From 8665a7c6c60586526e32e8941fe2896739b6ebfb Mon Sep 17 00:00:00 2001 From: Jason Woofenden Date: Thu, 4 Nov 2010 01:29:20 -0400 Subject: [PATCH] vanilla ckeditor-3.2.2 --- CHANGES.html | 82 +- _samples/asp/advanced.asp | 105 +++ _samples/asp/events.asp | 136 +++ _samples/asp/index.html | 103 +++ _samples/asp/replace.asp | 72 ++ _samples/asp/replaceall.asp | 77 ++ _samples/asp/sample_posteddata.asp | 46 + _samples/asp/standalone.asp | 72 ++ _samples/index.html | 1 + _samples/output_html.html | 259 ++++++ _source/core/ckeditor.js | 10 + _source/core/ckeditor_base.js | 8 +- _source/core/ckeditor_basic.js | 2 +- _source/core/config.js | 12 +- _source/core/dom/domobject.js | 5 + _source/core/dom/element.js | 77 +- _source/core/dom/range.js | 16 +- _source/core/env.js | 7 +- _source/core/htmlparser/filter.js | 40 +- _source/core/loader.js | 2 +- _source/core/tools.js | 19 +- _source/lang/_translationstatus.txt | 114 +-- _source/lang/af.js | 38 + _source/lang/ar.js | 40 +- _source/lang/bg.js | 38 + _source/lang/bn.js | 38 + _source/lang/bs.js | 38 + _source/lang/ca.js | 38 + _source/lang/cs.js | 38 + _source/lang/cy.js | 38 + _source/lang/da.js | 38 + _source/lang/de.js | 38 + _source/lang/el.js | 38 + _source/lang/en-au.js | 38 + _source/lang/en-ca.js | 38 + _source/lang/en-gb.js | 38 + _source/lang/en.js | 38 + _source/lang/eo.js | 38 + _source/lang/es.js | 38 + _source/lang/et.js | 38 + _source/lang/eu.js | 38 + _source/lang/fa.js | 38 + _source/lang/fi.js | 46 +- _source/lang/fo.js | 38 + _source/lang/fr-ca.js | 38 + _source/lang/fr.js | 38 + _source/lang/gl.js | 38 + _source/lang/gu.js | 38 + _source/lang/he.js | 92 +- _source/lang/hi.js | 38 + _source/lang/hr.js | 38 + _source/lang/hu.js | 38 + _source/lang/is.js | 38 + _source/lang/it.js | 38 + _source/lang/ja.js | 38 + _source/lang/km.js | 38 + _source/lang/ko.js | 38 + _source/lang/lt.js | 38 + _source/lang/lv.js | 38 + _source/lang/mn.js | 38 + _source/lang/ms.js | 38 + _source/lang/nb.js | 38 + _source/lang/nl.js | 92 +- _source/lang/no.js | 38 + _source/lang/pl.js | 38 + _source/lang/pt-br.js | 38 + _source/lang/pt.js | 38 + _source/lang/ro.js | 38 + _source/lang/ru.js | 38 + _source/lang/sk.js | 38 + _source/lang/sl.js | 38 + _source/lang/sr-latn.js | 38 + _source/lang/sr.js | 38 + _source/lang/sv.js | 38 + _source/lang/th.js | 38 + _source/lang/tr.js | 440 +++++---- _source/lang/uk.js | 38 + _source/lang/vi.js | 432 +++++---- _source/lang/zh-cn.js | 38 + _source/lang/zh.js | 38 + _source/plugins/a11yhelp/lang/he.js | 216 +++++ _source/plugins/a11yhelp/plugin.js | 2 +- _source/plugins/button/plugin.js | 9 +- _source/plugins/clipboard/dialogs/paste.js | 53 +- _source/plugins/clipboard/plugin.js | 52 +- _source/plugins/colorbutton/plugin.js | 3 +- _source/plugins/colordialog/dialogs/colordialog.js | 23 +- _source/plugins/contextmenu/plugin.js | 22 +- _source/plugins/dialog/plugin.js | 125 ++- _source/plugins/dialogui/plugin.js | 11 +- _source/plugins/elementspath/plugin.js | 5 +- _source/plugins/enterkey/plugin.js | 24 +- _source/plugins/fakeobjects/plugin.js | 6 +- _source/plugins/flash/dialogs/flash.js | 4 +- _source/plugins/format/plugin.js | 1 + _source/plugins/image/dialogs/image.js | 350 +++---- _source/plugins/indent/plugin.js | 8 + _source/plugins/link/dialogs/link.js | 10 +- _source/plugins/list/plugin.js | 15 +- _source/plugins/liststyle/dialogs/liststyle.js | 189 ++++ _source/plugins/liststyle/plugin.js | 59 ++ _source/plugins/maximize/plugin.js | 61 +- _source/plugins/pagebreak/plugin.js | 6 +- _source/plugins/pastefromword/plugin.js | 2 + _source/plugins/pastetext/dialogs/pastetext.js | 1 + _source/plugins/removeformat/plugin.js | 44 +- _source/plugins/resize/plugin.js | 49 +- _source/plugins/scayt/dialogs/options.js | 6 +- _source/plugins/scayt/plugin.js | 332 +++++-- _source/plugins/selection/plugin.js | 46 +- _source/plugins/smiley/dialogs/smiley.js | 10 +- _source/plugins/smiley/plugin.js | 4 +- _source/plugins/specialchar/dialogs/specialchar.js | 11 +- _source/plugins/styles/plugin.js | 93 +- _source/plugins/stylescombo/plugin.js | 1 + _source/plugins/table/dialogs/table.js | 5 + _source/plugins/tabletools/plugin.js | 64 +- _source/plugins/templates/dialogs/templates.js | 5 +- _source/plugins/uicolor/dialogs/uicolor.js | 9 +- _source/plugins/uicolor/yui/assets/yui.css | 2 +- _source/plugins/undo/plugin.js | 48 +- _source/plugins/wysiwygarea/plugin.js | 147 +-- _source/skins/kama/dialog.css | 14 +- _source/skins/kama/mainui.css | 12 + _source/skins/kama/templates.css | 26 +- _source/skins/kama/toolbar.css | 19 +- _source/skins/office2003/dialog.css | 8 +- _source/skins/office2003/mainui.css | 22 +- _source/skins/office2003/templates.css | 24 +- _source/skins/office2003/toolbar.css | 2 +- _source/skins/v2/dialog.css | 8 +- _source/skins/v2/mainui.css | 12 + _source/skins/v2/templates.css | 24 +- _source/skins/v2/toolbar.css | 1 + _source/themes/default/theme.js | 6 +- ckeditor.asp | 955 ++++++++++++++++++++ ckeditor.js | 235 ++--- 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/a11yhelp/lang/he.js | 6 + plugins/clipboard/dialogs/paste.js | 4 +- plugins/colordialog/dialogs/colordialog.js | 2 +- plugins/flash/dialogs/flash.js | 2 +- plugins/image/dialogs/image.js | 16 +- plugins/link/dialogs/link.js | 2 +- plugins/liststyle/dialogs/liststyle.js | 6 + plugins/liststyle/plugin.js | 6 + plugins/pastetext/dialogs/pastetext.js | 2 +- plugins/scayt/dialogs/options.js | 2 +- plugins/smiley/dialogs/smiley.js | 4 +- plugins/specialchar/dialogs/specialchar.js | 4 +- plugins/table/dialogs/table.js | 4 +- plugins/templates/dialogs/templates.js | 4 +- plugins/uicolor/dialogs/uicolor.js | 4 +- plugins/uicolor/yui/assets/yui.css | 2 +- skins/kama/dialog.css | 8 +- skins/kama/editor.css | 14 +- skins/kama/templates.css | 2 +- skins/office2003/dialog.css | 2 +- skins/office2003/editor.css | 6 +- skins/office2003/templates.css | 2 +- skins/v2/dialog.css | 2 +- skins/v2/editor.css | 14 +- skins/v2/templates.css | 2 +- themes/default/theme.js | 6 +- 227 files changed, 6787 insertions(+), 1477 deletions(-) create mode 100644 _samples/asp/advanced.asp create mode 100644 _samples/asp/events.asp create mode 100644 _samples/asp/index.html create mode 100644 _samples/asp/replace.asp create mode 100644 _samples/asp/replaceall.asp create mode 100644 _samples/asp/sample_posteddata.asp create mode 100644 _samples/asp/standalone.asp create mode 100644 _samples/output_html.html create mode 100644 _source/plugins/a11yhelp/lang/he.js create mode 100644 _source/plugins/liststyle/dialogs/liststyle.js create mode 100644 _source/plugins/liststyle/plugin.js create mode 100644 ckeditor.asp create mode 100644 plugins/a11yhelp/lang/he.js create mode 100644 plugins/liststyle/dialogs/liststyle.js create mode 100644 plugins/liststyle/plugin.js diff --git a/CHANGES.html b/CHANGES.html index 93a1af1..f65775a 100644 --- a/CHANGES.html +++ b/CHANGES.html @@ -35,6 +35,84 @@ For licensing, see LICENSE.html or http://ckeditor.com/license CKEditor Changelog

+ CKEditor 3.2.2

+

+ New features:

+ +

+ Fixed issues:

+ +

CKEditor 3.2.1

New features:

