From e371ddf8abcb89013e20e6d0dd746adec344d0e5 Mon Sep 17 00:00:00 2001 From: Jason Woofenden Date: Thu, 4 Nov 2010 01:29:23 -0400 Subject: [PATCH] vanilla ckeditor-3.4b --- CHANGES.html | 21 + _samples/autogrow.html | 75 ++++ _samples/index.html | 1 + _source/core/ckeditor_base.js | 8 +- _source/core/config.js | 18 +- _source/core/dom/node.js | 21 + _source/core/dom/range.js | 41 +- _source/core/dom/rangelist.js | 163 +++++++ _source/core/env.js | 6 +- _source/core/loader.js | 5 +- _source/core/tools.js | 14 + _source/lang/_translationstatus.txt | 114 ++--- _source/lang/af.js | 13 +- _source/lang/ar.js | 13 +- _source/lang/bg.js | 13 +- _source/lang/bn.js | 13 +- _source/lang/bs.js | 13 +- _source/lang/ca.js | 13 +- _source/lang/cs.js | 13 +- _source/lang/cy.js | 13 +- _source/lang/da.js | 13 +- _source/lang/de.js | 13 +- _source/lang/el.js | 13 +- _source/lang/en-au.js | 13 +- _source/lang/en-ca.js | 13 +- _source/lang/en-gb.js | 13 +- _source/lang/en.js | 13 +- _source/lang/eo.js | 13 +- _source/lang/es.js | 13 +- _source/lang/et.js | 13 +- _source/lang/eu.js | 13 +- _source/lang/fa.js | 13 +- _source/lang/fi.js | 13 +- _source/lang/fo.js | 13 +- _source/lang/fr-ca.js | 13 +- _source/lang/fr.js | 13 +- _source/lang/gl.js | 13 +- _source/lang/gu.js | 13 +- _source/lang/he.js | 13 +- _source/lang/hi.js | 13 +- _source/lang/hr.js | 13 +- _source/lang/hu.js | 13 +- _source/lang/is.js | 13 +- _source/lang/it.js | 13 +- _source/lang/ja.js | 13 +- _source/lang/km.js | 13 +- _source/lang/ko.js | 13 +- _source/lang/lt.js | 13 +- _source/lang/lv.js | 13 +- _source/lang/mn.js | 13 +- _source/lang/ms.js | 13 +- _source/lang/nb.js | 13 +- _source/lang/nl.js | 13 +- _source/lang/no.js | 13 +- _source/lang/pl.js | 13 +- _source/lang/pt-br.js | 13 +- _source/lang/pt.js | 13 +- _source/lang/ro.js | 13 +- _source/lang/ru.js | 13 +- _source/lang/sk.js | 13 +- _source/lang/sl.js | 13 +- _source/lang/sr-latn.js | 13 +- _source/lang/sr.js | 13 +- _source/lang/sv.js | 13 +- _source/lang/th.js | 13 +- _source/lang/tr.js | 13 +- _source/lang/uk.js | 13 +- _source/lang/vi.js | 13 +- _source/lang/zh-cn.js | 13 +- _source/lang/zh.js | 13 +- _source/plugins/autogrow/plugin.js | 79 ++++ _source/plugins/bidi/plugin.js | 244 +++++++++++ _source/plugins/blockquote/plugin.js | 2 +- _source/plugins/clipboard/plugin.js | 11 +- _source/plugins/colordialog/dialogs/colordialog.js | 9 +- _source/plugins/dialog/plugin.js | 15 +- _source/plugins/dialogadvtab/plugin.js | 216 ++++++++++ _source/plugins/dialogui/plugin.js | 22 +- _source/plugins/div/plugin.js | 2 +- _source/plugins/enterkey/plugin.js | 12 +- _source/plugins/filebrowser/plugin.js | 10 +- _source/plugins/find/dialogs/find.js | 30 +- _source/plugins/flash/dialogs/flash.js | 4 +- _source/plugins/flash/plugin.js | 3 +- _source/plugins/forms/plugin.js | 4 +- _source/plugins/image/dialogs/image.js | 5 +- _source/plugins/image/plugin.js | 2 +- _source/plugins/indent/plugin.js | 452 ++++++++++---------- _source/plugins/justify/plugin.js | 59 +-- _source/plugins/link/dialogs/link.js | 2 +- _source/plugins/link/plugin.js | 16 +- _source/plugins/list/plugin.js | 60 ++- _source/plugins/liststyle/plugin.js | 3 + _source/plugins/pagebreak/plugin.js | 6 +- _source/plugins/removeformat/plugin.js | 6 +- _source/plugins/scayt/plugin.js | 5 +- _source/plugins/selection/plugin.js | 194 ++++++--- _source/plugins/showborders/plugin.js | 26 ++ _source/plugins/smiley/dialogs/smiley.js | 2 +- _source/plugins/specialchar/dialogs/specialchar.js | 15 +- _source/plugins/styles/plugin.js | 48 ++- _source/plugins/tab/plugin.js | 108 ++++- _source/plugins/table/dialogs/table.js | 96 ++++- _source/plugins/table/plugin.js | 2 +- _source/plugins/tableresize/plugin.js | 450 +++++++++++++++++++ _source/plugins/tabletools/plugin.js | 102 ++--- _source/plugins/toolbar/plugin.js | 1 + _source/plugins/wysiwygarea/plugin.js | 73 +++- _source/skins/kama/dialog.css | 2 +- _source/skins/kama/icons.css | 13 +- _source/skins/office2003/dialog.css | 2 +- _source/skins/office2003/icons.css | 10 + _source/skins/v2/dialog.css | 2 +- _source/skins/v2/icons.css | 10 + ckeditor.asp | 6 +- ckeditor.js | 202 ++++----- ckeditor.pack | 3 + ckeditor_basic.js | 6 +- ckeditor_basic_source.js | 2 +- ckeditor_php4.php | 6 +- ckeditor_php5.php | 6 +- ckeditor_source.js | 2 +- lang/_translationstatus.txt | 114 ++--- lang/af.js | 2 +- lang/ar.js | 2 +- lang/bg.js | 2 +- lang/bn.js | 2 +- lang/bs.js | 2 +- lang/ca.js | 2 +- lang/cs.js | 2 +- lang/cy.js | 2 +- lang/da.js | 2 +- lang/de.js | 2 +- lang/el.js | 2 +- lang/en-au.js | 2 +- lang/en-ca.js | 2 +- lang/en-gb.js | 2 +- lang/en.js | 2 +- lang/eo.js | 2 +- lang/es.js | 2 +- lang/et.js | 2 +- lang/eu.js | 2 +- lang/fa.js | 2 +- lang/fi.js | 2 +- lang/fo.js | 2 +- lang/fr-ca.js | 2 +- lang/fr.js | 2 +- lang/gl.js | 2 +- lang/gu.js | 2 +- lang/he.js | 2 +- lang/hi.js | 2 +- lang/hr.js | 2 +- lang/hu.js | 2 +- lang/is.js | 2 +- lang/it.js | 2 +- lang/ja.js | 2 +- lang/km.js | 2 +- lang/ko.js | 2 +- lang/lt.js | 2 +- lang/lv.js | 2 +- lang/mn.js | 2 +- lang/ms.js | 2 +- lang/nb.js | 2 +- lang/nl.js | 2 +- lang/no.js | 2 +- lang/pl.js | 2 +- lang/pt-br.js | 2 +- lang/pt.js | 2 +- lang/ro.js | 2 +- lang/ru.js | 2 +- lang/sk.js | 2 +- lang/sl.js | 2 +- lang/sr-latn.js | 2 +- lang/sr.js | 2 +- lang/sv.js | 2 +- lang/th.js | 2 +- lang/tr.js | 2 +- lang/uk.js | 2 +- lang/vi.js | 2 +- lang/zh-cn.js | 2 +- lang/zh.js | 2 +- plugins/autogrow/plugin.js | 6 + plugins/colordialog/dialogs/colordialog.js | 4 +- plugins/find/dialogs/find.js | 8 +- plugins/flash/dialogs/flash.js | 2 +- plugins/image/dialogs/image.js | 2 +- plugins/link/dialogs/link.js | 2 +- plugins/smiley/dialogs/smiley.js | 2 +- plugins/specialchar/dialogs/specialchar.js | 2 +- plugins/table/dialogs/table.js | 8 +- plugins/tableresize/plugin.js | 7 + skins/kama/dialog.css | 2 +- skins/kama/editor.css | 2 +- skins/office2003/dialog.css | 2 +- skins/office2003/editor.css | 2 +- skins/v2/dialog.css | 2 +- skins/v2/editor.css | 2 +- 197 files changed, 3340 insertions(+), 854 deletions(-) create mode 100644 _samples/autogrow.html create mode 100644 _source/core/dom/rangelist.js create mode 100644 _source/plugins/autogrow/plugin.js create mode 100644 _source/plugins/bidi/plugin.js create mode 100644 _source/plugins/dialogadvtab/plugin.js create mode 100644 _source/plugins/tableresize/plugin.js create mode 100644 plugins/autogrow/plugin.js create mode 100644 plugins/tableresize/plugin.js diff --git a/CHANGES.html b/CHANGES.html index 442210d..75b86b1 100644 --- a/CHANGES.html +++ b/CHANGES.html @@ -35,6 +35,27 @@ For licensing, see LICENSE.html or http://ckeditor.com/license CKEditor Changelog

+ CKEditor 3.4 Beta

+

+ New features:

+ +

+ Fixed issues:

+ +

CKEditor 3.3.2

New features:

diff --git a/_samples/autogrow.html b/_samples/autogrow.html new file mode 100644 index 0000000..ccc08b6 --- /dev/null +++ b/_samples/autogrow.html @@ -0,0 +1,75 @@ + + + + + AutoGrow Plugin - CKEditor Sample + + + + + + +

+ CKEditor Sample +

+ +
+ +
+
+

+ In this sample the AutoGrow plugin is available. It makes the editor grow to fit the size of the content.

+

+
+ + +

+

+
+ + +

+

+ +

+
+ + + diff --git a/_samples/index.html b/_samples/index.html index d560ceb..679914b 100644 --- a/_samples/index.html +++ b/_samples/index.html @@ -41,6 +41,7 @@ For licensing, see LICENSE.html or http://ckeditor.com/license
  • jQuery adapter example
  • Output XHTML
  • Output HTML
  • +
  • AutoGrow plugin
  • '; return { title : editor.lang.flash.title, diff --git a/_source/plugins/flash/plugin.js b/_source/plugins/flash/plugin.js index c76a7fe..65e76c5 100644 --- a/_source/plugins/flash/plugin.js +++ b/_source/plugins/flash/plugin.js @@ -90,7 +90,8 @@ For licensing, see LICENSE.html or http://ckeditor.com/license { editor.contextMenu.addListener( function( element, selection ) { - if ( element && element.is( 'img' ) && element.getAttribute( '_cke_real_element_type' ) == 'flash' ) + if ( element && element.is( 'img' ) && !element.isReadOnly() + && element.getAttribute( '_cke_real_element_type' ) == 'flash' ) return { flash : CKEDITOR.TRISTATE_OFF }; }); } diff --git a/_source/plugins/forms/plugin.js b/_source/plugins/forms/plugin.js index daf36c6..7d8ea45 100644 --- a/_source/plugins/forms/plugin.js +++ b/_source/plugins/forms/plugin.js @@ -131,13 +131,13 @@ CKEDITOR.plugins.add( 'forms', { editor.contextMenu.addListener( function( element ) { - if ( element && element.hasAscendant( 'form', true ) ) + if ( element && element.hasAscendant( 'form', true ) && !element.isReadOnly() ) return { form : CKEDITOR.TRISTATE_OFF }; }); editor.contextMenu.addListener( function( element ) { - if ( element ) + if ( element && !element.isReadOnly() ) { var name = element.getName(); diff --git a/_source/plugins/image/dialogs/image.js b/_source/plugins/image/dialogs/image.js index d8eb581..0fa8827 100644 --- a/_source/plugins/image/dialogs/image.js +++ b/_source/plugins/image/dialogs/image.js @@ -250,7 +250,10 @@ For licensing, see LICENSE.html or http://ckeditor.com/license switchLockRatio( this, false ); // Unlock. }; - var numbering = function( id ){ return id + CKEDITOR.tools.getNextNumber(); }, + var numbering = function( id ) + { + return CKEDITOR.tools.getNextId() + '_' + id; + }, btnLockSizesId = numbering( 'btnLockSizes' ), btnResetSizeId = numbering( 'btnResetSize' ), imagePreviewLoaderId = numbering( 'ImagePreviewLoader' ), diff --git a/_source/plugins/image/plugin.js b/_source/plugins/image/plugin.js index 4c709b2..6757aa3 100644 --- a/_source/plugins/image/plugin.js +++ b/_source/plugins/image/plugin.js @@ -53,7 +53,7 @@ CKEDITOR.plugins.add( 'image', { editor.contextMenu.addListener( function( element, selection ) { - if ( !element || !element.is( 'img' ) || element.getAttribute( '_cke_realelement' ) ) + if ( !element || !element.is( 'img' ) || element.getAttribute( '_cke_realelement' ) || element.isReadOnly() ) return null; return { image : CKEDITOR.TRISTATE_OFF }; diff --git a/_source/plugins/indent/plugin.js b/_source/plugins/indent/plugin.js index 80fc71d..e60a29e 100644 --- a/_source/plugins/indent/plugin.js +++ b/_source/plugins/indent/plugin.js @@ -53,7 +53,7 @@ For licensing, see LICENSE.html or http://ckeditor.com/license } else { - var indent = parseInt( firstBlock.getStyle( this.indentCssProperty ), 10 ); + var indent = parseInt( firstBlock.getStyle( getIndentCssProperty( firstBlock ) ), 10 ); if ( isNaN( indent ) ) indent = 0; if ( indent <= 0 ) @@ -62,260 +62,274 @@ For licensing, see LICENSE.html or http://ckeditor.com/license } } - function indentList( editor, range, listNode ) + function indentCommand( editor, name ) { - // Our starting and ending points of the range might be inside some blocks under a list item... - // So before playing with the iterator, we need to expand the block to include the list items. - var startContainer = range.startContainer, - endContainer = range.endContainer; - while ( startContainer && !startContainer.getParent().equals( listNode ) ) - startContainer = startContainer.getParent(); - while ( endContainer && !endContainer.getParent().equals( listNode ) ) - endContainer = endContainer.getParent(); - - if ( !startContainer || !endContainer ) - return; - - // Now we can iterate over the individual items on the same tree depth. - var block = startContainer, - itemsToMove = [], - stopFlag = false; - while ( !stopFlag ) - { - if ( block.equals( endContainer ) ) - stopFlag = true; - itemsToMove.push( block ); - block = block.getNext(); - } - if ( itemsToMove.length < 1 ) - return; - - // Do indent or outdent operations on the array model of the list, not the - // list's DOM tree itself. The array model demands that it knows as much as - // possible about the surrounding lists, we need to feed it the further - // ancestor node that is still a list. - var listParents = listNode.getParents( true ); - for ( var i = 0 ; i < listParents.length ; i++ ) + this.name = name; + this.useIndentClasses = editor.config.indentClasses && editor.config.indentClasses.length > 0; + if ( this.useIndentClasses ) { - if ( listParents[i].getName && listNodeNames[ listParents[i].getName() ] ) - { - listNode = listParents[i]; - break; - } + this.classNameRegex = new RegExp( '(?:^|\\s+)(' + editor.config.indentClasses.join( '|' ) + ')(?=$|\\s)' ); + this.indentClassMap = {}; + for ( var i = 0 ; i < editor.config.indentClasses.length ; i++ ) + this.indentClassMap[ editor.config.indentClasses[i] ] = i + 1; } - var indentOffset = this.name == 'indent' ? 1 : -1, - startItem = itemsToMove[0], - lastItem = itemsToMove[ itemsToMove.length - 1 ], - database = {}; - - // Convert the list DOM tree into a one dimensional array. - var listArray = CKEDITOR.plugins.list.listToArray( listNode, database ); - // Apply indenting or outdenting on the array. - var baseIndent = listArray[ lastItem.getCustomData( 'listarray_index' ) ].indent; - for ( i = startItem.getCustomData( 'listarray_index' ); i <= lastItem.getCustomData( 'listarray_index' ); i++ ) - { - listArray[ i ].indent += indentOffset; - // Make sure the newly created sublist get a brand-new element of the same type. (#5372) - var listRoot = listArray[ i ].parent; - listArray[ i ].parent = new CKEDITOR.dom.element( listRoot.getName(), listRoot.getDocument() ); - } + this.startDisabled = name == 'outdent'; + } - for ( i = lastItem.getCustomData( 'listarray_index' ) + 1 ; - i < listArray.length && listArray[i].indent > baseIndent ; i++ ) - listArray[i].indent += indentOffset; + // Returns the CSS property to be used for identing a given element. + function getIndentCssProperty( element ) + { + return element.getComputedStyle( 'direction' ) == 'ltr' ? 'margin-left' : 'margin-right'; + } - // Convert the array back to a DOM forest (yes we might have a few subtrees now). - // And replace the old list with the new forest. - var newList = CKEDITOR.plugins.list.arrayToList( listArray, database, null, editor.config.enterMode, 0 ); + function isListItem( node ) + { + return node.type = CKEDITOR.NODE_ELEMENT && node.is( 'li' ); + } - // Avoid nested
  • after outdent even they're visually same, - // recording them for later refactoring.(#3982) - if ( this.name == 'outdent' ) + indentCommand.prototype = { + exec : function( editor ) { - var parentLiElement; - if ( ( parentLiElement = listNode.getParent() ) && parentLiElement.is( 'li' ) ) - { - var children = newList.listNode.getChildren(), - pendingLis = [], - count = children.count(), - child; + var self = this, database = {}; - for ( i = count - 1 ; i >= 0 ; i-- ) + function indentList( listNode ) + { + // Our starting and ending points of the range might be inside some blocks under a list item... + // So before playing with the iterator, we need to expand the block to include the list items. + var startContainer = range.startContainer, + endContainer = range.endContainer; + while ( startContainer && !startContainer.getParent().equals( listNode ) ) + startContainer = startContainer.getParent(); + while ( endContainer && !endContainer.getParent().equals( listNode ) ) + endContainer = endContainer.getParent(); + + if ( !startContainer || !endContainer ) + return; + + // Now we can iterate over the individual items on the same tree depth. + var block = startContainer, + itemsToMove = [], + stopFlag = false; + while ( !stopFlag ) { - if ( ( child = children.getItem( i ) ) && child.is && child.is( 'li' ) ) - pendingLis.push( child ); + if ( block.equals( endContainer ) ) + stopFlag = true; + itemsToMove.push( block ); + block = block.getNext(); } - } - } - - if ( newList ) - newList.listNode.replace( listNode ); + if ( itemsToMove.length < 1 ) + return; + + // Do indent or outdent operations on the array model of the list, not the + // list's DOM tree itself. The array model demands that it knows as much as + // possible about the surrounding lists, we need to feed it the further + // ancestor node that is still a list. + var listParents = listNode.getParents( true ); + for ( var i = 0 ; i < listParents.length ; i++ ) + { + if ( listParents[i].getName && listNodeNames[ listParents[i].getName() ] ) + { + listNode = listParents[i]; + break; + } + } + var indentOffset = self.name == 'indent' ? 1 : -1, + startItem = itemsToMove[0], + lastItem = itemsToMove[ itemsToMove.length - 1 ]; - // Move the nested
  • to be appeared after the parent. - if ( pendingLis && pendingLis.length ) - { - for ( i = 0; i < pendingLis.length ; i++ ) - { - var li = pendingLis[ i ], - followingList = li; + // Convert the list DOM tree into a one dimensional array. + var listArray = CKEDITOR.plugins.list.listToArray( listNode, database ); - // Nest preceding
      /
        inside current
      1. if any. - while ( ( followingList = followingList.getNext() ) && - followingList.is && - followingList.getName() in listNodeNames ) + // Apply indenting or outdenting on the array. + var baseIndent = listArray[ lastItem.getCustomData( 'listarray_index' ) ].indent; + for ( i = startItem.getCustomData( 'listarray_index' ); i <= lastItem.getCustomData( 'listarray_index' ); i++ ) { - // IE requires a filler NBSP for nested list inside empty list item, - // otherwise the list item will be inaccessiable. (#4476) - if ( CKEDITOR.env.ie && !li.getFirst( function( node ){ return isNotWhitespaces( node ) && isNotBookmark( node ); } ) ) - li.append( range.document.createText( '\u00a0' ) ); - - li.append( followingList ); + listArray[ i ].indent += indentOffset; + // Make sure the newly created sublist get a brand-new element of the same type. (#5372) + var listRoot = listArray[ i ].parent; + listArray[ i ].parent = new CKEDITOR.dom.element( listRoot.getName(), listRoot.getDocument() ); } - li.insertAfter( parentLiElement ); - } - } - - // Clean up the markers. - CKEDITOR.dom.element.clearAllMarkers( database ); - } + for ( i = lastItem.getCustomData( 'listarray_index' ) + 1 ; + i < listArray.length && listArray[i].indent > baseIndent ; i++ ) + listArray[i].indent += indentOffset; - function indentBlock( editor, range ) - { - var iterator = range.createIterator(), - enterMode = editor.config.enterMode; - iterator.enforceRealBlocks = true; - iterator.enlargeBr = enterMode != CKEDITOR.ENTER_BR; - var block; - while ( ( block = iterator.getNextParagraph() ) ) - indentElement.call( this, editor, block ); - } + // Convert the array back to a DOM forest (yes we might have a few subtrees now). + // And replace the old list with the new forest. + var newList = CKEDITOR.plugins.list.arrayToList( listArray, database, null, editor.config.enterMode, 0 ); - function indentElement( editor, element ) - { - if ( this.useIndentClasses ) - { - // Transform current class name to indent step index. - var indentClass = element.$.className.match( this.classNameRegex ), - indentStep = 0; - if ( indentClass ) + // Avoid nested
      2. after outdent even they're visually same, + // recording them for later refactoring.(#3982) + if ( self.name == 'outdent' ) { - indentClass = indentClass[1]; - indentStep = this.indentClassMap[ indentClass ]; + var parentLiElement; + if ( ( parentLiElement = listNode.getParent() ) && parentLiElement.is( 'li' ) ) + { + var children = newList.listNode.getChildren(), + pendingLis = [], + count = children.count(), + child; + + for ( i = count - 1 ; i >= 0 ; i-- ) + { + if ( ( child = children.getItem( i ) ) && child.is && child.is( 'li' ) ) + pendingLis.push( child ); + } + } } - // Operate on indent step index, transform indent step index back to class - // name. - if ( this.name == 'outdent' ) - indentStep--; - else - indentStep++; - - if ( indentStep < 0 ) - return false; + if ( newList ) + newList.listNode.replace( listNode ); - indentStep = Math.min( indentStep, editor.config.indentClasses.length ); - indentStep = Math.max( indentStep, 0 ); - var className = CKEDITOR.tools.ltrim( element.$.className.replace( this.classNameRegex, '' ) ); - if ( indentStep < 1 ) - element.$.className = className; - else - element.addClass( editor.config.indentClasses[ indentStep - 1 ] ); + // Move the nested
      3. to be appeared after the parent. + if ( pendingLis && pendingLis.length ) + { + for ( i = 0; i < pendingLis.length ; i++ ) + { + var li = pendingLis[ i ], + followingList = li; + + // Nest preceding
          /
            inside current
          1. if any. + while ( ( followingList = followingList.getNext() ) && + followingList.is && + followingList.getName() in listNodeNames ) + { + // IE requires a filler NBSP for nested list inside empty list item, + // otherwise the list item will be inaccessiable. (#4476) + if ( CKEDITOR.env.ie && !li.getFirst( function( node ){ return isNotWhitespaces( node ) && isNotBookmark( node ); } ) ) + li.append( range.document.createText( '\u00a0' ) ); + + li.append( followingList ); + } + + li.insertAfter( parentLiElement ); + } + } } - else + + function indentBlock() { - var currentOffset = parseInt( element.getStyle( this.indentCssProperty ), 10 ); - if ( isNaN( currentOffset ) ) - currentOffset = 0; - currentOffset += ( this.name == 'indent' ? 1 : -1 ) * editor.config.indentOffset; - - if ( currentOffset < 0 ) - return false; - - currentOffset = Math.max( currentOffset, 0 ); - currentOffset = Math.ceil( currentOffset / editor.config.indentOffset ) * editor.config.indentOffset; - element.setStyle( this.indentCssProperty, currentOffset ? currentOffset + editor.config.indentUnit : '' ); - if ( element.getAttribute( 'style' ) === '' ) - element.removeAttribute( 'style' ); + var iterator = range.createIterator(), + enterMode = editor.config.enterMode; + iterator.enforceRealBlocks = true; + iterator.enlargeBr = enterMode != CKEDITOR.ENTER_BR; + var block; + while ( ( block = iterator.getNextParagraph() ) ) + indentElement( block ); } - return true; - } + function indentElement( element ) + { + if ( element.getCustomData( 'indent_processed' ) ) + return false; - function indentCommand( editor, name ) - { - this.name = name; - this.useIndentClasses = editor.config.indentClasses && editor.config.indentClasses.length > 0; - if ( this.useIndentClasses ) - { - this.classNameRegex = new RegExp( '(?:^|\\s+)(' + editor.config.indentClasses.join( '|' ) + ')(?=$|\\s)' ); - this.indentClassMap = {}; - for ( var i = 0 ; i < editor.config.indentClasses.length ; i++ ) - this.indentClassMap[ editor.config.indentClasses[i] ] = i + 1; - } - else - this.indentCssProperty = editor.config.contentsLangDirection == 'ltr' ? 'margin-left' : 'margin-right'; - this.startDisabled = name == 'outdent'; - } + if ( self.useIndentClasses ) + { + // Transform current class name to indent step index. + var indentClass = element.$.className.match( self.classNameRegex ), + indentStep = 0; + if ( indentClass ) + { + indentClass = indentClass[1]; + indentStep = self.indentClassMap[ indentClass ]; + } + + // Operate on indent step index, transform indent step index back to class + // name. + if ( self.name == 'outdent' ) + indentStep--; + else + indentStep++; + + if ( indentStep < 0 ) + return false; + + indentStep = Math.min( indentStep, editor.config.indentClasses.length ); + indentStep = Math.max( indentStep, 0 ); + var className = CKEDITOR.tools.ltrim( element.$.className.replace( self.classNameRegex, '' ) ); + if ( indentStep < 1 ) + element.$.className = className; + else + element.addClass( editor.config.indentClasses[ indentStep - 1 ] ); + } + else + { + var indentCssProperty = getIndentCssProperty( element ); + var currentOffset = parseInt( element.getStyle( indentCssProperty ), 10 ); + if ( isNaN( currentOffset ) ) + currentOffset = 0; + currentOffset += ( self.name == 'indent' ? 1 : -1 ) * editor.config.indentOffset; + + if ( currentOffset < 0 ) + return false; + + currentOffset = Math.max( currentOffset, 0 ); + currentOffset = Math.ceil( currentOffset / editor.config.indentOffset ) * editor.config.indentOffset; + element.setStyle( indentCssProperty, currentOffset ? currentOffset + editor.config.indentUnit : '' ); + if ( element.getAttribute( 'style' ) === '' ) + element.removeAttribute( 'style' ); + } - function isListItem( node ) - { - return node.type = CKEDITOR.NODE_ELEMENT && node.is( 'li' ); - } + CKEDITOR.dom.element.setMarker( database, element, 'indent_processed', true ); + return true; + } - indentCommand.prototype = { - exec : function( editor ) - { var selection = editor.getSelection(), - range = selection && selection.getRanges()[0]; - - var startContainer = range.startContainer, - endContainer = range.endContainer, - rangeRoot = range.getCommonAncestor(), - nearestListBlock = rangeRoot; - - while ( nearestListBlock && !( nearestListBlock.type == CKEDITOR.NODE_ELEMENT && - listNodeNames[ nearestListBlock.getName() ] ) ) - nearestListBlock = nearestListBlock.getParent(); - - // Avoid selection anchors under list root. - //
              [
            • ...
            • ]
            =>
            • [...]
            - if ( nearestListBlock && startContainer.type == CKEDITOR.NODE_ELEMENT - && startContainer.getName() in listNodeNames ) - { - var walker = new CKEDITOR.dom.walker( range ); - walker.evaluator = isListItem; - range.startContainer = walker.next(); - } + bookmarks = selection.createBookmarks( true ), + ranges = selection && selection.getRanges( true ), + range; - if ( nearestListBlock && endContainer.type == CKEDITOR.NODE_ELEMENT - && endContainer.getName() in listNodeNames ) + var iterator = ranges.createIterator(); + while ( ( range = iterator.getNextRange() ) ) { - walker = new CKEDITOR.dom.walker( range ); - walker.evaluator = isListItem; - range.endContainer = walker.previous(); - } + var startContainer = range.startContainer, + endContainer = range.endContainer, + rangeRoot = range.getCommonAncestor(), + nearestListBlock = rangeRoot; + + while ( nearestListBlock && !( nearestListBlock.type == CKEDITOR.NODE_ELEMENT && + listNodeNames[ nearestListBlock.getName() ] ) ) + nearestListBlock = nearestListBlock.getParent(); + + // Avoid selection anchors under list root. + //
              [
            • ...
            • ]
            =>
            • [...]
            + if ( nearestListBlock && startContainer.type == CKEDITOR.NODE_ELEMENT + && startContainer.getName() in listNodeNames ) + { + var walker = new CKEDITOR.dom.walker( range ); + walker.evaluator = isListItem; + range.startContainer = walker.next(); + } - var bookmarks = selection.createBookmarks( true ); + if ( nearestListBlock && endContainer.type == CKEDITOR.NODE_ELEMENT + && endContainer.getName() in listNodeNames ) + { + walker = new CKEDITOR.dom.walker( range ); + walker.evaluator = isListItem; + range.endContainer = walker.previous(); + } - if ( nearestListBlock ) - { - var firstListItem = nearestListBlock.getFirst( function( node ) - { - return node.type == CKEDITOR.NODE_ELEMENT && node.is( 'li' ); - }), - rangeStart = range.startContainer, - indentWholeList = firstListItem.equals( rangeStart ) || firstListItem.contains( rangeStart ); - - // Indent the entire list if cursor is inside the first list item. (#3893) - if ( !( indentWholeList && indentElement.call( this, editor, nearestListBlock ) ) ) - indentList.call( this, editor, range, nearestListBlock ); + if ( nearestListBlock ) + { + var firstListItem = nearestListBlock.getFirst( function( node ) + { + return node.type == CKEDITOR.NODE_ELEMENT && node.is( 'li' ); + }), + rangeStart = range.startContainer, + indentWholeList = firstListItem.equals( rangeStart ) || firstListItem.contains( rangeStart ); + + // Indent the entire list if cursor is inside the first list item. (#3893) + if ( !( indentWholeList && indentElement( nearestListBlock ) ) ) + indentList( nearestListBlock ); + } + else + indentBlock(); } - else - indentBlock.call( this, editor, range ); - editor.focus(); + // Clean up the markers. + CKEDITOR.dom.element.clearAllMarkers( database ); + editor.forceNextSelectionCheck(); selection.selectBookmarks( bookmarks ); } diff --git a/_source/plugins/justify/plugin.js b/_source/plugins/justify/plugin.js index a3ff0dd..8d306b9 100644 --- a/_source/plugins/justify/plugin.js +++ b/_source/plugins/justify/plugin.js @@ -9,8 +9,6 @@ For licensing, see LICENSE.html or http://ckeditor.com/license (function() { - var alignRemoveRegex = /(-moz-|-webkit-|start|auto)/i; - function getState( editor, path ) { var firstBlock = path.block || path.blockLimit; @@ -18,10 +16,24 @@ For licensing, see LICENSE.html or http://ckeditor.com/license if ( !firstBlock || firstBlock.getName() == 'body' ) return CKEDITOR.TRISTATE_OFF; - var currentAlign = firstBlock.getComputedStyle( 'text-align' ).replace( alignRemoveRegex, '' ); - if ( ( !currentAlign && this.isDefaultAlign ) || currentAlign == this.value ) - return CKEDITOR.TRISTATE_ON; - return CKEDITOR.TRISTATE_OFF; + return ( getAlignment( firstBlock, editor.config.useComputedState ) == this.value ) ? + CKEDITOR.TRISTATE_ON : + CKEDITOR.TRISTATE_OFF; + } + + function getAlignment( element, useComputedState ) + { + useComputedState = useComputedState === undefined || useComputedState; + + var align = useComputedState ? + element.getComputedStyle( 'text-align' ) : + element.getStyle( 'text-align' ) || element.getAttribute( 'align' ) || ''; + + align && ( align = align.replace( /-moz-|-webkit-|start|auto/i, '' ) ); + + !align && useComputedState && ( align = element.getComputedStyle( 'direction' ) == 'rtl' ? 'right' : 'left' ); + + return align; } function onSelectionChange( evt ) @@ -36,10 +48,6 @@ For licensing, see LICENSE.html or http://ckeditor.com/license this.name = name; this.value = value; - var contentDir = editor.config.contentsLangDirection; - this.isDefaultAlign = ( value == 'left' && contentDir == 'ltr' ) || - ( value == 'right' && contentDir == 'rtl' ); - var classes = editor.config.justifyClasses; if ( classes ) { @@ -73,12 +81,15 @@ For licensing, see LICENSE.html or http://ckeditor.com/license return; var bookmarks = selection.createBookmarks(), - ranges = selection.getRanges(); - + ranges = selection.getRanges( true ); var cssClassName = this.cssClassName, iterator, block; + + var useComputedState = editor.config.useComputedState; + useComputedState = useComputedState === undefined || useComputedState; + for ( var i = ranges.length - 1 ; i >= 0 ; i-- ) { iterator = ranges[ i ].createIterator(); @@ -87,26 +98,26 @@ For licensing, see LICENSE.html or http://ckeditor.com/license while ( ( block = iterator.getNextParagraph() ) ) { block.removeAttribute( 'align' ); + block.removeStyle( 'text-align' ); + + // Remove any of the alignment classes from the className. + var className = cssClassName && ( block.$.className = + CKEDITOR.tools.ltrim( block.$.className.replace( this.cssClassRegex, '' ) ) ); + + var apply = + ( this.state == CKEDITOR.TRISTATE_OFF ) && + ( !useComputedState || ( getAlignment( block, true ) != this.value ) ); if ( cssClassName ) { - // Remove any of the alignment classes from the className. - var className = block.$.className = - CKEDITOR.tools.ltrim( block.$.className.replace( this.cssClassRegex, '' ) ); - // Append the desired class name. - if ( this.state == CKEDITOR.TRISTATE_OFF && !this.isDefaultAlign ) + if ( apply ) block.addClass( cssClassName ); else if ( !className ) block.removeAttribute( 'class' ); } - else - { - if ( this.state == CKEDITOR.TRISTATE_OFF && !this.isDefaultAlign ) - block.setStyle( 'text-align', this.value ); - else - block.removeStyle( 'text-align' ); - } + else if ( apply ) + block.setStyle( 'text-align', this.value ); } } diff --git a/_source/plugins/link/dialogs/link.js b/_source/plugins/link/dialogs/link.js index 3b05df2..ed24860 100644 --- a/_source/plugins/link/dialogs/link.js +++ b/_source/plugins/link/dialogs/link.js @@ -1294,7 +1294,7 @@ CKEDITOR.dialog.add( 'link', function( editor ) { // Create element if current selection is collapsed. var selection = editor.getSelection(), - ranges = selection.getRanges(); + ranges = selection.getRanges( true ); if ( ranges.length == 1 && ranges[0].collapsed ) { // Short mailto link text view (#5736). diff --git a/_source/plugins/link/plugin.js b/_source/plugins/link/plugin.js index c7f7adb..c8e145f 100644 --- a/_source/plugins/link/plugin.js +++ b/_source/plugins/link/plugin.js @@ -58,7 +58,7 @@ CKEDITOR.plugins.add( 'link', * for this in Firefox. So we must detect the state by element paths. */ var command = editor.getCommand( 'unlink' ), - element = evt.data.path.lastElement.getAscendant( 'a', true ); + element = evt.data.path.lastElement && evt.data.path.lastElement.getAscendant( 'a', true ); if ( element && element.getName() == 'a' && element.getAttribute( 'href' ) ) command.setState( CKEDITOR.TRISTATE_OFF ); else @@ -110,7 +110,7 @@ CKEDITOR.plugins.add( 'link', { editor.contextMenu.addListener( function( element, selection ) { - if ( !element ) + if ( !element || element.isReadOnly() ) return null; var isAnchor = ( element.is( 'img' ) && element.getAttribute( '_cke_real_element_type' ) == 'anchor' ); @@ -177,12 +177,14 @@ CKEDITOR.plugins.link = getSelectedLink : function( editor ) { var range; - try { range = editor.getSelection().getRanges()[ 0 ]; } + try + { + range = editor.getSelection().getRanges( true )[ 0 ]; + range.shrink( CKEDITOR.SHRINK_TEXT ); + var root = range.getCommonAncestor(); + return root.getAscendant( 'a', true ); + } catch( e ) { return null; } - - range.shrink( CKEDITOR.SHRINK_TEXT ); - var root = range.getCommonAncestor(); - return root.getAscendant( 'a', true ); } }; diff --git a/_source/plugins/list/plugin.js b/_source/plugins/list/plugin.js index 4c728fa..0cd962f 100644 --- a/_source/plugins/list/plugin.js +++ b/_source/plugins/list/plugin.js @@ -67,7 +67,7 @@ For licensing, see LICENSE.html or http://ckeditor.com/license }, // Convert our internal representation of a list back to a DOM forest. - arrayToList : function( listArray, database, baseIndex, paragraphMode ) + arrayToList : function( listArray, database, baseIndex, paragraphMode, dir ) { if ( !baseIndex ) baseIndex = 0; @@ -109,8 +109,12 @@ For licensing, see LICENSE.html or http://ckeditor.com/license else { // Create completely new blocks here, attributes are dropped. - if ( paragraphMode != CKEDITOR.ENTER_BR && item.grandparent.getName() != 'td' ) + if ( dir || ( paragraphMode != CKEDITOR.ENTER_BR && item.grandparent.getName() != 'td' ) ) + { currentListItem = doc.createElement( paragraphName ); + if ( dir ) + currentListItem.setAttribute( 'dir', dir ); + } else currentListItem = new CKEDITOR.dom.documentFragment( doc ); } @@ -286,7 +290,8 @@ For licensing, see LICENSE.html or http://ckeditor.com/license // Insert the list to the DOM tree. var insertAnchor = listContents[ listContents.length - 1 ].getNext(), - listNode = doc.createElement( this.type ); + listNode = doc.createElement( this.type ), + dir; listsCreated.push( listNode ); while ( listContents.length ) @@ -299,6 +304,11 @@ For licensing, see LICENSE.html or http://ckeditor.com/license contentBlock.appendTo( listItem ); else { + if ( contentBlock.hasAttribute( 'dir' ) ) + { + dir = dir || contentBlock.getAttribute( 'dir' ); + contentBlock.removeAttribute( 'dir' ); + } contentBlock.copyAttributes( listItem ); contentBlock.moveChildren( listItem ); contentBlock.remove(); @@ -310,6 +320,10 @@ For licensing, see LICENSE.html or http://ckeditor.com/license if ( !CKEDITOR.env.ie ) listItem.appendBogus(); } + + if ( dir ) + listNode.setAttribute( 'dir', dir ); + if ( insertAnchor ) listNode.insertBefore( insertAnchor ); else @@ -359,7 +373,8 @@ For licensing, see LICENSE.html or http://ckeditor.com/license } } - var newList = CKEDITOR.plugins.list.arrayToList( listArray, database, null, editor.config.enterMode ); + var newList = CKEDITOR.plugins.list.arrayToList( listArray, database, null, editor.config.enterMode, + groupObj.root.getAttribute( 'dir' ) ); // Compensate
            before/after the list node if the surrounds are non-blocks.(#3836) var docFragment = newList.listNode, boundaryNode, siblingNode; @@ -391,7 +406,7 @@ For licensing, see LICENSE.html or http://ckeditor.com/license var doc = editor.document, selection = editor.getSelection(), - ranges = selection && selection.getRanges(); + ranges = selection && selection.getRanges( true ); // There should be at least one selected range. if ( !ranges || ranges.length < 1 ) @@ -439,11 +454,22 @@ For licensing, see LICENSE.html or http://ckeditor.com/license // Group the blocks up because there are many cases where multiple lists have to be created, // or multiple lists have to be cancelled. var listGroups = [], - database = {}; + database = {}, + rangeIterator = ranges.createIterator(), + index = 0; - while ( ranges.length > 0 ) + while ( ( range = rangeIterator.getNextRange() ) && ++index ) { - range = ranges.shift(); + var boundaryNodes = range.getBoundaryNodes(), + startNode = boundaryNodes.startNode, + endNode = boundaryNodes.endNode; + + if ( startNode.type == CKEDITOR.NODE_ELEMENT && startNode.getName() == 'td' ) + range.setStartAt( boundaryNodes.startNode, CKEDITOR.POSITION_AFTER_START ); + + if ( endNode.type == CKEDITOR.NODE_ELEMENT && endNode.getName() == 'td' ) + range.setEndAt( boundaryNodes.endNode, CKEDITOR.POSITION_BEFORE_END ); + var iterator = range.createIterator(), block; @@ -451,6 +477,12 @@ For licensing, see LICENSE.html or http://ckeditor.com/license while ( ( block = iterator.getNextParagraph() ) ) { + // Avoid duplicate blocks get processed across ranges. + if( block.getCustomData( 'list_block' ) ) + continue; + else + CKEDITOR.dom.element.setMarker( database, block, 'list_block', 1 ); + var path = new CKEDITOR.dom.elementPath( block ), pathElements = path.elements, pathElementsCount = pathElements.length, @@ -470,7 +502,7 @@ For licensing, see LICENSE.html or http://ckeditor.com/license // no longer be valid. Since paragraphs after the list // should belong to a different group of paragraphs before // the list. (Bug #1309) - blockLimit.removeCustomData( 'list_group_object' ); + blockLimit.removeCustomData( 'list_group_object_' + index ); var groupObj = element.getCustomData( 'list_group_object' ); if ( groupObj ) @@ -489,14 +521,14 @@ For licensing, see LICENSE.html or http://ckeditor.com/license if ( processedFlag ) continue; - // No list ancestor? Group by block limit. + // No list ancestor? Group by block limit, but don't mix contents from different ranges. var root = blockLimit; - if ( root.getCustomData( 'list_group_object' ) ) - root.getCustomData( 'list_group_object' ).contents.push( block ); + if ( root.getCustomData( 'list_group_object_' + index ) ) + root.getCustomData( 'list_group_object_' + index ).contents.push( block ); else { groupObj = { root : root, contents : [ block ] }; - CKEDITOR.dom.element.setMarker( database, root, 'list_group_object', groupObj ); + CKEDITOR.dom.element.setMarker( database, root, 'list_group_object_' + index, groupObj ); listGroups.push( groupObj ); } } @@ -530,7 +562,7 @@ For licensing, see LICENSE.html or http://ckeditor.com/license var sibling = listNode[ rtl ? 'getPrevious' : 'getNext' ]( CKEDITOR.dom.walker.whitespaces( true ) ); if ( sibling && sibling.getName && - sibling.getName() == listCommand.type ) + sibling.getName() == listCommand.type ) { sibling.remove(); // Move children order by merge direction.(#3820) diff --git a/_source/plugins/liststyle/plugin.js b/_source/plugins/liststyle/plugin.js index b1b6df3..8e23cca 100644 --- a/_source/plugins/liststyle/plugin.js +++ b/_source/plugins/liststyle/plugin.js @@ -43,6 +43,9 @@ For licensing, see LICENSE.html or http://ckeditor.com/license { editor.contextMenu.addListener( function( element, selection ) { + if ( !element || element.isReadOnly() ) + return null; + while ( element ) { var name = element.getName(); diff --git a/_source/plugins/pagebreak/plugin.js b/_source/plugins/pagebreak/plugin.js index 5587330..8c0c9f7 100644 --- a/_source/plugins/pagebreak/plugin.js +++ b/_source/plugins/pagebreak/plugin.js @@ -82,15 +82,15 @@ CKEDITOR.plugins.pagebreakCmd = // Creates the fake image used for this element. breakObject = editor.createFakeElement( breakObject, 'cke_pagebreak', 'div' ); - var ranges = editor.getSelection().getRanges(); + var ranges = editor.getSelection().getRanges( true ); editor.fire( 'saveSnapshot' ); - for ( var range, i = 0 ; i < ranges.length ; i++ ) + for ( var range, i = ranges.length - 1 ; i >= 0; i-- ) { range = ranges[ i ]; - if ( i > 0 ) + if ( i < ranges.length -1 ) breakObject = breakObject.clone( true ); range.splitBlock( 'p' ); diff --git a/_source/plugins/removeformat/plugin.js b/_source/plugins/removeformat/plugin.js index d54bfb3..28b4ea7 100644 --- a/_source/plugins/removeformat/plugin.js +++ b/_source/plugins/removeformat/plugin.js @@ -35,9 +35,11 @@ CKEDITOR.plugins.removeformat = ( editor._.removeAttributes = editor.config.removeFormatAttributes.split( ',' ) ); var filter = CKEDITOR.plugins.removeformat.filter; - var ranges = editor.getSelection().getRanges(); + var ranges = editor.getSelection().getRanges( true ), + iterator = ranges.createIterator(), + range; - for ( var i = 0, range ; range = ranges[ i ] ; i++ ) + while ( ( range = iterator.getNextRange() ) ) { if ( range.collapsed ) continue; diff --git a/_source/plugins/scayt/plugin.js b/_source/plugins/scayt/plugin.js index 671815b..8486ad9 100644 --- a/_source/plugins/scayt/plugin.js +++ b/_source/plugins/scayt/plugin.js @@ -624,9 +624,10 @@ CKEDITOR.plugins.scayt = // If the "contextmenu" plugin is loaded, register the listeners. if ( editor.contextMenu && editor.addMenuItems ) { - editor.contextMenu.addListener( function( ) + editor.contextMenu.addListener( function( element, selection ) { - if ( !plugin.isScaytEnabled( editor ) ) + if ( !plugin.isScaytEnabled( editor ) + || selection.getCommonAncestor().isReadOnly() ) return null; var scayt_control = plugin.getScayt( editor ), diff --git a/_source/plugins/selection/plugin.js b/_source/plugins/selection/plugin.js index 3d707fc..d4a92f8 100644 --- a/_source/plugins/selection/plugin.js +++ b/_source/plugins/selection/plugin.js @@ -525,8 +525,9 @@ For licensing, see LICENSE.html or http://ckeditor.com/license * var ranges = selection.getRanges(); * alert(ranges.length); */ - getRanges : - CKEDITOR.env.ie ? + getRanges : (function () + { + var func = CKEDITOR.env.ie ? ( function() { // Finds the container and offset for a specific boundary @@ -614,10 +615,6 @@ For licensing, see LICENSE.html or http://ckeditor.com/license return function() { - var cache = this._.cache; - if ( cache.ranges ) - return cache.ranges; - // IE doesn't have range support (in the W3C way), so we // need to do some magic to transform selections into // CKEDITOR.dom.range instances. @@ -640,11 +637,11 @@ For licensing, see LICENSE.html or http://ckeditor.com/license boundaryInfo = getBoundaryInformation( nativeRange ); range.setEnd( new CKEDITOR.dom.node( boundaryInfo.container ), boundaryInfo.offset ); - return ( cache.ranges = [ range ] ); + return [ range ]; } else if ( type == CKEDITOR.SELECTION_ELEMENT ) { - var retval = this._.cache.ranges = []; + var retval = []; for ( var i = 0 ; i < nativeRange.length ; i++ ) { @@ -665,15 +662,12 @@ For licensing, see LICENSE.html or http://ckeditor.com/license return retval; } - return ( cache.ranges = [] ); + return []; }; })() : function() { - var cache = this._.cache; - if ( cache.ranges ) - return cache.ranges; // On browsers implementing the W3C range, we simply // tranform the native ranges in CKEDITOR.dom.range @@ -694,9 +688,101 @@ For licensing, see LICENSE.html or http://ckeditor.com/license range.setEnd( new CKEDITOR.dom.node( nativeRange.endContainer ), nativeRange.endOffset ); ranges.push( range ); } + return ranges; + }; - return ( cache.ranges = ranges ); - }, + return function( onlyEditables ) + { + var cache = this._.cache; + if ( cache.ranges && !onlyEditables ) + return cache.ranges; + else if ( !cache.ranges ) + cache.ranges = new CKEDITOR.dom.rangeList( func.call( this ) ); + + // Split range into multiple by read-only nodes. + if ( onlyEditables ) + { + var ranges = cache.ranges; + for ( var i = 0; i < ranges.length; i++ ) + { + var range = ranges[ i ]; + + // Drop range spans inside one ready-only node. + var parent = range.getCommonAncestor(); + if ( parent.isReadOnly()) + ranges.splice( i, 1 ); + + if ( range.collapsed ) + continue; + + var startContainer = range.startContainer, + endContainer = range.endContainer, + startOffset = range.startOffset, + endOffset = range.endOffset, + walkerRange = range.clone(); + + // Range may start inside a non-editable element, restart range + // by the end of it. + var readOnly; + if ( ( readOnly = startContainer.isReadOnly() ) ) + range.setStartAfter( readOnly ); + + // Enlarge range start/end with text node to avoid walker + // being DOM destructive, it doesn't interfere our checking + // of elements below as well. + if ( startContainer && startContainer.type == CKEDITOR.NODE_TEXT ) + { + if ( startOffset >= startContainer.getLength() ) + walkerRange.setStartAfter( startContainer ); + else + walkerRange.setStartBefore( startContainer ); + } + + if ( endContainer && endContainer.type == CKEDITOR.NODE_TEXT ) + { + if ( !endOffset ) + walkerRange.setEndBefore( endContainer ); + else + walkerRange.setEndAfter( endContainer ); + } + + // Looking for non-editable element inside the range. + var walker = new CKEDITOR.dom.walker( walkerRange ); + walker.evaluator = function( node ) + { + if ( node.type == CKEDITOR.NODE_ELEMENT + && node.getAttribute( 'contenteditable' ) == 'false' ) + { + var newRange = range.clone(); + range.setEndBefore( node ); + + // Drop collapsed range around read-only elements, + // it make sure the range list empty when selecting + // only non-editable elements. + if ( range.collapsed ) + ranges.splice( i--, 1 ); + + // Avoid creating invalid range. + if ( !( node.getPosition( walkerRange.endContainer ) & CKEDITOR.POSITION_CONTAINS ) ) + { + newRange.setStartAfter( node ); + if ( !newRange.collapsed ) + ranges.splice( i + 1, 0, newRange ); + } + + return true; + } + + return false; + }; + + walker.next(); + } + } + + return cache.ranges; + }; + })(), /** * Gets the DOM element in which the selection starts. @@ -900,7 +986,7 @@ For licensing, see LICENSE.html or http://ckeditor.com/license this._.cache.selectedElement = element; this._.cache.startElement = element; - this._.cache.ranges = [ range ]; + this._.cache.ranges = new CKEDITOR.dom.rangeList( range ); this._.cache.type = CKEDITOR.SELECTION_ELEMENT; return; @@ -956,8 +1042,8 @@ For licensing, see LICENSE.html or http://ckeditor.com/license if ( this.isLocked ) { this._.cache.selectedElement = null; - this._.cache.startElement = ranges[ 0 ].getTouchedStartNode(); - this._.cache.ranges = ranges; + this._.cache.startElement = ranges[ 0 ] && ranges[ 0 ].getTouchedStartNode(); + this._.cache.ranges = new CKEDITOR.dom.rangeList( ranges ); this._.cache.type = CKEDITOR.SELECTION_TEXT; return; @@ -965,8 +1051,14 @@ For licensing, see LICENSE.html or http://ckeditor.com/license if ( CKEDITOR.env.ie ) { - // IE doesn't accept multiple ranges selection, so we just - // select the first one. + if ( ranges.length > 1 ) + { + // IE doesn't accept multiple ranges selection, so we join all into one. + var last = ranges[ ranges.length -1 ] ; + ranges[ 0 ].setEnd( last.endContainer, last.endOffset ); + ranges.length = 1; + } + if ( ranges[ 0 ] ) ranges[ 0 ].select(); @@ -975,10 +1067,35 @@ For licensing, see LICENSE.html or http://ckeditor.com/license else { var sel = this.getNative(); - sel.removeAllRanges(); + + if ( ranges.length ) + sel.removeAllRanges(); for ( var i = 0 ; i < ranges.length ; i++ ) { + // Joining sequential ranges introduced by + // readonly elements protection. + if ( i < ranges.length -1 ) + { + var left = ranges[ i ], right = ranges[ i +1 ], + between = left.clone(); + between.setStart( left.endContainer, left.endOffset ); + between.setEnd( right.startContainer, right.startOffset ); + + // Don't confused by Firefox adjancent multi-ranges + // introduced by table cells selection. + if ( !between.collapsed ) + { + between.shrink( CKEDITOR.NODE_ELEMENT, true ); + if ( between.getCommonAncestor().isReadOnly()) + { + right.setStart( left.startContainer, left.startOffset ); + ranges.splice( i--, 1 ); + continue; + } + } + } + var range = ranges[ i ]; var nativeRange = this.document.$.createRange(); var startContainer = range.startContainer; @@ -1013,34 +1130,7 @@ For licensing, see LICENSE.html or http://ckeditor.com/license */ createBookmarks : function( serializable ) { - var retval = [], - ranges = this.getRanges(), - length = ranges.length, - bookmark; - for ( var i = 0; i < length ; i++ ) - { - retval.push( bookmark = ranges[ i ].createBookmark( serializable, true ) ); - - serializable = bookmark.serializable; - - var bookmarkStart = serializable ? this.document.getById( bookmark.startNode ) : bookmark.startNode, - bookmarkEnd = serializable ? this.document.getById( bookmark.endNode ) : bookmark.endNode; - - // Updating the offset values for rest of ranges which have been mangled(#3256). - for ( var j = i + 1 ; j < length ; j++ ) - { - var dirtyRange = ranges[ j ], - rangeStart = dirtyRange.startContainer, - rangeEnd = dirtyRange.endContainer; - - rangeStart.equals( bookmarkStart.getParent() ) && dirtyRange.startOffset++; - rangeStart.equals( bookmarkEnd.getParent() ) && dirtyRange.startOffset++; - rangeEnd.equals( bookmarkStart.getParent() ) && dirtyRange.endOffset++; - rangeEnd.equals( bookmarkEnd.getParent() ) && dirtyRange.endOffset++; - } - } - - return retval; + return this.getRanges().createBookmarks( serializable ); }, /** @@ -1051,13 +1141,7 @@ For licensing, see LICENSE.html or http://ckeditor.com/license */ createBookmarks2 : function( normalized ) { - var bookmarks = [], - ranges = this.getRanges(); - - for ( var i = 0 ; i < ranges.length ; i++ ) - bookmarks.push( ranges[i].createBookmark2( normalized ) ); - - return bookmarks; + return this.getRanges().createBookmarks2( normalized ); }, /** diff --git a/_source/plugins/showborders/plugin.js b/_source/plugins/showborders/plugin.js index e7e9eec..9219206 100644 --- a/_source/plugins/showborders/plugin.js +++ b/_source/plugins/showborders/plugin.js @@ -161,6 +161,32 @@ For licensing, see LICENSE.html or http://ckeditor.com/license selectedTable[ ( !value || value <= 0 ) ? 'addClass' : 'removeClass' ]( showBorderClassName ); }; } ); + + var advTab = dialogDefinition.getContents( 'advanced' ), + classField = advTab && advTab.get( 'advCSSClasses' ); + + if ( classField ) + { + classField.setup = CKEDITOR.tools.override( classField.setup, function( originalSetup ) + { + return function() + { + originalSetup.apply( this, arguments ); + this.setValue( this.getValue().replace( /cke_show_border/, '' ) ); + }; + }); + + classField.commit = CKEDITOR.tools.override( classField.commit, function( originalCommit ) + { + return function( data, element ) + { + originalCommit.apply( this, arguments ); + + if ( !parseInt( element.getAttribute( 'border' ), 10 ) ) + element.addClass( 'cke_show_border' ); + }; + }); + } } }); diff --git a/_source/plugins/smiley/dialogs/smiley.js b/_source/plugins/smiley/dialogs/smiley.js index 5d05d95..8371fb1 100644 --- a/_source/plugins/smiley/dialogs/smiley.js +++ b/_source/plugins/smiley/dialogs/smiley.js @@ -131,7 +131,7 @@ CKEDITOR.dialog.add( 'smiley', function( editor ) }); // Build the HTML for the smiley images table. - var labelId = 'smiley_emtions_label' + CKEDITOR.tools.getNextNumber(); + var labelId = CKEDITOR.tools.getNextId() + '_smiley_emtions_label'; var html = [ '
            ' + diff --git a/_source/plugins/specialchar/dialogs/specialchar.js b/_source/plugins/specialchar/dialogs/specialchar.js index 7c37603..ae15b02 100644 --- a/_source/plugins/specialchar/dialogs/specialchar.js +++ b/_source/plugins/specialchar/dialogs/specialchar.js @@ -15,22 +15,25 @@ CKEDITOR.dialog.add( 'specialchar', function( editor ) var insertSpecialChar = function ( specialChar ) { var selection = editor.getSelection(), - ranges = selection.getRanges(), + ranges = selection.getRanges( true ), range, textNode; editor.fire( 'saveSnapshot' ); - for ( var i = 0, len = ranges.length ; i < len ; i++ ) + for ( var i = ranges.length - 1; i >= 0 ; i-- ) { range = ranges[ i ]; range.deleteContents(); - textNode = CKEDITOR.dom.element.createFromHtml( specialChar ); + textNode = CKEDITOR.dom.element.createFromHtml( specialChar ); range.insertNode( textNode ); } - range.moveToPosition( textNode, CKEDITOR.POSITION_AFTER_END ); - range.select(); + if ( range ) + { + range.moveToPosition( textNode, CKEDITOR.POSITION_AFTER_END ); + range.select(); + } editor.fire( 'saveSnapshot' ); }; @@ -262,7 +265,7 @@ CKEDITOR.dialog.add( 'specialchar', function( editor ) var columns = this.definition.charColumns, chars = this.definition.chars; - var charsTableLabel = 'specialchar_table_label' + CKEDITOR.tools.getNextNumber(); + var charsTableLabel = CKEDITOR.tools.getNextId() + '_specialchar_table_label'; var html = [ '' ]; diff --git a/_source/plugins/styles/plugin.js b/_source/plugins/styles/plugin.js index 3af696c..3c6fedb 100644 --- a/_source/plugins/styles/plugin.js +++ b/_source/plugins/styles/plugin.js @@ -376,9 +376,6 @@ CKEDITOR.STYLE_OBJECT = 3; // Get the DTD definition for the element. Defaults to "span". var dtd = CKEDITOR.dtd[ elementName ] || ( isUnknownElement = true, CKEDITOR.dtd.span ); - // Bookmark the range so we can re-select it after processing. - var bookmark = range.createBookmark(); - // Expand the range. range.enlarge( CKEDITOR.ENLARGE_ELEMENT ); range.trim(); @@ -544,9 +541,9 @@ CKEDITOR.STYLE_OBJECT = 3; } } - firstNode.remove(); - lastNode.remove(); - range.moveToBookmark( bookmark ); + // Remove the bookmark nodes. + range.moveToBookmark( boundaryNodes ); + // Minimize the result range to exclude empty text nodes. (#5374) range.shrink( CKEDITOR.SHRINK_TEXT ); } @@ -585,12 +582,14 @@ CKEDITOR.STYLE_OBJECT = 3; if ( this.checkElementRemovable( element ) ) { - var endOfElement = range.checkBoundaryOfElement( element, CKEDITOR.END ), - startOfElement = !endOfElement && range.checkBoundaryOfElement( element, CKEDITOR.START ); - if ( startOfElement || endOfElement ) + var isStart; + + if ( range.collapsed && ( + range.checkBoundaryOfElement( element, CKEDITOR.END ) || + ( isStart = range.checkBoundaryOfElement( element, CKEDITOR.START ) ) ) ) { boundaryElement = element; - boundaryElement.match = startOfElement ? 'start' : 'end'; + boundaryElement.match = isStart ? 'start' : 'end'; } else { @@ -1274,17 +1273,24 @@ CKEDITOR.STYLE_OBJECT = 3; function applyStyle( document, remove ) { - // Get all ranges from the selection. - var selection = document.getSelection(); - var ranges = selection.getRanges(); - var func = remove ? this.removeFromRange : this.applyToRange; - - // Apply the style to the ranges. - for ( var i = 0 ; i < ranges.length ; i++ ) - func.call( this, ranges[ i ] ); - - // Select the ranges again. - selection.selectRanges( ranges ); + var selection = document.getSelection(), + // Bookmark the range so we can re-select it after processing. + bookmarks = selection.createBookmarks(), + ranges = selection.getRanges( true ), + func = remove ? this.removeFromRange : this.applyToRange, + range; + + var iterator = ranges.createIterator(); + while ( ( range = iterator.getNextRange() ) ) + func.call( this, range ); + + if ( bookmarks.length == 1 && bookmarks[0].collapsed ) + { + selection.selectRanges( ranges ); + bookmarks[0].startNode.remove(); + } + else + selection.selectBookmarks( bookmarks ); } })(); diff --git a/_source/plugins/tab/plugin.js b/_source/plugins/tab/plugin.js index c66fb43..f63cd5b 100644 --- a/_source/plugins/tab/plugin.js +++ b/_source/plugins/tab/plugin.js @@ -27,13 +27,86 @@ For licensing, see LICENSE.html or http://ckeditor.com/license } }; + function selectNextCellCommand( backward ) + { + return { + editorFocus : false, + canUndo : false, + modes : { wysiwyg : 1 }, + exec : function( editor ) + { + if ( editor.focusManager.hasFocus ) + { + var sel = editor.getSelection(), + ancestor = sel.getCommonAncestor(), + cell; + + if ( ( cell = ( ancestor.getAscendant( 'td', true ) || ancestor.getAscendant( 'th', true ) ) ) ) + { + var resultRange = new CKEDITOR.dom.range( editor.document ), + next = CKEDITOR.tools.tryThese( function() + { + var row = cell.getParent(), + next = row.$.cells[ cell.$.cellIndex + ( backward ? - 1 : 1 ) ]; + + // Invalid any empty value. + next.parentNode.parentNode; + return next; + }, + function() + { + var row = cell.getParent(), + table = row.getAscendant( 'table' ), + nextRow = table.$.rows[ row.$.rowIndex + ( backward ? - 1 : 1 ) ]; + + return nextRow.cells[ backward? nextRow.cells.length -1 : 0 ]; + }); + + // Clone one more row at the end of table and select the first newly established cell. + if ( ! ( next || backward ) ) + { + var table = cell.getAscendant( 'table' ).$, + cells = cell.getParent().$.cells; + + var newRow = new CKEDITOR.dom.element( table.insertRow( -1 ), editor.document ); + + for ( var i = 0, count = cells.length ; i < count; i++ ) + { + var newCell = newRow.append( new CKEDITOR.dom.element( + cells[ i ], editor.document ).clone( false, false ) ); + !CKEDITOR.env.ie && newCell.appendBogus(); + } + + resultRange.moveToElementEditStart( newRow ); + } + else if ( next ) + { + next = new CKEDITOR.dom.element( next ); + resultRange.moveToElementEditStart( next ); + // Avoid selecting empty block makes the cursor blind. + if ( !( resultRange.checkStartOfBlock() && resultRange.checkEndOfBlock() ) ) + resultRange.selectNodeContents( next ); + } + else + return true; + + resultRange.select( true ); + return true; + } + } + return false; + } + }; + } + CKEDITOR.plugins.add( 'tab', { requires : [ 'keystrokes' ], init : function( editor ) { - var tabSpaces = editor.config.tabSpaces || 0, + var tabTools = editor.config.enableTabKeyTools !== false, + tabSpaces = editor.config.tabSpaces || 0, tabText = ''; while ( tabSpaces-- ) @@ -51,6 +124,16 @@ For licensing, see LICENSE.html or http://ckeditor.com/license }); } + if ( tabTools ) + { + editor.on( 'key', function( ev ) + { + if ( ev.data.keyCode == 9 && editor.execCommand( 'selectNextCell' ) || // TAB + ev.data.keyCode == ( CKEDITOR.SHIFT + 9 ) && editor.execCommand( 'selectPreviousCell' ) ) // SHIFT+TAB + ev.cancel(); + }); + } + if ( CKEDITOR.env.webkit || CKEDITOR.env.gecko ) { editor.on( 'key', function( ev ) @@ -73,6 +156,8 @@ For licensing, see LICENSE.html or http://ckeditor.com/license editor.addCommand( 'blur', CKEDITOR.tools.extend( blurCommand, meta ) ); editor.addCommand( 'blurBack', CKEDITOR.tools.extend( blurBackCommand, meta ) ); + editor.addCommand( 'selectNextCell', selectNextCellCommand() ); + editor.addCommand( 'selectPreviousCell', selectNextCellCommand( true ) ); } }); })(); @@ -259,3 +344,24 @@ CKEDITOR.dom.element.prototype.focusPrevious = function( ignoreChildren, indexTo * @example * config.tabSpaces = 4; */ + +/** + * Allow context-sensitive tab key behaviors, including the following scenarios: + *
            When selection is anchored inside table cells:
            + *
              + *
            • If TAB is pressed, select the contents of the "next" cell. If in the last cell in the table, add a new row to it and focus its first cell.
            • + *
            • If SHIFT+TAB is pressed, select the contents of the "previous" cell. Do nothing when it's in the first cell.
            • + *
            + * @name CKEDITOR.config.enableTabKeyTools + * @type Boolean + * @default true + * @example + * config.enableTabKeyTools = false; + */ + +// If the TAB key is not supposed to be enabled for navigation, the following +// settings could be used alternatively: +// config.keystrokes.push( +// [ CKEDITOR.ALT + 38 /*Arrow Up*/, 'selectPreviousCell' ], +// [ CKEDITOR.ALT + 40 /*Arrow Down*/, 'selectNextCell' ] +// ); diff --git a/_source/plugins/table/dialogs/table.js b/_source/plugins/table/dialogs/table.js index ddd47f5..55a45e1 100644 --- a/_source/plugins/table/dialogs/table.js +++ b/_source/plugins/table/dialogs/table.js @@ -18,12 +18,62 @@ For licensing, see LICENSE.html or http://ckeditor.com/license function tableDialog( editor, command ) { - var makeElement = function( name ){ return new CKEDITOR.dom.element( name, editor.document ); }; + var makeElement = function( name ) + { + return new CKEDITOR.dom.element( name, editor.document ); + }; + + var dialogadvtab = editor.plugins.dialogadvtab; return { title : editor.lang.table.title, minWidth : 310, minHeight : CKEDITOR.env.ie ? 310 : 280, + + onLoad : function() + { + var dialog = this, + isUpdating; + + var styles = dialog.getContentElement( 'advanced', 'advStyles' ); + + if ( styles ) + { + styles.on( 'change', function( evt ) + { + if ( isUpdating ) + return; + + // Flag to avoid recursion. + isUpdating = 1; + + // Synchronize width value. + var width = this.getStyle( 'width', '' ), + txtWidth = dialog.getContentElement( 'info', 'txtWidth' ), + cmbWidthType = dialog.getContentElement( 'info', 'cmbWidthType' ), + isPx = 1; + + if ( width ) + { + isPx = ( width.length < 3 || width.substr( width.length - 1 ) != '%' ); + width = parseInt( width, 10 ); + } + + txtWidth && txtWidth.setValue( width ); + cmbWidthType && cmbWidthType.setValue( isPx ? 'pixels' : 'percents' ); + + // Synchronize height value. + var height = this.getStyle( 'height', '' ), + txtHeight = dialog.getContentElement( 'info', 'txtHeight' ); + + height && ( height = parseInt( height, 10 ) ); + txtHeight && txtHeight.setValue( height ); + + isUpdating = 0; + }); + } + }, + onShow : function() { // Detect if there's a selected table. @@ -33,7 +83,9 @@ For licensing, see LICENSE.html or http://ckeditor.com/license var rowsInput = this.getContentElement( 'info', 'txtRows' ), colsInput = this.getContentElement( 'info', 'txtCols' ), - widthInput = this.getContentElement( 'info', 'txtWidth' ); + widthInput = this.getContentElement( 'info', 'txtWidth' ), + heightInput = this.getContentElement( 'info', 'txtHeight' ); + if ( command == 'tableProperties' ) { if ( ( selectedTable = editor.getSelection().getSelectedElement() ) ) @@ -70,6 +122,11 @@ For licensing, see LICENSE.html or http://ckeditor.com/license colsInput && colsInput.enable(); rowsInput && rowsInput.select(); } + + // Call the onChange method for the widht and height fields so + // they get reflected into the Advanced tab. + widthInput && widthInput.onChange(); + heightInput && heightInput.onChange(); }, onOk : function() { @@ -380,7 +437,7 @@ For licensing, see LICENSE.html or http://ckeditor.com/license id : 'txtWidth', style : 'width:5em', label : editor.lang.table.width, - 'default' : 200, + 'default' : 500, validate : CKEDITOR.dialog.validate['number']( editor.lang.table.invalidWidth ), // Extra labelling of width unit type. @@ -394,6 +451,21 @@ For licensing, see LICENSE.html or http://ckeditor.com/license inputElement.setAttribute( 'aria-labelledby', [ ariaLabelledByAttr, labelElement.$.id ].join( ' ' ) ); }, + onChange : function() + { + var styles = this.getDialog().getContentElement( 'advanced', 'advStyles' ); + + if ( styles ) + { + var value = this.getValue(); + + if ( value ) + value += this.getDialog().getContentElement( 'info', 'cmbWidthType' ).getValue() == 'percents' ? '%' : 'px'; + + styles.updateStyle( 'width', value ); + } + }, + setup : function( selectedTable ) { var widthMatch = widthPattern.exec( selectedTable.$.style.width ); @@ -421,6 +493,10 @@ For licensing, see LICENSE.html or http://ckeditor.com/license if ( widthMatch ) this.setValue( widthMatch[2] == 'px' ? 'pixels' : 'percents' ); }, + onChange : function() + { + this.getDialog().getContentElement( 'info', 'txtWidth' ).onChange(); + }, commit : commitValue } ] @@ -449,6 +525,17 @@ For licensing, see LICENSE.html or http://ckeditor.com/license inputElement.setAttribute( 'aria-labelledby', [ ariaLabelledByAttr, labelElement.$.id ].join( ' ' ) ); }, + onChange : function() + { + var styles = this.getDialog().getContentElement( 'advanced', 'advStyles' ); + + if ( styles ) + { + var value = this.getValue(); + styles.updateStyle( 'height', value && ( value + 'px' ) ); + } + }, + setup : function( selectedTable ) { var heightMatch = heightPattern.exec( selectedTable.$.style.height ); @@ -582,7 +669,8 @@ For licensing, see LICENSE.html or http://ckeditor.com/license ] } ] - } + }, + dialogadvtab && dialogadvtab.createAdvancedTab( editor ) ] }; } diff --git a/_source/plugins/table/plugin.js b/_source/plugins/table/plugin.js index d1c60a8..9f5ca9d 100644 --- a/_source/plugins/table/plugin.js +++ b/_source/plugins/table/plugin.js @@ -58,7 +58,7 @@ CKEDITOR.plugins.add( 'table', { editor.contextMenu.addListener( function( element, selection ) { - if ( !element ) + if ( !element || element.isReadOnly()) return null; var isTable = element.is( 'table' ) || element.hasAscendant( 'table' ); diff --git a/_source/plugins/tableresize/plugin.js b/_source/plugins/tableresize/plugin.js new file mode 100644 index 0000000..f16978a --- /dev/null +++ b/_source/plugins/tableresize/plugin.js @@ -0,0 +1,450 @@ +/* +Copyright (c) 2003-2010, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.html or http://ckeditor.com/license +*/ + +(function() +{ + var pxUnit = CKEDITOR.tools.cssLength, + needsIEHacks = CKEDITOR.env.ie && ( CKEDITOR.env.ie7Compat || CKEDITOR.env.quirks || CKEDITOR.env.version < 7 ); + + function getWidth( el ) + { + return CKEDITOR.env.ie ? el.$.clientWidth : parseInt( el.getComputedStyle( 'width' ), 10 ); + } + + function getBorderWidth( element, side ) + { + var computed = element.getComputedStyle( 'border-' + side + '-width' ), + borderMap = + { + thin: '0px', + medium: '1px', + thick: '2px' + }; + + if ( computed.indexOf( 'px' ) < 0 ) + { + // look up keywords + if ( computed in borderMap && element.getComputedStyle( 'border-style' ) != 'none' ) + computed = borderMap[ computed ]; + else + computed = 0; + } + + return parseInt( computed, 10 ); + } + + // Gets the table row that contains the most columns. + function getMasterPillarRow( table ) + { + var $rows = table.$.rows, + maxCells = 0, cellsCount, + $elected, $tr; + + for ( var i = 0, len = $rows.length ; i < len; i++ ) + { + $tr = $rows[ i ]; + cellsCount = $tr.cells.length; + + if ( cellsCount > maxCells ) + { + maxCells = cellsCount; + $elected = $tr; + } + } + + return $elected; + } + + function buildTableColumnPillars( table ) + { + var pillars = [], + pillarIndex = -1, + rtl = ( table.getComputedStyle( 'direction' ) == 'rtl' ); + + // Get the raw row element that cointains the most columns. + var $tr = getMasterPillarRow( table ); + + // Get the tbody element and position, which will be used to set the + // top and bottom boundaries. + var tbody = new CKEDITOR.dom.element( table.$.tBodies[ 0 ] ), + tbodyPosition = tbody.getDocumentPosition(); + + // Loop thorugh all cells, building pillars after each one of them. + for ( var i = 0, len = $tr.cells.length ; i < len ; i++ ) + { + // Both the current cell and the successive one will be used in the + // pillar size calculation. + var td = new CKEDITOR.dom.element( $tr.cells[ i ] ), + nextTd = $tr.cells[ i + 1 ] && new CKEDITOR.dom.element( $tr.cells[ i + 1 ] ); + + pillarIndex += td.$.colSpan || 1; + + // Calculate the pillar boundary positions. + var pillarLeft, pillarRight, pillarWidth, pillarPadding; + + var x = td.getDocumentPosition().x; + + // Calculate positions based on the current cell. + rtl ? + pillarRight = x + getBorderWidth( td, 'left' ) : + pillarLeft = x + td.$.offsetWidth - getBorderWidth( td, 'right' ); + + // Calculate positions based on the next cell, if available. + if ( nextTd ) + { + x = nextTd.getDocumentPosition().x; + + rtl ? + pillarLeft = x + nextTd.$.offsetWidth - getBorderWidth( nextTd, 'right' ) : + pillarRight = x + getBorderWidth( nextTd, 'left' ); + } + // Otherwise calculate positions based on the table (for last cell). + else + { + x = table.getDocumentPosition().x; + + rtl ? + pillarLeft = x : + pillarRight = x + table.$.offsetWidth; + } + + pillarWidth = Math.max( pillarRight - pillarLeft, 3 ); + + // Make the pillar touch area at least 14 pixels wide, for easy to use. + pillarPadding = Math.max( Math.round( 7 - ( pillarWidth / 2 ) ), 0 ); + + // The pillar should reflects exactly the shape of the hovered + // column border line. + pillars.push( { + table : table, + index : pillarIndex, + x : pillarLeft, + y : tbodyPosition.y, + width : pillarWidth, + height: tbody.$.offsetHeight, + padding : pillarPadding, + rtl : rtl } ); + } + + return pillars; + } + + function getPillarAtPosition( pillars, positionX ) + { + for ( var i = 0, len = pillars.length ; i < len ; i++ ) + { + var pillar = pillars[ i ], + pad = pillar.padding; + + if ( positionX >= pillar.x - pad && positionX <= ( pillar.x + pillar.width + pad ) ) + return pillar; + } + + return null; + } + + function cancel( evt ) + { + ( evt.data || evt ).preventDefault(); + } + + function columnResizer( editor ) + { + var pillar, + document, + resizer, + isResizing, + startOffset, + currentShift; + + var leftSideCells, rightSideCells, leftShiftBoundary, rightShiftBoundary; + + function detach() + { + pillar = null; + currentShift = 0; + isResizing = 0; + + document.removeListener( 'mouseup', onMouseUp ); + resizer.removeListener( 'mousedown', onMouseDown ); + resizer.removeListener( 'mousemove', onMouseMove ); + + document.getBody().setStyle( 'cursor', 'auto' ); + + // Hide the resizer (remove it on IE7 - #5890). + needsIEHacks ? resizer.remove() : resizer.hide(); + } + + function resizeStart() + { + // Before starting to resize, figure out which cells to change + // and the boundaries of this resizing shift. + + var columnIndex = pillar.index, + map = CKEDITOR.tools.buildTableMap( pillar.table ), + leftColumnCells = [], + rightColumnCells = [], + leftMinSize = Number.MAX_VALUE, + rightMinSize = leftMinSize, + rtl = pillar.rtl; + + for ( var i = 0, len = map.length ; i < len ; i++ ) + { + var row = map[ i ], + leftCell = row[ columnIndex + ( rtl ? 1 : 0 ) ], + rightCell = row[ columnIndex + ( rtl ? 0 : 1 ) ]; + + leftCell = leftCell && new CKEDITOR.dom.element( leftCell ); + rightCell = rightCell && new CKEDITOR.dom.element( rightCell ); + + if ( !leftCell || !rightCell || !leftCell.equals( rightCell ) ) + { + leftCell && ( leftMinSize = Math.min( leftMinSize, getWidth( leftCell ) ) ); + rightCell && ( rightMinSize = Math.min( rightMinSize, getWidth( rightCell ) ) ); + + leftColumnCells.push( leftCell ); + rightColumnCells.push( rightCell ); + } + } + + // Cache the list of cells to be resized. + leftSideCells = leftColumnCells; + rightSideCells = rightColumnCells; + + // Cache the resize limit boundaries. + leftShiftBoundary = pillar.x - leftMinSize; + rightShiftBoundary = pillar.x + rightMinSize; + + resizer.setOpacity( 0.5 ); + startOffset = parseInt( resizer.getStyle( 'left' ), 10 ); + currentShift = 0; + isResizing = 1; + + resizer.on( 'mousemove', onMouseMove ); + + // Prevent the native drag behavior otherwise 'mousemove' won't fire. + document.on( 'dragstart', cancel ); + } + + function resizeEnd() + { + isResizing = 0; + + resizer.setOpacity( 0 ); + + currentShift && resizeColumn(); + + var table = pillar.table; + setTimeout( function () { table.removeCustomData( '_cke_table_pillars' ); }, 0 ); + + document.removeListener( 'dragstart', cancel ); + } + + function resizeColumn() + { + var rtl = pillar.rtl, + cellsCount = rtl ? rightSideCells.length : leftSideCells.length; + + // Perform the actual resize to table cells, only for those by side of the pillar. + for ( var i = 0 ; i < cellsCount ; i++ ) + { + var leftCell = leftSideCells[ i ], + rightCell = rightSideCells[ i ], + table = pillar.table; + + // Defer the resizing to avoid any interference among cells. + CKEDITOR.tools.setTimeout( + function( leftCell, leftOldWidth, rightCell, rightOldWidth, tableWidth, sizeShift ) + { + leftCell && leftCell.setStyle( 'width', pxUnit( Math.max( leftOldWidth + sizeShift, 0 ) ) ); + rightCell && rightCell.setStyle( 'width', pxUnit( Math.max( rightOldWidth - sizeShift, 0 ) ) ); + + // If we're in the last cell, we need to resize the table as well + if ( tableWidth ) + table.setStyle( 'width', pxUnit( tableWidth + sizeShift * ( rtl ? -1 : 1 ) ) ); + } + , 0, + this, [ + leftCell, leftCell && getWidth( leftCell ), + rightCell, rightCell && getWidth( rightCell ), + ( !leftCell || !rightCell ) && ( getWidth( table ) + getBorderWidth( table, 'left' ) + getBorderWidth( table, 'right' ) ), + currentShift ] ); + } + } + + function onMouseDown( evt ) + { + cancel( evt ); + + resizeStart(); + + document.on( 'mouseup', onMouseUp, this ); + } + + function onMouseUp( evt ) + { + evt.removeListener(); + + resizeEnd(); + } + + function onMouseMove( evt ) + { + move( evt.data.$.clientX ); + } + + document = editor.document; + + resizer = CKEDITOR.dom.element.createFromHtml( + '
            ', document ); + + // Except on IE6/7 (#5890), place the resizer after body to prevent it + // from being editable. + if ( !needsIEHacks ) + document.getDocumentElement().append( resizer ); + + this.attachTo = function( targetPillar ) + { + // Accept only one pillar at a time. + if ( isResizing ) + return; + + // On IE6/7, we append the resizer everytime we need it. (#5890) + if ( needsIEHacks ) + { + document.getBody().append( resizer ); + currentShift = 0; + } + + pillar = targetPillar; + + resizer.setStyles( + { + width: pxUnit( targetPillar.width ), + height : pxUnit( targetPillar.height ), + left : pxUnit( targetPillar.x ), + top : pxUnit( targetPillar.y ) + }); + + // In IE6/7, it's not possible to have custom cursors for floating + // elements in an editable document. Show the resizer in that case, + // to give the user a visual clue. + needsIEHacks && resizer.setOpacity( 0.25 ); + + resizer.on( 'mousedown', onMouseDown, this ); + + document.getBody().setStyle( 'cursor', 'col-resize' ); + + // Display the resizer to receive events but don't show it, + // only change the cursor to resizable shape. + resizer.show(); + }; + + var move = this.move = function( posX ) + { + if ( !pillar ) + return 0; + + var pad = pillar.padding; + + if ( !isResizing && ( posX < pillar.x - pad || posX > ( pillar.x + pillar.width + pad ) ) ) + { + detach(); + return 0; + } + + var resizerNewPosition = posX - Math.round( resizer.$.offsetWidth / 2 ); + + if ( isResizing ) + { + if ( resizerNewPosition == leftShiftBoundary || resizerNewPosition == rightShiftBoundary ) + return 1; + + resizerNewPosition = Math.max( resizerNewPosition, leftShiftBoundary ); + resizerNewPosition = Math.min( resizerNewPosition, rightShiftBoundary ); + + currentShift = resizerNewPosition - startOffset; + } + + resizer.setStyle( 'left', pxUnit( resizerNewPosition ) ); + + return 1; + }; + } + + function clearPillarsCache( evt ) + { + var target = evt.data.getTarget(); + + if ( evt.name == 'mouseout' ) + { + // Bypass interal mouse move. + if ( !target.is ( 'table' ) ) + return; + + var dest = new CKEDITOR.dom.element( evt.data.$.relatedTarget || evt.data.$.toElement ); + while( dest && dest.$ && !dest.equals( target ) && !dest.is( 'body' ) ) + dest = dest.getParent(); + if ( !dest || dest.equals( target ) ) + return; + } + + target.getAscendant( 'table', true ).removeCustomData( '_cke_table_pillars' ); + evt.removeListener(); + } + + CKEDITOR.plugins.add( 'tableresize', + { + requires : [ 'tabletools' ], + init : function( editor ) + { + editor.on( 'contentDom', function() + { + var resizer; + + editor.document.getBody().on( 'mousemove', function( evt ) + { + evt = evt.data; + + // If we're already attached to a pillar, simply move the + // resizer. + if ( resizer && resizer.move( evt.$.clientX ) ) + { + cancel( evt ); + return; + } + + // Considering table, tr, td, tbody but nothing else. + var target = evt.getTarget(), + table, + pillars; + + if ( !target.is( 'table' ) && !target.getAscendant( 'tbody', true ) ) + return; + + table = target.getAscendant( 'table', true ); + + if ( !( pillars = table.getCustomData( '_cke_table_pillars' ) ) ) + { + // Cache table pillars calculation result. + table.setCustomData( '_cke_table_pillars', ( pillars = buildTableColumnPillars( table ) ) ); + table.on( 'mouseout', clearPillarsCache ); + table.on( 'mousedown', clearPillarsCache ); + } + + var pillar = getPillarAtPosition( pillars, evt.$.clientX ); + if ( pillar ) + { + !resizer && ( resizer = new columnResizer( editor ) ); + resizer.attachTo( pillar ); + } + }); + }); + } + }); + +})(); diff --git a/_source/plugins/tabletools/plugin.js b/_source/plugins/tabletools/plugin.js index 1f1f4d1..0ef39f0 100644 --- a/_source/plugins/tabletools/plugin.js +++ b/_source/plugins/tabletools/plugin.js @@ -400,51 +400,6 @@ For licensing, see LICENSE.html or http://ckeditor.com/license range.select( true ); } - function buildTableMap( table ) - { - - var aRows = table.$.rows ; - - // Row and Column counters. - var r = -1 ; - - var aMap = []; - - for ( var i = 0 ; i < aRows.length ; i++ ) - { - r++ ; - !aMap[r] && ( aMap[r] = [] ); - - var c = -1 ; - - for ( var j = 0 ; j < aRows[i].cells.length ; j++ ) - { - var oCell = aRows[i].cells[j] ; - - c++ ; - while ( aMap[r][c] ) - c++ ; - - var iColSpan = isNaN( oCell.colSpan ) ? 1 : oCell.colSpan ; - var iRowSpan = isNaN( oCell.rowSpan ) ? 1 : oCell.rowSpan ; - - for ( var rs = 0 ; rs < iRowSpan ; rs++ ) - { - if ( !aMap[r + rs] ) - aMap[r + rs] = new Array() ; - - for ( var cs = 0 ; cs < iColSpan ; cs++ ) - { - aMap[r + rs][c + cs] = aRows[i].cells[j] ; - } - } - - c += iColSpan - 1 ; - } - } - return aMap ; - } - function cellInRow( tableMap, rowIndex, cell ) { var oRow = tableMap[ rowIndex ]; @@ -498,7 +453,7 @@ For licensing, see LICENSE.html or http://ckeditor.com/license var cell, firstCell = cells[ 0 ], table = firstCell.getAscendant( 'table' ), - map = buildTableMap( table ), + map = CKEDITOR.tools.buildTableMap( table ), mapHeight = map.length, mapWidth = map[ 0 ].length, startRow = firstCell.getParent().$.rowIndex, @@ -633,7 +588,7 @@ For licensing, see LICENSE.html or http://ckeditor.com/license var cell = cells[ 0 ], tr = cell.getParent(), table = tr.getAscendant( 'table' ), - map = buildTableMap( table ), + map = CKEDITOR.tools.buildTableMap( table ), rowIndex = tr.$.rowIndex, colIndex = cellInRow( map, rowIndex, cell ), rowSpan = cell.$.rowSpan, @@ -709,7 +664,7 @@ For licensing, see LICENSE.html or http://ckeditor.com/license var cell = cells[ 0 ], tr = cell.getParent(), table = tr.getAscendant( 'table' ), - map = buildTableMap( table ), + map = CKEDITOR.tools.buildTableMap( table ), rowIndex = tr.$.rowIndex, colIndex = cellInRow( map, rowIndex, cell ), colSpan = cell.$.colSpan, @@ -1088,7 +1043,7 @@ For licensing, see LICENSE.html or http://ckeditor.com/license { editor.contextMenu.addListener( function( element, selection ) { - if ( !element ) + if ( !element || element.isReadOnly() ) return null; while ( element ) @@ -1114,3 +1069,52 @@ For licensing, see LICENSE.html or http://ckeditor.com/license }; CKEDITOR.plugins.add( 'tabletools', CKEDITOR.plugins.tabletools ); })(); + +/** + * Create a two-dimension array that reflects the actual layout of table cells, + * with cell spans, with mappings to the original td elements. + * @param table {CKEDITOR.dom.element} + */ +CKEDITOR.tools.buildTableMap = function ( table ) +{ + var aRows = table.$.rows ; + + // Row and Column counters. + var r = -1 ; + + var aMap = []; + + for ( var i = 0 ; i < aRows.length ; i++ ) + { + r++ ; + !aMap[r] && ( aMap[r] = [] ); + + var c = -1 ; + + for ( var j = 0 ; j < aRows[i].cells.length ; j++ ) + { + var oCell = aRows[i].cells[j] ; + + c++ ; + while ( aMap[r][c] ) + c++ ; + + var iColSpan = isNaN( oCell.colSpan ) ? 1 : oCell.colSpan ; + var iRowSpan = isNaN( oCell.rowSpan ) ? 1 : oCell.rowSpan ; + + for ( var rs = 0 ; rs < iRowSpan ; rs++ ) + { + if ( !aMap[r + rs] ) + aMap[r + rs] = []; + + for ( var cs = 0 ; cs < iColSpan ; cs++ ) + { + aMap[r + rs][c + cs] = aRows[i].cells[j] ; + } + } + + c += iColSpan - 1 ; + } + } + return aMap ; +}; diff --git a/_source/plugins/toolbar/plugin.js b/_source/plugins/toolbar/plugin.js index fd9fab0..a936df5 100644 --- a/_source/plugins/toolbar/plugin.js +++ b/_source/plugins/toolbar/plugin.js @@ -433,6 +433,7 @@ CKEDITOR.config.toolbar_Full = ['Bold','Italic','Underline','Strike','-','Subscript','Superscript'], ['NumberedList','BulletedList','-','Outdent','Indent','Blockquote','CreateDiv'], ['JustifyLeft','JustifyCenter','JustifyRight','JustifyBlock'], + ['BidiLtr', 'BidiRtl'], ['Link','Unlink','Anchor'], ['Image','Flash','Table','HorizontalRule','Smiley','SpecialChar','PageBreak'], '/', diff --git a/_source/plugins/wysiwygarea/plugin.js b/_source/plugins/wysiwygarea/plugin.js index deff975..7e7c192 100644 --- a/_source/plugins/wysiwygarea/plugin.js +++ b/_source/plugins/wysiwygarea/plugin.js @@ -18,15 +18,26 @@ For licensing, see LICENSE.html or http://ckeditor.com/license var notWhitespaceEval = CKEDITOR.dom.walker.whitespaces( true ); + function checkReadOnly( selection ) + { + if ( selection.getType() == CKEDITOR.SELECTION_ELEMENT ) + return selection.getSelectedElement().isReadOnly(); + else + return selection.getCommonAncestor().isReadOnly(); + } + function onInsertHtml( evt ) { if ( this.mode == 'wysiwyg' ) { this.focus(); - this.fire( 'saveSnapshot' ); - var selection = this.getSelection(), - data = evt.data; + var selection = this.getSelection(); + if ( checkReadOnly( selection ) ) + return; + + var data = evt.data; + this.fire( 'saveSnapshot' ); if ( this.dataProcessor ) data = this.dataProcessor.toHtml( data ); @@ -39,8 +50,29 @@ For licensing, see LICENSE.html or http://ckeditor.com/license selection.unlock(); var $sel = selection.getNative(); + + // Delete control selections to avoid IE bugs on pasteHTML. if ( $sel.type == 'Control' ) $sel.clear(); + else if ( selection.getType() == CKEDITOR.SELECTION_TEXT ) + { + // Due to IE bugs on handling contenteditable=false blocks + // (#6005), we need to make some checks and eventually + // delete the selection first. + + var range = selection.getRanges()[0], + endContainer = range && range.endContainer; + + if ( endContainer && + endContainer.type == CKEDITOR.NODE_ELEMENT && + endContainer.getAttribute( 'contenteditable' ) == 'false' && + range.checkBoundaryOfElement( endContainer, CKEDITOR.END ) ) + { + range.setEndAfter( range.endContainer ); + range.deleteContents(); + } + } + $sel.createRange().pasteHTML( data ); if ( selIsLocked ) @@ -70,15 +102,18 @@ For licensing, see LICENSE.html or http://ckeditor.com/license if ( this.mode == 'wysiwyg' ) { this.focus(); + + var selection = this.getSelection(); + if ( checkReadOnly( selection ) ) + return; + this.fire( 'saveSnapshot' ); - var element = evt.data, + var ranges = selection.getRanges(), + element = evt.data, elementName = element.getName(), isBlock = CKEDITOR.dtd.$block[ elementName ]; - var selection = this.getSelection(), - ranges = selection.getRanges(); - var selIsLocked = selection.isLocked; if ( selIsLocked ) @@ -377,6 +412,10 @@ For licensing, see LICENSE.html or http://ckeditor.com/license ' allowTransparency="true"' + '>' ); + // #5689 Running inside of Firefox chrome the load event doesn't bubble like in a normal page + if (document.location.protocol == 'chrome:') + CKEDITOR.event.useCapture = true; + // With FF, it's better to load the data on iframe.load. (#3894,#4058) iframe.on( 'load', function( ev ) { @@ -391,6 +430,10 @@ For licensing, see LICENSE.html or http://ckeditor.com/license doc.close(); }); + // #5689 Reset adjustment back to default + if (document.location.protocol == 'chrome:') + CKEDITOR.event.useCapture = false; + mainElement.append( iframe ); }; @@ -493,6 +536,14 @@ For licensing, see LICENSE.html or http://ckeditor.com/license } ); } + // Prevent the browser opening links in read-only blocks. (#6032) + domDocument.on( 'click', function( ev ) + { + ev = ev.data; + if ( ev.getTarget().is( 'a' ) && ev.$.button != 2 ) + ev.preventDefault(); + }); + // Webkit: avoid from editing form control elements content. if ( CKEDITOR.env.webkit ) { @@ -933,7 +984,13 @@ For licensing, see LICENSE.html or http://ckeditor.com/license if ( element.type == CKEDITOR.NODE_ELEMENT && ( element.is( 'input' ) || element.is( 'textarea' ) ) ) { - element.setAttribute( 'contentEditable', false ); + if ( !element.isReadOnly() ) + { + element.setAttribute( 'contentEditable', false ); + // We should flag that the element was locked by our code so + // it'll be editable by the editor functions (#6046). + element.setCustomData( '_cke_notReadOnly', 1 ); + } } }); diff --git a/_source/skins/kama/dialog.css b/_source/skins/kama/dialog.css index 1530bba..743854e 100644 --- a/_source/skins/kama/dialog.css +++ b/_source/skins/kama/dialog.css @@ -610,7 +610,7 @@ body .cke_dialog background-color: white; } -.cke_skin_kama iframe.cke_dialog_ui_input_file +.cke_skin_kama .cke_dialog_ui_input_file { width: 100%; height: 25px; diff --git a/_source/skins/kama/icons.css b/_source/skins/kama/icons.css index 93306de..df7666d 100644 --- a/_source/skins/kama/icons.css +++ b/_source/skins/kama/icons.css @@ -320,7 +320,18 @@ For licensing, see LICENSE.html or http://ckeditor.com/license { background-position: 0 -1040px; } -.cke_skin_office2003 .cke_button_editdiv .cke_icon + +.cke_skin_kama .cke_button_editdiv .cke_icon { background-position: 0 -1184px; } + +.cke_skin_kama .cke_button_bidirtl .cke_icon +{ + background-position: 0 -1072px; +} + +.cke_skin_kama .cke_button_bidiltr .cke_icon +{ + background-position: 0 -1056px; +} diff --git a/_source/skins/office2003/dialog.css b/_source/skins/office2003/dialog.css index e292a11..05dc4a4 100644 --- a/_source/skins/office2003/dialog.css +++ b/_source/skins/office2003/dialog.css @@ -541,7 +541,7 @@ body .cke_dialog background-color: white; } -.cke_skin_office2003 iframe.cke_dialog_ui_input_file +.cke_skin_office2003 .cke_dialog_ui_input_file { width: 100%; height: 25px; diff --git a/_source/skins/office2003/icons.css b/_source/skins/office2003/icons.css index a0a1645..2f4eacf 100644 --- a/_source/skins/office2003/icons.css +++ b/_source/skins/office2003/icons.css @@ -322,3 +322,13 @@ For licensing, see LICENSE.html or http://ckeditor.com/license { background-position: 0 -1200px; } + +.cke_skin_office2003 .cke_button_bidirtl .cke_icon +{ + background-position: 0 -1072px; +} + +.cke_skin_office2003 .cke_button_bidiltr .cke_icon +{ + background-position: 0 -1056px; +} diff --git a/_source/skins/v2/dialog.css b/_source/skins/v2/dialog.css index 6ae59d1..a63baca 100644 --- a/_source/skins/v2/dialog.css +++ b/_source/skins/v2/dialog.css @@ -543,7 +543,7 @@ body .cke_dialog background-color: white; } -.cke_skin_v2 iframe.cke_dialog_ui_input_file +.cke_skin_v2 .cke_dialog_ui_input_file { width: 100%; height: 25px; diff --git a/_source/skins/v2/icons.css b/_source/skins/v2/icons.css index 9879c3c..f64ff52 100644 --- a/_source/skins/v2/icons.css +++ b/_source/skins/v2/icons.css @@ -322,3 +322,13 @@ For licensing, see LICENSE.html or http://ckeditor.com/license { background-position: 0 -1200px; } + +.cke_skin_v2 .cke_button_bidirtl .cke_icon +{ + background-position: 0 -1072px; +} + +.cke_skin_v2 .cke_button_bidiltr .cke_icon +{ + background-position: 0 -1056px; +} diff --git a/ckeditor.asp b/ckeditor.asp index 59b2108..1bbcbe3 100644 --- a/ckeditor.asp +++ b/ckeditor.asp @@ -91,9 +91,9 @@ Class CKEditor Private Sub Class_Initialize() - version = "3.3.2" - timeStamp = "A73H4H9" - mTimeStamp = "A73H4H9" + version = "3.4 Beta" + timeStamp = "A73H4HC" + mTimeStamp = "A73H4HC" Set oInstanceConfig = CreateObject("Scripting.Dictionary") Set oAllInstancesConfig = CreateObject("Scripting.Dictionary") diff --git a/ckeditor.js b/ckeditor.js index 8bde780..7b8b00d 100644 --- a/ckeditor.js +++ b/ckeditor.js @@ -3,21 +3,21 @@ Copyright (c) 2003-2010, CKSource - Frederico Knabben. All rights reserved. For licensing, see LICENSE.html or http://ckeditor.com/license */ -(function(){if(!window.CKEDITOR)window.CKEDITOR=(function(){var a={timestamp:'A73H4H9',version:'3.3.2',revision:'5805',_:{},status:'unloaded',basePath:(function(){var d=window.CKEDITOR_BASEPATH||'';if(!d){var e=document.getElementsByTagName('script');for(var f=0;f=0?'&':'?')+'t='+this.timestamp;return d;}},b=window.CKEDITOR_GETURL;if(b){var c=a.getUrl;a.getUrl=function(d){return b.call(a,d)||c.call(a,d);};}return a;})();var a=CKEDITOR;if(!a.event){a.event=function(){};a.event.implementOn=function(b,c){var d=a.event.prototype;for(var e in d){if(b[e]==undefined)b[e]=d[e];}};a.event.prototype=(function(){var b=function(d){var e=d.getPrivate&&d.getPrivate()||d._||(d._={});return e.events||(e.events={});},c=function(d){this.name=d;this.listeners=[];};c.prototype={getListenerIndex:function(d){for(var e=0,f=this.listeners;e=0;n--){if(k[n].priority<=h){k.splice(n+1,0,m);return;}}k.unshift(m);}},fire:(function(){var d=false,e=function(){d=true;},f=false,g=function(){f=true;};return function(h,i,j){var k=b(this)[h],l=d,m=f;d=f=false;if(k){var n=k.listeners;if(n.length){n=n.slice(0);for(var o=0;o=0)f.listeners.splice(g,1);}},hasListeners:function(d){var e=b(this)[d];return e&&e.listeners.length>0; -}};})();}if(!a.editor){a.ELEMENT_MODE_NONE=0;a.ELEMENT_MODE_REPLACE=1;a.ELEMENT_MODE_APPENDTO=2;a.editor=function(b,c,d,e){var f=this;f._={instanceConfig:b,element:c,data:e};f.elementMode=d||0;a.event.call(f);f._init();};a.editor.replace=function(b,c){var d=b;if(typeof d!='object'){d=document.getElementById(b);if(!d){var e=0,f=document.getElementsByName(b);while((d=f[e++])&&d.tagName.toLowerCase()!='textarea'){}}if(!d)throw '[CKEDITOR.editor.replace] The element with id or name "'+b+'" was not found.';}d.style.visibility='hidden';return new a.editor(c,d,1);};a.editor.appendTo=function(b,c,d){var e=b;if(typeof e!='object'){e=document.getElementById(b);if(!e)throw '[CKEDITOR.editor.appendTo] The element with id "'+b+'" was not found.';}return new a.editor(c,e,2,d);};a.editor.prototype={_init:function(){var b=a.editor._pending||(a.editor._pending=[]);b.push(this);},fire:function(b,c){return a.event.prototype.fire.call(this,b,c,this);},fireOnce:function(b,c){return a.event.prototype.fireOnce.call(this,b,c,this);}};a.event.implementOn(a.editor.prototype,true);}if(!a.env)a.env=(function(){var b=navigator.userAgent.toLowerCase(),c=window.opera,d={ie:/*@cc_on!@*/false,opera:!!c&&c.version,webkit:b.indexOf(' applewebkit/')>-1,air:b.indexOf(' adobeair/')>-1,mac:b.indexOf('macintosh')>-1,quirks:document.compatMode=='BackCompat',mobile:b.indexOf('mobile')>-1,isCustomDomain:function(){var g=document.domain,h=window.location.hostname;return this.ie&&g!=h&&g!='['+h+']';}};d.gecko=navigator.product=='Gecko'&&!d.webkit&&!d.opera;var e=0;if(d.ie){e=parseFloat(b.match(/msie (\d+)/)[1]);d.ie8=!!document.documentMode;d.ie8Compat=document.documentMode==8;d.ie7Compat=e==7&&!document.documentMode||document.documentMode==7;d.ie6Compat=e<7||d.quirks;}if(d.gecko){var f=b.match(/rv:([\d\.]+)/);if(f){f=f[1].split('.');e=f[0]*10000+(f[1]||0)*100+ +(f[2]||0);}}if(d.opera)e=parseFloat(c.version());if(d.air)e=parseFloat(b.match(/ adobeair\/(\d+)/)[1]);if(d.webkit)e=parseFloat(b.match(/ applewebkit\/(\d+)/)[1]);d.version=e;d.isCompatible=!d.mobile&&(d.ie&&e>=6||d.gecko&&e>=10801||d.opera&&e>=9.5||d.air&&e>=1||d.webkit&&e>=522||false);d.cssClass='cke_browser_'+(d.ie?'ie':d.gecko?'gecko':d.opera?'opera':d.air?'air':d.webkit?'webkit':'unknown');if(d.quirks)d.cssClass+=' cke_browser_quirks';if(d.ie){d.cssClass+=' cke_browser_ie'+(d.version<7?'6':d.version>=8?'8':'7');if(d.quirks)d.cssClass+=' cke_browser_iequirks';}if(d.gecko&&e<10900)d.cssClass+=' cke_browser_gecko18';return d; -})();var b=a.env;var c=b.ie;if(a.status=='unloaded')(function(){a.event.implementOn(a);a.loadFullCore=function(){if(a.status!='basic_ready'){a.loadFullCore._load=true;return;}delete a.loadFullCore;var e=document.createElement('script');e.type='text/javascript';e.src=a.basePath+'ckeditor.js';document.getElementsByTagName('head')[0].appendChild(e);};a.loadFullCoreTimeout=0;a.replaceClass='ckeditor';a.replaceByClassEnabled=true;var d=function(e,f,g,h){if(b.isCompatible){if(a.loadFullCore)a.loadFullCore();var i=g(e,f,h);a.add(i);return i;}return null;};a.replace=function(e,f){return d(e,f,a.editor.replace);};a.appendTo=function(e,f,g){return d(e,f,a.editor.appendTo,g);};a.add=function(e){var f=this._.pending||(this._.pending=[]);f.push(e);};a.replaceAll=function(){var e=document.getElementsByTagName('textarea');for(var f=0;f'+g+'');else h.push('');}return h.join('');},htmlEncode:function(f){var g=function(k){var l=new d.element('span');l.setText(k);return l.getHtml();},h=g('\n').toLowerCase()=='
            '?function(k){return g(k).replace(/
            /gi,'\n');}:g,i=g('>')=='>'?function(k){return h(k).replace(/>/g,'>');}:h,j=g(' ')=='  '?function(k){return i(k).replace(/ /g,' ');}:i;this.htmlEncode=j;return this.htmlEncode(f);},htmlEncodeAttr:function(f){return f.replace(/"/g,'"').replace(//g,'>');},escapeCssSelector:function(f){return f.replace(/[\s#:.,$*^\[\]()~=+>]/g,'\\$&');},getNextNumber:(function(){var f=0;return function(){return++f;};})(),override:function(f,g){return g(f);},setTimeout:function(f,g,h,i,j){if(!j)j=window;if(!h)h=j;return j.setTimeout(function(){if(i)f.apply(h,[].concat(i));else f.apply(h);},g||0);},trim:(function(){var f=/(?:^[ \t\n\r]+)|(?:[ \t\n\r]+$)/g;return function(g){return g.replace(f,'');};})(),ltrim:(function(){var f=/^[ \t\n\r]+/g;return function(g){return g.replace(f,'');};})(),rtrim:(function(){var f=/[ \t\n\r]+$/g;return function(g){return g.replace(f,'');};})(),indexOf:Array.prototype.indexOf?function(f,g){return f.indexOf(g);}:function(f,g){for(var h=0,i=f.length;h=0?'&':'?')+'t='+this.timestamp;return d;}},b=window.CKEDITOR_GETURL;if(b){var c=a.getUrl;a.getUrl=function(d){return b.call(a,d)||c.call(a,d);};}return a;})();var a=CKEDITOR;if(!a.event){a.event=function(){};a.event.implementOn=function(b,c){var d=a.event.prototype;for(var e in d){if(b[e]==undefined)b[e]=d[e];}};a.event.prototype=(function(){var b=function(d){var e=d.getPrivate&&d.getPrivate()||d._||(d._={});return e.events||(e.events={});},c=function(d){this.name=d;this.listeners=[];};c.prototype={getListenerIndex:function(d){for(var e=0,f=this.listeners;e=0;n--){if(k[n].priority<=h){k.splice(n+1,0,m);return;}}k.unshift(m);}},fire:(function(){var d=false,e=function(){d=true;},f=false,g=function(){f=true;};return function(h,i,j){var k=b(this)[h],l=d,m=f;d=f=false;if(k){var n=k.listeners;if(n.length){n=n.slice(0);for(var o=0;o=0)f.listeners.splice(g,1);}},hasListeners:function(d){var e=b(this)[d]; +return e&&e.listeners.length>0;}};})();}if(!a.editor){a.ELEMENT_MODE_NONE=0;a.ELEMENT_MODE_REPLACE=1;a.ELEMENT_MODE_APPENDTO=2;a.editor=function(b,c,d,e){var f=this;f._={instanceConfig:b,element:c,data:e};f.elementMode=d||0;a.event.call(f);f._init();};a.editor.replace=function(b,c){var d=b;if(typeof d!='object'){d=document.getElementById(b);if(!d){var e=0,f=document.getElementsByName(b);while((d=f[e++])&&d.tagName.toLowerCase()!='textarea'){}}if(!d)throw '[CKEDITOR.editor.replace] The element with id or name "'+b+'" was not found.';}d.style.visibility='hidden';return new a.editor(c,d,1);};a.editor.appendTo=function(b,c,d){var e=b;if(typeof e!='object'){e=document.getElementById(b);if(!e)throw '[CKEDITOR.editor.appendTo] The element with id "'+b+'" was not found.';}return new a.editor(c,e,2,d);};a.editor.prototype={_init:function(){var b=a.editor._pending||(a.editor._pending=[]);b.push(this);},fire:function(b,c){return a.event.prototype.fire.call(this,b,c,this);},fireOnce:function(b,c){return a.event.prototype.fireOnce.call(this,b,c,this);}};a.event.implementOn(a.editor.prototype,true);}if(!a.env)a.env=(function(){var b=navigator.userAgent.toLowerCase(),c=window.opera,d={ie:/*@cc_on!@*/false,opera:!!c&&c.version,webkit:b.indexOf(' applewebkit/')>-1,air:b.indexOf(' adobeair/')>-1,mac:b.indexOf('macintosh')>-1,quirks:document.compatMode=='BackCompat',mobile:b.indexOf('mobile')>-1,isCustomDomain:function(){if(!this.ie)return false;var g=document.domain,h=window.location.hostname;return g!=h&&g!='['+h+']';}};d.gecko=navigator.product=='Gecko'&&!d.webkit&&!d.opera;var e=0;if(d.ie){e=parseFloat(b.match(/msie (\d+)/)[1]);d.ie8=!!document.documentMode;d.ie8Compat=document.documentMode==8;d.ie7Compat=e==7&&!document.documentMode||document.documentMode==7;d.ie6Compat=e<7||d.quirks;}if(d.gecko){var f=b.match(/rv:([\d\.]+)/);if(f){f=f[1].split('.');e=f[0]*10000+(f[1]||0)*100+ +(f[2]||0);}}if(d.opera)e=parseFloat(c.version());if(d.air)e=parseFloat(b.match(/ adobeair\/(\d+)/)[1]);if(d.webkit)e=parseFloat(b.match(/ applewebkit\/(\d+)/)[1]);d.version=e;d.isCompatible=!d.mobile&&(d.ie&&e>=6||d.gecko&&e>=10801||d.opera&&e>=9.5||d.air&&e>=1||d.webkit&&e>=522||false);d.cssClass='cke_browser_'+(d.ie?'ie':d.gecko?'gecko':d.opera?'opera':d.air?'air':d.webkit?'webkit':'unknown');if(d.quirks)d.cssClass+=' cke_browser_quirks';if(d.ie){d.cssClass+=' cke_browser_ie'+(d.version<7?'6':d.version>=8?'8':'7');if(d.quirks)d.cssClass+=' cke_browser_iequirks';}if(d.gecko&&e<10900)d.cssClass+=' cke_browser_gecko18'; +return d;})();var b=a.env;var c=b.ie;if(a.status=='unloaded')(function(){a.event.implementOn(a);a.loadFullCore=function(){if(a.status!='basic_ready'){a.loadFullCore._load=true;return;}delete a.loadFullCore;var e=document.createElement('script');e.type='text/javascript';e.src=a.basePath+'ckeditor.js';document.getElementsByTagName('head')[0].appendChild(e);};a.loadFullCoreTimeout=0;a.replaceClass='ckeditor';a.replaceByClassEnabled=true;var d=function(e,f,g,h){if(b.isCompatible){if(a.loadFullCore)a.loadFullCore();var i=g(e,f,h);a.add(i);return i;}return null;};a.replace=function(e,f){return d(e,f,a.editor.replace);};a.appendTo=function(e,f,g){return d(e,f,a.editor.appendTo,g);};a.add=function(e){var f=this._.pending||(this._.pending=[]);f.push(e);};a.replaceAll=function(){var e=document.getElementsByTagName('textarea');for(var f=0;f'+g+'');else h.push('');}return h.join('');},htmlEncode:function(f){var g=function(k){var l=new d.element('span');l.setText(k);return l.getHtml();},h=g('\n').toLowerCase()=='
            '?function(k){return g(k).replace(/
            /gi,'\n');}:g,i=g('>')=='>'?function(k){return h(k).replace(/>/g,'>');}:h,j=g(' ')=='  '?function(k){return i(k).replace(/ /g,' ');}:i;this.htmlEncode=j;return this.htmlEncode(f);},htmlEncodeAttr:function(f){return f.replace(/"/g,'"').replace(//g,'>');},escapeCssSelector:function(f){return f.replace(/[\s#:.,$*^\[\]()~=+>]/g,'\\$&');},getNextNumber:(function(){var f=0;return function(){return++f;};})(),getNextId:function(){return 'cke_'+this.getNextNumber();},override:function(f,g){return g(f);},setTimeout:function(f,g,h,i,j){if(!j)j=window;if(!h)h=j;return j.setTimeout(function(){if(i)f.apply(h,[].concat(i));else f.apply(h);},g||0);},trim:(function(){var f=/(?:^[ \t\n\r]+)|(?:[ \t\n\r]+$)/g;return function(g){return g.replace(f,'');};})(),ltrim:(function(){var f=/^[ \t\n\r]+/g;return function(g){return g.replace(f,'');};})(),rtrim:(function(){var f=/[ \t\n\r]+$/g;return function(g){return g.replace(f,'');};})(),indexOf:Array.prototype.indexOf?function(f,g){return f.indexOf(g);}:function(f,g){for(var h=0,i=f.length;h]*>/g,''):i; -},getOuterHtml:function(){var j=this;if(j.$.outerHTML)return j.$.outerHTML.replace(/<\?[^>]*>/,'');var i=j.$.ownerDocument.createElement('div');i.appendChild(j.$.cloneNode(true));return i.innerHTML;},setHtml:function(i){return this.$.innerHTML=i;},setText:function(i){h.prototype.setText=this.$.innerText!=undefined?function(j){return this.$.innerText=j;}:function(j){return this.$.textContent=j;};return this.setText(i);},getAttribute:(function(){var i=function(j){return this.$.getAttribute(j,2);};if(c&&(b.ie7Compat||b.ie6Compat))return function(j){var n=this;switch(j){case 'class':j='className';break;case 'tabindex':var k=i.call(n,j);if(k!==0&&n.$.tabIndex===0)k=null;return k;break;case 'checked':var l=n.$.attributes.getNamedItem(j),m=l.specified?l.nodeValue:n.$.checked;return m?'checked':null;case 'hspace':return n.$.hspace;case 'style':return n.$.style.cssText;}return i.call(n,j);};else return i;})(),getChildren:function(){return new d.nodeList(this.$.childNodes);},getComputedStyle:c?function(i){return this.$.currentStyle[e.cssStyleToDomStyle(i)];}:function(i){return this.getWindow().$.getComputedStyle(this.$,'').getPropertyValue(i);},getDtd:function(){var i=f[this.getName()];this.getDtd=function(){return i;};return i;},getElementsByTag:g.prototype.getElementsByTag,getTabIndex:c?function(){var i=this.$.tabIndex;if(i===0&&!f.$tabIndex[this.getName()]&&parseInt(this.getAttribute('tabindex'),10)!==0)i=-1;return i;}:b.webkit?function(){var i=this.$.tabIndex;if(i==undefined){i=parseInt(this.getAttribute('tabindex'),10);if(isNaN(i))i=-1;}return i;}:function(){return this.$.tabIndex;},getText:function(){return this.$.textContent||this.$.innerText||'';},getWindow:function(){return this.getDocument().getWindow();},getId:function(){return this.$.id||null;},getNameAtt:function(){return this.$.name||null;},getName:function(){var i=this.$.nodeName.toLowerCase();if(c){var j=this.$.scopeName;if(j!='HTML')i=j.toLowerCase()+':'+i;}return(this.getName=function(){return i;})();},getValue:function(){return this.$.value;},getFirst:function(i){var j=this.$.firstChild,k=j&&new d.node(j);if(k&&i&&!i(k))k=k.getNext(i);return k;},getLast:function(i){var j=this.$.lastChild,k=j&&new d.node(j);if(k&&i&&!i(k))k=k.getPrevious(i);return k;},getStyle:function(i){return this.$.style[e.cssStyleToDomStyle(i)];},is:function(){var i=this.getName();for(var j=0;j0&&(j>2||!k[i[0].nodeName]||j==2&&!k[i[1].nodeName]);},hasAttribute:function(i){var j=this.$.attributes.getNamedItem(i);return!!(j&&j.specified);},hide:function(){this.setStyle('display','none');},moveChildren:function(i,j){var k=this.$;i=i.$;if(k==i)return;var l;if(j)while(l=k.lastChild)i.insertBefore(k.removeChild(l),i.firstChild);else while(l=k.firstChild)i.appendChild(k.removeChild(l));},mergeSiblings:(function(){function i(j,k,l){if(k&&k.type==1){var m=[];while(k.getAttribute('_fck_bookmark')||k.isEmptyInlineRemoveable()){m.push(k);k=l?k.getNext():k.getPrevious();if(!k||k.type!=1)return;}if(j.isIdentical(k)){var n=l?j.getLast():j.getFirst();while(m.length)m.shift().move(j,!l);k.moveChildren(j,!l);k.remove();if(n&&n.type==1)n.mergeSiblings();}}};return function(){var j=this;if(!(f.$removeEmpty[j.getName()]||j.is('a')))return;i(j,j.getNext(),true);i(j,j.getPrevious());};})(),show:function(){this.setStyles({display:'',visibility:''});},setAttribute:(function(){var i=function(j,k){this.$.setAttribute(j,k);return this;};if(c&&(b.ie7Compat||b.ie6Compat))return function(j,k){var l=this;if(j=='class')l.$.className=k; -else if(j=='style')l.$.style.cssText=k;else if(j=='tabindex')l.$.tabIndex=k;else if(j=='checked')l.$.checked=k;else i.apply(l,arguments);return l;};else return i;})(),setAttributes:function(i){for(var j in i)this.setAttribute(j,i[j]);return this;},setValue:function(i){this.$.value=i;return this;},removeAttribute:(function(){var i=function(j){this.$.removeAttribute(j);};if(c&&(b.ie7Compat||b.ie6Compat))return function(j){if(j=='class')j='className';else if(j=='tabindex')j='tabIndex';i.call(this,j);};else return i;})(),removeAttributes:function(i){if(e.isArray(i))for(var j=0;j=100?'':'progid:DXImageTransform.Microsoft.Alpha(opacity='+i+')');}else this.setStyle('opacity',i);},unselectable:b.gecko?function(){this.$.style.MozUserSelect='none';this.on('dragstart',function(i){i.data.preventDefault();});}:b.webkit?function(){this.$.style.KhtmlUserSelect='none';this.on('dragstart',function(i){i.data.preventDefault();});}:function(){if(c||b.opera){var i=this.$,j,k=0;i.unselectable='on';while(j=i.all[k++])switch(j.tagName.toLowerCase()){case 'iframe':case 'textarea':case 'input':case 'select':break;default:j.unselectable='on';}}},getPositionedAncestor:function(){var i=this;while(i.getName()!='html'){if(i.getComputedStyle('position')!='static')return i;i=i.getParent();}return null;},getDocumentPosition:function(i){var D=this;var j=0,k=0,l=D.getDocument().getBody(),m=D.getDocument().$.compatMode=='BackCompat',n=D.getDocument();if(document.documentElement.getBoundingClientRect){var o=D.$.getBoundingClientRect(),p=n.$,q=p.documentElement,r=q.clientTop||l.$.clientTop||0,s=q.clientLeft||l.$.clientLeft||0,t=true;if(c){var u=n.getDocumentElement().contains(D),v=n.getBody().contains(D);t=m&&v||!m&&u;}if(t){j=o.left+(!m&&q.scrollLeft||l.$.scrollLeft);j-=s;k=o.top+(!m&&q.scrollTop||l.$.scrollTop);k-=r;}}else{var w=D,x=null,y;while(w&&!(w.getName()=='body'||w.getName()=='html')){j+=w.$.offsetLeft-w.$.scrollLeft;k+=w.$.offsetTop-w.$.scrollTop;if(!w.equals(D)){j+=w.$.clientLeft||0; -k+=w.$.clientTop||0;}var z=x;while(z&&!z.equals(w)){j-=z.$.scrollLeft;k-=z.$.scrollTop;z=z.getParent();}x=w;w=(y=w.$.offsetParent)?new h(y):null;}}if(i){var A=D.getWindow(),B=i.getWindow();if(!A.equals(B)&&A.$.frameElement){var C=new h(A.$.frameElement).getDocumentPosition(i);j+=C.x;k+=C.y;}}if(!document.documentElement.getBoundingClientRect)if(b.gecko&&!m){j+=D.$.clientLeft?1:0;k+=D.$.clientTop?1:0;}return{x:j,y:k};},scrollIntoView:function(i){var o=this;var j=o.getWindow(),k=j.getViewPaneSize().height,l=k*-1;if(i)l+=k;else{l+=o.$.offsetHeight||0;l+=parseInt(o.getComputedStyle('marginBottom')||0,10)||0;}var m=o.getDocumentPosition();l+=m.y;l=l<0?0:l;var n=j.getScrollPosition().y;if(l>n||lwindow.setTimeout(function(){window.close();},50);")');}return i&&new g(i.contentWindow.document);},copyAttributes:function(i,j){var p=this;var k=p.$.attributes;j=j||{};for(var l=0;l0&&j)j=j.childNodes[i.shift()];return j?new d.node(j):null;},getChildCount:function(){return this.$.childNodes.length;},disableContextMenu:function(){this.on('contextmenu',function(i){if(!i.data.getTarget().hasClass('cke_enable_context_menu'))i.data.preventDefault();});}});a.command=function(i,j){this.uiItems=[];this.exec=function(k){if(this.state==0)return false;if(this.editorFocus)i.focus();return j.exec.call(this,i,k)!==false;};e.extend(this,j,{modes:{wysiwyg:1},editorFocus:true,state:2}); -a.event.call(this);};a.command.prototype={enable:function(){var i=this;if(i.state==0)i.setState(!i.preserveState||typeof i.previousState=='undefined'?2:i.previousState);},disable:function(){this.setState(0);},setState:function(i){var j=this;if(j.state==i)return false;j.previousState=j.state;j.state=i;j.fire('state');return true;},toggleState:function(){var i=this;if(i.state==2)i.setState(1);else if(i.state==1)i.setState(2);}};a.event.implementOn(a.command.prototype,true);a.ENTER_P=1;a.ENTER_BR=2;a.ENTER_DIV=3;a.config={customConfig:'config.js',autoUpdateElement:true,baseHref:'',contentsCss:a.basePath+'contents.css',contentsLangDirection:'ui',contentsLanguage:'',language:'',defaultLanguage:'en',enterMode:1,forceEnterMode:false,shiftEnterMode:2,corePlugins:'',docType:'',bodyId:'',bodyClass:'',fullPage:false,height:200,plugins:'about,a11yhelp,basicstyles,blockquote,button,clipboard,colorbutton,colordialog,contextmenu,div,elementspath,enterkey,entities,filebrowser,find,flash,font,format,forms,horizontalrule,htmldataprocessor,image,indent,justify,keystrokes,link,list,liststyle,maximize,newpage,pagebreak,pastefromword,pastetext,popup,preview,print,removeformat,resize,save,scayt,smiley,showblocks,showborders,sourcearea,stylescombo,table,tabletools,specialchar,tab,templates,toolbar,undo,wysiwygarea,wsc',extraPlugins:'',removePlugins:'',protectedSource:[],tabIndex:0,theme:'default',skin:'kama',width:'',baseFloatZIndex:10000};var i=a.config;a.focusManager=function(j){if(j.focusManager)return j.focusManager;this.hasFocus=false;this._={editor:j};return this;};a.focusManager.prototype={focus:function(){var k=this;if(k._.timer)clearTimeout(k._.timer);if(!k.hasFocus){if(a.currentInstance)a.currentInstance.focusManager.forceBlur();var j=k._.editor;j.container.getChild(1).addClass('cke_focus');k.hasFocus=true;j.fire('focus');}},blur:function(){var j=this;if(j._.timer)clearTimeout(j._.timer);j._.timer=setTimeout(function(){delete j._.timer;j.forceBlur();},100);},forceBlur:function(){if(this.hasFocus){var j=this._.editor;j.container.getChild(1).removeClass('cke_focus');this.hasFocus=false;j.fire('blur');}}};(function(){var j={};a.lang={languages:{af:1,ar:1,bg:1,bn:1,bs:1,ca:1,cs:1,cy:1,da:1,de:1,el:1,'en-au':1,'en-ca':1,'en-gb':1,en:1,eo:1,es:1,et:1,eu:1,fa:1,fi:1,fo:1,'fr-ca':1,fr:1,gl:1,gu:1,he:1,hi:1,hr:1,hu:1,is:1,it:1,ja:1,km:1,ko:1,lt:1,lv:1,mn:1,ms:1,nb:1,nl:1,no:1,pl:1,'pt-br':1,pt:1,ro:1,ru:1,sk:1,sl:1,'sr-latn':1,sr:1,sv:1,th:1,tr:1,uk:1,vi:1,'zh-cn':1,zh:1},load:function(k,l,m){if(!k||!a.lang.languages[k])k=this.detect(l,k); +},getNext:function(h){var i=this.$,j;do{i=i.nextSibling;j=i&&new d.node(i);}while(j&&h&&!h(j))return j;},getParent:function(){var h=this.$.parentNode;return h&&h.nodeType==1?new d.node(h):null;},getParents:function(h){var i=this,j=[];do j[h?'push':'unshift'](i);while(i=i.getParent())return j;},getCommonAncestor:function(h){var j=this;if(h.equals(j))return j;if(h.contains&&h.contains(j))return h;var i=j.contains?j:j.getParent();do{if(i.contains(h))return i;}while(i=i.getParent())return null;},getPosition:function(h){var i=this.$,j=h.$;if(i.compareDocumentPosition)return i.compareDocumentPosition(j);if(i==j)return 0;if(this.type==1&&h.type==1){if(i.contains){if(i.contains(j))return 16+4;if(j.contains(i))return 8+2;}if('sourceIndex' in i)return i.sourceIndex<0||j.sourceIndex<0?1:i.sourceIndex]*>/g,''):i;},getOuterHtml:function(){var j=this;if(j.$.outerHTML)return j.$.outerHTML.replace(/<\?[^>]*>/,'');var i=j.$.ownerDocument.createElement('div');i.appendChild(j.$.cloneNode(true));return i.innerHTML;},setHtml:function(i){return this.$.innerHTML=i;},setText:function(i){h.prototype.setText=this.$.innerText!=undefined?function(j){return this.$.innerText=j;}:function(j){return this.$.textContent=j;};return this.setText(i);},getAttribute:(function(){var i=function(j){return this.$.getAttribute(j,2);};if(c&&(b.ie7Compat||b.ie6Compat))return function(j){var n=this;switch(j){case 'class':j='className';break;case 'tabindex':var k=i.call(n,j);if(k!==0&&n.$.tabIndex===0)k=null;return k;break;case 'checked':var l=n.$.attributes.getNamedItem(j),m=l.specified?l.nodeValue:n.$.checked;return m?'checked':null;case 'hspace':return n.$.hspace;case 'style':return n.$.style.cssText;}return i.call(n,j);};else return i;})(),getChildren:function(){return new d.nodeList(this.$.childNodes);},getComputedStyle:c?function(i){return this.$.currentStyle[e.cssStyleToDomStyle(i)];}:function(i){return this.getWindow().$.getComputedStyle(this.$,'').getPropertyValue(i);},getDtd:function(){var i=f[this.getName()];this.getDtd=function(){return i;};return i;},getElementsByTag:g.prototype.getElementsByTag,getTabIndex:c?function(){var i=this.$.tabIndex;if(i===0&&!f.$tabIndex[this.getName()]&&parseInt(this.getAttribute('tabindex'),10)!==0)i=-1;return i;}:b.webkit?function(){var i=this.$.tabIndex;if(i==undefined){i=parseInt(this.getAttribute('tabindex'),10);if(isNaN(i))i=-1;}return i;}:function(){return this.$.tabIndex;},getText:function(){return this.$.textContent||this.$.innerText||'';},getWindow:function(){return this.getDocument().getWindow();},getId:function(){return this.$.id||null;},getNameAtt:function(){return this.$.name||null;},getName:function(){var i=this.$.nodeName.toLowerCase();if(c){var j=this.$.scopeName;if(j!='HTML')i=j.toLowerCase()+':'+i;}return(this.getName=function(){return i;})();},getValue:function(){return this.$.value;},getFirst:function(i){var j=this.$.firstChild,k=j&&new d.node(j);if(k&&i&&!i(k))k=k.getNext(i);return k;},getLast:function(i){var j=this.$.lastChild,k=j&&new d.node(j);if(k&&i&&!i(k))k=k.getPrevious(i);return k;},getStyle:function(i){return this.$.style[e.cssStyleToDomStyle(i)]; +},is:function(){var i=this.getName();for(var j=0;j0&&(j>2||!k[i[0].nodeName]||j==2&&!k[i[1].nodeName]);},hasAttribute:function(i){var j=this.$.attributes.getNamedItem(i);return!!(j&&j.specified);},hide:function(){this.setStyle('display','none');},moveChildren:function(i,j){var k=this.$;i=i.$;if(k==i)return;var l;if(j)while(l=k.lastChild)i.insertBefore(k.removeChild(l),i.firstChild);else while(l=k.firstChild)i.appendChild(k.removeChild(l));},mergeSiblings:(function(){function i(j,k,l){if(k&&k.type==1){var m=[];while(k.getAttribute('_fck_bookmark')||k.isEmptyInlineRemoveable()){m.push(k);k=l?k.getNext():k.getPrevious();if(!k||k.type!=1)return;}if(j.isIdentical(k)){var n=l?j.getLast():j.getFirst();while(m.length)m.shift().move(j,!l);k.moveChildren(j,!l);k.remove();if(n&&n.type==1)n.mergeSiblings();}}};return function(){var j=this;if(!(f.$removeEmpty[j.getName()]||j.is('a')))return;i(j,j.getNext(),true);i(j,j.getPrevious());};})(),show:function(){this.setStyles({display:'',visibility:''}); +},setAttribute:(function(){var i=function(j,k){this.$.setAttribute(j,k);return this;};if(c&&(b.ie7Compat||b.ie6Compat))return function(j,k){var l=this;if(j=='class')l.$.className=k;else if(j=='style')l.$.style.cssText=k;else if(j=='tabindex')l.$.tabIndex=k;else if(j=='checked')l.$.checked=k;else i.apply(l,arguments);return l;};else return i;})(),setAttributes:function(i){for(var j in i)this.setAttribute(j,i[j]);return this;},setValue:function(i){this.$.value=i;return this;},removeAttribute:(function(){var i=function(j){this.$.removeAttribute(j);};if(c&&(b.ie7Compat||b.ie6Compat))return function(j){if(j=='class')j='className';else if(j=='tabindex')j='tabIndex';i.call(this,j);};else return i;})(),removeAttributes:function(i){if(e.isArray(i))for(var j=0;j=100?'':'progid:DXImageTransform.Microsoft.Alpha(opacity='+i+')');}else this.setStyle('opacity',i);},unselectable:b.gecko?function(){this.$.style.MozUserSelect='none';this.on('dragstart',function(i){i.data.preventDefault();});}:b.webkit?function(){this.$.style.KhtmlUserSelect='none';this.on('dragstart',function(i){i.data.preventDefault();});}:function(){if(c||b.opera){var i=this.$,j,k=0;i.unselectable='on';while(j=i.all[k++])switch(j.tagName.toLowerCase()){case 'iframe':case 'textarea':case 'input':case 'select':break;default:j.unselectable='on';}}},getPositionedAncestor:function(){var i=this;while(i.getName()!='html'){if(i.getComputedStyle('position')!='static')return i;i=i.getParent();}return null;},getDocumentPosition:function(i){var D=this;var j=0,k=0,l=D.getDocument().getBody(),m=D.getDocument().$.compatMode=='BackCompat',n=D.getDocument();if(document.documentElement.getBoundingClientRect){var o=D.$.getBoundingClientRect(),p=n.$,q=p.documentElement,r=q.clientTop||l.$.clientTop||0,s=q.clientLeft||l.$.clientLeft||0,t=true;if(c){var u=n.getDocumentElement().contains(D),v=n.getBody().contains(D);t=m&&v||!m&&u;}if(t){j=o.left+(!m&&q.scrollLeft||l.$.scrollLeft);j-=s;k=o.top+(!m&&q.scrollTop||l.$.scrollTop); +k-=r;}}else{var w=D,x=null,y;while(w&&!(w.getName()=='body'||w.getName()=='html')){j+=w.$.offsetLeft-w.$.scrollLeft;k+=w.$.offsetTop-w.$.scrollTop;if(!w.equals(D)){j+=w.$.clientLeft||0;k+=w.$.clientTop||0;}var z=x;while(z&&!z.equals(w)){j-=z.$.scrollLeft;k-=z.$.scrollTop;z=z.getParent();}x=w;w=(y=w.$.offsetParent)?new h(y):null;}}if(i){var A=D.getWindow(),B=i.getWindow();if(!A.equals(B)&&A.$.frameElement){var C=new h(A.$.frameElement).getDocumentPosition(i);j+=C.x;k+=C.y;}}if(!document.documentElement.getBoundingClientRect)if(b.gecko&&!m){j+=D.$.clientLeft?1:0;k+=D.$.clientTop?1:0;}return{x:j,y:k};},scrollIntoView:function(i){var o=this;var j=o.getWindow(),k=j.getViewPaneSize().height,l=k*-1;if(i)l+=k;else{l+=o.$.offsetHeight||0;l+=parseInt(o.getComputedStyle('marginBottom')||0,10)||0;}var m=o.getDocumentPosition();l+=m.y;l=l<0?0:l;var n=j.getScrollPosition().y;if(l>n||lwindow.setTimeout(function(){window.close();},50);")');}return i&&new g(i.contentWindow.document);},copyAttributes:function(i,j){var p=this;var k=p.$.attributes;j=j||{};for(var l=0;l0&&j)j=j.childNodes[i.shift()];return j?new d.node(j):null;},getChildCount:function(){return this.$.childNodes.length;},disableContextMenu:function(){this.on('contextmenu',function(i){if(!i.data.getTarget().hasClass('cke_enable_context_menu'))i.data.preventDefault();});}});a.command=function(i,j){this.uiItems=[]; +this.exec=function(k){if(this.state==0)return false;if(this.editorFocus)i.focus();return j.exec.call(this,i,k)!==false;};e.extend(this,j,{modes:{wysiwyg:1},editorFocus:true,state:2});a.event.call(this);};a.command.prototype={enable:function(){var i=this;if(i.state==0)i.setState(!i.preserveState||typeof i.previousState=='undefined'?2:i.previousState);},disable:function(){this.setState(0);},setState:function(i){var j=this;if(j.state==i)return false;j.previousState=j.state;j.state=i;j.fire('state');return true;},toggleState:function(){var i=this;if(i.state==2)i.setState(1);else if(i.state==1)i.setState(2);}};a.event.implementOn(a.command.prototype,true);a.ENTER_P=1;a.ENTER_BR=2;a.ENTER_DIV=3;a.config={customConfig:'config.js',autoUpdateElement:true,baseHref:'',contentsCss:a.basePath+'contents.css',contentsLangDirection:'ui',contentsLanguage:'',language:'',defaultLanguage:'en',enterMode:1,forceEnterMode:false,shiftEnterMode:2,corePlugins:'',docType:'',bodyId:'',bodyClass:'',fullPage:false,height:200,plugins:'about,a11yhelp,basicstyles,bidi,blockquote,button,clipboard,colorbutton,colordialog,contextmenu,dialogadvtab,div,elementspath,enterkey,entities,filebrowser,find,flash,font,format,forms,horizontalrule,htmldataprocessor,image,indent,justify,keystrokes,link,list,liststyle,maximize,newpage,pagebreak,pastefromword,pastetext,popup,preview,print,removeformat,resize,save,scayt,smiley,showblocks,showborders,sourcearea,stylescombo,table,tabletools,specialchar,tab,templates,toolbar,undo,wysiwygarea,wsc',extraPlugins:'',removePlugins:'',protectedSource:[],tabIndex:0,theme:'default',skin:'kama',width:'',baseFloatZIndex:10000};var i=a.config;a.focusManager=function(j){if(j.focusManager)return j.focusManager;this.hasFocus=false;this._={editor:j};return this;};a.focusManager.prototype={focus:function(){var k=this;if(k._.timer)clearTimeout(k._.timer);if(!k.hasFocus){if(a.currentInstance)a.currentInstance.focusManager.forceBlur();var j=k._.editor;j.container.getChild(1).addClass('cke_focus');k.hasFocus=true;j.fire('focus');}},blur:function(){var j=this;if(j._.timer)clearTimeout(j._.timer);j._.timer=setTimeout(function(){delete j._.timer;j.forceBlur();},100);},forceBlur:function(){if(this.hasFocus){var j=this._.editor;j.container.getChild(1).removeClass('cke_focus');this.hasFocus=false;j.fire('blur');}}};(function(){var j={};a.lang={languages:{af:1,ar:1,bg:1,bn:1,bs:1,ca:1,cs:1,cy:1,da:1,de:1,el:1,'en-au':1,'en-ca':1,'en-gb':1,en:1,eo:1,es:1,et:1,eu:1,fa:1,fi:1,fo:1,'fr-ca':1,fr:1,gl:1,gu:1,he:1,hi:1,hr:1,hu:1,is:1,it:1,ja:1,km:1,ko:1,lt:1,lv:1,mn:1,ms:1,nb:1,nl:1,no:1,pl:1,'pt-br':1,pt:1,ro:1,ru:1,sk:1,sl:1,'sr-latn':1,sr:1,sv:1,th:1,tr:1,uk:1,vi:1,'zh-cn':1,zh:1},load:function(k,l,m){if(!k||!a.lang.languages[k])k=this.detect(l,k); if(!this[k])a.scriptLoader.load(a.getUrl('lang/'+k+'.js'),function(){m(k,this[k]);},this);else m(k,this[k]);},detect:function(k,l){var m=this.languages;l=l||navigator.userLanguage||navigator.language;var n=l.toLowerCase().match(/([a-z]+)(?:-([a-z]+))?/),o=n[1],p=n[2];if(m[o+'-'+p])o=o+'-'+p;else if(!m[o])o=null;a.lang.detect=o?function(){return o;}:function(q){return q;};return o||k;}};})();a.scriptLoader=(function(){var j={},k={};return{load:function(l,m,n,o,p){var q=typeof l=='string';if(q)l=[l];if(!n)n=a;var r=l.length,s=[],t=[],u=function(z){if(m)if(q)m.call(n,z);else m.call(n,s,t);};if(r===0){u(true);return;}var v=function(z,A){(A?s:t).push(z);if(--r<=0){p&&a.document.getDocumentElement().removeStyle('cursor');u(A);}},w=function(z,A){j[z]=1;var B=k[z];delete k[z];for(var C=0;C1)return;var B=new h('script');B.setAttributes({type:'text/javascript',src:z});if(m)if(c)B.$.onreadystatechange=function(){if(B.$.readyState=='loaded'||B.$.readyState=='complete'){B.$.onreadystatechange=null;w(z,true);}};else{B.$.onload=function(){setTimeout(function(){w(z,true);},0);};B.$.onerror=function(){w(z,false);};}B.appendTo(a.document.getHead());};p&&a.document.getDocumentElement().setStyle('cursor','wait');for(var y=0;y0){t(v);a.imageCacher.load(v,function(){l[p]=1;n(o,p,q,r);});return;}l[p]=1;}q=s[q];var w=!q||!!q._isLoaded;if(w)r&&r();else{var x=q._pending||(q._pending=[]);x.push(r);if(x.length>1)return;var y=!q.css||!q.css.length,z=!q.js||!q.js.length,A=function(){if(y&&z){q._isLoaded=1;for(var D=0;D=0?x.langCode:J[0];if(!I.lang[L])G.push(a.getUrl(K+'lang/'+L+'.js'));else{e.extend(x.lang,I.lang[L]);L=null;}}F.push(L);E.push(I);}a.scriptLoader.load(G,function(){var M=['beforeInit','init','afterInit'];for(var N=0;N');else this._.output.push('>');},attribute:function(l,m){if(typeof m=='string')m=e.htmlEncodeAttr(m);this._.output.push(' ',l,'="',m,'"');},closeTag:function(l){this._.output.push('');},text:function(l){this._.output.push(l);},comment:function(l){this._.output.push('');},write:function(l){this._.output.push(l);},reset:function(){this._.output=[];this._.indent=false;},getHtml:function(l){var m=this._.output.join('');if(l)this.reset();return m;}}});delete a.loadFullCore;a.instances={};a.document=new g(document);a.add=function(l){a.instances[l.name]=l;l.on('focus',function(){if(a.currentInstance!=l){a.currentInstance=l;a.fire('currentInstance');}});l.on('blur',function(){if(a.currentInstance==l){a.currentInstance=null;a.fire('currentInstance');}});};a.remove=function(l){delete a.instances[l.name];};a.on('instanceDestroyed',function(){if(e.isEmpty(this.instances))a.fire('reset');});a.TRISTATE_ON=1;a.TRISTATE_OFF=2;a.TRISTATE_DISABLED=0;d.comment=e.createClass({base:d.node,$:function(l,m){if(typeof l=='string')l=(m?m.$:document).createComment(l);this.base(l);},proto:{type:8,getOuterHtml:function(){return '';}}});(function(){var l={address:1,blockquote:1,dl:1,h1:1,h2:1,h3:1,h4:1,h5:1,h6:1,p:1,pre:1,li:1,dt:1,dd:1},m={body:1,div:1,table:1,tbody:1,tr:1,td:1,th:1,caption:1,form:1},n=function(o){var p=o.getChildren();for(var q=0,r=p.count();q0&&D.getChild(w.startOffset-1);this._.guardRTL=function(G,H){return(!H||!D.equals(G))&&(!E||!G.equals(E))&&(G.type!=1||!H||G.getName()!='body');};}var F=t?this._.guardRTL:this._.guardLTR;if(y)x=function(G,H){if(F(G,H)===false)return false;return y(G,H);};else x=F;if(this.current)v=this.current[A](false,z,x);else if(t){v=w.endContainer;if(w.endOffset>0){v=v.getChild(w.endOffset-1);if(x(v)===false)v=null;}else v=x(v,true)===false?null:v.getPreviousSourceNode(true,z,x);}else{v=w.startContainer;v=v.getChild(w.startOffset);if(v){if(x(v)===false)v=null;}else v=x(w.startContainer,true)===false?null:w.startContainer.getNextSourceNode(true,z,x);}while(v&&!this._.end){this.current=v;if(!this.evaluator||this.evaluator(v)!==false){if(!u)return v;}else if(u&&this.evaluator)return false;v=v[A](false,z,x);}this.end();return this.current=null;};function m(t){var u,v=null;while(u=l.call(this,t))v=u;return v;};d.walker=e.createClass({$:function(t){this.range=t;this._={};},proto:{end:function(){this._.end=1;},next:function(){return l.call(this); },previous:function(){return l.call(this,true);},checkForward:function(){return l.call(this,false,true)!==false;},checkBackward:function(){return l.call(this,true,true)!==false;},lastForward:function(){return m.call(this);},lastBackward:function(){return m.call(this,true);},reset:function(){delete this.current;this._={};}}});var n={block:1,'list-item':1,table:1,'table-row-group':1,'table-header-group':1,'table-footer-group':1,'table-row':1,'table-column-group':1,'table-column':1,'table-cell':1,'table-caption':1},o={hr:1};h.prototype.isBlockBoundary=function(t){var u=e.extend({},o,t||{});return n[this.getComputedStyle('display')]||u[this.getName()];};d.walker.blockBoundary=function(t){return function(u,v){return!(u.type==1&&u.isBlockBoundary(t));};};d.walker.listItemBoundary=function(){return this.blockBoundary({br:1});};d.walker.bookmark=function(t,u){function v(w){return w&&w.getName&&w.getName()=='span'&&w.hasAttribute('_fck_bookmark');};return function(w){var x,y;x=w&&!w.getName&&(y=w.getParent())&&v(y);x=t?x:x||v(w);return u^x;};};d.walker.whitespaces=function(t){return function(u){var v=u&&u.type==3&&!e.trim(u.getText());return t^v;};};d.walker.invisible=function(t){var u=d.walker.whitespaces();return function(v){var w=u(v)||v.is&&!v.$.offsetHeight;return t^w;};};var p=/^[\t\r\n ]*(?: |\xa0)$/,q=d.walker.whitespaces(true),r=d.walker.bookmark(false,true),s=function(t){return r(t)&&q(t);};h.prototype.getBogus=function(){var t=this.getLast(s);if(t&&(!c?t.is&&t.is('br'):t.getText&&p.test(t.getText())))return t;return false;};})();d.range=function(l){var m=this;m.startContainer=null;m.startOffset=null;m.endContainer=null;m.endOffset=null;m.collapsed=true;m.document=l;};(function(){var l=function(t){t.collapsed=t.startContainer&&t.endContainer&&t.startContainer.equals(t.endContainer)&&t.startOffset==t.endOffset;},m=function(t,u,v){t.optimizeBookmark();var w=t.startContainer,x=t.endContainer,y=t.startOffset,z=t.endOffset,A,B;if(x.type==3)x=x.split(z);else if(x.getChildCount()>0)if(z>=x.getChildCount()){x=x.append(t.document.createText(''));B=true;}else x=x.getChild(z);if(w.type==3){w.split(y);if(w.equals(x))x=w.getNext();}else if(!y){w=w.getFirst().insertBeforeMe(t.document.createText(''));A=true;}else if(y>=w.getChildCount()){w=w.append(t.document.createText(''));A=true;}else w=w.getChild(y).getPrevious();var C=w.getParents(),D=x.getParents(),E,F,G;for(E=0;E0&&!I.equals(x))J=H.append(I.clone());if(!C[N]||I.$.parentNode!=C[N].$.parentNode){K=I.getPrevious();while(K){if(K.equals(C[N])||K.equals(w))break;L=K.getPrevious();if(u==2)H.$.insertBefore(K.$.cloneNode(true),H.$.firstChild);else{K.remove();if(u==1)H.$.insertBefore(K.$,H.$.firstChild);}K=L;}}if(H)H=J;}if(u==2){var O=t.startContainer;if(O.type==3){O.$.data+=O.$.nextSibling.data;O.$.parentNode.removeChild(O.$.nextSibling);}var P=t.endContainer;if(P.type==3&&P.$.nextSibling){P.$.data+=P.$.nextSibling.data;P.$.parentNode.removeChild(P.$.nextSibling);}}else{if(F&&G&&(w.$.parentNode!=F.$.parentNode||x.$.parentNode!=G.$.parentNode)){var Q=G.getIndex();if(A&&G.$.parentNode==w.$.parentNode)Q--;t.setStart(G.getParent(),Q);}t.collapse(true);}if(A)w.remove();if(B&&x.$.parentNode)x.remove();},n={abbr:1,acronym:1,b:1,bdo:1,big:1,cite:1,code:1,del:1,dfn:1,em:1,font:1,i:1,ins:1,label:1,kbd:1,q:1,samp:1,small:1,span:1,strike:1,strong:1,sub:1,sup:1,tt:1,u:1,'var':1};function o(t){var u=false,v=d.walker.bookmark(true);return function(w){if(v(w))return true;if(w.type==3){if(e.trim(w.getText()).length)return false;}else if(w.type==1)if(!n[w.getName()])if(!t&&!c&&w.getName()=='br'&&!u)u=true;else return false;return true;};};function p(t){return t.type!=3&&t.getName() in f.$removeEmpty||!e.trim(t.getText())||t.getParent().hasAttribute('_fck_bookmark');};var q=new d.walker.whitespaces(),r=new d.walker.bookmark();function s(t){return!q(t)&&!r(t);};d.range.prototype={clone:function(){var u=this;var t=new d.range(u.document);t.startContainer=u.startContainer;t.startOffset=u.startOffset;t.endContainer=u.endContainer;t.endOffset=u.endOffset;t.collapsed=u.collapsed;return t;},collapse:function(t){var u=this;if(t){u.endContainer=u.startContainer;u.endOffset=u.startOffset;}else{u.startContainer=u.endContainer;u.startOffset=u.endOffset;}u.collapsed=true;},cloneContents:function(){var t=new d.documentFragment(this.document);if(!this.collapsed)m(this,2,t);return t;},deleteContents:function(){if(this.collapsed)return;m(this,0);},extractContents:function(){var t=new d.documentFragment(this.document);if(!this.collapsed)m(this,1,t);return t;},createBookmark:function(t){var y=this;var u,v,w,x;u=y.document.createElement('span');u.setAttribute('_fck_bookmark',1); -u.setStyle('display','none');u.setHtml(' ');if(t){w='cke_bm_'+e.getNextNumber();u.setAttribute('id',w+'S');}if(!y.collapsed){v=u.clone();v.setHtml(' ');if(t)v.setAttribute('id',w+'E');x=y.clone();x.collapse();x.insertNode(v);}x=y.clone();x.collapse(true);x.insertNode(u);if(v){y.setStartAfter(u);y.setEndBefore(v);}else y.moveToPosition(u,4);return{startNode:t?w+'S':u,endNode:t?w+'E':v,serializable:t};},createBookmark2:function(t){var A=this;var u=A.startContainer,v=A.endContainer,w=A.startOffset,x=A.endOffset,y,z;if(!u||!v)return{start:0,end:0};if(t){if(u.type==1){y=u.getChild(w);if(y&&y.type==3&&w>0&&y.getPrevious().type==3){u=y;w=0;}}while(u.type==3&&(z=u.getPrevious())&&z.type==3){u=z;w+=z.getLength();}if(!A.isCollapsed){if(v.type==1){y=v.getChild(x);if(y&&y.type==3&&x>0&&y.getPrevious().type==3){v=y;x=0;}}while(v.type==3&&(z=v.getPrevious())&&z.type==3){v=z;x+=z.getLength();}}}return{start:u.getAddress(t),end:A.isCollapsed?null:v.getAddress(t),startOffset:w,endOffset:x,normalized:t,is2:true};},moveToBookmark:function(t){var B=this;if(t.is2){var u=B.document.getByAddress(t.start,t.normalized),v=t.startOffset,w=t.end&&B.document.getByAddress(t.end,t.normalized),x=t.endOffset;B.setStart(u,v);if(w)B.setEnd(w,x);else B.collapse(true);}else{var y=t.serializable,z=y?B.document.getById(t.startNode):t.startNode,A=y?B.document.getById(t.endNode):t.endNode;B.setStartBefore(z);z.remove();if(A){B.setEndBefore(A);A.remove();}else B.collapse(true);}},getBoundaryNodes:function(){var y=this;var t=y.startContainer,u=y.endContainer,v=y.startOffset,w=y.endOffset,x;if(t.type==1){x=t.getChildCount();if(x>v)t=t.getChild(v);else if(x<1)t=t.getPreviousSourceNode();else{t=t.$;while(t.lastChild)t=t.lastChild;t=new d.node(t);t=t.getNextSourceNode()||t;}}if(u.type==1){x=u.getChildCount();if(x>w)u=u.getChild(w).getPreviousSourceNode(true);else if(x<1)u=u.getPreviousSourceNode();else{u=u.$;while(u.lastChild)u=u.lastChild;u=new d.node(u);}}if(t.getPosition(u)&2)t=u;return{startNode:t,endNode:u};},getCommonAncestor:function(t,u){var y=this;var v=y.startContainer,w=y.endContainer,x;if(v.equals(w)){if(t&&v.type==1&&y.startOffset==y.endOffset-1)x=v.getChild(y.startOffset);else x=v;}else x=v.getCommonAncestor(w);return u&&!x.is?x.getParent():x;},optimize:function(){var v=this;var t=v.startContainer,u=v.startOffset;if(t.type!=1)if(!u)v.setStartBefore(t);else if(u>=t.getLength())v.setStartAfter(t);t=v.endContainer;u=v.endOffset;if(t.type!=1)if(!u)v.setEndBefore(t);else if(u>=t.getLength())v.setEndAfter(t); +if(H&&!I.equals(w))J=H.append(I.clone());K=I.getNext();while(K){if(K.equals(D[M])||K.equals(x))break;L=K.getNext();if(u==2)H.append(K.clone(true));else{K.remove();if(u==1)H.append(K);}K=L;}if(H)H=J;}H=v;for(var N=E;N0&&!I.equals(x))J=H.append(I.clone());if(!C[N]||I.$.parentNode!=C[N].$.parentNode){K=I.getPrevious();while(K){if(K.equals(C[N])||K.equals(w))break;L=K.getPrevious();if(u==2)H.$.insertBefore(K.$.cloneNode(true),H.$.firstChild);else{K.remove();if(u==1)H.$.insertBefore(K.$,H.$.firstChild);}K=L;}}if(H)H=J;}if(u==2){var O=t.startContainer;if(O.type==3){O.$.data+=O.$.nextSibling.data;O.$.parentNode.removeChild(O.$.nextSibling);}var P=t.endContainer;if(P.type==3&&P.$.nextSibling){P.$.data+=P.$.nextSibling.data;P.$.parentNode.removeChild(P.$.nextSibling);}}else{if(F&&G&&(w.$.parentNode!=F.$.parentNode||x.$.parentNode!=G.$.parentNode)){var Q=G.getIndex();if(A&&G.$.parentNode==w.$.parentNode)Q--;t.setStart(G.getParent(),Q);}t.collapse(true);}if(A)w.remove();if(B&&x.$.parentNode)x.remove();},n={abbr:1,acronym:1,b:1,bdo:1,big:1,cite:1,code:1,del:1,dfn:1,em:1,font:1,i:1,ins:1,label:1,kbd:1,q:1,samp:1,small:1,span:1,strike:1,strong:1,sub:1,sup:1,tt:1,u:1,'var':1};function o(t){var u=false,v=d.walker.bookmark(true);return function(w){if(v(w))return true;if(w.type==3){if(e.trim(w.getText()).length)return false;}else if(w.type==1)if(!n[w.getName()])if(!t&&!c&&w.getName()=='br'&&!u)u=true;else return false;return true;};};function p(t){return t.type!=3&&t.getName() in f.$removeEmpty||!e.trim(t.getText())||t.getParent().hasAttribute('_fck_bookmark');};var q=new d.walker.whitespaces(),r=new d.walker.bookmark();function s(t){return!q(t)&&!r(t);};d.range.prototype={clone:function(){var u=this;var t=new d.range(u.document);t.startContainer=u.startContainer;t.startOffset=u.startOffset;t.endContainer=u.endContainer;t.endOffset=u.endOffset;t.collapsed=u.collapsed;return t;},collapse:function(t){var u=this;if(t){u.endContainer=u.startContainer;u.endOffset=u.startOffset;}else{u.startContainer=u.endContainer;u.startOffset=u.endOffset;}u.collapsed=true;},cloneContents:function(){var t=new d.documentFragment(this.document);if(!this.collapsed)m(this,2,t);return t;},deleteContents:function(){if(this.collapsed)return;m(this,0);},extractContents:function(){var t=new d.documentFragment(this.document);if(!this.collapsed)m(this,1,t);return t;},createBookmark:function(t){var z=this;var u,v,w,x,y=z.collapsed;u=z.document.createElement('span');u.setAttribute('_fck_bookmark',1); +u.setStyle('display','none');u.setHtml(' ');if(t){w='cke_bm_'+e.getNextNumber();u.setAttribute('id',w+'S');}if(!y){v=u.clone();v.setHtml(' ');if(t)v.setAttribute('id',w+'E');x=z.clone();x.collapse();x.insertNode(v);}x=z.clone();x.collapse(true);x.insertNode(u);if(v){z.setStartAfter(u);z.setEndBefore(v);}else z.moveToPosition(u,4);return{startNode:t?w+'S':u,endNode:t?w+'E':v,serializable:t,collapsed:y};},createBookmark2:function(t){var B=this;var u=B.startContainer,v=B.endContainer,w=B.startOffset,x=B.endOffset,y=B.collapsed,z,A;if(!u||!v)return{start:0,end:0};if(t){if(u.type==1){z=u.getChild(w);if(z&&z.type==3&&w>0&&z.getPrevious().type==3){u=z;w=0;}}while(u.type==3&&(A=u.getPrevious())&&A.type==3){u=A;w+=A.getLength();}if(!y){if(v.type==1){z=v.getChild(x);if(z&&z.type==3&&x>0&&z.getPrevious().type==3){v=z;x=0;}}while(v.type==3&&(A=v.getPrevious())&&A.type==3){v=A;x+=A.getLength();}}}return{start:u.getAddress(t),end:y?null:v.getAddress(t),startOffset:w,endOffset:x,normalized:t,collapsed:y,is2:true};},moveToBookmark:function(t){var B=this;if(t.is2){var u=B.document.getByAddress(t.start,t.normalized),v=t.startOffset,w=t.end&&B.document.getByAddress(t.end,t.normalized),x=t.endOffset;B.setStart(u,v);if(w)B.setEnd(w,x);else B.collapse(true);}else{var y=t.serializable,z=y?B.document.getById(t.startNode):t.startNode,A=y?B.document.getById(t.endNode):t.endNode;B.setStartBefore(z);z.remove();if(A){B.setEndBefore(A);A.remove();}else B.collapse(true);}},getBoundaryNodes:function(){var y=this;var t=y.startContainer,u=y.endContainer,v=y.startOffset,w=y.endOffset,x;if(t.type==1){x=t.getChildCount();if(x>v)t=t.getChild(v);else if(x<1)t=t.getPreviousSourceNode();else{t=t.$;while(t.lastChild)t=t.lastChild;t=new d.node(t);t=t.getNextSourceNode()||t;}}if(u.type==1){x=u.getChildCount();if(x>w)u=u.getChild(w).getPreviousSourceNode(true);else if(x<1)u=u.getPreviousSourceNode();else{u=u.$;while(u.lastChild)u=u.lastChild;u=new d.node(u);}}if(t.getPosition(u)&2)t=u;return{startNode:t,endNode:u};},getCommonAncestor:function(t,u){var y=this;var v=y.startContainer,w=y.endContainer,x;if(v.equals(w)){if(t&&v.type==1&&y.startOffset==y.endOffset-1)x=v.getChild(y.startOffset);else x=v;}else x=v.getCommonAncestor(w);return u&&!x.is?x.getParent():x;},optimize:function(){var v=this;var t=v.startContainer,u=v.startOffset;if(t.type!=1)if(!u)v.setStartBefore(t);else if(u>=t.getLength())v.setStartAfter(t);t=v.endContainer;u=v.endOffset;if(t.type!=1)if(!u)v.setEndBefore(t);else if(u>=t.getLength())v.setEndAfter(t); },optimizeBookmark:function(){var v=this;var t=v.startContainer,u=v.endContainer;if(t.is&&t.is('span')&&t.hasAttribute('_fck_bookmark'))v.setStartAt(t,3);if(u&&u.is&&u.is('span')&&u.hasAttribute('_fck_bookmark'))v.setEndAt(u,4);},trim:function(t,u){var B=this;var v=B.startContainer,w=B.startOffset,x=B.collapsed;if((!t||x)&&v&&v.type==3){if(!w){w=v.getIndex();v=v.getParent();}else if(w>=v.getLength()){w=v.getIndex()+1;v=v.getParent();}else{var y=v.split(w);w=v.getIndex()+1;v=v.getParent();if(B.startContainer.equals(B.endContainer))B.setEnd(y,B.endOffset-B.startOffset);else if(v.equals(B.endContainer))B.endOffset+=1;}B.setStart(v,w);if(x){B.collapse(true);return;}}var z=B.endContainer,A=B.endOffset;if(!(u||x)&&z&&z.type==3){if(!A){A=z.getIndex();z=z.getParent();}else if(A>=z.getLength()){A=z.getIndex()+1;z=z.getParent();}else{z.split(A);A=z.getIndex()+1;z=z.getParent();}B.setEnd(z,A);}},enlarge:function(t){switch(t){case 1:if(this.collapsed)return;var u=this.getCommonAncestor(),v=this.document.getBody(),w,x,y,z,A,B=false,C,D,E=this.startContainer,F=this.startOffset;if(E.type==3){if(F){E=!e.trim(E.substring(0,F)).length&&E;B=!!E;}if(E)if(!(z=E.getPrevious()))y=E.getParent();}else{if(F)z=E.getChild(F-1)||E.getLast();if(!z)y=E;}while(y||z){if(y&&!z){if(!A&&y.equals(u))A=true;if(!v.contains(y))break;if(!B||y.getComputedStyle('display')!='inline'){B=false;if(A)w=y;else this.setStartBefore(y);}z=y.getPrevious();}while(z){C=false;if(z.type==3){D=z.getText();if(/[^\s\ufeff]/.test(D))z=null;C=/[\s\ufeff]$/.test(D);}else if(z.$.offsetWidth>0&&!z.getAttribute('_fck_bookmark'))if(B&&f.$removeEmpty[z.getName()]){D=z.getText();if(/[^\s\ufeff]/.test(D))z=null;else{var G=z.$.all||z.$.getElementsByTagName('*');for(var H=0,I;I=G[H++];){if(!f.$removeEmpty[I.nodeName.toLowerCase()]){z=null;break;}}}if(z)C=!!D.length;}else z=null;if(C)if(B){if(A)w=y;else if(y)this.setStartBefore(y);}else B=true;if(z){var J=z.getPrevious();if(!y&&!J){y=z;z=null;break;}z=J;}else y=null;}if(y)y=y.getParent();}E=this.endContainer;F=this.endOffset;y=z=null;A=B=false;if(E.type==3){E=!e.trim(E.substring(F)).length&&E;B=!(E&&E.getLength());if(E)if(!(z=E.getNext()))y=E.getParent();}else{z=E.getChild(F);if(!z)y=E;}while(y||z){if(y&&!z){if(!A&&y.equals(u))A=true;if(!v.contains(y))break;if(!B||y.getComputedStyle('display')!='inline'){B=false;if(A)x=y;else if(y)this.setEndAfter(y);}z=y.getNext();}while(z){C=false;if(z.type==3){D=z.getText();if(/[^\s\ufeff]/.test(D))z=null;C=/^[\s\ufeff]/.test(D);}else if(z.$.offsetWidth>0&&!z.getAttribute('_fck_bookmark'))if(B&&f.$removeEmpty[z.getName()]){D=z.getText(); if(/[^\s\ufeff]/.test(D))z=null;else{G=z.$.all||z.$.getElementsByTagName('*');for(H=0;I=G[H++];){if(!f.$removeEmpty[I.nodeName.toLowerCase()]){z=null;break;}}}if(z)C=!!D.length;}else z=null;if(C)if(B)if(A)x=y;else this.setEndAfter(y);if(z){J=z.getNext();if(!y&&!J){y=z;z=null;break;}z=J;}else y=null;}if(y)y=y.getParent();}if(w&&x){u=w.contains(x)?x:w;this.setStartBefore(u);this.setEndAfter(u);}break;case 2:case 3:var K=new d.range(this.document);v=this.document.getBody();K.setStartAt(v,1);K.setEnd(this.startContainer,this.startOffset);var L=new d.walker(K),M,N,O=d.walker.blockBoundary(t==3?{br:1}:null),P=function(R){var S=O(R);if(!S)M=R;return S;},Q=function(R){var S=P(R);if(!S&&R.is&&R.is('br'))N=R;return S;};L.guard=P;y=L.lastBackward();M=M||v;this.setStartAt(M,!M.is('br')&&(!y&&this.checkStartOfBlock()||y&&M.contains(y))?1:4);K=this.clone();K.collapse();K.setEndAt(v,2);L=new d.walker(K);L.guard=t==3?Q:P;M=null;y=L.lastForward();M=M||v;this.setEndAt(M,!y&&this.checkEndOfBlock()||y&&M.contains(y)?2:3);if(N)this.setEndAfter(N);}},shrink:function(t,u){if(!this.collapsed){t=t||2;var v=this.clone(),w=this.startContainer,x=this.endContainer,y=this.startOffset,z=this.endOffset,A=this.collapsed,B=1,C=1;if(w&&w.type==3)if(!y)v.setStartBefore(w);else if(y>=w.getLength())v.setStartAfter(w);else{v.setStartBefore(w);B=0;}if(x&&x.type==3)if(!z)v.setEndBefore(x);else if(z>=x.getLength())v.setEndAfter(x);else{v.setEndAfter(x);C=0;}var D=new d.walker(v);D.evaluator=function(H){return H.type==(t==1?1:3);};var E;D.guard=function(H,I){if(t==1&&H.type==3)return false;if(I&&H.equals(E))return false;if(!I&&H.type==1)E=H;return true;};if(B){var F=D[t==1?'lastForward':'next']();F&&this.setStartAt(F,u?1:3);}if(C){D.reset();var G=D[t==1?'lastBackward':'previous']();G&&this.setEndAt(G,u?2:4);}return!!(B||C);}},insertNode:function(t){var x=this;x.optimizeBookmark();x.trim(false,true);var u=x.startContainer,v=x.startOffset,w=u.getChild(v);if(w)t.insertBefore(w);else u.append(t);if(t.getParent().equals(x.endContainer))x.endOffset++;x.setStartBefore(t);},moveToPosition:function(t,u){this.setStartAt(t,u);this.collapse(true);},selectNodeContents:function(t){this.setStart(t,0);this.setEnd(t,t.type==3?t.getLength():t.getChildCount());},setStart:function(t,u){var v=this;if(t.type==1&&f.$empty[t.getName()])t=t.getParent(),u=t.getIndex();v.startContainer=t;v.startOffset=u;if(!v.endContainer){v.endContainer=t;v.endOffset=u;}l(v);},setEnd:function(t,u){var v=this;if(t.type==1&&f.$empty[t.getName()])t=t.getParent(),u=t.getIndex()+1; -v.endContainer=t;v.endOffset=u;if(!v.startContainer){v.startContainer=t;v.startOffset=u;}l(v);},setStartAfter:function(t){this.setStart(t.getParent(),t.getIndex()+1);},setStartBefore:function(t){this.setStart(t.getParent(),t.getIndex());},setEndAfter:function(t){this.setEnd(t.getParent(),t.getIndex()+1);},setEndBefore:function(t){this.setEnd(t.getParent(),t.getIndex());},setStartAt:function(t,u){var v=this;switch(u){case 1:v.setStart(t,0);break;case 2:if(t.type==3)v.setStart(t,t.getLength());else v.setStart(t,t.getChildCount());break;case 3:v.setStartBefore(t);break;case 4:v.setStartAfter(t);}l(v);},setEndAt:function(t,u){var v=this;switch(u){case 1:v.setEnd(t,0);break;case 2:if(t.type==3)v.setEnd(t,t.getLength());else v.setEnd(t,t.getChildCount());break;case 3:v.setEndBefore(t);break;case 4:v.setEndAfter(t);}l(v);},fixBlock:function(t,u){var x=this;var v=x.createBookmark(),w=x.document.createElement(u);x.collapse(t);x.enlarge(2);x.extractContents().appendTo(w);w.trim();if(!c)w.appendBogus();x.insertNode(w);x.moveToBookmark(v);return w;},splitBlock:function(t){var D=this;var u=new d.elementPath(D.startContainer),v=new d.elementPath(D.endContainer),w=u.blockLimit,x=v.blockLimit,y=u.block,z=v.block,A=null;if(!w.equals(x))return null;if(t!='br'){if(!y){y=D.fixBlock(true,t);z=new d.elementPath(D.endContainer).block;}if(!z)z=D.fixBlock(false,t);}var B=y&&D.checkStartOfBlock(),C=z&&D.checkEndOfBlock();D.deleteContents();if(y&&y.equals(z))if(C){A=new d.elementPath(D.startContainer);D.moveToPosition(z,4);z=null;}else if(B){A=new d.elementPath(D.startContainer);D.moveToPosition(y,3);y=null;}else{z=D.splitElement(y);if(!c&&!y.is('ul','ol'))y.appendBogus();}return{previousBlock:y,nextBlock:z,wasStartOfBlock:B,wasEndOfBlock:C,elementPath:A};},splitElement:function(t){var w=this;if(!w.collapsed)return null;w.setEndAt(t,2);var u=w.extractContents(),v=t.clone(false);u.appendTo(v);v.insertAfter(t);w.moveToPosition(t,4);return v;},checkBoundaryOfElement:function(t,u){var v=this.clone();v[u==1?'setStartAt':'setEndAt'](t,u==1?1:2);var w=new d.walker(v);w.evaluator=p;return w[u==1?'checkBackward':'checkForward']();},checkStartOfBlock:function(){var z=this;var t=z.startContainer,u=z.startOffset;if(u&&t.type==3){var v=e.ltrim(t.substring(0,u));if(v.length)return false;}z.trim();var w=new d.elementPath(z.startContainer),x=z.clone();x.collapse(true);x.setStartAt(w.block||w.blockLimit,1);var y=new d.walker(x);y.evaluator=o(true);return y.checkBackward();},checkEndOfBlock:function(){var z=this; -var t=z.endContainer,u=z.endOffset;if(t.type==3){var v=e.rtrim(t.substring(u));if(v.length)return false;}z.trim();var w=new d.elementPath(z.endContainer),x=z.clone();x.collapse(false);x.setEndAt(w.block||w.blockLimit,2);var y=new d.walker(x);y.evaluator=o(false);return y.checkForward();},moveToElementEditablePosition:function(t,u){var v;if(f.$empty[t.getName()])return false;while(t&&t.type==1){v=t.isEditable();if(v)this.moveToPosition(t,u?2:1);else if(f.$inline[t.getName()]){this.moveToPosition(t,u?4:3);return true;}if(f.$empty[t.getName()])t=t[u?'getPrevious':'getNext'](s);else t=t[u?'getLast':'getFirst'](s);if(t&&t.type==3){this.moveToPosition(t,u?4:3);return true;}}return v;},moveToElementEditStart:function(t){return this.moveToElementEditablePosition(t);},moveToElementEditEnd:function(t){return this.moveToElementEditablePosition(t,true);},getEnclosedNode:function(){var t=this.clone();t.optimize();if(t.startContainer.type!=1||t.endContainer.type!=1)return null;var u=new d.walker(t),v=d.walker.bookmark(true),w=d.walker.whitespaces(true),x=function(z){return w(z)&&v(z);};t.evaluator=x;var y=u.next();u.reset();return y&&y.equals(u.previous())?y:null;},getTouchedStartNode:function(){var t=this.startContainer;if(this.collapsed||t.type!=1)return t;return t.getChild(this.startOffset)||t;},getTouchedEndNode:function(){var t=this.endContainer;if(this.collapsed||t.type!=1)return t;return t.getChild(this.endOffset-1)||t;}};})();a.POSITION_AFTER_START=1;a.POSITION_BEFORE_END=2;a.POSITION_BEFORE_START=3;a.POSITION_AFTER_END=4;a.ENLARGE_ELEMENT=1;a.ENLARGE_BLOCK_CONTENTS=2;a.ENLARGE_LIST_ITEM_CONTENTS=3;a.START=1;a.END=2;a.STARTEND=3;a.SHRINK_ELEMENT=1;a.SHRINK_TEXT=2;(function(){if(b.webkit){b.hc=false;return;}var l=c&&b.version<7,m=c&&b.version==7,n=l?a.basePath+'images/spacer.gif':m?'about:blank':'data:image/png;base64,',o=h.createFromHtml('
            ',a.document);o.appendTo(a.document.getHead());try{b.hc=o.getComputedStyle('background-image')=='none';}catch(p){b.hc=false;}if(b.hc)b.cssClass+=' cke_hc';o.remove();})();j.load(i.corePlugins.split(','),function(){a.status='loaded';a.fire('loaded');var l=a._.pending;if(l){delete a._.pending;for(var m=0;m0){y=z.shift();while(!y.getParent().equals(C))y=y.getParent();if(!y.equals(G))D.push(y);G=y;}while(D.length>0){y=D.shift();if(y.getName()=='blockquote'){var H=new d.documentFragment(p.document);while(y.getFirst()){H.append(y.getFirst().remove());z.push(H.getLast());}H.replace(y);}else z.push(y);}var I=p.document.createElement('blockquote');I.insertBefore(z[0]);while(z.length>0){y=z.shift();I.append(y);}}else if(q==1){var J=[],K={};while(y=x.getNextParagraph()){var L=null,M=null;while(y.getParent()){if(y.getParent().getName()=='blockquote'){L=y.getParent();M=y;break;}y=y.getParent();}if(L&&M&&!M.getCustomData('blockquote_moveout')){J.push(M);h.setMarker(K,M,'blockquote_moveout',true);}}h.clearAllMarkers(K);var N=[],O=[];K={};while(J.length>0){var P=J.shift();I=P.getParent();if(!P.getPrevious())P.remove().insertBefore(I);else if(!P.getNext())P.remove().insertAfter(I);else{P.breakParent(P.getParent());O.push(P.getNext());}if(!I.getCustomData('blockquote_processed')){O.push(I);h.setMarker(K,I,'blockquote_processed',true);}N.push(P);}h.clearAllMarkers(K);for(E=O.length-1;E>=0;E--){I=O[E];if(n(I))I.remove();}if(p.config.enterMode==2){var Q=true;while(N.length){P=N.shift();if(P.getName()=='div'){H=new d.documentFragment(p.document);var R=Q&&P.getPrevious()&&!(P.getPrevious().type==1&&P.getPrevious().isBlockBoundary());if(R)H.append(p.document.createElement('br')); -var S=P.getNext()&&!(P.getNext().type==1&&P.getNext().isBlockBoundary());while(P.getFirst())P.getFirst().remove().appendTo(H);if(S)H.append(p.document.createElement('br'));H.replace(P);Q=false;}}}}r.selectBookmarks(t);p.focus();}};j.add('blockquote',{init:function(p){p.addCommand('blockquote',o);p.ui.addButton('Blockquote',{label:p.lang.blockquote,command:'blockquote'});p.on('selectionChange',m);},requires:['domiterator']});})();j.add('button',{beforeInit:function(l){l.ui.addHandler(1,k.button.handler);}});a.UI_BUTTON=1;k.button=function(l){e.extend(this,l,{title:l.label,className:l.className||l.command&&'cke_button_'+l.command||'',click:l.click||(function(m){m.execCommand(l.command);})});this._={};};k.button.handler={create:function(l){return new k.button(l);}};k.button.prototype={canGroup:true,render:function(l,m){var n=b,o=this._.id='cke_'+e.getNextNumber(),p='',q=this.command,r,s;this._.editor=l;var t={id:o,button:this,editor:l,focus:function(){var v=a.document.getById(o);v.focus();},execute:function(){this.button.click(l);}};t.clickFn=r=e.addFunction(t.execute,t);t.index=s=k.button._.instances.push(t)-1;if(this.modes)l.on('mode',function(){this.setState(this.modes[l.mode]?2:0);},this);else if(q){q=l.getCommand(q);if(q){q.on('state',function(){this.setState(q.state);},this);p+='cke_'+(q.state==1?'on':q.state==0?'disabled':'off');}}if(!q)p+='cke_off';if(this.className)p+=' '+this.className;m.push('','=10900&&!n.hc?'':'" href="javascript:void(\''+(this.title||'').replace("'",'')+"')\"",' title="',this.title,'" tabindex="-1" hidefocus="true" role="button" aria-labelledby="'+o+'_label"'+(this.hasArrow?' aria-haspopup="true"':''));if(n.opera||n.gecko&&n.mac)m.push(' onkeypress="return false;"');if(n.gecko)m.push(' onblur="this.style.cssText = this.style.cssText;"');m.push(' onkeydown="return CKEDITOR.ui.button._.keydown(',s,', event);" onfocus="return CKEDITOR.ui.button._.focus(',s,', event);" onclick="CKEDITOR.tools.callFunction(',r,', this); return false;"> ',this.label,'');if(this.hasArrow)m.push(''+(b.hc?'▼':' ')+'');m.push('','');if(this.onRender)this.onRender();return t;},setState:function(l){if(this._.state==l)return false; -this._.state=l;var m=a.document.getById(this._.id);if(m){m.setState(l);l==0?m.setAttribute('aria-disabled',true):m.removeAttribute('aria-disabled');l==1?m.setAttribute('aria-pressed',true):m.removeAttribute('aria-pressed');return true;}else return false;}};k.button._={instances:[],keydown:function(l,m){var n=k.button._.instances[l];if(n.onkey){m=new d.event(m);return n.onkey(n,m.getKeystroke())!==false;}},focus:function(l,m){var n=k.button._.instances[l],o;if(n.onfocus)o=n.onfocus(n,new d.event(m))!==false;if(b.gecko&&b.version<10900)m.preventBubble();return o;}};k.prototype.addButton=function(l,m){this.add(l,1,m);};a.on('reset',function(){k.button._.instances=[];});(function(){var l=function(s,t){var u=s.document,v=u.getBody(),w=false,x=function(){w=true;};v.on(t,x);(b.version>7?u.$:u.$.selection.createRange()).execCommand(t);v.removeListener(t,x);return w;},m=c?function(s,t){return l(s,t);}:function(s,t){try{return s.document.$.execCommand(t);}catch(u){return false;}},n=function(s){this.type=s;this.canUndo=this.type=='cut';};n.prototype={exec:function(s,t){this.type=='cut'&&r(s);var u=m(s,this.type);if(!u)alert(s.lang.clipboard[this.type+'Error']);return u;}};var o={canUndo:false,exec:c?function(s){s.focus();if(!s.document.getBody().fire('beforepaste')&&!l(s,'paste')){s.fire('pasteDialog');return false;}}:function(s){try{if(!s.document.getBody().fire('beforepaste')&&!s.document.$.execCommand('Paste',false,null))throw 0;}catch(t){setTimeout(function(){s.fire('pasteDialog');},0);return false;}}},p=function(s){if(this.mode!='wysiwyg')return;switch(s.data.keyCode){case 1000+86:case 2000+45:var t=this.document.getBody();if(!c&&t.fire('beforepaste'))s.cancel();else if(b.opera||b.gecko&&b.version<10900)t.fire('paste');return;case 1000+88:case 2000+46:var u=this;this.fire('saveSnapshot');setTimeout(function(){u.fire('saveSnapshot');},0);}};function q(s,t,u){var v=this.document;if(c&&v.getById('cke_pastebin'))return;if(t=='text'&&s.data&&s.data.$.clipboardData){var w=s.data.$.clipboardData.getData('text/plain');if(w){s.data.preventDefault();u(w);return;}}var x=this.getSelection(),y=new d.range(v),z=new h(t=='text'?'textarea':b.webkit?'body':'div',v);z.setAttribute('id','cke_pastebin');b.webkit&&z.append(v.createText('\xa0'));v.getBody().append(z);z.setStyles({position:'absolute',top:x.getStartElement().getDocumentPosition().y+'px',width:'1px',height:'1px',overflow:'hidden'});z.setStyle(this.config.contentsLangDirection=='ltr'?'left':'right','-1000px');var A=x.createBookmarks(); -if(t=='text'){if(c){var B=v.getBody().$.createTextRange();B.moveToElementText(z.$);B.execCommand('Paste');s.data.preventDefault();}else{v.$.designMode='off';z.$.focus();}}else{y.setStartAt(z,1);y.setEndAt(z,2);y.select(true);}window.setTimeout(function(){t=='text'&&!c&&(v.$.designMode='on');z.remove();var C;z=b.webkit&&(C=z.getFirst())&&C.is&&C.hasClass('Apple-style-span')?C:z;x.selectBookmarks(A);u(z['get'+(t=='text'?'Value':'Html')]());},0);};function r(s){if(!c||s.document.$.compatMode=='BackCompat')return;var t=s.getSelection(),u;if(t.getType()==3&&(u=t.getSelectedElement())){var v=t.getRanges()[0],w=s.document.createText('');w.insertBefore(u);v.setStartBefore(w);v.setEndAfter(u);t.selectRanges([v]);setTimeout(function(){if(u.getParent()){w.remove();t.selectElement(u);}},0);}};j.add('clipboard',{requires:['dialog','htmldataprocessor'],init:function(s){s.on('paste',function(x){var y=x.data;if(y.html)s.insertHtml(y.html);else if(y.text)s.insertText(y.text);},null,null,1000);s.on('pasteDialog',function(x){setTimeout(function(){s.openDialog('paste');},0);});function t(x,y,z,A){var B=s.lang[y];s.addCommand(y,z);s.ui.addButton(x,{label:B,command:y});if(s.addMenuItems)s.addMenuItem(y,{label:B,command:y,group:'clipboard',order:A});};t('Cut','cut',new n('cut'),1);t('Copy','copy',new n('copy'),4);t('Paste','paste',o,8);a.dialog.add('paste',a.getUrl(this.path+'dialogs/paste.js'));s.on('key',p,s);var u=s.config.forcePasteAsPlainText?'text':'html';s.on('contentDom',function(){var x=s.document.getBody();x.on(u=='text'&&c||b.webkit?'paste':'beforepaste',function(y){if(v)return;q.call(s,y,u,function(z){if(!z)return;var A={};A[u]=z;s.fire('paste',A);});});x.on('beforecut',function(){!v&&r(s);});});if(s.contextMenu){var v;function w(x){c&&(v=1);var y=s.document.$.queryCommandEnabled(x)?2:0;v=0;return y;};s.contextMenu.addListener(function(){return{cut:w('Cut'),copy:w('Cut'),paste:b.webkit?2:w('Paste')};});}}});})();j.add('colorbutton',{requires:['panelbutton','floatpanel','styles'],init:function(l){var m=l.config,n=l.lang.colorButton,o;if(!b.hc){p('TextColor','fore',n.textColorTitle);p('BGColor','back',n.bgColorTitle);}function p(r,s,t){l.ui.add(r,4,{label:t,title:t,className:'cke_button_'+r.toLowerCase(),modes:{wysiwyg:1},panel:{css:l.skin.editor.css,attributes:{role:'listbox','aria-label':n.panelTitle}},onBlock:function(u,v){v.autoSize=true;v.element.addClass('cke_colorblock');v.element.setHtml(q(u,s));v.element.getDocument().getBody().setStyle('overflow','hidden');var w=v.keys,x=l.lang.dir=='rtl'; -w[x?37:39]='next';w[40]='next';w[9]='next';w[x?39:37]='prev';w[38]='prev';w[2000+9]='prev';w[32]='click';}});};function q(r,s){var t=[],u=m.colorButton_colors.split(','),v=u.length+(m.colorButton_enableMore?2:1),w=e.addFunction(function(C,D){if(C=='?'){var E=arguments.callee;function F(H){this.removeListener('ok',F);this.removeListener('cancel',F);H.name=='ok'&&E(this.getContentElement('picker','selectedColor').getValue(),D);};l.openDialog('colordialog',function(){this.on('ok',F);this.on('cancel',F);});return;}l.focus();r.hide();l.fire('saveSnapshot');new a.style(m['colorButton_'+D+'Style'],{color:'inherit'}).remove(l.document);if(C){var G=m['colorButton_'+D+'Style'];G.childRule=D=='back'?function(){return false;}:function(H){return H.getName()!='a';};new a.style(G,{color:C}).apply(l.document);}l.fire('saveSnapshot');});t.push('
            ',n.auto,'
            ');for(var x=0;x');var y=u[x].split('/'),z=y[0],A=y[1]||z;if(!y[1])z='#'+z.replace(/^(.)(.)(.)$/,'$1$1$2$2$3$3');var B=l.lang.colors[A]||A;t.push('');}if(m.colorButton_enableMore)t.push('');t.push('
            ',n.more,'
            ');return t.join('');};}});i.colorButton_enableMore=true;i.colorButton_colors='000,800000,8B4513,2F4F4F,008080,000080,4B0082,696969,B22222,A52A2A,DAA520,006400,40E0D0,0000CD,800080,808080,F00,FF8C00,FFD700,008000,0FF,00F,EE82EE,A9A9A9,FFA07A,FFA500,FFFF00,00FF00,AFEEEE,ADD8E6,DDA0DD,D3D3D3,FFF0F5,FAEBD7,FFFFE0,F0FFF0,F0FFFF,F0F8FF,E6E6FA,FFF'; -i.colorButton_foreStyle={element:'span',styles:{color:'#(color)'},overrides:[{element:'font',attributes:{color:null}}]};i.colorButton_backStyle={element:'span',styles:{'background-color':'#(color)'}};(function(){j.colordialog={init:function(l){l.addCommand('colordialog',new a.dialogCommand('colordialog'));a.dialog.add('colordialog',this.path+'dialogs/colordialog.js');}};j.add('colordialog',j.colordialog);})();j.add('contextmenu',{requires:['menu'],beforeInit:function(l){l.contextMenu=new j.contextMenu(l);l.addCommand('contextMenu',{exec:function(){l.contextMenu.show(l.document.getBody());}});}});j.contextMenu=e.createClass({$:function(l){this.id='cke_'+e.getNextNumber();this.editor=l;this._.listeners=[];this._.functionId=e.addFunction(function(m){this._.panel.hide();l.focus();l.execCommand(m);},this);this.definition={panel:{className:l.skinClass+' cke_contextmenu',attributes:{'aria-label':l.lang.contextmenu.options}}};},_:{onMenu:function(l,m,n,o){var p=this._.menu,q=this.editor;if(p){p.hide();p.removeAll();}else{p=this._.menu=new a.menu(q,this.definition);p.onClick=e.bind(function(z){p.hide();if(z.onClick)z.onClick();else if(z.command)q.execCommand(z.command);},this);p.onEscape=function(z){var A=this.parent;if(A){A._.panel.hideChild();var B=A._.panel._.panel._.currentBlock,C=B._.focusIndex;B._.markItem(C);}else if(z==27){this.hide();q.focus();}return false;};}var r=this._.listeners,s=[],t=this.editor.getSelection(),u=t&&t.getStartElement();p.onHide=e.bind(function(){p.onHide=null;if(c){var z=q.getSelection();z&&z.unlock();}this.onHide&&this.onHide();},this);for(var v=0;v ';j.add('elementspath',{requires:['selection'],init:function(n){var o='cke_path_'+n.name,p,q=function(){if(!p)p=a.document.getById(o);return p;},r='cke_elementspath_'+e.getNextNumber()+'_';n._.elementsPath={idBase:r,filters:[]};n.on('themeSpace',function(s){if(s.data.space=='bottom')s.data.html+=''+n.lang.elementsPath.eleLabel+''+'
            '+m+'
            ';});n.on('selectionChange',function(s){var t=b,u=s.data.selection,v=u.getStartElement(),w=[],x=s.editor,y=x._.elementsPath.list=[],z=x._.elementsPath.filters;while(v){var A=0;for(var B=0;B',D,''+F+'','');}if(D=='body')break;v=v.getParent();}q().setHtml(w.join('')+m);});n.on('contentDomUnload',function(){p&&p.setHtml(m);});n.addCommand('elementsPathFocus',l.toolbarFocus);}});})();a._.elementsPath={click:function(l,m){var n=a.instances[l];n.focus();var o=n._.elementsPath.list[m];n.getSelection().selectElement(o);return false;},keydown:function(l,m,n){var o=k.button._.instances[m],p=a.instances[l],q=p._.elementsPath.idBase,r;n=new d.event(n);var s=p.lang.dir=='rtl';switch(n.getKeystroke()){case s?39:37:case 9:r=a.document.getById(q+(m+1));if(!r)r=a.document.getById(q+'0');r.focus();return false;case s?37:39:case 2000+9:r=a.document.getById(q+(m-1));if(!r)r=a.document.getById(q+(p._.elementsPath.list.length-1));r.focus();return false;case 27:p.focus();return false;case 13:case 32:this.click(l,m);return false;}return true;}};(function(){j.add('enterkey',{requires:['keystrokes','indent'],init:function(s){var t=s.specialKeys;t[13]=q;t[2000+13]=p;}});j.enterkey={enterBlock:function(s,t,u,v){u=u||r(s);var w=u.document;if(u.checkStartOfBlock()&&u.checkEndOfBlock()){var x=new d.elementPath(u.startContainer),y=x.block;if(y&&(y.is('li')||y.getParent().is('li'))){s.execCommand('outdent');return;}}var z=t==3?'div':'p',A=u.splitBlock(z);if(!A)return;var B=A.previousBlock,C=A.nextBlock,D=A.wasStartOfBlock,E=A.wasEndOfBlock,F;if(C){F=C.getParent();if(F.is('li')){C.breakParent(F);C.move(C.getNext(),true);}}else if(B&&(F=B.getParent())&&F.is('li')){B.breakParent(F);u.moveToElementEditStart(B.getNext());B.move(B.getPrevious());}if(!D&&!E){if(C.is('li')&&(F=C.getFirst(d.walker.invisible(true)))&&F.is&&F.is('ul','ol'))(c?w.createText('\xa0'):w.createElement('br')).insertBefore(F);if(C)u.moveToElementEditStart(C); -}else{var G;if(B){if(B.is('li')||!o.test(B.getName()))G=B.clone();}else if(C)G=C.clone();if(!G)G=w.createElement(z);else if(v&&!G.is('li'))G.renameNode(z);var H=A.elementPath;if(H)for(var I=0,J=H.elements.length;I0;u--)t[u].deleteContents();return t[0];};})();(function(){var l='nbsp,gt,lt,quot,iexcl,cent,pound,curren,yen,brvbar,sect,uml,copy,ordf,laquo,not,shy,reg,macr,deg,plusmn,sup2,sup3,acute,micro,para,middot,cedil,sup1,ordm,raquo,frac14,frac12,frac34,iquest,times,divide,fnof,bull,hellip,prime,Prime,oline,frasl,weierp,image,real,trade,alefsym,larr,uarr,rarr,darr,harr,crarr,lArr,uArr,rArr,dArr,hArr,forall,part,exist,empty,nabla,isin,notin,ni,prod,sum,minus,lowast,radic,prop,infin,ang,and,or,cap,cup,int,there4,sim,cong,asymp,ne,equiv,le,ge,sub,sup,nsub,sube,supe,oplus,otimes,perp,sdot,lceil,rceil,lfloor,rfloor,lang,rang,loz,spades,clubs,hearts,diams,circ,tilde,ensp,emsp,thinsp,zwnj,zwj,lrm,rlm,ndash,mdash,lsquo,rsquo,sbquo,ldquo,rdquo,bdquo,dagger,Dagger,permil,lsaquo,rsaquo,euro',m='Agrave,Aacute,Acirc,Atilde,Auml,Aring,AElig,Ccedil,Egrave,Eacute,Ecirc,Euml,Igrave,Iacute,Icirc,Iuml,ETH,Ntilde,Ograve,Oacute,Ocirc,Otilde,Ouml,Oslash,Ugrave,Uacute,Ucirc,Uuml,Yacute,THORN,szlig,agrave,aacute,acirc,atilde,auml,aring,aelig,ccedil,egrave,eacute,ecirc,euml,igrave,iacute,icirc,iuml,eth,ntilde,ograve,oacute,ocirc,otilde,ouml,oslash,ugrave,uacute,ucirc,uuml,yacute,thorn,yuml,OElig,oelig,Scaron,scaron,Yuml',n='Alpha,Beta,Gamma,Delta,Epsilon,Zeta,Eta,Theta,Iota,Kappa,Lambda,Mu,Nu,Xi,Omicron,Pi,Rho,Sigma,Tau,Upsilon,Phi,Chi,Psi,Omega,alpha,beta,gamma,delta,epsilon,zeta,eta,theta,iota,kappa,lambda,mu,nu,xi,omicron,pi,rho,sigmaf,sigma,tau,upsilon,phi,chi,psi,omega,thetasym,upsih,piv'; +v.endContainer=t;v.endOffset=u;if(!v.startContainer){v.startContainer=t;v.startOffset=u;}l(v);},setStartAfter:function(t){this.setStart(t.getParent(),t.getIndex()+1);},setStartBefore:function(t){this.setStart(t.getParent(),t.getIndex());},setEndAfter:function(t){this.setEnd(t.getParent(),t.getIndex()+1);},setEndBefore:function(t){this.setEnd(t.getParent(),t.getIndex());},setStartAt:function(t,u){var v=this;switch(u){case 1:v.setStart(t,0);break;case 2:if(t.type==3)v.setStart(t,t.getLength());else v.setStart(t,t.getChildCount());break;case 3:v.setStartBefore(t);break;case 4:v.setStartAfter(t);}l(v);},setEndAt:function(t,u){var v=this;switch(u){case 1:v.setEnd(t,0);break;case 2:if(t.type==3)v.setEnd(t,t.getLength());else v.setEnd(t,t.getChildCount());break;case 3:v.setEndBefore(t);break;case 4:v.setEndAfter(t);}l(v);},fixBlock:function(t,u){var x=this;var v=x.createBookmark(),w=x.document.createElement(u);x.collapse(t);x.enlarge(2);x.extractContents().appendTo(w);w.trim();if(!c)w.appendBogus();x.insertNode(w);x.moveToBookmark(v);return w;},splitBlock:function(t){var D=this;var u=new d.elementPath(D.startContainer),v=new d.elementPath(D.endContainer),w=u.blockLimit,x=v.blockLimit,y=u.block,z=v.block,A=null;if(!w.equals(x))return null;if(t!='br'){if(!y){y=D.fixBlock(true,t);z=new d.elementPath(D.endContainer).block;}if(!z)z=D.fixBlock(false,t);}var B=y&&D.checkStartOfBlock(),C=z&&D.checkEndOfBlock();D.deleteContents();if(y&&y.equals(z))if(C){A=new d.elementPath(D.startContainer);D.moveToPosition(z,4);z=null;}else if(B){A=new d.elementPath(D.startContainer);D.moveToPosition(y,3);y=null;}else{z=D.splitElement(y);if(!c&&!y.is('ul','ol'))y.appendBogus();}return{previousBlock:y,nextBlock:z,wasStartOfBlock:B,wasEndOfBlock:C,elementPath:A};},splitElement:function(t){var w=this;if(!w.collapsed)return null;w.setEndAt(t,2);var u=w.extractContents(),v=t.clone(false);u.appendTo(v);v.insertAfter(t);w.moveToPosition(t,4);return v;},checkBoundaryOfElement:function(t,u){var v=u==1,w=this.clone();w.collapse(v);w[v?'setStartAt':'setEndAt'](t,v?1:2);var x=new d.walker(w);x.evaluator=p;return x[v?'checkBackward':'checkForward']();},checkStartOfBlock:function(){var z=this;var t=z.startContainer,u=z.startOffset;if(u&&t.type==3){var v=e.ltrim(t.substring(0,u));if(v.length)return false;}z.trim();var w=new d.elementPath(z.startContainer),x=z.clone();x.collapse(true);x.setStartAt(w.block||w.blockLimit,1);var y=new d.walker(x);y.evaluator=o(true);return y.checkBackward();},checkEndOfBlock:function(){var z=this; +var t=z.endContainer,u=z.endOffset;if(t.type==3){var v=e.rtrim(t.substring(u));if(v.length)return false;}z.trim();var w=new d.elementPath(z.endContainer),x=z.clone();x.collapse(false);x.setEndAt(w.block||w.blockLimit,2);var y=new d.walker(x);y.evaluator=o(false);return y.checkForward();},moveToElementEditablePosition:function(t,u){var v;if(f.$empty[t.getName()])return false;while(t&&t.type==1){v=t.isEditable();if(v)this.moveToPosition(t,u?2:1);else if(f.$inline[t.getName()]){this.moveToPosition(t,u?4:3);return true;}if(f.$empty[t.getName()])t=t[u?'getPrevious':'getNext'](s);else t=t[u?'getLast':'getFirst'](s);if(t&&t.type==3){this.moveToPosition(t,u?4:3);return true;}}return v;},moveToElementEditStart:function(t){return this.moveToElementEditablePosition(t);},moveToElementEditEnd:function(t){return this.moveToElementEditablePosition(t,true);},getEnclosedNode:function(){var t=this.clone();t.optimize();if(t.startContainer.type!=1||t.endContainer.type!=1)return null;var u=new d.walker(t),v=d.walker.bookmark(true),w=d.walker.whitespaces(true),x=function(z){return w(z)&&v(z);};t.evaluator=x;var y=u.next();u.reset();return y&&y.equals(u.previous())?y:null;},getTouchedStartNode:function(){var t=this.startContainer;if(this.collapsed||t.type!=1)return t;return t.getChild(this.startOffset)||t;},getTouchedEndNode:function(){var t=this.endContainer;if(this.collapsed||t.type!=1)return t;return t.getChild(this.endOffset-1)||t;}};})();a.POSITION_AFTER_START=1;a.POSITION_BEFORE_END=2;a.POSITION_BEFORE_START=3;a.POSITION_AFTER_END=4;a.ENLARGE_ELEMENT=1;a.ENLARGE_BLOCK_CONTENTS=2;a.ENLARGE_LIST_ITEM_CONTENTS=3;a.START=1;a.END=2;a.STARTEND=3;a.SHRINK_ELEMENT=1;a.SHRINK_TEXT=2;(function(){d.rangeList=function(n){if(n instanceof d.rangeList)return n;if(!n)n=[];else if(n instanceof d.range)n=[n];return e.extend(n,l);};var l={createIterator:function(){var n=this,o=[],p;return{getNextRange:function(){p=p==undefined?0:p+1;var q=n[p];if(q&&n.length>1)if(!p)for(var r=n.length-1;r>0;r--)o.unshift(n[r].createBookmark(true));else q.moveToBookmark(o.shift());return q;}};},createBookmarks:function(n){var s=this;var o=[],p;for(var q=0;q
            ',a.document);o.appendTo(a.document.getHead());try{b.hc=o.getComputedStyle('background-image')=='none';}catch(p){b.hc=false;}if(b.hc)b.cssClass+=' cke_hc';o.remove();})();j.load(i.corePlugins.split(','),function(){a.status='loaded';a.fire('loaded');var l=a._.pending;if(l){delete a._.pending;for(var m=0;m=0;B--){var C=[],D=new d.walker(w[B]);D.evaluator=function(H){return H.type==1&&H.getName() in l&&!(H.getName()==(v==1)?'p':'div'&&H.getParent().type==1&&H.getParent().getName()=='blockquote');};while(A=D.next()){p(A,s,t);C.push(A);}z=w[B].createIterator();z.enlargeBr=v!=2;while(A=z.getNextParagraph(v==1?'p':'div')){if(A.isReadOnly())continue;var E=0;for(var F=0;F0){y=z.shift();while(!y.getParent().equals(C))y=y.getParent();if(!y.equals(G))D.push(y);G=y;}while(D.length>0){y=D.shift();if(y.getName()=='blockquote'){var H=new d.documentFragment(p.document); +while(y.getFirst()){H.append(y.getFirst().remove());z.push(H.getLast());}H.replace(y);}else z.push(y);}var I=p.document.createElement('blockquote');I.insertBefore(z[0]);while(z.length>0){y=z.shift();I.append(y);}}else if(q==1){var J=[],K={};while(y=x.getNextParagraph()){var L=null,M=null;while(y.getParent()){if(y.getParent().getName()=='blockquote'){L=y.getParent();M=y;break;}y=y.getParent();}if(L&&M&&!M.getCustomData('blockquote_moveout')){J.push(M);h.setMarker(K,M,'blockquote_moveout',true);}}h.clearAllMarkers(K);var N=[],O=[];K={};while(J.length>0){var P=J.shift();I=P.getParent();if(!P.getPrevious())P.remove().insertBefore(I);else if(!P.getNext())P.remove().insertAfter(I);else{P.breakParent(P.getParent());O.push(P.getNext());}if(!I.getCustomData('blockquote_processed')){O.push(I);h.setMarker(K,I,'blockquote_processed',true);}N.push(P);}h.clearAllMarkers(K);for(E=O.length-1;E>=0;E--){I=O[E];if(n(I))I.remove();}if(p.config.enterMode==2){var Q=true;while(N.length){P=N.shift();if(P.getName()=='div'){H=new d.documentFragment(p.document);var R=Q&&P.getPrevious()&&!(P.getPrevious().type==1&&P.getPrevious().isBlockBoundary());if(R)H.append(p.document.createElement('br'));var S=P.getNext()&&!(P.getNext().type==1&&P.getNext().isBlockBoundary());while(P.getFirst())P.getFirst().remove().appendTo(H);if(S)H.append(p.document.createElement('br'));H.replace(P);Q=false;}}}}r.selectBookmarks(t);p.focus();}};j.add('blockquote',{init:function(p){p.addCommand('blockquote',o);p.ui.addButton('Blockquote',{label:p.lang.blockquote,command:'blockquote'});p.on('selectionChange',m);},requires:['domiterator']});})();j.add('button',{beforeInit:function(l){l.ui.addHandler(1,k.button.handler);}});a.UI_BUTTON=1;k.button=function(l){e.extend(this,l,{title:l.label,className:l.className||l.command&&'cke_button_'+l.command||'',click:l.click||(function(m){m.execCommand(l.command);})});this._={};};k.button.handler={create:function(l){return new k.button(l);}};k.button.prototype={canGroup:true,render:function(l,m){var n=b,o=this._.id='cke_'+e.getNextNumber(),p='',q=this.command,r,s;this._.editor=l;var t={id:o,button:this,editor:l,focus:function(){var v=a.document.getById(o);v.focus();},execute:function(){this.button.click(l);}};t.clickFn=r=e.addFunction(t.execute,t);t.index=s=k.button._.instances.push(t)-1;if(this.modes)l.on('mode',function(){this.setState(this.modes[l.mode]?2:0);},this);else if(q){q=l.getCommand(q);if(q){q.on('state',function(){this.setState(q.state);},this);p+='cke_'+(q.state==1?'on':q.state==0?'disabled':'off'); +}}if(!q)p+='cke_off';if(this.className)p+=' '+this.className;m.push('','=10900&&!n.hc?'':'" href="javascript:void(\''+(this.title||'').replace("'",'')+"')\"",' title="',this.title,'" tabindex="-1" hidefocus="true" role="button" aria-labelledby="'+o+'_label"'+(this.hasArrow?' aria-haspopup="true"':''));if(n.opera||n.gecko&&n.mac)m.push(' onkeypress="return false;"');if(n.gecko)m.push(' onblur="this.style.cssText = this.style.cssText;"');m.push(' onkeydown="return CKEDITOR.ui.button._.keydown(',s,', event);" onfocus="return CKEDITOR.ui.button._.focus(',s,', event);" onclick="CKEDITOR.tools.callFunction(',r,', this); return false;"> ',this.label,'');if(this.hasArrow)m.push(''+(b.hc?'▼':' ')+'');m.push('','');if(this.onRender)this.onRender();return t;},setState:function(l){if(this._.state==l)return false;this._.state=l;var m=a.document.getById(this._.id);if(m){m.setState(l);l==0?m.setAttribute('aria-disabled',true):m.removeAttribute('aria-disabled');l==1?m.setAttribute('aria-pressed',true):m.removeAttribute('aria-pressed');return true;}else return false;}};k.button._={instances:[],keydown:function(l,m){var n=k.button._.instances[l];if(n.onkey){m=new d.event(m);return n.onkey(n,m.getKeystroke())!==false;}},focus:function(l,m){var n=k.button._.instances[l],o;if(n.onfocus)o=n.onfocus(n,new d.event(m))!==false;if(b.gecko&&b.version<10900)m.preventBubble();return o;}};k.prototype.addButton=function(l,m){this.add(l,1,m);};a.on('reset',function(){k.button._.instances=[];});(function(){var l=function(s,t){var u=s.document,v=u.getBody(),w=false,x=function(){w=true;};v.on(t,x);(b.version>7?u.$:u.$.selection.createRange()).execCommand(t);v.removeListener(t,x);return w;},m=c?function(s,t){return l(s,t);}:function(s,t){try{return s.document.$.execCommand(t);}catch(u){return false;}},n=function(s){this.type=s;this.canUndo=this.type=='cut';};n.prototype={exec:function(s,t){this.type=='cut'&&r(s);var u=m(s,this.type);if(!u)alert(s.lang.clipboard[this.type+'Error']);return u;}};var o={canUndo:false,exec:c?function(s){s.focus();if(!s.document.getBody().fire('beforepaste')&&!l(s,'paste')){s.fire('pasteDialog');return false; +}}:function(s){try{if(!s.document.getBody().fire('beforepaste')&&!s.document.$.execCommand('Paste',false,null))throw 0;}catch(t){setTimeout(function(){s.fire('pasteDialog');},0);return false;}}},p=function(s){if(this.mode!='wysiwyg')return;switch(s.data.keyCode){case 1000+86:case 2000+45:var t=this.document.getBody();if(!c&&t.fire('beforepaste'))s.cancel();else if(b.opera||b.gecko&&b.version<10900)t.fire('paste');return;case 1000+88:case 2000+46:var u=this;this.fire('saveSnapshot');setTimeout(function(){u.fire('saveSnapshot');},0);}};function q(s,t,u){var v=this.document;if(c&&v.getById('cke_pastebin'))return;if(t=='text'&&s.data&&s.data.$.clipboardData){var w=s.data.$.clipboardData.getData('text/plain');if(w){s.data.preventDefault();u(w);return;}}var x=this.getSelection(),y=new d.range(v),z=new h(t=='text'?'textarea':b.webkit?'body':'div',v);z.setAttribute('id','cke_pastebin');b.webkit&&z.append(v.createText('\xa0'));v.getBody().append(z);z.setStyles({position:'absolute',top:x.getStartElement().getDocumentPosition().y+'px',width:'1px',height:'1px',overflow:'hidden'});z.setStyle(this.config.contentsLangDirection=='ltr'?'left':'right','-1000px');var A=x.createBookmarks();if(t=='text'){if(c){var B=v.getBody().$.createTextRange();B.moveToElementText(z.$);B.execCommand('Paste');s.data.preventDefault();}else{v.$.designMode='off';z.$.focus();}}else{y.setStartAt(z,1);y.setEndAt(z,2);y.select(true);}window.setTimeout(function(){t=='text'&&!c&&(v.$.designMode='on');z.remove();var C;z=b.webkit&&(C=z.getFirst())&&C.is&&C.hasClass('Apple-style-span')?C:z;x.selectBookmarks(A);u(z['get'+(t=='text'?'Value':'Html')]());},0);};function r(s){if(!c||s.document.$.compatMode=='BackCompat')return;var t=s.getSelection(),u;if(t.getType()==3&&(u=t.getSelectedElement())){var v=t.getRanges()[0],w=s.document.createText('');w.insertBefore(u);v.setStartBefore(w);v.setEndAfter(u);t.selectRanges([v]);setTimeout(function(){if(u.getParent()){w.remove();t.selectElement(u);}},0);}};j.add('clipboard',{requires:['dialog','htmldataprocessor'],init:function(s){s.on('paste',function(x){var y=x.data;if(y.html)s.insertHtml(y.html);else if(y.text)s.insertText(y.text);},null,null,1000);s.on('pasteDialog',function(x){setTimeout(function(){s.openDialog('paste');},0);});function t(x,y,z,A){var B=s.lang[y];s.addCommand(y,z);s.ui.addButton(x,{label:B,command:y});if(s.addMenuItems)s.addMenuItem(y,{label:B,command:y,group:'clipboard',order:A});};t('Cut','cut',new n('cut'),1);t('Copy','copy',new n('copy'),4); +t('Paste','paste',o,8);a.dialog.add('paste',a.getUrl(this.path+'dialogs/paste.js'));s.on('key',p,s);var u=s.config.forcePasteAsPlainText?'text':'html';s.on('contentDom',function(){var x=s.document.getBody();x.on(u=='text'&&c||b.webkit?'paste':'beforepaste',function(y){if(v)return;q.call(s,y,u,function(z){if(!z)return;var A={};A[u]=z;s.fire('paste',A);});});x.on('beforecut',function(){!v&&r(s);});});if(s.contextMenu){var v;function w(x){c&&(v=1);var y=s.document.$.queryCommandEnabled(x)?2:0;v=0;return y;};s.contextMenu.addListener(function(x,y){var z=y.getCommonAncestor().isReadOnly();return{cut:!z&&w('Cut'),copy:w('Copy'),paste:!z&&(b.webkit?2:w('Paste'))};});}}});})();j.add('colorbutton',{requires:['panelbutton','floatpanel','styles'],init:function(l){var m=l.config,n=l.lang.colorButton,o;if(!b.hc){p('TextColor','fore',n.textColorTitle);p('BGColor','back',n.bgColorTitle);}function p(r,s,t){l.ui.add(r,4,{label:t,title:t,className:'cke_button_'+r.toLowerCase(),modes:{wysiwyg:1},panel:{css:l.skin.editor.css,attributes:{role:'listbox','aria-label':n.panelTitle}},onBlock:function(u,v){v.autoSize=true;v.element.addClass('cke_colorblock');v.element.setHtml(q(u,s));v.element.getDocument().getBody().setStyle('overflow','hidden');var w=v.keys,x=l.lang.dir=='rtl';w[x?37:39]='next';w[40]='next';w[9]='next';w[x?39:37]='prev';w[38]='prev';w[2000+9]='prev';w[32]='click';}});};function q(r,s){var t=[],u=m.colorButton_colors.split(','),v=u.length+(m.colorButton_enableMore?2:1),w=e.addFunction(function(C,D){if(C=='?'){var E=arguments.callee;function F(H){this.removeListener('ok',F);this.removeListener('cancel',F);H.name=='ok'&&E(this.getContentElement('picker','selectedColor').getValue(),D);};l.openDialog('colordialog',function(){this.on('ok',F);this.on('cancel',F);});return;}l.focus();r.hide();l.fire('saveSnapshot');new a.style(m['colorButton_'+D+'Style'],{color:'inherit'}).remove(l.document);if(C){var G=m['colorButton_'+D+'Style'];G.childRule=D=='back'?function(){return false;}:function(H){return H.getName()!='a';};new a.style(G,{color:C}).apply(l.document);}l.fire('saveSnapshot');});t.push('
            ',n.auto,'
            '); +for(var x=0;x');var y=u[x].split('/'),z=y[0],A=y[1]||z;if(!y[1])z='#'+z.replace(/^(.)(.)(.)$/,'$1$1$2$2$3$3');var B=l.lang.colors[A]||A;t.push('');}if(m.colorButton_enableMore)t.push('');t.push('
            ',n.more,'
            ');return t.join('');};}});i.colorButton_enableMore=true;i.colorButton_colors='000,800000,8B4513,2F4F4F,008080,000080,4B0082,696969,B22222,A52A2A,DAA520,006400,40E0D0,0000CD,800080,808080,F00,FF8C00,FFD700,008000,0FF,00F,EE82EE,A9A9A9,FFA07A,FFA500,FFFF00,00FF00,AFEEEE,ADD8E6,DDA0DD,D3D3D3,FFF0F5,FAEBD7,FFFFE0,F0FFF0,F0FFFF,F0F8FF,E6E6FA,FFF';i.colorButton_foreStyle={element:'span',styles:{color:'#(color)'},overrides:[{element:'font',attributes:{color:null}}]};i.colorButton_backStyle={element:'span',styles:{'background-color':'#(color)'}};(function(){j.colordialog={init:function(l){l.addCommand('colordialog',new a.dialogCommand('colordialog'));a.dialog.add('colordialog',this.path+'dialogs/colordialog.js');}};j.add('colordialog',j.colordialog);})();j.add('contextmenu',{requires:['menu'],beforeInit:function(l){l.contextMenu=new j.contextMenu(l);l.addCommand('contextMenu',{exec:function(){l.contextMenu.show(l.document.getBody());}});}});j.contextMenu=e.createClass({$:function(l){this.id='cke_'+e.getNextNumber();this.editor=l;this._.listeners=[];this._.functionId=e.addFunction(function(m){this._.panel.hide();l.focus();l.execCommand(m);},this);this.definition={panel:{className:l.skinClass+' cke_contextmenu',attributes:{'aria-label':l.lang.contextmenu.options}}};},_:{onMenu:function(l,m,n,o){var p=this._.menu,q=this.editor;if(p){p.hide();p.removeAll();}else{p=this._.menu=new a.menu(q,this.definition);p.onClick=e.bind(function(z){p.hide();if(z.onClick)z.onClick();else if(z.command)q.execCommand(z.command);},this);p.onEscape=function(z){var A=this.parent;if(A){A._.panel.hideChild();var B=A._.panel._.panel._.currentBlock,C=B._.focusIndex; +B._.markItem(C);}else if(z==27){this.hide();q.focus();}return false;};}var r=this._.listeners,s=[],t=this.editor.getSelection(),u=t&&t.getStartElement();p.onHide=e.bind(function(){p.onHide=null;if(c){var z=q.getSelection();z&&z.unlock();}this.onHide&&this.onHide();},this);for(var v=0;v ';j.add('elementspath',{requires:['selection'],init:function(n){var o='cke_path_'+n.name,p,q=function(){if(!p)p=a.document.getById(o);return p;},r='cke_elementspath_'+e.getNextNumber()+'_';n._.elementsPath={idBase:r,filters:[]};n.on('themeSpace',function(s){if(s.data.space=='bottom')s.data.html+=''+n.lang.elementsPath.eleLabel+''+'
            '+m+'
            '; +});n.on('selectionChange',function(s){var t=b,u=s.data.selection,v=u.getStartElement(),w=[],x=s.editor,y=x._.elementsPath.list=[],z=x._.elementsPath.filters;while(v){var A=0;for(var B=0;B',D,''+F+'','');}if(D=='body')break;v=v.getParent();}q().setHtml(w.join('')+m);});n.on('contentDomUnload',function(){p&&p.setHtml(m);});n.addCommand('elementsPathFocus',l.toolbarFocus);}});})();a._.elementsPath={click:function(l,m){var n=a.instances[l];n.focus();var o=n._.elementsPath.list[m];n.getSelection().selectElement(o);return false;},keydown:function(l,m,n){var o=k.button._.instances[m],p=a.instances[l],q=p._.elementsPath.idBase,r;n=new d.event(n);var s=p.lang.dir=='rtl';switch(n.getKeystroke()){case s?39:37:case 9:r=a.document.getById(q+(m+1));if(!r)r=a.document.getById(q+'0');r.focus();return false;case s?37:39:case 2000+9:r=a.document.getById(q+(m-1));if(!r)r=a.document.getById(q+(p._.elementsPath.list.length-1));r.focus();return false;case 27:p.focus();return false;case 13:case 32:this.click(l,m);return false;}return true;}};(function(){j.add('enterkey',{requires:['keystrokes','indent'],init:function(s){var t=s.specialKeys;t[13]=q;t[2000+13]=p;}});j.enterkey={enterBlock:function(s,t,u,v){u=u||r(s);if(!u)return;var w=u.document;if(u.checkStartOfBlock()&&u.checkEndOfBlock()){var x=new d.elementPath(u.startContainer),y=x.block;if(y&&(y.is('li')||y.getParent().is('li'))){s.execCommand('outdent');return;}}var z=t==3?'div':'p',A=u.splitBlock(z);if(!A)return;var B=A.previousBlock,C=A.nextBlock,D=A.wasStartOfBlock,E=A.wasEndOfBlock,F;if(C){F=C.getParent();if(F.is('li')){C.breakParent(F);C.move(C.getNext(),true);}}else if(B&&(F=B.getParent())&&F.is('li')){B.breakParent(F);u.moveToElementEditStart(B.getNext()); +B.move(B.getPrevious());}if(!D&&!E){if(C.is('li')&&(F=C.getFirst(d.walker.invisible(true)))&&F.is&&F.is('ul','ol'))(c?w.createText('\xa0'):w.createElement('br')).insertBefore(F);if(C)u.moveToElementEditStart(C);}else{var G;if(B){if(B.is('li')||!o.test(B.getName()))G=B.clone();}else if(C)G=C.clone();if(!G)G=w.createElement(z);else if(v&&!G.is('li'))G.renameNode(z);var H=A.elementPath;if(H)for(var I=0,J=H.elements.length;I0;u--)t[u].deleteContents();return t[0];};})();(function(){var l='nbsp,gt,lt,quot,iexcl,cent,pound,curren,yen,brvbar,sect,uml,copy,ordf,laquo,not,shy,reg,macr,deg,plusmn,sup2,sup3,acute,micro,para,middot,cedil,sup1,ordm,raquo,frac14,frac12,frac34,iquest,times,divide,fnof,bull,hellip,prime,Prime,oline,frasl,weierp,image,real,trade,alefsym,larr,uarr,rarr,darr,harr,crarr,lArr,uArr,rArr,dArr,hArr,forall,part,exist,empty,nabla,isin,notin,ni,prod,sum,minus,lowast,radic,prop,infin,ang,and,or,cap,cup,int,there4,sim,cong,asymp,ne,equiv,le,ge,sub,sup,nsub,sube,supe,oplus,otimes,perp,sdot,lceil,rceil,lfloor,rfloor,lang,rang,loz,spades,clubs,hearts,diams,circ,tilde,ensp,emsp,thinsp,zwnj,zwj,lrm,rlm,ndash,mdash,lsquo,rsquo,sbquo,ldquo,rdquo,bdquo,dagger,Dagger,permil,lsaquo,rsaquo,euro',m='Agrave,Aacute,Acirc,Atilde,Auml,Aring,AElig,Ccedil,Egrave,Eacute,Ecirc,Euml,Igrave,Iacute,Icirc,Iuml,ETH,Ntilde,Ograve,Oacute,Ocirc,Otilde,Ouml,Oslash,Ugrave,Uacute,Ucirc,Uuml,Yacute,THORN,szlig,agrave,aacute,acirc,atilde,auml,aring,aelig,ccedil,egrave,eacute,ecirc,euml,igrave,iacute,icirc,iuml,eth,ntilde,ograve,oacute,ocirc,otilde,ouml,oslash,ugrave,uacute,ucirc,uuml,yacute,thorn,yuml,OElig,oelig,Scaron,scaron,Yuml',n='Alpha,Beta,Gamma,Delta,Epsilon,Zeta,Eta,Theta,Iota,Kappa,Lambda,Mu,Nu,Xi,Omicron,Pi,Rho,Sigma,Tau,Upsilon,Phi,Chi,Psi,Omega,alpha,beta,gamma,delta,epsilon,zeta,eta,theta,iota,kappa,lambda,mu,nu,xi,omicron,pi,rho,sigmaf,sigma,tau,upsilon,phi,chi,psi,omega,thetasym,upsih,piv'; function o(p){var q={},r=[],s={nbsp:'\xa0',shy:'­',gt:'>',lt:'<'};p=p.replace(/\b(nbsp|shy|gt|lt|amp)(?:,|$)/g,function(x,y){q[s[y]]='&'+y+';';r.push(s[y]);return '';});p=p.split(',');var t=document.createElement('div'),u;t.innerHTML='&'+p.join(';&')+';';u=t.innerHTML;t=null;for(var v=0;v'+t+'',t);}},onClick:function(s){l.focus();l.fire('saveSnapshot');p[s].apply(l.document);setTimeout(function(){l.fire('saveSnapshot');},0);},onRender:function(){l.on('selectionChange',function(s){var t=this.getValue(),u=s.data.path;for(var v in p){if(p[v].checkActive(u)){if(v!=t)this.setValue(v,l.lang.format['tag_'+v]);return;}}this.setValue('');},this);}});}});i.format_tags='p;h1;h2;h3;h4;h5;h6;pre;address;div';i.format_p={element:'p'};i.format_div={element:'div'};i.format_pre={element:'pre'};i.format_address={element:'address'};i.format_h1={element:'h1'};i.format_h2={element:'h2'};i.format_h3={element:'h3'};i.format_h4={element:'h4'};i.format_h5={element:'h5'};i.format_h6={element:'h6'};j.add('forms',{init:function(l){var m=l.lang;l.addCss('form{border: 1px dotted #FF0000;padding: 2px;}\n');l.addCss('img.cke_hidden{background-image: url('+a.getUrl(this.path+'images/hiddenfield.gif')+');'+'background-position: center center;'+'background-repeat: no-repeat;'+'border: 1px solid #a9a9a9;'+'width: 16px !important;'+'height: 16px !important;'+'}');var n=function(p,q,r){l.addCommand(q,new a.dialogCommand(q));l.ui.addButton(p,{label:m.common[p.charAt(0).toLowerCase()+p.slice(1)],command:q}); -a.dialog.add(q,r);},o=this.path+'dialogs/';n('Form','form',o+'form.js');n('Checkbox','checkbox',o+'checkbox.js');n('Radio','radio',o+'radio.js');n('TextField','textfield',o+'textfield.js');n('Textarea','textarea',o+'textarea.js');n('Select','select',o+'select.js');n('Button','button',o+'button.js');n('ImageButton','imagebutton',j.getPath('image')+'dialogs/image.js');n('HiddenField','hiddenfield',o+'hiddenfield.js');if(l.addMenuItems)l.addMenuItems({form:{label:m.form.menu,command:'form',group:'form'},checkbox:{label:m.checkboxAndRadio.checkboxTitle,command:'checkbox',group:'checkbox'},radio:{label:m.checkboxAndRadio.radioTitle,command:'radio',group:'radio'},textfield:{label:m.textfield.title,command:'textfield',group:'textfield'},hiddenfield:{label:m.hidden.title,command:'hiddenfield',group:'hiddenfield'},imagebutton:{label:m.image.titleButton,command:'imagebutton',group:'imagebutton'},button:{label:m.button.title,command:'button',group:'button'},select:{label:m.select.title,command:'select',group:'select'},textarea:{label:m.textarea.title,command:'textarea',group:'textarea'}});if(l.contextMenu){l.contextMenu.addListener(function(p){if(p&&p.hasAscendant('form',true))return{form:2};});l.contextMenu.addListener(function(p){if(p){var q=p.getName();if(q=='select')return{select:2};if(q=='textarea')return{textarea:2};if(q=='input'){var r=p.getAttribute('type');if(r=='text'||r=='password')return{textfield:2};if(r=='button'||r=='submit'||r=='reset')return{button:2};if(r=='checkbox')return{checkbox:2};if(r=='radio')return{radio:2};if(r=='image')return{imagebutton:2};}if(q=='img'&&p.getAttribute('_cke_real_element_type')=='hiddenfield')return{hiddenfield:2};}});}l.on('doubleclick',function(p){var q=p.data.element;if(q.is('form'))p.data.dialog='form';else if(q.is('select'))p.data.dialog='select';else if(q.is('textarea'))p.data.dialog='textarea';else if(q.is('img')&&q.getAttribute('_cke_real_element_type')=='hiddenfield')p.data.dialog='hiddenfield';else if(q.is('input')){var r=q.getAttribute('type');switch(r){case 'text':case 'password':p.data.dialog='textfield';break;case 'button':case 'submit':case 'reset':p.data.dialog='button';break;case 'checkbox':p.data.dialog='checkbox';break;case 'radio':p.data.dialog='radio';break;case 'image':p.data.dialog='imagebutton';break;}}});},afterInit:function(l){var m=l.dataProcessor,n=m&&m.htmlFilter,o=m&&m.dataFilter;if(c)n&&n.addRules({elements:{input:function(p){var q=p.attributes,r=q.type;if(r=='checkbox'||r=='radio')q.value=='on'&&delete q.value; +a.dialog.add(q,r);},o=this.path+'dialogs/';n('Form','form',o+'form.js');n('Checkbox','checkbox',o+'checkbox.js');n('Radio','radio',o+'radio.js');n('TextField','textfield',o+'textfield.js');n('Textarea','textarea',o+'textarea.js');n('Select','select',o+'select.js');n('Button','button',o+'button.js');n('ImageButton','imagebutton',j.getPath('image')+'dialogs/image.js');n('HiddenField','hiddenfield',o+'hiddenfield.js');if(l.addMenuItems)l.addMenuItems({form:{label:m.form.menu,command:'form',group:'form'},checkbox:{label:m.checkboxAndRadio.checkboxTitle,command:'checkbox',group:'checkbox'},radio:{label:m.checkboxAndRadio.radioTitle,command:'radio',group:'radio'},textfield:{label:m.textfield.title,command:'textfield',group:'textfield'},hiddenfield:{label:m.hidden.title,command:'hiddenfield',group:'hiddenfield'},imagebutton:{label:m.image.titleButton,command:'imagebutton',group:'imagebutton'},button:{label:m.button.title,command:'button',group:'button'},select:{label:m.select.title,command:'select',group:'select'},textarea:{label:m.textarea.title,command:'textarea',group:'textarea'}});if(l.contextMenu){l.contextMenu.addListener(function(p){if(p&&p.hasAscendant('form',true)&&!p.isReadOnly())return{form:2};});l.contextMenu.addListener(function(p){if(p&&!p.isReadOnly()){var q=p.getName();if(q=='select')return{select:2};if(q=='textarea')return{textarea:2};if(q=='input'){var r=p.getAttribute('type');if(r=='text'||r=='password')return{textfield:2};if(r=='button'||r=='submit'||r=='reset')return{button:2};if(r=='checkbox')return{checkbox:2};if(r=='radio')return{radio:2};if(r=='image')return{imagebutton:2};}if(q=='img'&&p.getAttribute('_cke_real_element_type')=='hiddenfield')return{hiddenfield:2};}});}l.on('doubleclick',function(p){var q=p.data.element;if(q.is('form'))p.data.dialog='form';else if(q.is('select'))p.data.dialog='select';else if(q.is('textarea'))p.data.dialog='textarea';else if(q.is('img')&&q.getAttribute('_cke_real_element_type')=='hiddenfield')p.data.dialog='hiddenfield';else if(q.is('input')){var r=q.getAttribute('type');switch(r){case 'text':case 'password':p.data.dialog='textfield';break;case 'button':case 'submit':case 'reset':p.data.dialog='button';break;case 'checkbox':p.data.dialog='checkbox';break;case 'radio':p.data.dialog='radio';break;case 'image':p.data.dialog='imagebutton';break;}}});},afterInit:function(l){var m=l.dataProcessor,n=m&&m.htmlFilter,o=m&&m.dataFilter;if(c)n&&n.addRules({elements:{input:function(p){var q=p.attributes,r=q.type;if(r=='checkbox'||r=='radio')q.value=='on'&&delete q.value; }}});if(o)o.addRules({elements:{input:function(p){if(p.attributes.type=='hidden')return l.createFakeParserElement(p,'cke_hidden','hiddenfield');}}});},requires:['image','fakeobjects']});if(c)h.prototype.hasAttribute=function(l){var o=this;var m=o.$.attributes.getNamedItem(l);if(o.getName()=='input')switch(l){case 'class':return o.$.className.length>0;case 'checked':return!!o.$.checked;case 'value':var n=o.getAttribute('type');if(n=='checkbox'||n=='radio')return o.$.value!='on';break;default:}return!!(m&&m.specified);};(function(){var l={canUndo:false,exec:function(n){n.insertElement(n.document.createElement('hr'));}},m='horizontalrule';j.add(m,{init:function(n){n.addCommand(m,l);n.ui.addButton('HorizontalRule',{label:n.lang.horizontalrule,command:m});}});})();(function(){var l=/^[\t\r\n ]*(?: |\xa0)$/,m='{cke_protected}';function n(Q){var R=Q.children.length,S=Q.children[R-1];while(S&&S.type==3&&!e.trim(S.value))S=Q.children[--R];return S;};function o(Q,R){var S=Q.children,T=n(Q);if(T){if((R||!c)&&T.type==1&&T.name=='br')S.pop();if(T.type==3&&l.test(T.value))S.pop();}};function p(Q){var R=n(Q);return!R||R.type==1&&R.name=='br'||Q.name=='form'&&R.name=='input';};function q(Q){o(Q,true);if(p(Q))if(c)Q.add(new a.htmlParser.text('\xa0'));else Q.add(new a.htmlParser.element('br',{}));};function r(Q){o(Q);if(p(Q))Q.add(new a.htmlParser.text('\xa0'));};var s=f,t=e.extend({},s.$block,s.$listItem,s.$tableContent);for(var u in t){if(!('br' in s[u]))delete t[u];}delete t.pre;var v={elements:{},attributeNames:[[/^on/,'_cke_pa_on']]},w={elements:{}};for(u in t)w.elements[u]=q;var x={elementNames:[[/^cke:/,''],[/^\?xml:namespace$/,'']],attributeNames:[[/^_cke_(saved|pa)_/,''],[/^_cke.*/,''],['hidefocus','']],elements:{$:function(Q){var R=Q.attributes;if(R){if(R.cke_temp)return false;var S=['name','href','src'],T;for(var U=0;U]+)))/gi,C=/(?:])[^>]*>[\s\S]*<\/style>)|(?:<(:?link|meta|base)[^>]*>)/gi,D=/([^<]*)<\/cke:encoded>/gi,E=/(<\/?)((?:object|embed|param|html|body|head|title)[^>]*>)/gi,F=/(<\/?)cke:((?:html|body|head|title)[^>]*>)/gi,G=/]*?)\/?>(?!\s*<\/cke:\1)/gi;function H(Q){return Q.replace(B,'$& _cke_saved_$1');};function I(Q){return Q.replace(C,function(R){return ''+encodeURIComponent(R)+'';});};function J(Q){return Q.replace(D,function(R,S){return decodeURIComponent(S);});};function K(Q){return Q.replace(E,'$1cke:$2');};function L(Q){return Q.replace(F,'$1$2');};function M(Q){return Q.replace(G,'');};function N(Q){return Q.replace(//g,function(R){return '';});};function O(Q){return Q.replace(//g,function(R,S){return decodeURIComponent(S);});};function P(Q,R){var S=[],T=/<\!--\{cke_temp(comment)?\}(\d*?)-->/g,U=[//gi,//gi].concat(R);Q=Q.replace(//g,function(W){return '';});for(var V=0;V';});Q=Q.replace(T,function(W,X,Y){return '';});return Q;};j.add('htmldataprocessor',{requires:['htmlwriter'],init:function(Q){var R=Q.dataProcessor=new a.htmlDataProcessor(Q);R.writer.forceSimpleAmpersand=Q.config.forceSimpleAmpersand;R.dataFilter.addRules(v);R.dataFilter.addRules(w);R.htmlFilter.addRules(x);R.htmlFilter.addRules(y); -}});a.htmlDataProcessor=function(Q){var R=this;R.editor=Q;R.writer=new a.htmlWriter();R.dataFilter=new a.htmlParser.filter();R.htmlFilter=new a.htmlParser.filter();};a.htmlDataProcessor.prototype={toHtml:function(Q,R){Q=P(Q,this.editor.config.protectedSource);Q=H(Q);Q=I(Q);Q=K(Q);Q=M(Q);var S=new h('div');S.setHtml('a'+Q);Q=S.getHtml().substr(1);Q=L(Q);Q=J(Q);Q=O(Q);var T=a.htmlParser.fragment.fromHtml(Q,R),U=new a.htmlParser.basicWriter();T.writeHtml(U,this.dataFilter);Q=U.getHtml(true);Q=N(Q);return Q;},toDataFormat:function(Q,R){var S=this.writer,T=a.htmlParser.fragment.fromHtml(Q,R);S.reset();T.writeHtml(S,this.htmlFilter);return S.getHtml(true);}};})();i.forceSimpleAmpersand=false;j.add('image',{init:function(l){var m='image';a.dialog.add(m,this.path+'dialogs/image.js');l.addCommand(m,new a.dialogCommand(m));l.ui.addButton('Image',{label:l.lang.common.image,command:m});l.on('doubleclick',function(n){var o=n.data.element;if(o.is('img')&&!o.getAttribute('_cke_realelement'))n.data.dialog='image';});if(l.addMenuItems)l.addMenuItems({image:{label:l.lang.image.menu,command:'image',group:'image'}});if(l.contextMenu)l.contextMenu.addListener(function(n,o){if(!n||!n.is('img')||n.getAttribute('_cke_realelement'))return null;return{image:2};});}});i.image_removeLinkByEmptyURL=true;(function(){var l={ol:1,ul:1},m=d.walker.whitespaces(true),n=d.walker.bookmark(false,true);function o(v,w){v.getCommand(this.name).setState(w);};function p(v){var E=this;var w=v.editor,x=v.data.path,y=x&&x.contains(l);if(y)return o.call(E,w,2);if(!E.useIndentClasses&&E.name=='indent')return o.call(E,w,2);var z=v.data.path,A=z.block||z.blockLimit;if(!A)return o.call(E,w,0);if(E.useIndentClasses){var B=A.$.className.match(E.classNameRegex),C=0;if(B){B=B[1];C=E.indentClassMap[B];}if(E.name=='outdent'&&!C||E.name=='indent'&&C==w.config.indentClasses.length)return o.call(E,w,0);return o.call(E,w,2);}else{var D=parseInt(A.getStyle(E.indentCssProperty),10);if(isNaN(D))D=0;if(D<=0)return o.call(E,w,0);return o.call(E,w,2);}};function q(v,w,x){var y=w.startContainer,z=w.endContainer;while(y&&!y.getParent().equals(x))y=y.getParent();while(z&&!z.getParent().equals(x))z=z.getParent();if(!y||!z)return;var A=y,B=[],C=false;while(!C){if(A.equals(z))C=true;B.push(A);A=A.getNext();}if(B.length<1)return;var D=x.getParents(true);for(var E=0;EK;E++)J[E].indent+=F;var M=j.list.arrayToList(J,I,null,v.config.enterMode,0);if(this.name=='outdent'){var N;if((N=x.getParent())&&N.is('li')){var O=M.listNode.getChildren(),P=[],Q=O.count(),R;for(E=Q-1;E>=0;E--){if((R=O.getItem(E))&&R.is&&R.is('li'))P.push(R);}}}if(M)M.listNode.replace(x);if(P&&P.length)for(E=0;E0;if(y.useIndentClasses){y.classNameRegex=new RegExp('(?:^|\\s+)('+v.config.indentClasses.join('|')+')(?=$|\\s)');y.indentClassMap={};for(var x=0;x=0;x--){v=t[x].createIterator();v.enlargeBr=r!=2;while(w=v.getNextParagraph()){w.removeAttribute('align');if(u){var y=w.$.className=e.ltrim(w.$.className.replace(z.cssClassRegex,''));if(z.state==2&&!z.isDefaultAlign)w.addClass(u);else if(!y)w.removeAttribute('class');}else if(z.state==2&&!z.isDefaultAlign)w.setStyle('text-align',z.value);else w.removeStyle('text-align');}}p.focus();p.forceNextSelectionCheck();q.selectBookmarks(s);}};j.add('justify',{init:function(p){var q=new o(p,'justifyleft','left'),r=new o(p,'justifycenter','center'),s=new o(p,'justifyright','right'),t=new o(p,'justifyblock','justify');p.addCommand('justifyleft',q);p.addCommand('justifycenter',r);p.addCommand('justifyright',s); -p.addCommand('justifyblock',t);p.ui.addButton('JustifyLeft',{label:p.lang.justify.left,command:'justifyleft'});p.ui.addButton('JustifyCenter',{label:p.lang.justify.center,command:'justifycenter'});p.ui.addButton('JustifyRight',{label:p.lang.justify.right,command:'justifyright'});p.ui.addButton('JustifyBlock',{label:p.lang.justify.block,command:'justifyblock'});p.on('selectionChange',e.bind(n,q));p.on('selectionChange',e.bind(n,s));p.on('selectionChange',e.bind(n,r));p.on('selectionChange',e.bind(n,t));},requires:['domiterator']});})();e.extend(i,{justifyClasses:null});j.add('keystrokes',{beforeInit:function(l){l.keystrokeHandler=new a.keystrokeHandler(l);l.specialKeys={};},init:function(l){var m=l.config.keystrokes,n=l.config.blockedKeystrokes,o=l.keystrokeHandler.keystrokes,p=l.keystrokeHandler.blockedKeystrokes;for(var q=0;qE[G-1].indent+1){var K=E[G-1].indent+1-E[G].indent,L=E[G].indent;while(E[G]&&E[G].indent>=L){E[G].indent+=K;G++;}G--;}}var M=j.list.arrayToList(E,D,null,B.config.enterMode),N=M.listNode,O,P;function Q(R){if((O=N[R?'getFirst':'getLast']())&&!(O.is&&O.isBlockBoundary())&&(P=C.root[R?'getPrevious':'getNext'](d.walker.whitespaces(true)))&&!(P.is&&P.isBlockBoundary({br:1})))B.document.createElement('br')[R?'insertBefore':'insertAfter'](O);};Q(true);Q();N.replace(C.root);};function t(B,C){this.name=B;this.type=C;};t.prototype={exec:function(B){B.focus();var C=B.document,D=B.getSelection(),E=D&&D.getRanges();if(!E||E.length<1)return;if(this.state==2){var F=C.getBody();F.trim();if(!F.getFirst()){var G=C.createElement(B.config.enterMode==1?'p':B.config.enterMode==3?'div':'br');G.appendTo(F);E=[new d.range(C)];if(G.is('br')){E[0].setStartBefore(G);E[0].setEndAfter(G);}else E[0].selectNodeContents(G);D.selectRanges(E);}else{var H=E.length==1&&E[0],I=H&&H.getEnclosedNode();if(I&&I.is&&this.type==I.getName())n.call(this,B,1);}}var J=D.createBookmarks(true),K=[],L={};while(E.length>0){H=E.shift();var M=H.createIterator(),N;M.forceBrBreak=this.state==2;while(N=M.getNextParagraph()){var O=new d.elementPath(N),P=O.elements,Q=P.length,R=null,S=false,T=O.blockLimit,U;for(var V=Q-1;V>=0&&(U=P[V]);V--){if(l[U.getName()]&&T.contains(U)){T.removeCustomData('list_group_object');var W=U.getCustomData('list_group_object');if(W)W.contents.push(N);else{W={root:U,contents:[N]};K.push(W);h.setMarker(L,U,'list_group_object',W);}S=true; -break;}}if(S)continue;var X=T;if(X.getCustomData('list_group_object'))X.getCustomData('list_group_object').contents.push(N);else{W={root:X,contents:[N]};h.setMarker(L,X,'list_group_object',W);K.push(W);}}}var Y=[];while(K.length>0){W=K.shift();if(this.state==2){if(l[W.root.getName()])p.call(this,B,W,L,Y);else r.call(this,B,W,Y);}else if(this.state==1&&l[W.root.getName()])s.call(this,B,W,L);}for(V=0;V0)for(var t=s.length-1;t>=0;t--){var u=s[t][0],v=s[t][1];if(v)u.insertBefore(v);else u.appendTo(r);}};function n(r,s){var t=l(r),u={},v=r.$;if(!s){u['class']=v.className||'';v.className='';}u.inline=v.style.cssText||'';if(!s)v.style.cssText='position: static; overflow: visible';m(t);return u;};function o(r,s){var t=l(r),u=r.$;if('class' in s)u.className=s['class'];if('inline' in s)u.style.cssText=s.inline;m(t);};function p(r){var s=a.instances;for(var t in s){var u=s[t];if(u.mode=='wysiwyg'){var v=u.document.getBody();v.setAttribute('contentEditable',false);v.setAttribute('contentEditable',true);}}if(r.focusManager.hasFocus){r.toolbox.focus();r.focus();}};function q(r){if(!c||b.version>6)return null;var s=h.createFromHtml('');return r.append(s,true);};j.add('maximize',{init:function(r){var s=r.lang,t=a.document,u=t.getWindow(),v,w,x,y;function z(){var B=u.getViewPaneSize();y&&y.setStyles({width:B.width+'px',height:B.height+'px'});r.resize(B.width,B.height,null,true);};var A=2;r.addCommand('maximize',{modes:{wysiwyg:1,source:1},editorFocus:false,exec:function(){var B=r.container.getChild(1),C=r.getThemeSpace('contents');if(r.mode=='wysiwyg'){var D=r.getSelection();v=D&&D.getRanges();w=u.getScrollPosition();}else{var E=r.textarea.$;v=!c&&[E.selectionStart,E.selectionEnd];w=[E.scrollLeft,E.scrollTop];}if(this.state==2){u.on('resize',z);x=u.getScrollPosition();var F=r.container;while(F=F.getParent()){F.setCustomData('maximize_saved_styles',n(F));F.setStyle('z-index',r.config.baseFloatZIndex-1);}C.setCustomData('maximize_saved_styles',n(C,true));B.setCustomData('maximize_saved_styles',n(B,true));if(c)t.$.documentElement.style.overflow=t.getBody().$.style.overflow='hidden';else t.getBody().setStyles({overflow:'hidden',width:'0px',height:'0px'}); -c?setTimeout(function(){u.$.scrollTo(0,0);},0):u.$.scrollTo(0,0);var G=u.getViewPaneSize();B.setStyle('position','absolute');B.$.offsetLeft;B.setStyles({'z-index':r.config.baseFloatZIndex-1,left:'0px',top:'0px'});y=q(B);B.addClass('cke_maximized');z();var H=B.getDocumentPosition();B.setStyles({left:-1*H.x+'px',top:-1*H.y+'px'});b.gecko&&p(r);}else if(this.state==1){u.removeListener('resize',z);var I=[C,B];for(var J=0;J ');m=l.createFakeElement(m,'cke_pagebreak','div');var n=l.getSelection().getRanges();l.fire('saveSnapshot');for(var o,p=0;p0)m=m.clone(true);o.splitBlock('p');o.insertNode(m);if(p==n.length-1){o.moveToPosition(m,4);o.select();}var q=m.getPrevious();if(f[q.getName()].div)m.move(q);}l.fire('saveSnapshot');}};(function(){j.add('pastefromword',{init:function(l){var m=0,n=function(){setTimeout(function(){m=0;},0);};l.addCommand('pastefromword',{canUndo:false,exec:function(){m=1;if(l.execCommand('paste')===false)l.on('dialogHide',function(o){o.removeListener();n();});else n();}});l.ui.addButton('PasteFromWord',{label:l.lang.pastefromword.toolbar,command:'pastefromword'});l.on('paste',function(o){var p=o.data,q;if((q=p.html)&&(m||/(class=\"?Mso|style=\"[^\"]*\bmso\-|w:WordDocument)/.test(q))){var r=this.loadFilterRules(function(){if(r)l.fire('paste',p);else if(!l.config.pasteFromWordPromptCleanup||m||confirm(l.lang.pastefromword.confirmCleanup))p.html=a.cleanWord(q,l);});r&&o.cancel();}},this);},loadFilterRules:function(l){var m=a.cleanWord;if(m)l();else{var n=a.getUrl(i.pasteFromWordCleanupFile||this.path+'filter/default.js');a.scriptLoader.load(n,l,null,false,true);}return!m;}});})();(function(){var l={exec:function(o){var p=e.tryThese(function(){var q=window.clipboardData.getData('Text');if(!q)throw 0;return q;});if(!p){o.openDialog('pastetext');return false;}else o.fire('paste',{text:p});return true;}};function m(o,p){if(c){var q=o.selection;if(q.type=='Control')q.clear();q.createRange().pasteHTML(p);}else o.execCommand('inserthtml',false,p);};j.add('pastetext',{init:function(o){var p='pastetext',q=o.addCommand(p,l);o.ui.addButton('PasteText',{label:o.lang.pasteText.button,command:p});a.dialog.add(p,a.getUrl(this.path+'dialogs/pastetext.js'));if(o.config.forcePasteAsPlainText)o.on('beforeCommandExec',function(r){if(r.data.name=='paste'){o.execCommand('pastetext');r.cancel();}},null,null,0);},requires:['clipboard']});function n(o,p,q,r){while(q--)j.enterkey[p==2?'enterBr':'enterBlock'](o,p,null,r);};a.editor.prototype.insertText=function(o){this.focus();this.fire('saveSnapshot');var p=this.getSelection().getStartElement().hasAscendant('pre',true)?2:this.config.enterMode,q=p==2,r=this.document.$,s=this,t; -o=e.htmlEncode(o.replace(/\r\n|\r/g,'\n'));var u=0;o.replace(/\n+/g,function(v,w){t=o.substring(u,w);u=w+v.length;t.length&&m(r,t);var x=v.length,y=q?0:Math.floor(x/2),z=q?x:x%2;n(s,p,y);n(s,2,z,q?false:true);});t=o.substring(u,o.length);t.length&&m(r,t);this.fire('saveSnapshot');};})();j.add('popup');e.extend(a.editor.prototype,{popup:function(l,m,n){m=m||'80%';n=n||'70%';if(typeof m=='string'&&m.length>1&&m.substr(m.length-1,1)=='%')m=parseInt(window.screen.width*parseInt(m,10)/100,10);if(typeof n=='string'&&n.length>1&&n.substr(n.length-1,1)=='%')n=parseInt(window.screen.height*parseInt(n,10)/100,10);if(m<640)m=640;if(n<420)n=420;var o=parseInt((window.screen.height-n)/2,10),p=parseInt((window.screen.width-m)/2,10),q='location=no,menubar=no,toolbar=no,dependent=yes,minimizable=no,modal=yes,alwaysRaised=yes,resizable=yes,width='+m+',height='+n+',top='+o+',left='+p,r=window.open('',null,q,true);if(!r)return false;try{r.moveTo(p,o);r.resizeTo(m,n);r.focus();r.location.href=l;}catch(s){r=window.open(l,null,q,true);}return true;}});(function(){var l={modes:{wysiwyg:1,source:1},canUndo:false,exec:function(n){var o,p=n.config,q=p.baseHref?'':'',r=b.isCustomDomain();if(p.fullPage)o=n.getData().replace(//,'$&'+q).replace(/[^>]*(?=<\/title>)/,n.lang.preview);else{var s=''+''+q+''+n.lang.preview+''+e.buildStyleHtml(n.config.contentsCss)+''+s+n.getData()+'';}var u=640,v=420,w=80;try{var x=window.screen;u=Math.round(x.width*0.8);v=Math.round(x.height*0.7);w=Math.round(x.width*0.1);}catch(A){}var y='';if(r){window._cke_htmlToLoad=o;y='javascript:void( (function(){document.open();document.domain="'+document.domain+'";'+'document.write( window.opener._cke_htmlToLoad );'+'document.close();'+'window.opener._cke_htmlToLoad = null;'+'})() )';}var z=window.open(y,null,'toolbar=yes,location=no,status=yes,menubar=yes,scrollbars=yes,resizable=yes,width='+u+',height='+v+',left='+w);if(!r){z.document.open();z.document.write(o);z.document.close();}}},m='preview';j.add(m,{init:function(n){n.addCommand(m,l);n.ui.addButton('Preview',{label:n.lang.preview,command:m});}});})();j.add('print',{init:function(l){var m='print',n=l.addCommand(m,j.print);l.ui.addButton('Print',{label:l.lang.print,command:m}); -}});j.print={exec:function(l){if(b.opera)return;else if(b.gecko)l.window.$.print();else l.document.$.execCommand('Print');},canUndo:false,modes:{wysiwyg:!b.opera}};j.add('removeformat',{requires:['selection'],init:function(l){l.addCommand('removeFormat',j.removeformat.commands.removeformat);l.ui.addButton('RemoveFormat',{label:l.lang.removeFormat,command:'removeFormat'});l._.removeFormat={filters:[]};}});j.removeformat={commands:{removeformat:{exec:function(l){var m=l._.removeFormatRegex||(l._.removeFormatRegex=new RegExp('^(?:'+l.config.removeFormatTags.replace(/,/g,'|')+')$','i')),n=l._.removeAttributes||(l._.removeAttributes=l.config.removeFormatAttributes.split(',')),o=j.removeformat.filter,p=l.getSelection().getRanges();for(var q=0,r;r=p[q];q++){if(r.collapsed)continue;r.enlarge(1);var s=r.createBookmark(),t=s.startNode,u=s.endNode,v=function(y){var z=new d.elementPath(y),A=z.elements;for(var B=1,C;C=A[B];B++){if(C.equals(z.block)||C.equals(z.blockLimit))break;if(m.test(C.getName())&&o(l,C))y.breakParent(C);}};v(t);v(u);var w=t.getNextSourceNode(true,1);while(w){if(w.equals(u))break;var x=w.getNextSourceNode(false,1);if(!(w.getName()=='img'&&w.getAttribute('_cke_realelement'))&&o(l,w))if(m.test(w.getName()))w.remove(true);else{w.removeAttributes(n);l.fire('removeFormatCleanup',w);}w=x;}r.moveToBookmark(s);}l.getSelection().selectRanges(p);}}},filter:function(l,m){var n=l._.removeFormat.filters;for(var o=0;op.width&&(m.resize_minWidth=p.width);m.resize_minHeight>p.height&&(m.resize_minHeight=p.height);a.document.on('mousemove',s);a.document.on('mouseup',t);if(l.document){l.document.on('mousemove',s);l.document.on('mouseup',t);}});l.on('destroy',function(){e.removeFunction(u);});l.on('themeSpace',function(v){if(v.data.space=='bottom'){var w='';if(q&&!r)w=' cke_resizer_horizontal';if(!q&&r)w=' cke_resizer_vertical';v.data.html+='
            ';}},l,null,100);}}});(function(){var l={modes:{wysiwyg:1,source:1},exec:function(n){var o=n.element.$.form;if(o)try{o.submit();}catch(p){if(o.submit.click)o.submit.click();}}},m='save';j.add(m,{init:function(n){var o=n.addCommand(m,l);o.modes={wysiwyg:!!n.element.$.form};n.ui.addButton('Save',{label:n.lang.save,command:m});}});})();(function(){var l='scaytcheck',m='';function n(s,t){var u=false,v;for(v in t){if(t[v]===s||t[v]==s){u=true;break;}}return u;};var o=function(){var s=this,t=function(){var x={};x.srcNodeRef=s.document.getWindow().$.frameElement;x.assocApp='CKEDITOR.'+a.version+'@'+a.revision;x.customerid=s.config.scayt_customerid||'1:WvF0D4-UtPqN1-43nkD4-NKvUm2-daQqk3-LmNiI-z7Ysb4-mwry24-T8YrS3-Q2tpq2';x.customDictionaryIds=s.config.scayt_customDictionaryIds||'';x.userDictionaryName=s.config.scayt_userDictionaryName||'';x.sLang=s.config.scayt_sLang||'en_US';x.onLoad=function(){if(!(c&&b.version<8))this.addStyle(this.selectorCss(),'padding-bottom: 2px !important;');if(s.focusManager.hasFocus&&!p.isControlRestored(s))this.focus();};x.onBeforeChange=function(){if(p.getScayt(s)&&!s.checkDirty())setTimeout(function(){s.resetDirty();});};var y=window.scayt_custom_params;if(typeof y=='object')for(var z in y)x[z]=y[z];if(p.getControlId(s))x.id=p.getControlId(s);var A=new window.scayt(x);A.afterMarkupRemove.push(function(H){new h(H,A.document).mergeSiblings();});var B=p.instances[s.name];if(B){A.sLang=B.sLang;A.option(B.option());A.paused=B.paused;}p.instances[s.name]=A;var C='scaytButton',D=window.scayt.uiTags,E=[];for(var F=0,G=4;F=0){this.setState(0);p.loadEngine(s);}}};j.add('scayt',{requires:['menubutton'],beforeInit:function(s){var t=s.config.scayt_contextMenuItemsOrder||'suggest|moresuggest|control',u='';t=t.split('|');if(t&&t.length)for(var v in t)u+='scayt_'+t[v]+(t.length!=parseInt(v,10)+1?',':'');if(s.config.scayt_contextMenuOntop)s.config.menu_groups=u+','+s.config.menu_groups;else s.config.menu_groups=s.config.menu_groups+','+u;},init:function(s){var t={},u={},v=s.addCommand(l,r);a.dialog.add(l,a.getUrl(this.path+'dialogs/options.js'));var w=s.config.scayt_uiTabs||'1,1,1',x=[]; -w=w.split(',');for(var y=0,z=3;y tr > td, .%1 table.%2 > tr > th,','.%1 table.%2 > tbody > tr > td, .%1 table.%2 > tbody > tr > th,','.%1 table.%2 > thead > tr > td, .%1 table.%2 > thead > tr > th,','.%1 table.%2 > tfoot > tr > td, .%1 table.%2 > tfoot > tr > th','{','border : #d3d3d3 1px dotted','}']).join('');m=n.replace(/%2/g,l).replace(/%1/g,'cke_show_borders ');var o={preserveState:true,editorFocus:false,exec:function(p){this.toggleState();this.refresh(p);},refresh:function(p){var q=this.state==1?'addClass':'removeClass';p.document.getBody()[q]('cke_show_borders');}};j.add('showborders',{requires:['wysiwygarea'],modes:{wysiwyg:1},init:function(p){var q=p.addCommand('showborders',o);q.canUndo=false;if(p.config.startupShowBorders!==false)q.setState(1);p.addCss(m);p.on('mode',function(){if(q.state!=0)q.refresh(p);},null,null,100);p.on('contentDom',function(){if(q.state!=0)q.refresh(p);});p.on('removeFormatCleanup',function(r){var s=r.data;if(p.getCommand('showborders').state==1&&s.is('table')&&(!s.hasAttribute('border')||parseInt(s.getAttribute('border'),10)<=0))s.addClass(l);});},afterInit:function(p){var q=p.dataProcessor,r=q&&q.dataFilter,s=q&&q.htmlFilter;if(r)r.addRules({elements:{table:function(t){var u=t.attributes,v=u['class'],w=parseInt(u.border,10);if(!w||w<=0)u['class']=(v||'')+' '+l;}}});if(s)s.addRules({elements:{table:function(t){var u=t.attributes,v=u['class'];v&&(u['class']=v.replace(l,'').replace(/\s{2}/,' ').replace(/^\s+|\s+$/,''));}}});}});a.on('dialogDefinition',function(p){var q=p.data.name;if(q=='table'||q=='tableProperties'){var r=p.data.definition,s=r.getContents('info'),t=s.get('txtBorder'),u=t.commit;t.commit=e.override(u,function(v){return function(w,x){v.apply(this,arguments);var y=parseInt(this.getValue(),10);x[!y||y<=0?'addClass':'removeClass'](l);};});}});})();j.add('sourcearea',{requires:['editingblock'],init:function(l){var m=j.sourcearea,n=a.document.getWindow();l.on('editingBlockReady',function(){var o,p;l.addMode('source',{load:function(q,r){if(c&&b.version<8)q.setStyle('position','relative');l.textarea=o=new h('textarea');o.setAttributes({dir:'ltr',tabIndex:b.webkit?-1:l.tabIndex,role:'textbox','aria-label':l.lang.editorTitle.replace('%1',l.name)}); -o.addClass('cke_source');o.addClass('cke_enable_context_menu');var s={width:b.ie7Compat?'99%':'100%',height:'100%',resize:'none',outline:'none','text-align':'left'};if(c){p=function(){o.hide();o.setStyle('height',q.$.clientHeight+'px');o.setStyle('width',q.$.clientWidth+'px');o.show();};l.on('resize',p);n.on('resize',p);setTimeout(p,0);}else o.on('mousedown',function(u){u.data.stopPropagation();});q.setHtml('');q.append(o);o.setStyles(s);l.fire('ariaWidget',o);o.on('blur',function(){l.focusManager.blur();});o.on('focus',function(){l.focusManager.focus();});l.mayBeDirty=true;this.loadData(r);var t=l.keystrokeHandler;if(t)t.attach(o);setTimeout(function(){l.mode='source';l.fire('mode');},b.gecko||b.webkit?100:0);},loadData:function(q){o.setValue(q);l.fire('dataReady');},getData:function(){return o.getValue();},getSnapshotData:function(){return o.getValue();},unload:function(q){o.clearCustomData();l.textarea=o=null;if(p){l.removeListener('resize',p);n.removeListener('resize',p);}if(c&&b.version<8)q.removeStyle('position');},focus:function(){o.focus();}});});l.addCommand('source',m.commands.source);if(l.ui.addButton)l.ui.addButton('Source',{label:l.lang.source,command:'source'});l.on('mode',function(){l.getCommand('source').setState(l.mode=='source'?1:2);});}});j.sourcearea={commands:{source:{modes:{wysiwyg:1,source:1},editorFocus:false,exec:function(l){if(l.mode=='wysiwyg')l.fire('saveSnapshot');l.getCommand('source').setState(0);l.setMode(l.mode=='source'?'wysiwyg':'source');},canUndo:false}}};(function(){j.add('stylescombo',{requires:['richcombo','styles'],init:function(m){var n=m.config,o=m.lang.stylesCombo,p={},q=[];function r(s){m.getStylesSet(function(t){if(!q.length){var u,v;for(var w=0;w0)return;if(T.type==1&&m.test(T.getName())&&!T.getCustomData('selected_cell')){h.setMarker(K,T,'selected_cell',true);J.push(T);}};for(var M=0;M0&&Q.$.rows[L]||Q.$.parentNode);for(N=J.length;N>=0;N--){if(J[N])r(J[N]);}return K;}else if(G instanceof h){Q=G.getAscendant('table');if(Q.$.rows.length==1)Q.remove();else G.remove();}return 0;};function s(G,H){var I=G.getStartElement(),J=I.getAscendant('td',true)||I.getAscendant('th',true);if(!J)return;var K=J.getAscendant('table'),L=J.$.cellIndex;for(var M=0;M1){L=H[J-1]+1;break;}}if(!L)L=H[0]>0?H[0]-1:H[H.length-1]+1;var N=I.$.rows;for(J=0,K=N.length;J=0;J--){if(H[J])u(H[J]);}return I;}else if(G instanceof h){var K=G.getAscendant('table');if(!K)return null;var L=G.$.cellIndex;for(J=K.$.rows.length-1;J>=0;J--){var M=new h(K.$.rows[J]);if(!L&&M.$.cells.length==1){r(M);continue;}if(M.$.cells[L])M.$.removeChild(M.$.cells[L]);}}return null;};function v(G,H){var I=G.getStartElement(),J=I.getAscendant('td',true)||I.getAscendant('th',true);if(!J)return;var K=J.clone();if(!c)K.appendBogus();if(H)K.insertBefore(J);else K.insertAfter(J);};function w(G){if(G instanceof d.selection){var H=n(G),I=H[0]&&H[0].getAscendant('table'),J=o(H);for(var K=H.length-1;K>=0;K--)w(H[K]);if(J)y(J,true);else if(I)I.remove();}else if(G instanceof h){var L=G.getParent();if(L.getChildCount()==1)L.remove();else G.remove();}};function x(G){var H=G.getBogus();H&&H.remove();G.trim();};function y(G,H){var I=new d.range(G.getDocument());if(!I['moveToElementEdit'+(H?'End':'Start')](G)){I.selectNodeContents(G); -I.collapse(H?false:true);}I.select(true);};function z(G){var H=G.$.rows,I=-1,J=[];for(var K=0;K=Q)M.removeAttribute('rowSpan');else M.$.rowSpan=W;if(W>=P)M.removeAttribute('colSpan');else M.$.colSpan=X;var ai=new d.nodeList(N.$.rows),aj=ai.count();for(aa=aj-1;aa>=0;aa--){var ak=ai.getItem(aa);if(!ak.$.cells.length){ak.remove();aj++;continue;}}return M;}else return W*X==Z;};function D(G,H){var I=n(G);if(I.length>1)return false;else if(H)return true;var J=I[0],K=J.getParent(),L=K.getAscendant('table'),M=z(L),N=K.$.rowIndex,O=A(M,N,J),P=J.$.rowSpan,Q,R,S,T;if(P>1){R=Math.ceil(P/2);S=Math.floor(P/2);T=N+R;var U=new h(L.$.rows[T]),V=A(M,T),W;Q=J.clone();for(var X=0;XO){Q.insertBefore(new h(W));break;}else W=null;}if(!W)U.append(Q,true);}else{S=R=1;U=K.clone();U.insertAfter(K); -U.append(Q=J.clone());var Y=A(M,N);for(var Z=0;Z1)return false;else if(H)return true;var J=I[0],K=J.getParent(),L=K.getAscendant('table'),M=z(L),N=K.$.rowIndex,O=A(M,N,J),P=J.$.colSpan,Q,R,S;if(P>1){R=Math.ceil(P/2);S=Math.floor(P/2);}else{S=R=1;var T=B(M,O);for(var U=0;U0?2:0};}},tablecell_insertBefore:{label:H.cell.insertBefore,group:'tablecell',command:'cellInsertBefore',order:5},tablecell_insertAfter:{label:H.cell.insertAfter,group:'tablecell',command:'cellInsertAfter',order:10},tablecell_delete:{label:H.cell.deleteCell,group:'tablecell',command:'cellDelete',order:15},tablecell_merge:{label:H.cell.merge,group:'tablecell',command:'cellMerge',order:16},tablecell_merge_right:{label:H.cell.mergeRight,group:'tablecell',command:'cellMergeRight',order:17},tablecell_merge_down:{label:H.cell.mergeDown,group:'tablecell',command:'cellMergeDown',order:18},tablecell_split_horizontal:{label:H.cell.splitHorizontal,group:'tablecell',command:'cellHorizontalSplit',order:19},tablecell_split_vertical:{label:H.cell.splitVertical,group:'tablecell',command:'cellVerticalSplit',order:20},tablecell_properties:{label:H.cell.title,group:'tablecellproperties',command:'cellProperties',order:21},tablerow:{label:H.row.menu,group:'tablerow',order:1,getItems:function(){return{tablerow_insertBefore:2,tablerow_insertAfter:2,tablerow_delete:2};}},tablerow_insertBefore:{label:H.row.insertBefore,group:'tablerow',command:'rowInsertBefore',order:5},tablerow_insertAfter:{label:H.row.insertAfter,group:'tablerow',command:'rowInsertAfter',order:10},tablerow_delete:{label:H.row.deleteRow,group:'tablerow',command:'rowDelete',order:15},tablecolumn:{label:H.column.menu,group:'tablecolumn',order:1,getItems:function(){return{tablecolumn_insertBefore:2,tablecolumn_insertAfter:2,tablecolumn_delete:2};}},tablecolumn_insertBefore:{label:H.column.insertBefore,group:'tablecolumn',command:'columnInsertBefore',order:5},tablecolumn_insertAfter:{label:H.column.insertAfter,group:'tablecolumn',command:'columnInsertAfter',order:10},tablecolumn_delete:{label:H.column.deleteColumn,group:'tablecolumn',command:'columnDelete',order:15}});if(G.contextMenu)G.contextMenu.addListener(function(I,J){if(!I)return null;while(I){if(I.getName() in F)return{tablecell:2,tablerow:2,tablecolumn:2};I=I.getParent();}return null;});},getSelectedCells:n};j.add('tabletools',j.tabletools);})();j.add('specialchar',{init:function(l){var m='specialchar';a.dialog.add(m,this.path+'dialogs/specialchar.js');l.addCommand(m,new a.dialogCommand(m)); -l.ui.addButton('SpecialChar',{label:l.lang.specialChar.toolbar,command:m});}});(function(){var l={editorFocus:false,modes:{wysiwyg:1,source:1}},m={exec:function(o){o.container.focusNext(true,o.tabIndex);}},n={exec:function(o){o.container.focusPrevious(true,o.tabIndex);}};j.add('tab',{requires:['keystrokes'],init:function(o){var p=o.config.tabSpaces||0,q='';while(p--)q+='\xa0';if(q)o.on('key',function(r){if(r.data.keyCode==9){o.insertHtml(q);r.cancel();}});if(b.webkit||b.gecko)o.on('key',function(r){var s=r.data.keyCode;if(s==9&&!q){r.cancel();o.execCommand('blur');}if(s==2000+9){o.execCommand('blurBack');r.cancel();}});o.addCommand('blur',e.extend(m,l));o.addCommand('blurBack',e.extend(n,l));}});})();h.prototype.focusNext=function(l,m){var v=this;var n=v.$,o=m===undefined?v.getTabIndex():m,p,q,r,s,t,u;if(o<=0){t=v.getNextSourceNode(l,1);while(t){if(t.isVisible()&&t.getTabIndex()===0){r=t;break;}t=t.getNextSourceNode(false,1);}}else{t=v.getDocument().getBody().getFirst();while(t=t.getNextSourceNode(false,1)){if(!p)if(!q&&t.equals(v)){q=true;if(l){if(!(t=t.getNextSourceNode(true,1)))break;p=1;}}else if(q&&!v.contains(t))p=1;if(!t.isVisible()||(u=t.getTabIndex())<0)continue;if(p&&u==o){r=t;break;}if(u>o&&(!r||!s||us){r=u;s=t;}}else{if(p&&t==o){r=u;break;}if(ts)){r=u;s=t;}}}if(r)r.focus();};(function(){j.add('templates',{requires:['dialog'],init:function(n){a.dialog.add('templates',a.getUrl(this.path+'dialogs/templates.js'));n.addCommand('templates',new a.dialogCommand('templates'));n.ui.addButton('Templates',{label:n.lang.templates.button,command:'templates'});}});var l={},m={};a.addTemplates=function(n,o){l[n]=o;};a.getTemplates=function(n){return l[n];};a.loadTemplates=function(n,o){var p=[];for(var q=0;q0)a.scriptLoader.load(p,o);else setTimeout(o,0);};})();i.templates='default';i.templates_files=[a.getUrl('plugins/templates/templates/default.js')];i.templates_replaceContent=true;(function(){var l=function(){this.toolbars=[];this.focusCommandExecuted=false; -};l.prototype.focus=function(){for(var n=0,o;o=this.toolbars[n++];)for(var p=0,q;q=o.items[p++];){if(q.focus){q.focus();return;}}};var m={toolbarFocus:{modes:{wysiwyg:1,source:1},exec:function(n){if(n.toolbox){n.toolbox.focusCommandExecuted=true;if(c)setTimeout(function(){n.toolbox.focus();},100);else n.toolbox.focus();}}}};j.add('toolbar',{init:function(n){var o=function(p,q){var r,s,t,u=n.lang.dir=='rtl';switch(q){case u?37:39:case 9:do{r=p.next;if(!r){s=p.toolbar.next;t=s&&s.items.length;while(t===0){s=s.next;t=s&&s.items.length;}if(s)r=s.items[0];}p=r;}while(p&&!p.focus)if(p)p.focus();else n.toolbox.focus();return false;case u?39:37:case 2000+9:do{r=p.previous;if(!r){s=p.toolbar.previous;t=s&&s.items.length;while(t===0){s=s.previous;t=s&&s.items.length;}if(s)r=s.items[t-1];}p=r;}while(p&&!p.focus)if(p)p.focus();else{var v=n.toolbox.toolbars[n.toolbox.toolbars.length-1].items;v[v.length-1].focus();}return false;case 27:n.focus();return false;case 13:case 32:p.execute();return false;}return true;};n.on('themeSpace',function(p){if(p.data.space==n.config.toolbarLocation){n.toolbox=new l();var q='cke_'+e.getNextNumber(),r=['');if(n.config.toolbarCanCollapse){var F=e.addFunction(function(){n.execCommand('toolbarCollapse');});n.on('destroy',function(){e.removeFunction(F);});var G='cke_'+e.getNextNumber(); -n.addCommand('toolbarCollapse',{exec:function(H){var I=a.document.getById(G),J=I.getPrevious(),K=H.getThemeSpace('contents'),L=J.getParent(),M=parseInt(K.$.style.height,10),N=L.$.offsetHeight,O=!J.isVisible();if(!O){J.hide();I.addClass('cke_toolbox_collapser_min');I.setAttribute('title',H.lang.toolbarExpand);}else{J.show();I.removeClass('cke_toolbox_collapser_min');I.setAttribute('title',H.lang.toolbarCollapse);}I.getFirst().setText(O?'▲':'◀');var P=L.$.offsetHeight-N;K.setStyle('height',M-P+'px');H.fire('resize');},modes:{wysiwyg:1,source:1}});r.push('','','');}p.data.html+=r.join('');}});n.addCommand('toolbarFocus',m.toolbarFocus);}});})();k.separator={render:function(l,m){m.push('');return{};}};i.toolbarLocation='top';i.toolbar_Basic=[['Bold','Italic','-','NumberedList','BulletedList','-','Link','Unlink','-','About']];i.toolbar_Full=[['Source','-','Save','NewPage','Preview','-','Templates'],['Cut','Copy','Paste','PasteText','PasteFromWord','-','Print','SpellChecker','Scayt'],['Undo','Redo','-','Find','Replace','-','SelectAll','RemoveFormat'],['Form','Checkbox','Radio','TextField','Textarea','Select','Button','ImageButton','HiddenField'],'/',['Bold','Italic','Underline','Strike','-','Subscript','Superscript'],['NumberedList','BulletedList','-','Outdent','Indent','Blockquote','CreateDiv'],['JustifyLeft','JustifyCenter','JustifyRight','JustifyBlock'],['Link','Unlink','Anchor'],['Image','Flash','Table','HorizontalRule','Smiley','SpecialChar','PageBreak'],'/',['Styles','Format','Font','FontSize'],['TextColor','BGColor'],['Maximize','ShowBlocks','-','About']];i.toolbar='Full';i.toolbarCanCollapse=true;(function(){j.add('undo',{requires:['selection','wysiwygarea'],init:function(r){var s=new n(r),t=r.addCommand('undo',{exec:function(){if(s.undo()){r.selectionChange();this.fire('afterUndo');}},state:0,canUndo:false}),u=r.addCommand('redo',{exec:function(){if(s.redo()){r.selectionChange();this.fire('afterRedo');}},state:0,canUndo:false});s.onChange=function(){t.setState(s.undoable()?2:0);u.setState(s.redoable()?2:0);};function v(w){if(s.enabled&&w.data.command.canUndo!==false)s.save();};r.on('beforeCommandExec',v);r.on('afterCommandExec',v);r.on('saveSnapshot',function(){s.save(); -});r.on('contentDom',function(){r.document.on('keydown',function(w){if(!w.data.$.ctrlKey&&!w.data.$.metaKey)s.type(w);});});r.on('beforeModeUnload',function(){r.mode=='wysiwyg'&&s.save(true);});r.on('mode',function(){s.enabled=r.mode=='wysiwyg';s.onChange();});r.ui.addButton('Undo',{label:r.lang.undo,command:'undo'});r.ui.addButton('Redo',{label:r.lang.redo,command:'redo'});r.resetUndo=function(){s.reset();r.fire('saveSnapshot');};r.on('updateSnapshot',function(){if(s.currentImage&&new l(r).equals(s.currentImage))setTimeout(function(){s.update();},0);});}});j.undo={};var l=j.undo.Image=function(r){this.editor=r;var s=r.getSnapshot(),t=s&&r.getSelection();c&&s&&(s=s.replace(/\s+_cke_expando=".*?"/g,''));this.contents=s;this.bookmarks=t&&t.createBookmarks2(true);},m=/\b(?:href|src|name)="[^"]*?"/gi;l.prototype={equals:function(r,s){var t=this.contents,u=r.contents;if(c&&(b.ie7Compat||b.ie6Compat)){t=t.replace(m,'');u=u.replace(m,'');}if(t!=u)return false;if(s)return true;var v=this.bookmarks,w=r.bookmarks;if(v||w){if(!v||!w||v.length!=w.length)return false;for(var x=0;x25){this.save(false,null,false);this.modifiersCount=1;}}else if(!x){this.modifiersCount=0;this.typesCount++;if(this.typesCount>25){this.save(false,null,false);this.typesCount=1;}}},reset:function(){var r=this;r.lastKeystroke=0;r.snapshots=[];r.index=-1;r.limit=r.editor.config.undoStackSize;r.currentImage=null;r.hasUndo=false;r.hasRedo=false;r.resetType();},resetType:function(){var r=this;r.typing=false;delete r.lastKeystroke;r.typesCount=0;r.modifiersCount=0;},fireChange:function(){var r=this; -r.hasUndo=!!r.getNextImage(true);r.hasRedo=!!r.getNextImage(false);r.resetType();r.onChange();},save:function(r,s,t){var v=this;var u=v.snapshots;if(!s)s=new l(v.editor);if(s.contents===false)return false;if(v.currentImage&&s.equals(v.currentImage,r))return false;u.splice(v.index+1,u.length-v.index-1);if(u.length==v.limit)u.shift();v.index=u.push(s)-1;v.currentImage=s;if(t!==false)v.fireChange();return true;},restoreImage:function(r){var t=this;t.editor.loadSnapshot(r.contents);if(r.bookmarks)t.editor.getSelection().selectBookmarks(r.bookmarks);else if(c){var s=t.editor.document.getBody().$.createTextRange();s.collapse(true);s.select();}t.index=r.index;t.update();t.fireChange();},getNextImage:function(r){var w=this;var s=w.snapshots,t=w.currentImage,u,v;if(t)if(r)for(v=w.index-1;v>=0;v--){u=s[v];if(!t.equals(u,true)){u.index=v;return u;}}else for(v=w.index+1;v]*>\s*(?:]*>| |\u00A0| )?\s*(:?<\/\1>)?\s*(?=$|<\/body>)/gi,n=d.walker.whitespaces(true);function o(z){if(this.mode=='wysiwyg'){this.focus();this.fire('saveSnapshot');var A=this.getSelection(),B=z.data;if(this.dataProcessor)B=this.dataProcessor.toHtml(B);if(c){var C=A.isLocked;if(C)A.unlock();var D=A.getNative();if(D.type=='Control')D.clear();D.createRange().pasteHTML(B);if(C)this.getSelection().lock();}else this.document.$.execCommand('inserthtml',false,B);if(b.webkit){this.document.$.execCommand('inserthtml',false,'');var E=this.document.getById('cke_paste_marker');E.scrollIntoView();E.remove();}e.setTimeout(function(){this.fire('saveSnapshot');},0,this);}};function p(z){if(this.mode=='wysiwyg'){this.focus();this.fire('saveSnapshot');var A=z.data,B=A.getName(),C=f.$block[B],D=this.getSelection(),E=D.getRanges(),F=D.isLocked;if(F)D.unlock();var G,H,I,J;for(var K=E.length-1;K>=0;K--){G=E[K]; -G.deleteContents();H=!K&&A||A.clone(true);var L,M;if(C)while((L=G.getCommonAncestor(false,true))&&(M=f[L.getName()])&&!(M&&M[B])){if(L.getName() in f.span)G.splitElement(L);else if(G.checkStartOfBlock()&&G.checkEndOfBlock()){G.setStartBefore(L);G.collapse(true);L.remove();}else G.splitBlock();}G.insertNode(H);if(!I)I=H;}G.moveToPosition(I,4);if(C){var N=I.getNext(n),O=N&&N.type==1&&N.getName();if(O&&f.$block[O]&&f[O]['#'])G.moveToElementEditStart(N);}D.selectRanges([G]);if(F)this.getSelection().lock();e.setTimeout(function(){this.fire('saveSnapshot');},0,this);}};function q(z){if(!z.checkDirty())setTimeout(function(){z.resetDirty();});};var r=d.walker.whitespaces(true),s=d.walker.bookmark(false,true);function t(z){return r(z)&&s(z);};function u(z){return z.type==3&&e.trim(z.getText()).match(/^(?: |\xa0)$/);};function v(z){if(z.isLocked){z.unlock();setTimeout(function(){z.lock();},0);}};function w(z){return z.getOuterHtml().match(m);};r=d.walker.whitespaces(true);function x(z){var A=z.window,B=z.document,C=z.document.getBody(),D=C.getChildren().count();if(!D||D==1&&C.getFirst().hasAttribute('_moz_editor_bogus_node')){q(z);var E=B.$.createEvent('KeyEvents');E.initKeyEvent('keypress',true,true,A.$,false,false,false,false,0,32);B.$.dispatchEvent(E);D&&C.getFirst().remove();B.getBody().appendBogus();var F=new d.range(B);F.setStartAt(C,1);F.select();}};function y(z){var A=z.editor,B=z.data.path,C=B.blockLimit,D=z.data.selection,E=D.getRanges()[0],F=A.document.getBody(),G=A.config.enterMode;b.gecko&&x(A);if(G!=2&&E.collapsed&&C.getName()=='body'&&!B.block){A.fire('updateSnapshot');q(A);c&&v(D);var H=E.fixBlock(true,A.config.enterMode==3?'div':'p');if(c){var I=H.getFirst(t);I&&u(I)&&I.remove();}if(w(H)){var J=H.getNext(r);if(J&&J.type==1&&!l[J.getName()]){E.moveToElementEditStart(J);H.remove();}else{J=H.getPrevious(r);if(J&&J.type==1&&!l[J.getName()]){E.moveToElementEditEnd(J);H.remove();}}}E.select();if(!c)A.selectionChange();}var K=new d.range(A.document),L=new d.walker(K);K.selectNodeContents(F);L.evaluator=function(N){return N.type==1&&N.getName() in l;};L.guard=function(N,O){return!(N.type==3&&r(N)||O);};if(L.previous()){A.fire('updateSnapshot');q(A);c&&v(D);var M;if(G!=2)M=F.append(new h(G==1?'p':'div'));else M=F;if(!c)M.appendBogus();}};j.add('wysiwygarea',{requires:['editingblock'],init:function(z){var A=z.config.enterMode!=2?z.config.enterMode==3?'div':'p':false,B=z.lang.editorTitle.replace('%1',z.name),C;z.on('editingBlockReady',function(){var I,J,K,L,M,N,O=b.isCustomDomain(),P=function(S){if(J)J.remove(); -var T='document.open();'+(O?'document.domain="'+document.domain+'";':'')+'document.close();';J=h.createFromHtml('');J.on('load',function(U){M=1;U.removeListener();var V=J.getFrameDocument().$;V.open('text/html','replace');V.write(S);V.close();});I.append(J);};C=e.addFunction(R);var Q='';function R(S){if(!M)return;M=0;z.fire('ariaWidget',J);var T=S.document,U=T.body,V=T.getElementById('cke_actscrpt');V.parentNode.removeChild(V);U.spellcheck=!z.config.disableNativeSpellChecker;if(c){U.hideFocus=true;U.disabled=true;U.contentEditable=true;U.removeAttribute('disabled');}else setTimeout(function(){if(b.gecko&&b.version>=10900||b.opera)T.$.body.contentEditable=true;else if(b.webkit)T.$.body.parentNode.contentEditable=true;else T.$.designMode='on';},0);b.gecko&&e.setTimeout(x,0,null,z);S=z.window=new d.window(S);T=z.document=new g(T);T.on('dblclick',function(Z){var aa=Z.data.getTarget(),ab={element:aa,dialog:''};z.fire('doubleclick',ab);ab.dialog&&z.openDialog(ab.dialog);});if(!(c||b.opera))T.on('mousedown',function(Z){var aa=Z.data.getTarget();if(aa.is('img','hr','input','textarea','select'))z.getSelection().selectElement(aa);});if(b.gecko)T.on('mouseup',function(Z){if(Z.data.$.button==2){var aa=Z.data.getTarget();if(!aa.getOuterHtml().replace(m,'')){var ab=new d.range(T);ab.moveToElementEditStart(aa);ab.select(true);}}});if(b.webkit){T.on('click',function(Z){if(Z.data.getTarget().is('input','select'))Z.data.preventDefault();});T.on('mouseup',function(Z){if(Z.data.getTarget().is('input','textarea'))Z.data.preventDefault();});}if(c&&T.$.compatMode=='CSS1Compat'||b.gecko||b.opera){var W=T.getDocumentElement();W.on('mousedown',function(Z){if(Z.data.getTarget().equals(W)){if(b.gecko&&b.version>=10900)G();H.focus();}});}S.on('blur',function(){z.focusManager.blur();});S.on('focus',function(){var Z=z.document;if(b.gecko&&b.version>=10900)G();else if(b.opera)Z.getBody().focus();z.focusManager.focus();});var X=z.keystrokeHandler;if(X)X.attach(T);if(c){T.getDocumentElement().addClass(T.$.compatMode);T.on('keydown',function(Z){var aa=Z.data.getKeystroke();if(aa in {8:1,46:1}){var ab=z.getSelection(),ac=ab.getSelectedElement(); -if(ac){z.fire('saveSnapshot');var ad=ab.getRanges()[0].createBookmark();ac.remove();ab.selectBookmarks([ad]);z.fire('saveSnapshot');Z.data.preventDefault();}}});if(T.$.compatMode=='CSS1Compat'){var Y={33:1,34:1};T.on('keydown',function(Z){if(Z.data.getKeystroke() in Y)setTimeout(function(){z.getSelection().scrollIntoView();},0);});}}if(z.contextMenu)z.contextMenu.addTarget(T,z.config.browserContextMenuOnCtrl!==false);setTimeout(function(){z.fire('contentDom');if(N){z.mode='wysiwyg';z.fire('mode');N=false;}K=false;if(L){z.focus();L=false;}setTimeout(function(){z.fire('dataReady');},0);try{z.document.$.execCommand('enableObjectResizing',false,!z.config.disableObjectResizing);}catch(Z){}try{z.document.$.execCommand('enableInlineTableEditing',false,!z.config.disableNativeTableHandles);}catch(aa){}if(c)setTimeout(function(){if(z.document){var ab=z.document.$.body;ab.runtimeStyle.marginBottom='0px';ab.runtimeStyle.marginBottom='';}},1000);},0);};z.addMode('wysiwyg',{load:function(S,T,U){I=S;if(c&&b.quirks)S.setStyle('position','relative');z.mayBeDirty=true;N=true;if(U)this.loadSnapshotData(T);else this.loadData(T);},loadData:function(S){K=true;var T=z.config,U=T.fullPage,V=T.docType,W='';!U&&(W=e.buildStyleHtml(z.config.contentsCss)+W);var X=T.baseHref?'':'';if(U)S=S.replace(/]*>/i,function(Y){z.docType=V=Y;return '';});if(z.dataProcessor)S=z.dataProcessor.toHtml(S,A);if(U){if(!/]/.test(S))S=''+S;if(!/]/.test(S))S=''+S+'';if(!/]/.test(S))S=S.replace(/]*>/,'$&');else if(!/]/.test(S))S=S.replace(/]*>/,'$&');X&&(S=S.replace(//,'$&'+X));S=S.replace(/<\/head\s*>/,W+'$&');S=V+S;}else S=T.docType+''+''+''+B+''+X+W+''+''+S+'';S+=Q;this.onDispose();P(S);},getData:function(){var S=z.config,T=S.fullPage,U=T&&z.docType,V=J.getFrameDocument(),W=T?V.getDocumentElement().getOuterHtml():V.getBody().getHtml();if(z.dataProcessor)W=z.dataProcessor.toDataFormat(W,A);if(S.ignoreEmptyParagraph)W=W.replace(m,'');if(U)W=U+'\n'+W;return W;},getSnapshotData:function(){return J.getFrameDocument().getBody().getHtml();},loadSnapshotData:function(S){J.getFrameDocument().getBody().setHtml(S); -},onDispose:function(){if(!z.document)return;z.document.getDocumentElement().clearCustomData();z.document.getBody().clearCustomData();z.window.clearCustomData();z.document.clearCustomData();J.clearCustomData();J.remove();},unload:function(S){this.onDispose();z.window=z.document=J=I=L=null;z.fire('contentDomUnload');},focus:function(){if(K)L=true;else if(z.window){z.window.focus();z.selectionChange();}}});z.on('insertHtml',o,null,null,20);z.on('insertElement',p,null,null,20);z.on('selectionChange',y,null,null,1);});var D;z.on('contentDom',function(){var I=z.document.getElementsByTag('title').getItem(0);I.setAttribute('_cke_title',z.document.$.title);z.document.$.title=B;});if(b.ie8Compat){z.addCss('html.CSS1Compat [contenteditable=false]{ min-height:0 !important;}');var E=[];for(var F in f.$removeEmpty)E.push('html.CSS1Compat '+F+'[contenteditable=false]');z.addCss(E.join(',')+'{ display:inline-block;}');}function G(I){e.tryThese(function(){z.document.$.designMode='on';setTimeout(function(){z.document.$.designMode='off';z.document.getBody().focus();},50);},function(){z.document.$.designMode='off';var J=z.document.getBody();J.setAttribute('contentEditable',false);J.setAttribute('contentEditable',true);!I&&G(1);});};if(b.gecko||c||b.opera){var H;z.on('uiReady',function(){H=z.container.append(h.createFromHtml(''));H.on('focus',function(){z.focus();});});z.on('destroy',function(){e.removeFunction(C);H.clearCustomData();});}z.on('insertElement',function(I){var J=I.data;if(J.type==1&&(J.is('input')||J.is('textarea')))J.setAttribute('contentEditable',false);});}});if(b.gecko)(function(){var z=document.body;if(!z)window.addEventListener('load',arguments.callee,false);else{var A=z.getAttribute('onpageshow');z.setAttribute('onpageshow',(A?A+';':'')+'event.persisted && (function(){'+'var allInstances = CKEDITOR.instances, editor, doc;'+'for ( var i in allInstances )'+'{'+'\teditor = allInstances[ i ];'+'\tdoc = editor.document;'+'\tif ( doc )'+'\t{'+'\t\tdoc.$.designMode = "off";'+'\t\tdoc.$.designMode = "on";'+'\t}'+'}'+'})();');}})();})();i.disableObjectResizing=false;i.disableNativeTableHandles=true;i.disableNativeSpellChecker=true;i.ignoreEmptyParagraph=true;j.add('wsc',{requires:['dialog'],init:function(l){var m='checkspell',n=l.addCommand(m,new a.dialogCommand(m));n.modes={wysiwyg:!b.opera&&document.domain==window.location.hostname};l.ui.addButton('SpellChecker',{label:l.lang.spellCheck.toolbar,command:m}); -a.dialog.add(m,this.path+'dialogs/wsc.js');}});i.wsc_customerId=i.wsc_customerId||'1:ua3xw1-2XyGJ3-GWruD3-6OFNT1-oXcuB1-nR6Bp4-hgQHc-EcYng3-sdRXG3-NOfFk';i.wsc_customLoaderScript=i.wsc_customLoaderScript||null;a.DIALOG_RESIZE_NONE=0;a.DIALOG_RESIZE_WIDTH=1;a.DIALOG_RESIZE_HEIGHT=2;a.DIALOG_RESIZE_BOTH=3;(function(){function l(M){return!!this._.tabs[M][0].$.offsetHeight;};function m(){var Q=this;var M=Q._.currentTabId,N=Q._.tabIdList.length,O=e.indexOf(Q._.tabIdList,M)+N;for(var P=O-1;P>O-N;P--){if(l.call(Q,Q._.tabIdList[P%N]))return Q._.tabIdList[P%N];}return null;};function n(){var Q=this;var M=Q._.currentTabId,N=Q._.tabIdList.length,O=e.indexOf(Q._.tabIdList,M);for(var P=O+1;P1){R._.tabBarMode=true;R._.tabs[R._.currentTabId][0].focus();V=1;}else if((ad==37||ad==39)&&R._.tabBarMode){ag=ad==(ae?39:37)?m.call(R):n.call(R);R.selectPage(ag);R._.tabs[ag][0].focus();V=1;}else if((ad==13||ad==32)&&R._.tabBarMode){ah.selectPage(ah._.currentTabId);ah._.tabBarMode=false;ah._.currentFocusIndex=-1;U(true);V=1;}if(V){ac.stop();ac.data.preventDefault();}};function X(ac){V&&ac.data.preventDefault();};var Y=this._.element;this.on('show',function(){Y.on('keydown',W,this,null,0);if(b.opera||b.gecko&&b.mac)Y.on('keypress',X,this);});this.on('hide',function(){Y.removeListener('keydown',W);if(b.opera||b.gecko&&b.mac)Y.removeListener('keypress',X);});this.on('iframeAdded',function(ac){var ad=new g(ac.data.iframe.$.contentWindow.document);ad.on('keydown',W,this,null,0);});this.on('show',function(){var ag=this;T();if(M.config.dialog_startupFocusTab&&R._.pageCount>1){R._.tabBarMode=true;R._.tabs[R._.currentTabId][0].focus();}else if(!ag._.hasFocus){ag._.currentFocusIndex=-1;if(O.onFocus){var ac=O.onFocus.call(ag);ac&&ac.focus();}else U(true);if(ag._.editor.mode=='wysiwyg'&&c){var ad=M.document.$.selection,ae=ad.createRange();if(ae)if(ae.parentElement&&ae.parentElement().ownerDocument==M.document.$||ae.item&&ae.item(0).ownerDocument==M.document.$){var af=document.body.createTextRange();af.moveToElementText(ag.getElement().getFirst().$);af.collapse(true);af.select();}}}},this,null,4294967295);if(b.ie6Compat)this.on('load',function(ac){var ad=this.getElement(),ae=ad.getFirst();ae.remove();ae.appendTo(ad);},this);v(this);w(this);new d.text(O.title,a.document).appendTo(this.parts.title); -for(var Z=0;Z0?N:0)+'px',top:(O>0?O:0)+'px'});};})(),getPosition:function(){return e.extend({},this._.position);},show:function(){var M=this._.editor;if(M.mode=='wysiwyg'&&c){var N=M.getSelection();N&&N.lock();}var O=this._.element,P=this.definition;if(!(O.getParent()&&O.getParent().equals(a.document.getBody())))O.appendTo(a.document.getBody());else O.setStyle('display','block');if(b.gecko&&b.version<10900){var Q=this.parts.dialog;Q.setStyle('position','absolute');setTimeout(function(){Q.setStyle('position','fixed');},0);}this.resize(P.minWidth,P.minHeight);this.selectPage(this.definition.contents[0].id); -this.reset();if(a.dialog._.currentZIndex===null)a.dialog._.currentZIndex=this._.editor.config.baseFloatZIndex;this._.element.getFirst().setStyle('z-index',a.dialog._.currentZIndex+=10);if(a.dialog._.currentTop===null){a.dialog._.currentTop=this;this._.parentDialog=null;A(this._.editor);O.on('keydown',E);O.on(b.opera?'keypress':'keyup',F);for(var R in {keyup:1,keydown:1,keypress:1})O.on(R,L);}else{this._.parentDialog=a.dialog._.currentTop;var S=this._.parentDialog.getElement().getFirst();S.$.style.zIndex-=Math.floor(this._.editor.config.baseFloatZIndex/2);a.dialog._.currentTop=this;}G(this,this,'\x1b',null,function(){this.getButton('cancel')&&this.getButton('cancel').click();});this._.hasFocus=false;e.setTimeout(function(){var T=a.document.getWindow().getViewPaneSize(),U=this.getSize();this.move((T.width-P.minWidth)/2,(T.height-U.height)/2);this.parts.dialog.setStyle('visibility','');this.fireOnce('load',{});this.fire('show',{});this._.editor.fire('dialogShow',this);this.foreach(function(V){V.setInitValue&&V.setInitValue();});},100,this);},foreach:function(M){var P=this;for(var N in P._.contents)for(var O in P._.contents[N])M(P._.contents[N][O]);return P;},reset:(function(){var M=function(N){if(N.reset)N.reset();};return function(){this.foreach(M);return this;};})(),setupContent:function(){var M=arguments;this.foreach(function(N){if(N.setup)N.setup.apply(N,M);});},commitContent:function(){var M=arguments;this.foreach(function(N){if(N.commit)N.commit.apply(N,M);});},hide:function(){if(!this.parts.dialog.isVisible())return;this.fire('hide',{});this._.editor.fire('dialogHide',this);var M=this._.element;M.setStyle('display','none');this.parts.dialog.setStyle('visibility','hidden');H(this);while(a.dialog._.currentTop!=this)a.dialog._.currentTop.hide();if(!this._.parentDialog)B();else{var N=this._.parentDialog.getElement().getFirst();N.setStyle('z-index',parseInt(N.$.style.zIndex,10)+Math.floor(this._.editor.config.baseFloatZIndex/2));}a.dialog._.currentTop=this._.parentDialog;if(!this._.parentDialog){a.dialog._.currentZIndex=null;M.removeListener('keydown',E);M.removeListener(b.opera?'keypress':'keyup',F);for(var O in {keyup:1,keydown:1,keypress:1})M.removeListener(O,L);var P=this._.editor;P.focus();if(P.mode=='wysiwyg'&&c){var Q=P.getSelection();Q&&Q.unlock(true);}}else a.dialog._.currentZIndex-=10;delete this._.parentDialog;this.foreach(function(R){R.resetInitValue&&R.resetInitValue();});},addPage:function(M){var Y=this;var N=[],O=M.label?' title="'+e.htmlEncode(M.label)+'"':'',P=M.elements,Q=a.dialog._.uiElementBuilders.vbox.build(Y,{type:'vbox',className:'cke_dialog_page_contents',children:M.elements,expand:!!M.expand,padding:M.padding,style:M.style||'width: 100%; height: 100%;'},N),R=h.createFromHtml(N.join('')); -R.setAttribute('role','tabpanel');var S=b,T=M.id+'_'+e.getNextNumber(),U=h.createFromHtml(['0?' cke_last':'cke_first',O,!!M.hidden?' style="display:none"':'',' id="',T,'"',S.gecko&&S.version>=10900&&!S.hc?'':' href="javascript:void(0)"',' tabIndex="-1"',' hidefocus="true"',' role="tab">',M.label,''].join(''));R.setAttribute('aria-labelledby',T);Y._.tabs[M.id]=[U,R];Y._.tabIdList.push(M.id);!M.hidden&&Y._.pageCount++;Y._.lastTab=U;Y.updateStyle();var V=Y._.contents[M.id]={},W,X=Q.getChild();while(W=X.shift()){V[W.id]=W;if(typeof W.getChild=='function')X.push.apply(X,W.getChild());}R.setAttribute('name',M.id);R.appendTo(Y.parts.contents);U.unselectable();Y.parts.tabs.append(U);if(M.accessKey){G(Y,Y,'CTRL+'+M.accessKey,J,I);Y._.accessKeyMap['CTRL+'+M.accessKey]=M.id;}},selectPage:function(M){var R=this;if(R._.currentTabId==M)return;if(R.fire('selectPage',{page:M,currentPage:R._.currentTabId})===true)return;for(var N in R._.tabs){var O=R._.tabs[N][0],P=R._.tabs[N][1];if(N!=M){O.removeClass('cke_dialog_tab_selected');P.hide();}P.setAttribute('aria-hidden',N!=M);}var Q=R._.tabs[M];Q[0].addClass('cke_dialog_tab_selected');Q[1].show();R._.currentTabId=M;R._.currentTabIndex=e.indexOf(R._.tabIdList,M);},updateStyle:function(){this.parts.dialog[(this._.pageCount===1?'add':'remove')+'Class']('cke_single_page');},hidePage:function(M){var O=this;var N=O._.tabs[M]&&O._.tabs[M][0];if(!N||O._.pageCount==1)return;else if(M==O._.currentTabId)O.selectPage(m.call(O));N.hide();O._.pageCount--;O.updateStyle();},showPage:function(M){var O=this;var N=O._.tabs[M]&&O._.tabs[M][0];if(!N)return;N.show();O._.pageCount++;O.updateStyle();},getElement:function(){return this._.element;},getName:function(){return this._.name;},getContentElement:function(M,N){var O=this._.contents[M];return O&&O[N];},getValueOf:function(M,N){return this.getContentElement(M,N).getValue();},setValueOf:function(M,N,O){return this.getContentElement(M,N).setValue(O);},getButton:function(M){return this._.buttons[M];},click:function(M){return this._.buttons[M].click();},disableButton:function(M){return this._.buttons[M].disable();},enableButton:function(M){return this._.buttons[M].enable();},getPageCount:function(){return this._.pageCount;},getParentEditor:function(){return this._.editor;},getSelectedElement:function(){return this.getParentEditor().getSelection().getSelectedElement();},addFocusable:function(M,N){var P=this;if(typeof N=='undefined'){N=P._.focusList.length; -P._.focusList.push(new o(P,M,N));}else{P._.focusList.splice(N,0,new o(P,M,N));for(var O=N+1;OX.width-W.width-R)ac=X.width-W.width+S[1];else ac=O.x;if(O.y+S[0]X.height-W.height-R)ad=X.height-W.height+S[2];else ad=O.y;M.move(ac,ad);V.data.preventDefault();};function U(V){a.document.removeListener('mousemove',T);a.document.removeListener('mouseup',U);if(b.ie6Compat){var W=z.getChild(0).getFrameDocument();W.removeListener('mousemove',T);W.removeListener('mouseup',U);}};M.parts.title.on('mousedown',function(V){M._.updateSize=true;N={x:V.data.$.screenX,y:V.data.$.screenY};a.document.on('mousemove',T);a.document.on('mouseup',U);O=M.getPosition();if(b.ie6Compat){var W=z.getChild(0).getFrameDocument();W.on('mousemove',T);W.on('mouseup',U);}V.data.preventDefault();},M);};function w(M){var N=M.definition,O=N.minWidth||0,P=N.minHeight||0,Q=N.resizable,R=M.getParentEditor().skin.margins||[0,0,0,0];function S(ad,ae){ad.y+=ae;};function T(ad,ae){ad.x2+=ae;};function U(ad,ae){ad.y2+=ae;};function V(ad,ae){ad.x+=ae;};var W=null,X=null,Y=M._.editor.config.magnetDistance,Z=['tl','t','tr','l','r','bl','b','br'];function aa(ad){var ae=ad.listenerData.part,af=M.getSize();X=M.getPosition();e.extend(X,{x2:X.x+af.width,y2:X.y+af.height});W={x:ad.data.$.screenX,y:ad.data.$.screenY};a.document.on('mousemove',ab,M,{part:ae});a.document.on('mouseup',ac,M,{part:ae});if(b.ie6Compat){var ag=z.getChild(0).getFrameDocument();ag.on('mousemove',ab,M,{part:ae});ag.on('mouseup',ac,M,{part:ae});}ad.data.preventDefault();};function ab(ad){var ae=ad.data.$.screenX,af=ad.data.$.screenY,ag=ae-W.x,ah=af-W.y,ai=a.document.getWindow().getViewPaneSize(),aj=ad.listenerData.part;if(aj.search('t')!=-1)S(X,ah);if(aj.search('l')!=-1)V(X,ag);if(aj.search('b')!=-1)U(X,ah);if(aj.search('r')!=-1)T(X,ag);W={x:ae,y:af};var ak,al,am,an;if(X.x+R[3]ai.width-Y)am=ai.width+R[1];else if(aj.search('r')!=-1&&X.x2-X.xai.height-Y)an=ai.height+R[2];else if(aj.search('b')!=-1&&X.y2-X.y'];if(b.ie6Compat){var U=b.isCustomDomain(),V="";T.push('');}T.push('');S=h.createFromHtml(T.join(''));S.setOpacity(P!=undefined?P:0.5);S.appendTo(a.document.getBody());y[R]=S;}else S.show();z=S;var W=function(){var Z=N.getViewPaneSize();S.setStyles({width:Z.width+'px',height:Z.height+'px'});},X=function(){var Z=N.getScrollPosition(),aa=a.dialog._.currentTop;S.setStyles({left:Z.x+'px',top:Z.y+'px'});do{var ab=aa.getPosition();aa.move(ab.x,ab.y);}while(aa=aa._.parentDialog)};x=W;N.on('resize',W);W();if(b.ie6Compat){var Y=function(){X();arguments.callee.prevScrollHandler.apply(this,arguments);};N.$.setTimeout(function(){Y.prevScrollHandler=window.onscroll||(function(){});window.onscroll=Y;},0);X();}};function B(){if(!z)return;var M=a.document.getWindow();z.hide();M.removeListener('resize',x);if(b.ie6Compat)M.$.setTimeout(function(){var N=window.onscroll&&window.onscroll.prevScrollHandler;window.onscroll=N||null;},0);x=null;};function C(){for(var M in y)y[M].remove();y={};};var D={},E=function(M){var N=M.data.$.ctrlKey||M.data.$.metaKey,O=M.data.$.altKey,P=M.data.$.shiftKey,Q=String.fromCharCode(M.data.$.keyCode),R=D[(N?'CTRL+':'')+(O?'ALT+':'')+(P?'SHIFT+':'')+Q];if(!R||!R.length)return;R=R[R.length-1];R.keydown&&R.keydown.call(R.uiElement,R.dialog,R.key);M.data.preventDefault();},F=function(M){var N=M.data.$.ctrlKey||M.data.$.metaKey,O=M.data.$.altKey,P=M.data.$.shiftKey,Q=String.fromCharCode(M.data.$.keyCode),R=D[(N?'CTRL+':'')+(O?'ALT+':'')+(P?'SHIFT+':'')+Q]; -if(!R||!R.length)return;R=R[R.length-1];if(R.keyup){R.keyup.call(R.uiElement,R.dialog,R.key);M.data.preventDefault();}},G=function(M,N,O,P,Q){var R=D[O]||(D[O]=[]);R.push({uiElement:M,dialog:N,key:O,keyup:Q||M.accessKeyUp,keydown:P||M.accessKeyDown});},H=function(M){for(var N in D){var O=D[N];for(var P=O.length-1;P>=0;P--){if(O[P].dialog==M||O[P].uiElement==M)O.splice(P,1);}if(O.length===0)delete D[N];}},I=function(M,N){if(M._.accessKeyMap[N])M.selectPage(M._.accessKeyMap[N]);},J=function(M,N){},K={27:1,13:1},L=function(M){if(M.data.getKeystroke() in K)M.data.stopPropagation();};(function(){k.dialog={uiElement:function(M,N,O,P,Q,R,S){if(arguments.length<4)return;var T=(P.call?P(N):P)||'div',U=['<',T,' '],V=(Q&&Q.call?Q(N):Q)||{},W=(R&&R.call?R(N):R)||{},X=(S&&S.call?S.call(this,M,N):S)||'',Y=this.domId=W.id||e.getNextNumber()+'_uiElement',Z=this.id=N.id,aa;W.id=Y;var ab={};if(N.type)ab['cke_dialog_ui_'+N.type]=1;if(N.className)ab[N.className]=1;var ac=W['class']&&W['class'].split?W['class'].split(' '):[];for(aa=0;aa=0;aa--){if(ae[aa]==='')ae.splice(aa,1);}if(ae.length>0)W.style=(W.style?W.style+'; ':'')+ae.join('; ');for(aa in W)U.push(aa+'="'+e.htmlEncode(W[aa])+'" ');U.push('>',X,'');O.push(U.join(''));(this._||(this._={})).dialog=M;if(typeof N.isChanged=='boolean')this.isChanged=function(){return N.isChanged;};if(typeof N.isChanged=='function')this.isChanged=N.isChanged;a.event.implementOn(this);this.registerEvents(N);if(this.accessKeyUp&&this.accessKeyDown&&N.accessKey)G(this,M,'CTRL+'+N.accessKey);var af=this;M.on('load',function(){if(af.getInputElement())af.getInputElement().on('focus',function(){M._.tabBarMode=false;M._.hasFocus=true;af.fire('focus');},af);});if(this.keyboardFocusable){this.tabIndex=N.tabIndex||0;this.focusIndex=M._.focusList.push(this)-1;this.on('focus',function(){M._.currentFocusIndex=af.focusIndex;});}e.extend(this,N);},hbox:function(M,N,O,P,Q){if(arguments.length<4)return;this._||(this._={});var R=this._.children=N,S=Q&&Q.widths||null,T=Q&&Q.height||null,U={},V,W=function(){var Y=[''];for(V=0;V0)Y.push('style="'+aa.join('; ')+'" ');Y.push('>',O[V],'');}Y.push('');return Y.join('');},X={role:'presentation'};Q&&Q.align&&(X.align=Q.align);k.dialog.uiElement.call(this,M,Q||{type:'hbox'},P,'table',U,X,W);},vbox:function(M,N,O,P,Q){if(arguments.length<3)return;this._||(this._={});var R=this._.children=N,S=Q&&Q.width||null,T=Q&&Q.heights||null,U=function(){var V=['');for(var W=0;W');}V.push('
            0)V.push('style="',X.join('; '),'" ');V.push(' class="cke_dialog_ui_vbox_child">',O[W],'
            ');return V.join('');};k.dialog.uiElement.call(this,M,Q||{type:'vbox'},P,'div',null,{role:'presentation'},U);}};})();k.dialog.uiElement.prototype={getElement:function(){return a.document.getById(this.domId);},getInputElement:function(){return this.getElement();},getDialog:function(){return this._.dialog;},setValue:function(M){this.getInputElement().setValue(M);this.fire('change',{value:M});return this;},getValue:function(){return this.getInputElement().getValue();},isChanged:function(){return false;},selectParentTab:function(){var P=this;var M=P.getInputElement(),N=M,O;while((N=N.getParent())&&N.$.className.search('cke_dialog_page_contents')==-1){}if(!N)return P;O=N.getAttribute('name');if(P._.dialog._.currentTabId!=O)P._.dialog.selectPage(O);return P;},focus:function(){this.selectParentTab().getInputElement().focus();return this;},registerEvents:function(M){var N=/^on([A-Z]\w+)/,O,P=function(R,S,T,U){S.on('load',function(){R.getInputElement().on(T,U,R);});};for(var Q in M){if(!(O=Q.match(N)))continue;if(this.eventProcessors[Q])this.eventProcessors[Q].call(this,this._.dialog,M[Q]);else P(this,this._.dialog,O[1].toLowerCase(),M[Q]);}return this; -},eventProcessors:{onLoad:function(M,N){M.on('load',N,this);},onShow:function(M,N){M.on('show',N,this);},onHide:function(M,N){M.on('hide',N,this);}},accessKeyDown:function(M,N){this.focus();},accessKeyUp:function(M,N){},disable:function(){var M=this.getInputElement();M.setAttribute('disabled','true');M.addClass('cke_disabled');},enable:function(){var M=this.getInputElement();M.removeAttribute('disabled');M.removeClass('cke_disabled');},isEnabled:function(){return!this.getInputElement().getAttribute('disabled');},isVisible:function(){return this.getInputElement().isVisible();},isFocusable:function(){if(!this.isEnabled()||!this.isVisible())return false;return true;}};k.dialog.hbox.prototype=e.extend(new k.dialog.uiElement(),{getChild:function(M){var N=this;if(arguments.length<1)return N._.children.concat();if(!M.splice)M=[M];if(M.length<2)return N._.children[M[0]];else return N._.children[M[0]]&&N._.children[M[0]].getChild?N._.children[M[0]].getChild(M.slice(1,M.length)):null;}},true);k.dialog.vbox.prototype=new k.dialog.hbox();(function(){var M={build:function(N,O,P){var Q=O.children,R,S=[],T=[];for(var U=0;U',O.name,'');return P.join('');}};a.style.getStyleText=function(O){var P=O._ST;if(P)return P;P=O.styles;var Q=O.attributes&&O.attributes.style||'',R='';if(Q.length)Q=Q.replace(n,';');for(var S in P){var T=P[S],U=(S+':'+T).replace(n,';');if(T=='inherit')R+=U;else Q+=U;}if(Q.length)Q=K(Q);Q+=R;return O._ST=Q;};function o(O){var al=this;var P=O.document;if(O.collapsed){var Q=D(al,P);O.insertNode(Q);O.moveToPosition(Q,2);return;}var R=al.element,S=al._.definition,T,U=f[R]||(T=true,f.span),V=O.createBookmark();O.enlarge(1);O.trim();var W=O.createBookmark(),X=W.startNode,Y=W.endNode,Z=X,aa;while(Z){var ab=false;if(Z.equals(Y)){Z=null;ab=true;}else{var ac=Z.type,ad=ac==1?Z.getName():null;if(ad&&Z.getAttribute('_fck_bookmark')){Z=Z.getNextSourceNode(true);continue;}if(!ad||U[ad]&&(Z.getPosition(Y)|4|0|8)==4+0+8&&(!S.childRule||S.childRule(Z))){var ae=Z.getParent();if(ae&&((ae.getDtd()||f.span)[R]||T)&&(!S.parentRule||S.parentRule(ae))){if(!aa&&(!ad||!f.$removeEmpty[ad]||(Z.getPosition(Y)|4|0|8)==4+0+8)){aa=new d.range(P);aa.setStartBefore(Z);}if(ac==3||ac==1&&!Z.getChildCount()){var af=Z,ag;while(!af.$.nextSibling&&(ag=af.getParent(),U[ag.getName()])&&(ag.getPosition(X)|2|0|8)==2+0+8&&(!S.childRule||S.childRule(ag)))af=ag;aa.setEndAfter(af);if(!af.$.nextSibling)ab=true;}}else ab=true;}else ab=true;Z=Z.getNextSourceNode();}if(ab&&aa&&!aa.collapsed){var ah=D(al,P),ai=aa.getCommonAncestor(); -while(ah&&ai){if(ai.getName()==R){for(var aj in S.attributes){if(ah.getAttribute(aj)==ai.getAttribute(aj))ah.removeAttribute(aj);}for(var ak in S.styles){if(ah.getStyle(ak)==ai.getStyle(ak))ah.removeStyle(ak);}if(!ah.hasAttributes()){ah=null;break;}}ai=ai.getParent();}if(ah){aa.extractContents().appendTo(ah);A(al,ah);aa.insertNode(ah);ah.mergeSiblings();if(!c)ah.$.normalize();}aa=null;}}X.remove();Y.remove();O.moveToBookmark(V);O.shrink(2);};function p(O){O.enlarge(1);var P=O.createBookmark(),Q=P.startNode;if(O.collapsed){var R=new d.elementPath(Q.getParent()),S;for(var T=0,U;T'+Q+'';else O.setHtml(Q);P.remove();};function v(O){var P=/(\S\s*)\n(?:\s|(]+_fck_bookmark.*?\/span>))*\n(?!$)/gi,Q=O.getName(),R=w(O.getOuterHtml(),P,function(T,U,V){return U+''+V+'
            ';
            -}),S=[];R.replace(/([\s\S]*?)<\/pre>/gi,function(T,U){S.push(U);});return S;};function w(O,P,Q){var R='',S='';O=O.replace(/(^]+_fck_bookmark.*?\/span>)|(]+_fck_bookmark.*?\/span>$)/gi,function(T,U,V){U&&(R=U);V&&(S=V);return '';});return R+O.replace(P,Q)+S;};function x(O,P){var Q=new d.documentFragment(P.getDocument());for(var R=0;R');S=S.replace(/[ \t]{2,}/g,function(U){return e.repeat(' ',U.length-1)+' ';});var T=P.clone();T.setHtml(S);Q.append(T);}return Q;};function y(O,P){var Q=O.getHtml();Q=w(Q,/(?:^[ \t\n\r]+)|(?:[ \t\n\r]+$)/g,'');Q=Q.replace(/[ \t\r\n]*(]*>)[ \t\r\n]*/gi,'$1');Q=Q.replace(/([ \t\n\r]+| )/g,' ');Q=Q.replace(/]*>/gi,'\n');if(c){var R=O.getDocument().createElement('div');R.append(P);P.$.outerHTML='
            '+Q+'
            ';P=R.getFirst().remove();}else P.setHtml(Q);return P;};function z(O,P){var Q=O._.definition,R=e.extend({},Q.attributes,I(O)[P.getName()]),S=Q.styles,T=e.isEmpty(R)&&e.isEmpty(S);for(var U in R){if((U=='class'||O._.definition.fullMatch)&&P.getAttribute(U)!=J(U,R[U]))continue;T=P.hasAttribute(U);P.removeAttribute(U);}for(var V in S){if(O._.definition.fullMatch&&P.getStyle(V)!=J(V,S[V],true))continue;T=T||!!P.getStyle(V);P.removeStyle(V);}T&&C(P);};function A(O,P){var Q=O._.definition,R=Q.attributes,S=Q.styles,T=I(O),U=P.getElementsByTag(O.element);for(var V=U.count();--V>=0;)z(O,U.getItem(V));for(var W in T){if(W!=O.element){U=P.getElementsByTag(W);for(V=U.count()-1;V>=0;V--){var X=U.getItem(V);B(X,T[W]);}}}};function B(O,P){var Q=P&&P.attributes;if(Q)for(var R=0;R0)G+=(E.$.offsetWidth||0)-(E.$.clientWidth||0);G+=4;E.setStyle('width',G+'px');u.element.addClass('cke_frameLoaded');var H=u.element.$.scrollHeight;if(c&&b.quirks&&H>0)H+=(E.$.offsetHeight||0)-(E.$.clientHeight||0);E.setStyle('height',H+'px');t._.currentBlock.element.setStyle('display','none').removeStyle('display');}else E.removeStyle('height');var I=t.element,J=I.getWindow(),K=J.getScrollPosition(),L=J.getViewPaneSize(),M={height:I.$.offsetHeight,width:I.$.offsetWidth};if(z?A<0:A+M.width>L.width+K.x)A+=M.width*(z?1:-1);if(B+M.height>L.height+K.y)B-=M.height;v.setStyles({top:B+'px',left:A+'px'});v.setOpacity(1);},this);t.isLoaded?D():t.onLoad=D;e.setTimeout(function(){w.$.contentWindow.focus();this.allowBlur(true);},0,this);},0,this);this.visible=1;if(this.onShow)this.onShow.call(this);m=false;},hide:function(){var o=this;if(o.visible&&(!o.onHide||o.onHide.call(o)!==true)){o.hideChild();o.element.setStyle('display','none');o.visible=0;}},allowBlur:function(o){var p=this._.panel;if(o!=undefined)p.allowBlur=o;return p.allowBlur;},showAsChild:function(o,p,q,r,s,t){if(this._.activeChild==o&&o._.panel._.offsetParentId==q.getId())return;this.hideChild();o.onHide=e.bind(function(){e.setTimeout(function(){if(!this._.focused)this.hide();},0,this);},this);this._.activeChild=o;this._.focused=false;o.showBlock(p,q,r,s,t);if(b.ie7Compat||b.ie8&&b.ie6Compat)setTimeout(function(){o.element.getChild(0).$.style.cssText+='';},100);},hideChild:function(){var o=this._.activeChild;if(o){delete o.onHide;delete this._.activeChild; -o.hide();}}}});a.on('instanceDestroyed',function(){var o=e.isEmpty(a.instances);for(var p in l){var q=l[p];if(o)q.destroy();else q.element.hide();}o&&(l={});});})();j.add('menu',{beforeInit:function(l){var m=l.config.menu_groups.split(','),n=l._.menuGroups={},o=l._.menuItems={};for(var p=0;p'],y=q.length,z=y&&q[0].group;for(var A=0;A');z=B.group;}B.render(this,A,x);}x.push('');t.setHtml(x.join(''));if(this.parent)this.parent._.panel.showAsChild(s,this.id,m,n,o,p);else s.showBlock(this.id,m,n,o,p);r.fire('menuShow',[s]);},hide:function(){this._.panel&&this._.panel.hide();}}});function l(m){m.sort(function(n,o){if(n.groupo.group)return 1;return n.ordero.order?1:0;});};})();a.menuItem=e.createClass({$:function(l,m,n){var o=this;e.extend(o,n,{order:0,className:'cke_button_'+m});o.group=l._.menuGroups[o.group];o.editor=l;o.name=m;},proto:{render:function(l,m,n){var u=this;var o=l.id+String(m),p=typeof u.state=='undefined'?2:u.state,q=' cke_'+(p==1?'on':p==0?'disabled':'off'),r=u.label;if(u.className)q+=' '+u.className;var s=u.getItems;n.push(''+'');if(s)n.push('','&#',u.editor.lang.dir=='rtl'?'9668':'9658',';','');n.push(r,'');}}});i.menu_subMenuDelay=400;i.menu_groups='clipboard,form,tablecell,tablecellproperties,tablerow,tablecolumn,table,anchor,link,image,flash,checkbox,radio,textfield,hiddenfield,imagebutton,button,select,textarea,div';(function(){var l=function(n,o){return n._.modes&&n._.modes[o||n.mode];},m;j.add('editingblock',{init:function(n){if(!n.config.editingBlock)return; -n.on('themeSpace',function(o){if(o.data.space=='contents')o.data.html+='
            ';});n.on('themeLoaded',function(){n.fireOnce('editingBlockReady');});n.on('uiReady',function(){n.setMode(n.config.startupMode);});n.on('afterSetData',function(){if(!m){function o(){m=true;l(n).loadData(n.getData());m=false;};if(n.mode)o();else n.on('mode',function(){o();n.removeListener('mode',arguments.callee);});}});n.on('beforeGetData',function(){if(!m&&n.mode){m=true;n.setData(l(n).getData());m=false;}});n.on('getSnapshot',function(o){if(n.mode)o.data=l(n).getSnapshotData();});n.on('loadSnapshot',function(o){if(n.mode)l(n).loadSnapshotData(o.data);});n.on('mode',function(o){o.removeListener();b.webkit&&n.container.on('focus',function(){n.focus();});if(n.config.startupFocus)n.focus();setTimeout(function(){n.fireOnce('instanceReady');a.fire('instanceReady',null,n);});});}});a.editor.prototype.mode='';a.editor.prototype.addMode=function(n,o){o.name=n;(this._.modes||(this._.modes={}))[n]=o;};a.editor.prototype.setMode=function(n){var o,p=this.getThemeSpace('contents'),q=this.checkDirty();if(this.mode){if(n==this.mode)return;this.fire('beforeModeUnload');var r=l(this);o=r.getData();r.unload(p);this.mode='';}p.setHtml('');var s=l(this,n);if(!s)throw '[CKEDITOR.editor.setMode] Unknown mode "'+n+'".';if(!q)this.on('mode',function(){this.resetDirty();this.removeListener('mode',arguments.callee);});s.load(p,typeof o!='string'?this.getData():o);};a.editor.prototype.focus=function(){var n=l(this);if(n)n.focus();};})();i.startupMode='wysiwyg';i.startupFocus=false;i.editingBlock=true;(function(){function l(){var v=this;try{var s=v.getSelection();if(!s||!s.document.getWindow().$)return;var t=s.getStartElement(),u=new d.elementPath(t);if(!u.compare(v._.selectionPreviousPath)){v._.selectionPreviousPath=u;v.fire('selectionChange',{selection:s,path:u,element:t});}}catch(w){}};var m,n;function o(){n=true;if(m)return;p.call(this);m=e.setTimeout(p,200,this);};function p(){m=null;if(n){e.setTimeout(l,0,this);n=false;}};var q={modes:{wysiwyg:1,source:1},exec:function(s){switch(s.mode){case 'wysiwyg':s.document.$.execCommand('SelectAll',false,null);break;case 'source':var t=s.textarea.$;if(c)t.createTextRange().execCommand('SelectAll');else{t.selectionStart=0;t.selectionEnd=t.value.length;}t.focus();}},canUndo:false};j.add('selection',{init:function(s){s.on('contentDom',function(){var t=s.document,u=t.getBody(),v=t.getDocumentElement();if(c){var w,x,y=1;u.on('focusin',function(B){if(B.data.$.srcElement.nodeName!='BODY')return; -if(w){if(y)try{w.select();}catch(C){}w=null;}});u.on('focus',function(){x=true;A();});u.on('beforedeactivate',function(B){if(B.data.$.toElement)return;x=false;y=1;});if(c&&b.version<8)s.on('blur',function(B){s.document&&s.document.$.selection.empty();});v.on('mousedown',function(){y=0;});v.on('mouseup',function(){y=1;});if(c&&(b.ie7Compat||b.version<8||b.quirks))v.on('click',function(B){if(B.data.getTarget().getName()=='html')s.getSelection().getRanges()[0].select();});u.on('mousedown',function(){z();});u.on('mouseup',function(){x=true;setTimeout(function(){A(true);},0);});u.on('keydown',z);u.on('keyup',function(){x=true;A();});t.on('selectionchange',A);function z(){x=false;};function A(B){if(x){var C=s.document,D=s.getSelection(),E=D&&D.getNative();if(B&&E&&E.type=='None')if(!C.$.queryCommandEnabled('InsertImage')){e.setTimeout(A,50,this,true);return;}var F;if(E&&E.type&&E.type!='Control'&&(F=E.createRange())&&(F=F.parentElement())&&(F=F.nodeName)&&F.toLowerCase() in {input:1,textarea:1})return;w=E&&D.getRanges()[0];o.call(s);}};}else{t.on('mouseup',o,s);t.on('keyup',o,s);}});s.addCommand('selectAll',q);s.ui.addButton('SelectAll',{label:s.lang.selectAll,command:'selectAll'});s.selectionChange=o;}});a.editor.prototype.getSelection=function(){return this.document&&this.document.getSelection();};a.editor.prototype.forceNextSelectionCheck=function(){delete this._.selectionPreviousPath;};g.prototype.getSelection=function(){var s=new d.selection(this);return!s||s.isInvalid?null:s;};a.SELECTION_NONE=1;a.SELECTION_TEXT=2;a.SELECTION_ELEMENT=3;d.selection=function(s){var v=this;var t=s.getCustomData('cke_locked_selection');if(t)return t;v.document=s;v.isLocked=false;v._={cache:{}};if(c){var u=v.getNative().createRange();if(!u||u.item&&u.item(0).ownerDocument!=v.document.$||u.parentElement&&u.parentElement().ownerDocument!=v.document.$)v.isInvalid=true;}return v;};var r={img:1,hr:1,li:1,table:1,tr:1,td:1,th:1,embed:1,object:1,ol:1,ul:1,a:1,input:1,form:1,select:1,textarea:1,button:1,fieldset:1,th:1,thead:1,tfoot:1};d.selection.prototype={getNative:c?function(){return this._.cache.nativeSel||(this._.cache.nativeSel=this.document.$.selection);}:function(){return this._.cache.nativeSel||(this._.cache.nativeSel=this.document.getWindow().$.getSelection());},getType:c?function(){var s=this._.cache;if(s.type)return s.type;var t=1;try{var u=this.getNative(),v=u.type;if(v=='Text')t=2;if(v=='Control')t=3;if(u.createRange().parentElement)t=2;}catch(w){}return s.type=t;}:function(){var s=this._.cache; -if(s.type)return s.type;var t=2,u=this.getNative();if(!u)t=1;else if(u.rangeCount==1){var v=u.getRangeAt(0),w=v.startContainer;if(w==v.endContainer&&w.nodeType==1&&v.endOffset-v.startOffset==1&&r[w.childNodes[v.startOffset].nodeName.toLowerCase()])t=3;}return s.type=t;},getRanges:c?(function(){var s=function(t,u){t=t.duplicate();t.collapse(u);var v=t.parentElement(),w=v.childNodes,x;for(var y=0;y0)break;else if(!A||B==1&&A==-1)return{container:v,offset:y};else if(!B)return{container:v,offset:y+1};x=null;}}if(!x){x=t.duplicate();x.moveToElementText(v);x.collapse(false);}x.setEndPoint('StartToStart',t);var C=x.text.replace(/(\r\n|\r)/g,'\n').length;try{while(C>0)C-=w[--y].nodeValue.length;}catch(D){C=0;}if(C===0)return{container:v,offset:y};else return{container:w[y],offset:-C};};return function(){var E=this;var t=E._.cache;if(t.ranges)return t.ranges;var u=E.getNative(),v=u&&u.createRange(),w=E.getType(),x;if(!u)return[];if(w==2){x=new d.range(E.document);var y=s(v,true);x.setStart(new d.node(y.container),y.offset);y=s(v);x.setEnd(new d.node(y.container),y.offset);return t.ranges=[x];}else if(w==3){var z=E._.cache.ranges=[];for(var A=0;A=0){r.collapse(true);p.setEnd(r.endContainer.$,r.endOffset);}else throw s;}var q=r.document.getSelection().getNative();q.removeAllRanges();q.addRange(p);};})();(function(){var l={elements:{$:function(m){var n=m.attributes,o=n&&n._cke_realelement,p=o&&new a.htmlParser.fragment.fromHtml(decodeURIComponent(o)),q=p&&p.children[0];if(q&&m.attributes._cke_resizable){var r=m.attributes.style;if(r){var s=/(?:^|\s)width\s*:\s*(\d+)/i.exec(r),t=s&&s[1];s=/(?:^|\s)height\s*:\s*(\d+)/i.exec(r);var u=s&&s[1]; -if(t)q.attributes.width=t;if(u)q.attributes.height=u;}}return q;}}};j.add('fakeobjects',{requires:['htmlwriter'],afterInit:function(m){var n=m.dataProcessor,o=n&&n.htmlFilter;if(o)o.addRules(l);}});})();a.editor.prototype.createFakeElement=function(l,m,n,o){var p=this.lang.fakeobjects,q={'class':m,src:a.getUrl('images/spacer.gif'),_cke_realelement:encodeURIComponent(l.getOuterHtml()),_cke_real_node_type:l.type,alt:p[n]||p.unknown,align:l.getAttribute('align')||''};if(n)q._cke_real_element_type=n;if(o)q._cke_resizable=o;return this.document.createElement('img',{attributes:q});};a.editor.prototype.createFakeParserElement=function(l,m,n,o){var p=this.lang.fakeobjects,q,r=new a.htmlParser.basicWriter();l.writeHtml(r);q=r.getHtml();var s={'class':m,src:a.getUrl('images/spacer.gif'),_cke_realelement:encodeURIComponent(q),_cke_real_node_type:l.type,alt:p[n]||p.unknown,align:l.attributes.align||''};if(n)s._cke_real_element_type=n;if(o)s._cke_resizable=o;return new a.htmlParser.element('img',s);};a.editor.prototype.restoreRealElement=function(l){if(l.getAttribute('_cke_real_node_type')!=1)return null;return h.createFromHtml(decodeURIComponent(l.getAttribute('_cke_realelement')),this.document);};j.add('richcombo',{requires:['floatpanel','listblock','button'],beforeInit:function(l){l.ui.addHandler(3,k.richCombo.handler);}});a.UI_RICHCOMBO=3;k.richCombo=e.createClass({$:function(l){var n=this;e.extend(n,l,{title:l.label,modes:{wysiwyg:1}});var m=n.panel||{};delete n.panel;n.id=e.getNextNumber();n.document=m&&m.parent&&m.parent.getDocument()||a.document;m.className=(m.className||'')+' cke_rcombopanel';m.block={multiSelect:m.multiSelect,attributes:m.attributes};n._={panelDefinition:m,items:{},state:2};},statics:{handler:{create:function(l){return new k.richCombo(l);}}},proto:{renderHtml:function(l){var m=[];this.render(l,m);return m.join('');},render:function(l,m){var n=b,o='cke_'+this.id,p=e.addFunction(function(s){var v=this;var t=v._;if(t.state==0)return;v.createPanel(l);if(t.on){t.panel.hide();return;}if(!t.committed){t.list.commit();t.committed=1;}var u=v.getValue();if(u)t.list.mark(u);else t.list.unmarkAll();t.panel.showBlock(v.id,new h(s),4);},this),q={id:o,combo:this,focus:function(){var s=a.document.getById(o).getChild(1);s.focus();},clickFn:p};l.on('mode',function(){this.setState(this.modes[l.mode]?2:0);},this);var r=e.addFunction(function(s,t){s=new d.event(s);var u=s.getKeystroke();switch(u){case 13:case 32:case 40:e.callFunction(p,t);break;default:q.onkey(q,u); -}s.preventDefault();});q.keyDownFn=r;m.push('','','',this.label,'','=10900&&!n.hc?'':" href=\"javascript:void('"+this.label+"')\"",' role="button" aria-labelledby="',o,'_label" aria-describedby="',o,'_text" aria-haspopup="true"');if(b.opera||b.gecko&&b.mac)m.push(' onkeypress="return false;"');if(b.gecko)m.push(' onblur="this.style.cssText = this.style.cssText;"');m.push(' onkeydown="CKEDITOR.tools.callFunction( ',r,', event, this );" onclick="CKEDITOR.tools.callFunction(',p,', this); return false;">'+this.label+''+''+''+(b.hc?'':'')+''+''+''+'');if(this.onRender)this.onRender();return q;},createPanel:function(l){if(this._.panel)return;var m=this._.panelDefinition,n=this._.panelDefinition.block,o=m.parent||a.document.getBody(),p=new k.floatPanel(l,o,m),q=p.addListBlock(this.id,n),r=this;p.onShow=function(){if(r.className)this.element.getFirst().addClass(r.className+'_panel');r.setState(1);q.focus(!r.multiSelect&&r.getValue());r._.on=1;if(r.onOpen)r.onOpen();};p.onHide=function(){if(r.className)this.element.getFirst().removeClass(r.className+'_panel');r.setState(2);r._.on=0;if(r.onClose)r.onClose();};p.onEscape=function(){p.hide();r.document.getById('cke_'+r.id).getFirst().getNext().focus();};q.onClick=function(s,t){r.document.getWindow().focus();if(r.onClick)r.onClick.call(r,s,t);if(t)r.setValue(s,r._.items[s]);else r.setValue('');p.hide();};this._.panel=p;this._.list=q;p.getBlock(this.id).onHide=function(){r._.on=0;r.setState(2);};if(this.init)this.init();},setValue:function(l,m){var o=this;o._.value=l;var n=o.document.getById('cke_'+o.id+'_text');if(!(l||m)){m=o.label;n.addClass('cke_inline_label');}else n.removeClass('cke_inline_label');n.setHtml(typeof m!='undefined'?m:l);},getValue:function(){return this._.value||'';},unmarkAll:function(){this._.list.unmarkAll();},mark:function(l){this._.list.mark(l);},hideItem:function(l){this._.list.hideItem(l);},hideGroup:function(l){this._.list.hideGroup(l);},showAll:function(){this._.list.showAll();},add:function(l,m,n){this._.items[l]=n||l;this._.list.add(l,m,n);},startGroup:function(l){this._.list.startGroup(l);},commit:function(){this._.list.commit(); -},setState:function(l){var m=this;if(m._.state==l)return;m.document.getById('cke_'+m.id).setState(l);m._.state=l;}}});k.prototype.addRichCombo=function(l,m){this.add(l,3,m);};j.add('htmlwriter');a.htmlWriter=e.createClass({base:a.htmlParser.basicWriter,$:function(){var n=this;n.base();n.indentationChars='\t';n.selfClosingEnd=' />';n.lineBreakChars='\n';n.forceSimpleAmpersand=false;n.sortAttributes=true;n._.indent=false;n._.indentation='';n._.rules={};var l=f;for(var m in e.extend({},l.$nonBodyContent,l.$block,l.$listItem,l.$tableContent))n.setRules(m,{indent:true,breakBeforeOpen:true,breakAfterOpen:true,breakBeforeClose:!l[m]['#'],breakAfterClose:true});n.setRules('br',{breakAfterOpen:true});n.setRules('title',{indent:false,breakAfterOpen:false});n.setRules('style',{indent:false,breakBeforeClose:true});n.setRules('pre',{indent:false});},proto:{openTag:function(l,m){var o=this;var n=o._.rules[l];if(o._.indent)o.indentation();else if(n&&n.breakBeforeOpen){o.lineBreak();o.indentation();}o._.output.push('<',l);},openTagClose:function(l,m){var o=this;var n=o._.rules[l];if(m)o._.output.push(o.selfClosingEnd);else{o._.output.push('>');if(n&&n.indent)o._.indentation+=o.indentationChars;}if(n&&n.breakAfterOpen)o.lineBreak();},attribute:function(l,m){if(typeof m=='string'){this.forceSimpleAmpersand&&(m=m.replace(/&/g,'&'));m=e.htmlEncodeAttr(m);}this._.output.push(' ',l,'="',m,'"');},closeTag:function(l){var n=this;var m=n._.rules[l];if(m&&m.indent)n._.indentation=n._.indentation.substr(n.indentationChars.length);if(n._.indent)n.indentation();else if(m&&m.breakBeforeClose){n.lineBreak();n.indentation();}n._.output.push('');if(m&&m.breakAfterClose)n.lineBreak();},text:function(l){if(this._.indent){this.indentation();l=e.ltrim(l);}this._.output.push(l);},comment:function(l){if(this._.indent)this.indentation();this._.output.push('');},lineBreak:function(){var l=this;if(l._.output.length>0)l._.output.push(l.lineBreakChars);l._.indent=true;},indentation:function(){this._.output.push(this._.indentation);this._.indent=false;},setRules:function(l,m){var n=this._.rules[l];if(n)e.extend(n,m,true);else this._.rules[l]=m;}}});j.add('menubutton',{requires:['button','contextmenu'],beforeInit:function(l){l.ui.addHandler(5,k.menuButton.handler);}});a.UI_MENUBUTTON=5;(function(){var l=function(m){var n=this._;if(n.state===0)return;n.previousState=n.state;var o=n.menu;if(!o){o=n.menu=new j.contextMenu(m);o.definition.panel.attributes['aria-label']=m.lang.common.options; -o.onHide=e.bind(function(){this.setState(n.previousState);},this);if(this.onMenu)o.addListener(this.onMenu);}if(n.on){o.hide();return;}this.setState(1);o.show(a.document.getById(this._.id),4);};k.menuButton=e.createClass({base:k.button,$:function(m){var n=m.panel;delete m.panel;this.base(m);this.hasArrow=true;this.click=l;},statics:{handler:{create:function(m){return new k.menuButton(m);}}}});})();j.add('dialogui');(function(){var l=function(t){var w=this;w._||(w._={});w._['default']=w._.initValue=t['default']||'';w._.required=t.required||false;var u=[w._];for(var v=1;v',u.label,'','');else{var C={type:'hbox',widths:u.widths,padding:0,children:[{type:'html',html:'
            ';else O.setHtml(Q);P.remove();};function v(O){var P=/(\S\s*)\n(?:\s|(]+_fck_bookmark.*?\/span>))*\n(?!$)/gi,Q=O.getName(),R=w(O.getOuterHtml(),P,function(T,U,V){return U+''+V+'
            ';}),S=[];R.replace(/([\s\S]*?)<\/pre>/gi,function(T,U){S.push(U);});return S;};function w(O,P,Q){var R='',S='';O=O.replace(/(^]+_fck_bookmark.*?\/span>)|(]+_fck_bookmark.*?\/span>$)/gi,function(T,U,V){U&&(R=U);V&&(S=V);return '';});return R+O.replace(P,Q)+S;};function x(O,P){var Q=new d.documentFragment(P.getDocument());for(var R=0;R');S=S.replace(/[ \t]{2,}/g,function(U){return e.repeat(' ',U.length-1)+' ';});var T=P.clone();T.setHtml(S);Q.append(T);}return Q;};function y(O,P){var Q=O.getHtml();Q=w(Q,/(?:^[ \t\n\r]+)|(?:[ \t\n\r]+$)/g,'');Q=Q.replace(/[ \t\r\n]*(]*>)[ \t\r\n]*/gi,'$1');
            +Q=Q.replace(/([ \t\n\r]+| )/g,' ');Q=Q.replace(/]*>/gi,'\n');if(c){var R=O.getDocument().createElement('div');R.append(P);P.$.outerHTML='
            '+Q+'
            ';P=R.getFirst().remove();}else P.setHtml(Q);return P;};function z(O,P){var Q=O._.definition,R=e.extend({},Q.attributes,I(O)[P.getName()]),S=Q.styles,T=e.isEmpty(R)&&e.isEmpty(S);for(var U in R){if((U=='class'||O._.definition.fullMatch)&&P.getAttribute(U)!=J(U,R[U]))continue;T=P.hasAttribute(U);P.removeAttribute(U);}for(var V in S){if(O._.definition.fullMatch&&P.getStyle(V)!=J(V,S[V],true))continue;T=T||!!P.getStyle(V);P.removeStyle(V);}T&&C(P);};function A(O,P){var Q=O._.definition,R=Q.attributes,S=Q.styles,T=I(O),U=P.getElementsByTag(O.element);for(var V=U.count();--V>=0;)z(O,U.getItem(V));for(var W in T){if(W!=O.element){U=P.getElementsByTag(W);for(V=U.count()-1;V>=0;V--){var X=U.getItem(V);B(X,T[W]);}}}};function B(O,P){var Q=P&&P.attributes;if(Q)for(var R=0;R0)G+=(E.$.offsetWidth||0)-(E.$.clientWidth||0);G+=4;E.setStyle('width',G+'px');u.element.addClass('cke_frameLoaded');var H=u.element.$.scrollHeight;if(c&&b.quirks&&H>0)H+=(E.$.offsetHeight||0)-(E.$.clientHeight||0);E.setStyle('height',H+'px');t._.currentBlock.element.setStyle('display','none').removeStyle('display');}else E.removeStyle('height');var I=t.element,J=I.getWindow(),K=J.getScrollPosition(),L=J.getViewPaneSize(),M={height:I.$.offsetHeight,width:I.$.offsetWidth};if(z?A<0:A+M.width>L.width+K.x)A+=M.width*(z?1:-1);if(B+M.height>L.height+K.y)B-=M.height;v.setStyles({top:B+'px',left:A+'px'});v.setOpacity(1);},this);t.isLoaded?D():t.onLoad=D;e.setTimeout(function(){w.$.contentWindow.focus();this.allowBlur(true);},0,this);},0,this);this.visible=1;if(this.onShow)this.onShow.call(this);m=false;},hide:function(){var o=this;if(o.visible&&(!o.onHide||o.onHide.call(o)!==true)){o.hideChild();o.element.setStyle('display','none');o.visible=0;}},allowBlur:function(o){var p=this._.panel;if(o!=undefined)p.allowBlur=o;return p.allowBlur;},showAsChild:function(o,p,q,r,s,t){if(this._.activeChild==o&&o._.panel._.offsetParentId==q.getId())return;this.hideChild();o.onHide=e.bind(function(){e.setTimeout(function(){if(!this._.focused)this.hide();},0,this);},this);this._.activeChild=o;this._.focused=false;o.showBlock(p,q,r,s,t);if(b.ie7Compat||b.ie8&&b.ie6Compat)setTimeout(function(){o.element.getChild(0).$.style.cssText+='';},100);},hideChild:function(){var o=this._.activeChild;if(o){delete o.onHide;delete this._.activeChild;o.hide();}}}});a.on('instanceDestroyed',function(){var o=e.isEmpty(a.instances);for(var p in l){var q=l[p];if(o)q.destroy();else q.element.hide();}o&&(l={});});})();j.add('menu',{beforeInit:function(l){var m=l.config.menu_groups.split(','),n=l._.menuGroups={},o=l._.menuItems={};for(var p=0;p'],y=q.length,z=y&&q[0].group;for(var A=0;A');z=B.group;}B.render(this,A,x);}x.push('');t.setHtml(x.join(''));if(this.parent)this.parent._.panel.showAsChild(s,this.id,m,n,o,p);else s.showBlock(this.id,m,n,o,p);r.fire('menuShow',[s]);},hide:function(){this._.panel&&this._.panel.hide();}}});function l(m){m.sort(function(n,o){if(n.groupo.group)return 1;return n.ordero.order?1:0;});};})();a.menuItem=e.createClass({$:function(l,m,n){var o=this;e.extend(o,n,{order:0,className:'cke_button_'+m});o.group=l._.menuGroups[o.group];o.editor=l;o.name=m;},proto:{render:function(l,m,n){var u=this;var o=l.id+String(m),p=typeof u.state=='undefined'?2:u.state,q=' cke_'+(p==1?'on':p==0?'disabled':'off'),r=u.label;if(u.className)q+=' '+u.className;var s=u.getItems;n.push(''+'');if(s)n.push('','&#',u.editor.lang.dir=='rtl'?'9668':'9658',';','');n.push(r,'');}}});i.menu_subMenuDelay=400;i.menu_groups='clipboard,form,tablecell,tablecellproperties,tablerow,tablecolumn,table,anchor,link,image,flash,checkbox,radio,textfield,hiddenfield,imagebutton,button,select,textarea,div';(function(){var l=function(n,o){return n._.modes&&n._.modes[o||n.mode];},m;j.add('editingblock',{init:function(n){if(!n.config.editingBlock)return;n.on('themeSpace',function(o){if(o.data.space=='contents')o.data.html+='
            ';});n.on('themeLoaded',function(){n.fireOnce('editingBlockReady');});n.on('uiReady',function(){n.setMode(n.config.startupMode);});n.on('afterSetData',function(){if(!m){function o(){m=true;l(n).loadData(n.getData());m=false;};if(n.mode)o();else n.on('mode',function(){o();n.removeListener('mode',arguments.callee);});}});n.on('beforeGetData',function(){if(!m&&n.mode){m=true;n.setData(l(n).getData());m=false;}});n.on('getSnapshot',function(o){if(n.mode)o.data=l(n).getSnapshotData();});n.on('loadSnapshot',function(o){if(n.mode)l(n).loadSnapshotData(o.data);});n.on('mode',function(o){o.removeListener(); +b.webkit&&n.container.on('focus',function(){n.focus();});if(n.config.startupFocus)n.focus();setTimeout(function(){n.fireOnce('instanceReady');a.fire('instanceReady',null,n);});});}});a.editor.prototype.mode='';a.editor.prototype.addMode=function(n,o){o.name=n;(this._.modes||(this._.modes={}))[n]=o;};a.editor.prototype.setMode=function(n){var o,p=this.getThemeSpace('contents'),q=this.checkDirty();if(this.mode){if(n==this.mode)return;this.fire('beforeModeUnload');var r=l(this);o=r.getData();r.unload(p);this.mode='';}p.setHtml('');var s=l(this,n);if(!s)throw '[CKEDITOR.editor.setMode] Unknown mode "'+n+'".';if(!q)this.on('mode',function(){this.resetDirty();this.removeListener('mode',arguments.callee);});s.load(p,typeof o!='string'?this.getData():o);};a.editor.prototype.focus=function(){var n=l(this);if(n)n.focus();};})();i.startupMode='wysiwyg';i.startupFocus=false;i.editingBlock=true;(function(){function l(){var v=this;try{var s=v.getSelection();if(!s||!s.document.getWindow().$)return;var t=s.getStartElement(),u=new d.elementPath(t);if(!u.compare(v._.selectionPreviousPath)){v._.selectionPreviousPath=u;v.fire('selectionChange',{selection:s,path:u,element:t});}}catch(w){}};var m,n;function o(){n=true;if(m)return;p.call(this);m=e.setTimeout(p,200,this);};function p(){m=null;if(n){e.setTimeout(l,0,this);n=false;}};var q={modes:{wysiwyg:1,source:1},exec:function(s){switch(s.mode){case 'wysiwyg':s.document.$.execCommand('SelectAll',false,null);break;case 'source':var t=s.textarea.$;if(c)t.createTextRange().execCommand('SelectAll');else{t.selectionStart=0;t.selectionEnd=t.value.length;}t.focus();}},canUndo:false};j.add('selection',{init:function(s){s.on('contentDom',function(){var t=s.document,u=t.getBody(),v=t.getDocumentElement();if(c){var w,x,y=1;u.on('focusin',function(B){if(B.data.$.srcElement.nodeName!='BODY')return;if(w){if(y)try{w.select();}catch(C){}w=null;}});u.on('focus',function(){x=true;A();});u.on('beforedeactivate',function(B){if(B.data.$.toElement)return;x=false;y=1;});if(c&&b.version<8)s.on('blur',function(B){s.document&&s.document.$.selection.empty();});v.on('mousedown',function(){y=0;});v.on('mouseup',function(){y=1;});if(c&&(b.ie7Compat||b.version<8||b.quirks))v.on('click',function(B){if(B.data.getTarget().getName()=='html')s.getSelection().getRanges()[0].select();});u.on('mousedown',function(){z();});u.on('mouseup',function(){x=true;setTimeout(function(){A(true);},0);});u.on('keydown',z);u.on('keyup',function(){x=true;A();});t.on('selectionchange',A); +function z(){x=false;};function A(B){if(x){var C=s.document,D=s.getSelection(),E=D&&D.getNative();if(B&&E&&E.type=='None')if(!C.$.queryCommandEnabled('InsertImage')){e.setTimeout(A,50,this,true);return;}var F;if(E&&E.type&&E.type!='Control'&&(F=E.createRange())&&(F=F.parentElement())&&(F=F.nodeName)&&F.toLowerCase() in {input:1,textarea:1})return;w=E&&D.getRanges()[0];o.call(s);}};}else{t.on('mouseup',o,s);t.on('keyup',o,s);}});s.addCommand('selectAll',q);s.ui.addButton('SelectAll',{label:s.lang.selectAll,command:'selectAll'});s.selectionChange=o;}});a.editor.prototype.getSelection=function(){return this.document&&this.document.getSelection();};a.editor.prototype.forceNextSelectionCheck=function(){delete this._.selectionPreviousPath;};g.prototype.getSelection=function(){var s=new d.selection(this);return!s||s.isInvalid?null:s;};a.SELECTION_NONE=1;a.SELECTION_TEXT=2;a.SELECTION_ELEMENT=3;d.selection=function(s){var v=this;var t=s.getCustomData('cke_locked_selection');if(t)return t;v.document=s;v.isLocked=false;v._={cache:{}};if(c){var u=v.getNative().createRange();if(!u||u.item&&u.item(0).ownerDocument!=v.document.$||u.parentElement&&u.parentElement().ownerDocument!=v.document.$)v.isInvalid=true;}return v;};var r={img:1,hr:1,li:1,table:1,tr:1,td:1,th:1,embed:1,object:1,ol:1,ul:1,a:1,input:1,form:1,select:1,textarea:1,button:1,fieldset:1,th:1,thead:1,tfoot:1};d.selection.prototype={getNative:c?function(){return this._.cache.nativeSel||(this._.cache.nativeSel=this.document.$.selection);}:function(){return this._.cache.nativeSel||(this._.cache.nativeSel=this.document.getWindow().$.getSelection());},getType:c?function(){var s=this._.cache;if(s.type)return s.type;var t=1;try{var u=this.getNative(),v=u.type;if(v=='Text')t=2;if(v=='Control')t=3;if(u.createRange().parentElement)t=2;}catch(w){}return s.type=t;}:function(){var s=this._.cache;if(s.type)return s.type;var t=2,u=this.getNative();if(!u)t=1;else if(u.rangeCount==1){var v=u.getRangeAt(0),w=v.startContainer;if(w==v.endContainer&&w.nodeType==1&&v.endOffset-v.startOffset==1&&r[w.childNodes[v.startOffset].nodeName.toLowerCase()])t=3;}return s.type=t;},getRanges:(function(){var s=c?(function(){var t=function(u,v){u=u.duplicate();u.collapse(v);var w=u.parentElement(),x=w.childNodes,y;for(var z=0;z0)break;else if(!B||C==1&&B==-1)return{container:w,offset:z}; +else if(!C)return{container:w,offset:z+1};y=null;}}if(!y){y=u.duplicate();y.moveToElementText(w);y.collapse(false);}y.setEndPoint('StartToStart',u);var D=y.text.replace(/(\r\n|\r)/g,'\n').length;try{while(D>0)D-=x[--z].nodeValue.length;}catch(E){D=0;}if(D===0)return{container:w,offset:z};else return{container:x[z],offset:-D};};return function(){var E=this;var u=E.getNative(),v=u&&u.createRange(),w=E.getType(),x;if(!u)return[];if(w==2){x=new d.range(E.document);var y=t(v,true);x.setStart(new d.node(y.container),y.offset);y=t(v);x.setEnd(new d.node(y.container),y.offset);return[x];}else if(w==3){var z=[];for(var A=0;A=z.getLength())D.setStartAfter(z);else D.setStartBefore(z);if(A&&A.type==3)if(!C)D.setEndBefore(A);else D.setEndAfter(A);var F=new d.walker(D);F.evaluator=function(G){if(G.type==1&&G.getAttribute('contenteditable')=='false'){var H=x.clone();x.setEndBefore(G);if(x.collapsed)v.splice(w--,1);if(!(G.getPosition(D.endContainer)&16)){H.setStartAfter(G);if(!H.collapsed)v.splice(w+1,0,H);}return true;}return false;};F.next();}}return u.ranges;};})(),getStartElement:function(){var z=this;var s=z._.cache;if(s.startElement!==undefined)return s.startElement;var t,u=z.getNative();switch(z.getType()){case 3:return z.getSelectedElement();case 2:var v=z.getRanges()[0];if(v)if(!v.collapsed){v.optimize();for(;;){var w=v.startContainer,x=v.startOffset;if(x==(w.getChildCount?w.getChildCount():w.getLength())&&!w.isBlockBoundary())v.setStartAfter(w);else break;}t=v.startContainer;if(t.type!=1)return t.getParent();t=t.getChild(v.startOffset);if(!t||t.type!=1)return v.startContainer;var y=t.getFirst(); +while(y&&y.type==1){t=y;y=y.getFirst();}return t;}if(c){v=u.createRange();v.collapse(true);t=v.parentElement();}else{t=u.anchorNode;if(t&&t.nodeType!=1)t=t.parentNode;}}return s.startElement=t?new h(t):null;},getSelectedElement:function(){var s=this._.cache;if(s.selectedElement!==undefined)return s.selectedElement;var t=this,u=e.tryThese(function(){return t.getNative().createRange().item(0);},function(){var v=t.getRanges()[0],w,x;for(var y=2;y&&!((w=v.getEnclosedNode())&&w.type==1&&r[w.getName()]&&(x=w));y--)v.shrink(1);return x.$;});return s.selectedElement=u?new h(u):null;},lock:function(){var s=this;s.getRanges();s.getStartElement();s.getSelectedElement();s._.cache.nativeSel={};s.isLocked=true;s.document.setCustomData('cke_locked_selection',s);},unlock:function(s){var x=this;var t=x.document,u=t.getCustomData('cke_locked_selection');if(u){t.setCustomData('cke_locked_selection',null);if(s){var v=u.getSelectedElement(),w=!v&&u.getRanges();x.isLocked=false;x.reset();t.getBody().focus();if(v)x.selectElement(v);else x.selectRanges(w);}}if(!u||!s){x.isLocked=false;x.reset();}},reset:function(){this._.cache={};},selectElement:function(s){var v=this;if(v.isLocked){var t=new d.range(v.document);t.setStartBefore(s);t.setEndAfter(s);v._.cache.selectedElement=s;v._.cache.startElement=s;v._.cache.ranges=new d.rangeList(t);v._.cache.type=3;return;}if(c){v.getNative().empty();try{t=v.document.$.body.createControlRange();t.addElement(s.$);t.select();}catch(w){t=v.document.$.body.createTextRange();t.moveToElementText(s.$);t.select();}finally{v.document.fire('selectionchange');}v.reset();}else{t=v.document.$.createRange();t.selectNode(s.$);var u=v.getNative();u.removeAllRanges();u.addRange(t);v.reset();}},selectRanges:function(s){var C=this;if(C.isLocked){C._.cache.selectedElement=null;C._.cache.startElement=s[0]&&s[0].getTouchedStartNode();C._.cache.ranges=new d.rangeList(s);C._.cache.type=2;return;}if(c){if(s.length>1){var t=s[s.length-1];s[0].setEnd(t.endContainer,t.endOffset);s.length=1;}if(s[0])s[0].select();C.reset();}else{var u=C.getNative();if(s.length)u.removeAllRanges();for(var v=0;v=0){r.collapse(true);p.setEnd(r.endContainer.$,r.endOffset);}else throw s;}var q=r.document.getSelection().getNative();q.removeAllRanges();q.addRange(p);};})();(function(){var l={elements:{$:function(m){var n=m.attributes,o=n&&n._cke_realelement,p=o&&new a.htmlParser.fragment.fromHtml(decodeURIComponent(o)),q=p&&p.children[0];if(q&&m.attributes._cke_resizable){var r=m.attributes.style;if(r){var s=/(?:^|\s)width\s*:\s*(\d+)/i.exec(r),t=s&&s[1];s=/(?:^|\s)height\s*:\s*(\d+)/i.exec(r);var u=s&&s[1];if(t)q.attributes.width=t; +if(u)q.attributes.height=u;}}return q;}}};j.add('fakeobjects',{requires:['htmlwriter'],afterInit:function(m){var n=m.dataProcessor,o=n&&n.htmlFilter;if(o)o.addRules(l);}});})();a.editor.prototype.createFakeElement=function(l,m,n,o){var p=this.lang.fakeobjects,q={'class':m,src:a.getUrl('images/spacer.gif'),_cke_realelement:encodeURIComponent(l.getOuterHtml()),_cke_real_node_type:l.type,alt:p[n]||p.unknown,align:l.getAttribute('align')||''};if(n)q._cke_real_element_type=n;if(o)q._cke_resizable=o;return this.document.createElement('img',{attributes:q});};a.editor.prototype.createFakeParserElement=function(l,m,n,o){var p=this.lang.fakeobjects,q,r=new a.htmlParser.basicWriter();l.writeHtml(r);q=r.getHtml();var s={'class':m,src:a.getUrl('images/spacer.gif'),_cke_realelement:encodeURIComponent(q),_cke_real_node_type:l.type,alt:p[n]||p.unknown,align:l.attributes.align||''};if(n)s._cke_real_element_type=n;if(o)s._cke_resizable=o;return new a.htmlParser.element('img',s);};a.editor.prototype.restoreRealElement=function(l){if(l.getAttribute('_cke_real_node_type')!=1)return null;return h.createFromHtml(decodeURIComponent(l.getAttribute('_cke_realelement')),this.document);};j.add('richcombo',{requires:['floatpanel','listblock','button'],beforeInit:function(l){l.ui.addHandler(3,k.richCombo.handler);}});a.UI_RICHCOMBO=3;k.richCombo=e.createClass({$:function(l){var n=this;e.extend(n,l,{title:l.label,modes:{wysiwyg:1}});var m=n.panel||{};delete n.panel;n.id=e.getNextNumber();n.document=m&&m.parent&&m.parent.getDocument()||a.document;m.className=(m.className||'')+' cke_rcombopanel';m.block={multiSelect:m.multiSelect,attributes:m.attributes};n._={panelDefinition:m,items:{},state:2};},statics:{handler:{create:function(l){return new k.richCombo(l);}}},proto:{renderHtml:function(l){var m=[];this.render(l,m);return m.join('');},render:function(l,m){var n=b,o='cke_'+this.id,p=e.addFunction(function(s){var v=this;var t=v._;if(t.state==0)return;v.createPanel(l);if(t.on){t.panel.hide();return;}if(!t.committed){t.list.commit();t.committed=1;}var u=v.getValue();if(u)t.list.mark(u);else t.list.unmarkAll();t.panel.showBlock(v.id,new h(s),4);},this),q={id:o,combo:this,focus:function(){var s=a.document.getById(o).getChild(1);s.focus();},clickFn:p};l.on('mode',function(){this.setState(this.modes[l.mode]?2:0);},this);var r=e.addFunction(function(s,t){s=new d.event(s);var u=s.getKeystroke();switch(u){case 13:case 32:case 40:e.callFunction(p,t);break;default:q.onkey(q,u);}s.preventDefault();}); +q.keyDownFn=r;m.push('','','',this.label,'','=10900&&!n.hc?'':" href=\"javascript:void('"+this.label+"')\"",' role="button" aria-labelledby="',o,'_label" aria-describedby="',o,'_text" aria-haspopup="true"');if(b.opera||b.gecko&&b.mac)m.push(' onkeypress="return false;"');if(b.gecko)m.push(' onblur="this.style.cssText = this.style.cssText;"');m.push(' onkeydown="CKEDITOR.tools.callFunction( ',r,', event, this );" onclick="CKEDITOR.tools.callFunction(',p,', this); return false;">'+this.label+''+''+''+(b.hc?'':'')+''+''+''+'');if(this.onRender)this.onRender();return q;},createPanel:function(l){if(this._.panel)return;var m=this._.panelDefinition,n=this._.panelDefinition.block,o=m.parent||a.document.getBody(),p=new k.floatPanel(l,o,m),q=p.addListBlock(this.id,n),r=this;p.onShow=function(){if(r.className)this.element.getFirst().addClass(r.className+'_panel');r.setState(1);q.focus(!r.multiSelect&&r.getValue());r._.on=1;if(r.onOpen)r.onOpen();};p.onHide=function(){if(r.className)this.element.getFirst().removeClass(r.className+'_panel');r.setState(2);r._.on=0;if(r.onClose)r.onClose();};p.onEscape=function(){p.hide();r.document.getById('cke_'+r.id).getFirst().getNext().focus();};q.onClick=function(s,t){r.document.getWindow().focus();if(r.onClick)r.onClick.call(r,s,t);if(t)r.setValue(s,r._.items[s]);else r.setValue('');p.hide();};this._.panel=p;this._.list=q;p.getBlock(this.id).onHide=function(){r._.on=0;r.setState(2);};if(this.init)this.init();},setValue:function(l,m){var o=this;o._.value=l;var n=o.document.getById('cke_'+o.id+'_text');if(!(l||m)){m=o.label;n.addClass('cke_inline_label');}else n.removeClass('cke_inline_label');n.setHtml(typeof m!='undefined'?m:l);},getValue:function(){return this._.value||'';},unmarkAll:function(){this._.list.unmarkAll();},mark:function(l){this._.list.mark(l);},hideItem:function(l){this._.list.hideItem(l);},hideGroup:function(l){this._.list.hideGroup(l);},showAll:function(){this._.list.showAll();},add:function(l,m,n){this._.items[l]=n||l;this._.list.add(l,m,n);},startGroup:function(l){this._.list.startGroup(l);},commit:function(){this._.list.commit();},setState:function(l){var m=this; +if(m._.state==l)return;m.document.getById('cke_'+m.id).setState(l);m._.state=l;}}});k.prototype.addRichCombo=function(l,m){this.add(l,3,m);};j.add('htmlwriter');a.htmlWriter=e.createClass({base:a.htmlParser.basicWriter,$:function(){var n=this;n.base();n.indentationChars='\t';n.selfClosingEnd=' />';n.lineBreakChars='\n';n.forceSimpleAmpersand=false;n.sortAttributes=true;n._.indent=false;n._.indentation='';n._.rules={};var l=f;for(var m in e.extend({},l.$nonBodyContent,l.$block,l.$listItem,l.$tableContent))n.setRules(m,{indent:true,breakBeforeOpen:true,breakAfterOpen:true,breakBeforeClose:!l[m]['#'],breakAfterClose:true});n.setRules('br',{breakAfterOpen:true});n.setRules('title',{indent:false,breakAfterOpen:false});n.setRules('style',{indent:false,breakBeforeClose:true});n.setRules('pre',{indent:false});},proto:{openTag:function(l,m){var o=this;var n=o._.rules[l];if(o._.indent)o.indentation();else if(n&&n.breakBeforeOpen){o.lineBreak();o.indentation();}o._.output.push('<',l);},openTagClose:function(l,m){var o=this;var n=o._.rules[l];if(m)o._.output.push(o.selfClosingEnd);else{o._.output.push('>');if(n&&n.indent)o._.indentation+=o.indentationChars;}if(n&&n.breakAfterOpen)o.lineBreak();},attribute:function(l,m){if(typeof m=='string'){this.forceSimpleAmpersand&&(m=m.replace(/&/g,'&'));m=e.htmlEncodeAttr(m);}this._.output.push(' ',l,'="',m,'"');},closeTag:function(l){var n=this;var m=n._.rules[l];if(m&&m.indent)n._.indentation=n._.indentation.substr(n.indentationChars.length);if(n._.indent)n.indentation();else if(m&&m.breakBeforeClose){n.lineBreak();n.indentation();}n._.output.push('');if(m&&m.breakAfterClose)n.lineBreak();},text:function(l){if(this._.indent){this.indentation();l=e.ltrim(l);}this._.output.push(l);},comment:function(l){if(this._.indent)this.indentation();this._.output.push('');},lineBreak:function(){var l=this;if(l._.output.length>0)l._.output.push(l.lineBreakChars);l._.indent=true;},indentation:function(){this._.output.push(this._.indentation);this._.indent=false;},setRules:function(l,m){var n=this._.rules[l];if(n)e.extend(n,m,true);else this._.rules[l]=m;}}});j.add('menubutton',{requires:['button','contextmenu'],beforeInit:function(l){l.ui.addHandler(5,k.menuButton.handler);}});a.UI_MENUBUTTON=5;(function(){var l=function(m){var n=this._;if(n.state===0)return;n.previousState=n.state;var o=n.menu;if(!o){o=n.menu=new j.contextMenu(m);o.definition.panel.attributes['aria-label']=m.lang.common.options;o.onHide=e.bind(function(){this.setState(n.previousState); +},this);if(this.onMenu)o.addListener(this.onMenu);}if(n.on){o.hide();return;}this.setState(1);o.show(a.document.getById(this._.id),4);};k.menuButton=e.createClass({base:k.button,$:function(m){var n=m.panel;delete m.panel;this.base(m);this.hasArrow=true;this.click=l;},statics:{handler:{create:function(m){return new k.menuButton(m);}}}});})();j.add('dialogui');(function(){var l=function(t){var w=this;w._||(w._={});w._['default']=w._.initValue=t['default']||'';w._.required=t.required||false;var u=[w._];for(var v=1;v',u.label,'','');else{var C={type:'hbox',widths:u.widths,padding:0,children:[{type:'html',html:'
        ');delete this._.started;}},getClick:function(){if(!this._.click)this._.click=e.addFunction(function(l){var n=this;var m=true;if(n.multiSelect)m=n.toggle(l);else n.mark(l);if(n.onClick)n.onClick(l,m);},this);return this._.click;}},proto:{add:function(l,m,n){var q=this;var o=q._.pendingHtml,p='cke_'+e.getNextNumber();if(!q._.started){o.push('