Ticket #4252: 4252_3.patch
File 4252_3.patch, 9.4 KB (added by , 15 years ago) |
---|
-
_source/core/ui.js
75 75 if ( command ) 76 76 command.uiItems.push( result ); 77 77 78 // Replace the registered items with created instances. 79 this._.items[ name ] = result; 80 78 81 return result; 79 82 }, 80 83 -
_source/plugins/richcombo/plugin.js
273 273 me.setState( CKEDITOR.TRISTATE_OFF ); 274 274 }; 275 275 276 panel.on( 'showBlock', function() 277 { 278 this.fire( 'open', panel ); 279 }, this ); 280 276 281 if ( this.init ) 277 282 this.init(); 278 283 }, … … 351 356 } 352 357 }); 353 358 359 CKEDITOR.event.implementOn( CKEDITOR.ui.richCombo.prototype, true ); 354 360 CKEDITOR.ui.prototype.addRichCombo = function( name, definition ) 355 361 { 356 362 this.add( name, CKEDITOR.UI_RICHCOMBO, definition ); -
_source/plugins/menu/plugin.js
151 151 }, 152 152 this ); 153 153 154 panel.on( 'showBlock', function() 155 { 156 this.fire( 'open', panel ); 157 }, this ); 158 159 154 160 // Create an autosize block inside the panel. 155 161 var block = panel.addBlock( this.id ); 156 162 block.autoSize = true; … … 241 247 } 242 248 }); 243 249 250 CKEDITOR.event.implementOn( CKEDITOR.menu.prototype, true ); 251 244 252 function sortItems( items ) 245 253 { 246 254 items.sort( function( itemA, itemB ) -
_source/plugins/floatpanel/plugin.js
217 217 if ( panel.isLoaded ) 218 218 setHeight(); 219 219 else 220 panel.on Load = setHeight;220 panel.on( 'load', setHeight ); 221 221 } 222 222 else 223 element.getFirst().removeStyle( 'height');223 element.getFirst().removeStyle('height'); 224 224 225 panel.isLoaded ? 226 this.fire( 'showBlock', block ) 227 : panel.on( 'load', function( evt ) 228 { 229 evt.removeListener(); 230 this.fire( 'showBlock', block ); 231 }, this ); 232 225 233 // Set the IFrame focus, so the blur event gets fired. 226 234 CKEDITOR.tools.setTimeout( function() 227 235 { … … 322 330 } 323 331 } 324 332 }); 333 334 CKEDITOR.event.implementOn( CKEDITOR.ui.floatPanel.prototype, true ); 335 325 336 })(); -
_source/plugins/dialog/plugin.js
2680 2680 var storedDialogs = this._.storedDialogs || 2681 2681 ( this._.storedDialogs = {} ); 2682 2682 2683 var dialog = storedDialogs[ dialogName ] || 2684 ( storedDialogs[ dialogName ] = new CKEDITOR.dialog( this, dialogName ) ); 2685 2683 var dialog = storedDialogs[ dialogName ]; 2684 if( !dialog ) 2685 { 2686 dialog = ( storedDialogs[ dialogName ] = new CKEDITOR.dialog( this, dialogName ) ); 2687 dialog.on( 'show', function() 2688 { 2689 this.fire( 'dialogOpen', dialog ); 2690 }, this ); 2691 } 2686 2692 dialog.show(); 2687 2693 2688 2694 return dialog; -
_source/plugins/toolbar/plugin.js
193 193 } 194 194 195 195 var itemObj = item.render( editor, output ); 196 item.toolbarItem = itemObj; 196 197 index = toolbarObj.items.push( itemObj ) - 1; 197 198 198 199 if ( index > 0 ) -
_source/plugins/panelbutton/plugin.js
133 133 _.on = 0; 134 134 me.setState( CKEDITOR.TRISTATE_OFF ); 135 135 }; 136 panel.on( 'showBlock', function() 137 { 138 this.fire( 'open', panel ); 139 }, this ); 136 140 } 137 141 } 138 142 }); 139 143 144 CKEDITOR.event.implementOn( CKEDITOR.ui.panelButton.prototype, true ); 145 140 146 })(); -
_source/core/test.js
68 68 } 69 69 70 70 sel.selectRanges( ranges ); 71 } 72 71 }, 72 73 toolbar : 74 { 75 /** 76 * Click on a specific toolbar button and the {@param callback} will be 77 * fed with the consequential UI object which has been opened by this click. 78 * 79 * @param itemName The toolbar item definition name. 80 * @callback The callback function which is called after the affiliate 81 * button behavior has completed. 82 * @example 83 * 84 * // Click on 'Format' combo. 85 * CKEDITOR.test.toolbar.clickButton( 'Format' , 86 * function( combo ) 87 * { 88 * alert( combo instanceof CKEDITOR.ui.richCombo ); // true 89 * }); 90 * 91 * // Click on 'Image' dialog. 92 * CKEDITOR.test.toolbar.clickButton( 'Image' , 93 * function( dialog ) 94 * { 95 * alert( dialog instanceof CKEDITOR.dialog ); // true 96 * }); 97 */ 98 clickButton : function( editor, itemName, callback, context ) 99 { 100 var ui = editor.ui, 101 // Find the corresponding ui instances of the toolbar item. 102 uiItems = ui._.items, 103 uiItem =uiItems[ itemName ], 104 // Back reference the toolbar item instance. 105 toolbarItem = uiItem.toolbarItem, 106 // Find the command instance registered on this ui item. 107 command = editor.getCommand( uiItem.command ); 108 109 // Special treatments for different types of button. 110 if( uiItem instanceof CKEDITOR.ui.button ) 111 { 112 // button of style command. 113 if( command && command.style ) 114 { 115 editor.on( 'selectionChange', function( evt ) 116 { 117 evt.removeListener(); 118 callback.call( context ); 119 }, null, null, 1000 ); 120 } 121 // button of dialog command. 122 if( command && command.dialogName ) 123 { 124 editor.on( 'dialogOpen', function( evt ) 125 { 126 evt.removeListener(); 127 callback.call( context, evt.data ); 128 }, null, null, 1000 ); 129 } 130 // button of panel. 131 else if( uiItem instanceof CKEDITOR.ui.panelButton ) 132 { 133 uiItem.on( 'open', function( evt ) 134 { 135 evt.removeListener(); 136 callback.call( context, uiItem ); 137 }, null, 1000 ); 138 } 139 // Trigger button. 140 toolbarItem.execute(); 141 } 142 else if( uiItem instanceof CKEDITOR.ui.richCombo ) 143 { 144 uiItem.on( 'open', function( evt ) 145 { 146 evt.removeListener(); 147 callback.call( context, uiItem ); 148 }, null, 1000 ); 149 150 // Trigger combo. 151 var comboEntry = YAHOO.util.Selector.query( 'a', toolbarItem.id, true ); 152 comboEntry.onclick(); 153 } 154 } 155 156 }, 157 158 dialog : 159 { 160 /** 161 * Filling the assigned dialog with a specified set of field values and finally close it. 162 * @param dialog {CKEDITOR.dialog} The dialog instance to populate. 163 * @param profile {Object} The page - field - value map to be filled into the dialog. 164 * @example 165 * CKEDITOR.test.dialog.fill( imageDialog, 166 * { 167 * info : 168 * { 169 * txtUrl : 'http://ckeditor.com/logos.gif' 170 * }, 171 * Link : 172 * { 173 * txtUrl : 'http://ckeditor.com' 174 * }, 175 * advanced : 176 * { 177 * linkId : 'link_id1', 178 * txtGenClass : 'cls' 179 * } 180 * } ); 181 * 182 */ 183 fill : function ( dialog, profile ) 184 { 185 var field, page; 186 for( var pageName in profile ) 187 { 188 // Activate the page. 189 dialog.selectPage( pageName ); 190 191 page = profile[ pageName ]; 192 for( var fieldId in page ) 193 { 194 field = dialog.getContentElement( pageName, fieldId ); 195 // Populate the field. 196 field.setValue( page[ fieldId ] ); 197 } 198 } 199 dialog.click( 'ok' ); 200 } 201 202 }, 203 204 editor : 205 { 206 loadDataWithSelection : function( editor, data ) 207 { 208 var docBody = editor.document.getBody(); 209 CKEDITOR.test.setHtmlWithSelection( docBody, data ); 210 } 211 } 73 212 }; 74 213 YAHOO.lang.augmentObject( CKEDITOR.test, CKTESTER.tools ); -
_source/plugins/panel/plugin.js
141 141 if ( CKEDITOR.env.isCustomDomain() ) 142 142 doc.$.domain = document.domain; 143 143 144 var onLoad = CKEDITOR.tools.addFunction( CKEDITOR.tools.bind( function( ev)144 var onLoad = CKEDITOR.tools.addFunction( CKEDITOR.tools.bind( function() 145 145 { 146 146 this.isLoaded = true; 147 if ( this.onLoad )148 this.onLoad(); 147 this.fire( 'load', this ); 148 149 149 }, this ) ); 150 150 151 151 doc.$.write( … … 233 233 } 234 234 }; 235 235 236 CKEDITOR.event.implementOn( CKEDITOR.ui.panel.prototype, true ); 236 237 CKEDITOR.ui.panel.block = CKEDITOR.tools.createClass( 237 238 { 238 239 $ : function( blockHolder )