@@ -123,12 +201,12 @@ For licensing, see LICENSE.html or http://ckeditor.com/license
  • #5221 : Range is mangled when making collapsed selection in an empty paragraph.
  • #5261 : Config option 'scayt_autoStartup' slow down editor loading.
  • #3846 : Google Chrome - No Img properties after inserting.
  • -
  • #5465 : ShiftEnter=DIV doesn't respect list item when pressing enter at end of list item.
  • +
  • #5465 : ShiftEnter=DIV doesn't respect list item when pressing ENTER at end of list item.
  • #5454 : After replaced success, the popup window couldn't be closed and a js error occured.
  • #4784 : Incorrect cursor position after delete table cells.
  • #5149 : [FF] Cursor disappears after maximize when the editor has focus.
  • #5220 : DTD now shows tolerance to <style> appear inside content.
  • -
  • #5540 : Mobile browsers (iPhone, Android...) are marked as incompatible as they don't support editing features.
  • +
  • #5440 : Mobile browsers (iPhone, Android...) are marked as incompatible as they don't support editing features.
  • #5504 : [IE6/7] 'Paste' dialog will always get opened even when user allows the clipboard access dialog when using 'Paste' button.
  • Updated the following language files: '; return { title : editor.lang.flash.title, diff --git a/_source/plugins/format/plugin.js b/_source/plugins/format/plugin.js index 402672d..bb0d997 100644 --- a/_source/plugins/format/plugin.js +++ b/_source/plugins/format/plugin.js @@ -21,6 +21,7 @@ CKEDITOR.plugins.add( 'format', { var tag = tags[ i ]; styles[ tag ] = new CKEDITOR.style( config[ 'format_' + tag ] ); + styles[ tag ]._.enterMode = editor.config.enterMode; } editor.ui.addRichCombo( 'Format', diff --git a/_source/plugins/image/dialogs/image.js b/_source/plugins/image/dialogs/image.js index 3ba0dc1..4ebfd16 100644 --- a/_source/plugins/image/dialogs/image.js +++ b/_source/plugins/image/dialogs/image.js @@ -5,202 +5,207 @@ For licensing, see LICENSE.html or http://ckeditor.com/license (function() { - // Load image preview. - var IMAGE = 1, - LINK = 2, - PREVIEW = 4, - CLEANUP = 8, - regexGetSize = /^\s*(\d+)((px)|\%)?\s*$/i, - regexGetSizeOrEmpty = /(^\s*(\d+)((px)|\%)?\s*$)|^$/i, - pxLengthRegex = /^\d+px$/; - - var onSizeChange = function() + var imageDialog = function( editor, dialogType ) { - var value = this.getValue(), // This = input element. - dialog = this.getDialog(), - aMatch = value.match( regexGetSize ); // Check value - if ( aMatch ) + // Load image preview. + var IMAGE = 1, + LINK = 2, + PREVIEW = 4, + CLEANUP = 8, + regexGetSize = /^\s*(\d+)((px)|\%)?\s*$/i, + regexGetSizeOrEmpty = /(^\s*(\d+)((px)|\%)?\s*$)|^$/i, + pxLengthRegex = /^\d+px$/; + + var onSizeChange = function() { - if ( aMatch[2] == '%' ) // % is allowed - > unlock ratio. - switchLockRatio( dialog, false ); // Unlock. - value = aMatch[1]; - } + var value = this.getValue(), // This = input element. + dialog = this.getDialog(), + aMatch = value.match( regexGetSize ); // Check value + if ( aMatch ) + { + if ( aMatch[2] == '%' ) // % is allowed - > unlock ratio. + switchLockRatio( dialog, false ); // Unlock. + value = aMatch[1]; + } - // Only if ratio is locked - if ( dialog.lockRatio ) - { - var oImageOriginal = dialog.originalElement; - if ( oImageOriginal.getCustomData( 'isReady' ) == 'true' ) + // Only if ratio is locked + if ( dialog.lockRatio ) { - if ( this.id == 'txtHeight' ) - { - if ( value && value != '0' ) - value = Math.round( oImageOriginal.$.width * ( value / oImageOriginal.$.height ) ); - if ( !isNaN( value ) ) - dialog.setValueOf( 'info', 'txtWidth', value ); - } - else //this.id = txtWidth. + var oImageOriginal = dialog.originalElement; + if ( oImageOriginal.getCustomData( 'isReady' ) == 'true' ) { - if ( value && value != '0' ) - value = Math.round( oImageOriginal.$.height * ( value / oImageOriginal.$.width ) ); - if ( !isNaN( value ) ) - dialog.setValueOf( 'info', 'txtHeight', value ); + if ( this.id == 'txtHeight' ) + { + if ( value && value != '0' ) + value = Math.round( oImageOriginal.$.width * ( value / oImageOriginal.$.height ) ); + if ( !isNaN( value ) ) + dialog.setValueOf( 'info', 'txtWidth', value ); + } + else //this.id = txtWidth. + { + if ( value && value != '0' ) + value = Math.round( oImageOriginal.$.height * ( value / oImageOriginal.$.width ) ); + if ( !isNaN( value ) ) + dialog.setValueOf( 'info', 'txtHeight', value ); + } } } - } - updatePreview( dialog ); - }; - - var updatePreview = function( dialog ) - { - //Don't load before onShow. - if ( !dialog.originalElement || !dialog.preview ) - return 1; + updatePreview( dialog ); + }; - // Read attributes and update imagePreview; - dialog.commitContent( PREVIEW, dialog.preview ); - return 0; - }; + var updatePreview = function( dialog ) + { + //Don't load before onShow. + if ( !dialog.originalElement || !dialog.preview ) + return 1; - // Custom commit dialog logic, where we're intended to give inline style - // field (txtdlgGenStyle) higher priority to avoid overwriting styles contribute - // by other fields. - function commitContent() - { - var args = arguments; - var inlineStyleField = this.getContentElement( 'advanced', 'txtdlgGenStyle' ); - inlineStyleField && inlineStyleField.commit.apply( inlineStyleField, args ); + // Read attributes and update imagePreview; + dialog.commitContent( PREVIEW, dialog.preview ); + return 0; + }; - this.foreach( function( widget ) + // Custom commit dialog logic, where we're intended to give inline style + // field (txtdlgGenStyle) higher priority to avoid overwriting styles contribute + // by other fields. + function commitContent() { - if ( widget.commit && widget.id != 'txtdlgGenStyle' ) - widget.commit.apply( widget, args ); - }); - } - - // Avoid recursions. - var incommit; + var args = arguments; + var inlineStyleField = this.getContentElement( 'advanced', 'txtdlgGenStyle' ); + inlineStyleField && inlineStyleField.commit.apply( inlineStyleField, args ); - // Synchronous field values to other impacted fields is required, e.g. border - // size change should alter inline-style text as well. - function commitInternally( targetFields ) - { - if ( incommit ) - return; + this.foreach( function( widget ) + { + if ( widget.commit && widget.id != 'txtdlgGenStyle' ) + widget.commit.apply( widget, args ); + }); + } - incommit = 1; + // Avoid recursions. + var incommit; - var dialog = this.getDialog(), - element = dialog.imageElement; - if ( element ) + // Synchronous field values to other impacted fields is required, e.g. border + // size change should alter inline-style text as well. + function commitInternally( targetFields ) { - // Commit this field and broadcast to target fields. - this.commit( IMAGE, element ); + if ( incommit ) + return; + + incommit = 1; - targetFields = [].concat( targetFields ); - var length = targetFields.length, - field; - for ( var i = 0; i < length; i++ ) + var dialog = this.getDialog(), + element = dialog.imageElement; + if ( element ) { - field = dialog.getContentElement.apply( dialog, targetFields[ i ].split( ':' ) ); - // May cause recursion. - field && field.setup( IMAGE, element ); + // Commit this field and broadcast to target fields. + this.commit( IMAGE, element ); + + targetFields = [].concat( targetFields ); + var length = targetFields.length, + field; + for ( var i = 0; i < length; i++ ) + { + field = dialog.getContentElement.apply( dialog, targetFields[ i ].split( ':' ) ); + // May cause recursion. + field && field.setup( IMAGE, element ); + } } + + incommit = 0; } - incommit = 0; - } + var switchLockRatio = function( dialog, value ) + { + var oImageOriginal = dialog.originalElement; - var switchLockRatio = function( dialog, value ) - { - var oImageOriginal = dialog.originalElement, - ratioButton = CKEDITOR.document.getById( 'btnLockSizes' ); + // Dialog may already closed. (#5505) + if( !oImageOriginal ) + return null; - if ( oImageOriginal.getCustomData( 'isReady' ) == 'true' ) - { - if ( value == 'check' ) // Check image ratio and original image ratio. + var ratioButton = CKEDITOR.document.getById( btnLockSizesId ); + + if ( oImageOriginal.getCustomData( 'isReady' ) == 'true' ) { - var width = dialog.getValueOf( 'info', 'txtWidth' ), - height = dialog.getValueOf( 'info', 'txtHeight' ), - originalRatio = oImageOriginal.$.width * 1000 / oImageOriginal.$.height, - thisRatio = width * 1000 / height; - dialog.lockRatio = false; // Default: unlock ratio - - if ( !width && !height ) - dialog.lockRatio = true; - else if ( !isNaN( originalRatio ) && !isNaN( thisRatio ) ) + if ( value == 'check' ) // Check image ratio and original image ratio. { - if ( Math.round( originalRatio ) == Math.round( thisRatio ) ) + var width = dialog.getValueOf( 'info', 'txtWidth' ), + height = dialog.getValueOf( 'info', 'txtHeight' ), + originalRatio = oImageOriginal.$.width * 1000 / oImageOriginal.$.height, + thisRatio = width * 1000 / height; + dialog.lockRatio = false; // Default: unlock ratio + + if ( !width && !height ) dialog.lockRatio = true; + else if ( !isNaN( originalRatio ) && !isNaN( thisRatio ) ) + { + if ( Math.round( originalRatio ) == Math.round( thisRatio ) ) + dialog.lockRatio = true; + } } + else if ( value != undefined ) + dialog.lockRatio = value; + else + dialog.lockRatio = !dialog.lockRatio; } - else if ( value != undefined ) - dialog.lockRatio = value; - else - dialog.lockRatio = !dialog.lockRatio; - } - else if ( value != 'check' ) // I can't lock ratio if ratio is unknown. - dialog.lockRatio = false; + else if ( value != 'check' ) // I can't lock ratio if ratio is unknown. + dialog.lockRatio = false; - if ( dialog.lockRatio ) - ratioButton.removeClass( 'cke_btn_unlocked' ); - else - ratioButton.addClass( 'cke_btn_unlocked' ); + if ( dialog.lockRatio ) + ratioButton.removeClass( 'cke_btn_unlocked' ); + else + ratioButton.addClass( 'cke_btn_unlocked' ); - var lang = dialog._.editor.lang.image, - label = lang[ dialog.lockRatio ? 'unlockRatio' : 'lockRatio' ]; + var lang = dialog._.editor.lang.image, + label = lang[ dialog.lockRatio ? 'unlockRatio' : 'lockRatio' ]; - ratioButton.setAttribute( 'title', label ); - ratioButton.getFirst().setText( label ); + ratioButton.setAttribute( 'title', label ); + ratioButton.getFirst().setText( label ); - return dialog.lockRatio; - }; + return dialog.lockRatio; + }; - var resetSize = function( dialog ) - { - var oImageOriginal = dialog.originalElement; - if ( oImageOriginal.getCustomData( 'isReady' ) == 'true' ) + var resetSize = function( dialog ) { - dialog.setValueOf( 'info', 'txtWidth', oImageOriginal.$.width ); - dialog.setValueOf( 'info', 'txtHeight', oImageOriginal.$.height ); - } - updatePreview( dialog ); - }; - - var setupDimension = function( type, element ) - { - if ( type != IMAGE ) - return; + var oImageOriginal = dialog.originalElement; + if ( oImageOriginal.getCustomData( 'isReady' ) == 'true' ) + { + dialog.setValueOf( 'info', 'txtWidth', oImageOriginal.$.width ); + dialog.setValueOf( 'info', 'txtHeight', oImageOriginal.$.height ); + } + updatePreview( dialog ); + }; - function checkDimension( size, defaultValue ) + var setupDimension = function( type, element ) { - var aMatch = size.match( regexGetSize ); - if ( aMatch ) + if ( type != IMAGE ) + return; + + function checkDimension( size, defaultValue ) { - if ( aMatch[2] == '%' ) // % is allowed. + var aMatch = size.match( regexGetSize ); + if ( aMatch ) { - aMatch[1] += '%'; - switchLockRatio( dialog, false ); // Unlock ratio + if ( aMatch[2] == '%' ) // % is allowed. + { + aMatch[1] += '%'; + switchLockRatio( dialog, false ); // Unlock ratio + } + return aMatch[1]; } - return aMatch[1]; + return defaultValue; } - return defaultValue; - } - var dialog = this.getDialog(), - value = '', - dimension = (( this.id == 'txtWidth' )? 'width' : 'height' ), - size = element.getAttribute( dimension ); + var dialog = this.getDialog(), + value = '', + dimension = (( this.id == 'txtWidth' )? 'width' : 'height' ), + size = element.getAttribute( dimension ); - if ( size ) - value = checkDimension( size, value ); - value = checkDimension( element.getStyle( dimension ), value ); + if ( size ) + value = checkDimension( size, value ); + value = checkDimension( element.getStyle( dimension ), value ); - this.setValue( value ); - }; + this.setValue( value ); + }; - var imageDialog = function( editor, dialogType ) - { var previewPreloader; var onImgLoadEvent = function() @@ -213,7 +218,7 @@ For licensing, see LICENSE.html or http://ckeditor.com/license original.removeListener( 'abort', onImgLoadErrorEvent ); // Hide loader - CKEDITOR.document.getById( 'ImagePreviewLoader' ).setStyle( 'display', 'none' ); + CKEDITOR.document.getById( imagePreviewLoaderId ).setStyle( 'display', 'none' ); // New image -> new domensions if ( !this.dontResetSize ) @@ -241,9 +246,18 @@ For licensing, see LICENSE.html or http://ckeditor.com/license this.preview.setAttribute( 'src', noimage ); // Hide loader - CKEDITOR.document.getById( 'ImagePreviewLoader' ).setStyle( 'display', 'none' ); + CKEDITOR.document.getById( imagePreviewLoaderId ).setStyle( 'display', 'none' ); switchLockRatio( this, false ); // Unlock. }; + + var numbering = function( id ){ return id + CKEDITOR.tools.getNextNumber(); }, + btnLockSizesId = numbering( 'btnLockSizes' ), + btnResetSizeId = numbering( 'btnResetSize' ), + imagePreviewLoaderId = numbering( 'ImagePreviewLoader' ), + imagePreviewBoxId = numbering( 'ImagePreviewBox' ), + previewLinkId = numbering( 'previewLink' ), + previewImageId = numbering( 'previewImage' ); + return { title : ( dialogType == 'image' ) ? editor.lang.image.title : editor.lang.image.titleButton, minWidth : 420, @@ -268,10 +282,10 @@ For licensing, see LICENSE.html or http://ckeditor.com/license link = element && element.getAscendant( 'a' ); //Hide loader. - CKEDITOR.document.getById( 'ImagePreviewLoader' ).setStyle( 'display', 'none' ); + CKEDITOR.document.getById( imagePreviewLoaderId ).setStyle( 'display', 'none' ); // Create the preview before setup the dialog contents. previewPreloader = new CKEDITOR.dom.element( 'img', editor.document ); - this.preview = CKEDITOR.document.getById( 'previewImage' ); + this.preview = CKEDITOR.document.getById( previewImageId ); // Copy of the image this.originalElement = editor.document.createElement( 'img' ); @@ -432,8 +446,8 @@ For licensing, see LICENSE.html or http://ckeditor.com/license if ( dialogType != 'image' ) this.hidePage( 'Link' ); //Hide Link tab. var doc = this._.element.getDocument(); - this.addFocusable( doc.getById( 'btnResetSize' ), 5 ); - this.addFocusable( doc.getById( 'btnLockSizes' ), 5 ); + this.addFocusable( doc.getById( btnResetSizeId ), 5 ); + this.addFocusable( doc.getById( btnLockSizesId ), 5 ); this.commitContent = commitContent; }, @@ -491,7 +505,7 @@ For licensing, see LICENSE.html or http://ckeditor.com/license original.setCustomData( 'isReady', 'false' ); // Show loader - var loader = CKEDITOR.document.getById( 'ImagePreviewLoader' ); + var loader = CKEDITOR.document.getById( imagePreviewLoaderId ); if ( loader ) loader.setStyle( 'display', '' ); @@ -718,8 +732,8 @@ For licensing, see LICENSE.html or http://ckeditor.com/license onLoad : function() { // Activate Reset button - var resetButton = CKEDITOR.document.getById( 'btnResetSize' ), - ratioButton = CKEDITOR.document.getById( 'btnLockSizes' ); + var resetButton = CKEDITOR.document.getById( btnResetSizeId ), + ratioButton = CKEDITOR.document.getById( btnLockSizesId ); if ( resetButton ) { resetButton.on( 'click', function(evt) @@ -768,9 +782,9 @@ For licensing, see LICENSE.html or http://ckeditor.com/license }, html : '
    '+ '' + editor.lang.image.unlockRatio + '' + + '" class="cke_btn_locked" id="' + btnLockSizesId + '" role="button">' + editor.lang.image.unlockRatio + '' + '' + editor.lang.image.resetSize + ''+ + '" class="cke_btn_reset" id="' + btnResetSizeId + '" role="button">' + editor.lang.image.resetSize + ''+ '
    ' } ] @@ -1050,10 +1064,10 @@ For licensing, see LICENSE.html or http://ckeditor.com/license type : 'html', style : 'width:95%;', html : '
    ' + CKEDITOR.tools.htmlEncode( editor.lang.common.preview ) +'
    '+ - ''+ - '
    ']; -for(T=0;T0)W.push('style="'+Y.join('; ')+'" ');W.push('>',M[T],'');}W.push('');return W.join('');},V={role:'presentation'};O&&O.align&&(V.align=O.align);k.dialog.uiElement.call(this,K,O||{type:'hbox'},N,'table',S,V,U);},vbox:function(K,L,M,N,O){if(arguments.length<3)return;this._||(this._={});var P=this._.children=L,Q=O&&O.width||null,R=O&&O.heights||null,S=function(){var T=['
    '+ - ''+ - '' + + ''+ + '
    '+ + ''+ + '' + ( editor.config.image_previewText || 'Lorem ipsum dolor sit amet, consectetuer adipiscing elit. '+ 'Maecenas feugiat consequat diam. Maecenas metus. Vivamus diam purus, cursus a, commodo non, facilisis vitae, '+ diff --git a/_source/plugins/indent/plugin.js b/_source/plugins/indent/plugin.js index d61e6a6..d175e46 100644 --- a/_source/plugins/indent/plugin.js +++ b/_source/plugins/indent/plugin.js @@ -11,6 +11,9 @@ For licensing, see LICENSE.html or http://ckeditor.com/license { var listNodeNames = { ol : 1, ul : 1 }; + var isNotWhitespaces = CKEDITOR.dom.walker.whitespaces( true ), + isNotBookmark = CKEDITOR.dom.walker.bookmark( false, true ); + function setState( editor, state ) { editor.getCommand( this.name ).setState( state ); @@ -187,6 +190,11 @@ For licensing, see LICENSE.html or http://ckeditor.com/license 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 ); } diff --git a/_source/plugins/link/dialogs/link.js b/_source/plugins/link/dialogs/link.js index 4ac6766..57c483c 100644 --- a/_source/plugins/link/dialogs/link.js +++ b/_source/plugins/link/dialogs/link.js @@ -411,13 +411,13 @@ CKEDITOR.dialog.add( 'link', function( editor ) type : 'select', label : editor.lang.common.protocol, 'default' : 'http://', - style : 'width : 100%;', items : [ - [ 'http://' ], - [ 'https://' ], - [ 'ftp://' ], - [ 'news://' ], + // Force 'ltr' for protocol names in BIDI. (#5433) + [ 'http://\u200E', 'http://' ], + [ 'https://\u200E', 'https://' ], + [ 'ftp://\u200E', 'ftp://' ], + [ 'news://\u200E', 'news://' ], [ editor.lang.link.other , '' ] ], setup : function( data ) diff --git a/_source/plugins/list/plugin.js b/_source/plugins/list/plugin.js index 0a55231..be74702 100644 --- a/_source/plugins/list/plugin.js +++ b/_source/plugins/list/plugin.js @@ -234,6 +234,8 @@ For licensing, see LICENSE.html or http://ckeditor.com/license newList.listNode.replace( groupObj.root ); } + var headerTagRegex = /^h[1-6]$/; + function createList( editor, groupObj, listsCreated ) { var contents = groupObj.contents, @@ -285,8 +287,17 @@ For licensing, see LICENSE.html or http://ckeditor.com/license { var contentBlock = listContents.shift(), listItem = doc.createElement( 'li' ); - contentBlock.moveChildren( listItem ); - contentBlock.remove(); + + // Preserve heading structure when converting to list item. (#5271) + if ( headerTagRegex.test( contentBlock.getName() ) ) + contentBlock.appendTo( listItem ); + else + { + contentBlock.copyAttributes( listItem ); + contentBlock.moveChildren( listItem ); + contentBlock.remove(); + } + listItem.appendTo( listNode ); // Append a bogus BR to force the LI to render at full height diff --git a/_source/plugins/liststyle/dialogs/liststyle.js b/_source/plugins/liststyle/dialogs/liststyle.js new file mode 100644 index 0000000..b874d53 --- /dev/null +++ b/_source/plugins/liststyle/dialogs/liststyle.js @@ -0,0 +1,189 @@ +/* + * Copyright (c) 2003-2010, CKSource - Frederico Knabben. All rights reserved. + * For licensing, see LICENSE.html or http://ckeditor.com/license + */ + +(function() +{ + function getListElement( editor, listTag ) + { + var range; + try { range = editor.getSelection().getRanges()[ 0 ]; } + catch( e ) { return null; } + + range.shrink( CKEDITOR.SHRINK_TEXT ); + return range.getCommonAncestor().getAscendant( listTag, true ); + } + + var mapListStyle = { + 'a' : 'lower-alpha', + 'A' : 'upper-alpha', + 'i' : 'lower-roman', + 'I' : 'upper-roman', + '1' : 'decimal', + 'disc' : 'disc', + 'circle': 'circle', + 'square' : 'square' + }; + + function listStyle( editor, startupPage ) + { + if ( startupPage == 'bulletedListStyle' ) + { + return { + title : editor.lang.list.bulletedTitle, + minWidth : 300, + minHeight : 50, + contents : + [ + { + elements : + [ + { + type : 'select', + label : editor.lang.list.type, + id : 'type', + style : 'width: 150px; margin: auto;', + items : + [ + [ editor.lang.list.notset, '' ], + [ editor.lang.list.circle, 'circle' ], + [ editor.lang.list.disc, 'disc' ], + [ editor.lang.list.square, 'square' ] + ], + setup : function( element ) + { + var value = element.getStyle( 'list-style-type' ) + || mapListStyle[ element.getAttribute( 'type' ) ] + || element.getAttribute( 'type' ) + || ''; + + this.setValue( value ); + }, + commit : function( element ) + { + var value = this.getValue(); + if ( value ) + element.setStyle( 'list-style-type', value ); + else + element.removeStyle( 'list-style-type' ); + } + } + ] + } + ], + onShow: function() + { + var editor = this.getParentEditor(), + element = getListElement( editor, 'ul' ); + + element && this.setupContent( element ); + }, + onOk: function() + { + var editor = this.getParentEditor(), + element = getListElement( editor, 'ul' ); + + element && this.commitContent( element ); + } + }; + } + else if ( startupPage == 'numberedListStyle' ) + { + return { + title : editor.lang.list.numberedTitle, + minWidth : 300, + minHeight : 50, + contents : + [ + { + elements : + [ + { + type : 'hbox', + widths : [ '25%', '75%' ], + children : + [ + { + label : editor.lang.list.start, + type : 'text', + id : 'start', + setup : function( element ) + { + var value = element.getAttribute( 'start' ) || 1; + value && this.setValue( value ); + }, + commit : function( element ) + { + element.setAttribute( 'start', this.getValue() ); + } + }, + { + type : 'select', + label : editor.lang.list.type, + id : 'type', + style : 'width: 100%;', + items : + [ + [ editor.lang.list.notset, '' ], + [ editor.lang.list.armenian, 'armenian' ], + [ editor.lang.list.georgian, 'georgian' ], + [ editor.lang.list.lowerRoman, 'lower-roman' ], + [ editor.lang.list.upperRoman, 'upper-roman' ], + [ editor.lang.list.lowerAlpha, 'lower-alpha' ], + [ editor.lang.list.upperAlpha, 'upper-alpha' ], + [ editor.lang.list.lowerGreek, 'lower-greek' ], + [ editor.lang.list.decimal, 'decimal' ], + [ editor.lang.list.decimalLeadingZero, 'decimal-leading-zero' ] + ], + setup : function( element ) + { + var value = element.getStyle( 'list-style-type' ) + || mapListStyle[ element.getAttribute( 'type' ) ] + || element.getAttribute( 'type' ) + || ''; + + this.setValue( value ); + }, + commit : function( element ) + { + var value = this.getValue(); + if ( value ) + element.setStyle( 'list-style-type', value ); + else + element.removeStyle( 'list-style-type' ); + } + } + ] + } + ] + } + ], + onShow: function() + { + var editor = this.getParentEditor(), + element = getListElement( editor, 'ol' ); + + element && this.setupContent( element ); + }, + onOk: function() + { + var editor = this.getParentEditor(), + element = getListElement( editor, 'ol' ); + + element && this.commitContent( element ); + } + }; + } + } + + CKEDITOR.dialog.add( 'numberedListStyle', function( editor ) + { + return listStyle( editor, 'numberedListStyle' ); + }); + + CKEDITOR.dialog.add( 'bulletedListStyle', function( editor ) + { + return listStyle( editor, 'bulletedListStyle' ); + }); +})(); diff --git a/_source/plugins/liststyle/plugin.js b/_source/plugins/liststyle/plugin.js new file mode 100644 index 0000000..e63905f --- /dev/null +++ b/_source/plugins/liststyle/plugin.js @@ -0,0 +1,59 @@ +/* +Copyright (c) 2003-2010, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.html or http://ckeditor.com/license +*/ + +(function() +{ + CKEDITOR.plugins.liststyle = + { + init : function( editor ) + { + + editor.addCommand( 'numberedListStyle', new CKEDITOR.dialogCommand( 'numberedListStyle' ) ); + CKEDITOR.dialog.add( 'numberedListStyle', this.path + 'dialogs/liststyle.js' ); + editor.addCommand( 'bulletedListStyle', new CKEDITOR.dialogCommand( 'bulletedListStyle' ) ); + CKEDITOR.dialog.add( 'bulletedListStyle', this.path + 'dialogs/liststyle.js' ); + + //Register map group; + editor.addMenuGroup("list", 108); + // If the "menu" plugin is loaded, register the menu items. + if ( editor.addMenuItems ) + { + editor.addMenuItems( + { + numberedlist : + { + label : editor.lang.list.numberedTitle, + group : 'list', + command: 'numberedListStyle' + }, + bulletedlist : + { + label : editor.lang.list.bulletedTitle, + group : 'list', + command: 'bulletedListStyle' + } + }); + } + + // If the "contextmenu" plugin is loaded, register the listeners. + if ( editor.contextMenu ) + { + editor.contextMenu.addListener( function( element, selection ) + { + if ( !element ) + return null; + + if ( element.getAscendant( 'ol') ) + return { numberedlist: CKEDITOR.TRISTATE_OFF }; + + if ( element.getAscendant( 'ul' ) ) + return { bulletedlist: CKEDITOR.TRISTATE_OFF }; + }); + } + } + }; + + CKEDITOR.plugins.add( 'liststyle', CKEDITOR.plugins.liststyle ); +})(); diff --git a/_source/plugins/maximize/plugin.js b/_source/plugins/maximize/plugin.js index 2258c5a..a5a06fc 100644 --- a/_source/plugins/maximize/plugin.js +++ b/_source/plugins/maximize/plugin.js @@ -78,31 +78,37 @@ For licensing, see LICENSE.html or http://ckeditor.com/license restoreFormStyles( data ); } - function getResizeHandler( mainWindow, editor ) - { - return function() - { - var viewPaneSize = mainWindow.getViewPaneSize(); - editor.resize( viewPaneSize.width, viewPaneSize.height, null, true ); - }; - } - function refreshCursor( editor ) { if ( editor.focusManager.hasFocus ) { - var focusGrabber = editor.container.append( CKEDITOR.dom.element.createFromHtml( - '' ) ); - - focusGrabber.on( 'focus', function() - { - editor.focus(); - } ); - focusGrabber.focus(); - focusGrabber.remove(); + editor.toolbox.focus(); + editor.focus(); } } + /** + * Adding an iframe shim to this element, OR removing the existing one if already applied. + * Note: This will only affect IE version below 7. + */ + function createIframeShim( element ) + { + if ( !CKEDITOR.env.ie || CKEDITOR.env.version > 6 ) + return null; + + var shim = CKEDITOR.dom.element.createFromHtml( '' ); + return element.append( shim, true ); + } + CKEDITOR.plugins.add( 'maximize', { init : function( editor ) @@ -118,8 +124,15 @@ For licensing, see LICENSE.html or http://ckeditor.com/license // Saved scroll position for the outer window. var outerScroll; + var shim; + // Saved resize handler function. - var resizeHandler = getResizeHandler( mainWindow, editor ); + function resizeHandler() + { + var viewPaneSize = mainWindow.getViewPaneSize(); + shim && shim.setStyles( { width : viewPaneSize.width + 'px', height : viewPaneSize.height + 'px' } ); + editor.resize( viewPaneSize.width, viewPaneSize.height, null, true ); + } // Retain state after mode switches. var savedState = CKEDITOR.TRISTATE_OFF; @@ -196,7 +209,9 @@ For licensing, see LICENSE.html or http://ckeditor.com/license left : '0px', top : '0px' } ); - editor.resize( viewPaneSize.width, viewPaneSize.height, null, true ); + + shim = createIframeShim( container ); // IE6 select element penetration when maximized. (#4459) + resizeHandler(); // Still not top left? Fix it. (Bug #174) var offset = container.getDocumentPosition(); @@ -240,6 +255,12 @@ For licensing, see LICENSE.html or http://ckeditor.com/license // Remove cke_maximized class. container.removeClass( 'cke_maximized' ); + if ( shim ) + { + shim.remove(); + shim = null; + } + // Emit a resize event, because this time the size is modified in // restoreStyles. editor.fire( 'resize' ); diff --git a/_source/plugins/pagebreak/plugin.js b/_source/plugins/pagebreak/plugin.js index b73fbcf..3daef0c 100644 --- a/_source/plugins/pagebreak/plugin.js +++ b/_source/plugins/pagebreak/plugin.js @@ -32,7 +32,7 @@ CKEDITOR.plugins.add( 'pagebreak', 'clear: both;' + 'display: block;' + 'float: none;' + - 'width: 100%;' + + 'width:100%;_width:99.9%;' + 'border-top: #999999 1px dotted;' + 'border-bottom: #999999 1px dotted;' + 'height: 5px;' + @@ -84,6 +84,8 @@ CKEDITOR.plugins.pagebreakCmd = var ranges = editor.getSelection().getRanges(); + editor.fire( 'saveSnapshot' ); + for ( var range, i = 0 ; i < ranges.length ; i++ ) { range = ranges[ i ]; @@ -99,5 +101,7 @@ CKEDITOR.plugins.pagebreakCmd = range.select(); } } + + editor.fire( 'saveSnapshot' ); } }; diff --git a/_source/plugins/pastefromword/plugin.js b/_source/plugins/pastefromword/plugin.js index a5d3896..d50b3f0 100644 --- a/_source/plugins/pastefromword/plugin.js +++ b/_source/plugins/pastefromword/plugin.js @@ -35,6 +35,8 @@ For licensing, see LICENSE.html or http://ckeditor.com/license resetFromWord(); }); } + else + resetFromWord(); } }); diff --git a/_source/plugins/pastetext/dialogs/pastetext.js b/_source/plugins/pastetext/dialogs/pastetext.js index 9ff4f74..c63025f 100644 --- a/_source/plugins/pastetext/dialogs/pastetext.js +++ b/_source/plugins/pastetext/dialogs/pastetext.js @@ -52,6 +52,7 @@ For licensing, see LICENSE.html or http://ckeditor.com/license 'width:346px;' + 'height:170px;' + 'resize: none;' + + 'direction:' + editor.config.contentsLangDirection + ';' + 'border:1px solid black;' + 'background-color:white">' + '', diff --git a/_source/plugins/removeformat/plugin.js b/_source/plugins/removeformat/plugin.js index 97b858a..84d7947 100644 --- a/_source/plugins/removeformat/plugin.js +++ b/_source/plugins/removeformat/plugin.js @@ -15,6 +15,8 @@ CKEDITOR.plugins.add( 'removeformat', label : editor.lang.removeFormat, command : 'removeFormat' }); + + editor._.removeFormat = { filters: [] }; } }); @@ -32,6 +34,7 @@ CKEDITOR.plugins.removeformat = var removeAttributes = editor._.removeAttributes || ( editor._.removeAttributes = editor.config.removeFormatAttributes.split( ',' ) ); + var filter = CKEDITOR.plugins.removeformat.filter; var ranges = editor.getSelection().getRanges(); for ( var i = 0, range ; range = ranges[ i ] ; i++ ) @@ -70,7 +73,7 @@ CKEDITOR.plugins.removeformat = break; // If this element can be removed (even partially). - if ( tagsRegex.test( pathElement.getName() ) ) + if ( tagsRegex.test( pathElement.getName() ) && filter( editor, pathElement ) ) node.breakParent( pathElement ); } }; @@ -92,7 +95,9 @@ CKEDITOR.plugins.removeformat = var nextNode = currentNode.getNextSourceNode( false, CKEDITOR.NODE_ELEMENT ); // This node must not be a fake element. - if ( !( currentNode.getName() == 'img' && currentNode.getAttribute( '_cke_realelement' ) ) ) + if ( !( currentNode.getName() == 'img' + && currentNode.getAttribute( '_cke_realelement' ) ) + && filter( editor, currentNode ) ) { // Remove elements nodes that match with this style rules. if ( tagsRegex.test( currentNode.getName() ) ) @@ -110,10 +115,45 @@ CKEDITOR.plugins.removeformat = editor.getSelection().selectRanges( ranges ); } } + }, + + /** + * Perform the remove format filters on the passed element. + * @param {CKEDITOR.editor} editor + * @param {CKEDITOR.dom.element} element + */ + filter : function ( editor, element ) + { + var filters = editor._.removeFormat.filters; + for ( var i = 0; i < filters.length; i++ ) + { + if ( filters[ i ]( element ) === false ) + return false; + } + return true; } }; /** + * Add to a collection of functions to decide whether a specific + * element should be considered as formatting element and thus + * could be removed during removeFormat command, + * Note: Only available with the existence of 'removeformat' plugin. + * @since 3.3 + * @param {Function} func The function to be called, which will be passed a {CKEDITOR.dom.element} element to test. + * @example + * // Don't remove empty span + * editor.addRemoveFormatFilter.push( function( element ) + * { + * return !( element.is( 'span' ) && CKEDITOR.tools.isEmpty( element.getAttributes() ) ); + * }); + */ +CKEDITOR.editor.prototype.addRemoveFormatFilter = function( func ) +{ + this._.removeFormat.filters.push( func ); +}; + +/** * A comma separated list of elements to be removed when executing the "remove " format" command. Note that only inline elements are allowed. * @type String diff --git a/_source/plugins/resize/plugin.js b/_source/plugins/resize/plugin.js index 780f319..8c25035 100644 --- a/_source/plugins/resize/plugin.js +++ b/_source/plugins/resize/plugin.js @@ -11,18 +11,30 @@ CKEDITOR.plugins.add( 'resize', if ( config.resize_enabled ) { - var container = null; - var origin, startSize; + var container = null, + origin, + startSize, + resizeHorizontal = ( config.resize_dir == 'both' || config.resize_dir == 'horizontal' ) && + ( config.resize_minWidth != config.resize_maxWidth ), + resizeVertical = ( config.resize_dir == 'both' || config.resize_dir == 'vertical' ) && + ( config.resize_minHeight != config.resize_maxHeight ); function dragHandler( evt ) { - var dx = evt.data.$.screenX - origin.x; - var dy = evt.data.$.screenY - origin.y; - var internalWidth = startSize.width + dx * ( editor.lang.dir == 'rtl' ? -1 : 1 ); - var internalHeight = startSize.height + dy; + var dx = evt.data.$.screenX - origin.x, + dy = evt.data.$.screenY - origin.y, + width = startSize.width, + height = startSize.height, + internalWidth = width + dx * ( editor.lang.dir == 'rtl' ? -1 : 1 ), + internalHeight = height + dy; - editor.resize( Math.max( config.resize_minWidth, Math.min( internalWidth, config.resize_maxWidth ) ), - Math.max( config.resize_minHeight, Math.min( internalHeight, config.resize_maxHeight ) ) ); + if ( resizeHorizontal ) + width = Math.max( config.resize_minWidth, Math.min( internalWidth, config.resize_maxWidth ) ); + + if ( resizeVertical ) + height = Math.max( config.resize_minHeight, Math.min( internalHeight, config.resize_maxHeight ) ); + + editor.resize( width, height ); } function dragEndHandler ( evt ) @@ -61,7 +73,13 @@ CKEDITOR.plugins.add( 'resize', { if ( event.data.space == 'bottom' ) { - event.data.html += '
    '; @@ -108,10 +126,21 @@ CKEDITOR.config.resize_maxWidth = 3000; CKEDITOR.config.resize_maxHeight = 3000; /** - * Whether to enable the resizing feature. If disabed the resize handler will not be visible. + * Whether to enable the resizing feature. If disabled the resize handler will not be visible. * @type Boolean * @default true * @example * config.resize_enabled = false; */ CKEDITOR.config.resize_enabled = true; + +/** + * The directions to which the editor resizing is enabled. Possible values + * are "both", "vertical" and "horizontal". + * @type String + * @default 'both' + * @since 3.3 + * @example + * config.resize_dir = 'vertical'; + */ +CKEDITOR.config.resize_dir = 'both'; diff --git a/_source/plugins/scayt/dialogs/options.js b/_source/plugins/scayt/dialogs/options.js index c68b8cf..f745d82 100644 --- a/_source/plugins/scayt/dialogs/options.js +++ b/_source/plugins/scayt/dialogs/options.js @@ -243,9 +243,9 @@ CKEDITOR.dialog.add( 'scaytcheck', function( editor ) } } - var about = '

    ' + captions[ 'about_throwt_image' ] + '

    '+ - '

    ' + captions[ 'version' ] + dialog.data.scayt.version.toString() + '

    ' + - '

    ' + captions[ 'about_throwt_copy' ] + '

    '; + var about = '

    ' + + '

    ' + captions[ 'version' ] + window.scayt.getAboutInfo().version.toString() + '

    ' + + '

    ' + captions[ 'about_throwt_copy' ] + '

    '; doc.getById( 'scayt_about' ).setHtml( about ); diff --git a/_source/plugins/scayt/plugin.js b/_source/plugins/scayt/plugin.js index f64d25e..2076207 100644 --- a/_source/plugins/scayt/plugin.js +++ b/_source/plugins/scayt/plugin.js @@ -11,9 +11,7 @@ For licensing, see LICENSE.html or http://ckeditor.com/license (function() { var commandName = 'scaytcheck', - openPage = '', - scayt_paused = null, - scayt_control_id = null; + openPage = ''; // Checks if a value exists in an array function in_array(needle, haystack) @@ -47,9 +45,23 @@ For licensing, see LICENSE.html or http://ckeditor.com/license oParams.userDictionaryName = editor.config.scayt_userDictionaryName || ''; oParams.sLang = editor.config.scayt_sLang || 'en_US'; + // Introduce SCAYT onLoad callback. (#5632) + oParams.onLoad = function() + { + // Draw down word marker to avoid being covered by background-color style.(#5466) + if ( !( CKEDITOR.env.ie && CKEDITOR.env.version < 8 ) ) + this.addStyle( this.selectorCss(), 'padding-bottom: 2px !important;' ); + + // Call scayt_control.focus when SCAYT loaded + // and only if editor has focus and scayt control creates at first time (#5720) + if ( editor.focusManager.hasFocus && !plugin.isControlRestored( editor ) ) + this.focus(); + + }; + oParams.onBeforeChange = function() { - if ( !editor.checkDirty() ) + if ( plugin.getScayt( editor ) && !editor.checkDirty() ) setTimeout( function(){ editor.resetDirty(); } ); }; @@ -62,11 +74,16 @@ For licensing, see LICENSE.html or http://ckeditor.com/license } } // needs for restoring a specific scayt control settings - if ( scayt_control_id ) - oParams.id = scayt_control_id; + if ( plugin.getControlId(editor) ) + oParams.id = plugin.getControlId(editor); var scayt_control = new window.scayt( oParams ); + scayt_control.afterMarkupRemove.push( function( node ) + { + ( new CKEDITOR.dom.element( node, scayt_control.document ) ).mergeSiblings(); + } ); + // Copy config. var lastInstance = plugin.instances[ editor.name ]; if ( lastInstance ) @@ -88,7 +105,7 @@ For licensing, see LICENSE.html or http://ckeditor.com/license plugin.uiTabs = fTabs; try { - scayt_control.setDisabled( scayt_paused === false ); + scayt_control.setDisabled( plugin.isPaused( editor ) === false ); } catch (e) {} editor.fire( 'showScaytState' ); @@ -120,30 +137,51 @@ For licensing, see LICENSE.html or http://ckeditor.com/license var scayt_instance = plugin.getScayt( editor ); if ( scayt_instance ) { - scayt_paused = scayt_instance.paused = !scayt_instance.disabled; + plugin.setPaused( editor, !scayt_instance.disabled ); // store a control id for restore a specific scayt control settings - scayt_control_id = scayt_instance.id; + plugin.setControlId( editor, scayt_instance.id ); scayt_instance.destroy( true ); delete plugin.instances[ editor.name ]; } } + // Catch on source mode switch off (#5720) + else if ( ev.data.name == 'source' && editor.mode == 'source' ) + plugin.markControlRestore( editor ); + }); + + editor.on( 'afterCommandExec', function( ev ) + { + if ( !plugin.isScaytEnabled( editor ) ) + return; + + if ( editor.mode == 'wysiwyg' && ( ev.data.name == 'undo' || ev.data.name == 'redo' ) ) + window.setTimeout( function() { plugin.getScayt( editor ).refresh(); }, 10 ); }); editor.on( 'destroy', function( ev ) { var editor = ev.editor, scayt_instance = plugin.getScayt( editor ); + + // SCAYT instance might already get destroyed by mode switch (#5744). + if ( !scayt_instance ) + return; + + delete plugin.instances[ editor.name ]; // store a control id for restore a specific scayt control settings - scayt_control_id = scayt_instance.id; + plugin.setControlId( editor, scayt_instance.id ); scayt_instance.destroy( true ); - delete plugin.instances[ editor.name ]; }); // Listen to data manipulation to reflect scayt markup. editor.on( 'afterSetData', function() { if ( plugin.isScaytEnabled( editor ) ) { - window.setTimeout( function(){ plugin.getScayt( editor ).refresh(); }, 10 ); + window.setTimeout( function() + { + var instance = plugin.getScayt( editor ); + instance && instance.refresh(); + }, 10 ); } }); @@ -158,8 +196,12 @@ For licensing, see LICENSE.html or http://ckeditor.com/license if ( CKEDITOR.env.ie ) editor.getSelection().unlock( true ); - // Swallow any SCAYT engine errors. - window.setTimeout( function(){ scayt_instance.refresh(); }, 10 ); + // Return focus to the editor and refresh SCAYT markup (#5573). + window.setTimeout( function() + { + scayt_instance.focus(); + scayt_instance.refresh(); + }, 10 ); } }, this, null, 50 ); @@ -173,8 +215,13 @@ For licensing, see LICENSE.html or http://ckeditor.com/license if ( CKEDITOR.env.ie ) editor.getSelection().unlock( true ); - // Swallow any SCAYT engine errors. - window.setTimeout( function(){ scayt_instance.refresh(); },10 ); + // Return focus to the editor (#5573) + // Refresh SCAYT markup + window.setTimeout( function() + { + scayt_instance.focus(); + scayt_instance.refresh(); + }, 10 ); } }, this, null, 50 ); @@ -208,14 +255,92 @@ For licensing, see LICENSE.html or http://ckeditor.com/license ); } + // Override Image.equals method avoid CK snapshot module to add SCAYT markup to snapshots. (#5546) + var undoImagePrototype = CKEDITOR.plugins.undo.Image.prototype; + undoImagePrototype.equals = CKEDITOR.tools.override( undoImagePrototype.equals, function( org ) + { + return function( otherImage ) + { + var thisContents = this.contents, + otherContents = otherImage.contents; + var scayt_instance = plugin.getScayt( this.editor ); + // Making the comparison based on content without SCAYT word markers. + if ( scayt_instance && plugin.isScaytReady( this.editor ) ) + { + // scayt::reset might return value undefined. (#5742) + this.contents = scayt_instance.reset( thisContents ) || ''; + otherImage.contents = scayt_instance.reset( otherContents ) || ''; + } + + var retval = org.apply( this, arguments ); + + this.contents = thisContents; + otherImage.contents = otherContents; + return retval; + }; + }); + if ( editor.document ) createInstance(); }; - CKEDITOR.plugins.scayt = +CKEDITOR.plugins.scayt = { engineLoaded : false, instances : {}, + // Data storage for SCAYT control, based on editor instances + controlInfo : {}, + setControlInfo : function( editor, o ) + { + if ( editor && editor.name && typeof ( this.controlInfo[ editor.name ] ) != 'object' ) + this.controlInfo[ editor.name ] = {}; + + for ( var infoOpt in o ) + this.controlInfo[ editor.name ][ infoOpt ] = o[ infoOpt ]; + }, + isControlRestored : function ( editor ) + { + if ( editor && + editor.name && + this.controlInfo[ editor.name ] ) + { + return this.controlInfo[ editor.name ].restored ; + } + return false; + }, + markControlRestore : function ( editor ) + { + this.setControlInfo( editor,{ restored:true } ); + }, + setControlId: function (editor, id) + { + this.setControlInfo( editor,{ id:id } ); + }, + getControlId: function (editor) + { + if ( editor && + editor.name && + this.controlInfo[ editor.name ] && + this.controlInfo[ editor.name ].id ) + { + return this.controlInfo[ editor.name ].id; + } + return null; + }, + setPaused: function ( editor , bool ) + { + this.setControlInfo( editor,{ paused:bool } ); + }, + isPaused: function (editor) + { + if ( editor && + editor.name && + this.controlInfo[editor.name] ) + { + return this.controlInfo[editor.name].paused ; + } + return undefined; + }, getScayt : function( editor ) { return this.instances[ editor.name ]; @@ -234,7 +359,7 @@ For licensing, see LICENSE.html or http://ckeditor.com/license { // SCAYT doesn't work with Opera. if ( CKEDITOR.env.opera ) - return null; + return editor.fire( 'showScaytState' ); if ( this.engineLoaded === true ) return onEngineLoad.apply( editor ); // Add new instance. @@ -257,34 +382,39 @@ For licensing, see LICENSE.html or http://ckeditor.com/license var protocol = document.location.protocol; // Default to 'http' for unknown. protocol = protocol.search( /https?:/) != -1? protocol : 'http:'; - var baseUrl = 'svc.spellchecker.net/spellcheck31/lf/scayt/scayt22.js'; + var baseUrl = 'svc.spellchecker.net/spellcheck31/lf/scayt24/loader__base.js'; var scaytUrl = editor.config.scayt_srcUrl || ( protocol + '//' + baseUrl ); var scaytConfigBaseUrl = plugin.parseUrl( scaytUrl ).path + '/'; - CKEDITOR._djScaytConfig = + if( window.scayt == undefined ) { - baseUrl: scaytConfigBaseUrl, - addOnLoad: - [ - function() - { - CKEDITOR.fireOnce( 'scaytReady' ); - } - ], - isDebug: false - }; - // Append javascript code. - CKEDITOR.document.getHead().append( - CKEDITOR.document.createElement( 'script', - { - attributes : - { - type : 'text/javascript', - src : scaytUrl - } - }) - ); + CKEDITOR._djScaytConfig = + { + baseUrl: scaytConfigBaseUrl, + addOnLoad: + [ + function() + { + CKEDITOR.fireOnce( 'scaytReady' ); + } + ], + isDebug: false + }; + // Append javascript code. + CKEDITOR.document.getHead().append( + CKEDITOR.document.createElement( 'script', + { + attributes : + { + type : 'text/javascript', + src : scaytUrl + } + }) + ); + } + else + CKEDITOR.fireOnce( 'scaytReady' ); return null; }, @@ -322,6 +452,9 @@ For licensing, see LICENSE.html or http://ckeditor.com/license exec: function( editor ) { + var autoStartup = editor.config.scayt_autoStartup; + autoStartup = ( autoStartup == undefined ) || autoStartup; + if ( plugin.isScaytReady( editor ) ) { var isEnabled = plugin.isScaytEnabled( editor ); @@ -329,19 +462,18 @@ For licensing, see LICENSE.html or http://ckeditor.com/license this.setState( isEnabled ? CKEDITOR.TRISTATE_OFF : CKEDITOR.TRISTATE_ON ); var scayt_control = plugin.getScayt( editor ); + // the place where the status of editor focus should be restored + // after there will be ability to store its state before SCAYT button click + // if (storedFocusState is focused ) + // scayt_control.focus(); + // + // now focus is set certainly + scayt_control.focus( ); scayt_control.setDisabled( isEnabled ); } - else if ( !editor.config.scayt_autoStartup && plugin.engineLoaded >= 0 ) // Load first time + else if ( !autoStartup && plugin.engineLoaded >= 0 ) // Load first time { this.setState( CKEDITOR.TRISTATE_DISABLED ); - - editor.on( 'showScaytState', function() - { - this.removeListener(); - this.setState( plugin.isScaytEnabled( editor ) ? CKEDITOR.TRISTATE_ON : CKEDITOR.TRISTATE_OFF ); - }, - this); - plugin.loadEngine( editor ); } } @@ -354,8 +486,25 @@ For licensing, see LICENSE.html or http://ckeditor.com/license beforeInit : function( editor ) { - // Register own rbc menu group. - editor.config.menu_groups = 'scayt_suggest,scayt_moresuggest,scayt_control,' + editor.config.menu_groups; + var items_order = editor.config.scayt_contextMenuItemsOrder + || 'suggest|moresuggest|control', + items_order_str = ""; + + items_order = items_order.split( '|' ); + + if ( items_order && items_order.length ) + { + for ( var pos in items_order ) + items_order_str += 'scayt_' + items_order[ pos ] + ( items_order.length != parseInt( pos, 10 ) + 1 ? ',' : '' ); + } + + // Register scayt rbc menu group. + if ( editor.config.scayt_contextMenuOntop ) + // Put it on top of all context menu items + editor.config.menu_groups = items_order_str + ',' + editor.config.menu_groups; + else + // Put it down + editor.config.menu_groups = editor.config.menu_groups + ',' +items_order_str; }, init : function( editor ) @@ -448,7 +597,7 @@ For licensing, see LICENSE.html or http://ckeditor.com/license editor.ui.add( 'Scayt', CKEDITOR.UI_MENUBUTTON, { label : editor.lang.scayt.title, - title : editor.lang.scayt.title, + title : CKEDITOR.env.opera ? editor.lang.scayt.opera_title : editor.lang.scayt.title, className : 'cke_button_scayt', onRender: function() { @@ -607,15 +756,30 @@ For licensing, see LICENSE.html or http://ckeditor.com/license }); } - // Start plugin - if ( editor.config.scayt_autoStartup ) - { - var showInitialState = function() + var showInitialState = function() { editor.removeListener( 'showScaytState', showInitialState ); - command.setState( plugin.isScaytEnabled( editor ) ? CKEDITOR.TRISTATE_ON : CKEDITOR.TRISTATE_OFF ); + + if ( !CKEDITOR.env.opera ) + command.setState( plugin.isScaytEnabled( editor ) ? CKEDITOR.TRISTATE_ON : CKEDITOR.TRISTATE_OFF ); + else + command.setState( CKEDITOR.TRISTATE_DISABLED ); }; - editor.on( 'showScaytState', showInitialState ); + + editor.on( 'showScaytState', showInitialState ); + + if ( CKEDITOR.env.opera ) + { + editor.on( 'instanceReady', function() + { + showInitialState(); + }); + } + + // Start plugin + var autoStartup = editor.config.scayt_autoStartup; + if ( ( autoStartup == undefined ) || autoStartup ) + { editor.on( 'instanceReady', function() { plugin.loadEngine( editor ); @@ -625,16 +789,18 @@ For licensing, see LICENSE.html or http://ckeditor.com/license afterInit : function( editor ) { - // Prevent word marker line from displaying in elements path. (#3570) - var elementsPathFilters; + // Prevent word marker line from displaying in elements path and been removed when cleaning format. (#3570) (#4125) + var elementsPathFilters, + scaytFilter = function( element ) + { + if ( element.hasAttribute( 'scaytid' ) ) + return false; + }; + if ( editor._.elementsPath && ( elementsPathFilters = editor._.elementsPath.filters ) ) - { - elementsPathFilters.push( function( element ) - { - if ( element.hasAttribute( 'scaytid' ) ) - return false; - } ); - } + elementsPathFilters.push( scaytFilter ); + + editor.addRemoveFormatFilter && editor.addRemoveFormatFilter( scaytFilter ); } }); @@ -644,9 +810,9 @@ For licensing, see LICENSE.html or http://ckeditor.com/license * If enabled (true), turns on SCAYT automatically after loading the editor. * @name CKEDITOR.config.scayt_autoStartup * @type Boolean - * @default false + * @default true * @example - * config.scayt_autoStartup = true; + * config.scayt_autoStartup = false; */ /** @@ -765,3 +931,29 @@ For licensing, see LICENSE.html or http://ckeditor.com/license * @example * config.scayt_userDictionaryName = 'MyDictionary'; */ + +/** + * Makes it possible to place the SCAYT context menu items above others. + * @name CKEDITOR.config.scayt_contextMenuOntop + * @type Boolean + * @default false + * @example + * config.scayt_contextMenuOntop = true; + */ + +/** + * Define order of placing of SCAYT context menu items by groups. + * It must be a string with one or more of the following + * words separated by a pipe ("|"): + *
      + *
    • 'suggest' - main suggestion word list,
    • + *
    • 'moresuggest' - more suggestions word list,
    • + *
    • 'control' - SCAYT commands, such as 'Ignore' and 'Add Word'
    • + *
    + * + * @name CKEDITOR.config.scayt_contextMenuItemsOrder + * @type String + * @default 'suggest|moresuggest|control' + * @example + * config.scayt_contextMenuItemsOrder = 'moresuggest|control|suggest'; + */ diff --git a/_source/plugins/selection/plugin.js b/_source/plugins/selection/plugin.js index 9a85a84..04be631 100644 --- a/_source/plugins/selection/plugin.js +++ b/_source/plugins/selection/plugin.js @@ -209,7 +209,8 @@ For licensing, see LICENSE.html or http://ckeditor.com/license if ( saveEnabled ) { var doc = editor.document, - sel = doc && doc.$.selection; + sel = editor.getSelection(), + nativeSel = sel && sel.getNative(); // There is a very specific case, when clicking // inside a text selection. In that case, the @@ -219,7 +220,7 @@ For licensing, see LICENSE.html or http://ckeditor.com/license // range at the very start of the document. In // such situation we have to test the range, to // be sure it's valid. - if ( testIt && sel && sel.type == 'None' ) + if ( testIt && nativeSel && nativeSel.type == 'None' ) { // The "InsertImage" command can be used to // test whether the selection is good or not. @@ -232,7 +233,16 @@ For licensing, see LICENSE.html or http://ckeditor.com/license } } - savedRange = sel && sel.createRange(); + // Avoid saving selection from within text input. (#5747) + var parentTag; + if ( nativeSel.type == 'Text' + && ( parentTag = nativeSel.createRange().parentElement().nodeName.toLowerCase() ) + && parentTag in { input: 1, textarea : 1 } ) + { + return; + } + + savedRange = nativeSel && sel.getRanges()[ 0 ]; checkSelectionChangeTimeout.call( editor ); } @@ -752,16 +762,21 @@ For licensing, see LICENSE.html or http://ckeditor.com/license // node of the range. function() { - var range = self.getRanges()[ 0 ]; - range.shrink( CKEDITOR.SHRINK_ELEMENT ); - - var enclosed; - if ( range.startContainer.equals( range.endContainer ) - && ( range.endOffset - range.startOffset ) == 1 - && styleObjectElements[ ( enclosed = range.startContainer.getChild( range.startOffset ) ).getName() ] ) + var range = self.getRanges()[ 0 ], + enclosed, + selected; + + // Check first any enclosed element, e.g. + for ( var i = 2; i && !( ( enclosed = range.getEnclosedNode() ) + && ( enclosed.type == CKEDITOR.NODE_ELEMENT ) + && styleObjectElements[ enclosed.getName() ] + && ( selected = enclosed ) ); i-- ) { - return enclosed.$; + // Then check any deep wrapped element, e.g. [] + range.shrink( CKEDITOR.SHRINK_ELEMENT ); } + + return selected.$; }); return cache.selectedElement = ( node ? new CKEDITOR.dom.element( node ) : null ); @@ -1009,6 +1024,7 @@ For licensing, see LICENSE.html or http://ckeditor.com/license { var notWhitespaces = CKEDITOR.dom.walker.whitespaces( true ); var fillerTextRegex = /\ufeff|\u00a0/; +var nonCells = { table:1,tbody:1,tr:1 }; CKEDITOR.dom.range.prototype.select = CKEDITOR.env.ie ? @@ -1019,6 +1035,14 @@ CKEDITOR.dom.range.prototype.select = var isStartMarkerAlone; var dummySpan; + // IE doesn't support selecting the entire table row/cell, move the selection into cells, e.g. + // [... =>
    cell
    ... + if ( this.startContainer.type == CKEDITOR.NODE_ELEMENT && this.startContainer.getName() in nonCells + || this.endContainer.type == CKEDITOR.NODE_ELEMENT && this.endContainer.getName() in nonCells ) + { + this.shrink( CKEDITOR.NODE_ELEMENT, true ); + } + var bookmark = this.createBookmark(); // Create marker tags for the start and end boundaries. diff --git a/_source/plugins/smiley/dialogs/smiley.js b/_source/plugins/smiley/dialogs/smiley.js index 1fae121..e13439b 100644 --- a/_source/plugins/smiley/dialogs/smiley.js +++ b/_source/plugins/smiley/dialogs/smiley.js @@ -133,11 +133,12 @@ CKEDITOR.dialog.add( 'smiley', function( editor ) }); // Build the HTML for the smiley images table. + var labelId = 'smiley_emtions_label' + CKEDITOR.tools.getNextNumber(); var html = [ '
    ' + - '' + lang.options +'', - '
    [cell
    ' + lang.options +'', + '
    ' ]; @@ -148,12 +149,13 @@ CKEDITOR.dialog.add( 'smiley', function( editor ) if ( i % columns === 0 ) html.push( '' ); + var smileyLabelId = 'cke_smile_label_' + i + '_' + CKEDITOR.tools.getNextNumber(); html.push( '' ); diff --git a/_source/plugins/smiley/plugin.js b/_source/plugins/smiley/plugin.js index d4ecda6..4d509ae 100644 --- a/_source/plugins/smiley/plugin.js +++ b/_source/plugins/smiley/plugin.js @@ -64,7 +64,7 @@ CKEDITOR.config.smiley_images = [ * config.smiley_descriptions = * [ * 'smiley', 'sad', 'wink', 'laugh', 'frown', 'cheeky', 'blush', 'surprise', - * 'indecision', 'angry', 'angle', 'cool', 'devil', 'crying', 'enlightened', 'no', + * 'indecision', 'angry', 'angel', 'cool', 'devil', 'crying', 'enlightened', 'no', * 'yes', 'heart', 'broken heart', 'kiss', 'mail' * ]; * @example @@ -79,6 +79,6 @@ CKEDITOR.config.smiley_images = [ CKEDITOR.config.smiley_descriptions = [ 'smiley', 'sad', 'wink', 'laugh', 'frown', 'cheeky', 'blush', 'surprise', - 'indecision', 'angry', 'angle', 'cool', 'devil', 'crying', 'enlightened', 'no', + 'indecision', 'angry', 'angel', 'cool', 'devil', 'crying', 'enlightened', 'no', 'yes', 'heart', 'broken heart', 'kiss', 'mail' ]; diff --git a/_source/plugins/specialchar/dialogs/specialchar.js b/_source/plugins/specialchar/dialogs/specialchar.js index b419cf5..7c37603 100644 --- a/_source/plugins/specialchar/dialogs/specialchar.js +++ b/_source/plugins/specialchar/dialogs/specialchar.js @@ -262,7 +262,8 @@ CKEDITOR.dialog.add( 'specialchar', function( editor ) var columns = this.definition.charColumns, chars = this.definition.chars; - var html = [ '
    ' + '', '', config.smiley_descriptions[i], '' + - '' +config.smiley_descriptions[ i ] + '' + + '' +config.smiley_descriptions[ i ] + '' + '', '
    ' ]; @@ -289,12 +290,14 @@ CKEDITOR.dialog.add( 'specialchar', function( editor ) // Use character in case description unavailable. charDesc = charDesc || character; + var charLabelId = 'cke_specialchar_label_' + i + '_' + CKEDITOR.tools.getNextNumber(); + html.push( '' ); } - html.push( '
    ', '' + lang.options +'' ); + html.push( '
    ', '' + lang.options +'' ); this.getContentElement( 'info', 'charContainer' ).getElement().setHtml( html.join( '' ) ); }, diff --git a/_source/plugins/styles/plugin.js b/_source/plugins/styles/plugin.js index 65a36c2..2d9878b 100644 --- a/_source/plugins/styles/plugin.js +++ b/_source/plugins/styles/plugin.js @@ -379,39 +379,9 @@ CKEDITOR.STYLE_OBJECT = 3; // Get the first node to be processed and the last, which concludes the // processing. - var boundaryNodes = range.getBoundaryNodes(); - var firstNode = boundaryNodes.startNode; - var lastNode = boundaryNodes.endNode.getNextSourceNode( true ); - - // Probably the document end is reached, we need a marker node. - if ( !lastNode ) - { - var marker; - lastNode = marker = document.createText( '' ); - lastNode.insertAfter( range.endContainer ); - } - // The detection algorithm below skips the contents inside bookmark nodes, so - // we'll need to make sure lastNode isn't the   inside a bookmark node. - var lastParent = lastNode.getParent(); - if ( lastParent && lastParent.getAttribute( '_fck_bookmark' ) ) - lastNode = lastParent; - - if ( lastNode.equals( firstNode ) ) - { - // If the last node is the same as the the first one, we must move - // it to the next one, otherwise the first one will not be - // processed. - lastNode = lastNode.getNextSourceNode( true ); - - // It may happen that there are no more nodes after it (the end of - // the document), so we must add something there to make our code - // simpler. - if ( !lastNode ) - { - lastNode = marker = document.createText( '' ); - lastNode.insertAfter( firstNode ); - } - } + var boundaryNodes = range.createBookmark(), + firstNode = boundaryNodes.startNode, + lastNode = boundaryNodes.endNode; var currentNode = firstNode; @@ -550,7 +520,7 @@ CKEDITOR.STYLE_OBJECT = 3; styleRange.insertNode( styleNode ); // Let's merge our new style with its neighbors, if possible. - mergeSiblings( styleNode ); + styleNode.mergeSiblings(); // As the style system breaks text nodes constantly, let's normalize // things for performance. @@ -568,8 +538,8 @@ CKEDITOR.STYLE_OBJECT = 3; } } - // Remove the temporary marking node.(#4111) - marker && marker.remove(); + firstNode.remove(); + lastNode.remove(); range.moveToBookmark( bookmark ); // Minimize the result range to exclude empty text nodes. (#5374) range.shrink( CKEDITOR.SHRINK_TEXT ); @@ -624,7 +594,7 @@ CKEDITOR.STYLE_OBJECT = 3; * no difference that they're separate entities in the DOM tree. So, merge * them before removal. */ - mergeSiblings( element ); + element.mergeSiblings(); removeFromElement( this, element ); } @@ -753,6 +723,10 @@ CKEDITOR.STYLE_OBJECT = 3; var iterator = range.createIterator(); iterator.enforceRealBlocks = true; + // make recognize
    tag as a separator in ENTER_BR mode (#5121) + if ( this._.enterMode ) + iterator.enlargeBr = ( this._.enterMode != CKEDITOR.ENTER_BR ); + var block; var doc = range.document; var previousPreBlock; @@ -1057,47 +1031,11 @@ CKEDITOR.STYLE_OBJECT = 3; if ( firstChild ) { // Check the cached nodes for merging. - mergeSiblings( firstChild ); - - if ( lastChild && !firstChild.equals( lastChild ) ) - mergeSiblings( lastChild ); - } - } - } - - function mergeSiblings( element ) - { - if ( !element || element.type != CKEDITOR.NODE_ELEMENT || !CKEDITOR.dtd.$removeEmpty[ element.getName() ] ) - return; - - mergeElements( element, element.getNext(), true ); - mergeElements( element, element.getPrevious() ); - } - - function mergeElements( element, sibling, isNext ) - { - if ( sibling && sibling.type == CKEDITOR.NODE_ELEMENT ) - { - var hasBookmark = sibling.getAttribute( '_fck_bookmark' ); - - if ( hasBookmark ) - sibling = isNext ? sibling.getNext() : sibling.getPrevious(); - - if ( sibling && sibling.type == CKEDITOR.NODE_ELEMENT && element.isIdentical( sibling ) ) - { - // Save the last child to be checked too, to merge things like - // => - var innerSibling = isNext ? element.getLast() : element.getFirst(); - - if ( hasBookmark ) - ( isNext ? sibling.getPrevious() : sibling.getNext() ).move( element, !isNext ); - - sibling.moveChildren( element, !isNext ); - sibling.remove(); + firstChild.type == CKEDITOR.NODE_ELEMENT && firstChild.mergeSiblings(); - // Now check the last inner child (see two comments above). - if ( innerSibling ) - mergeSiblings( innerSibling ); + if ( lastChild && !firstChild.equals( lastChild ) + && lastChild.type == CKEDITOR.NODE_ELEMENT ) + lastChild.mergeSiblings(); } } } @@ -1422,6 +1360,7 @@ CKEDITOR.editor.prototype.getStylesSet = function( callback ) * Otherwise, this setting has the "name:url" syntax, making it * possible to set the URL from which loading the styles file.
    * Previously this setting was available as config.stylesCombo_stylesSet
    + * @name CKEDITOR.config.stylesSet * @type String|Array * @default 'default' * @since 3.3 diff --git a/_source/plugins/stylescombo/plugin.js b/_source/plugins/stylescombo/plugin.js index 8ed7f9b..a5d4b7c 100644 --- a/_source/plugins/stylescombo/plugin.js +++ b/_source/plugins/stylescombo/plugin.js @@ -34,6 +34,7 @@ For licensing, see LICENSE.html or http://ckeditor.com/license style = styles[ styleName ] = new CKEDITOR.style( styleDefinition ); style._name = styleName; + style._.enterMode = config.enterMode; stylesList.push( style ); } diff --git a/_source/plugins/table/dialogs/table.js b/_source/plugins/table/dialogs/table.js index 6ad826c..38652d4 100644 --- a/_source/plugins/table/dialogs/table.js +++ b/_source/plugins/table/dialogs/table.js @@ -43,6 +43,11 @@ For licensing, see LICENSE.html or http://ckeditor.com/license } else if ( ranges.length > 0 ) { + // Webkit could report the following range on cell selection (#4948): + //
    ] + if ( CKEDITOR.env.webkit ) + ranges[ 0 ].shrink( CKEDITOR.NODE_ELEMENT ); + var rangeRoot = ranges[0].getCommonAncestor( true ); selectedTable = rangeRoot.getAscendant( 'table', true ); } diff --git a/_source/plugins/tabletools/plugin.js b/_source/plugins/tabletools/plugin.js index 7590078..1f2224c 100644 --- a/_source/plugins/tabletools/plugin.js +++ b/_source/plugins/tabletools/plugin.js @@ -86,7 +86,7 @@ For licensing, see LICENSE.html or http://ckeditor.com/license return retval; } - function getFocusedCell( cellsToDelete ) { + function getFocusElementAfterDelCells( cellsToDelete ) { var i = 0, last = cellsToDelete.length - 1, database = {}, @@ -248,21 +248,65 @@ For licensing, see LICENSE.html or http://ckeditor.com/license } } + function getFocusElementAfterDelCols( cells ) + { + var cellIndexList = [], + table = cells[ 0 ] && cells[ 0 ].getAscendant( 'table' ), + i, length, + targetIndex, targetCell; + + // get the cellIndex list of delete cells + for ( i = 0, length = cells.length; i < length; i++ ) + cellIndexList.push( cells[i].$.cellIndex ); + + // get the focusable column index + cellIndexList.sort(); + for ( i = 1, length = cellIndexList.length; i < length; i++ ) + { + if ( cellIndexList[ i ] - cellIndexList[ i - 1 ] > 1 ) + { + targetIndex = cellIndexList[ i - 1 ] + 1; + break; + } + } + + if ( !targetIndex ) + targetIndex = cellIndexList[ 0 ] > 0 ? ( cellIndexList[ 0 ] - 1 ) + : ( cellIndexList[ cellIndexList.length - 1 ] + 1 ); + + // scan row by row to get the target cell + var rows = table.$.rows; + for ( i = 0, length = rows.length; i < length ; i++ ) + { + targetCell = rows[ i ].cells[ targetIndex ]; + if ( targetCell ) + break; + } + + return targetCell ? new CKEDITOR.dom.element( targetCell ) : table.getPrevious(); + } + function deleteColumns( selectionOrCell ) { if ( selectionOrCell instanceof CKEDITOR.dom.selection ) { - var colsToDelete = getSelectedCells( selectionOrCell ); - for ( var i = colsToDelete.length ; i >= 0 ; i-- ) + var colsToDelete = getSelectedCells( selectionOrCell ), + elementToFocus = getFocusElementAfterDelCols( colsToDelete ); + + for ( var i = colsToDelete.length - 1 ; i >= 0 ; i-- ) { if ( colsToDelete[ i ] ) deleteColumns( colsToDelete[ i ] ); } + + return elementToFocus; } else if ( selectionOrCell instanceof CKEDITOR.dom.element ) { // Get the cell's table. var table = selectionOrCell.getAscendant( 'table' ); + if ( !table ) + return null; // Get the cell index. var cellIndex = selectionOrCell.$.cellIndex; @@ -288,6 +332,8 @@ For licensing, see LICENSE.html or http://ckeditor.com/license row.$.removeChild( row.$.cells[ cellIndex ] ); } } + + return null; } function insertCell( selection, insertBefore ) @@ -315,7 +361,7 @@ For licensing, see LICENSE.html or http://ckeditor.com/license { var cellsToDelete = getSelectedCells( selectionOrCell ); var table = cellsToDelete[ 0 ] && cellsToDelete[ 0 ].getAscendant( 'table' ); - var cellToFocus = getFocusedCell( cellsToDelete ); + var cellToFocus = getFocusElementAfterDelCells( cellsToDelete ); for ( var i = cellsToDelete.length - 1 ; i >= 0 ; i-- ) deleteCells( cellsToDelete[ i ] ); @@ -726,9 +772,10 @@ For licensing, see LICENSE.html or http://ckeditor.com/license range.collapse(); selection.selectRanges( [ range ] ); - // If the table's parent has only one child, remove it as well. - if ( table.getParent().getChildCount() == 1 ) - table.getParent().remove(); + // If the table's parent has only one child, remove it,except body,as well.( #5416 ) + var parent = table.getParent(); + if ( parent.getChildCount() == 1 && parent.getName() != 'body' ) + parent.remove(); else table.remove(); } @@ -766,7 +813,8 @@ For licensing, see LICENSE.html or http://ckeditor.com/license exec : function( editor ) { var selection = editor.getSelection(); - deleteColumns( selection ); + var element = deleteColumns( selection ); + element && placeCursorInCell( element, true ); } } ); diff --git a/_source/plugins/templates/dialogs/templates.js b/_source/plugins/templates/dialogs/templates.js index af04e55..d3d78c6 100644 --- a/_source/plugins/templates/dialogs/templates.js +++ b/_source/plugins/templates/dialogs/templates.js @@ -146,6 +146,7 @@ For licensing, see LICENSE.html or http://ckeditor.com/license var listContainer; + var templateListLabelId = 'cke_tpl_list_label_' + CKEDITOR.tools.getNextNumber(); return { title :editor.lang.templates.title, @@ -176,10 +177,10 @@ For licensing, see LICENSE.html or http://ckeditor.com/license type : 'html', focus: true, html : - '
    ' + + '
    ' + '
    ' + '
    ' + - '' + editor.lang.templates.options+ '' + '' + editor.lang.templates.options+ '' }, { id : 'chkInsertOpt', diff --git a/_source/plugins/uicolor/dialogs/uicolor.js b/_source/plugins/uicolor/dialogs/uicolor.js index 92d42e5..7d49394 100644 --- a/_source/plugins/uicolor/dialogs/uicolor.js +++ b/_source/plugins/uicolor/dialogs/uicolor.js @@ -7,7 +7,8 @@ CKEDITOR.dialog.add( 'uicolor', function( editor ) { var dialog, picker, pickerContents, // Actual UI color value. - uiColor = editor.getUiColor(); + uiColor = editor.getUiColor(), + pickerId = 'cke_uicolor_picker' + CKEDITOR.tools.getNextNumber(); function setNewPickerColor( color ) { @@ -16,7 +17,7 @@ CKEDITOR.dialog.add( 'uicolor', function( editor ) color = window.YAHOO.util.Color.hex2rgb( color.substr( 1 ) ); picker.setValue( color, true ); // Refresh picker UI. - picker.refresh( 'cke_uicolor_picker' ); + picker.refresh( pickerId ); } function setNewUiColor( color, force ) @@ -33,7 +34,7 @@ CKEDITOR.dialog.add( 'uicolor', function( editor ) { id : 'yuiColorPicker', type : 'html', - html : "
    ", + html : "
    ", onLoad : function( event ) { var url = CKEDITOR.getUrl( @@ -42,7 +43,7 @@ CKEDITOR.dialog.add( 'uicolor', function( editor ) ); // Create new color picker widget. - picker = new window.YAHOO.widget.ColorPicker( "cke_uicolor_picker", + picker = new window.YAHOO.widget.ColorPicker( pickerId, { showhsvcontrols : true, showhexcontrols : true, diff --git a/_source/plugins/uicolor/yui/assets/yui.css b/_source/plugins/uicolor/yui/assets/yui.css index f0f59b0..e7dbd79 100644 --- a/_source/plugins/uicolor/yui/assets/yui.css +++ b/_source/plugins/uicolor/yui/assets/yui.css @@ -12,4 +12,4 @@ Code licensed under the BSD License: http://developer.yahoo.net/yui/license.txt version: 2.7.0 */ -#cke_uicolor_picker .yui-picker-panel{background:#e3e3e3;border-color:#888;}#cke_uicolor_picker .yui-picker-panel .hd{background-color:#ccc;font-size:100%;line-height:100%;border:1px solid #e3e3e3;font-weight:bold;overflow:hidden;padding:6px;color:#000;}#cke_uicolor_picker .yui-picker-panel .bd{background:#e8e8e8;margin:1px;height:200px;}#cke_uicolor_picker .yui-picker-panel .ft{background:#e8e8e8;margin:1px;padding:1px;}#cke_uicolor_picker .yui-picker{position:relative;}#cke_uicolor_picker .yui-picker-hue-thumb{cursor:default;width:18px;height:18px;top:-8px;left:-2px;z-index:9;position:absolute;}#cke_uicolor_picker .yui-picker-hue-bg{-moz-outline:none;outline:0 none;position:absolute;left:200px;height:183px;width:14px;background:url(hue_bg.png) no-repeat;top:4px;}#cke_uicolor_picker .yui-picker-bg{-moz-outline:none;outline:0 none;position:absolute;top:4px;left:4px;height:182px;width:182px;background-color:#F00;background-image:url(picker_mask.png);}*html #cke_uicolor_picker .yui-picker-bg{background-image:none;filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src='picker_mask.png',sizingMethod='scale');}#cke_uicolor_picker .yui-picker-mask{position:absolute;z-index:1;top:0;left:0;}#cke_uicolor_picker .yui-picker-thumb{cursor:default;width:11px;height:11px;z-index:9;position:absolute;top:-4px;left:-4px;}#cke_uicolor_picker .yui-picker-swatch{position:absolute;left:240px;top:4px;height:60px;width:55px;border:1px solid #888;}#cke_uicolor_picker .yui-picker-websafe-swatch{position:absolute;left:304px;top:4px;height:24px;width:24px;border:1px solid #888;}#cke_uicolor_picker .yui-picker-controls{position:absolute;top:72px;left:226px;font:1em monospace;}#cke_uicolor_picker .yui-picker-controls .hd{background:transparent;border-width:0!important;}#cke_uicolor_picker .yui-picker-controls .bd{height:100px;border-width:0!important;}#cke_uicolor_picker .yui-picker-controls ul{float:left;padding:0 2px 0 0;margin:0;}#cke_uicolor_picker .yui-picker-controls li{padding:2px;list-style:none;margin:0;}#cke_uicolor_picker .yui-picker-controls input{font-size:.85em;width:2.4em;}#cke_uicolor_picker .yui-picker-hex-controls{clear:both;padding:2px;}#cke_uicolor_picker .yui-picker-hex-controls input{width:4.6em;}#cke_uicolor_picker .yui-picker-controls a{font:1em arial,helvetica,clean,sans-serif;display:block;*display:inline-block;padding:0;color:#000;} +.cke_uicolor_picker .yui-picker-panel{background:#e3e3e3;border-color:#888;}.cke_uicolor_picker .yui-picker-panel .hd{background-color:#ccc;font-size:100%;line-height:100%;border:1px solid #e3e3e3;font-weight:bold;overflow:hidden;padding:6px;color:#000;}.cke_uicolor_picker .yui-picker-panel .bd{background:#e8e8e8;margin:1px;height:200px;}.cke_uicolor_picker .yui-picker-panel .ft{background:#e8e8e8;margin:1px;padding:1px;}.cke_uicolor_picker .yui-picker{position:relative;}.cke_uicolor_picker .yui-picker-hue-thumb{cursor:default;width:18px;height:18px;top:-8px;left:-2px;z-index:9;position:absolute;}.cke_uicolor_picker .yui-picker-hue-bg{-moz-outline:none;outline:0 none;position:absolute;left:200px;height:183px;width:14px;background:url(hue_bg.png) no-repeat;top:4px;}.cke_uicolor_picker .yui-picker-bg{-moz-outline:none;outline:0 none;position:absolute;top:4px;left:4px;height:182px;width:182px;background-color:#F00;background-image:url(picker_mask.png);}*html .cke_uicolor_picker .yui-picker-bg{background-image:none;filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src='picker_mask.png',sizingMethod='scale');}.cke_uicolor_picker .yui-picker-mask{position:absolute;z-index:1;top:0;left:0;}.cke_uicolor_picker .yui-picker-thumb{cursor:default;width:11px;height:11px;z-index:9;position:absolute;top:-4px;left:-4px;}.cke_uicolor_picker .yui-picker-swatch{position:absolute;left:240px;top:4px;height:60px;width:55px;border:1px solid #888;}.cke_uicolor_picker .yui-picker-websafe-swatch{position:absolute;left:304px;top:4px;height:24px;width:24px;border:1px solid #888;}.cke_uicolor_picker .yui-picker-controls{position:absolute;top:72px;left:226px;font:1em monospace;}.cke_uicolor_picker .yui-picker-controls .hd{background:transparent;border-width:0!important;}.cke_uicolor_picker .yui-picker-controls .bd{height:100px;border-width:0!important;}.cke_uicolor_picker .yui-picker-controls ul{float:left;padding:0 2px 0 0;margin:0;}.cke_uicolor_picker .yui-picker-controls li{padding:2px;list-style:none;margin:0;}.cke_uicolor_picker .yui-picker-controls input{font-size:.85em;width:2.4em;}.cke_uicolor_picker .yui-picker-hex-controls{clear:both;padding:2px;}.cke_uicolor_picker .yui-picker-hex-controls input{width:4.6em;}.cke_uicolor_picker .yui-picker-controls a{font:1em arial,helvetica,clean,sans-serif;display:block;*display:inline-block;padding:0;color:#000;} diff --git a/_source/plugins/undo/plugin.js b/_source/plugins/undo/plugin.js index e843d23..fde581f 100644 --- a/_source/plugins/undo/plugin.js +++ b/_source/plugins/undo/plugin.js @@ -114,13 +114,41 @@ For licensing, see LICENSE.html or http://ckeditor.com/license // Create the first image. editor.fire( 'saveSnapshot' ); }; + + /** + * Update the undo stacks with any subsequent DOM changes after this call. + * @name CKEDITOR.editor#updateUndo + * @example + * function() + * { + * editor.fire( 'updateSnapshot' ); + * ... + * // Ask to include subsequent (in this call stack) DOM changes to be + * // considered as part of the first snapshot. + * editor.fire( 'updateSnapshot' ); + * editor.document.body.append(...); + * ... + * } + */ + editor.on( 'updateSnapshot', function() + { + if ( undoManager.currentImage && new Image( editor ).equals( undoManager.currentImage ) ) + setTimeout( function () { undoManager.update(); }, 0 ); + }); } }); - // Gets a snapshot image which represent the current document status. - function Image( editor ) + CKEDITOR.plugins.undo = {}; + + /** + * Undo snapshot which represents the current document status. + * @name CKEDITOR.plugins.undo.Image + * @param editor The editor instance on which the image is created. + */ + var Image = CKEDITOR.plugins.undo.Image = function( editor ) { - var contents = editor.getSnapshot(), + this.editor = editor; + var contents = editor.getSnapshot(), selection = contents && editor.getSelection(); // In IE, we need to remove the expando attributes. @@ -128,7 +156,7 @@ For licensing, see LICENSE.html or http://ckeditor.com/license this.contents = contents; this.bookmarks = selection && selection.createBookmarks2( true ); - } + }; // Attributes that browser may changing them when setting via innerHTML. var protectedAttrs = /\b(?:href|src|name)="[^"]*?"/gi; @@ -137,6 +165,7 @@ For licensing, see LICENSE.html or http://ckeditor.com/license { equals : function( otherImage, contentOnly ) { + var thisContents = this.contents, otherContents = otherImage.contents; @@ -397,8 +426,7 @@ For licensing, see LICENSE.html or http://ckeditor.com/license // Update current image with the actual editor // content, since actualy content may differ from // the original snapshot due to dom change. (#4622) - this.snapshots.splice( this.index, 1, ( this.currentImage = new Image( this.editor ) ) ); - + this.update(); this.fireChange(); }, @@ -497,6 +525,14 @@ For licensing, see LICENSE.html or http://ckeditor.com/license } return false; + }, + + /** + * Update the last snapshot of the undo stack with the current editor content. + */ + update : function() + { + this.snapshots.splice( this.index, 1, ( this.currentImage = new Image( this.editor ) ) ); } }; })(); diff --git a/_source/plugins/wysiwygarea/plugin.js b/_source/plugins/wysiwygarea/plugin.js index dc8329d..a6b0639 100644 --- a/_source/plugins/wysiwygarea/plugin.js +++ b/_source/plugins/wysiwygarea/plugin.js @@ -170,6 +170,13 @@ For licensing, see LICENSE.html or http://ckeditor.com/license } } + function isBlankParagraph( block ) + { + return block.getOuterHtml().match( emptyParagraphRegexp ); + } + + isNotWhitespace = CKEDITOR.dom.walker.whitespaces( true ); + /** * Auto-fixing block-less content by wrapping paragraph (#3190), prevent * non-exitable-block by padding extra br.(#3189) @@ -191,6 +198,7 @@ For licensing, see LICENSE.html or http://ckeditor.com/license && blockLimit.getName() == 'body' && !path.block ) { + editor.fire( 'updateSnapshot' ); restoreDirty( editor ); CKEDITOR.env.ie && restoreSelection( selection ); @@ -204,19 +212,21 @@ For licensing, see LICENSE.html or http://ckeditor.com/license first && isNbsp( first ) && first.remove(); } - // If the fixed block is blank and already followed by a exitable - // block, we should revert the fix. (#3684) - if ( fixedBlock.getOuterHtml().match( emptyParagraphRegexp ) ) + // If the fixed block is actually blank and is already followed by an exitable blank + // block, we should revert the fix and move into the existed one. (#3684) + if ( isBlankParagraph( fixedBlock ) ) { var previousElement = fixedBlock.getPrevious( isNotWhitespace ), nextElement = fixedBlock.getNext( isNotWhitespace ); if ( previousElement && previousElement.getName && !( previousElement.getName() in nonExitableElementNames ) + && isBlankParagraph( previousElement ) && range.moveToElementEditStart( previousElement ) || nextElement && nextElement.getName - && !( nextElement.getName() in nonExitableElementNames ) - && range.moveToElementEditStart( nextElement ) ) + && !( nextElement.getName() in nonExitableElementNames ) + && isBlankParagraph( nextElement ) + && range.moveToElementEditStart( nextElement ) ) { fixedBlock.remove(); } @@ -245,6 +255,7 @@ For licensing, see LICENSE.html or http://ckeditor.com/license if ( walker.previous() ) { + editor.fire( 'updateSnapshot' ); restoreDirty( editor ); CKEDITOR.env.ie && restoreSelection( selection ); @@ -270,6 +281,7 @@ For licensing, see LICENSE.html or http://ckeditor.com/license var frameLabel = editor.lang.editorTitle.replace( '%1', editor.name ); + var contentDomReadyHandler; editor.on( 'editingBlockReady', function() { var mainElement, @@ -289,13 +301,6 @@ For licensing, see LICENSE.html or http://ckeditor.com/license if ( iframe ) iframe.remove(); - frameLoaded = 0; - - var setDataFn = !CKEDITOR.env.gecko && CKEDITOR.tools.addFunction( function( doc ) - { - CKEDITOR.tools.removeFunction( setDataFn ); - doc.write( data ); - }); var srcScript = 'document.open();' + @@ -304,29 +309,30 @@ For licensing, see LICENSE.html or http://ckeditor.com/license // call document.open(). ( isCustomDomain ? ( 'document.domain="' + document.domain + '";' ) : '' ) + - ( ( 'parent.CKEDITOR.tools.callFunction(' + setDataFn + ',document);' ) ) + - 'document.close();'; iframe = CKEDITOR.dom.element.createFromHtml( '' ); // With FF, it's better to load the data on iframe.load. (#3894,#4058) - CKEDITOR.env.gecko && iframe.on( 'load', function( ev ) + iframe.on( 'load', function( ev ) { + frameLoaded = 1; ev.removeListener(); var doc = iframe.getFrameDocument().$; - doc.open(); + // Don't leave any history log in IE. (#5657) + doc.open( "text/html","replace" ); doc.write( data ); doc.close(); }); @@ -336,18 +342,19 @@ For licensing, see LICENSE.html or http://ckeditor.com/license // The script that launches the bootstrap logic on 'domReady', so the document // is fully editable even before the editing iframe is fully loaded (#4455). + contentDomReadyHandler = CKEDITOR.tools.addFunction( contentDomReady ); var activationScript = ''; // Editing area bootstrap code. - var contentDomReady = function( domWindow ) + function contentDomReady( domWindow ) { - if ( frameLoaded ) + if ( !frameLoaded ) return; - frameLoaded = 1; + frameLoaded = 0; editor.fire( 'ariaWidget', iframe ); @@ -358,8 +365,6 @@ For licensing, see LICENSE.html or http://ckeditor.com/license var script = domDocument.getElementById( "cke_actscrpt" ); script.parentNode.removeChild( script ); - delete CKEDITOR._[ 'contentDomReady' + editor.name ]; - body.spellcheck = !editor.config.disableNativeSpellChecker; if ( CKEDITOR.env.ie ) @@ -374,7 +379,32 @@ For licensing, see LICENSE.html or http://ckeditor.com/license body.removeAttribute( 'disabled' ); } else + { + // Gecko need a key event to 'wake up' the editing + // ability when document is empty.(#3864) + if ( CKEDITOR.env.gecko && !body.childNodes.length ) + { + setTimeout( function() + { + restoreDirty( editor ); + + // Simulating keyboard character input by dispatching a keydown of white-space text. + var keyEventSimulate = domDocument.$.createEvent( "KeyEvents" ); + keyEventSimulate.initKeyEvent( 'keypress', true, true, domWindow.$, false, + false, false, false, 0, 32 ); + domDocument.$.dispatchEvent( keyEventSimulate ); + + // Restore the original document status by placing the cursor before a bogus br created (#5021). + domDocument.createElement( 'br', { attributes: { '_moz_editor_bogus_node' : 'TRUE', '_moz_dirty' : "" } } ) + .replace( domDocument.getBody().getFirst() ); + var nativeRange = new CKEDITOR.dom.range( domDocument ); + nativeRange.setStartAt( new CKEDITOR.dom.element( body ) , CKEDITOR.POSITION_AFTER_START ); + nativeRange.select(); + }, 0 ); + } + domDocument.designMode = 'on'; + } // IE, Opera and Safari may not support it and throw // errors. @@ -439,33 +469,6 @@ For licensing, see LICENSE.html or http://ckeditor.com/license focusTarget.on( 'focus', function() { - // Gecko need a key event to 'wake up' the editing - // ability when document is empty.(#3864) - if ( CKEDITOR.env.gecko ) - { - var first = body; - while ( first.firstChild ) - first = first.firstChild; - - if ( !first.nextSibling - && ( 'BR' == first.tagName ) - && first.hasAttribute( '_moz_editor_bogus_node' ) ) - { - restoreDirty( editor ); - var keyEventSimulate = domDocument.$.createEvent( "KeyEvents" ); - keyEventSimulate.initKeyEvent( 'keypress', true, true, domWindow.$, false, - false, false, false, 0, 32 ); - domDocument.$.dispatchEvent( keyEventSimulate ); - var bogusText = domDocument.getBody().getFirst() ; - // Compensate the line maintaining
    if enterMode is not block. - if ( editor.config.enterMode == CKEDITOR.ENTER_BR ) - domDocument.createElement( 'br', { attributes: { '_moz_dirty' : "" } } ) - .replace( bogusText ); - else - bogusText.remove(); - } - } - editor.focusManager.focus(); }); @@ -573,7 +576,7 @@ For licensing, see LICENSE.html or http://ckeditor.com/license } }, 0 ); - }; + } editor.addMode( 'wysiwyg', { @@ -643,6 +646,8 @@ For licensing, see LICENSE.html or http://ckeditor.com/license // Check if the tag is available. if ( !(/]/).test( data ) ) data = data.replace( /]*>/, '$&' ) ; + else if ( !(/]/).test( data ) ) + data = data.replace( /]*>/, '$&' ) ; // The base must be the first tag in the HEAD, e.g. to get relative // links on styles. @@ -662,7 +667,8 @@ For licensing, see LICENSE.html or http://ckeditor.com/license { data = config.docType + - '' + + '' + '' + frameLabel + '' + '' + baseTag + @@ -677,7 +683,6 @@ For licensing, see LICENSE.html or http://ckeditor.com/license data += activationScript; - CKEDITOR._[ 'contentDomReady' + editor.name ] = contentDomReady; // The iframe is recreated on each call of setData, so we need to clear DOM objects this.onDispose(); @@ -787,6 +792,7 @@ For licensing, see LICENSE.html or http://ckeditor.com/license } ); editor.on( 'destroy', function() { + CKEDITOR.tools.removeFunction( contentDomReadyHandler ); ieFocusGrabber.clearCustomData(); } ); } @@ -804,24 +810,21 @@ For licensing, see LICENSE.html or http://ckeditor.com/license window.addEventListener( 'load', arguments.callee, false ); else { - body.setAttribute( 'onpageshow', body.getAttribute( 'onpageshow' ) - + ';event.persisted && CKEDITOR.tools.callFunction(' + - CKEDITOR.tools.addFunction( function() - { - var allInstances = CKEDITOR.instances, - editor, - doc; - for ( var i in allInstances ) - { - editor = allInstances[ i ]; - doc = editor.document; - if ( doc ) - { - doc.$.designMode = 'off'; - doc.$.designMode = 'on'; - } - } - } ) + ')' ); + var currentHandler = body.getAttribute( 'onpageshow' ); + body.setAttribute( 'onpageshow', ( currentHandler ? currentHandler + ';' : '') + + 'event.persisted && (function(){' + + 'var allInstances = CKEDITOR.instances, editor, doc;' + + 'for ( var i in allInstances )' + + '{' + + ' editor = allInstances[ i ];' + + ' doc = editor.document;' + + ' if ( doc )' + + ' {' + + ' doc.$.designMode = "off";' + + ' doc.$.designMode = "on";' + + ' }' + + '}' + + '})();' ); } } )(); diff --git a/_source/skins/kama/dialog.css b/_source/skins/kama/dialog.css index 2a0a47a..8a64bc7 100644 --- a/_source/skins/kama/dialog.css +++ b/_source/skins/kama/dialog.css @@ -67,12 +67,6 @@ body .cke_dialog margin-bottom: 10px; } -.cke_skin_kama .cke_browser_ie.cke_rtl .cke_dialog_title -{ - position: static !important; - unicode-bidi: bidi-override; -} - .cke_skin_kama .cke_dialog_contents { background-color: #ebebeb; @@ -685,7 +679,7 @@ body .cke_dialog cursor: hand; } -.cke_skin_kama .cke_dialog #ImagePreviewBox +.cke_skin_kama .cke_dialog .ImagePreviewBox { border : 2px ridge black; overflow : scroll; @@ -695,7 +689,7 @@ body .cke_dialog background-color : white; } -.cke_skin_kama .cke_dialog #ImagePreviewBox table td { +.cke_skin_kama .cke_dialog .ImagePreviewBox table td { white-space: normal; } @@ -705,7 +699,7 @@ body .cke_dialog _position: absolute; } -.cke_skin_kama .cke_dialog #ImagePreviewLoader +.cke_skin_kama .cke_dialog .ImagePreviewLoader { position: absolute; white-space : normal; @@ -720,7 +714,7 @@ body .cke_dialog background-color : #e4e4e4; } -.cke_skin_kama .cke_dialog #FlashPreviewBox +.cke_skin_kama .cke_dialog .FlashPreviewBox { white-space : normal; border : 2px ridge black; diff --git a/_source/skins/kama/mainui.css b/_source/skins/kama/mainui.css index e55c45a..c614d9e 100644 --- a/_source/skins/kama/mainui.css +++ b/_source/skins/kama/mainui.css @@ -133,6 +133,18 @@ span.cke_skin_kama float: left; } +.cke_skin_kama .cke_resizer_horizontal, +.cke_skin_kama .cke_rtl .cke_resizer_horizontal +{ + cursor: e-resize; +} + +.cke_skin_kama .cke_resizer_vertical, +.cke_skin_kama .cke_rtl .cke_resizer_vertical +{ + cursor: n-resize; +} + .cke_skin_kama .cke_maximized .cke_resizer { display: none; diff --git a/_source/skins/kama/templates.css b/_source/skins/kama/templates.css index df68e0e..78f7b49 100644 --- a/_source/skins/kama/templates.css +++ b/_source/skins/kama/templates.css @@ -56,8 +56,22 @@ For licensing, see LICENSE.html or http://ckeditor.com/license { border: #ff9933 1px solid; background-color: #fffacd; +} + +.cke_skin_kama .cke_tpl_list a:active *, +.cke_skin_kama .cke_tpl_list a:hover *, +.cke_skin_kama .cke_tpl_list a:focus * +{ cursor: pointer; - cursor: hand; +} + +/* IE6 contextual selectors childs won't get :hover transition until, + the hover style of the link itself contains certain CSS declarations.*/ +.cke_skin_kama .cke_browser_ie6 .cke_tpl_list a:active, +.cke_skin_kama .cke_browser_ie6 .cke_tpl_list a:hover, +.cke_skin_kama .cke_browser_ie6 .cke_tpl_list a:focus +{ + background-position: 0 0; } .cke_skin_kama .cke_hc .cke_tpl_list a:active .cke_tpl_item, @@ -67,16 +81,6 @@ For licensing, see LICENSE.html or http://ckeditor.com/license border-width: 3px; } -/* - * Fix property 'cursor' doesn't inherit on table - */ -.cke_skin_kama .cke_tpl_list a:active *, -.cke_skin_kama .cke_tpl_list a:hover *, -.cke_skin_kama .cke_tpl_list a:focus * -{ - cursor: inherit; -} - .cke_skin_kama .cke_tpl_empty, .cke_tpl_loading { text-align: center; diff --git a/_source/skins/kama/toolbar.css b/_source/skins/kama/toolbar.css index 74b24bf..11ba824 100644 --- a/_source/skins/kama/toolbar.css +++ b/_source/skins/kama/toolbar.css @@ -128,6 +128,12 @@ For licensing, see LICENSE.html or http://ckeditor.com/license margin-left: 6px; } +.cke_skin_kama .cke_toolgroup +{ + display: block; + height: 22px; +} + .cke_skin_kama .cke_button a, .cke_skin_kama .cke_button a:hover, .cke_skin_kama .cke_button a:focus, @@ -377,19 +383,6 @@ For licensing, see LICENSE.html or http://ckeditor.com/license line-height: 17px; } -/* IE8 strict button valign correction */ -.cke_skin_kama .cke_browser_ie8 .cke_button .cke_label -{ - vertical-align: top; -} - -.cke_skin_kama .cke_browser_iequirks.cke_browser_ie8 .cke_button .cke_label -{ - /* revert previous */ - vertical-align: middle; -} -/* END IE8 strict button valign correction */ - /* Fix cursor shape consistency on toolbar combos (#4031) */ .cke_skin_kama .cke_browser_ie .cke_rcombo, .cke_skin_kama .cke_browser_ie .cke_rcombo * diff --git a/_source/skins/office2003/dialog.css b/_source/skins/office2003/dialog.css index e609b2d..c2342cd 100644 --- a/_source/skins/office2003/dialog.css +++ b/_source/skins/office2003/dialog.css @@ -610,7 +610,7 @@ body .cke_dialog cursor: hand; } -.cke_skin_office2003 .cke_dialog #ImagePreviewBox +.cke_skin_office2003 .cke_dialog .ImagePreviewBox { border : 2px ridge black; overflow : scroll; @@ -620,7 +620,7 @@ body .cke_dialog background-color : white; } -.cke_skin_office2003 .cke_dialog #ImagePreviewBox table td { +.cke_skin_office2003 .cke_dialog .ImagePreviewBox table td { white-space: normal; } @@ -630,7 +630,7 @@ body .cke_dialog _position: absolute; } -.cke_skin_office2003 .cke_dialog #ImagePreviewLoader +.cke_skin_office2003 .cke_dialog .ImagePreviewLoader { position: absolute; white-space : normal; @@ -645,7 +645,7 @@ body .cke_dialog background-color : #e4e4e4; } -.cke_skin_office2003 .cke_dialog #FlashPreviewBox +.cke_skin_office2003 .cke_dialog .FlashPreviewBox { white-space : normal; border : 2px ridge black; diff --git a/_source/skins/office2003/mainui.css b/_source/skins/office2003/mainui.css index 2676fb2..d0e077d 100644 --- a/_source/skins/office2003/mainui.css +++ b/_source/skins/office2003/mainui.css @@ -93,11 +93,6 @@ For licensing, see LICENSE.html or http://ckeditor.com/license cursor: se-resize; } -.cke_skin_office2003 .cke_maximized .cke_resizer -{ - display: none; -} - .cke_skin_office2003 .cke_rtl .cke_resizer { cursor: sw-resize; @@ -106,6 +101,23 @@ For licensing, see LICENSE.html or http://ckeditor.com/license float: left; } +.cke_skin_office2003 .cke_resizer_horizontal, +.cke_skin_office2003 .cke_rtl .cke_resizer_horizontal +{ + cursor: e-resize; +} + +.cke_skin_office2003 .cke_resizer_vertical, +.cke_skin_office2003 .cke_rtl .cke_resizer_vertical +{ + cursor: n-resize; +} + +.cke_skin_office2003 .cke_maximized .cke_resizer +{ + display: none; +} + .cke_skin_office2003 .cke_browser_ie6 .cke_contents textarea, .cke_skin_office2003 .cke_browser_ie7 .cke_contents textarea { diff --git a/_source/skins/office2003/templates.css b/_source/skins/office2003/templates.css index 22b9629..411d1ee 100644 --- a/_source/skins/office2003/templates.css +++ b/_source/skins/office2003/templates.css @@ -55,8 +55,22 @@ For licensing, see LICENSE.html or http://ckeditor.com/license { border: #ff9933 1px solid !important; background-color: #fffacd !important; +} + +.cke_skin_office2003 .cke_tpl_list a:active *, +.cke_skin_office2003 .cke_tpl_list a:hover *, +.cke_skin_office2003 .cke_tpl_list a:focus * +{ cursor: pointer; - cursor: hand; +} + +/* IE6 contextual selectors childs won't get :hover transition until, + the hover style of the link itself contains certain CSS declarations.*/ +.cke_skin_office2003 .cke_browser_ie6 .cke_tpl_list a:active, +.cke_skin_office2003 .cke_browser_ie6 .cke_tpl_list a:hover, +.cke_skin_office2003 .cke_browser_ie6 .cke_tpl_list a:focus +{ + background-position: 0 0; } .cke_skin_office2003 .cke_tpl_list a:active .cke_tpl_item, @@ -66,14 +80,6 @@ For licensing, see LICENSE.html or http://ckeditor.com/license border-width: 3px; } -/* - * Fix property 'cursor' doesn't inherit on table - */ -.cke_skin_office2003 .cke_tpl_hover * -{ - cursor: inherit; -} - .cke_skin_office2003 .cke_tpl_empty, .cke_tpl_loading { text-align: center; diff --git a/_source/skins/office2003/toolbar.css b/_source/skins/office2003/toolbar.css index 2135213..8a393a1 100644 --- a/_source/skins/office2003/toolbar.css +++ b/_source/skins/office2003/toolbar.css @@ -312,7 +312,7 @@ For licensing, see LICENSE.html or http://ckeditor.com/license display: none; padding-left: 3px; cursor: default; - + vertical-align:middle; _background-image: url(images/sprites_ie6.png); _background-position: 0 -970px; _background-repeat: repeat-x; diff --git a/_source/skins/v2/dialog.css b/_source/skins/v2/dialog.css index ff14fc4..492a062 100644 --- a/_source/skins/v2/dialog.css +++ b/_source/skins/v2/dialog.css @@ -612,7 +612,7 @@ body .cke_dialog cursor: hand; } -.cke_skin_v2 .cke_dialog #ImagePreviewBox +.cke_skin_v2 .cke_dialog .ImagePreviewBox { border : 2px ridge black; overflow : scroll; @@ -622,7 +622,7 @@ body .cke_dialog background-color : white; } -.cke_skin_v2 .cke_dialog #ImagePreviewBox table td { +.cke_skin_v2 .cke_dialog .ImagePreviewBox table td { white-space: normal; } @@ -632,7 +632,7 @@ body .cke_dialog _position: absolute; } -.cke_skin_v2 .cke_dialog #ImagePreviewLoader +.cke_skin_v2 .cke_dialog .ImagePreviewLoader { position: absolute; white-space : normal; @@ -647,7 +647,7 @@ body .cke_dialog background-color : #e4e4e4; } -.cke_skin_v2 .cke_dialog #FlashPreviewBox +.cke_skin_v2 .cke_dialog .FlashPreviewBox { white-space : normal; border : 2px ridge black; diff --git a/_source/skins/v2/mainui.css b/_source/skins/v2/mainui.css index 7f1adf8..4bb149b 100644 --- a/_source/skins/v2/mainui.css +++ b/_source/skins/v2/mainui.css @@ -110,6 +110,18 @@ For licensing, see LICENSE.html or http://ckeditor.com/license float: left; } +.cke_skin_v2 .cke_resizer_horizontal, +.cke_skin_v2 .cke_rtl .cke_resizer_horizontal +{ + cursor: e-resize; +} + +.cke_skin_v2 .cke_resizer_vertical, +.cke_skin_v2 .cke_rtl .cke_resizer_vertical +{ + cursor: n-resize; +} + .cke_skin_v2 .cke_maximized .cke_resizer { display: none; diff --git a/_source/skins/v2/templates.css b/_source/skins/v2/templates.css index 984687d..7964e37 100644 --- a/_source/skins/v2/templates.css +++ b/_source/skins/v2/templates.css @@ -55,8 +55,22 @@ For licensing, see LICENSE.html or http://ckeditor.com/license { border: #ff9933 1px solid !important; background-color: #fffacd !important; +} + +.cke_skin_v2 .cke_tpl_list a:active *, +.cke_skin_v2 .cke_tpl_list a:hover *, +.cke_skin_v2 .cke_tpl_list a:focus * +{ cursor: pointer; - cursor: hand; +} + +/* IE6 contextual selectors childs won't get :hover transition until, + the hover style of the link itself contains certain CSS declarations.*/ +.cke_skin_v2 .cke_browser_ie6 .cke_tpl_list a:active, +.cke_skin_v2 .cke_browser_ie6 .cke_tpl_list a:hover, +.cke_skin_v2 .cke_browser_ie6 .cke_tpl_list a:focus +{ + background-position: 0 0; } .cke_skin_v2 .cke_tpl_list a:active .cke_tpl_item, @@ -66,14 +80,6 @@ For licensing, see LICENSE.html or http://ckeditor.com/license border-width: 3px; } -/* - * Fix property 'cursor' doesn't inherit on table - */ -.cke_skin_v2 .cke_tpl_hover * -{ - cursor: inherit; -} - .cke_skin_v2 .cke_tpl_empty, .cke_tpl_loading { text-align: center; diff --git a/_source/skins/v2/toolbar.css b/_source/skins/v2/toolbar.css index ae2a8f6..926494c 100644 --- a/_source/skins/v2/toolbar.css +++ b/_source/skins/v2/toolbar.css @@ -285,6 +285,7 @@ For licensing, see LICENSE.html or http://ckeditor.com/license cursor: default; display: none; padding-left: 3px; + vertical-align:middle; } .cke_skin_v2 .cke_hc .cke_button .cke_label diff --git a/_source/themes/default/theme.js b/_source/themes/default/theme.js index b9150b4..85229c0 100644 --- a/_source/themes/default/theme.js +++ b/_source/themes/default/theme.js @@ -126,9 +126,9 @@ CKEDITOR.themes.add( 'default', (function() '' + '' + '' + - '' + - '' + - '' + + '' + + '' + + '' + '' + //Hide the container when loading skins, later restored by skin css. '' + diff --git a/ckeditor.asp b/ckeditor.asp new file mode 100644 index 0000000..bc644a4 --- /dev/null +++ b/ckeditor.asp @@ -0,0 +1,955 @@ +<% + ' + ' Copyright (c) 2003-2010, CKSource - Frederico Knabben. All rights reserved. + ' For licensing, see LICENSE.html or http://ckeditor.com/license + +' Shared variable for all instances ("static") +dim CKEDITOR_initComplete +dim CKEDITOR_returnedEvents + + '' + ' \brief CKEditor class that can be used to create editor + ' instances in ASP pages on server side. + ' @see http://ckeditor.com + ' + ' Sample usage: + ' @code + ' editor = new CKEditor + ' editor.editor "editor1", "

    Initial value.

    ", empty, empty + ' @endcode + +Class CKEditor + + '' + ' The version of %CKEditor. + private version + + '' + ' A constant string unique for each release of %CKEditor. + private mTimeStamp + + '' + ' URL to the %CKEditor installation directory (absolute or relative to document root). + ' If not set, CKEditor will try to guess it's path. + ' + ' Example usage: + ' @code + ' editor.basePath = "/ckeditor/" + ' @endcode + Public basePath + + '' + ' A boolean variable indicating whether CKEditor has been initialized. + ' Set it to true only if you have already included + ' <script> tag loading ckeditor.js in your website. + Public initialized + + '' + ' Boolean variable indicating whether created code should be printed out or returned by a function. + ' + ' Example 1: get the code creating %CKEditor instance and print it on a page with the "echo" function. + ' @code + ' editor = new CKEditor + ' editor.returnOutput = true + ' code = editor.editor("editor1", "

    Initial value.

    ", empty, empty) + ' response.write "

    Editor 1:

    " + ' response.write code + ' @endcode + Public returnOutput + + '' + ' A Dictionary with textarea attributes. + ' + ' When %CKEditor is created with the editor() method, a HTML <textarea> element is created, + ' it will be displayed to anyone with JavaScript disabled or with incompatible browser. + public textareaAttributes + + '' + ' A string indicating the creation date of %CKEditor. + ' Do not change it unless you want to force browsers to not use previously cached version of %CKEditor. + public timestamp + + '' + ' A dictionary that holds the instance configuration. + private oInstanceConfig + + '' + ' A dictionary that holds the configuration for all the instances. + private oAllInstancesConfig + + '' + ' A dictionary that holds event listeners for the instance. + private oInstanceEvents + + '' + ' A dictionary that holds event listeners for all the instances. + private oAllInstancesEvents + + '' + ' A Dictionary that holds global event listeners (CKEDITOR object) + private oGlobalEvents + + + Private Sub Class_Initialize() + version = "3.2.2" + timeStamp = "A4SD49X" + mTimeStamp = "A4SD49X" + + Set oInstanceConfig = CreateObject("Scripting.Dictionary") + Set oAllInstancesConfig = CreateObject("Scripting.Dictionary") + + Set oInstanceEvents = CreateObject("Scripting.Dictionary") + Set oAllInstancesEvents = CreateObject("Scripting.Dictionary") + Set oGlobalEvents = CreateObject("Scripting.Dictionary") + + Set textareaAttributes = CreateObject("Scripting.Dictionary") + textareaAttributes.Add "rows", 8 + textareaAttributes.Add "cols", 60 + End Sub + + '' + ' Creates a %CKEditor instance. + ' In incompatible browsers %CKEditor will downgrade to plain HTML <textarea> element. + ' + ' @param name (string) Name of the %CKEditor instance (this will be also the "name" attribute of textarea element). + ' @param value (string) Initial value. + ' + ' Example usage: + ' @code + ' set editor = New CKEditor + ' editor.editor "field1", "

    Initial value.

    " + ' @endcode + ' + ' Advanced example: + ' @code + ' set editor = new CKEditor + ' set config = CreateObject("Scripting.Dictionary") + ' config.Add "toolbar", Array( _ + ' Array( "Source", "-", "Bold", "Italic", "Underline", "Strike" ), _ + ' Array( "Image", "Link", "Unlink", "Anchor" ) _ + ' ) + ' set events = CreateObject("Scripting.Dictionary") + ' events.Add "instanceReady", "function (evt) { alert('Loaded second editor: ' + evt.editor.name );}" + + ' editor.editor "field1", "

    Initial value.

    ", config, events + ' @endcode + ' + public function editor(name, value) + dim attr, out, js, customConfig, extraConfig + dim attribute + + attr = "" + + for each attribute in textareaAttributes + attr = attr & " " & attribute & "=""" & replace( textareaAttributes( attribute ), """", """ ) & """" + next + + out = "" & vbcrlf + + if not(initialized) then + out = out & init() + end if + + set customConfig = configSettings() + js = returnGlobalEvents() + + extraConfig = (new JSON)( empty, customConfig, false ) + if extraConfig<>"" then extraConfig = ", " & extraConfig + js = js & "CKEDITOR.replace('" & name & "'" & extraConfig & ");" + + out = out & script(js) + + if not(returnOutput) then + response.write out + out = "" + end if + + editor = out + + oInstanceConfig.RemoveAll + oInstanceEvents.RemoveAll + end function + + '' + ' Replaces a <textarea> with a %CKEditor instance. + ' + ' @param id (string) The id or name of textarea element. + ' + ' Example 1: adding %CKEditor to <textarea name="article"></textarea> element: + ' @code + ' set editor = New CKEditor + ' editor.replace "article" + ' @endcode + ' + public function replaceInstance(id) + dim out, js, customConfig, extraConfig + + out = "" + if not(initialized) then + out = out & init() + end if + + set customConfig = configSettings() + js = returnGlobalEvents() + + extraConfig = (new JSON)( empty, customConfig, false ) + if extraConfig<>"" then extraConfig = ", " & extraConfig + js = js & "CKEDITOR.replace('" & id & "'" & extraConfig & ");" + + out = out & script(js) + + if not(returnOutput) then + response.write out + out = "" + end if + + replaceInstance = out + + oInstanceConfig.RemoveAll + oInstanceEvents.RemoveAll + end function + + '' + ' Replace all <textarea> elements available in the document with editor instances. + ' + ' @param className (string) If set, replace all textareas with class className in the page. + ' + ' Example 1: replace all <textarea> elements in the page. + ' @code + ' editor = new CKEditor + ' editor.replaceAll empty + ' @endcode + ' + ' Example 2: replace all <textarea class="myClassName"> elements in the page. + ' @code + ' editor = new CKEditor + ' editor.replaceAll 'myClassName' + ' @endcode + ' + function replaceAll(className) + dim out, js, customConfig + + out = "" + if not(initialized) then + out = out & init() + end if + + set customConfig = configSettings() + js = returnGlobalEvents() + + if (customConfig.Count=0) then + if (isEmpty(className)) then + js = js & "CKEDITOR.replaceAll();" + else + js = js & "CKEDITOR.replaceAll('" & className & "');" + end if + else + js = js & "CKEDITOR.replaceAll( function(textarea, config) {\n" + if not(isEmpty(className)) then + js = js & " var classRegex = new RegExp('(?:^| )' + '" & className & "' + '(?:$| )');\n" + js = js & " if (!classRegex.test(textarea.className))\n" + js = js & " return false;\n" + end if + js = js & " CKEDITOR.tools.extend(config, " & (new JSON)( empty, customConfig, false ) & ", true);" + js = js & "} );" + end if + + out = out & script(js) + + if not(returnOutput) then + response.write out + out = "" + end if + + replaceAll = out + + oInstanceConfig.RemoveAll + oInstanceEvents.RemoveAll + end function + + + '' + ' A Dictionary that holds the %CKEditor configuration for all instances + ' For the list of available options, see http://docs.cksource.com/ckeditor_api/symbols/CKEDITOR.config.html + ' + ' Example usage: + ' @code + ' editor.config("height") = 400 + ' // Use @@ at the beggining of a string to ouput it without surrounding quotes. + ' editor.config("width") = "@@screen.width * 0.8" + ' @endcode + Public Property Let Config( configKey, configValue ) + oAllInstancesConfig.Add configKey, configValue + End Property + + '' + ' Configuration options for the next instance + ' + Public Property Let instanceConfig( configKey, configValue ) + oInstanceConfig.Add configKey, configValue + End Property + + '' + ' Adds event listener. + ' Events are fired by %CKEditor in various situations. + ' + ' @param eventName (string) Event name. + ' @param javascriptCode (string) Javascript anonymous function or function name. + ' + ' Example usage: + ' @code + ' editor.addEventHandler "instanceReady", "function (ev) { " & _ + ' " alert('Loaded: ' + ev.editor.name); " & _ + ' "}" + ' @endcode + ' + public sub addEventHandler(eventName, javascriptCode) + if not(oAllInstancesEvents.Exists( eventName ) ) then + oAllInstancesEvents.Add eventName, Array() + end if + + dim listeners, size + listeners = oAllInstancesEvents( eventName ) + size = ubound(listeners) + 1 + redim preserve listeners(size) + listeners(size) = javascriptCode + + oAllInstancesEvents( eventName ) = listeners +' '' Avoid duplicates. fixme... +' if (!in_array($javascriptCode, $this->_events[$event])) { +' $this->_events[$event][] = $javascriptCode; +' } + end sub + + '' + ' Clear registered event handlers. + ' Note: this function will have no effect on already created editor instances. + ' + ' @param eventName (string) Event name, if set to 'empty' all event handlers will be removed. + ' + public sub clearEventHandlers( eventName ) + if not(isEmpty( eventName )) then + oAllInstancesEvents.Remove eventName + else + oAllInstancesEvents.RemoveAll + end if + end sub + + + '' + ' Adds event listener only for the next instance. + ' Events are fired by %CKEditor in various situations. + ' + ' @param eventName (string) Event name. + ' @param javascriptCode (string) Javascript anonymous function or function name. + ' + ' Example usage: + ' @code + ' editor.addInstanceEventHandler "instanceReady", "function (ev) { " & _ + ' " alert('Loaded: ' + ev.editor.name); " & _ + ' "}" + ' @endcode + ' + public sub addInstanceEventHandler(eventName, javascriptCode) + if not(oInstanceEvents.Exists( eventName ) ) then + oInstanceEvents.Add eventName, Array() + end if + + dim listeners, size + listeners = oInstanceEvents( eventName ) + size = ubound(listeners) + 1 + redim preserve listeners(size) + listeners(size) = javascriptCode + + oInstanceEvents( eventName ) = listeners +' '' Avoid duplicates. fixme... +' if (!in_array($javascriptCode, $this->_events[$event])) { +' $this->_events[$event][] = $javascriptCode; +' } + end sub + + '' + ' Clear registered event handlers. + ' Note: this function will have no effect on already created editor instances. + ' + ' @param eventName (string) Event name, if set to 'empty' all event handlers will be removed. + ' + public sub clearInstanceEventHandlers( eventName ) + if not(isEmpty( eventName )) then + oInstanceEvents.Remove eventName + else + oInstanceEvents.RemoveAll + end if + end sub + + '' + ' Adds global event listener. + ' + ' @param event (string) Event name. + ' @param javascriptCode (string) Javascript anonymous function or function name. + ' + ' Example usage: + ' @code + ' editor.addGlobalEventHandler "dialogDefinition", "function (ev) { " & _ + ' " alert('Loading dialog: ' + ev.data.name); " & _ + ' "}" + ' @endcode + ' + public sub addGlobalEventHandler( eventName, javascriptCode) + if not(oGlobalEvents.Exists( eventName ) ) then + oGlobalEvents.Add eventName, Array() + end if + + dim listeners, size + listeners = oGlobalEvents( eventName ) + size = ubound(listeners) + 1 + redim preserve listeners(size) + listeners(size) = javascriptCode + + oGlobalEvents( eventName ) = listeners + +' // Avoid duplicates. +' if (!in_array($javascriptCode, $this->_globalEvents[$event])) { +' $this->_globalEvents[$event][] = $javascriptCode; +' } + end sub + + '' + ' Clear registered global event handlers. + ' Note: this function will have no effect if the event handler has been already printed/returned. + ' + ' @param eventName (string) Event name, if set to 'empty' all event handlers will be removed . + ' + public sub clearGlobalEventHandlers( eventName ) + if not(isEmpty( eventName )) then + oGlobalEvents.Remove eventName + else + oGlobalEvents.RemoveAll + end if + end sub + + '' + ' Prints javascript code. + ' + ' @param string js + ' + private function script(js) + script = "" & vbcrlf + end function + + '' + ' Returns the configuration array (global and instance specific settings are merged into one array). + ' + ' @param instanceConfig (Dictionary) The specific configurations to apply to editor instance. + ' @param instanceEvents (Dictionary) Event listeners for editor instance. + ' + private function configSettings() + dim mergedConfig, mergedEvents + set mergedConfig = cloneDictionary(oAllInstancesConfig) + set mergedEvents = cloneDictionary(oAllInstancesEvents) + + if not(isEmpty(oInstanceConfig)) then + set mergedConfig = mergeDictionary(mergedConfig, oInstanceConfig) + end if + + if not(isEmpty(oInstanceEvents)) then + for each eventName in oInstanceEvents + code = oInstanceEvents( eventName ) + + if not(mergedEvents.Exists( eventName)) then + mergedEvents.Add eventName, code + else + + dim listeners, size + listeners = mergedEvents( eventName ) + size = ubound(listeners) + if isArray( code ) then + addedCount = ubound(code) + redim preserve listeners( size + addedCount + 1 ) + for i = 0 to addedCount + listeners(size + i + 1) = code (i) + next + else + size = size + 1 + redim preserve listeners(size) + listeners(size) = code + end if + + mergedEvents( eventName ) = listeners + end if + next + + end if + + dim i, eventName, handlers, configON, ub, code + + if mergedEvents.Count>0 then + if mergedConfig.Exists( "on" ) then + set configON = mergedConfig.items( "on" ) + else + set configON = CreateObject("Scripting.Dictionary") + mergedConfig.Add "on", configOn + end if + + for each eventName in mergedEvents + handlers = mergedEvents( eventName ) + code = "" + + if isArray(handlers) then + uB = ubound(handlers) + if (uB = 0) then + code = handlers(0) + else + code = "function (ev) {" + for i=0 to uB + code = code & "(" & handlers(i) & ")(ev);" + next + code = code & "}" + end if + else + code = handlers + end if + ' Using @@ at the beggining to signal JSON that we don't want this quoted. + configON.Add eventName, "@@" & code + next + +' set mergedConfig.Item("on") = configOn + end if + + set configSettings = mergedConfig + end function + + '' + ' Returns a copy of a scripting.dictionary object + ' + private function cloneDictionary( base ) + dim newOne, tmpKey + + Set newOne = CreateObject("Scripting.Dictionary") + for each tmpKey in base + newOne.Add tmpKey , base( tmpKey ) + next + + set cloneDictionary = newOne + end function + + '' + ' Combines two scripting.dictionary objects + ' The base object isn't modified, and extra gets all the properties in base + ' + private function mergeDictionary(base, extra) + dim newOne, tmpKey + + for each tmpKey in base + if not(extra.Exists( tmpKey )) then + extra.Add tmpKey, base( tmpKey ) + end if + next + + set mergeDictionary = extra + end function + + '' + ' Return global event handlers. + ' + private function returnGlobalEvents() + dim out, eventName, handlers + dim handlersForEvent, handler, code, i + out = "" + + if (isempty(CKEDITOR_returnedEvents)) then + set CKEDITOR_returnedEvents = CreateObject("Scripting.Dictionary") + end if + + for each eventName in oGlobalEvents + handlers = oGlobalEvents( eventName ) + + if not(CKEDITOR_returnedEvents.Exists(eventName)) then + CKEDITOR_returnedEvents.Add eventName, CreateObject("Scripting.Dictionary") + end if + + set handlersForEvent = CKEDITOR_returnedEvents.Item( eventName ) + + ' handlersForEvent is another dictionary + ' and handlers is an array + + for i = 0 to ubound(handlers) + code = handlers( i ) + + ' Return only new events + if not(handlersForEvent.Exists( code )) then + if (out <> "") then out = out & vbcrlf + out = out & "CKEDITOR.on('" & eventName & "', " & code & ");" + handlersForEvent.Add code, code + end if + next + next + + returnGlobalEvents = out + end function + + '' + ' Initializes CKEditor (executed only once). + ' + private function init() + dim out, args, path, extraCode, file + out = "" + + if (CKEDITOR_initComplete) then + init = "" + exit function + end if + + if (initialized) then + CKEDITOR_initComplete = true + init = "" + exit function + end if + + args = "" + path = ckeditorPath() + + if (timestamp <> "") and (timestamp <> "%" & "TIMESTAMP%") then + args = "?t=" & timestamp + end if + + ' Skip relative paths... + if (instr(path, "..") <> 0) then + out = out & script("window.CKEDITOR_BASEPATH='" & path & "';") + end if + + out = out & "" & vbcrlf + + extraCode = "" + if (timestamp <> mTimeStamp) then + extraCode = extraCode & "CKEDITOR.timestamp = '" & timestamp & "';" + end if + if (extraCode <> "") then + out = out & script(extraCode) + end if + + CKEDITOR_initComplete = true + initialized = true + + init = out + end function + + private function ckeditorFileName() + ckeditorFileName = "ckeditor.js" + end function + + '' + ' Return path to ckeditor.js. + ' + private function ckeditorPath() + if (basePath <> "") then + ckeditorPath = basePath + else + ' In classic ASP we can't get the location of this included script + ckeditorPath = "/ckeditor/" + end if + + ' Try to check if that folder contains the CKEditor files: + ' If it's a full URL avoid checking it as it might point to an external server. + if (instr(ckeditorPath, "://") <> 0) then exit function + + dim filename, oFSO, exists + filename = server.mapPath(basePath & ckeditorFileName()) + set oFSO = Server.CreateObject("Scripting.FileSystemObject") + exists = oFSO.FileExists(filename) + set oFSO = nothing + + if not(exists) then + response.clear + response.write "

    CKEditor path validation failed

    " + response.write "

    The path "" & ckeditorPath & "" doesn't include the CKEditor main file (" & ckeditorFileName() & ")

    " + response.write "

    Please, verify that you have set it correctly and/or adjust the 'basePath' property

    " + response.write "

    Checked for physical file: "" & filename & ""

    " + response.end + end if + end function + +End Class + + + +' URL: http://www.webdevbros.net/2007/04/26/generate-json-from-asp-datatypes/ +'************************************************************************************************************** +'' @CLASSTITLE: JSON +'' @CREATOR: Michal Gabrukiewicz (gabru at grafix.at), Michael Rebec +'' @CONTRIBUTORS: - Cliff Pruitt (opensource at crayoncowboy.com) +'' - Sylvain Lafontaine +'' - Jef Housein +'' - Jeremy Brown +'' @CREATEDON: 2007-04-26 12:46 +'' @CDESCRIPTION: Comes up with functionality for JSON (http://json.org) to use within ASP. +'' Correct escaping of characters, generating JSON Grammer out of ASP datatypes and structures +'' Some examples (all use the toJSON() method but as it is the class' default method it can be left out): +'' +'' <% +'' 'simple number +'' output = (new JSON)("myNum", 2, false) +'' 'generates {"myNum": 2} +'' +'' 'array with different datatypes +'' output = (new JSON)("anArray", array(2, "x", null), true) +'' 'generates "anArray": [2, "x", null] +'' '(note: the last parameter was true, thus no surrounding brackets in the result) +'' % > +'' +'' @REQUIRES: - +'' @OPTIONEXPLICIT: yes +'' @VERSION: 1.5.1 + +'************************************************************************************************************** +class JSON + + 'private members + private output, innerCall + + '********************************************************************************************************** + '* constructor + '********************************************************************************************************** + public sub class_initialize() + newGeneration() + end sub + + '****************************************************************************************** + '' @SDESCRIPTION: STATIC! takes a given string and makes it JSON valid + '' @DESCRIPTION: all characters which needs to be escaped are beeing replaced by their + '' unicode representation according to the + '' RFC4627#2.5 - http://www.ietf.org/rfc/rfc4627.txt?number=4627 + '' @PARAM: val [string]: value which should be escaped + '' @RETURN: [string] JSON valid string + '****************************************************************************************** + public function escape(val) + dim cDoubleQuote, cRevSolidus, cSolidus + cDoubleQuote = &h22 + cRevSolidus = &h5C + cSolidus = &h2F + dim i, currentDigit + for i = 1 to (len(val)) + currentDigit = mid(val, i, 1) + if ascw(currentDigit) > &h00 and ascw(currentDigit) < &h1F then + currentDigit = escapequence(currentDigit) + elseif ascw(currentDigit) >= &hC280 and ascw(currentDigit) <= &hC2BF then + currentDigit = "\u00" + right(padLeft(hex(ascw(currentDigit) - &hC200), 2, 0), 2) + elseif ascw(currentDigit) >= &hC380 and ascw(currentDigit) <= &hC3BF then + currentDigit = "\u00" + right(padLeft(hex(ascw(currentDigit) - &hC2C0), 2, 0), 2) + else + select case ascw(currentDigit) + case cDoubleQuote: currentDigit = escapequence(currentDigit) + case cRevSolidus: currentDigit = escapequence(currentDigit) + case cSolidus: currentDigit = escapequence(currentDigit) + end select + end if + escape = escape & currentDigit + next + end function + + '****************************************************************************************************************** + '' @SDESCRIPTION: generates a representation of a name value pair in JSON grammer + '' @DESCRIPTION: It generates a name value pair which is represented as {"name": value} in JSON. + '' the generation is fully recursive. Thus the value can also be a complex datatype (array in dictionary, etc.) e.g. + '' + '' <% + '' set j = new JSON + '' j.toJSON "n", array(RS, dict, false), false + '' j.toJSON "n", array(array(), 2, true), false + '' % > + '' + '' @PARAM: name [string]: name of the value (accessible with javascript afterwards). leave empty to get just the value + '' @PARAM: val [variant], [int], [float], [array], [object], [dictionary]: value which needs + '' to be generated. Conversation of the data types is as follows:
    + '' - ASP datatype -> JavaScript datatype + '' - NOTHING, NULL -> null + '' - INT, DOUBLE -> number + '' - STRING -> string + '' - BOOLEAN -> bool + '' - ARRAY -> array + '' - DICTIONARY -> Represents it as name value pairs. Each key is accessible as property afterwards. json will look like "name": {"key1": "some value", "key2": "other value"} + '' - multidimensional array -> Generates a 1-dimensional array (flat) with all values of the multidimensional array + '' - request object -> every property and collection (cookies, form, querystring, etc) of the asp request object is exposed as an item of a dictionary. Property names are lowercase. e.g. servervariables. + '' - OBJECT -> name of the type (if unknown type) or all its properties (if class implements reflect() method) + '' Implement a reflect() function if you want your custom classes to be recognized. The function must return + '' a dictionary where the key holds the property name and the value its value. Example of a reflect function within a User class which has firstname and lastname properties + '' + '' <% + '' function reflect() + '' . set reflect = server.createObject("scripting.dictionary") + '' . reflect.add "firstname", firstname + '' . reflect.add "lastname", lastname + '' end function + '' % > + '' + '' Example of how to generate a JSON representation of the asp request object and access the HTTP_HOST server variable in JavaScript: + '' + '' + '' + '' @PARAM: nested [bool]: indicates if the name value pair is already nested within another? if yes then the {} are left out. + '' @RETURN: [string] returns a JSON representation of the given name value pair + '****************************************************************************************************************** + public default function toJSON(name, val, nested) + if not nested and not isEmpty(name) then write("{") + if not isEmpty(name) then write("""" & escape(name) & """: ") + generateValue(val) + if not nested and not isEmpty(name) then write("}") + toJSON = output + + if innerCall = 0 then newGeneration() + end function + + '****************************************************************************************************************** + '* generate + '****************************************************************************************************************** + private function generateValue(val) + if isNull(val) then + write("null") + elseif isArray(val) then + generateArray(val) + elseif isObject(val) then + dim tName : tName = typename(val) + if val is nothing then + write("null") + elseif tName = "Dictionary" or tName = "IRequestDictionary" then + generateDictionary(val) + elseif tName = "IRequest" then + set req = server.createObject("scripting.dictionary") + req.add "clientcertificate", val.ClientCertificate + req.add "cookies", val.cookies + req.add "form", val.form + req.add "querystring", val.queryString + req.add "servervariables", val.serverVariables + req.add "totalbytes", val.totalBytes + generateDictionary(req) + elseif tName = "IStringList" then + if val.count = 1 then + toJSON empty, val(1), true + else + generateArray(val) + end if + else + generateObject(val) + end if + else + 'bool + dim varTyp + varTyp = varType(val) + if varTyp = 11 then + if val then write("true") else write("false") + 'int, long, byte + elseif varTyp = 2 or varTyp = 3 or varTyp = 17 or varTyp = 19 then + write(cLng(val)) + 'single, double, currency + elseif varTyp = 4 or varTyp = 5 or varTyp = 6 or varTyp = 14 then + write(replace(cDbl(val), ",", ".")) + else + ' Using @@ at the beggining to signal JSON that we don't want this quoted. + if left(val, 2) = "@@" then + write( mid( val, 3 ) ) + else + write("""" & escape(val & "") & """") + end if + end if + end if + generateValue = output + end function + + '****************************************************************************************************************** + '* generateArray + '****************************************************************************************************************** + private sub generateArray(val) + dim item, i + write("[") + i = 0 + 'the for each allows us to support also multi dimensional arrays + for each item in val + if i > 0 then write(",") + generateValue(item) + i = i + 1 + next + write("]") + end sub + + '****************************************************************************************************************** + '* generateDictionary + '****************************************************************************************************************** + private sub generateDictionary(val) + innerCall = innerCall + 1 + if val.count = 0 then + toJSON empty, null, true + exit sub + end if + dim key, i + write("{") + i = 0 + for each key in val + if i > 0 then write(",") + toJSON key, val(key), true + i = i + 1 + next + write("}") + innerCall = innerCall - 1 + end sub + + '****************************************************************************************************************** + '* generateObject + '****************************************************************************************************************** + private sub generateObject(val) + dim props + on error resume next + set props = val.reflect() + if err = 0 then + on error goto 0 + innerCall = innerCall + 1 + toJSON empty, props, true + innerCall = innerCall - 1 + else + on error goto 0 + write("""" & escape(typename(val)) & """") + end if + end sub + + '****************************************************************************************************************** + '* newGeneration + '****************************************************************************************************************** + private sub newGeneration() + output = empty + innerCall = 0 + end sub + + '****************************************************************************************** + '* JsonEscapeSquence + '****************************************************************************************** + private function escapequence(digit) + escapequence = "\u00" + right(padLeft(hex(ascw(digit)), 2, 0), 2) + end function + + '****************************************************************************************** + '* padLeft + '****************************************************************************************** + private function padLeft(value, totalLength, paddingChar) + padLeft = right(clone(paddingChar, totalLength) & value, totalLength) + end function + + '****************************************************************************************** + '* clone + '****************************************************************************************** + private function clone(byVal str, n) + dim i + for i = 1 to n : clone = clone & str : next + end function + + '****************************************************************************************** + '* write + '****************************************************************************************** + private sub write(val) + output = output & val + end sub + +end class +%> diff --git a/ckeditor.js b/ckeditor.js index 3d887fe..5f41ad4 100644 --- a/ckeditor.js +++ b/ckeditor.js @@ -3,122 +3,125 @@ 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:'A39E',version:'3.2.1',revision:'5372',_:{},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(){return this.ie&&document.domain!=window.location.hostname;}};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(//,'>');},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]*>/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;j1||i.length==1&&i[0].nodeName!='_cke_expando';},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));},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';}:b.webkit?function(){this.$.style.KhtmlUserSelect='none';}: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:'ltr',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,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]+)>)|(?:!--([\\S|\\s]*?)-->)|(?:([^\\s>]+)\\s*((?:(?:[^\"'>]+)|(?:\"[^\"]*\")|(?:'[^']*'))*)\\/?>))",'g')};};(function(){var l=/([\w\-:.]+)(?:(?:\s*=\s*(?:(?:"([^"]*)")|(?:'([^']*)')|([^\s>]+)))|(?=\s|$))/g,m={checked:1,compact:1,declare:1,defer:1,disabled:1,ismap:1,multiple:1,nohref:1,noresize:1,noshade:1,nowrap:1,readonly:1,selected:1};a.htmlParser.prototype={onTagOpen:function(){},onTagClose:function(){},onText:function(){},onCDATA:function(){},onComment:function(){},parse:function(n){var A=this;var o,p,q=0,r;while(o=A._.htmlPartsRegex.exec(n)){var s=o.index;if(s>q){var t=n.substring(q,s); -if(r)r.push(t);else A.onText(t);}q=A._.htmlPartsRegex.lastIndex;if(p=o[1]){p=p.toLowerCase();if(r&&f.$cdata[p]){A.onCDATA(r.join(''));r=null;}if(!r){A.onTagClose(p);continue;}}if(r){r.push(o[0]);continue;}if(p=o[3]){p=p.toLowerCase();var u={},v,w=o[4],x=!!(w&&w.charAt(w.length-1)=='/');if(w)while(v=l.exec(w)){var y=v[1].toLowerCase(),z=v[2]||v[3]||v[4]||'';if(!z&&m[y])u[y]=y;else u[y]=z;}A.onTagOpen(p,u,x);if(!r&&f.$cdata[p])r=[];continue;}if(p=o[2])A.onComment(p);}if(n.length>q)A.onText(n.substring(q,n.length));}};})();a.htmlParser.comment=function(l){this.value=l;this._={isBlockLike:false};};a.htmlParser.comment.prototype={type:8,writeHtml:function(l,m){var n=this.value;if(m){if(!(n=m.onComment(n,this)))return;if(typeof n!='string'){n.parent=this.parent;n.writeHtml(l,m);return;}}l.comment(n);}};(function(){var l=/[\t\r\n ]{2,}|[\t\r\n]/g;a.htmlParser.text=function(m){this.value=m;this._={isBlockLike:false};};a.htmlParser.text.prototype={type:3,writeHtml:function(m,n){var o=this.value;if(n&&!(o=n.onText(o,this)))return;m.text(o);}};})();(function(){a.htmlParser.cdata=function(l){this.value=l;};a.htmlParser.cdata.prototype={type:3,writeHtml:function(l){l.write(this.value);}};})();a.htmlParser.fragment=function(){this.children=[];this.parent=null;this._={isBlockLike:true,hasInlineStarted:false};};(function(){var l={colgroup:1,dd:1,dt:1,li:1,option:1,p:1,td:1,tfoot:1,th:1,thead:1,tr:1},m=e.extend({table:1,ul:1,ol:1,dl:1},f.table,f.ul,f.ol,f.dl),n=f.$list,o=f.$listItem;a.htmlParser.fragment.fromHtml=function(p,q){var r=new a.htmlParser(),s=[],t=new a.htmlParser.fragment(),u=[],v=[],w=t,x=false,y;function z(E){var F;if(u.length>0)for(var G=0;G=0;F--){if(E==u[F].name){u.splice(F,1);return;}}var G=[],H=[],I=w;while(I.type&&I.name!=E){if(!I._.isBlockLike)H.unshift(I);G.push(I);I=I.parent;}if(I.type){for(F=0;F0&&s.children[q-1]||null;if(r){if(p._.isBlockLike&&r.type==3){r.value=e.rtrim(r.value);if(r.value.length===0){s.children.pop();s.add(p);return;}}r.next=p;}p.previous=r;p.parent=s;s.children.push(p);s._.hasInlineStarted=p.type==3||p.type==1&&!p._.isBlockLike;},writeHtml:function(p,q){var r;this.filterChildren=function(){var s=new a.htmlParser.basicWriter();this.writeChildrenHtml.call(this,s,q,true);var t=s.getHtml();this.children=new a.htmlParser.fragment.fromHtml(t).children;r=1;};!this.name&&q&&q.onFragment(this);this.writeChildrenHtml(p,r?null:q);},writeChildrenHtml:function(p,q){for(var r=0;rn?1:0;};a.htmlParser.element.prototype={type:1,add:a.htmlParser.fragment.prototype.add,clone:function(){return new a.htmlParser.element(this.name,this.attributes);},writeHtml:function(m,n){var o=this.attributes,p=this,q=p.name,r,s,t,u;p.filterChildren=function(){if(!u){var z=new a.htmlParser.basicWriter();a.htmlParser.fragment.prototype.writeChildrenHtml.call(p,z,n);p.children=new a.htmlParser.fragment.fromHtml(z.getHtml()).children;u=1;}};if(n){for(;;){if(!(q=n.onElementName(q)))return;p.name=q;if(!(p=n.onElement(p)))return;p.parent=this.parent;if(p.name==q)break;if(p.type!=1){p.writeHtml(m,n);return;}q=p.name;if(!q){this.writeChildrenHtml.call(p,m,u?null:n);return;}}o=p.attributes;}m.openTag(q,o);var v=[];for(var w=0;w<2;w++)for(r in o){s=r;t=o[r];if(w==1)v.push([r,t]);else if(n){for(;;){if(!(s=n.onAttributeName(r))){delete o[r];break;}else if(s!=r){delete o[r];r=s;continue;}else break;}if(s)if((t=n.onAttribute(p,s,t))===false)delete o[s];else o[s]=t;}}if(m.sortAttributes)v.sort(l);var x=v.length;for(w=0;w=0;u--){var x=r[u];if(x){x.pri=s;q.splice(t,0,x);}}}};function n(q,r,s){if(r)for(var t in r){var u=q[t];q[t]=o(u,r[t],s);if(!u)q.$length++;}};function o(q,r,s){if(r){r.pri=s;if(q){if(!q.splice){if(q.pri>s)q=[r,q];else q=[q,r];q.filter=p;}else m(q,r,s);return q;}else{r.filter=r;return r;}}};function p(q){var r=typeof q=='object';for(var s=0;s');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.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.bookmarkContents=function(t){},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);},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){if(!this.collapsed){t=t||a.SHRINK_TEXT;var u=this.clone(),v=this.startContainer,w=this.endContainer,x=this.startOffset,y=this.endOffset,z=this.collapsed,A=1,B=1;if(v&&v.type==3)if(!x)u.setStartBefore(v);else if(x>=v.getLength())u.setStartAfter(v);else{u.setStartBefore(v);A=0;}if(w&&w.type==3)if(!y)u.setEndBefore(w);else if(y>=w.getLength())u.setEndAfter(w);else{u.setEndAfter(w);B=0;}var C=new d.walker(u);C.evaluator=function(G){return G.type==(t==a.SHRINK_ELEMENT?1:3);};var D;C.guard=function(G,H){if(t==a.SHRINK_ELEMENT&&G.type==3)return false;if(H&&G.equals(D))return false;if(!H&&G.type==1)D=G;return true;};if(A){var E=C[t==a.SHRINK_ELEMENT?'lastForward':'next']();E&&this.setStartBefore(E);}if(B){C.reset();var F=C[t==a.SHRINK_ELEMENT?'lastBackward':'previous']();F&&this.setEndAfter(F);}return!!(A||B);}},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;v.startContainer=t;v.startOffset=u;if(!v.endContainer){v.endContainer=t;v.endOffset=u;}l(v);},setEnd:function(t,u){var v=this;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),x=false;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(),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);};(function(){var l=function(r,s){var t=r.document,u=t.getBody(),v=false,w=function(){v=true;};u.on(s,w);(b.version>7?t.$:t.$.selection.createRange()).execCommand(s);u.removeListener(s,w);return v;},m=c?function(r,s){return l(r,s);}:function(r,s){try{return r.document.$.execCommand(s);}catch(t){return false;}},n=function(r){this.type=r;this.canUndo=this.type=='cut';};n.prototype={exec:function(r,s){var t=m(r,this.type);if(!t)alert(r.lang.clipboard[this.type+'Error']);return t;}};var o={canUndo:false,exec:c?function(r){r.focus();if(!r.document.getBody().fire('beforepaste')&&!l(r,'paste')){r.fire('pasteDialog');return false;}}:function(r){try{if(!r.document.getBody().fire('beforepaste')&&!r.document.$.execCommand('Paste',false,null))throw 0;}catch(s){setTimeout(function(){r.fire('pasteDialog');},0);return false;}}},p=function(r){if(this.mode!='wysiwyg')return;switch(r.data.keyCode){case 1000+86:case 2000+45:var s=this.document.getBody();if(!c&&s.fire('beforepaste'))r.cancel();else if(b.opera||b.gecko&&b.version<10900)s.fire('paste');return;case 1000+88:case 2000+46:var t=this;this.fire('saveSnapshot');setTimeout(function(){t.fire('saveSnapshot');},0);}};function q(r,s,t){var u=this.document;if(c&&u.getById('cke_pastebin'))return;if(s=='text'&&r.data&&r.data.$.clipboardData){var v=r.data.$.clipboardData.getData('text/plain');if(v){r.data.preventDefault();t(v);return;}}var w=this.getSelection(),x=new d.range(u),y=new h(s=='text'?'textarea':'div',u); -y.setAttribute('id','cke_pastebin');b.webkit&&y.append(u.createText('\xa0'));u.getBody().append(y);y.setStyles({position:'absolute',left:'-1000px',top:w.getStartElement().getDocumentPosition().y+'px',width:'1px',height:'1px',overflow:'hidden'});var z=w.createBookmarks();if(s=='text'){if(c){var A=u.getBody().$.createTextRange();A.moveToElementText(y.$);A.execCommand('Paste');r.data.preventDefault();}else{u.$.designMode='off';y.$.focus();}}else{x.setStartAt(y,1);x.setEndAt(y,2);x.select(true);}window.setTimeout(function(){s=='text'&&!c&&(u.$.designMode='on');y.remove();var B;y=b.webkit&&(B=y.getFirst())&&B.is&&B.hasClass('Apple-style-span')?B:y;w.selectBookmarks(z);t(y['get'+(s=='text'?'Value':'Html')]());},0);};j.add('clipboard',{requires:['dialog','htmldataprocessor'],init:function(r){r.on('paste',function(w){var x=w.data;if(x.html)r.insertHtml(x.html);else if(x.text)r.insertText(x.text);},null,null,1000);r.on('pasteDialog',function(w){setTimeout(function(){r.openDialog('paste');},0);});function s(w,x,y,z){var A=r.lang[x];r.addCommand(x,y);r.ui.addButton(w,{label:A,command:x});if(r.addMenuItems)r.addMenuItem(x,{label:A,command:x,group:'clipboard',order:z});};s('Cut','cut',new n('cut'),1);s('Copy','copy',new n('copy'),4);s('Paste','paste',o,8);a.dialog.add('paste',a.getUrl(this.path+'dialogs/paste.js'));r.on('key',p,r);var t=r.config.forcePasteAsPlainText?'text':'html';r.on('contentDom',function(){var w=r.document.getBody();w.on(t=='text'&&c||b.webkit?'paste':'beforepaste',function(x){if(u)return;q.call(r,x,t,function(y){if(!y)return;var z={};z[t]=y;r.fire('paste',z);});});});if(r.contextMenu){var u;function v(w){c&&w=='Paste'&&(u=1);var x=r.document.$.queryCommandEnabled(w)?2:0;u=0;return x;};r.contextMenu.addListener(function(){return{cut:v('Cut'),copy:v('Cut'),paste:b.webkit?2:v('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));var w=v.keys;w[39]='next';w[40]='next';w[9]='next';w[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;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(){q().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);switch(n.getKeystroke()){case 37:case 9:r=a.document.getById(q+(m+1));if(!r)r=a.document.getById(q+'0');r.focus();return false;case 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.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')||!(v||o.test(B.getName())))G=B.clone();}else if(C)G=C.clone();if(!G)G=w.createElement(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;}');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'}}); +(function(){if(!window.CKEDITOR)window.CKEDITOR=(function(){var a={timestamp:'A4SD49X',version:'3.2.2',revision:'5541',_:{},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(//,'>');},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]*>/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;j1||i.length==1&&i[0].nodeName!='_cke_expando';},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';}:b.webkit?function(){this.$.style.KhtmlUserSelect='none';}: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:'ltr',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);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]+)>)|(?:!--([\\S|\\s]*?)-->)|(?:([^\\s>]+)\\s*((?:(?:[^\"'>]+)|(?:\"[^\"]*\")|(?:'[^']*'))*)\\/?>))",'g')};};(function(){var l=/([\w\-:.]+)(?:(?:\s*=\s*(?:(?:"([^"]*)")|(?:'([^']*)')|([^\s>]+)))|(?=\s|$))/g,m={checked:1,compact:1,declare:1,defer:1,disabled:1,ismap:1,multiple:1,nohref:1,noresize:1,noshade:1,nowrap:1,readonly:1,selected:1};a.htmlParser.prototype={onTagOpen:function(){},onTagClose:function(){},onText:function(){},onCDATA:function(){},onComment:function(){},parse:function(n){var A=this;var o,p,q=0,r;while(o=A._.htmlPartsRegex.exec(n)){var s=o.index;if(s>q){var t=n.substring(q,s);if(r)r.push(t);else A.onText(t);}q=A._.htmlPartsRegex.lastIndex;if(p=o[1]){p=p.toLowerCase();if(r&&f.$cdata[p]){A.onCDATA(r.join(''));r=null;}if(!r){A.onTagClose(p);continue;}}if(r){r.push(o[0]);continue;}if(p=o[3]){p=p.toLowerCase();var u={},v,w=o[4],x=!!(w&&w.charAt(w.length-1)=='/');if(w)while(v=l.exec(w)){var y=v[1].toLowerCase(),z=v[2]||v[3]||v[4]||'';if(!z&&m[y])u[y]=y;else u[y]=z;}A.onTagOpen(p,u,x);if(!r&&f.$cdata[p])r=[];continue;}if(p=o[2])A.onComment(p);}if(n.length>q)A.onText(n.substring(q,n.length));}};})();a.htmlParser.comment=function(l){this.value=l;this._={isBlockLike:false};};a.htmlParser.comment.prototype={type:8,writeHtml:function(l,m){var n=this.value;if(m){if(!(n=m.onComment(n,this)))return;if(typeof n!='string'){n.parent=this.parent;n.writeHtml(l,m);return;}}l.comment(n);}};(function(){var l=/[\t\r\n ]{2,}|[\t\r\n]/g;a.htmlParser.text=function(m){this.value=m;this._={isBlockLike:false};};a.htmlParser.text.prototype={type:3,writeHtml:function(m,n){var o=this.value;if(n&&!(o=n.onText(o,this)))return;m.text(o);}};})();(function(){a.htmlParser.cdata=function(l){this.value=l;};a.htmlParser.cdata.prototype={type:3,writeHtml:function(l){l.write(this.value);}};})();a.htmlParser.fragment=function(){this.children=[];this.parent=null;this._={isBlockLike:true,hasInlineStarted:false};};(function(){var l={colgroup:1,dd:1,dt:1,li:1,option:1,p:1,td:1,tfoot:1,th:1,thead:1,tr:1},m=e.extend({table:1,ul:1,ol:1,dl:1},f.table,f.ul,f.ol,f.dl),n=f.$list,o=f.$listItem; +a.htmlParser.fragment.fromHtml=function(p,q){var r=new a.htmlParser(),s=[],t=new a.htmlParser.fragment(),u=[],v=[],w=t,x=false,y;function z(E){var F;if(u.length>0)for(var G=0;G=0;F--){if(E==u[F].name){u.splice(F,1);return;}}var G=[],H=[],I=w;while(I.type&&I.name!=E){if(!I._.isBlockLike)H.unshift(I);G.push(I);I=I.parent;}if(I.type){for(F=0;F0&&s.children[q-1]||null;if(r){if(p._.isBlockLike&&r.type==3){r.value=e.rtrim(r.value);if(r.value.length===0){s.children.pop();s.add(p);return;}}r.next=p;}p.previous=r;p.parent=s;s.children.push(p);s._.hasInlineStarted=p.type==3||p.type==1&&!p._.isBlockLike;},writeHtml:function(p,q){var r;this.filterChildren=function(){var s=new a.htmlParser.basicWriter();this.writeChildrenHtml.call(this,s,q,true);var t=s.getHtml();this.children=new a.htmlParser.fragment.fromHtml(t).children;r=1;};!this.name&&q&&q.onFragment(this);this.writeChildrenHtml(p,r?null:q);},writeChildrenHtml:function(p,q){for(var r=0;rn?1:0;};a.htmlParser.element.prototype={type:1,add:a.htmlParser.fragment.prototype.add,clone:function(){return new a.htmlParser.element(this.name,this.attributes);},writeHtml:function(m,n){var o=this.attributes,p=this,q=p.name,r,s,t,u;p.filterChildren=function(){if(!u){var z=new a.htmlParser.basicWriter();a.htmlParser.fragment.prototype.writeChildrenHtml.call(p,z,n);p.children=new a.htmlParser.fragment.fromHtml(z.getHtml()).children;u=1;}};if(n){for(;;){if(!(q=n.onElementName(q)))return;p.name=q;if(!(p=n.onElement(p)))return;p.parent=this.parent;if(p.name==q)break;if(p.type!=1){p.writeHtml(m,n);return;}q=p.name;if(!q){this.writeChildrenHtml.call(p,m,u?null:n);return;}}o=p.attributes;}m.openTag(q,o);var v=[];for(var w=0;w<2;w++)for(r in o){s=r;t=o[r];if(w==1)v.push([r,t]);else if(n){for(;;){if(!(s=n.onAttributeName(r))){delete o[r];break;}else if(s!=r){delete o[r];r=s;continue;}else break;}if(s)if((t=n.onAttribute(p,s,t))===false)delete o[s];else o[s]=t;}}if(m.sortAttributes)v.sort(l);var x=v.length;for(w=0;w=0;u--){var x=r[u];if(x){x.pri=s;q.splice(t,0,x);}}}};function n(q,r,s){if(r)for(var t in r){var u=q[t];q[t]=o(u,r[t],s);if(!u)q.$length++;}};function o(q,r,s){if(r){r.pri=s;if(q){if(!q.splice){if(q.pri>s)q=[r,q];else q=[q,r];q.filter=p;}else m(q,r,s);return q;}else{r.filter=r;return r;}}};function p(q){var r=q.type||q instanceof a.htmlParser.fragment;for(var s=0;s');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.bookmarkContents=function(t){},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);},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||a.SHRINK_TEXT;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==a.SHRINK_ELEMENT?1:3);};var E;D.guard=function(H,I){if(t==a.SHRINK_ELEMENT&&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==a.SHRINK_ELEMENT?'lastForward':'next']();F&&this.setStartAt(F,u?1:3);}if(C){D.reset();var G=D[t==a.SHRINK_ELEMENT?'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),x=false;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(),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));var w=v.keys;w[39]='next';w[40]='next';w[9]='next';w[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(){q().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';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;}');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};}});}},afterInit:function(l){if(c){var m=l.dataProcessor,n=m&&m.htmlFilter;n&&n.addRules({elements:{input:function(o){var p=o.attributes,q=p.type;if(q=='checkbox'||q=='radio')p.value=='on'&&delete p.value;}}});}},requires:['image']});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(O){var P=O.children.length,Q=O.children[P-1];while(Q&&Q.type==3&&!e.trim(Q.value))Q=O.children[--P];return Q;};function o(O,P){var Q=O.children,R=n(O);if(R){if((P||!c)&&R.type==1&&R.name=='br')Q.pop();if(R.type==3&&l.test(R.value))Q.pop();}};function p(O){var P=n(O);return!P||P.type==1&&P.name=='br'||O.name=='form'&&P.name=='input';};function q(O){o(O,true);if(p(O))if(c)O.add(new a.htmlParser.text('\xa0'));else O.add(new a.htmlParser.element('br',{}));};function r(O){o(O);if(p(O))O.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={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(O){var P=O.attributes;if(P){if(P.cke_temp)return false;var Q=['name','href','src'],R;for(var S=0;S]+)))/gi,A=/(?:])[^>]*>[\s\S]*<\/style>)|(?:<(:?link|meta|base)[^>]*>)/gi,B=/([^<]*)<\/cke:encoded>/gi,C=/(<\/?)((?:object|embed|param|html|body|head|title)[^>]*>)/gi,D=/(<\/?)cke:((?:html|body|head|title)[^>]*>)/gi,E=/]*?)\/?>(?!\s*<\/cke:\1)/gi;function F(O){return O.replace(z,'$& _cke_saved_$1');};function G(O){return O.replace(A,function(P){return ''+encodeURIComponent(P)+'';});};function H(O){return O.replace(B,function(P,Q){return decodeURIComponent(Q);});};function I(O){return O.replace(C,'$1cke:$2');};function J(O){return O.replace(D,'$1$2');};function K(O){return O.replace(E,'');};function L(O){return O.replace(//g,function(P){return '';});};function M(O){return O.replace(//g,function(P,Q){return decodeURIComponent(Q);});};function N(O,P){var Q=[],R=/<\!--\{cke_temp(comment)?\}(\d*?)-->/g,S=[//gi,//gi].concat(P);O=O.replace(//g,function(U){return '';});for(var T=0;T';});O=O.replace(R,function(U,V,W){return ''; -});return O;};j.add('htmldataprocessor',{requires:['htmlwriter'],init:function(O){var P=O.dataProcessor=new a.htmlDataProcessor(O);P.writer.forceSimpleAmpersand=O.config.forceSimpleAmpersand;P.dataFilter.addRules(v);P.dataFilter.addRules(w);P.htmlFilter.addRules(x);P.htmlFilter.addRules(y);}});a.htmlDataProcessor=function(O){var P=this;P.editor=O;P.writer=new a.htmlWriter();P.dataFilter=new a.htmlParser.filter();P.htmlFilter=new a.htmlParser.filter();};a.htmlDataProcessor.prototype={toHtml:function(O,P){O=N(O,this.editor.config.protectedSource);O=F(O);O=G(O);O=I(O);O=K(O);var Q=new h('div');Q.setHtml('a'+O);O=Q.getHtml().substr(1);O=J(O);O=H(O);O=M(O);var R=a.htmlParser.fragment.fromHtml(O,P),S=new a.htmlParser.basicWriter();R.writeHtml(S,this.dataFilter);O=S.getHtml(true);O=L(O);return O;},toDataFormat:function(O,P){var Q=this.writer,R=a.htmlParser.fragment.fromHtml(O,P);Q.reset();R.writeHtml(Q,this.htmlFilter);return Q.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});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};function m(r,s){r.getCommand(this.name).setState(s);};function n(r){var C=this;var s=r.data.path.elements,t,u,v=r.editor;for(var w=0;wG;A++)F[A].indent+=B;var I=j.list.arrayToList(F,E,null,r.config.enterMode,0);if(this.name=='outdent'){var J;if((J=t.getParent())&&J.is('li')){var K=I.listNode.getChildren(),L=[],M=K.count(),N;for(A=M-1;A>=0;A--){if((N=K.getItem(A))&&N.is&&N.is('li'))L.push(N);}}}if(I)I.listNode.replace(t);if(L&&L.length)for(A=0;A0;if(u.useIndentClasses){u.classNameRegex=new RegExp('(?:^|\\s+)('+r.config.indentClasses.join('|')+')(?=$|\\s)');u.indentClassMap={};for(var t=0;t=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;qD[F-1].indent+1){var J=D[F-1].indent+1-D[F].indent,K=D[F].indent;while(D[F]&&D[F].indent>=K){D[F].indent+=J;F++;}F--;}}var L=j.list.arrayToList(D,C,null,A.config.enterMode),M=L.listNode,N,O;function P(Q){if((N=M[Q?'getFirst':'getLast']())&&!(N.is&&N.isBlockBoundary())&&(O=B.root[Q?'getPrevious':'getNext'](d.walker.whitespaces(true)))&&!(O.is&&O.isBlockBoundary({br:1})))A.document.createElement('br')[Q?'insertBefore':'insertAfter'](N);};P(true);P();M.replace(B.root);};function s(A,B){this.name=A;this.type=B;};s.prototype={exec:function(A){A.focus();var B=A.document,C=A.getSelection(),D=C&&C.getRanges();if(!D||D.length<1)return;if(this.state==2){var E=B.getBody();E.trim();if(!E.getFirst()){var F=B.createElement(A.config.enterMode==1?'p':A.config.enterMode==3?'div':'br');F.appendTo(E);D=[new d.range(B)];if(F.is('br')){D[0].setStartBefore(F);D[0].setEndAfter(F);}else D[0].selectNodeContents(F);C.selectRanges(D);}else{var G=D.length==1&&D[0],H=G&&G.getEnclosedNode();if(H&&H.is&&this.type==H.getName())n.call(this,A,1);}}var I=C.createBookmarks(true),J=[],K={};while(D.length>0){G=D.shift();var L=G.getBoundaryNodes(),M=L.startNode,N=L.endNode;if(M.type==1&&M.getName()=='td')G.setStartAt(L.startNode,1);if(N.type==1&&N.getName()=='td')G.setEndAt(L.endNode,2);var O=G.createIterator(),P;O.forceBrBreak=this.state==2;while(P=O.getNextParagraph()){var Q=new d.elementPath(P),R=Q.elements,S=R.length,T=null,U=false,V=Q.blockLimit,W;for(var X=S-1;X>=0&&(W=R[X]);X--){if(l[W.getName()]&&V.contains(W)){V.removeCustomData('list_group_object');var Y=W.getCustomData('list_group_object');if(Y)Y.contents.push(P);else{Y={root:W,contents:[P]};J.push(Y);h.setMarker(K,W,'list_group_object',Y);}U=true;break;}}if(U)continue;var Z=V;if(Z.getCustomData('list_group_object'))Z.getCustomData('list_group_object').contents.push(P);else{Y={root:Z,contents:[P]};h.setMarker(K,Z,'list_group_object',Y);J.push(Y);}}}var aa=[];while(J.length>0){Y=J.shift();if(this.state==2){if(l[Y.root.getName()])p.call(this,A,Y,K,aa); -else q.call(this,A,Y,aa);}else if(this.state==1&&l[Y.root.getName()])r.call(this,A,Y,K);}for(X=0;X0)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,s){return function(){var t=r.getViewPaneSize();s.resize(t.width,t.height,null,true);};};function q(r){if(r.focusManager.hasFocus){var s=r.container.append(h.createFromHtml('')); -s.on('focus',function(){r.focus();});s.focus();s.remove();}};j.add('maximize',{init:function(r){var s=r.lang,t=a.document,u=t.getWindow(),v,w,x,y=p(u,r),z=2;r.addCommand('maximize',{modes:{wysiwyg:1,source:1},editorFocus:false,exec:function(){var A=r.container.getChild(1),B=r.getThemeSpace('contents');if(r.mode=='wysiwyg'){var C=r.getSelection();v=C&&C.getRanges();w=u.getScrollPosition();}else{var D=r.textarea.$;v=!c&&[D.selectionStart,D.selectionEnd];w=[D.scrollLeft,D.scrollTop];}if(this.state==2){u.on('resize',y);x=u.getScrollPosition();var E=r.container;while(E=E.getParent()){E.setCustomData('maximize_saved_styles',n(E));E.setStyle('z-index',r.config.baseFloatZIndex-1);}B.setCustomData('maximize_saved_styles',n(B,true));A.setCustomData('maximize_saved_styles',n(A,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 F=u.getViewPaneSize();A.setStyle('position','absolute');A.$.offsetLeft;A.setStyles({'z-index':r.config.baseFloatZIndex-1,left:'0px',top:'0px'});r.resize(F.width,F.height,null,true);var G=A.getDocumentPosition();A.setStyles({left:-1*G.x+'px',top:-1*G.y+'px'});b.gecko&&q(r);A.addClass('cke_maximized');}else if(this.state==1){u.removeListener('resize',y);var H=[B,A];for(var I=0;I 
    ');m=l.createFakeElement(m,'cke_pagebreak','div');var n=l.getSelection().getRanges();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();}}}};(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();});}});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;},function(){window.netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect');var q=window.Components.classes['@mozilla.org/widget/clipboard;1'].getService(window.Components.interfaces.nsIClipboard),r=window.Components.classes['@mozilla.org/widget/transferable;1'].createInstance(window.Components.interfaces.nsITransferable);r.addDataFlavor('text/unicode');q.getData(r,q.kGlobalClipboard);var s={},t={},u;r.getTransferData('text/unicode',s,t);s=s.value.QueryInterface(window.Components.interfaces.nsISupportsString);u=s.data.substring(0,t.value/2);return u;});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'});}});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=l.getSelection().getRanges();for(var p=0,q;q=o[p];p++){if(q.collapsed)continue;q.enlarge(1);var r=q.createBookmark(),s=r.startNode,t=r.endNode,u=function(x){var y=new d.elementPath(x),z=y.elements;for(var A=1,B;B=z[A];A++){if(B.equals(y.block)||B.equals(y.blockLimit))break;if(m.test(B.getName()))x.breakParent(B);}};u(s);u(t);var v=s.getNextSourceNode(true,1); -while(v){if(v.equals(t))break;var w=v.getNextSourceNode(false,1);if(!(v.getName()=='img'&&v.getAttribute('_cke_realelement')))if(m.test(v.getName()))v.remove(true);else v.removeAttributes(n);v=w;}q.moveToBookmark(r);}l.getSelection().selectRanges(o);}}}};i.removeFormatTags='b,big,code,del,dfn,em,font,i,ins,kbd,q,samp,small,span,strike,strong,sub,sup,tt,u,var';i.removeFormatAttributes='class,style,lang,width,height,align,hspace,valign';j.add('resize',{init:function(l){var m=l.config;if(m.resize_enabled){var n=null,o,p;function q(t){var u=t.data.$.screenX-o.x,v=t.data.$.screenY-o.y,w=p.width+u*(l.lang.dir=='rtl'?-1:1),x=p.height+v;l.resize(Math.max(m.resize_minWidth,Math.min(w,m.resize_maxWidth)),Math.max(m.resize_minHeight,Math.min(x,m.resize_maxHeight)));};function r(t){a.document.removeListener('mousemove',q);a.document.removeListener('mouseup',r);if(l.document){l.document.removeListener('mousemove',q);l.document.removeListener('mouseup',r);}};var s=e.addFunction(function(t){if(!n)n=l.getResizable();p={width:n.$.offsetWidth||0,height:n.$.offsetHeight||0};o={x:t.screenX,y:t.screenY};a.document.on('mousemove',q);a.document.on('mouseup',r);if(l.document){l.document.on('mousemove',q);l.document.on('mouseup',r);}});l.on('destroy',function(){e.removeFunction(s);});l.on('themeSpace',function(t){if(t.data.space=='bottom')t.data.html+='
    ';},l,null,100);}}});i.resize_minWidth=750;i.resize_minHeight=250;i.resize_maxWidth=3000;i.resize_maxHeight=3000;i.resize_enabled=true;(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='',n=null,o=null;function p(u,v){var w=false,x;for(x in v){if(v[x]===u||v[x]==u){w=true;break;}}return w;};var q=function(){var u=this,v=function(){var y={};y.srcNodeRef=u.document.getWindow().$.frameElement;y.assocApp='CKEDITOR.'+a.version+'@'+a.revision;y.customerid=u.config.scayt_customerid||'1:WvF0D4-UtPqN1-43nkD4-NKvUm2-daQqk3-LmNiI-z7Ysb4-mwry24-T8YrS3-Q2tpq2';y.customDictionaryIds=u.config.scayt_customDictionaryIds||'';y.userDictionaryName=u.config.scayt_userDictionaryName||'';y.sLang=u.config.scayt_sLang||'en_US';y.onBeforeChange=function(){if(!u.checkDirty())setTimeout(function(){u.resetDirty(); -});};var z=window.scayt_custom_params;if(typeof z=='object')for(var A in z)y[A]=z[A];if(o)y.id=o;var B=new window.scayt(y),C=r.instances[u.name];if(C){B.sLang=C.sLang;B.option(C.option());B.paused=C.paused;}r.instances[u.name]=B;var D='scaytButton',E=window.scayt.uiTags,F=[];for(var G=0,H=4;G=0){this.setState(0);u.on('showScaytState',function(){this.removeListener();this.setState(r.isScaytEnabled(u)?1:2);},this);r.loadEngine(u);}}};j.add('scayt',{requires:['menubutton'],beforeInit:function(u){u.config.menu_groups='scayt_suggest,scayt_moresuggest,scayt_control,'+u.config.menu_groups;},init:function(u){var v={},w={},x=u.addCommand(l,t);a.dialog.add(l,a.getUrl(this.path+'dialogs/options.js'));var y=u.config.scayt_uiTabs||'1,1,1',z=[];y=y.split(',');for(var A=0,B=3;A 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);});},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: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},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(S.type==1&&m.test(S.getName())&&!S.getCustomData('selected_cell')){h.setMarker(J,S,'selected_cell',true); -I.push(S);}};for(var L=0;L0&&P.$.rows[K]||P.$.parentNode);for(M=I.length;M>=0;M--){if(I[M])r(I[M]);}return J;}else if(F instanceof h){P=F.getAscendant('table');if(P.$.rows.length==1)P.remove();else F.remove();}return 0;};function s(F,G){var H=F.getStartElement(),I=H.getAscendant('td',true)||H.getAscendant('th',true);if(!I)return;var J=I.getAscendant('table'),K=I.$.cellIndex;for(var L=0;L=0;H--){if(G[H])t(G[H]);}}else if(F instanceof h){var I=F.getAscendant('table'),J=F.$.cellIndex;for(H=I.$.rows.length-1;H>=0;H--){var K=new h(I.$.rows[H]);if(!J&&K.$.cells.length==1){r(K);continue;}if(K.$.cells[J])K.$.removeChild(K.$.cells[J]);}}};function u(F,G){var H=F.getStartElement(),I=H.getAscendant('td',true)||H.getAscendant('th',true);if(!I)return;var J=I.clone();if(!c)J.appendBogus();if(G)J.insertBefore(I);else J.insertAfter(I);};function v(F){if(F instanceof d.selection){var G=n(F),H=G[0]&&G[0].getAscendant('table'),I=o(G);for(var J=G.length-1; -J>=0;J--)v(G[J]);if(I)x(I,true);else if(H)H.remove();}else if(F instanceof h){var K=F.getParent();if(K.getChildCount()==1)K.remove();else F.remove();}};function w(F){var G=F.getBogus();G&&G.remove();F.trim();};function x(F,G){var H=new d.range(F.getDocument());if(!H['moveToElementEdit'+(G?'End':'Start')](F)){H.selectNodeContents(F);H.collapse(G?false:true);}H.select(true);};function y(F){var G=F.$.rows,H=-1,I=[];for(var J=0;J=P)L.removeAttribute('rowSpan');else L.$.rowSpan=V;if(V>=O)L.removeAttribute('colSpan');else L.$.colSpan=W;var ah=new d.nodeList(M.$.rows),ai=ah.count();for(Z=ai-1;Z>=0;Z--){var aj=ah.getItem(Z);if(!aj.$.cells.length){aj.remove();ai++;continue;}}return L;}else return V*W==Y;};function C(F,G){var H=n(F);if(H.length>1)return false;else if(G)return true;var I=H[0],J=I.getParent(),K=J.getAscendant('table'),L=y(K),M=J.$.rowIndex,N=z(L,M,I),O=I.$.rowSpan,P,Q,R,S; -if(O>1){Q=Math.ceil(O/2);R=Math.floor(O/2);S=M+Q;var T=new h(K.$.rows[S]),U=z(L,S),V;P=I.clone();for(var W=0;WN){P.insertBefore(new h(V));break;}else V=null;}if(!V)T.append(P,true);}else{R=Q=1;T=J.clone();T.insertAfter(J);T.append(P=I.clone());var X=z(L,M);for(var Y=0;Y1)return false;else if(G)return true;var I=H[0],J=I.getParent(),K=J.getAscendant('table'),L=y(K),M=J.$.rowIndex,N=z(L,M,I),O=I.$.colSpan,P,Q,R;if(O>1){Q=Math.ceil(O/2);R=Math.floor(O/2);}else{R=Q=1;var S=A(L,N);for(var T=0;T0?2:0};}},tablecell_insertBefore:{label:G.cell.insertBefore,group:'tablecell',command:'cellInsertBefore',order:5},tablecell_insertAfter:{label:G.cell.insertAfter,group:'tablecell',command:'cellInsertAfter',order:10},tablecell_delete:{label:G.cell.deleteCell,group:'tablecell',command:'cellDelete',order:15},tablecell_merge:{label:G.cell.merge,group:'tablecell',command:'cellMerge',order:16},tablecell_merge_right:{label:G.cell.mergeRight,group:'tablecell',command:'cellMergeRight',order:17},tablecell_merge_down:{label:G.cell.mergeDown,group:'tablecell',command:'cellMergeDown',order:18},tablecell_split_horizontal:{label:G.cell.splitHorizontal,group:'tablecell',command:'cellHorizontalSplit',order:19},tablecell_split_vertical:{label:G.cell.splitVertical,group:'tablecell',command:'cellVerticalSplit',order:20},tablecell_properties:{label:G.cell.title,group:'tablecellproperties',command:'cellProperties',order:21},tablerow:{label:G.row.menu,group:'tablerow',order:1,getItems:function(){return{tablerow_insertBefore:2,tablerow_insertAfter:2,tablerow_delete:2};}},tablerow_insertBefore:{label:G.row.insertBefore,group:'tablerow',command:'rowInsertBefore',order:5},tablerow_insertAfter:{label:G.row.insertAfter,group:'tablerow',command:'rowInsertAfter',order:10},tablerow_delete:{label:G.row.deleteRow,group:'tablerow',command:'rowDelete',order:15},tablecolumn:{label:G.column.menu,group:'tablecolumn',order:1,getItems:function(){return{tablecolumn_insertBefore:2,tablecolumn_insertAfter:2,tablecolumn_delete:2};}},tablecolumn_insertBefore:{label:G.column.insertBefore,group:'tablecolumn',command:'columnInsertBefore',order:5},tablecolumn_insertAfter:{label:G.column.insertAfter,group:'tablecolumn',command:'columnInsertAfter',order:10},tablecolumn_delete:{label:G.column.deleteColumn,group:'tablecolumn',command:'columnDelete',order:15}});if(F.contextMenu)F.contextMenu.addListener(function(H,I){if(!H)return null;while(H){if(H.getName() in E)return{tablecell:2,tablerow:2,tablecolumn:2}; -H=H.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)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');};}});function l(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);};var 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.snapshots.splice(t.index,1,t.currentImage=new l(t.editor));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;function n(w){if(this.mode=='wysiwyg'){this.focus();this.fire('saveSnapshot');var x=this.getSelection(),y=w.data;if(this.dataProcessor)y=this.dataProcessor.toHtml(y);if(c){var z=x.isLocked;if(z)x.unlock();var A=x.getNative();if(A.type=='Control')A.clear();A.createRange().pasteHTML(y);if(z)this.getSelection().lock();}else this.document.$.execCommand('inserthtml',false,y);e.setTimeout(function(){this.fire('saveSnapshot');},0,this);}};function o(w){if(this.mode=='wysiwyg'){this.focus();this.fire('saveSnapshot');var x=w.data,y=x.getName(),z=f.$block[y],A=this.getSelection(),B=A.getRanges(),C=A.isLocked;if(C)A.unlock();var D,E,F,G;for(var H=B.length-1;H>=0;H--){D=B[H];D.deleteContents();E=!H&&x||x.clone(true);var I,J;if(z)while((I=D.getCommonAncestor(false,true))&&(J=f[I.getName()])&&!(J&&J[y])){if(I.getName() in f.span)D.splitElement(I); -else if(D.checkStartOfBlock()&&D.checkEndOfBlock()){D.setStartBefore(I);D.collapse(true);I.remove();}else D.splitBlock();}D.insertNode(E);if(!F)F=E;}D.moveToPosition(F,4);var K=F.getNextSourceNode(true);if(K&&K.type==1)D.moveToElementEditStart(K);A.selectRanges([D]);if(C)this.getSelection().lock();e.setTimeout(function(){this.fire('saveSnapshot');},0,this);}};function p(w){if(!w.checkDirty())setTimeout(function(){w.resetDirty();});};var q=d.walker.whitespaces(true),r=d.walker.bookmark(false,true);function s(w){return q(w)&&r(w);};function t(w){return w.type==3&&e.trim(w.getText()).match(/^(?: |\xa0)$/);};function u(w){if(w.isLocked){w.unlock();setTimeout(function(){w.lock();},0);}};function v(w){var x=w.editor,y=w.data.path,z=y.blockLimit,A=w.data.selection,B=A.getRanges()[0],C=x.document.getBody(),D=x.config.enterMode;if(D!=2&&B.collapsed&&z.getName()=='body'&&!y.block){p(x);c&&u(A);var E=B.fixBlock(true,x.config.enterMode==3?'div':'p');if(c){var F=E.getFirst(s);F&&t(F)&&F.remove();}if(E.getOuterHtml().match(m)){var G=E.getPrevious(q),H=E.getNext(q);if(G&&G.getName&&!(G.getName() in l)&&B.moveToElementEditStart(G)||H&&H.getName&&!(H.getName() in l)&&B.moveToElementEditStart(H))E.remove();}B.select();if(!c)x.selectionChange();}var I=new d.range(x.document),J=new d.walker(I);I.selectNodeContents(C);J.evaluator=function(L){return L.type==1&&L.getName() in l;};J.guard=function(L,M){return!(L.type==3&&q(L)||M);};if(J.previous()){p(x);c&&u(A);var K;if(D!=2)K=C.append(new h(D==1?'p':'div'));else K=C;if(!c)K.appendBogus();}};j.add('wysiwygarea',{requires:['editingblock'],init:function(w){var x=w.config.enterMode!=2?w.config.enterMode==3?'div':'p':false,y=w.lang.editorTitle.replace('%1',w.name);w.on('editingBlockReady',function(){var B,C,D,E,F,G,H=b.isCustomDomain(),I=function(L){if(C)C.remove();F=0;var M=!b.gecko&&e.addFunction(function(O){e.removeFunction(M);O.write(L);}),N='document.open();'+(H?'document.domain="'+document.domain+'";':'')+('parent.CKEDITOR.tools.callFunction('+M+',document);')+'document.close();';C=h.createFromHtml('');b.gecko&&C.on('load',function(O){O.removeListener();var P=C.getFrameDocument().$;P.open();P.write(L);P.close();});B.append(C);},J='',K=function(L){if(F)return; -F=1;w.fire('ariaWidget',C);var M=L.document,N=M.body,O=M.getElementById('cke_actscrpt');O.parentNode.removeChild(O);delete a._['contentDomReady'+w.name];N.spellcheck=!w.config.disableNativeSpellChecker;if(c){N.hideFocus=true;N.disabled=true;N.contentEditable=true;N.removeAttribute('disabled');}else M.designMode='on';try{M.execCommand('enableObjectResizing',false,!w.config.disableObjectResizing);}catch(T){}try{M.execCommand('enableInlineTableEditing',false,!w.config.disableNativeTableHandles);}catch(U){}L=w.window=new d.window(L);M=w.document=new g(M);if(!(c||b.opera))M.on('mousedown',function(V){var W=V.data.getTarget();if(W.is('img','hr','input','textarea','select'))w.getSelection().selectElement(W);});if(b.webkit){M.on('click',function(V){if(V.data.getTarget().is('input','select'))V.data.preventDefault();});M.on('mouseup',function(V){if(V.data.getTarget().is('input','textarea'))V.data.preventDefault();});}if(c&&M.$.compatMode=='CSS1Compat'){var P=M.getDocumentElement();P.on('mousedown',function(V){if(V.data.getTarget().equals(P))A.focus();});}var Q=c||b.webkit?L:M;Q.on('blur',function(){w.focusManager.blur();});Q.on('focus',function(){if(b.gecko){var V=N;while(V.firstChild)V=V.firstChild;if(!V.nextSibling&&'BR'==V.tagName&&V.hasAttribute('_moz_editor_bogus_node')){p(w);var W=M.$.createEvent('KeyEvents');W.initKeyEvent('keypress',true,true,L.$,false,false,false,false,0,32);M.$.dispatchEvent(W);var X=M.getBody().getFirst();if(w.config.enterMode==2)M.createElement('br',{attributes:{_moz_dirty:''}}).replace(X);else X.remove();}}w.focusManager.focus();});var R=w.keystrokeHandler;if(R)R.attach(M);if(c){M.on('keydown',function(V){var W=V.data.getKeystroke();if(W in {8:1,46:1}){var X=w.getSelection(),Y=X.getSelectedElement();if(Y){w.fire('saveSnapshot');var Z=X.getRanges()[0].createBookmark();Y.remove();X.selectBookmarks([Z]);w.fire('saveSnapshot');V.data.preventDefault();}}});if(M.$.compatMode=='CSS1Compat'){var S={33:1,34:1};M.on('keydown',function(V){if(V.data.getKeystroke() in S)setTimeout(function(){w.getSelection().scrollIntoView();},0);});}}if(w.contextMenu)w.contextMenu.addTarget(M,w.config.browserContextMenuOnCtrl!==false);setTimeout(function(){w.fire('contentDom');if(G){w.mode='wysiwyg';w.fire('mode');G=false;}D=false;if(E){w.focus();E=false;}setTimeout(function(){w.fire('dataReady');},0);if(c)setTimeout(function(){if(w.document){var V=w.document.$.body;V.runtimeStyle.marginBottom='0px';V.runtimeStyle.marginBottom='';}},1000);},0);};w.addMode('wysiwyg',{load:function(L,M,N){B=L; -if(c&&b.quirks)L.setStyle('position','relative');w.mayBeDirty=true;G=true;if(N)this.loadSnapshotData(M);else this.loadData(M);},loadData:function(L){D=true;var M=w.config,N=M.fullPage,O=M.docType,P='';!N&&(P=e.buildStyleHtml(w.config.contentsCss)+P);var Q=M.baseHref?'':'';if(N)L=L.replace(/]*>/i,function(R){w.docType=O=R;return '';});if(w.dataProcessor)L=w.dataProcessor.toHtml(L,x);if(N){if(!/]/.test(L))L=''+L;if(!/]/.test(L))L=''+L+'';if(!/]/.test(L))L=L.replace(/]*>/,'$&');Q&&(L=L.replace(//,'$&'+Q));L=L.replace(/<\/head\s*>/,P+'$&');L=O+L;}else L=M.docType+''+''+y+''+''+Q+P+''+''+L+'';L+=J;a._['contentDomReady'+w.name]=K;this.onDispose();I(L);},getData:function(){var L=w.config,M=L.fullPage,N=M&&w.docType,O=C.getFrameDocument(),P=M?O.getDocumentElement().getOuterHtml():O.getBody().getHtml();if(w.dataProcessor)P=w.dataProcessor.toDataFormat(P,x);if(L.ignoreEmptyParagraph)P=P.replace(m,'');if(N)P=N+'\n'+P;return P;},getSnapshotData:function(){return C.getFrameDocument().getBody().getHtml();},loadSnapshotData:function(L){C.getFrameDocument().getBody().setHtml(L);},onDispose:function(){if(!w.document)return;w.document.getDocumentElement().clearCustomData();w.document.getBody().clearCustomData();w.window.clearCustomData();w.document.clearCustomData();C.clearCustomData();},unload:function(L){this.onDispose();w.window=w.document=C=B=E=null;w.fire('contentDomUnload');},focus:function(){if(D)E=true;else if(w.window){w.window.focus();w.selectionChange();}}});w.on('insertHtml',n,null,null,20);w.on('insertElement',o,null,null,20);w.on('selectionChange',v,null,null,1);});var z;w.on('contentDom',function(){var B=w.document.getElementsByTag('title').getItem(0);B.setAttribute('_cke_title',w.document.$.title);w.document.$.title=y;});if(c){var A;w.on('uiReady',function(){A=w.container.append(h.createFromHtml(''));A.on('focus',function(){w.focus();});});w.on('destroy',function(){A.clearCustomData();});}}});if(b.gecko)(function(){var w=document.body;if(!w)window.addEventListener('load',arguments.callee,false);else w.setAttribute('onpageshow',w.getAttribute('onpageshow')+';event.persisted && CKEDITOR.tools.callFunction('+e.addFunction(function(){var x=a.instances,y,z; -for(var A in x){y=x[A];z=y.document;if(z){z.$.designMode='off';z.$.designMode='on';}}})+')');})();})();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(K){return!!this._.tabs[K][0].$.offsetHeight;};function m(){var O=this;var K=O._.currentTabId,L=O._.tabIdList.length,M=e.indexOf(O._.tabIdList,K)+L;for(var N=M-1;N>M-L;N--){if(l.call(O,O._.tabIdList[N%L]))return O._.tabIdList[N%L];}return null;};function n(){var O=this;var K=O._.currentTabId,L=O._.tabIdList.length,M=e.indexOf(O._.tabIdList,K);for(var N=M+1;N1){P._.tabBarMode=true;P._.tabs[P._.currentTabId][0].focus();T=1;}else if((ab==37||ab==39)&&P._.tabBarMode){ad=ab==37?m.call(P):n.call(P);P.selectPage(ad);P._.tabs[ad][0].focus();T=1;}else if((ab==13||ab==32)&&P._.tabBarMode){ae.selectPage(ae._.currentTabId);ae._.tabBarMode=false;ae._.currentFocusIndex=-1;S(true);T=1;}if(T){aa.stop();aa.data.preventDefault();}};function V(aa){T&&aa.data.preventDefault();};var W=this._.element;this.on('show',function(){W.on('keydown',U,this,null,0);if(b.opera||b.gecko&&b.mac)W.on('keypress',V,this);if(b.ie6Compat){var aa=y.getChild(0).getFrameDocument();aa.on('keydown',U,this,null,0);}});this.on('hide',function(){W.removeListener('keydown',U);if(b.opera||b.gecko&&b.mac)W.removeListener('keypress',V);});this.on('iframeAdded',function(aa){var ab=new g(aa.data.iframe.$.contentWindow.document);ab.on('keydown',U,this,null,0);});this.on('show',function(){var ae=this;R();if(K.config.dialog_startupFocusTab&&P._.tabIdList.length>1){P._.tabBarMode=true;P._.tabs[P._.currentTabId][0].focus();}else if(!ae._.hasFocus){ae._.currentFocusIndex=-1;if(M.onFocus){var aa=M.onFocus.call(ae);aa&&aa.focus();}else S(true);if(ae._.editor.mode=='wysiwyg'&&c){var ab=K.document.$.selection,ac=ab.createRange(); -if(ac)if(ac.parentElement&&ac.parentElement().ownerDocument==K.document.$||ac.item&&ac.item(0).ownerDocument==K.document.$){var ad=document.body.createTextRange();ad.moveToElementText(ae.getElement().getFirst().$);ad.collapse(true);ad.select();}}}},this,null,4294967295);if(b.ie6Compat)this.on('load',function(aa){var ab=this.getElement(),ac=ab.getFirst();ac.remove();ac.appendTo(ab);},this);v(this);w(this);new d.text(M.title,a.document).appendTo(this.parts.title);for(var X=0;X0?L:0)+'px',top:(M>0?M:0)+'px'});};})(),getPosition:function(){return e.extend({},this._.position);},show:function(){var K=this._.editor;if(K.mode=='wysiwyg'&&c){var L=K.getSelection();L&&L.lock(); -}var M=this._.element,N=this.definition;if(!(M.getParent()&&M.getParent().equals(a.document.getBody())))M.appendTo(a.document.getBody());else return;if(b.gecko&&b.version<10900){var O=this.parts.dialog;O.setStyle('position','absolute');setTimeout(function(){O.setStyle('position','fixed');},0);}this.resize(N.minWidth,N.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;z(this._.editor);M.on('keydown',C);M.on(b.opera?'keypress':'keyup',D);for(var P in {keyup:1,keydown:1,keypress:1})M.on(P,J);}else{this._.parentDialog=a.dialog._.currentTop;var Q=this._.parentDialog.getElement().getFirst();Q.$.style.zIndex-=Math.floor(this._.editor.config.baseFloatZIndex/2);a.dialog._.currentTop=this;}E(this,this,'\x1b',null,function(){this.getButton('cancel')&&this.getButton('cancel').click();});this._.hasFocus=false;e.setTimeout(function(){var R=a.document.getWindow().getViewPaneSize(),S=this.getSize();this.move((R.width-N.minWidth)/2,(R.height-S.height)/2);this.parts.dialog.setStyle('visibility','');this.fireOnce('load',{});this.fire('show',{});this._.editor.fire('dialogShow',this);this.foreach(function(T){T.setInitValue&&T.setInitValue();});},100,this);},foreach:function(K){var N=this;for(var L in N._.contents)for(var M in N._.contents[L])K(N._.contents[L][M]);return N;},reset:(function(){var K=function(L){if(L.reset)L.reset();};return function(){this.foreach(K);return this;};})(),setupContent:function(){var K=arguments;this.foreach(function(L){if(L.setup)L.setup.apply(L,K);});},commitContent:function(){var K=arguments;this.foreach(function(L){if(L.commit)L.commit.apply(L,K);});},hide:function(){this.fire('hide',{});this._.editor.fire('dialogHide',this);var K=this._.element;if(!K.getParent())return;K.remove();this.parts.dialog.setStyle('visibility','hidden');F(this);if(!this._.parentDialog)A();else{var L=this._.parentDialog.getElement().getFirst();L.setStyle('z-index',parseInt(L.$.style.zIndex,10)+Math.floor(this._.editor.config.baseFloatZIndex/2));}a.dialog._.currentTop=this._.parentDialog;if(!this._.parentDialog){a.dialog._.currentZIndex=null;K.removeListener('keydown',C);K.removeListener(b.opera?'keypress':'keyup',D);for(var M in {keyup:1,keydown:1,keypress:1})K.removeListener(M,J);var N=this._.editor; -N.focus();if(N.mode=='wysiwyg'&&c){var O=N.getSelection();O&&O.unlock(true);}}else a.dialog._.currentZIndex-=10;this.foreach(function(P){P.resetInitValue&&P.resetInitValue();});},addPage:function(K){var W=this;var L=[],M=K.label?' title="'+e.htmlEncode(K.label)+'"':'',N=K.elements,O=a.dialog._.uiElementBuilders.vbox.build(W,{type:'vbox',className:'cke_dialog_page_contents',children:K.elements,expand:!!K.expand,padding:K.padding,style:K.style||'width: 100%; height: 100%;'},L),P=h.createFromHtml(L.join(''));P.setAttribute('role','tabpanel');var Q=b,R=K.id+'_'+e.getNextNumber(),S=h.createFromHtml(['0?' cke_last':'cke_first',M,!!K.hidden?' style="display:none"':'',' id="',R,'"',Q.gecko&&Q.version>=10900&&!Q.hc?'':' href="javascript:void(0)"',' tabIndex="-1"',' hidefocus="true"',' role="tab">',K.label,''].join(''));P.setAttribute('aria-labelledby',R);W._.tabs[K.id]=[S,P];W._.tabIdList.push(K.id);!K.hidden&&W._.pageCount++;W._.lastTab=S;W.updateStyle();var T=W._.contents[K.id]={},U,V=O.getChild();while(U=V.shift()){T[U.id]=U;if(typeof U.getChild=='function')V.push.apply(V,U.getChild());}P.setAttribute('name',K.id);P.appendTo(W.parts.contents);S.unselectable();W.parts.tabs.append(S);if(K.accessKey){E(W,W,'CTRL+'+K.accessKey,H,G);W._.accessKeyMap['CTRL+'+K.accessKey]=K.id;}},selectPage:function(K){var P=this;for(var L in P._.tabs){var M=P._.tabs[L][0],N=P._.tabs[L][1];if(L!=K){M.removeClass('cke_dialog_tab_selected');N.hide();}N.setAttribute('aria-hidden',L!=K);}var O=P._.tabs[K];O[0].addClass('cke_dialog_tab_selected');O[1].show();P._.currentTabId=K;P._.currentTabIndex=e.indexOf(P._.tabIdList,K);},updateStyle:function(){this.parts.dialog[(this._.pageCount===1?'add':'remove')+'Class']('cke_single_page');},hidePage:function(K){var M=this;var L=M._.tabs[K]&&M._.tabs[K][0];if(!L||M._.pageCount==1)return;else if(K==M._.currentTabId)M.selectPage(m.call(M));L.hide();M._.pageCount--;M.updateStyle();},showPage:function(K){var M=this;var L=M._.tabs[K]&&M._.tabs[K][0];if(!L)return;L.show();M._.pageCount++;M.updateStyle();},getElement:function(){return this._.element;},getName:function(){return this._.name;},getContentElement:function(K,L){var M=this._.contents[K];return M&&M[L];},getValueOf:function(K,L){return this.getContentElement(K,L).getValue();},setValueOf:function(K,L,M){return this.getContentElement(K,L).setValue(M);},getButton:function(K){return this._.buttons[K];},click:function(K){return this._.buttons[K].click();},disableButton:function(K){return this._.buttons[K].disable(); -},enableButton:function(K){return this._.buttons[K].enable();},getPageCount:function(){return this._.pageCount;},getParentEditor:function(){return this._.editor;},getSelectedElement:function(){return this.getParentEditor().getSelection().getSelectedElement();},addFocusable:function(K,L){var N=this;if(typeof L=='undefined'){L=N._.focusList.length;N._.focusList.push(new o(N,K,L));}else{N._.focusList.splice(L,0,new o(N,K,L));for(var M=L+1;MV.width-U.width-P)aa=V.width-U.width+Q[1];else aa=M.x;if(M.y+Q[0]V.height-U.height-P)ab=V.height-U.height+Q[2];else ab=M.y;K.move(aa,ab);T.data.preventDefault();};function S(T){a.document.removeListener('mousemove',R);a.document.removeListener('mouseup',S);if(b.ie6Compat){var U=y.getChild(0).getFrameDocument();U.removeListener('mousemove',R);U.removeListener('mouseup',S);}};K.parts.title.on('mousedown',function(T){K._.updateSize=true;L={x:T.data.$.screenX,y:T.data.$.screenY};a.document.on('mousemove',R);a.document.on('mouseup',S);M=K.getPosition();if(b.ie6Compat){var U=y.getChild(0).getFrameDocument();U.on('mousemove',R);U.on('mouseup',S);}T.data.preventDefault();},K);};function w(K){var L=K.definition,M=L.minWidth||0,N=L.minHeight||0,O=L.resizable,P=K.getParentEditor().skin.margins||[0,0,0,0];function Q(ab,ac){ab.y+=ac;};function R(ab,ac){ab.x2+=ac;};function S(ab,ac){ab.y2+=ac;};function T(ab,ac){ab.x+=ac;};var U=null,V=null,W=K._.editor.config.magnetDistance,X=['tl','t','tr','l','r','bl','b','br'];function Y(ab){var ac=ab.listenerData.part,ad=K.getSize();V=K.getPosition();e.extend(V,{x2:V.x+ad.width,y2:V.y+ad.height});U={x:ab.data.$.screenX,y:ab.data.$.screenY};a.document.on('mousemove',Z,K,{part:ac});a.document.on('mouseup',aa,K,{part:ac});if(b.ie6Compat){var ae=y.getChild(0).getFrameDocument();ae.on('mousemove',Z,K,{part:ac});ae.on('mouseup',aa,K,{part:ac});}ab.data.preventDefault();};function Z(ab){var ac=ab.data.$.screenX,ad=ab.data.$.screenY,ae=ac-U.x,af=ad-U.y,ag=a.document.getWindow().getViewPaneSize(),ah=ab.listenerData.part;if(ah.search('t')!=-1)Q(V,af);if(ah.search('l')!=-1)T(V,ae);if(ah.search('b')!=-1)S(V,af);if(ah.search('r')!=-1)R(V,ae); -U={x:ac,y:ad};var ai,aj,ak,al;if(V.x+P[3]ag.width-W)ak=ag.width+P[1];else if(ah.search('r')!=-1&&V.x2-V.xag.height-W)al=ag.height+P[2];else if(ah.search('b')!=-1&&V.y2-V.y'];if(b.ie6Compat){var O=b.isCustomDomain(),P="";N.push('');}N.push('
    ');y=h.createFromHtml(N.join(''));}var Q=y,R=function(){var V=L.getViewPaneSize();Q.setStyles({width:V.width+'px',height:V.height+'px'});},S=function(){var V=L.getScrollPosition(),W=a.dialog._.currentTop;Q.setStyles({left:V.x+'px',top:V.y+'px'});do{var X=W.getPosition();W.move(X.x,X.y);}while(W=W._.parentDialog)};x=R;L.on('resize',R);R();if(b.ie6Compat){var T=function(){S();arguments.callee.prevScrollHandler.apply(this,arguments);};L.$.setTimeout(function(){T.prevScrollHandler=window.onscroll||(function(){});window.onscroll=T;},0);S();}var U=K.config.dialog_backgroundCoverOpacity;Q.setOpacity(typeof U!='undefined'?U:0.5);Q.appendTo(a.document.getBody());},A=function(){if(!y)return;var K=a.document.getWindow();y.remove();K.removeListener('resize',x);if(b.ie6Compat)K.$.setTimeout(function(){var L=window.onscroll&&window.onscroll.prevScrollHandler;window.onscroll=L||null;},0);x=null;},B={},C=function(K){var L=K.data.$.ctrlKey||K.data.$.metaKey,M=K.data.$.altKey,N=K.data.$.shiftKey,O=String.fromCharCode(K.data.$.keyCode),P=B[(L?'CTRL+':'')+(M?'ALT+':'')+(N?'SHIFT+':'')+O]; -if(!P||!P.length)return;P=P[P.length-1];P.keydown&&P.keydown.call(P.uiElement,P.dialog,P.key);K.data.preventDefault();},D=function(K){var L=K.data.$.ctrlKey||K.data.$.metaKey,M=K.data.$.altKey,N=K.data.$.shiftKey,O=String.fromCharCode(K.data.$.keyCode),P=B[(L?'CTRL+':'')+(M?'ALT+':'')+(N?'SHIFT+':'')+O];if(!P||!P.length)return;P=P[P.length-1];if(P.keyup){P.keyup.call(P.uiElement,P.dialog,P.key);K.data.preventDefault();}},E=function(K,L,M,N,O){var P=B[M]||(B[M]=[]);P.push({uiElement:K,dialog:L,key:M,keyup:O||K.accessKeyUp,keydown:N||K.accessKeyDown});},F=function(K){for(var L in B){var M=B[L];for(var N=M.length-1;N>=0;N--){if(M[N].dialog==K||M[N].uiElement==K)M.splice(N,1);}if(M.length===0)delete B[L];}},G=function(K,L){if(K._.accessKeyMap[L])K.selectPage(K._.accessKeyMap[L]);},H=function(K,L){},I={27:1,13:1},J=function(K){if(K.data.getKeystroke() in I)K.data.stopPropagation();};(function(){k.dialog={uiElement:function(K,L,M,N,O,P,Q){if(arguments.length<4)return;var R=(N.call?N(L):N)||'div',S=['<',R,' '],T=(O&&O.call?O(L):O)||{},U=(P&&P.call?P(L):P)||{},V=(Q&&Q.call?Q.call(this,K,L):Q)||'',W=this.domId=U.id||e.getNextNumber()+'_uiElement',X=this.id=L.id,Y;U.id=W;var Z={};if(L.type)Z['cke_dialog_ui_'+L.type]=1;if(L.className)Z[L.className]=1;var aa=U['class']&&U['class'].split?U['class'].split(' '):[];for(Y=0;Y=0;Y--){if(ac[Y]==='')ac.splice(Y,1);}if(ac.length>0)U.style=(U.style?U.style+'; ':'')+ac.join('; ');for(Y in U)S.push(Y+'="'+e.htmlEncode(U[Y])+'" ');S.push('>',V,'');M.push(S.join(''));(this._||(this._={})).dialog=K;if(typeof L.isChanged=='boolean')this.isChanged=function(){return L.isChanged;};if(typeof L.isChanged=='function')this.isChanged=L.isChanged;a.event.implementOn(this);this.registerEvents(L);if(this.accessKeyUp&&this.accessKeyDown&&L.accessKey)E(this,K,'CTRL+'+L.accessKey);var ad=this;K.on('load',function(){if(ad.getInputElement())ad.getInputElement().on('focus',function(){K._.tabBarMode=false;K._.hasFocus=true;ad.fire('focus');},ad);});if(this.keyboardFocusable){this.tabIndex=L.tabIndex||0;this.focusIndex=K._.focusList.push(this)-1;this.on('focus',function(){K._.currentFocusIndex=ad.focusIndex;});}e.extend(this,L);},hbox:function(K,L,M,N,O){if(arguments.length<4)return;this._||(this._={});var P=this._.children=L,Q=O&&O.widths||null,R=O&&O.height||null,S={},T,U=function(){var W=['
    ');for(var U=0;U');}T.push('
    0)T.push('style="',V.join('; '),'" ');T.push(' class="cke_dialog_ui_vbox_child">',M[U],'
    ');return T.join('');};k.dialog.uiElement.call(this,K,O||{type:'vbox'},N,'div',null,{role:'presentation'},S);}};})();k.dialog.uiElement.prototype={getElement:function(){return a.document.getById(this.domId);},getInputElement:function(){return this.getElement();},getDialog:function(){return this._.dialog;},setValue:function(K){this.getInputElement().setValue(K);this.fire('change',{value:K});return this;},getValue:function(){return this.getInputElement().getValue();},isChanged:function(){return false;},selectParentTab:function(){var N=this;var K=N.getInputElement(),L=K,M;while((L=L.getParent())&&L.$.className.search('cke_dialog_page_contents')==-1){}if(!L)return N;M=L.getAttribute('name');if(N._.dialog._.currentTabId!=M)N._.dialog.selectPage(M);return N;},focus:function(){this.selectParentTab().getInputElement().focus();return this;},registerEvents:function(K){var L=/^on([A-Z]\w+)/,M,N=function(P,Q,R,S){Q.on('load',function(){P.getInputElement().on(R,S,P);});}; -for(var O in K){if(!(M=O.match(L)))continue;if(this.eventProcessors[O])this.eventProcessors[O].call(this,this._.dialog,K[O]);else N(this,this._.dialog,M[1].toLowerCase(),K[O]);}return this;},eventProcessors:{onLoad:function(K,L){K.on('load',L,this);},onShow:function(K,L){K.on('show',L,this);},onHide:function(K,L){K.on('hide',L,this);}},accessKeyDown:function(K,L){this.focus();},accessKeyUp:function(K,L){},disable:function(){var K=this.getInputElement();K.setAttribute('disabled','true');K.addClass('cke_disabled');},enable:function(){var K=this.getInputElement();K.removeAttribute('disabled');K.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(K){var L=this;if(arguments.length<1)return L._.children.concat();if(!K.splice)K=[K];if(K.length<2)return L._.children[K[0]];else return L._.children[K[0]]&&L._.children[K[0]].getChild?L._.children[K[0]].getChild(K.slice(1,K.length)):null;}},true);k.dialog.vbox.prototype=new k.dialog.hbox();(function(){var K={build:function(L,M,N){var O=M.children,P,Q=[],R=[];for(var S=0;S',P.name,'');return Q.join('');}};a.style.getStyleText=function(P){var Q=P._ST;if(Q)return Q;Q=P.styles;var R=P.attributes&&P.attributes.style||'',S='';if(R.length)R=R.replace(n,';');for(var T in Q){var U=Q[T],V=(T+':'+U).replace(n,';');if(U=='inherit')S+=V;else R+=V;}if(R.length)R=L(R);R+=S;return P._ST=R;};function o(P){var ao=this;var Q=P.document;if(P.collapsed){var R=E(ao,Q);P.insertNode(R);P.moveToPosition(R,2);return;}var S=ao.element,T=ao._.definition,U,V=f[S]||(U=true,f.span),W=P.createBookmark();P.enlarge(1);P.trim();var X=P.getBoundaryNodes(),Y=X.startNode,Z=X.endNode.getNextSourceNode(true);if(!Z){var aa;Z=aa=Q.createText('');Z.insertAfter(P.endContainer);}var ab=Z.getParent();if(ab&&ab.getAttribute('_fck_bookmark'))Z=ab;if(Z.equals(Y)){Z=Z.getNextSourceNode(true);if(!Z){Z=aa=Q.createText('');Z.insertAfter(Y);}}var ac=Y,ad;while(ac){var ae=false;if(ac.equals(Z)){ac=null;ae=true;}else{var af=ac.type,ag=af==1?ac.getName():null;if(ag&&ac.getAttribute('_fck_bookmark')){ac=ac.getNextSourceNode(true);continue;}if(!ag||V[ag]&&(ac.getPosition(Z)|4|0|8)==4+0+8&&(!T.childRule||T.childRule(ac))){var ah=ac.getParent();if(ah&&((ah.getDtd()||f.span)[S]||U)&&(!T.parentRule||T.parentRule(ah))){if(!ad&&(!ag||!f.$removeEmpty[ag]||(ac.getPosition(Z)|4|0|8)==4+0+8)){ad=new d.range(Q);ad.setStartBefore(ac);}if(af==3||af==1&&!ac.getChildCount()){var ai=ac,aj;while(!ai.$.nextSibling&&(aj=ai.getParent(),V[aj.getName()])&&(aj.getPosition(Y)|2|0|8)==2+0+8&&(!T.childRule||T.childRule(aj)))ai=aj; -ad.setEndAfter(ai);if(!ai.$.nextSibling)ae=true;}}else ae=true;}else ae=true;ac=ac.getNextSourceNode();}if(ae&&ad&&!ad.collapsed){var ak=E(ao,Q),al=ad.getCommonAncestor();while(ak&&al){if(al.getName()==S){for(var am in T.attributes){if(ak.getAttribute(am)==al.getAttribute(am))ak.removeAttribute(am);}for(var an in T.styles){if(ak.getStyle(an)==al.getStyle(an))ak.removeStyle(an);}if(!ak.hasAttributes()){ak=null;break;}}al=al.getParent();}if(ak){ad.extractContents().appendTo(ak);z(ao,ak);ad.insertNode(ak);C(ak);if(!c)ak.$.normalize();}ad=null;}}aa&&aa.remove();P.moveToBookmark(W);P.shrink(a.SHRINK_TEXT);};function p(P){P.enlarge(1);var Q=P.createBookmark(),R=Q.startNode;if(P.collapsed){var S=new d.elementPath(R.getParent()),T;for(var U=0,V;U';else P.setHtml(R);Q.remove();};function u(P){var Q=/(\S\s*)\n(?:\s|(]+_fck_bookmark.*?\/span>))*\n(?!$)/gi,R=P.getName(),S=v(P.getOuterHtml(),Q,function(U,V,W){return V+''+W+'
    ';}),T=[];S.replace(/([\s\S]*?)<\/pre>/gi,function(U,V){T.push(V);});return T;};function v(P,Q,R){var S='',T='';P=P.replace(/(^]+_fck_bookmark.*?\/span>)|(]+_fck_bookmark.*?\/span>$)/gi,function(U,V,W){V&&(S=V);W&&(T=W);return '';});return S+P.replace(Q,R)+T;};function w(P,Q){var R=new d.documentFragment(Q.getDocument());for(var S=0;S');T=T.replace(/[ \t]{2,}/g,function(V){return e.repeat(' ',V.length-1)+' ';});var U=Q.clone();U.setHtml(T);R.append(U);}return R;};function x(P,Q){var R=P.getHtml();R=v(R,/(?:^[ \t\n\r]+)|(?:[ \t\n\r]+$)/g,'');R=R.replace(/[ \t\r\n]*(]*>)[ \t\r\n]*/gi,'$1');R=R.replace(/([ \t\n\r]+| )/g,' ');R=R.replace(/]*>/gi,'\n');if(c){var S=P.getDocument().createElement('div');S.append(Q);Q.$.outerHTML='
    '+R+'
    ';Q=S.getFirst().remove();}else Q.setHtml(R);return Q;};function y(P,Q){var R=P._.definition,S=e.extend({},R.attributes,J(P)[Q.getName()]),T=R.styles,U=e.isEmpty(S)&&e.isEmpty(T);for(var V in S){if((V=='class'||P._.definition.fullMatch)&&Q.getAttribute(V)!=K(V,S[V]))continue;U=Q.hasAttribute(V);Q.removeAttribute(V);}for(var W in T){if(P._.definition.fullMatch&&Q.getStyle(W)!=K(W,T[W],true))continue;U=U||!!Q.getStyle(W);Q.removeStyle(W);}U&&B(Q);};function z(P,Q){var R=P._.definition,S=R.attributes,T=R.styles,U=J(P),V=Q.getElementsByTag(P.element);for(var W=V.count();--W>=0;)y(P,V.getItem(W));for(var X in U){if(X!=P.element){V=Q.getElementsByTag(X);for(W=V.count()-1;W>=0;W--){var Y=V.getItem(W);A(Y,U[X]);}}}};function A(P,Q){var R=Q&&Q.attributes;if(R)for(var S=0;S0)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',opacity:'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();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)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();if(c){var v,w;u.on('focusin',function(z){if(z.data.$.srcElement.nodeName!='BODY')return;if(v){try{v.select();}catch(A){}v=null;}});u.on('focus',function(){w=true;y();});u.on('beforedeactivate',function(z){if(z.data.$.toElement)return;w=false;});if(c&&b.version<8)t.getWindow().on('blur',function(z){s.document.$.selection.empty();});u.on('mousedown',x);u.on('mouseup',function(){w=true;setTimeout(function(){y(true);},0);});u.on('keydown',x);u.on('keyup',function(){w=true;y();});t.on('selectionchange',y);function x(){w=false;};function y(z){if(w){var A=s.document,B=A&&A.$.selection;if(z&&B&&B.type=='None')if(!A.$.queryCommandEnabled('InsertImage')){e.setTimeout(y,50,this,true);return;}v=B&&B.createRange();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){q.collapse(true);o.setEnd(q.endContainer.$,q.endOffset);}else throw r;}var p=q.document.getSelection().getNative();p.removeAllRanges();p.addRange(o);};})();(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};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};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 B={type:'hbox',widths:u.widths,padding:0,children:[{type:'html',html:'