Skip to content
Snippets Groups Projects
Commit da3d7797 authored by dczepierga's avatar dczepierga
Browse files

[#1847662] by dczepierga: Add support for CKEditor v4 - fix MediaEmbed plugin

parent c3ff1290
No related branches found
No related tags found
No related merge requests found
......@@ -4,6 +4,13 @@ For licensing, see LICENSE.html or http://ckeditor.com/license
*/
CKEDITOR.dialog.add( 'mediaembedDialog', function( editor ) {
var numberRegex = /^\d+(?:\.\d+)?$/;
var cssifyLength = function( length )
{
if ( numberRegex.test( length ) )
return length + 'px';
return length;
}
return {
title : Drupal.t('Embed Media Dialog'),
minWidth : 400,
......
......@@ -7,6 +7,13 @@ For licensing, see LICENSE.html or http://ckeditor.com/license
* @file Plugin for inserting Drupal embeded media
*/
( function() {
var numberRegex = /^\d+(?:\.\d+)?$/;
var cssifyLength = function( length )
{
if ( numberRegex.test( length ) )
return length + 'px';
return length;
}
CKEDITOR.plugins.add( 'mediaembed',
{
requires : [ 'dialog', 'fakeobjects', 'htmlwriter' ],
......@@ -100,11 +107,4 @@ For licensing, see LICENSE.html or http://ckeditor.com/license
}
}
} );
var numberRegex = /^\d+(?:\.\d+)?$/;
function cssifyLength( length )
{
if ( numberRegex.test( length ) )
return length + 'px';
return length;
}
} )();
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment