Navigation Menu

Skip to content

Commit

Permalink
Merge branch 't/11910'
Browse files Browse the repository at this point in the history
  • Loading branch information
oleq committed Jun 16, 2014
2 parents a2facd8 + 00ec25b commit 8eb72d1
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGES.md
Expand Up @@ -32,6 +32,7 @@ Fixed Issues:
* [#11947](http://dev.ckeditor.com/ticket/11947): [FF+IE11] Fixed: Shift+Enter in lists produces two line breaks.
* [#11972](http://dev.ckeditor.com/ticket/11972): Fixed: Feature detection in the [`element.setText()`](http://docs.ckeditor.com/#!/api/CKEDITOR.dom.element-method-setText) method should not trigger layout engine.
* [#7634](http://dev.ckeditor.com/ticket/7634): Fixed: Flash plugin omits `allowFullScreen` parameter in editor data if set `true`.
* [#11910](http://dev.ckeditor.com/ticket/11910): Fixed: [Enhanced Image](http://ckeditor.com/addon/image2) does not consider `config.baseHref` when updating image dimensions.

## CKEditor 4.4.1

Expand Down
8 changes: 6 additions & 2 deletions plugins/image2/dialogs/image2.js
Expand Up @@ -38,6 +38,9 @@ CKEDITOR.dialog.add( 'image2', function( editor ) {

helpers = CKEDITOR.plugins.image2,

// Editor instance configuration.
config = editor.config,

// Content restrictions defined by the widget which
// impact on dialog structure and presence of fields.
features = editor.widgets.registered.image.features,
Expand Down Expand Up @@ -118,7 +121,8 @@ CKEDITOR.dialog.add( 'image2', function( editor ) {
callback( null );
} );

image.setAttribute( 'src', src + '?' + Math.random().toString( 16 ).substring( 2 ) );
image.setAttribute( 'src',
( config.baseHref || '' ) + src + '?' + Math.random().toString( 16 ).substring( 2 ) );
};
}

Expand Down Expand Up @@ -338,7 +342,7 @@ CKEDITOR.dialog.add( 'image2', function( editor ) {
heightField[ method ]();
}

var hasFileBrowser = !!( editor.config.filebrowserImageBrowseUrl || editor.config.filebrowserBrowseUrl ),
var hasFileBrowser = !!( config.filebrowserImageBrowseUrl || config.filebrowserBrowseUrl ),
srcBoxChildren = [
{
id: 'src',
Expand Down
12 changes: 12 additions & 0 deletions plugins/wysiwygarea/plugin.js
Expand Up @@ -136,6 +136,8 @@
script && script.parentNode.removeChild( script );
script = doc.getElementById( 'cke_shimscrpt' );
script && script.parentNode.removeChild( script );
script = doc.getElementById( 'cke_basetagscrpt' );
script && script.parentNode.removeChild( script );

if ( CKEDITOR.env.gecko ) {
// Force Gecko to change contentEditable from false to true on domReady
Expand Down Expand Up @@ -475,6 +477,16 @@
'</script>';
}

// IE<10 needs this hack to properly enable <base href="...">.
// See: http://stackoverflow.com/a/13373180/1485219 (#11910).
if ( baseTag && CKEDITOR.env.ie && CKEDITOR.env.version < 10 ) {
bootstrapCode +=
'<script id="cke_basetagscrpt">' +
'var baseTag = document.querySelector( "base" );' +
'baseTag.href = baseTag.href;' +
'</script>'
}

data = data.replace( /(?=\s*<\/(:?head)>)/, bootstrapCode );

// Current DOM will be deconstructed by document.write, cleanup required.
Expand Down

0 comments on commit 8eb72d1

Please sign in to comment.