JasonWoof Got questions, comments, patches, etc.? Contact Jason Woofenden
vanilla ckeditor-3.6
[ckeditor.git] / _source / plugins / image / dialogs / image.js
index c604ebd..3833e03 100644 (file)
@@ -115,6 +115,9 @@ For licensing, see LICENSE.html or http://ckeditor.com/license
 \r
                var switchLockRatio = function( dialog, value )\r
                {\r
+                       if ( !dialog.getContentElement( 'info', 'ratioLock' ) )\r
+                               return null;\r
+\r
                        var oImageOriginal = dialog.originalElement;\r
 \r
                        // Dialog may already closed. (#5505)\r
@@ -169,8 +172,10 @@ For licensing, see LICENSE.html or http://ckeditor.com/license
                        var oImageOriginal = dialog.originalElement;\r
                        if ( oImageOriginal.getCustomData( 'isReady' ) == 'true' )\r
                        {\r
-                               dialog.setValueOf( 'info', 'txtWidth', oImageOriginal.$.width );\r
-                               dialog.setValueOf( 'info', 'txtHeight', oImageOriginal.$.height );\r
+                               var widthField = dialog.getContentElement( 'info', 'txtWidth' ),\r
+                                       heightField = dialog.getContentElement( 'info', 'txtHeight' );\r
+                               widthField && widthField.setValue( oImageOriginal.$.width );\r
+                               heightField && heightField.setValue( oImageOriginal.$.height );\r
                        }\r
                        updatePreview( dialog );\r
                };\r
@@ -451,8 +456,12 @@ For licensing, see LICENSE.html or http://ckeditor.com/license
                                if ( dialogType != 'image' )\r
                                        this.hidePage( 'Link' );                //Hide Link tab.\r
                                var doc = this._.element.getDocument();\r
-                               this.addFocusable( doc.getById( btnResetSizeId ), 5 );\r
-                               this.addFocusable( doc.getById( btnLockSizesId ), 5 );\r
+\r
+                               if ( this.getContentElement( 'info', 'ratioLock' ) )\r
+                               {\r
+                                       this.addFocusable( doc.getById( btnResetSizeId ), 5 );\r
+                                       this.addFocusable( doc.getById( btnLockSizesId ), 5 );\r
+                               }\r
 \r
                                this.commitContent = commitContent;\r
                        },\r
@@ -612,6 +621,7 @@ For licensing, see LICENSE.html or http://ckeditor.com/license
                                                        children :\r
                                                        [\r
                                                                {\r
+                                                                       id : 'basic',\r
                                                                        type : 'vbox',\r
                                                                        children :\r
                                                                        [\r
@@ -728,6 +738,7 @@ For licensing, see LICENSE.html or http://ckeditor.com/license
                                                                                                        ]\r
                                                                                                },\r
                                                                                                {\r
+                                                                                                       id : 'ratioLock',\r
                                                                                                        type : 'html',\r
                                                                                                        style : 'margin-top:30px;width:40px;height:40px;',\r
                                                                                                        onLoad : function()\r
@@ -1059,6 +1070,7 @@ For licensing, see LICENSE.html or http://ckeditor.com/license
                                                                        [\r
                                                                                {\r
                                                                                        type : 'html',\r
+                                                                                       id : 'htmlPreview',\r
                                                                                        style : 'width:95%;',\r
                                                                                        html : '<div>' + CKEDITOR.tools.htmlEncode( editor.lang.common.preview ) +'<br>'+\r
                                                                                        '<div id="' + imagePreviewLoaderId + '" class="ImagePreviewLoader" style="display:none"><div class="loading">&nbsp;</div></div>'+\r