Ticket #6189: 6189_2.patch
File 6189_2.patch, 114.7 KB (added by , 14 years ago) |
---|
-
_source/plugins/a11yhelp/dialogs/a11yhelp.js
6 6 CKEDITOR.dialog.add( 'a11yHelp', function( editor ) 7 7 { 8 8 var lang = editor.lang.accessibilityHelp, 9 id = CKEDITOR.tools.getNext Number();9 id = CKEDITOR.tools.getNextId(); 10 10 11 11 // CharCode <-> KeyChar. 12 12 var keyMap = … … 125 125 // Create the help list directly from lang file entries. 126 126 function buildHelpContents() 127 127 { 128 var pageTpl = '<div class="cke_accessibility_legend" role="document" aria-labelledby=" cke_' + id + '_arialbl" tabIndex="-1">%1</div>' +129 '<span id=" cke_' + id + '_arialbl" class="cke_voice_label">' + lang.contents + ' </span>',128 var pageTpl = '<div class="cke_accessibility_legend" role="document" aria-labelledby="' + id + '_arialbl" tabIndex="-1">%1</div>' + 129 '<span id="' + id + '_arialbl" class="cke_voice_label">' + lang.contents + ' </span>', 130 130 sectionTpl = '<h1>%1</h1><dl>%2</dl>', 131 131 itemTpl = '<dt>%1</dt><dd>%2</dd>'; 132 132 -
_source/plugins/basicstyles/plugin.js
29 29 }); 30 30 }; 31 31 32 var config = editor.config ;33 varlang = editor.lang;32 var config = editor.config, 33 lang = editor.lang; 34 34 35 addButtonCommand( 'Bold' , lang.bold 35 addButtonCommand( 'Bold' , lang.bold , 'bold' , config.coreStyles_bold ); 36 36 addButtonCommand( 'Italic' , lang.italic , 'italic' , config.coreStyles_italic ); 37 addButtonCommand( 'Underline' , lang.underline , 'underline' , config.coreStyles_underline );37 addButtonCommand( 'Underline' , lang.underline , 'underline' , config.coreStyles_underline ); 38 38 addButtonCommand( 'Strike' , lang.strike , 'strike' , config.coreStyles_strike ); 39 addButtonCommand( 'Subscript' , lang.subscript , 'subscript' , config.coreStyles_subscript );40 addButtonCommand( 'Superscript' , lang.superscript , 'superscript' , config.coreStyles_superscript );39 addButtonCommand( 'Subscript' , lang.subscript , 'subscript' , config.coreStyles_subscript ); 40 addButtonCommand( 'Superscript' , lang.superscript , 'superscript' , config.coreStyles_superscript ); 41 41 } 42 42 }); 43 43 -
_source/plugins/bidi/plugin.js
5 5 6 6 (function() 7 7 { 8 var guardElements = { table:1, ul:1, ol:1, blockquote:1, div:1 } ;9 vardirectSelectionGuardElements = {};8 var guardElements = { table:1, ul:1, ol:1, blockquote:1, div:1 }, 9 directSelectionGuardElements = {}; 10 10 CKEDITOR.tools.extend( directSelectionGuardElements, guardElements, { tr:1, p:1, div:1, li:1 } ); 11 11 12 12 function onSelectionChange( evt ) -
_source/plugins/button/plugin.js
70 70 render : function( editor, output ) 71 71 { 72 72 var env = CKEDITOR.env, 73 id = this._.id = 'cke_' + CKEDITOR.tools.getNextNumber(),73 id = this._.id = CKEDITOR.tools.getNextId(), 74 74 classes = '', 75 75 command = this.command, // Get the command name. 76 76 clickFn, -
_source/plugins/clipboard/dialogs/paste.js
10 10 11 11 function onPasteFrameLoad( win ) 12 12 { 13 var doc = 13 var doc = new CKEDITOR.dom.document( win.document ), 14 14 docElement = doc.$; 15 15 16 doc.getById( "cke_actscrpt").remove();16 doc.getById( 'cke_actscrpt' ).remove(); 17 17 18 18 CKEDITOR.env.ie ? 19 19 docElement.body.contentEditable = "true" : -
_source/plugins/clipboard/plugin.js
16 16 var doc = editor.document, 17 17 body = doc.getBody(); 18 18 19 var enabled = false;19 var enabled = 0; 20 20 var onExec = function() 21 21 { 22 enabled = true;22 enabled = 1; 23 23 }; 24 24 25 25 // The following seems to be the only reliable way to detect that … … 168 168 return; 169 169 170 170 // If the browser supports it, get the data directly 171 if ( mode == 'text' && evt.data && evt.data.$.clipboardData)171 if ( mode == 'text' && evt.data && evt.data.$.clipboardData ) 172 172 { 173 173 // evt.data.$.clipboardData.types contains all the flavours in Mac's Safari, but not on windows. 174 174 var plain = evt.data.$.clipboardData.getData( 'text/plain' ); 175 if ( plain)175 if ( plain ) 176 176 { 177 177 evt.data.preventDefault(); 178 178 callback( plain ); … … 254 254 // Cutting off control type element in IE standards breaks the selection entirely. (#4881) 255 255 function fixCut( editor ) 256 256 { 257 if ( !CKEDITOR.env.ie || editor.document.$.compatMode == 'BackCompat')257 if ( !CKEDITOR.env.ie || CKEDITOR.env.quirks ) 258 258 return; 259 259 260 260 var sel = editor.getSelection(); … … 348 348 editor.on( 'contentDom', function() 349 349 { 350 350 var body = editor.document.getBody(); 351 body.on( ( (mode == 'text' && CKEDITOR.env.ie ) || CKEDITOR.env.webkit ) ? 'paste' : 'beforepaste',351 body.on( ( (mode == 'text' && CKEDITOR.env.ie ) || CKEDITOR.env.webkit ) ? 'paste' : 'beforepaste', 352 352 function( evt ) 353 353 { 354 354 if ( depressBeforeEvent ) -
_source/plugins/colorbutton/plugin.js
161 161 } 162 162 163 163 // Render the "More Colors" button. 164 if ( config.colorButton_enableMore )164 if ( config.colorButton_enableMore === undefined || config.colorButton_enableMore ) 165 165 { 166 166 output.push( 167 167 '</tr>' + … … 174 174 ' role="option" aria-posinset="', total, '" aria-setsize="', total, '">', 175 175 lang.more, 176 176 '</a>' + 177 '</td>' ); // Itis later in the code.177 '</td>' ); // tr is later in the code. 178 178 } 179 179 180 180 output.push( '</tr></table>' ); … … 191 191 * @example 192 192 * config.colorButton_enableMore = false; 193 193 */ 194 CKEDITOR.config.colorButton_enableMore = true;195 194 196 195 /** 197 196 * Defines the colors to be displayed in the color selectors. It's a string -
_source/plugins/colordialog/dialogs/colordialog.js
14 14 // Reference the dialog. 15 15 var dialog; 16 16 17 function spacer()17 var spacer = 18 18 { 19 return { 20 type : 'html', 21 html : ' ' 22 }; 23 } 19 type : 'html', 20 html : ' ' 21 }; 24 22 25 23 function clearSelected() 26 24 { … … 30 28 31 29 function updateSelected( evt ) 32 30 { 33 if ( ! ( evt instanceof CKEDITOR.dom.event ) )31 if ( ! ( evt instanceof CKEDITOR.dom.event ) ) 34 32 evt = new CKEDITOR.dom.event( evt ); 35 33 36 34 var target = evt.getTarget(), 37 35 color; 38 36 39 37 if ( target.getName() == 'a' && ( color = target.getChild( 0 ).getHtml() ) ) 40 38 dialog.getContentElement( 'picker', 'selectedColor' ).setValue( color ); … … 42 40 43 41 function updateHighlight( event ) 44 42 { 45 if ( ! ( event instanceof CKEDITOR.dom.event ) )43 if ( ! ( event instanceof CKEDITOR.dom.event ) ) 46 44 event = event.data; 47 45 48 46 var target = event.getTarget(), … … 61 59 $doc.getById( hicolorTextId ).setHtml( ' ' ); 62 60 } 63 61 64 var onMouseout = $tools.addFunction( clearHighlight ); 62 var onMouseout = $tools.addFunction( clearHighlight ), 63 onClick = updateSelected, 64 onClickHandler = CKEDITOR.tools.addFunction( onClick ), 65 onFocus = updateHighlight, 66 onBlur = clearHighlight; 65 67 66 var onClick = updateSelected,67 onClickHandler = CKEDITOR.tools.addFunction( onClick );68 69 var onFocus = updateHighlight,70 onBlur = clearHighlight;71 72 68 var onKeydownHandler = CKEDITOR.tools.addFunction( function( ev ) 73 69 { 74 70 ev = new CKEDITOR.dom.event( ev ); 75 71 var element = ev.getTarget(); 76 72 var relative, nodeToMove; 77 var keystroke = ev.getKeystroke() ;78 varrtl = editor.lang.dir == 'rtl';73 var keystroke = ev.getKeystroke(), 74 rtl = editor.lang.dir == 'rtl'; 79 75 80 76 switch ( keystroke ) 81 77 { … … 177 173 function createColorTable() 178 174 { 179 175 // Create the base colors array. 180 var aColors = [ '00','33','66','99','cc','ff'];176 var aColors = [ '00', '33', '66', '99', 'cc', 'ff' ]; 181 177 182 178 // This function combines two ranges of three values from the color array into a row. 183 179 function appendColorRow( rangeA, rangeB ) 184 180 { 185 181 for ( var i = rangeA ; i < rangeA + 3 ; i++ ) 186 182 { 187 var row = table.$.insertRow( -1);183 var row = table.$.insertRow( -1 ); 188 184 189 185 for ( var j = rangeB ; j < rangeB + 3 ; j++ ) 190 186 { … … 287 283 firstColor.focus(); 288 284 } 289 285 }, 290 spacer (),286 spacer, 291 287 { 292 288 type : 'vbox', 293 289 padding : 0, … … 320 316 } 321 317 } 322 318 }, 323 spacer (),319 spacer, 324 320 { 325 321 type : 'button', 326 322 id : 'clear', -
_source/plugins/contextmenu/plugin.js
25 25 { 26 26 $ : function( editor ) 27 27 { 28 this.id = 'cke_' + CKEDITOR.tools.getNextNumber();28 this.id = CKEDITOR.tools.getNextId(); 29 29 this.editor = editor; 30 30 this._.listeners = []; 31 31 this._.functionId = CKEDITOR.tools.addFunction( function( commandName ) -
_source/plugins/dialog/plugin.js
33 33 34 34 (function() 35 35 { 36 var cssLength = CKEDITOR.tools.cssLength; 36 37 function isTabVisible( tabId ) 37 38 { 38 39 return !!this._.tabs[ tabId ][ 0 ].$.offsetHeight; … … 501 502 page && this.addPage( page ); 502 503 } 503 504 504 this.parts[ 'tabs'].on( 'click', function( evt )505 this.parts[ 'tabs' ].on( 'click', function( evt ) 505 506 { 506 507 var target = evt.data.getTarget(); 507 508 // If we aren't inside a tab, bail out. … … 990 991 page.setAttribute( 'aria-hidden', i != id ); 991 992 } 992 993 993 var selected = this._.tabs[ id];994 selected[ 0].addClass( 'cke_dialog_tab_selected' );995 996 // [IE] a unvisible input[type='text'] will enlarge it's width997 // if it's value is long when it show ( #5649 )998 // so we clear it's value before it shows and then recover it994 var selected = this._.tabs[ id ]; 995 selected[ 0 ].addClass( 'cke_dialog_tab_selected' ); 996 997 // [IE] an invisible input[type='text'] will enlarge it's width 998 // if it's value is long when it shows, so we clear it's value 999 // before it shows and then recover it (#5649) 999 1000 if ( CKEDITOR.env.ie6Compat || CKEDITOR.env.ie7Compat ) 1000 1001 { 1001 clearOrRecoverTextInputValue( selected[ 1] );1002 selected[ 1].show();1002 clearOrRecoverTextInputValue( selected[ 1 ] ); 1003 selected[ 1 ].show(); 1003 1004 setTimeout( function() 1004 1005 { 1005 clearOrRecoverTextInputValue( selected[ 1], true);1006 clearOrRecoverTextInputValue( selected[ 1 ], 1 ); 1006 1007 }, 0 ); 1007 1008 } 1008 1009 else 1009 { 1010 selected[1].show(); 1011 } 1010 selected[ 1 ].show(); 1012 1011 1013 1014 1012 this._.currentTabId = id; 1015 1013 this._.currentTabIndex = CKEDITOR.tools.indexOf( this._.tabIdList, id ); 1016 1014 }, … … 1817 1815 function showCover( editor ) 1818 1816 { 1819 1817 var win = CKEDITOR.document.getWindow(); 1820 var backgroundColorStyle = editor.config.dialog_backgroundCoverColor || 'white', 1821 backgroundCoverOpacity = editor.config.dialog_backgroundCoverOpacity, 1822 baseFloatZIndex = editor.config.baseFloatZIndex, 1818 var config = editor.config, 1819 backgroundColorStyle = config.dialog_backgroundCoverColor || 'white', 1820 backgroundCoverOpacity = config.dialog_backgroundCoverOpacity, 1821 baseFloatZIndex = config.baseFloatZIndex, 1823 1822 coverKey = CKEDITOR.tools.genKey( 1824 1823 backgroundColorStyle, 1825 1824 backgroundCoverOpacity, … … 2250 2249 if ( widths ) 2251 2250 { 2252 2251 if ( widths[i] ) 2253 styles.push( 'width:' + CKEDITOR.tools.cssLength( widths[i] ) );2252 styles.push( 'width:' + cssLength( widths[i] ) ); 2254 2253 } 2255 2254 else 2256 2255 styles.push( 'width:' + Math.floor( 100 / childHtmlList.length ) + '%' ); 2257 2256 if ( height ) 2258 styles.push( 'height:' + CKEDITOR.tools.cssLength( height ) );2257 styles.push( 'height:' + cssLength( height ) ); 2259 2258 if ( elementDefinition && elementDefinition.padding != undefined ) 2260 styles.push( 'padding:' + CKEDITOR.tools.cssLength( elementDefinition.padding ) );2259 styles.push( 'padding:' + cssLength( elementDefinition.padding ) ); 2261 2260 if ( styles.length > 0 ) 2262 2261 html.push( 'style="' + styles.join('; ') + '" ' ); 2263 2262 html.push( '>', childHtmlList[i], '</td>' ); … … 2310 2309 */ 2311 2310 vbox : function( dialog, childObjList, childHtmlList, htmlList, elementDefinition ) 2312 2311 { 2313 if ( arguments.length < 3 )2312 if ( arguments.length < 3 ) 2314 2313 return; 2315 2314 2316 2315 this._ || ( this._ = {} ); … … 2325 2324 html.push( 'style="' ); 2326 2325 if ( elementDefinition && elementDefinition.expand ) 2327 2326 html.push( 'height:100%;' ); 2328 html.push( 'width:' + CKEDITOR.tools.cssLength( width || '100%' ), ';' );2327 html.push( 'width:' + cssLength( width || '100%' ), ';' ); 2329 2328 html.push( '"' ); 2330 2329 html.push( 'align="', CKEDITOR.tools.htmlEncode( 2331 2330 ( elementDefinition && elementDefinition.align ) || ( dialog.getParentEditor().lang.dir == 'ltr' ? 'left' : 'right' ) ), '" ' ); … … 2336 2335 var styles = []; 2337 2336 html.push( '<tr><td role="presentation" ' ); 2338 2337 if ( width ) 2339 styles.push( 'width:' + CKEDITOR.tools.cssLength( width || '100%' ) );2338 styles.push( 'width:' + cssLength( width || '100%' ) ); 2340 2339 if ( heights ) 2341 styles.push( 'height:' + CKEDITOR.tools.cssLength( heights[i] ) );2340 styles.push( 'height:' + cssLength( heights[i] ) ); 2342 2341 else if ( elementDefinition && elementDefinition.expand ) 2343 2342 styles.push( 'height:' + Math.floor( 100 / childHtmlList.length ) + '%' ); 2344 2343 if ( elementDefinition && elementDefinition.padding != undefined ) 2345 styles.push( 'padding:' + CKEDITOR.tools.cssLength( elementDefinition.padding ) );2344 styles.push( 'padding:' + cssLength( elementDefinition.padding ) ); 2346 2345 if ( styles.length > 0 ) 2347 2346 html.push( 'style="', styles.join( '; ' ), '" ' ); 2348 2347 html.push( ' class="cke_dialog_ui_vbox_child">', childHtmlList[i], '</td></tr>' ); -
_source/plugins/dialogadvtab/plugin.js
132 132 label : lang.styles, 133 133 'default' : '', 134 134 135 onChange : function(){},136 137 135 getStyle : function( name, defaultValue ) 138 136 { 139 137 var match = this.getValue().match( new RegExp( name + '\\s*:\s*([^;]*)', 'i') ); … … 159 157 styles += name + ': ' + value; 160 158 } 161 159 162 this.setValue( styles, true);160 this.setValue( styles, 1 ); 163 161 164 162 }, 165 163 -
_source/plugins/dialogui/plugin.js
380 380 if ( elementDefinition[ 'default' ] ) 381 381 attributes.checked = 'checked'; 382 382 383 if ( typeof myDefinition.controlStyle != 'undefined')383 if ( typeof myDefinition.controlStyle != 'undefined' ) 384 384 myDefinition.style = myDefinition.controlStyle; 385 385 386 386 _.checkbox = new CKEDITOR.ui.dialog.uiElement( dialog, myDefinition, html, 'input', null, attributes ); … … 462 462 cleanInnerDefinition( inputDefinition ); 463 463 cleanInnerDefinition( labelDefinition ); 464 464 465 if ( typeof inputDefinition.controlStyle != 'undefined')465 if ( typeof inputDefinition.controlStyle != 'undefined' ) 466 466 inputDefinition.style = inputDefinition.controlStyle; 467 467 468 468 children.push( new CKEDITOR.ui.dialog.uiElement( dialog, inputDefinition, inputHtml, 'input', null, inputAttributes ) ); … … 622 622 CKEDITOR.tools.htmlEncode( item[0] ) ); 623 623 } 624 624 625 if ( typeof myDefinition.controlStyle != 'undefined')625 if ( typeof myDefinition.controlStyle != 'undefined' ) 626 626 myDefinition.style = myDefinition.controlStyle; 627 627 628 628 _.select = new CKEDITOR.ui.dialog.uiElement( dialog, myDefinition, html, 'select', null, attributes, innerHTML.join( '' ) ); … … 931 931 { 932 932 this._.disabled = false; 933 933 var element = this.getElement(); 934 element && element.removeClass( ' disabled' );934 element && element.removeClass( 'cke_disabled' ); 935 935 }, 936 936 937 937 /** … … 941 941 disable : function() 942 942 { 943 943 this._.disabled = true; 944 this.getElement().addClass( ' disabled' );944 this.getElement().addClass( 'cke_disabled' ); 945 945 }, 946 946 947 947 isVisible : function() … … 1384 1384 */ 1385 1385 reset : function() 1386 1386 { 1387 var frameElement = CKEDITOR.document.getById( this._.frameId ), 1387 var _ = this._, 1388 frameElement = CKEDITOR.document.getById( _.frameId ), 1388 1389 frameDocument = frameElement.getFrameDocument(), 1389 elementDefinition = this._.definition,1390 buttons = this._.buttons,1390 elementDefinition = _.definition, 1391 buttons = _.buttons, 1391 1392 callNumber = this.formLoadedNumber, 1392 1393 unloadNumber = this.formUnloadNumber, 1393 langDir = this._.dialog._.editor.lang.dir,1394 langCode = this._.dialog._.editor.langCode;1394 langDir = _.dialog._.editor.lang.dir, 1395 langCode = _.dialog._.editor.langCode; 1395 1396 1396 1397 // The callback function for the iframe, but we must call tools.addFunction only once 1397 1398 // so we store the function number in this.formLoadedNumber 1398 if ( !callNumber)1399 if ( !callNumber ) 1399 1400 { 1400 1401 callNumber = this.formLoadedNumber = CKEDITOR.tools.addFunction( 1401 1402 function() -
_source/plugins/div/dialogs/div.js
140 140 var containedBlocks = [], block; 141 141 142 142 // Get all ranges from the selection. 143 var selection = editor.document.getSelection() ;144 varranges = selection.getRanges();143 var selection = editor.document.getSelection(), 144 ranges = selection.getRanges(); 145 145 var bookmarks = selection.createBookmarks(); 146 146 var i, iterator; 147 147 … … 437 437 ], 438 438 onLoad : function() 439 439 { 440 setupFields.call( this);440 setupFields.call( this ); 441 441 442 442 // Preparing for the 'elementStyle' field. 443 443 var dialog = this, -
_source/plugins/div/plugin.js
95 95 { 96 96 editor.contextMenu.addListener( function( element, selection ) 97 97 { 98 if ( !element || element.isReadOnly() )98 if ( !element || element.isReadOnly() ) 99 99 return null; 100 100 101 101 var elementPath = new CKEDITOR.dom.elementPath( element ), -
_source/plugins/domiterator/plugin.js
20 20 return; 21 21 22 22 this.range = range; 23 this.forceBrBreak = false;23 this.forceBrBreak = 0; 24 24 25 25 // Whether include <br>s into the enlarged range.(#3730). 26 this.enlargeBr = true;27 this.enforceRealBlocks = false;26 this.enlargeBr = 1; 27 this.enforceRealBlocks = 0; 28 28 29 29 this._ || ( this._ = {} ); 30 30 } … … 80 80 // next block.(#3887) 81 81 if ( this._.lastNode && 82 82 this._.lastNode.type == CKEDITOR.NODE_TEXT && 83 !CKEDITOR.tools.trim( this._.lastNode.getText( 83 !CKEDITOR.tools.trim( this._.lastNode.getText() ) && 84 84 this._.lastNode.getParent().isBlockBoundary() ) 85 85 { 86 86 var testRange = new CKEDITOR.dom.range( range.document ); … … 112 112 { 113 113 // closeRange indicates that a paragraph boundary has been found, 114 114 // so the range can be closed. 115 var closeRange = false,116 115 var closeRange = 0, 116 parentPre = currentNode.hasAscendant( 'pre' ); 117 117 118 118 // includeNode indicates that the current node is good to be part 119 119 // of the range. By default, any non-element node is ok for it. 120 120 var includeNode = ( currentNode.type != CKEDITOR.NODE_ELEMENT ), 121 continueFromSibling = false;121 continueFromSibling = 0; 122 122 123 123 // If it is an element node, let's check if it can be part of the 124 124 // range. … … 132 132 // <br> boundaries must be part of the range. It will 133 133 // happen only if ForceBrBreak. 134 134 if ( nodeName == 'br' ) 135 includeNode = true;135 includeNode = 1; 136 136 else if ( !range && !currentNode.getChildCount() && nodeName != 'hr' ) 137 137 { 138 138 // If we have found an empty block, and haven't started … … 154 154 this._.nextNode = currentNode; 155 155 } 156 156 157 closeRange = true;157 closeRange = 1; 158 158 } 159 159 else 160 160 { … … 171 171 currentNode = currentNode.getFirst(); 172 172 continue; 173 173 } 174 includeNode = true;174 includeNode = 1; 175 175 } 176 176 } 177 177 else if ( currentNode.type == CKEDITOR.NODE_TEXT ) … … 179 179 // Ignore normal whitespaces (i.e. not including or 180 180 // other unicode whitespaces) before/after a block node. 181 181 if ( beginWhitespaceRegex.test( currentNode.getText() ) ) 182 includeNode = false;182 includeNode = 0; 183 183 } 184 184 185 185 // The current node is good to be part of the range and we are … … 204 204 if ( parentNode.isBlockBoundary( this.forceBrBreak 205 205 && !parentPre && { br : 1 } ) ) 206 206 { 207 closeRange = true;207 closeRange = 1; 208 208 isLast = isLast || ( parentNode.equals( lastNode) ); 209 209 break; 210 210 } 211 211 212 212 currentNode = parentNode; 213 includeNode = true;213 includeNode = 1; 214 214 isLast = ( currentNode.equals( lastNode ) ); 215 continueFromSibling = true;215 continueFromSibling = 1; 216 216 } 217 217 } 218 218 -
_source/plugins/editingblock/plugin.js
211 211 * @example 212 212 * config.startupFocus = true; 213 213 */ 214 CKEDITOR.config.startupFocus = false;215 214 216 215 /** 217 216 * Whether to render or not the editing block area in the editor interface. -
_source/plugins/enterkey/plugin.js
69 69 if ( node.is( 'li' ) ) 70 70 { 71 71 nextBlock.breakParent( node ); 72 nextBlock.move( nextBlock.getNext(), true);72 nextBlock.move( nextBlock.getNext(), 1 ); 73 73 } 74 74 } 75 75 else if ( previousBlock && ( node = previousBlock.getParent() ) && node.is( 'li' ) ) … … 317 317 return true; 318 318 } 319 319 else 320 return enter( editor, editor.config.shiftEnterMode, true);320 return enter( editor, editor.config.shiftEnterMode, 1 ); 321 321 } 322 322 323 323 function enter( editor, mode, forceMode ) … … 335 335 setTimeout( function() 336 336 { 337 337 editor.fire( 'saveSnapshot' ); // Save undo step. 338 if ( mode == CKEDITOR.ENTER_BR || editor.getSelection().getStartElement().hasAscendant( 'pre', true) )338 if ( mode == CKEDITOR.ENTER_BR || editor.getSelection().getStartElement().hasAscendant( 'pre', 1 ) ) 339 339 enterBr( editor, mode, null, forceMode ); 340 340 else 341 341 enterBlock( editor, mode, null, forceMode ); -
_source/plugins/entities/plugin.js
214 214 * config.entities_processNumerical = true; 215 215 * config.entities_processNumerical = 'force'; //Convert from " " into " "; 216 216 */ 217 CKEDITOR.config.entities_processNumerical = false;218 217 219 218 /** 220 219 * An additional list of entities to be used. It's a string containing each -
_source/plugins/filebrowser/plugin.js
340 340 var ids = elementId.split( ";" ); 341 341 for ( var i = 0 ; i < ids.length ; i++ ) 342 342 { 343 if ( isConfigured( definition, tabId, ids[i] ) )343 if ( isConfigured( definition, tabId, ids[i] ) ) 344 344 return true; 345 345 } 346 346 return false; -
_source/plugins/find/dialogs/find.js
71 71 // Style object for highlights: (#5018) 72 72 // 1. Defined as full match style to avoid compromising ordinary text color styles. 73 73 // 2. Must be apply onto inner-most text to avoid conflicting with ordinary text color styles visually. 74 var highlightStyle = new CKEDITOR.style( CKEDITOR.tools.extend( { fullMatch : true, childRule : function(){ return false; } },74 var highlightStyle = new CKEDITOR.style( CKEDITOR.tools.extend( { fullMatch : true, childRule : function(){ return 0; } }, 75 75 editor.config.find_highlight ) ); 76 76 77 77 /** … … 87 87 new CKEDITOR.dom.walker( range ); 88 88 walker.guard = matchWord ? nonCharactersBoundary : null; 89 89 walker[ 'evaluator' ] = findEvaluator; 90 walker.breakOnFalse = true;90 walker.breakOnFalse = 1; 91 91 92 92 this._ = { 93 93 matchWord : matchWord, … … 111 111 { 112 112 var currentTextNode = this.textNode; 113 113 // Already at the end of document, no more character available. 114 if ( 114 if ( currentTextNode === null ) 115 115 return cursorStep.call( this ); 116 116 117 117 this._.matchBoundary = false; … … 142 142 // Stop searching if we're need full word match OR 143 143 // already reach document end. 144 144 if ( this._.matchWord && !currentTextNode 145 || this._.walker._.end )145 || this._.walker._.end ) 146 146 break; 147 147 148 148 // Marking as match character boundaries. … … 175 175 cursors : [], 176 176 rangeLength : rangeLength, 177 177 highlightRange : null, 178 isMatched : false178 isMatched : 0 179 179 }; 180 180 }; 181 181 … … 511 511 // Re-run the finding once for cyclic.(#3517) 512 512 if ( matchCyclic && !cyclicRerun ) 513 513 { 514 this.searchRange = getSearchRange( true);514 this.searchRange = getSearchRange( 1 ); 515 515 this.matchRange = null; 516 516 return arguments.callee.apply( this, 517 517 Array.prototype.slice.call( arguments ).concat( [ true ] ) ); … … 531 531 isReplace = 1; 532 532 533 533 // Successiveness of current replace/find. 534 var result = false;534 var result = 0; 535 535 536 536 // 1. Perform the replace when there's already a match here. 537 537 // 2. Otherwise perform the find but don't replace it immediately. … … 561 561 this.matchRange.highlight(); 562 562 this.matchRange._.isReplaced = true; 563 563 this.replaceCounter++; 564 result = true;564 result = 1; 565 565 } 566 566 else 567 567 result = this.find( pattern, matchCase, matchWord, matchCyclic, !isReplaceAll ); … … 595 595 return searchRange; 596 596 } 597 597 598 var lang = editor.lang.findAndReplace; 598 599 return { 599 title : editor.lang.findAndReplace.title,600 title : lang.title, 600 601 resizable : CKEDITOR.DIALOG_RESIZE_NONE, 601 602 minWidth : 350, 602 603 minHeight : 165, 603 buttons : [ CKEDITOR.dialog.cancelButton ], // Cancel button only.604 buttons : [ CKEDITOR.dialog.cancelButton ], // Cancel button only. 604 605 contents : [ 605 606 { 606 607 id : 'find', 607 label : editor.lang.findAndReplace.find,608 title : editor.lang.findAndReplace.find,608 label : lang.find, 609 title : lang.find, 609 610 accessKey : '', 610 611 elements : [ 611 612 { … … 616 617 { 617 618 type : 'text', 618 619 id : 'txtFindFind', 619 label : editor.lang.findAndReplace.findWhat,620 label : lang.findWhat, 620 621 isChanged : false, 621 622 labelLayout : 'horizontal', 622 623 accessKey : 'F' … … 625 626 type : 'button', 626 627 align : 'left', 627 628 style : 'width:100%', 628 label : editor.lang.findAndReplace.find,629 label : lang.find, 629 630 onClick : function() 630 631 { 631 632 var dialog = this.getDialog(); … … 633 634 dialog.getValueOf( 'find', 'txtFindCaseChk' ), 634 635 dialog.getValueOf( 'find', 'txtFindWordChk' ), 635 636 dialog.getValueOf( 'find', 'txtFindCyclic' ) ) ) 636 alert( editor.lang.findAndReplace637 alert( lang 637 638 .notFoundMsg ); 638 639 } 639 640 } … … 649 650 id : 'txtFindCaseChk', 650 651 isChanged : false, 651 652 style : 'margin-top:28px', 652 label : editor.lang.findAndReplace.matchCase653 label : lang.matchCase 653 654 }, 654 655 { 655 656 type : 'checkbox', 656 657 id : 'txtFindWordChk', 657 658 isChanged : false, 658 label : editor.lang.findAndReplace.matchWord659 label : lang.matchWord 659 660 }, 660 661 { 661 662 type : 'checkbox', 662 663 id : 'txtFindCyclic', 663 664 isChanged : false, 664 665 'default' : true, 665 label : editor.lang.findAndReplace.matchCyclic666 label : lang.matchCyclic 666 667 } 667 668 ] 668 669 } … … 670 671 }, 671 672 { 672 673 id : 'replace', 673 label : editor.lang.findAndReplace.replace,674 label : lang.replace, 674 675 accessKey : 'M', 675 676 elements : [ 676 677 { … … 681 682 { 682 683 type : 'text', 683 684 id : 'txtFindReplace', 684 label : editor.lang.findAndReplace.findWhat,685 label : lang.findWhat, 685 686 isChanged : false, 686 687 labelLayout : 'horizontal', 687 688 accessKey : 'F' … … 690 691 type : 'button', 691 692 align : 'left', 692 693 style : 'width:100%', 693 label : editor.lang.findAndReplace.replace,694 label : lang.replace, 694 695 onClick : function() 695 696 { 696 697 var dialog = this.getDialog(); … … 700 701 dialog.getValueOf( 'replace', 'txtReplaceCaseChk' ), 701 702 dialog.getValueOf( 'replace', 'txtReplaceWordChk' ), 702 703 dialog.getValueOf( 'replace', 'txtReplaceCyclic' ) ) ) 703 alert( editor.lang.findAndReplace704 alert( lang 704 705 .notFoundMsg ); 705 706 } 706 707 } … … 714 715 { 715 716 type : 'text', 716 717 id : 'txtReplace', 717 label : editor.lang.findAndReplace.replaceWith,718 label : lang.replaceWith, 718 719 isChanged : false, 719 720 labelLayout : 'horizontal', 720 721 accessKey : 'R' … … 723 724 type : 'button', 724 725 align : 'left', 725 726 style : 'width:100%', 726 label : editor.lang.findAndReplace.replaceAll,727 label : lang.replaceAll, 727 728 isChanged : false, 728 729 onClick : function() 729 730 { … … 733 734 finder.replaceCounter = 0; 734 735 735 736 // Scope to full document. 736 finder.searchRange = getSearchRange( true);737 finder.searchRange = getSearchRange( 1 ); 737 738 if ( finder.matchRange ) 738 739 { 739 740 finder.matchRange.removeHighlight(); … … 750 751 751 752 if ( finder.replaceCounter ) 752 753 { 753 alert( editor.lang.findAndReplace.replaceSuccessMsg.replace( /%1/, finder.replaceCounter ) );754 alert( lang.replaceSuccessMsg.replace( /%1/, finder.replaceCounter ) ); 754 755 editor.fire( 'saveSnapshot' ); 755 756 } 756 757 else 757 alert( editor.lang.findAndReplace.notFoundMsg );758 alert( lang.notFoundMsg ); 758 759 } 759 760 } 760 761 ] … … 768 769 type : 'checkbox', 769 770 id : 'txtReplaceCaseChk', 770 771 isChanged : false, 771 label : editor.lang.findAndReplace772 label : lang 772 773 .matchCase 773 774 }, 774 775 { 775 776 type : 'checkbox', 776 777 id : 'txtReplaceWordChk', 777 778 isChanged : false, 778 label : editor.lang.findAndReplace779 label : lang 779 780 .matchWord 780 781 }, 781 782 { … … 783 784 id : 'txtReplaceCyclic', 784 785 isChanged : false, 785 786 'default' : true, 786 label : editor.lang.findAndReplace787 label : lang 787 788 .matchCyclic 788 789 } 789 790 ] … … 795 796 { 796 797 var dialog = this; 797 798 798 // keep track of the current pattern field in use.799 // Keep track of the current pattern field in use. 799 800 var patternField, wholeWordChkField; 800 801 801 // Ignore initial page select on dialog show802 var isUserSelect = false;803 this.on( 'hide', function()802 // Ignore initial page select on dialog show 803 var isUserSelect = 0; 804 this.on( 'hide', function() 804 805 { 805 isUserSelect = false;806 } 807 this.on( 'show', function()806 isUserSelect = 0; 807 }); 808 this.on( 'show', function() 808 809 { 809 isUserSelect = true;810 } 810 isUserSelect = 1; 811 }); 811 812 812 813 this.selectPage = CKEDITOR.tools.override( this.selectPage, function( originalFunc ) 813 814 { … … 825 826 wholeWordChkField = dialog.getContentElement( pageId, 826 827 wholeWordChkFieldId ); 827 828 828 // prepare for check pattern text filed 'keyup' event829 // Prepare for check pattern text filed 'keyup' event 829 830 if ( !currPage.initialized ) 830 831 { 831 832 patternFieldInput = CKEDITOR.document … … 833 834 currPage.initialized = true; 834 835 } 835 836 837 // Synchronize fields on tab switch. 836 838 if ( isUserSelect ) 837 // synchronize fields on tab switch.838 839 syncFieldsBetweenTabs.call( this, pageId ); 839 840 }; 840 841 } ); -
_source/plugins/flash/plugin.js
5 5 6 6 (function() 7 7 { 8 var flashFilenameRegex = /\.swf(?:$|\?)/i, 9 numberRegex = /^\d+(?:\.\d+)?$/; 8 var flashFilenameRegex = /\.swf(?:$|\?)/i; 10 9 11 function cssifyLength( length ) 12 { 13 if ( numberRegex.test( length ) ) 14 return length + 'px'; 15 return length; 16 } 10 var cssifyLength = CKEDITOR.tools.cssLength; 17 11 18 12 function isFlashEmbed( element ) 19 13 { -
_source/plugins/floatpanel/plugin.js
16 16 function getPanel( editor, doc, parentElement, definition, level ) 17 17 { 18 18 // Generates the panel key: docId-eleId-skinName-langDir[-uiColor][-CSSs][-level] 19 var key = 20 doc.getUniqueId() + 21 '-' + parentElement.getUniqueId() + 22 '-' + editor.skinName + 23 '-' + editor.lang.dir + 24 ( ( editor.uiColor && ( '-' + editor.uiColor ) ) || '' ) + 25 ( ( definition.css && ( '-' + definition.css ) ) || '' ) + 26 ( ( level && ( '-' + level ) ) || '' ); 19 var key = CKEDITOR.tools.genKey( doc.getUniqueId(), parentElement.getUniqueId(), editor.skinName, editor.lang.dir, 20 editor.uiColor || '', definition.css || '', level || '' ); 27 21 28 22 var panel = panels[ key ]; 29 23 … … 46 40 { 47 41 $ : function( editor, parentElement, definition, level ) 48 42 { 49 definition.forceIFrame = true;43 definition.forceIFrame = 1; 50 44 51 45 var doc = parentElement.getDocument(), 52 46 panel = getPanel( editor, doc, parentElement, definition, level || 0 ), … … 104 98 block = panel.showBlock( name ); 105 99 106 100 this.allowBlur( false ); 107 isShowing = true;101 isShowing = 1; 108 102 109 103 var element = this.element, 110 104 iframe = this._.iframe, … … 313 307 if ( this.onShow ) 314 308 this.onShow.call( this ); 315 309 316 isShowing = false;310 isShowing = 0; 317 311 }, 318 312 319 313 hide : function() -
_source/plugins/forms/dialogs/button.js
12 12 { 13 13 delete this.button; 14 14 var element = this.getParentEditor().getSelection().getSelectedElement(); 15 if ( element && element. getName() == "input")15 if ( element && element.is( 'input' ) ) 16 16 { 17 17 var type = element.getAttribute( 'type' ); 18 if ( type == "button" || type == "reset" || type == "submit")18 if ( type in { button:1, reset:1, submit:1 } ) 19 19 { 20 20 this.button = element; 21 21 this.setupContent( element ); -
_source/plugins/forms/dialogs/checkbox.js
14 14 15 15 var element = this.getParentEditor().getSelection().getSelectedElement(); 16 16 17 if ( element && element.getAttribute( 'type' ) == "checkbox")17 if ( element && element.getAttribute( 'type' ) == 'checkbox' ) 18 18 { 19 19 this.checkbox = element; 20 20 this.setupContent( element ); … … 31 31 editor = this.getParentEditor(); 32 32 element = editor.document.createElement( 'input' ); 33 33 element.setAttribute( 'type', 'checkbox' ); 34 }35 36 if ( isInsertMode )37 34 editor.insertElement( element ); 35 } 38 36 this.commitContent( { element : element } ); 39 37 }, 40 38 contents : [ … … 94 92 { 95 93 if ( CKEDITOR.env.ie ) 96 94 { 97 // Remove attribute 'value' of checkbox #4721.95 // Remove attribute 'value' of checkbox (#4721). 98 96 var checkbox = new CKEDITOR.dom.element( 'input', element.getDocument() ); 99 97 element.copyAttributes( checkbox, { value: 1 } ); 100 98 checkbox.replace( element ); … … 123 121 124 122 if ( CKEDITOR.env.ie ) 125 123 { 126 var isElementChecked = !!element.getAttribute( 'checked' ) ;127 varisChecked = !!this.getValue();124 var isElementChecked = !!element.getAttribute( 'checked' ), 125 isChecked = !!this.getValue(); 128 126 129 127 if ( isElementChecked != isChecked ) 130 128 { -
_source/plugins/forms/dialogs/radio.js
13 13 delete this.radioButton; 14 14 15 15 var element = this.getParentEditor().getSelection().getSelectedElement(); 16 if ( element && element.getName() == "input" && element.getAttribute( 'type' ) == "radio")16 if ( element && element.getName() == 'input' && element.getAttribute( 'type' ) == 'radio' ) 17 17 { 18 18 this.radioButton = element; 19 19 this.setupContent( element ); -
_source/plugins/forms/plugin.js
191 191 192 192 switch ( type ) 193 193 { 194 case 'text' : case 'password': 194 case 'text' : 195 case 'password' : 195 196 evt.data.dialog = 'textfield'; 196 197 break; 197 case 'button' : case 'submit' : case 'reset' : 198 case 'button' : 199 case 'submit' : 200 case 'reset' : 198 201 evt.data.dialog = 'button'; 199 202 break; 200 203 case 'checkbox' : -
_source/plugins/htmlwriter/plugin.js
57 57 */ 58 58 this.lineBreakChars = '\n'; 59 59 60 this.forceSimpleAmpersand = false;60 this.forceSimpleAmpersand = 0; 61 61 62 this.sortAttributes = true;62 this.sortAttributes = 1; 63 63 64 this._.indent = false;64 this._.indent = 0; 65 65 this._.indentation = ''; 66 66 this._.rules = {}; 67 67 … … 254 254 { 255 255 if ( this._.output.length > 0 ) 256 256 this._.output.push( this.lineBreakChars ); 257 this._.indent = true;257 this._.indent = 1; 258 258 }, 259 259 260 260 /** … … 268 268 indentation : function() 269 269 { 270 270 this._.output.push( this._.indentation ); 271 this._.indent = false;271 this._.indent = 0; 272 272 }, 273 273 274 274 /** -
_source/plugins/iframedialog/plugin.js
74 74 contentLoad = elementDefinition.onContentLoad && CKEDITOR.tools.bind( elementDefinition.onContentLoad, this ), 75 75 cssWidth = CKEDITOR.tools.cssLength( elementDefinition.width ), 76 76 cssHeight = CKEDITOR.tools.cssLength( elementDefinition.height ); 77 _.frameId = CKEDITOR.tools.getNext Number() + '_iframe';77 _.frameId = CKEDITOR.tools.getNextId() + '_iframe'; 78 78 79 79 // IE BUG: Parent container does not resize to contain the iframe automatically. 80 80 dialog.on( 'load', function() -
_source/plugins/indent/plugin.js
267 267 268 268 currentOffset = Math.max( currentOffset, 0 ); 269 269 currentOffset = Math.ceil( currentOffset / editor.config.indentOffset ) * editor.config.indentOffset; 270 element.setStyle( indentCssProperty, currentOffset ? currentOffset + editor.config.indentUnit: '' );270 element.setStyle( indentCssProperty, currentOffset ? currentOffset + ( editor.config.indentUnit || 'px' ) : '' ); 271 271 if ( element.getAttribute( 'style' ) === '' ) 272 272 element.removeAttribute( 'style' ); 273 273 } … … 393 393 394 394 CKEDITOR.tools.extend( CKEDITOR.config, 395 395 { 396 indentOffset : 40, 397 indentUnit : 'px', 398 indentClasses : null 396 indentOffset : 40 399 397 }); 400 398 401 399 /** 402 400 * Size of each indentation step 403 401 * @type Number 404 * @example405 * config.indentOffset = 40;406 */407 408 /**409 * Unit for the indentation style410 * @type String411 * @example412 * config.indentUnit = 'px';413 */414 415 /**416 * List of classes to use for indenting the contents.417 * @type Array418 * @example419 * // Don't use classes for indenting. (this is the default value)420 * config.indentClasses = null;421 * @example422 * // Use the classes 'Indent1', 'Indent2', 'Indent3'423 * config.indentClasses = ['Indent1', 'Indent2', 'Indent3'];424 */425 426 /**427 * Size of each indentation step428 * @type Number429 402 * @default 40 430 403 * @example 431 404 * config.indentOffset = 4; -
_source/plugins/justify/plugin.js
183 183 requires : [ 'domiterator' ] 184 184 }); 185 185 })(); 186 187 CKEDITOR.tools.extend( CKEDITOR.config,188 {189 justifyClasses : null190 } ); -
_source/plugins/keystrokes/plugin.js
28 28 blockedKeystrokes = editor.keystrokeHandler.blockedKeystrokes; 29 29 30 30 for ( var i = 0 ; i < keystrokesConfig.length ; i++ ) 31 {32 31 keystrokes[ keystrokesConfig[i][0] ] = keystrokesConfig[i][1]; 33 }34 32 35 33 for ( i = 0 ; i < blockedConfig.length ; i++ ) 36 {37 34 blockedKeystrokes[ blockedConfig[i] ] = 1; 38 }39 35 } 40 36 }); 41 37 -
_source/plugins/link/dialogs/link.js
243 243 { 244 244 var item = elements.getItem( i ); 245 245 if ( item.getAttribute( '_cke_realelement' ) && item.getAttribute( '_cke_real_element_type' ) == 'anchor' ) 246 {247 246 anchors.push( editor.restoreRealElement( item ) ); 248 }249 247 } 250 248 251 249 for ( i = 0 ; i < realAnchors.count() ; i++ ) … … 363 361 return 'String.fromCharCode(' + encodedChars.join( ',' ) + ')'; 364 362 } 365 363 364 var commonLang = editor.lang.common, 365 linkLang = editor.lang.link; 366 366 367 return { 367 title : editor.lang.link.title,368 title : linkLang.title, 368 369 minWidth : 350, 369 370 minHeight : 230, 370 371 contents : [ 371 372 { 372 373 id : 'info', 373 label : editor.lang.link.info,374 title : editor.lang.link.info,374 label : linkLang.info, 375 title : linkLang.info, 375 376 elements : 376 377 [ 377 378 { 378 379 id : 'linkType', 379 380 type : 'select', 380 label : editor.lang.link.type,381 label : linkLang.type, 381 382 'default' : 'url', 382 383 items : 383 384 [ 384 [ editor.lang.link.toUrl, 'url' ],385 [ editor.lang.link.toAnchor, 'anchor' ],386 [ editor.lang.link.toEmail, 'email' ]385 [ linkLang.toUrl, 'url' ], 386 [ linkLang.toAnchor, 'anchor' ], 387 [ linkLang.toEmail, 'email' ] 387 388 ], 388 389 onChange : linkTypeChanged, 389 390 setup : function( data ) … … 409 410 { 410 411 id : 'protocol', 411 412 type : 'select', 412 label : editor.lang.common.protocol,413 label : commonLang.protocol, 413 414 'default' : 'http://', 414 415 items : 415 416 [ … … 418 419 [ 'https://\u200E', 'https://' ], 419 420 [ 'ftp://\u200E', 'ftp://' ], 420 421 [ 'news://\u200E', 'news://' ], 421 [ editor.lang.link.other , '' ]422 [ linkLang.other , '' ] 422 423 ], 423 424 setup : function( data ) 424 425 { … … 436 437 { 437 438 type : 'text', 438 439 id : 'url', 439 label : editor.lang.common.url,440 label : commonLang.url, 440 441 required: true, 441 442 onLoad : function () 442 443 { … … 477 478 if ( this.getDialog().fakeObj ) // Edit Anchor. 478 479 return true; 479 480 480 var func = CKEDITOR.dialog.validate.notEmpty( editor.lang.link.noUrl );481 var func = CKEDITOR.dialog.validate.notEmpty( linkLang.noUrl ); 481 482 return func.apply( this ); 482 483 }, 483 484 setup : function( data ) … … 513 514 id : 'browse', 514 515 hidden : 'true', 515 516 filebrowser : 'info:url', 516 label : editor.lang.common.browseServer517 label : commonLang.browseServer 517 518 } 518 519 ] 519 520 }, … … 528 529 { 529 530 type : 'fieldset', 530 531 id : 'selectAnchorText', 531 label : editor.lang.link.selectAnchor,532 label : linkLang.selectAnchor, 532 533 setup : function( data ) 533 534 { 534 535 if ( data.anchors.length > 0 ) … … 547 548 type : 'select', 548 549 id : 'anchorName', 549 550 'default' : '', 550 label : editor.lang.link.anchorName,551 label : linkLang.anchorName, 551 552 style : 'width: 100%;', 552 553 items : 553 554 [ … … 582 583 type : 'select', 583 584 id : 'anchorId', 584 585 'default' : '', 585 label : editor.lang.link.anchorId,586 label : linkLang.anchorId, 586 587 style : 'width: 100%;', 587 588 items : 588 589 [ … … 624 625 type : 'html', 625 626 id : 'noAnchors', 626 627 style : 'text-align: center;', 627 html : '<div role="label" tabIndex="-1">' + CKEDITOR.tools.htmlEncode( editor.lang.link.noAnchors ) + '</div>',628 html : '<div role="label" tabIndex="-1">' + CKEDITOR.tools.htmlEncode( linkLang.noAnchors ) + '</div>', 628 629 // Focus the first element defined in above html. 629 630 focus : true, 630 631 setup : function( data ) … … 651 652 { 652 653 type : 'text', 653 654 id : 'emailAddress', 654 label : editor.lang.link.emailAddress,655 label : linkLang.emailAddress, 655 656 required : true, 656 657 validate : function() 657 658 { … … 661 662 dialog.getValueOf( 'info', 'linkType' ) != 'email' ) 662 663 return true; 663 664 664 var func = CKEDITOR.dialog.validate.notEmpty( editor.lang.link.noEmail );665 var func = CKEDITOR.dialog.validate.notEmpty( linkLang.noEmail ); 665 666 return func.apply( this ); 666 667 }, 667 668 setup : function( data ) … … 684 685 { 685 686 type : 'text', 686 687 id : 'emailSubject', 687 label : editor.lang.link.emailSubject,688 label : linkLang.emailSubject, 688 689 setup : function( data ) 689 690 { 690 691 if ( data.email ) … … 701 702 { 702 703 type : 'textarea', 703 704 id : 'emailBody', 704 label : editor.lang.link.emailBody,705 label : linkLang.emailBody, 705 706 rows : 3, 706 707 'default' : '', 707 708 setup : function( data ) … … 728 729 }, 729 730 { 730 731 id : 'target', 731 label : editor.lang.link.target,732 title : editor.lang.link.target,732 label : linkLang.target, 733 title : linkLang.target, 733 734 elements : 734 735 [ 735 736 { … … 740 741 { 741 742 type : 'select', 742 743 id : 'linkTargetType', 743 label : editor.lang.common.target,744 label : commonLang.target, 744 745 'default' : 'notSet', 745 746 style : 'width : 100%;', 746 747 'items' : 747 748 [ 748 [ editor.lang.common.notSet, 'notSet' ],749 [ editor.lang.link.targetFrame, 'frame' ],750 [ editor.lang.link.targetPopup, 'popup' ],751 [ editor.lang.common.targetNew, '_blank' ],752 [ editor.lang.common.targetTop, '_top' ],753 [ editor.lang.common.targetSelf, '_self' ],754 [ editor.lang.common.targetParent, '_parent' ]749 [ commonLang.notSet, 'notSet' ], 750 [ linkLang.targetFrame, 'frame' ], 751 [ linkLang.targetPopup, 'popup' ], 752 [ commonLang.targetNew, '_blank' ], 753 [ commonLang.targetTop, '_top' ], 754 [ commonLang.targetSelf, '_self' ], 755 [ commonLang.targetParent, '_parent' ] 755 756 ], 756 757 onChange : targetChanged, 757 758 setup : function( data ) … … 771 772 { 772 773 type : 'text', 773 774 id : 'linkTargetName', 774 label : editor.lang.link.targetFrameName,775 label : linkLang.targetFrameName, 775 776 'default' : '', 776 777 setup : function( data ) 777 778 { … … 798 799 [ 799 800 { 800 801 type : 'fieldset', 801 label : editor.lang.link.popupFeatures,802 label : linkLang.popupFeatures, 802 803 children : 803 804 [ 804 805 { … … 808 809 { 809 810 type : 'checkbox', 810 811 id : 'resizable', 811 label : editor.lang.link.popupResizable,812 label : linkLang.popupResizable, 812 813 setup : setupPopupParams, 813 814 commit : commitPopupParams 814 815 }, 815 816 { 816 817 type : 'checkbox', 817 818 id : 'status', 818 label : editor.lang.link.popupStatusBar,819 label : linkLang.popupStatusBar, 819 820 setup : setupPopupParams, 820 821 commit : commitPopupParams 821 822 … … 829 830 { 830 831 type : 'checkbox', 831 832 id : 'location', 832 label : editor.lang.link.popupLocationBar,833 label : linkLang.popupLocationBar, 833 834 setup : setupPopupParams, 834 835 commit : commitPopupParams 835 836 … … 837 838 { 838 839 type : 'checkbox', 839 840 id : 'toolbar', 840 label : editor.lang.link.popupToolbar,841 label : linkLang.popupToolbar, 841 842 setup : setupPopupParams, 842 843 commit : commitPopupParams 843 844 … … 851 852 { 852 853 type : 'checkbox', 853 854 id : 'menubar', 854 label : editor.lang.link.popupMenuBar,855 label : linkLang.popupMenuBar, 855 856 setup : setupPopupParams, 856 857 commit : commitPopupParams 857 858 … … 859 860 { 860 861 type : 'checkbox', 861 862 id : 'fullscreen', 862 label : editor.lang.link.popupFullScreen,863 label : linkLang.popupFullScreen, 863 864 setup : setupPopupParams, 864 865 commit : commitPopupParams 865 866 … … 873 874 { 874 875 type : 'checkbox', 875 876 id : 'scrollbars', 876 label : editor.lang.link.popupScrollBars,877 label : linkLang.popupScrollBars, 877 878 setup : setupPopupParams, 878 879 commit : commitPopupParams 879 880 … … 881 882 { 882 883 type : 'checkbox', 883 884 id : 'dependent', 884 label : editor.lang.link.popupDependent,885 label : linkLang.popupDependent, 885 886 setup : setupPopupParams, 886 887 commit : commitPopupParams 887 888 … … 896 897 type : 'text', 897 898 widths : [ '30%', '70%' ], 898 899 labelLayout : 'horizontal', 899 label : editor.lang.link.popupWidth,900 label : linkLang.popupWidth, 900 901 id : 'width', 901 902 setup : setupPopupParams, 902 903 commit : commitPopupParams … … 906 907 type : 'text', 907 908 labelLayout : 'horizontal', 908 909 widths : [ '55%', '45%' ], 909 label : editor.lang.link.popupLeft,910 label : linkLang.popupLeft, 910 911 id : 'left', 911 912 setup : setupPopupParams, 912 913 commit : commitPopupParams … … 922 923 type : 'text', 923 924 labelLayout : 'horizontal', 924 925 widths : [ '30%', '70%' ], 925 label : editor.lang.link.popupHeight,926 label : linkLang.popupHeight, 926 927 id : 'height', 927 928 setup : setupPopupParams, 928 929 commit : commitPopupParams … … 931 932 { 932 933 type : 'text', 933 934 labelLayout : 'horizontal', 934 label : editor.lang.link.popupTop,935 label : linkLang.popupTop, 935 936 widths : [ '55%', '45%' ], 936 937 id : 'top', 937 938 setup : setupPopupParams, … … 948 949 }, 949 950 { 950 951 id : 'upload', 951 label : editor.lang.link.upload,952 title : editor.lang.link.upload,952 label : linkLang.upload, 953 title : linkLang.upload, 953 954 hidden : true, 954 955 filebrowser : 'uploadButton', 955 956 elements : … … 957 958 { 958 959 type : 'file', 959 960 id : 'upload', 960 label : editor.lang.common.upload,961 label : commonLang.upload, 961 962 style: 'height:40px', 962 963 size : 29 963 964 }, 964 965 { 965 966 type : 'fileButton', 966 967 id : 'uploadButton', 967 label : editor.lang.common.uploadSubmit,968 label : commonLang.uploadSubmit, 968 969 filebrowser : 'info:url', 969 970 'for' : [ 'upload', 'upload' ] 970 971 } … … 972 973 }, 973 974 { 974 975 id : 'advanced', 975 label : editor.lang.link.advanced,976 title : editor.lang.link.advanced,976 label : linkLang.advanced, 977 title : linkLang.advanced, 977 978 elements : 978 979 [ 979 980 { … … 989 990 { 990 991 type : 'text', 991 992 id : 'advId', 992 label : editor.lang.link.id,993 label : linkLang.id, 993 994 setup : setupAdvParams, 994 995 commit : commitAdvParams 995 996 }, 996 997 { 997 998 type : 'select', 998 999 id : 'advLangDir', 999 label : editor.lang.link.langDir,1000 label : linkLang.langDir, 1000 1001 'default' : '', 1001 1002 style : 'width:110px', 1002 1003 items : 1003 1004 [ 1004 [ editor.lang.common.notSet, '' ],1005 [ editor.lang.link.langDirLTR, 'ltr' ],1006 [ editor.lang.link.langDirRTL, 'rtl' ]1005 [ commonLang.notSet, '' ], 1006 [ linkLang.langDirLTR, 'ltr' ], 1007 [ linkLang.langDirRTL, 'rtl' ] 1007 1008 ], 1008 1009 setup : setupAdvParams, 1009 1010 commit : commitAdvParams … … 1012 1013 type : 'text', 1013 1014 id : 'advAccessKey', 1014 1015 width : '80px', 1015 label : editor.lang.link.acccessKey,1016 label : linkLang.acccessKey, 1016 1017 maxLength : 1, 1017 1018 setup : setupAdvParams, 1018 1019 commit : commitAdvParams … … 1027 1028 [ 1028 1029 { 1029 1030 type : 'text', 1030 label : editor.lang.link.name,1031 label : linkLang.name, 1031 1032 id : 'advName', 1032 1033 setup : setupAdvParams, 1033 1034 commit : commitAdvParams … … 1035 1036 }, 1036 1037 { 1037 1038 type : 'text', 1038 label : editor.lang.link.langCode,1039 label : linkLang.langCode, 1039 1040 id : 'advLangCode', 1040 1041 width : '110px', 1041 1042 'default' : '', … … 1045 1046 }, 1046 1047 { 1047 1048 type : 'text', 1048 label : editor.lang.link.tabIndex,1049 label : linkLang.tabIndex, 1049 1050 id : 'advTabIndex', 1050 1051 width : '80px', 1051 1052 maxLength : 5, … … 1069 1070 [ 1070 1071 { 1071 1072 type : 'text', 1072 label : editor.lang.link.advisoryTitle,1073 label : linkLang.advisoryTitle, 1073 1074 'default' : '', 1074 1075 id : 'advTitle', 1075 1076 setup : setupAdvParams, … … 1078 1079 }, 1079 1080 { 1080 1081 type : 'text', 1081 label : editor.lang.link.advisoryContentType,1082 label : linkLang.advisoryContentType, 1082 1083 'default' : '', 1083 1084 id : 'advContentType', 1084 1085 setup : setupAdvParams, … … 1094 1095 [ 1095 1096 { 1096 1097 type : 'text', 1097 label : editor.lang.link.cssClasses,1098 label : linkLang.cssClasses, 1098 1099 'default' : '', 1099 1100 id : 'advCSSClasses', 1100 1101 setup : setupAdvParams, … … 1103 1104 }, 1104 1105 { 1105 1106 type : 'text', 1106 label : editor.lang.link.charset,1107 label : linkLang.charset, 1107 1108 'default' : '', 1108 1109 id : 'advCharset', 1109 1110 setup : setupAdvParams, … … 1118 1119 [ 1119 1120 { 1120 1121 type : 'text', 1121 label : editor.lang.link.styles,1122 label : linkLang.styles, 1122 1123 'default' : '', 1123 1124 id : 'advStyles', 1124 1125 setup : setupAdvParams, … … 1387 1388 { 1388 1389 var linkType = this.getContentElement( 'info', 'linkType' ), 1389 1390 urlField; 1390 if ( linkType && linkType.getValue( 1391 if ( linkType && linkType.getValue() == 'url' ) 1391 1392 { 1392 1393 urlField = this.getContentElement( 'info', 'url' ); 1393 1394 urlField.select(); -
_source/plugins/list/plugin.js
80 80 indentLevel = Math.max( listArray[ baseIndex ].indent, 0 ), 81 81 currentListItem = null, 82 82 paragraphName = ( paragraphMode == CKEDITOR.ENTER_P ? 'p' : 'div' ); 83 while ( true)83 while ( 1 ) 84 84 { 85 85 var item = listArray[ currentIndex ]; 86 86 if ( item.indent == indentLevel ) 87 87 { 88 88 if ( !rootNode || listArray[ currentIndex ].parent.getName() != rootNode.getName() ) 89 89 { 90 rootNode = listArray[ currentIndex ].parent.clone( false, true);90 rootNode = listArray[ currentIndex ].parent.clone( false, 1 ); 91 91 retval.append( rootNode ); 92 92 } 93 currentListItem = rootNode.append( item.element.clone( false, true) );93 currentListItem = rootNode.append( item.element.clone( 0, 1 ) ); 94 94 for ( var i = 0 ; i < item.contents.length ; i++ ) 95 currentListItem.append( item.contents[i].clone( true, true) );95 currentListItem.append( item.contents[i].clone( 1, 1 ) ); 96 96 currentIndex++; 97 97 } 98 98 else if ( item.indent == Math.max( indentLevel, 0 ) + 1 ) … … 127 127 } 128 128 129 129 for ( i = 0 ; i < item.contents.length ; i++ ) 130 currentListItem.append( item.contents[i].clone( true, true) );130 currentListItem.append( item.contents[i].clone( 1, 1 ) ); 131 131 132 132 if ( currentListItem.type == CKEDITOR.NODE_DOCUMENT_FRAGMENT 133 133 && currentIndex != listArray.length - 1 ) … … 446 446 enclosedNode = range && range.getEnclosedNode(); 447 447 if ( enclosedNode && enclosedNode.is 448 448 && this.type == enclosedNode.getName() ) 449 { 450 setState.call( this, editor, CKEDITOR.TRISTATE_ON ); 451 } 449 setState.call( this, editor, CKEDITOR.TRISTATE_ON ); 452 450 } 453 451 } 454 452 … … 490 488 pathElements = path.elements, 491 489 pathElementsCount = pathElements.length, 492 490 listNode = null, 493 processedFlag = false,491 processedFlag = 0, 494 492 blockLimit = path.blockLimit, 495 493 element; 496 494 … … 516 514 listGroups.push( groupObj ); 517 515 CKEDITOR.dom.element.setMarker( database, element, 'list_group_object', groupObj ); 518 516 } 519 processedFlag = true;517 processedFlag = 1; 520 518 break; 521 519 } 522 520 } … … 569 567 { 570 568 sibling.remove(); 571 569 // Move children order by merge direction.(#3820) 572 sibling.moveChildren( listNode, rtl ? true : false);570 sibling.moveChildren( listNode, rtl ); 573 571 } 574 572 } )(); 575 mergeSibling( true);573 mergeSibling( 1 ); 576 574 } 577 575 578 576 // Clean up, restore selection and update toolbar button states. -
_source/plugins/listblock/plugin.js
81 81 add : function( value, html, title ) 82 82 { 83 83 var pendingHtml = this._.pendingHtml, 84 id = 'cke_' + CKEDITOR.tools.getNextNumber();84 id = CKEDITOR.tools.getNextId(); 85 85 86 86 if ( !this._.started ) 87 87 { … … 109 109 { 110 110 this._.close(); 111 111 112 var id = 'cke_' + CKEDITOR.tools.getNextNumber();112 var id = CKEDITOR.tools.getNextId(); 113 113 114 114 this._.groups[ title ] = id; 115 115 -
_source/plugins/liststyle/dialogs/liststyle.js
12 12 catch( e ) { return null; } 13 13 14 14 range.shrink( CKEDITOR.SHRINK_TEXT ); 15 return range.getCommonAncestor().getAscendant( listTag, true);15 return range.getCommonAncestor().getAscendant( listTag, 1 ); 16 16 } 17 17 18 18 var mapListStyle = { … … 28 28 29 29 function listStyle( editor, startupPage ) 30 30 { 31 var lang = editor.lang.list; 31 32 if ( startupPage == 'bulletedListStyle' ) 32 33 { 33 34 return { 34 title : editor.lang.list.bulletedTitle,35 title : lang.bulletedTitle, 35 36 minWidth : 300, 36 37 minHeight : 50, 37 38 contents : … … 43 44 [ 44 45 { 45 46 type : 'select', 46 label : editor.lang.list.type,47 label : lang.type, 47 48 id : 'type', 48 49 style : 'width: 150px; margin: auto;', 49 50 items : 50 51 [ 51 [ editor.lang.list.notset, '' ],52 [ editor.lang.list.circle, 'circle' ],53 [ editor.lang.list.disc, 'disc' ],54 [ editor.lang.list.square, 'square' ]52 [ lang.notset, '' ], 53 [ lang.circle, 'circle' ], 54 [ lang.disc, 'disc' ], 55 [ lang.square, 'square' ] 55 56 ], 56 57 setup : function( element ) 57 58 { … … 95 96 96 97 var listStyleOptions = 97 98 [ 98 [ editor.lang.list.notset, '' ],99 [ editor.lang.list.lowerRoman, 'lower-roman' ],100 [ editor.lang.list.upperRoman, 'upper-roman' ],101 [ editor.lang.list.lowerAlpha, 'lower-alpha' ],102 [ editor.lang.list.upperAlpha, 'upper-alpha' ],103 [ editor.lang.list.decimal, 'decimal' ]99 [ lang.notset, '' ], 100 [ lang.lowerRoman, 'lower-roman' ], 101 [ lang.upperRoman, 'upper-roman' ], 102 [ lang.lowerAlpha, 'lower-alpha' ], 103 [ lang.upperAlpha, 'upper-alpha' ], 104 [ lang.decimal, 'decimal' ] 104 105 ]; 105 106 106 107 if ( !CKEDITOR.env.ie || CKEDITOR.env.version > 7 ) 107 108 { 108 109 listStyleOptions.concat( [ 109 [ editor.lang.list.armenian, 'armenian' ],110 [ editor.lang.list.decimalLeadingZero, 'decimal-leading-zero' ],111 [ editor.lang.list.georgian, 'georgian' ],112 [ editor.lang.list.lowerGreek, 'lower-greek' ]110 [ lang.armenian, 'armenian' ], 111 [ lang.decimalLeadingZero, 'decimal-leading-zero' ], 112 [ lang.georgian, 'georgian' ], 113 [ lang.lowerGreek, 'lower-greek' ] 113 114 ]); 114 115 } 115 116 116 117 return { 117 title : editor.lang.list.numberedTitle,118 title : lang.numberedTitle, 118 119 minWidth : 300, 119 120 minHeight : 50, 120 121 contents : … … 130 131 children : 131 132 [ 132 133 { 133 label : editor.lang.list.start,134 label : lang.start, 134 135 type : 'text', 135 136 id : 'start', 136 validate : CKEDITOR.dialog.validate.integer( editor.lang.list.validateStartNumber ),137 validate : CKEDITOR.dialog.validate.integer( lang.validateStartNumber ), 137 138 setup : function( element ) 138 139 { 139 140 var value = element.getAttribute( 'start' ) || 1; … … 146 147 }, 147 148 { 148 149 type : 'select', 149 label : editor.lang.list.type,150 label : lang.type, 150 151 id : 'type', 151 152 style : 'width: 100%;', 152 153 items : listStyleOptions, -
_source/plugins/maximize/plugin.js
10 10 if ( !formElement || formElement.type != CKEDITOR.NODE_ELEMENT || formElement.getName() != 'form' ) 11 11 return []; 12 12 13 var hijackRecord = [] ;14 varhijackNames = [ 'style', 'className' ];13 var hijackRecord = [], 14 hijackNames = [ 'style', 'className' ]; 15 15 for ( var i = 0 ; i < hijackNames.length ; i++ ) 16 16 { 17 17 var name = hijackNames[i]; … … 129 129 init : function( editor ) 130 130 { 131 131 var lang = editor.lang; 132 var mainDocument = CKEDITOR.document ;133 varmainWindow = mainDocument.getWindow();132 var mainDocument = CKEDITOR.document, 133 mainWindow = mainDocument.getWindow(); 134 134 135 135 // Saved selection and scroll position for the editing area. 136 var savedSelection ;137 varsavedScroll;136 var savedSelection, 137 savedScroll; 138 138 139 139 // Saved scroll position for the outer window. 140 140 var outerScroll; -
_source/plugins/menu/plugin.js
190 190 this._.itemOverFn = CKEDITOR.tools.addFunction( function( index ) 191 191 { 192 192 clearTimeout( this._.showSubTimeout ); 193 this._.showSubTimeout = CKEDITOR.tools.setTimeout( this._.showSubMenu, editor.config.menu_subMenuDelay , this, [ index ] );193 this._.showSubTimeout = CKEDITOR.tools.setTimeout( this._.showSubMenu, editor.config.menu_subMenuDelay || 400, this, [ index ] ); 194 194 }, 195 this );195 this ); 196 196 197 197 this._.itemOutFn = CKEDITOR.tools.addFunction( function( index ) 198 198 { 199 199 clearTimeout( this._.showSubTimeout ); 200 200 }, 201 this );201 this ); 202 202 203 203 this._.itemClickFn = CKEDITOR.tools.addFunction( function( index ) 204 204 { … … 215 215 else 216 216 this.onClick && this.onClick( item ); 217 217 }, 218 this );218 this ); 219 219 } 220 220 221 221 // Put the items in the right order. 222 222 sortItems( items ); 223 223 224 var chromeRoot = editor.container.getChild( 1 ) ;225 varmixedContentClass = chromeRoot.hasClass( 'cke_mixed_dir_content' ) ? ' cke_mixed_dir_content' : '';224 var chromeRoot = editor.container.getChild( 1 ), 225 mixedContentClass = chromeRoot.hasClass( 'cke_mixed_dir_content' ) ? ' cke_mixed_dir_content' : ''; 226 226 227 227 // Build the HTML that composes the menu and its items. 228 228 var output = [ '<div class="cke_menu' + mixedContentClass + '" role="presentation">' ]; … … 390 390 * // Remove the submenu delay. 391 391 * config.menu_subMenuDelay = 0; 392 392 */ 393 CKEDITOR.config.menu_subMenuDelay = 400;394 393 395 394 /** 396 395 * A comma separated list of items group names to be displayed in the context -
_source/plugins/newpage/plugin.js
19 19 exec : function( editor ) 20 20 { 21 21 var command = this; 22 editor.setData( editor.config.newpage_html , function()22 editor.setData( editor.config.newpage_html || '', function() 23 23 { 24 24 // Save the undo snapshot after all document changes are affected. (#4889) 25 25 setTimeout( function () … … 51 51 * @example 52 52 * config.newpage_html = '<p>Type your text here.</p>'; 53 53 */ 54 CKEDITOR.config.newpage_html = ''; -
_source/plugins/panel/plugin.js
31 31 css : [] 32 32 }); 33 33 34 this.id = CKEDITOR.tools.getNext Number();34 this.id = CKEDITOR.tools.getNextId(); 35 35 this.document = document; 36 36 37 37 this._ = … … 73 73 */ 74 74 render : function( editor, output ) 75 75 { 76 var id = 'cke_' +this.id;76 var id = this.id; 77 77 78 78 output.push( 79 79 '<div class="', editor.skinClass ,'"' + … … 130 130 { 131 131 if ( this.forceIFrame || this.css.length ) 132 132 { 133 var iframe = this.document.getById( 'cke_' +this.id + '_frame' ),133 var iframe = this.document.getById( this.id + '_frame' ), 134 134 parentDiv = iframe.getParent(), 135 135 dir = parentDiv.getAttribute( 'dir' ), 136 136 className = parentDiv.getParent().getAttribute( 'class' ), … … 173 173 doc.on( 'keydown', function( evt ) 174 174 { 175 175 var keystroke = evt.data.getKeystroke(), 176 dir = this.document.getById( 'cke_' +this.id ).getAttribute( 'dir' );176 dir = this.document.getById( this.id ).getAttribute( 'dir' ); 177 177 178 178 // Delegate key processing to block. 179 179 if ( this._.onKeyDown && this._.onKeyDown( keystroke ) === false ) … … 186 186 if ( keystroke == 27 || keystroke == ( dir == 'rtl' ? 39 : 37 ) ) 187 187 { 188 188 if ( this.onEscape && this.onEscape( keystroke ) === false ) 189 evt.data.preventDefault( 189 evt.data.preventDefault(); 190 190 } 191 191 }, 192 192 this ); … … 195 195 holder.unselectable(); 196 196 } 197 197 else 198 holder = this.document.getById( 'cke_' +this.id );198 holder = this.document.getById( this.id ); 199 199 200 200 this._.holder = holder; 201 201 } … … 225 225 block = blocks[ name ], 226 226 current = this._.currentBlock, 227 227 holder = this.forceIFrame ? 228 this.document.getById( 'cke_' +this.id + '_frame' )228 this.document.getById( this.id + '_frame' ) 229 229 : this._.holder; 230 230 231 231 // Disable context menu for block panel. -
_source/plugins/popup/plugin.js
54 54 popupWindow.focus(); 55 55 popupWindow.location.href = url; 56 56 } 57 catch ( e)57 catch ( e ) 58 58 { 59 59 popupWindow = window.open( url, null, options, true ); 60 60 } -
_source/plugins/removeformat/plugin.js
35 35 ( editor._.removeAttributes = editor.config.removeFormatAttributes.split( ',' ) ); 36 36 37 37 var filter = CKEDITOR.plugins.removeformat.filter; 38 var ranges = editor.getSelection().getRanges( true),38 var ranges = editor.getSelection().getRanges( 1 ), 39 39 iterator = ranges.createIterator(), 40 40 range; 41 41 … … 50 50 var bookmark = range.createBookmark(); 51 51 52 52 // The style will be applied within the bookmark boundaries. 53 var startNode = bookmark.startNode ;54 varendNode = bookmark.endNode;53 var startNode = bookmark.startNode, 54 endNode = bookmark.endNode; 55 55 56 56 // We need to check the selection boundaries (bookmark spans) to break 57 57 // the code in a way that we can properly remove partially selected nodes. … … 66 66 var breakParent = function( node ) 67 67 { 68 68 // Let's start checking the start boundary. 69 var path = new CKEDITOR.dom.elementPath( node ) ;70 varpathElements = path.elements;69 var path = new CKEDITOR.dom.elementPath( node ), 70 pathElements = path.elements; 71 71 72 72 for ( var i = 1, pathElement ; pathElement = pathElements[ i ] ; i++ ) 73 73 { … … 103 103 { 104 104 // Remove elements nodes that match with this style rules. 105 105 if ( tagsRegex.test( currentNode.getName() ) ) 106 currentNode.remove( true);106 currentNode.remove( 1 ); 107 107 else 108 108 { 109 109 currentNode.removeAttributes( removeAttributes ); -
_source/plugins/resize/plugin.js
83 83 if ( event.data.space == 'bottom' ) 84 84 { 85 85 var direction = ''; 86 if ( resizeHorizontal && !resizeVertical )86 if ( resizeHorizontal && !resizeVertical ) 87 87 direction = ' cke_resizer_horizontal'; 88 if ( !resizeHorizontal && resizeVertical )88 if ( !resizeHorizontal && resizeVertical ) 89 89 direction = ' cke_resizer_vertical'; 90 90 91 91 event.data.html += '<div class="cke_resizer' + direction + '"' + -
_source/plugins/scayt/dialogs/options.js
11 11 tags = [], 12 12 i, 13 13 contents = [], 14 userDicActive = false,14 userDicActive = 0, 15 15 dic_buttons = [ 16 16 // [0] contains buttons for creating 17 17 "dic_create,dic_restore", 18 18 // [1] contains buton for manipulation 19 19 "dic_rename,dic_delete" 20 20 ], 21 optionsIds = [ 'mixedCase','mixedWithDigits','allCaps','ignoreDomainNames' ];21 optionsIds = [ 'mixedCase', 'mixedWithDigits', 'allCaps', 'ignoreDomainNames' ]; 22 22 23 23 // common operations 24 24 25 function getBOMAllOptions () { 25 function getBOMAllOptions() 26 { 26 27 return document.forms.optionsbar["options"]; 27 28 } 28 function getBOMAllLangs () { 29 function getBOMAllLangs() 30 { 29 31 return document.forms.languagesbar["scayt_lang"]; 30 32 } 31 33 32 function setCheckedValue(radioObj, newValue) { 33 if (!radioObj) 34 function setCheckedValue( radioObj, newValue ) 35 { 36 if ( !radioObj ) 34 37 return; 35 38 var radioLength = radioObj.length; 36 if (radioLength == undefined) { 37 radioObj.checked = (radioObj.value == newValue.toString()); 39 if ( radioLength == undefined ) 40 { 41 radioObj.checked = radioObj.value == newValue.toString(); 38 42 return; 39 43 } 40 for (var i = 0; i < radioLength; i++) { 44 for ( var i = 0; i < radioLength; i++ ) 45 { 41 46 radioObj[i].checked = false; 42 if ( radioObj[i].value == newValue.toString()) {47 if ( radioObj[i].value == newValue.toString() ) 43 48 radioObj[i].checked = true; 44 }45 49 } 46 50 } 47 51 52 var lang = editor.lang.scayt; 48 53 var tags_contents = [ 49 54 { 50 55 id : 'options', 51 label : editor.lang.scayt.optionsTab,56 label : lang.optionsTab, 52 57 elements : [ 53 58 { 54 59 type : 'html', … … 77 82 }, 78 83 { 79 84 id : 'langs', 80 label : editor.lang.scayt.languagesTab,85 label : lang.languagesTab, 81 86 elements : [ 82 87 { 83 88 type : 'html', … … 92 97 }, 93 98 { 94 99 id : 'dictionaries', 95 label : editor.lang.scayt.dictionariesTab,100 label : lang.dictionariesTab, 96 101 elements : [ 97 102 { 98 103 type : 'html', … … 123 128 }, 124 129 { 125 130 id : 'about', 126 label : editor.lang.scayt.aboutTab,131 label : lang.aboutTab, 127 132 elements : [ 128 133 { 129 134 type : 'html', … … 136 141 ]; 137 142 138 143 var dialogDefiniton = { 139 title : editor.lang.scayt.title,144 title : lang.title, 140 145 minWidth : 360, 141 146 minHeight : 220, 142 147 onShow : function() … … 183 188 onCancel: function() 184 189 { 185 190 var o = getBOMAllOptions(); 186 for ( i in o)191 for ( var i in o ) 187 192 o[i].checked = false; 188 193 189 setCheckedValue( getBOMAllLangs(),"");194 setCheckedValue( getBOMAllLangs(), "" ); 190 195 }, 191 196 contents : contents 192 197 }; … … 195 200 196 201 tags = CKEDITOR.plugins.scayt.uiTabs; 197 202 198 for ( i in tags )203 for ( var i in tags ) 199 204 { 200 205 if ( tags[ i ] == 1 ) 201 206 contents[ contents.length ] = tags_contents[ i ]; 202 207 } 203 208 if ( tags[2] == 1 ) 204 userDicActive = true;209 userDicActive = 1; 205 210 206 211 207 212 var init_with_captions = function() 208 213 { 209 214 var dialog = this, 210 215 lang_list = dialog.data.scayt.getLangList(), 211 buttons = [ 'dic_create', 'dic_delete','dic_rename','dic_restore' ],216 buttons = [ 'dic_create', 'dic_delete', 'dic_rename', 'dic_restore' ], 212 217 labels = optionsIds, 213 218 i; 214 219 … … 282 287 }; 283 288 284 289 var langList = []; 285 if ( tags[1] ==1 )290 if ( tags[1] ==1 ) 286 291 { 287 for ( i in lang_list.rtl )292 for ( var i in lang_list.rtl ) 288 293 langList[ langList.length ] = createOption( i, lang_list.ltr ); 289 294 290 295 for ( i in lang_list.ltr ) … … 314 319 var err_massage = captions["err_dic_create"]; 315 320 var suc_massage = captions["succ_dic_create"]; 316 321 317 window.scayt.createUserDictionary( dic_name,318 function( arg)322 window.scayt.createUserDictionary( dic_name, 323 function( arg ) 319 324 { 320 325 hide_dic_buttons ( all_buttons ); 321 326 display_dic_buttons ( dic_buttons[1] ); 322 327 suc_massage = suc_massage.replace("%s" , arg.dname ); 323 328 dic_success_message (suc_massage); 324 329 }, 325 function( arg)330 function( arg ) 326 331 { 327 332 err_massage = err_massage.replace("%s" ,arg.dname ); 328 333 dic_error_message ( err_massage + "( "+ (arg.message || "") +")"); … … 336 341 // try to rename dictionary 337 342 var err_massage = captions["err_dic_rename"] || ""; 338 343 var suc_massage = captions["succ_dic_rename"] || ""; 339 window.scayt.renameUserDictionary( dic_name,340 function( arg)344 window.scayt.renameUserDictionary( dic_name, 345 function( arg ) 341 346 { 342 347 suc_massage = suc_massage.replace("%s" , arg.dname ); 343 348 set_dic_name( dic_name ); 344 349 dic_success_message ( suc_massage ); 345 350 }, 346 function( arg)351 function( arg ) 347 352 { 348 353 err_massage = err_massage.replace("%s" , arg.dname ); 349 354 set_dic_name( dic_name ); … … 351 356 }); 352 357 }; 353 358 354 dic.dic_delete = function 359 dic.dic_delete = function( el, dic_name , dic_buttons ) 355 360 { 356 361 var all_buttons = dic_buttons[0] + ',' + dic_buttons[1]; 357 362 var err_massage = captions["err_dic_delete"]; … … 359 364 360 365 // try to delete dictionary 361 366 window.scayt.deleteUserDictionary( 362 function( arg)367 function( arg ) 363 368 { 364 369 suc_massage = suc_massage.replace("%s" , arg.dname ); 365 370 hide_dic_buttons ( all_buttons ); … … 367 372 set_dic_name( "" ); // empty input field 368 373 dic_success_message( suc_massage ); 369 374 }, 370 function( arg)375 function( arg ) 371 376 { 372 377 err_massage = err_massage.replace("%s" , arg.dname ); 373 378 dic_error_message(err_massage); 374 379 }); 375 380 }; 376 381 377 dic.dic_restore = dialog.dic_restore || function 382 dic.dic_restore = dialog.dic_restore || function( el, dic_name , dic_buttons ) 378 383 { 379 384 // try to restore existing dictionary 380 385 var all_buttons = dic_buttons[0] + ',' + dic_buttons[1]; … … 382 387 var suc_massage = captions["succ_dic_restore"]; 383 388 384 389 window.scayt.restoreUserDictionary(dic_name, 385 function( arg)390 function( arg ) 386 391 { 387 392 suc_massage = suc_massage.replace("%s" , arg.dname ); 388 393 hide_dic_buttons ( all_buttons ); 389 394 display_dic_buttons(dic_buttons[1]); 390 395 dic_success_message( suc_massage ); 391 396 }, 392 function( arg)397 function( arg ) 393 398 { 394 399 err_massage = err_massage.replace("%s" , arg.dname ); 395 400 dic_error_message( err_massage ); … … 408 413 var el = id = ev.data.getTarget().getParent(); 409 414 var id = el.getId(); 410 415 dic[ id ].apply( null, [ el, dic_name, dic_buttons ] ); 411 }catch(err){ 416 } 417 catch(err) 418 { 412 419 dic_error_message(" Dictionary error. "); 413 420 } 414 421 … … 431 438 { 432 439 var dialog = this; 433 440 // for enabled options tab 434 if ( tags[0] == 1){441 if ( tags[0] == 1 ){ 435 442 var opto = getBOMAllOptions(); 436 443 437 444 // Animate options. … … 466 473 //for enabled languages tab 467 474 if ( tags[1] == 1 ) 468 475 { 469 var domLang = doc.getById("cke_option" +dialog.sLang);470 setCheckedValue( domLang.$,dialog.sLang);476 var domLang = doc.getById("cke_option" + dialog.sLang); 477 setCheckedValue( domLang.$,dialog.sLang ); 471 478 } 472 479 473 480 // * user dictionary … … 487 494 display_dic_buttons( dic_buttons[0] ); 488 495 489 496 }, 490 function 497 function() 491 498 { 492 499 doc.getById( 'dic_name' ).setValue(""); 493 500 }); … … 496 503 497 504 }; 498 505 499 function dic_error_message 506 function dic_error_message( m ) 500 507 { 501 508 doc.getById('dic_message').setHtml('<span style="color:red;">' + m + '</span>' ); 502 509 } 503 function dic_success_message 510 function dic_success_message( m ) 504 511 { 505 512 doc.getById('dic_message').setHtml('<span style="color:blue;">' + m + '</span>') ; 506 513 } 507 function display_dic_buttons 514 function display_dic_buttons( sIds ) 508 515 { 509 510 516 sIds = String( sIds ); 511 517 var aIds = sIds.split(','); 512 518 for ( var i=0, l = aIds.length; i < l ; i+=1) 513 {514 519 doc.getById( aIds[i] ).$.style.display = "inline"; 515 }516 517 520 } 518 function hide_dic_buttons 521 function hide_dic_buttons( sIds ) 519 522 { 520 523 sIds = String( sIds ); 521 524 var aIds = sIds.split(','); 522 525 for ( var i = 0, l = aIds.length; i < l ; i += 1 ) 523 {524 526 doc.getById( aIds[i] ).$.style.display = "none"; 525 }526 527 } 527 function set_dic_name 528 function set_dic_name( dic_name ) 528 529 { 529 530 doc.getById('dic_name').$.value= dic_name; 530 531 } -
_source/plugins/scayt/plugin.js
10 10 11 11 (function() 12 12 { 13 var commandName 14 openPage 13 var commandName = 'scaytcheck', 14 openPage = ''; 15 15 16 16 // Checks if a value exists in an array 17 function in_array( needle, haystack)17 function in_array( needle, haystack ) 18 18 { 19 var found = false, key; 20 for (key in haystack) 19 var found = 0, 20 key; 21 for ( key in haystack ) 21 22 { 22 if ( (haystack[key] === needle) || ( haystack[key] == needle))23 if ( haystack[ key ] == needle ) 23 24 { 24 found = true;25 found = 1; 25 26 break; 26 27 } 27 28 } … … 34 35 35 36 var createInstance = function() // Create new instance every time Document is created. 36 37 { 38 var config = editor.config; 37 39 // Initialise Scayt instance. 38 40 var oParams = {}; 39 41 // Get the iframe. 40 42 oParams.srcNodeRef = editor.document.getWindow().$.frameElement; 41 43 // syntax : AppName.AppVersion@AppRevision 42 44 oParams.assocApp = 'CKEDITOR.' + CKEDITOR.version + '@' + CKEDITOR.revision; 43 oParams.customerid = editor.config.scayt_customerid || '1:WvF0D4-UtPqN1-43nkD4-NKvUm2-daQqk3-LmNiI-z7Ysb4-mwry24-T8YrS3-Q2tpq2';44 oParams.customDictionaryIds = editor.config.scayt_customDictionaryIds || '';45 oParams.userDictionaryName = editor.config.scayt_userDictionaryName || '';46 oParams.sLang = editor.config.scayt_sLang || 'en_US';45 oParams.customerid = config.scayt_customerid || '1:WvF0D4-UtPqN1-43nkD4-NKvUm2-daQqk3-LmNiI-z7Ysb4-mwry24-T8YrS3-Q2tpq2'; 46 oParams.customDictionaryIds = config.scayt_customDictionaryIds || ''; 47 oParams.userDictionaryName = config.scayt_userDictionaryName || ''; 48 oParams.sLang = config.scayt_sLang || 'en_US'; 47 49 48 50 // Introduce SCAYT onLoad callback. (#5632) 49 51 oParams.onLoad = function() … … 66 68 }; 67 69 68 70 var scayt_custom_params = window.scayt_custom_params; 69 if ( typeof scayt_custom_params == 'object' )71 if ( typeof scayt_custom_params == 'object' ) 70 72 { 71 73 for ( var k in scayt_custom_params ) 72 {73 74 oParams[ k ] = scayt_custom_params[ k ]; 74 }75 75 } 76 76 // needs for restoring a specific scayt control settings 77 if ( plugin.getControlId( editor) )78 oParams.id = plugin.getControlId( editor);77 if ( plugin.getControlId( editor ) ) 78 oParams.id = plugin.getControlId( editor ); 79 79 80 80 var scayt_control = new window.scayt( oParams ); 81 81 … … 85 85 } ); 86 86 87 87 // Copy config. 88 var 88 var lastInstance = plugin.instances[ editor.name ]; 89 89 if ( lastInstance ) 90 90 { 91 91 scayt_control.sLang = lastInstance.sLang; … … 100 100 var uiTabs = window.scayt.uiTags; 101 101 var fTabs = []; 102 102 103 for ( var i = 0,l=4; i<l; i++)103 for ( var i = 0, l=4; i < l; i++ ) 104 104 fTabs.push( uiTabs[i] && plugin.uiTabs[i] ); 105 105 106 106 plugin.uiTabs = fTabs; … … 132 132 133 133 editor.on( 'beforeCommandExec', function( ev ) // Disable SCAYT before Source command execution. 134 134 { 135 if ( ( ev.data.name == 'source' || ev.data.name == 'newpage') && editor.mode == 'wysiwyg' )135 if ( ( ev.data.name == 'source' || ev.data.name == 'newpage' ) && editor.mode == 'wysiwyg' ) 136 136 { 137 137 var scayt_instance = plugin.getScayt( editor ); 138 138 if ( scayt_instance ) … … 257 257 258 258 // Override Image.equals method avoid CK snapshot module to add SCAYT markup to snapshots. (#5546) 259 259 var undoImagePrototype = CKEDITOR.plugins.undo.Image.prototype; 260 undoImagePrototype.equals = 260 undoImagePrototype.equals = CKEDITOR.tools.override( undoImagePrototype.equals, function( org ) 261 261 { 262 262 return function( otherImage ) 263 263 { … … 298 298 for ( var infoOpt in o ) 299 299 this.controlInfo[ editor.name ][ infoOpt ] = o[ infoOpt ]; 300 300 }, 301 isControlRestored : function 301 isControlRestored : function( editor ) 302 302 { 303 303 if ( editor && 304 304 editor.name && … … 308 308 } 309 309 return false; 310 310 }, 311 markControlRestore : function 311 markControlRestore : function( editor ) 312 312 { 313 this.setControlInfo( editor, { restored:true } );313 this.setControlInfo( editor, { restored:true } ); 314 314 }, 315 setControlId: function (editor, id)315 setControlId: function( editor, id ) 316 316 { 317 this.setControlInfo( editor, { id:id } );317 this.setControlInfo( editor, { id:id } ); 318 318 }, 319 getControlId: function (editor)319 getControlId: function( editor ) 320 320 { 321 321 if ( editor && 322 322 editor.name && … … 327 327 } 328 328 return null; 329 329 }, 330 setPaused: function 330 setPaused: function( editor , bool ) 331 331 { 332 this.setControlInfo( editor, { paused:bool } );332 this.setControlInfo( editor, { paused:bool } ); 333 333 }, 334 isPaused: function (editor)334 isPaused: function( editor ) 335 335 { 336 336 if ( editor && 337 337 editor.name && 338 338 this.controlInfo[editor.name] ) 339 339 { 340 return this.controlInfo[editor.name].paused 340 return this.controlInfo[editor.name].paused; 341 341 } 342 342 return undefined; 343 343 }, … … 466 466 // scayt_control.focus(); 467 467 // 468 468 // now focus is set certainly 469 scayt_control.focus( 469 scayt_control.focus(); 470 470 scayt_control.setDisabled( isEnabled ); 471 471 } 472 472 else if ( !editor.config.scayt_autoStartup && plugin.engineLoaded >= 0 ) // Load first time … … 502 502 503 503 init : function( editor ) 504 504 { 505 var moreSuggestions = {} ;506 varmainSuggestions = {};505 var moreSuggestions = {}, 506 mainSuggestions = {}; 507 507 508 508 // Scayt command. 509 509 var command = editor.addCommand( commandName, commandDefinition ); … … 516 516 // string to array convert 517 517 confuiTabs = confuiTabs.split( ',' ); 518 518 // check array length ! always must be 3 filled with 1 or 0 519 for ( var i=0,l=3; i<l; i++)519 for ( var i=0, l=3; i < l; i++ ) 520 520 { 521 var flag = parseInt( confuiTabs[i] || '1' ,10);521 var flag = parseInt( confuiTabs[i] || '1', 10 ); 522 522 uiTabs.push( flag ); 523 523 } 524 524 … … 527 527 // combine menu items to render 528 528 var uiMuneItems = {}; 529 529 530 var lang = editor.lang.scayt; 531 530 532 // always added 531 533 uiMuneItems.scaytToggle = 532 534 { 533 label : editor.lang.scayt.enable,535 label : lang.enable, 534 536 command : commandName, 535 537 group : menuGroup 536 538 }; 537 539 538 if ( uiTabs[0] == 1)540 if ( uiTabs[0] == 1 ) 539 541 uiMuneItems.scaytOptions = 540 542 { 541 label : editor.lang.scayt.options,543 label : lang.options, 542 544 group : menuGroup, 543 545 onClick : function() 544 546 { … … 547 549 } 548 550 }; 549 551 550 if ( uiTabs[1] == 1)552 if ( uiTabs[1] == 1 ) 551 553 uiMuneItems.scaytLangs = 552 554 { 553 label : editor.lang.scayt.langs,555 label : lang.langs, 554 556 group : menuGroup, 555 557 onClick : function() 556 558 { … … 558 560 editor.openDialog( commandName ); 559 561 } 560 562 }; 561 if ( uiTabs[2] == 1)563 if ( uiTabs[2] == 1 ) 562 564 uiMuneItems.scaytDict = 563 565 { 564 label : editor.lang.scayt.dictionariesTab,566 label : lang.dictionariesTab, 565 567 group : menuGroup, 566 568 onClick : function() 567 569 { … … 579 581 openPage = 'about'; 580 582 editor.openDialog( commandName ); 581 583 } 582 } 583 ; 584 }; 584 585 585 586 uiTabs[3] = 1; // about us tab is always on 586 587 plugin.uiTabs = uiTabs; … … 589 590 590 591 editor.ui.add( 'Scayt', CKEDITOR.UI_MENUBUTTON, 591 592 { 592 label : editor.lang.scayt.title,593 title : CKEDITOR.env.opera ? editor.lang.scayt.opera_title : editor.lang.scayt.title,593 label : lang.title, 594 title : CKEDITOR.env.opera ? lang.opera_title : lang.title, 594 595 className : 'cke_button_scayt', 595 596 onRender: function() 596 597 { … … 604 605 { 605 606 var isEnabled = plugin.isScaytEnabled( editor ); 606 607 607 editor.getMenuItem( 'scaytToggle' ).label = editor.lang.scayt[ isEnabled ? 'disable' : 'enable' ];608 editor.getMenuItem( 'scaytToggle' ).label = lang[ isEnabled ? 'disable' : 'enable' ]; 608 609 609 610 return { 610 611 scaytToggle : CKEDITOR.TRISTATE_OFF, … … 673 674 return { 674 675 exec: function() 675 676 { 676 scayt_control.replace( el, s);677 scayt_control.replace( el, s ); 677 678 } 678 679 }; 679 680 })( node, items_suggestion[i] ); … … 699 700 // Register the More suggestions group; 700 701 editor.addMenuItem( 'scayt_moresuggest', 701 702 { 702 label : editor.lang.scayt.moreSuggestions,703 label : lang.moreSuggestions, 703 704 group : 'scayt_moresuggest', 704 705 order : 10, 705 706 getItems : function() … … 717 718 scayt_control.ignore( node ); 718 719 } 719 720 }; 720 addButtonCommand( editor, 'ignore', editor.lang.scayt.ignore, 'scayt_ignore', ignore_command, 'scayt_control', 1 );721 addButtonCommand( editor, 'ignore', lang.ignore, 'scayt_ignore', ignore_command, 'scayt_control', 1 ); 721 722 mainSuggestions[ 'scayt_ignore' ] = CKEDITOR.TRISTATE_OFF; 722 723 } 723 724 … … 728 729 scayt_control.ignoreAll( node ); 729 730 } 730 731 }; 731 addButtonCommand(editor, 'ignore_all', editor.lang.scayt.ignoreAll, 'scayt_ignore_all', ignore_all_command, 'scayt_control', 2);732 addButtonCommand(editor, 'ignore_all', lang.ignoreAll, 'scayt_ignore_all', ignore_all_command, 'scayt_control', 2); 732 733 mainSuggestions['scayt_ignore_all'] = CKEDITOR.TRISTATE_OFF; 733 734 } 734 735 … … 739 740 window.scayt.addWordToUserDictionary( node ); 740 741 } 741 742 }; 742 addButtonCommand(editor, 'add_word', editor.lang.scayt.addWord, 'scayt_add_word', addword_command, 'scayt_control', 3);743 addButtonCommand(editor, 'add_word', lang.addWord, 'scayt_add_word', addword_command, 'scayt_control', 3); 743 744 mainSuggestions['scayt_add_word'] = CKEDITOR.TRISTATE_OFF; 744 745 } 745 746 -
_source/plugins/selection/plugin.js
151 151 body.on( 'focus', function() 152 152 { 153 153 // Enable selections to be saved. 154 saveEnabled = true;154 saveEnabled = 1; 155 155 156 156 saveSelection(); 157 157 }); … … 164 164 return; 165 165 166 166 // Disable selections from being saved. 167 saveEnabled = false;167 saveEnabled = 0; 168 168 restoreEnabled = 1; 169 169 }); 170 170 … … 185 185 186 186 // Listening on document element ensures that 187 187 // scrollbar is included. (#5280) 188 html.on( 'mousedown', function 188 html.on( 'mousedown', function() 189 189 { 190 190 // Lock restore selection now, as we have 191 191 // a followed 'click' event which introduce … … 193 193 restoreEnabled = 0; 194 194 }); 195 195 196 html.on( 'mouseup', function 196 html.on( 'mouseup', function() 197 197 { 198 198 restoreEnabled = 1; 199 199 }); … … 240 240 } 241 241 scroll = null; 242 242 243 saveEnabled = true;243 saveEnabled = 1; 244 244 setTimeout( function() 245 245 { 246 246 saveSelection( true ); … … 252 252 body.on( 'keyup', 253 253 function() 254 254 { 255 saveEnabled = true;255 saveEnabled = 1; 256 256 saveSelection(); 257 257 }); 258 258 … … 263 263 264 264 function disableSave() 265 265 { 266 saveEnabled = false;266 saveEnabled = 0; 267 267 } 268 268 269 269 function saveSelection( testIt ) … … 405 405 return lockedSelection; 406 406 407 407 this.document = document; 408 this.isLocked = false;408 this.isLocked = 0; 409 409 this._ = 410 410 { 411 411 cache : {} … … 745 745 746 746 // Drop range spans inside one ready-only node. 747 747 var parent = range.getCommonAncestor(); 748 if ( parent.isReadOnly() )748 if ( parent.isReadOnly() ) 749 749 ranges.splice( i, 1 ); 750 750 751 751 if ( range.collapsed ) … … 855 855 // Decrease the range content to exclude particial 856 856 // selected node on the start which doesn't have 857 857 // visual impact. ( #3231 ) 858 while ( true)858 while ( 1 ) 859 859 { 860 860 var startContainer = range.startContainer, 861 861 startOffset = range.startOffset; … … 891 891 if ( CKEDITOR.env.ie ) 892 892 { 893 893 range = sel.createRange(); 894 range.collapse( true);894 range.collapse( 1 ); 895 895 896 896 node = range.parentElement(); 897 897 } … … 964 964 // The native selection is not available when locked. 965 965 this._.cache.nativeSel = {}; 966 966 967 this.isLocked = true;967 this.isLocked = 1; 968 968 969 969 // Save this selection inside the DOM document. 970 970 this.document.setCustomData( 'cke_locked_selection', this ); … … 984 984 var selectedElement = lockedSelection.getSelectedElement(), 985 985 ranges = !selectedElement && lockedSelection.getRanges(); 986 986 987 this.isLocked = false;987 this.isLocked = 0; 988 988 this.reset(); 989 989 990 990 doc.getBody().focus(); … … 998 998 999 999 if ( !lockedSelection || !restore ) 1000 1000 { 1001 this.isLocked = false;1001 this.isLocked = 0; 1002 1002 this.reset(); 1003 1003 } 1004 1004 }, … … 1039 1039 range.addElement( element.$ ); 1040 1040 range.select(); 1041 1041 } 1042 catch( e)1042 catch( e ) 1043 1043 { 1044 1044 // If failed, select it as a text range. 1045 1045 range = this.document.$.body.createTextRange(); -
_source/plugins/showblocks/plugin.js
153 153 * @example 154 154 * config.startupOutlineBlocks = true; 155 155 */ 156 CKEDITOR.config.startupOutlineBlocks = false; -
_source/plugins/smiley/dialogs/smiley.js
54 54 element = new CKEDITOR.dom.element( element ); 55 55 var relative, nodeToMove; 56 56 57 var keystroke = ev.getKeystroke() ;58 varrtl = editor.lang.dir == 'rtl';57 var keystroke = ev.getKeystroke(), 58 rtl = editor.lang.dir == 'rtl'; 59 59 switch ( keystroke ) 60 60 { 61 61 // UP-ARROW -
_source/plugins/specialchar/dialogs/specialchar.js
112 112 // Get an Anchor element. 113 113 var element = ev.getTarget(); 114 114 var relative, nodeToMove; 115 var keystroke = ev.getKeystroke() ;116 varrtl = editor.lang.dir == 'rtl';115 var keystroke = ev.getKeystroke(), 116 rtl = editor.lang.dir == 'rtl'; 117 117 118 118 switch ( keystroke ) 119 119 { … … 347 347 focus : function() 348 348 { 349 349 var firstChar = this.getElement().getElementsByTag( 'a' ).getItem( 0 ); 350 setTimeout( function()350 setTimeout( function() 351 351 { 352 352 firstChar.focus(); 353 353 onFocus( null, firstChar ); -
_source/plugins/styles/plugin.js
1321 1321 var selection = document.getSelection(), 1322 1322 // Bookmark the range so we can re-select it after processing. 1323 1323 bookmarks = selection.createBookmarks(), 1324 ranges = selection.getRanges( true),1324 ranges = selection.getRanges( 1 ), 1325 1325 func = remove ? this.removeFromRange : this.applyToRange, 1326 1326 range; 1327 1327 -
_source/plugins/stylescombo/plugin.js
26 26 styleName; 27 27 28 28 // Put all styles into an Array. 29 for ( var i = 0 ; i < stylesDefinitions.length; i++ )29 for ( var i = 0, count = stylesDefinitions.length ; i < count ; i++ ) 30 30 { 31 31 var styleDefinition = stylesDefinitions[ i ]; 32 32 … … 71 71 // Loop over the Array, adding all items to the 72 72 // combo. 73 73 var lastType; 74 for ( var i = 0 ; i < stylesList.length; i++ )74 for ( var i = 0, count = stylesList.length ; i < count ; i++ ) 75 75 { 76 76 style = stylesList[ i ]; 77 77 styleName = style._name; … … 126 126 elements = elementPath.elements; 127 127 128 128 // For each element into the elements path. 129 for ( var i = 0, element ; i < elements.length; i++ )129 for ( var i = 0, count = elements.length, element ; i < count ; i++ ) 130 130 { 131 131 element = elements[i]; 132 132 … … 154 154 if ( CKEDITOR.env.ie || CKEDITOR.env.webkit ) 155 155 editor.focus(); 156 156 157 var selection = editor.getSelection(); 158 159 var element = selection.getSelectedElement(), 157 var selection = editor.getSelection(), 158 element = selection.getSelectedElement(), 160 159 elementPath = new CKEDITOR.dom.elementPath( element || selection.getStartElement() ); 161 160 162 161 var counter = [ 0, 0, 0, 0 ]; -
_source/plugins/tab/plugin.js
38 38 if ( editor.focusManager.hasFocus ) 39 39 { 40 40 var sel = editor.getSelection(), 41 42 41 ancestor = sel.getCommonAncestor(), 42 cell; 43 43 44 44 if ( ( cell = ( ancestor.getAscendant( 'td', true ) || ancestor.getAscendant( 'th', true ) ) ) ) 45 45 { -
_source/plugins/table/plugin.js
58 58 { 59 59 editor.contextMenu.addListener( function( element, selection ) 60 60 { 61 if ( !element || element.isReadOnly() )61 if ( !element || element.isReadOnly() ) 62 62 return null; 63 63 64 var isTable = element.is( 'table' ) || element.hasAscendant( 'table');64 var isTable = element.hasAscendant( 'table', 1 ); 65 65 66 66 if ( isTable ) 67 67 { -
_source/plugins/tableresize/plugin.js
393 393 return; 394 394 } 395 395 396 target.getAscendant( 'table', true).removeCustomData( '_cke_table_pillars' );396 target.getAscendant( 'table', 1 ).removeCustomData( '_cke_table_pillars' ); 397 397 evt.removeListener(); 398 398 } 399 399 … … 423 423 table, 424 424 pillars; 425 425 426 if ( !target.is( 'table' ) && !target.getAscendant( 'tbody', true) )426 if ( !target.is( 'table' ) && !target.getAscendant( 'tbody', 1 ) ) 427 427 return; 428 428 429 table = target.getAscendant( 'table', true);429 table = target.getAscendant( 'table', 1 ); 430 430 431 431 if ( !( pillars = table.getCustomData( '_cke_table_pillars' ) ) ) 432 432 { -
_source/plugins/tabletools/plugin.js
146 146 return; 147 147 148 148 // Create a clone of the row. 149 var newRow = row.clone( true);149 var newRow = row.clone( 1 ); 150 150 151 151 insertBefore ? 152 152 newRow.insertBefore( row ) : … … 216 216 { 217 217 // Get the cell where the selection is placed in. 218 218 var startElement = selection.getStartElement(); 219 var cell = startElement.getAscendant( 'td', true ) || startElement.getAscendant( 'th', true);219 var cell = startElement.getAscendant( 'td', 1 ) || startElement.getAscendant( 'th', 1 ); 220 220 221 221 if ( !cell ) 222 222 return; … … 234 234 if ( $row.cells.length < ( cellIndex + 1 ) ) 235 235 continue; 236 236 237 cell = ( new CKEDITOR.dom.element( $row.cells[ cellIndex ] ) ).clone( false);237 cell = ( new CKEDITOR.dom.element( $row.cells[ cellIndex ] ) ).clone( 0 ); 238 238 239 239 if ( !CKEDITOR.env.ie ) 240 240 cell.appendBogus(); … … 339 339 function insertCell( selection, insertBefore ) 340 340 { 341 341 var startElement = selection.getStartElement(); 342 var cell = startElement.getAscendant( 'td', true ) || startElement.getAscendant( 'th', true);342 var cell = startElement.getAscendant( 'td', 1 ) || startElement.getAscendant( 'th', 1 ); 343 343 344 344 if ( !cell ) 345 345 return; -
_source/plugins/templates/dialogs/templates.js
15 15 // clear loading wait text. 16 16 container.setHtml( '' ); 17 17 18 for ( var i = 0 ; i < templatesDefinitions.length; i++ )18 for ( var i = 0, totalDefs = templatesDefinitions.length ; i < totalDefs ; i++ ) 19 19 { 20 20 var definition = CKEDITOR.getTemplates( templatesDefinitions[ i ] ), 21 21 imagesPath = definition.imagesPath, … … 44 44 var html = '<table style="width:350px;" class="cke_tpl_preview" role="presentation"><tr>'; 45 45 46 46 if ( template.image && imagesPath ) 47 html += '<td class="cke_tpl_preview_img"><img src="' + CKEDITOR.getUrl( imagesPath + template.image ) + '"' + ( CKEDITOR.env.ie6Compat ? ' onload="this.width=this.width"' : '' ) + ' alt="" title=""></td>';47 html += '<td class="cke_tpl_preview_img"><img src="' + CKEDITOR.getUrl( imagesPath + template.image ) + '"' + ( CKEDITOR.env.ie6Compat ? ' onload="this.width=this.width"' : '' ) + ' alt="" title=""></td>'; 48 48 49 49 html += '<td style="white-space:normal;"><span class="cke_tpl_title">' + template.title + '</span><br/>'; 50 50 … … 80 80 // Place the cursor at the first editable place. 81 81 var range = new CKEDITOR.dom.range( editor.document ); 82 82 range.moveToElementEditStart( editor.document.getBody() ); 83 range.select( true);84 setTimeout( function 83 range.select( 1 ); 84 setTimeout( function() 85 85 { 86 86 editor.fire( 'saveSnapshot' ); 87 87 }, 0 ); 88 } 88 }); 89 89 90 90 editor.fire( 'saveSnapshot' ); 91 91 editor.setData( html ); … … 146 146 147 147 var listContainer; 148 148 149 var templateListLabelId = 'cke_tpl_list_label_' + CKEDITOR.tools.getNextNumber(); 149 var templateListLabelId = 'cke_tpl_list_label_' + CKEDITOR.tools.getNextNumber(), 150 lang = editor.lang.templates, 151 config = editor.config; 150 152 return { 151 153 title :editor.lang.templates.title, 152 154 … … 157 159 [ 158 160 { 159 161 id :'selectTpl', 160 label : editor.lang.templates.title,162 label : lang.title, 161 163 elements : 162 164 [ 163 165 { … … 169 171 type : 'html', 170 172 html : 171 173 '<span>' + 172 editor.lang.templates.selectPromptMsg +174 lang.selectPromptMsg + 173 175 '</span>' 174 176 }, 175 177 { 176 id : "templatesList",178 id : 'templatesList', 177 179 type : 'html', 178 180 focus: true, 179 181 html : 180 182 '<div class="cke_tpl_list" tabIndex="-1" role="listbox" aria-labelledby="' + templateListLabelId+ '">' + 181 183 '<div class="cke_tpl_loading"><span></span></div>' + 182 184 '</div>' + 183 '<span class="cke_voice_label" id="' + templateListLabelId + '">' + editor.lang.templates.options+ '</span>'185 '<span class="cke_voice_label" id="' + templateListLabelId + '">' + lang.options+ '</span>' 184 186 }, 185 187 { 186 188 id : 'chkInsertOpt', 187 189 type : 'checkbox', 188 label : editor.lang.templates.insertOption,189 'default' : editor.config.templates_replaceContent190 label : lang.insertOption, 191 'default' : config.templates_replaceContent 190 192 } 191 193 ] 192 194 } … … 201 203 var templatesListField = this.getContentElement( 'selectTpl' , 'templatesList' ); 202 204 listContainer = templatesListField.getElement(); 203 205 204 CKEDITOR.loadTemplates( editor.config.templates_files, function()206 CKEDITOR.loadTemplates( config.templates_files, function() 205 207 { 206 var templates = editor.config.templates.split( ',' );208 var templates = ( config.templates || 'default' ).split( ',' ); 207 209 208 210 if ( templates.length ) 209 211 { … … 214 216 { 215 217 listContainer.setHtml( 216 218 '<div class="cke_tpl_empty">' + 217 '<span>' + editor.lang.templates.emptyListMsg + '</span>' +219 '<span>' + lang.emptyListMsg + '</span>' + 218 220 '</div>' ); 219 221 } 220 222 }); … … 222 224 this._.element.on( 'keydown', keyNavigation ); 223 225 }, 224 226 225 onHide : function 227 onHide : function() 226 228 { 227 229 this._.element.removeListener( 'keydown', keyNavigation ); 228 230 } -
_source/plugins/templates/plugin.js
42 42 var toLoad = []; 43 43 44 44 // Look for pending template files to get loaded. 45 for ( var i = 0 ; i < templateFiles.length; i++ )45 for ( var i = 0, count = templateFiles.length ; i < count ; i++ ) 46 46 { 47 47 if ( !loadedTemplatesFiles[ templateFiles[ i ] ] ) 48 48 { … … 51 51 } 52 52 } 53 53 54 if ( toLoad.length > 0)54 if ( toLoad.length ) 55 55 CKEDITOR.scriptLoader.load( toLoad, callback ); 56 56 else 57 57 setTimeout( callback, 0 ); … … 68 68 * @example 69 69 * config.templates = 'my_templates'; 70 70 */ 71 CKEDITOR.config.templates = 'default';72 71 73 72 /** 74 73 * The list of templates definition files to load. -
_source/plugins/toolbar/plugin.js
157 157 { 158 158 editor.toolbox = new toolbox(); 159 159 160 var labelId = 'cke_' + CKEDITOR.tools.getNextNumber();160 var labelId = CKEDITOR.tools.getNextId(); 161 161 162 162 var output = [ '<div class="cke_toolbox" role="toolbar" aria-labelledby="', labelId, '"' ], 163 163 expanded = editor.config.toolbarStartupExpanded !== false, … … 187 187 if ( !row ) 188 188 continue; 189 189 190 var toolbarId = 'cke_' + CKEDITOR.tools.getNextNumber(),190 var toolbarId = CKEDITOR.tools.getNextId(), 191 191 toolbarObj = { id : toolbarId, items : [] }; 192 192 193 193 if ( groupStarted ) … … 283 283 function() 284 284 { 285 285 editor.execCommand( 'toolbarCollapse' ); 286 } 286 }); 287 287 288 288 editor.on( 'destroy', function () { 289 289 CKEDITOR.tools.removeFunction( collapserFn ); 290 } 290 }); 291 291 292 var collapserId = 'cke_' + CKEDITOR.tools.getNextNumber();292 var collapserId = CKEDITOR.tools.getNextId(); 293 293 294 294 editor.addCommand( 'toolbarCollapse', 295 295 { 296 296 exec : function( editor ) 297 297 { 298 var collapser = CKEDITOR.document.getById( collapserId ) ;299 var toolbox = collapser.getPrevious();300 var contents = editor.getThemeSpace( 'contents' );301 var toolboxContainer = toolbox.getParent();302 var contentHeight = parseInt( contents.$.style.height, 10 );303 var previousHeight = toolboxContainer.$.offsetHeight;304 varcollapsed = !toolbox.isVisible();298 var collapser = CKEDITOR.document.getById( collapserId ), 299 toolbox = collapser.getPrevious(), 300 contents = editor.getThemeSpace( 'contents' ), 301 toolboxContainer = toolbox.getParent(), 302 contentHeight = parseInt( contents.$.style.height, 10 ), 303 previousHeight = toolboxContainer.$.offsetHeight, 304 collapsed = !toolbox.isVisible(); 305 305 306 306 if ( !collapsed ) 307 307 { -
_source/plugins/undo/plugin.js
133 133 editor.on( 'updateSnapshot', function() 134 134 { 135 135 if ( undoManager.currentImage && new Image( editor ).equals( undoManager.currentImage ) ) 136 setTimeout( function 136 setTimeout( function() { undoManager.update(); }, 0 ); 137 137 }); 138 138 } 139 139 }); … … 339 339 */ 340 340 this.index = -1; 341 341 342 this.limit = this.editor.config.undoStackSize ;342 this.limit = this.editor.config.undoStackSize || 20; 343 343 344 344 this.currentImage = null; 345 345 … … 545 545 * @example 546 546 * config.undoStackSize = 50; 547 547 */ 548 CKEDITOR.config.undoStackSize = 20;549 548 550 549 /** 551 550 * Fired when the editor is about to save an undo snapshot. This event can be -
_source/plugins/wysiwygarea/plugin.js
92 92 var marker = this.document.getById( 'cke_paste_marker' ); 93 93 marker.scrollIntoView(); 94 94 marker.remove(); 95 marker = null; 95 96 } 96 97 97 98 CKEDITOR.tools.setTimeout( function() … … 132 133 // Remove the original contents. 133 134 range.deleteContents(); 134 135 135 clone = !i && element || element.clone( true);136 clone = !i && element || element.clone( 1 ); 136 137 137 138 // If we're inserting a block at dtd-violated position, split 138 139 // the parent blocks until we reach blockLimit. 139 140 var current, dtd; 140 141 if ( isBlock ) 141 142 { 142 while ( ( current = range.getCommonAncestor( false, true) )143 while ( ( current = range.getCommonAncestor( 0, 1 ) ) 143 144 && ( dtd = CKEDITOR.dtd[ current.getName() ] ) 144 145 && !( dtd && dtd [ elementName ] ) ) 145 146 { … … 530 531 531 532 CKEDITOR.env.gecko && CKEDITOR.tools.setTimeout( activateEditing, 0, null, editor ); 532 533 533 domWindow = editor.window 534 domWindow = editor.window = new CKEDITOR.dom.window( domWindow ); 534 535 domDocument = editor.document = new CKEDITOR.dom.document( domDocument ); 535 536 536 537 domDocument.on( 'dblclick', function( evt ) … … 1066 1067 // Fixing Firefox 'Back-Forward Cache' break design mode. (#4514) 1067 1068 if ( CKEDITOR.env.gecko ) 1068 1069 { 1069 ( function()1070 (function() 1070 1071 { 1071 1072 var body = document.body; 1072 1073