Ticket #4648: 4648_4.patch
File 4648_4.patch, 14.0 KB (added by , 13 years ago) |
---|
-
_source/core/config.js
243 243 * @type String 244 244 * @example 245 245 */ 246 plugins : 'about,a11yhelp,basicstyles,blockquote,button,clipboard,colorbutton,colordialog,contextmenu,div,elementspath,enterkey,entities,filebrowser,find,flash,font,format,forms,horizontalrule,htmldataprocessor,i mage,indent,justify,keystrokes,link,list,liststyle,maximize,newpage,pagebreak,pastefromword,pastetext,popup,preview,print,removeformat,resize,save,scayt,smiley,showblocks,showborders,sourcearea,stylescombo,table,tabletools,specialchar,tab,templates,toolbar,undo,wysiwygarea,wsc',246 plugins : 'about,a11yhelp,basicstyles,blockquote,button,clipboard,colorbutton,colordialog,contextmenu,div,elementspath,enterkey,entities,filebrowser,find,flash,font,format,forms,horizontalrule,htmldataprocessor,iframe,image,indent,justify,keystrokes,link,list,liststyle,maximize,newpage,pagebreak,pastefromword,pastetext,popup,preview,print,removeformat,resize,save,scayt,smiley,showblocks,showborders,sourcearea,stylescombo,table,tabletools,specialchar,tab,templates,toolbar,undo,wysiwygarea,wsc', 247 247 248 248 /** 249 249 * List of additional plugins to be loaded. This is a tool setting which -
_source/lang/en.js
611 611 remove : 'Remove Div' 612 612 }, 613 613 614 iframe : 615 { 616 title : 'Iframe Properties', 617 toolbar : 'Iframe', 618 height : 'Height', 619 width : 'Width', 620 invalidHeight : 'Iframe height must be a number.', 621 invalidWidth : 'Iframe width must be a number.', 622 noUrl : 'Please type the iframe URL', 623 scrolling : 'Enable scrollbars', 624 border : 'Show frame border' 625 }, 626 614 627 font : 615 628 { 616 629 label : 'Font', -
_source/plugins/iframe/dialogs/iframe.js
1 /* 2 Copyright (c) 2003-2010, CKSource - Frederico Knabben. All rights reserved. 3 For licensing, see LICENSE.html or http://ckeditor.com/license 4 */ 5 6 (function() 7 { 8 // Map 'true' and 'false' values to match W3C's specifications 9 // http://www.w3.org/TR/REC-html40/present/frames.html#h-16.5 10 var checkboxValues = 11 { 12 scrolling : { 'true' : 'yes', 'false' : 'no' }, 13 frameborder : { 'true' : '1', 'false' : '0' } 14 }; 15 16 function loadValue( iframeNode ) 17 { 18 var isCheckbox = this instanceof CKEDITOR.ui.dialog.checkbox; 19 if ( iframeNode.hasAttribute( this.id ) ) 20 { 21 var value = iframeNode.getAttribute( this.id ); 22 if ( isCheckbox ) 23 this.setValue( checkboxValues[this.id]['true'] == value.toLowerCase() ); 24 else 25 this.setValue( value ); 26 } 27 } 28 29 function commitValue( iframeNode ) 30 { 31 var isRemove = this.getValue() === '', 32 isCheckbox = this instanceof CKEDITOR.ui.dialog.checkbox, 33 value = this.getValue(); 34 if ( isRemove ) 35 iframeNode.removeAttribute( this.id ); 36 else if ( isCheckbox ) 37 iframeNode.setAttribute( this.id, checkboxValues[this.id][value] ); 38 else 39 iframeNode.setAttribute( this.id, value ); 40 } 41 42 CKEDITOR.dialog.add( 'iframe', function( editor ) 43 { 44 var iframeLang = editor.lang.iframe, 45 commonLang = editor.lang.common; 46 return { 47 title : iframeLang.title, 48 minWidth : 300, 49 minHeight : 260, 50 onShow : function() 51 { 52 // Clear previously saved elements. 53 this.fakeImage = this.iframeNode = null; 54 55 var fakeImage = this.getSelectedElement(); 56 if ( fakeImage && fakeImage.getAttribute( '_cke_real_element_type' ) && fakeImage.getAttribute( '_cke_real_element_type' ) == 'iframe' ) 57 { 58 this.fakeImage = fakeImage; 59 60 var iframeNode = editor.restoreRealElement( fakeImage ); 61 this.iframeNode = iframeNode; 62 63 this.setupContent( iframeNode, fakeImage ); 64 } 65 }, 66 onOk : function() 67 { 68 var iframeNode; 69 if ( !this.fakeImage ) 70 iframeNode = new CKEDITOR.dom.element( 'iframe' ); 71 else 72 iframeNode = this.iframeNode; 73 74 // A subset of the specified attributes/styles 75 // should also be applied on the fake element to 76 // have better visual effect. (#5240) 77 var extraStyles = {}, extraAttributes = {}; 78 this.commitContent( iframeNode, extraStyles, extraAttributes ); 79 80 // Refresh the fake image. 81 var newFakeImage = editor.createFakeElement( iframeNode, 'cke_iframe', 'iframe', true ); 82 newFakeImage.setAttributes( extraAttributes ); 83 newFakeImage.setStyles( extraStyles ); 84 if ( this.fakeImage ) 85 { 86 newFakeImage.replace( this.fakeImage ); 87 editor.getSelection().selectElement( newFakeImage ); 88 } 89 else 90 editor.insertElement( newFakeImage ); 91 }, 92 contents : [ 93 { 94 id : 'info', 95 label : commonLang.generalTab, 96 accessKey : 'I', 97 elements : 98 [ 99 { 100 type : 'vbox', 101 padding : 0, 102 children : 103 [ 104 { 105 id : 'src', 106 type : 'text', 107 label : commonLang.url, 108 required : true, 109 validate : CKEDITOR.dialog.validate.notEmpty( iframeLang.noUrl ), 110 setup : loadValue, 111 commit : commitValue 112 } 113 ] 114 }, 115 { 116 type : 'hbox', 117 widths : [ '25%', '25%' ], 118 children : 119 [ 120 { 121 id : 'width', 122 type : 'text', 123 style : 'width:80px', 124 labelLayout : 'vertical', 125 label : iframeLang.width, 126 validate : CKEDITOR.dialog.validate.integer( iframeLang.invalidWidth ), 127 setup : function( iframeNode, fakeImage ) 128 { 129 loadValue.apply( this, arguments ); 130 if ( fakeImage ) 131 { 132 var fakeImageWidth = parseInt( fakeImage.$.style.width, 10 ); 133 if ( !isNaN( fakeImageWidth ) ) 134 this.setValue( fakeImageWidth ); 135 } 136 }, 137 commit : function( iframeNode, extraStyles ) 138 { 139 commitValue.apply( this, arguments ); 140 if ( this.getValue() ) 141 extraStyles.width = this.getValue() + 'px'; 142 } 143 }, 144 { 145 id : 'height', 146 type : 'text', 147 style : 'width:80px', 148 labelLayout : 'vertical', 149 label : iframeLang.height, 150 validate : CKEDITOR.dialog.validate.integer( iframeLang.invalidHeight ), 151 setup : function( iframeNode, fakeImage ) 152 { 153 loadValue.apply( this, arguments ); 154 if ( fakeImage ) 155 { 156 var fakeImageHeight = parseInt( fakeImage.$.style.height, 10 ); 157 if ( !isNaN( fakeImageHeight ) ) 158 this.setValue( fakeImageHeight ); 159 } 160 }, 161 commit : function( iframeNode, extraStyles ) 162 { 163 commitValue.apply( this, arguments ); 164 if ( this.getValue() ) 165 extraStyles.height = this.getValue() + 'px'; 166 } 167 } 168 ] 169 }, 170 { 171 type : 'hbox', 172 widths : [ '50%', '50%' ], 173 children : 174 [ 175 { 176 id : 'scrolling', 177 type : 'checkbox', 178 label : iframeLang.scrolling, 179 setup : loadValue, 180 commit : commitValue 181 }, 182 { 183 id : 'frameborder', 184 type : 'checkbox', 185 label : iframeLang.border, 186 setup : loadValue, 187 commit : commitValue 188 } 189 ] 190 }, 191 { 192 type : 'hbox', 193 widths : [ '45%', '55%' ], 194 children : 195 [ 196 { 197 id : 'id', 198 type : 'text', 199 label : commonLang.id, 200 setup : loadValue, 201 commit : commitValue 202 }, 203 { 204 id : 'title', 205 type : 'text', 206 label : commonLang.advisoryTitle, 207 setup : loadValue, 208 commit : commitValue 209 } 210 ] 211 }, 212 { 213 type : 'hbox', 214 widths : [ '45%', '55%' ], 215 children : 216 [ 217 { 218 id : 'class', 219 type : 'text', 220 label : commonLang.cssClass, 221 setup : loadValue, 222 commit : commitValue 223 } 224 ] 225 }, 226 { 227 id : 'style', 228 type : 'text', 229 label : commonLang.cssStyle, 230 setup : loadValue, 231 commit : commitValue 232 } 233 ] 234 } 235 ] 236 }; 237 }); 238 })(); -
_source/plugins/iframe/plugin.js
1 /* 2 Copyright (c) 2003-2010, CKSource - Frederico Knabben. All rights reserved. 3 For licensing, see LICENSE.html or http://ckeditor.com/license 4 */ 5 6 (function() 7 { 8 function createFakeElement( editor, realElement ) 9 { 10 var fakeElement = editor.createFakeParserElement( realElement, 'cke_iframe', 'iframe', true ), 11 fakeStyle = fakeElement.attributes.style || ''; 12 13 var width = realElement.attributes.width, 14 height = realElement.attributes.height; 15 16 if ( typeof width != 'undefined' ) 17 fakeStyle += 'width:' + CKEDITOR.tools.cssLength( width ) + ';'; 18 19 if ( typeof height != 'undefined' ) 20 fakeStyle += 'height:' + CKEDITOR.tools.cssLength( height ) + ';'; 21 22 fakeElement.attributes.style = fakeStyle; 23 24 return fakeElement; 25 } 26 27 CKEDITOR.plugins.add( 'iframe', 28 { 29 requires : [ 'dialog', 'fakeobjects' ], 30 init : function( editor ) 31 { 32 var pluginName = 'iframe', 33 lang = editor.lang.iframe; 34 35 CKEDITOR.dialog.add( pluginName, this.path + 'dialogs/iframe.js' ); 36 editor.addCommand( pluginName, new CKEDITOR.dialogCommand( pluginName ) ); 37 38 editor.addCss( 39 'img.cke_iframe' + 40 '{' + 41 'background-image: url(' + CKEDITOR.getUrl( this.path + 'images/placeholder.png' ) + ');' + 42 'background-position: center center;' + 43 'background-repeat: no-repeat;' + 44 'border: 1px solid #a9a9a9;' + 45 'width: 80px;' + 46 'height: 80px;' + 47 '}' 48 ); 49 50 editor.ui.addButton( 'Iframe', 51 { 52 label : lang.toolbar, 53 command : pluginName 54 }); 55 56 editor.on( 'doubleclick', function( evt ) 57 { 58 var element = evt.data.element; 59 if ( element.is( 'img' ) && element.getAttribute( '_cke_real_element_type' ) == 'iframe' ) 60 evt.data.dialog = 'iframe'; 61 }); 62 63 if ( editor.addMenuItems ) 64 { 65 editor.addMenuItems( 66 { 67 iframe : 68 { 69 label : lang.title, 70 command : 'iframe', 71 group : 'image' 72 } 73 }); 74 } 75 76 // If the "contextmenu" plugin is loaded, register the listeners. 77 if ( editor.contextMenu ) 78 { 79 editor.contextMenu.addListener( function( element, selection ) 80 { 81 if ( element && element.is( 'img' ) && element.getAttribute( '_cke_real_element_type' ) == 'iframe' ) 82 return { iframe : CKEDITOR.TRISTATE_OFF }; 83 }); 84 } 85 }, 86 afterInit : function( editor ) 87 { 88 var dataProcessor = editor.dataProcessor, 89 dataFilter = dataProcessor && dataProcessor.dataFilter; 90 91 if ( dataFilter ) 92 { 93 dataFilter.addRules( 94 { 95 elements : 96 { 97 iframe : function( element ) 98 { 99 return createFakeElement( editor, element ); 100 } 101 } 102 }); 103 } 104 } 105 }); 106 })(); -
_source/plugins/toolbar/plugin.js
416 416 * ['NumberedList','BulletedList','-','Outdent','Indent','Blockquote','CreateDiv'], 417 417 * ['JustifyLeft','JustifyCenter','JustifyRight','JustifyBlock'], 418 418 * ['Link','Unlink','Anchor'], 419 * ['Image','Flash','Table','HorizontalRule','Smiley','SpecialChar','PageBreak' ],419 * ['Image','Flash','Table','HorizontalRule','Smiley','SpecialChar','PageBreak','Iframe'], 420 420 * '/', 421 421 * ['Styles','Format','Font','FontSize'], 422 422 * ['TextColor','BGColor'], … … 434 434 ['NumberedList','BulletedList','-','Outdent','Indent','Blockquote','CreateDiv'], 435 435 ['JustifyLeft','JustifyCenter','JustifyRight','JustifyBlock'], 436 436 ['Link','Unlink','Anchor'], 437 ['Image','Flash','Table','HorizontalRule','Smiley','SpecialChar','PageBreak' ],437 ['Image','Flash','Table','HorizontalRule','Smiley','SpecialChar','PageBreak','Iframe'], 438 438 '/', 439 439 ['Styles','Format','Font','FontSize'], 440 440 ['TextColor','BGColor'], -
_source/skins/kama/icons.css
320 320 { 321 321 background-position: 0 -1040px; 322 322 } 323 .cke_skin_office2003 .cke_button_editdiv .cke_icon 323 324 .cke_skin_kama .cke_button_iframe .cke_icon 324 325 { 325 background-position: 0 -1 184px;326 background-position: 0 -1216px; 326 327 } -
_source/skins/office2003/icons.css
322 322 { 323 323 background-position: 0 -1200px; 324 324 } 325 .cke_skin_office2003 .cke_button_iframe .cke_icon 326 { 327 background-position: 0 -1216px; 328 } 329 -
_source/skins/v2/icons.css
322 322 { 323 323 background-position: 0 -1200px; 324 324 } 325 326 .cke_skin_v2 .cke_button_iframe .cke_icon 327 { 328 background-position: 0 -1216px; 329 }