From 87fe55e19715b575f2644f52aee34fa7e80daf14 Mon Sep 17 00:00:00 2001 From: "Jacob T.Paul" Date: Wed, 27 Jul 2011 18:03:38 +0530 Subject: [PATCH] Nation Notes module contributed by Z&H Healthcare. Signed-off-by: Jacob T.Paul --- acl_setup.php | 13 +- acl_upgrade.php | 9 +- images/b_edit.png | Bin 0 -> 451 bytes images/enter.gif | Bin 0 -> 870 bytes images/paragraph.png | Bin 0 -> 677 bytes images/question.png | Bin 0 -> 676 bytes interface/forms/LBF/new.php | 37 +- interface/super/edit_layout.php | 97 +- interface/themes/style_babyblu.css | 88 + interface/themes/style_blue.css | 87 + interface/themes/style_metal.css | 87 + interface/themes/style_oemr.css | 87 + interface/themes/style_purple.css | 87 + interface/themes/style_sky_blue.css | 87 + library/acl.inc | 4 +- library/custom_template/add_context.php | 204 ++ library/custom_template/add_custombutton.php | 153 + library/custom_template/add_template.php | 120 + library/custom_template/ajax_code.php | 195 ++ library/custom_template/ckeditor/.htaccess | 24 + library/custom_template/ckeditor/CHANGES.html | 1154 +++++++ library/custom_template/ckeditor/INSTALL.html | 92 + library/custom_template/ckeditor/LICENSE.html | 1334 +++++++++ .../ckeditor/_samples/adobeair/application.xml | 32 + .../ckeditor/_samples/adobeair/run.bat | 9 + .../ckeditor/_samples/adobeair/sample.html | 45 + .../custom_template/ckeditor/_samples/ajax.html | 99 + library/custom_template/ckeditor/_samples/api.html | 192 ++ .../ckeditor/_samples/api_dialog.html | 198 ++ .../ckeditor/_samples/api_dialog/my_dialog.js | 28 + .../ckeditor/_samples/asp/advanced.asp | 105 + .../ckeditor/_samples/asp/events.asp | 136 + .../ckeditor/_samples/asp/index.html | 103 + .../ckeditor/_samples/asp/replace.asp | 72 + .../ckeditor/_samples/asp/replaceall.asp | 77 + .../ckeditor/_samples/asp/sample_posteddata.asp | 46 + .../ckeditor/_samples/asp/standalone.asp | 72 + .../ckeditor/_samples/assets/_posteddata.php | 59 + .../ckeditor/_samples/assets/output_for_flash.fla | Bin 0 -> 85504 bytes .../ckeditor/_samples/assets/output_for_flash.swf | Bin 0 -> 15571 bytes .../ckeditor/_samples/assets/output_xhtml.css | 204 ++ .../ckeditor/_samples/assets/swfobject.js | 18 + .../ckeditor/_samples/autogrow.html | 103 + .../ckeditor/_samples/divreplace.html | 149 + .../ckeditor/_samples/enterkey.html | 115 + .../ckeditor/_samples/fullpage.html | 75 + .../custom_template/ckeditor/_samples/index.html | 96 + .../ckeditor/_samples/jqueryadapter.html | 99 + .../ckeditor/_samples/output_for_flash.html | 274 ++ .../ckeditor/_samples/output_html.html | 286 ++ .../ckeditor/_samples/output_xhtml.html | 181 ++ .../ckeditor/_samples/php/advanced.php | 120 + .../ckeditor/_samples/php/events.php | 153 + .../ckeditor/_samples/php/index.html | 47 + .../ckeditor/_samples/php/replace.php | 87 + .../ckeditor/_samples/php/replaceall.php | 88 + .../ckeditor/_samples/php/standalone.php | 83 + .../ckeditor/_samples/placeholder.html | 81 + .../ckeditor/_samples/replacebyclass.html | 64 + .../ckeditor/_samples/replacebycode.html | 97 + .../custom_template/ckeditor/_samples/sample.css | 163 + .../custom_template/ckeditor/_samples/sample.js | 65 + .../ckeditor/_samples/sample_posteddata.php | 21 + .../ckeditor/_samples/sharedspaces.html | 153 + .../custom_template/ckeditor/_samples/skins.html | 110 + .../ckeditor/_samples/ui_color.html | 129 + .../ckeditor/_samples/ui_languages.html | 134 + .../ckeditor/_source/adapters/jquery.js | 300 ++ .../ckeditor/_source/core/_bootstrap.js | 96 + .../custom_template/ckeditor/_source/core/ajax.js | 142 + .../ckeditor/_source/core/ckeditor.js | 141 + .../ckeditor/_source/core/ckeditor_base.js | 196 ++ .../ckeditor/_source/core/ckeditor_basic.js | 239 ++ .../ckeditor/_source/core/command.js | 209 ++ .../ckeditor/_source/core/commanddefinition.js | 129 + .../ckeditor/_source/core/config.js | 431 +++ .../ckeditor/_source/core/dataprocessor.js | 65 + .../custom_template/ckeditor/_source/core/dom.js | 20 + .../ckeditor/_source/core/dom/comment.js | 32 + .../ckeditor/_source/core/dom/document.js | 251 ++ .../ckeditor/_source/core/dom/documentfragment.js | 49 + .../ckeditor/_source/core/dom/domobject.js | 258 ++ .../ckeditor/_source/core/dom/element.js | 1624 ++++++++++ .../ckeditor/_source/core/dom/elementpath.js | 119 + .../ckeditor/_source/core/dom/event.js | 142 + .../ckeditor/_source/core/dom/node.js | 696 +++++ .../ckeditor/_source/core/dom/nodelist.js | 26 + .../ckeditor/_source/core/dom/range.js | 1953 ++++++++++++ .../ckeditor/_source/core/dom/rangelist.js | 213 ++ .../ckeditor/_source/core/dom/text.js | 123 + .../ckeditor/_source/core/dom/walker.js | 460 +++ .../ckeditor/_source/core/dom/window.js | 96 + .../custom_template/ckeditor/_source/core/dtd.js | 238 ++ .../ckeditor/_source/core/editor.js | 985 ++++++ .../ckeditor/_source/core/editor_basic.js | 186 ++ .../custom_template/ckeditor/_source/core/env.js | 272 ++ .../custom_template/ckeditor/_source/core/event.js | 342 +++ .../ckeditor/_source/core/eventInfo.js | 120 + .../ckeditor/_source/core/focusmanager.js | 152 + .../ckeditor/_source/core/htmlparser.js | 224 ++ .../_source/core/htmlparser/basicwriter.js | 145 + .../ckeditor/_source/core/htmlparser/cdata.js | 43 + .../ckeditor/_source/core/htmlparser/comment.js | 60 + .../ckeditor/_source/core/htmlparser/element.js | 249 ++ .../ckeditor/_source/core/htmlparser/filter.js | 288 ++ .../ckeditor/_source/core/htmlparser/fragment.js | 504 ++++ .../ckeditor/_source/core/htmlparser/text.js | 55 + .../custom_template/ckeditor/_source/core/lang.js | 156 + .../ckeditor/_source/core/loader.js | 242 ++ .../ckeditor/_source/core/plugindefinition.js | 66 + .../ckeditor/_source/core/plugins.js | 85 + .../ckeditor/_source/core/resourcemanager.js | 238 ++ .../ckeditor/_source/core/scriptloader.js | 180 ++ .../custom_template/ckeditor/_source/core/skins.js | 184 ++ .../ckeditor/_source/core/themes.js | 19 + .../custom_template/ckeditor/_source/core/tools.js | 734 +++++ .../custom_template/ckeditor/_source/core/ui.js | 125 + .../custom_template/ckeditor/_source/core/xml.js | 165 + .../ckeditor/_source/lang/_languages.js | 83 + .../ckeditor/_source/lang/_translationstatus.txt | 60 + .../custom_template/ckeditor/_source/lang/af.js | 752 +++++ .../custom_template/ckeditor/_source/lang/ar.js | 752 +++++ .../custom_template/ckeditor/_source/lang/bg.js | 752 +++++ .../custom_template/ckeditor/_source/lang/bn.js | 752 +++++ .../custom_template/ckeditor/_source/lang/bs.js | 752 +++++ .../custom_template/ckeditor/_source/lang/ca.js | 752 +++++ .../custom_template/ckeditor/_source/lang/cs.js | 752 +++++ .../custom_template/ckeditor/_source/lang/cy.js | 752 +++++ .../custom_template/ckeditor/_source/lang/da.js | 752 +++++ .../custom_template/ckeditor/_source/lang/de.js | 752 +++++ .../custom_template/ckeditor/_source/lang/el.js | 752 +++++ .../custom_template/ckeditor/_source/lang/en-au.js | 752 +++++ .../custom_template/ckeditor/_source/lang/en-ca.js | 752 +++++ .../custom_template/ckeditor/_source/lang/en-gb.js | 752 +++++ .../custom_template/ckeditor/_source/lang/en.js | 752 +++++ .../custom_template/ckeditor/_source/lang/eo.js | 752 +++++ .../custom_template/ckeditor/_source/lang/es.js | 752 +++++ .../custom_template/ckeditor/_source/lang/et.js | 752 +++++ .../custom_template/ckeditor/_source/lang/eu.js | 752 +++++ .../custom_template/ckeditor/_source/lang/fa.js | 752 +++++ .../custom_template/ckeditor/_source/lang/fi.js | 752 +++++ .../custom_template/ckeditor/_source/lang/fo.js | 752 +++++ .../custom_template/ckeditor/_source/lang/fr-ca.js | 752 +++++ .../custom_template/ckeditor/_source/lang/fr.js | 752 +++++ .../custom_template/ckeditor/_source/lang/gl.js | 752 +++++ .../custom_template/ckeditor/_source/lang/gu.js | 752 +++++ .../custom_template/ckeditor/_source/lang/he.js | 752 +++++ .../custom_template/ckeditor/_source/lang/hi.js | 752 +++++ .../custom_template/ckeditor/_source/lang/hr.js | 752 +++++ .../custom_template/ckeditor/_source/lang/hu.js | 752 +++++ .../custom_template/ckeditor/_source/lang/is.js | 752 +++++ .../custom_template/ckeditor/_source/lang/it.js | 752 +++++ .../custom_template/ckeditor/_source/lang/ja.js | 752 +++++ .../custom_template/ckeditor/_source/lang/km.js | 752 +++++ .../custom_template/ckeditor/_source/lang/ko.js | 752 +++++ .../custom_template/ckeditor/_source/lang/lt.js | 752 +++++ .../custom_template/ckeditor/_source/lang/lv.js | 752 +++++ .../custom_template/ckeditor/_source/lang/mn.js | 752 +++++ .../custom_template/ckeditor/_source/lang/ms.js | 752 +++++ .../custom_template/ckeditor/_source/lang/nb.js | 752 +++++ .../custom_template/ckeditor/_source/lang/nl.js | 752 +++++ .../custom_template/ckeditor/_source/lang/no.js | 752 +++++ .../custom_template/ckeditor/_source/lang/pl.js | 752 +++++ .../custom_template/ckeditor/_source/lang/pt-br.js | 751 +++++ .../custom_template/ckeditor/_source/lang/pt.js | 752 +++++ .../custom_template/ckeditor/_source/lang/ro.js | 752 +++++ .../custom_template/ckeditor/_source/lang/ru.js | 752 +++++ .../custom_template/ckeditor/_source/lang/sk.js | 752 +++++ .../custom_template/ckeditor/_source/lang/sl.js | 752 +++++ .../ckeditor/_source/lang/sr-latn.js | 752 +++++ .../custom_template/ckeditor/_source/lang/sr.js | 752 +++++ .../custom_template/ckeditor/_source/lang/sv.js | 752 +++++ .../custom_template/ckeditor/_source/lang/th.js | 752 +++++ .../custom_template/ckeditor/_source/lang/tr.js | 751 +++++ .../custom_template/ckeditor/_source/lang/uk.js | 752 +++++ .../custom_template/ckeditor/_source/lang/vi.js | 752 +++++ .../custom_template/ckeditor/_source/lang/zh-cn.js | 752 +++++ .../custom_template/ckeditor/_source/lang/zh.js | 752 +++++ .../_source/plugins/a11yhelp/dialogs/a11yhelp.js | 211 ++ .../ckeditor/_source/plugins/a11yhelp/lang/en.js | 108 + .../ckeditor/_source/plugins/a11yhelp/lang/he.js | 216 ++ .../ckeditor/_source/plugins/a11yhelp/plugin.js | 46 + .../_source/plugins/about/dialogs/about.js | 73 + .../plugins/about/dialogs/logo_ckeditor.png | Bin 0 -> 2759 bytes .../ckeditor/_source/plugins/about/plugin.js | 23 + .../ckeditor/_source/plugins/adobeair/plugin.js | 228 ++ .../ckeditor/_source/plugins/autogrow/plugin.js | 86 + .../ckeditor/_source/plugins/basicstyles/plugin.js | 101 + .../ckeditor/_source/plugins/bidi/plugin.js | 280 ++ .../ckeditor/_source/plugins/blockquote/plugin.js | 302 ++ .../ckeditor/_source/plugins/button/plugin.js | 295 ++ .../_source/plugins/clipboard/dialogs/paste.js | 212 ++ .../ckeditor/_source/plugins/clipboard/plugin.js | 445 +++ .../ckeditor/_source/plugins/colorbutton/plugin.js | 291 ++ .../plugins/colordialog/dialogs/colordialog.js | 340 +++ .../ckeditor/_source/plugins/colordialog/plugin.js | 13 + .../ckeditor/_source/plugins/contextmenu/plugin.js | 177 ++ .../_source/plugins/dialog/dialogDefinition.js | 315 ++ .../ckeditor/_source/plugins/dialog/plugin.js | 3138 ++++++++++++++++++++ .../_source/plugins/dialogadvtab/plugin.js | 213 ++ .../ckeditor/_source/plugins/dialogui/plugin.js | 1537 ++++++++++ .../ckeditor/_source/plugins/div/dialogs/div.js | 535 ++++ .../ckeditor/_source/plugins/div/plugin.js | 121 + .../ckeditor/_source/plugins/domiterator/plugin.js | 356 +++ .../_source/plugins/editingblock/plugin.js | 248 ++ .../_source/plugins/elementspath/plugin.js | 208 ++ .../ckeditor/_source/plugins/enterkey/plugin.js | 381 +++ .../ckeditor/_source/plugins/entities/plugin.js | 226 ++ .../ckeditor/_source/plugins/fakeobjects/plugin.js | 126 + .../ckeditor/_source/plugins/filebrowser/plugin.js | 502 ++++ .../ckeditor/_source/plugins/find/dialogs/find.js | 890 ++++++ .../ckeditor/_source/plugins/find/plugin.js | 46 + .../_source/plugins/flash/dialogs/flash.js | 698 +++++ .../_source/plugins/flash/images/placeholder.png | Bin 0 -> 256 bytes .../ckeditor/_source/plugins/flash/plugin.js | 168 ++ .../ckeditor/_source/plugins/floatpanel/plugin.js | 405 +++ .../ckeditor/_source/plugins/font/plugin.js | 234 ++ .../ckeditor/_source/plugins/format/plugin.js | 197 ++ .../_source/plugins/forms/dialogs/button.js | 118 + .../_source/plugins/forms/dialogs/checkbox.js | 153 + .../ckeditor/_source/plugins/forms/dialogs/form.js | 177 ++ .../_source/plugins/forms/dialogs/hiddenfield.js | 98 + .../_source/plugins/forms/dialogs/radio.js | 135 + .../_source/plugins/forms/dialogs/select.js | 556 ++++ .../_source/plugins/forms/dialogs/textarea.js | 114 + .../_source/plugins/forms/dialogs/textfield.js | 199 ++ .../_source/plugins/forms/images/hiddenfield.gif | Bin 0 -> 105 bytes .../ckeditor/_source/plugins/forms/plugin.js | 284 ++ .../_source/plugins/horizontalrule/plugin.js | 36 + .../_source/plugins/htmldataprocessor/plugin.js | 571 ++++ .../ckeditor/_source/plugins/htmlwriter/plugin.js | 319 ++ .../_source/plugins/iframe/dialogs/iframe.js | 257 ++ .../_source/plugins/iframe/images/placeholder.png | Bin 0 -> 449 bytes .../ckeditor/_source/plugins/iframe/plugin.js | 106 + .../_source/plugins/iframedialog/plugin.js | 136 + .../_source/plugins/image/dialogs/image.js | 1388 +++++++++ .../ckeditor/_source/plugins/image/plugin.js | 81 + .../ckeditor/_source/plugins/indent/plugin.js | 460 +++ .../ckeditor/_source/plugins/justify/plugin.js | 239 ++ .../ckeditor/_source/plugins/keystrokes/plugin.js | 225 ++ .../_source/plugins/link/dialogs/anchor.js | 99 + .../ckeditor/_source/plugins/link/dialogs/link.js | 1427 +++++++++ .../_source/plugins/link/images/anchor.gif | Bin 0 -> 184 bytes .../ckeditor/_source/plugins/link/plugin.js | 242 ++ .../ckeditor/_source/plugins/list/plugin.js | 721 +++++ .../ckeditor/_source/plugins/listblock/plugin.js | 257 ++ .../_source/plugins/liststyle/dialogs/liststyle.js | 204 ++ .../ckeditor/_source/plugins/liststyle/plugin.js | 66 + .../ckeditor/_source/plugins/maximize/plugin.js | 350 +++ .../ckeditor/_source/plugins/menu/plugin.js | 505 ++++ .../ckeditor/_source/plugins/menubutton/plugin.js | 98 + .../ckeditor/_source/plugins/newpage/plugin.js | 53 + .../_source/plugins/pagebreak/images/pagebreak.gif | Bin 0 -> 54 bytes .../ckeditor/_source/plugins/pagebreak/plugin.js | 120 + .../ckeditor/_source/plugins/panel/plugin.js | 402 +++ .../ckeditor/_source/plugins/panelbutton/plugin.js | 146 + .../plugins/pastefromword/filter/default.js | 1175 ++++++++ .../_source/plugins/pastefromword/plugin.js | 129 + .../_source/plugins/pastetext/dialogs/pastetext.js | 70 + .../ckeditor/_source/plugins/pastetext/plugin.js | 90 + .../plugins/placeholder/dialogs/placeholder.js | 71 + .../_source/plugins/placeholder/lang/en.js | 16 + .../_source/plugins/placeholder/placeholder.gif | Bin 0 -> 96 bytes .../ckeditor/_source/plugins/placeholder/plugin.js | 171 ++ .../ckeditor/_source/plugins/popup/plugin.js | 64 + .../ckeditor/_source/plugins/preview/plugin.js | 108 + .../ckeditor/_source/plugins/print/plugin.js | 41 + .../_source/plugins/removeformat/plugin.js | 185 ++ .../ckeditor/_source/plugins/resize/plugin.js | 157 + .../ckeditor/_source/plugins/richcombo/plugin.js | 374 +++ .../ckeditor/_source/plugins/save/plugin.js | 55 + .../_source/plugins/scayt/dialogs/options.js | 534 ++++ .../_source/plugins/scayt/dialogs/toolbar.css | 71 + .../ckeditor/_source/plugins/scayt/plugin.js | 947 ++++++ .../ckeditor/_source/plugins/selection/plugin.js | 1418 +++++++++ .../plugins/showblocks/images/block_address.png | Bin 0 -> 171 bytes .../plugins/showblocks/images/block_blockquote.png | Bin 0 -> 181 bytes .../plugins/showblocks/images/block_div.png | Bin 0 -> 136 bytes .../_source/plugins/showblocks/images/block_h1.png | Bin 0 -> 127 bytes .../_source/plugins/showblocks/images/block_h2.png | Bin 0 -> 134 bytes .../_source/plugins/showblocks/images/block_h3.png | Bin 0 -> 131 bytes .../_source/plugins/showblocks/images/block_h4.png | Bin 0 -> 133 bytes .../_source/plugins/showblocks/images/block_h5.png | Bin 0 -> 133 bytes .../_source/plugins/showblocks/images/block_h6.png | Bin 0 -> 129 bytes .../_source/plugins/showblocks/images/block_p.png | Bin 0 -> 119 bytes .../plugins/showblocks/images/block_pre.png | Bin 0 -> 136 bytes .../ckeditor/_source/plugins/showblocks/plugin.js | 156 + .../ckeditor/_source/plugins/showborders/plugin.js | 203 ++ .../_source/plugins/smiley/dialogs/smiley.js | 223 ++ .../_source/plugins/smiley/images/angel_smile.gif | Bin 0 -> 465 bytes .../_source/plugins/smiley/images/angry_smile.gif | Bin 0 -> 443 bytes .../_source/plugins/smiley/images/broken_heart.gif | Bin 0 -> 192 bytes .../plugins/smiley/images/confused_smile.gif | Bin 0 -> 464 bytes .../_source/plugins/smiley/images/cry_smile.gif | Bin 0 -> 468 bytes .../_source/plugins/smiley/images/devil_smile.gif | Bin 0 -> 436 bytes .../plugins/smiley/images/embaressed_smile.gif | Bin 0 -> 442 bytes .../_source/plugins/smiley/images/envelope.gif | Bin 0 -> 426 bytes .../_source/plugins/smiley/images/heart.gif | Bin 0 -> 183 bytes .../_source/plugins/smiley/images/kiss.gif | Bin 0 -> 241 bytes .../_source/plugins/smiley/images/lightbulb.gif | Bin 0 -> 368 bytes .../_source/plugins/smiley/images/omg_smile.gif | Bin 0 -> 451 bytes .../plugins/smiley/images/regular_smile.gif | Bin 0 -> 450 bytes .../_source/plugins/smiley/images/sad_smile.gif | Bin 0 -> 460 bytes .../_source/plugins/smiley/images/shades_smile.gif | Bin 0 -> 449 bytes .../_source/plugins/smiley/images/teeth_smile.gif | Bin 0 -> 442 bytes .../_source/plugins/smiley/images/thumbs_down.gif | Bin 0 -> 408 bytes .../_source/plugins/smiley/images/thumbs_up.gif | Bin 0 -> 396 bytes .../_source/plugins/smiley/images/tounge_smile.gif | Bin 0 -> 446 bytes .../smiley/images/whatchutalkingabout_smile.gif | Bin 0 -> 452 bytes .../_source/plugins/smiley/images/wink_smile.gif | Bin 0 -> 458 bytes .../ckeditor/_source/plugins/smiley/plugin.js | 94 + .../ckeditor/_source/plugins/sourcearea/plugin.js | 196 ++ .../plugins/specialchar/dialogs/specialchar.js | 347 +++ .../_source/plugins/specialchar/lang/en.js | 89 + .../ckeditor/_source/plugins/specialchar/plugin.js | 70 + .../ckeditor/_source/plugins/styles/plugin.js | 1644 ++++++++++ .../_source/plugins/styles/styles/default.js | 88 + .../ckeditor/_source/plugins/stylescombo/plugin.js | 201 ++ .../ckeditor/_source/plugins/tab/plugin.js | 367 +++ .../_source/plugins/table/dialogs/table.js | 672 +++++ .../ckeditor/_source/plugins/table/plugin.js | 78 + .../ckeditor/_source/plugins/tableresize/plugin.js | 450 +++ .../plugins/tabletools/dialogs/tableCell.js | 525 ++++ .../ckeditor/_source/plugins/tabletools/plugin.js | 1194 ++++++++ .../_source/plugins/templates/dialogs/templates.js | 233 ++ .../ckeditor/_source/plugins/templates/plugin.js | 99 + .../_source/plugins/templates/templates/default.js | 94 + .../templates/templates/images/template1.gif | Bin 0 -> 375 bytes .../templates/templates/images/template2.gif | Bin 0 -> 333 bytes .../templates/templates/images/template3.gif | Bin 0 -> 422 bytes .../ckeditor/_source/plugins/toolbar/plugin.js | 501 ++++ .../_source/plugins/uicolor/dialogs/uicolor.js | 205 ++ .../ckeditor/_source/plugins/uicolor/lang/en.js | 15 + .../ckeditor/_source/plugins/uicolor/lang/he.js | 15 + .../ckeditor/_source/plugins/uicolor/plugin.js | 37 + .../ckeditor/_source/plugins/uicolor/uicolor.gif | Bin 0 -> 1108 bytes .../_source/plugins/uicolor/yui/assets/hue_bg.png | Bin 0 -> 1120 bytes .../plugins/uicolor/yui/assets/hue_thumb.png | Bin 0 -> 195 bytes .../plugins/uicolor/yui/assets/picker_mask.png | Bin 0 -> 12174 bytes .../plugins/uicolor/yui/assets/picker_thumb.png | Bin 0 -> 192 bytes .../_source/plugins/uicolor/yui/assets/yui.css | 15 + .../ckeditor/_source/plugins/uicolor/yui/yui.js | 71 + .../ckeditor/_source/plugins/undo/plugin.js | 554 ++++ .../_source/plugins/wsc/dialogs/ciframe.html | 49 + .../_source/plugins/wsc/dialogs/tmpFrameset.html | 52 + .../ckeditor/_source/plugins/wsc/dialogs/wsc.css | 82 + .../ckeditor/_source/plugins/wsc/dialogs/wsc.js | 192 ++ .../ckeditor/_source/plugins/wsc/plugin.js | 33 + .../ckeditor/_source/plugins/wysiwygarea/plugin.js | 1275 ++++++++ .../ckeditor/_source/skins/kama/dialog.css | 915 ++++++ .../ckeditor/_source/skins/kama/editor.css | 25 + .../ckeditor/_source/skins/kama/elementspath.css | 73 + .../ckeditor/_source/skins/kama/icons.css | 361 +++ .../ckeditor/_source/skins/kama/icons.png | Bin 0 -> 5598 bytes .../ckeditor/_source/skins/kama/icons_rtl.png | Bin 0 -> 5600 bytes .../_source/skins/kama/images/dialog_sides.gif | Bin 0 -> 48 bytes .../_source/skins/kama/images/dialog_sides.png | Bin 0 -> 178 bytes .../_source/skins/kama/images/dialog_sides_rtl.png | Bin 0 -> 181 bytes .../ckeditor/_source/skins/kama/images/mini.gif | Bin 0 -> 183 bytes .../ckeditor/_source/skins/kama/images/noimage.png | Bin 0 -> 2115 bytes .../ckeditor/_source/skins/kama/images/sprites.png | Bin 0 -> 7086 bytes .../_source/skins/kama/images/sprites_ie6.png | Bin 0 -> 2724 bytes .../_source/skins/kama/images/toolbar_start.gif | Bin 0 -> 105 bytes .../ckeditor/_source/skins/kama/mainui.css | 203 ++ .../ckeditor/_source/skins/kama/menu.css | 232 ++ .../ckeditor/_source/skins/kama/panel.css | 217 ++ .../ckeditor/_source/skins/kama/presets.css | 49 + .../ckeditor/_source/skins/kama/reset.css | 84 + .../ckeditor/_source/skins/kama/richcombo.css | 287 ++ .../ckeditor/_source/skins/kama/skin.js | 235 ++ .../ckeditor/_source/skins/kama/templates.css | 88 + .../ckeditor/_source/skins/kama/toolbar.css | 452 +++ .../ckeditor/_source/skins/office2003/dialog.css | 826 ++++++ .../ckeditor/_source/skins/office2003/editor.css | 25 + .../_source/skins/office2003/elementspath.css | 74 + .../ckeditor/_source/skins/office2003/icons.css | 358 +++ .../ckeditor/_source/skins/office2003/icons.png | Bin 0 -> 5598 bytes .../_source/skins/office2003/icons_rtl.png | Bin 0 -> 5600 bytes .../skins/office2003/images/dialog_sides.gif | Bin 0 -> 48 bytes .../skins/office2003/images/dialog_sides.png | Bin 0 -> 178 bytes .../skins/office2003/images/dialog_sides_rtl.png | Bin 0 -> 181 bytes .../_source/skins/office2003/images/mini.gif | Bin 0 -> 183 bytes .../_source/skins/office2003/images/noimage.png | Bin 0 -> 2115 bytes .../_source/skins/office2003/images/sprites.png | Bin 0 -> 6119 bytes .../skins/office2003/images/sprites_ie6.png | Bin 0 -> 2715 bytes .../ckeditor/_source/skins/office2003/mainui.css | 153 + .../ckeditor/_source/skins/office2003/menu.css | 229 ++ .../ckeditor/_source/skins/office2003/panel.css | 212 ++ .../ckeditor/_source/skins/office2003/presets.css | 49 + .../ckeditor/_source/skins/office2003/reset.css | 84 + .../_source/skins/office2003/richcombo.css | 318 ++ .../ckeditor/_source/skins/office2003/skin.js | 73 + .../_source/skins/office2003/templates.css | 87 + .../ckeditor/_source/skins/office2003/toolbar.css | 522 ++++ .../ckeditor/_source/skins/v2/dialog.css | 842 ++++++ .../ckeditor/_source/skins/v2/editor.css | 25 + .../ckeditor/_source/skins/v2/elementspath.css | 74 + .../ckeditor/_source/skins/v2/icons.css | 358 +++ .../ckeditor/_source/skins/v2/icons.png | Bin 0 -> 5598 bytes .../ckeditor/_source/skins/v2/icons_rtl.png | Bin 0 -> 5600 bytes .../_source/skins/v2/images/dialog_sides.gif | Bin 0 -> 48 bytes .../_source/skins/v2/images/dialog_sides.png | Bin 0 -> 178 bytes .../_source/skins/v2/images/dialog_sides_rtl.png | Bin 0 -> 181 bytes .../ckeditor/_source/skins/v2/images/mini.gif | Bin 0 -> 183 bytes .../ckeditor/_source/skins/v2/images/noimage.png | Bin 0 -> 2115 bytes .../ckeditor/_source/skins/v2/images/sprites.png | Bin 0 -> 5389 bytes .../_source/skins/v2/images/sprites_ie6.png | Bin 0 -> 492 bytes .../_source/skins/v2/images/toolbar_start.gif | Bin 0 -> 105 bytes .../ckeditor/_source/skins/v2/mainui.css | 162 + .../ckeditor/_source/skins/v2/menu.css | 232 ++ .../ckeditor/_source/skins/v2/panel.css | 212 ++ .../ckeditor/_source/skins/v2/presets.css | 50 + .../ckeditor/_source/skins/v2/reset.css | 84 + .../ckeditor/_source/skins/v2/richcombo.css | 317 ++ .../ckeditor/_source/skins/v2/skin.js | 69 + .../ckeditor/_source/skins/v2/templates.css | 87 + .../ckeditor/_source/skins/v2/toolbar.css | 465 +++ .../ckeditor/_source/themes/default/theme.js | 374 +++ .../custom_template/ckeditor/adapters/jquery.js | 6 + library/custom_template/ckeditor/ckeditor.asp | 955 ++++++ library/custom_template/ckeditor/ckeditor.js | 141 + library/custom_template/ckeditor/ckeditor.pack | 211 ++ library/custom_template/ckeditor/ckeditor.php | 29 + library/custom_template/ckeditor/ckeditor_basic.js | 8 + .../ckeditor/ckeditor_basic_source.js | 20 + library/custom_template/ckeditor/ckeditor_php4.php | 596 ++++ library/custom_template/ckeditor/ckeditor_php5.php | 586 ++++ .../custom_template/ckeditor/ckeditor_source.js | 25 + library/custom_template/ckeditor/config.js | 13 + library/custom_template/ckeditor/contents.css | 45 + library/custom_template/ckeditor/images/spacer.gif | Bin 0 -> 43 bytes .../custom_template/ckeditor/lang/_languages.js | 6 + .../ckeditor/lang/_translationstatus.txt | 60 + library/custom_template/ckeditor/lang/af.js | 6 + library/custom_template/ckeditor/lang/ar.js | 6 + library/custom_template/ckeditor/lang/bg.js | 6 + library/custom_template/ckeditor/lang/bn.js | 6 + library/custom_template/ckeditor/lang/bs.js | 6 + library/custom_template/ckeditor/lang/ca.js | 6 + library/custom_template/ckeditor/lang/cs.js | 6 + library/custom_template/ckeditor/lang/cy.js | 6 + library/custom_template/ckeditor/lang/da.js | 6 + library/custom_template/ckeditor/lang/de.js | 6 + library/custom_template/ckeditor/lang/el.js | 6 + library/custom_template/ckeditor/lang/en-au.js | 6 + library/custom_template/ckeditor/lang/en-ca.js | 6 + library/custom_template/ckeditor/lang/en-gb.js | 6 + library/custom_template/ckeditor/lang/en.js | 6 + library/custom_template/ckeditor/lang/eo.js | 6 + library/custom_template/ckeditor/lang/es.js | 6 + library/custom_template/ckeditor/lang/et.js | 6 + library/custom_template/ckeditor/lang/eu.js | 6 + library/custom_template/ckeditor/lang/fa.js | 6 + library/custom_template/ckeditor/lang/fi.js | 6 + library/custom_template/ckeditor/lang/fo.js | 6 + library/custom_template/ckeditor/lang/fr-ca.js | 6 + library/custom_template/ckeditor/lang/fr.js | 6 + library/custom_template/ckeditor/lang/gl.js | 6 + library/custom_template/ckeditor/lang/gu.js | 6 + library/custom_template/ckeditor/lang/he.js | 6 + library/custom_template/ckeditor/lang/hi.js | 6 + library/custom_template/ckeditor/lang/hr.js | 6 + library/custom_template/ckeditor/lang/hu.js | 6 + library/custom_template/ckeditor/lang/is.js | 6 + library/custom_template/ckeditor/lang/it.js | 6 + library/custom_template/ckeditor/lang/ja.js | 6 + library/custom_template/ckeditor/lang/km.js | 6 + library/custom_template/ckeditor/lang/ko.js | 6 + library/custom_template/ckeditor/lang/lt.js | 6 + library/custom_template/ckeditor/lang/lv.js | 6 + library/custom_template/ckeditor/lang/mn.js | 6 + library/custom_template/ckeditor/lang/ms.js | 6 + library/custom_template/ckeditor/lang/nb.js | 6 + library/custom_template/ckeditor/lang/nl.js | 6 + library/custom_template/ckeditor/lang/no.js | 6 + library/custom_template/ckeditor/lang/pl.js | 6 + library/custom_template/ckeditor/lang/pt-br.js | 6 + library/custom_template/ckeditor/lang/pt.js | 6 + library/custom_template/ckeditor/lang/ro.js | 6 + library/custom_template/ckeditor/lang/ru.js | 6 + library/custom_template/ckeditor/lang/sk.js | 6 + library/custom_template/ckeditor/lang/sl.js | 6 + library/custom_template/ckeditor/lang/sr-latn.js | 6 + library/custom_template/ckeditor/lang/sr.js | 6 + library/custom_template/ckeditor/lang/sv.js | 6 + library/custom_template/ckeditor/lang/th.js | 6 + library/custom_template/ckeditor/lang/tr.js | 6 + library/custom_template/ckeditor/lang/uk.js | 6 + library/custom_template/ckeditor/lang/vi.js | 6 + library/custom_template/ckeditor/lang/zh-cn.js | 6 + library/custom_template/ckeditor/lang/zh.js | 6 + .../ckeditor/plugins/a11yhelp/dialogs/a11yhelp.js | 7 + .../ckeditor/plugins/a11yhelp/lang/en.js | 6 + .../ckeditor/plugins/a11yhelp/lang/he.js | 6 + .../ckeditor/plugins/about/dialogs/about.js | 6 + .../plugins/about/dialogs/logo_ckeditor.png | Bin 0 -> 2759 bytes .../ckeditor/plugins/adobeair/plugin.js | 6 + .../ckeditor/plugins/autogrow/plugin.js | 6 + .../ckeditor/plugins/clipboard/dialogs/paste.js | 7 + .../plugins/colordialog/dialogs/colordialog.js | 7 + .../ckeditor/plugins/dialog/dialogDefinition.js | 4 + .../ckeditor/plugins/div/dialogs/div.js | 8 + .../ckeditor/plugins/find/dialogs/find.js | 9 + .../ckeditor/plugins/flash/dialogs/flash.js | 9 + .../ckeditor/plugins/flash/images/placeholder.png | Bin 0 -> 256 bytes .../ckeditor/plugins/forms/dialogs/button.js | 6 + .../ckeditor/plugins/forms/dialogs/checkbox.js | 6 + .../ckeditor/plugins/forms/dialogs/form.js | 6 + .../ckeditor/plugins/forms/dialogs/hiddenfield.js | 6 + .../ckeditor/plugins/forms/dialogs/radio.js | 6 + .../ckeditor/plugins/forms/dialogs/select.js | 9 + .../ckeditor/plugins/forms/dialogs/textarea.js | 6 + .../ckeditor/plugins/forms/dialogs/textfield.js | 6 + .../ckeditor/plugins/forms/images/hiddenfield.gif | Bin 0 -> 105 bytes .../ckeditor/plugins/iframe/dialogs/iframe.js | 7 + .../ckeditor/plugins/iframe/images/placeholder.png | Bin 0 -> 449 bytes .../ckeditor/plugins/iframedialog/plugin.js | 6 + .../ckeditor/plugins/image/dialogs/image.js | 13 + .../ckeditor/plugins/link/dialogs/anchor.js | 6 + .../ckeditor/plugins/link/dialogs/link.js | 11 + .../ckeditor/plugins/link/images/anchor.gif | Bin 0 -> 184 bytes .../plugins/liststyle/dialogs/liststyle.js | 6 + .../plugins/pagebreak/images/pagebreak.gif | Bin 0 -> 54 bytes .../plugins/pastefromword/filter/default.js | 10 + .../plugins/pastetext/dialogs/pastetext.js | 6 + .../plugins/placeholder/dialogs/placeholder.js | 6 + .../ckeditor/plugins/placeholder/lang/en.js | 6 + .../ckeditor/plugins/placeholder/placeholder.gif | Bin 0 -> 96 bytes .../ckeditor/plugins/placeholder/plugin.js | 6 + .../ckeditor/plugins/scayt/dialogs/options.js | 8 + .../ckeditor/plugins/scayt/dialogs/toolbar.css | 6 + .../plugins/showblocks/images/block_address.png | Bin 0 -> 171 bytes .../plugins/showblocks/images/block_blockquote.png | Bin 0 -> 181 bytes .../plugins/showblocks/images/block_div.png | Bin 0 -> 136 bytes .../plugins/showblocks/images/block_h1.png | Bin 0 -> 127 bytes .../plugins/showblocks/images/block_h2.png | Bin 0 -> 134 bytes .../plugins/showblocks/images/block_h3.png | Bin 0 -> 131 bytes .../plugins/showblocks/images/block_h4.png | Bin 0 -> 133 bytes .../plugins/showblocks/images/block_h5.png | Bin 0 -> 133 bytes .../plugins/showblocks/images/block_h6.png | Bin 0 -> 129 bytes .../ckeditor/plugins/showblocks/images/block_p.png | Bin 0 -> 119 bytes .../plugins/showblocks/images/block_pre.png | Bin 0 -> 136 bytes .../ckeditor/plugins/smiley/dialogs/smiley.js | 7 + .../ckeditor/plugins/smiley/images/angel_smile.gif | Bin 0 -> 465 bytes .../ckeditor/plugins/smiley/images/angry_smile.gif | Bin 0 -> 443 bytes .../plugins/smiley/images/broken_heart.gif | Bin 0 -> 192 bytes .../plugins/smiley/images/confused_smile.gif | Bin 0 -> 464 bytes .../ckeditor/plugins/smiley/images/cry_smile.gif | Bin 0 -> 468 bytes .../ckeditor/plugins/smiley/images/devil_smile.gif | Bin 0 -> 436 bytes .../plugins/smiley/images/embaressed_smile.gif | Bin 0 -> 442 bytes .../ckeditor/plugins/smiley/images/envelope.gif | Bin 0 -> 426 bytes .../ckeditor/plugins/smiley/images/heart.gif | Bin 0 -> 183 bytes .../ckeditor/plugins/smiley/images/kiss.gif | Bin 0 -> 241 bytes .../ckeditor/plugins/smiley/images/lightbulb.gif | Bin 0 -> 368 bytes .../ckeditor/plugins/smiley/images/omg_smile.gif | Bin 0 -> 451 bytes .../plugins/smiley/images/regular_smile.gif | Bin 0 -> 450 bytes .../ckeditor/plugins/smiley/images/sad_smile.gif | Bin 0 -> 460 bytes .../plugins/smiley/images/shades_smile.gif | Bin 0 -> 449 bytes .../ckeditor/plugins/smiley/images/teeth_smile.gif | Bin 0 -> 442 bytes .../ckeditor/plugins/smiley/images/thumbs_down.gif | Bin 0 -> 408 bytes .../ckeditor/plugins/smiley/images/thumbs_up.gif | Bin 0 -> 396 bytes .../plugins/smiley/images/tounge_smile.gif | Bin 0 -> 446 bytes .../smiley/images/whatchutalkingabout_smile.gif | Bin 0 -> 452 bytes .../ckeditor/plugins/smiley/images/wink_smile.gif | Bin 0 -> 458 bytes .../plugins/specialchar/dialogs/specialchar.js | 7 + .../ckeditor/plugins/specialchar/lang/en.js | 6 + .../ckeditor/plugins/styles/styles/default.js | 6 + .../ckeditor/plugins/table/dialogs/table.js | 9 + .../ckeditor/plugins/tableresize/plugin.js | 7 + .../plugins/tabletools/dialogs/tableCell.js | 8 + .../plugins/templates/dialogs/templates.js | 7 + .../plugins/templates/templates/default.js | 6 + .../templates/templates/images/template1.gif | Bin 0 -> 375 bytes .../templates/templates/images/template2.gif | Bin 0 -> 333 bytes .../templates/templates/images/template3.gif | Bin 0 -> 422 bytes .../ckeditor/plugins/uicolor/dialogs/uicolor.js | 7 + .../ckeditor/plugins/uicolor/lang/en.js | 6 + .../ckeditor/plugins/uicolor/lang/he.js | 6 + .../ckeditor/plugins/uicolor/plugin.js | 6 + .../ckeditor/plugins/uicolor/uicolor.gif | Bin 0 -> 1108 bytes .../ckeditor/plugins/uicolor/yui/assets/hue_bg.png | Bin 0 -> 1120 bytes .../plugins/uicolor/yui/assets/hue_thumb.png | Bin 0 -> 195 bytes .../plugins/uicolor/yui/assets/picker_mask.png | Bin 0 -> 12174 bytes .../plugins/uicolor/yui/assets/picker_thumb.png | Bin 0 -> 192 bytes .../ckeditor/plugins/uicolor/yui/assets/yui.css | 6 + .../ckeditor/plugins/uicolor/yui/yui.js | 76 + .../ckeditor/plugins/wsc/dialogs/ciframe.html | 49 + .../ckeditor/plugins/wsc/dialogs/tmpFrameset.html | 52 + .../ckeditor/plugins/wsc/dialogs/wsc.css | 6 + .../ckeditor/plugins/wsc/dialogs/wsc.js | 7 + .../custom_template/ckeditor/skins/kama/dialog.css | 9 + .../custom_template/ckeditor/skins/kama/editor.css | 13 + .../custom_template/ckeditor/skins/kama/icons.png | Bin 0 -> 5598 bytes .../ckeditor/skins/kama/icons_rtl.png | Bin 0 -> 5600 bytes .../ckeditor/skins/kama/images/dialog_sides.gif | Bin 0 -> 48 bytes .../ckeditor/skins/kama/images/dialog_sides.png | Bin 0 -> 178 bytes .../skins/kama/images/dialog_sides_rtl.png | Bin 0 -> 181 bytes .../ckeditor/skins/kama/images/mini.gif | Bin 0 -> 183 bytes .../ckeditor/skins/kama/images/noimage.png | Bin 0 -> 2115 bytes .../ckeditor/skins/kama/images/sprites.png | Bin 0 -> 7086 bytes .../ckeditor/skins/kama/images/sprites_ie6.png | Bin 0 -> 2724 bytes .../ckeditor/skins/kama/images/toolbar_start.gif | Bin 0 -> 105 bytes .../custom_template/ckeditor/skins/kama/skin.js | 7 + .../ckeditor/skins/kama/templates.css | 6 + .../ckeditor/skins/office2003/dialog.css | 9 + .../ckeditor/skins/office2003/editor.css | 14 + .../ckeditor/skins/office2003/icons.png | Bin 0 -> 5598 bytes .../ckeditor/skins/office2003/icons_rtl.png | Bin 0 -> 5600 bytes .../skins/office2003/images/dialog_sides.gif | Bin 0 -> 48 bytes .../skins/office2003/images/dialog_sides.png | Bin 0 -> 178 bytes .../skins/office2003/images/dialog_sides_rtl.png | Bin 0 -> 181 bytes .../ckeditor/skins/office2003/images/mini.gif | Bin 0 -> 183 bytes .../ckeditor/skins/office2003/images/noimage.png | Bin 0 -> 2115 bytes .../ckeditor/skins/office2003/images/sprites.png | Bin 0 -> 6119 bytes .../skins/office2003/images/sprites_ie6.png | Bin 0 -> 2715 bytes .../ckeditor/skins/office2003/skin.js | 6 + .../ckeditor/skins/office2003/templates.css | 6 + .../custom_template/ckeditor/skins/v2/dialog.css | 9 + .../custom_template/ckeditor/skins/v2/editor.css | 13 + .../custom_template/ckeditor/skins/v2/icons.png | Bin 0 -> 5598 bytes .../ckeditor/skins/v2/icons_rtl.png | Bin 0 -> 5600 bytes .../ckeditor/skins/v2/images/dialog_sides.gif | Bin 0 -> 48 bytes .../ckeditor/skins/v2/images/dialog_sides.png | Bin 0 -> 178 bytes .../ckeditor/skins/v2/images/dialog_sides_rtl.png | Bin 0 -> 181 bytes .../ckeditor/skins/v2/images/mini.gif | Bin 0 -> 183 bytes .../ckeditor/skins/v2/images/noimage.png | Bin 0 -> 2115 bytes .../ckeditor/skins/v2/images/sprites.png | Bin 0 -> 5389 bytes .../ckeditor/skins/v2/images/sprites_ie6.png | Bin 0 -> 492 bytes .../ckeditor/skins/v2/images/toolbar_start.gif | Bin 0 -> 105 bytes library/custom_template/ckeditor/skins/v2/skin.js | 6 + .../ckeditor/skins/v2/templates.css | 6 + library/custom_template/ckeditor/test.html | 11 + .../ckeditor/themes/default/theme.js | 8 + library/custom_template/custom_template.php | 238 ++ library/custom_template/delete_category.php | 130 + library/custom_template/fonts/Courier-Bold.afm | 342 +++ .../custom_template/fonts/Courier-BoldOblique.afm | 342 +++ library/custom_template/fonts/Courier-Oblique.afm | 342 +++ library/custom_template/fonts/Courier.afm | 342 +++ library/custom_template/fonts/Helvetica-Bold.afm | 2827 ++++++++++++++++++ .../fonts/Helvetica-BoldOblique.afm | 2827 ++++++++++++++++++ .../custom_template/fonts/Helvetica-Oblique.afm | 3051 +++++++++++++++++++ library/custom_template/fonts/Helvetica.afm | 3051 +++++++++++++++++++ library/custom_template/fonts/Symbol.afm | 213 ++ library/custom_template/fonts/Times-Bold.afm | 2588 ++++++++++++++++ library/custom_template/fonts/Times-BoldItalic.afm | 2384 +++++++++++++++ library/custom_template/fonts/Times-Italic.afm | 2667 +++++++++++++++++ library/custom_template/fonts/Times-Roman.afm | 2419 +++++++++++++++ library/custom_template/fonts/ZapfDingbats.afm | 225 ++ library/custom_template/fonts/php_Courier-Bold.afm | 1 + .../fonts/php_Courier-BoldOblique.afm | 1 + .../custom_template/fonts/php_Courier-Oblique.afm | 1 + library/custom_template/fonts/php_Courier.afm | 1 + .../custom_template/fonts/php_Helvetica-Bold.afm | 1 + .../fonts/php_Helvetica-BoldOblique.afm | 1 + .../fonts/php_Helvetica-Oblique.afm | 1 + library/custom_template/fonts/php_Helvetica.afm | 1 + library/custom_template/fonts/php_Symbol.afm | 1 + library/custom_template/fonts/php_Times-Bold.afm | 1 + .../custom_template/fonts/php_Times-BoldItalic.afm | 1 + library/custom_template/fonts/php_Times-Italic.afm | 1 + library/custom_template/fonts/php_Times-Roman.afm | 1 + library/custom_template/fonts/php_ZapfDingbats.afm | 1 + library/custom_template/fonts/php_a0100131.afm | 1 + library/custom_template/fonts/php_a010013l.afm | 1 + library/custom_template/personalize.php | 471 +++ library/custom_template/quest_popup.php | 100 + library/custom_template/save_as.php | 56 + library/custom_template/share_template.php | 117 + library/custom_template/updateDB.php | 51 + library/custom_template/upgrade_version.php | 56 + library/js/ajax_functions_writer.js | 204 ++ library/js/jquery-ui-1.7.1.custom.min.js | 54 + library/options.inc.php | 24 +- sql/4_0_0-to-4_1_0_upgrade.sql | 35 + sql/database.sql | 41 +- version.php | 2 +- 677 files changed, 144836 insertions(+), 25 deletions(-) create mode 100644 images/b_edit.png create mode 100644 images/enter.gif create mode 100644 images/paragraph.png create mode 100644 images/question.png create mode 100644 library/custom_template/add_context.php create mode 100644 library/custom_template/add_custombutton.php create mode 100644 library/custom_template/add_template.php create mode 100644 library/custom_template/ajax_code.php create mode 100644 library/custom_template/ckeditor/.htaccess create mode 100644 library/custom_template/ckeditor/CHANGES.html create mode 100644 library/custom_template/ckeditor/INSTALL.html create mode 100644 library/custom_template/ckeditor/LICENSE.html create mode 100644 library/custom_template/ckeditor/_samples/adobeair/application.xml create mode 100644 library/custom_template/ckeditor/_samples/adobeair/run.bat create mode 100644 library/custom_template/ckeditor/_samples/adobeair/sample.html create mode 100644 library/custom_template/ckeditor/_samples/ajax.html create mode 100644 library/custom_template/ckeditor/_samples/api.html create mode 100644 library/custom_template/ckeditor/_samples/api_dialog.html create mode 100644 library/custom_template/ckeditor/_samples/api_dialog/my_dialog.js create mode 100644 library/custom_template/ckeditor/_samples/asp/advanced.asp create mode 100644 library/custom_template/ckeditor/_samples/asp/events.asp create mode 100644 library/custom_template/ckeditor/_samples/asp/index.html create mode 100644 library/custom_template/ckeditor/_samples/asp/replace.asp create mode 100644 library/custom_template/ckeditor/_samples/asp/replaceall.asp create mode 100644 library/custom_template/ckeditor/_samples/asp/sample_posteddata.asp create mode 100644 library/custom_template/ckeditor/_samples/asp/standalone.asp create mode 100644 library/custom_template/ckeditor/_samples/assets/_posteddata.php create mode 100644 library/custom_template/ckeditor/_samples/assets/output_for_flash.fla create mode 100644 library/custom_template/ckeditor/_samples/assets/output_for_flash.swf create mode 100644 library/custom_template/ckeditor/_samples/assets/output_xhtml.css create mode 100644 library/custom_template/ckeditor/_samples/assets/swfobject.js create mode 100644 library/custom_template/ckeditor/_samples/autogrow.html create mode 100644 library/custom_template/ckeditor/_samples/divreplace.html create mode 100644 library/custom_template/ckeditor/_samples/enterkey.html create mode 100644 library/custom_template/ckeditor/_samples/fullpage.html create mode 100644 library/custom_template/ckeditor/_samples/index.html create mode 100644 library/custom_template/ckeditor/_samples/jqueryadapter.html create mode 100644 library/custom_template/ckeditor/_samples/output_for_flash.html create mode 100644 library/custom_template/ckeditor/_samples/output_html.html create mode 100644 library/custom_template/ckeditor/_samples/output_xhtml.html create mode 100644 library/custom_template/ckeditor/_samples/php/advanced.php create mode 100644 library/custom_template/ckeditor/_samples/php/events.php create mode 100644 library/custom_template/ckeditor/_samples/php/index.html create mode 100644 library/custom_template/ckeditor/_samples/php/replace.php create mode 100644 library/custom_template/ckeditor/_samples/php/replaceall.php create mode 100644 library/custom_template/ckeditor/_samples/php/standalone.php create mode 100644 library/custom_template/ckeditor/_samples/placeholder.html create mode 100644 library/custom_template/ckeditor/_samples/replacebyclass.html create mode 100644 library/custom_template/ckeditor/_samples/replacebycode.html create mode 100644 library/custom_template/ckeditor/_samples/sample.css create mode 100644 library/custom_template/ckeditor/_samples/sample.js create mode 100644 library/custom_template/ckeditor/_samples/sample_posteddata.php create mode 100644 library/custom_template/ckeditor/_samples/sharedspaces.html create mode 100644 library/custom_template/ckeditor/_samples/skins.html create mode 100644 library/custom_template/ckeditor/_samples/ui_color.html create mode 100644 library/custom_template/ckeditor/_samples/ui_languages.html create mode 100644 library/custom_template/ckeditor/_source/adapters/jquery.js create mode 100644 library/custom_template/ckeditor/_source/core/_bootstrap.js create mode 100644 library/custom_template/ckeditor/_source/core/ajax.js create mode 100644 library/custom_template/ckeditor/_source/core/ckeditor.js create mode 100644 library/custom_template/ckeditor/_source/core/ckeditor_base.js create mode 100644 library/custom_template/ckeditor/_source/core/ckeditor_basic.js create mode 100644 library/custom_template/ckeditor/_source/core/command.js create mode 100644 library/custom_template/ckeditor/_source/core/commanddefinition.js create mode 100644 library/custom_template/ckeditor/_source/core/config.js create mode 100644 library/custom_template/ckeditor/_source/core/dataprocessor.js create mode 100644 library/custom_template/ckeditor/_source/core/dom.js create mode 100644 library/custom_template/ckeditor/_source/core/dom/comment.js create mode 100644 library/custom_template/ckeditor/_source/core/dom/document.js create mode 100644 library/custom_template/ckeditor/_source/core/dom/documentfragment.js create mode 100644 library/custom_template/ckeditor/_source/core/dom/domobject.js create mode 100644 library/custom_template/ckeditor/_source/core/dom/element.js create mode 100644 library/custom_template/ckeditor/_source/core/dom/elementpath.js create mode 100644 library/custom_template/ckeditor/_source/core/dom/event.js create mode 100644 library/custom_template/ckeditor/_source/core/dom/node.js create mode 100644 library/custom_template/ckeditor/_source/core/dom/nodelist.js create mode 100644 library/custom_template/ckeditor/_source/core/dom/range.js create mode 100644 library/custom_template/ckeditor/_source/core/dom/rangelist.js create mode 100644 library/custom_template/ckeditor/_source/core/dom/text.js create mode 100644 library/custom_template/ckeditor/_source/core/dom/walker.js create mode 100644 library/custom_template/ckeditor/_source/core/dom/window.js create mode 100644 library/custom_template/ckeditor/_source/core/dtd.js create mode 100644 library/custom_template/ckeditor/_source/core/editor.js create mode 100644 library/custom_template/ckeditor/_source/core/editor_basic.js create mode 100644 library/custom_template/ckeditor/_source/core/env.js create mode 100644 library/custom_template/ckeditor/_source/core/event.js create mode 100644 library/custom_template/ckeditor/_source/core/eventInfo.js create mode 100644 library/custom_template/ckeditor/_source/core/focusmanager.js create mode 100644 library/custom_template/ckeditor/_source/core/htmlparser.js create mode 100644 library/custom_template/ckeditor/_source/core/htmlparser/basicwriter.js create mode 100644 library/custom_template/ckeditor/_source/core/htmlparser/cdata.js create mode 100644 library/custom_template/ckeditor/_source/core/htmlparser/comment.js create mode 100644 library/custom_template/ckeditor/_source/core/htmlparser/element.js create mode 100644 library/custom_template/ckeditor/_source/core/htmlparser/filter.js create mode 100644 library/custom_template/ckeditor/_source/core/htmlparser/fragment.js create mode 100644 library/custom_template/ckeditor/_source/core/htmlparser/text.js create mode 100644 library/custom_template/ckeditor/_source/core/lang.js create mode 100644 library/custom_template/ckeditor/_source/core/loader.js create mode 100644 library/custom_template/ckeditor/_source/core/plugindefinition.js create mode 100644 library/custom_template/ckeditor/_source/core/plugins.js create mode 100644 library/custom_template/ckeditor/_source/core/resourcemanager.js create mode 100644 library/custom_template/ckeditor/_source/core/scriptloader.js create mode 100644 library/custom_template/ckeditor/_source/core/skins.js create mode 100644 library/custom_template/ckeditor/_source/core/themes.js create mode 100644 library/custom_template/ckeditor/_source/core/tools.js create mode 100644 library/custom_template/ckeditor/_source/core/ui.js create mode 100644 library/custom_template/ckeditor/_source/core/xml.js create mode 100644 library/custom_template/ckeditor/_source/lang/_languages.js create mode 100644 library/custom_template/ckeditor/_source/lang/_translationstatus.txt create mode 100644 library/custom_template/ckeditor/_source/lang/af.js create mode 100644 library/custom_template/ckeditor/_source/lang/ar.js create mode 100644 library/custom_template/ckeditor/_source/lang/bg.js create mode 100644 library/custom_template/ckeditor/_source/lang/bn.js create mode 100644 library/custom_template/ckeditor/_source/lang/bs.js create mode 100644 library/custom_template/ckeditor/_source/lang/ca.js create mode 100644 library/custom_template/ckeditor/_source/lang/cs.js create mode 100644 library/custom_template/ckeditor/_source/lang/cy.js create mode 100644 library/custom_template/ckeditor/_source/lang/da.js create mode 100644 library/custom_template/ckeditor/_source/lang/de.js create mode 100644 library/custom_template/ckeditor/_source/lang/el.js create mode 100644 library/custom_template/ckeditor/_source/lang/en-au.js create mode 100644 library/custom_template/ckeditor/_source/lang/en-ca.js create mode 100644 library/custom_template/ckeditor/_source/lang/en-gb.js create mode 100644 library/custom_template/ckeditor/_source/lang/en.js create mode 100644 library/custom_template/ckeditor/_source/lang/eo.js create mode 100644 library/custom_template/ckeditor/_source/lang/es.js create mode 100644 library/custom_template/ckeditor/_source/lang/et.js create mode 100644 library/custom_template/ckeditor/_source/lang/eu.js create mode 100644 library/custom_template/ckeditor/_source/lang/fa.js create mode 100644 library/custom_template/ckeditor/_source/lang/fi.js create mode 100644 library/custom_template/ckeditor/_source/lang/fo.js create mode 100644 library/custom_template/ckeditor/_source/lang/fr-ca.js create mode 100644 library/custom_template/ckeditor/_source/lang/fr.js create mode 100644 library/custom_template/ckeditor/_source/lang/gl.js create mode 100644 library/custom_template/ckeditor/_source/lang/gu.js create mode 100644 library/custom_template/ckeditor/_source/lang/he.js create mode 100644 library/custom_template/ckeditor/_source/lang/hi.js create mode 100644 library/custom_template/ckeditor/_source/lang/hr.js create mode 100644 library/custom_template/ckeditor/_source/lang/hu.js create mode 100644 library/custom_template/ckeditor/_source/lang/is.js create mode 100644 library/custom_template/ckeditor/_source/lang/it.js create mode 100644 library/custom_template/ckeditor/_source/lang/ja.js create mode 100644 library/custom_template/ckeditor/_source/lang/km.js create mode 100644 library/custom_template/ckeditor/_source/lang/ko.js create mode 100644 library/custom_template/ckeditor/_source/lang/lt.js create mode 100644 library/custom_template/ckeditor/_source/lang/lv.js create mode 100644 library/custom_template/ckeditor/_source/lang/mn.js create mode 100644 library/custom_template/ckeditor/_source/lang/ms.js create mode 100644 library/custom_template/ckeditor/_source/lang/nb.js create mode 100644 library/custom_template/ckeditor/_source/lang/nl.js create mode 100644 library/custom_template/ckeditor/_source/lang/no.js create mode 100644 library/custom_template/ckeditor/_source/lang/pl.js create mode 100644 library/custom_template/ckeditor/_source/lang/pt-br.js create mode 100644 library/custom_template/ckeditor/_source/lang/pt.js create mode 100644 library/custom_template/ckeditor/_source/lang/ro.js create mode 100644 library/custom_template/ckeditor/_source/lang/ru.js create mode 100644 library/custom_template/ckeditor/_source/lang/sk.js create mode 100644 library/custom_template/ckeditor/_source/lang/sl.js create mode 100644 library/custom_template/ckeditor/_source/lang/sr-latn.js create mode 100644 library/custom_template/ckeditor/_source/lang/sr.js create mode 100644 library/custom_template/ckeditor/_source/lang/sv.js create mode 100644 library/custom_template/ckeditor/_source/lang/th.js create mode 100644 library/custom_template/ckeditor/_source/lang/tr.js create mode 100644 library/custom_template/ckeditor/_source/lang/uk.js create mode 100644 library/custom_template/ckeditor/_source/lang/vi.js create mode 100644 library/custom_template/ckeditor/_source/lang/zh-cn.js create mode 100644 library/custom_template/ckeditor/_source/lang/zh.js create mode 100644 library/custom_template/ckeditor/_source/plugins/a11yhelp/dialogs/a11yhelp.js create mode 100644 library/custom_template/ckeditor/_source/plugins/a11yhelp/lang/en.js create mode 100644 library/custom_template/ckeditor/_source/plugins/a11yhelp/lang/he.js create mode 100644 library/custom_template/ckeditor/_source/plugins/a11yhelp/plugin.js create mode 100644 library/custom_template/ckeditor/_source/plugins/about/dialogs/about.js create mode 100644 library/custom_template/ckeditor/_source/plugins/about/dialogs/logo_ckeditor.png create mode 100644 library/custom_template/ckeditor/_source/plugins/about/plugin.js create mode 100644 library/custom_template/ckeditor/_source/plugins/adobeair/plugin.js create mode 100644 library/custom_template/ckeditor/_source/plugins/autogrow/plugin.js create mode 100644 library/custom_template/ckeditor/_source/plugins/basicstyles/plugin.js create mode 100644 library/custom_template/ckeditor/_source/plugins/bidi/plugin.js create mode 100644 library/custom_template/ckeditor/_source/plugins/blockquote/plugin.js create mode 100644 library/custom_template/ckeditor/_source/plugins/button/plugin.js create mode 100644 library/custom_template/ckeditor/_source/plugins/clipboard/dialogs/paste.js create mode 100644 library/custom_template/ckeditor/_source/plugins/clipboard/plugin.js create mode 100644 library/custom_template/ckeditor/_source/plugins/colorbutton/plugin.js create mode 100644 library/custom_template/ckeditor/_source/plugins/colordialog/dialogs/colordialog.js create mode 100644 library/custom_template/ckeditor/_source/plugins/colordialog/plugin.js create mode 100644 library/custom_template/ckeditor/_source/plugins/contextmenu/plugin.js create mode 100644 library/custom_template/ckeditor/_source/plugins/dialog/dialogDefinition.js create mode 100644 library/custom_template/ckeditor/_source/plugins/dialog/plugin.js create mode 100644 library/custom_template/ckeditor/_source/plugins/dialogadvtab/plugin.js create mode 100644 library/custom_template/ckeditor/_source/plugins/dialogui/plugin.js create mode 100644 library/custom_template/ckeditor/_source/plugins/div/dialogs/div.js create mode 100644 library/custom_template/ckeditor/_source/plugins/div/plugin.js create mode 100644 library/custom_template/ckeditor/_source/plugins/domiterator/plugin.js create mode 100644 library/custom_template/ckeditor/_source/plugins/editingblock/plugin.js create mode 100644 library/custom_template/ckeditor/_source/plugins/elementspath/plugin.js create mode 100644 library/custom_template/ckeditor/_source/plugins/enterkey/plugin.js create mode 100644 library/custom_template/ckeditor/_source/plugins/entities/plugin.js create mode 100644 library/custom_template/ckeditor/_source/plugins/fakeobjects/plugin.js create mode 100644 library/custom_template/ckeditor/_source/plugins/filebrowser/plugin.js create mode 100644 library/custom_template/ckeditor/_source/plugins/find/dialogs/find.js create mode 100644 library/custom_template/ckeditor/_source/plugins/find/plugin.js create mode 100644 library/custom_template/ckeditor/_source/plugins/flash/dialogs/flash.js create mode 100644 library/custom_template/ckeditor/_source/plugins/flash/images/placeholder.png create mode 100644 library/custom_template/ckeditor/_source/plugins/flash/plugin.js create mode 100644 library/custom_template/ckeditor/_source/plugins/floatpanel/plugin.js create mode 100644 library/custom_template/ckeditor/_source/plugins/font/plugin.js create mode 100644 library/custom_template/ckeditor/_source/plugins/format/plugin.js create mode 100644 library/custom_template/ckeditor/_source/plugins/forms/dialogs/button.js create mode 100644 library/custom_template/ckeditor/_source/plugins/forms/dialogs/checkbox.js create mode 100644 library/custom_template/ckeditor/_source/plugins/forms/dialogs/form.js create mode 100644 library/custom_template/ckeditor/_source/plugins/forms/dialogs/hiddenfield.js create mode 100644 library/custom_template/ckeditor/_source/plugins/forms/dialogs/radio.js create mode 100644 library/custom_template/ckeditor/_source/plugins/forms/dialogs/select.js create mode 100644 library/custom_template/ckeditor/_source/plugins/forms/dialogs/textarea.js create mode 100644 library/custom_template/ckeditor/_source/plugins/forms/dialogs/textfield.js create mode 100644 library/custom_template/ckeditor/_source/plugins/forms/images/hiddenfield.gif create mode 100644 library/custom_template/ckeditor/_source/plugins/forms/plugin.js create mode 100644 library/custom_template/ckeditor/_source/plugins/horizontalrule/plugin.js create mode 100644 library/custom_template/ckeditor/_source/plugins/htmldataprocessor/plugin.js create mode 100644 library/custom_template/ckeditor/_source/plugins/htmlwriter/plugin.js create mode 100644 library/custom_template/ckeditor/_source/plugins/iframe/dialogs/iframe.js create mode 100644 library/custom_template/ckeditor/_source/plugins/iframe/images/placeholder.png create mode 100644 library/custom_template/ckeditor/_source/plugins/iframe/plugin.js create mode 100644 library/custom_template/ckeditor/_source/plugins/iframedialog/plugin.js create mode 100644 library/custom_template/ckeditor/_source/plugins/image/dialogs/image.js create mode 100644 library/custom_template/ckeditor/_source/plugins/image/plugin.js create mode 100644 library/custom_template/ckeditor/_source/plugins/indent/plugin.js create mode 100644 library/custom_template/ckeditor/_source/plugins/justify/plugin.js create mode 100644 library/custom_template/ckeditor/_source/plugins/keystrokes/plugin.js create mode 100644 library/custom_template/ckeditor/_source/plugins/link/dialogs/anchor.js create mode 100644 library/custom_template/ckeditor/_source/plugins/link/dialogs/link.js create mode 100644 library/custom_template/ckeditor/_source/plugins/link/images/anchor.gif create mode 100644 library/custom_template/ckeditor/_source/plugins/link/plugin.js create mode 100644 library/custom_template/ckeditor/_source/plugins/list/plugin.js create mode 100644 library/custom_template/ckeditor/_source/plugins/listblock/plugin.js create mode 100644 library/custom_template/ckeditor/_source/plugins/liststyle/dialogs/liststyle.js create mode 100644 library/custom_template/ckeditor/_source/plugins/liststyle/plugin.js create mode 100644 library/custom_template/ckeditor/_source/plugins/maximize/plugin.js create mode 100644 library/custom_template/ckeditor/_source/plugins/menu/plugin.js create mode 100644 library/custom_template/ckeditor/_source/plugins/menubutton/plugin.js create mode 100644 library/custom_template/ckeditor/_source/plugins/newpage/plugin.js create mode 100644 library/custom_template/ckeditor/_source/plugins/pagebreak/images/pagebreak.gif create mode 100644 library/custom_template/ckeditor/_source/plugins/pagebreak/plugin.js create mode 100644 library/custom_template/ckeditor/_source/plugins/panel/plugin.js create mode 100644 library/custom_template/ckeditor/_source/plugins/panelbutton/plugin.js create mode 100644 library/custom_template/ckeditor/_source/plugins/pastefromword/filter/default.js create mode 100644 library/custom_template/ckeditor/_source/plugins/pastefromword/plugin.js create mode 100644 library/custom_template/ckeditor/_source/plugins/pastetext/dialogs/pastetext.js create mode 100644 library/custom_template/ckeditor/_source/plugins/pastetext/plugin.js create mode 100644 library/custom_template/ckeditor/_source/plugins/placeholder/dialogs/placeholder.js create mode 100644 library/custom_template/ckeditor/_source/plugins/placeholder/lang/en.js create mode 100644 library/custom_template/ckeditor/_source/plugins/placeholder/placeholder.gif create mode 100644 library/custom_template/ckeditor/_source/plugins/placeholder/plugin.js create mode 100644 library/custom_template/ckeditor/_source/plugins/popup/plugin.js create mode 100644 library/custom_template/ckeditor/_source/plugins/preview/plugin.js create mode 100644 library/custom_template/ckeditor/_source/plugins/print/plugin.js create mode 100644 library/custom_template/ckeditor/_source/plugins/removeformat/plugin.js create mode 100644 library/custom_template/ckeditor/_source/plugins/resize/plugin.js create mode 100644 library/custom_template/ckeditor/_source/plugins/richcombo/plugin.js create mode 100644 library/custom_template/ckeditor/_source/plugins/save/plugin.js create mode 100644 library/custom_template/ckeditor/_source/plugins/scayt/dialogs/options.js create mode 100644 library/custom_template/ckeditor/_source/plugins/scayt/dialogs/toolbar.css create mode 100644 library/custom_template/ckeditor/_source/plugins/scayt/plugin.js create mode 100644 library/custom_template/ckeditor/_source/plugins/selection/plugin.js create mode 100644 library/custom_template/ckeditor/_source/plugins/showblocks/images/block_address.png create mode 100644 library/custom_template/ckeditor/_source/plugins/showblocks/images/block_blockquote.png create mode 100644 library/custom_template/ckeditor/_source/plugins/showblocks/images/block_div.png create mode 100644 library/custom_template/ckeditor/_source/plugins/showblocks/images/block_h1.png create mode 100644 library/custom_template/ckeditor/_source/plugins/showblocks/images/block_h2.png create mode 100644 library/custom_template/ckeditor/_source/plugins/showblocks/images/block_h3.png create mode 100644 library/custom_template/ckeditor/_source/plugins/showblocks/images/block_h4.png create mode 100644 library/custom_template/ckeditor/_source/plugins/showblocks/images/block_h5.png create mode 100644 library/custom_template/ckeditor/_source/plugins/showblocks/images/block_h6.png create mode 100644 library/custom_template/ckeditor/_source/plugins/showblocks/images/block_p.png create mode 100644 library/custom_template/ckeditor/_source/plugins/showblocks/images/block_pre.png create mode 100644 library/custom_template/ckeditor/_source/plugins/showblocks/plugin.js create mode 100644 library/custom_template/ckeditor/_source/plugins/showborders/plugin.js create mode 100644 library/custom_template/ckeditor/_source/plugins/smiley/dialogs/smiley.js create mode 100644 library/custom_template/ckeditor/_source/plugins/smiley/images/angel_smile.gif create mode 100644 library/custom_template/ckeditor/_source/plugins/smiley/images/angry_smile.gif create mode 100644 library/custom_template/ckeditor/_source/plugins/smiley/images/broken_heart.gif create mode 100644 library/custom_template/ckeditor/_source/plugins/smiley/images/confused_smile.gif create mode 100644 library/custom_template/ckeditor/_source/plugins/smiley/images/cry_smile.gif create mode 100644 library/custom_template/ckeditor/_source/plugins/smiley/images/devil_smile.gif create mode 100644 library/custom_template/ckeditor/_source/plugins/smiley/images/embaressed_smile.gif create mode 100644 library/custom_template/ckeditor/_source/plugins/smiley/images/envelope.gif create mode 100644 library/custom_template/ckeditor/_source/plugins/smiley/images/heart.gif create mode 100644 library/custom_template/ckeditor/_source/plugins/smiley/images/kiss.gif create mode 100644 library/custom_template/ckeditor/_source/plugins/smiley/images/lightbulb.gif create mode 100644 library/custom_template/ckeditor/_source/plugins/smiley/images/omg_smile.gif create mode 100644 library/custom_template/ckeditor/_source/plugins/smiley/images/regular_smile.gif create mode 100644 library/custom_template/ckeditor/_source/plugins/smiley/images/sad_smile.gif create mode 100644 library/custom_template/ckeditor/_source/plugins/smiley/images/shades_smile.gif create mode 100644 library/custom_template/ckeditor/_source/plugins/smiley/images/teeth_smile.gif create mode 100644 library/custom_template/ckeditor/_source/plugins/smiley/images/thumbs_down.gif create mode 100644 library/custom_template/ckeditor/_source/plugins/smiley/images/thumbs_up.gif create mode 100644 library/custom_template/ckeditor/_source/plugins/smiley/images/tounge_smile.gif create mode 100644 library/custom_template/ckeditor/_source/plugins/smiley/images/whatchutalkingabout_smile.gif create mode 100644 library/custom_template/ckeditor/_source/plugins/smiley/images/wink_smile.gif create mode 100644 library/custom_template/ckeditor/_source/plugins/smiley/plugin.js create mode 100644 library/custom_template/ckeditor/_source/plugins/sourcearea/plugin.js create mode 100644 library/custom_template/ckeditor/_source/plugins/specialchar/dialogs/specialchar.js create mode 100644 library/custom_template/ckeditor/_source/plugins/specialchar/lang/en.js create mode 100644 library/custom_template/ckeditor/_source/plugins/specialchar/plugin.js create mode 100644 library/custom_template/ckeditor/_source/plugins/styles/plugin.js create mode 100644 library/custom_template/ckeditor/_source/plugins/styles/styles/default.js create mode 100644 library/custom_template/ckeditor/_source/plugins/stylescombo/plugin.js create mode 100644 library/custom_template/ckeditor/_source/plugins/tab/plugin.js create mode 100644 library/custom_template/ckeditor/_source/plugins/table/dialogs/table.js create mode 100644 library/custom_template/ckeditor/_source/plugins/table/plugin.js create mode 100644 library/custom_template/ckeditor/_source/plugins/tableresize/plugin.js create mode 100644 library/custom_template/ckeditor/_source/plugins/tabletools/dialogs/tableCell.js create mode 100644 library/custom_template/ckeditor/_source/plugins/tabletools/plugin.js create mode 100644 library/custom_template/ckeditor/_source/plugins/templates/dialogs/templates.js create mode 100644 library/custom_template/ckeditor/_source/plugins/templates/plugin.js create mode 100644 library/custom_template/ckeditor/_source/plugins/templates/templates/default.js create mode 100644 library/custom_template/ckeditor/_source/plugins/templates/templates/images/template1.gif create mode 100644 library/custom_template/ckeditor/_source/plugins/templates/templates/images/template2.gif create mode 100644 library/custom_template/ckeditor/_source/plugins/templates/templates/images/template3.gif create mode 100644 library/custom_template/ckeditor/_source/plugins/toolbar/plugin.js create mode 100644 library/custom_template/ckeditor/_source/plugins/uicolor/dialogs/uicolor.js create mode 100644 library/custom_template/ckeditor/_source/plugins/uicolor/lang/en.js create mode 100644 library/custom_template/ckeditor/_source/plugins/uicolor/lang/he.js create mode 100644 library/custom_template/ckeditor/_source/plugins/uicolor/plugin.js create mode 100644 library/custom_template/ckeditor/_source/plugins/uicolor/uicolor.gif create mode 100644 library/custom_template/ckeditor/_source/plugins/uicolor/yui/assets/hue_bg.png create mode 100644 library/custom_template/ckeditor/_source/plugins/uicolor/yui/assets/hue_thumb.png create mode 100644 library/custom_template/ckeditor/_source/plugins/uicolor/yui/assets/picker_mask.png create mode 100644 library/custom_template/ckeditor/_source/plugins/uicolor/yui/assets/picker_thumb.png create mode 100644 library/custom_template/ckeditor/_source/plugins/uicolor/yui/assets/yui.css create mode 100644 library/custom_template/ckeditor/_source/plugins/uicolor/yui/yui.js create mode 100644 library/custom_template/ckeditor/_source/plugins/undo/plugin.js create mode 100644 library/custom_template/ckeditor/_source/plugins/wsc/dialogs/ciframe.html create mode 100644 library/custom_template/ckeditor/_source/plugins/wsc/dialogs/tmpFrameset.html create mode 100644 library/custom_template/ckeditor/_source/plugins/wsc/dialogs/wsc.css create mode 100644 library/custom_template/ckeditor/_source/plugins/wsc/dialogs/wsc.js create mode 100644 library/custom_template/ckeditor/_source/plugins/wsc/plugin.js create mode 100644 library/custom_template/ckeditor/_source/plugins/wysiwygarea/plugin.js create mode 100644 library/custom_template/ckeditor/_source/skins/kama/dialog.css create mode 100644 library/custom_template/ckeditor/_source/skins/kama/editor.css create mode 100644 library/custom_template/ckeditor/_source/skins/kama/elementspath.css create mode 100644 library/custom_template/ckeditor/_source/skins/kama/icons.css create mode 100644 library/custom_template/ckeditor/_source/skins/kama/icons.png create mode 100644 library/custom_template/ckeditor/_source/skins/kama/icons_rtl.png create mode 100644 library/custom_template/ckeditor/_source/skins/kama/images/dialog_sides.gif create mode 100644 library/custom_template/ckeditor/_source/skins/kama/images/dialog_sides.png create mode 100644 library/custom_template/ckeditor/_source/skins/kama/images/dialog_sides_rtl.png create mode 100644 library/custom_template/ckeditor/_source/skins/kama/images/mini.gif create mode 100644 library/custom_template/ckeditor/_source/skins/kama/images/noimage.png create mode 100644 library/custom_template/ckeditor/_source/skins/kama/images/sprites.png create mode 100644 library/custom_template/ckeditor/_source/skins/kama/images/sprites_ie6.png create mode 100644 library/custom_template/ckeditor/_source/skins/kama/images/toolbar_start.gif create mode 100644 library/custom_template/ckeditor/_source/skins/kama/mainui.css create mode 100644 library/custom_template/ckeditor/_source/skins/kama/menu.css create mode 100644 library/custom_template/ckeditor/_source/skins/kama/panel.css create mode 100644 library/custom_template/ckeditor/_source/skins/kama/presets.css create mode 100644 library/custom_template/ckeditor/_source/skins/kama/reset.css create mode 100644 library/custom_template/ckeditor/_source/skins/kama/richcombo.css create mode 100644 library/custom_template/ckeditor/_source/skins/kama/skin.js create mode 100644 library/custom_template/ckeditor/_source/skins/kama/templates.css create mode 100644 library/custom_template/ckeditor/_source/skins/kama/toolbar.css create mode 100644 library/custom_template/ckeditor/_source/skins/office2003/dialog.css create mode 100644 library/custom_template/ckeditor/_source/skins/office2003/editor.css create mode 100644 library/custom_template/ckeditor/_source/skins/office2003/elementspath.css create mode 100644 library/custom_template/ckeditor/_source/skins/office2003/icons.css create mode 100644 library/custom_template/ckeditor/_source/skins/office2003/icons.png create mode 100644 library/custom_template/ckeditor/_source/skins/office2003/icons_rtl.png create mode 100644 library/custom_template/ckeditor/_source/skins/office2003/images/dialog_sides.gif create mode 100644 library/custom_template/ckeditor/_source/skins/office2003/images/dialog_sides.png create mode 100644 library/custom_template/ckeditor/_source/skins/office2003/images/dialog_sides_rtl.png create mode 100644 library/custom_template/ckeditor/_source/skins/office2003/images/mini.gif create mode 100644 library/custom_template/ckeditor/_source/skins/office2003/images/noimage.png create mode 100644 library/custom_template/ckeditor/_source/skins/office2003/images/sprites.png create mode 100644 library/custom_template/ckeditor/_source/skins/office2003/images/sprites_ie6.png create mode 100644 library/custom_template/ckeditor/_source/skins/office2003/mainui.css create mode 100644 library/custom_template/ckeditor/_source/skins/office2003/menu.css create mode 100644 library/custom_template/ckeditor/_source/skins/office2003/panel.css create mode 100644 library/custom_template/ckeditor/_source/skins/office2003/presets.css create mode 100644 library/custom_template/ckeditor/_source/skins/office2003/reset.css create mode 100644 library/custom_template/ckeditor/_source/skins/office2003/richcombo.css create mode 100644 library/custom_template/ckeditor/_source/skins/office2003/skin.js create mode 100644 library/custom_template/ckeditor/_source/skins/office2003/templates.css create mode 100644 library/custom_template/ckeditor/_source/skins/office2003/toolbar.css create mode 100644 library/custom_template/ckeditor/_source/skins/v2/dialog.css create mode 100644 library/custom_template/ckeditor/_source/skins/v2/editor.css create mode 100644 library/custom_template/ckeditor/_source/skins/v2/elementspath.css create mode 100644 library/custom_template/ckeditor/_source/skins/v2/icons.css create mode 100644 library/custom_template/ckeditor/_source/skins/v2/icons.png create mode 100644 library/custom_template/ckeditor/_source/skins/v2/icons_rtl.png create mode 100644 library/custom_template/ckeditor/_source/skins/v2/images/dialog_sides.gif create mode 100644 library/custom_template/ckeditor/_source/skins/v2/images/dialog_sides.png create mode 100644 library/custom_template/ckeditor/_source/skins/v2/images/dialog_sides_rtl.png create mode 100644 library/custom_template/ckeditor/_source/skins/v2/images/mini.gif create mode 100644 library/custom_template/ckeditor/_source/skins/v2/images/noimage.png create mode 100644 library/custom_template/ckeditor/_source/skins/v2/images/sprites.png create mode 100644 library/custom_template/ckeditor/_source/skins/v2/images/sprites_ie6.png create mode 100644 library/custom_template/ckeditor/_source/skins/v2/images/toolbar_start.gif create mode 100644 library/custom_template/ckeditor/_source/skins/v2/mainui.css create mode 100644 library/custom_template/ckeditor/_source/skins/v2/menu.css create mode 100644 library/custom_template/ckeditor/_source/skins/v2/panel.css create mode 100644 library/custom_template/ckeditor/_source/skins/v2/presets.css create mode 100644 library/custom_template/ckeditor/_source/skins/v2/reset.css create mode 100644 library/custom_template/ckeditor/_source/skins/v2/richcombo.css create mode 100644 library/custom_template/ckeditor/_source/skins/v2/skin.js create mode 100644 library/custom_template/ckeditor/_source/skins/v2/templates.css create mode 100644 library/custom_template/ckeditor/_source/skins/v2/toolbar.css create mode 100644 library/custom_template/ckeditor/_source/themes/default/theme.js create mode 100644 library/custom_template/ckeditor/adapters/jquery.js create mode 100644 library/custom_template/ckeditor/ckeditor.asp create mode 100644 library/custom_template/ckeditor/ckeditor.js create mode 100644 library/custom_template/ckeditor/ckeditor.pack create mode 100644 library/custom_template/ckeditor/ckeditor.php create mode 100644 library/custom_template/ckeditor/ckeditor_basic.js create mode 100644 library/custom_template/ckeditor/ckeditor_basic_source.js create mode 100644 library/custom_template/ckeditor/ckeditor_php4.php create mode 100644 library/custom_template/ckeditor/ckeditor_php5.php create mode 100644 library/custom_template/ckeditor/ckeditor_source.js create mode 100644 library/custom_template/ckeditor/config.js create mode 100644 library/custom_template/ckeditor/contents.css create mode 100644 library/custom_template/ckeditor/images/spacer.gif create mode 100644 library/custom_template/ckeditor/lang/_languages.js create mode 100644 library/custom_template/ckeditor/lang/_translationstatus.txt create mode 100644 library/custom_template/ckeditor/lang/af.js create mode 100644 library/custom_template/ckeditor/lang/ar.js create mode 100644 library/custom_template/ckeditor/lang/bg.js create mode 100644 library/custom_template/ckeditor/lang/bn.js create mode 100644 library/custom_template/ckeditor/lang/bs.js create mode 100644 library/custom_template/ckeditor/lang/ca.js create mode 100644 library/custom_template/ckeditor/lang/cs.js create mode 100644 library/custom_template/ckeditor/lang/cy.js create mode 100644 library/custom_template/ckeditor/lang/da.js create mode 100644 library/custom_template/ckeditor/lang/de.js create mode 100644 library/custom_template/ckeditor/lang/el.js create mode 100644 library/custom_template/ckeditor/lang/en-au.js create mode 100644 library/custom_template/ckeditor/lang/en-ca.js create mode 100644 library/custom_template/ckeditor/lang/en-gb.js create mode 100644 library/custom_template/ckeditor/lang/en.js create mode 100644 library/custom_template/ckeditor/lang/eo.js create mode 100644 library/custom_template/ckeditor/lang/es.js create mode 100644 library/custom_template/ckeditor/lang/et.js create mode 100644 library/custom_template/ckeditor/lang/eu.js create mode 100644 library/custom_template/ckeditor/lang/fa.js create mode 100644 library/custom_template/ckeditor/lang/fi.js create mode 100644 library/custom_template/ckeditor/lang/fo.js create mode 100644 library/custom_template/ckeditor/lang/fr-ca.js create mode 100644 library/custom_template/ckeditor/lang/fr.js create mode 100644 library/custom_template/ckeditor/lang/gl.js create mode 100644 library/custom_template/ckeditor/lang/gu.js create mode 100644 library/custom_template/ckeditor/lang/he.js create mode 100644 library/custom_template/ckeditor/lang/hi.js create mode 100644 library/custom_template/ckeditor/lang/hr.js create mode 100644 library/custom_template/ckeditor/lang/hu.js create mode 100644 library/custom_template/ckeditor/lang/is.js create mode 100644 library/custom_template/ckeditor/lang/it.js create mode 100644 library/custom_template/ckeditor/lang/ja.js create mode 100644 library/custom_template/ckeditor/lang/km.js create mode 100644 library/custom_template/ckeditor/lang/ko.js create mode 100644 library/custom_template/ckeditor/lang/lt.js create mode 100644 library/custom_template/ckeditor/lang/lv.js create mode 100644 library/custom_template/ckeditor/lang/mn.js create mode 100644 library/custom_template/ckeditor/lang/ms.js create mode 100644 library/custom_template/ckeditor/lang/nb.js create mode 100644 library/custom_template/ckeditor/lang/nl.js create mode 100644 library/custom_template/ckeditor/lang/no.js create mode 100644 library/custom_template/ckeditor/lang/pl.js create mode 100644 library/custom_template/ckeditor/lang/pt-br.js create mode 100644 library/custom_template/ckeditor/lang/pt.js create mode 100644 library/custom_template/ckeditor/lang/ro.js create mode 100644 library/custom_template/ckeditor/lang/ru.js create mode 100644 library/custom_template/ckeditor/lang/sk.js create mode 100644 library/custom_template/ckeditor/lang/sl.js create mode 100644 library/custom_template/ckeditor/lang/sr-latn.js create mode 100644 library/custom_template/ckeditor/lang/sr.js create mode 100644 library/custom_template/ckeditor/lang/sv.js create mode 100644 library/custom_template/ckeditor/lang/th.js create mode 100644 library/custom_template/ckeditor/lang/tr.js create mode 100644 library/custom_template/ckeditor/lang/uk.js create mode 100644 library/custom_template/ckeditor/lang/vi.js create mode 100644 library/custom_template/ckeditor/lang/zh-cn.js create mode 100644 library/custom_template/ckeditor/lang/zh.js create mode 100644 library/custom_template/ckeditor/plugins/a11yhelp/dialogs/a11yhelp.js create mode 100644 library/custom_template/ckeditor/plugins/a11yhelp/lang/en.js create mode 100644 library/custom_template/ckeditor/plugins/a11yhelp/lang/he.js create mode 100644 library/custom_template/ckeditor/plugins/about/dialogs/about.js create mode 100644 library/custom_template/ckeditor/plugins/about/dialogs/logo_ckeditor.png create mode 100644 library/custom_template/ckeditor/plugins/adobeair/plugin.js create mode 100644 library/custom_template/ckeditor/plugins/autogrow/plugin.js create mode 100644 library/custom_template/ckeditor/plugins/clipboard/dialogs/paste.js create mode 100644 library/custom_template/ckeditor/plugins/colordialog/dialogs/colordialog.js create mode 100644 library/custom_template/ckeditor/plugins/dialog/dialogDefinition.js create mode 100644 library/custom_template/ckeditor/plugins/div/dialogs/div.js create mode 100644 library/custom_template/ckeditor/plugins/find/dialogs/find.js create mode 100644 library/custom_template/ckeditor/plugins/flash/dialogs/flash.js create mode 100644 library/custom_template/ckeditor/plugins/flash/images/placeholder.png create mode 100644 library/custom_template/ckeditor/plugins/forms/dialogs/button.js create mode 100644 library/custom_template/ckeditor/plugins/forms/dialogs/checkbox.js create mode 100644 library/custom_template/ckeditor/plugins/forms/dialogs/form.js create mode 100644 library/custom_template/ckeditor/plugins/forms/dialogs/hiddenfield.js create mode 100644 library/custom_template/ckeditor/plugins/forms/dialogs/radio.js create mode 100644 library/custom_template/ckeditor/plugins/forms/dialogs/select.js create mode 100644 library/custom_template/ckeditor/plugins/forms/dialogs/textarea.js create mode 100644 library/custom_template/ckeditor/plugins/forms/dialogs/textfield.js create mode 100644 library/custom_template/ckeditor/plugins/forms/images/hiddenfield.gif create mode 100644 library/custom_template/ckeditor/plugins/iframe/dialogs/iframe.js create mode 100644 library/custom_template/ckeditor/plugins/iframe/images/placeholder.png create mode 100644 library/custom_template/ckeditor/plugins/iframedialog/plugin.js create mode 100644 library/custom_template/ckeditor/plugins/image/dialogs/image.js create mode 100644 library/custom_template/ckeditor/plugins/link/dialogs/anchor.js create mode 100644 library/custom_template/ckeditor/plugins/link/dialogs/link.js create mode 100644 library/custom_template/ckeditor/plugins/link/images/anchor.gif create mode 100644 library/custom_template/ckeditor/plugins/liststyle/dialogs/liststyle.js create mode 100644 library/custom_template/ckeditor/plugins/pagebreak/images/pagebreak.gif create mode 100644 library/custom_template/ckeditor/plugins/pastefromword/filter/default.js create mode 100644 library/custom_template/ckeditor/plugins/pastetext/dialogs/pastetext.js create mode 100644 library/custom_template/ckeditor/plugins/placeholder/dialogs/placeholder.js create mode 100644 library/custom_template/ckeditor/plugins/placeholder/lang/en.js create mode 100644 library/custom_template/ckeditor/plugins/placeholder/placeholder.gif create mode 100644 library/custom_template/ckeditor/plugins/placeholder/plugin.js create mode 100644 library/custom_template/ckeditor/plugins/scayt/dialogs/options.js create mode 100644 library/custom_template/ckeditor/plugins/scayt/dialogs/toolbar.css create mode 100644 library/custom_template/ckeditor/plugins/showblocks/images/block_address.png create mode 100644 library/custom_template/ckeditor/plugins/showblocks/images/block_blockquote.png create mode 100644 library/custom_template/ckeditor/plugins/showblocks/images/block_div.png create mode 100644 library/custom_template/ckeditor/plugins/showblocks/images/block_h1.png create mode 100644 library/custom_template/ckeditor/plugins/showblocks/images/block_h2.png create mode 100644 library/custom_template/ckeditor/plugins/showblocks/images/block_h3.png create mode 100644 library/custom_template/ckeditor/plugins/showblocks/images/block_h4.png create mode 100644 library/custom_template/ckeditor/plugins/showblocks/images/block_h5.png create mode 100644 library/custom_template/ckeditor/plugins/showblocks/images/block_h6.png create mode 100644 library/custom_template/ckeditor/plugins/showblocks/images/block_p.png create mode 100644 library/custom_template/ckeditor/plugins/showblocks/images/block_pre.png create mode 100644 library/custom_template/ckeditor/plugins/smiley/dialogs/smiley.js create mode 100644 library/custom_template/ckeditor/plugins/smiley/images/angel_smile.gif create mode 100644 library/custom_template/ckeditor/plugins/smiley/images/angry_smile.gif create mode 100644 library/custom_template/ckeditor/plugins/smiley/images/broken_heart.gif create mode 100644 library/custom_template/ckeditor/plugins/smiley/images/confused_smile.gif create mode 100644 library/custom_template/ckeditor/plugins/smiley/images/cry_smile.gif create mode 100644 library/custom_template/ckeditor/plugins/smiley/images/devil_smile.gif create mode 100644 library/custom_template/ckeditor/plugins/smiley/images/embaressed_smile.gif create mode 100644 library/custom_template/ckeditor/plugins/smiley/images/envelope.gif create mode 100644 library/custom_template/ckeditor/plugins/smiley/images/heart.gif create mode 100644 library/custom_template/ckeditor/plugins/smiley/images/kiss.gif create mode 100644 library/custom_template/ckeditor/plugins/smiley/images/lightbulb.gif create mode 100644 library/custom_template/ckeditor/plugins/smiley/images/omg_smile.gif create mode 100644 library/custom_template/ckeditor/plugins/smiley/images/regular_smile.gif create mode 100644 library/custom_template/ckeditor/plugins/smiley/images/sad_smile.gif create mode 100644 library/custom_template/ckeditor/plugins/smiley/images/shades_smile.gif create mode 100644 library/custom_template/ckeditor/plugins/smiley/images/teeth_smile.gif create mode 100644 library/custom_template/ckeditor/plugins/smiley/images/thumbs_down.gif create mode 100644 library/custom_template/ckeditor/plugins/smiley/images/thumbs_up.gif create mode 100644 library/custom_template/ckeditor/plugins/smiley/images/tounge_smile.gif create mode 100644 library/custom_template/ckeditor/plugins/smiley/images/whatchutalkingabout_smile.gif create mode 100644 library/custom_template/ckeditor/plugins/smiley/images/wink_smile.gif create mode 100644 library/custom_template/ckeditor/plugins/specialchar/dialogs/specialchar.js create mode 100644 library/custom_template/ckeditor/plugins/specialchar/lang/en.js create mode 100644 library/custom_template/ckeditor/plugins/styles/styles/default.js create mode 100644 library/custom_template/ckeditor/plugins/table/dialogs/table.js create mode 100644 library/custom_template/ckeditor/plugins/tableresize/plugin.js create mode 100644 library/custom_template/ckeditor/plugins/tabletools/dialogs/tableCell.js create mode 100644 library/custom_template/ckeditor/plugins/templates/dialogs/templates.js create mode 100644 library/custom_template/ckeditor/plugins/templates/templates/default.js create mode 100644 library/custom_template/ckeditor/plugins/templates/templates/images/template1.gif create mode 100644 library/custom_template/ckeditor/plugins/templates/templates/images/template2.gif create mode 100644 library/custom_template/ckeditor/plugins/templates/templates/images/template3.gif create mode 100644 library/custom_template/ckeditor/plugins/uicolor/dialogs/uicolor.js create mode 100644 library/custom_template/ckeditor/plugins/uicolor/lang/en.js create mode 100644 library/custom_template/ckeditor/plugins/uicolor/lang/he.js create mode 100644 library/custom_template/ckeditor/plugins/uicolor/plugin.js create mode 100644 library/custom_template/ckeditor/plugins/uicolor/uicolor.gif create mode 100644 library/custom_template/ckeditor/plugins/uicolor/yui/assets/hue_bg.png create mode 100644 library/custom_template/ckeditor/plugins/uicolor/yui/assets/hue_thumb.png create mode 100644 library/custom_template/ckeditor/plugins/uicolor/yui/assets/picker_mask.png create mode 100644 library/custom_template/ckeditor/plugins/uicolor/yui/assets/picker_thumb.png create mode 100644 library/custom_template/ckeditor/plugins/uicolor/yui/assets/yui.css create mode 100644 library/custom_template/ckeditor/plugins/uicolor/yui/yui.js create mode 100644 library/custom_template/ckeditor/plugins/wsc/dialogs/ciframe.html create mode 100644 library/custom_template/ckeditor/plugins/wsc/dialogs/tmpFrameset.html create mode 100644 library/custom_template/ckeditor/plugins/wsc/dialogs/wsc.css create mode 100644 library/custom_template/ckeditor/plugins/wsc/dialogs/wsc.js create mode 100644 library/custom_template/ckeditor/skins/kama/dialog.css create mode 100644 library/custom_template/ckeditor/skins/kama/editor.css create mode 100644 library/custom_template/ckeditor/skins/kama/icons.png create mode 100644 library/custom_template/ckeditor/skins/kama/icons_rtl.png create mode 100644 library/custom_template/ckeditor/skins/kama/images/dialog_sides.gif create mode 100644 library/custom_template/ckeditor/skins/kama/images/dialog_sides.png create mode 100644 library/custom_template/ckeditor/skins/kama/images/dialog_sides_rtl.png create mode 100644 library/custom_template/ckeditor/skins/kama/images/mini.gif create mode 100644 library/custom_template/ckeditor/skins/kama/images/noimage.png create mode 100644 library/custom_template/ckeditor/skins/kama/images/sprites.png create mode 100644 library/custom_template/ckeditor/skins/kama/images/sprites_ie6.png create mode 100644 library/custom_template/ckeditor/skins/kama/images/toolbar_start.gif create mode 100644 library/custom_template/ckeditor/skins/kama/skin.js create mode 100644 library/custom_template/ckeditor/skins/kama/templates.css create mode 100644 library/custom_template/ckeditor/skins/office2003/dialog.css create mode 100644 library/custom_template/ckeditor/skins/office2003/editor.css create mode 100644 library/custom_template/ckeditor/skins/office2003/icons.png create mode 100644 library/custom_template/ckeditor/skins/office2003/icons_rtl.png create mode 100644 library/custom_template/ckeditor/skins/office2003/images/dialog_sides.gif create mode 100644 library/custom_template/ckeditor/skins/office2003/images/dialog_sides.png create mode 100644 library/custom_template/ckeditor/skins/office2003/images/dialog_sides_rtl.png create mode 100644 library/custom_template/ckeditor/skins/office2003/images/mini.gif create mode 100644 library/custom_template/ckeditor/skins/office2003/images/noimage.png create mode 100644 library/custom_template/ckeditor/skins/office2003/images/sprites.png create mode 100644 library/custom_template/ckeditor/skins/office2003/images/sprites_ie6.png create mode 100644 library/custom_template/ckeditor/skins/office2003/skin.js create mode 100644 library/custom_template/ckeditor/skins/office2003/templates.css create mode 100644 library/custom_template/ckeditor/skins/v2/dialog.css create mode 100644 library/custom_template/ckeditor/skins/v2/editor.css create mode 100644 library/custom_template/ckeditor/skins/v2/icons.png create mode 100644 library/custom_template/ckeditor/skins/v2/icons_rtl.png create mode 100644 library/custom_template/ckeditor/skins/v2/images/dialog_sides.gif create mode 100644 library/custom_template/ckeditor/skins/v2/images/dialog_sides.png create mode 100644 library/custom_template/ckeditor/skins/v2/images/dialog_sides_rtl.png create mode 100644 library/custom_template/ckeditor/skins/v2/images/mini.gif create mode 100644 library/custom_template/ckeditor/skins/v2/images/noimage.png create mode 100644 library/custom_template/ckeditor/skins/v2/images/sprites.png create mode 100644 library/custom_template/ckeditor/skins/v2/images/sprites_ie6.png create mode 100644 library/custom_template/ckeditor/skins/v2/images/toolbar_start.gif create mode 100644 library/custom_template/ckeditor/skins/v2/skin.js create mode 100644 library/custom_template/ckeditor/skins/v2/templates.css create mode 100644 library/custom_template/ckeditor/test.html create mode 100644 library/custom_template/ckeditor/themes/default/theme.js create mode 100644 library/custom_template/custom_template.php create mode 100644 library/custom_template/delete_category.php create mode 100644 library/custom_template/fonts/Courier-Bold.afm create mode 100644 library/custom_template/fonts/Courier-BoldOblique.afm create mode 100644 library/custom_template/fonts/Courier-Oblique.afm create mode 100644 library/custom_template/fonts/Courier.afm create mode 100644 library/custom_template/fonts/Helvetica-Bold.afm create mode 100644 library/custom_template/fonts/Helvetica-BoldOblique.afm create mode 100644 library/custom_template/fonts/Helvetica-Oblique.afm create mode 100644 library/custom_template/fonts/Helvetica.afm create mode 100644 library/custom_template/fonts/Symbol.afm create mode 100644 library/custom_template/fonts/Times-Bold.afm create mode 100644 library/custom_template/fonts/Times-BoldItalic.afm create mode 100644 library/custom_template/fonts/Times-Italic.afm create mode 100644 library/custom_template/fonts/Times-Roman.afm create mode 100644 library/custom_template/fonts/ZapfDingbats.afm create mode 100644 library/custom_template/fonts/php_Courier-Bold.afm create mode 100644 library/custom_template/fonts/php_Courier-BoldOblique.afm create mode 100644 library/custom_template/fonts/php_Courier-Oblique.afm create mode 100644 library/custom_template/fonts/php_Courier.afm create mode 100644 library/custom_template/fonts/php_Helvetica-Bold.afm create mode 100644 library/custom_template/fonts/php_Helvetica-BoldOblique.afm create mode 100644 library/custom_template/fonts/php_Helvetica-Oblique.afm create mode 100644 library/custom_template/fonts/php_Helvetica.afm create mode 100644 library/custom_template/fonts/php_Symbol.afm create mode 100644 library/custom_template/fonts/php_Times-Bold.afm create mode 100644 library/custom_template/fonts/php_Times-BoldItalic.afm create mode 100644 library/custom_template/fonts/php_Times-Italic.afm create mode 100644 library/custom_template/fonts/php_Times-Roman.afm create mode 100644 library/custom_template/fonts/php_ZapfDingbats.afm create mode 100644 library/custom_template/fonts/php_a0100131.afm create mode 100644 library/custom_template/fonts/php_a010013l.afm create mode 100644 library/custom_template/personalize.php create mode 100644 library/custom_template/quest_popup.php create mode 100644 library/custom_template/save_as.php create mode 100644 library/custom_template/share_template.php create mode 100644 library/custom_template/updateDB.php create mode 100644 library/custom_template/upgrade_version.php create mode 100644 library/js/ajax_functions_writer.js create mode 100644 library/js/jquery-ui-1.7.1.custom.min.js diff --git a/acl_setup.php b/acl_setup.php index 2057456cc..1fa7df956 100644 --- a/acl_setup.php +++ b/acl_setup.php @@ -59,6 +59,8 @@ // xl('Sensitivities') $gacl->add_object_section('Placeholder' , 'placeholder' , 10, 0, 'ACO'); // xl('Placeholder') + $gacl->add_object_section('Nation Notes' , 'nationnotes' , 10, 0, 'ACO'); + // xl('Nation Notes') // Create Accounting ACOs. // @@ -158,6 +160,11 @@ // $gacl->add_object('placeholder', 'Placeholder (Maintains empty ACLs)', 'filler', 10, 0, 'ACO'); // xl('Placeholder (Maintains empty ACLs)') + + // Create ACO for nationnotes. + // + $gacl->add_object('nationnotes', 'Nation Notes Configure', 'nn_configure', 10, 0, 'ACO'); + // xl('Nation Notes Configure') // Create ARO groups. // @@ -208,7 +215,8 @@ $breakglass = $gacl->add_group('breakglass' , 'Emergency Login' , $users, 'A 'encounters'=>array('auth_a', 'coding_a', 'notes_a', 'date_a'), 'lists'=>array('default','state','country','language','ethrace'), 'patients'=>array('appt', 'demo', 'med', 'trans', 'docs', 'notes'), - 'sensitivities'=>array('normal', 'high') + 'sensitivities'=>array('normal', 'high'), + 'nationnotes'=>array('nn_configure') ), NULL, array($admin), NULL, NULL, 1, 1, 'write', 'Administrators can do anything' @@ -310,7 +318,8 @@ $breakglass = $gacl->add_group('breakglass' , 'Emergency Login' , $users, 'A 'encounters'=>array('auth_a', 'coding_a', 'notes_a', 'date_a'), 'lists'=>array('default','state','country','language','ethrace'), 'patients'=>array('appt', 'demo', 'med', 'trans', 'docs', 'notes'), - 'sensitivities'=>array('normal', 'high') + 'sensitivities'=>array('normal', 'high'), + 'nationnotes'=>array('nn_configure') ), NULL, array($breakglass), NULL, NULL, 1, 1, 'write', 'Emergency Login user can do anything' diff --git a/acl_upgrade.php b/acl_upgrade.php index 4c555066a..9ee4a83b1 100644 --- a/acl_upgrade.php +++ b/acl_upgrade.php @@ -76,6 +76,8 @@ addObjectSectionAcl('sensitivities', 'Sensitivities'); addObjectSectionAcl('lists', 'Lists'); //Add 'Placeholder' object section (added in 3.0.2) addObjectSectionAcl('placeholder', 'Placeholder'); +//Add 'Nation Notes' object section (added in 4.1.0) +addObjectSectionAcl('nationnotes','Nation Notes'); //Add new Objects echo "
Adding new objects
"; @@ -103,6 +105,8 @@ addObjectAcl('lists', 'Lists', 'ethrace', 'Ethnicity-Race List (write,addonly op addObjectAcl('placeholder', 'Placeholder', 'filler', 'Placeholder (Maintains empty ACLs)'); //Add 'Sign Lab Results (write,addonly optional)' object (added in 3.3.0) addObjectAcl('patients', 'Patients', 'sign', 'Sign Lab Results (write,addonly optional)'); +//Add 'nationnotes' object (added in 4.1.0) +addObjectAcl('nationnotes', 'Nation Notes', 'nn_configure', 'Nation Notes Configure'); //Update already existing Objects echo "
Upgrading objects
"; @@ -228,7 +232,10 @@ updateAcl($emergency_write, 'Emergency Login', 'sensitivities', 'Sensitivities', updateAcl($emergency_write, 'Emergency Login', 'sensitivities', 'Sensitivities', 'normal', 'Normal', 'write'); //Insert the 'sign' object from the 'patients' section into the Physicians group write ACL (added in 3.3.0) updateAcl($doc_write, 'Physicians', 'patients', 'Patients', 'sign', 'Sign Lab Results (write,addonly optional)', 'write'); - +//Insert the 'sign' object from the 'nationnotes' section into the Administrators group write ACL (added in 3.3.0) +updateAcl($admin_write, 'Administrators','nationnotes', 'Nation Notes', 'nn_configure', 'Nation Notes Configure','write'); +//Insert the 'sign' object from the 'nationnotes' section into the Emergency Login group write ACL (added in 3.3.0) +updateAcl($emergency_write, 'Emergency Login','nationnotes', 'Nation Notes', 'nn_configure', 'Nation Notes Configure','write'); //Function will return an array that contains the ACL ID number. //It will also check to ensure the ACL exist and is not duplicated. diff --git a/images/b_edit.png b/images/b_edit.png new file mode 100644 index 0000000000000000000000000000000000000000..05711a0948ed445c97dd21645f42a22a403735c9 GIT binary patch literal 451 zcwXxa@N?(olHy`uVBq!ia0vp^0wB!63?wyl`GbKJOS+@4BLl>+{$oq9z#bv`|(K8|7RH1EM%;!+W@rl%$ff) zXP){0|No6kKcVv0;5G-)fXVRHVF$S+0nK)Dy9MV0^ uQ!ekoV7P*T(Rflj1JKO7zZn?W82;Q;yt3}o zGJu36n9zhJJQ0b^;#?eyP9Yaa&8w@`)htCwp$bjt!VuJpq~^81qRmp(OwH9oEyr}}#;W!43fC+r3GvpW z-c@%Cx14w+TBJs|dekylPG*v=T(j?cTBKzMS$k3PD(z~j3@ffmrc)GYFI0M>ON2yD zw9=NByA9)QPdU+fi?(a3jqMttk+THS5=%`J@}^VBy&2-|uX?j|kMPJ@7wM68yQx=s z`FG&{rnE1$EDM%-Eb~_9%-@aq2rl$re-l`3;n3>T_MUurv^swN&Yzp|@$r$z@;j(q!3lK=n!AY({UO#lFTB>(_`g8%^e{{R4h=>PzA zFaQARU;qF*m;eA5Z<1fdMgRZ;8%ab#RCwBA{Qv(y12q9a05LI882|(j)eQs)AY2AA zlWQPA0O2t34-YV8ZSZOQ!N8z^O&lPASg@-8&%$u#(T~IX?tWsp^XWeW6D!vXes-3p zEPsD6{QdroLEsO!aYl%MKL-QD19Ytb0fg0s|Ns4Cn0@^Z!*6C5219W+1|{A<60Dzo z7}vQAZu-T9~Q9u z{0mdXhD|F#0AV$d@ju&N_TTRro`3(v@QXu`;rBll24*HM1`ZBZAfKB7U)lu-AnYz= zWcZTjEK&OZCo{vHSL_Tw|9)fm^y?GDx1XFmET2E(H4q?xSa3-Qa542ad-4hY|NQ4; z>Bi^n|CmG>xR`$Oe`4ik;Q8|xY$zimBZfYJ0K%ED*%=uAvNNz&vh#4xWoKb$`2GJI z!(UdGzak7Qc+(+301?b7KsRtQF!2B*hzrE~{^sisuV!LZ~|S54*&!ZK?DD?G4Ox?_?v-+S&-pB1N#>SW?_a8-+nOsVZyEzAbu41XAZ{{7GN{+AT5IL^!t5I{tfHY}Gpe(+sj`Scg)d-h)(pLv;o zzrMi0@C&>i{;pf z&xiBy5fCU4kRXl}i8TBH8fd7(<2R(FMU+%@lo2gG1rjvSxv&%w0YXV2u?dcS*uLa) zkKO$!631b>@6(J%ni)n!I0s{lQc7zLKn!u7V4bIiVHicxUO(K4QUd%jd1+!ipU)Qx zg)06`FZ{&Tn+Dz4arYOxomk3Md%e%LxnvisE{SF9VE_pQTjw+p}` zqA(0Mf`n@Vu>Q5nfF#iila3(MK1_us02@JaZ#vGh%+gwCSvH6b*95|^UIN0(RBr9I z_j3@x-so^eUXpLw-}rgGlN#a#Fcbw-N(mt>#+c(c z*T>Z-HEQS0X8+(=tCaZgvoJ1Bm>fX4T)s6yQ#R+CxF(@#r6QMHOAOBAAVNQPYFLpkA-HWB&HL{t=`($uuEV zYN~Qm{l%{EtBw3cV zTCGl}lcp&EDW&VWzVAyZ9mlb4n=v+WAR=ST$+XVmVnc9#8rVNLeM7~Gxhk0e0000< KMNUMnLSTa7iYU_n literal 0 HcwPel00001 diff --git a/interface/forms/LBF/new.php b/interface/forms/LBF/new.php index 4bfdc3363..a4c25eecb 100644 --- a/interface/forms/LBF/new.php +++ b/interface/forms/LBF/new.php @@ -154,15 +154,40 @@ div.section { - + + + + + + + - + + + + +
+ + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + +
#
","")'>
+
+
+ + \ No newline at end of file diff --git a/library/custom_template/add_custombutton.php b/library/custom_template/add_custombutton.php new file mode 100644 index 000000000..064f132f7 --- /dev/null +++ b/library/custom_template/add_custombutton.php @@ -0,0 +1,153 @@ + +// +// +// This program is free software; you can redistribute it and/or +// modify it under the terms of the GNU General Public License +// as published by the Free Software Foundation; either version 2 +// of the License, or (at your option) any later version. +// +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// +// A copy of the GNU General Public License is included along with this program: +// openemr/interface/login/GnuGPL.html +// For more information write to the Free Software +// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +// +// Author: Eldho Chacko +// Jacob T Paul +// +// +------------------------------------------------------------------------------+ + +//SANITIZE ALL ESCAPES +$sanitize_all_escapes=true; +// + +//STOP FAKE REGISTER GLOBALS +$fake_register_globals=false; +// + +require_once("../../interface/globals.php"); +if((isset($_POST['form_save']) && $_POST['form_save']=='Save') || (isset($_POST['form_delete']) && $_POST['form_delete']=='Delete')){ + $count = $_POST['count']; + $k=1; + $sta = $_POST['start']; + $end = $st+$count; + for($cnt=$sta;$cnt<=$end;$cnt++){ + if($_POST['hidid'.$cnt]){ + if(trim(formData('inshort'.$cnt))=='' && trim(formdata('designation'.$cnt))==''){ + sqlStatement("UPDATE customlists SET cl_deleted=1 WHERE cl_list_slno=?",array($_POST['hidid'.$cnt])); + sqlStatement("DELETE FROM template_users WHERE tu_template_id=? AND tu_user_id=?",array($_POST['hidid'.$cnt],$_SESSION['authId'])); + } + else{ + $sql = "UPDATE customlists SET cl_list_item_short=?,cl_list_item_long=?,cl_order=? WHERE cl_list_slno=?"; + sqlStatement($sql,array($_POST['inshort'.$cnt],$_POST['designation'.$cnt],$_POST['level'.$cnt],$_POST['hidid'.$cnt])); + } + } + else{ + if(trim(formData('inshort'.$cnt))!='' || trim(formdata('designation'.$cnt))!=''){ + $rowID=sqlQuery("SELECT MAX(cl_list_item_id)+1 as maxID FROM customlists WHERE cl_list_type=6"); + $itemID = $rowID['maxID'] ? $rowID['maxID'] : 1; + $sql = "INSERT INTO customlists (cl_list_item_id,cl_list_type,cl_list_item_short,cl_list_item_long,cl_order) VALUES(?,?,?,?,?)"; + $newid = sqlInsert($sql,array($itemID,6,$_POST['inshort'.$cnt],$_POST['designation'.$cnt],$_POST['level'.$cnt])); + sqlStatement("INSERT INTO template_users (tu_user_id,tu_template_id) VALUES (?,?)",array($_SESSION['authId'],$newid)); + } + } + if($_POST['form_delete']=='Delete'){ + if($_POST['chk'.$cnt]){ + sqlStatement("UPDATE customlists SET cl_deleted=1 WHERE cl_list_slno=?",array($_POST['chk'.$cnt])); + sqlStatement("DELETE FROM template_users WHERE tu_template_id=? AND tu_user_id=?",array($_POST['chk'.$cnt],$_SESSION['authId'])); + } + } + } + unset($_POST['form_save']); + unset($_POST['form_delete']); +} +?> + + + + + + +
+ + + + + + + + + + + + + + + '> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
# 
" value="" readonly="" style="width:25px; background-color:#C9C9C9"/>" size="10" value="" />" value="" />'>
+ + '/> +
+
+ + \ No newline at end of file diff --git a/library/custom_template/add_template.php b/library/custom_template/add_template.php new file mode 100644 index 000000000..3cce6678d --- /dev/null +++ b/library/custom_template/add_template.php @@ -0,0 +1,120 @@ + +// +// +// This program is free software; you can redistribute it and/or +// modify it under the terms of the GNU General Public License +// as published by the Free Software Foundation; either version 2 +// of the License, or (at your option) any later version. +// +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// +// A copy of the GNU General Public License is included along with this program: +// openemr/interface/login/GnuGPL.html +// For more information write to the Free Software +// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +// +// Author: Eldho Chacko +// Jacob T Paul +// +// +------------------------------------------------------------------------------+ + +//SANITIZE ALL ESCAPES +$sanitize_all_escapes=true; +// + +//STOP FAKE REGISTER GLOBALS +$fake_register_globals=false; +// + +require_once("../../interface/globals.php"); +$list_id = $_REQUEST['list_id']; +?> + + + + + + + +
+ + + + + + +
+ + + + + +
+
+ + \ No newline at end of file diff --git a/library/custom_template/ajax_code.php b/library/custom_template/ajax_code.php new file mode 100644 index 000000000..0d396da1e --- /dev/null +++ b/library/custom_template/ajax_code.php @@ -0,0 +1,195 @@ + +// +// +// This program is free software; you can redistribute it and/or +// modify it under the terms of the GNU General Public License +// as published by the Free Software Foundation; either version 2 +// of the License, or (at your option) any later version. +// +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// +// A copy of the GNU General Public License is included along with this program: +// openemr/interface/login/GnuGPL.html +// For more information write to the Free Software +// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +// +// Author: Eldho Chacko +// Jacob T Paul +// +// +------------------------------------------------------------------------------+ + +//SANITIZE ALL ESCAPES +$sanitize_all_escapes=true; +// + +//STOP FAKE REGISTER GLOBALS +$fake_register_globals=false; +// + +require_once("../../interface/globals.php"); + +$templateid = $_REQUEST['templateid']; +$Source = $_REQUEST['source']; +$list_id = $_REQUEST['list_id']; +$item = $_REQUEST['item']; +$multi = $_REQUEST['multi']; +$content = $_REQUEST['content']; + +if($Source=="add_template"){ + $arr = explode("|",$multi); + + for($i=0;$i"; + echo ""; + $resTemplates = sqlStatement("SELECT * FROM template_users AS tu LEFT OUTER JOIN customlists AS c ON tu.tu_template_id=c.cl_list_slno WHERE + tu.tu_user_id=? AND c.cl_list_type=3 AND cl_list_id=? AND cl_deleted=0 ORDER BY tu.tu_template_order, + c.cl_list_item_long",array($_SESSION['authId'],$list_id)); + while($rowTemplates = sqlFetchArray($resTemplates)){ + echo ""; + } + echo ""; + } +} +else if($Source=="save_provider"){ + $arr = explode("|",$multi); + for($i=0;$i"; + echo "".htmlspecialchars(xl('Preview of')," ".$selcat['cl_list_item_long']."(".$selcont['cl_list_item_long'].")",ENT_QUOTES).""; + $i=0; + while($row=sqlFetchArray($res)){ + $i++; + $class = ($class=='reportTableOddRow') ? 'reportTableEvenRow' : 'reportTableOddRow'; + echo "".$i."".htmlspecialchars($row['cl_list_item_long'],ENT_QUOTES).""; + } + echo ""; + } + else{ + echo ""; + echo ""; + echo "
".htmlspecialchars(xl('No items under selected category'),ENT_QUOTES)."
"; + } + $Source="add_template"; +} +else if($Source=='check_item'){ + $sql=sqlStatement("SELECT * FROM template_users WHERE tu_template_id=? AND tu_user_id=?",array($item,$list_id)); + $cnt=sqlNumRows($sql); + if($cnt){ + echo htmlspecialchars(xl("OK"),ENT_QUOTES); + } + else{ + echo htmlspecialchars(xl("FAIL"),ENT_QUOTES); + } + $Source="add_template"; +} +else if($Source=='display_item'){ + $multi = preg_replace('/\|$/','',$multi); + $val = str_replace("|",",",$multi); + echo ""; + $Source="add_template"; +} +else if($Source=='delete_category'){ + $res = sqlStatement("SELECT * FROM template_users AS tu LEFT OUTER JOIN users AS u ON tu.tu_user_id=u.id WHERE tu_template_id=? AND tu.tu_user_id!=?",array($templateid,$_SESSION['authId'])); + $users =''; + $i=0; + while($row=sqlFetchArray($res)){ + $i++; + $users .= $i.")".$row['fname']." ".$row['lname']."\n"; + } + echo htmlspecialchars($users,ENT_QUOTES); + $Source="add_template"; +} +else if($Source=='delete_full_category'){ + sqlStatement("UPDATE customlists SET cl_deleted=? WHERE cl_list_slno=?",array(1,$templateid)); + sqlStatement("DELETE template_users WHERE tu_template_id=?",array($templateid)); + $res = sqlStatement("SELECT * FROM customlists AS cl WHERE cl_list_id=?",array($templateid)); + while($row=sqlFetchArray($res)){ + sqlStatement("UPDATE customlists SET cl_deleted=1 WHERE cl_list_slno=?",array($row['cl_list_slno'])); + sqlStatement("DELETE template_users WHERE tu_template_id=?",array($row['cl_list_slno'])); + } + + $Source="add_template"; +} +else if($Source=='checkcontext'){ + $res = sqlStatement("SELECT * FROM customlists WHERE cl_deleted=0 AND cl_list_type=3 AND cl_list_id=?",array($list_id)); + if(sqlNumRows($res)){ + echo "1"; + } + else{ + echo "0"; + } + $Source="add_template"; +} +if($Source!="add_template"){ + $res= sqlStatement("SELECT * FROM customlists AS cl LEFT OUTER JOIN template_users AS tu ON cl.cl_list_slno=tu.tu_template_id + WHERE cl_list_type=4 AND cl_list_id=? AND cl_deleted=0 AND tu.tu_user_id=? ORDER BY tu.tu_template_order", + array($templateid,$_SESSION['authId'])); + $i=0; + while($row = sqlFetchArray($res)){ + $i++; + echo "
  • "; + if(acl_check('nationnotes', 'nn_configure')){ + echo ""; + } + echo "
    ".htmlspecialchars($row['cl_list_item_long'],ENT_QUOTES)."
    "; + if(acl_check('nationnotes', 'nn_configure')){ + echo ""; + echo ""; + } + echo "
  • "; + } + if(acl_check('nationnotes', 'nn_configure') && $templateid){ + echo "
  • ".htmlspecialchars(xl('Click to add new components'),ENT_QUOTES); + echo "
  • "; + } +} +?> \ No newline at end of file diff --git a/library/custom_template/ckeditor/.htaccess b/library/custom_template/ckeditor/.htaccess new file mode 100644 index 000000000..1427d97fb --- /dev/null +++ b/library/custom_template/ckeditor/.htaccess @@ -0,0 +1,24 @@ +# +# Copyright (c) 2003-2011, CKSource - Frederico Knabben. All rights reserved. +# For licensing, see LICENSE.html or http://ckeditor.com/license +# + +# +# On some specific Linux installations you could face problems with Firefox. +# It could give you errors when loading the editor saying that some illegal +# characters were found (three strange chars in the beginning of the file). +# This could happen if you map the .js or .css files to PHP, for example. +# +# Those characters are the Byte Order Mask (BOM) of the Unicode encoded files. +# All FCKeditor files are Unicode encoded. +# + +AddType application/x-javascript .js +AddType text/css .css + +# +# If PHP is mapped to handle XML files, you could have some issues. The +# following will disable it. +# + +AddType text/xml .xml diff --git a/library/custom_template/ckeditor/CHANGES.html b/library/custom_template/ckeditor/CHANGES.html new file mode 100644 index 000000000..d365c4950 --- /dev/null +++ b/library/custom_template/ckeditor/CHANGES.html @@ -0,0 +1,1154 @@ + + + + + Changelog — CKEditor + + + + +

    + CKEditor Changelog +

    +

    + CKEditor 3.5.2

    +

    + Fixed issues:

    +
      +
    • #7168 : [IE9] Destroying an editor instance throws an error.
    • +
    • #7169 : [IE9] Menu item has incorrect height.
    • +
    • #7178 : [IE9] Read-only attributes do not work in IE9.
    • +
    • #7181 : [IE9] Toolbar items are not aligned in v2 and Office2003 skins.
    • +
    • #7174 : [IE9] Elements path does not load correctly when the editor is switched back from Source to WYSIWYG.
    • +
    +

    + CKEditor 3.5.1

    +

    + New features:

    +
      +
    • #6107 : It is now possible to remove block styles using Styles and Paragraph Format drop-down lists.
    • +
    • #5590 : Remove Format command works in collapsed selections.
    • +
    • #5755 : The dialog_buttonsOrder option now works in Internet Explorer.
    • +
    • #6869 : The data-cke-nostyle attribute (which was introduced for escaping the element from been influenced by the style system since 3.5) is deprecated in favor of the new data-nostyle attribute.
    • +
    • Revised sample pages with code examples and clarifications.
    • +
    +

    + Fixed issues:

    +
      +
    • #5855 : Updating a link multiple times generates wrong href attribute.
    • +
    • #6166 : Error on Maximize command, when the toolbar button is not shown.
    • +
    • #6607 : Table cell "merge down" and "merge right" commands work only once.
    • +
    • #6228 : Merge down does not work, throwing a JavasSript error.
    • +
    • #6625 : BIDI: Mixed LTR/RTL direction causes incorrect behavior.
    • +
    • #6881 : IFrame capitalization is now consistent throughout labels.
    • +
    • #6686 : BIDI: [FF] When we apply explicit language direction to a numbered/bulleted list, the corresponding language direction toolbar icon is not highlighted.
    • +
    • #6566 : It is now possible to exit a blockquote using ENTER_BR.
    • +
    • #6868 : Partial (invalid) list structure crashes the editor on load.
    • +
    • #6804 : Buggy behavior when editing the legend element inside a fieldset.
    • +
    • #6724 : [IE7] Nested list display bug on empty list item.
    • +
    • #6715 : List items do not create paragraphs after the list placed in a table cell is removed.
    • +
    • #6695 : [Webkit] Display bug after the editor is restored from the full screen mode.
    • +
    • #6661 : [IE] Pre-formatted style does not preserve applied text direction.
    • +
    • #6655 : Using the editor resize grip causes small visual offsets.
    • +
    • #6604 : The div element should be used as a formatting block in ENTER_BR.
    • +
    • #6249 : BIDI: List item bullets are off viewport with RTL text direction.
    • +
    • #6610 : BIDI: ENTER_BR change direction in one line out of multiple.
    • +
    • #6872 : [IE] Link target field is not populated properly when no target is set.
    • +
    • #6880 : Samples: Added a user-friendly message for users on servers without PHP support.
    • +
    • #6628 : Setting config.enterMode from PHP fails.
    • +
    • #6278 : Comments were moved above the br tags.
    • +
    • #6687 : Empty tag should be removed in inline-style format.
    • +
    • #6645 : Allow to configure whether " (double quotes) characters should be encoded in the contents.
    • +
    • #6336 : IE: (double)clicking an input type="submit" button submitted the form.
    • +
    • #6646 : Context menu was not working for text inputs present in the initial content.
    • +
    • #6641 : Copying and pasting links inside the editor was not working.
    • +
    • #4208 : The disableObjectResizing setting now works in IE.
    • +
    • #6242 : [IE] Editing existing links with href of a relative path mangles containing text.
    • +
    • #5930 : [IE] Style definitions are no longer lowercased.
    • +
    • #5361 : Preview window's title should reflect the title tag in full page mode.
    • +
    • #5522 : [IE] In versions < 8 or compatibility mode, type="text" was missing in text fields.
    • +
    • #6126 : [IE] Avoid problems if there are two buttons named "submit".
    • +
    • #6791 : [IE7] Editor did not show up when the name of a replaced textarea matched the name of a meta tag in the page.
    • +
    • #5684 : [FF] When forcePasteAsPlainText is used, the cursor disappears after paste.
    • +
    • #6390 : Prevent toolbar dialog window buttons from being clicked twice.
    • +
    • #6684 : [Webkit] Toolbar buttons are not wrapping correctly when the editor is displayed inside a table.
    • +
    • #6703 : [IE] editor focus event not fired in an instance, when a dialog window closes.
    • +
    • #6873 : Difficult to drag the resize grip of the spell checker dialog window.
    • +
    • #6896 : [Webkit] Unable to paste into source area when the editor is maximized.
    • +
    • #6020 : The state of the Cut, Copy, and Paste toolbar now matches the state of the context menu buttons.
    • +
    • #5256 : JavaScript error thrown when percent (%) sign is used in image URL.
    • +
    • #6577 : [FF] Selection error when an element containing the editor instance is hidden.
    • +
    • #5500 : [IE] value attribute of text input dialog window field was missing.
    • +
    • #6665 : [IE] name field of Link dialog window was missing.
    • +
    • #6639 : Line-breaks inside pasted list item from Microsoft Word break the list structure.
    • +
    • #6909 : [IE] GIF icons of toolbar button from custom plugins are not diplayed in zoom level 100%.
    • +
    • #6860 : [FF] Double-clicking the placeholder element in order to open a Placeholder dialog window throws a JavaScript error.
    • +
    • #6630 : Empty pre elements are output differently in various browsers.
    • +
    • #6568 : Insert table row/column does not work with spanning.
    • +
    • #6735 : Inaccurate read-only selection detection.
    • +
    • #6728 : BIDI: Change direction does not work with list nested inside a blockquote.
    • +
    • #6432 : Inserting a table in place of a fully selected list results in a JavaScript error.
    • +
    • #6438 : [IE] Performance enhancement when typing inside an element with many child nodes.
    • +
    • #6970 : [IE] Dialog window shadows were presented inaccurately.
    • +
    • #6672 : [IE] Unnecessary br element is no longer inserted after a form.
    • +
    • #7087 : [FF] Sometimes it was not possible to move cursor out of link at the end of block.
    • +
    • Updated the following language files:
    • +
    +

    + CKEditor 3.5

    +

    + New features:

    +
      +
    • #4090 : Full Adobe AIR support.
    • +
    • #5084 : Dialog windows are now resizable with a grip located in the footer.
    • +
    • #5755 : Introduced the dialog_buttonsOrder setting, making it possible to control the buttons order.
    • +
    • #4648 : Added the new iFrame plugin.
    • +
    • #6010 : The Automatic option of the font/background color panel now represents the real color.
    • +
    • #5654 : New "placeholder" plugin.
    • +
    • #6334 : CKEditor now uses HTML5's data-* attributes for its internal attributes.
    • +
    • #6103 : It's now possible to control the styling of inline read-only elements with the disableReadonlyStyling setting. It's also possible to avoid inline-styling any element by setting its "data-cke-nostyle" attribute to "1".
    • +
    • #5404 : fillEmptyBlocks configuration option of v2 is now available.
    • +
    • #5367 : New CKEDITOR.editor#insertText method (check api.html sample page for usages) is now provided to insert plain text into editor.
    • +
    • #5915 : New removeDialogTabs configuration option to hide certain dialog tabs.
    • +
    +

    + Fixed issues:

    +
      +
    • #4821 : Icons in the toolbar were distorted with IE and zoom != 100%.
    • +
    • #5587 : Visual improvements in dialogs, reinforce field label on separate line.
    • +
    • #4652 : Now it's able to disable editor context menu by simply removing the "contextmenu" plugin.
    • +
    • #5599 : Labels of "specialchar" dialog are now translated.
    • +
    • #6419 : [IE] List creation by merging problem.
    • +
    • #6502 : Removed IE6 image preloading, which was used to defect the duplicate request of background images.
    • +
    • #6822 : Added labels to fake objects.
    • +
    • #6898 : [IE6] Toolbar icons becomes invisible in RTL.
    • +
    • Updated the following language files:
        +
      • Hebrew
      • +
    • +
    +

    + CKEditor 3.4.3

    +

    + Fixed issues:

    +
      +
    • #6554 : [Webkit] cannot type after inserting Page Break.
    • +
    • #6569 : Indentation now complies with text direction of the only item.
    • +
    • #6579 : The jQuery adapter was not working properly and was turned on in incompatible environments.
    • +
    • #6644 : Restrict onmousedown handler to the toolbar area.
    • +
    • #6656 : Panelbutton's buttons became active when clicking on Source.
    • +
    • #6248 : Whitespaces (nbsp elements) were incorrectly added into empty table cells and list items.
    • +
    • #6575 : Tabs disappearing in Link dialog window after a specific sequence of actions.
    • +
    • #6510 : Margin mirroring does not respect style configuration.
    • +
    • #6471 : BIDI: Pressing Decrease Indent in an RTL bulleted list causes incorrect behaviour.
    • +
    • #6479 : BIDI: Language direction is not being preserved when pressing Enter after a Paragraph Format was applied.
    • +
    • #6670 : BIDI: Indent & List icons are not reversed when we apply RTL direction to a paragraph with any of Paragraph Formatting options.
    • +
    • #6640 : Floating panels are now being closed when switching modes.
    • +
    • #4790 : Remove list with multiple items in enterBr doesnot preserve line breaks.
    • +
    • #6297 : Floated inline elements are not taking part in behavior of blocks anymore.
    • +
    • #6171 : [Firefox] Opening rich content drop-down list scrolls host page to the top when editor has a vertical scrollbar.
    • +
    • #6330 : List markers from MS Word with Roman numbering are not preserved.
    • +
    • #6720 : Attribute protection might detect wrong elements.
    • +
    • #6580 : [IE9] Flash dialog window does not get filled up.
    • +
    • #6447 : Decreasing indentation of a list with indentClasses config does not work.
    • +
    • #5894 : Adding custom buttons at the bottom of a dialog window does not cause it to expand to include its contents.
    • +
    • #6513 : Wrong ARIA attributes created on list options of Styles drop-down list.
    • +
    • #6150 : [Safari] Color dialog window was broken.
    • +
    • #6747 : Full screen layout issue caused by page element focus outside editor.
    • +
    • #6779 : Clicking the body element on elements path turns the selection on and off immediately.
    • +
    • #6781 : [IE7] Dialog windows are broken with RTL, Office 2003 and v2 skins.
    • +
    • #6798 : [IE7] Dialog window buttons disappearing in RTL after dragging.
    • +
    • #6806 : [IE7] Dialog window buttons invisible on focus.
    • +
    • #6588 : Copy and paste adds <span> if SCAYT is enabled.
    • +
    • #6673 : IE Target combo for Image Link shown as blank even when we select <not set> as an option.
    • +
    • Updated the following language files:
    • +
    +

    + CKEditor 3.4.2

    +

    + New features:

    +
      +
    • #5024 : Added a sample that shows how to output HTML that is valid for Flash.
    • +
    +

    + Fixed issues:

    +
      +
    • #5237 : English text in dialogs' title was flipped when using RTL language (office2003 and v2 skins).
    • +
    • #6289 : Deleting nested table removed the parent cell.
    • +
    • #6341 : The editor contents now have the text cursor.
    • +
    • #6153 : Chrome: tab focus is wrong.
    • +
    • #6261 : Focus and infinite loop between multiple editors.
    • +
    • #6170 : Dedicated class names are removed from floating panels when opening another panel.
    • +
    • #6339 : Autogrow plugin now doesn't work on maximized editors.
    • +
    • #6237 : BIDI: Applying same language direction to all paragraphs not working.
    • +
    • #6353 : [IE] Resize was broken with office2003 and v2 skins.
    • +
    • #6375 : Avoiding errors when hiding the editor after the blur event.
    • +
    • #6133 : Styled paragraphs result on buggy list creation.
    • +
    • #5074 : Link target is not removed when changing to popup.
    • +
    • #6408 : [IE] Autogrow now works correctly on Quirks.
    • +
    • #6420 : [IE] The table properties dialog now correctly retrieves the caption text.
    • +
    • #6141 : It was impossible to outdent a list when indentOffset was set to 0.
    • +
    • #6377 : FF width and height are not shown for smiley in Image properties dialog.
    • +
    • #5399 : Lists pasted from Word do not maintain their nesting.
    • +
    • #6225 : [FF] Cannot transform several lines to list with enterMode BR.
    • +
    • #6467 : [FF] It is now possible to disable the plugin command on "mode" event.
    • +
    • #6461 : Attributes are now being kept when changing block formatting.
    • +
    • #6226 : BIDI: Language direction applied to a Paragraph is removed when we apply one of Paragraph formatting options.
    • +
    • #5395 : [Opera] Native context menu incorrectly opened after Opera 10.2.
    • +
    • #6444 : [Opera] Close panels and dialogs don't return focus to wysiwyg frame.
    • +
    • #6332 : IE: V2 skin bottom dialog's border broken.
    • +
    • #5646 : Parser incorrectly removes inline element when there's only one comment node enclosed.
    • +
    • #6189 : Minor code size reduction.
    • +
    • #5045 : uiColor behaved wrong if multiple editors were used with period in their names.
    • +
    • #5766 : Config entry "ignoreEmptyParagraph" should only remove one single empty paragraph in document.
    • +
    • #5931 : Unable to apply inline style because of nested elements with same style name.
    • +
    • #6083 : Dialog close sometimes cause collapsed editor selection before the insertion.
    • +
    • #6253 : BIDI: creating a Numbered/Bulleted list causing improper behavior on bidi.
    • +
    • #4023 : [Opera] Maximize plugin.
    • +
    • #6403 : [Opera] Font name options are not correctly marked in dropdown list.
    • +
    • #4534 : [Opera] Arrow key to navigate through combo list has side effects of window scrolling.
    • +
    • #6534 : [Opera] Menu key brings up both CKEditor and browser context menu.
    • +
    • #6534 : [Opera] Menu key brings up both CKEditor and browser context menu.
    • +
    • #6416 : [IE9] Unable to make text selection with mouse in source area.
    • +
    • #6417 : [IE9] Context menu opens at the upper-left corner always.
    • +
    • #6501 : [IE9] Context menu item layout is broken.
    • +
    • #6099 : BIDI: when we apply explicit language direction to Numbered/Bulleted List the corresponding BIDI Tool bar icon is not highlighted in the Toolbar.
    • +
    • #6100 : BIDI: when we change Table language direction indentation of text in Table cells is not applied correctly.
    • +
    • #6376 : BIDI: buttons should not toggle the base language direction.
    • +
    • #6235 : BIDI: Applying direction to multi-paragraph selection within a div.
    • +
    • #6187 : [IE6] Multi-instance loading produces 404s on background images.
    • +
    • #5446 : Setting config.filebrowserImageBrowseUrl results in displaying also Browser Server on links.
    • +
    • #5626 : CKeditor 3.2.1 : html content attached makes ckeditor crash the browser FF/IE.
    • +
    • #6508 : BiDi: Margin mirroring logic doesn't honor CSS direction.
    • +
    • #6043 : BIDI: When we apply RTL direction to a right aligned Paragraph, Paragraph is not moved to the left & Alignment of Paragraph is not changed.
    • +
    • #6485 : BIDI: When direction is applied on partial selected list, the style is been incorrectly applied to the entire list.
    • +
    • #6087 : Cursor of input fields in dialog isn't visible in RTL.
    • +
    • #5595 : Extra leading spaces added in preformatted block.
    • +
    • #6094 : Match full word option doesn't stop on block boundaries.
    • +
    • #5730 : [Safari] Continual pastes (holding paste key) breaks document contents.
    • +
    • #5850 : [IE] Inline style misbehaviors at the beginning of numbered/bulleted list.
    • +
    • Updated the following language files:
        +
      • #6427 : Ukrainian;
      • +
      • #6464 : Finnish;
      • +
      • Hebrew;
      • +
    • +
    +

    + CKEditor 3.4.1

    +

    + New features:

    + +

    + Fixed issues:

    +
      +
    • #6027 : Modifying Table Properties by selecting more than one cell caused issues.
    • +
    • #6146 : IE: Floating panels were being opened in the wrong place in RTL pages with horizontal scrollbars.
    • +
    • #6055 : The timestamp is now added only once to each loaded file.
    • +
    • #6097 : The bookmarks now use the right name.
    • +
    • #5717 : Removed the scayt_contextMenuOntop setting and the SCAYT context menu options are always on top.
    • +
    • #5956 : [FF] It was impossible to create an editor inside an hidden container.
    • +
    • #5753 : It was impossible to have a default value for the name field in the select dialog.
    • +
    • #6041 : BIDI: Direction of Increase Indent & Decrease Indent icons are not reversed after changing Lang direction to RTL.
    • +
    • #6138 : List indentation is not working.
    • +
    • #5649 : Image dialog too wide when many styles are set.
    • +
    • #5715 : Cell color picker dialog returns focus to document.
    • +
    • #6108 : Fixed div style.
    • +
    • #5336 : Remove object style.
    • +
    • #6155 : [[FF]] Modifying Table Header Properties by selecting first Row, causing several issues.
    • +
    • #6163 : Focus not going to Tabs in Image dialog when we went to Edit the Image.
    • +
    • #6177 : IE we can't start Numbered/Bulleted list on a Empty page.
    • +
    • #5413 : Browser error after pasting html table in CKEditor.
    • +
    • #6034 : Horizontal Alignment applied to Table cell is not updated correctly in the Toolbar.
    • +
    • #6112 : BIDI: Alignment set to text in Table cell is not shown in the Tool bar when we press Enter to start a new Paragraph.
    • +
    • #6117 : BIDI: Language direction is changing when we come out of Numbered/Bulleted list.
    • +
    • #6182 : Language Direction field on the Advanced tab of Table Properties dialog has a fixed pixel width.
    • +
    • #5487 : Fullpage writer problem with line-break.
    • +
    • #6197 : The CKEDITOR.loader base path auto-detection was not working with the _source folder.
    • +
    • #6240 : Font Names & Font Sizes should be shown Left Align even for RTL Languages.
    • +
    • #5975 : Page-break should have proper Alt Text instead of Unknown object. so that JAWS reads it properly.
    • +
    • #6255 : Inserting a page break as the first node triggered an error.
    • +
    • #6188 : [IE7] Automatic color button had the wrong cursor.
    • +
    • #6129 : The show blocks' labels are now shown in the right for RTL languages.
    • +
    • #5421 : &shy; entity not converted when config.entities=false.
    • +
    • #5769 : xhtml code generation problem &nbsp; instead of &#160; (htmlentities, entities,entities_additional,..., configuration).
    • +
    • #4472 : [FF3] Browser window scrolls to loaded CKEditor.
    • +
    • #6230 : Fixed invalid parameter count for setTimeout function call.
    • +
    • #5335 : Several lines' formatted data will be merged to one line when we apply Numbers/Bullets.
    • +
    • #5353 : wrong width of editor after resize() called in Firefox 3.6.
    • +
    • #5778 : [IE] Unwanted scroll on first mouse right-click.
    • +
    • #5218 : [FF] Copy/paste of an image from same domain changed URL to relative URL.
    • +
    • #6265 : Popup window properties were visible in the link dialog's target tab when nothing was selected.
    • +
    • #6075 : [FF] Newly created links didn't fill in information on edit.
    • +
    • #6183 : The toolbar panels options sometimes had the contents' link color.
    • +
    • #6192 : [WebKit] Inserting smileys was not working because of editor focus issues.
    • +
    • #6178 : [WebKit] Inserting elements by code was failing if the editor didn't receive the focus first.
    • +
    • #6179 : [WebKit] The Image dialog was not working if the editor didn't receive the focus first.
    • +
    • #4657 : [Opera] Styles where not working with collapsed selections.
    • +
    • #5839 : "Insert row after" was removing the ids of the elements from the clicked row.
    • +
    • #6315 : DIV plugin TT #2885 regression.
    • +
    • Updated the following language files:
    • +
    +

    + CKEditor 3.4

    +

    + Fixed issues:

    +
      +
    • #6118 : Initial focus is now set to the tabs in the table properties dialog.
    • +
    • #6135 : The dialogadvtab plugin now uses the correct label.
    • +
    • #6125 : Focus was lost after applying commands in Opera.
    • +
    • #6137 : The table dialog was missing the default width value on second opening.
    • +
    +

    + CKEditor 3.4 Beta

    +

    + New features:

    +
      +
    • #5909 : New BiDi feature, making it possible to switch the base language direction of block elements.
    • +
    • #5268 : Introducing the "tableresize" plugin, which makes it possible to resize tables columns by mouse drag. It's not enabled by default, so it must be enabled in the configurations file.
    • +
    • #979 : New enableTabKeyTools configuration to allow using the TAB key to navigate through table cells.
    • +
    • #4606 : Introduce the "autogrow" plugin, which makes the editor resize automatically, based on the contents size.
    • +
    • #5737 : Added support for the HTML5 contenteditable attribute, making it possible to define read only regions into the editor contents.
    • +
    • #5418 : New "Advanced" tab introduced on the Table Properties dialog. It's based on the new dialogadvtab plugin.
    • +
    • #6082 : Introduced the useComputedState setting, making it possible to control whether toolbar features, like alignment and direction, should reflect the "computed" selection states, even when the effective feature value is not applied.
    • +
    +

    + Fixed issues:

    +
      +
    • #5911 : BiDi: List items should support and retain correct base language direction
    • +
    • #5689 : Make it possible to run CKEditor inside of Firefox chrome.
    • +
    • #6042 : It wasn't possible to align a paragraph with the dir attribute to the opposite direction.
    • +
    • #6058 : Fixed a small style glitch with file upload fields in IE+Quirks.
    • +
    +

    + CKEditor 3.3.2

    +

    + New features:

    +
      +
    • #5882 : Introduce the dialog#selectPage event, replicating the OnDialogTabChange feature available in FCKeditor 2.
    • +
    • #5927 : The native controls in ui.dialog.elements can be styled with the controlStyle definition.
    • +
    +

    + Fixed issues:

    +
      +
    • #1644 : Removed references to cursor:hand in the stylesheets.
    • +
    • #5411 : Anchor, hidden fields and Page-Break objects can no longer be resized.
    • +
    • #5456 : Initial focus incorect in api_dialog sample page.
    • +
    • #5628 : Incorrect <pre> siblings merging.
    • +
    • #5829 : Adding validation for start number field in list style dialog.
    • +
    • #5845 : Context menu on empty list item loses selection.
    • +
    • #5860 : [IE] > in attribute values are incorrectly escaped.
    • +
    • #5905 : SCAYT is not any more enabled by default.
    • +
    • #5736 : Improved the text generated for mailto: links if no text was selected.
    • +
    • #4779 : Adjust resize_minWidth and resize_minHeight if smaller than actual dimensions.
    • +
    • #5687 : Navigation through colors is now compatible with RTL.
    • +
    • #4615 : [IE] Text fields are no longer disrupted in dialog with RTL.
    • +
    • #5887 : The number of columns in the smileys table is now configurable via the smiley_columns setting.
    • +
    • #5100 : It was possible to drag&drop some elements like context menu items or dropdown entries.
    • +
    • #5933 : Text color and background color panels don't have scrollbars anymore under office2003 and v2 skins.
    • +
    • #5943 : An error is no longer generated when using percent or pixel values in the image dialog.
    • +
    • #5951 : Avoid problems with security systems due to the usage of UniversalXPConnect.
    • +
    • #5441 : Avoid errors if the editor instance is removed from the DOM before calling its destroy() method.
    • +
    • #4997 : Provide better access to the native input in the ui.dialog.file element.
    • +
    • #5914 : Modified the Smileys dialog to make active only the images and not their borders.
    • +
    • #5565 : The scrollbar does not behaves erratically when opening a rich combo in RTL page.
    • +
    • #5843 : In CKEditor 3.3: When we set the focus in the 'instanceReady' event, FF3.6 is giving js error.
    • +
    • #5902 : paste and pastetext dialogs cannot be skinned easily.
    • +
    • #5959 : Dialog auto focus does not check for hidden tabs.
    • +
    • #5415 : Undo not working when we change the Table Properties for the table on a saved page.
    • +
    • #5435 : IE: we can't start Numbered/Bulleted list in Tables by Clicking on Insert/Remove Numbers/Bullets Icon.
    • +
    • #5832 : The JQuery adapter sample is not working properly with SSL.
    • +
    • #5728 : Text field & Upload Button in Upload Tab of Image Properties dialog are not shown Properly in Arabic.
    • +
    • #5436 : IE: Cursor goes to next Table Cell after we insert a Smiley in the Table Cell.
    • +
    • #5580 : Maximize does not work properly in the Office 2003 and V2 skins.
    • +
    • #5495 : The link dialog was breaking the undo system on some situations.
    • +
    • #5775 : Required field's label to contain a CSS class to allow it to be styled differently.
    • +
    • #5999 : Table dialog rows and columns fields are now marked as required.
    • +
    • #5693 : baseHref detection in the flash dialog now works correctly.
    • +
    • #5690 : Table cell's width attribute is now respected properly.
    • +
    • #5819 : Introducing the new removeFormatCleanup event and making sure remove format doesn't break the showborder plugin.
    • +
    • #5558 : After pasting on WebKit based browsers the editor now scrolls to the end of the pasted content.
    • +
    • #5799 : Correct plugin dependencies for the liststyle plugin with contextMenu and dialog.
    • +
    • #5436 : IE: The cursor was moving to the wrong position when inserting inline elements at the end of cells on tables.
    • +
    • #5984 : Firefox: CTRL+HOME was creating an unwanted empty paragraph at the start of the document.
    • +
    • #5634 : IE: It was needed to click twice in the editor to make it editable on some situations.
    • +
    • #5338 : Pasting from Open Office could lead on error.
    • +
    • #5224 : Some invalid markup could break the editor.
    • +
    • #5455 : It was not possible to remove formatting from pasted content on specific cases.
    • +
    • #5735 : IE: The editor was having focus issues when the previous selection got hidden by scroll operations.
    • +
    • #5563 : Firefox: The disableObjectResizing and disableNativeTableHandles settings stopped working.
    • +
    • #5781 : Firefox: Editing was not possible in an empty document.
    • +
    • #5293 : Firefox: Unwanted BR tags were being left in the editor output when it should be empty.
    • +
    • #5280 : IE: Scrollbars where reacting improperly when clicking in the bar space.
    • +
    • #5840 : Some dialog access keys are conflicting with "Ctrl + A", select all text behavior on text input.
    • +
    • #6059 : Changing list type didn't preserve the list's attributes.
    • +
    • #5193 : In Firefox, the element path options had the text cursor instead of the arrow.
    • +
    • #6073 : The list context menu was showing the wrong option when in a mixed list hierarchy.
    • +
    • #6074 : The Insert Table Column command was duplicating the selected column cells ids.
    • +
    • #6066 : The toolbar combos had the text cursor instead of the arrow.
    • +
    • #6062 : The toolbar buttons had the text cursor instead of the arrow.
    • +
    • #6068 : [IE7] A few labels were hidden in a RTL language.
    • +
    • #6000 : Safari and Chrome where scrolling the contents to the top when moving the focus to the editor.
    • +
    • #6090 : IE: Textarea with selection inside causes Link dialog issues.
    • +
    • #5079 : Page break in lists move to above the list when you switch from WYSIWYG to HTML mode and back.
    • +
    • Updated the following language files:
        +
      • Chinese Simplified;
      • +
      • Hebrew;
      • +
      • #5962 : German;
      • +
      • #5645 : Portuguese;
      • +
      • #5797 : Turkish;
      • +
    • +
    +

    + CKEditor 3.3.1

    +

    + Fixed issues:

    +
      +
    • #5780 : Text selection lost when opening some of the dialogs.
    • +
    • #5787 : Liststyle plugin wasn't packaged into the core (CKEDITOR.resourceManager.load exception).
    • +
    • #5637 : Fix wrong nesting that generated "<head> must be a child of <html>" warning in Webkit.
    • +
    • #5790 : Internal only attributes output on fullpage <html> tag.
    • +
    • #5761 : [IE] Color dialog matrix buttons are barely clickable in quirks mode.
    • +
    • #5759 : [IE] Clicking on the scrollbar and then on the host page causes error.
    • +
    • #5772 : List style dialog is missing tab page ids.
    • +
    • #5782 : [FF] Wysiwyg mode is broken by 'display' style changes on editor's parent DOM tree.
    • +
    • #5801 : [IE] contentEditable="false" doesn't apply in effect on inline-elements.
    • +
    • #5794 : Empty find matching twice results in JavaScript error.
    • +
    • #5732 : If it isn't possible to connect to the SCAYT servers the dialogs might hang in Firefox. Fix for Firefox>=3.6.
    • +
    • #5807 : [FF2] New page command results in uneditable document.
    • +
    • #5807 : [FF2] SCAYT plugin is disabled in Firefox2 due to selection interference.
    • +
    • #5772 : [IE] Some numbered list style types are not supported by IE6/7 and causes JavaScript error.
    • +
    +

    + CKEditor 3.3

    +

    + New features:

    +
      +
    • #635 : The properties dialog will now open when double clicking on objects.
    • +
    • #3893 : It's now possible to indent/outdent lists when selecting the first list item.
    • +
    • #4968 : The contentsLangDirection setting now has a default value 'ui' which inherit language direction from the editor UI language.
    • +
    • #4649 : The color picker dialog is now accessible.
    • +
    • #3593 : The editing area is now enabled by contentEditable="true" instead of designMode="on" to allow creating uneditable content elements in all browsers.
    • +
    • #4056 : Hidden fields will now be displayed as fake element just like in FCKeditor 2.
    • +
    +

    + CKEditor 3.2.2

    +

    + New features:

    +
      +
    • The SCAYT spell checker is now enabled by default through the autoStartup setting.
    • +
    • #5631 : The SCAYT context menu options can now be reorganized through the scayt_contextMenuItemsOrder setting.
    • +
    • #4231 : Introducing the resize_dir setting, to be able to restrict manual resizing of the editor to only one direction (horizontal/vertical).
    • +
    • #5479 : Introducing the classic ASP integration files and samples.
    • +
    • #5024 : Added samples (HTML and XHTML) to show how to output HTML using fonts and other attributes instead of styles.
    • +
    • #4358 : Introduced the List Properties dialog.
    • +
    • #5485 : Adding the contentsLanguage configuration option to be able to set the language for the editor contents.
    • +
    +

    + Fixed issues:

    +
      +
    • #5330 : Corrected detection of CTRL and META keys in Macs for the context menu.
    • +
    • #5434 : Fixed access denied issues with IE when accessing web sites through IPv6 IP addresses.
    • +
    • #4476 : [IE] Inaccessible empty list item contains sub list.
    • +
    • #4881 : [IE] Selection range broken because of cutting a single control type element from it.
    • +
    • #5505 : Image dialog throw JavaScript error when click close dialog before preview area is loading.
    • +
    • #5144 : [Chrome] Paste in Webkit sometimes leaves extra 'div' element.
    • +
    • #5021 : [Firefox] Typing in empty document start from second line when enterMode = CKEDITOR.ENTER_BR.
    • +
    • #5416 : [IE] Delete table throws a error when enterMode = CKEDITOR.ENTER_BR.
    • +
    • #4459 : [IE] Select element is penetrating the maximized editor in IE6.
    • +
    • #5559 : [IE] The first call to setData is affected by iframe cache when loading the wysiwyg mode.
    • +
    • #5567 : [IE] Remove inline styles in some case doesn't join identical siblings.
    • +
    • #5450 : [FireFox] Press ENTER on 'replace' button result wrong.
    • +
    • #5121 : Recognizes the <br /> tag as a separator when apply block styles and enterMode = CKEDITOR.ENTER_BR.
    • +
    • #5575 : CKEDITOR.replaceAll should consider all kind of white spaces between class names.
    • +
    • #5582 : Prevent the default behavior when click the 'x' button to close dialog box.
    • +
    • #5584 : ENTER key with forceEnterMode turns on doesn't inherit current block attributes.
    • +
    • #4797 : [Opera] Press ENTER key in dialog fields to close throws JavaScript error.
    • +
    • #5578 : Add flash fake element align property when switch mode (source to wysiwyg).
    • +
    • #5577 : Update delete column behavior when choose multiple cells in the same column.
    • +
    • #5512 : Open context menu with SHIFT+F10 doesn't get correct editor selection.
    • +
    • #5433 : English protocol text directions in Link dialog are not incorrect in 'rtl' UI languages.
    • +
    • #5553 : Paste dialog clipboard area text direction is incorrect for 'rtl' content languages.
    • +
    • #4734 : Font size resets when font name is changed in an empty numbered list.
    • +
    • #5237 : English text in dialogs' title is flipped when using RTL language.
    • +
    • #3257 : Create list doesn't keep blocks as headings.
    • +
    • #5111 : [Firefox] JAWS doesn't respect PC cursor mode (application role) on toolbar.
    • +
    • #5530 : Page break for printing can't be removed with undo.
    • +
    • #5381 : Unable to place cursor between two paragraphs in body.
    • +
    • #5568 : [IE6/7] Selecting a entire table cell changes the original range.
    • +
    • #5623 : [Firefox] Apply style that edges another inline style result incorrect.
    • +
    • #5586 : [Firefox] Maximize the second editor ruins full screen mode.
    • +
    • #5617 : HTML filter system does not allow two 'text' filter rules.
    • +
    • #5663 : General memory clean up after destroying last instance.
    • +
    • #5461 : [IE] Fix Paste from Word dialog doesn't accept imput problem.
    • +
    • #5676 : Make color buttons use RRGGBB instead of RGB for better compatibility with IE.
    • +
    • #4948 : [Safari] Select the first/last cell of table to open context menu may lead to undetected table.
    • +
    • #5591 : [Firefox] Select a list item makes selected element broken.
    • +
    • #5667 : Pasting in a RTL page content causes shows up the horizontal scrollbar.
    • +
    • #5688 : Duplicate ids are used in dialog definition.
    • +
    • #5719 : [IE] 'change' dialog event should not be triggered when dialog is already closed.
    • +
    • #5747 : [IE] Error thrown when IE input field editing mode is turned on.
    • +
    • #5516 : IE8: Toolbar buttons have higher bottom padding.
    • +
    • #5402 : SHIFT-ENTER could now be used to exit from preformat block.
    • +
    • SCAYT plugin related:
        +
      • #4836 : Using SCAYT result in fragile elements when applying inline styles.
      • +
      • #5425 : [Opera] Disable SCAYT plugin for Opera browser.
      • +
      • #5632 : SCAYT word marker is not visible on text with background-color set.
      • +
      • #4125 : Remove Format command incorrectly removes SCAYT word markers.
      • +
      • #5671 : SCAYT bootstrap script could be added multiple times unnecessarily.
      • +
      • #5573 : SCAYT move cursor position after insert element into marked word text.
      • +
      • #5546 : SCAYT interferes with undo/redo commands.
      • +
      • #5570 : [IE] First enabling SCAYT blind cursor in editor.
      • +
      • #5741 : Enable SCAYT cause error in multiple editor instances.
      • +
      • #5744 : Remove editor with SCAYT enabled in source mode throws error.
      • +
    • +
    • Updated the following language files:
    • +
    +

    + CKEditor 3.2.1

    +

    + New features:

    +
      +
    • #4478 : Enable the SelectAll command in source mode.
    • +
    • #5150 : Allow names in the CKEDITOR.config.colorButton_colors setting.
    • +
    • #4810 : Adding configuration option for image dialog preview area filling text.
    • +
    • #536 : Object style now could be applied on any parent element of current selection.
    • +
    • #5290 : Unified stylesSet loading removing dependencies from the styles combo. + Now the configuration entry is named 'config.stylesSet' instead of config.stylesCombo_stylesSet and the default location + is under the 'styles' plugin instead of 'stylescombo'.
    • +
    • #5352 : Allow to define the stylesSet array in the config object for the editor.
    • +
    • #5302 : Adding config option "forceEnterMode".
    • +
    • #5216 : Extend CKEDITOR.appendTo to allow a data parameter for the initial value.
    • +
    • #5024 : Added sample to show how to output XHTML and avoid deprecated tags.
    • +
    +

    + Fixed issues:

    +
      +
    • #5152 : Indentation using class attribute doesn't work properly.
    • +
    • #4682 : It wasn't possible to edit block elements in IE that had styles like width, height or float.
    • +
    • #4750 : Correcting default order of buttons layout in dialogs on Mac.
    • +
    • #4932 : Fixed collapse button not clickable on simple toolbar.
    • +
    • #5228 : Link dialog is automatically changes protocol when URLs that starts with '?'.
    • +
    • #4877 : Fixed CKEditor displays source code in one long line (IE quirks mode + office2003 skin).
    • +
    • #5132 : Apply inline style leaks into sibling words which are seperated spaces.
    • +
    • #3599 : Background color style on sized text displayed as narrow band behind.
    • +
    • #4661 : Translation missing in link dialog.
    • +
    • #5240 : Flash alignment property is not presented visually on fake element.
    • +
    • #4910 : Pasting in IE scrolls document to the end.
    • +
    • #5041 : Table summary attribute can't be removed with dialog.
    • +
    • #5124 : All inline styles cannot be applied on empty spaces.
    • +
    • #3570 : SCAYT marker shouldn't appear inside elements path bar.
    • +
    • #4553 : Dirty check result incorrect when editor document is empty.
    • +
    • #4555 : Unreleased memory when editor is created and destroyed.
    • +
    • #5118 : Arrow keys navigation in RTL languages is incorrect.
    • +
    • #4721 : Remove attribute 'value' of checkbox in IE.
    • +
    • #5278 : IE: Add validation to check for bad window names of popup window.
    • +
    • #5171 : Dialogs contains lists don't have proper voice labels.
    • +
    • #4791 : Can't place cursor inside a form that end with a checkbox/radio.
    • +
    • #4479 : StylesCombo doesn't reflect the selection state until it's first opened.
    • +
    • #4717 : 'Unlink' and 'Outdent' command buttons should be disabled on editor startup.
    • +
    • #5119 : Disabled command buttons are not being properly styled when focused.
    • +
    • #5307 : Hide dialog page cause problem when there's two tab pages remain.
    • +
    • #5343 : Active list item ARIA role is wrongly placed.
    • +
    • #3599 : Background color style applying to text with font size style has been narrowly rendered.
    • +
    • #4711 : Line break character inside preformatted text makes it unable to type text at the end of previous line.
    • +
    • #4829 : [IE] Apply style from combo has wrong result on manually created selection.
    • +
    • #4830 : Retrieving selected element isn't always right, especially selecting using keyboard (SHIFT+ARROW).
    • +
    • #5128 : Element attribute inside preformatted text is corrupted when converting to other blocks.
    • +
    • #5190 : Template list entry shouldn't gain initial focus open templates list dialog opens.
    • +
    • #5238 : Menu button doesn't display arrow icon in high-contrast mode.
    • +
    • #3576 : Non-attributed element of the same name with the applied style is incorrectly removed.
    • +
    • #5221 : Insert table into empty document cause JavaScript error thrown.
    • +
    • #5242 : Apply 'automatic' color option of text color incorrectly removes background-color style.
    • +
    • #4719 : IE does not escape attribute values properly.
    • +
    • #5170 : Firefox does not insert text into styled element properly.
    • +
    • #4026 : Office2003 skin has no toolbar button borders in High Contrast in IE7.
    • +
    • #4348 : There should have exception thrown when 'CKEDITOR_BASEPATH' couldn't be figured out automatically.
    • +
    • #5364 : Focus may not be put into dialog correctly when dialog skin file is loading slow.
    • +
    • #4016 : Justify the layout of forms select dialog in Chrome and IE7.
    • +
    • #5373 : Variable 'pathBlockElements' defines wrong items in CKEDITOR.dom.elementPath.
    • +
    • #5082 : Ctrl key should be described as Cmd key on Mac.
    • +
    • #5182 : Context menu is not been announced correctly by ATs.
    • +
    • #4898 : Can't navigate outside table under the last paragraph of document.
    • +
    • #4950 : List commands could compromise list item attribute and styles.
    • +
    • #5018 : Find result highlighting remove normal font color styles unintentionally.
    • +
    • #5376 : Unable to exit list from within a empty block under list item.
    • +
    • #5145 : Various SCAYT fixes.
    • +
    • #5319 : Match whole word doesn't work anymore after replacement has happened.
    • +
    • #5363 : 'title' attribute now presents on all editor iframes.
    • +
    • #5374 : Unable to toggle inline style when the selection starts at the linefeed of the previous paragraph.
    • +
    • #4513 : Selected link element is not always correctly detected when using keyboard arrows to perform such selection.
    • +
    • #5372 : Newly created sub list should inherit nothing from the original (parent) list, except the list type.
    • +
    • #5274 : [IE6] Templates preview image is displayed in wrong size.
    • +
    • #5292 : Preview in font size and family doesn't work with custom styles.
    • +
    • #5396 : Selection is lost when use cell properties dialog to change cell type to header.
    • +
    • #4082 : [IE+Quirks] Preview text in the image dialog is not wrapping.
    • +
    • #4197 : Fixing format combo don't hide when editor blur on Safari.
    • +
    • #5401 : The context menu break layout with Office2003 and V2 skin on IE quirks mode.
    • +
    • #4825 : Fixing browser context menu is opened when clicking right mouse button twice.
    • +
    • #5356 : The SCAYT dialog had issues with Prototype enabled pages.
    • +
    • #5266 : SCAYT was disturbing the rendering of TH elements.
    • +
    • #4688 : SCAYT was interfering on checkDirty.
    • +
    • #5429 : High Contrast mode was being mistakenly detected when loading the editor through Dojo's xhrGet.
    • +
    • #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.
    • +
    • #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.
    • +
    • #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:
    • +
    +

    + CKEditor 3.2

    +

    + New features:

    +
      +
    • Several accessibility enhancements:
        +
      • #4502 : The editor accessibility is now totally based on WAI-ARIA.
      • +
      • #5015 : Adding accessibility help dialog plugin.
      • +
      • #5014 : Keyboard navigation compliance with screen reader suggested keys.
      • +
      • #4595 : Better accessibility in the Templates dialog.
      • +
      • #3389 : Esc/Arrow Key now works for closing sub menu.
      • +
    • +
    • #4973 : The Style field in the Div Container dialog is now loading the styles defined in the default styleset used by the Styles toolbar combo.
    • +
    +

    + Fixed issues:

    +
      +
    • #5049 : Form Field list command in JAWS incorrectly lists extra fields.
    • +
    • #5008 : Lock/Unlock ratio buttons in the Image dialog was poorly designed in High Contrast mode.
    • +
    • #3980 : All labels in dialogs now use <label> instead of <div>.
    • +
    • #5213 : Reorganization of some entries in the language files to make it more consistent.
    • +
    • #5199 : In IE, single row toolbars didn't have the bottom padding.
    • +
    +

    + CKEditor 3.1.1

    +

    + New features:

    +
      +
    • #4399 : Improved support for external file browsers by allowing executing a callback function.
    • +
    • #4612 : The text of links is now updated if it matches the URL to which it points to.
    • +
    • #4936 : New localization support for the Welsh language.
    • +
    +

    + Fixed issues:

    +
      +
    • #4272 : Kama skin toolbar was broken in IE+Quirks+RTL.
    • +
    • #4987 : Changed the url which is called by the Browser Server button in the Link tab of Image Properties dialog.
    • +
    • #5030 : The CKEDITOR.timestamp wasn't been appended to the skin.js file.
    • +
    • #4993 : Removed the float style from images when the user selects 'not set' for alignment.
    • +
    • #4944 : Fixed a bug where nested list structures with inconsequent levels were not being pasted correctly from MS Word.
    • +
    • #4637 : Table cells' 'nowrap' attribute was not being loaded by the cell property dialog. Thanks to pomu0325.
    • +
    • #4724 : Using the mouse to insert a link in IE might create incorrect results.
    • +
    • #4640 : Small optimizations for the fileBrowser plugin.
    • +
    • #4583 : The "Target Frame Name" field is now visible when target is set to 'frame' only.
    • +
    • #4863 : Fixing iframedialog's height doesn't stretch to 100% (except IE Quirks).
    • +
    • #4964 : The BACKSPACE key positioning was not correct in some cases with Firefox.
    • +
    • #4980 : Setting border, vspace and hspace of images to zero was not working.
    • +
    • #4773 : The fileBrowser plugin was overwriting onClick functions eventually defined on fileButton elements.
    • +
    • #4731 : The clipboard plugin was missing a reference to the dialog plugin.
    • +
    • #5051 : The about plugin was missing a reference to the dialog plugin.
    • +
    • #5146 : The wsc plugin was missing a reference to the dialog plugin.
    • +
    • #4632 : The print command will now properly break on the insertion point of page break for printing.
    • +
    • #4862 : The English (United Kingdom) language file has been renamed to en-gb.js.
    • +
    • #4618 : Selecting an emoticon or the lock and reset buttons in the image dialog fired the onBeforeUnload event in IE.
    • +
    • #4678 : It was not possible to set tables' width to empty value.
    • +
    • #5012 : Fixed dependency issues with the menu plugin.
    • +
    • #5040 : The editor will not properly ignore font related settings that have extra item separators (semi-colons).
    • +
    • #4046 : Justify should respect config.enterMode = CKEDITOR.ENTER_BR.
    • +
    • #4622 : Inserting tables multiple times was corrupting the undo system.
    • +
    • #4647 : [IE] Selection on an element within positioned container is lost after open context-menu then click one menu item.
    • +
    • #4683 : Double-quote character in attribute values was not escaped in the editor output.
    • +
    • #4762 : [IE] Unexpected vertical-scrolling behavior happens whenever focus is moving out of editor in source mode.
    • +
    • #4772 : Text color was not being applied properly on links.
    • +
    • #4795 : [IE] Press 'Del' key on horizontal line or table result in error.
    • +
    • #4824 : [IE] <br/> at the very first table cell breaks the editor selection.
    • +
    • #4851 : [IE] Delete table rows with context-menu may cause error.
    • +
    • #4951 : Replacing text with empty string was throwing errors.
    • +
    • #4963 : Link dialog was not opening properly for e-mail type links.
    • +
    • #5043 : Removed the possibility of having an unwanted script tag being outputted with the editor contents.
    • +
    • #3678 : There were issues when editing links inside floating divs with IE.
    • +
    • #4763 : Pressing ENTER key with text selected was not deleting the text in some situations.
    • +
    • #5096 : Simple ampersand attribute value doesn't work for more than one occurrence.
    • +
    • #3494 : Context menu is too narrow in some translations.
    • +
    • #5005 : Fixed HTML errors in PHP samples.
    • +
    • #5123 : Fixed broken XHTML in User Interface Languages sample.
    • +
    • #4893 : Editor now understands table cell inline styles.
    • +
    • #4611 : Selection around <select> in editor doesn't cause error anymore.
    • +
    • #4886 : Extra BR tags were being created in the output HTML.
    • +
    • #4933 : Empty tags with BR were being left in the DOM.
    • +
    • #5127 : There were errors when removing dialog definition pages through code.
    • +
    • #4767 : CKEditor was not working when ckeditor_source.js is loaded in the <body> .
    • +
    • #5062 : Avoided security warning message when loading the wysiwyg area in IE6 under HTTPS.
    • +
    • #5135 : The TAB key will now behave properly when in Source mode.
    • +
    • #4988 : It wasn't possible to use forcePasteAsPlainText with Safari on Mac.
    • +
    • #5095 : Safari on Mac deleted the current selection in the editor when Edit menu was clicked.
    • +
    • #5140 : In High Contrast mode, arrows were now been displayed for menus with submenus.
    • +
    • #5163 : The undo system was not working on some specific cases.
    • +
    • #5162 : The ajax sample was throwing errors when loading data.
    • +
    • #4999 : The Template dialog was not generating an undo snapshot.
    • +
    • Updated the following language files:
    • +
    +

    + CKEditor 3.1

    +

    + New features:

    +
      +
    • #4067 : Introduced the full page editing support (from <html> to </html>).
    • +
    • #4228 : Introduced the Shared Spaces feature.
    • +
    • #4379 : Introduced the new powerful pasting system and word cleanup procedure, including enhancements to the paste as plain text feature.
    • +
    • #2872 : Introduced the new native PHP API, the first standardized server side support.
    • +
    • #4210 : Added CKEditor plugin for jQuery.
    • +
    • #2885 : Added 'div' dialog and corresponding context menu options.
    • +
    • #4574 : Added the table merging tools and corresponding context menu options.
    • +
    • #4340 : Added the email protection option for link dialog.
    • +
    • #4463 : Added inline CSS support in all places where custom stylesheet could apply.
    • +
    • #3881 : Added color dialog for 'more color' option in color buttons.
    • +
    • #4341 : Added the 'showborder' plugin.
    • +
    • #4549 : Make the anti-cache query string configurable.
    • +
    • #4708 : Added the 'htmlEncodeOutput' config option.
    • +
    • #4342 : Introduced the bodyId and bodyClass settings to specify the id and class. to be used in the editing area at runtime.
    • +
    • #3401 : Introduced the baseHref setting so it's possible to set the URL to be used to resolve absolute and relative URLs in the contents.
    • +
    • #4729 : Added support to fake elements for comments.
    • +
    +

    + Fixed issues:

    +
      +
    • #4707 : Fixed invalid link is requested in image preview.
    • +
    • #4461 : Fixed toolbar separator line along side combo enlarging the toolbar height.
    • +
    • #4596 : Fixed image re-size lock buttons aren't accessible in high-contrast mode.
    • +
    • #4676 : Fixed editing tables using table properties dialog overwrites original style values.
    • +
    • #4714 : Fixed IE6 JavaScript error when editing flash by commit 'Flash' dialog.
    • +
    • #3905 : Fixed 'wysiwyg' mode causes unauthenticated content warnings over SSL in FF 3.5.
    • +
    • #4768 : Fixed open context menu in IE throws js error when focus is not inside document.
    • +
    • #4822 : Fixed applying 'Headers' to existing table does not work in IE.
    • +
    • #4855 : Fixed toolbar doesn't wrap well for 'v2' skin in all browsers.
    • +
    • #4882 : Fixed auto detect paste from MS-Word is not working for Safari.
    • +
    • #4882 : Fixed unexpected margin style left behind on content cleaning up from MS-Word.
    • +
    • #4896 : Fixed paste nested list from MS-Word with measurement units set to cm is broken.
    • +
    • #4899 : Fixed unable to undo pre-formatted style.
    • +
    • #4900 : Fixed ratio-lock inconsistent between browsers.
    • +
    • #4901 : Fixed unable to edit any link with popup window's features in Firefox.
    • +
    • #4904 : Fixed when paste happen from dialog, it always throw JavaScript error.
    • +
    • #4905 : Fixed paste plain text result incorrect when content from dialog.
    • +
    • #4889 : Fixed unable to undo 'New Page' command after typing inside editor.
    • +
    • #4892 : Fixed table alignment style is not properly represented by the wrapping div.
    • +
    • #4918 : Fixed switching mode when maximized is showing background page contents.
    • +
    +

    + CKEditor 3.0.2

    +

    + New features:

    +
      +
    • #4343 : Added the configuration option 'browserContextMenuOnCtrl' so it's possible to enable the default browser context menu by holding the CTRL key.
    • +
    +

    + Fixed issues:

    +
      +
    • #4552 : Fixed float panel doesn't show up since editor instanced been destroyed once.
    • +
    • #3918 : Fixed fake object is editable with Image dialog.
    • +
    • #4053 : Fixed 'Form Properties' missing from context menu when selection collapsed inside form.
    • +
    • #4401 : Fixed customized by removing 'upload' tab page from 'Link dialog' cause JavaScript error.
    • +
    • #4477 : Adding missing tag names in object style elements.
    • +
    • #4567 : Fixed IE throw error when pressing BACKSPACE in source mode.
    • +
    • #4573 : Fixed 'IgnoreEmptyPargraph' config doesn't work with the config 'entities' is set to 'false'.
    • +
    • #4614 : Fixed attribute protection fails because of line-break.
    • +
    • #4546 : Fixed UIColor plugin doesn't work when editor id contains CSS selector preserved keywords.
    • +
    • #4609 : Fixed flash object is lost when loading data from outside editor.
    • +
    • #4625 : Fixed editor stays visible in a div with style 'visibility:hidden'.
    • +
    • #4621 : Fixed clicking below table caused an empty table been generated.
    • +
    • #3373 : Fixed empty context menu when there's no menu item at all.
    • +
    • #4473 : Fixed setting rules on the same element tag name throws error.
    • +
    • #4514 : Fixed press 'Back' button breaks wysiwyg editing mode is Firefox.
    • +
    • #4542 : Fixed unable to access buttons using tab key in Safari and Opera.
    • +
    • #4577 : Fixed relative link url is broken after opening 'Link' dialog.
    • +
    • #4597 : Fixed custom style with same attribute name but different attribute value doesn't work.
    • +
    • #4651 : Fixed 'Deleted' and 'Inserted' text style is not rendering in wysiwyg mode and is wrong is source mode.
    • +
    • #4654 : Fixed 'CKEDITOR.config.font_defaultLabel(fontSize_defaultLabel)' is not working.
    • +
    • #3950 : Fixed table column insertion incorrect when selecting empty cell area.
    • +
    • #3912 : Fixed UIColor not working in IE when page has more than 30+ editors.
    • +
    • #4031 : Fixed mouse cursor on toolbar combo has more than 3 shapes.
    • +
    • #4041 : Fixed open context menu on multiple cells to remove them result in only one removed.
    • +
    • #4185 : Fixed resize handler effect doesn't affect flash object on output.
    • +
    • #4196 : Fixed 'Remove Numbered/Bulleted List' on nested list doesn't work well on nested list.
    • +
    • #4200 : Fixed unable to insert 'password' type filed with attributes.
    • +
    • #4530 : Fixed context menu couldn't open in Opera.
    • +
    • #4536 : Fixed keyboard navigation doesn't work at all in IE quirks mode.
    • +
    • #4584 : Fixed updated link Target field is not updating when updating to certain values.
    • +
    • #4603 : Fixed unable to disable submenu items in contextmenu.
    • +
    • #4672 : Fixed unable to redo the insertion of horizontal line.
    • +
    • #4677 : Fixed 'Tab' key is trapped by hidden dialog elements.
    • +
    • #4073 : Fixed insert template with replace option could result in empty document.
    • +
    • #4455 : Fixed unable to start editing when image inside document not loaded.
    • +
    • #4517 : Fixed 'dialog_backgroundCoverColor' doesn't work on IE6.
    • +
    • #3165 : Fixed enter key in empty list item before nested one result in collapsed line.
    • +
    • #4527 : Fixed checkbox generate invalid 'checked' attribute.
    • +
    • #1659 : Fixed unable to click below content to start editing in IE with 'config.docType' setting to standard compliant.
    • +
    • #3933 : Fixed extra <br> left at the end of document when the last element is a table.
    • +
    • #4736 : Fixed PAGE UP and PAGE DOWN keys in standards mode are not working.
    • +
    • #4725 : Fixed hitting 'enter' before html comment node produces a JavaScript error.
    • +
    • #4522 : Fixed unable to redo when typing after insert an image with relative url.
    • +
    • #4594 : Fixed context menu goes off-screen when mouse is at right had side of screen.
    • +
    • #4673 : Fixed undo not available straight away if shift key is used to enter first character.
    • +
    • #4690 : Fixed the parsing of nested inline elements.
    • +
    • #4450 : Fixed selecting multiple table cells before apply justify commands generates spurious paragraph in Firefox.
    • +
    • #4733 : Fixed dialog opening sometimes hang up Firefox and Safari.
    • +
    • #4498 : Fixed toolbar collapse button missing tooltip.
    • +
    • #4738 : Fixed inserting table inside bold/italic/underline generates error on ENTER_BR mode.
    • +
    • #4246 : Fixed avoid XHTML deprecated attributes for image styling.
    • +
    • #4543 : Fixed unable to move cursor between table and hr.
    • +
    • #4764 : Fixed wrong exception message when CKEDITOR.editor.append() to non-existing elements.
    • +
    • #4521 : Fixed dialog layout in IE6/7 may have scroll-bar and other weird effects.
    • +
    • #4709 : Fixed inconsistent scroll-bar behavior on IE.
    • +
    • #4776 : Fixed preview page failed to open when relative URl contains in document.
    • +
    • #4812 : Fixed 'Esc' key not working on dialogs in Opera.
    • +
    • Updated the following language files:
    • +
    +

    + CKEditor 3.0.1

    +

    + New features:

    +
      +
    • #4219 : Added fallback mechanism for config.language.
    • +
    • #4194 : Added support for using multiple css style sheets within the editor.
    • +
    +

    + Fixed issues:

    +
      +
    • #3898 : Added validation for URL value in Image dialog.
    • +
    • #3528 : Fixed Context Menu issue when triggered using Shift+F10.
    • +
    • #4028 : Maximize control's tool tip was wrong once it is maximized.
    • +
    • #4237 : Toolbar is chopped off in Safari browser 3.x.
    • +
    • #4241 : Float panels are left on screen while editor is destroyed.
    • +
    • #4274 : Double click event is incorrect handled in 'divreplace' sample.
    • +
    • #4354 : Fixed TAB key on toolbar to not focus disabled buttons.
    • +
    • #3856 : Fixed focus and blur events in source view mode.
    • +
    • #3438 : Floating panels are off by (-1px, 0px) in RTL mode.
    • +
    • #3370 : Refactored use of CKEDITOR.env.isCustomDomain().
    • +
    • #4230 : HC detection caused js error.
    • +
    • #3978 : Fixed setStyle float on IE7 strict.
    • +
    • #4262 : Tab and Shift+Tab was not working to cycle through CTRL+SHIFT+F10 context menu in IE.
    • +
    • #3633 : Default context menu isn't disabled in toolbar, status bar, panels...
    • +
    • #3897 : Now there is no image previews when the URL is empty in image dialog.
    • +
    • #4048 : Context submenu was lacking uiColor.
    • +
    • #3568 : Dialogs now select all text when tabbing to text inputs.
    • +
    • #3727 : Cell Properties dialog was missing color selection option.
    • +
    • #3517 : Fixed "Match cyclic" field in Find & Replace dialog.
    • +
    • #4368 : borderColor table cell attribute haven't worked for none-IE
    • +
    • #4203 : In IE quirks mode + toolbar collapsed + source mode editing block height was incorrect.
    • +
    • #4387 : Fixed: right clicking in Kama skin can lead to a javascript error.
    • +
    • #4397 : Wysiwyg mode caused the host page scroll.
    • +
    • #4385 : Fixed editor's auto adjusting on DOM structure were confusing the dirty checking mechanism.
    • +
    • #4397 : Fixed regression of [3816] where turn on design mode was causing Firefox3 to scroll the host page.
    • +
    • #4254 : Added basic API sample.
    • +
    • #4107 : Normalize css font-family style text for correct comparision.
    • +
    • #3664 : Insert block element in empty editor document should not create new paragraph.
    • +
    • #4037 : 'id' attribute is missing with Flash dialog advanced page.
    • +
    • #4047 : Delete selected control type element when 'Backspace' is pressed on it.
    • +
    • #4191 : Fixed: dialog changes confirmation on image dialog appeared even when no changes have been made.
    • +
    • #4351 : Dash and dot could appear in attribute names.
    • +
    • #4355 : 'maximize' and 'showblock' commands shouldn't take editor focus.
    • +
    • #4504 : Fixed 'Enter'/'Esc' key is not working on dialog button.
    • +
    • #4245 : 'Strange Template' now come with a style attribute for width.
    • +
    • #4512 : Fixed styles plugin incorrectly adding semicolons to style text.
    • +
    • #3855 : Fixed loading unminified _source files when ckeditor_source.js is used.
    • +
    • #3717 : Dialog settings defaults can now be overridden in-page through the CKEDITOR.config object.
    • +
    • #4481 : The 'stylesCombo_stylesSet' configuration entry didn't work for full URLs.
    • +
    • #4480 : Fixed scope attribute in th.
    • +
    • #4467 : Fixed bug to use custom icon in context menus. Thanks to george.
    • +
    • #4190 : Fixed select field dialog layout in Safari.
    • +
    • #4518 : Fixed unable to open dialog without editor focus in IE.
    • +
    • #4519 : Fixed maximize without editor focus throw error in IE.
    • +
    • Updated the following language files:
    • +
    +

    + CKEditor 3.0

    +

    + New features:

    +
      +
    • #3188 : Introduce + <pre> formatting feature when converting from other blocks.
    • +
    • #4445 : editor::setData now support an optional callback parameter.
    • +
    +

    + Fixed issues:

    +
      +
    • #2856 : Fixed problem with inches in Paste From Word plugin.
    • +
    • #3929 : Using Paste dialog, + the text is pasted into current selection
    • +
    • #3920 : Mouse cursor over characters in + Special Character dialog now is correct
    • +
    • #3882 : Fixed an issue + with PasteFromWord dialog in which default values was ignored
    • +
    • #3859 : Fixed Flash dialog layout in Webkit
    • +
    • #3852 : Disabled textarea resizing in dialogs
    • +
    • #3831 : The attempt to remove the contextmenu plugin + will not anymore break the editor
    • +
    • #3781 : Colorbutton is now disabled in 'source' mode
    • +
    • #3848 : Fixed an issue with Webkit in witch + elements in the Image and Link dialogs had wrong dimensions.
    • +
    • #3808 : Fixed UI Color Picker dialog size in example page.
    • +
    • #3658 : Editor had horizontal scrollbar in IE6.
    • +
    • #3819 : The cursor was not visible + when applying style to collapsed selections in Firefox 2.
    • +
    • #3809 : Fixed beam cursor + when mouse cursor is over text-only buttons in IE.
    • +
    • #3815 : Fixed an issue + with the form dialog in which the "enctype" attribute is outputted as "encoding".
    • +
    • #3785 : Fixed an issue + in CKEDITOR.tools.htmlEncode() which incorrectly outputs &nbsp; in IE8.
    • +
    • #3820 : Fixed an issue in + bullet list command in which a list created at the bottom of another gets merged to the top. +
    • +
    • #3830 : Table cell properties dialog + doesn't apply to all selected cells.
    • +
    • #3835 : Element path is not refreshed + after click on 'newpage'; and safari is not putting focus on document also. +
    • +
    • #3821 : Fixed an issue with JAWS in which + toolbar items are read inconsistently between virtual cursor modes.
    • +
    • #3789 : The "src" attribute + was getting duplicated in some situations.
    • +
    • #3591 : Protecting flash related elements + including '<object>', '<embed>' and '<param>'. +
    • +
    • #3759 : Fixed CKEDITOR.dom.element::scrollIntoView + logic bug which scroll even element is inside viewport. +
    • +
    • #3773 : Fixed remove list will merge lines. +
    • +
    • #3829 : Fixed remove empty link on output data.
    • +
    • #3730 : Indent is performing on the whole + block instead of selected lines in enterMode = BR.
    • +
    • #3844 : Fixed UndoManager register keydown on obsoleted document
    • +
    • #3805 : Enabled SCAYT plugin for IE.
    • +
    • #3834 : Context menu on table caption was incorrect.
    • +
    • #3812 : Fixed an issue in which the editor + may show up empty or uneditable in IE7, 8 and Firefox 3.
    • +
    • #3825 : Fixed JS error when opening spellingcheck.
    • +
    • #3862 : Fixed html parser infinite loop on certain malformed + source code.
    • +
    • #3639 : Button size was inconsistent.
    • +
    • #3874 : Paste as plain text in Safari loosing lines.
    • +
    • #3849 : Fixed IE8 crashes when applying lists and indenting.
    • +
    • #3876 : Changed dialog checkbox and radio labels to explicit labels.
    • +
    • #3843 : Fixed context submenu position in IE 6 & 7 RTL.
    • +
    • #3864 : [FF]Document is not editable after inserting element on a fresh page.
    • +
    • #3883 : Fixed removing inline style logic incorrect on Firefox2.
    • +
    • #3884 : Empty "href" attribute was duplicated on output data.
    • +
    • #3858 : Fixed the issue where toolbars + break up in IE6 and IE7 after the browser is resized.
    • +
    • #3868 : [chrome] SCAYT toolbar options was in reversed order.
    • +
    • #3875 : Fixed an issue in Safari where + table row/column/cell menus are not useable when table cells are selected.
    • +
    • #3896 : The editing area was + flashing when switching forth and back to source view.
    • +
    • #3894 : Fixed an issue where editor failed to initialize when using the on-demand loading way.
    • +
    • #3903 : Color button plugin doesn't read config entry from editor instance correctly.
    • +
    • #3801 : Comments at the start of the document was lost in IE.
    • +
    • #3871 : Unable to redo when undos to the front of snapshots stack.
    • +
    • #3909 : Move focus from editor into a text input control is broken.
    • +
    • #3870 : The empty paragraph + desappears when hitting ENTER after "New Page".
    • +
    • #3887 : Fixed an issue in which the create + list command may leak outside of a selected table cell and into the rest of document.
    • +
    • #3916 : Fixed maximize does not enlarge editor width when width is set.
    • +
    • #3879 : [webkit] Color button panel had incorrect size on first open.
    • +
    • #3839 : Update Scayt plugin to reflect the latest change from SpellChecker.net.
    • +
    • #3742 : Fixed wrong dialog layout for dialogs without tab bar in IE RTL mode .
    • +
    • #3671 : Fixed body fixing should be applied to the real type under fake elements.
    • +
    • #3836 : Fixed remove list in enterMode=BR will merge sibling text to one line.
    • +
    • #3949 : Fixed enterKey within pre-formatted text introduce wrong line-break.
    • +
    • #3878 : Whenever possible, + dialogs will not present scrollbars if the content is too big for its standard + size.
    • +
    • #3782 : Remove empty list in table cell result in collapsed cell.
    • +
    • Updated the following language files:
    • +
    • #3984 : [IE]The pre-formatted style is generating error.
    • +
    • #3946 : Fixed unable to hide contextmenu.
    • +
    • #3956 : Fixed About dialog in Source Mode for IE.
    • +
    • #3953 : Fixed keystroke for close Paste dialog.
    • +
    • #3951 : Reset size and lock ratio options were not accessible in Image dialog.
    • +
    • #3921 : Fixed Container scroll issue on IE7.
    • +
    • #3940 : Fixed list operation doesn't stop at table.
    • +
    • #3891 : [IE] Fixed 'automatic' font color doesn't work.
    • +
    • #3972 : Fixed unable to remove a single empty list in document in Firefox with enterMode=BR.
    • +
    • #3973 : Fixed list creation error at the end of document.
    • +
    • #3959 : Pasting styled text from word result in content lost.
    • +
    • #3793 : Combined images into sprites.
    • +
    • #3783 : Fixed indenting command in table cells create collapsed paragraph.
    • +
    • #3968 : About dialog layout was broken with IE+Standards+RTL.
    • +
    • #3991 : In IE quirks, text was not visible in v2 and office2003 skins.
    • +
    • #3983 : In IE, we'll now + silently ignore wrong toolbar definition settings which have extra commas being + left around.
    • +
    • Fixed the following test cases:
        +
      • #3992 : core/ckeditor2.html
      • +
      • #4138 : core/plugins.html
      • +
      • #3801 : plugins/htmldataprocessor/htmldataprocessor.html
      • +
    • +
    • #3989 : Host page horizontal scrolling a lot when on having righ-to-left direction.
    • +
    • #4001 : Create link around existing image result incorrect.
    • +
    • #3988 : Destroy editor on form submit event cause error.
    • +
    • #3994 : Insert horizontal line at end of document cause error.
    • +
    • #4074 : Indent error with 'indentClasses' config specified.
    • +
    • #4057 : Fixed anchor is lost after switch between editing modes.
    • +
    • #3644 : Image dialog was missin radio lock.
    • +
    • #4014 : Firefox2 had no dialog button backgrounds.
    • +
    • #4018 : Firefox2 had no richcombo text visible.
    • +
    • #4035 : [IE6] Paste dialog size was too small.
    • +
    • #4049 : Kama skin was too wide with config.width.
    • +
    • The following released files now doesn't require the _source folder
        +
      • #4086 : _samples/ui_languages.html
      • +
      • #4093 : _tests/core/dom/document.html
      • +
      • #4094 : Smiley plugin file
      • +
      • #4097 : No undo/redo support for fontColor and backgroundColor buttons.
      • +
    • +
    • #4085 : Paste and Paste from Word dialogs were not well styled in IE+RTL.
    • +
    • #3982 : Fixed enterKey on empty list item result in weird dom structure.
    • +
    • #4101 : Now it is possible to close dialog before gets focus.
    • +
    • #4075 : [IE6/7]Fixed apply custom inline style with "class" attribute failed.
    • +
    • #4087 : [Firefox]Fixed extra blocks created on create list when full document selected.
    • +
    • #4097 : No undo/redo support for fontColor and backgroundColor buttons.
    • +
    • #4111 : Fixed apply block style after inline style applied on full document error.
    • +
    • #3622 : Fixed shift enter with selection not deleting highlighted text.
    • +
    • #4092 : [IE6] Close button was missing for dialog without multiple tabs.
    • +
    • #4003 : Markup on the image dialog was disrupted when removing the border input.
    • +
    • #4096 : Editor content area was pushed down in IE RTL quirks.
    • +
    • #4112 : [FF] Paste dialog had scrollbars in quirks.
    • +
    • #4118 : Dialog dragging was + occasionally behaving strangely .
    • +
    • #4077 : The toolbar combos + were rendering incorrectly in some languages, like Chinese.
    • +
    • #3622 : The toolbar in the v2 + skin was wrapping improperly in some languages.
    • +
    • #4119 : Unable to edit image link with image dialog.
    • +
    • #4117 : Fixed dialog error when transforming image into button.
    • +
    • #4058 : [FF] wysiwyg mode is sometimes not been activated.
    • +
    • #4114 : [IE] RTE + IE6/IE7 Quirks = dialog mispositoned.
    • +
    • #4123 : Some dialog buttons were broken in IE7 quirks.
    • +
    • #4122 : [IE] The image dialog + was being rendered improperly when loading an image with long URL.
    • +
    • #4144 : Fixed the white-spaces at the end of <pre> is incorrectly removed.
    • +
    • #4143 : Fixed element id is lost when extracting contents from the range.
    • +
    • #4007 : [IE] Source area overflow from editor chrome.
    • +
    • #4145 : Fixed the on demand + ("basic") loading model of the editor.
    • +
    • #4139 : Fixed list plugin regression of [3903].
    • +
    • #4147 : Unify style text normalization logic when comparing styles.
    • +
    • #4150 : Fixed enlarge list result incorrect at the inner boundary of block.
    • +
    • #4164 : Now it is possible to paste text + in Source mode even if forcePasteAsPlainText = true.
    • +
    • #4129 : [FF]Unable to remove list with Ctrl-A.
    • +
    • #4172 : [Safari] The trailing + <br> was not been always added to blank lines ending with &nbsp;.
    • +
    • #4178 : It's now possible to + copy and paste Flash content among different editor instances.
    • +
    • #4193 : Automatic font color produced empty span on Firefox 3.5.
    • +
    • #4186 : [FF] Fixed First open float panel cause host page scrollbar blinking.
    • +
    • #4227 : Fixed destroy editor instance created on textarea which is not within form cause error.
    • +
    • #4240 : Fixed editor name containing hyphen break editor completely.
    • +
    • #3828 : Malformed nested list is now corrected by the parser.
    • +
    +

    + CKEditor 3.0 RC

    +

    + Changelog starts at this release.

    + + + diff --git a/library/custom_template/ckeditor/INSTALL.html b/library/custom_template/ckeditor/INSTALL.html new file mode 100644 index 000000000..565ed261d --- /dev/null +++ b/library/custom_template/ckeditor/INSTALL.html @@ -0,0 +1,92 @@ + + + + + Installation Guide - CKEditor + + + + +

    + CKEditor Installation Guide

    +

    + What's CKEditor?

    +

    + CKEditor is a text editor to be used inside web pages. It's not a replacement + for desktop text editors like Word or OpenOffice, but a component to be used as + part of web applications and web sites.

    +

    + Installation

    +

    + Installing CKEditor is an easy task. Just follow these simple steps:

    +
      +
    1. Download the latest version of the editor from our web site: http://ckeditor.com. You should have already completed + this step, but be sure you have the very latest version.
    2. +
    3. Extract (decompress) the downloaded file into the root of your + web site.
    4. +
    +

    + Note: CKEditor is by default installed in the "ckeditor" + folder. You can place the files in whichever you want though.

    +

    + Checking Your Installation +

    +

    + The editor comes with a few sample pages that can be used to verify that installation + proceeded properly. Take a look at the _samples directory.

    +

    + To test your installation, just call the following page at your web site:

    +
    +http://<your site>/<CKEditor installation path>/_samples/index.html
    +
    +For example:
    +http://www.example.com/ckeditor/_samples/index.html
    +

    + Documentation

    +

    + The full editor documentation is available online at the following address:
    + http://docs.cksource.com/ckeditor

    + + + diff --git a/library/custom_template/ckeditor/LICENSE.html b/library/custom_template/ckeditor/LICENSE.html new file mode 100644 index 000000000..0529c9f4b --- /dev/null +++ b/library/custom_template/ckeditor/LICENSE.html @@ -0,0 +1,1334 @@ + + + + + License - CKEditor + + +

    + Software License Agreement +

    +

    + CKEditor™ - The text editor for Internet™ - + http://ckeditor.com
    + Copyright © 2003-2011, CKSource - Frederico Knabben. All rights reserved. +

    +

    + Licensed under the terms of any of the following licenses at your choice: +

    + +

    + You are not required to, but if you want to explicitly declare the license you have + chosen to be bound to when using, reproducing, modifying and distributing this software, + just include a text file titled "LEGAL" in your version of this software, indicating + your license choice. In any case, your choice will not restrict any recipient of + your version of this software to use, reproduce, modify and distribute this software + under any of the above licenses. +

    +

    + Sources of Intellectual Property Included in CKEditor +

    +

    + Where not otherwise indicated, all CKEditor content is authored by CKSource engineers + and consists of CKSource-owned intellectual property. In some specific instances, + CKEditor will incorporate work done by developers outside of CKSource with their + express permission. +

    +

    + YUI Test: At _source/tests/yuitest.js + can be found part of the source code of YUI, which is licensed under the terms of + the BSD License. YUI is + Copyright © 2008, Yahoo! Inc. +

    +

    + Trademarks +

    +

    + CKEditor is a trademark of CKSource - Frederico Knabben. All other brand and product + names are trademarks, registered trademarks or service marks of their respective + holders. +

    + + diff --git a/library/custom_template/ckeditor/_samples/adobeair/application.xml b/library/custom_template/ckeditor/_samples/adobeair/application.xml new file mode 100644 index 000000000..e202a089e --- /dev/null +++ b/library/custom_template/ckeditor/_samples/adobeair/application.xml @@ -0,0 +1,32 @@ + + + + com.ckeditor.air.sample + CKEditor - Adobe AIR Sample Application + 1.0 + CKEditor AIR Samples + This is a sample AIR application of CKEditor. + Copyright (c) 2003-2011, CKSource - Frederico Knabben. All rights reserved. + + _samples/adobeair/sample.html + CKEditor - Adobe AIR Sample + standard + false + true + true + true + true + 100 + 80 + 950 + 700 + 900 600 + + CKEditor/Sample AIR Application + CKEditor/Sample AIR Application + false + false + diff --git a/library/custom_template/ckeditor/_samples/adobeair/run.bat b/library/custom_template/ckeditor/_samples/adobeair/run.bat new file mode 100644 index 000000000..411987bf5 --- /dev/null +++ b/library/custom_template/ckeditor/_samples/adobeair/run.bat @@ -0,0 +1,9 @@ +@ECHO OFF +:: +:: Copyright (c) 2003-2011, CKSource - Frederico Knabben. All rights reserved. +:: For licensing, see LICENSE.html or http://ckeditor.com/license +:: +:: Use this file to quickly run the sample in a Windows environment. +:: + +adl application.xml ../../ diff --git a/library/custom_template/ckeditor/_samples/adobeair/sample.html b/library/custom_template/ckeditor/_samples/adobeair/sample.html new file mode 100644 index 000000000..eb362874e --- /dev/null +++ b/library/custom_template/ckeditor/_samples/adobeair/sample.html @@ -0,0 +1,45 @@ + + + + + Replace Textarea by Code - CKEditor Sample + + + + + +

    + CKEditor - Adobe AIR Sample +

    +

    + This is a sample HTML/JavaScript Adobe AIR application with CKEditor with default features. +

    +

    + + +

    + + + diff --git a/library/custom_template/ckeditor/_samples/ajax.html b/library/custom_template/ckeditor/_samples/ajax.html new file mode 100644 index 000000000..70ed9caa3 --- /dev/null +++ b/library/custom_template/ckeditor/_samples/ajax.html @@ -0,0 +1,99 @@ + + + + + Ajax — CKEditor Sample + + + + + + + +

    + CKEditor Sample — Create and Destroy Editor Instances for Ajax Applications +

    +
    +

    + This sample shows how to create and destroy CKEditor instances on the fly. After the removal of CKEditor the content created inside the editing + area will be displayed in a <div> element. +

    +

    + For details of how to create this setup check the source code of this sample page + for JavaScript code responsible for the creation and destruction of a CKEditor instance. +

    +
    + + +
    + +
    +

    Click the buttons to create and remove a CKEditor instance.

    +

    + + +

    + +
    +
    + + + + diff --git a/library/custom_template/ckeditor/_samples/api.html b/library/custom_template/ckeditor/_samples/api.html new file mode 100644 index 000000000..750f12330 --- /dev/null +++ b/library/custom_template/ckeditor/_samples/api.html @@ -0,0 +1,192 @@ + + + + + API Usage — CKEditor Sample + + + + + + + + +

    + CKEditor Sample — Using CKEditor JavaScript API +

    +
    +

    + This sample shows how to use the + CKEditor JavaScript API + to interact with the editor at runtime. +

    +

    + For details on how to create this setup check the source code of this sample page. +

    +
    + + +
    + +
    +
    + + + + +
    +
    + +
    + + + diff --git a/library/custom_template/ckeditor/_samples/api_dialog.html b/library/custom_template/ckeditor/_samples/api_dialog.html new file mode 100644 index 000000000..69aa92290 --- /dev/null +++ b/library/custom_template/ckeditor/_samples/api_dialog.html @@ -0,0 +1,198 @@ + + + + + Using API to Customize Dialog Windows — CKEditor Sample + + + + + + + + + +

    + CKEditor Sample — Using CKEditor Dialog API +

    +
    +

    + This sample shows how to use the + CKEditor Dialog API + to customize CKEditor dialog windows without changing the original editor code. + The following customizations are being done in the example below: +

    +
      +
    1. Adding dialog window tabs – "My Tab" in the "Link" dialog window.
    2. +
    3. Removing a dialog window tab – "Target" tab from the "Link" dialog window.
    4. +
    5. Adding dialog window fields – "My Custom Field" in the "Link" dialog window.
    6. +
    7. Removing dialog window fields – "Link Type" and "Browse Server" in the "Link" + dialog window.
    8. +
    9. Setting default values for dialog window fields – "URL" field in the + "Link" dialog window.
    10. +
    11. Creating a custom dialog window – "My Dialog" dialog window opened with the "My Dialog" toolbar button.
    12. +
    +

    +For details on how to create this setup check the source code of this sample page. +

    +
    + + + +
    + +
    + + + + + + diff --git a/library/custom_template/ckeditor/_samples/api_dialog/my_dialog.js b/library/custom_template/ckeditor/_samples/api_dialog/my_dialog.js new file mode 100644 index 000000000..a423c1f29 --- /dev/null +++ b/library/custom_template/ckeditor/_samples/api_dialog/my_dialog.js @@ -0,0 +1,28 @@ +/* +Copyright (c) 2003-2011, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.html or http://ckeditor.com/license +*/ + +CKEDITOR.dialog.add( 'myDialog', function( editor ) +{ + return { + title : 'My Dialog', + minWidth : 400, + minHeight : 200, + contents : [ + { + id : 'tab1', + label : 'First Tab', + title : 'First Tab', + elements : + [ + { + id : 'input1', + type : 'text', + label : 'Input 1' + } + ] + } + ] + }; +} ); diff --git a/library/custom_template/ckeditor/_samples/asp/advanced.asp b/library/custom_template/ckeditor/_samples/asp/advanced.asp new file mode 100644 index 000000000..1b31d0590 --- /dev/null +++ b/library/custom_template/ckeditor/_samples/asp/advanced.asp @@ -0,0 +1,105 @@ +<%@ codepage="65001" language="VBScript" %> +<% Option Explicit %> + +<% + + ' You must set "Enable Parent Paths" on your web site + ' in order for the above relative include to work. + ' Or you can use #INCLUDE VIRTUAL="/full path/ckeditor.asp" + +%> + + + + + Sample - CKEditor + + + + +

    + CKEditor Sample +

    + +
    + +
    + +
    + Output +
    +

    +
    +

    +<% + ' Create class instance. + dim editor, initialValue, code, textareaAttributes + set editor = New CKEditor + + ' Do not print the code directly to the browser, return it instead + editor.returnOutput = true + + ' Path to CKEditor directory, ideally instead of relative dir, use an absolute path: + ' editor.basePath = "/ckeditor/" + ' If not set, CKEditor will default to /ckeditor/ + editor.basePath = "../../" + + ' Set global configuration (will be used by all instances of CKEditor). + editor.config("width") = 600 + + ' Change default textarea attributes + set textareaAttributes = CreateObject("Scripting.Dictionary") + textareaAttributes.Add "rows", 10 + textareaAttributes.Add "cols", 80 + Set editor.textareaAttributes = textareaAttributes + + ' The initial value to be displayed in the editor. + initialValue = "

    This is some sample text. You are using CKEditor.

    " + + ' Create first instance. + code = editor.editor("editor1", initialValue) + + response.write code +%> +

    +
    +

    +<% +' Configuration that will be used only by the second editor. + +editor.instanceConfig("toolbar") = Array( _ + Array( "Source", "-", "Bold", "Italic", "Underline", "Strike" ), _ + Array( "Image", "Link", "Unlink", "Anchor" ) _ + ) + +editor.instanceConfig("skin") = "v2" + +' Create second instance. +response.write editor.editor("editor2", initialValue) +%> +

    + +

    +
    +
    + + + diff --git a/library/custom_template/ckeditor/_samples/asp/events.asp b/library/custom_template/ckeditor/_samples/asp/events.asp new file mode 100644 index 000000000..d42d96c4e --- /dev/null +++ b/library/custom_template/ckeditor/_samples/asp/events.asp @@ -0,0 +1,136 @@ +<%@ codepage="65001" language="VBScript" %> +<% Option Explicit %> + +<% + + ' You must set "Enable Parent Paths" on your web site + ' in order for the above relative include to work. + ' Or you can use #INCLUDE VIRTUAL="/full path/ckeditor.asp" + +%> + + + + + Sample - CKEditor + + + + +

    + CKEditor Sample +

    + +
    + +
    + +
    + Output +
    +

    +
    +

    +<% + +'' + ' Adds global event, will hide "Target" tab in Link dialog in all instances. + ' +function CKEditorHideLinkTargetTab(editor) + dim functionCode + functionCode = "function (ev) {" & vbcrlf & _ + "// Take the dialog name and its definition from the event data" & vbcrlf & _ + "var dialogName = ev.data.name;" & vbcrlf & _ + "var dialogDefinition = ev.data.definition;" & vbcrlf & _ + "" & vbcrlf & _ + "// Check if the definition is from the Link dialog." & vbcrlf & _ + "if ( dialogName == 'link' )" & vbcrlf & _ + " dialogDefinition.removeContents('target')" & vbcrlf & _ + "}" & vbcrlf + + editor.addGlobalEventHandler "dialogDefinition", functionCode +end function + +'' + ' Adds global event, will notify about opened dialog. + ' +function CKEditorNotifyAboutOpenedDialog(editor) + dim functionCode + functionCode = "function (evt) {" & vbcrlf & _ + "alert('Loading dialog: ' + evt.data.name);" & vbcrlf & _ + "}" + + editor.addGlobalEventHandler "dialogDefinition", functionCode +end function + + +dim editor, initialValue + +' Create class instance. +set editor = new CKEditor + +' Set configuration option for all editors. +editor.config("width") = 750 + +' Path to CKEditor directory, ideally instead of relative dir, use an absolute path: +' editor.basePath = "/ckeditor/" +' If not set, CKEditor will default to /ckeditor/ +editor.basePath = "../../" + +' The initial value to be displayed in the editor. +initialValue = "

    This is some sample text. You are using CKEditor.

    " + +' Event that will be handled only by the first editor. +editor.addEventHandler "instanceReady", "function (evt) { alert('Loaded editor: ' + evt.editor.name );}" + +' Create first instance. +editor.editor "editor1", initialValue + +' Clear event handlers, instances that will be created later will not have +' the 'instanceReady' listener defined a couple of lines above. +editor.clearEventHandlers empty +%> +

    +
    +

    +<% +' Configuration that will be used only by the second editor. +editor.instanceConfig("width") = 600 +editor.instanceConfig("toolbar") = "Basic" + +' Add some global event handlers (for all editors). +CKEditorHideLinkTargetTab(editor) +CKEditorNotifyAboutOpenedDialog(editor) + +' Event that will be handled only by the second editor. +editor.addInstanceEventHandler "instanceReady", "function (evt) { alert('Loaded second editor: ' + evt.editor.name );}" + +' Create second instance. +editor.editor "editor2", initialValue +%> +

    + +

    +
    +
    + + + diff --git a/library/custom_template/ckeditor/_samples/asp/index.html b/library/custom_template/ckeditor/_samples/asp/index.html new file mode 100644 index 000000000..5d6389153 --- /dev/null +++ b/library/custom_template/ckeditor/_samples/asp/index.html @@ -0,0 +1,103 @@ + + + + + ASP integration Samples List — CKEditor + + + +

    + CKEditor Samples List for ASP — CKEditor Sample +

    +

    + Overview +

    +

    The ckeditor.asp file provides a wrapper to ease the work of creating CKEditor instances from classic Asp.

    +

    To use it, you must first include it into your page: + + <!-- #INCLUDE file="../../ckeditor.asp" --> + + Of course, you should adjust the path to make it point to the correct location, and maybe use a full path (with virtual="" instead of file="") +

    +

    After that script is included, you can use it in different ways, based on the following pattern:

    + +
      +
    1. + Create an instance of the CKEditor class: +
      dim editor
      +set editor = New CKEditor
      +
    2. +
    3. + Set the path to the folder where CKEditor has been installed, by default it will use /ckeditor/ +
      editor.basePath = "../../"
      +
    4. +
    5. + Now use one of the three main methods to create the CKEditor instances: +
        +
      • + Replace textarea with id (or name) "editor1". +
        editor.replaceInstance "editor1"
        +
      • +
      • + Replace all textareas with CKEditor. +
        editor.replaceAll empty
        +
      • +
      • + Create a textarea element and attach CKEditor to it. +
        editor.editor "editor1", initialValue
        +
      • +
      +
    6. +
    +

    Before step 3 you can use a number of methods and properties to adjust the behavior of this class and the CKEditor instances +that will be created:

    +
      +
    • returnOutput : if set to true, the functions won't dump the code with response.write, but instead they will return it so + you can do anything you want
    • +
    • basePath: location of the CKEditor scripts
    • +
    • initialized: if you set it to true, it means that you have already included the CKEditor.js file into the page and it + doesn't have to be generated again.
    • +
    • textareaAttributes: You can set here a Dictionary object with the attributes that you want to output in the call to the "editor" method.
    • + +
    • config: Allows to set config values for all the instances from now on.
    • +
    • instanceConfig: Allows to set config values just for the next instance.
    • + +
    • addEventHandler: Adds an event handler for all the instances from now on.
    • +
    • addInstanceEventHandler: Adds an event handler just for the next instance.
    • +
    • addGlobalEventHandler: Adds an event handler for the global CKEDITOR object.
    • + +
    • clearEventHandlers: Removes one or all the event handlers from all the instances from now on.
    • +
    • clearInstanceEventHandlers: Removes one or all the event handlers from the next instance.
    • +
    • clearGlobalEventHandlers: Removes one or all the event handlers from the global CKEDITOR object.
    • + +
    + +

    + Basic Samples +

    + +

    + Advanced Samples +

    + + + + diff --git a/library/custom_template/ckeditor/_samples/asp/replace.asp b/library/custom_template/ckeditor/_samples/asp/replace.asp new file mode 100644 index 000000000..73e468a35 --- /dev/null +++ b/library/custom_template/ckeditor/_samples/asp/replace.asp @@ -0,0 +1,72 @@ +<%@ codepage="65001" language="VBScript" %> +<% Option Explicit %> + +<% + + ' You must set "Enable Parent Paths" on your web site + ' in order for the above relative include to work. + ' Or you can use #INCLUDE VIRTUAL="/full path/ckeditor.asp" + +%> + + + + + Sample - CKEditor + + + + +

    + CKEditor Sample +

    + +
    + +
    + +
    + Output +
    +

    +
    + +

    +

    + +

    +
    +
    + + <% + ' Create class instance. + dim editor + set editor = New CKEditor + ' Path to CKEditor directory, ideally instead of relative dir, use an absolute path: + ' editor.basePath = "/ckeditor/" + ' If not set, CKEditor will default to /ckeditor/ + editor.basePath = "../../" + ' Replace textarea with id (or name) "editor1". + editor.replaceInstance "editor1" + %> + + diff --git a/library/custom_template/ckeditor/_samples/asp/replaceall.asp b/library/custom_template/ckeditor/_samples/asp/replaceall.asp new file mode 100644 index 000000000..faac4be20 --- /dev/null +++ b/library/custom_template/ckeditor/_samples/asp/replaceall.asp @@ -0,0 +1,77 @@ +<%@ codepage="65001" language="VBScript" %> +<% Option Explicit %> + +<% + + ' You must set "Enable Parent Paths" on your web site + ' in order for the above relative include to work. + ' Or you can use #INCLUDE VIRTUAL="/full path/ckeditor.asp" + +%> + + + + + Sample - CKEditor + + + + +

    + CKEditor Sample +

    + +
    + +
    + +
    + Output +
    +

    +
    + +

    +

    +
    + +

    +

    + +

    +
    +
    + + <% + ' Create class instance. + dim editor + set editor = New CKEditor + ' Path to CKEditor directory, ideally instead of relative dir, use an absolute path: + ' editor.basePath = "/ckeditor/" + ' If not set, CKEditor will default to /ckeditor/ + editor.basePath = "../../" + ' Replace all textareas with CKEditor. + editor.replaceAll empty + %> + + diff --git a/library/custom_template/ckeditor/_samples/asp/sample_posteddata.asp b/library/custom_template/ckeditor/_samples/asp/sample_posteddata.asp new file mode 100644 index 000000000..89a8a9447 --- /dev/null +++ b/library/custom_template/ckeditor/_samples/asp/sample_posteddata.asp @@ -0,0 +1,46 @@ +<%@ codepage="65001" language="VBScript" %> +<% Option Explicit %> + + + + + Sample - CKEditor + + + + +

    + CKEditor - Posted Data +

    + + + + + + + + + <% + Dim sForm + For Each sForm in Request.Form + %> + + + + + <% Next %> +
    Field NameValue
    <%=Server.HTMLEncode( sForm )%>
    <%=Server.HTMLEncode( Request.Form(sForm) )%>
    + + + diff --git a/library/custom_template/ckeditor/_samples/asp/standalone.asp b/library/custom_template/ckeditor/_samples/asp/standalone.asp new file mode 100644 index 000000000..1eeaebbbe --- /dev/null +++ b/library/custom_template/ckeditor/_samples/asp/standalone.asp @@ -0,0 +1,72 @@ +<%@ codepage="65001" language="VBScript" %> +<% Option Explicit %> + +<% + + ' You must set "Enable Parent Paths" on your web site + ' in order for the above relative include to work. + ' Or you can use #INCLUDE VIRTUAL="/full path/ckeditor.asp" + +%> + + + + + Sample - CKEditor + + + + +

    + CKEditor Sample +

    + +
    + +
    + +
    + Output +
    +

    + Editor 1: +

    +

    + <% + dim initialValue, editor + ' The initial value to be displayed in the editor. + initialValue = "

    This is some sample text.

    " + ' Create class instance. + set editor = New CKEditor + ' Path to CKEditor directory, ideally instead of relative dir, use an absolute path: + ' editor.basePath = "/ckeditor/" + ' If not set, CKEditor will default to /ckeditor/ + editor.basePath = "../../" + ' Create textarea element and attach CKEditor to it. + editor.editor "editor1", initialValue + %> + +

    +
    +
    + + + diff --git a/library/custom_template/ckeditor/_samples/assets/_posteddata.php b/library/custom_template/ckeditor/_samples/assets/_posteddata.php new file mode 100644 index 000000000..bb4b7eada --- /dev/null +++ b/library/custom_template/ckeditor/_samples/assets/_posteddata.php @@ -0,0 +1,59 @@ + + + + + Sample — CKEditor + + + + +

    + CKEditor — Posted Data +

    + + + + + + + + + $value ) +{ + if ( get_magic_quotes_gpc() ) + $postedValue = htmlspecialchars( stripslashes( $value ) ) ; + else + $postedValue = htmlspecialchars( $value ) ; + +?> + + + + + +
    Field NameValue
    + + + diff --git a/library/custom_template/ckeditor/_samples/assets/output_for_flash.fla b/library/custom_template/ckeditor/_samples/assets/output_for_flash.fla new file mode 100644 index 0000000000000000000000000000000000000000..27e68ccd1cb7192c8bda2418d198d90f1aff10a7 GIT binary patch literal 85504 zcwX&&2V7Lg^Z4E!hz(Ji4FR#Bu~9@o5gT^Jnux}Va7d&npkl>n?6JgHPEn&t>;+4( z#6lwW6HSZ-dnfkZmG__Bef##^alqYazTbTRKOUcDc6MiGcW3+VdvhmGl)1WmbA@Y2 z?+HXIlp_>FMPy-0a0=0((g?YTegPgFWD9PHh!;Np8&6jh3x5g76}3b$0EeO^WXj`+ zET#I!?IUjO=$>nbo+vZHxofj-ZA7Bvz|)sEFH!t3DZ8TgkYfr<2x@9Uqgp`fINfma zKR%CC@_uZQQi0RP;xH_T9zPwxCAFgd&QNks;=G9Shd*EBjT#`Id}Xl58PdmnK!uD? zzZtm4_SD}^C;bM<1J#H0@&5+-%3zPPSbp{tM30}^;HK1|{!dx|SO+;iPq(eSsA{u) z%kRBf222=Ch{XDT{KNV>xc*&nkb?4ms`@vj{6oR{tEvA})IT00O-a8pxXTXI|0(Jp zw|(5Fj7?u&|E%490G9)BX9xW8Y4WnA=Ct1Q!($&5pIVF1%Yb` z4i62j!QtVnEx2~z+KaRu0S1HXgmBwIs0+e<2-hP*-NAhh?h9}|z=eS839c8oFTwQ& z*9Tl*aQ(pb2R8s*D7b;(!oY=t!%Z^++#qm~;JyNfJ5m(5XmBy$V$rA3dq-LO^8>9l zAg$k*{5R%-_NO!77etRA++I7`7erFiK&xQAC*qGEZQE;DPu8V+Klvtu1Aw66tC+#vw!E-f0SQXIRi+iH)h zH501#$+o|AXXDz9dq3=XbY{=?wNs`%{?1*|Nx9S_pxFDrY^Q8EyZqT-3x~|@+ADb6 zXFnf!zUsSy)f>O>_Ug!}u@7c9?Qm)3A8kFW9QtY4>*HT*ogb~Aw-F8dUiRNS<8r^+RbDwB`F2$B(bD~gxW=8c z@w=}Iyl)+NzgXbzBD=D#2Hn}R#`VV+f4=4TFP46-Qu?(A>6QJTRFAvf`Re0_aiM~1$~o2BofZ8y-@C26vwKa` zhGPt9?)v&fM}6|a&!+LkzlDLZ6=vI zYjJlVJ_<5MhKX2<&nWEVjHA9x$9@>pQOU>1vKh?EkuVxYkwB3d)j+zBQZ5`=OSFQ4 zyFCoN;b;UbAFz;cGNeir#IYxtx+40SWRE41KNS>+ZGS`(=wD3)JP#2{9OxIw>E$WO z9~^EtJtSqR1Q1zufUGA$0fv(CSV22>C-{?bDHN(?OJtdBsl)yWOSCwe(?j^4NSJcs zV7eJf7Kv)8paHN<8w8Uu)j7^?45_%fFnQ{Rv=x_jLxFDqOmX2b4O_#X;aaN;QWGGx zC@IDj1}0bJ27i=KjS@lPK!}MX%SKnoNjP9Zz?}fD29dz9n!qs%Trm^Vlgq&Ajv;9m zT(-IZ!{Dz4iI0M59fuEwT)FAx(+!qjuHYL4<%lPK-T0a$T|@ zSnYb_x!BIdqSPam`^x?oUl02uDXUA@3ZpJ$_WizPYmfO8E5+A)`m6hiBP&mp?YJ-P z`GiWxzn|z??Y_euR6A|!=5y6=ocycEkB`<)d-e4E>an)7uPDZ0Ei8!32}t#`@#`L( zVtsK>(U?)czTO?BdYPH?IJQLl_wM)Jzj|8N!@oqp9rY${a$WVVVgrLRdMIBWty8Y` z%Zpu`jyiBNC~|9HlMP2sO<%XnevfmHZ!AX73U@fVF8$iE^vVzBUAge`=&7q25p%q) z_l$b~t4mm=5f7{NUS@Hr_k5elPv$jyTx;pu9IGtLlJzDzkF!iFbMU)*Ros8yJARMb zgZH~Me&3(D_w-rl<(w6tT|PGW$G2@=6AzczWO3hNsM~{iJJa?wcbcDUb*fXJ+5YK& zG%i;qxcjIB2PWTe>{njZC&eZwq5Z4-{>yI!Rh*vm=g{bw(U+X}tXozU^7w_aZKYPT zCLAA~d3th-_wOt1(gZr4ul0QJ;=q)}*Y=lJxMZG4A2P6i>w24`vt2zS?tJww&i2}) z0V6FM_}-s~N`1NE_`Lapht91yW7!v3ub$rR(WIEiQuiZ=+SPp%7d0x}@xH^#mgQ7D_CXWxlJYJvPcg~rU zCpMhvnNp+9nVUcP=6qPTmSprB3$KSEJC8mcylzkPeGSI=y(znIflcz}epyc(4yGK+ z@{AaIJuV~V$kZABvHtO0=BrL^>*3d`s`H)wo3pR^jhXu0wMO-JmQz9hOlpqX+JU=H zkvU1jKHt6IY%6HV?Kb(J=yQ9&MzQZ@ljQvuOI-PKZ1lktyKfh69qN{S&Exj_hR?m9 z916J-GNa6xZ9T8v7?P2q3QSqGby}Smr?eNVk4#MuZIHTfUg@mZHZSJ>boR#4cCLZD zhWD#=@X+hxWBhIg9Zc!>^;q?;CS{++%~<%X&5SZj0#h`@Mz>6Sc4<_nUWpNk__d2W zx@10%ZoT1MC+8X~_Jj^ykuiGyyz~9v#?Kp5FXF>g&*O_vM4w9QGo<&voIl51b@d(> zpLnA0?n6;$DxR+2u-CCC7k5W2?RR!{mw{XRY+VxTywtzj?Rq0N?|y%|&%TtfwDNb~ zBvxuTEbK!3WNVk@iM{Gaor^pE{hCuF{u+Gx*58Y_yi2WmVQlo!6$ex9bQ)c0*Metp z<>DJ;UmK*=#D`f;sHjg*OKXk0PtL*5h!?ZiUx0&2SdL*QST2<{=8bFP>)p+y& z=(@XZrCr!oukoVogMPc0v9a&3f3^-h_1^mFtAkgxs~b513o8HI% zR{q}JaVdlDsE4ko|7Bw56-^qKw)lk=odMag<5AIae_fe& z*>~2FJ}Vpd`pS9c+qlbL?_2fwy3HADz#3y z_B~v``m>N^yVHHM#=ia9jUNGk2nG>BiuDSfvW$T|ur+USNBwSAo z$lOrUan0Z(5q}MSKWtIbx3A8{`c^vbS^ik?{Y$H6jUB#Wu=9j(vqJjqY=10UyXcw4 zvU_Tqn%Q^vl%G(<=Ju$;F55PZ4BK}+J|}wRwz1PMZ#!c>+YWlus>ct)TuUAQrTgt& zvKD$m{29!AtR;zo4CVMJ2dvaStPD#@b}f1-Jg5V<956)cLurz7Iijcn^tqX~3^mK8LYK~d+Lk~Yl z8u{%BpDSJ7wX40?r>Q4%Y4!PhQ4!B4tGC4d2XE_)7}pBI5o_%NGfFI;IjMkTDd%GJM;a4?>oQS zbZd&u-Qc^O_k8ikk9O0mmuhkA;pRo~R;}49#bILQR%auOIEVuS~ zUGi4Hp)0bSFSs81v(y(Unh}4cz1X?l<-Y&XN>9a9o zE4@Q;y)qkSH`OK;5B2Jx*7{d^HfXx%u=~3LH$gAIHQyz$w%``=B>BqPxHSQkkZ8M;C3s|y+hCVTitiKd%Mh( z*4}jvzZj76_bmS=u@^jBG^kYkT&-D;Ufg@stYUoa;E6HSVJ-FR&&}R$oY-*4*_|(Z z&izvB!1U*u!53~G?EIw7dJn66o066U*p;dt(ql-M^0n_SY?_pLzguej_2A8`Lh8RO zy}s}2vv!O6G|~3@^6tfV1C+OidtNH}?m+K;YhO;=oatXWex*&s)aXOA?IIfu@40Mn zmdCwmnUI&N=$CxuAJVe+uh*ecN*Po^qtNA(?9k)n^Zq(PIhp` zhV}uICbWFpXiCfY+PCk|eHMGS_ZiP2rR&z~dbZZalm}Mt7Qe1G?%CeZIUj7k*z0z7 zjBm`5GJ~BGf2S+2d`gVgnQ(|0@8bslWz zIN{rtHMdXu>3QGwITaoc_P(vf1KPMr<*pQey?(XN6=SXX!Vt-U46 zZ$wF}={>r(uGM4LwV&4}Y0^xCS4l z=e%w=zqj!D-fvE1jhgw#raIA0F4R+bZHXRrpo05%c2irdc{NtuHRI~UxXb%*9*nzD zcl|MKw&i}eN8e046qkBB%*~(|)po6~nCds@>f*F}<+87Z?9KSaz5Ndh+IMi7dA^oose7u)U0lMH z(=VL58&KipQrp|Rr)&vLc%RcDWByE^#El($hWyp=R+jg*&@MxM8+j|s_S)-&zYZ2_ z;CSm<%8lUm9y7-seR`+6kK>!ackf*`c2rh?(@Z;j8Ne?{N^vTHCF<{aOSC_4ILQ|q&4}L3z ze|hW8u1n{AF04MB)N4W6`8ytd{;J922XTEvd%m2uvEq)2Eg(bblVK|R>v)G(;m$+0 z_Q<%N@#?p!wYImvc{KLthreDq*lOFI&U1!W-hStGm*_=LXMXkU`$N-V0DHW8^#0i1 zeH-li`TCmm4R7w~{9w?_(;MpD_MX~$yO-K!N)Pw#eQQ=a9_Ze3*6vGB2R9m+X>)E^ zo0`EB>;17gb7yz0CgogY^vsLJg2P6C)1ZXi1BbbG*V@;A;4stfL&)f|A-$g@4$WA2 zCcR2XS$(3Y!}QvZCbd3O)1uy^3yZE~WmsOQ+Tit)d7HM? z-V~Vy4WVK6?VB4%Pd;%fM`fN}_$>ToyPCnzZ%GB9%_T$z44g=0$)1yjL^RMZjbHbYayf? zW-p08Qf7OPL5bs=EkW)LRozFboVprdK`{y(r`L5-$dKV^Slbv=OTbnnp#@5)gJ?&SU?5ByDllF9-X6OB5 z-!C;4-lU&un>cC4`o@1gzr4-McFL?>4L5e!mo~6p^?@^^`Y-WLjPLv7t#zkXIQR4O zd3rk|F5AERN}=ziMb*Y@hea;?^5wLFu@BN01&-R(F#b~VraSMh{N$VRs@2dv8Sie~ z8@B2BuDOevI=E%cc4);bEOYbb>cGgi-G2*HJ#nn^J-FlW~6S~ar z^BE&wPxSa|kXxxY8{Qm0^7+j=2V9;sTVLbhlxm^hRxCe6ao^|g#e_9whdK@IcXRCF z4|8rj(8l+@H$f|;esinmqtC+9{;<~gRSR@joDs13QAV|K?(g@E7%{Q*SN&JiO?bLI z^pBg(eFJPeWjIVYlu>STs}8oq7rpV_WVh+JxHcQBcKR;18YOipuXMyMK2aP_niO2 zJ|b#*^wZ(#5s!O1-*&aAmt_06>eaUCbDM5hkUkE%wXS~(p(>qGA__%OqqshGYaInoV+5PayH2+|TDPXjWetm)&pT1ll z1<|voi+I<8%kOOPqQnq>LRxb`}&HFMji0LV;sKXa;b7c_Ev}*eCl6 zkbc9&u#V*0YI0#qZi{gu{M$fQ=NR%Y1Tof~ybpjsTcR^kEE-Pkzax+uZF6icg2yVk0NuQ-0Bw$T z9%NsN!teBTV~1=8DRSwiB**HY=A?9CdRkH#t)*7dM_sNkUnfGj;>dqjm~97;&%f|o zo@Y7vc+f2=Iy5#4mwK@kLeoi)choQScMvs0#V`dzIu0ReN>@rO@FX`uxt@;+ydc-Q^>`Ex;x6xf9>3=YJo0z$783gzDRUjESB9IGqTFe6t$WndC6YY$o} zf?sj4hq3J$s*l#yN7iUZ5fqgZkS>(`P+BPZIv`kh|Mp}~@s|O~LaBETg|z1ZF=*wR z7{&XS0Z7sPL+RHW-v|8kW}2YB`?nA<<5fe{|5|8XUh5{A&T`|o%pgXEy0Zpc8K#mZk`dtVu5-?ggQ{>MabWl!N4 z80u7vfCf#o!~84~ak`ZN=Rr3~0r+!Sgjlv!oEDR~l*RnKOj1_TN+5I|vY7?CT>`K* zuq5E}^SruQBea>6pG6|BXKXuXM@fX*f#|oTc)3(u*B%hGgM8b~%Y?G4!SDisC1HLp z4tZz`aB4AxmI7P}NvjwELe3EMt{CQLk+@JWl79f5Pj-bi0PrDX>ra4LP|zm;Rg3_k z5iSV*PP!zEMCb=5>KVY_p>Zs)M%xi%Q}MK%p|5o&?T5=O`55SrL%kgU=nh5t9biiv zUM>|QKqwV_-AiMBUZ&#AI~8~60`vsM>&0C&prr(y)46A0Qw_<7#K zn2PQ}&|w(W_5(~P52FIc%i@iiq{FKa)UE;<6~strc+A@opc9NL6#&M=sKgqxiqqBu zUn>X9&s#d0SQ&&uR+d*ms2e~Bh>CXNOu0)%Onjjiy&hi0d90gsEHGo ztKuV23mBXH2|t&K7JNouT+65lby%FjP4+bWD9BPV0)%=&)N&il&ms|B@LUG(6@cG5 zP&l{*4aaOMMu1R5XplEauV#^mr{fD*%7zTuLgRl}iOW^-v?fE2hgD+ymwEbF)I{jC zFwvql6)9xdR`Im(WRa|3`KMvEjoI*YjYQJ(u^S%CR-z%K1NRcqoHidw@Fn8Mn^n_+{9ikRO8(IUf5?*jH0)%oP=yTFF zSR~?faR65UOb7Da02hGxNX*Y^ajLgS(`1qG_yGM*7{Lbt41l&51#krvj3ujL1PFZ% zzOiIz;CYfn#X!?`1ULssvmlcK$VkOqo2PXin#Kc?e-??jp0;BMlbjMnH?ZOPQgL1V zjeTUn!SjTc!N?Z|ff;x{fiA6pW^n*k6<+|nju#w^0ET7o`4-3gEE1l+FkbnCxF&9N zs$1zy=e0R7yw(AzVgxV`SEhBKkRoBh!9>A27v(@uPj}i57@LZxbq0JhNd0q}C07G| zF&Iw902~NK8VPW`4KJ695kM7zZ#Eg4c$tbbZ!;k20U}QVfg0c`PFQ1=t9n9l-VgD^}w2Rg3_ZQs663OK3RTMJndEBvn6tPS=tqDS zFusfemB%T@8Qcjw;DH^VKIQyIOgZ>5rbth8EjAr0$YPI<#U`Qf`9J-b zdHzcSx(yl-7p}i7RG=a@viAHv_@_M=1eY8^uq;KI?Avj!q=!5MWNG<9R*P~F{g^0* zd>YXLDbW}9@Xr}pq1ql-bJFlZ*+X;-Wuu+-(HnH;sc<*P1EF&7k;hG(vPTExq(C0d zOio|qk%n{Nkt#SV==Vz5u-@=ja)|fThh$L6B6tvti277cC3T^a)3P9xn+n5fDh`#L zmIXm!^r>FyK_#bsCHZnuodCE^29=za1;Oa6PvxWsm7LZ|@^#mz!qClvL#2}r7Y>3| zjGU^C2*Uw70~`TR#c5fTLW+bDjYYE{23-Ko09YB|B7oHZ{)FXmURUtVC-PV%$Yaqg zNFUBCL65{3RB~PxB=b%K_z>WDfM)=XEM1ut>z|hL@nZPXstvgmo}K zr^P`t2|tTOXejd2<4{I?;T1`%lm~1{Ty%kct3vyh^x~ME7;RDRx3tA z7scyYkM)A10{pKL{&H_C>@srB3HIm!x`*bW^!g|R9SaiP=hTNC{I96R9uVpPE%T|*VX^}yeC z4VsABD2ToKrKM=)MvAZzz$F0f0M5qszz7iPBKj0kB;s`Uph#Z>JdBsl09OO-jQKh3 zIS3j>_*o?4bmIWl2G}2~#)7WpGgWv`AkjvFuc8H8%V*O5&%E^kE(TZ=V7LhDsKm8A zrNu#Ct1v%{M4S#o6+jPwm!Xy$1KbNx#c8qckrMN>NW|&d16%^IFHQvD2&@Op&uP1X zZ#v;;k%-gH1lUVS_0bXFL4YkWKc`&?zAl8HMZ&1byf*(MXOgGx@jRPyDbI#7xZ=nN`3Eek@qsk-VxC8zDmxtO<#2o(TN0DJ(&xrR%~ zX^S%wDH3tIEPzh|W&*TPQRs(T2&ctC?+8DOM4S%8F)FHQJjj=Z#4cifPK$j%kQT-w z5vRjF%My=x0Lug1FG3Zk?JNcCLT8#`UIV}r_kM=^i23@pA7tkeeOR=aUutZpHkE)_mC=8vlCuRV8p_&fp z1hM#kAJ!(9?a>SHTtxTn(cchu9@*g#8|a=@N~8V=QNsrxpb|@2Q1}+K{Q}@QfG0(0 z$p|=!0zC)ceNr`dL^6fMfH?045iSGx8sHL9lqIL#A@Q#T-#rqxOiG6_AkNF+2R*3d zv^>Yz z!0{rii#5S%7nNcBiDlR#50gccFvfs5FNU}|BmrCj@GlWsa$4+rMd~yTd?!dfe=m|L zBnHHJYuZxS7T`@0R>S$^v^KVkzb^QWkuXg5kc2S?m<*T~L;N;IYk*AvwgT7+>yFc6 zpC>6Ni$th7^Xfy^co- z)wR(^RNEe%1avdHU=Lf0^Wb2F5KuadJB#d5Wf(EK;wUeKe*~mbX(Ud#H*-KvSMZnZ zC2UlH+(+m!x@ixozJT4t3wv}6;!Yz+d-N1xS04{Mm0|esv4?+ls3smxpt#5d6I%mU z8FJ}}cGI(pYIX<}0|itD_zWt<2HH(Z8gGx@zf>3U%I(ksaY3oS7-ppGG;7WiWppd^OgUaeUTwcWYnLZVR zBlMt>^Nf&u39R|aVKEt0^7hGlb1vEXEmz4?;BD4~Q4+6ObQf9^-A5FG#msXUpPt(z z{AO8Yyr3#c{#@|DWe1TicyKF;F5{^C2){uA#Lvm!HB9pWMzL$2ump>SVFHi18xa{P zpMMZXN`#F@?G&>thigi~(_84C6)FxPYw4 zmYf#*VkDWg?5`w!a2-kByr4oxYkVJo5k}SrP65)nCVr6+wSl&Z?SkPcH~{`16#f0k z6-0Stg{s)YzY^eu>c=tVP!0xx(q(xSE?}5)G@7SZeP6oc22B(x<}kmJBMd>u}xTTym<_dQiz} zS930XDhz`xI8?6I;R+&sDP2y5=l@iILjfKZp(UrqzCISXQt{1n1PMzM$rKU;;=HFs zcus^@0mcDTaoTedKZ`_Y`e8kKLvW)EDmgC;l6lVn+yd}-dpaSn7om#Np0Ht!nyRRFdQy}$`Bo{;halOrQeH{ zoR;@rvqvjDW1p`z+X_`f)xiw_i6{uR8eiGN?!^r)M{cDFA-*$#ojX4H$bwx=7FvQS z(}8I*J}fzp)ablDF@87zRV(W!geiz+#_H&vJt_qQQYmx@Gr%;Dj^Z6mHads0>AvO+ zDvzgr2XGBAO%)*a!(5KY9XZlH5-|@s6&4dCp&6_Z;U0irijeF$7y&FTMIZEF2YTH{ z$vTlR#(+34hWOxkBfv{4nihtZoEG~^5dO{Jdr9>Eqe!NZ7!c=^^%ycb1i3mf|LBCLt?$!QNu{0|)1ZUd9ibQlBTycpumQ>IwJDI&DwwAe?_ zXtE)4E(!Zh(g$NeoR`7LdQiz}xn@o1@773vb)v1)2EQZM5!MQKP!4qMKLI<8YI@`d zbro!>twcZMkY&m-^Z~6cO@6PmG*Tf?@*fWf#h~}P;7P|8mh$fCnLRnew1vblYzgJZ zU({fT&lH0I?gQA|k&byPMnFl95>>NE=orka52xrsCFhwU`4aP@o-Q^529=zL1wq>S zR1D74gG$abQ}TK0Q!fU%72vOqw3YoOLQBrGKva$bZ2(^?3ESt$8YN>uXb|&W6ya47 z-Uj#+KozIGD)F;Ogj|_d4xh-NlGCyv*m^SW6@ZTco&)#@;0X~bIV}rwHJL4`MJ#4=Py%4}xZ*PsO0TJz}WjJiI0PvE&)l&x4ZZ zkEh<8dl7&4F3%2$nTuXotMRahqXRg`S(E{fexboNBWt4He~Ca1&3`) z>Ov)p;6bn))u)of5K9h~oQDO8+;S=gaZ+-q=-nnWf}UaC!N})2TPFs zrf7orxiJ4UI9&FjFa3-dL;l;3F({mvU6#K}n%74L#y3^bi5gRs3a5xt8#+U`AqA{B~jPcVT6s3ixck@cB*;_0?`_^M0RIyo_vdcUdG>8XpS^D>28&NJUD@d?Vi2HOsUIj1(s2k$pS?3S zMQ#fMxwLDH1pzx$a*!gIb`=F__alu0kS7@xFpS~%_6xtIFZ`Ci@LT$7h2PQ_eoJ5Y zEj=pymcH;?`cL*Py)hf35p<R?Lfee33FZ+~UhdtNQ&X`Z>&0032!tdk@ zzmqTgP9Eo@@H_d!@8tgvekX6tw0Nx@lAe#97WKZ9M|qqLe#B?;#*`?kF{g*{Jtlo7 zuNT4(fbs7&;$x&nFoRno!?S8#keUFgMM*KPs4+M<_@jJkln4^>Z!}U%$*#oWaRLfL z_}3i=z;r%HhSda)QQ(T1n4Vk)PInARyWq0bCFkj3kk$Zl&=yL<2Scvh^z!M3Y9m*2 zl!h%k*UnXrnj~FAkI`+ZnM_Ubm=L!mjkh+Rb7o6jX@!sMX_2>T@BybaY7rDWFflqj zCIKH0mn+p7@!yNY&L95pZ$&mhKDZ98x{($WLk?y=MLA;C;tr}`#V;;*Xp<@8R*YC$ zeJW)EaxOxM4-HAgkf>2@7?qNdD9jfqvFXGDu9CCmjp*b5p#MvigGGol)9cSDZ0dsl z4^pUL3r#KoOgKd!cjMvx^M`+?+}P7 zd@N=K_E$FlN0?CzAnCj&Kpj6G%MEgPU$1+K5wIUU}d@5Fr2Q04X2UO#cyOHktAtO_p?I^EsI; zaleWp>C}O~$fw`j8qDvf4!HSm13zDFf}CbR6-Vy93jRs${N!{bS{Vpb9U*=giNQaz z9Zj@Jev;Z&zg9md`VJ=TX*dZT%&9BtQ{x}J4u$+gz#qH0>rC~-|TX)X-KL?KU ztrlw~uTsSD+OpF9fo+^4)7lmuQ*pRdqDrQ>rmsj?1TR$u<7))}cy}1-9l)pZfj&kg zR5j&i(pj6p8XgIuEfBsv#rcls<*IIOzwaj2Bd(FQfCb^77-uClSt^&+mFP4a+IAwD z$6~ouhup0y7Vtz;>$rEeKy+y@jVNXHIrNvnxD`f8y;0<E8g*k-AO zYNoY=Xhhd814vtq6JPO(AfqfuD_R5UvL?bmBkn=|AgqdMDe%o-bE03?+CY+przjWv z<@DPPUhLw$;2wqNokTK|Va?Lk13XGkx-fRs=f!2g8_=O77x)bYKFa3ZwhNps_4=4G zBN8vYff=rp;TbL-TDBU;yPKX~1Zgq4?N64X!8T%yT>4(eS2B%tB-)a+>1ImH4MOyt zkUZw&%BHn2ybWiE4c#DLZDB5v%Ia#GEI!(LBR^R0x6iYL1xb?UN_S-SG}vb8nysab zi(hz1T)9S9e4sFl>$q zFwiU9O>2LAWDg=?d^FXOnyW>1g7$=EVd^l_p1MICK0*savbnLcX?2YAFpShNZF8(v ziL5%NYdQkagOH(w3ey)b=IPC>`K<)$+gWsl9K$8#S|R6GmvpYfdBPee^K%(57*Fbe z1RNuOFOKgia_2MuR1B^F%pQqxJx7sRm({b2Dbo1yW)z~wo01&8m3TYC9g$DII)gOe zv%)7Yo-h{sAb(gb7#hoRjY3L4x~9lQNmEM@L#4c#xC;& zr_?L8d41UUQ5vt2h*oNto-SU84;R;x`HUE5NM`#_)5aoWB-3?WUcD**UYToWUC|V7 zyVN#BNiL>IlAo*jiR(S0B|F0_G&VD{J-$R=#q?So zf)Y$<^LVTuW?;O^e~u_%tzE^GwxD~S`LWWBI0G}WmGQa^66b_m=OiXdq?dkCFpkpI zP^^6aTEtV_6^naVy%j=1b6lSDmb2+CiSIM>YLEH15>sn7e`%)IY(cs*LZVYa`+51^ z%GJ>Bs#peG*$aF2&QmoA+z1Cr9m1z8^Yj9odW?K8F;Sq?PXho8o zO44%O73jA0ZZO}<&T1+ccUM5qb=gcUjsv-PJ0W_X;0pR3is-5z?`h<35=bdmGObs% z0iWzNQdOUgv?lhhJk~H~oP)6yp7A{jbCC0dnx?15NA&{Qx{E1oGoM|WN$1ab)=ov! z+BUw|7%9(1t}_XG^F`NRtn7HM=ef`CObwsD;jkbQi_1Jz&XsGAL%Hx7@&Gd9NR+u& zgz{4jeo7*hBiH`3J1IZDLm4g~>D^6h&H8&V18uRSZhO(WHLYw~YIFt(BYDPiZkLP zIu(X`ZGQ7*o;_c0M9qI3>WXkXjwLf$YlP>HFcOPv!Q2xlT)QLm?_E{+jR_wEJuQD( zbUup_N1CBx&J3)LP0AtLjkgfTi-bI+6tpwpdma8Z2x(2F^hX`6XSNoQv|7uwp4*9x zSVrAs8t5wpNjF+j<2Y=>`H@hK!b7d3oqqHP42``oL~VWQ4m4d)`)3{TS!CpF`m>;4w=`QrZ- zO|PpV@^no)T{m`plfM+>)}Hyd6C+1TSJPUGd<4Na@v^&4y&0*X6?C!4bx=tv84r(Lf0QO zhaEuv$Go{l-~FODtW0JQnKxx`f0j8%Mgcp23+?uN(!9 zBDy0O-sxitE+D6qKdKG6sEz7FZm_Qrv@{xm@1<#ouNdMfg)|UDe38Ex;vD^ z9Qpgx%}|2u&1$LUs~Init#ff~6e)48yB>pkse(`O^Vv()Hmzmyy?;S_iM%vmOf9i} zvGMPd$CK4}l$q(}HQ#aP>U9^QL#gV!qpb|iwE}M zghjH6s5eGCqerM5LDdZPAgG3+Z3wDmXn%qV3>|?{Z&9)+%9}{8A)!Qa0F&%ZB)4Fa zy@}*jOtLqT+=fY3OOgq%nn<>nP&G@4qC~O}ldRUVbctj&k=&F?*3*W!x3`FT7>Gp( z$NnJciV%5g)R~<(CaMfY77grrdL%8ZNdYG$DCmY^Ga%cFXy3$Z|gs3YmMQ4km z1aGlYW+S3Hj9%obqmo5YY9hIYgc8XCOtP9tZowq0iR4yHvYv9(YPE>=HxP@ET2viX zjyFbUNGRbQ!BvOR!CZA}QL&=xFxsE14x`(ocI8bIV!9F~ORA%yB-N=&9Z9NFi*+Qb zPAyi7s5**Ds?#a2nn>;pq*Pa0wOB_~l%N(XWwin2XfzrTHKbUCG@|OLHoP%9S3=bo z{YFBGs1aOs7>(ho!{{KcI*e{$#NOUCA*LK6d4`0Fk|ot?NF7P4(};B>st%*SN_~(> z-X^sxHBE@=N|Y?AP9xTls5*^6`;j5lX|-ArO*asWkXBS3Ek60Qb-skEwE}H~6xCq# zYY8QiM{w0)G>)qdqib2Lw>M3QX@f|fE1^X4HxepJmQ<$|>qu0cR-o;f>WWC-AoW4D zR;(jRtkH^fL{U+)q&lrY`;j5lQB!gFd2ApSky+*kR$drI09`1dYK+d7Pz^?>NT?R0 z$r4Hu8o^bE(bW>_%@QJc_9l|&ODK^%LqdtYFE}?2REmD+7c9u{rONgRGvImo_S0aH(E-Il!a%l-AlFLabk?bm=0!zq{a**zt z0qLs_Pcb*R>ga4GjvE>>TiHvfhE84#C9{nR$6&ShflYl-CBTy<2kNUSB2ttFI5 zt|*~enh-;YWG^OJAd>&)s`C~#Nn?rR;u5Oy7VC(jM6$Dl3f`jX3{M2QT~c3lc#1jA zRfo}wTy=D|6318#nXPI_D4DJByid~Akl6~a%}C?dA}UH!oto5L@Cy zj-rz4bS7&JnXT~JjHIg(DEf%bM_MBJPp&!*sUt~s8nKQ<)ltc!C@qm(Lqdt<047-= zlFxC~X~a4bRi_bXKN3}^5j9D9iDY{T6*Qu92#WMOtj_3-^i_wan7yok)Of_NQXf>) zxs0_d4V}E0uEg0&QXNLaxazcGrHHDdsH8frSVyAjC@QH=XH}pjl5wS+Lqv5LJ;_z4 z73)Y;omQazNK~CxRII2vt*A*Vib$@(P(9@cq{AN0Q*}6Y2aDB^*=ifhhK9^m8(20p z8rJtoHZ)o`EmBmfBT;o2O=ps|MDkuHSxY4U$|P$wEM3a0WeJfIX(h?$43tRlW~it- zhKj0VsHi%IimDStZ9K*n3`G54yY33aAMRI5K0#y^*+ow22VedfPCEFS!HER3Igz2< z=B=S3JW%~X=#R@f68}raOOCa8mS*KQMw*r6!)5;rkDz^US;k>8YjNKG5~wW+sa2~) z0oYtaU5GgYNREJQpX5$}hbc@vOQSal_!glXqNo1!oGG4ISt*TLbm`tKF)T8+TX;f3 zWK2Z7m>OhO!BfS@Db!>H4H~3ihb)F3c>!q6;Sg3_qE+#DMlL~Lq9DjB0ROJvL*QtR zx(yf>9_AXF7VMjEo9%t?ysoH6b!Od|+&1 zOoD4;S5Gg`1|IeOynK96;q&i!3NrqL4K@`g4%?AwX|%B^X55PMnr`5#I5BZm{G*Lr z6(?q{XfFQqrml(`)Hy#FrH|YXTTtSx1=EaOF+LNmU5!V0Yl_eWa1#;UOd>Q1++>9J z#t2OXHx1l$gr{z7!v>+5;ASDbmPBX{xbG0&lj0w>KxiJq8)1YNAiVR&Kgf>IB5;er zrGQ%kZYj8B2v67uEl1dB4f$OZ^b@$B5gmRDpa0C$I{(IEzy?_Pf1?es_@3z<7}fvp zW~R6mu=2zTn3q@;eozSwz||+1Hx^~ht$^V%v?by;z?3YtysD)HsI;1h=c~n{-B1z? z#G&L8PO5QaK|5P=pkoX%R9mB&S2Q-gNh_@=$5j5m&pu)TnF-uUCzA}I>-{J_R ziX?^gW~h!FA>3WW%~T-?u^>NtPacbZfdMl!E+pAv!1zm5+3V&ezQ9m`i81p{ow=I! zLP$R5)+(Fwa!$T4Bbo8ycPI7m!K!Y$+>bKnWxByJ^9-APj48D$rnOWfjl2ExM(IrYaM7UI z95d!(*(%52NA1SQFxxzpiJ#bfA%zrZWb4xy0W;R*n7Jm+%rl_&5w8UsFyiKFnzVe3 z%T+c_Qobhd+)U{U1(*jhPzh=Baw@+t8&ZJLv z^D&rU_E>AsD2Pd)CmLME{8x+=nqf>)Z=GpOzc$lYmZ@gE%>E2p&wN;A)8z0OrMpxX zfsXtpnyliI@-VgbDa^lpoB_H|W8msjncFf^zb2UkGf}n?2F$9MqIn}uyiAf;pqVg} zRy+l)JwM6kukZ{++y>DK zI{hfnJlm%?8CS)W*7~XC71)>lNrO>loYQ@T=_?akVjgqOr!pS)aVE?@#(0`(X4>3L zYwt8XPZM!wkIV*Fs(LN`qmApCvAfkXUu4GlT`nU^X6$3x8Q_0nCZKbf@%>LSU1j1P z^&`!6RW>cPd<~5KXHBCSYp~5!LvY5Mm^06Wow)|{KGsm5NvH04j>jf_ly3Z9+?YO= zk0Gb(rnS5R`-Xw>r68F`-P&UJ&l>YG&Y+mt`({1!WhR}>fNwpEC4hjv1^^V}Q%V(Y*kpU?#uSWt8Evf6maFiKXZF2nNi-eHsIG)lHFNk^#NS zri>~DnE5kFR=)51{&EI2K(ntotd-;Hf?9| zNesui885Ry({}g~znq{SH{@@?tVptnsLX&FMr8)fFe)=(hEbUTGmHw{7)g<29Rp?< zl^HO@sLX&FMr8)fFe)=(hEXE94U;T4V1`kd0W*xs447e5X21-iG6QB9C6b#m$$Hw5 zTMjd%Ivo3hq$`;LGom_-hH=$lv=3JuMtgD9VKjuR4x@*;>U6RpH(*9oN6`_Yu4D$x zi0ZrrX26W74x<;j>ZoKKFe9qd3e12RQJq#`2F!@+sANfXT7elbBdViDU)XphGhjwk zrxln1Gom`JzzmoX)oBH0z>KI)D=-6Qxs^k{yCctIgQ{bOOz1c%Ghjwkhtb&*Dl=e4 zREN=I2^E+T6j5~;T`i$917<{Zg1`)z5!DF-GhjwkCkV`d8BraREUFHpsZ6rmfEiI8 zOK3G!oggp+W<+&@zzmoX)iKEiRVU3yh9(iY0W*xs447e5X21-iG6QB9l^HO@D4DJN zSVD3GW*C(jFvF?RfEh+*2Fx%jGhl{MnE|sRy2he% zD+lSW8FHx(Pcb*R>ga4GjvI0VW<+&#@?xmWfEiI8oy)}9mm4r6s-u!cVz~h`qB?JZ z889QNqX{uoX26W74x@i_)p?7Wq_HvsW<+(~0yAJnROc-)17<{Z-U2gVW4Ty<)(jzra|MNLv-nE^ARI<>$Im=V>f1!ll3w{r4tlX3%Q zM0FIER7X)sbvl!^+<+NT9Yr6}`ABZSjHpf{Fau^pbsB*gFe9p?l0{K+17<{Z8i5%w zBdWvbIj%a5zzmoX)oBD~z>KI)BWjZJ$_$th4&vURFT40W+dH zI+w9_B{N_~R7YnkNp%M)wlB+Ct$5!DF-Ghjwk$I_*|G6QBrbxiU(10|9hFe9pCsHi%IimGF% zs5(K^#$(vnS}_HgVZlt~G{z>_M{pu!CMOci=0t{a`-v==6)4Sg3ucN!6J|(90{De^ zn*h`VjX?BulEEayu29f$@ddcX$PMV+APgVEW2^^EkR4&V>4@-EeK^8)o!X$0K8BNj|08&Sg!?zfsx)DVF0P^|}&Ot*loKe?9 zZiItLNq{skM>C1T6@@^)u-P4YfR01zqq?vf!mbYF$OAPXCMJB~e_e1s5Z*w%Okp3P z`awz_$QS;51FSbLTG1+?@3biW7#iMe}49LT{hyYW7b>FS|ya$L_o;foi0hiAUM19LVc7sc$l zB#`v1I5J5MBq6jc_0TXf9qIN*`g(bQm;Nt5l>1#6yet&`Ku|0#&V`vUUsTotXa$#Mqb9osdDYoOHh1)!&1e0 z*H70C@?u;3tqT5xXLl3KyzR}3koZf+z0q1+lywcy-#Lewxuq&Q3ccXVxB zE($J98?sQQvuaWv9E^{(RlHmtk}s`32OjB6Z|eo8z|!G89*>~U5&7zG5RVeWc^*h! zfQcbe!azp7Tq){P6qJg5_QpLX|K7-H^XrfL<3|4d-IVo%oR;pP=k<(?=8sQG{8SRwv^}YPP XsrcmfO-DN*^n;D=y?o*GKmGhad_awx*qq{%d+;~YrWUn`}6r6&be(p-MH=>BNUHl z>k#5ELWqxqtOZF3AuICy{Ja^Z1DmOShzHqPIk1A_V=SVA0#HcImN4Q6?6mpgMA1Pp z)&VgAC?+H{8U=?1M28?e78Dg85Qc32HtfRj_uzmHK`0uvjh*aB(^lGAT$&oKCI?V{>MiBxX&TBz@2>vDZZTUqflDbdj`?+2p~o4ex*6 zseO>1)?B46$UmwoD?KXUFk^J;`&U;gH8hB=o0r6RR#gactqN=RCmml4~V*F85<@0VJ^C!wtR3#A`(poC3$YcW@68&;NHhNQh7olNsFTElzq>&7%K zKmJEC7rT;p{Fb&P$|=7OTV`Lz#`6wdCgv6LFCBYnkS8gZ|B-2Md@fISGSF3Ee-PXF z(egz~+g;?3+%(Bd4a3uW)*;eF{_JR|nB%EL^*|hk*Xp{rMU0g{9(*Ti5*fO0fxWKC zczwKQZ3I#|T!d~q)>MjUXCYOiERqS{nvz=2zyl}CS9-q>iB3y(7!kPoywX~!g=@k4 zG*n@T-l`zph8G&9m2QoRRft^4gBFxYsx-!juSgJY>gG&kNr|ahKPhw--XzNv6T3>L zKdk|YsIZZERuOYBjg)1=I!^9Sk6XAmz4WgA?`j(>$&m;JuVfB8mVRHVtn}n ztn19z&WQv)2=KpU*_!SiYhls3C)+wC(7#u2k@hcSG{~kE9XLd@HZVp z*tH_PUTWE+W$zHfz7DP1cl?BGrDk2)Fq>Q%i1D0YMTjw7hh!px_w|(B;a_Tx$R+ZK z-1%tJK?&cz(=~M$H8GXSF;(Fh zy|k*57M`=X@*<@D;%-IHOVjC~a6(JQJ0!hkccF0Zeb*&?Tkc0aK(zO?$r+}Fifm4g zJKa-W{sm$-Bg!$+!tLFu2x*jTrhDRJEOhlV@-%e1^XVx2HY?vjh`%i8wcFl7lAT%5aS;eK8pYQ-*kJS%}WCen@f^_B_8}lfo*QvV&A4V$_NhWq-vy=Cm?RJo6M^Gj(4As46ey zIj)X*Rea)JAA!haIfysBXT19AQdG>;G+*l+>ypbR(X33RXtq1zxjT@EVk;82RbYiK z!Z#K{7i1;M3=r|wOY(?EB0g*s)Hd#($C-opNqcb#Y3Xp^StvMG5@a`IcL*U7+z1KH z56q#=fE~fPyxIAP!WZ9=J0LBkJ5jisc0u9U2SPKw%h=;5aG1@qwEKv7M_rKiEYDnDlDBsja+5|hqyC)x3%E1X-=?Mb3Vz`|SW=B|2@I}{?So}^54kGgTS6V8 ztZg0dENwMMeoaMakJ^pa@$)Y!)i03BWd`b|8rEiYXyAt~+%D1r|LJ*NMfamuNZ84GfL9 zx}8w1Lnm|CJTc5_8wK)RIlfW5k|Br9dCZ38a;8W`NdPUWYhZrhwYcGwyHHSz#-zj^ zMqkc#INr|4P#NyiZT3eMJ&3YBWmCb^U^ZE?2zh37tlt+Y8+&j($#5~f$VVkEU~btS z`_ec%Wo^Myz3w`+Jk6Yv)WWy7;OWiNf|o0~QkuHhIM?2Dhp(}vyid_;;d|f`{EKdO59j{Jx5Y@q7|K0LEP16 zmmbgGVB%*Vo&4mZa7FFmXD`s@Ws8p(Ny^=fP+^n&_gqda7jalDytu+uD=WyHe3XSm z^@B?{1l{m0Ts|V8NpRJTE5f0stQ zJXz|`+5K9?FrjO_&AB5ePWxMU`SOE{(xrHuZiZ=i@m^`E3VNKf)$oCm;H$~kJ6C92 zfA-fA$+uhO4GL|u{61cNff&dN*&qkRLIG$!+JFL45DG>cQ3wh}VJIAJMG+_pMWYxL zi{kJL{jgO(1pK+JMf;bp)my9gPBT?4RShWm-(V3&eTp{gO{Nns!Z^YIs1DiK)@ z(|iX&QqwB=)|-zP!@B?j2tivvvrC>y$YiQ8JO|EWig34S5e4}73LR|h1ojALc1tL zUArhmYXSNb-2Fii8Ij}Yd*5<(49Lg%ZHV4+` zz*>Tpz!b_cJer9a|2rG(9AG{sd$s`V5=`QbLCmQHGEf2JDu7%CkgEW46@bnH$W;Kj z3LsYj3ykn0rWIt95-L9SDf>lEZV1-VMFCxudiBV+?}FkSFHtputrh0#)M zr(=fA9>QecyI(2HBzO$`1z?{7`z){=W~NZi;vQyV5~>J0ACtId&w`S(poCy1rJSNR zQ-VqO3A+-=K$W1O630J;No22t?3Iwc60%o9_DaZJ3E7F6`IIWk46eEgpPVwxA2W@Z zC#IXge-*QJt{Jm`wiR=5t^?Qwo)StmUX@9yfj-wjp9wZ%CgDEU;`3PwtOS-&>L`3u znUs3UwO{#|MBaKhv4p1#^9Qboup2Q64fUX*9yHX0hI-IY4;lzh3grTYc-9as!Q`7N z#Z<#pT%eT9w-NF- z!c4-GNx1}P>=H#D*M13VzXY{k!bK!2`4 ze+V{W5`Aleel|hOCWzUD{SB0>IND`k3$P8?3G4>;0{eiOlxv{y8YsL5(XPQ&a2+~! z9XfU$pR`6yqF2pObu;v*8T!)y=ptBvKwL`Rah}I4|J3wa#=F zIti9gZc-RiS26i;|2siXC+O(}J)NMZ6ZCX~o=(uy33@v5jx=KudOAT*C+O*fbKV8J z)&;xPg?Ft1vwyY)*a_?g_5%BWC6rru_wy;;a2mVeD(Hrc-H;J?daf0d$kh$Gx}lRj zltIc7%m{ps>w#xP52b@z3H}nwZMceip}JnEt{1B7h3a~tx?ZTR7jpGNu3qSNFOJ^@ zETP=Najp`?*GnHL>;r{;u&NJM^?|}ZP}m0w`|w&R2ASGACB@*y6r>7Jb?1aIy=H|m zPfSaJhXJ+>*s?Gx2OfFwr~x&=FF>VJ%g92Qx^u#qL&DTqlZmjdNdII<}C#lSBPWPnEoD2o|_U&#>j6@ZH1 zR|9Imd;zL7PzK`5Kztd9FN4>Lf=3J}4rBloV2&EB(g2SDRTfT#EM6sqd16`=^9vHg zB=&{y%U}|<%VOnfm_L4MfGx!!)(TMN@NNoXGVr;Q!!zlaUyvwfFG&oO&_H;kFo~FQ zP^lcml*91_sPfnr#3ZVahY0e}A9+|SkGm}awj_`Nl!cjcK!v{}D8SiPz2J64XwRj%htBhN(LziAkIXB~YsbYL#FYh*cWkkzy!8UKLCs zOk!tMaMd!H)_7C}t`~LKBXu|%>To92;Y_OIIcne$q%MQnm%$Da6a$YGCeg8Fa4MF; zIV32LX+5g~Gu1GOx|YFt)5Lui#w3&wwj_{&=`||@wk&4Ij3Q<)X(@QLFd1{&m;&=U zn7VUDFlq@NE1(Tff~tk*%VFx``C8bc2h<0@0oX>Ey(D9>t-x;$whd62s!b(ct7}t< z*Xo2VN7aG;>%yom+)s3&YF*rCIUw#ATx+^`rWQ~e=Iem12lEYpra*H{#+)UrvI1Iz z-wEgp6sGFIY1hN|8A(i{OL|z9EGD6f7}dfQnAZmCU=msMphjZ8CD>L#8=x)F4(J4P zWT^VM8*-S$Jxw3Ftq(Evp?d^Pffg`oiCIRr0^1qH9jbOs7h zjUl@+=rjgZ#&FsRzXnhXljw#q>;*yRzgL;SKAOP&*%Yg#V-oizQz~&MF@+sBg&jAA zlSa%@fKhFr4kpo6Q&3LKUjeiLT7usSb7sy4Y+Ilm&>b&JZ*JS^;f< zLR1?napxo`i%Im~22Q38?tmU9ahI@xEH0%&go&8R}gP z{?%0CZz-$c4zL=|A>mPnQ7uej2MJpTXb!XjS_7Sc6e^touM8RRI*>tBN@obnXMw$l zv4}zZMQbsG_>0zJM*8ny%pIgC%wObe3gPFbE@re&@nD{q7Ql@Etpc_h_!l!4;|RNj zz9ZrdeRDGU=ZkEjLwtK?Ng*fd|6_Ulu@;*CW2u-C79Crh`u|w@+W%M@e?~+8_&Wd0 zv-mT*6#L3e2}|hD=&a5^mNNF0!l)sRqF_c?+<)fr{UthV8goq&G(<6)<w!#)iJa+7#3k+3})!YkeFx&GblPJYFkhsnkPqMJropyZgaB{ z*B3%*rgzA~1iDeyR1MRX%u zpf}lGMA;M1OcS-?l5t6{pubHz?UGDdh!=!dt*28pD{YH}_HcRNpZ1E{Ak-qn2Wef< zKVNAa9AxZ}JeIoGe_lwP10gD+{qu2;1xOM}A#>D+PLN{AKgm9nFbXdNDIqhj@lu5aq7)rVBmNA!xx&67zbH_G*{PyB9>R8Bh_w-0dLZL3mmt-Dr(fU*Jfq+(b1p|_9Kk}$z zBas(*?y6C~WSwtuXV{F2AF4-(oJA|wU)JtolPf0C0!0~>NLLo(8qY#|v5+cT(nBlu z?n?YGl_9$+Ytepg!%r3RR#k`=UWSA(xC&}lTU*~oGCfr&saP4QmNSs9ZynDM-`cHP zy^j#@fOSsUdjI8LE6&op|7)Mma&L|%!#)0p^#P%1O0vT-1KL+_mWGWBTIlqA#<9N) zE0p6&%%+y|9{%;QT*1^KW*hHC)A0pkkKG(aUiGRD_TIQI#-_PxqDAFd57v8FA(|Hx z$&J>O<>ZgYwCl#&()tgEj)<7#trY9>j~Jn|xvNj;1+5(&^kgCW0E3jr9ke_md+W{a zz2vvbRrJaP^1b1G!y_>}~0L|&^b^)@ad+20>rIF9$6O z2q{ew-N#5@s(Gu`K_zXkW(6VzUGwtzSZ0u6`2bO`Z|9VDty_6NdCEEXnMXWwb49c# zDmf#?v9}F5@p=!CEZgTIU zyK2k@V}zLVi2PYMr{?9Vc=247Z=Tv!R~%GsXW}hBY>tAg+8k7jIxTux@_37RN5=*Y zf-J6u*q0$Cw@a7rotW69SclFIA>J=OOIv7XGE{r6g;cRgamH>R3CYU2h&r|1Q`+_7 z%7-3y&aJQVvXGlEoAyg}@cG{B-SkpFT_zi~_^Hqd$qmFC~zGUT2i5m^BwXkh4a#TQZC%}M?n7snc3J;4mG zURz_N(52DizW(?sL|=gK7GpB&O9L&(ijCPM9~p!!EjF-{lGC+$MxHgaji0OZc66^U z?+|~o3h~sGAw#xPS>1wGl3x*W5Zq^9*GvsqY%y28h%_hBe?`TB{29@V%aG{3y8@f8 zpA^{iz#P?lX+@9E$*a^=WxcHsC*DeaqlLHBbFRd zl3fboJ(3W|xmQNzMq9~wHaeSxcum^MFART=*~qhPGWeUjQSI4Le^mUJL}HWbaO1lr zJR-w8G(J#!yEd0MNf8&zJ1c||H>woG4;G&uuN2x}F~ufV-a~vfV--Q$RQeA$)g<-2 zK*g&UN30N;7(15ik8F`LW!6G%TE{L(F(g~bpJd;UxIUOLGcU03UCQ0(&}fb>cV+Z1 z!6%bBHMEv^bJ!NGMs6qo1)&fWhPL46*1z5g-Yt}jh)2eM|AOM*FCJ#`LtMp@ur~kk zjhO!Pa2EOVLcs!$o`*-b^Pk809sKA{0pF58zJHI#|FJZ&Rb>i~_(LEC9$gH}tzm)x zS3KueU{N#_!Z9*NV)wHVl_!%*NH-^ikc5RJJFT^qZ*7R+u(Z{DT0iF0YoHcS%DPL{ zmN7pP*=eKw&l8*WAD`G1?2vp^XHhiIRVsiG2g=8j<{!@wBP+x~rE$=x92_(bPEHOk z9swR6Zf+j>LVi90G5VrKVsuea@g)k<;u3O_qM{5nhMc0(QkA8PrPVdnl{FQVmnsuM zNSvIUJX}1&JUqh6;-ccp|K+dw4kV2biAI92f0UER6fBODi<^fRPq-+6$RrAdOr_9h zRNNENPCSmNf;1r+Eej4|*8oo0NV@i(?9*Iwmi28S%z-cRI_snMa`T9aEm|zDps1w0 zR7F=$-@tIWk(ITL?aEbl_HHb94^J;|pACUQ!5c$DH$}(9Zi|agNZgl{oU%XlK-%FW zIk`vkjvdc0K2uV9_FP$c#rX>j7aK2KzS4A~z2jzQ*RAfJd-n$)Jbd(c=*j5V%U7@8 zynXk6{Oh;xKPD!B{+gO5>LMWu>7TFvv@Sth7nw?>P&tXZNaQ$Tf*_S9qs1X);mR2h zDJ-kKhl_5ReY(DlTTX}hMPz-{0FS7=?x@07qBN-Nf3L8;|3{VmDeT{M4dK)C0twjL z+Swwatbcv{_y3;r)QSYTkO?|NA;}`LAc-PK`u|7l|FI+X1o2Twc=ITN$P7&}8*~fB z+#V`uy*Ju9@?qazM)E1?wF_0pcPBkxutSc2?+;&(o%+w2Ems>I4k%uc3i0sgb~*Q2 zV)YW8n~CQpnLfkC#z&6|kiK=sGq%g7KMK^mbm2(-*rPjBYciDmM*I#=|2}l+$L@Vn zD%W{_)(?jcoNV54xTpxY4oBcUqy8KuDsKh#+@y315+OwJC+N@Pk?m6ss(-Y-0o0DscOpQW2|GIH7 ziavGJtx{?^&-10y$Jg~V@2-)I6|ukIIyAn0N=n14Na6{-xICtL~L+-@ku*D%)!&c=tp0I?cH| zK6f9_xR!-xKF*weo_NSJ{nhT5Rr4r!r$V{iWCq6*mtC6^d^qM&Y;(|T+@nkTb_}F9 zuWWxSI2l`U|F6(xAKuK3`6_-Awrw8SB66ck*7)oBj5~rfJI*r3r&lp|Hf-XGQIC4I zJy_ekDo_90?wvZ>zrODKyujw{xRP^=-Q-mEx5J%@tM;e3O^8(QT(6;Cdhg5zRok=Q z9rLc$OZk}9F7B$xes)!SGCFQ(9v?K`6 zd7f&tdva^Ko-%8_!I8ezj%Igex}}p7rqU(OaZmV|eR#E#pZ}q2hkJ2jZb|d*FCRWH zf70)?BFsVI)%)=3TYTK>O>?D=h~F+ZKh*QN&-BE7y`_Ge-{)KPjhV7Nvv!91KQ@1N zXUk5>WQ!Hv_QHqk_m17~zHsT(t{op|F27H!^wlf8W+3Vlf8tP%7R#(N+B`kBZa6SJ zJn-9|-v=)#%p;#CbzdfPo~Y-}Ro3ogkBALPKYq5Z>9KM7w1-r=?swmoC#*BeNGp_U z8ob_no?Otsuo7=waIS#_=aAo)d35dV=O10tg(!OZ&8ZUaHi=N5=acE_j{|?pwKr_2 z@%rxd;QsKh-HulusZ}+MZ2r{vjbr`!kWFOpu2T4ZWzi@lw`b-wL=E>pYFjKH1qY)^gDPNN1hJ z+0a^%hP^i4>TP^{X;-|BT+^N(=;0Xo#@lxNQLPVG&9tPeDTdR}?#*b$R(N$qZj283{JJ&i zLS;rlT$Jb5ujh7;O}{Mhm2(`>EeyD5$o&4%VBlB;`FOjneR=rlRsJ3PpC3t=Z~Ff1 zuBvUeck2}S+0ZuIqU1i#=9}Gr?J-YlN-jAn_ESGvM0>brV7XhC{o#csmy3(@y_NFq zg0~&^UUcEA``?{_t4sCwJJohMe zc4t>lq`b&-w+@qw2Y>ATq7m9V(Q@`|rT&qy`X>$&Pu6m8Stc)Q_>%J|^A6iKVz-&k z>1C-k>$@+c^mRAo?WHZ4M>{36e+jN#ojMa)+9qdOT`hkhv#2L{_pQLRi3$^w-wJPM zm-SAC88dUsqn(-$>~5c1Q@Anh;-Y7BbN5$gJ0E*w8{_Vp@vBWG@nwxky&vss<1OA1 zquG_uZIkEG3njUEWNDVWY5cj!M>&O<;l-c%f0hP_&m-n;`|q_P@n`2z$Kj5x)X1Bn z+iVsw$caZzp1t-lSaDzRdz+C{RyjeBAHNh;tV-BW`}D73TY07~vnn;BCu%{cbK{eJ z2?M=Hzh8Q8XUN=XQB|SZVcL6tjjESx{+n+~GR}jkpSwTZ5j(PM(wCiS^IbSnW=-zf zA5}fdlt3qr@-2<;?@3(lx-BQkAvMv|#PaD%j`4Ey8u+AmQRjeMQxn&7omc*7r|N-X zw$X>pGNUU#Y_Xd#kz*cANLjOe#VM_!#jC+ak6rdgfio!>i7s-EBe zJ6?9s!b`(<9>sVW1{{?{kq_OJ`n?(i6RPf}w|pmfp<^k~!+ldG_g!lDXWj0rS3=H4lp)Tr(@b(_~nBih1DP z^N6Q%UdLBTv1yAZYApYLSk&xqf2Q?t#w=8!F)!h@`KN1VWG^om*IuZ4vbaJxXUW*d z-tmERKE}DS`QHa0KDcI6wQ0DeAy)PH;DqHXrP*(Wv#N?|$~h+rUwt-oOV+zhJ^YPF zxwxe6fAVaC=hOU9{F6_|uWl8&yjS%wv-QOgZ0akqaVBDnAYZRy5fHCPDeY2%^E+)8x@v_9g@DI zFEFf9xMTLc__V&`x)`O(CGuPH&%e`X)ZFyp$Cm{ouMT?KAKrR?@AfS@dmo;E+;%st z(`YvMOV*Y}a#D&(b+<*eNHUV=q$ArzBlA#X!Q9%Uoo7?e$ft&NEivVmeHps3FezJo zOqW}Bcu&$>cjv#eR3O6IBM=u1)N4qrAT zRl7%VkVF#{PVCEIq>0z4JH-gNEA#ec6b80;lbxI*ZqbSsxrpxJ`Xb$Ub3nZ8*J}ye z!2?gY;3BLM~@Y3(Ce4)S#ECK z9h}CpZkIi@QXpt7m}h$3LF$z5f|Bj7`m1bZ`(>xB?dg#VZN^5Oifjs!XE_R~k>d91 zn>2Xj<@P8K1)1wF5pq>3)W6gp@Saaxx!ud*dqHN`FPgQ_RbwB@&mT62zeW^2*tzFy z#-and5%g_x$2HG?1({==W)EY^ z_C5J39 zTu8sZS=|%eos@d#JmTQK&}n4h8M^I{POd#=Aq=&VBlTKigFnqXhc6Zkwm2yb(j~2FB0!@mTNX~ga^xIi67i*A11azs-#DM^p%4{%zN^M z<7fZcXjZHjzEMu9O*69_d8b(UGB`eX)MvnH+lM#Wx?04?|**(u%`CW_U$_( zx&C@`=~ni|O^c_pvn7^kE8i=PN*1db&yb*h*w$6Qtul5vY_K-jMcbw$3`t`N>t6^X1~dtUwM))j|lX*MO|RxOBlFNPBZKDc1ocZ7>(Tt*zy2vBWE{Z=2n*d9ZXz2N6dWUKYP>AM^zXl-aG_QI{GNzfI7BfOY1k>g PiRJ$v{=Z~%Jo4WFms%02 literal 0 HcwPel00001 diff --git a/library/custom_template/ckeditor/_samples/assets/output_xhtml.css b/library/custom_template/ckeditor/_samples/assets/output_xhtml.css new file mode 100644 index 000000000..a17d54abc --- /dev/null +++ b/library/custom_template/ckeditor/_samples/assets/output_xhtml.css @@ -0,0 +1,204 @@ +/* + * Copyright (c) 2003-2011, CKSource - Frederico Knabben. All rights reserved. + * For licensing, see LICENSE.html or http://ckeditor.com/license + * + * Styles used by the XHTML 1.1 sample page (xhtml.html). + */ + +/** + * Basic definitions for the editing area. + */ +body +{ + font-family: Arial, Verdana, sans-serif; + font-size: 80%; + color: #000000; + background-color: #ffffff; + padding: 5px; + margin: 0px; +} + +/** + * Core styles. + */ + +.Bold +{ + font-weight: bold; +} + +.Italic +{ + font-style: italic; +} + +.Underline +{ + text-decoration: underline; +} + +.StrikeThrough +{ + text-decoration: line-through; +} + +.Subscript +{ + vertical-align: sub; + font-size: smaller; +} + +.Superscript +{ + vertical-align: super; + font-size: smaller; +} + +/** + * Font faces. + */ + +.FontComic +{ + font-family: 'Comic Sans MS'; +} + +.FontCourier +{ + font-family: 'Courier New'; +} + +.FontTimes +{ + font-family: 'Times New Roman'; +} + +/** + * Font sizes. + */ + +.FontSmaller +{ + font-size: smaller; +} + +.FontLarger +{ + font-size: larger; +} + +.FontSmall +{ + font-size: 8pt; +} + +.FontBig +{ + font-size: 14pt; +} + +.FontDouble +{ + font-size: 200%; +} + +/** + * Font colors. + */ +.FontColor1 +{ + color: #ff9900; +} + +.FontColor2 +{ + color: #0066cc; +} + +.FontColor3 +{ + color: #ff0000; +} + +.FontColor1BG +{ + background-color: #ff9900; +} + +.FontColor2BG +{ + background-color: #0066cc; +} + +.FontColor3BG +{ + background-color: #ff0000; +} + +/** + * Indentation. + */ + +.Indent1 +{ + margin-left: 40px; +} + +.Indent2 +{ + margin-left: 80px; +} + +.Indent3 +{ + margin-left: 120px; +} + +/** + * Alignment. + */ + +.JustifyLeft +{ + text-align: left; +} + +.JustifyRight +{ + text-align: right; +} + +.JustifyCenter +{ + text-align: center; +} + +.JustifyFull +{ + text-align: justify; +} + +/** + * Other. + */ + +code +{ + font-family: courier, monospace; + background-color: #eeeeee; + padding-left: 1px; + padding-right: 1px; + border: #c0c0c0 1px solid; +} + +kbd +{ + padding: 0px 1px 0px 1px; + border-width: 1px 2px 2px 1px; + border-style: solid; +} + +blockquote +{ + color: #808080; +} diff --git a/library/custom_template/ckeditor/_samples/assets/swfobject.js b/library/custom_template/ckeditor/_samples/assets/swfobject.js new file mode 100644 index 000000000..a3efbe627 --- /dev/null +++ b/library/custom_template/ckeditor/_samples/assets/swfobject.js @@ -0,0 +1,18 @@ +/** + * SWFObject v1.5: Flash Player detection and embed - http://blog.deconcept.com/swfobject/ + * + * SWFObject is (c) 2007 Geoff Stearns and is released under the MIT License: + * http://www.opensource.org/licenses/mit-license.php + * + */ +/* +Copyright (c) 2007 Geoff Stearns + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +/*jsl:ignoreall*/ +if(typeof deconcept=="undefined"){var deconcept=new Object();}if(typeof deconcept.util=="undefined"){deconcept.util=new Object();}if(typeof deconcept.SWFObjectUtil=="undefined"){deconcept.SWFObjectUtil=new Object();}deconcept.SWFObject=function(_1,id,w,h,_5,c,_7,_8,_9,_a){if(!document.getElementById){return;}this.DETECT_KEY=_a?_a:"detectflash";this.skipDetect=deconcept.util.getRequestParameter(this.DETECT_KEY);this.params=new Object();this.variables=new Object();this.attributes=new Array();if(_1){this.setAttribute("swf",_1);}if(id){this.setAttribute("id",id);}if(w){this.setAttribute("width",w);}if(h){this.setAttribute("height",h);}if(_5){this.setAttribute("version",new deconcept.PlayerVersion(_5.toString().split(".")));}this.installedVer=deconcept.SWFObjectUtil.getPlayerVersion();if(!window.opera&&document.all&&this.installedVer.major>7){deconcept.SWFObject.doPrepUnload=true;}if(c){this.addParam("bgcolor",c);}var q=_7?_7:"high";this.addParam("quality",q);this.setAttribute("useExpressInstall",false);this.setAttribute("doExpressInstall",false);var _c=(_8)?_8:window.location;this.setAttribute("xiRedirectUrl",_c);this.setAttribute("redirectUrl","");if(_9){this.setAttribute("redirectUrl",_9);}};deconcept.SWFObject.prototype={useExpressInstall:function(_d){this.xiSWFPath=!_d?"expressinstall.swf":_d;this.setAttribute("useExpressInstall",true);},setAttribute:function(_e,_f){this.attributes[_e]=_f;},getAttribute:function(_10){return this.attributes[_10];},addParam:function(_11,_12){this.params[_11]=_12;},getParams:function(){return this.params;},addVariable:function(_13,_14){this.variables[_13]=_14;},getVariable:function(_15){return this.variables[_15];},getVariables:function(){return this.variables;},getVariablePairs:function(){var _16=new Array();var key;var _18=this.getVariables();for(key in _18){_16[_16.length]=key+"="+_18[key];}return _16;},getSWFHTML:function(){var _19="";if(navigator.plugins&&navigator.mimeTypes&&navigator.mimeTypes.length){if(this.getAttribute("doExpressInstall")){this.addVariable("MMplayerType","PlugIn");this.setAttribute("swf",this.xiSWFPath);}_19="0){_19+="flashvars=\""+_1c+"\"";}_19+="/>";}else{if(this.getAttribute("doExpressInstall")){this.addVariable("MMplayerType","ActiveX");this.setAttribute("swf",this.xiSWFPath);}_19="";_19+="";var _1d=this.getParams();for(var key in _1d){_19+="";}var _1f=this.getVariablePairs().join("&");if(_1f.length>0){_19+="";}_19+="";}return _19;},write:function(_20){if(this.getAttribute("useExpressInstall")){var _21=new deconcept.PlayerVersion([6,0,65]);if(this.installedVer.versionIsValid(_21)&&!this.installedVer.versionIsValid(this.getAttribute("version"))){this.setAttribute("doExpressInstall",true);this.addVariable("MMredirectURL",escape(this.getAttribute("xiRedirectUrl")));document.title=document.title.slice(0,47)+" - Flash Player Installation";this.addVariable("MMdoctitle",document.title);}}if(this.skipDetect||this.getAttribute("doExpressInstall")||this.installedVer.versionIsValid(this.getAttribute("version"))){var n=(typeof _20=="string")?document.getElementById(_20):_20;n.innerHTML=this.getSWFHTML();return true;}else{if(this.getAttribute("redirectUrl")!=""){document.location.replace(this.getAttribute("redirectUrl"));}}return false;}};deconcept.SWFObjectUtil.getPlayerVersion=function(){var _23=new deconcept.PlayerVersion([0,0,0]);if(navigator.plugins&&navigator.mimeTypes.length){var x=navigator.plugins["Shockwave Flash"];if(x&&x.description){_23=new deconcept.PlayerVersion(x.description.replace(/([a-zA-Z]|\s)+/,"").replace(/(\s+r|\s+b[0-9]+)/,".").split("."));}}else{if(navigator.userAgent&&navigator.userAgent.indexOf("Windows CE")>=0){var axo=1;var _26=3;while(axo){try{_26++;axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash."+_26);_23=new deconcept.PlayerVersion([_26,0,0]);}catch(e){axo=null;}}}else{try{var axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7");}catch(e){try{var axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");_23=new deconcept.PlayerVersion([6,0,21]);axo.AllowScriptAccess="always";}catch(e){if(_23.major==6){return _23;}}try{axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash");}catch(e){}}if(axo!=null){_23=new deconcept.PlayerVersion(axo.GetVariable("$version").split(" ")[1].split(","));}}}return _23;};deconcept.PlayerVersion=function(_29){this.major=_29[0]!=null?parseInt(_29[0]):0;this.minor=_29[1]!=null?parseInt(_29[1]):0;this.rev=_29[2]!=null?parseInt(_29[2]):0;};deconcept.PlayerVersion.prototype.versionIsValid=function(fv){if(this.majorfv.major){return true;}if(this.minorfv.minor){return true;}if(this.rev=0;i--){_2f[i].style.display="none";for(var x in _2f[i]){if(typeof _2f[i][x]=="function"){_2f[i][x]=function(){};}}}};if(deconcept.SWFObject.doPrepUnload){if(!deconcept.unloadSet){deconcept.SWFObjectUtil.prepUnload=function(){__flash_unloadHandler=function(){};__flash_savedUnloadHandler=function(){};window.attachEvent("onunload",deconcept.SWFObjectUtil.cleanupSWFs);};window.attachEvent("onbeforeunload",deconcept.SWFObjectUtil.prepUnload);deconcept.unloadSet=true;}}if(!document.getElementById&&document.all){document.getElementById=function(id){return document.all[id];};}var getQueryParamValue=deconcept.util.getRequestParameter;var FlashObject=deconcept.SWFObject;var SWFObject=deconcept.SWFObject; diff --git a/library/custom_template/ckeditor/_samples/autogrow.html b/library/custom_template/ckeditor/_samples/autogrow.html new file mode 100644 index 000000000..fa65620df --- /dev/null +++ b/library/custom_template/ckeditor/_samples/autogrow.html @@ -0,0 +1,103 @@ + + + + + AutoGrow Plugin — CKEditor Sample + + + + + + +

    + CKEditor Sample — Using AutoGrow Plugin +

    +
    +

    + This sample shows how to configure CKEditor instances to use the + autogrow plugin that lets the editor window expand and shrink + depending on the amount and size of content entered in the editing area. +

    +

    + In its default implementation the AutoGrow feature can expand the + CKEditor window infinitely in order to avoid introducing scrollbars to the editing area. +

    +

    + It is also possible to set a maximum height for the editor window. Once CKEditor + editing area reaches the value in pixels specified in the autoGrow_maxHeight + attribute, scrollbars will be added and the editor window will no longer expand. +

    +

    + To add a CKEditor instance using the autogrow plugin and its + autoGrow_maxHeight attribute, insert the following JavaScript call to your code: +

    +
    CKEDITOR.replace( 'textarea_id',
    +	{
    +		extraPlugins : 'autogrow',
    +		autoGrow_maxHeight : 800
    +	});
    +

    + Note that textarea_id in the code above is the id attribute of + the <textarea> element to be replaced with CKEditor. The maximum height should + be given in pixels. +

    +
    + +
    + +
    +
    +

    + + + +

    +

    + + + +

    +

    + +

    +
    + + + diff --git a/library/custom_template/ckeditor/_samples/divreplace.html b/library/custom_template/ckeditor/_samples/divreplace.html new file mode 100644 index 000000000..c8f14308b --- /dev/null +++ b/library/custom_template/ckeditor/_samples/divreplace.html @@ -0,0 +1,149 @@ + + + + + Replace DIV — CKEditor Sample + + + + + + + + + +

    + CKEditor Sample — Replace DIV with CKEditor on the Fly +

    +
    +

    + This sample shows how to automatically replace <div> elements + with a CKEditor instance on the fly, following user's doubleclick. The content + that was previously placed inside the <div> element will now + be moved into CKEditor editing area. +

    +

    + For details on how to create this setup check the source code of this sample page. +

    +
    + +
    + +
    +

    + Double-click any of the following <div> elements to transform them into + editor instances.

    +
    +

    + Part 1

    +

    + Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Cras et ipsum quis mi + semper accumsan. Integer pretium dui id massa. Suspendisse in nisl sit amet urna + rutrum imperdiet. Nulla eu tellus. Donec ante nisi, ullamcorper quis, fringilla + nec, sagittis eleifend, pede. Nulla commodo interdum massa. Donec id metus. Fusce + eu ipsum. Suspendisse auctor. Phasellus fermentum porttitor risus. +

    +
    +
    +

    + Part 2

    +

    + Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Cras et ipsum quis mi + semper accumsan. Integer pretium dui id massa. Suspendisse in nisl sit amet urna + rutrum imperdiet. Nulla eu tellus. Donec ante nisi, ullamcorper quis, fringilla + nec, sagittis eleifend, pede. Nulla commodo interdum massa. Donec id metus. Fusce + eu ipsum. Suspendisse auctor. Phasellus fermentum porttitor risus. +

    +

    + Donec velit. Mauris massa. Vestibulum non nulla. Nam suscipit arcu nec elit. Phasellus + sollicitudin iaculis ante. Ut non mauris et sapien tincidunt adipiscing. Vestibulum + vitae leo. Suspendisse nec mi tristique nulla laoreet vulputate. +

    +
    +
    +

    + Part 3

    +

    + Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Cras et ipsum quis mi + semper accumsan. Integer pretium dui id massa. Suspendisse in nisl sit amet urna + rutrum imperdiet. Nulla eu tellus. Donec ante nisi, ullamcorper quis, fringilla + nec, sagittis eleifend, pede. Nulla commodo interdum massa. Donec id metus. Fusce + eu ipsum. Suspendisse auctor. Phasellus fermentum porttitor risus. +

    +
    + + + diff --git a/library/custom_template/ckeditor/_samples/enterkey.html b/library/custom_template/ckeditor/_samples/enterkey.html new file mode 100644 index 000000000..03cce0825 --- /dev/null +++ b/library/custom_template/ckeditor/_samples/enterkey.html @@ -0,0 +1,115 @@ + + + + + ENTER Key Configuration — CKEditor Sample + + + + + + + +

    + CKEditor Sample — ENTER Key Configuration +

    +
    +

    + This sample shows how to configure the Enter and Shift+Enter keys + to perform actions specified in the + enterMode + and shiftEnterMode + parameters, respectively. + You can choose from the following options: +

    +
      +
    • ENTER_P – new <p> paragraphs are created;
    • +
    • ENTER_BR – lines are broken with <br> elements;
    • +
    • ENTER_DIV – new <div> blocks are created.
    • +
    +

    + The sample code below shows how to configure CKEditor to create a <div> block when Enter key is pressed. +

    +
    CKEDITOR.replace( 'textarea_id',
    +	{
    +		enterMode : CKEDITOR.ENTER_DIV
    +	});
    +

    + Note that textarea_id in the code above is the id attribute of + the <textarea> element to be replaced. +

    +
    + + +
    + +
    +
    + When Enter is pressed:
    + +
    +
    + When Shift+Enter is pressed:
    + +
    +
    +
    +

    +
    + +

    +

    + +

    +
    + + + diff --git a/library/custom_template/ckeditor/_samples/fullpage.html b/library/custom_template/ckeditor/_samples/fullpage.html new file mode 100644 index 000000000..3a5d368f2 --- /dev/null +++ b/library/custom_template/ckeditor/_samples/fullpage.html @@ -0,0 +1,75 @@ + + + + + Full Page Editing — CKEditor Sample + + + + + + +

    + CKEditor Sample — Full Page Editing +

    +
    +

    + This sample shows how to configure CKEditor to edit entire HTML pages, from the + <html> tag to the </html> tag. +

    +

    + CKEditor is inserted with a JavaScript call using the following code: +

    +
    CKEDITOR.replace( 'textarea_id',
    +	{
    +		fullPage : true
    +	});
    +

    + Note that textarea_id in the code above is the id attribute of + the <textarea> element to be replaced. +

    +
    + + +
    + +
    +
    + + + +

    + +

    +
    + + + diff --git a/library/custom_template/ckeditor/_samples/index.html b/library/custom_template/ckeditor/_samples/index.html new file mode 100644 index 000000000..9b23eb7b2 --- /dev/null +++ b/library/custom_template/ckeditor/_samples/index.html @@ -0,0 +1,96 @@ + + + + + CKEditor Samples + + + + +

    + CKEditor Samples Site +

    +

    + Basic Samples +

    + +

    + Basic Customization +

    +
      +
    • Skins
      + Changing the CKEditor skin by adjusting a single configuration option. +
    • +
    • User Interface color
      + Changing CKEditor User Interface color and adding a toolbar button that lets the user set the UI color. +
    • +
    • User Interface languages
      + Changing CKEditor User Interface language and adding a drop-down list that lets the user choose the UI language. +
    • +
    • AutoGrow plugin
      + Using the AutoGrow plugin in order to make the editor grow to fit the size of its content. +
    • +
    +

    + Advanced Samples +

    + + + + diff --git a/library/custom_template/ckeditor/_samples/jqueryadapter.html b/library/custom_template/ckeditor/_samples/jqueryadapter.html new file mode 100644 index 000000000..037e0f940 --- /dev/null +++ b/library/custom_template/ckeditor/_samples/jqueryadapter.html @@ -0,0 +1,99 @@ + + + + + jQuery Adapter — CKEditor Sample + + + + + + + + + +

    + CKEditor Sample — Using jQuery Adapter +

    +
    +

    + This sample shows how to load CKEditor and configure it using the + jQuery adapter. + In this case the jQuery adapter is responsible for transforming a <textarea> + element into a CKEditor instance and setting the configuration of the toolbar. +

    +

    + CKEditor instance with custom configuration set in jQuery can be inserted with the + following JavaScript code: +

    +
    $(function()
    +{
    +	var config = {
    +		skin:'v2'
    +	};
    +
    +	$('.textarea_class').ckeditor(config);
    +});
    +

    + Note that textarea_class in the code above is the + class attribute of the <textarea> element to be replaced with + CKEditor. Any other jQuery selector can be used to match the target element. +

    +
    + + +
    + +
    + +
    +

    + + +

    +

    + +

    +
    + + + diff --git a/library/custom_template/ckeditor/_samples/output_for_flash.html b/library/custom_template/ckeditor/_samples/output_for_flash.html new file mode 100644 index 000000000..c0bd84284 --- /dev/null +++ b/library/custom_template/ckeditor/_samples/output_for_flash.html @@ -0,0 +1,274 @@ + + + + + Output for Flash — CKEditor Sample + + + + + + + + +

    + CKEditor Sample — Producing Flash Compliant HTML Output +

    +
    +

    + This sample shows how to configure CKEditor to output + HTML code that can be used with + + Adobe Flash. + The code will contain a subset of standard HTML elements like <b>, + <i>, and <p> as well as HTML attributes. +

    +

    + To add a CKEditor instance outputting Flash compliant HTML code, load the editor using a standard + JavaScript call, and define CKEditor features to use HTML elements and attributes. +

    +

    + For details on how to create this setup check the source code of this sample page. +

    +
    +

    + To see how it works, create some content in the editing area of CKEditor on the left + and send it to the Flash object on the right side of the page by using the + Send to Flash button. +

    + + +
    + +
    +
    + + + + + +
    + + + + +
    + + + + diff --git a/library/custom_template/ckeditor/_samples/output_html.html b/library/custom_template/ckeditor/_samples/output_html.html new file mode 100644 index 000000000..cc3d436df --- /dev/null +++ b/library/custom_template/ckeditor/_samples/output_html.html @@ -0,0 +1,286 @@ + + + + + HTML Compliant Output — CKEditor Sample + + + + + + +

    + CKEditor Sample — Producing HTML Compliant Output +

    +
    +

    + This sample shows how to configure CKEditor to output valid + HTML 4.01 code. + Traditional HTML elements like <b>, + <i>, and <font> are used in place of + <strong>, <em>, and CSS styles. +

    +

    + To add a CKEditor instance outputting legacy HTML 4.01 code, load the editor using a standard + JavaScript call, and define CKEditor features to use the HTML compliant elements and attributes. +

    +

    + A snippet of the configuration code can be seen below; check the source of this page for + full definition: +

    +
    CKEDITOR.replace( 'textarea_id',
    +	{
    +		coreStyles_bold	: { element : 'b' },
    +		coreStyles_italic : { element : 'i' },
    +
    +		fontSize_style :
    +			{
    +				element		: 'font',
    +				attributes	: { 'size' : '#(size)' }
    +			}
    +
    +		// More definitions follow.
    +	});
    +
    + + +
    + +
    +
    +

    + + + +

    +

    + +

    +
    + + + diff --git a/library/custom_template/ckeditor/_samples/output_xhtml.html b/library/custom_template/ckeditor/_samples/output_xhtml.html new file mode 100644 index 000000000..bccc90d89 --- /dev/null +++ b/library/custom_template/ckeditor/_samples/output_xhtml.html @@ -0,0 +1,181 @@ + + + + + XHTML Compliant Output — CKEditor Sample + + + + + + +

    + CKEditor Sample — Producing XHTML Compliant Output +

    +
    +

    + This sample shows how to configure CKEditor to output valid + XHTML 1.1 code. + Deprecated elements (<font>, <u>) or attributes + (size, face) will be replaced with XHTML compliant code. +

    +

    + To add a CKEditor instance outputting valid XHTML code, load the editor using a standard + JavaScript call and define CKEditor features to use the XHTML compliant elements and styles. +

    +

    + A snippet of the configuration code can be seen below; check the source of this page for + full definition: +

    +
    CKEDITOR.replace( 'textarea_id',
    +	{
    +		contentsCss : 'assets/output_xhtml.css',
    +
    +		coreStyles_bold	: { element : 'span', attributes : {'class': 'Bold'} },
    +		coreStyles_italic : { element : 'span', attributes : {'class': 'Italic'} },
    +
    +		// More definitions follow.
    +	});
    +
    + + +
    + +
    +
    +

    + + + +

    +

    + +

    +
    + + + diff --git a/library/custom_template/ckeditor/_samples/php/advanced.php b/library/custom_template/ckeditor/_samples/php/advanced.php new file mode 100644 index 000000000..2b91720c6 --- /dev/null +++ b/library/custom_template/ckeditor/_samples/php/advanced.php @@ -0,0 +1,120 @@ + + + + + Setting Configuration Options — CKEditor Sample + + + + +

    + CKEditor Sample — Setting Configuration Options +

    +

    + This sample shows how to insert a CKEditor instance with custom configuration options. +

    +

    + To set configuration options, use the config property. To set the attributes of a <textarea> element (which is displayed instead of CKEditor in unsupported browsers), use the textareaAttributes property. +

    +
    +<?php
    +// Include the CKEditor class.
    +include_once "ckeditor/ckeditor.php";
    +
    +// Create a class instance.
    +$CKEditor = new CKEditor();
    +
    +// Path to the CKEditor directory.
    +$CKEditor->basePath = '/ckeditor/';
    +
    +// Set global configuration (used by every instance of CKEditor).
    +$CKEditor->config['width'] = 600;
    +
    +// Change default textarea attributes.
    +$CKEditor->textareaAttributes = array("cols" => 80, "rows" => 10);
    +
    +// The initial value to be displayed in the editor.
    +$initialValue = 'This is some sample text.';
    +
    +// Create the first instance.
    +$CKEditor->editor("textarea_id", $initialValue);
    +?>
    +

    + Note that textarea_id in the code above is the name attribute of + the <textarea> element to be created. +

    + + +
    + +
    +
    + +returnOutput = true; + +// Path to the CKEditor directory, ideally use an absolute path instead of a relative dir. +// $CKEditor->basePath = '/ckeditor/' +// If not set, CKEditor will try to detect the correct path. +$CKEditor->basePath = '../../'; + +// Set global configuration (will be used by all instances of CKEditor). +$CKEditor->config['width'] = 600; + +// Change default textarea attributes. +$CKEditor->textareaAttributes = array("cols" => 80, "rows" => 10); + +// The initial value to be displayed in the editor. +$initialValue = '

    This is some sample text. You are using CKEditor.

    '; + +// Create the first instance. +$code = $CKEditor->editor("editor1", $initialValue); + +echo $code; +?> +
    + +editor("editor2", $initialValue, $config); +?> +

    + +

    +
    + + + diff --git a/library/custom_template/ckeditor/_samples/php/events.php b/library/custom_template/ckeditor/_samples/php/events.php new file mode 100644 index 000000000..4d3446d38 --- /dev/null +++ b/library/custom_template/ckeditor/_samples/php/events.php @@ -0,0 +1,153 @@ + + + + + Adding Event Handlers — CKEditor Sample + + + + +

    + CKEditor Sample — Adding Event Handlers +

    +
    +

    + This sample shows how to add event handlers to CKEditor with PHP. +

    +

    + A snippet of the configuration code can be seen below; check the source code of this page for + the full definition: +

    +
    <?php
    +// Include the CKEditor class.
    +include("ckeditor/ckeditor.php");
    +
    +// Create a class instance.
    +$CKEditor = new CKEditor();
    +
    +// Path to the CKEditor directory.
    +$CKEditor->basePath = '/ckeditor/';
    +
    +// The initial value to be displayed in the editor.
    +$initialValue = 'This is some sample text.';
    +
    +// Add event handler, instanceReady is fired when editor is loaded.
    +$CKEditor->addEventHandler('instanceReady', 'function (evt) {
    +	alert("Loaded editor: " + evt.editor.name);
    +}');
    +
    +// Create an editor instance.
    +$CKEditor->editor("editor1", $initialValue);
    +
    +
    + +
    + +
    +
    + +addGlobalEventHandler('dialogDefinition', $function); +} + +/** + * Adds a global event, will notify about an open dialog window. + */ +function CKEditorNotifyAboutOpenedDialog(&$CKEditor) { + $function = 'function (evt) { + alert("Loading a dialog window: " + evt.data.name); + }'; + + $CKEditor->addGlobalEventHandler('dialogDefinition', $function); +} + +// Include the CKEditor class. +include("../../ckeditor.php"); + +// Create a class instance. +$CKEditor = new CKEditor(); + +// Set a configuration option for all editors. +$CKEditor->config['width'] = 750; + +// Path to the CKEditor directory, ideally use an absolute path instead of a relative dir. +// $CKEditor->basePath = '/ckeditor/' +// If not set, CKEditor will try to detect the correct path. +$CKEditor->basePath = '../../'; + +// The initial value to be displayed in the editor. +$initialValue = '

    This is some sample text. You are using CKEditor.

    '; + +// Event that will be handled only by the first editor. +$CKEditor->addEventHandler('instanceReady', 'function (evt) { + alert("Loaded editor: " + evt.editor.name); +}'); + +// Create the first instance. +$CKEditor->editor("editor1", $initialValue); + +// Clear event handlers. Instances that will be created later will not have +// the 'instanceReady' listener defined a couple of lines above. +$CKEditor->clearEventHandlers(); +?> +
    + +editor("editor2", $initialValue, $config, $events); +?> +

    + +

    +
    + + + diff --git a/library/custom_template/ckeditor/_samples/php/index.html b/library/custom_template/ckeditor/_samples/php/index.html new file mode 100644 index 000000000..ceb3340d2 --- /dev/null +++ b/library/custom_template/ckeditor/_samples/php/index.html @@ -0,0 +1,47 @@ + + + + + + CKEditor Samples — PHP Integration + + + +

    + CKEditor Samples List for PHP +

    +

    + Basic Samples +

    + +

    + Advanced Samples +

    + + + + diff --git a/library/custom_template/ckeditor/_samples/php/replace.php b/library/custom_template/ckeditor/_samples/php/replace.php new file mode 100644 index 000000000..f7d49e882 --- /dev/null +++ b/library/custom_template/ckeditor/_samples/php/replace.php @@ -0,0 +1,87 @@ + + + + + Replace Selected Textarea Elements — CKEditor Sample + + + + +

    + CKEditor Sample — Replace Selected Textarea Elements Using PHP Code +

    +
    +

    + This sample shows how to replace a selected <textarea> element + with a CKEditor instance by using PHP code. +

    +

    + To replace a <textarea> element, place the following call at any point + after the <textarea> element: +

    +
    +<?php
    +// Include the CKEditor class.
    +include_once "ckeditor/ckeditor.php";
    +
    +// Create a class instance.
    +$CKEditor = new CKEditor();
    +
    +// Path to the CKEditor directory.
    +$CKEditor->basePath = '/ckeditor/';
    +
    +// Replace a textarea element with an id (or name) of "textarea_id".
    +$CKEditor->replace("textarea_id");
    +?>
    +

    + Note that textarea_id in the code above is the id attribute of + the <textarea> element to be replaced. +

    +
    + +
    + +
    +
    +

    + + +

    +

    + +

    +
    + + basePath = '/ckeditor/' + // If not set, CKEditor will try to detect the correct path. + $CKEditor->basePath = '../../'; + // Replace a textarea element with an id (or name) of "editor1". + $CKEditor->replace("editor1"); + ?> + + diff --git a/library/custom_template/ckeditor/_samples/php/replaceall.php b/library/custom_template/ckeditor/_samples/php/replaceall.php new file mode 100644 index 000000000..a4d9f7b31 --- /dev/null +++ b/library/custom_template/ckeditor/_samples/php/replaceall.php @@ -0,0 +1,88 @@ + + + + + Replace All Textarea Elements — CKEditor Sample + + + + +

    + CKEditor Sample — Replace All Textarea Elements Using PHP Code +

    +
    +

    + This sample shows how to replace all <textarea> elements + with CKEditor by using PHP code. +

    +

    + To replace all <textarea> elements, place the following call at any point + after the last <textarea> element: +

    +
    +<?php
    +// Include the CKEditor class.
    +include("ckeditor/ckeditor.php");
    +
    +// Create a class instance.
    +$CKEditor = new CKEditor();
    +
    +// Path to the CKEditor directory.
    +$CKEditor->basePath = '/ckeditor/';
    +
    +// Replace all textarea elements with CKEditor.
    +$CKEditor->replaceAll();
    +?>
    +
    + +
    + +
    +
    +

    + + +

    +

    + + +

    +

    + +

    +
    + + basePath = '/ckeditor/' + // If not set, CKEditor will try to detect the correct path. + $CKEditor->basePath = '../../'; + // Replace all textarea elements with CKEditor. + $CKEditor->replaceAll(); + ?> + + diff --git a/library/custom_template/ckeditor/_samples/php/standalone.php b/library/custom_template/ckeditor/_samples/php/standalone.php new file mode 100644 index 000000000..8151001e4 --- /dev/null +++ b/library/custom_template/ckeditor/_samples/php/standalone.php @@ -0,0 +1,83 @@ + + + + + Creating CKEditor Instances — CKEditor Sample + + + + +

    + CKEditor Sample — Creating CKEditor Instances +

    +
    +

    + This sample shows how to create a CKEditor instance with PHP. +

    +
    +<?php
    +include_once "ckeditor/ckeditor.php";
    +
    +// Create a class instance.
    +$CKEditor = new CKEditor();
    +
    +// Path to the CKEditor directory.
    +$CKEditor->basePath = '/ckeditor/';
    +
    +// Create a textarea element and attach CKEditor to it.
    +$CKEditor->editor("textarea_id", "This is some sample text");
    +?>
    +

    + Note that textarea_id in the code above is the id and name attribute of + the <textarea> element that will be created. +

    +
    + +
    + +
    + +
    +

    + +

    +

    + This is some sample text.

    '; + // Create a class instance. + $CKEditor = new CKEditor(); + // Path to the CKEditor directory, ideally use an absolute path instead of a relative dir. + // $CKEditor->basePath = '/ckeditor/' + // If not set, CKEditor will try to detect the correct path. + $CKEditor->basePath = '../../'; + // Create a textarea element and attach CKEditor to it. + $CKEditor->editor("editor1", $initialValue); + ?> + +

    +
    + + + diff --git a/library/custom_template/ckeditor/_samples/placeholder.html b/library/custom_template/ckeditor/_samples/placeholder.html new file mode 100644 index 000000000..b4c441ef3 --- /dev/null +++ b/library/custom_template/ckeditor/_samples/placeholder.html @@ -0,0 +1,81 @@ + + + + + Placeholder Plugin — CKEditor Sample + + + + + + +

    + CKEditor Sample — Using the Placeholder Plugin +

    +
    +

    + This sample shows how to configure CKEditor instances to use the + placeholder plugin that lets you insert read-only elements + into your content. To enter and modify read-only text, use the + Create Placeholder button and its matching dialog window. +

    +

    + To add a CKEditor instance that uses the placeholder plugin and a related + Create Placeholder toolbar button, insert the following JavaScript + call to your code: +

    +
    CKEDITOR.replace( 'textarea_id',
    +	{
    +		extraPlugins : 'placeholder',
    +		toolbar : [ [ 'Source', 'Bold' ], ['CreatePlaceholder'] ]
    +	});
    +

    + Note that textarea_id in the code above is the id attribute of + the <textarea> element to be replaced with CKEditor. +

    +
    + +
    + +
    +
    +

    + + + +

    +

    + +

    +
    + + + diff --git a/library/custom_template/ckeditor/_samples/replacebyclass.html b/library/custom_template/ckeditor/_samples/replacebyclass.html new file mode 100644 index 000000000..0614cead8 --- /dev/null +++ b/library/custom_template/ckeditor/_samples/replacebyclass.html @@ -0,0 +1,64 @@ + + + + + Replace Textareas by Class Name — CKEditor Sample + + + + + + +

    + CKEditor Sample — Replace Textarea Elements by Class Name +

    +
    +

    + This sample shows how to automatically replace all <textarea> elements + of a given class with a CKEditor instance. +

    +

    + To replace a <textarea> element, simply assign it the ckeditor + class, as in the code below: +

    +
    <textarea class="ckeditor" name="editor1"></textarea>
    +

    + Note that other <textarea> attributes (like id or name) need to be adjusted to your document. +

    +
    + + +
    + +
    +
    +

    + + +

    +

    + +

    +
    + + + diff --git a/library/custom_template/ckeditor/_samples/replacebycode.html b/library/custom_template/ckeditor/_samples/replacebycode.html new file mode 100644 index 000000000..9f7ed85fe --- /dev/null +++ b/library/custom_template/ckeditor/_samples/replacebycode.html @@ -0,0 +1,97 @@ + + + + + Replace Textarea by Code — CKEditor Sample + + + + + + +

    + CKEditor Sample — Replace Textarea Elements Using JavaScript Code +

    +
    +

    + This sample shows how to automatically replace all <textarea> elements + with a CKEditor instance by using a JavaScript call. +

    +

    + To replace a <textarea> element, place the following call at any point + after the <textarea> element or inside a <script> element located + in the <head> section of the page, in a window.onload event handler: +

    +
    CKEDITOR.replace( 'textarea_id' );
    +

    + Note that textarea_id in the code above is the id attribute of + the <textarea> element to be replaced. +

    +
    + + +
    + +
    +
    +

    + + + +

    +

    + + + +

    +

    + +

    +
    + + + diff --git a/library/custom_template/ckeditor/_samples/sample.css b/library/custom_template/ckeditor/_samples/sample.css new file mode 100644 index 000000000..d847e8a29 --- /dev/null +++ b/library/custom_template/ckeditor/_samples/sample.css @@ -0,0 +1,163 @@ +/* +Copyright (c) 2003-2011, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.html or http://ckeditor.com/license +*/ + +html, body, h1, h2, h3, h4, h5, h6, div, span, blockquote, p, address, form, fieldset, img, ul, ol, dl, dt, dd, li, hr, table, td, th, strong, em, sup, sub, dfn, ins, del, q, cite, var, samp, code, kbd, tt, pre { + line-height: 1.5em; +} + +body { + padding:0px 0px; +} + +input, textarea, select, option, optgroup, button, td, th { + font-size: 100%; +} + +pre, +code, +kbd, +samp, +tt{ + font-family: monospace,monospace; + font-size: 1em; +} + +h1.samples { + color:#0782C1; + font-size:200%; + font-weight:normal; + margin: 0; + padding: 0; +} + +h2.samples { + color:#000000; + font-size:130%; + margin: 0; + padding: 0; +} + +p, blockquote, address, form, pre, dl, h1.samples, h2.samples { + margin-bottom:15px; +} + +ul.samples { + margin-bottom:15px; +} + +.clear { + clear:both; +} + +fieldset +{ + margin: 0; + padding: 10px; +} + +body, input, textarea { + color: #333333; + font-family: Arial, Helvetica, sans-serif; +} + +body { + font-size: 75%; +} + +a.samples { + color:#189DE1; + text-decoration:none; +} + +a.samples:hover { + text-decoration:underline; +} + +form +{ + margin: 0; + padding: 0; +} + +pre.samples +{ + background-color: #F7F7F7; + border: 1px solid #D7D7D7; + overflow: auto; + padding: 0.25em; +} + +#alerts +{ + color: Red; +} + +#footer hr +{ + margin: 10px 0 15px 0; + height: 1px; + border: solid 1px gray; + border-bottom: none; +} + +#footer p +{ + margin: 0 10px 10px 10px; + float: left; +} + +#footer #copy +{ + float: right; +} + +#outputSample +{ + width: 100%; + table-layout: fixed; +} + +#outputSample thead th +{ + color: #dddddd; + background-color: #999999; + padding: 4px; + white-space: nowrap; +} + +#outputSample tbody th +{ + vertical-align: top; + text-align: left; +} + +#outputSample pre +{ + margin: 0; + padding: 0; + white-space: pre; /* CSS2 */ + white-space: -moz-pre-wrap; /* Mozilla*/ + white-space: -o-pre-wrap; /* Opera 7 */ + white-space: pre-wrap; /* CSS 2.1 */ + white-space: pre-line; /* CSS 3 (and 2.1 as well, actually) */ + word-wrap: break-word; /* IE */ +} + +.description { + border: 1px dotted #B7B7B7; + margin-bottom: 10px; + padding: 10px 10px 0; +} + +label { + display: block; + margin-bottom:6px; +} + +.cke_dialog label +{ + display: inline; + margin-bottom: auto; +} diff --git a/library/custom_template/ckeditor/_samples/sample.js b/library/custom_template/ckeditor/_samples/sample.js new file mode 100644 index 000000000..860565b16 --- /dev/null +++ b/library/custom_template/ckeditor/_samples/sample.js @@ -0,0 +1,65 @@ +/* +Copyright (c) 2003-2011, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.html or http://ckeditor.com/license +*/ + +// This file is not required by CKEditor and may be safely ignored. +// It is just a helper file that displays a red message about browser compatibility +// at the top of the samples (if incompatible browser is detected). + +if ( window.CKEDITOR ) +{ + (function() + { + var showCompatibilityMsg = function() + { + var env = CKEDITOR.env; + + var html = '

    Your browser is not compatible with CKEditor.'; + + var browsers = + { + gecko : 'Firefox 2.0', + ie : 'Internet Explorer 6.0', + opera : 'Opera 9.5', + webkit : 'Safari 3.0' + }; + + var alsoBrowsers = ''; + + for ( var key in env ) + { + if ( browsers[ key ] ) + { + if ( env[key] ) + html += ' CKEditor is compatible with ' + browsers[ key ] + ' or higher.'; + else + alsoBrowsers += browsers[ key ] + '+, '; + } + } + + alsoBrowsers = alsoBrowsers.replace( /\+,([^,]+), $/, '+ and $1' ); + + html += ' It is also compatible with ' + alsoBrowsers + '.'; + + html += '

    With non compatible browsers, you should still be able to see and edit the contents (HTML) in a plain text field.

    '; + + var alertsEl = document.getElementById( 'alerts' ); + alertsEl && ( alertsEl.innerHTML = html ); + }; + + var onload = function() + { + // Show a friendly compatibility message as soon as the page is loaded, + // for those browsers that are not compatible with CKEditor. + if ( !CKEDITOR.env.isCompatible ) + showCompatibilityMsg(); + }; + + // Register the onload listener. + if ( window.addEventListener ) + window.addEventListener( 'load', onload, false ); + else if ( window.attachEvent ) + window.attachEvent( 'onload', onload ); + })(); +} diff --git a/library/custom_template/ckeditor/_samples/sample_posteddata.php b/library/custom_template/ckeditor/_samples/sample_posteddata.php new file mode 100644 index 000000000..07d48d7f7 --- /dev/null +++ b/library/custom_template/ckeditor/_samples/sample_posteddata.php @@ -0,0 +1,21 @@ + diff --git a/library/custom_template/ckeditor/_samples/sharedspaces.html b/library/custom_template/ckeditor/_samples/sharedspaces.html new file mode 100644 index 000000000..a0c0a2847 --- /dev/null +++ b/library/custom_template/ckeditor/_samples/sharedspaces.html @@ -0,0 +1,153 @@ + + + + + Shared Toolbars — CKEditor Sample + + + + + + + +

    + CKEditor Sample — Shared Toolbars +

    +
    +

    + This sample shows how to configure multiple CKEditor instances to share some parts of the interface. + You can choose to share the toolbar (topSpace), the elements path + (bottomSpace), or both. +

    +

    + CKEditor instances with shared spaces can be inserted with a JavaScript call using the following code: +

    +
    CKEDITOR.replace( 'textarea_id',
    +	{
    +		sharedSpaces :
    +		{
    +			top : 'topSpace',
    +			bottom : 'bottomSpace'
    +		}
    +	});
    +

    + Note that textarea_id in the code above is the id attribute of + the <textarea> element to be replaced with CKEditor. +

    +
    + +
    + +
    +
    +
    +
    +

    + + +

    +

    + + +

    +

    + + +

    +

    + + +

    +

    + +

    +
    +
    +
    + + + + diff --git a/library/custom_template/ckeditor/_samples/skins.html b/library/custom_template/ckeditor/_samples/skins.html new file mode 100644 index 000000000..958037b6a --- /dev/null +++ b/library/custom_template/ckeditor/_samples/skins.html @@ -0,0 +1,110 @@ + + + + + Skins — CKEditor Sample + + + + + + +

    + CKEditor Sample — Skins +

    +
    +

    + This sample shows how to automatically replace <textarea> elements + with a CKEditor instance using a specific skin. +

    +

    + CKEditor with a specified skin (in this case, the "Office 2003" skin) is inserted with a JavaScript call using the following code: +

    +
    CKEDITOR.replace( 'textarea_id',
    +	{
    +		skin : 'office2003'
    +	});
    +

    + Note that textarea_id in the code above is the id attribute of + the <textarea> element to be replaced. +

    +
    + + +
    + +
    +
    +

    "Kama" skin

    +

    The default skin used in CKEditor. No additional configuration is required.

    +

    + + +

    +

    "Office 2003" skin

    +

    Use the following code to configure a CKEditor instance to use the "Office 2003" skin.

    +
    CKEDITOR.replace( 'textarea_id',
    +	{
    +		skin : 'office2003'
    +	});
    +

    + + +

    +

    "V2" skin

    +

    Use the following code to configure a CKEditor instance to use the "V2" skin.

    +
    CKEDITOR.replace( 'textarea_id',
    +	{
    +		skin : 'v2'
    +	});
    + + +
    + + + diff --git a/library/custom_template/ckeditor/_samples/ui_color.html b/library/custom_template/ckeditor/_samples/ui_color.html new file mode 100644 index 000000000..120a80655 --- /dev/null +++ b/library/custom_template/ckeditor/_samples/ui_color.html @@ -0,0 +1,129 @@ + + + + + UI Color Picker — CKEditor Sample + + + + + + +

    + CKEditor Sample — UI Color Picker +

    +
    +

    + This sample shows how to automatically replace <textarea> elements + with a CKEditor instance with an option to change the color of its user interface. +

    +

    Setting the User Interface Color

    +

    + To specify the color of the user interface, set the uiColor property: +

    +
    CKEDITOR.replace( 'textarea_id',
    +	{
    +		uiColor: '#EE0000'
    +	});
    +

    + Note that textarea_id in the code above is the id attribute of + the <textarea> element to be replaced. +

    +

    Enabling the Color Picker

    +

    + If the uicolor plugin along with the dedicated UIColor + toolbar button is added to CKEditor, the user will also be able to pick the color of the + UI from the color palette available in the UI Color Picker dialog window. +

    +

    + To insert a CKEditor instance with the uicolor plugin enabled, + use the following JavaScript call: +

    +
    CKEDITOR.replace( 'textarea_id',
    +	{
    +		extraPlugins : 'uicolor',
    +		toolbar : [ [ 'Bold', 'Italic' ], [ 'UIColor' ] ]
    +	});
    +
    + +
    + +
    +

    + Click the UI Color Picker button to test your color preferences at runtime. +

    +

    + The first editor instance includes the UI Color Picker toolbar button, + but the default UI color is not defined, so the editor uses the skin color. +

    +
    +

    + + +

    +

    + The second editor instance includes the UI Color Picker toolbar button. The + default UI color was defined, so the skin color is not used. +

    +

    + + +

    +

    + +

    +
    + + + diff --git a/library/custom_template/ckeditor/_samples/ui_languages.html b/library/custom_template/ckeditor/_samples/ui_languages.html new file mode 100644 index 000000000..0c752a51c --- /dev/null +++ b/library/custom_template/ckeditor/_samples/ui_languages.html @@ -0,0 +1,134 @@ + + + + + User Interface Globalization — CKEditor Sample + + + + + + + +

    + CKEditor Sample — User Interface Languages +

    +
    +

    + This sample shows how to automatically replace <textarea> elements + with a CKEditor instance with an option to change the language of its user interface. +

    +

    + It pulls the language list from CKEditor _languages.js file that contains the list of supported languages and creates + a drop-down list that lets the user change the UI language. +

    +

    + By default, CKEditor automatically localizes the editor to the language of the user. + The UI language can be controlled with two configuration options: + + language and + defaultLanguage. The defaultLanguage setting specifies the + default CKEditor language to be used when a localization suitable for user's settings is not available. +

    +

    + To specify the user interface language that will be used no matter what language is + specified in user's browser or operating system, set the language property: +

    +
    CKEDITOR.replace( 'textarea_id',
    +	{
    +		// Load the German interface.
    +		language: 'de'
    +	});
    +

    + Note that textarea_id in the code above is the id attribute of + the <textarea> element to be replaced. +

    +
    + +
    + +
    +
    +

    + Available languages ( languages!):
    + +
    + (You may see strange characters if your system does not + support the selected language) +

    +

    + + +

    +
    + + + diff --git a/library/custom_template/ckeditor/_source/adapters/jquery.js b/library/custom_template/ckeditor/_source/adapters/jquery.js new file mode 100644 index 000000000..72bdb2246 --- /dev/null +++ b/library/custom_template/ckeditor/_source/adapters/jquery.js @@ -0,0 +1,300 @@ +/* +Copyright (c) 2003-2011, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.html or http://ckeditor.com/license +*/ + +/** + * @fileOverview jQuery adapter provides easy use of basic CKEditor functions + * and access to internal API. It also integrates some aspects of CKEditor with + * jQuery framework. + * + * Every TEXTAREA, DIV and P elements can be converted to working editor. + * + * Plugin exposes some of editor's event to jQuery event system. All of those are namespaces inside + * ".ckeditor" namespace and can be binded/listened on supported textarea, div and p nodes. + * + * Available jQuery events: + * - instanceReady.ckeditor( editor, rootNode ) + * Triggered when new instance is ready. + * - destroy.ckeditor( editor ) + * Triggered when instance is destroyed. + * - getData.ckeditor( editor, eventData ) + * Triggered when getData event is fired inside editor. It can change returned data using eventData reference. + * - setData.ckeditor( editor ) + * Triggered when getData event is fired inside editor. + * + * @example + * + * + * + */ + +(function() +{ + /** + * Allow CKEditor to override jQuery.fn.val(). This results in ability to use val() + * function on textareas as usual and having those calls synchronized with CKEditor + * Rich Text Editor component. + * + * This config option is global and executed during plugin load. + * Can't be customized across editor instances. + * + * @type Boolean + * @example + * $( 'textarea' ).ckeditor(); + * // ... + * $( 'textarea' ).val( 'New content' ); + */ + CKEDITOR.config.jqueryOverrideVal = typeof CKEDITOR.config.jqueryOverrideVal == 'undefined' + ? true : CKEDITOR.config.jqueryOverrideVal; + + var jQuery = window.jQuery; + + if ( typeof jQuery == 'undefined' ) + return; + + // jQuery object methods. + jQuery.extend( jQuery.fn, + /** @lends jQuery.fn */ + { + /** + * Return existing CKEditor instance for first matched element. + * Allows to easily use internal API. Doesn't return jQuery object. + * + * Raised exception if editor doesn't exist or isn't ready yet. + * + * @name jQuery.ckeditorGet + * @return CKEDITOR.editor + * @see CKEDITOR.editor + */ + ckeditorGet: function() + { + var instance = this.eq( 0 ).data( 'ckeditorInstance' ); + if ( !instance ) + throw "CKEditor not yet initialized, use ckeditor() with callback."; + return instance; + }, + /** + * Triggers creation of CKEditor in all matched elements (reduced to DIV, P and TEXTAREAs). + * Binds callback to instanceReady event of all instances. If editor is already created, than + * callback is fired right away. + * + * Mixed parameter order allowed. + * + * @param callback Function to be run on editor instance. Passed parameters: [ textarea ]. + * Callback is fiered in "this" scope being ckeditor instance and having source textarea as first param. + * + * @param config Configuration options for new instance(s) if not already created. + * See URL + * + * @example + * $( 'textarea' ).ckeditor( function( textarea ) { + * $( textarea ).val( this.getData() ) + * } ); + * + * @name jQuery.fn.ckeditor + * @return jQuery.fn + */ + ckeditor: function( callback, config ) + { + if ( !CKEDITOR.env.isCompatible ) + return this; + + if ( !jQuery.isFunction( callback )) + { + var tmp = config; + config = callback; + callback = tmp; + } + config = config || {}; + + this.filter( 'textarea, div, p' ).each( function() + { + var $element = jQuery( this ), + editor = $element.data( 'ckeditorInstance' ), + instanceLock = $element.data( '_ckeditorInstanceLock' ), + element = this; + + if ( editor && !instanceLock ) + { + if ( callback ) + callback.apply( editor, [ this ] ); + } + else if ( !instanceLock ) + { + // CREATE NEW INSTANCE + + // Handle config.autoUpdateElement inside this plugin if desired. + if ( config.autoUpdateElement + || ( typeof config.autoUpdateElement == 'undefined' && CKEDITOR.config.autoUpdateElement ) ) + { + config.autoUpdateElementJquery = true; + } + + // Always disable config.autoUpdateElement. + config.autoUpdateElement = false; + $element.data( '_ckeditorInstanceLock', true ); + + // Set instance reference in element's data. + editor = CKEDITOR.replace( element, config ); + $element.data( 'ckeditorInstance', editor ); + + // Register callback. + editor.on( 'instanceReady', function( event ) + { + var editor = event.editor; + setTimeout( function() + { + // Delay bit more if editor is still not ready. + if ( !editor.element ) + { + setTimeout( arguments.callee, 100 ); + return; + } + + // Remove this listener. + event.removeListener( 'instanceReady', this.callee ); + + // Forward setData on dataReady. + editor.on( 'dataReady', function() + { + $element.trigger( 'setData' + '.ckeditor', [ editor ] ); + }); + + // Forward getData. + editor.on( 'getData', function( event ) { + $element.trigger( 'getData' + '.ckeditor', [ editor, event.data ] ); + }, 999 ); + + // Forward destroy event. + editor.on( 'destroy', function() + { + $element.trigger( 'destroy.ckeditor', [ editor ] ); + }); + + // Integrate with form submit. + if ( editor.config.autoUpdateElementJquery && $element.is( 'textarea' ) && $element.parents( 'form' ).length ) + { + var onSubmit = function() + { + $element.ckeditor( function() + { + editor.updateElement(); + }); + }; + + // Bind to submit event. + $element.parents( 'form' ).submit( onSubmit ); + + // Bind to form-pre-serialize from jQuery Forms plugin. + $element.parents( 'form' ).bind( 'form-pre-serialize', onSubmit ); + + // Unbind when editor destroyed. + $element.bind( 'destroy.ckeditor', function() + { + $element.parents( 'form' ).unbind( 'submit', onSubmit ); + $element.parents( 'form' ).unbind( 'form-pre-serialize', onSubmit ); + }); + } + + // Garbage collect on destroy. + editor.on( 'destroy', function() + { + $element.data( 'ckeditorInstance', null ); + }); + + // Remove lock. + $element.data( '_ckeditorInstanceLock', null ); + + // Fire instanceReady event. + $element.trigger( 'instanceReady.ckeditor', [ editor ] ); + + // Run given (first) code. + if ( callback ) + callback.apply( editor, [ element ] ); + }, 0 ); + }, null, null, 9999); + } + else + { + // Editor is already during creation process, bind our code to the event. + CKEDITOR.on( 'instanceReady', function( event ) + { + var editor = event.editor; + setTimeout( function() + { + // Delay bit more if editor is still not ready. + if ( !editor.element ) + { + setTimeout( arguments.callee, 100 ); + return; + } + + if ( editor.element.$ == element ) + { + // Run given code. + if ( callback ) + callback.apply( editor, [ element ] ); + } + }, 0 ); + }, null, null, 9999); + } + }); + return this; + } + }); + + // New val() method for objects. + if ( CKEDITOR.config.jqueryOverrideVal ) + { + jQuery.fn.val = CKEDITOR.tools.override( jQuery.fn.val, function( oldValMethod ) + { + /** + * CKEditor-aware val() method. + * + * Acts same as original jQuery val(), but for textareas which have CKEditor instances binded to them, method + * returns editor's content. It also works for settings values. + * + * @param oldValMethod + * @name jQuery.fn.val + */ + return function( newValue, forceNative ) + { + var isSetter = typeof newValue != 'undefined', + result; + + this.each( function() + { + var $this = jQuery( this ), + editor = $this.data( 'ckeditorInstance' ); + + if ( !forceNative && $this.is( 'textarea' ) && editor ) + { + if ( isSetter ) + editor.setData( newValue ); + else + { + result = editor.getData(); + // break; + return null; + } + } + else + { + if ( isSetter ) + oldValMethod.call( $this, newValue ); + else + { + result = oldValMethod.call( $this ); + // break; + return null; + } + } + + return true; + }); + return isSetter ? this : result; + }; + }); + } +})(); diff --git a/library/custom_template/ckeditor/_source/core/_bootstrap.js b/library/custom_template/ckeditor/_source/core/_bootstrap.js new file mode 100644 index 000000000..22974c82a --- /dev/null +++ b/library/custom_template/ckeditor/_source/core/_bootstrap.js @@ -0,0 +1,96 @@ +/* +Copyright (c) 2003-2011, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.html or http://ckeditor.com/license +*/ + +/** + * @fileOverview API initialization code. + */ + +(function() +{ + // Disable HC detaction in WebKit. (#5429) + if ( CKEDITOR.env.webkit ) + { + CKEDITOR.env.hc = false; + return; + } + + // Check is High Contrast is active by creating a temporary element with a + // background image. + + var useSpacer = CKEDITOR.env.ie && CKEDITOR.env.version < 7, + useBlank = CKEDITOR.env.ie && CKEDITOR.env.version == 7; + + var backgroundImageUrl = useSpacer ? ( CKEDITOR.basePath + 'images/spacer.gif' ) : + useBlank ? 'about:blank' : 'data:image/png;base64,'; + + var hcDetect = CKEDITOR.dom.element.createFromHtml( + '
    ', CKEDITOR.document ); + + hcDetect.appendTo( CKEDITOR.document.getHead() ); + + // Update CKEDITOR.env. + // Catch exception needed sometimes for FF. (#4230) + try + { + CKEDITOR.env.hc = ( hcDetect.getComputedStyle( 'background-image' ) == 'none' ); + } + catch (e) + { + CKEDITOR.env.hc = false; + } + + if ( CKEDITOR.env.hc ) + CKEDITOR.env.cssClass += ' cke_hc'; + + hcDetect.remove(); +})(); + +// Load core plugins. +CKEDITOR.plugins.load( CKEDITOR.config.corePlugins.split( ',' ), function() + { + CKEDITOR.status = 'loaded'; + CKEDITOR.fire( 'loaded' ); + + // Process all instances created by the "basic" implementation. + var pending = CKEDITOR._.pending; + if ( pending ) + { + delete CKEDITOR._.pending; + + for ( var i = 0 ; i < pending.length ; i++ ) + CKEDITOR.add( pending[ i ] ); + } + }); + +// Needed for IE6 to not request image (HTTP 200 or 304) for every CSS background. (#6187) +if ( CKEDITOR.env.ie ) +{ + // Remove IE mouse flickering on IE6 because of background images. + try + { + document.execCommand( 'BackgroundImageCache', false, true ); + } + catch (e) + { + // We have been reported about loading problems caused by the above + // line. For safety, let's just ignore errors. + } +} + +/** + * Indicates that CKEditor is running on a High Contrast environment. + * @name CKEDITOR.env.hc + * @example + * if ( CKEDITOR.env.hc ) + * alert( 'You're running on High Contrast mode. The editor interface will get adapted to provide you a better experience.' ); + */ + +/** + * Fired when a CKEDITOR core object is fully loaded and ready for interaction. + * @name CKEDITOR#loaded + * @event + */ diff --git a/library/custom_template/ckeditor/_source/core/ajax.js b/library/custom_template/ckeditor/_source/core/ajax.js new file mode 100644 index 000000000..0a13a4269 --- /dev/null +++ b/library/custom_template/ckeditor/_source/core/ajax.js @@ -0,0 +1,142 @@ +/* +Copyright (c) 2003-2011, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.html or http://ckeditor.com/license +*/ + +/** + * @fileOverview Defines the {@link CKEDITOR.ajax} object, which holds ajax methods for + * data loading. + */ + +/** + * @namespace Ajax methods for data loading. + * @example + */ +CKEDITOR.ajax = (function() +{ + var createXMLHttpRequest = function() + { + // In IE, using the native XMLHttpRequest for local files may throw + // "Access is Denied" errors. + if ( !CKEDITOR.env.ie || location.protocol != 'file:' ) + try { return new XMLHttpRequest(); } catch(e) {} + + try { return new ActiveXObject( 'Msxml2.XMLHTTP' ); } catch (e) {} + try { return new ActiveXObject( 'Microsoft.XMLHTTP' ); } catch (e) {} + + return null; + }; + + var checkStatus = function( xhr ) + { + // HTTP Status Codes: + // 2xx : Success + // 304 : Not Modified + // 0 : Returned when running locally (file://) + // 1223 : IE may change 204 to 1223 (see http://dev.jquery.com/ticket/1450) + + return ( xhr.readyState == 4 && + ( ( xhr.status >= 200 && xhr.status < 300 ) || + xhr.status == 304 || + xhr.status === 0 || + xhr.status == 1223 ) ); + }; + + var getResponseText = function( xhr ) + { + if ( checkStatus( xhr ) ) + return xhr.responseText; + return null; + }; + + var getResponseXml = function( xhr ) + { + if ( checkStatus( xhr ) ) + { + var xml = xhr.responseXML; + return new CKEDITOR.xml( xml && xml.firstChild ? xml : xhr.responseText ); + } + return null; + }; + + var load = function( url, callback, getResponseFn ) + { + var async = !!callback; + + var xhr = createXMLHttpRequest(); + + if ( !xhr ) + return null; + + xhr.open( 'GET', url, async ); + + if ( async ) + { + // TODO: perform leak checks on this closure. + /** @ignore */ + xhr.onreadystatechange = function() + { + if ( xhr.readyState == 4 ) + { + callback( getResponseFn( xhr ) ); + xhr = null; + } + }; + } + + xhr.send(null); + + return async ? '' : getResponseFn( xhr ); + }; + + return /** @lends CKEDITOR.ajax */ { + + /** + * Loads data from an URL as plain text. + * @param {String} url The URL from which load data. + * @param {Function} [callback] A callback function to be called on + * data load. If not provided, the data will be loaded + * asynchronously, passing the data value the function on load. + * @returns {String} The loaded data. For asynchronous requests, an + * empty string. For invalid requests, null. + * @example + * // Load data synchronously. + * var data = CKEDITOR.ajax.load( 'somedata.txt' ); + * alert( data ); + * @example + * // Load data asynchronously. + * var data = CKEDITOR.ajax.load( 'somedata.txt', function( data ) + * { + * alert( data ); + * } ); + */ + load : function( url, callback ) + { + return load( url, callback, getResponseText ); + }, + + /** + * Loads data from an URL as XML. + * @param {String} url The URL from which load data. + * @param {Function} [callback] A callback function to be called on + * data load. If not provided, the data will be loaded + * asynchronously, passing the data value the function on load. + * @returns {CKEDITOR.xml} An XML object holding the loaded data. For asynchronous requests, an + * empty string. For invalid requests, null. + * @example + * // Load XML synchronously. + * var xml = CKEDITOR.ajax.loadXml( 'somedata.xml' ); + * alert( xml.getInnerXml( '//' ) ); + * @example + * // Load XML asynchronously. + * var data = CKEDITOR.ajax.loadXml( 'somedata.xml', function( xml ) + * { + * alert( xml.getInnerXml( '//' ) ); + * } ); + */ + loadXml : function( url, callback ) + { + return load( url, callback, getResponseXml ); + } + }; +})(); diff --git a/library/custom_template/ckeditor/_source/core/ckeditor.js b/library/custom_template/ckeditor/_source/core/ckeditor.js new file mode 100644 index 000000000..591485952 --- /dev/null +++ b/library/custom_template/ckeditor/_source/core/ckeditor.js @@ -0,0 +1,141 @@ +/* +Copyright (c) 2003-2011, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.html or http://ckeditor.com/license +*/ + +/** + * @fileOverview Contains the third and last part of the {@link CKEDITOR} object + * definition. + */ + +// Remove the CKEDITOR.loadFullCore reference defined on ckeditor_basic. +delete CKEDITOR.loadFullCore; + +/** + * Holds references to all editor instances created. The name of the properties + * in this object correspond to instance names, and their values contains the + * {@link CKEDITOR.editor} object representing them. + * @type {Object} + * @example + * alert( CKEDITOR.instances.editor1.name ); // "editor1" + */ +CKEDITOR.instances = {}; + +/** + * The document of the window holding the CKEDITOR object. + * @type {CKEDITOR.dom.document} + * @example + * alert( CKEDITOR.document.getBody().getName() ); // "body" + */ +CKEDITOR.document = new CKEDITOR.dom.document( document ); + +/** + * Adds an editor instance to the global {@link CKEDITOR} object. This function + * is available for internal use mainly. + * @param {CKEDITOR.editor} editor The editor instance to be added. + * @example + */ +CKEDITOR.add = function( editor ) +{ + CKEDITOR.instances[ editor.name ] = editor; + + editor.on( 'focus', function() + { + if ( CKEDITOR.currentInstance != editor ) + { + CKEDITOR.currentInstance = editor; + CKEDITOR.fire( 'currentInstance' ); + } + }); + + editor.on( 'blur', function() + { + if ( CKEDITOR.currentInstance == editor ) + { + CKEDITOR.currentInstance = null; + CKEDITOR.fire( 'currentInstance' ); + } + }); +}; + +/** + * Removes an editor instance from the global {@link CKEDITOR} object. This function + * is available for internal use only. External code must use {@link CKEDITOR.editor.prototype.destroy} + * to avoid memory leaks. + * @param {CKEDITOR.editor} editor The editor instance to be removed. + * @example + */ +CKEDITOR.remove = function( editor ) +{ + delete CKEDITOR.instances[ editor.name ]; +}; + +/** + * Perform global clean up to free as much memory as possible + * when there are no instances left + */ +CKEDITOR.on( 'instanceDestroyed', function () + { + if ( CKEDITOR.tools.isEmpty( this.instances ) ) + CKEDITOR.fire( 'reset' ); + }); + +// Load the bootstrap script. +CKEDITOR.loader.load( 'core/_bootstrap' ); // @Packager.RemoveLine + +// Tri-state constants. + +/** + * Used to indicate the ON or ACTIVE state. + * @constant + * @example + */ +CKEDITOR.TRISTATE_ON = 1; + +/** + * Used to indicate the OFF or NON ACTIVE state. + * @constant + * @example + */ +CKEDITOR.TRISTATE_OFF = 2; + +/** + * Used to indicate DISABLED state. + * @constant + * @example + */ +CKEDITOR.TRISTATE_DISABLED = 0; + +/** + * The editor which is currently active (have user focus). + * @name CKEDITOR.currentInstance + * @type CKEDITOR.editor + * @see CKEDITOR#currentInstance + * @example + * function showCurrentEditorName() + * { + * if ( CKEDITOR.currentInstance ) + * alert( CKEDITOR.currentInstance.name ); + * else + * alert( 'Please focus an editor first.' ); + * } + */ + +/** + * Fired when the CKEDITOR.currentInstance object reference changes. This may + * happen when setting the focus on different editor instances in the page. + * @name CKEDITOR#currentInstance + * @event + * var editor; // Variable to hold a reference to the current editor. + * CKEDITOR.on( 'currentInstance' , function( e ) + * { + * editor = CKEDITOR.currentInstance; + * }); + */ + +/** + * Fired when the last instance has been destroyed. This event is used to perform + * global memory clean up. + * @name CKEDITOR#reset + * @event + */ diff --git a/library/custom_template/ckeditor/_source/core/ckeditor_base.js b/library/custom_template/ckeditor/_source/core/ckeditor_base.js new file mode 100644 index 000000000..e52fedfb7 --- /dev/null +++ b/library/custom_template/ckeditor/_source/core/ckeditor_base.js @@ -0,0 +1,196 @@ +/* +Copyright (c) 2003-2011, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.html or http://ckeditor.com/license +*/ + +/** + * @fileOverview Contains the first and essential part of the {@link CKEDITOR} + * object definition. + */ + +// #### Compressed Code +// Must be updated on changes in the script, as well as updated in the +// ckeditor_source.js and ckeditor_basic_source.js files. + +// if(!window.CKEDITOR)window.CKEDITOR=(function(){var a={timestamp:'',version:'3.5.2',rev:'6450',_:{},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;})(); + +// #### Raw code +// ATTENTION: read the above "Compressed Code" notes when changing this code. + +if ( !window.CKEDITOR ) +{ + /** + * @name CKEDITOR + * @namespace This is the API entry point. The entire CKEditor code runs under this object. + * @example + */ + window.CKEDITOR = (function() + { + var CKEDITOR = + /** @lends CKEDITOR */ + { + + /** + * A constant string unique for each release of CKEditor. Its value + * is used, by default, to build the URL for all resources loaded + * by the editor code, guaranteing clean cache results when + * upgrading. + * @type String + * @example + * alert( CKEDITOR.timestamp ); // e.g. '87dm' + */ + // The production implementation contains a fixed timestamp, unique + // for each release, generated by the releaser. + // (Base 36 value of each component of YYMMDDHH - 4 chars total - e.g. 87bm == 08071122) + timestamp : 'B1GG4Z6', + + /** + * Contains the CKEditor version number. + * @type String + * @example + * alert( CKEDITOR.version ); // e.g. 'CKEditor 3.4.1' + */ + version : '3.5.2', + + /** + * Contains the CKEditor revision number. + * The revision number is incremented automatically, following each + * modification to the CKEditor source code. + * @type String + * @example + * alert( CKEDITOR.revision ); // e.g. '3975' + */ + revision : '6450', + + /** + * Private object used to hold core stuff. It should not be used out of + * the API code as properties defined here may change at any time + * without notice. + * @private + */ + _ : {}, + + /** + * Indicates the API loading status. The following status are available: + *
      + *
    • unloaded: the API is not yet loaded.
    • + *
    • basic_loaded: the basic API features are available.
    • + *
    • basic_ready: the basic API is ready to load the full core code.
    • + *
    • loading: the full API is being loaded.
    • + *
    • loaded: the API can be fully used.
    • + *
    + * @type String + * @example + * if ( CKEDITOR.status == 'loaded' ) + * { + * // The API can now be fully used. + * } + */ + status : 'unloaded', + + /** + * Contains the full URL for the CKEditor installation directory. + * It's possible to manually provide the base path by setting a + * global variable named CKEDITOR_BASEPATH. This global variable + * must be set "before" the editor script loading. + * @type String + * @example + * alert( CKEDITOR.basePath ); // "http://www.example.com/ckeditor/" (e.g.) + */ + basePath : (function() + { + // ATTENTION: fixes on this code must be ported to + // var basePath in "core/loader.js". + + // Find out the editor directory path, based on its ")' ); + } + } + + return $ && new CKEDITOR.dom.document( $.contentWindow.document ); + }, + + /** + * Copy all the attributes from one node to the other, kinda like a clone + * skipAttributes is an object with the attributes that must NOT be copied. + * @param {CKEDITOR.dom.element} dest The destination element. + * @param {Object} skipAttributes A dictionary of attributes to skip. + * @example + */ + copyAttributes : function( dest, skipAttributes ) + { + var attributes = this.$.attributes; + skipAttributes = skipAttributes || {}; + + for ( var n = 0 ; n < attributes.length ; n++ ) + { + var attribute = attributes[n]; + + // Lowercase attribute name hard rule is broken for + // some attribute on IE, e.g. CHECKED. + var attrName = attribute.nodeName.toLowerCase(), + attrValue; + + // We can set the type only once, so do it with the proper value, not copying it. + if ( attrName in skipAttributes ) + continue; + + if ( attrName == 'checked' && ( attrValue = this.getAttribute( attrName ) ) ) + dest.setAttribute( attrName, attrValue ); + // IE BUG: value attribute is never specified even if it exists. + else if ( attribute.specified || + ( CKEDITOR.env.ie && attribute.nodeValue && attrName == 'value' ) ) + { + attrValue = this.getAttribute( attrName ); + if ( attrValue === null ) + attrValue = attribute.nodeValue; + + dest.setAttribute( attrName, attrValue ); + } + } + + // The style: + if ( this.$.style.cssText !== '' ) + dest.$.style.cssText = this.$.style.cssText; + }, + + /** + * Changes the tag name of the current element. + * @param {String} newTag The new tag for the element. + */ + renameNode : function( newTag ) + { + // If it's already correct exit here. + if ( this.getName() == newTag ) + return; + + var doc = this.getDocument(); + + // Create the new node. + var newNode = new CKEDITOR.dom.element( newTag, doc ); + + // Copy all attributes. + this.copyAttributes( newNode ); + + // Move children to the new node. + this.moveChildren( newNode ); + + // Replace the node. + this.getParent() && this.$.parentNode.replaceChild( newNode.$, this.$ ); + newNode.$[ 'data-cke-expando' ] = this.$[ 'data-cke-expando' ]; + this.$ = newNode.$; + }, + + /** + * Gets a DOM tree descendant under the current node. + * @param {Array|Number} indices The child index or array of child indices under the node. + * @returns {CKEDITOR.dom.node} The specified DOM child under the current node. Null if child does not exist. + * @example + * var strong = p.getChild(0); + */ + getChild : function( indices ) + { + var rawNode = this.$; + + if ( !indices.slice ) + rawNode = rawNode.childNodes[ indices ]; + else + { + while ( indices.length > 0 && rawNode ) + rawNode = rawNode.childNodes[ indices.shift() ]; + } + + return rawNode ? new CKEDITOR.dom.node( rawNode ) : null; + }, + + getChildCount : function() + { + return this.$.childNodes.length; + }, + + disableContextMenu : function() + { + this.on( 'contextmenu', function( event ) + { + // Cancel the browser context menu. + if ( !event.data.getTarget().hasClass( 'cke_enable_context_menu' ) ) + event.data.preventDefault(); + } ); + }, + + /** + * Gets element's direction. Supports both CSS 'direction' prop and 'dir' attr. + */ + getDirection : function( useComputed ) + { + return useComputed ? this.getComputedStyle( 'direction' ) : this.getStyle( 'direction' ) || this.getAttribute( 'dir' ); + }, + + /** + * Gets, sets and removes custom data to be stored as HTML5 data-* attributes. + * @name CKEDITOR.dom.element.data + * @param {String} name The name of the attribute, execluding the 'data-' part. + * @param {String} [value] The value to set. If set to false, the attribute will be removed. + */ + data : function ( name, value ) + { + name = 'data-' + name; + if ( value === undefined ) + return this.getAttribute( name ); + else if ( value === false ) + this.removeAttribute( name ); + else + this.setAttribute( name, value ); + + return null; + } + }); + +( function() +{ + var sides = { + width : [ "border-left-width", "border-right-width","padding-left", "padding-right" ], + height : [ "border-top-width", "border-bottom-width", "padding-top", "padding-bottom" ] + }; + + function marginAndPaddingSize( type ) + { + var adjustment = 0; + for ( var i = 0, len = sides[ type ].length; i < len; i++ ) + adjustment += parseInt( this.getComputedStyle( sides [ type ][ i ] ) || 0, 10 ) || 0; + return adjustment; + } + + /** + * Update the element's size with box model awareness. + * @name CKEDITOR.dom.element.setSize + * @param {String} type [width|height] + * @param {Number} size The length unit in px. + * @param isBorderBox Apply the {@param width} and {@param height} based on border box model. + */ + CKEDITOR.dom.element.prototype.setSize = function( type, size, isBorderBox ) + { + if ( typeof size == 'number' ) + { + if ( isBorderBox && !( CKEDITOR.env.ie && CKEDITOR.env.quirks ) ) + size -= marginAndPaddingSize.call( this, type ); + + this.setStyle( type, size + 'px' ); + } + }; + + /** + * Get the element's size, possibly with box model awareness. + * @name CKEDITOR.dom.element.getSize + * @param {String} type [width|height] + * @param {Boolean} contentSize Get the {@param width} or {@param height} based on border box model. + */ + CKEDITOR.dom.element.prototype.getSize = function( type, contentSize ) + { + var size = Math.max( this.$[ 'offset' + CKEDITOR.tools.capitalize( type ) ], + this.$[ 'client' + CKEDITOR.tools.capitalize( type ) ] ) || 0; + + if ( contentSize ) + size -= marginAndPaddingSize.call( this, type ); + + return size; + }; +})(); diff --git a/library/custom_template/ckeditor/_source/core/dom/elementpath.js b/library/custom_template/ckeditor/_source/core/dom/elementpath.js new file mode 100644 index 000000000..31bbdee2f --- /dev/null +++ b/library/custom_template/ckeditor/_source/core/dom/elementpath.js @@ -0,0 +1,119 @@ +/* +Copyright (c) 2003-2011, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.html or http://ckeditor.com/license +*/ + +(function() +{ + // Elements that may be considered the "Block boundary" in an element path. + var pathBlockElements = { 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, legend:1 }; + + // Elements that may be considered the "Block limit" in an element path. + var pathBlockLimitElements = { body:1,div:1,table:1,tbody:1,tr:1,td:1,th:1,caption:1,form:1,fieldset:1 }; + + // Check if an element contains any block element. + var checkHasBlock = function( element ) + { + var childNodes = element.getChildren(); + + for ( var i = 0, count = childNodes.count() ; i < count ; i++ ) + { + var child = childNodes.getItem( i ); + + if ( child.type == CKEDITOR.NODE_ELEMENT && CKEDITOR.dtd.$block[ child.getName() ] ) + return true; + } + + return false; + }; + + /** + * @class + */ + CKEDITOR.dom.elementPath = function( lastNode ) + { + var block = null; + var blockLimit = null; + var elements = []; + + var e = lastNode; + + while ( e ) + { + if ( e.type == CKEDITOR.NODE_ELEMENT ) + { + if ( !this.lastElement ) + this.lastElement = e; + + var elementName = e.getName(); + if ( CKEDITOR.env.ie && e.$.scopeName != 'HTML' ) + elementName = e.$.scopeName.toLowerCase() + ':' + elementName; + + if ( !blockLimit ) + { + if ( !block && pathBlockElements[ elementName ] ) + block = e; + + if ( pathBlockLimitElements[ elementName ] ) + { + // DIV is considered the Block, if no block is available (#525) + // and if it doesn't contain other blocks. + if ( !block && elementName == 'div' && !checkHasBlock( e ) ) + block = e; + else + blockLimit = e; + } + } + + elements.push( e ); + + if ( elementName == 'body' ) + break; + } + e = e.getParent(); + } + + this.block = block; + this.blockLimit = blockLimit; + this.elements = elements; + }; +})(); + +CKEDITOR.dom.elementPath.prototype = +{ + /** + * Compares this element path with another one. + * @param {CKEDITOR.dom.elementPath} otherPath The elementPath object to be + * compared with this one. + * @returns {Boolean} "true" if the paths are equal, containing the same + * number of elements and the same elements in the same order. + */ + compare : function( otherPath ) + { + var thisElements = this.elements; + var otherElements = otherPath && otherPath.elements; + + if ( !otherElements || thisElements.length != otherElements.length ) + return false; + + for ( var i = 0 ; i < thisElements.length ; i++ ) + { + if ( !thisElements[ i ].equals( otherElements[ i ] ) ) + return false; + } + + return true; + }, + + contains : function( tagNames ) + { + var elements = this.elements; + for ( var i = 0 ; i < elements.length ; i++ ) + { + if ( elements[ i ].getName() in tagNames ) + return elements[ i ]; + } + + return null; + } +}; diff --git a/library/custom_template/ckeditor/_source/core/dom/event.js b/library/custom_template/ckeditor/_source/core/dom/event.js new file mode 100644 index 000000000..3666e3c6e --- /dev/null +++ b/library/custom_template/ckeditor/_source/core/dom/event.js @@ -0,0 +1,142 @@ +/* +Copyright (c) 2003-2011, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.html or http://ckeditor.com/license +*/ + +/** + * @fileOverview Defines the {@link CKEDITOR.dom.event} class, which + * represents the a native DOM event object. + */ + +/** + * Represents a native DOM event object. + * @constructor + * @param {Object} domEvent A native DOM event object. + * @example + */ +CKEDITOR.dom.event = function( domEvent ) +{ + /** + * The native DOM event object represented by this class instance. + * @type Object + * @example + */ + this.$ = domEvent; +}; + +CKEDITOR.dom.event.prototype = +{ + /** + * Gets the key code associated to the event. + * @returns {Number} The key code. + * @example + * alert( event.getKey() ); "65" is "a" has been pressed + */ + getKey : function() + { + return this.$.keyCode || this.$.which; + }, + + /** + * Gets a number represeting the combination of the keys pressed during the + * event. It is the sum with the current key code and the {@link CKEDITOR.CTRL}, + * {@link CKEDITOR.SHIFT} and {@link CKEDITOR.ALT} constants. + * @returns {Number} The number representing the keys combination. + * @example + * alert( event.getKeystroke() == 65 ); // "a" key + * alert( event.getKeystroke() == CKEDITOR.CTRL + 65 ); // CTRL + "a" key + * alert( event.getKeystroke() == CKEDITOR.CTRL + CKEDITOR.SHIFT + 65 ); // CTRL + SHIFT + "a" key + */ + getKeystroke : function() + { + var keystroke = this.getKey(); + + if ( this.$.ctrlKey || this.$.metaKey ) + keystroke += CKEDITOR.CTRL; + + if ( this.$.shiftKey ) + keystroke += CKEDITOR.SHIFT; + + if ( this.$.altKey ) + keystroke += CKEDITOR.ALT; + + return keystroke; + }, + + /** + * Prevents the original behavior of the event to happen. It can optionally + * stop propagating the event in the event chain. + * @param {Boolean} [stopPropagation] Stop propagating this event in the + * event chain. + * @example + * var element = CKEDITOR.document.getById( 'myElement' ); + * element.on( 'click', function( ev ) + * { + * // The DOM event object is passed by the "data" property. + * var domEvent = ev.data; + * // Prevent the click to chave any effect in the element. + * domEvent.preventDefault(); + * }); + */ + preventDefault : function( stopPropagation ) + { + var $ = this.$; + if ( $.preventDefault ) + $.preventDefault(); + else + $.returnValue = false; + + if ( stopPropagation ) + this.stopPropagation(); + }, + + stopPropagation : function() + { + var $ = this.$; + if ( $.stopPropagation ) + $.stopPropagation(); + else + $.cancelBubble = true; + }, + + /** + * Returns the DOM node where the event was targeted to. + * @returns {CKEDITOR.dom.node} The target DOM node. + * @example + * var element = CKEDITOR.document.getById( 'myElement' ); + * element.on( 'click', function( ev ) + * { + * // The DOM event object is passed by the "data" property. + * var domEvent = ev.data; + * // Add a CSS class to the event target. + * domEvent.getTarget().addClass( 'clicked' ); + * }); + */ + + getTarget : function() + { + var rawNode = this.$.target || this.$.srcElement; + return rawNode ? new CKEDITOR.dom.node( rawNode ) : null; + } +}; + +/** + * CTRL key (1000). + * @constant + * @example + */ +CKEDITOR.CTRL = 1000; + +/** + * SHIFT key (2000). + * @constant + * @example + */ +CKEDITOR.SHIFT = 2000; + +/** + * ALT key (4000). + * @constant + * @example + */ +CKEDITOR.ALT = 4000; diff --git a/library/custom_template/ckeditor/_source/core/dom/node.js b/library/custom_template/ckeditor/_source/core/dom/node.js new file mode 100644 index 000000000..2a47d34b4 --- /dev/null +++ b/library/custom_template/ckeditor/_source/core/dom/node.js @@ -0,0 +1,696 @@ +/* +Copyright (c) 2003-2011, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.html or http://ckeditor.com/license +*/ + +/** + * @fileOverview Defines the {@link CKEDITOR.dom.node} class, which is the base + * class for classes that represent DOM nodes. + */ + +/** + * Base class for classes representing DOM nodes. This constructor may return + * and instance of classes that inherits this class, like + * {@link CKEDITOR.dom.element} or {@link CKEDITOR.dom.text}. + * @augments CKEDITOR.dom.domObject + * @param {Object} domNode A native DOM node. + * @constructor + * @see CKEDITOR.dom.element + * @see CKEDITOR.dom.text + * @example + */ +CKEDITOR.dom.node = function( domNode ) +{ + if ( domNode ) + { + switch ( domNode.nodeType ) + { + // Safari don't consider document as element node type. (#3389) + case CKEDITOR.NODE_DOCUMENT : + return new CKEDITOR.dom.document( domNode ); + + case CKEDITOR.NODE_ELEMENT : + return new CKEDITOR.dom.element( domNode ); + + case CKEDITOR.NODE_TEXT : + return new CKEDITOR.dom.text( domNode ); + } + + // Call the base constructor. + CKEDITOR.dom.domObject.call( this, domNode ); + } + + return this; +}; + +CKEDITOR.dom.node.prototype = new CKEDITOR.dom.domObject(); + +/** + * Element node type. + * @constant + * @example + */ +CKEDITOR.NODE_ELEMENT = 1; + +/** + * Document node type. + * @constant + * @example + */ +CKEDITOR.NODE_DOCUMENT = 9; + +/** + * Text node type. + * @constant + * @example + */ +CKEDITOR.NODE_TEXT = 3; + +/** + * Comment node type. + * @constant + * @example + */ +CKEDITOR.NODE_COMMENT = 8; + +CKEDITOR.NODE_DOCUMENT_FRAGMENT = 11; + +CKEDITOR.POSITION_IDENTICAL = 0; +CKEDITOR.POSITION_DISCONNECTED = 1; +CKEDITOR.POSITION_FOLLOWING = 2; +CKEDITOR.POSITION_PRECEDING = 4; +CKEDITOR.POSITION_IS_CONTAINED = 8; +CKEDITOR.POSITION_CONTAINS = 16; + +CKEDITOR.tools.extend( CKEDITOR.dom.node.prototype, + /** @lends CKEDITOR.dom.node.prototype */ + { + /** + * Makes this node child of another element. + * @param {CKEDITOR.dom.element} element The target element to which append + * this node. + * @returns {CKEDITOR.dom.element} The target element. + * @example + * var p = new CKEDITOR.dom.element( 'p' ); + * var strong = new CKEDITOR.dom.element( 'strong' ); + * strong.appendTo( p ); + * + * // result: "<p><strong></strong></p>" + */ + appendTo : function( element, toStart ) + { + element.append( this, toStart ); + return element; + }, + + clone : function( includeChildren, cloneId ) + { + var $clone = this.$.cloneNode( includeChildren ); + + var removeIds = function( node ) + { + if ( node.nodeType != CKEDITOR.NODE_ELEMENT ) + return; + + if ( !cloneId ) + node.removeAttribute( 'id', false ); + node.removeAttribute( 'data-cke-expando', false ); + + if ( includeChildren ) + { + var childs = node.childNodes; + for ( var i=0; i < childs.length; i++ ) + removeIds( childs[ i ] ); + } + }; + + // The "id" attribute should never be cloned to avoid duplication. + removeIds( $clone ); + + return new CKEDITOR.dom.node( $clone ); + }, + + hasPrevious : function() + { + return !!this.$.previousSibling; + }, + + hasNext : function() + { + return !!this.$.nextSibling; + }, + + /** + * Inserts this element after a node. + * @param {CKEDITOR.dom.node} node The that will preceed this element. + * @returns {CKEDITOR.dom.node} The node preceeding this one after + * insertion. + * @example + * var em = new CKEDITOR.dom.element( 'em' ); + * var strong = new CKEDITOR.dom.element( 'strong' ); + * strong.insertAfter( em ); + * + * // result: "<em></em><strong></strong>" + */ + insertAfter : function( node ) + { + node.$.parentNode.insertBefore( this.$, node.$.nextSibling ); + return node; + }, + + /** + * Inserts this element before a node. + * @param {CKEDITOR.dom.node} node The that will be after this element. + * @returns {CKEDITOR.dom.node} The node being inserted. + * @example + * var em = new CKEDITOR.dom.element( 'em' ); + * var strong = new CKEDITOR.dom.element( 'strong' ); + * strong.insertBefore( em ); + * + * // result: "<strong></strong><em></em>" + */ + insertBefore : function( node ) + { + node.$.parentNode.insertBefore( this.$, node.$ ); + return node; + }, + + insertBeforeMe : function( node ) + { + this.$.parentNode.insertBefore( node.$, this.$ ); + return node; + }, + + /** + * Retrieves a uniquely identifiable tree address for this node. + * The tree address returns is an array of integers, with each integer + * indicating a child index of a DOM node, starting from + * document.documentElement. + * + * For example, assuming is the second child from ( + * being the first), and we'd like to address the third child under the + * fourth child of body, the tree address returned would be: + * [1, 3, 2] + * + * The tree address cannot be used for finding back the DOM tree node once + * the DOM tree structure has been modified. + */ + getAddress : function( normalized ) + { + var address = []; + var $documentElement = this.getDocument().$.documentElement; + var node = this.$; + + while ( node && node != $documentElement ) + { + var parentNode = node.parentNode; + var currentIndex = -1; + + if ( parentNode ) + { + for ( var i = 0 ; i < parentNode.childNodes.length ; i++ ) + { + var candidate = parentNode.childNodes[i]; + + if ( normalized && + candidate.nodeType == 3 && + candidate.previousSibling && + candidate.previousSibling.nodeType == 3 ) + { + continue; + } + + currentIndex++; + + if ( candidate == node ) + break; + } + + address.unshift( currentIndex ); + } + + node = parentNode; + } + + return address; + }, + + /** + * Gets the document containing this element. + * @returns {CKEDITOR.dom.document} The document. + * @example + * var element = CKEDITOR.document.getById( 'example' ); + * alert( element.getDocument().equals( CKEDITOR.document ) ); // "true" + */ + getDocument : function() + { + return new CKEDITOR.dom.document( this.$.ownerDocument || this.$.parentNode.ownerDocument ); + }, + + getIndex : function() + { + var $ = this.$; + + var currentNode = $.parentNode && $.parentNode.firstChild; + var currentIndex = -1; + + while ( currentNode ) + { + currentIndex++; + + if ( currentNode == $ ) + return currentIndex; + + currentNode = currentNode.nextSibling; + } + + return -1; + }, + + getNextSourceNode : function( startFromSibling, nodeType, guard ) + { + // If "guard" is a node, transform it in a function. + if ( guard && !guard.call ) + { + var guardNode = guard; + guard = function( node ) + { + return !node.equals( guardNode ); + }; + } + + var node = ( !startFromSibling && this.getFirst && this.getFirst() ), + parent; + + // Guarding when we're skipping the current element( no children or 'startFromSibling' ). + // send the 'moving out' signal even we don't actually dive into. + if ( !node ) + { + if ( this.type == CKEDITOR.NODE_ELEMENT && guard && guard( this, true ) === false ) + return null; + node = this.getNext(); + } + + while ( !node && ( parent = ( parent || this ).getParent() ) ) + { + // The guard check sends the "true" paramenter to indicate that + // we are moving "out" of the element. + if ( guard && guard( parent, true ) === false ) + return null; + + node = parent.getNext(); + } + + if ( !node ) + return null; + + if ( guard && guard( node ) === false ) + return null; + + if ( nodeType && nodeType != node.type ) + return node.getNextSourceNode( false, nodeType, guard ); + + return node; + }, + + getPreviousSourceNode : function( startFromSibling, nodeType, guard ) + { + if ( guard && !guard.call ) + { + var guardNode = guard; + guard = function( node ) + { + return !node.equals( guardNode ); + }; + } + + var node = ( !startFromSibling && this.getLast && this.getLast() ), + parent; + + // Guarding when we're skipping the current element( no children or 'startFromSibling' ). + // send the 'moving out' signal even we don't actually dive into. + if ( !node ) + { + if ( this.type == CKEDITOR.NODE_ELEMENT && guard && guard( this, true ) === false ) + return null; + node = this.getPrevious(); + } + + while ( !node && ( parent = ( parent || this ).getParent() ) ) + { + // The guard check sends the "true" paramenter to indicate that + // we are moving "out" of the element. + if ( guard && guard( parent, true ) === false ) + return null; + + node = parent.getPrevious(); + } + + if ( !node ) + return null; + + if ( guard && guard( node ) === false ) + return null; + + if ( nodeType && node.type != nodeType ) + return node.getPreviousSourceNode( false, nodeType, guard ); + + return node; + }, + + getPrevious : function( evaluator ) + { + var previous = this.$, retval; + do + { + previous = previous.previousSibling; + retval = previous && new CKEDITOR.dom.node( previous ); + } + while ( retval && evaluator && !evaluator( retval ) ) + return retval; + }, + + /** + * Gets the node that follows this element in its parent's child list. + * @param {Function} evaluator Filtering the result node. + * @returns {CKEDITOR.dom.node} The next node or null if not available. + * @example + * var element = CKEDITOR.dom.element.createFromHtml( '<div><b>Example</b> <i>next</i></div>' ); + * var first = element.getFirst().getNext(); + * alert( first.getName() ); // "i" + */ + getNext : function( evaluator ) + { + var next = this.$, retval; + do + { + next = next.nextSibling; + retval = next && new CKEDITOR.dom.node( next ); + } + while ( retval && evaluator && !evaluator( retval ) ) + return retval; + }, + + /** + * Gets the parent element for this node. + * @returns {CKEDITOR.dom.element} The parent element. + * @example + * var node = editor.document.getBody().getFirst(); + * var parent = node.getParent(); + * alert( node.getName() ); // "body" + */ + getParent : function() + { + var parent = this.$.parentNode; + return ( parent && parent.nodeType == 1 ) ? new CKEDITOR.dom.node( parent ) : null; + }, + + getParents : function( closerFirst ) + { + var node = this; + var parents = []; + + do + { + parents[ closerFirst ? 'push' : 'unshift' ]( node ); + } + while ( ( node = node.getParent() ) ) + + return parents; + }, + + getCommonAncestor : function( node ) + { + if ( node.equals( this ) ) + return this; + + if ( node.contains && node.contains( this ) ) + return node; + + var start = this.contains ? this : this.getParent(); + + do + { + if ( start.contains( node ) ) + return start; + } + while ( ( start = start.getParent() ) ); + + return null; + }, + + getPosition : function( otherNode ) + { + var $ = this.$; + var $other = otherNode.$; + + if ( $.compareDocumentPosition ) + return $.compareDocumentPosition( $other ); + + // IE and Safari have no support for compareDocumentPosition. + + if ( $ == $other ) + return CKEDITOR.POSITION_IDENTICAL; + + // Only element nodes support contains and sourceIndex. + if ( this.type == CKEDITOR.NODE_ELEMENT && otherNode.type == CKEDITOR.NODE_ELEMENT ) + { + if ( $.contains ) + { + if ( $.contains( $other ) ) + return CKEDITOR.POSITION_CONTAINS + CKEDITOR.POSITION_PRECEDING; + + if ( $other.contains( $ ) ) + return CKEDITOR.POSITION_IS_CONTAINED + CKEDITOR.POSITION_FOLLOWING; + } + + if ( 'sourceIndex' in $ ) + { + return ( $.sourceIndex < 0 || $other.sourceIndex < 0 ) ? CKEDITOR.POSITION_DISCONNECTED : + ( $.sourceIndex < $other.sourceIndex ) ? CKEDITOR.POSITION_PRECEDING : + CKEDITOR.POSITION_FOLLOWING; + } + } + + // For nodes that don't support compareDocumentPosition, contains + // or sourceIndex, their "address" is compared. + + var addressOfThis = this.getAddress(), + addressOfOther = otherNode.getAddress(), + minLevel = Math.min( addressOfThis.length, addressOfOther.length ); + + // Determinate preceed/follow relationship. + for ( var i = 0 ; i <= minLevel - 1 ; i++ ) + { + if ( addressOfThis[ i ] != addressOfOther[ i ] ) + { + if ( i < minLevel ) + { + return addressOfThis[ i ] < addressOfOther[ i ] ? + CKEDITOR.POSITION_PRECEDING : CKEDITOR.POSITION_FOLLOWING; + } + break; + } + } + + // Determinate contains/contained relationship. + return ( addressOfThis.length < addressOfOther.length ) ? + CKEDITOR.POSITION_CONTAINS + CKEDITOR.POSITION_PRECEDING : + CKEDITOR.POSITION_IS_CONTAINED + CKEDITOR.POSITION_FOLLOWING; + }, + + /** + * Gets the closes ancestor node of a specified node name. + * @param {String} name Node name of ancestor node. + * @param {Boolean} includeSelf (Optional) Whether to include the current + * node in the calculation or not. + * @returns {CKEDITOR.dom.node} Ancestor node. + */ + getAscendant : function( name, includeSelf ) + { + var $ = this.$; + + if ( !includeSelf ) + $ = $.parentNode; + + while ( $ ) + { + if ( $.nodeName && $.nodeName.toLowerCase() == name ) + return new CKEDITOR.dom.node( $ ); + + $ = $.parentNode; + } + return null; + }, + + hasAscendant : function( name, includeSelf ) + { + var $ = this.$; + + if ( !includeSelf ) + $ = $.parentNode; + + while ( $ ) + { + if ( $.nodeName && $.nodeName.toLowerCase() == name ) + return true; + + $ = $.parentNode; + } + return false; + }, + + move : function( target, toStart ) + { + target.append( this.remove(), toStart ); + }, + + /** + * Removes this node from the document DOM. + * @param {Boolean} [preserveChildren] Indicates that the children + * elements must remain in the document, removing only the outer + * tags. + * @example + * var element = CKEDITOR.dom.element.getById( 'MyElement' ); + * element.remove(); + */ + remove : function( preserveChildren ) + { + var $ = this.$; + var parent = $.parentNode; + + if ( parent ) + { + if ( preserveChildren ) + { + // Move all children before the node. + for ( var child ; ( child = $.firstChild ) ; ) + { + parent.insertBefore( $.removeChild( child ), $ ); + } + } + + parent.removeChild( $ ); + } + + return this; + }, + + replace : function( nodeToReplace ) + { + this.insertBefore( nodeToReplace ); + nodeToReplace.remove(); + }, + + trim : function() + { + this.ltrim(); + this.rtrim(); + }, + + ltrim : function() + { + var child; + while ( this.getFirst && ( child = this.getFirst() ) ) + { + if ( child.type == CKEDITOR.NODE_TEXT ) + { + var trimmed = CKEDITOR.tools.ltrim( child.getText() ), + originalLength = child.getLength(); + + if ( !trimmed ) + { + child.remove(); + continue; + } + else if ( trimmed.length < originalLength ) + { + child.split( originalLength - trimmed.length ); + + // IE BUG: child.remove() may raise JavaScript errors here. (#81) + this.$.removeChild( this.$.firstChild ); + } + } + break; + } + }, + + rtrim : function() + { + var child; + while ( this.getLast && ( child = this.getLast() ) ) + { + if ( child.type == CKEDITOR.NODE_TEXT ) + { + var trimmed = CKEDITOR.tools.rtrim( child.getText() ), + originalLength = child.getLength(); + + if ( !trimmed ) + { + child.remove(); + continue; + } + else if ( trimmed.length < originalLength ) + { + child.split( trimmed.length ); + + // IE BUG: child.getNext().remove() may raise JavaScript errors here. + // (#81) + this.$.lastChild.parentNode.removeChild( this.$.lastChild ); + } + } + break; + } + + if ( !CKEDITOR.env.ie && !CKEDITOR.env.opera ) + { + child = this.$.lastChild; + + if ( child && child.type == 1 && child.nodeName.toLowerCase() == 'br' ) + { + // Use "eChildNode.parentNode" instead of "node" to avoid IE bug (#324). + child.parentNode.removeChild( child ) ; + } + } + }, + + /** + * Checks is this node is read-only (should not be changed). It + * additionaly returns the element, if any, which defines the read-only + * state of this node. It may be the node itself or any of its parent + * nodes. + * @returns {CKEDITOR.dom.element|Boolean} An element containing + * read-only attributes or "false" if none is found. + * @since 3.5 + * @example + * // For the following HTML: + * // <div contenteditable="false">Some <b>text</b></div> + * + * // If "ele" is the above <div> + * ele.isReadOnly(); // the <div> element + * + * // If "ele" is the above <b> + * ele.isReadOnly(); // the <div> element + */ + isReadOnly : function() + { + var current = this; + while( current ) + { + if ( current.type == CKEDITOR.NODE_ELEMENT ) + { + if ( current.is( 'body' ) || !!current.data( 'cke-editable' ) ) + break; + + if ( current.getAttribute( 'contentEditable' ) == 'false' ) + return current; + else if ( current.getAttribute( 'contentEditable' ) == 'true' ) + break; + } + current = current.getParent(); + } + + return false; + } + } +); diff --git a/library/custom_template/ckeditor/_source/core/dom/nodelist.js b/library/custom_template/ckeditor/_source/core/dom/nodelist.js new file mode 100644 index 000000000..08926bf17 --- /dev/null +++ b/library/custom_template/ckeditor/_source/core/dom/nodelist.js @@ -0,0 +1,26 @@ +/* +Copyright (c) 2003-2011, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.html or http://ckeditor.com/license +*/ + +/** + * @class + */ +CKEDITOR.dom.nodeList = function( nativeList ) +{ + this.$ = nativeList; +}; + +CKEDITOR.dom.nodeList.prototype = +{ + count : function() + { + return this.$.length; + }, + + getItem : function( index ) + { + var $node = this.$[ index ]; + return $node ? new CKEDITOR.dom.node( $node ) : null; + } +}; diff --git a/library/custom_template/ckeditor/_source/core/dom/range.js b/library/custom_template/ckeditor/_source/core/dom/range.js new file mode 100644 index 000000000..974999ed3 --- /dev/null +++ b/library/custom_template/ckeditor/_source/core/dom/range.js @@ -0,0 +1,1953 @@ +/* +Copyright (c) 2003-2011, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.html or http://ckeditor.com/license +*/ + +/** + * @class + */ +CKEDITOR.dom.range = function( document ) +{ + this.startContainer = null; + this.startOffset = null; + this.endContainer = null; + this.endOffset = null; + this.collapsed = true; + + this.document = document; +}; + +(function() +{ + // Updates the "collapsed" property for the given range object. + var updateCollapsed = function( range ) + { + range.collapsed = ( + range.startContainer && + range.endContainer && + range.startContainer.equals( range.endContainer ) && + range.startOffset == range.endOffset ); + }; + + // This is a shared function used to delete, extract and clone the range + // contents. + // V2 + var execContentsAction = function( range, action, docFrag, mergeThen ) + { + range.optimizeBookmark(); + + var startNode = range.startContainer; + var endNode = range.endContainer; + + var startOffset = range.startOffset; + var endOffset = range.endOffset; + + var removeStartNode; + var removeEndNode; + + // For text containers, we must simply split the node and point to the + // second part. The removal will be handled by the rest of the code . + if ( endNode.type == CKEDITOR.NODE_TEXT ) + endNode = endNode.split( endOffset ); + else + { + // If the end container has children and the offset is pointing + // to a child, then we should start from it. + if ( endNode.getChildCount() > 0 ) + { + // If the offset points after the last node. + if ( endOffset >= endNode.getChildCount() ) + { + // Let's create a temporary node and mark it for removal. + endNode = endNode.append( range.document.createText( '' ) ); + removeEndNode = true; + } + else + endNode = endNode.getChild( endOffset ); + } + } + + // For text containers, we must simply split the node. The removal will + // be handled by the rest of the code . + if ( startNode.type == CKEDITOR.NODE_TEXT ) + { + startNode.split( startOffset ); + + // In cases the end node is the same as the start node, the above + // splitting will also split the end, so me must move the end to + // the second part of the split. + if ( startNode.equals( endNode ) ) + endNode = startNode.getNext(); + } + else + { + // If the start container has children and the offset is pointing + // to a child, then we should start from its previous sibling. + + // If the offset points to the first node, we don't have a + // sibling, so let's use the first one, but mark it for removal. + if ( !startOffset ) + { + // Let's create a temporary node and mark it for removal. + startNode = startNode.getFirst().insertBeforeMe( range.document.createText( '' ) ); + removeStartNode = true; + } + else if ( startOffset >= startNode.getChildCount() ) + { + // Let's create a temporary node and mark it for removal. + startNode = startNode.append( range.document.createText( '' ) ); + removeStartNode = true; + } + else + startNode = startNode.getChild( startOffset ).getPrevious(); + } + + // Get the parent nodes tree for the start and end boundaries. + var startParents = startNode.getParents(); + var endParents = endNode.getParents(); + + // Compare them, to find the top most siblings. + var i, topStart, topEnd; + + for ( i = 0 ; i < startParents.length ; i++ ) + { + topStart = startParents[ i ]; + topEnd = endParents[ i ]; + + // The compared nodes will match until we find the top most + // siblings (different nodes that have the same parent). + // "i" will hold the index in the parents array for the top + // most element. + if ( !topStart.equals( topEnd ) ) + break; + } + + var clone = docFrag, levelStartNode, levelClone, currentNode, currentSibling; + + // Remove all successive sibling nodes for every node in the + // startParents tree. + for ( var j = i ; j < startParents.length ; j++ ) + { + levelStartNode = startParents[j]; + + // For Extract and Clone, we must clone this level. + if ( clone && !levelStartNode.equals( startNode ) ) // action = 0 = Delete + levelClone = clone.append( levelStartNode.clone() ); + + currentNode = levelStartNode.getNext(); + + while ( currentNode ) + { + // Stop processing when the current node matches a node in the + // endParents tree or if it is the endNode. + if ( currentNode.equals( endParents[ j ] ) || currentNode.equals( endNode ) ) + break; + + // Cache the next sibling. + currentSibling = currentNode.getNext(); + + // If cloning, just clone it. + if ( action == 2 ) // 2 = Clone + clone.append( currentNode.clone( true ) ); + else + { + // Both Delete and Extract will remove the node. + currentNode.remove(); + + // When Extracting, move the removed node to the docFrag. + if ( action == 1 ) // 1 = Extract + clone.append( currentNode ); + } + + currentNode = currentSibling; + } + + if ( clone ) + clone = levelClone; + } + + clone = docFrag; + + // Remove all previous sibling nodes for every node in the + // endParents tree. + for ( var k = i ; k < endParents.length ; k++ ) + { + levelStartNode = endParents[ k ]; + + // For Extract and Clone, we must clone this level. + if ( action > 0 && !levelStartNode.equals( endNode ) ) // action = 0 = Delete + levelClone = clone.append( levelStartNode.clone() ); + + // The processing of siblings may have already been done by the parent. + if ( !startParents[ k ] || levelStartNode.$.parentNode != startParents[ k ].$.parentNode ) + { + currentNode = levelStartNode.getPrevious(); + + while ( currentNode ) + { + // Stop processing when the current node matches a node in the + // startParents tree or if it is the startNode. + if ( currentNode.equals( startParents[ k ] ) || currentNode.equals( startNode ) ) + break; + + // Cache the next sibling. + currentSibling = currentNode.getPrevious(); + + // If cloning, just clone it. + if ( action == 2 ) // 2 = Clone + clone.$.insertBefore( currentNode.$.cloneNode( true ), clone.$.firstChild ) ; + else + { + // Both Delete and Extract will remove the node. + currentNode.remove(); + + // When Extracting, mode the removed node to the docFrag. + if ( action == 1 ) // 1 = Extract + clone.$.insertBefore( currentNode.$, clone.$.firstChild ); + } + + currentNode = currentSibling; + } + } + + if ( clone ) + clone = levelClone; + } + + if ( action == 2 ) // 2 = Clone. + { + // No changes in the DOM should be done, so fix the split text (if any). + + var startTextNode = range.startContainer; + if ( startTextNode.type == CKEDITOR.NODE_TEXT ) + { + startTextNode.$.data += startTextNode.$.nextSibling.data; + startTextNode.$.parentNode.removeChild( startTextNode.$.nextSibling ); + } + + var endTextNode = range.endContainer; + if ( endTextNode.type == CKEDITOR.NODE_TEXT && endTextNode.$.nextSibling ) + { + endTextNode.$.data += endTextNode.$.nextSibling.data; + endTextNode.$.parentNode.removeChild( endTextNode.$.nextSibling ); + } + } + else + { + // Collapse the range. + + // If a node has been partially selected, collapse the range between + // topStart and topEnd. Otherwise, simply collapse it to the start. (W3C specs). + if ( topStart && topEnd && ( startNode.$.parentNode != topStart.$.parentNode || endNode.$.parentNode != topEnd.$.parentNode ) ) + { + var endIndex = topEnd.getIndex(); + + // If the start node is to be removed, we must correct the + // index to reflect the removal. + if ( removeStartNode && topEnd.$.parentNode == startNode.$.parentNode ) + endIndex--; + + // Merge splitted parents. + if ( mergeThen && topStart.type == CKEDITOR.NODE_ELEMENT ) + { + var span = CKEDITOR.dom.element.createFromHtml( ' ', range.document ); + span.insertAfter( topStart ); + topStart.mergeSiblings( false ); + range.moveToBookmark( { startNode : span } ); + } + else + range.setStart( topEnd.getParent(), endIndex ); + } + + // Collapse it to the start. + range.collapse( true ); + } + + // Cleanup any marked node. + if ( removeStartNode ) + startNode.remove(); + + if ( removeEndNode && endNode.$.parentNode ) + endNode.remove(); + }; + + var inlineChildReqElements = { 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 }; + + // Creates the appropriate node evaluator for the dom walker used inside + // check(Start|End)OfBlock. + function getCheckStartEndBlockEvalFunction( isStart ) + { + var hadBr = false, bookmarkEvaluator = CKEDITOR.dom.walker.bookmark( true ); + return function( node ) + { + // First ignore bookmark nodes. + if ( bookmarkEvaluator( node ) ) + return true; + + if ( node.type == CKEDITOR.NODE_TEXT ) + { + // If there's any visible text, then we're not at the start. + if ( CKEDITOR.tools.trim( node.getText() ).length ) + return false; + } + else if ( node.type == CKEDITOR.NODE_ELEMENT ) + { + // If there are non-empty inline elements (e.g. ), then we're not + // at the start. + if ( !inlineChildReqElements[ node.getName() ] ) + { + // If we're working at the end-of-block, forgive the first
    in non-IE + // browsers. + if ( !isStart && !CKEDITOR.env.ie && node.getName() == 'br' && !hadBr ) + hadBr = true; + else + return false; + } + } + return true; + }; + } + + // Evaluator for CKEDITOR.dom.element::checkBoundaryOfElement, reject any + // text node and non-empty elements unless it's being bookmark text. + function elementBoundaryEval( node ) + { + // Reject any text node unless it's being bookmark + // OR it's spaces. (#3883) + return node.type != CKEDITOR.NODE_TEXT + && node.getName() in CKEDITOR.dtd.$removeEmpty + || !CKEDITOR.tools.trim( node.getText() ) + || !!node.getParent().data( 'cke-bookmark' ); + } + + var whitespaceEval = new CKEDITOR.dom.walker.whitespaces(), + bookmarkEval = new CKEDITOR.dom.walker.bookmark(); + + function nonWhitespaceOrBookmarkEval( node ) + { + // Whitespaces and bookmark nodes are to be ignored. + return !whitespaceEval( node ) && !bookmarkEval( node ); + } + + CKEDITOR.dom.range.prototype = + { + clone : function() + { + var clone = new CKEDITOR.dom.range( this.document ); + + clone.startContainer = this.startContainer; + clone.startOffset = this.startOffset; + clone.endContainer = this.endContainer; + clone.endOffset = this.endOffset; + clone.collapsed = this.collapsed; + + return clone; + }, + + collapse : function( toStart ) + { + if ( toStart ) + { + this.endContainer = this.startContainer; + this.endOffset = this.startOffset; + } + else + { + this.startContainer = this.endContainer; + this.startOffset = this.endOffset; + } + + this.collapsed = true; + }, + + /** + * The content nodes of the range are cloned and added to a document fragment, which is returned. + * Note: Text selection may lost after invoking this method. (caused by text node splitting). + */ + cloneContents : function() + { + var docFrag = new CKEDITOR.dom.documentFragment( this.document ); + + if ( !this.collapsed ) + execContentsAction( this, 2, docFrag ); + + return docFrag; + }, + + /** + * Deletes the content nodes of the range permanently from the DOM tree. + * @param {Boolean} [mergeThen] Merge any splitted elements result in DOM true due to partial selection. + */ + deleteContents : function( mergeThen ) + { + if ( this.collapsed ) + return; + + execContentsAction( this, 0, null, mergeThen ); + }, + + /** + * The content nodes of the range are cloned and added to a document fragment, + * meanwhile they're removed permanently from the DOM tree. + * @param {Boolean} [mergeThen] Merge any splitted elements result in DOM true due to partial selection. + */ + extractContents : function( mergeThen ) + { + var docFrag = new CKEDITOR.dom.documentFragment( this.document ); + + if ( !this.collapsed ) + execContentsAction( this, 1, docFrag, mergeThen ); + + return docFrag; + }, + + /** + * Creates a bookmark object, which can be later used to restore the + * range by using the moveToBookmark function. + * This is an "intrusive" way to create a bookmark. It includes tags + * in the range boundaries. The advantage of it is that it is possible to + * handle DOM mutations when moving back to the bookmark. + * Attention: the inclusion of nodes in the DOM is a design choice and + * should not be changed as there are other points in the code that may be + * using those nodes to perform operations. See GetBookmarkNode. + * @param {Boolean} [serializable] Indicates that the bookmark nodes + * must contain ids, which can be used to restore the range even + * when these nodes suffer mutations (like a clonation or innerHTML + * change). + * @returns {Object} And object representing a bookmark. + */ + createBookmark : function( serializable ) + { + var startNode, endNode; + var baseId; + var clone; + var collapsed = this.collapsed; + + startNode = this.document.createElement( 'span' ); + startNode.data( 'cke-bookmark', 1 ); + startNode.setStyle( 'display', 'none' ); + + // For IE, it must have something inside, otherwise it may be + // removed during DOM operations. + startNode.setHtml( ' ' ); + + if ( serializable ) + { + baseId = 'cke_bm_' + CKEDITOR.tools.getNextNumber(); + startNode.setAttribute( 'id', baseId + 'S' ); + } + + // If collapsed, the endNode will not be created. + if ( !collapsed ) + { + endNode = startNode.clone(); + endNode.setHtml( ' ' ); + + if ( serializable ) + endNode.setAttribute( 'id', baseId + 'E' ); + + clone = this.clone(); + clone.collapse(); + clone.insertNode( endNode ); + } + + clone = this.clone(); + clone.collapse( true ); + clone.insertNode( startNode ); + + // Update the range position. + if ( endNode ) + { + this.setStartAfter( startNode ); + this.setEndBefore( endNode ); + } + else + this.moveToPosition( startNode, CKEDITOR.POSITION_AFTER_END ); + + return { + startNode : serializable ? baseId + 'S' : startNode, + endNode : serializable ? baseId + 'E' : endNode, + serializable : serializable, + collapsed : collapsed + }; + }, + + /** + * Creates a "non intrusive" and "mutation sensible" bookmark. This + * kind of bookmark should be used only when the DOM is supposed to + * remain stable after its creation. + * @param {Boolean} [normalized] Indicates that the bookmark must + * normalized. When normalized, the successive text nodes are + * considered a single node. To sucessful load a normalized + * bookmark, the DOM tree must be also normalized before calling + * moveToBookmark. + * @returns {Object} An object representing the bookmark. + */ + createBookmark2 : function( normalized ) + { + var startContainer = this.startContainer, + endContainer = this.endContainer; + + var startOffset = this.startOffset, + endOffset = this.endOffset; + + var collapsed = this.collapsed; + + var child, previous; + + // If there is no range then get out of here. + // It happens on initial load in Safari #962 and if the editor it's + // hidden also in Firefox + if ( !startContainer || !endContainer ) + return { start : 0, end : 0 }; + + if ( normalized ) + { + // Find out if the start is pointing to a text node that will + // be normalized. + if ( startContainer.type == CKEDITOR.NODE_ELEMENT ) + { + child = startContainer.getChild( startOffset ); + + // In this case, move the start information to that text + // node. + if ( child && child.type == CKEDITOR.NODE_TEXT + && startOffset > 0 && child.getPrevious().type == CKEDITOR.NODE_TEXT ) + { + startContainer = child; + startOffset = 0; + } + } + + // Normalize the start. + while ( startContainer.type == CKEDITOR.NODE_TEXT + && ( previous = startContainer.getPrevious() ) + && previous.type == CKEDITOR.NODE_TEXT ) + { + startContainer = previous; + startOffset += previous.getLength(); + } + + // Process the end only if not normalized. + if ( !collapsed ) + { + // Find out if the start is pointing to a text node that + // will be normalized. + if ( endContainer.type == CKEDITOR.NODE_ELEMENT ) + { + child = endContainer.getChild( endOffset ); + + // In this case, move the start information to that + // text node. + if ( child && child.type == CKEDITOR.NODE_TEXT + && endOffset > 0 && child.getPrevious().type == CKEDITOR.NODE_TEXT ) + { + endContainer = child; + endOffset = 0; + } + } + + // Normalize the end. + while ( endContainer.type == CKEDITOR.NODE_TEXT + && ( previous = endContainer.getPrevious() ) + && previous.type == CKEDITOR.NODE_TEXT ) + { + endContainer = previous; + endOffset += previous.getLength(); + } + } + } + + return { + start : startContainer.getAddress( normalized ), + end : collapsed ? null : endContainer.getAddress( normalized ), + startOffset : startOffset, + endOffset : endOffset, + normalized : normalized, + collapsed : collapsed, + is2 : true // It's a createBookmark2 bookmark. + }; + }, + + moveToBookmark : function( bookmark ) + { + if ( bookmark.is2 ) // Created with createBookmark2(). + { + // Get the start information. + var startContainer = this.document.getByAddress( bookmark.start, bookmark.normalized ), + startOffset = bookmark.startOffset; + + // Get the end information. + var endContainer = bookmark.end && this.document.getByAddress( bookmark.end, bookmark.normalized ), + endOffset = bookmark.endOffset; + + // Set the start boundary. + this.setStart( startContainer, startOffset ); + + // Set the end boundary. If not available, collapse it. + if ( endContainer ) + this.setEnd( endContainer, endOffset ); + else + this.collapse( true ); + } + else // Created with createBookmark(). + { + var serializable = bookmark.serializable, + startNode = serializable ? this.document.getById( bookmark.startNode ) : bookmark.startNode, + endNode = serializable ? this.document.getById( bookmark.endNode ) : bookmark.endNode; + + // Set the range start at the bookmark start node position. + this.setStartBefore( startNode ); + + // Remove it, because it may interfere in the setEndBefore call. + startNode.remove(); + + // Set the range end at the bookmark end node position, or simply + // collapse it if it is not available. + if ( endNode ) + { + this.setEndBefore( endNode ); + endNode.remove(); + } + else + this.collapse( true ); + } + }, + + getBoundaryNodes : function() + { + var startNode = this.startContainer, + endNode = this.endContainer, + startOffset = this.startOffset, + endOffset = this.endOffset, + childCount; + + if ( startNode.type == CKEDITOR.NODE_ELEMENT ) + { + childCount = startNode.getChildCount(); + if ( childCount > startOffset ) + startNode = startNode.getChild( startOffset ); + else if ( childCount < 1 ) + startNode = startNode.getPreviousSourceNode(); + else // startOffset > childCount but childCount is not 0 + { + // Try to take the node just after the current position. + startNode = startNode.$; + while ( startNode.lastChild ) + startNode = startNode.lastChild; + startNode = new CKEDITOR.dom.node( startNode ); + + // Normally we should take the next node in DFS order. But it + // is also possible that we've already reached the end of + // document. + startNode = startNode.getNextSourceNode() || startNode; + } + } + if ( endNode.type == CKEDITOR.NODE_ELEMENT ) + { + childCount = endNode.getChildCount(); + if ( childCount > endOffset ) + endNode = endNode.getChild( endOffset ).getPreviousSourceNode( true ); + else if ( childCount < 1 ) + endNode = endNode.getPreviousSourceNode(); + else // endOffset > childCount but childCount is not 0 + { + // Try to take the node just before the current position. + endNode = endNode.$; + while ( endNode.lastChild ) + endNode = endNode.lastChild; + endNode = new CKEDITOR.dom.node( endNode ); + } + } + + // Sometimes the endNode will come right before startNode for collapsed + // ranges. Fix it. (#3780) + if ( startNode.getPosition( endNode ) & CKEDITOR.POSITION_FOLLOWING ) + startNode = endNode; + + return { startNode : startNode, endNode : endNode }; + }, + + /** + * Find the node which fully contains the range. + * @param includeSelf + * @param {Boolean} ignoreTextNode Whether ignore CKEDITOR.NODE_TEXT type. + */ + getCommonAncestor : function( includeSelf , ignoreTextNode ) + { + var start = this.startContainer, + end = this.endContainer, + ancestor; + + if ( start.equals( end ) ) + { + if ( includeSelf + && start.type == CKEDITOR.NODE_ELEMENT + && this.startOffset == this.endOffset - 1 ) + ancestor = start.getChild( this.startOffset ); + else + ancestor = start; + } + else + ancestor = start.getCommonAncestor( end ); + + return ignoreTextNode && !ancestor.is ? ancestor.getParent() : ancestor; + }, + + /** + * Transforms the startContainer and endContainer properties from text + * nodes to element nodes, whenever possible. This is actually possible + * if either of the boundary containers point to a text node, and its + * offset is set to zero, or after the last char in the node. + */ + optimize : function() + { + var container = this.startContainer; + var offset = this.startOffset; + + if ( container.type != CKEDITOR.NODE_ELEMENT ) + { + if ( !offset ) + this.setStartBefore( container ); + else if ( offset >= container.getLength() ) + this.setStartAfter( container ); + } + + container = this.endContainer; + offset = this.endOffset; + + if ( container.type != CKEDITOR.NODE_ELEMENT ) + { + if ( !offset ) + this.setEndBefore( container ); + else if ( offset >= container.getLength() ) + this.setEndAfter( container ); + } + }, + + /** + * Move the range out of bookmark nodes if they'd been the container. + */ + optimizeBookmark: function() + { + var startNode = this.startContainer, + endNode = this.endContainer; + + if ( startNode.is && startNode.is( 'span' ) + && startNode.data( 'cke-bookmark' ) ) + this.setStartAt( startNode, CKEDITOR.POSITION_BEFORE_START ); + if ( endNode && endNode.is && endNode.is( 'span' ) + && endNode.data( 'cke-bookmark' ) ) + this.setEndAt( endNode, CKEDITOR.POSITION_AFTER_END ); + }, + + trim : function( ignoreStart, ignoreEnd ) + { + var startContainer = this.startContainer, + startOffset = this.startOffset, + collapsed = this.collapsed; + if ( ( !ignoreStart || collapsed ) + && startContainer && startContainer.type == CKEDITOR.NODE_TEXT ) + { + // If the offset is zero, we just insert the new node before + // the start. + if ( !startOffset ) + { + startOffset = startContainer.getIndex(); + startContainer = startContainer.getParent(); + } + // If the offset is at the end, we'll insert it after the text + // node. + else if ( startOffset >= startContainer.getLength() ) + { + startOffset = startContainer.getIndex() + 1; + startContainer = startContainer.getParent(); + } + // In other case, we split the text node and insert the new + // node at the split point. + else + { + var nextText = startContainer.split( startOffset ); + + startOffset = startContainer.getIndex() + 1; + startContainer = startContainer.getParent(); + + // Check all necessity of updating the end boundary. + if ( this.startContainer.equals( this.endContainer ) ) + this.setEnd( nextText, this.endOffset - this.startOffset ); + else if ( startContainer.equals( this.endContainer ) ) + this.endOffset += 1; + } + + this.setStart( startContainer, startOffset ); + + if ( collapsed ) + { + this.collapse( true ); + return; + } + } + + var endContainer = this.endContainer; + var endOffset = this.endOffset; + + if ( !( ignoreEnd || collapsed ) + && endContainer && endContainer.type == CKEDITOR.NODE_TEXT ) + { + // If the offset is zero, we just insert the new node before + // the start. + if ( !endOffset ) + { + endOffset = endContainer.getIndex(); + endContainer = endContainer.getParent(); + } + // If the offset is at the end, we'll insert it after the text + // node. + else if ( endOffset >= endContainer.getLength() ) + { + endOffset = endContainer.getIndex() + 1; + endContainer = endContainer.getParent(); + } + // In other case, we split the text node and insert the new + // node at the split point. + else + { + endContainer.split( endOffset ); + + endOffset = endContainer.getIndex() + 1; + endContainer = endContainer.getParent(); + } + + this.setEnd( endContainer, endOffset ); + } + }, + + /** + * Expands the range so that partial units are completely contained. + * @param unit {Number} The unit type to expand with. + * @param {Boolean} [excludeBrs=false] Whether include line-breaks when expanding. + */ + enlarge : function( unit, excludeBrs ) + { + switch ( unit ) + { + case CKEDITOR.ENLARGE_ELEMENT : + + if ( this.collapsed ) + return; + + // Get the common ancestor. + var commonAncestor = this.getCommonAncestor(); + + var body = this.document.getBody(); + + // For each boundary + // a. Depending on its position, find out the first node to be checked (a sibling) or, if not available, to be enlarge. + // b. Go ahead checking siblings and enlarging the boundary as much as possible until the common ancestor is not reached. After reaching the common ancestor, just save the enlargeable node to be used later. + + var startTop, endTop; + + var enlargeable, sibling, commonReached; + + // Indicates that the node can be added only if whitespace + // is available before it. + var needsWhiteSpace = false; + var isWhiteSpace; + var siblingText; + + // Process the start boundary. + + var container = this.startContainer; + var offset = this.startOffset; + + if ( container.type == CKEDITOR.NODE_TEXT ) + { + if ( offset ) + { + // Check if there is any non-space text before the + // offset. Otherwise, container is null. + container = !CKEDITOR.tools.trim( container.substring( 0, offset ) ).length && container; + + // If we found only whitespace in the node, it + // means that we'll need more whitespace to be able + // to expand. For example, can be expanded in + // "A [B]", but not in "A [B]". + needsWhiteSpace = !!container; + } + + if ( container ) + { + if ( !( sibling = container.getPrevious() ) ) + enlargeable = container.getParent(); + } + } + else + { + // If we have offset, get the node preceeding it as the + // first sibling to be checked. + if ( offset ) + sibling = container.getChild( offset - 1 ) || container.getLast(); + + // If there is no sibling, mark the container to be + // enlarged. + if ( !sibling ) + enlargeable = container; + } + + while ( enlargeable || sibling ) + { + if ( enlargeable && !sibling ) + { + // If we reached the common ancestor, mark the flag + // for it. + if ( !commonReached && enlargeable.equals( commonAncestor ) ) + commonReached = true; + + if ( !body.contains( enlargeable ) ) + break; + + // If we don't need space or this element breaks + // the line, then enlarge it. + if ( !needsWhiteSpace || enlargeable.getComputedStyle( 'display' ) != 'inline' ) + { + needsWhiteSpace = false; + + // If the common ancestor has been reached, + // we'll not enlarge it immediately, but just + // mark it to be enlarged later if the end + // boundary also enlarges it. + if ( commonReached ) + startTop = enlargeable; + else + this.setStartBefore( enlargeable ); + } + + sibling = enlargeable.getPrevious(); + } + + // Check all sibling nodes preceeding the enlargeable + // node. The node wil lbe enlarged only if none of them + // blocks it. + while ( sibling ) + { + // This flag indicates that this node has + // whitespaces at the end. + isWhiteSpace = false; + + if ( sibling.type == CKEDITOR.NODE_TEXT ) + { + siblingText = sibling.getText(); + + if ( /[^\s\ufeff]/.test( siblingText ) ) + sibling = null; + + isWhiteSpace = /[\s\ufeff]$/.test( siblingText ); + } + else + { + // If this is a visible element. + // We need to check for the bookmark attribute because IE insists on + // rendering the display:none nodes we use for bookmarks. (#3363) + // Line-breaks (br) are rendered with zero width, which we don't want to include. (#7041) + if ( ( sibling.$.offsetWidth > 0 || excludeBrs && sibling.is( 'br' ) ) && !sibling.data( 'cke-bookmark' ) ) + { + // We'll accept it only if we need + // whitespace, and this is an inline + // element with whitespace only. + if ( needsWhiteSpace && CKEDITOR.dtd.$removeEmpty[ sibling.getName() ] ) + { + // It must contains spaces and inline elements only. + + siblingText = sibling.getText(); + + if ( (/[^\s\ufeff]/).test( siblingText ) ) // Spaces + Zero Width No-Break Space (U+FEFF) + sibling = null; + else + { + var allChildren = sibling.$.all || sibling.$.getElementsByTagName( '*' ); + for ( var i = 0, child ; child = allChildren[ i++ ] ; ) + { + if ( !CKEDITOR.dtd.$removeEmpty[ child.nodeName.toLowerCase() ] ) + { + sibling = null; + break; + } + } + } + + if ( sibling ) + isWhiteSpace = !!siblingText.length; + } + else + sibling = null; + } + } + + // A node with whitespaces has been found. + if ( isWhiteSpace ) + { + // Enlarge the last enlargeable node, if we + // were waiting for spaces. + if ( needsWhiteSpace ) + { + if ( commonReached ) + startTop = enlargeable; + else if ( enlargeable ) + this.setStartBefore( enlargeable ); + } + else + needsWhiteSpace = true; + } + + if ( sibling ) + { + var next = sibling.getPrevious(); + + if ( !enlargeable && !next ) + { + // Set the sibling as enlargeable, so it's + // parent will be get later outside this while. + enlargeable = sibling; + sibling = null; + break; + } + + sibling = next; + } + else + { + // If sibling has been set to null, then we + // need to stop enlarging. + enlargeable = null; + } + } + + if ( enlargeable ) + enlargeable = enlargeable.getParent(); + } + + // Process the end boundary. This is basically the same + // code used for the start boundary, with small changes to + // make it work in the oposite side (to the right). This + // makes it difficult to reuse the code here. So, fixes to + // the above code are likely to be replicated here. + + container = this.endContainer; + offset = this.endOffset; + + // Reset the common variables. + enlargeable = sibling = null; + commonReached = needsWhiteSpace = false; + + if ( container.type == CKEDITOR.NODE_TEXT ) + { + // Check if there is any non-space text after the + // offset. Otherwise, container is null. + container = !CKEDITOR.tools.trim( container.substring( offset ) ).length && container; + + // If we found only whitespace in the node, it + // means that we'll need more whitespace to be able + // to expand. For example, can be expanded in + // "A [B]", but not in "A [B]". + needsWhiteSpace = !( container && container.getLength() ); + + if ( container ) + { + if ( !( sibling = container.getNext() ) ) + enlargeable = container.getParent(); + } + } + else + { + // Get the node right after the boudary to be checked + // first. + sibling = container.getChild( offset ); + + if ( !sibling ) + enlargeable = container; + } + + while ( enlargeable || sibling ) + { + if ( enlargeable && !sibling ) + { + if ( !commonReached && enlargeable.equals( commonAncestor ) ) + commonReached = true; + + if ( !body.contains( enlargeable ) ) + break; + + if ( !needsWhiteSpace || enlargeable.getComputedStyle( 'display' ) != 'inline' ) + { + needsWhiteSpace = false; + + if ( commonReached ) + endTop = enlargeable; + else if ( enlargeable ) + this.setEndAfter( enlargeable ); + } + + sibling = enlargeable.getNext(); + } + + while ( sibling ) + { + isWhiteSpace = false; + + if ( sibling.type == CKEDITOR.NODE_TEXT ) + { + siblingText = sibling.getText(); + + if ( /[^\s\ufeff]/.test( siblingText ) ) + sibling = null; + + isWhiteSpace = /^[\s\ufeff]/.test( siblingText ); + } + else + { + // If this is a visible element. + // We need to check for the bookmark attribute because IE insists on + // rendering the display:none nodes we use for bookmarks. (#3363) + // Line-breaks (br) are rendered with zero width, which we don't want to include. (#7041) + if ( ( sibling.$.offsetWidth > 0 || excludeBrs && sibling.is( 'br' ) ) && !sibling.data( 'cke-bookmark' ) ) + { + // We'll accept it only if we need + // whitespace, and this is an inline + // element with whitespace only. + if ( needsWhiteSpace && CKEDITOR.dtd.$removeEmpty[ sibling.getName() ] ) + { + // It must contains spaces and inline elements only. + + siblingText = sibling.getText(); + + if ( (/[^\s\ufeff]/).test( siblingText ) ) + sibling = null; + else + { + allChildren = sibling.$.all || sibling.$.getElementsByTagName( '*' ); + for ( i = 0 ; child = allChildren[ i++ ] ; ) + { + if ( !CKEDITOR.dtd.$removeEmpty[ child.nodeName.toLowerCase() ] ) + { + sibling = null; + break; + } + } + } + + if ( sibling ) + isWhiteSpace = !!siblingText.length; + } + else + sibling = null; + } + } + + if ( isWhiteSpace ) + { + if ( needsWhiteSpace ) + { + if ( commonReached ) + endTop = enlargeable; + else + this.setEndAfter( enlargeable ); + } + } + + if ( sibling ) + { + next = sibling.getNext(); + + if ( !enlargeable && !next ) + { + enlargeable = sibling; + sibling = null; + break; + } + + sibling = next; + } + else + { + // If sibling has been set to null, then we + // need to stop enlarging. + enlargeable = null; + } + } + + if ( enlargeable ) + enlargeable = enlargeable.getParent(); + } + + // If the common ancestor can be enlarged by both boundaries, then include it also. + if ( startTop && endTop ) + { + commonAncestor = startTop.contains( endTop ) ? endTop : startTop; + + this.setStartBefore( commonAncestor ); + this.setEndAfter( commonAncestor ); + } + break; + + case CKEDITOR.ENLARGE_BLOCK_CONTENTS: + case CKEDITOR.ENLARGE_LIST_ITEM_CONTENTS: + + // Enlarging the start boundary. + var walkerRange = new CKEDITOR.dom.range( this.document ); + + body = this.document.getBody(); + + walkerRange.setStartAt( body, CKEDITOR.POSITION_AFTER_START ); + walkerRange.setEnd( this.startContainer, this.startOffset ); + + var walker = new CKEDITOR.dom.walker( walkerRange ), + blockBoundary, // The node on which the enlarging should stop. + tailBr, // In case BR as block boundary. + notBlockBoundary = CKEDITOR.dom.walker.blockBoundary( + ( unit == CKEDITOR.ENLARGE_LIST_ITEM_CONTENTS ) ? { br : 1 } : null ), + // Record the encountered 'blockBoundary' for later use. + boundaryGuard = function( node ) + { + var retval = notBlockBoundary( node ); + if ( !retval ) + blockBoundary = node; + return retval; + }, + // Record the encounted 'tailBr' for later use. + tailBrGuard = function( node ) + { + var retval = boundaryGuard( node ); + if ( !retval && node.is && node.is( 'br' ) ) + tailBr = node; + return retval; + }; + + walker.guard = boundaryGuard; + + enlargeable = walker.lastBackward(); + + // It's the body which stop the enlarging if no block boundary found. + blockBoundary = blockBoundary || body; + + // Start the range either after the end of found block (

    ...

    [text) + // or at the start of block (

    [text...), by comparing the document position + // with 'enlargeable' node. + this.setStartAt( + blockBoundary, + !blockBoundary.is( 'br' ) && + ( !enlargeable && this.checkStartOfBlock() + || enlargeable && blockBoundary.contains( enlargeable ) ) ? + CKEDITOR.POSITION_AFTER_START : + CKEDITOR.POSITION_AFTER_END ); + + // Enlarging the end boundary. + walkerRange = this.clone(); + walkerRange.collapse(); + walkerRange.setEndAt( body, CKEDITOR.POSITION_BEFORE_END ); + walker = new CKEDITOR.dom.walker( walkerRange ); + + // tailBrGuard only used for on range end. + walker.guard = ( unit == CKEDITOR.ENLARGE_LIST_ITEM_CONTENTS ) ? + tailBrGuard : boundaryGuard; + blockBoundary = null; + // End the range right before the block boundary node. + + enlargeable = walker.lastForward(); + + // It's the body which stop the enlarging if no block boundary found. + blockBoundary = blockBoundary || body; + + // Close the range either before the found block start (text]

    ...

    ) or at the block end (...text]

    ) + // by comparing the document position with 'enlargeable' node. + this.setEndAt( + blockBoundary, + ( !enlargeable && this.checkEndOfBlock() + || enlargeable && blockBoundary.contains( enlargeable ) ) ? + CKEDITOR.POSITION_BEFORE_END : + CKEDITOR.POSITION_BEFORE_START ); + // We must include the
    at the end of range if there's + // one and we're expanding list item contents + if ( tailBr ) + this.setEndAfter( tailBr ); + } + }, + + /** + * Descrease the range to make sure that boundaries + * always anchor beside text nodes or innermost element. + * @param {Number} mode ( CKEDITOR.SHRINK_ELEMENT | CKEDITOR.SHRINK_TEXT ) The shrinking mode. + *
    + *
    CKEDITOR.SHRINK_ELEMENT
    + *
    Shrink the range boundaries to the edge of the innermost element.
    + *
    CKEDITOR.SHRINK_TEXT
    + *
    Shrink the range boudaries to anchor by the side of enclosed text node, range remains if there's no text nodes on boundaries at all.
    + *
    + * @param {Boolean} selectContents Whether result range anchors at the inner OR outer boundary of the node. + */ + shrink : function( mode, selectContents ) + { + // Unable to shrink a collapsed range. + if ( !this.collapsed ) + { + mode = mode || CKEDITOR.SHRINK_TEXT; + + var walkerRange = this.clone(); + + var startContainer = this.startContainer, + endContainer = this.endContainer, + startOffset = this.startOffset, + endOffset = this.endOffset, + collapsed = this.collapsed; + + // Whether the start/end boundary is moveable. + var moveStart = 1, + moveEnd = 1; + + if ( startContainer && startContainer.type == CKEDITOR.NODE_TEXT ) + { + if ( !startOffset ) + walkerRange.setStartBefore( startContainer ); + else if ( startOffset >= startContainer.getLength( ) ) + walkerRange.setStartAfter( startContainer ); + else + { + // Enlarge the range properly to avoid walker making + // DOM changes caused by triming the text nodes later. + walkerRange.setStartBefore( startContainer ); + moveStart = 0; + } + } + + if ( endContainer && endContainer.type == CKEDITOR.NODE_TEXT ) + { + if ( !endOffset ) + walkerRange.setEndBefore( endContainer ); + else if ( endOffset >= endContainer.getLength( ) ) + walkerRange.setEndAfter( endContainer ); + else + { + walkerRange.setEndAfter( endContainer ); + moveEnd = 0; + } + } + + var walker = new CKEDITOR.dom.walker( walkerRange ), + isBookmark = CKEDITOR.dom.walker.bookmark(); + + walker.evaluator = function( node ) + { + return node.type == ( mode == CKEDITOR.SHRINK_ELEMENT ? + CKEDITOR.NODE_ELEMENT : CKEDITOR.NODE_TEXT ); + }; + + var currentElement; + walker.guard = function( node, movingOut ) + { + if ( isBookmark( node ) ) + return true; + + // Stop when we're shrink in element mode while encountering a text node. + if ( mode == CKEDITOR.SHRINK_ELEMENT && node.type == CKEDITOR.NODE_TEXT ) + return false; + + // Stop when we've already walked "through" an element. + if ( movingOut && node.equals( currentElement ) ) + return false; + + if ( !movingOut && node.type == CKEDITOR.NODE_ELEMENT ) + currentElement = node; + + return true; + }; + + if ( moveStart ) + { + var textStart = walker[ mode == CKEDITOR.SHRINK_ELEMENT ? 'lastForward' : 'next'](); + textStart && this.setStartAt( textStart, selectContents ? CKEDITOR.POSITION_AFTER_START : CKEDITOR.POSITION_BEFORE_START ); + } + + if ( moveEnd ) + { + walker.reset(); + var textEnd = walker[ mode == CKEDITOR.SHRINK_ELEMENT ? 'lastBackward' : 'previous'](); + textEnd && this.setEndAt( textEnd, selectContents ? CKEDITOR.POSITION_BEFORE_END : CKEDITOR.POSITION_AFTER_END ); + } + + return !!( moveStart || moveEnd ); + } + }, + + /** + * Inserts a node at the start of the range. The range will be expanded + * the contain the node. + */ + insertNode : function( node ) + { + this.optimizeBookmark(); + this.trim( false, true ); + + var startContainer = this.startContainer; + var startOffset = this.startOffset; + + var nextNode = startContainer.getChild( startOffset ); + + if ( nextNode ) + node.insertBefore( nextNode ); + else + startContainer.append( node ); + + // Check if we need to update the end boundary. + if ( node.getParent().equals( this.endContainer ) ) + this.endOffset++; + + // Expand the range to embrace the new node. + this.setStartBefore( node ); + }, + + moveToPosition : function( node, position ) + { + this.setStartAt( node, position ); + this.collapse( true ); + }, + + selectNodeContents : function( node ) + { + this.setStart( node, 0 ); + this.setEnd( node, node.type == CKEDITOR.NODE_TEXT ? node.getLength() : node.getChildCount() ); + }, + + /** + * Sets the start position of a Range. + * @param {CKEDITOR.dom.node} startNode The node to start the range. + * @param {Number} startOffset An integer greater than or equal to zero + * representing the offset for the start of the range from the start + * of startNode. + */ + setStart : function( startNode, startOffset ) + { + // W3C requires a check for the new position. If it is after the end + // boundary, the range should be collapsed to the new start. It seams + // we will not need this check for our use of this class so we can + // ignore it for now. + + // Fixing invalid range start inside dtd empty elements. + if( startNode.type == CKEDITOR.NODE_ELEMENT + && CKEDITOR.dtd.$empty[ startNode.getName() ] ) + startOffset = startNode.getIndex(), startNode = startNode.getParent(); + + this.startContainer = startNode; + this.startOffset = startOffset; + + if ( !this.endContainer ) + { + this.endContainer = startNode; + this.endOffset = startOffset; + } + + updateCollapsed( this ); + }, + + /** + * Sets the end position of a Range. + * @param {CKEDITOR.dom.node} endNode The node to end the range. + * @param {Number} endOffset An integer greater than or equal to zero + * representing the offset for the end of the range from the start + * of endNode. + */ + setEnd : function( endNode, endOffset ) + { + // W3C requires a check for the new position. If it is before the start + // boundary, the range should be collapsed to the new end. It seams we + // will not need this check for our use of this class so we can ignore + // it for now. + + // Fixing invalid range end inside dtd empty elements. + if( endNode.type == CKEDITOR.NODE_ELEMENT + && CKEDITOR.dtd.$empty[ endNode.getName() ] ) + endOffset = endNode.getIndex() + 1, endNode = endNode.getParent(); + + this.endContainer = endNode; + this.endOffset = endOffset; + + if ( !this.startContainer ) + { + this.startContainer = endNode; + this.startOffset = endOffset; + } + + updateCollapsed( this ); + }, + + setStartAfter : function( node ) + { + this.setStart( node.getParent(), node.getIndex() + 1 ); + }, + + setStartBefore : function( node ) + { + this.setStart( node.getParent(), node.getIndex() ); + }, + + setEndAfter : function( node ) + { + this.setEnd( node.getParent(), node.getIndex() + 1 ); + }, + + setEndBefore : function( node ) + { + this.setEnd( node.getParent(), node.getIndex() ); + }, + + setStartAt : function( node, position ) + { + switch( position ) + { + case CKEDITOR.POSITION_AFTER_START : + this.setStart( node, 0 ); + break; + + case CKEDITOR.POSITION_BEFORE_END : + if ( node.type == CKEDITOR.NODE_TEXT ) + this.setStart( node, node.getLength() ); + else + this.setStart( node, node.getChildCount() ); + break; + + case CKEDITOR.POSITION_BEFORE_START : + this.setStartBefore( node ); + break; + + case CKEDITOR.POSITION_AFTER_END : + this.setStartAfter( node ); + } + + updateCollapsed( this ); + }, + + setEndAt : function( node, position ) + { + switch( position ) + { + case CKEDITOR.POSITION_AFTER_START : + this.setEnd( node, 0 ); + break; + + case CKEDITOR.POSITION_BEFORE_END : + if ( node.type == CKEDITOR.NODE_TEXT ) + this.setEnd( node, node.getLength() ); + else + this.setEnd( node, node.getChildCount() ); + break; + + case CKEDITOR.POSITION_BEFORE_START : + this.setEndBefore( node ); + break; + + case CKEDITOR.POSITION_AFTER_END : + this.setEndAfter( node ); + } + + updateCollapsed( this ); + }, + + fixBlock : function( isStart, blockTag ) + { + var bookmark = this.createBookmark(), + fixedBlock = this.document.createElement( blockTag ); + + this.collapse( isStart ); + + this.enlarge( CKEDITOR.ENLARGE_BLOCK_CONTENTS ); + + this.extractContents().appendTo( fixedBlock ); + fixedBlock.trim(); + + if ( !CKEDITOR.env.ie ) + fixedBlock.appendBogus(); + + this.insertNode( fixedBlock ); + + this.moveToBookmark( bookmark ); + + return fixedBlock; + }, + + splitBlock : function( blockTag ) + { + var startPath = new CKEDITOR.dom.elementPath( this.startContainer ), + endPath = new CKEDITOR.dom.elementPath( this.endContainer ); + + var startBlockLimit = startPath.blockLimit, + endBlockLimit = endPath.blockLimit; + + var startBlock = startPath.block, + endBlock = endPath.block; + + var elementPath = null; + // Do nothing if the boundaries are in different block limits. + if ( !startBlockLimit.equals( endBlockLimit ) ) + return null; + + // Get or fix current blocks. + if ( blockTag != 'br' ) + { + if ( !startBlock ) + { + startBlock = this.fixBlock( true, blockTag ); + endBlock = new CKEDITOR.dom.elementPath( this.endContainer ).block; + } + + if ( !endBlock ) + endBlock = this.fixBlock( false, blockTag ); + } + + // Get the range position. + var isStartOfBlock = startBlock && this.checkStartOfBlock(), + isEndOfBlock = endBlock && this.checkEndOfBlock(); + + // Delete the current contents. + // TODO: Why is 2.x doing CheckIsEmpty()? + this.deleteContents(); + + if ( startBlock && startBlock.equals( endBlock ) ) + { + if ( isEndOfBlock ) + { + elementPath = new CKEDITOR.dom.elementPath( this.startContainer ); + this.moveToPosition( endBlock, CKEDITOR.POSITION_AFTER_END ); + endBlock = null; + } + else if ( isStartOfBlock ) + { + elementPath = new CKEDITOR.dom.elementPath( this.startContainer ); + this.moveToPosition( startBlock, CKEDITOR.POSITION_BEFORE_START ); + startBlock = null; + } + else + { + endBlock = this.splitElement( startBlock ); + + // In Gecko, the last child node must be a bogus
    . + // Note: bogus
    added under
      or
        would cause + // lists to be incorrectly rendered. + if ( !CKEDITOR.env.ie && !startBlock.is( 'ul', 'ol') ) + startBlock.appendBogus() ; + } + } + + return { + previousBlock : startBlock, + nextBlock : endBlock, + wasStartOfBlock : isStartOfBlock, + wasEndOfBlock : isEndOfBlock, + elementPath : elementPath + }; + }, + + /** + * Branch the specified element from the collapsed range position and + * place the caret between the two result branches. + * Note: The range must be collapsed and been enclosed by this element. + * @param {CKEDITOR.dom.element} element + * @return {CKEDITOR.dom.element} Root element of the new branch after the split. + */ + splitElement : function( toSplit ) + { + if ( !this.collapsed ) + return null; + + // Extract the contents of the block from the selection point to the end + // of its contents. + this.setEndAt( toSplit, CKEDITOR.POSITION_BEFORE_END ); + var documentFragment = this.extractContents(); + + // Duplicate the element after it. + var clone = toSplit.clone( false ); + + // Place the extracted contents into the duplicated element. + documentFragment.appendTo( clone ); + clone.insertAfter( toSplit ); + this.moveToPosition( toSplit, CKEDITOR.POSITION_AFTER_END ); + return clone; + }, + + /** + * Check whether a range boundary is at the inner boundary of a given + * element. + * @param {CKEDITOR.dom.element} element The target element to check. + * @param {Number} checkType The boundary to check for both the range + * and the element. It can be CKEDITOR.START or CKEDITOR.END. + * @returns {Boolean} "true" if the range boundary is at the inner + * boundary of the element. + */ + checkBoundaryOfElement : function( element, checkType ) + { + var checkStart = ( checkType == CKEDITOR.START ); + + // Create a copy of this range, so we can manipulate it for our checks. + var walkerRange = this.clone(); + + // Collapse the range at the proper size. + walkerRange.collapse( checkStart ); + + // Expand the range to element boundary. + walkerRange[ checkStart ? 'setStartAt' : 'setEndAt' ] + ( element, checkStart ? CKEDITOR.POSITION_AFTER_START : CKEDITOR.POSITION_BEFORE_END ); + + // Create the walker, which will check if we have anything useful + // in the range. + var walker = new CKEDITOR.dom.walker( walkerRange ); + walker.evaluator = elementBoundaryEval; + + return walker[ checkStart ? 'checkBackward' : 'checkForward' ](); + }, + + // Calls to this function may produce changes to the DOM. The range may + // be updated to reflect such changes. + checkStartOfBlock : function() + { + var startContainer = this.startContainer, + startOffset = this.startOffset; + + // If the starting node is a text node, and non-empty before the offset, + // then we're surely not at the start of block. + if ( startOffset && startContainer.type == CKEDITOR.NODE_TEXT ) + { + var textBefore = CKEDITOR.tools.ltrim( startContainer.substring( 0, startOffset ) ); + if ( textBefore.length ) + return false; + } + + // Antecipate the trim() call here, so the walker will not make + // changes to the DOM, which would not get reflected into this + // range otherwise. + this.trim(); + + // We need to grab the block element holding the start boundary, so + // let's use an element path for it. + var path = new CKEDITOR.dom.elementPath( this.startContainer ); + + // Creates a range starting at the block start until the range start. + var walkerRange = this.clone(); + walkerRange.collapse( true ); + walkerRange.setStartAt( path.block || path.blockLimit, CKEDITOR.POSITION_AFTER_START ); + + var walker = new CKEDITOR.dom.walker( walkerRange ); + walker.evaluator = getCheckStartEndBlockEvalFunction( true ); + + return walker.checkBackward(); + }, + + checkEndOfBlock : function() + { + var endContainer = this.endContainer, + endOffset = this.endOffset; + + // If the ending node is a text node, and non-empty after the offset, + // then we're surely not at the end of block. + if ( endContainer.type == CKEDITOR.NODE_TEXT ) + { + var textAfter = CKEDITOR.tools.rtrim( endContainer.substring( endOffset ) ); + if ( textAfter.length ) + return false; + } + + // Antecipate the trim() call here, so the walker will not make + // changes to the DOM, which would not get reflected into this + // range otherwise. + this.trim(); + + // We need to grab the block element holding the start boundary, so + // let's use an element path for it. + var path = new CKEDITOR.dom.elementPath( this.endContainer ); + + // Creates a range starting at the block start until the range start. + var walkerRange = this.clone(); + walkerRange.collapse( false ); + walkerRange.setEndAt( path.block || path.blockLimit, CKEDITOR.POSITION_BEFORE_END ); + + var walker = new CKEDITOR.dom.walker( walkerRange ); + walker.evaluator = getCheckStartEndBlockEvalFunction( false ); + + return walker.checkForward(); + }, + + /** + * Check if elements at which the range boundaries anchor are read-only, + * with respect to "contenteditable" attribute. + */ + checkReadOnly : ( function() + { + function checkNodesEditable( node, anotherEnd ) + { + while( node ) + { + if ( node.type == CKEDITOR.NODE_ELEMENT ) + { + if ( node.getAttribute( 'contentEditable' ) == 'false' + && !node.data( 'cke-editable' ) ) + { + return 0; + } + // Range enclosed entirely in an editable element. + else if ( node.is( 'body' ) + || node.getAttribute( 'contentEditable' ) == 'true' + && ( node.contains( anotherEnd ) || node.equals( anotherEnd ) ) ) + { + break; + } + } + node = node.getParent(); + } + + return 1; + } + + return function() + { + var startNode = this.startContainer, + endNode = this.endContainer; + + // Check if elements path at both boundaries are editable. + return !( checkNodesEditable( startNode, endNode ) && checkNodesEditable( endNode, startNode ) ); + }; + })(), + + /** + * Moves the range boundaries to the first/end editing point inside an + * element. For example, in an element tree like + * "<p><b><i></i></b> Text</p>", the start editing point is + * "<p><b><i>^</i></b> Text</p>" (inside <i>). + * @param {CKEDITOR.dom.element} el The element into which look for the + * editing spot. + * @param {Boolean} isMoveToEnd Whether move to the end editable position. + */ + moveToElementEditablePosition : function( el, isMoveToEnd ) + { + var isEditable; + + // Empty elements are rejected. + if ( CKEDITOR.dtd.$empty[ el.getName() ] ) + return false; + + while ( el && el.type == CKEDITOR.NODE_ELEMENT ) + { + isEditable = el.isEditable(); + + // If an editable element is found, move inside it. + if ( isEditable ) + this.moveToPosition( el, isMoveToEnd ? + CKEDITOR.POSITION_BEFORE_END : + CKEDITOR.POSITION_AFTER_START ); + // Stop immediately if we've found a non editable inline element (e.g ). + else if ( CKEDITOR.dtd.$inline[ el.getName() ] ) + { + this.moveToPosition( el, isMoveToEnd ? + CKEDITOR.POSITION_AFTER_END : + CKEDITOR.POSITION_BEFORE_START ); + return true; + } + + // Non-editable non-inline elements are to be bypassed, getting the next one. + if ( CKEDITOR.dtd.$empty[ el.getName() ] ) + el = el[ isMoveToEnd ? 'getPrevious' : 'getNext' ]( nonWhitespaceOrBookmarkEval ); + else + el = el[ isMoveToEnd ? 'getLast' : 'getFirst' ]( nonWhitespaceOrBookmarkEval ); + + // Stop immediately if we've found a text node. + if ( el && el.type == CKEDITOR.NODE_TEXT ) + { + this.moveToPosition( el, isMoveToEnd ? + CKEDITOR.POSITION_AFTER_END : + CKEDITOR.POSITION_BEFORE_START ); + return true; + } + } + + return isEditable; + }, + + /** + *@see {CKEDITOR.dom.range.moveToElementEditablePosition} + */ + moveToElementEditStart : function( target ) + { + return this.moveToElementEditablePosition( target ); + }, + + /** + *@see {CKEDITOR.dom.range.moveToElementEditablePosition} + */ + moveToElementEditEnd : function( target ) + { + return this.moveToElementEditablePosition( target, true ); + }, + + /** + * Get the single node enclosed within the range if there's one. + */ + getEnclosedNode : function() + { + var walkerRange = this.clone(); + + // Optimize and analyze the range to avoid DOM destructive nature of walker. (#5780) + walkerRange.optimize(); + if ( walkerRange.startContainer.type != CKEDITOR.NODE_ELEMENT + || walkerRange.endContainer.type != CKEDITOR.NODE_ELEMENT ) + return null; + + var walker = new CKEDITOR.dom.walker( walkerRange ), + isNotBookmarks = CKEDITOR.dom.walker.bookmark( true ), + isNotWhitespaces = CKEDITOR.dom.walker.whitespaces( true ), + evaluator = function( node ) + { + return isNotWhitespaces( node ) && isNotBookmarks( node ); + }; + walkerRange.evaluator = evaluator; + var node = walker.next(); + walker.reset(); + return node && node.equals( walker.previous() ) ? node : null; + }, + + getTouchedStartNode : function() + { + var container = this.startContainer ; + + if ( this.collapsed || container.type != CKEDITOR.NODE_ELEMENT ) + return container ; + + return container.getChild( this.startOffset ) || container ; + }, + + getTouchedEndNode : function() + { + var container = this.endContainer ; + + if ( this.collapsed || container.type != CKEDITOR.NODE_ELEMENT ) + return container ; + + return container.getChild( this.endOffset - 1 ) || container ; + } + }; +})(); + +CKEDITOR.POSITION_AFTER_START = 1; // ^contents "^text" +CKEDITOR.POSITION_BEFORE_END = 2; // contents^ "text^" +CKEDITOR.POSITION_BEFORE_START = 3; // ^contents ^"text" +CKEDITOR.POSITION_AFTER_END = 4; // contents^ "text" + +CKEDITOR.ENLARGE_ELEMENT = 1; +CKEDITOR.ENLARGE_BLOCK_CONTENTS = 2; +CKEDITOR.ENLARGE_LIST_ITEM_CONTENTS = 3; + +// Check boundary types. +// @see CKEDITOR.dom.range.prototype.checkBoundaryOfElement +CKEDITOR.START = 1; +CKEDITOR.END = 2; +CKEDITOR.STARTEND = 3; + +// Shrink range types. +// @see CKEDITOR.dom.range.prototype.shrink +CKEDITOR.SHRINK_ELEMENT = 1; +CKEDITOR.SHRINK_TEXT = 2; diff --git a/library/custom_template/ckeditor/_source/core/dom/rangelist.js b/library/custom_template/ckeditor/_source/core/dom/rangelist.js new file mode 100644 index 000000000..859d4b901 --- /dev/null +++ b/library/custom_template/ckeditor/_source/core/dom/rangelist.js @@ -0,0 +1,213 @@ +/* +Copyright (c) 2003-2011, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.html or http://ckeditor.com/license +*/ + +(function() +{ + /** + * Represents a list os CKEDITOR.dom.range objects, which can be easily + * iterated sequentially. + * @constructor + * @param {CKEDITOR.dom.range|Array} [ranges] The ranges contained on this list. + * Note that, if an array of ranges is specified, the range sequence + * should match its DOM order. This class will not help to sort them. + */ + CKEDITOR.dom.rangeList = function( ranges ) + { + if ( ranges instanceof CKEDITOR.dom.rangeList ) + return ranges; + + if ( !ranges ) + ranges = []; + else if ( ranges instanceof CKEDITOR.dom.range ) + ranges = [ ranges ]; + + return CKEDITOR.tools.extend( ranges, mixins ); + }; + + var mixins = + /** @lends CKEDITOR.dom.rangeList.prototype */ + { + /** + * Creates an instance of the rangeList iterator, it should be used + * only when the ranges processing could be DOM intrusive, which + * means it may pollute and break other ranges in this list. + * Otherwise, it's enough to just iterate over this array in a for loop. + * @returns {CKEDITOR.dom.rangeListIterator} + */ + createIterator : function() + { + var rangeList = this, + bookmark = CKEDITOR.dom.walker.bookmark(), + guard = function( node ) { return ! ( node.is && node.is( 'tr' ) ); }, + bookmarks = [], + current; + + /** + * @lends CKEDITOR.dom.rangeListIterator.prototype + */ + return { + + /** + * Retrieves the next range in the list. + * @param {Boolean} mergeConsequent Whether join two adjacent ranges into single, e.g. consequent table cells. + */ + getNextRange : function( mergeConsequent ) + { + current = current == undefined ? 0 : current + 1; + + var range = rangeList[ current ]; + + // Multiple ranges might be mangled by each other. + if ( range && rangeList.length > 1 ) + { + // Bookmarking all other ranges on the first iteration, + // the range correctness after it doesn't matter since we'll + // restore them before the next iteration. + if ( !current ) + { + // Make sure bookmark correctness by reverse processing. + for ( var i = rangeList.length - 1; i >= 0; i-- ) + bookmarks.unshift( rangeList[ i ].createBookmark( true ) ); + } + + if ( mergeConsequent ) + { + // Figure out how many ranges should be merged. + var mergeCount = 0; + while ( rangeList[ current + mergeCount + 1 ] ) + { + var doc = range.document, + found = 0, + left = doc.getById( bookmarks[ mergeCount ].endNode ), + right = doc.getById( bookmarks[ mergeCount + 1 ].startNode ), + next; + + // Check subsequent range. + while ( 1 ) + { + next = left.getNextSourceNode( false ); + if ( !right.equals( next ) ) + { + // This could be yet another bookmark or + // walking across block boundaries. + if ( bookmark( next ) || ( next.type == CKEDITOR.NODE_ELEMENT && next.isBlockBoundary() ) ) + { + left = next; + continue; + } + } + else + found = 1; + + break; + } + + if ( !found ) + break; + + mergeCount++; + } + } + + range.moveToBookmark( bookmarks.shift() ); + + // Merge ranges finally after moving to bookmarks. + while( mergeCount-- ) + { + next = rangeList[ ++current ]; + next.moveToBookmark( bookmarks.shift() ); + range.setEnd( next.endContainer, next.endOffset ); + } + } + + return range; + } + }; + }, + + createBookmarks : function( serializable ) + { + var retval = [], bookmark; + for ( var i = 0; i < this.length ; i++ ) + { + retval.push( bookmark = this[ i ].createBookmark( serializable, true) ); + + // Updating the container & offset values for ranges + // that have been touched. + for ( var j = i + 1; j < this.length; j++ ) + { + this[ j ] = updateDirtyRange( bookmark, this[ j ] ); + this[ j ] = updateDirtyRange( bookmark, this[ j ], true ); + } + } + return retval; + }, + + createBookmarks2 : function( normalized ) + { + var bookmarks = []; + + for ( var i = 0 ; i < this.length ; i++ ) + bookmarks.push( this[ i ].createBookmark2( normalized ) ); + + return bookmarks; + }, + + /** + * Move each range in the list to the position specified by a list of bookmarks. + * @param {Array} bookmarks The list of bookmarks, each one matching a range in the list. + */ + moveToBookmarks : function( bookmarks ) + { + for ( var i = 0 ; i < this.length ; i++ ) + this[ i ].moveToBookmark( bookmarks[ i ] ); + } + }; + + // Update the specified range which has been mangled by previous insertion of + // range bookmark nodes.(#3256) + function updateDirtyRange( bookmark, dirtyRange, checkEnd ) + { + var serializable = bookmark.serializable, + container = dirtyRange[ checkEnd ? 'endContainer' : 'startContainer' ], + offset = checkEnd ? 'endOffset' : 'startOffset'; + + var bookmarkStart = serializable ? + dirtyRange.document.getById( bookmark.startNode ) + : bookmark.startNode; + + var bookmarkEnd = serializable ? + dirtyRange.document.getById( bookmark.endNode ) + : bookmark.endNode; + + if ( container.equals( bookmarkStart.getPrevious() ) ) + { + dirtyRange.startOffset = dirtyRange.startOffset + - container.getLength() + - bookmarkEnd.getPrevious().getLength(); + container = bookmarkEnd.getNext(); + } + else if ( container.equals( bookmarkEnd.getPrevious() ) ) + { + dirtyRange.startOffset = dirtyRange.startOffset - container.getLength(); + container = bookmarkEnd.getNext(); + } + + container.equals( bookmarkStart.getParent() ) && dirtyRange[ offset ]++; + container.equals( bookmarkEnd.getParent() ) && dirtyRange[ offset ]++; + + // Update and return this range. + dirtyRange[ checkEnd ? 'endContainer' : 'startContainer' ] = container; + return dirtyRange; + } +})(); + +/** + * (Virtual Class) Do not call this constructor. This class is not really part + * of the API. It just describes the return type of {@link CKEDITOR.dom.rangeList#createIterator}. + * @name CKEDITOR.dom.rangeListIterator + * @constructor + * @example + */ diff --git a/library/custom_template/ckeditor/_source/core/dom/text.js b/library/custom_template/ckeditor/_source/core/dom/text.js new file mode 100644 index 000000000..8a8c41446 --- /dev/null +++ b/library/custom_template/ckeditor/_source/core/dom/text.js @@ -0,0 +1,123 @@ +/* +Copyright (c) 2003-2011, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.html or http://ckeditor.com/license +*/ + +/** + * @fileOverview Defines the {@link CKEDITOR.dom.text} class, which represents + * a DOM text node. + */ + +/** + * Represents a DOM text node. + * @constructor + * @augments CKEDITOR.dom.node + * @param {Object|String} text A native DOM text node or a string containing + * the text to use to create a new text node. + * @param {CKEDITOR.dom.document} [ownerDocument] The document that will contain + * the node in case of new node creation. Defaults to the current document. + * @example + * var nativeNode = document.createTextNode( 'Example' ); + * var text = CKEDITOR.dom.text( nativeNode ); + * @example + * var text = CKEDITOR.dom.text( 'Example' ); + */ +CKEDITOR.dom.text = function( text, ownerDocument ) +{ + if ( typeof text == 'string' ) + text = ( ownerDocument ? ownerDocument.$ : document ).createTextNode( text ); + + // Theoretically, we should call the base constructor here + // (not CKEDITOR.dom.node though). But, IE doesn't support expando + // properties on text node, so the features provided by domObject will not + // work for text nodes (which is not a big issue for us). + // + // CKEDITOR.dom.domObject.call( this, element ); + + /** + * The native DOM text node represented by this class instance. + * @type Object + * @example + * var element = new CKEDITOR.dom.text( 'Example' ); + * alert( element.$.nodeType ); // "3" + */ + this.$ = text; +}; + +CKEDITOR.dom.text.prototype = new CKEDITOR.dom.node(); + +CKEDITOR.tools.extend( CKEDITOR.dom.text.prototype, + /** @lends CKEDITOR.dom.text.prototype */ + { + /** + * The node type. This is a constant value set to + * {@link CKEDITOR.NODE_TEXT}. + * @type Number + * @example + */ + type : CKEDITOR.NODE_TEXT, + + getLength : function() + { + return this.$.nodeValue.length; + }, + + getText : function() + { + return this.$.nodeValue; + }, + + /** + * Breaks this text node into two nodes at the specified offset, + * keeping both in the tree as siblings. This node then only contains + * all the content up to the offset point. A new text node, which is + * inserted as the next sibling of this node, contains all the content + * at and after the offset point. When the offset is equal to the + * length of this node, the new node has no data. + * @param {Number} The position at which to split, starting from zero. + * @returns {CKEDITOR.dom.text} The new text node. + */ + split : function( offset ) + { + // If the offset is after the last char, IE creates the text node + // on split, but don't include it into the DOM. So, we have to do + // that manually here. + if ( CKEDITOR.env.ie && offset == this.getLength() ) + { + var next = this.getDocument().createText( '' ); + next.insertAfter( this ); + return next; + } + + var doc = this.getDocument(); + var retval = new CKEDITOR.dom.text( this.$.splitText( offset ), doc ); + + // IE BUG: IE8 does not update the childNodes array in DOM after splitText(), + // we need to make some DOM changes to make it update. (#3436) + if ( CKEDITOR.env.ie8 ) + { + var workaround = new CKEDITOR.dom.text( '', doc ); + workaround.insertAfter( retval ); + workaround.remove(); + } + + return retval; + }, + + /** + * Extracts characters from indexA up to but not including indexB. + * @param {Number} indexA An integer between 0 and one less than the + * length of the text. + * @param {Number} [indexB] An integer between 0 and the length of the + * string. If omitted, extracts characters to the end of the text. + */ + substring : function( indexA, indexB ) + { + // We need the following check due to a Firefox bug + // https://bugzilla.mozilla.org/show_bug.cgi?id=458886 + if ( typeof indexB != 'number' ) + return this.$.nodeValue.substr( indexA ); + else + return this.$.nodeValue.substring( indexA, indexB ); + } + }); diff --git a/library/custom_template/ckeditor/_source/core/dom/walker.js b/library/custom_template/ckeditor/_source/core/dom/walker.js new file mode 100644 index 000000000..fc8c9201e --- /dev/null +++ b/library/custom_template/ckeditor/_source/core/dom/walker.js @@ -0,0 +1,460 @@ +/* +Copyright (c) 2003-2011, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.html or http://ckeditor.com/license +*/ + +(function() +{ + // This function is to be called under a "walker" instance scope. + function iterate( rtl, breakOnFalse ) + { + // Return null if we have reached the end. + if ( this._.end ) + return null; + + var node, + range = this.range, + guard, + userGuard = this.guard, + type = this.type, + getSourceNodeFn = ( rtl ? 'getPreviousSourceNode' : 'getNextSourceNode' ); + + // This is the first call. Initialize it. + if ( !this._.start ) + { + this._.start = 1; + + // Trim text nodes and optmize the range boundaries. DOM changes + // may happen at this point. + range.trim(); + + // A collapsed range must return null at first call. + if ( range.collapsed ) + { + this.end(); + return null; + } + } + + // Create the LTR guard function, if necessary. + if ( !rtl && !this._.guardLTR ) + { + // Gets the node that stops the walker when going LTR. + var limitLTR = range.endContainer, + blockerLTR = limitLTR.getChild( range.endOffset ); + + this._.guardLTR = function( node, movingOut ) + { + return ( ( !movingOut || !limitLTR.equals( node ) ) + && ( !blockerLTR || !node.equals( blockerLTR ) ) + && ( node.type != CKEDITOR.NODE_ELEMENT || !movingOut || node.getName() != 'body' ) ); + }; + } + + // Create the RTL guard function, if necessary. + if ( rtl && !this._.guardRTL ) + { + // Gets the node that stops the walker when going LTR. + var limitRTL = range.startContainer, + blockerRTL = ( range.startOffset > 0 ) && limitRTL.getChild( range.startOffset - 1 ); + + this._.guardRTL = function( node, movingOut ) + { + return ( ( !movingOut || !limitRTL.equals( node ) ) + && ( !blockerRTL || !node.equals( blockerRTL ) ) + && ( node.type != CKEDITOR.NODE_ELEMENT || !movingOut || node.getName() != 'body' ) ); + }; + } + + // Define which guard function to use. + var stopGuard = rtl ? this._.guardRTL : this._.guardLTR; + + // Make the user defined guard function participate in the process, + // otherwise simply use the boundary guard. + if ( userGuard ) + { + guard = function( node, movingOut ) + { + if ( stopGuard( node, movingOut ) === false ) + return false; + + return userGuard( node, movingOut ); + }; + } + else + guard = stopGuard; + + if ( this.current ) + node = this.current[ getSourceNodeFn ]( false, type, guard ); + else + { + // Get the first node to be returned. + + if ( rtl ) + { + node = range.endContainer; + + if ( range.endOffset > 0 ) + { + node = node.getChild( range.endOffset - 1 ); + if ( guard( node ) === false ) + node = null; + } + else + node = ( guard ( node, true ) === false ) ? + null : node.getPreviousSourceNode( true, type, guard ); + } + else + { + node = range.startContainer; + node = node.getChild( range.startOffset ); + + if ( node ) + { + if ( guard( node ) === false ) + node = null; + } + else + node = ( guard ( range.startContainer, true ) === false ) ? + null : range.startContainer.getNextSourceNode( true, type, guard ) ; + } + } + + while ( node && !this._.end ) + { + this.current = node; + + if ( !this.evaluator || this.evaluator( node ) !== false ) + { + if ( !breakOnFalse ) + return node; + } + else if ( breakOnFalse && this.evaluator ) + return false; + + node = node[ getSourceNodeFn ]( false, type, guard ); + } + + this.end(); + return this.current = null; + } + + function iterateToLast( rtl ) + { + var node, last = null; + + while ( ( node = iterate.call( this, rtl ) ) ) + last = node; + + return last; + } + + CKEDITOR.dom.walker = CKEDITOR.tools.createClass( + { + /** + * Utility class to "walk" the DOM inside a range boundaries. If + * necessary, partially included nodes (text nodes) are broken to + * reflect the boundaries limits, so DOM and range changes may happen. + * Outside changes to the range may break the walker. + * + * The walker may return nodes that are not totaly included into the + * range boundaires. Let's take the following range representation, + * where the square brackets indicate the boundaries: + * + * [<p>Some <b>sample] text</b> + * + * While walking forward into the above range, the following nodes are + * returned: <p>, "Some ", <b> and "sample". Going + * backwards instead we have: "sample" and "Some ". So note that the + * walker always returns nodes when "entering" them, but not when + * "leaving" them. The guard function is instead called both when + * entering and leaving nodes. + * + * @constructor + * @param {CKEDITOR.dom.range} range The range within which walk. + */ + $ : function( range ) + { + this.range = range; + + /** + * A function executed for every matched node, to check whether + * it's to be considered into the walk or not. If not provided, all + * matched nodes are considered good. + * If the function returns "false" the node is ignored. + * @name CKEDITOR.dom.walker.prototype.evaluator + * @property + * @type Function + */ + // this.evaluator = null; + + /** + * A function executed for every node the walk pass by to check + * whether the walk is to be finished. It's called when both + * entering and exiting nodes, as well as for the matched nodes. + * If this function returns "false", the walking ends and no more + * nodes are evaluated. + * @name CKEDITOR.dom.walker.prototype.guard + * @property + * @type Function + */ + // this.guard = null; + + /** @private */ + this._ = {}; + }, + +// statics : +// { +// /* Creates a CKEDITOR.dom.walker instance to walk inside DOM boundaries set by nodes. +// * @param {CKEDITOR.dom.node} startNode The node from wich the walk +// * will start. +// * @param {CKEDITOR.dom.node} [endNode] The last node to be considered +// * in the walk. No more nodes are retrieved after touching or +// * passing it. If not provided, the walker stops at the +// * <body> closing boundary. +// * @returns {CKEDITOR.dom.walker} A DOM walker for the nodes between the +// * provided nodes. +// */ +// createOnNodes : function( startNode, endNode, startInclusive, endInclusive ) +// { +// var range = new CKEDITOR.dom.range(); +// if ( startNode ) +// range.setStartAt( startNode, startInclusive ? CKEDITOR.POSITION_BEFORE_START : CKEDITOR.POSITION_AFTER_END ) ; +// else +// range.setStartAt( startNode.getDocument().getBody(), CKEDITOR.POSITION_AFTER_START ) ; +// +// if ( endNode ) +// range.setEndAt( endNode, endInclusive ? CKEDITOR.POSITION_AFTER_END : CKEDITOR.POSITION_BEFORE_START ) ; +// else +// range.setEndAt( startNode.getDocument().getBody(), CKEDITOR.POSITION_BEFORE_END ) ; +// +// return new CKEDITOR.dom.walker( range ); +// } +// }, +// + proto : + { + /** + * Stop walking. No more nodes are retrieved if this function gets + * called. + */ + end : function() + { + this._.end = 1; + }, + + /** + * Retrieves the next node (at right). + * @returns {CKEDITOR.dom.node} The next node or null if no more + * nodes are available. + */ + next : function() + { + return iterate.call( this ); + }, + + /** + * Retrieves the previous node (at left). + * @returns {CKEDITOR.dom.node} The previous node or null if no more + * nodes are available. + */ + previous : function() + { + return iterate.call( this, 1 ); + }, + + /** + * Check all nodes at right, executing the evaluation fuction. + * @returns {Boolean} "false" if the evaluator function returned + * "false" for any of the matched nodes. Otherwise "true". + */ + checkForward : function() + { + return iterate.call( this, 0, 1 ) !== false; + }, + + /** + * Check all nodes at left, executing the evaluation fuction. + * @returns {Boolean} "false" if the evaluator function returned + * "false" for any of the matched nodes. Otherwise "true". + */ + checkBackward : function() + { + return iterate.call( this, 1, 1 ) !== false; + }, + + /** + * Executes a full walk forward (to the right), until no more nodes + * are available, returning the last valid node. + * @returns {CKEDITOR.dom.node} The last node at the right or null + * if no valid nodes are available. + */ + lastForward : function() + { + return iterateToLast.call( this ); + }, + + /** + * Executes a full walk backwards (to the left), until no more nodes + * are available, returning the last valid node. + * @returns {CKEDITOR.dom.node} The last node at the left or null + * if no valid nodes are available. + */ + lastBackward : function() + { + return iterateToLast.call( this, 1 ); + }, + + reset : function() + { + delete this.current; + this._ = {}; + } + + } + }); + + /* + * Anything whose display computed style is block, list-item, table, + * table-row-group, table-header-group, table-footer-group, table-row, + * table-column-group, table-column, table-cell, table-caption, or whose node + * name is hr, br (when enterMode is br only) is a block boundary. + */ + var blockBoundaryDisplayMatch = + { + 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 + }; + + CKEDITOR.dom.element.prototype.isBlockBoundary = function( customNodeNames ) + { + var nodeNameMatches = CKEDITOR.tools.extend( {}, CKEDITOR.dtd.$block, customNodeNames || {} ); + + // Don't consider floated formatting as block boundary, fall back to dtd check in that case. (#6297) + return this.getComputedStyle( 'float' ) == 'none' && blockBoundaryDisplayMatch[ this.getComputedStyle( 'display' ) ] + || nodeNameMatches[ this.getName() ]; + }; + + CKEDITOR.dom.walker.blockBoundary = function( customNodeNames ) + { + return function( node , type ) + { + return ! ( node.type == CKEDITOR.NODE_ELEMENT + && node.isBlockBoundary( customNodeNames ) ); + }; + }; + + CKEDITOR.dom.walker.listItemBoundary = function() + { + return this.blockBoundary( { br : 1 } ); + }; + + /** + * Whether the to-be-evaluated node is a bookmark node OR bookmark node + * inner contents. + * @param {Boolean} contentOnly Whether only test againt the text content of + * bookmark node instead of the element itself(default). + * @param {Boolean} isReject Whether should return 'false' for the bookmark + * node instead of 'true'(default). + */ + CKEDITOR.dom.walker.bookmark = function( contentOnly, isReject ) + { + function isBookmarkNode( node ) + { + return ( node && node.getName + && node.getName() == 'span' + && node.data( 'cke-bookmark' ) ); + } + + return function( node ) + { + var isBookmark, parent; + // Is bookmark inner text node? + isBookmark = ( node && !node.getName && ( parent = node.getParent() ) + && isBookmarkNode( parent ) ); + // Is bookmark node? + isBookmark = contentOnly ? isBookmark : isBookmark || isBookmarkNode( node ); + return !! ( isReject ^ isBookmark ); + }; + }; + + /** + * Whether the node is a text node containing only whitespaces characters. + * @param isReject + */ + CKEDITOR.dom.walker.whitespaces = function( isReject ) + { + return function( node ) + { + var isWhitespace = node && ( node.type == CKEDITOR.NODE_TEXT ) + && !CKEDITOR.tools.trim( node.getText() ); + return !! ( isReject ^ isWhitespace ); + }; + }; + + /** + * Whether the node is invisible in wysiwyg mode. + * @param isReject + */ + CKEDITOR.dom.walker.invisible = function( isReject ) + { + var whitespace = CKEDITOR.dom.walker.whitespaces(); + return function( node ) + { + // Nodes that take no spaces in wysiwyg: + // 1. White-spaces but not including NBSP; + // 2. Empty inline elements, e.g. we're checking here + // 'offsetHeight' instead of 'offsetWidth' for properly excluding + // all sorts of empty paragraph, e.g.
        . + var isInvisible = whitespace( node ) || node.is && !node.$.offsetHeight; + return !! ( isReject ^ isInvisible ); + }; + }; + + CKEDITOR.dom.walker.nodeType = function( type, isReject ) + { + return function( node ) + { + return !! ( isReject ^ ( node.type == type ) ); + }; + }; + + var tailNbspRegex = /^[\t\r\n ]*(?: |\xa0)$/, + isWhitespaces = CKEDITOR.dom.walker.whitespaces(), + isBookmark = CKEDITOR.dom.walker.bookmark(), + toSkip = function( node ) + { + return isBookmark( node ) + || isWhitespaces( node ) + || node.type == CKEDITOR.NODE_ELEMENT + && node.getName() in CKEDITOR.dtd.$inline + && !( node.getName() in CKEDITOR.dtd.$empty ); + }; + + // Check if there's a filler node at the end of an element, and return it. + CKEDITOR.dom.element.prototype.getBogus = function() + { + // Bogus are not always at the end, e.g.

        text

        (#7070). + var tail = this; + do { tail = tail.getPreviousSourceNode(); } + while ( toSkip( tail ) ) + + if ( tail && ( !CKEDITOR.env.ie ? tail.is && tail.is( 'br' ) + : tail.getText && tailNbspRegex.test( tail.getText() ) ) ) + { + return tail; + } + return false; + }; + +})(); diff --git a/library/custom_template/ckeditor/_source/core/dom/window.js b/library/custom_template/ckeditor/_source/core/dom/window.js new file mode 100644 index 000000000..60431a8b9 --- /dev/null +++ b/library/custom_template/ckeditor/_source/core/dom/window.js @@ -0,0 +1,96 @@ +/* +Copyright (c) 2003-2011, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.html or http://ckeditor.com/license +*/ + +/** + * @fileOverview Defines the {@link CKEDITOR.dom.document} class, which + * represents a DOM document. + */ + +/** + * Represents a DOM window. + * @constructor + * @augments CKEDITOR.dom.domObject + * @param {Object} domWindow A native DOM window. + * @example + * var document = new CKEDITOR.dom.window( window ); + */ +CKEDITOR.dom.window = function( domWindow ) +{ + CKEDITOR.dom.domObject.call( this, domWindow ); +}; + +CKEDITOR.dom.window.prototype = new CKEDITOR.dom.domObject(); + +CKEDITOR.tools.extend( CKEDITOR.dom.window.prototype, + /** @lends CKEDITOR.dom.window.prototype */ + { + /** + * Moves the selection focus to this window. + * @function + * @example + * var win = new CKEDITOR.dom.window( window ); + * win.focus(); + */ + focus : function() + { + // Webkit is sometimes failed to focus iframe, blur it first(#3835). + if ( CKEDITOR.env.webkit && this.$.parent ) + this.$.parent.focus(); + this.$.focus(); + }, + + /** + * Gets the width and height of this window's viewable area. + * @function + * @returns {Object} An object with the "width" and "height" + * properties containing the size. + * @example + * var win = new CKEDITOR.dom.window( window ); + * var size = win.getViewPaneSize(); + * alert( size.width ); + * alert( size.height ); + */ + getViewPaneSize : function() + { + var doc = this.$.document, + stdMode = doc.compatMode == 'CSS1Compat'; + return { + width : ( stdMode ? doc.documentElement.clientWidth : doc.body.clientWidth ) || 0, + height : ( stdMode ? doc.documentElement.clientHeight : doc.body.clientHeight ) || 0 + }; + }, + + /** + * Gets the current position of the window's scroll. + * @function + * @returns {Object} An object with the "x" and "y" properties + * containing the scroll position. + * @example + * var win = new CKEDITOR.dom.window( window ); + * var pos = win.getScrollPosition(); + * alert( pos.x ); + * alert( pos.y ); + */ + getScrollPosition : function() + { + var $ = this.$; + + if ( 'pageXOffset' in $ ) + { + return { + x : $.pageXOffset || 0, + y : $.pageYOffset || 0 + }; + } + else + { + var doc = $.document; + return { + x : doc.documentElement.scrollLeft || doc.body.scrollLeft || 0, + y : doc.documentElement.scrollTop || doc.body.scrollTop || 0 + }; + } + } + }); diff --git a/library/custom_template/ckeditor/_source/core/dtd.js b/library/custom_template/ckeditor/_source/core/dtd.js new file mode 100644 index 000000000..127de8c13 --- /dev/null +++ b/library/custom_template/ckeditor/_source/core/dtd.js @@ -0,0 +1,238 @@ +/* +Copyright (c) 2003-2011, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.html or http://ckeditor.com/license +*/ + +/** + * @fileOverview Defines the {@link CKEDITOR.dtd} object, which holds the DTD + * mapping for XHTML 1.0 Transitional. This file was automatically + * generated from the file: xhtml1-transitional.dtd. + */ + +/** + * @namespace Holds and object representation of the HTML DTD to be used by the + * editor in its internal operations.
        + *
        + * Each element in the DTD is represented by a property in this object. Each + * property contains the list of elements that can be contained by the element. + * Text is represented by the "#" property.
        + *
        + * Several special grouping properties are also available. Their names start + * with the "$" character. + * @example + * // Check if "div" can be contained in a "p" element. + * alert( !!CKEDITOR.dtd[ 'p' ][ 'div' ] ); "false" + * @example + * // Check if "p" can be contained in a "div" element. + * alert( !!CKEDITOR.dtd[ 'div' ][ 'p' ] ); "true" + * @example + * // Check if "p" is a block element. + * alert( !!CKEDITOR.dtd.$block[ 'p' ] ); "true" + */ +CKEDITOR.dtd = (function() +{ + var X = CKEDITOR.tools.extend, + + A = {isindex:1,fieldset:1}, + B = {input:1,button:1,select:1,textarea:1,label:1}, + C = X({a:1},B), + D = X({iframe:1},C), + E = {hr:1,ul:1,menu:1,div:1,blockquote:1,noscript:1,table:1,center:1,address:1,dir:1,pre:1,h5:1,dl:1,h4:1,noframes:1,h6:1,ol:1,h1:1,h3:1,h2:1}, + F = {ins:1,del:1,script:1,style:1}, + G = X({b:1,acronym:1,bdo:1,'var':1,'#':1,abbr:1,code:1,br:1,i:1,cite:1,kbd:1,u:1,strike:1,s:1,tt:1,strong:1,q:1,samp:1,em:1,dfn:1,span:1},F), + H = X({sub:1,img:1,object:1,sup:1,basefont:1,map:1,applet:1,font:1,big:1,small:1},G), + I = X({p:1},H), + J = X({iframe:1},H,B), + K = {img:1,noscript:1,br:1,kbd:1,center:1,button:1,basefont:1,h5:1,h4:1,samp:1,h6:1,ol:1,h1:1,h3:1,h2:1,form:1,font:1,'#':1,select:1,menu:1,ins:1,abbr:1,label:1,code:1,table:1,script:1,cite:1,input:1,iframe:1,strong:1,textarea:1,noframes:1,big:1,small:1,span:1,hr:1,sub:1,bdo:1,'var':1,div:1,object:1,sup:1,strike:1,dir:1,map:1,dl:1,applet:1,del:1,isindex:1,fieldset:1,ul:1,b:1,acronym:1,a:1,blockquote:1,i:1,u:1,s:1,tt:1,address:1,q:1,pre:1,p:1,em:1,dfn:1}, + + L = X({a:1},J), + M = {tr:1}, + N = {'#':1}, + O = X({param:1},K), + P = X({form:1},A,D,E,I), + Q = {li:1}, + R = {style:1,script:1}, + S = {base:1,link:1,meta:1,title:1}, + T = X(S,R), + U = {head:1,body:1}, + V = {html:1}; + + var block = {address:1,blockquote:1,center:1,dir:1,div:1,dl:1,fieldset:1,form:1,h1:1,h2:1,h3:1,h4:1,h5:1,h6:1,hr:1,isindex:1,menu:1,noframes:1,ol:1,p:1,pre:1,table:1,ul:1}; + + return /** @lends CKEDITOR.dtd */ { + + // The "$" items have been added manually. + + // List of elements living outside body. + $nonBodyContent: X(V,U,S), + + /** + * List of block elements, like "p" or "div". + * @type Object + * @example + */ + $block : block, + + /** + * List of block limit elements. + * @type Object + * @example + */ + $blockLimit : { body:1,div:1,td:1,th:1,caption:1,form:1 }, + + /** + * List of inline (<span> like) elements. + */ + $inline : L, // Just like span. + + /** + * list of elements that can be children at <body>. + */ + $body : X({script:1,style:1}, block), + + $cdata : {script:1,style:1}, + + /** + * List of empty (self-closing) elements, like "br" or "img". + * @type Object + * @example + */ + $empty : {area:1,base:1,br:1,col:1,hr:1,img:1,input:1,link:1,meta:1,param:1}, + + /** + * List of list item elements, like "li" or "dd". + * @type Object + * @example + */ + $listItem : {dd:1,dt:1,li:1}, + + /** + * List of list root elements. + * @type Object + * @example + */ + $list: { ul:1,ol:1,dl:1}, + + /** + * Elements that accept text nodes, but are not possible to edit into + * the browser. + * @type Object + * @example + */ + $nonEditable : {applet:1,button:1,embed:1,iframe:1,map:1,object:1,option:1,script:1,textarea:1,param:1}, + + /** + * List of elements that can be ignored if empty, like "b" or "span". + * @type Object + * @example + */ + $removeEmpty : {abbr:1,acronym:1,address: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,s:1,samp:1,small:1,span:1,strike:1,strong:1,sub:1,sup:1,tt:1,u:1,'var':1}, + + /** + * List of elements that have tabindex set to zero by default. + * @type Object + * @example + */ + $tabIndex : {a:1,area:1,button:1,input:1,object:1,select:1,textarea:1}, + + /** + * List of elements used inside the "table" element, like "tbody" or "td". + * @type Object + * @example + */ + $tableContent : {caption:1,col:1,colgroup:1,tbody:1,td:1,tfoot:1,th:1,thead:1,tr:1}, + + html: U, + head: T, + style: N, + script: N, + body: P, + base: {}, + link: {}, + meta: {}, + title: N, + col : {}, + tr : {td:1,th:1}, + img : {}, + colgroup : {col:1}, + noscript : P, + td : P, + br : {}, + th : P, + center : P, + kbd : L, + button : X(I,E), + basefont : {}, + h5 : L, + h4 : L, + samp : L, + h6 : L, + ol : Q, + h1 : L, + h3 : L, + option : N, + h2 : L, + form : X(A,D,E,I), + select : {optgroup:1,option:1}, + font : L, + ins : L, + menu : Q, + abbr : L, + label : L, + table : {thead:1,col:1,tbody:1,tr:1,colgroup:1,caption:1,tfoot:1}, + code : L, + script : N, + tfoot : M, + cite : L, + li : P, + input : {}, + iframe : P, + strong : L, + textarea : N, + noframes : P, + big : L, + small : L, + span : L, + hr : {}, + dt : L, + sub : L, + optgroup : {option:1}, + param : {}, + bdo : L, + 'var' : L, + div : P, + object : O, + sup : L, + dd : P, + strike : L, + area : {}, + dir : Q, + map : X({area:1,form:1,p:1},A,F,E), + applet : O, + dl : {dt:1,dd:1}, + del : L, + isindex : {}, + fieldset : X({legend:1},K), + thead : M, + ul : Q, + acronym : L, + b : L, + a : J, + blockquote : P, + caption : L, + i : L, + u : L, + tbody : M, + s : L, + address : X(D,I), + tt : L, + legend : L, + q : L, + pre : X(G,C), + p : L, + em : L, + dfn : L + }; +})(); + +// PACKAGER_RENAME( CKEDITOR.dtd ) diff --git a/library/custom_template/ckeditor/_source/core/editor.js b/library/custom_template/ckeditor/_source/core/editor.js new file mode 100644 index 000000000..bd66d9330 --- /dev/null +++ b/library/custom_template/ckeditor/_source/core/editor.js @@ -0,0 +1,985 @@ +/* +Copyright (c) 2003-2011, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.html or http://ckeditor.com/license +*/ + +/** + * @fileOverview Defines the {@link CKEDITOR.editor} class, which represents an + * editor instance. + */ + +(function() +{ + // The counter for automatic instance names. + var nameCounter = 0; + + var getNewName = function() + { + var name = 'editor' + ( ++nameCounter ); + return ( CKEDITOR.instances && CKEDITOR.instances[ name ] ) ? getNewName() : name; + }; + + // ##### START: Config Privates + + // These function loads custom configuration files and cache the + // CKEDITOR.editorConfig functions defined on them, so there is no need to + // download them more than once for several instances. + var loadConfigLoaded = {}; + var loadConfig = function( editor ) + { + var customConfig = editor.config.customConfig; + + // Check if there is a custom config to load. + if ( !customConfig ) + return false; + + customConfig = CKEDITOR.getUrl( customConfig ); + + var loadedConfig = loadConfigLoaded[ customConfig ] || ( loadConfigLoaded[ customConfig ] = {} ); + + // If the custom config has already been downloaded, reuse it. + if ( loadedConfig.fn ) + { + // Call the cached CKEDITOR.editorConfig defined in the custom + // config file for the editor instance depending on it. + loadedConfig.fn.call( editor, editor.config ); + + // If there is no other customConfig in the chain, fire the + // "configLoaded" event. + if ( CKEDITOR.getUrl( editor.config.customConfig ) == customConfig || !loadConfig( editor ) ) + editor.fireOnce( 'customConfigLoaded' ); + } + else + { + // Load the custom configuration file. + CKEDITOR.scriptLoader.load( customConfig, function() + { + // If the CKEDITOR.editorConfig function has been properly + // defined in the custom configuration file, cache it. + if ( CKEDITOR.editorConfig ) + loadedConfig.fn = CKEDITOR.editorConfig; + else + loadedConfig.fn = function(){}; + + // Call the load config again. This time the custom + // config is already cached and so it will get loaded. + loadConfig( editor ); + }); + } + + return true; + }; + + var initConfig = function( editor, instanceConfig ) + { + // Setup the lister for the "customConfigLoaded" event. + editor.on( 'customConfigLoaded', function() + { + if ( instanceConfig ) + { + // Register the events that may have been set at the instance + // configuration object. + if ( instanceConfig.on ) + { + for ( var eventName in instanceConfig.on ) + { + editor.on( eventName, instanceConfig.on[ eventName ] ); + } + } + + // Overwrite the settings from the in-page config. + CKEDITOR.tools.extend( editor.config, instanceConfig, true ); + + delete editor.config.on; + } + + onConfigLoaded( editor ); + }); + + // The instance config may override the customConfig setting to avoid + // loading the default ~/config.js file. + if ( instanceConfig && instanceConfig.customConfig != undefined ) + editor.config.customConfig = instanceConfig.customConfig; + + // Load configs from the custom configuration files. + if ( !loadConfig( editor ) ) + editor.fireOnce( 'customConfigLoaded' ); + }; + + // ##### END: Config Privates + + var onConfigLoaded = function( editor ) + { + // Set config related properties. + + var skin = editor.config.skin.split( ',' ), + skinName = skin[ 0 ], + skinPath = CKEDITOR.getUrl( skin[ 1 ] || ( + '_source/' + // @Packager.RemoveLine + 'skins/' + skinName + '/' ) ); + + /** + * The name of the skin used by this editor instance. The skin name can + * be set though the {@link CKEDITOR.config.skin} setting. + * @name CKEDITOR.editor.prototype.skinName + * @type String + * @example + * alert( editor.skinName ); // "kama" (e.g.) + */ + editor.skinName = skinName; + + /** + * The full URL of the skin directory. + * @name CKEDITOR.editor.prototype.skinPath + * @type String + * @example + * alert( editor.skinPath ); // "http://example.com/ckeditor/skins/kama/" (e.g.) + */ + editor.skinPath = skinPath; + + /** + * The CSS class name used for skin identification purposes. + * @name CKEDITOR.editor.prototype.skinClass + * @type String + * @example + * alert( editor.skinClass ); // "cke_skin_kama" (e.g.) + */ + editor.skinClass = 'cke_skin_' + skinName; + + /** + * The tabbing + * navigation order that has been calculated for this editor + * instance. This can be set by the {@link CKEDITOR.config.tabIndex} + * setting or taken from the "tabindex" attribute of the + * {@link #element} associated to the editor. + * @name CKEDITOR.editor.prototype.tabIndex + * @type Number + * @default 0 (zero) + * @example + * alert( editor.tabIndex ); // "0" (e.g.) + */ + editor.tabIndex = editor.config.tabIndex || editor.element.getAttribute( 'tabindex' ) || 0; + + // Fire the "configLoaded" event. + editor.fireOnce( 'configLoaded' ); + + // Load language file. + loadSkin( editor ); + }; + + var loadLang = function( editor ) + { + CKEDITOR.lang.load( editor.config.language, editor.config.defaultLanguage, function( languageCode, lang ) + { + /** + * The code for the language resources that have been loaded + * for the user internface elements of this editor instance. + * @name CKEDITOR.editor.prototype.langCode + * @type String + * @example + * alert( editor.langCode ); // "en" (e.g.) + */ + editor.langCode = languageCode; + + /** + * An object holding all language strings used by the editor + * interface. + * @name CKEDITOR.editor.prototype.lang + * @type CKEDITOR.lang + * @example + * alert( editor.lang.bold ); // "Negrito" (e.g. if language is Portuguese) + */ + // As we'll be adding plugin specific entries that could come + // from different language code files, we need a copy of lang, + // not a direct reference to it. + editor.lang = CKEDITOR.tools.prototypedCopy( lang ); + + // We're not able to support RTL in Firefox 2 at this time. + if ( CKEDITOR.env.gecko && CKEDITOR.env.version < 10900 && editor.lang.dir == 'rtl' ) + editor.lang.dir = 'ltr'; + + var config = editor.config; + config.contentsLangDirection == 'ui' && ( config.contentsLangDirection = editor.lang.dir ); + + loadPlugins( editor ); + }); + }; + + var loadPlugins = function( editor ) + { + var config = editor.config, + plugins = config.plugins, + extraPlugins = config.extraPlugins, + removePlugins = config.removePlugins; + + if ( extraPlugins ) + { + // Remove them first to avoid duplications. + var removeRegex = new RegExp( '(?:^|,)(?:' + extraPlugins.replace( /\s*,\s*/g, '|' ) + ')(?=,|$)' , 'g' ); + plugins = plugins.replace( removeRegex, '' ); + + plugins += ',' + extraPlugins; + } + + if ( removePlugins ) + { + removeRegex = new RegExp( '(?:^|,)(?:' + removePlugins.replace( /\s*,\s*/g, '|' ) + ')(?=,|$)' , 'g' ); + plugins = plugins.replace( removeRegex, '' ); + } + + // Load the Adobe AIR plugin conditionally. + CKEDITOR.env.air && ( plugins += ',adobeair' ); + + // Load all plugins defined in the "plugins" setting. + CKEDITOR.plugins.load( plugins.split( ',' ), function( plugins ) + { + // The list of plugins. + var pluginsArray = []; + + // The language code to get loaded for each plugin. Null + // entries will be appended for plugins with no language files. + var languageCodes = []; + + // The list of URLs to language files. + var languageFiles = []; + + /** + * And object holding references to all plugins used by this + * editor istance. + * @name CKEDITOR.editor.prototype.plugins + * @type Object + * @example + * alert( editor.plugins.dialog.path ); // "http://example.com/ckeditor/plugins/dialog/" (e.g.) + */ + editor.plugins = plugins; + + // Loop through all plugins, to build the list of language + // files to get loaded. + for ( var pluginName in plugins ) + { + var plugin = plugins[ pluginName ], + pluginLangs = plugin.lang, + pluginPath = CKEDITOR.plugins.getPath( pluginName ), + lang = null; + + // Set the plugin path in the plugin. + plugin.path = pluginPath; + + // If the plugin has "lang". + if ( pluginLangs ) + { + // Resolve the plugin language. If the current language + // is not available, get the first one (default one). + lang = ( CKEDITOR.tools.indexOf( pluginLangs, editor.langCode ) >= 0 ? editor.langCode : pluginLangs[ 0 ] ); + + if ( !plugin.lang[ lang ] ) + { + // Put the language file URL into the list of files to + // get downloaded. + languageFiles.push( CKEDITOR.getUrl( pluginPath + 'lang/' + lang + '.js' ) ); + } + else + { + CKEDITOR.tools.extend( editor.lang, plugin.lang[ lang ] ); + lang = null; + } + } + + // Save the language code, so we know later which + // language has been resolved to this plugin. + languageCodes.push( lang ); + + pluginsArray.push( plugin ); + } + + // Load all plugin specific language files in a row. + CKEDITOR.scriptLoader.load( languageFiles, function() + { + // Initialize all plugins that have the "beforeInit" and "init" methods defined. + var methods = [ 'beforeInit', 'init', 'afterInit' ]; + for ( var m = 0 ; m < methods.length ; m++ ) + { + for ( var i = 0 ; i < pluginsArray.length ; i++ ) + { + var plugin = pluginsArray[ i ]; + + // Uses the first loop to update the language entries also. + if ( m === 0 && languageCodes[ i ] && plugin.lang ) + CKEDITOR.tools.extend( editor.lang, plugin.lang[ languageCodes[ i ] ] ); + + // Call the plugin method (beforeInit and init). + if ( plugin[ methods[ m ] ] ) + plugin[ methods[ m ] ]( editor ); + } + } + + // Load the editor skin. + editor.fire( 'pluginsLoaded' ); + loadTheme( editor ); + }); + }); + }; + + var loadSkin = function( editor ) + { + CKEDITOR.skins.load( editor, 'editor', function() + { + loadLang( editor ); + }); + }; + + var loadTheme = function( editor ) + { + var theme = editor.config.theme; + CKEDITOR.themes.load( theme, function() + { + /** + * The theme used by this editor instance. + * @name CKEDITOR.editor.prototype.theme + * @type CKEDITOR.theme + * @example + * alert( editor.theme ); "http://example.com/ckeditor/themes/default/" (e.g.) + */ + var editorTheme = editor.theme = CKEDITOR.themes.get( theme ); + editorTheme.path = CKEDITOR.themes.getPath( theme ); + editorTheme.build( editor ); + + if ( editor.config.autoUpdateElement ) + attachToForm( editor ); + }); + }; + + var attachToForm = function( editor ) + { + var element = editor.element; + + // If are replacing a textarea, we must + if ( editor.elementMode == CKEDITOR.ELEMENT_MODE_REPLACE && element.is( 'textarea' ) ) + { + var form = element.$.form && new CKEDITOR.dom.element( element.$.form ); + if ( form ) + { + function onSubmit() + { + editor.updateElement(); + } + form.on( 'submit',onSubmit ); + + // Setup the submit function because it doesn't fire the + // "submit" event. + if ( !form.$.submit.nodeName && !form.$.submit.length ) + { + form.$.submit = CKEDITOR.tools.override( form.$.submit, function( originalSubmit ) + { + return function() + { + editor.updateElement(); + + // For IE, the DOM submit function is not a + // function, so we need thid check. + if ( originalSubmit.apply ) + originalSubmit.apply( this, arguments ); + else + originalSubmit(); + }; + }); + } + + // Remove 'submit' events registered on form element before destroying.(#3988) + editor.on( 'destroy', function() + { + form.removeListener( 'submit', onSubmit ); + } ); + } + } + }; + + function updateCommandsMode() + { + var command, + commands = this._.commands, + mode = this.mode; + + for ( var name in commands ) + { + command = commands[ name ]; + command[ command.startDisabled ? 'disable' : command.modes[ mode ] ? 'enable' : 'disable' ](); + } + } + + /** + * Initializes the editor instance. This function is called by the editor + * contructor (editor_basic.js). + * @private + */ + CKEDITOR.editor.prototype._init = function() + { + // Get the properties that have been saved in the editor_base + // implementation. + var element = CKEDITOR.dom.element.get( this._.element ), + instanceConfig = this._.instanceConfig; + delete this._.element; + delete this._.instanceConfig; + + this._.commands = {}; + this._.styles = []; + + /** + * The DOM element that has been replaced by this editor instance. This + * element holds the editor data on load and post. + * @name CKEDITOR.editor.prototype.element + * @type CKEDITOR.dom.element + * @example + * var editor = CKEDITOR.instances.editor1; + * alert( editor.element.getName() ); "textarea" + */ + this.element = element; + + /** + * The editor instance name. It hay be the replaced element id, name or + * a default name using a progressive counter (editor1, editor2, ...). + * @name CKEDITOR.editor.prototype.name + * @type String + * @example + * var editor = CKEDITOR.instances.editor1; + * alert( editor.name ); "editor1" + */ + this.name = ( element && ( this.elementMode == CKEDITOR.ELEMENT_MODE_REPLACE ) + && ( element.getId() || element.getNameAtt() ) ) + || getNewName(); + + if ( this.name in CKEDITOR.instances ) + throw '[CKEDITOR.editor] The instance "' + this.name + '" already exists.'; + + /** + * A unique random string assigned to each editor instance in the page. + * @name CKEDITOR.editor.prototype.id + * @type String + */ + this.id = CKEDITOR.tools.getNextId(); + + /** + * The configurations for this editor instance. It inherits all + * settings defined in (@link CKEDITOR.config}, combined with settings + * loaded from custom configuration files and those defined inline in + * the page when creating the editor. + * @name CKEDITOR.editor.prototype.config + * @type Object + * @example + * var editor = CKEDITOR.instances.editor1; + * alert( editor.config.theme ); "default" e.g. + */ + this.config = CKEDITOR.tools.prototypedCopy( CKEDITOR.config ); + + /** + * Namespace containing UI features related to this editor instance. + * @name CKEDITOR.editor.prototype.ui + * @type CKEDITOR.ui + * @example + */ + this.ui = new CKEDITOR.ui( this ); + + /** + * Controls the focus state of this editor instance. This property + * is rarely used for normal API operations. It is mainly + * destinated to developer adding UI elements to the editor interface. + * @name CKEDITOR.editor.prototype.focusManager + * @type CKEDITOR.focusManager + * @example + */ + this.focusManager = new CKEDITOR.focusManager( this ); + + CKEDITOR.fire( 'instanceCreated', null, this ); + + this.on( 'mode', updateCommandsMode, null, null, 1 ); + + initConfig( this, instanceConfig ); + }; +})(); + +CKEDITOR.tools.extend( CKEDITOR.editor.prototype, + /** @lends CKEDITOR.editor.prototype */ + { + /** + * Adds a command definition to the editor instance. Commands added with + * this function can be later executed with {@link #execCommand}. + * @param {String} commandName The indentifier name of the command. + * @param {CKEDITOR.commandDefinition} commandDefinition The command definition. + * @example + * editorInstance.addCommand( 'sample', + * { + * exec : function( editor ) + * { + * alert( 'Executing a command for the editor name "' + editor.name + '"!' ); + * } + * }); + */ + addCommand : function( commandName, commandDefinition ) + { + return this._.commands[ commandName ] = new CKEDITOR.command( this, commandDefinition ); + }, + + /** + * Add a trunk of css text to the editor which will be applied to the wysiwyg editing document. + * Note: This function should be called before editor is loaded to take effect. + * @param css {String} CSS text. + * @example + * editorInstance.addCss( 'body { background-color: grey; }' ); + */ + addCss : function( css ) + { + this._.styles.push( css ); + }, + + /** + * Destroys the editor instance, releasing all resources used by it. + * If the editor replaced an element, the element will be recovered. + * @param {Boolean} [noUpdate] If the instance is replacing a DOM + * element, this parameter indicates whether or not to update the + * element with the instance contents. + * @example + * alert( CKEDITOR.instances.editor1 ); e.g "object" + * CKEDITOR.instances.editor1.destroy(); + * alert( CKEDITOR.instances.editor1 ); "undefined" + */ + destroy : function( noUpdate ) + { + if ( !noUpdate ) + this.updateElement(); + + this.fire( 'destroy' ); + this.theme && this.theme.destroy( this ); + + CKEDITOR.remove( this ); + CKEDITOR.fire( 'instanceDestroyed', null, this ); + }, + + /** + * Executes a command. + * @param {String} commandName The indentifier name of the command. + * @param {Object} [data] Data to be passed to the command + * @returns {Boolean} "true" if the command has been successfuly + * executed, otherwise "false". + * @example + * editorInstance.execCommand( 'Bold' ); + */ + execCommand : function( commandName, data ) + { + var command = this.getCommand( commandName ); + + var eventData = + { + name: commandName, + commandData: data, + command: command + }; + + if ( command && command.state != CKEDITOR.TRISTATE_DISABLED ) + { + if ( this.fire( 'beforeCommandExec', eventData ) !== true ) + { + eventData.returnValue = command.exec( eventData.commandData ); + + // Fire the 'afterCommandExec' immediately if command is synchronous. + if ( !command.async && this.fire( 'afterCommandExec', eventData ) !== true ) + return eventData.returnValue; + } + } + + // throw 'Unknown command name "' + commandName + '"'; + return false; + }, + + /** + * Gets one of the registered commands. Note that, after registering a + * command definition with addCommand, it is transformed internally + * into an instance of {@link CKEDITOR.command}, which will be then + * returned by this function. + * @param {String} commandName The name of the command to be returned. + * This is the same used to register the command with addCommand. + * @returns {CKEDITOR.command} The command object identified by the + * provided name. + */ + getCommand : function( commandName ) + { + return this._.commands[ commandName ]; + }, + + /** + * Gets the editor data. The data will be in raw format. It is the same + * data that is posted by the editor. + * @type String + * @returns (String) The editor data. + * @example + * if ( CKEDITOR.instances.editor1.getData() == '' ) + * alert( 'There is no data available' ); + */ + getData : function() + { + this.fire( 'beforeGetData' ); + + var eventData = this._.data; + + if ( typeof eventData != 'string' ) + { + var element = this.element; + if ( element && this.elementMode == CKEDITOR.ELEMENT_MODE_REPLACE ) + eventData = element.is( 'textarea' ) ? element.getValue() : element.getHtml(); + else + eventData = ''; + } + + eventData = { dataValue : eventData }; + + // Fire "getData" so data manipulation may happen. + this.fire( 'getData', eventData ); + + return eventData.dataValue; + }, + + /** + * Gets the "raw data" currently available in the editor. This is a + * fast method which return the data as is, without processing, so it's + * not recommended to use it on resulting pages. It can be used instead + * combined with the {@link #loadSnapshot} so one can automatic save + * the editor data from time to time while the user is using the + * editor, to avoid data loss, without risking performance issues. + * @example + * alert( editor.getSnapshot() ); + */ + getSnapshot : function() + { + var data = this.fire( 'getSnapshot' ); + + if ( typeof data != 'string' ) + { + var element = this.element; + if ( element && this.elementMode == CKEDITOR.ELEMENT_MODE_REPLACE ) + data = element.is( 'textarea' ) ? element.getValue() : element.getHtml(); + } + + return data; + }, + + /** + * Loads "raw data" in the editor. This data is loaded with processing + * straight to the editing area. It should not be used as a way to load + * any kind of data, but instead in combination with + * {@link #getSnapshot} produced data. + * @example + * var data = editor.getSnapshot(); + * editor.loadSnapshot( data ); + */ + loadSnapshot : function( snapshot ) + { + this.fire( 'loadSnapshot', snapshot ); + }, + + /** + * Sets the editor data. The data must be provided in raw format (HTML).
        + *
        + * Note that this menthod is asynchronous. The "callback" parameter must + * be used if interaction with the editor is needed after setting the data. + * @param {String} data HTML code to replace the curent content in the + * editor. + * @param {Function} callback Function to be called after the setData + * is completed. + *@param {Boolean} internal Whether suppress any event firing when copying data internally inside editor. + * @example + * CKEDITOR.instances.editor1.setData( '<p>This is the editor data.</p>' ); + * @example + * CKEDITOR.instances.editor1.setData( '<p>Some other editor data.</p>', function() + * { + * this.checkDirty(); // true + * }); + */ + setData : function( data , callback, internal ) + { + if( callback ) + { + this.on( 'dataReady', function( evt ) + { + evt.removeListener(); + callback.call( evt.editor ); + } ); + } + + // Fire "setData" so data manipulation may happen. + var eventData = { dataValue : data }; + !internal && this.fire( 'setData', eventData ); + + this._.data = eventData.dataValue; + + !internal && this.fire( 'afterSetData', eventData ); + }, + + /** + * Inserts HTML into the currently selected position in the editor. + * @param {String} data HTML code to be inserted into the editor. + * @example + * CKEDITOR.instances.editor1.insertHtml( '<p>This is a new paragraph.</p>' ); + */ + insertHtml : function( data ) + { + this.fire( 'insertHtml', data ); + }, + + /** + * Insert text content into the currently selected position in the + * editor, in WYSIWYG mode, styles of the selected element will be applied to the inserted text, + * spaces around the text will be leaving untouched. + * Note: two subsequent line-breaks will introduce one paragraph, which element depends on {@link CKEDITOR.config.enterMode}; + * A single line-break will be instead translated into one <br />. + * @since 3.5 + * @param {String} text Text to be inserted into the editor. + * @example + * CKEDITOR.instances.editor1.insertText( ' line1 \n\n line2' ); + */ + insertText : function( text ) + { + this.fire( 'insertText', text ); + }, + + /** + * Inserts an element into the currently selected position in the + * editor. + * @param {CKEDITOR.dom.element} element The element to be inserted + * into the editor. + * @example + * var element = CKEDITOR.dom.element.createFromHtml( '<img src="hello.png" border="0" title="Hello" />' ); + * CKEDITOR.instances.editor1.insertElement( element ); + */ + insertElement : function( element ) + { + this.fire( 'insertElement', element ); + }, + + /** + * Checks whether the current editor contents present changes when + * compared to the contents loaded into the editor at startup, or to + * the contents available in the editor when {@link #resetDirty} has + * been called. + * @returns {Boolean} "true" is the contents present changes. + * @example + * function beforeUnload( e ) + * { + * if ( CKEDITOR.instances.editor1.checkDirty() ) + * return e.returnValue = "You'll loose the changes made in the editor."; + * } + * + * if ( window.addEventListener ) + * window.addEventListener( 'beforeunload', beforeUnload, false ); + * else + * window.attachEvent( 'onbeforeunload', beforeUnload ); + */ + checkDirty : function() + { + return ( this.mayBeDirty && this._.previousValue !== this.getSnapshot() ); + }, + + /** + * Resets the "dirty state" of the editor so subsequent calls to + * {@link #checkDirty} will return "false" if the user will not make + * further changes to the contents. + * @example + * alert( editor.checkDirty() ); // "true" (e.g.) + * editor.resetDirty(); + * alert( editor.checkDirty() ); // "false" + */ + resetDirty : function() + { + if ( this.mayBeDirty ) + this._.previousValue = this.getSnapshot(); + }, + + /** + * Updates the <textarea> element that has been replaced by the editor with + * the current data available in the editor. + * @example + * CKEDITOR.instances.editor1.updateElement(); + * alert( document.getElementById( 'editor1' ).value ); // The current editor data. + */ + updateElement : function() + { + var element = this.element; + if ( element && this.elementMode == CKEDITOR.ELEMENT_MODE_REPLACE ) + { + var data = this.getData(); + + if ( this.config.htmlEncodeOutput ) + data = CKEDITOR.tools.htmlEncode( data ); + + if ( element.is( 'textarea' ) ) + element.setValue( data ); + else + element.setHtml( data ); + } + } + }); + +CKEDITOR.on( 'loaded', function() + { + // Run the full initialization for pending editors. + var pending = CKEDITOR.editor._pending; + if ( pending ) + { + delete CKEDITOR.editor._pending; + + for ( var i = 0 ; i < pending.length ; i++ ) + pending[ i ]._init(); + } + }); + +/** + * Whether escape HTML when editor update original input element. + * @name CKEDITOR.config.htmlEncodeOutput + * @since 3.1 + * @type Boolean + * @default false + * @example + * config.htmlEncodeOutput = true; + */ + +/** + * Fired when a CKEDITOR instance is created, but still before initializing it. + * To interact with a fully initialized instance, use the + * {@link CKEDITOR#instanceReady} event instead. + * @name CKEDITOR#instanceCreated + * @event + * @param {CKEDITOR.editor} editor The editor instance that has been created. + */ + +/** + * Fired when a CKEDITOR instance is destroyed. + * @name CKEDITOR#instanceDestroyed + * @event + * @param {CKEDITOR.editor} editor The editor instance that has been destroyed. + */ + +/** + * Fired when all plugins are loaded and initialized into the editor instance. + * @name CKEDITOR.editor#pluginsLoaded + * @event + * @param {CKEDITOR.editor} editor This editor instance. + */ + +/** + * Fired before the command execution when {@link #execCommand} is called. + * @name CKEDITOR.editor#beforeCommandExec + * @event + * @param {CKEDITOR.editor} editor This editor instance. + * @param {String} data.name The command name. + * @param {Object} data.commandData The data to be sent to the command. This + * can be manipulated by the event listener. + * @param {CKEDITOR.command} data.command The command itself. + */ + +/** + * Fired after the command execution when {@link #execCommand} is called. + * @name CKEDITOR.editor#afterCommandExec + * @event + * @param {CKEDITOR.editor} editor This editor instance. + * @param {String} data.name The command name. + * @param {Object} data.commandData The data sent to the command. + * @param {CKEDITOR.command} data.command The command itself. + * @param {Object} data.returnValue The value returned by the command execution. + */ + +/** + * Fired every custom configuration file is loaded, before the final + * configurations initialization.
        + *
        + * Custom configuration files can be loaded thorugh the + * {@link CKEDITOR.config.customConfig} setting. Several files can be loading + * by chaning this setting. + * @name CKEDITOR.editor#customConfigLoaded + * @event + * @param {CKEDITOR.editor} editor This editor instance. + * @example + */ + +/** + * Fired once the editor configuration is ready (loaded and processed). + * @name CKEDITOR.editor#configLoaded + * @event + * @param {CKEDITOR.editor} editor This editor instance. + * @example + * if( editor.config.fullPage ) + * alert( 'This is a full page editor' ); + */ + +/** + * Fired when this editor instance is destroyed. The editor at this + * point isn't usable and this event should be used to perform clean up + * in any plugin. + * @name CKEDITOR.editor#destroy + * @event + */ + +/** + * Internal event to get the current data. + * @name CKEDITOR.editor#beforeGetData + * @event + */ + +/** + * Internal event to perform the #getSnapshot call. + * @name CKEDITOR.editor#getSnapshot + * @event + */ + +/** + * Internal event to perform the #loadSnapshot call. + * @name CKEDITOR.editor#loadSnapshot + * @event + */ + + +/** + * Event fired before the #getData call returns allowing additional manipulation. + * @name CKEDITOR.editor#getData + * @event + * @param {CKEDITOR.editor} editor This editor instance. + * @param {String} data.dataValue The data that will be returned. + */ + +/** + * Event fired before the #setData call is executed allowing additional manipulation. + * @name CKEDITOR.editor#setData + * @event + * @param {CKEDITOR.editor} editor This editor instance. + * @param {String} data.dataValue The data that will be used. + */ + +/** + * Event fired at the end of the #setData call is executed. Usually it's better to use the + * {@link CKEDITOR.editor.prototype.dataReady} event. + * @name CKEDITOR.editor#afterSetData + * @event + * @param {CKEDITOR.editor} editor This editor instance. + * @param {String} data.dataValue The data that has been set. + */ + +/** + * Internal event to perform the #insertHtml call + * @name CKEDITOR.editor#insertHtml + * @event + * @param {CKEDITOR.editor} editor This editor instance. + * @param {String} data The HTML to insert. + */ + +/** + * Internal event to perform the #insertText call + * @name CKEDITOR.editor#insertText + * @event + * @param {CKEDITOR.editor} editor This editor instance. + * @param {String} text The text to insert. + */ + +/** + * Internal event to perform the #insertElement call + * @name CKEDITOR.editor#insertElement + * @event + * @param {CKEDITOR.editor} editor This editor instance. + * @param {Object} element The element to insert. + */ diff --git a/library/custom_template/ckeditor/_source/core/editor_basic.js b/library/custom_template/ckeditor/_source/core/editor_basic.js new file mode 100644 index 000000000..a365e84c5 --- /dev/null +++ b/library/custom_template/ckeditor/_source/core/editor_basic.js @@ -0,0 +1,186 @@ +/* +Copyright (c) 2003-2011, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.html or http://ckeditor.com/license +*/ + +if ( !CKEDITOR.editor ) +{ + /** + * No element is linked to the editor instance. + * @constant + * @example + */ + CKEDITOR.ELEMENT_MODE_NONE = 0; + + /** + * The element is to be replaced by the editor instance. + * @constant + * @example + */ + CKEDITOR.ELEMENT_MODE_REPLACE = 1; + + /** + * The editor is to be created inside the element. + * @constant + * @example + */ + CKEDITOR.ELEMENT_MODE_APPENDTO = 2; + + /** + * Creates an editor class instance. This constructor should be rarely + * used, in favor of the {@link CKEDITOR} editor creation functions. + * @ class Represents an editor instance. + * @param {Object} instanceConfig Configuration values for this specific + * instance. + * @param {CKEDITOR.dom.element} [element] The element linked to this + * instance. + * @param {Number} [mode] The mode in which the element is linked to this + * instance. See {@link #elementMode}. + * @param {String} [data] Since 3.3. Initial value for the instance. + * @augments CKEDITOR.event + * @example + */ + CKEDITOR.editor = function( instanceConfig, element, mode, data ) + { + this._ = + { + // Save the config to be processed later by the full core code. + instanceConfig : instanceConfig, + element : element, + data : data + }; + + /** + * The mode in which the {@link #element} is linked to this editor + * instance. It can be any of the following values: + *
          + *
        • {@link CKEDITOR.ELEMENT_MODE_NONE}: No element is linked to the + * editor instance.
        • + *
        • {@link CKEDITOR.ELEMENT_MODE_REPLACE}: The element is to be + * replaced by the editor instance.
        • + *
        • {@link CKEDITOR.ELEMENT_MODE_APPENDTO}: The editor is to be + * created inside the element.
        • + *
        + * @name CKEDITOR.editor.prototype.elementMode + * @type Number + * @example + * var editor = CKEDITOR.replace( 'editor1' ); + * alert( editor.elementMode ); "1" + */ + this.elementMode = mode || CKEDITOR.ELEMENT_MODE_NONE; + + // Call the CKEDITOR.event constructor to initialize this instance. + CKEDITOR.event.call( this ); + + this._init(); + }; + + /** + * Replaces a <textarea> or a DOM element (DIV) with a CKEditor + * instance. For textareas, the initial value in the editor will be the + * textarea value. For DOM elements, their innerHTML will be used + * instead. We recommend using TEXTAREA and DIV elements only. Do not use + * this function directly. Use {@link CKEDITOR.replace} instead. + * @param {Object|String} elementOrIdOrName The DOM element (textarea), its + * ID or name. + * @param {Object} [config] The specific configurations to apply to this + * editor instance. Configurations set here will override global CKEditor + * settings. + * @returns {CKEDITOR.editor} The editor instance created. + * @example + */ + CKEDITOR.editor.replace = function( elementOrIdOrName, config ) + { + var element = elementOrIdOrName; + + if ( typeof element != 'object' ) + { + // Look for the element by id. We accept any kind of element here. + element = document.getElementById( elementOrIdOrName ); + + // Elements that should go into head are unacceptable (#6791). + if ( element && element.tagName.toLowerCase() in {style:1,script:1,base:1,link:1,meta:1,title:1} ) + element = null; + + // If not found, look for elements by name. In this case we accept only + // textareas. + if ( !element ) + { + var i = 0, + textareasByName = document.getElementsByName( elementOrIdOrName ); + + while ( ( element = textareasByName[ i++ ] ) && element.tagName.toLowerCase() != 'textarea' ) + { /*jsl:pass*/ } + } + + if ( !element ) + throw '[CKEDITOR.editor.replace] The element with id or name "' + elementOrIdOrName + '" was not found.'; + } + + // Do not replace the textarea right now, just hide it. The effective + // replacement will be done by the _init function. + element.style.visibility = 'hidden'; + + // Create the editor instance. + return new CKEDITOR.editor( config, element, CKEDITOR.ELEMENT_MODE_REPLACE ); + }; + + /** + * Creates a new editor instance inside a specific DOM element. Do not use + * this function directly. Use {@link CKEDITOR.appendTo} instead. + * @param {Object|String} elementOrId The DOM element or its ID. + * @param {Object} [config] The specific configurations to apply to this + * editor instance. Configurations set here will override global CKEditor + * settings. + * @param {String} [data] Since 3.3. Initial value for the instance. + * @returns {CKEDITOR.editor} The editor instance created. + * @example + */ + CKEDITOR.editor.appendTo = function( elementOrId, config, data ) + { + var element = elementOrId; + if ( typeof element != 'object' ) + { + element = document.getElementById( elementOrId ); + + if ( !element ) + throw '[CKEDITOR.editor.appendTo] The element with id "' + elementOrId + '" was not found.'; + } + + // Create the editor instance. + return new CKEDITOR.editor( config, element, CKEDITOR.ELEMENT_MODE_APPENDTO, data ); + }; + + CKEDITOR.editor.prototype = + { + /** + * Initializes the editor instance. This function will be overriden by the + * full CKEDITOR.editor implementation (editor.js). + * @private + */ + _init : function() + { + var pending = CKEDITOR.editor._pending || ( CKEDITOR.editor._pending = [] ); + pending.push( this ); + }, + + // Both fire and fireOnce will always pass this editor instance as the + // "editor" param in CKEDITOR.event.fire. So, we override it to do that + // automaticaly. + + /** @ignore */ + fire : function( eventName, data ) + { + return CKEDITOR.event.prototype.fire.call( this, eventName, data, this ); + }, + + /** @ignore */ + fireOnce : function( eventName, data ) + { + return CKEDITOR.event.prototype.fireOnce.call( this, eventName, data, this ); + } + }; + + // "Inherit" (copy actually) from CKEDITOR.event. + CKEDITOR.event.implementOn( CKEDITOR.editor.prototype, true ); +} diff --git a/library/custom_template/ckeditor/_source/core/env.js b/library/custom_template/ckeditor/_source/core/env.js new file mode 100644 index 000000000..6053e792d --- /dev/null +++ b/library/custom_template/ckeditor/_source/core/env.js @@ -0,0 +1,272 @@ +/* +Copyright (c) 2003-2011, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.html or http://ckeditor.com/license +*/ + +/** + * @fileOverview Defines the {@link CKEDITOR.env} object, which constains + * environment and browser information. + */ + +if ( !CKEDITOR.env ) +{ + /** + * @namespace Environment and browser information. + */ + CKEDITOR.env = (function() + { + var agent = navigator.userAgent.toLowerCase(); + var opera = window.opera; + + var env = + /** @lends CKEDITOR.env */ + { + /** + * Indicates that CKEditor is running on Internet Explorer. + * @type Boolean + * @example + * if ( CKEDITOR.env.ie ) + * alert( "I'm on IE!" ); + */ + ie : /*@cc_on!@*/false, + + /** + * Indicates that CKEditor is running on Opera. + * @type Boolean + * @example + * if ( CKEDITOR.env.opera ) + * alert( "I'm on Opera!" ); + */ + opera : ( !!opera && opera.version ), + + /** + * Indicates that CKEditor is running on a WebKit based browser, like + * Safari. + * @type Boolean + * @example + * if ( CKEDITOR.env.webkit ) + * alert( "I'm on WebKit!" ); + */ + webkit : ( agent.indexOf( ' applewebkit/' ) > -1 ), + + /** + * Indicates that CKEditor is running on Adobe AIR. + * @type Boolean + * @example + * if ( CKEDITOR.env.air ) + * alert( "I'm on AIR!" ); + */ + air : ( agent.indexOf( ' adobeair/' ) > -1 ), + + /** + * Indicates that CKEditor is running on Macintosh. + * @type Boolean + * @example + * if ( CKEDITOR.env.mac ) + * alert( "I love apples!" ); + */ + mac : ( agent.indexOf( 'macintosh' ) > -1 ), + + /** + * Indicates that CKEditor is running on a quirks mode environemnt. + * @type Boolean + * @example + * if ( CKEDITOR.env.quirks ) + * alert( "Nooooo!" ); + */ + quirks : ( document.compatMode == 'BackCompat' ), + + /** + * Indicates that CKEditor is running on a mobile like environemnt. + * @type Boolean + * @example + * if ( CKEDITOR.env.mobile ) + * alert( "I'm running with CKEditor today!" ); + */ + mobile : ( agent.indexOf( 'mobile' ) > -1 ), + + /** + * Indicates that the browser has a custom domain enabled. This has + * been set with "document.domain". + * @returns {Boolean} "true" if a custom domain is enabled. + * @example + * if ( CKEDITOR.env.isCustomDomain() ) + * alert( "I'm in a custom domain!" ); + */ + isCustomDomain : function() + { + if ( !this.ie ) + return false; + + var domain = document.domain, + hostname = window.location.hostname; + + return domain != hostname && + domain != ( '[' + hostname + ']' ); // IPv6 IP support (#5434) + } + }; + + /** + * Indicates that CKEditor is running on a Gecko based browser, like + * Firefox. + * @name CKEDITOR.env.gecko + * @type Boolean + * @example + * if ( CKEDITOR.env.gecko ) + * alert( "I'm riding a gecko!" ); + */ + env.gecko = ( navigator.product == 'Gecko' && !env.webkit && !env.opera ); + + var version = 0; + + // Internet Explorer 6.0+ + if ( env.ie ) + { + version = parseFloat( agent.match( /msie (\d+)/ )[1] ); + + /** + * Indicates that CKEditor is running on Internet Explorer 8. + * @name CKEDITOR.env.ie8 + * @type Boolean + * @example + * if ( CKEDITOR.env.ie8 ) + * alert( "I'm on IE8!" ); + */ + env.ie8 = !!document.documentMode; + + /** + * Indicates that CKEditor is running on Internet Explorer 8 on + * standards mode. + * @name CKEDITOR.env.ie8Compat + * @type Boolean + * @example + * if ( CKEDITOR.env.ie8Compat ) + * alert( "Now I'm on IE8, for real!" ); + */ + env.ie8Compat = document.documentMode == 8; + + /** + * Indicates that CKEditor is running on an IE7-like environment, which + * includes IE7 itself and IE8's IE7 document mode. + * @name CKEDITOR.env.ie7Compat + * @type Boolean + * @example + * if ( CKEDITOR.env.ie8Compat ) + * alert( "I'm on IE7 or on an IE7 like IE8!" ); + */ + env.ie7Compat = ( ( version == 7 && !document.documentMode ) + || document.documentMode == 7 ); + + /** + * Indicates that CKEditor is running on an IE6-like environment, which + * includes IE6 itself and IE7 and IE8 quirks mode. + * @name CKEDITOR.env.ie6Compat + * @type Boolean + * @example + * if ( CKEDITOR.env.ie6Compat ) + * alert( "I'm on IE6 or quirks mode!" ); + */ + env.ie6Compat = ( version < 7 || env.quirks ); + } + + // Gecko. + if ( env.gecko ) + { + var geckoRelease = agent.match( /rv:([\d\.]+)/ ); + if ( geckoRelease ) + { + geckoRelease = geckoRelease[1].split( '.' ); + version = geckoRelease[0] * 10000 + ( geckoRelease[1] || 0 ) * 100 + ( geckoRelease[2] || 0 ) * 1; + } + } + + // Opera 9.50+ + if ( env.opera ) + version = parseFloat( opera.version() ); + + // Adobe AIR 1.0+ + // Checked before Safari because AIR have the WebKit rich text editor + // features from Safari 3.0.4, but the version reported is 420. + if ( env.air ) + version = parseFloat( agent.match( / adobeair\/(\d+)/ )[1] ); + + // WebKit 522+ (Safari 3+) + if ( env.webkit ) + version = parseFloat( agent.match( / applewebkit\/(\d+)/ )[1] ); + + /** + * Contains the browser version.
        + *
        + * For gecko based browsers (like Firefox) it contains the revision + * number with first three parts concatenated with a padding zero + * (e.g. for revision 1.9.0.2 we have 10900).
        + *
        + * For webkit based browser (like Safari and Chrome) it contains the + * WebKit build version (e.g. 522). + * @name CKEDITOR.env.version + * @type Boolean + * @example + * if ( CKEDITOR.env.ie && CKEDITOR.env.version <= 6 ) + * alert( "Ouch!" ); + */ + env.version = version; + + /** + * Indicates that CKEditor is running on a compatible browser. + * @name CKEDITOR.env.isCompatible + * @type Boolean + * @example + * if ( CKEDITOR.env.isCompatible ) + * alert( "Your browser is pretty cool!" ); + */ + env.isCompatible = + !env.mobile && ( + ( env.ie && version >= 6 ) || + ( env.gecko && version >= 10801 ) || + ( env.opera && version >= 9.5 ) || + ( env.air && version >= 1 ) || + ( env.webkit && version >= 522 ) || + false ); + + /** + * The CSS class to be appended on the main UI containers, making it + * easy to apply browser specific styles to it. + * @name CKEDITOR.env.cssClass + * @type String + * @example + * myDiv.className = CKEDITOR.env.cssClass; + */ + env.cssClass = + 'cke_browser_' + ( + env.ie ? 'ie' : + env.gecko ? 'gecko' : + env.opera ? 'opera' : + env.webkit ? 'webkit' : + 'unknown' ); + + if ( env.quirks ) + env.cssClass += ' cke_browser_quirks'; + + if ( env.ie ) + { + env.cssClass += ' cke_browser_ie' + ( + env.version < 7 ? '6' : + env.version >= 8 ? document.documentMode: + '7' ); + + if ( env.quirks ) + env.cssClass += ' cke_browser_iequirks'; + } + + if ( env.gecko && version < 10900 ) + env.cssClass += ' cke_browser_gecko18'; + + if ( env.air ) + env.cssClass += ' cke_browser_air'; + + return env; + })(); +} + +// PACKAGER_RENAME( CKEDITOR.env ) +// PACKAGER_RENAME( CKEDITOR.env.ie ) diff --git a/library/custom_template/ckeditor/_source/core/event.js b/library/custom_template/ckeditor/_source/core/event.js new file mode 100644 index 000000000..ef7f00046 --- /dev/null +++ b/library/custom_template/ckeditor/_source/core/event.js @@ -0,0 +1,342 @@ +/* +Copyright (c) 2003-2011, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.html or http://ckeditor.com/license +*/ + +/** + * @fileOverview Defines the {@link CKEDITOR.event} class, which serves as the + * base for classes and objects that require event handling features. + */ + +if ( !CKEDITOR.event ) +{ + /** + * Creates an event class instance. This constructor is rearely used, being + * the {@link #.implementOn} function used in class prototypes directly + * instead. + * @class This is a base class for classes and objects that require event + * handling features.
        + *
        + * Do not confuse this class with {@link CKEDITOR.dom.event} which is + * instead used for DOM events. The CKEDITOR.event class implements the + * internal event system used by the CKEditor to fire API related events. + * @example + */ + CKEDITOR.event = function() + {}; + + /** + * Implements the {@link CKEDITOR.event} features in an object. + * @param {Object} targetObject The object into which implement the features. + * @example + * var myObject = { message : 'Example' }; + * CKEDITOR.event.implementOn( myObject }; + * myObject.on( 'testEvent', function() + * { + * alert( this.message ); // "Example" + * }); + * myObject.fire( 'testEvent' ); + */ + CKEDITOR.event.implementOn = function( targetObject ) + { + var eventProto = CKEDITOR.event.prototype; + + for ( var prop in eventProto ) + { + if ( targetObject[ prop ] == undefined ) + targetObject[ prop ] = eventProto[ prop ]; + } + }; + + CKEDITOR.event.prototype = (function() + { + // Returns the private events object for a given object. + var getPrivate = function( obj ) + { + var _ = ( obj.getPrivate && obj.getPrivate() ) || obj._ || ( obj._ = {} ); + return _.events || ( _.events = {} ); + }; + + var eventEntry = function( eventName ) + { + this.name = eventName; + this.listeners = []; + }; + + eventEntry.prototype = + { + // Get the listener index for a specified function. + // Returns -1 if not found. + getListenerIndex : function( listenerFunction ) + { + for ( var i = 0, listeners = this.listeners ; i < listeners.length ; i++ ) + { + if ( listeners[i].fn == listenerFunction ) + return i; + } + return -1; + } + }; + + return /** @lends CKEDITOR.event.prototype */ { + /** + * Registers a listener to a specific event in the current object. + * @param {String} eventName The event name to which listen. + * @param {Function} listenerFunction The function listening to the + * event. A single {@link CKEDITOR.eventInfo} object instanced + * is passed to this function containing all the event data. + * @param {Object} [scopeObj] The object used to scope the listener + * call (the this object. If omitted, the current object is used. + * @param {Object} [listenerData] Data to be sent as the + * {@link CKEDITOR.eventInfo#listenerData} when calling the + * listener. + * @param {Number} [priority] The listener priority. Lower priority + * listeners are called first. Listeners with the same priority + * value are called in registration order. Defaults to 10. + * @example + * someObject.on( 'someEvent', function() + * { + * alert( this == someObject ); // "true" + * }); + * @example + * someObject.on( 'someEvent', function() + * { + * alert( this == anotherObject ); // "true" + * } + * , anotherObject ); + * @example + * someObject.on( 'someEvent', function( event ) + * { + * alert( event.listenerData ); // "Example" + * } + * , null, 'Example' ); + * @example + * someObject.on( 'someEvent', function() { ... } ); // 2nd called + * someObject.on( 'someEvent', function() { ... }, null, null, 100 ); // 3rd called + * someObject.on( 'someEvent', function() { ... }, null, null, 1 ); // 1st called + */ + on : function( eventName, listenerFunction, scopeObj, listenerData, priority ) + { + // Get the event entry (create it if needed). + var events = getPrivate( this ), + event = events[ eventName ] || ( events[ eventName ] = new eventEntry( eventName ) ); + + if ( event.getListenerIndex( listenerFunction ) < 0 ) + { + // Get the listeners. + var listeners = event.listeners; + + // Fill the scope. + if ( !scopeObj ) + scopeObj = this; + + // Default the priority, if needed. + if ( isNaN( priority ) ) + priority = 10; + + var me = this; + + // Create the function to be fired for this listener. + var listenerFirer = function( editor, publisherData, stopFn, cancelFn ) + { + var ev = + { + name : eventName, + sender : this, + editor : editor, + data : publisherData, + listenerData : listenerData, + stop : stopFn, + cancel : cancelFn, + removeListener : function() + { + me.removeListener( eventName, listenerFunction ); + } + }; + + listenerFunction.call( scopeObj, ev ); + + return ev.data; + }; + listenerFirer.fn = listenerFunction; + listenerFirer.priority = priority; + + // Search for the right position for this new listener, based on its + // priority. + for ( var i = listeners.length - 1 ; i >= 0 ; i-- ) + { + // Find the item which should be before the new one. + if ( listeners[ i ].priority <= priority ) + { + // Insert the listener in the array. + listeners.splice( i + 1, 0, listenerFirer ); + return; + } + } + + // If no position has been found (or zero length), put it in + // the front of list. + listeners.unshift( listenerFirer ); + } + }, + + /** + * Fires an specific event in the object. All registered listeners are + * called at this point. + * @function + * @param {String} eventName The event name to fire. + * @param {Object} [data] Data to be sent as the + * {@link CKEDITOR.eventInfo#data} when calling the + * listeners. + * @param {CKEDITOR.editor} [editor] The editor instance to send as the + * {@link CKEDITOR.eventInfo#editor} when calling the + * listener. + * @returns {Boolean|Object} A booloan indicating that the event is to be + * canceled, or data returned by one of the listeners. + * @example + * someObject.on( 'someEvent', function() { ... } ); + * someObject.on( 'someEvent', function() { ... } ); + * someObject.fire( 'someEvent' ); // both listeners are called + * @example + * someObject.on( 'someEvent', function( event ) + * { + * alert( event.data ); // "Example" + * }); + * someObject.fire( 'someEvent', 'Example' ); + */ + fire : (function() + { + // Create the function that marks the event as stopped. + var stopped = false; + var stopEvent = function() + { + stopped = true; + }; + + // Create the function that marks the event as canceled. + var canceled = false; + var cancelEvent = function() + { + canceled = true; + }; + + return function( eventName, data, editor ) + { + // Get the event entry. + var event = getPrivate( this )[ eventName ]; + + // Save the previous stopped and cancelled states. We may + // be nesting fire() calls. + var previousStopped = stopped, + previousCancelled = canceled; + + // Reset the stopped and canceled flags. + stopped = canceled = false; + + if ( event ) + { + var listeners = event.listeners; + + if ( listeners.length ) + { + // As some listeners may remove themselves from the + // event, the original array length is dinamic. So, + // let's make a copy of all listeners, so we are + // sure we'll call all of them. + listeners = listeners.slice( 0 ); + + // Loop through all listeners. + for ( var i = 0 ; i < listeners.length ; i++ ) + { + // Call the listener, passing the event data. + var retData = listeners[i].call( this, editor, data, stopEvent, cancelEvent ); + + if ( typeof retData != 'undefined' ) + data = retData; + + // No further calls is stopped or canceled. + if ( stopped || canceled ) + break; + } + } + } + + var ret = canceled || ( typeof data == 'undefined' ? false : data ); + + // Restore the previous stopped and canceled states. + stopped = previousStopped; + canceled = previousCancelled; + + return ret; + }; + })(), + + /** + * Fires an specific event in the object, releasing all listeners + * registered to that event. The same listeners are not called again on + * successive calls of it or of {@link #fire}. + * @param {String} eventName The event name to fire. + * @param {Object} [data] Data to be sent as the + * {@link CKEDITOR.eventInfo#data} when calling the + * listeners. + * @param {CKEDITOR.editor} [editor] The editor instance to send as the + * {@link CKEDITOR.eventInfo#editor} when calling the + * listener. + * @returns {Boolean|Object} A booloan indicating that the event is to be + * canceled, or data returned by one of the listeners. + * @example + * someObject.on( 'someEvent', function() { ... } ); + * someObject.fire( 'someEvent' ); // above listener called + * someObject.fireOnce( 'someEvent' ); // above listener called + * someObject.fire( 'someEvent' ); // no listeners called + */ + fireOnce : function( eventName, data, editor ) + { + var ret = this.fire( eventName, data, editor ); + delete getPrivate( this )[ eventName ]; + return ret; + }, + + /** + * Unregisters a listener function from being called at the specified + * event. No errors are thrown if the listener has not been + * registered previously. + * @param {String} eventName The event name. + * @param {Function} listenerFunction The listener function to unregister. + * @example + * var myListener = function() { ... }; + * someObject.on( 'someEvent', myListener ); + * someObject.fire( 'someEvent' ); // myListener called + * someObject.removeListener( 'someEvent', myListener ); + * someObject.fire( 'someEvent' ); // myListener not called + */ + removeListener : function( eventName, listenerFunction ) + { + // Get the event entry. + var event = getPrivate( this )[ eventName ]; + + if ( event ) + { + var index = event.getListenerIndex( listenerFunction ); + if ( index >= 0 ) + event.listeners.splice( index, 1 ); + } + }, + + /** + * Checks if there is any listener registered to a given event. + * @param {String} eventName The event name. + * @example + * var myListener = function() { ... }; + * someObject.on( 'someEvent', myListener ); + * alert( someObject.hasListeners( 'someEvent' ) ); // "true" + * alert( someObject.hasListeners( 'noEvent' ) ); // "false" + */ + hasListeners : function( eventName ) + { + var event = getPrivate( this )[ eventName ]; + return ( event && event.listeners.length > 0 ) ; + } + }; + })(); +} diff --git a/library/custom_template/ckeditor/_source/core/eventInfo.js b/library/custom_template/ckeditor/_source/core/eventInfo.js new file mode 100644 index 000000000..d160ef006 --- /dev/null +++ b/library/custom_template/ckeditor/_source/core/eventInfo.js @@ -0,0 +1,120 @@ +/* +Copyright (c) 2003-2011, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.html or http://ckeditor.com/license +*/ + +/** + * @fileOverview Defines the "virtual" {@link CKEDITOR.eventInfo} class, which + * contains the defintions of the event object passed to event listeners. + * This file is for documentation purposes only. + */ + +/** + * (Virtual Class) Do not call this constructor. This class is not really part + * of the API. + * @class Virtual class that illustrates the features of the event object to be + * passed to event listeners by a {@link CKEDITOR.event} based object. + * @name CKEDITOR.eventInfo + * @example + * // Do not do this. + * var myEvent = new CKEDITOR.eventInfo(); // Error: CKEDITOR.eventInfo is undefined + */ + +/** + * The event name. + * @name CKEDITOR.eventInfo.prototype.name + * @field + * @type String + * @example + * someObject.on( 'someEvent', function( event ) + * { + * alert( event.name ); // "someEvent" + * }); + * someObject.fire( 'someEvent' ); + */ + +/** + * The object that publishes (sends) the event. + * @name CKEDITOR.eventInfo.prototype.sender + * @field + * @type Object + * @example + * someObject.on( 'someEvent', function( event ) + * { + * alert( event.sender == someObject ); // "true" + * }); + * someObject.fire( 'someEvent' ); + */ + +/** + * The editor instance that holds the sender. May be the same as sender. May be + * null if the sender is not part of an editor instance, like a component + * running in standalone mode. + * @name CKEDITOR.eventInfo.prototype.editor + * @field + * @type CKEDITOR.editor + * @example + * myButton.on( 'someEvent', function( event ) + * { + * alert( event.editor == myEditor ); // "true" + * }); + * myButton.fire( 'someEvent', null, myEditor ); + */ + +/** + * Any kind of additional data. Its format and usage is event dependent. + * @name CKEDITOR.eventInfo.prototype.data + * @field + * @type Object + * @example + * someObject.on( 'someEvent', function( event ) + * { + * alert( event.data ); // "Example" + * }); + * someObject.fire( 'someEvent', 'Example' ); + */ + +/** + * Any extra data appended during the listener registration. + * @name CKEDITOR.eventInfo.prototype.listenerData + * @field + * @type Object + * @example + * someObject.on( 'someEvent', function( event ) + * { + * alert( event.listenerData ); // "Example" + * } + * , null, 'Example' ); + */ + +/** + * Indicates that no further listeners are to be called. + * @name CKEDITOR.eventInfo.prototype.stop + * @function + * @example + * someObject.on( 'someEvent', function( event ) + * { + * event.stop(); + * }); + * someObject.on( 'someEvent', function( event ) + * { + * // This one will not be called. + * }); + * alert( someObject.fire( 'someEvent' ) ); // "false" + */ + +/** + * Indicates that the event is to be cancelled (if cancelable). + * @name CKEDITOR.eventInfo.prototype.cancel + * @function + * @example + * someObject.on( 'someEvent', function( event ) + * { + * event.cancel(); + * }); + * someObject.on( 'someEvent', function( event ) + * { + * // This one will not be called. + * }); + * alert( someObject.fire( 'someEvent' ) ); // "true" + */ diff --git a/library/custom_template/ckeditor/_source/core/focusmanager.js b/library/custom_template/ckeditor/_source/core/focusmanager.js new file mode 100644 index 000000000..582a3adb0 --- /dev/null +++ b/library/custom_template/ckeditor/_source/core/focusmanager.js @@ -0,0 +1,152 @@ +/* +Copyright (c) 2003-2011, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.html or http://ckeditor.com/license +*/ + +/** + * @fileOverview Defines the {@link CKEDITOR.focusManager} class, which is used + * to handle the focus on editor instances.. + */ + +/** + * Creates a focusManager class instance. + * @class Manages the focus activity in an editor instance. This class is to be + * used mainly by UI elements coders when adding interface elements that need + * to set the focus state of the editor. + * @param {CKEDITOR.editor} editor The editor instance. + * @example + * var focusManager = new CKEDITOR.focusManager( editor ); + * focusManager.focus(); + */ +CKEDITOR.focusManager = function( editor ) +{ + if ( editor.focusManager ) + return editor.focusManager; + + /** + * Indicates that the editor instance has focus. + * @type Boolean + * @example + * alert( CKEDITOR.instances.editor1.focusManager.hasFocus ); // e.g "true" + */ + this.hasFocus = false; + + /** + * Object used to hold private stuff. + * @private + */ + this._ = + { + editor : editor + }; + + return this; +}; + +CKEDITOR.focusManager.prototype = +{ + /** + * Used to indicate that the editor instance has the focus.
        + *
        + * Note that this function will not explicitelly set the focus in the + * editor (for example, making the caret blinking on it). Use + * {@link CKEDITOR.editor#focus} for it instead. + * @example + * var editor = CKEDITOR.instances.editor1; + * editor.focusManager.focus(); + */ + focus : function() + { + if ( this._.timer ) + clearTimeout( this._.timer ); + + if ( !this.hasFocus ) + { + // If another editor has the current focus, we first "blur" it. In + // this way the events happen in a more logical sequence, like: + // "focus 1" > "blur 1" > "focus 2" + // ... instead of: + // "focus 1" > "focus 2" > "blur 1" + if ( CKEDITOR.currentInstance ) + CKEDITOR.currentInstance.focusManager.forceBlur(); + + var editor = this._.editor; + + editor.container.getChild( 1 ).addClass( 'cke_focus' ); + + this.hasFocus = true; + editor.fire( 'focus' ); + } + }, + + /** + * Used to indicate that the editor instance has lost the focus.
        + *
        + * Note that this functions acts asynchronously with a delay of 100ms to + * avoid subsequent blur/focus effects. If you want the "blur" to happen + * immediately, use the {@link #forceBlur} function instead. + * @example + * var editor = CKEDITOR.instances.editor1; + * editor.focusManager.blur(); + */ + blur : function() + { + var focusManager = this; + + if ( focusManager._.timer ) + clearTimeout( focusManager._.timer ); + + focusManager._.timer = setTimeout( + function() + { + delete focusManager._.timer; + focusManager.forceBlur(); + } + , 100 ); + }, + + /** + * Used to indicate that the editor instance has lost the focus. Unlike + * {@link #blur}, this function is synchronous, marking the instance as + * "blured" immediately. + * @example + * var editor = CKEDITOR.instances.editor1; + * editor.focusManager.forceBlur(); + */ + forceBlur : function() + { + if ( this.hasFocus ) + { + var editor = this._.editor; + + editor.container.getChild( 1 ).removeClass( 'cke_focus' ); + + this.hasFocus = false; + editor.fire( 'blur' ); + } + } +}; + +/** + * Fired when the editor instance receives the input focus. + * @name CKEDITOR.editor#focus + * @event + * @param {CKEDITOR.editor} editor The editor instance. + * @example + * editor.on( 'focus', function( e ) + * { + * alert( 'The editor named ' + e.editor.name + ' is now focused' ); + * }); + */ + +/** + * Fired when the editor instance loses the input focus. + * @name CKEDITOR.editor#blur + * @event + * @param {CKEDITOR.editor} editor The editor instance. + * @example + * editor.on( 'blur', function( e ) + * { + * alert( 'The editor named ' + e.editor.name + ' lost the focus' ); + * }); + */ diff --git a/library/custom_template/ckeditor/_source/core/htmlparser.js b/library/custom_template/ckeditor/_source/core/htmlparser.js new file mode 100644 index 000000000..70de0a14d --- /dev/null +++ b/library/custom_template/ckeditor/_source/core/htmlparser.js @@ -0,0 +1,224 @@ +/* +Copyright (c) 2003-2011, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.html or http://ckeditor.com/license +*/ + +/** + * Creates a {@link CKEDITOR.htmlParser} class instance. + * @class Provides an "event like" system to parse strings of HTML data. + * @example + * var parser = new CKEDITOR.htmlParser(); + * parser.onTagOpen = function( tagName, attributes, selfClosing ) + * { + * alert( tagName ); + * }; + * parser.parse( '<p>Some <b>text</b>.</p>' ); + */ +CKEDITOR.htmlParser = function() +{ + this._ = + { + htmlPartsRegex : new RegExp( '<(?:(?:\\/([^>]+)>)|(?:!--([\\S|\\s]*?)-->)|(?:([^\\s>]+)\\s*((?:(?:[^"\'>]+)|(?:"[^"]*")|(?:\'[^\']*\'))*)\\/?>))', 'g' ) + }; +}; + +(function() +{ + var attribsRegex = /([\w\-:.]+)(?:(?:\s*=\s*(?:(?:"([^"]*)")|(?:'([^']*)')|([^\s>]+)))|(?=\s|$))/g, + emptyAttribs = {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}; + + CKEDITOR.htmlParser.prototype = + { + /** + * Function to be fired when a tag opener is found. This function + * should be overriden when using this class. + * @param {String} tagName The tag name. The name is guarantted to be + * lowercased. + * @param {Object} attributes An object containing all tag attributes. Each + * property in this object represent and attribute name and its + * value is the attribute value. + * @param {Boolean} selfClosing true if the tag closes itself, false if the + * tag doesn't. + * @example + * var parser = new CKEDITOR.htmlParser(); + * parser.onTagOpen = function( tagName, attributes, selfClosing ) + * { + * alert( tagName ); // e.g. "b" + * }); + * parser.parse( "<!-- Example --><b>Hello</b>" ); + */ + onTagOpen : function() {}, + + /** + * Function to be fired when a tag closer is found. This function + * should be overriden when using this class. + * @param {String} tagName The tag name. The name is guarantted to be + * lowercased. + * @example + * var parser = new CKEDITOR.htmlParser(); + * parser.onTagClose = function( tagName ) + * { + * alert( tagName ); // e.g. "b" + * }); + * parser.parse( "<!-- Example --><b>Hello</b>" ); + */ + onTagClose : function() {}, + + /** + * Function to be fired when text is found. This function + * should be overriden when using this class. + * @param {String} text The text found. + * @example + * var parser = new CKEDITOR.htmlParser(); + * parser.onText = function( text ) + * { + * alert( text ); // e.g. "Hello" + * }); + * parser.parse( "<!-- Example --><b>Hello</b>" ); + */ + onText : function() {}, + + /** + * Function to be fired when CDATA section is found. This function + * should be overriden when using this class. + * @param {String} cdata The CDATA been found. + * @example + * var parser = new CKEDITOR.htmlParser(); + * parser.onCDATA = function( cdata ) + * { + * alert( cdata ); // e.g. "var hello;" + * }); + * parser.parse( "<script>var hello;</script>" ); + */ + onCDATA : function() {}, + + /** + * Function to be fired when a commend is found. This function + * should be overriden when using this class. + * @param {String} comment The comment text. + * @example + * var parser = new CKEDITOR.htmlParser(); + * parser.onComment = function( comment ) + * { + * alert( comment ); // e.g. " Example " + * }); + * parser.parse( "<!-- Example --><b>Hello</b>" ); + */ + onComment : function() {}, + + /** + * Parses text, looking for HTML tokens, like tag openers or closers, + * or comments. This function fires the onTagOpen, onTagClose, onText + * and onComment function during its execution. + * @param {String} html The HTML to be parsed. + * @example + * var parser = new CKEDITOR.htmlParser(); + * // The onTagOpen, onTagClose, onText and onComment should be overriden + * // at this point. + * parser.parse( "<!-- Example --><b>Hello</b>" ); + */ + parse : function( html ) + { + var parts, + tagName, + nextIndex = 0, + cdata; // The collected data inside a CDATA section. + + while ( ( parts = this._.htmlPartsRegex.exec( html ) ) ) + { + var tagIndex = parts.index; + if ( tagIndex > nextIndex ) + { + var text = html.substring( nextIndex, tagIndex ); + + if ( cdata ) + cdata.push( text ); + else + this.onText( text ); + } + + nextIndex = this._.htmlPartsRegex.lastIndex; + + /* + "parts" is an array with the following items: + 0 : The entire match for opening/closing tags and comments. + 1 : Group filled with the tag name for closing tags. + 2 : Group filled with the comment text. + 3 : Group filled with the tag name for opening tags. + 4 : Group filled with the attributes part of opening tags. + */ + + // Closing tag + if ( ( tagName = parts[ 1 ] ) ) + { + tagName = tagName.toLowerCase(); + + if ( cdata && CKEDITOR.dtd.$cdata[ tagName ] ) + { + // Send the CDATA data. + this.onCDATA( cdata.join('') ); + cdata = null; + } + + if ( !cdata ) + { + this.onTagClose( tagName ); + continue; + } + } + + // If CDATA is enabled, just save the raw match. + if ( cdata ) + { + cdata.push( parts[ 0 ] ); + continue; + } + + // Opening tag + if ( ( tagName = parts[ 3 ] ) ) + { + tagName = tagName.toLowerCase(); + + // There are some tag names that can break things, so let's + // simply ignore them when parsing. (#5224) + if ( /="/.test( tagName ) ) + continue; + + var attribs = {}, + attribMatch, + attribsPart = parts[ 4 ], + selfClosing = !!( attribsPart && attribsPart.charAt( attribsPart.length - 1 ) == '/' ); + + if ( attribsPart ) + { + while ( ( attribMatch = attribsRegex.exec( attribsPart ) ) ) + { + var attName = attribMatch[1].toLowerCase(), + attValue = attribMatch[2] || attribMatch[3] || attribMatch[4] || ''; + + if ( !attValue && emptyAttribs[ attName ] ) + attribs[ attName ] = attName; + else + attribs[ attName ] = attValue; + } + } + + this.onTagOpen( tagName, attribs, selfClosing ); + + // Open CDATA mode when finding the appropriate tags. + if ( !cdata && CKEDITOR.dtd.$cdata[ tagName ] ) + cdata = []; + + continue; + } + + // Comment + if ( ( tagName = parts[ 2 ] ) ) + this.onComment( tagName ); + } + + if ( html.length > nextIndex ) + this.onText( html.substring( nextIndex, html.length ) ); + } + }; +})(); diff --git a/library/custom_template/ckeditor/_source/core/htmlparser/basicwriter.js b/library/custom_template/ckeditor/_source/core/htmlparser/basicwriter.js new file mode 100644 index 000000000..2d03a26ff --- /dev/null +++ b/library/custom_template/ckeditor/_source/core/htmlparser/basicwriter.js @@ -0,0 +1,145 @@ +/* +Copyright (c) 2003-2011, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.html or http://ckeditor.com/license +*/ + +CKEDITOR.htmlParser.basicWriter = CKEDITOR.tools.createClass( +{ + $ : function() + { + this._ = + { + output : [] + }; + }, + + proto : + { + /** + * Writes the tag opening part for a opener tag. + * @param {String} tagName The element name for this tag. + * @param {Object} attributes The attributes defined for this tag. The + * attributes could be used to inspect the tag. + * @example + * // Writes "<p". + * writer.openTag( 'p', { class : 'MyClass', id : 'MyId' } ); + */ + openTag : function( tagName, attributes ) + { + this._.output.push( '<', tagName ); + }, + + /** + * Writes the tag closing part for a opener tag. + * @param {String} tagName The element name for this tag. + * @param {Boolean} isSelfClose Indicates that this is a self-closing tag, + * like "br" or "img". + * @example + * // Writes ">". + * writer.openTagClose( 'p', false ); + * @example + * // Writes " />". + * writer.openTagClose( 'br', true ); + */ + openTagClose : function( tagName, isSelfClose ) + { + if ( isSelfClose ) + this._.output.push( ' />' ); + else + this._.output.push( '>' ); + }, + + /** + * Writes an attribute. This function should be called after opening the + * tag with {@link #openTagClose}. + * @param {String} attName The attribute name. + * @param {String} attValue The attribute value. + * @example + * // Writes ' class="MyClass"'. + * writer.attribute( 'class', 'MyClass' ); + */ + attribute : function( attName, attValue ) + { + // Browsers don't always escape special character in attribute values. (#4683, #4719). + if ( typeof attValue == 'string' ) + attValue = CKEDITOR.tools.htmlEncodeAttr( attValue ); + + this._.output.push( ' ', attName, '="', attValue, '"' ); + }, + + /** + * Writes a closer tag. + * @param {String} tagName The element name for this tag. + * @example + * // Writes "</p>". + * writer.closeTag( 'p' ); + */ + closeTag : function( tagName ) + { + this._.output.push( '' ); + }, + + /** + * Writes text. + * @param {String} text The text value + * @example + * // Writes "Hello Word". + * writer.text( 'Hello Word' ); + */ + text : function( text ) + { + this._.output.push( text ); + }, + + /** + * Writes a comment. + * @param {String} comment The comment text. + * @example + * // Writes "<!-- My comment -->". + * writer.comment( ' My comment ' ); + */ + comment : function( comment ) + { + this._.output.push( '' ); + }, + + /** + * Writes any kind of data to the ouput. + * @example + * writer.write( 'This is an <b>example</b>.' ); + */ + write : function( data ) + { + this._.output.push( data ); + }, + + /** + * Empties the current output buffer. + * @example + * writer.reset(); + */ + reset : function() + { + this._.output = []; + this._.indent = false; + }, + + /** + * Empties the current output buffer. + * @param {Boolean} reset Indicates that the {@link reset} function is to + * be automatically called after retrieving the HTML. + * @returns {String} The HTML written to the writer so far. + * @example + * var html = writer.getHtml(); + */ + getHtml : function( reset ) + { + var html = this._.output.join( '' ); + + if ( reset ) + this.reset(); + + return html; + } + } +}); diff --git a/library/custom_template/ckeditor/_source/core/htmlparser/cdata.js b/library/custom_template/ckeditor/_source/core/htmlparser/cdata.js new file mode 100644 index 000000000..c04a688a1 --- /dev/null +++ b/library/custom_template/ckeditor/_source/core/htmlparser/cdata.js @@ -0,0 +1,43 @@ +/* +Copyright (c) 2003-2011, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.html or http://ckeditor.com/license +*/ + +(function() +{ + + /** + * A lightweight representation of HTML text. + * @constructor + * @example + */ + CKEDITOR.htmlParser.cdata = function( value ) + { + /** + * The CDATA value. + * @type String + * @example + */ + this.value = value; + }; + + CKEDITOR.htmlParser.cdata.prototype = + { + /** + * CDATA has the same type as {@link CKEDITOR.htmlParser.text} This is + * a constant value set to {@link CKEDITOR.NODE_TEXT}. + * @type Number + * @example + */ + type : CKEDITOR.NODE_TEXT, + + /** + * Writes write the CDATA with no special manipulations. + * @param {CKEDITOR.htmlWriter} writer The writer to which write the HTML. + */ + writeHtml : function( writer ) + { + writer.write( this.value ); + } + }; +})(); diff --git a/library/custom_template/ckeditor/_source/core/htmlparser/comment.js b/library/custom_template/ckeditor/_source/core/htmlparser/comment.js new file mode 100644 index 000000000..e883f6683 --- /dev/null +++ b/library/custom_template/ckeditor/_source/core/htmlparser/comment.js @@ -0,0 +1,60 @@ +/* +Copyright (c) 2003-2011, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.html or http://ckeditor.com/license +*/ + +/** + * A lightweight representation of an HTML comment. + * @constructor + * @example + */ +CKEDITOR.htmlParser.comment = function( value ) +{ + /** + * The comment text. + * @type String + * @example + */ + this.value = value; + + /** @private */ + this._ = + { + isBlockLike : false + }; +}; + +CKEDITOR.htmlParser.comment.prototype = +{ + /** + * The node type. This is a constant value set to {@link CKEDITOR.NODE_COMMENT}. + * @type Number + * @example + */ + type : CKEDITOR.NODE_COMMENT, + + /** + * Writes the HTML representation of this comment to a CKEDITOR.htmlWriter. + * @param {CKEDITOR.htmlWriter} writer The writer to which write the HTML. + * @example + */ + writeHtml : function( writer, filter ) + { + var comment = this.value; + + if ( filter ) + { + if ( !( comment = filter.onComment( comment, this ) ) ) + return; + + if ( typeof comment != 'string' ) + { + comment.parent = this.parent; + comment.writeHtml( writer, filter ); + return; + } + } + + writer.comment( comment ); + } +}; diff --git a/library/custom_template/ckeditor/_source/core/htmlparser/element.js b/library/custom_template/ckeditor/_source/core/htmlparser/element.js new file mode 100644 index 000000000..ba2cdf7d2 --- /dev/null +++ b/library/custom_template/ckeditor/_source/core/htmlparser/element.js @@ -0,0 +1,249 @@ +/* +Copyright (c) 2003-2011, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.html or http://ckeditor.com/license +*/ + +/** + * A lightweight representation of an HTML element. + * @param {String} name The element name. + * @param {Object} attributes And object holding all attributes defined for + * this element. + * @constructor + * @example + */ +CKEDITOR.htmlParser.element = function( name, attributes ) +{ + /** + * The element name. + * @type String + * @example + */ + this.name = name; + + /** + * Holds the attributes defined for this element. + * @type Object + * @example + */ + this.attributes = attributes || ( attributes = {} ); + + /** + * The nodes that are direct children of this element. + * @type Array + * @example + */ + this.children = []; + + var tagName = attributes[ 'data-cke-real-element-type' ] || name; + + // Reveal the real semantic of our internal custom tag name (#6639). + var internalTag = tagName.match( /^cke:(.*)/ ); + internalTag && ( tagName = internalTag[ 1 ] ); + + var dtd = CKEDITOR.dtd, + isBlockLike = !!( dtd.$nonBodyContent[ tagName ] + || dtd.$block[ tagName ] + || dtd.$listItem[ tagName ] + || dtd.$tableContent[ tagName ] + || dtd.$nonEditable[ tagName ] + || tagName == 'br' ), + isEmpty = !!dtd.$empty[ name ]; + + this.isEmpty = isEmpty; + this.isUnknown = !dtd[ name ]; + + /** @private */ + this._ = + { + isBlockLike : isBlockLike, + hasInlineStarted : isEmpty || !isBlockLike + }; +}; + +(function() +{ + // Used to sort attribute entries in an array, where the first element of + // each object is the attribute name. + var sortAttribs = function( a, b ) + { + a = a[0]; + b = b[0]; + return a < b ? -1 : a > b ? 1 : 0; + }; + + CKEDITOR.htmlParser.element.prototype = + { + /** + * The node type. This is a constant value set to {@link CKEDITOR.NODE_ELEMENT}. + * @type Number + * @example + */ + type : CKEDITOR.NODE_ELEMENT, + + /** + * Adds a node to the element children list. + * @param {Object} node The node to be added. It can be any of of the + * following types: {@link CKEDITOR.htmlParser.element}, + * {@link CKEDITOR.htmlParser.text} and + * {@link CKEDITOR.htmlParser.comment}. + * @function + * @example + */ + add : CKEDITOR.htmlParser.fragment.prototype.add, + + /** + * Clone this element. + * @returns {CKEDITOR.htmlParser.element} The element clone. + * @example + */ + clone : function() + { + return new CKEDITOR.htmlParser.element( this.name, this.attributes ); + }, + + /** + * Writes the element HTML to a CKEDITOR.htmlWriter. + * @param {CKEDITOR.htmlWriter} writer The writer to which write the HTML. + * @example + */ + writeHtml : function( writer, filter ) + { + var attributes = this.attributes; + + // Ignore cke: prefixes when writing HTML. + var element = this, + writeName = element.name, + a, newAttrName, value; + + var isChildrenFiltered; + + /** + * Providing an option for bottom-up filtering order ( element + * children to be pre-filtered before the element itself ). + */ + element.filterChildren = function() + { + if ( !isChildrenFiltered ) + { + var writer = new CKEDITOR.htmlParser.basicWriter(); + CKEDITOR.htmlParser.fragment.prototype.writeChildrenHtml.call( element, writer, filter ); + element.children = new CKEDITOR.htmlParser.fragment.fromHtml( writer.getHtml() ).children; + isChildrenFiltered = 1; + } + }; + + if ( filter ) + { + while ( true ) + { + if ( !( writeName = filter.onElementName( writeName ) ) ) + return; + + element.name = writeName; + + if ( !( element = filter.onElement( element ) ) ) + return; + + element.parent = this.parent; + + if ( element.name == writeName ) + break; + + // If the element has been replaced with something of a + // different type, then make the replacement write itself. + if ( element.type != CKEDITOR.NODE_ELEMENT ) + { + element.writeHtml( writer, filter ); + return; + } + + writeName = element.name; + + // This indicate that the element has been dropped by + // filter but not the children. + if ( !writeName ) + { + this.writeChildrenHtml.call( element, writer, isChildrenFiltered ? null : filter ); + return; + } + } + + // The element may have been changed, so update the local + // references. + attributes = element.attributes; + } + + // Open element tag. + writer.openTag( writeName, attributes ); + + // Copy all attributes to an array. + var attribsArray = []; + // Iterate over the attributes twice since filters may alter + // other attributes. + for ( var i = 0 ; i < 2; i++ ) + { + for ( a in attributes ) + { + newAttrName = a; + value = attributes[ a ]; + if ( i == 1 ) + attribsArray.push( [ a, value ] ); + else if ( filter ) + { + while ( true ) + { + if ( !( newAttrName = filter.onAttributeName( a ) ) ) + { + delete attributes[ a ]; + break; + } + else if ( newAttrName != a ) + { + delete attributes[ a ]; + a = newAttrName; + continue; + } + else + break; + } + if ( newAttrName ) + { + if ( ( value = filter.onAttribute( element, newAttrName, value ) ) === false ) + delete attributes[ newAttrName ]; + else + attributes [ newAttrName ] = value; + } + } + } + } + // Sort the attributes by name. + if ( writer.sortAttributes ) + attribsArray.sort( sortAttribs ); + + // Send the attributes. + var len = attribsArray.length; + for ( i = 0 ; i < len ; i++ ) + { + var attrib = attribsArray[ i ]; + writer.attribute( attrib[0], attrib[1] ); + } + + // Close the tag. + writer.openTagClose( writeName, element.isEmpty ); + + if ( !element.isEmpty ) + { + this.writeChildrenHtml.call( element, writer, isChildrenFiltered ? null : filter ); + // Close the element. + writer.closeTag( writeName ); + } + }, + + writeChildrenHtml : function( writer, filter ) + { + // Send children. + CKEDITOR.htmlParser.fragment.prototype.writeChildrenHtml.apply( this, arguments ); + + } + }; +})(); diff --git a/library/custom_template/ckeditor/_source/core/htmlparser/filter.js b/library/custom_template/ckeditor/_source/core/htmlparser/filter.js new file mode 100644 index 000000000..3371edb9e --- /dev/null +++ b/library/custom_template/ckeditor/_source/core/htmlparser/filter.js @@ -0,0 +1,288 @@ +/* +Copyright (c) 2003-2011, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.html or http://ckeditor.com/license +*/ + +(function() +{ + CKEDITOR.htmlParser.filter = CKEDITOR.tools.createClass( + { + $ : function( rules ) + { + this._ = + { + elementNames : [], + attributeNames : [], + elements : { $length : 0 }, + attributes : { $length : 0 } + }; + + if ( rules ) + this.addRules( rules, 10 ); + }, + + proto : + { + addRules : function( rules, priority ) + { + if ( typeof priority != 'number' ) + priority = 10; + + // Add the elementNames. + addItemsToList( this._.elementNames, rules.elementNames, priority ); + + // Add the attributeNames. + addItemsToList( this._.attributeNames, rules.attributeNames, priority ); + + // Add the elements. + addNamedItems( this._.elements, rules.elements, priority ); + + // Add the attributes. + addNamedItems( this._.attributes, rules.attributes, priority ); + + // Add the text. + this._.text = transformNamedItem( this._.text, rules.text, priority ) || this._.text; + + // Add the comment. + this._.comment = transformNamedItem( this._.comment, rules.comment, priority ) || this._.comment; + + // Add root fragment. + this._.root = transformNamedItem( this._.root, rules.root, priority ) || this._.root; + }, + + onElementName : function( name ) + { + return filterName( name, this._.elementNames ); + }, + + onAttributeName : function( name ) + { + return filterName( name, this._.attributeNames ); + }, + + onText : function( text ) + { + var textFilter = this._.text; + return textFilter ? textFilter.filter( text ) : text; + }, + + onComment : function( commentText, comment ) + { + var textFilter = this._.comment; + return textFilter ? textFilter.filter( commentText, comment ) : commentText; + }, + + onFragment : function( element ) + { + var rootFilter = this._.root; + return rootFilter ? rootFilter.filter( element ) : element; + }, + + onElement : function( element ) + { + // We must apply filters set to the specific element name as + // well as those set to the generic $ name. So, add both to an + // array and process them in a small loop. + var filters = [ this._.elements[ '^' ], this._.elements[ element.name ], this._.elements.$ ], + filter, ret; + + for ( var i = 0 ; i < 3 ; i++ ) + { + filter = filters[ i ]; + if ( filter ) + { + ret = filter.filter( element, this ); + + if ( ret === false ) + return null; + + if ( ret && ret != element ) + return this.onNode( ret ); + + // The non-root element has been dismissed by one of the filters. + if ( element.parent && !element.name ) + break; + } + } + + return element; + }, + + onNode : function( node ) + { + var type = node.type; + + return type == CKEDITOR.NODE_ELEMENT ? this.onElement( node ) : + type == CKEDITOR.NODE_TEXT ? new CKEDITOR.htmlParser.text( this.onText( node.value ) ) : + type == CKEDITOR.NODE_COMMENT ? new CKEDITOR.htmlParser.comment( this.onComment( node.value ) ): + null; + }, + + onAttribute : function( element, name, value ) + { + var filter = this._.attributes[ name ]; + + if ( filter ) + { + var ret = filter.filter( value, element, this ); + + if ( ret === false ) + return false; + + if ( typeof ret != 'undefined' ) + return ret; + } + + return value; + } + } + }); + + function filterName( name, filters ) + { + for ( var i = 0 ; name && i < filters.length ; i++ ) + { + var filter = filters[ i ]; + name = name.replace( filter[ 0 ], filter[ 1 ] ); + } + return name; + } + + function addItemsToList( list, items, priority ) + { + if ( typeof items == 'function' ) + items = [ items ]; + + var i, j, + listLength = list.length, + itemsLength = items && items.length; + + if ( itemsLength ) + { + // Find the index to insert the items at. + for ( i = 0 ; i < listLength && list[ i ].pri < priority ; i++ ) + { /*jsl:pass*/ } + + // Add all new items to the list at the specific index. + for ( j = itemsLength - 1 ; j >= 0 ; j-- ) + { + var item = items[ j ]; + if ( item ) + { + item.pri = priority; + list.splice( i, 0, item ); + } + } + } + } + + function addNamedItems( hashTable, items, priority ) + { + if ( items ) + { + for ( var name in items ) + { + var current = hashTable[ name ]; + + hashTable[ name ] = + transformNamedItem( + current, + items[ name ], + priority ); + + if ( !current ) + hashTable.$length++; + } + } + } + + function transformNamedItem( current, item, priority ) + { + if ( item ) + { + item.pri = priority; + + if ( current ) + { + // If the current item is not an Array, transform it. + if ( !current.splice ) + { + if ( current.pri > priority ) + current = [ item, current ]; + else + current = [ current, item ]; + + current.filter = callItems; + } + else + addItemsToList( current, item, priority ); + + return current; + } + else + { + item.filter = item; + return item; + } + } + } + + // Invoke filters sequentially on the array, break the iteration + // when it doesn't make sense to continue anymore. + function callItems( currentEntry ) + { + var isNode = currentEntry.type + || currentEntry instanceof CKEDITOR.htmlParser.fragment; + + for ( var i = 0 ; i < this.length ; i++ ) + { + // Backup the node info before filtering. + if ( isNode ) + { + var orgType = currentEntry.type, + orgName = currentEntry.name; + } + + var item = this[ i ], + ret = item.apply( window, arguments ); + + if ( ret === false ) + return ret; + + // We're filtering node (element/fragment). + if ( isNode ) + { + // No further filtering if it's not anymore + // fitable for the subsequent filters. + if ( ret && ( ret.name != orgName + || ret.type != orgType ) ) + { + return ret; + } + } + // Filtering value (nodeName/textValue/attrValue). + else + { + // No further filtering if it's not + // any more values. + if ( typeof ret != 'string' ) + return ret; + } + + ret != undefined && ( currentEntry = ret ); + } + + return currentEntry; + } +})(); + +// "entities" plugin +/* +{ + text : function( text ) + { + // TODO : Process entities. + return text.toUpperCase(); + } +}; +*/ diff --git a/library/custom_template/ckeditor/_source/core/htmlparser/fragment.js b/library/custom_template/ckeditor/_source/core/htmlparser/fragment.js new file mode 100644 index 000000000..576b50b56 --- /dev/null +++ b/library/custom_template/ckeditor/_source/core/htmlparser/fragment.js @@ -0,0 +1,504 @@ +/* +Copyright (c) 2003-2011, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.html or http://ckeditor.com/license +*/ + +/** + * A lightweight representation of an HTML DOM structure. + * @constructor + * @example + */ +CKEDITOR.htmlParser.fragment = function() +{ + /** + * The nodes contained in the root of this fragment. + * @type Array + * @example + * var fragment = CKEDITOR.htmlParser.fragment.fromHtml( 'Sample Text' ); + * alert( fragment.children.length ); "2" + */ + this.children = []; + + /** + * Get the fragment parent. Should always be null. + * @type Object + * @default null + * @example + */ + this.parent = null; + + /** @private */ + this._ = + { + isBlockLike : true, + hasInlineStarted : false + }; +}; + +(function() +{ + // Elements which the end tag is marked as optional in the HTML 4.01 DTD + // (expect empty elements). + var optionalClose = {colgroup:1,dd:1,dt:1,li:1,option:1,p:1,td:1,tfoot:1,th:1,thead:1,tr:1}; + + // Block-level elements whose internal structure should be respected during + // parser fixing. + var nonBreakingBlocks = CKEDITOR.tools.extend( + {table:1,ul:1,ol:1,dl:1}, + CKEDITOR.dtd.table, CKEDITOR.dtd.ul, CKEDITOR.dtd.ol, CKEDITOR.dtd.dl ), + listBlocks = CKEDITOR.dtd.$list, listItems = CKEDITOR.dtd.$listItem; + + /** + * Creates a {@link CKEDITOR.htmlParser.fragment} from an HTML string. + * @param {String} fragmentHtml The HTML to be parsed, filling the fragment. + * @param {Number} [fixForBody=false] Wrap body with specified element if needed. + * @returns CKEDITOR.htmlParser.fragment The fragment created. + * @example + * var fragment = CKEDITOR.htmlParser.fragment.fromHtml( 'Sample Text' ); + * alert( fragment.children[0].name ); "b" + * alert( fragment.children[1].value ); " Text" + */ + CKEDITOR.htmlParser.fragment.fromHtml = function( fragmentHtml, fixForBody ) + { + var parser = new CKEDITOR.htmlParser(), + html = [], + fragment = new CKEDITOR.htmlParser.fragment(), + pendingInline = [], + pendingBRs = [], + currentNode = fragment, + // Indicate we're inside a
         element, spaces should be touched differently.
        +			inPre = false,
        +			returnPoint;
        +
        +		function checkPending( newTagName )
        +		{
        +			var pendingBRsSent;
        +
        +			if ( pendingInline.length > 0 )
        +			{
        +				for ( var i = 0 ; i < pendingInline.length ; i++ )
        +				{
        +					var pendingElement = pendingInline[ i ],
        +						pendingName = pendingElement.name,
        +						pendingDtd = CKEDITOR.dtd[ pendingName ],
        +						currentDtd = currentNode.name && CKEDITOR.dtd[ currentNode.name ];
        +
        +					if ( ( !currentDtd || currentDtd[ pendingName ] ) && ( !newTagName || !pendingDtd || pendingDtd[ newTagName ] || !CKEDITOR.dtd[ newTagName ] ) )
        +					{
        +						if ( !pendingBRsSent )
        +						{
        +							sendPendingBRs();
        +							pendingBRsSent = 1;
        +						}
        +
        +						// Get a clone for the pending element.
        +						pendingElement = pendingElement.clone();
        +
        +						// Add it to the current node and make it the current,
        +						// so the new element will be added inside of it.
        +						pendingElement.parent = currentNode;
        +						currentNode = pendingElement;
        +
        +						// Remove the pending element (back the index by one
        +						// to properly process the next entry).
        +						pendingInline.splice( i, 1 );
        +						i--;
        +					}
        +				}
        +			}
        +		}
        +
        +		function sendPendingBRs( brsToIgnore )
        +		{
        +			while ( pendingBRs.length - ( brsToIgnore || 0 ) > 0 )
        +				currentNode.add( pendingBRs.shift() );
        +		}
        +
        +		function addElement( element, target, enforceCurrent )
        +		{
        +			target = target || currentNode || fragment;
        +
        +			// If the target is the fragment and this inline element can't go inside
        +			// body (if fixForBody).
        +			if ( fixForBody && !target.type )
        +			{
        +				var elementName, realElementName;
        +				if ( element.attributes
        +					 && ( realElementName =
        +						  element.attributes[ 'data-cke-real-element-type' ] ) )
        +					elementName = realElementName;
        +				else
        +					elementName =  element.name;
        +
        +				if ( elementName && elementName in CKEDITOR.dtd.$inline )
        +				{
        +					var savedCurrent = currentNode;
        +
        +					// Create a 

        in the fragment. + currentNode = target; + parser.onTagOpen( fixForBody, {} ); + + // The new target now is the

        . + target = currentNode; + + if ( enforceCurrent ) + currentNode = savedCurrent; + } + } + + // Rtrim empty spaces on block end boundary. (#3585) + if ( element._.isBlockLike + && element.name != 'pre' ) + { + + var length = element.children.length, + lastChild = element.children[ length - 1 ], + text; + if ( lastChild && lastChild.type == CKEDITOR.NODE_TEXT ) + { + if ( !( text = CKEDITOR.tools.rtrim( lastChild.value ) ) ) + element.children.length = length -1; + else + lastChild.value = text; + } + } + + target.add( element ); + + if ( element.returnPoint ) + { + currentNode = element.returnPoint; + delete element.returnPoint; + } + } + + parser.onTagOpen = function( tagName, attributes, selfClosing ) + { + var element = new CKEDITOR.htmlParser.element( tagName, attributes ); + + // "isEmpty" will be always "false" for unknown elements, so we + // must force it if the parser has identified it as a selfClosing tag. + if ( element.isUnknown && selfClosing ) + element.isEmpty = true; + + // This is a tag to be removed if empty, so do not add it immediately. + if ( CKEDITOR.dtd.$removeEmpty[ tagName ] ) + { + pendingInline.push( element ); + return; + } + else if ( tagName == 'pre' ) + inPre = true; + else if ( tagName == 'br' && inPre ) + { + currentNode.add( new CKEDITOR.htmlParser.text( '\n' ) ); + return; + } + + if ( tagName == 'br' ) + { + pendingBRs.push( element ); + return; + } + + var currentName = currentNode.name; + + var currentDtd = currentName + && ( CKEDITOR.dtd[ currentName ] + || ( currentNode._.isBlockLike ? CKEDITOR.dtd.div : CKEDITOR.dtd.span ) ); + + // If the element cannot be child of the current element. + if ( currentDtd // Fragment could receive any elements. + && !element.isUnknown && !currentNode.isUnknown && !currentDtd[ tagName ] ) + { + + var reApply = false, + addPoint; // New position to start adding nodes. + + // Fixing malformed nested lists by moving it into a previous list item. (#3828) + if ( tagName in listBlocks + && currentName in listBlocks ) + { + var children = currentNode.children, + lastChild = children[ children.length - 1 ]; + + // Establish the list item if it's not existed. + if ( !( lastChild && lastChild.name in listItems ) ) + addElement( ( lastChild = new CKEDITOR.htmlParser.element( 'li' ) ), currentNode ); + + returnPoint = currentNode, addPoint = lastChild; + } + // If the element name is the same as the current element name, + // then just close the current one and append the new one to the + // parent. This situation usually happens with

        ,

      1. ,
        and + //
        , specially in IE. Do not enter in this if block in this case. + else if ( tagName == currentName ) + { + addElement( currentNode, currentNode.parent ); + } + else if ( tagName in CKEDITOR.dtd.$listItem ) + { + parser.onTagOpen( 'ul', {} ); + addPoint = currentNode; + reApply = true; + } + else + { + if ( nonBreakingBlocks[ currentName ] ) + { + if ( !returnPoint ) + returnPoint = currentNode; + } + else + { + addElement( currentNode, currentNode.parent, true ); + + if ( !optionalClose[ currentName ] ) + { + // The current element is an inline element, which + // cannot hold the new one. Put it in the pending list, + // and try adding the new one after it. + pendingInline.unshift( currentNode ); + } + } + + reApply = true; + } + + if ( addPoint ) + currentNode = addPoint; + // Try adding it to the return point, or the parent element. + else + currentNode = currentNode.returnPoint || currentNode.parent; + + if ( reApply ) + { + parser.onTagOpen.apply( this, arguments ); + return; + } + } + + checkPending( tagName ); + sendPendingBRs(); + + element.parent = currentNode; + element.returnPoint = returnPoint; + returnPoint = 0; + + if ( element.isEmpty ) + addElement( element ); + else + currentNode = element; + }; + + parser.onTagClose = function( tagName ) + { + // Check if there is any pending tag to be closed. + for ( var i = pendingInline.length - 1 ; i >= 0 ; i-- ) + { + // If found, just remove it from the list. + if ( tagName == pendingInline[ i ].name ) + { + pendingInline.splice( i, 1 ); + return; + } + } + + var pendingAdd = [], + newPendingInline = [], + candidate = currentNode; + + while ( candidate.type && candidate.name != tagName ) + { + // If this is an inline element, add it to the pending list, if we're + // really closing one of the parents element later, they will continue + // after it. + if ( !candidate._.isBlockLike ) + newPendingInline.unshift( candidate ); + + // This node should be added to it's parent at this point. But, + // it should happen only if the closing tag is really closing + // one of the nodes. So, for now, we just cache it. + pendingAdd.push( candidate ); + + candidate = candidate.parent; + } + + if ( candidate.type ) + { + // Add all elements that have been found in the above loop. + for ( i = 0 ; i < pendingAdd.length ; i++ ) + { + var node = pendingAdd[ i ]; + addElement( node, node.parent ); + } + + currentNode = candidate; + + if ( currentNode.name == 'pre' ) + inPre = false; + + if ( candidate._.isBlockLike ) + sendPendingBRs(); + + addElement( candidate, candidate.parent ); + + // The parent should start receiving new nodes now, except if + // addElement changed the currentNode. + if ( candidate == currentNode ) + currentNode = currentNode.parent; + + pendingInline = pendingInline.concat( newPendingInline ); + } + + if ( tagName == 'body' ) + fixForBody = false; + }; + + parser.onText = function( text ) + { + // Trim empty spaces at beginning of element contents except
        .
        +			if ( !currentNode._.hasInlineStarted && !inPre )
        +			{
        +				text = CKEDITOR.tools.ltrim( text );
        +
        +				if ( text.length === 0 )
        +					return;
        +			}
        +
        +			sendPendingBRs();
        +			checkPending();
        +
        +			if ( fixForBody
        +				 && ( !currentNode.type || currentNode.name == 'body' )
        +				 && CKEDITOR.tools.trim( text ) )
        +			{
        +				this.onTagOpen( fixForBody, {} );
        +			}
        +
        +			// Shrinking consequential spaces into one single for all elements
        +			// text contents.
        +			if ( !inPre )
        +				text = text.replace( /[\t\r\n ]{2,}|[\t\r\n]/g, ' ' );
        +
        +			currentNode.add( new CKEDITOR.htmlParser.text( text ) );
        +		};
        +
        +		parser.onCDATA = function( cdata )
        +		{
        +			currentNode.add( new CKEDITOR.htmlParser.cdata( cdata ) );
        +		};
        +
        +		parser.onComment = function( comment )
        +		{
        +			sendPendingBRs();
        +			checkPending();
        +			currentNode.add( new CKEDITOR.htmlParser.comment( comment ) );
        +		};
        +
        +		// Parse it.
        +		parser.parse( fragmentHtml );
        +
        +		// Send all pending BRs except one, which we consider a unwanted bogus. (#5293)
        +		sendPendingBRs( !CKEDITOR.env.ie && 1 );
        +
        +		// Close all pending nodes.
        +		while ( currentNode.type )
        +		{
        +			var parent = currentNode.parent,
        +				node = currentNode;
        +
        +			if ( fixForBody
        +				 && ( !parent.type || parent.name == 'body' )
        +				 && !CKEDITOR.dtd.$body[ node.name ] )
        +			{
        +				currentNode = parent;
        +				parser.onTagOpen( fixForBody, {} );
        +				parent = currentNode;
        +			}
        +
        +			parent.add( node );
        +			currentNode = parent;
        +		}
        +
        +		return fragment;
        +	};
        +
        +	CKEDITOR.htmlParser.fragment.prototype =
        +	{
        +		/**
        +		 * Adds a node to this fragment.
        +		 * @param {Object} node The node to be added. It can be any of of the
        +		 *		following types: {@link CKEDITOR.htmlParser.element},
        +		 *		{@link CKEDITOR.htmlParser.text} and
        +		 *		{@link CKEDITOR.htmlParser.comment}.
        +		 * @example
        +		 */
        +		add : function( node )
        +		{
        +			var len = this.children.length,
        +				previous = len > 0 && this.children[ len - 1 ] || null;
        +
        +			if ( previous )
        +			{
        +				// If the block to be appended is following text, trim spaces at
        +				// the right of it.
        +				if ( node._.isBlockLike && previous.type == CKEDITOR.NODE_TEXT )
        +				{
        +					previous.value = CKEDITOR.tools.rtrim( previous.value );
        +
        +					// If we have completely cleared the previous node.
        +					if ( previous.value.length === 0 )
        +					{
        +						// Remove it from the list and add the node again.
        +						this.children.pop();
        +						this.add( node );
        +						return;
        +					}
        +				}
        +
        +				previous.next = node;
        +			}
        +
        +			node.previous = previous;
        +			node.parent = this;
        +
        +			this.children.push( node );
        +
        +			this._.hasInlineStarted = node.type == CKEDITOR.NODE_TEXT || ( node.type == CKEDITOR.NODE_ELEMENT && !node._.isBlockLike );
        +		},
        +
        +		/**
        +		 * Writes the fragment HTML to a CKEDITOR.htmlWriter.
        +		 * @param {CKEDITOR.htmlWriter} writer The writer to which write the HTML.
        +		 * @example
        +		 * var writer = new CKEDITOR.htmlWriter();
        +		 * var fragment = CKEDITOR.htmlParser.fragment.fromHtml( '<P><B>Example' );
        +		 * fragment.writeHtml( writer )
        +		 * alert( writer.getHtml() );  "<p><b>Example</b></p>"
        +		 */
        +		writeHtml : function( writer, filter )
        +		{
        +			var isChildrenFiltered;
        +			this.filterChildren = function()
        +			{
        +				var writer = new CKEDITOR.htmlParser.basicWriter();
        +				this.writeChildrenHtml.call( this, writer, filter, true );
        +				var html = writer.getHtml();
        +				this.children = new CKEDITOR.htmlParser.fragment.fromHtml( html ).children;
        +				isChildrenFiltered = 1;
        +			};
        +
        +			// Filtering the root fragment before anything else.
        +			!this.name && filter && filter.onFragment( this );
        +
        +			this.writeChildrenHtml( writer, isChildrenFiltered ? null : filter );
        +		},
        +
        +		writeChildrenHtml : function( writer, filter )
        +		{
        +			for ( var i = 0 ; i < this.children.length ; i++ )
        +				this.children[i].writeHtml( writer, filter );
        +		}
        +	};
        +})();
        diff --git a/library/custom_template/ckeditor/_source/core/htmlparser/text.js b/library/custom_template/ckeditor/_source/core/htmlparser/text.js
        new file mode 100644
        index 000000000..59203d7ce
        --- /dev/null
        +++ b/library/custom_template/ckeditor/_source/core/htmlparser/text.js
        @@ -0,0 +1,55 @@
        +/*
        +Copyright (c) 2003-2011, CKSource - Frederico Knabben. All rights reserved.
        +For licensing, see LICENSE.html or http://ckeditor.com/license
        +*/
        +
        +(function()
        +{
        +	var spacesRegex = /[\t\r\n ]{2,}|[\t\r\n]/g;
        +
        +	/**
        +	 * A lightweight representation of HTML text.
        +	 * @constructor
        +	 * @example
        +	 */
        + 	CKEDITOR.htmlParser.text = function( value )
        +	{
        +		/**
        +		 * The text value.
        +		 * @type String
        +		 * @example
        +		 */
        +		this.value = value;
        +
        +		/** @private */
        +		this._ =
        +		{
        +			isBlockLike : false
        +		};
        +	};
        +
        +	CKEDITOR.htmlParser.text.prototype =
        +	{
        +		/**
        +		 * The node type. This is a constant value set to {@link CKEDITOR.NODE_TEXT}.
        +		 * @type Number
        +		 * @example
        +		 */
        +		type : CKEDITOR.NODE_TEXT,
        +
        +		/**
        +		 * Writes the HTML representation of this text to a CKEDITOR.htmlWriter.
        +		 * @param {CKEDITOR.htmlWriter} writer The writer to which write the HTML.
        +		 * @example
        +		 */
        +		writeHtml : function( writer, filter )
        +		{
        +			var text = this.value;
        +
        +			if ( filter && !( text = filter.onText( text, this ) ) )
        +				return;
        +
        +			writer.text( text );
        +		}
        +	};
        +})();
        diff --git a/library/custom_template/ckeditor/_source/core/lang.js b/library/custom_template/ckeditor/_source/core/lang.js
        new file mode 100644
        index 000000000..cca375a05
        --- /dev/null
        +++ b/library/custom_template/ckeditor/_source/core/lang.js
        @@ -0,0 +1,156 @@
        +/*
        +Copyright (c) 2003-2011, CKSource - Frederico Knabben. All rights reserved.
        +For licensing, see LICENSE.html or http://ckeditor.com/license
        +*/
        +
        +(function()
        +{
        +	var loadedLangs = {};
        +
        +	/**
        +	 * @namespace Holds language related functions.
        +	 */
        +	CKEDITOR.lang =
        +	{
        +		/**
        +		 * The list of languages available in the editor core.
        +		 * @type Object
        +		 * @example
        +		 * alert( CKEDITOR.lang.en );  // "true"
        +		 */
        +		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
        +		},
        +
        +		/**
        +		 * Loads a specific language file, or auto detect it. A callback is
        +		 * then called when the file gets loaded.
        +		 * @param {String} languageCode The code of the language file to be
        +		 *		loaded. If null or empty, autodetection will be performed. The
        +		 *		same happens if the language is not supported.
        +		 * @param {String} defaultLanguage The language to be used if
        +		 *		languageCode is not supported or if the autodetection fails.
        +		 * @param {Function} callback A function to be called once the
        +		 *		language file is loaded. Two parameters are passed to this
        +		 *		function: the language code and the loaded language entries.
        +		 * @example
        +		 */
        +		load : function( languageCode, defaultLanguage, callback )
        +		{
        +			// If no languageCode - fallback to browser or default.
        +			// If languageCode - fallback to no-localized version or default.
        +			if ( !languageCode || !CKEDITOR.lang.languages[ languageCode ] )
        +				languageCode = this.detect( defaultLanguage, languageCode );
        +
        +			if ( !this[ languageCode ] )
        +			{
        +				CKEDITOR.scriptLoader.load( CKEDITOR.getUrl(
        +					'_source/' +	// @Packager.RemoveLine
        +					'lang/' + languageCode + '.js' ),
        +					function()
        +						{
        +							callback( languageCode, this[ languageCode ] );
        +						}
        +						, this );
        +			}
        +			else
        +				callback( languageCode, this[ languageCode ] );
        +		},
        +
        +		/**
        +		 * Returns the language that best fit the user language. For example,
        +		 * suppose that the user language is "pt-br". If this language is
        +		 * supported by the editor, it is returned. Otherwise, if only "pt" is
        +		 * supported, it is returned instead. If none of the previous are
        +		 * supported, a default language is then returned.
        +		 * @param {String} defaultLanguage The default language to be returned
        +		 *		if the user language is not supported.
        +		 * @param {String} [probeLanguage] A language code to try to use,
        +		 *		instead of the browser based autodetection.
        +		 * @returns {String} The detected language code.
        +		 * @example
        +		 * alert( CKEDITOR.lang.detect( 'en' ) );  // e.g., in a German browser: "de"
        +		 */
        +		detect : function( defaultLanguage, probeLanguage )
        +		{
        +			var languages = this.languages;
        +			probeLanguage = probeLanguage || navigator.userLanguage || navigator.language;
        +
        +			var parts = probeLanguage
        +					.toLowerCase()
        +					.match( /([a-z]+)(?:-([a-z]+))?/ ),
        +				lang = parts[1],
        +				locale = parts[2];
        +
        +			if ( languages[ lang + '-' + locale ] )
        +				lang = lang + '-' + locale;
        +			else if ( !languages[ lang ] )
        +				lang = null;
        +
        +			CKEDITOR.lang.detect = lang ?
        +				function() { return lang; } :
        +				function( defaultLanguage ) { return defaultLanguage; };
        +
        +			return lang || defaultLanguage;
        +		}
        +	};
        +
        +})();
        diff --git a/library/custom_template/ckeditor/_source/core/loader.js b/library/custom_template/ckeditor/_source/core/loader.js
        new file mode 100644
        index 000000000..9bbb467b9
        --- /dev/null
        +++ b/library/custom_template/ckeditor/_source/core/loader.js
        @@ -0,0 +1,242 @@
        +/*
        +Copyright (c) 2003-2011, CKSource - Frederico Knabben. All rights reserved.
        +For licensing, see LICENSE.html or http://ckeditor.com/license
        +*/
        +
        +/**
        + * @fileOverview Defines the {@link CKEDITOR.loader} objects, which is used to
        + *		load core scripts and their dependencies from _source.
        + */
        +
        +if ( typeof CKEDITOR == 'undefined' )
        +	CKEDITOR = {};
        +
        +if ( !CKEDITOR.loader )
        +{
        +	/**
        +	 * Load core scripts and their dependencies from _source.
        +	 * @namespace
        +	 * @example
        +	 */
        +	CKEDITOR.loader = (function()
        +	{
        +		// Table of script names and their dependencies.
        +		var scripts =
        +		{
        +			'core/_bootstrap'		: [ 'core/config', 'core/ckeditor', 'core/plugins', 'core/scriptloader', 'core/tools', /* The following are entries that we want to force loading at the end to avoid dependence recursion */ 'core/dom/comment', 'core/dom/elementpath', 'core/dom/text', 'core/dom/rangelist' ],
        +			'core/ajax'				: [ 'core/xml' ],
        +			'core/ckeditor'			: [ 'core/ckeditor_basic', 'core/dom', 'core/dtd', 'core/dom/document', 'core/dom/element', 'core/editor', 'core/event', 'core/htmlparser', 'core/htmlparser/element', 'core/htmlparser/fragment', 'core/htmlparser/filter', 'core/htmlparser/basicwriter', 'core/tools' ],
        +			'core/ckeditor_base'	: [],
        +			'core/ckeditor_basic'	: [ 'core/editor_basic', 'core/env', 'core/event' ],
        +			'core/command'			: [],
        +			'core/config'			: [ 'core/ckeditor_base' ],
        +			'core/dom'				: [],
        +			'core/dom/comment'		: [ 'core/dom/node' ],
        +			'core/dom/document'		: [ 'core/dom', 'core/dom/domobject', 'core/dom/window' ],
        +			'core/dom/documentfragment'	: [ 'core/dom/element' ],
        +			'core/dom/element'		: [ 'core/dom', 'core/dom/document', 'core/dom/domobject', 'core/dom/node', 'core/dom/nodelist', 'core/tools' ],
        +			'core/dom/elementpath'	: [ 'core/dom/element' ],
        +			'core/dom/event'		: [],
        +			'core/dom/node'			: [ 'core/dom/domobject', 'core/tools' ],
        +			'core/dom/nodelist'		: [ 'core/dom/node' ],
        +			'core/dom/domobject'	: [ 'core/dom/event' ],
        +			'core/dom/range'		: [ 'core/dom/document', 'core/dom/documentfragment', 'core/dom/element', 'core/dom/walker' ],
        +			'core/dom/rangelist'    : [ 'core/dom/range' ],
        +			'core/dom/text'			: [ 'core/dom/node', 'core/dom/domobject' ],
        +			'core/dom/walker'		: [ 'core/dom/node' ],
        +			'core/dom/window'		: [ 'core/dom/domobject' ],
        +			'core/dtd'				: [ 'core/tools' ],
        +			'core/editor'			: [ 'core/command', 'core/config', 'core/editor_basic', 'core/focusmanager', 'core/lang', 'core/plugins', 'core/skins', 'core/themes', 'core/tools', 'core/ui' ],
        +			'core/editor_basic'		: [ 'core/event' ],
        +			'core/env'				: [],
        +			'core/event'			: [],
        +			'core/focusmanager'		: [],
        +			'core/htmlparser'		: [],
        +			'core/htmlparser/comment'	: [ 'core/htmlparser' ],
        +			'core/htmlparser/element'	: [ 'core/htmlparser', 'core/htmlparser/fragment' ],
        +			'core/htmlparser/fragment'	: [ 'core/htmlparser', 'core/htmlparser/comment', 'core/htmlparser/text', 'core/htmlparser/cdata' ],
        +			'core/htmlparser/text'		: [ 'core/htmlparser' ],
        +			'core/htmlparser/cdata'		: [ 'core/htmlparser' ],
        +			'core/htmlparser/filter'	: [ 'core/htmlparser' ],
        +			'core/htmlparser/basicwriter': [ 'core/htmlparser' ],
        +			'core/lang'				: [],
        +			'core/plugins'			: [ 'core/resourcemanager' ],
        +			'core/resourcemanager'	: [ 'core/scriptloader', 'core/tools' ],
        +			'core/scriptloader'		: [ 'core/dom/element', 'core/env' ],
        +			'core/skins'			: [ 'core/scriptloader' ],
        +			'core/themes'			: [ 'core/resourcemanager' ],
        +			'core/tools'			: [ 'core/env' ],
        +			'core/ui'				: [],
        +			'core/xml'				: [ 'core/env' ]
        +		};
        +
        +		var basePath = (function()
        +		{
        +			// This is a copy of CKEDITOR.basePath, but requires the script having
        +			// "_source/core/loader.js".
        +			if ( CKEDITOR && CKEDITOR.basePath )
        +				return CKEDITOR.basePath;
        +
        +			// Find out the editor directory path, based on its ' +
        +				'';
        +
        +			var src =
        +				CKEDITOR.env.air ?
        +					'javascript:void(0)' :
        +				isCustomDomain ?
        +					'javascript:void((function(){' +
        +						'document.open();' +
        +						'document.domain=\'' + document.domain + '\';' +
        +						'document.close();' +
        +						'})())"'
        +				:
        +					'';
        +
        +			var iframe = CKEDITOR.dom.element.createFromHtml(
        +						'' );
        +
        +			iframe.on( 'load', function( e )
        +				{
        +					e.removeListener();
        +
        +					var doc = iframe.getFrameDocument();
        +					doc.write( htmlToLoad );
        +
        +					if ( CKEDITOR.env.air )
        +						onPasteFrameLoad.call( this, doc.getWindow().$ );
        +				},
        +				this );
        +
        +			iframe.setCustomData( 'dialog', this );
        +
        +			var field = this.getContentElement( 'general', 'editing_area' ),
        +				container = field.getElement();
        +			container.setHtml( '' );
        +			container.append( iframe );
        +
        +			// IE need a redirect on focus to make
        +			// the cursor blinking inside iframe. (#5461)
        +			if ( CKEDITOR.env.ie )
        +			{
        +				var focusGrabber = CKEDITOR.dom.element.createFromHtml( '' );
        +				focusGrabber.on( 'focus', function()
        +				{
        +					iframe.$.contentWindow.focus();
        +				});
        +				container.append( focusGrabber );
        +
        +				// Override focus handler on field.
        +				field.focus = function()
        +				{
        +					focusGrabber.focus();
        +					this.fire( 'focus' );
        +				};
        +			}
        +
        +			field.getInputElement = function(){ return iframe; };
        +
        +			// Force container to scale in IE.
        +			if ( CKEDITOR.env.ie )
        +			{
        +				container.setStyle( 'display', 'block' );
        +				container.setStyle( 'height', ( iframe.$.offsetHeight + 2 ) + 'px' );
        +			}
        +		},
        +
        +		onHide : function()
        +		{
        +			if ( CKEDITOR.env.ie )
        +				this.getParentEditor().document.getBody().$.contentEditable = 'true';
        +		},
        +
        +		onLoad : function()
        +		{
        +			if ( ( CKEDITOR.env.ie7Compat || CKEDITOR.env.ie6Compat ) && editor.lang.dir == 'rtl' )
        +				this.parts.contents.setStyle( 'overflow', 'hidden' );
        +		},
        +
        +		onOk : function()
        +		{
        +			var container = this.getContentElement( 'general', 'editing_area' ).getElement(),
        +				iframe = container.getElementsByTag( 'iframe' ).getItem( 0 ),
        +				editor = this.getParentEditor(),
        +				html = iframe.$.contentWindow.document.body.innerHTML;
        +
        +			setTimeout( function(){
        +				editor.fire( 'paste', { 'html' : html } );
        +			}, 0 );
        +
        +		},
        +
        +		contents : [
        +			{
        +				id : 'general',
        +				label : editor.lang.common.generalTab,
        +				elements : [
        +					{
        +						type : 'html',
        +						id : 'securityMsg',
        +						html : '
        ' + lang.securityMsg + '
        ' + }, + { + type : 'html', + id : 'pasteMsg', + html : '
        '+lang.pasteMsg +'
        ' + }, + { + type : 'html', + id : 'editing_area', + style : 'width: 100%; height: 100%;', + html : '', + focus : function() + { + var win = this.getInputElement().$.contentWindow; + + // #3291 : JAWS needs the 500ms delay to detect that the editor iframe + // iframe is no longer editable. So that it will put the focus into the + // Paste from Word dialog's editable area instead. + setTimeout( function() + { + win.focus(); + }, 500 ); + } + } + ] + } + ] + }; +}); diff --git a/library/custom_template/ckeditor/_source/plugins/clipboard/plugin.js b/library/custom_template/ckeditor/_source/plugins/clipboard/plugin.js new file mode 100644 index 000000000..27121bed6 --- /dev/null +++ b/library/custom_template/ckeditor/_source/plugins/clipboard/plugin.js @@ -0,0 +1,445 @@ +/* +Copyright (c) 2003-2011, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.html or http://ckeditor.com/license +*/ + +/** + * @file Clipboard support + */ + +(function() +{ + // Tries to execute any of the paste, cut or copy commands in IE. Returns a + // boolean indicating that the operation succeeded. + var execIECommand = function( editor, command ) + { + var doc = editor.document, + body = doc.getBody(); + + var enabled = 0; + var onExec = function() + { + enabled = 1; + }; + + // The following seems to be the only reliable way to detect that + // clipboard commands are enabled in IE. It will fire the + // onpaste/oncut/oncopy events only if the security settings allowed + // the command to execute. + body.on( command, onExec ); + + // IE6/7: document.execCommand has problem to paste into positioned element. + ( CKEDITOR.env.version > 7 ? doc.$ : doc.$.selection.createRange() ) [ 'execCommand' ]( command ); + + body.removeListener( command, onExec ); + + return enabled; + }; + + // Attempts to execute the Cut and Copy operations. + var tryToCutCopy = + CKEDITOR.env.ie ? + function( editor, type ) + { + return execIECommand( editor, type ); + } + : // !IE. + function( editor, type ) + { + try + { + // Other browsers throw an error if the command is disabled. + return editor.document.$.execCommand( type, false, null ); + } + catch( e ) + { + return false; + } + }; + + // A class that represents one of the cut or copy commands. + var cutCopyCmd = function( type ) + { + this.type = type; + this.canUndo = this.type == 'cut'; // We can't undo copy to clipboard. + this.startDisabled = true; + }; + + cutCopyCmd.prototype = + { + exec : function( editor, data ) + { + this.type == 'cut' && fixCut( editor ); + + var success = tryToCutCopy( editor, this.type ); + + if ( !success ) + alert( editor.lang.clipboard[ this.type + 'Error' ] ); // Show cutError or copyError. + + return success; + } + }; + + // Paste command. + var pasteCmd = + { + canUndo : false, + + exec : + CKEDITOR.env.ie ? + function( editor ) + { + // Prevent IE from pasting at the begining of the document. + editor.focus(); + + if ( !editor.document.getBody().fire( 'beforepaste' ) + && !execIECommand( editor, 'paste' ) ) + { + editor.fire( 'pasteDialog' ); + return false; + } + } + : + function( editor ) + { + try + { + if ( !editor.document.getBody().fire( 'beforepaste' ) + && !editor.document.$.execCommand( 'Paste', false, null ) ) + { + throw 0; + } + } + catch ( e ) + { + setTimeout( function() + { + editor.fire( 'pasteDialog' ); + }, 0 ); + return false; + } + } + }; + + // Listens for some clipboard related keystrokes, so they get customized. + var onKey = function( event ) + { + if ( this.mode != 'wysiwyg' ) + return; + + switch ( event.data.keyCode ) + { + // Paste + case CKEDITOR.CTRL + 86 : // CTRL+V + case CKEDITOR.SHIFT + 45 : // SHIFT+INS + + var body = this.document.getBody(); + + // Simulate 'beforepaste' event for all none-IEs. + if ( !CKEDITOR.env.ie && body.fire( 'beforepaste' ) ) + event.cancel(); + // Simulate 'paste' event for Opera/Firefox2. + else if ( CKEDITOR.env.opera + || CKEDITOR.env.gecko && CKEDITOR.env.version < 10900 ) + body.fire( 'paste' ); + return; + + // Cut + case CKEDITOR.CTRL + 88 : // CTRL+X + case CKEDITOR.SHIFT + 46 : // SHIFT+DEL + + // Save Undo snapshot. + var editor = this; + this.fire( 'saveSnapshot' ); // Save before paste + setTimeout( function() + { + editor.fire( 'saveSnapshot' ); // Save after paste + }, 0 ); + } + }; + + // Allow to peek clipboard content by redirecting the + // pasting content into a temporary bin and grab the content of it. + function getClipboardData( evt, mode, callback ) + { + var doc = this.document; + + // Avoid recursions on 'paste' event or consequent paste too fast. (#5730) + if ( doc.getById( 'cke_pastebin' ) ) + return; + + // If the browser supports it, get the data directly + if ( mode == 'text' && evt.data && evt.data.$.clipboardData ) + { + // evt.data.$.clipboardData.types contains all the flavours in Mac's Safari, but not on windows. + var plain = evt.data.$.clipboardData.getData( 'text/plain' ); + if ( plain ) + { + evt.data.preventDefault(); + callback( plain ); + return; + } + } + + var sel = this.getSelection(), + range = new CKEDITOR.dom.range( doc ); + + // Create container to paste into + var pastebin = new CKEDITOR.dom.element( mode == 'text' ? 'textarea' : CKEDITOR.env.webkit ? 'body' : 'div', doc ); + pastebin.setAttribute( 'id', 'cke_pastebin' ); + // Safari requires a filler node inside the div to have the content pasted into it. (#4882) + CKEDITOR.env.webkit && pastebin.append( doc.createText( '\xa0' ) ); + doc.getBody().append( pastebin ); + + pastebin.setStyles( + { + position : 'absolute', + // Position the bin exactly at the position of the selected element + // to avoid any subsequent document scroll. + top : sel.getStartElement().getDocumentPosition().y + 'px', + width : '1px', + height : '1px', + overflow : 'hidden' + }); + + // It's definitely a better user experience if we make the paste-bin pretty unnoticed + // by pulling it off the screen. + pastebin.setStyle( this.config.contentsLangDirection == 'ltr' ? 'left' : 'right', '-1000px' ); + + var bms = sel.createBookmarks(); + + // Turn off design mode temporarily before give focus to the paste bin. + if ( mode == 'text' ) + { + if ( CKEDITOR.env.ie ) + { + var ieRange = doc.getBody().$.createTextRange(); + ieRange.moveToElementText( pastebin.$ ); + ieRange.execCommand( 'Paste' ); + evt.data.preventDefault(); + } + else + pastebin.$.focus(); + } + else + { + range.setStartAt( pastebin, CKEDITOR.POSITION_AFTER_START ); + range.setEndAt( pastebin, CKEDITOR.POSITION_BEFORE_END ); + range.select( true ); + } + + var editor = this; + // Wait a while and grab the pasted contents + window.setTimeout( function() + { + mode == 'text' && CKEDITOR.env.gecko && editor.focusGrabber.focus(); + pastebin.remove(); + + // Grab the HTML contents. + // We need to look for a apple style wrapper on webkit it also adds + // a div wrapper if you copy/paste the body of the editor. + // Remove hidden div and restore selection. + var bogusSpan; + pastebin = ( CKEDITOR.env.webkit + && ( bogusSpan = pastebin.getFirst() ) + && ( bogusSpan.is && bogusSpan.hasClass( 'Apple-style-span' ) ) ? + bogusSpan : pastebin ); + + sel.selectBookmarks( bms ); + callback( pastebin[ 'get' + ( mode == 'text' ? 'Value' : 'Html' ) ]() ); + }, 0 ); + } + + // Cutting off control type element in IE standards breaks the selection entirely. (#4881) + function fixCut( editor ) + { + if ( !CKEDITOR.env.ie || CKEDITOR.env.quirks ) + return; + + var sel = editor.getSelection(); + var control; + if( ( sel.getType() == CKEDITOR.SELECTION_ELEMENT ) && ( control = sel.getSelectedElement() ) ) + { + var range = sel.getRanges()[ 0 ]; + var dummy = editor.document.createText( '' ); + dummy.insertBefore( control ); + range.setStartBefore( dummy ); + range.setEndAfter( control ); + sel.selectRanges( [ range ] ); + + // Clear up the fix if the paste wasn't succeeded. + setTimeout( function() + { + // Element still online? + if ( control.getParent() ) + { + dummy.remove(); + sel.selectElement( control ); + } + }, 0 ); + } + } + + var depressBeforeEvent; + function stateFromNamedCommand( command, editor ) + { + // IE Bug: queryCommandEnabled('paste') fires also 'beforepaste(copy/cut)', + // guard to distinguish from the ordinary sources( either + // keyboard paste or execCommand ) (#4874). + CKEDITOR.env.ie && ( depressBeforeEvent = 1 ); + + var retval = editor.document.$.queryCommandEnabled( command ) ? CKEDITOR.TRISTATE_OFF : CKEDITOR.TRISTATE_DISABLED; + depressBeforeEvent = 0; + return retval; + } + + var inReadOnly; + function setToolbarStates() + { + if ( this.mode != 'wysiwyg' ) + return; + + this.getCommand( 'cut' ).setState( inReadOnly ? CKEDITOR.TRISTATE_DISABLED : stateFromNamedCommand( 'Cut', this ) ); + this.getCommand( 'copy' ).setState( stateFromNamedCommand( 'Copy', this ) ); + var pasteState = inReadOnly ? CKEDITOR.TRISTATE_DISABLED : + CKEDITOR.env.webkit ? CKEDITOR.TRISTATE_OFF : stateFromNamedCommand( 'Paste', this ); + this.fire( 'pasteState', pasteState ); + } + + // Register the plugin. + CKEDITOR.plugins.add( 'clipboard', + { + requires : [ 'dialog', 'htmldataprocessor' ], + init : function( editor ) + { + // Inserts processed data into the editor at the end of the + // events chain. + editor.on( 'paste', function( evt ) + { + var data = evt.data; + if ( data[ 'html' ] ) + editor.insertHtml( data[ 'html' ] ); + else if ( data[ 'text' ] ) + editor.insertText( data[ 'text' ] ); + + }, null, null, 1000 ); + + editor.on( 'pasteDialog', function( evt ) + { + setTimeout( function() + { + // Open default paste dialog. + editor.openDialog( 'paste' ); + }, 0 ); + }); + + editor.on( 'pasteState', function( evt ) + { + editor.getCommand( 'paste' ).setState( evt.data ); + }); + + function addButtonCommand( buttonName, commandName, command, ctxMenuOrder ) + { + var lang = editor.lang[ commandName ]; + + editor.addCommand( commandName, command ); + editor.ui.addButton( buttonName, + { + label : lang, + command : commandName + }); + + // If the "menu" plugin is loaded, register the menu item. + if ( editor.addMenuItems ) + { + editor.addMenuItem( commandName, + { + label : lang, + command : commandName, + group : 'clipboard', + order : ctxMenuOrder + }); + } + } + + addButtonCommand( 'Cut', 'cut', new cutCopyCmd( 'cut' ), 1 ); + addButtonCommand( 'Copy', 'copy', new cutCopyCmd( 'copy' ), 4 ); + addButtonCommand( 'Paste', 'paste', pasteCmd, 8 ); + + CKEDITOR.dialog.add( 'paste', CKEDITOR.getUrl( this.path + 'dialogs/paste.js' ) ); + + editor.on( 'key', onKey, editor ); + + var mode = editor.config.forcePasteAsPlainText ? 'text' : 'html'; + + // We'll be catching all pasted content in one line, regardless of whether the + // it's introduced by a document command execution (e.g. toolbar buttons) or + // user paste behaviors. (e.g. Ctrl-V) + editor.on( 'contentDom', function() + { + var body = editor.document.getBody(); + body.on( ( ( mode == 'text' && CKEDITOR.env.ie ) || CKEDITOR.env.webkit ) ? 'paste' : 'beforepaste', + function( evt ) + { + if ( depressBeforeEvent ) + return; + + getClipboardData.call( editor, evt, mode, function ( data ) + { + // The very last guard to make sure the + // paste has successfully happened. + if ( !data ) + return; + + var dataTransfer = {}; + dataTransfer[ mode ] = data; + editor.fire( 'paste', dataTransfer ); + } ); + }); + + body.on( 'beforecut', function() { !depressBeforeEvent && fixCut( editor ); } ); + + body.on( 'mouseup', function(){ setTimeout( function(){ setToolbarStates.call( editor ); }, 0 ); }, editor ); + body.on( 'keyup', setToolbarStates, editor ); + }); + + // For improved performance, we're checking the readOnly state on selectionChange instead of hooking a key event for that. + editor.on( 'selectionChange', function( evt ) + { + inReadOnly = evt.data.selection.getRanges()[ 0 ].checkReadOnly(); + setToolbarStates.call( editor ); + }); + + // If the "contextmenu" plugin is loaded, register the listeners. + if ( editor.contextMenu ) + { + editor.contextMenu.addListener( function( element, selection ) + { + var readOnly = selection.getRanges()[ 0 ].checkReadOnly(); + return { + cut : !readOnly && stateFromNamedCommand( 'Cut', editor ), + copy : stateFromNamedCommand( 'Copy', editor ), + paste : !readOnly && ( CKEDITOR.env.webkit ? CKEDITOR.TRISTATE_OFF : stateFromNamedCommand( 'Paste', editor ) ) + }; + }); + } + } + }); +})(); + +/** + * Fired when a clipboard operation is about to be taken into the editor. + * Listeners can manipulate the data to be pasted before having it effectively + * inserted into the document. + * @name CKEDITOR.editor#paste + * @since 3.1 + * @event + * @param {String} [data.html] The HTML data to be pasted. If not available, e.data.text will be defined. + * @param {String} [data.text] The plain text data to be pasted, available when plain text operations are to used. If not available, e.data.html will be defined. + */ + +/** + * Internal event to open the Paste dialog + * @name CKEDITOR.editor#pasteDialog + * @event + */ diff --git a/library/custom_template/ckeditor/_source/plugins/colorbutton/plugin.js b/library/custom_template/ckeditor/_source/plugins/colorbutton/plugin.js new file mode 100644 index 000000000..5727a29af --- /dev/null +++ b/library/custom_template/ckeditor/_source/plugins/colorbutton/plugin.js @@ -0,0 +1,291 @@ +/* +Copyright (c) 2003-2011, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.html or http://ckeditor.com/license +*/ + +CKEDITOR.plugins.add( 'colorbutton', +{ + requires : [ 'panelbutton', 'floatpanel', 'styles' ], + + init : function( editor ) + { + var config = editor.config, + lang = editor.lang.colorButton; + + var clickFn; + + if ( !CKEDITOR.env.hc ) + { + addButton( 'TextColor', 'fore', lang.textColorTitle ); + addButton( 'BGColor', 'back', lang.bgColorTitle ); + } + + function addButton( name, type, title ) + { + var colorBoxId = CKEDITOR.tools.getNextId() + '_colorBox'; + editor.ui.add( name, CKEDITOR.UI_PANELBUTTON, + { + label : title, + title : title, + className : 'cke_button_' + name.toLowerCase(), + modes : { wysiwyg : 1 }, + + panel : + { + css : editor.skin.editor.css, + attributes : { role : 'listbox', 'aria-label' : lang.panelTitle } + }, + + onBlock : function( panel, block ) + { + block.autoSize = true; + block.element.addClass( 'cke_colorblock' ); + block.element.setHtml( renderColors( panel, type, colorBoxId ) ); + // The block should not have scrollbars (#5933, #6056) + block.element.getDocument().getBody().setStyle( 'overflow', 'hidden' ); + + CKEDITOR.ui.fire( 'ready', this ); + + var keys = block.keys; + var rtl = editor.lang.dir == 'rtl'; + keys[ rtl ? 37 : 39 ] = 'next'; // ARROW-RIGHT + keys[ 40 ] = 'next'; // ARROW-DOWN + keys[ 9 ] = 'next'; // TAB + keys[ rtl ? 39 : 37 ] = 'prev'; // ARROW-LEFT + keys[ 38 ] = 'prev'; // ARROW-UP + keys[ CKEDITOR.SHIFT + 9 ] = 'prev'; // SHIFT + TAB + keys[ 32 ] = 'click'; // SPACE + }, + + // The automatic colorbox should represent the real color (#6010) + onOpen : function() + { + var selection = editor.getSelection(), + block = selection && selection.getStartElement(), + path = new CKEDITOR.dom.elementPath( block ), + color; + + // Find the closest block element. + block = path.block || path.blockLimit; + + // The background color might be transparent. In that case, look up the color in the DOM tree. + do + { + color = block && block.getComputedStyle( type == 'back' ? 'background-color' : 'color' ) || 'transparent'; + } + while ( type == 'back' && color == 'transparent' && block && ( block = block.getParent() ) ); + + // The box should never be transparent. + if ( !color || color == 'transparent' ) + color = '#ffffff'; + + this._.panel._.iframe.getFrameDocument().getById( colorBoxId ).setStyle( 'background-color', color ); + } + }); + } + + + function renderColors( panel, type, colorBoxId ) + { + var output = [], + colors = config.colorButton_colors.split( ',' ), + total = colors.length + ( config.colorButton_enableMore ? 2 : 1 ); + + var clickFn = CKEDITOR.tools.addFunction( function( color, type ) + { + if ( color == '?' ) + { + var applyColorStyle = arguments.callee; + function onColorDialogClose( evt ) + { + this.removeListener( 'ok', onColorDialogClose ); + this.removeListener( 'cancel', onColorDialogClose ); + + evt.name == 'ok' && applyColorStyle( this.getContentElement( 'picker', 'selectedColor' ).getValue(), type ); + } + + editor.openDialog( 'colordialog', function() + { + this.on( 'ok', onColorDialogClose ); + this.on( 'cancel', onColorDialogClose ); + } ); + + return; + } + + editor.focus(); + + panel.hide(); + + + editor.fire( 'saveSnapshot' ); + + // Clean up any conflicting style within the range. + new CKEDITOR.style( config['colorButton_' + type + 'Style'], { color : 'inherit' } ).remove( editor.document ); + + if ( color ) + { + var colorStyle = config['colorButton_' + type + 'Style']; + + colorStyle.childRule = type == 'back' ? + function( element ) + { + // It's better to apply background color as the innermost style. (#3599) + // Except for "unstylable elements". (#6103) + return isUnstylable( element ); + } + : + function( element ) + { + // Fore color style must be applied inside links instead of around it. + return element.getName() != 'a' || isUnstylable( element ); + }; + + new CKEDITOR.style( colorStyle, { color : color } ).apply( editor.document ); + } + + editor.fire( 'saveSnapshot' ); + }); + + // Render the "Automatic" button. + output.push( + '' + + '' + + '' + + '' + + '' + + '' + + '
        ' + + '' + + '', + lang.auto, + '
        ' + + '
        ' + + '' ); + + // Render the color boxes. + for ( var i = 0 ; i < colors.length ; i++ ) + { + if ( ( i % 8 ) === 0 ) + output.push( '' ); + + var parts = colors[ i ].split( '/' ), + colorName = parts[ 0 ], + colorCode = parts[ 1 ] || colorName; + + // The data can be only a color code (without #) or colorName + color code + // If only a color code is provided, then the colorName is the color with the hash + // Convert the color from RGB to RRGGBB for better compatibility with IE and . See #5676 + if (!parts[1]) + colorName = '#' + colorName.replace( /^(.)(.)(.)$/, '$1$1$2$2$3$3' ); + + var colorLabel = editor.lang.colors[ colorCode ] || colorCode; + output.push( + '' ); + } + + // Render the "More Colors" button. + if ( config.colorButton_enableMore === undefined || config.colorButton_enableMore ) + { + output.push( + '' + + '' + + '' ); // tr is later in the code. + } + + output.push( '
        ' + + '' + + '' + + '' + + '
        ' + + '', + lang.more, + '' + + '
        ' ); + + return output.join( '' ); + } + + function isUnstylable( ele ) + { + return ( ele.getAttribute( 'contentEditable' ) == 'false' ) || ele.getAttribute( 'data-nostyle' ); + } + } +}); + +/** + * Whether to enable the "More Colors..." button in the color selectors. + * @default true + * @type Boolean + * @example + * config.colorButton_enableMore = false; + */ + +/** + * Defines the colors to be displayed in the color selectors. It's a string + * containing the hexadecimal notation for HTML colors, without the "#" prefix. + * + * Since 3.3: A name may be optionally defined by prefixing the entries with the + * name and the slash character. For example, "FontColor1/FF9900" will be + * displayed as the color #FF9900 in the selector, but will be outputted as "FontColor1". + * @type String + * @default '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' + * @example + * // Brazil colors only. + * config.colorButton_colors = '00923E,F8C100,28166F'; + * @example + * config.colorButton_colors = 'FontColor1/FF9900,FontColor2/0066CC,FontColor3/F00' + */ +CKEDITOR.config.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'; + +/** + * Holds the style definition to be used to apply the text foreground color. + * @type Object + * @example + * // This is basically the default setting value. + * config.colorButton_foreStyle = + * { + * element : 'span', + * styles : { 'color' : '#(color)' } + * }; + */ +CKEDITOR.config.colorButton_foreStyle = + { + element : 'span', + styles : { 'color' : '#(color)' }, + overrides : [ { element : 'font', attributes : { 'color' : null } } ] + }; + +/** + * Holds the style definition to be used to apply the text background color. + * @type Object + * @example + * // This is basically the default setting value. + * config.colorButton_backStyle = + * { + * element : 'span', + * styles : { 'background-color' : '#(color)' } + * }; + */ +CKEDITOR.config.colorButton_backStyle = + { + element : 'span', + styles : { 'background-color' : '#(color)' } + }; diff --git a/library/custom_template/ckeditor/_source/plugins/colordialog/dialogs/colordialog.js b/library/custom_template/ckeditor/_source/plugins/colordialog/dialogs/colordialog.js new file mode 100644 index 000000000..0fbb82d7f --- /dev/null +++ b/library/custom_template/ckeditor/_source/plugins/colordialog/dialogs/colordialog.js @@ -0,0 +1,340 @@ +/* +Copyright (c) 2003-2011, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.html or http://ckeditor.com/license +*/ + +CKEDITOR.dialog.add( 'colordialog', function( editor ) + { + // Define some shorthands. + var $el = CKEDITOR.dom.element, + $doc = CKEDITOR.document, + $tools = CKEDITOR.tools, + lang = editor.lang.colordialog; + + // Reference the dialog. + var dialog; + + var spacer = + { + type : 'html', + html : ' ' + }; + + function clearSelected() + { + $doc.getById( selHiColorId ).removeStyle( 'background-color' ); + dialog.getContentElement( 'picker', 'selectedColor' ).setValue( '' ); + } + + function updateSelected( evt ) + { + if ( ! ( evt instanceof CKEDITOR.dom.event ) ) + evt = new CKEDITOR.dom.event( evt ); + + var target = evt.getTarget(), + color; + + if ( target.getName() == 'a' && ( color = target.getChild( 0 ).getHtml() ) ) + dialog.getContentElement( 'picker', 'selectedColor' ).setValue( color ); + } + + function updateHighlight( event ) + { + if ( ! ( event instanceof CKEDITOR.dom.event ) ) + event = event.data; + + var target = event.getTarget(), + color; + + if ( target.getName() == 'a' && ( color = target.getChild( 0 ).getHtml() ) ) + { + $doc.getById( hicolorId ).setStyle( 'background-color', color ); + $doc.getById( hicolorTextId ).setHtml( color ); + } + } + + function clearHighlight() + { + $doc.getById( hicolorId ).removeStyle( 'background-color' ); + $doc.getById( hicolorTextId ).setHtml( ' ' ); + } + + var onMouseout = $tools.addFunction( clearHighlight ), + onClick = updateSelected, + onClickHandler = CKEDITOR.tools.addFunction( onClick ), + onFocus = updateHighlight, + onBlur = clearHighlight; + + var onKeydownHandler = CKEDITOR.tools.addFunction( function( ev ) + { + ev = new CKEDITOR.dom.event( ev ); + var element = ev.getTarget(); + var relative, nodeToMove; + var keystroke = ev.getKeystroke(), + rtl = editor.lang.dir == 'rtl'; + + switch ( keystroke ) + { + // UP-ARROW + case 38 : + // relative is TR + if ( ( relative = element.getParent().getParent().getPrevious() ) ) + { + nodeToMove = relative.getChild( [element.getParent().getIndex(), 0] ); + nodeToMove.focus(); + onBlur( ev, element ); + onFocus( ev, nodeToMove ); + } + ev.preventDefault(); + break; + // DOWN-ARROW + case 40 : + // relative is TR + if ( ( relative = element.getParent().getParent().getNext() ) ) + { + nodeToMove = relative.getChild( [ element.getParent().getIndex(), 0 ] ); + if ( nodeToMove && nodeToMove.type == 1 ) + { + nodeToMove.focus(); + onBlur( ev, element ); + onFocus( ev, nodeToMove ); + } + } + ev.preventDefault(); + break; + // SPACE + // ENTER is already handled as onClick + case 32 : + onClick( ev ); + ev.preventDefault(); + break; + + // RIGHT-ARROW + case rtl ? 37 : 39 : + // relative is TD + if ( ( relative = element.getParent().getNext() ) ) + { + nodeToMove = relative.getChild( 0 ); + if ( nodeToMove.type == 1 ) + { + nodeToMove.focus(); + onBlur( ev, element ); + onFocus( ev, nodeToMove ); + ev.preventDefault( true ); + } + else + onBlur( null, element ); + } + // relative is TR + else if ( ( relative = element.getParent().getParent().getNext() ) ) + { + nodeToMove = relative.getChild( [ 0, 0 ] ); + if ( nodeToMove && nodeToMove.type == 1 ) + { + nodeToMove.focus(); + onBlur( ev, element ); + onFocus( ev, nodeToMove ); + ev.preventDefault( true ); + } + else + onBlur( null, element ); + } + break; + + // LEFT-ARROW + case rtl ? 39 : 37 : + // relative is TD + if ( ( relative = element.getParent().getPrevious() ) ) + { + nodeToMove = relative.getChild( 0 ); + nodeToMove.focus(); + onBlur( ev, element ); + onFocus( ev, nodeToMove ); + ev.preventDefault( true ); + } + // relative is TR + else if ( ( relative = element.getParent().getParent().getPrevious() ) ) + { + nodeToMove = relative.getLast().getChild( 0 ); + nodeToMove.focus(); + onBlur( ev, element ); + onFocus( ev, nodeToMove ); + ev.preventDefault( true ); + } + else + onBlur( null, element ); + break; + default : + // Do not stop not handled events. + return; + } + }); + + function createColorTable() + { + // Create the base colors array. + var aColors = [ '00', '33', '66', '99', 'cc', 'ff' ]; + + // This function combines two ranges of three values from the color array into a row. + function appendColorRow( rangeA, rangeB ) + { + for ( var i = rangeA ; i < rangeA + 3 ; i++ ) + { + var row = table.$.insertRow( -1 ); + + for ( var j = rangeB ; j < rangeB + 3 ; j++ ) + { + for ( var n = 0 ; n < 6 ; n++ ) + { + appendColorCell( row, '#' + aColors[j] + aColors[n] + aColors[i] ); + } + } + } + } + + // This function create a single color cell in the color table. + function appendColorCell( targetRow, color ) + { + var cell = new $el( targetRow.insertCell( -1 ) ); + cell.setAttribute( 'class', 'ColorCell' ); + cell.setStyle( 'background-color', color ); + + cell.setStyle( 'width', '15px' ); + cell.setStyle( 'height', '15px' ); + + var index = cell.$.cellIndex + 1 + 18 * targetRow.rowIndex; + cell.append( CKEDITOR.dom.element.createFromHtml( + '' + color + ' ', CKEDITOR.document ) ); + } + + appendColorRow( 0, 0 ); + appendColorRow( 3, 0 ); + appendColorRow( 0, 3 ); + appendColorRow( 3, 3 ); + + // Create the last row. + var oRow = table.$.insertRow(-1) ; + + // Create the gray scale colors cells. + for ( var n = 0 ; n < 6 ; n++ ) + { + appendColorCell( oRow, '#' + aColors[n] + aColors[n] + aColors[n] ) ; + } + + // Fill the row with black cells. + for ( var i = 0 ; i < 12 ; i++ ) + { + appendColorCell( oRow, '#000000' ) ; + } + } + + var table = new $el( 'table' ); + createColorTable(); + var html = table.getHtml(); + + var numbering = function( id ) + { + return CKEDITOR.tools.getNextId() + '_' + id; + }, + hicolorId = numbering( 'hicolor' ), + hicolorTextId = numbering( 'hicolortext' ), + selHiColorId = numbering( 'selhicolor' ), + tableLabelId = numbering( 'color_table_label' ); + + return { + title : lang.title, + minWidth : 360, + minHeight : 220, + onLoad : function() + { + // Update reference. + dialog = this; + }, + contents : [ + { + id : 'picker', + label : lang.title, + accessKey : 'I', + elements : + [ + { + type : 'hbox', + padding : 0, + widths : [ '70%', '10%', '30%' ], + children : + [ + { + type : 'html', + html : '' + + ( !CKEDITOR.env.webkit ? html : '' ) + + '
        ' + lang.options +'', + onLoad : function() + { + var table = CKEDITOR.document.getById( this.domId ); + table.on( 'mouseover', updateHighlight ); + // In WebKit, the table content must be inserted after this event call (#6150) + CKEDITOR.env.webkit && table.setHtml( html ); + }, + focus: function() + { + var firstColor = this.getElement().getElementsByTag( 'a' ).getItem( 0 ); + firstColor.focus(); + } + }, + spacer, + { + type : 'vbox', + padding : 0, + widths : [ '70%', '5%', '25%' ], + children : + [ + { + type : 'html', + html : '' + lang.highlight +'\ +
        \ +
         
        ' + lang.selected + '\ +
        ' + }, + { + type : 'text', + label : lang.selected, + labelStyle: 'display:none', + id : 'selectedColor', + style : 'width: 74px', + onChange : function() + { + // Try to update color preview with new value. If fails, then set it no none. + try + { + $doc.getById( selHiColorId ).setStyle( 'background-color', this.getValue() ); + } + catch ( e ) + { + clearSelected(); + } + } + }, + spacer, + { + type : 'button', + id : 'clear', + style : 'margin-top: 5px', + label : lang.clear, + onClick : clearSelected + } + ] + } + ] + } + ] + } + ] + }; + } + ); diff --git a/library/custom_template/ckeditor/_source/plugins/colordialog/plugin.js b/library/custom_template/ckeditor/_source/plugins/colordialog/plugin.js new file mode 100644 index 000000000..e320aa659 --- /dev/null +++ b/library/custom_template/ckeditor/_source/plugins/colordialog/plugin.js @@ -0,0 +1,13 @@ +( function() +{ + CKEDITOR.plugins.colordialog = + { + init : function( editor ) + { + editor.addCommand( 'colordialog', new CKEDITOR.dialogCommand( 'colordialog' ) ); + CKEDITOR.dialog.add( 'colordialog', this.path + 'dialogs/colordialog.js' ); + } + }; + + CKEDITOR.plugins.add( 'colordialog', CKEDITOR.plugins.colordialog ); +} )(); diff --git a/library/custom_template/ckeditor/_source/plugins/contextmenu/plugin.js b/library/custom_template/ckeditor/_source/plugins/contextmenu/plugin.js new file mode 100644 index 000000000..663393775 --- /dev/null +++ b/library/custom_template/ckeditor/_source/plugins/contextmenu/plugin.js @@ -0,0 +1,177 @@ +/* +Copyright (c) 2003-2011, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.html or http://ckeditor.com/license +*/ + +CKEDITOR.plugins.add( 'contextmenu', +{ + requires : [ 'menu' ], + + // Make sure the base class (CKEDITOR.menu) is loaded before it (#3318). + onLoad : function() + { + CKEDITOR.plugins.contextMenu = CKEDITOR.tools.createClass( + { + base : CKEDITOR.menu, + + $ : function( editor ) + { + this.base.call( this, editor, + { + panel: + { + className : editor.skinClass + ' cke_contextmenu', + attributes : + { + 'aria-label' : editor.lang.contextmenu.options + } + } + }); + }, + + proto : + { + addTarget : function( element, nativeContextMenuOnCtrl ) + { + // Opera doesn't support 'contextmenu' event, we have duo approaches employed here: + // 1. Inherit the 'button override' hack we introduced in v2 (#4530), while this require the Opera browser + // option 'Allow script to detect context menu/right click events' to be always turned on. + // 2. Considering the fact that ctrl/meta key is not been occupied + // for multiple range selecting (like Gecko), we use this key + // combination as a fallback for triggering context-menu. (#4530) + if ( CKEDITOR.env.opera && !( 'oncontextmenu' in document.body )) + { + var contextMenuOverrideButton; + element.on( 'mousedown', function( evt ) + { + evt = evt.data; + if ( evt.$.button != 2 ) + { + if ( evt.getKeystroke() == CKEDITOR.CTRL + 1 ) + element.fire( 'contextmenu', evt ); + return; + } + + if ( nativeContextMenuOnCtrl + && ( CKEDITOR.env.mac ? evt.$.metaKey : evt.$.ctrlKey ) ) + return; + + var target = evt.getTarget(); + + if ( !contextMenuOverrideButton ) + { + var ownerDoc = target.getDocument(); + contextMenuOverrideButton = ownerDoc.createElement( 'input' ) ; + contextMenuOverrideButton.$.type = 'button' ; + ownerDoc.getBody().append( contextMenuOverrideButton ) ; + } + + contextMenuOverrideButton.setAttribute( 'style', 'position:absolute;top:' + ( evt.$.clientY - 2 ) + + 'px;left:' + ( evt.$.clientX - 2 ) + + 'px;width:5px;height:5px;opacity:0.01' ); + + } ); + + element.on( 'mouseup', function ( evt ) + { + if ( contextMenuOverrideButton ) + { + contextMenuOverrideButton.remove(); + contextMenuOverrideButton = undefined; + // Simulate 'contextmenu' event. + element.fire( 'contextmenu', evt.data ); + } + } ); + } + + element.on( 'contextmenu', function( event ) + { + var domEvent = event.data; + + if ( nativeContextMenuOnCtrl && + // Safari on Windows always show 'ctrlKey' as true in 'contextmenu' event, + // which make this property unreliable. (#4826) + ( CKEDITOR.env.webkit ? holdCtrlKey : ( CKEDITOR.env.mac ? domEvent.$.metaKey : domEvent.$.ctrlKey ) ) ) + return; + + + // Cancel the browser context menu. + domEvent.preventDefault(); + + var offsetParent = domEvent.getTarget().getDocument().getDocumentElement(), + offsetX = domEvent.$.clientX, + offsetY = domEvent.$.clientY; + + CKEDITOR.tools.setTimeout( function() + { + this.open( offsetParent, null, offsetX, offsetY ); + }, + 0, this ); + }, + this ); + + if ( CKEDITOR.env.opera ) + { + // 'contextmenu' event triggered by Windows menu key is unpreventable, + // cancel the key event itself. (#6534) + element.on( 'keypress' , function ( evt ) + { + var domEvent = evt.data; + + if ( domEvent.$.keyCode === 0 ) + domEvent.preventDefault(); + }); + } + + if ( CKEDITOR.env.webkit ) + { + var holdCtrlKey, + onKeyDown = function( event ) + { + holdCtrlKey = CKEDITOR.env.mac ? event.data.$.metaKey : event.data.$.ctrlKey ; + }, + resetOnKeyUp = function() + { + holdCtrlKey = 0; + }; + + element.on( 'keydown', onKeyDown ); + element.on( 'keyup', resetOnKeyUp ); + element.on( 'contextmenu', resetOnKeyUp ); + } + }, + + open : function( offsetParent, corner, offsetX, offsetY ) + { + this.editor.focus(); + offsetParent = offsetParent || CKEDITOR.document.getDocumentElement(); + this.show( offsetParent, corner, offsetX, offsetY ); + } + } + }); + }, + + beforeInit : function( editor ) + { + editor.contextMenu = new CKEDITOR.plugins.contextMenu( editor ); + + editor.addCommand( 'contextMenu', + { + exec : function() + { + editor.contextMenu.open( editor.document.getBody() ); + } + }); + } +}); + +/** + * Whether to show the browser native context menu when the CTRL or the + * META (Mac) key is pressed while opening the context menu. + * @name CKEDITOR.config.browserContextMenuOnCtrl + * @since 3.0.2 + * @type Boolean + * @default true + * @example + * config.browserContextMenuOnCtrl = false; + */ diff --git a/library/custom_template/ckeditor/_source/plugins/dialog/dialogDefinition.js b/library/custom_template/ckeditor/_source/plugins/dialog/dialogDefinition.js new file mode 100644 index 000000000..cff6d69a1 --- /dev/null +++ b/library/custom_template/ckeditor/_source/plugins/dialog/dialogDefinition.js @@ -0,0 +1,315 @@ +/* +Copyright (c) 2003-2011, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.html or http://ckeditor.com/license +*/ + +/** + * @fileOverview Defines the "virtual" dialog, dialog content and dialog button + * definition classes. + */ + +/** + * This class is not really part of the API. It just illustrates the properties + * that developers can use to define and create dialogs. + * @name CKEDITOR.dialog.dialogDefinition + * @constructor + * @example + * // There is no constructor for this class, the user just has to define an + * // object with the appropriate properties. + * + * CKEDITOR.dialog.add( 'testOnly', function( editor ) + * { + * return { + * title : 'Test Dialog', + * resizable : CKEDITOR.DIALOG_RESIZE_BOTH, + * minWidth : 500, + * minHeight : 400, + * contents : [ + * { + * id : 'tab1', + * label : 'First Tab', + * title : 'First Tab Title', + * accessKey : 'Q', + * elements : [ + * { + * type : 'text', + * label : 'Test Text 1', + * id : 'testText1', + * 'default' : 'hello world!' + * } + * ] + * } + * ] + * }; + * }); + */ + +/** + * The dialog title, displayed in the dialog's header. Required. + * @name CKEDITOR.dialog.dialogDefinition.prototype.title + * @field + * @type String + * @example + */ + +/** + * How the dialog can be resized, must be one of the four contents defined below. + *

        + * CKEDITOR.DIALOG_RESIZE_NONE
        + * CKEDITOR.DIALOG_RESIZE_WIDTH
        + * CKEDITOR.DIALOG_RESIZE_HEIGHT
        + * CKEDITOR.DIALOG_RESIZE_BOTH
        + * @name CKEDITOR.dialog.dialogDefinition.prototype.resizable + * @field + * @type Number + * @default CKEDITOR.DIALOG_RESIZE_NONE + * @example + */ + +/** + * The minimum width of the dialog, in pixels. + * @name CKEDITOR.dialog.dialogDefinition.prototype.minWidth + * @field + * @type Number + * @default 600 + * @example + */ + +/** + * The minimum height of the dialog, in pixels. + * @name CKEDITOR.dialog.dialogDefinition.prototype.minHeight + * @field + * @type Number + * @default 400 + * @example + */ + +/** + * The buttons in the dialog, defined as an array of + * {@link CKEDITOR.dialog.buttonDefinition} objects. + * @name CKEDITOR.dialog.dialogDefinition.prototype.buttons + * @field + * @type Array + * @default [ CKEDITOR.dialog.okButton, CKEDITOR.dialog.cancelButton ] + * @example + */ + +/** + * The contents in the dialog, defined as an array of + * {@link CKEDITOR.dialog.contentDefinition} objects. Required. + * @name CKEDITOR.dialog.dialogDefinition.prototype.contents + * @field + * @type Array + * @example + */ + +/** + * The function to execute when OK is pressed. + * @name CKEDITOR.dialog.dialogDefinition.prototype.onOk + * @field + * @type Function + * @example + */ + +/** + * The function to execute when Cancel is pressed. + * @name CKEDITOR.dialog.dialogDefinition.prototype.onCancel + * @field + * @type Function + * @example + */ + +/** + * The function to execute when the dialog is displayed for the first time. + * @name CKEDITOR.dialog.dialogDefinition.prototype.onLoad + * @field + * @type Function + * @example + */ + +/** + * This class is not really part of the API. It just illustrates the properties + * that developers can use to define and create dialog content pages. + * @name CKEDITOR.dialog.contentDefinition + * @constructor + * @example + * // There is no constructor for this class, the user just has to define an + * // object with the appropriate properties. + */ + +/** + * The id of the content page. + * @name CKEDITOR.dialog.contentDefinition.prototype.id + * @field + * @type String + * @example + */ + +/** + * The tab label of the content page. + * @name CKEDITOR.dialog.contentDefinition.prototype.label + * @field + * @type String + * @example + */ + +/** + * The popup message of the tab label. + * @name CKEDITOR.dialog.contentDefinition.prototype.title + * @field + * @type String + * @example + */ + +/** + * The CTRL hotkey for switching to the tab. + * @name CKEDITOR.dialog.contentDefinition.prototype.accessKey + * @field + * @type String + * @example + * contentDefinition.accessKey = 'Q'; // Switch to this page when CTRL-Q is pressed. + */ + +/** + * The UI elements contained in this content page, defined as an array of + * {@link CKEDITOR.dialog.uiElementDefinition} objects. + * @name CKEDITOR.dialog.contentDefinition.prototype.elements + * @field + * @type Array + * @example + */ + +/** + * This class is not really part of the API. It just illustrates the properties + * that developers can use to define and create dialog buttons. + * @name CKEDITOR.dialog.buttonDefinition + * @constructor + * @example + * // There is no constructor for this class, the user just has to define an + * // object with the appropriate properties. + */ + +/** + * The id of the dialog button. Required. + * @name CKEDITOR.dialog.buttonDefinition.prototype.id + * @type String + * @field + * @example + */ + +/** + * The label of the dialog button. Required. + * @name CKEDITOR.dialog.buttonDefinition.prototype.label + * @type String + * @field + * @example + */ + +/** + * The popup message of the dialog button. + * @name CKEDITOR.dialog.buttonDefinition.prototype.title + * @type String + * @field + * @example + */ + +/** + * The CTRL hotkey for the button. + * @name CKEDITOR.dialog.buttonDefinition.prototype.accessKey + * @type String + * @field + * @example + * exitButton.accessKey = 'X'; // Button will be pressed when user presses CTRL-X + */ + +/** + * Whether the button is disabled. + * @name CKEDITOR.dialog.buttonDefinition.prototype.disabled + * @type Boolean + * @field + * @default false + * @example + */ + +/** + * The function to execute when the button is clicked. + * @name CKEDITOR.dialog.buttonDefinition.prototype.onClick + * @type Function + * @field + * @example + */ + +/** + * This class is not really part of the API. It just illustrates the properties + * that developers can use to define and create dialog UI elements. + * @name CKEDITOR.dialog.uiElementDefinition + * @constructor + * @see CKEDITOR.ui.dialog.uiElement + * @example + * // There is no constructor for this class, the user just has to define an + * // object with the appropriate properties. + */ + +/** + * The id of the UI element. + * @name CKEDITOR.dialog.uiElementDefinition.prototype.id + * @field + * @type String + * @example + */ + +/** + * The type of the UI element. Required. + * @name CKEDITOR.dialog.uiElementDefinition.prototype.type + * @field + * @type String + * @example + */ + +/** + * The popup label of the UI element. + * @name CKEDITOR.dialog.uiElementDefinition.prototype.title + * @field + * @type String + * @example + */ + +/** + * CSS class names to append to the UI element. + * @name CKEDITOR.dialog.uiElementDefinition.prototype.className + * @field + * @type String + * @example + */ + +/** + * Inline CSS classes to append to the UI element. + * @name CKEDITOR.dialog.uiElementDefinition.prototype.style + * @field + * @type String + * @example + */ + +/** + * Function to execute the first time the UI element is displayed. + * @name CKEDITOR.dialog.uiElementDefinition.prototype.onLoad + * @field + * @type Function + * @example + */ + +/** + * Function to execute whenever the UI element's parent dialog is displayed. + * @name CKEDITOR.dialog.uiElementDefinition.prototype.onShow + * @field + * @type Function + * @example + */ + +/** + * Function to execute whenever the UI element's parent dialog is closed. + * @name CKEDITOR.dialog.uiElementDefinition.prototype.onHide + * @field + * @type Function + * @example + */ diff --git a/library/custom_template/ckeditor/_source/plugins/dialog/plugin.js b/library/custom_template/ckeditor/_source/plugins/dialog/plugin.js new file mode 100644 index 000000000..a380c5793 --- /dev/null +++ b/library/custom_template/ckeditor/_source/plugins/dialog/plugin.js @@ -0,0 +1,3138 @@ +/* +Copyright (c) 2003-2011, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.html or http://ckeditor.com/license +*/ + +/** + * @fileOverview The floating dialog plugin. + */ + +/** + * No resize for this dialog. + * @constant + */ +CKEDITOR.DIALOG_RESIZE_NONE = 0; + +/** + * Only allow horizontal resizing for this dialog, disable vertical resizing. + * @constant + */ +CKEDITOR.DIALOG_RESIZE_WIDTH = 1; + +/** + * Only allow vertical resizing for this dialog, disable horizontal resizing. + * @constant + */ +CKEDITOR.DIALOG_RESIZE_HEIGHT = 2; + +/* + * Allow the dialog to be resized in both directions. + * @constant + */ +CKEDITOR.DIALOG_RESIZE_BOTH = 3; + +(function() +{ + var cssLength = CKEDITOR.tools.cssLength; + function isTabVisible( tabId ) + { + return !!this._.tabs[ tabId ][ 0 ].$.offsetHeight; + } + + function getPreviousVisibleTab() + { + var tabId = this._.currentTabId, + length = this._.tabIdList.length, + tabIndex = CKEDITOR.tools.indexOf( this._.tabIdList, tabId ) + length; + + for ( var i = tabIndex - 1 ; i > tabIndex - length ; i-- ) + { + if ( isTabVisible.call( this, this._.tabIdList[ i % length ] ) ) + return this._.tabIdList[ i % length ]; + } + + return null; + } + + function getNextVisibleTab() + { + var tabId = this._.currentTabId, + length = this._.tabIdList.length, + tabIndex = CKEDITOR.tools.indexOf( this._.tabIdList, tabId ); + + for ( var i = tabIndex + 1 ; i < tabIndex + length ; i++ ) + { + if ( isTabVisible.call( this, this._.tabIdList[ i % length ] ) ) + return this._.tabIdList[ i % length ]; + } + + return null; + } + + + function clearOrRecoverTextInputValue( container, isRecover ) + { + var inputs = container.$.getElementsByTagName( 'input' ); + for ( var i = 0, length = inputs.length; i < length ; i++ ) + { + var item = new CKEDITOR.dom.element( inputs[ i ] ); + + if ( item.getAttribute( 'type' ).toLowerCase() == 'text' ) + { + if ( isRecover ) + { + item.setAttribute( 'value', item.getCustomData( 'fake_value' ) || '' ); + item.removeCustomData( 'fake_value' ); + } + else + { + item.setCustomData( 'fake_value', item.getAttribute( 'value' ) ); + item.setAttribute( 'value', '' ); + } + } + } + } + + /** + * This is the base class for runtime dialog objects. An instance of this + * class represents a single named dialog for a single editor instance. + * @param {Object} editor The editor which created the dialog. + * @param {String} dialogName The dialog's registered name. + * @constructor + * @example + * var dialogObj = new CKEDITOR.dialog( editor, 'smiley' ); + */ + CKEDITOR.dialog = function( editor, dialogName ) + { + // Load the dialog definition. + var definition = CKEDITOR.dialog._.dialogDefinitions[ dialogName ], + defaultDefinition = CKEDITOR.tools.clone( defaultDialogDefinition ), + buttonsOrder = editor.config.dialog_buttonsOrder || 'OS', + dir = editor.lang.dir; + + if ( ( buttonsOrder == 'OS' && CKEDITOR.env.mac ) || // The buttons in MacOS Apps are in reverse order (#4750) + ( buttonsOrder == 'rtl' && dir == 'ltr' ) || + ( buttonsOrder == 'ltr' && dir == 'rtl' ) ) + defaultDefinition.buttons.reverse(); + + + // Completes the definition with the default values. + definition = CKEDITOR.tools.extend( definition( editor ), defaultDefinition ); + + // Clone a functionally independent copy for this dialog. + definition = CKEDITOR.tools.clone( definition ); + + // Create a complex definition object, extending it with the API + // functions. + definition = new definitionObject( this, definition ); + + var doc = CKEDITOR.document; + + var themeBuilt = editor.theme.buildDialog( editor ); + + // Initialize some basic parameters. + this._ = + { + editor : editor, + element : themeBuilt.element, + name : dialogName, + contentSize : { width : 0, height : 0 }, + size : { width : 0, height : 0 }, + contents : {}, + buttons : {}, + accessKeyMap : {}, + + // Initialize the tab and page map. + tabs : {}, + tabIdList : [], + currentTabId : null, + currentTabIndex : null, + pageCount : 0, + lastTab : null, + tabBarMode : false, + + // Initialize the tab order array for input widgets. + focusList : [], + currentFocusIndex : 0, + hasFocus : false + }; + + this.parts = themeBuilt.parts; + + CKEDITOR.tools.setTimeout( function() + { + editor.fire( 'ariaWidget', this.parts.contents ); + }, + 0, this ); + + // Set the startup styles for the dialog, avoiding it enlarging the + // page size on the dialog creation. + this.parts.dialog.setStyles( + { + position : CKEDITOR.env.ie6Compat ? 'absolute' : 'fixed', + top : 0, + left: 0, + visibility : 'hidden' + }); + + // Call the CKEDITOR.event constructor to initialize this instance. + CKEDITOR.event.call( this ); + + // Fire the "dialogDefinition" event, making it possible to customize + // the dialog definition. + this.definition = definition = CKEDITOR.fire( 'dialogDefinition', + { + name : dialogName, + definition : definition + } + , editor ).definition; + + var tabsToRemove = {}; + // Cache tabs that should be removed. + if ( !( 'removeDialogTabs' in editor._ ) && editor.config.removeDialogTabs ) + { + var removeContents = editor.config.removeDialogTabs.split( ';' ); + + for ( i = 0; i < removeContents.length; i++ ) + { + var parts = removeContents[ i ].split( ':' ); + if ( parts.length == 2 ) + { + var removeDialogName = parts[ 0 ]; + if ( !tabsToRemove[ removeDialogName ] ) + tabsToRemove[ removeDialogName ] = []; + tabsToRemove[ removeDialogName ].push( parts[ 1 ] ); + } + } + editor._.removeDialogTabs = tabsToRemove; + } + + // Remove tabs of this dialog. + if ( editor._.removeDialogTabs && ( tabsToRemove = editor._.removeDialogTabs[ dialogName ] ) ) + { + for ( i = 0; i < tabsToRemove.length; i++ ) + definition.removeContents( tabsToRemove[ i ] ); + } + + // Initialize load, show, hide, ok and cancel events. + if ( definition.onLoad ) + this.on( 'load', definition.onLoad ); + + if ( definition.onShow ) + this.on( 'show', definition.onShow ); + + if ( definition.onHide ) + this.on( 'hide', definition.onHide ); + + if ( definition.onOk ) + { + this.on( 'ok', function( evt ) + { + // Dialog confirm might probably introduce content changes (#5415). + editor.fire( 'saveSnapshot' ); + setTimeout( function () { editor.fire( 'saveSnapshot' ); }, 0 ); + if ( definition.onOk.call( this, evt ) === false ) + evt.data.hide = false; + }); + } + + if ( definition.onCancel ) + { + this.on( 'cancel', function( evt ) + { + if ( definition.onCancel.call( this, evt ) === false ) + evt.data.hide = false; + }); + } + + var me = this; + + // Iterates over all items inside all content in the dialog, calling a + // function for each of them. + var iterContents = function( func ) + { + var contents = me._.contents, + stop = false; + + for ( var i in contents ) + { + for ( var j in contents[i] ) + { + stop = func.call( this, contents[i][j] ); + if ( stop ) + return; + } + } + }; + + this.on( 'ok', function( evt ) + { + iterContents( function( item ) + { + if ( item.validate ) + { + var isValid = item.validate( this ); + + if ( typeof isValid == 'string' ) + { + alert( isValid ); + isValid = false; + } + + if ( isValid === false ) + { + if ( item.select ) + item.select(); + else + item.focus(); + + evt.data.hide = false; + evt.stop(); + return true; + } + } + }); + }, this, null, 0 ); + + this.on( 'cancel', function( evt ) + { + iterContents( function( item ) + { + if ( item.isChanged() ) + { + if ( !confirm( editor.lang.common.confirmCancel ) ) + evt.data.hide = false; + return true; + } + }); + }, this, null, 0 ); + + this.parts.close.on( 'click', function( evt ) + { + if ( this.fire( 'cancel', { hide : true } ).hide !== false ) + this.hide(); + evt.data.preventDefault(); + }, this ); + + // Sort focus list according to tab order definitions. + function setupFocus() + { + var focusList = me._.focusList; + focusList.sort( function( a, b ) + { + // Mimics browser tab order logics; + if ( a.tabIndex != b.tabIndex ) + return b.tabIndex - a.tabIndex; + // Sort is not stable in some browsers, + // fall-back the comparator to 'focusIndex'; + else + return a.focusIndex - b.focusIndex; + }); + + var size = focusList.length; + for ( var i = 0; i < size; i++ ) + focusList[ i ].focusIndex = i; + } + + function changeFocus( forward ) + { + var focusList = me._.focusList, + offset = forward ? 1 : -1; + if ( focusList.length < 1 ) + return; + + var current = me._.currentFocusIndex; + + // Trigger the 'blur' event of any input element before anything, + // since certain UI updates may depend on it. + try + { + focusList[ current ].getInputElement().$.blur(); + } + catch( e ){} + + var startIndex = ( current + offset + focusList.length ) % focusList.length, + currentIndex = startIndex; + while ( !focusList[ currentIndex ].isFocusable() ) + { + currentIndex = ( currentIndex + offset + focusList.length ) % focusList.length; + if ( currentIndex == startIndex ) + break; + } + focusList[ currentIndex ].focus(); + + // Select whole field content. + if ( focusList[ currentIndex ].type == 'text' ) + focusList[ currentIndex ].select(); + } + + this.changeFocus = changeFocus; + + var processed; + + function focusKeydownHandler( evt ) + { + // If I'm not the top dialog, ignore. + if ( me != CKEDITOR.dialog._.currentTop ) + return; + + var keystroke = evt.data.getKeystroke(), + rtl = editor.lang.dir == 'rtl'; + + processed = 0; + if ( keystroke == 9 || keystroke == CKEDITOR.SHIFT + 9 ) + { + var shiftPressed = ( keystroke == CKEDITOR.SHIFT + 9 ); + + // Handling Tab and Shift-Tab. + if ( me._.tabBarMode ) + { + // Change tabs. + var nextId = shiftPressed ? getPreviousVisibleTab.call( me ) : getNextVisibleTab.call( me ); + me.selectPage( nextId ); + me._.tabs[ nextId ][ 0 ].focus(); + } + else + { + // Change the focus of inputs. + changeFocus( !shiftPressed ); + } + + processed = 1; + } + else if ( keystroke == CKEDITOR.ALT + 121 && !me._.tabBarMode && me.getPageCount() > 1 ) + { + // Alt-F10 puts focus into the current tab item in the tab bar. + me._.tabBarMode = true; + me._.tabs[ me._.currentTabId ][ 0 ].focus(); + processed = 1; + } + else if ( ( keystroke == 37 || keystroke == 39 ) && me._.tabBarMode ) + { + // Arrow keys - used for changing tabs. + nextId = ( keystroke == ( rtl ? 39 : 37 ) ? getPreviousVisibleTab.call( me ) : getNextVisibleTab.call( me ) ); + me.selectPage( nextId ); + me._.tabs[ nextId ][ 0 ].focus(); + processed = 1; + } + else if ( ( keystroke == 13 || keystroke == 32 ) && me._.tabBarMode ) + { + this.selectPage( this._.currentTabId ); + this._.tabBarMode = false; + this._.currentFocusIndex = -1; + changeFocus( true ); + processed = 1; + } + + if ( processed ) + { + evt.stop(); + evt.data.preventDefault(); + } + } + + function focusKeyPressHandler( evt ) + { + processed && evt.data.preventDefault(); + } + + var dialogElement = this._.element; + // Add the dialog keyboard handlers. + this.on( 'show', function() + { + dialogElement.on( 'keydown', focusKeydownHandler, this, null, 0 ); + // Some browsers instead, don't cancel key events in the keydown, but in the + // keypress. So we must do a longer trip in those cases. (#4531) + if ( CKEDITOR.env.opera || ( CKEDITOR.env.gecko && CKEDITOR.env.mac ) ) + dialogElement.on( 'keypress', focusKeyPressHandler, this ); + + } ); + this.on( 'hide', function() + { + dialogElement.removeListener( 'keydown', focusKeydownHandler ); + if ( CKEDITOR.env.opera || ( CKEDITOR.env.gecko && CKEDITOR.env.mac ) ) + dialogElement.removeListener( 'keypress', focusKeyPressHandler ); + } ); + this.on( 'iframeAdded', function( evt ) + { + var doc = new CKEDITOR.dom.document( evt.data.iframe.$.contentWindow.document ); + doc.on( 'keydown', focusKeydownHandler, this, null, 0 ); + } ); + + // Auto-focus logic in dialog. + this.on( 'show', function() + { + // Setup tabIndex on showing the dialog instead of on loading + // to allow dynamic tab order happen in dialog definition. + setupFocus(); + + if ( editor.config.dialog_startupFocusTab + && me._.pageCount > 1 ) + { + me._.tabBarMode = true; + me._.tabs[ me._.currentTabId ][ 0 ].focus(); + } + else if ( !this._.hasFocus ) + { + this._.currentFocusIndex = -1; + + // Decide where to put the initial focus. + if ( definition.onFocus ) + { + var initialFocus = definition.onFocus.call( this ); + // Focus the field that the user specified. + initialFocus && initialFocus.focus(); + } + // Focus the first field in layout order. + else + changeFocus( true ); + + /* + * IE BUG: If the initial focus went into a non-text element (e.g. button), + * then IE would still leave the caret inside the editing area. + */ + if ( this._.editor.mode == 'wysiwyg' && CKEDITOR.env.ie ) + { + var $selection = editor.document.$.selection, + $range = $selection.createRange(); + + if ( $range ) + { + if ( $range.parentElement && $range.parentElement().ownerDocument == editor.document.$ + || $range.item && $range.item( 0 ).ownerDocument == editor.document.$ ) + { + var $myRange = document.body.createTextRange(); + $myRange.moveToElementText( this.getElement().getFirst().$ ); + $myRange.collapse( true ); + $myRange.select(); + } + } + } + } + }, this, null, 0xffffffff ); + + // IE6 BUG: Text fields and text areas are only half-rendered the first time the dialog appears in IE6 (#2661). + // This is still needed after [2708] and [2709] because text fields in hidden TR tags are still broken. + if ( CKEDITOR.env.ie6Compat ) + { + this.on( 'load', function( evt ) + { + var outer = this.getElement(), + inner = outer.getFirst(); + inner.remove(); + inner.appendTo( outer ); + }, this ); + } + + initDragAndDrop( this ); + initResizeHandles( this ); + + // Insert the title. + ( new CKEDITOR.dom.text( definition.title, CKEDITOR.document ) ).appendTo( this.parts.title ); + + // Insert the tabs and contents. + for ( var i = 0 ; i < definition.contents.length ; i++ ) + { + var page = definition.contents[i]; + page && this.addPage( page ); + } + + this.parts[ 'tabs' ].on( 'click', function( evt ) + { + var target = evt.data.getTarget(); + // If we aren't inside a tab, bail out. + if ( target.hasClass( 'cke_dialog_tab' ) ) + { + // Get the ID of the tab, without the 'cke_' prefix and the unique number suffix. + var id = target.$.id; + this.selectPage( id.substring( 4, id.lastIndexOf( '_' ) ) ); + + if ( this._.tabBarMode ) + { + this._.tabBarMode = false; + this._.currentFocusIndex = -1; + changeFocus( true ); + } + evt.data.preventDefault(); + } + }, this ); + + // Insert buttons. + var buttonsHtml = [], + buttons = CKEDITOR.dialog._.uiElementBuilders.hbox.build( this, + { + type : 'hbox', + className : 'cke_dialog_footer_buttons', + widths : [], + children : definition.buttons + }, buttonsHtml ).getChild(); + this.parts.footer.setHtml( buttonsHtml.join( '' ) ); + + for ( i = 0 ; i < buttons.length ; i++ ) + this._.buttons[ buttons[i].id ] = buttons[i]; + }; + + // Focusable interface. Use it via dialog.addFocusable. + function Focusable( dialog, element, index ) + { + this.element = element; + this.focusIndex = index; + // TODO: support tabIndex for focusables. + this.tabIndex = 0; + this.isFocusable = function() + { + return !element.getAttribute( 'disabled' ) && element.isVisible(); + }; + this.focus = function() + { + dialog._.currentFocusIndex = this.focusIndex; + this.element.focus(); + }; + // Bind events + element.on( 'keydown', function( e ) + { + if ( e.data.getKeystroke() in { 32:1, 13:1 } ) + this.fire( 'click' ); + } ); + element.on( 'focus', function() + { + this.fire( 'mouseover' ); + } ); + element.on( 'blur', function() + { + this.fire( 'mouseout' ); + } ); + } + + CKEDITOR.dialog.prototype = + { + destroy : function() + { + this.hide(); + this._.element.remove(); + }, + + /** + * Resizes the dialog. + * @param {Number} width The width of the dialog in pixels. + * @param {Number} height The height of the dialog in pixels. + * @function + * @example + * dialogObj.resize( 800, 640 ); + */ + resize : (function() + { + return function( width, height ) + { + if ( this._.contentSize && this._.contentSize.width == width && this._.contentSize.height == height ) + return; + + CKEDITOR.dialog.fire( 'resize', + { + dialog : this, + skin : this._.editor.skinName, + width : width, + height : height + }, this._.editor ); + + this._.contentSize = { width : width, height : height }; + }; + })(), + + /** + * Gets the current size of the dialog in pixels. + * @returns {Object} An object with "width" and "height" properties. + * @example + * var width = dialogObj.getSize().width; + */ + getSize : function() + { + var element = this._.element.getFirst(); + return { width : element.$.offsetWidth || 0, height : element.$.offsetHeight || 0}; + }, + + /** + * Moves the dialog to an (x, y) coordinate relative to the window. + * @function + * @param {Number} x The target x-coordinate. + * @param {Number} y The target y-coordinate. + * @param {Boolean} save Flag indicate whether the dialog position should be remembered on next open up. + * @example + * dialogObj.move( 10, 40 ); + */ + move : (function() + { + var isFixed; + return function( x, y, save ) + { + // The dialog may be fixed positioned or absolute positioned. Ask the + // browser what is the current situation first. + var element = this._.element.getFirst(); + if ( isFixed === undefined ) + isFixed = element.getComputedStyle( 'position' ) == 'fixed'; + + if ( isFixed && this._.position && this._.position.x == x && this._.position.y == y ) + return; + + // Save the current position. + this._.position = { x : x, y : y }; + + // If not fixed positioned, add scroll position to the coordinates. + if ( !isFixed ) + { + var scrollPosition = CKEDITOR.document.getWindow().getScrollPosition(); + x += scrollPosition.x; + y += scrollPosition.y; + } + + element.setStyles( + { + 'left' : ( x > 0 ? x : 0 ) + 'px', + 'top' : ( y > 0 ? y : 0 ) + 'px' + }); + + save && ( this._.moved = 1 ); + }; + })(), + + /** + * Gets the dialog's position in the window. + * @returns {Object} An object with "x" and "y" properties. + * @example + * var dialogX = dialogObj.getPosition().x; + */ + getPosition : function(){ return CKEDITOR.tools.extend( {}, this._.position ); }, + + /** + * Shows the dialog box. + * @example + * dialogObj.show(); + */ + show : function() + { + // Insert the dialog's element to the root document. + var element = this._.element; + var definition = this.definition; + if ( !( element.getParent() && element.getParent().equals( CKEDITOR.document.getBody() ) ) ) + element.appendTo( CKEDITOR.document.getBody() ); + else + element.setStyle( 'display', 'block' ); + + // FIREFOX BUG: Fix vanishing caret for Firefox 2 or Gecko 1.8. + if ( CKEDITOR.env.gecko && CKEDITOR.env.version < 10900 ) + { + var dialogElement = this.parts.dialog; + dialogElement.setStyle( 'position', 'absolute' ); + setTimeout( function() + { + dialogElement.setStyle( 'position', 'fixed' ); + }, 0 ); + } + + + // First, set the dialog to an appropriate size. + this.resize( this._.contentSize && this._.contentSize.width || definition.minWidth, + this._.contentSize && this._.contentSize.height || definition.minHeight ); + + // Reset all inputs back to their default value. + this.reset(); + + // Select the first tab by default. + this.selectPage( this.definition.contents[0].id ); + + // Set z-index. + if ( CKEDITOR.dialog._.currentZIndex === null ) + CKEDITOR.dialog._.currentZIndex = this._.editor.config.baseFloatZIndex; + this._.element.getFirst().setStyle( 'z-index', CKEDITOR.dialog._.currentZIndex += 10 ); + + // Maintain the dialog ordering and dialog cover. + // Also register key handlers if first dialog. + if ( CKEDITOR.dialog._.currentTop === null ) + { + CKEDITOR.dialog._.currentTop = this; + this._.parentDialog = null; + showCover( this._.editor ); + + element.on( 'keydown', accessKeyDownHandler ); + element.on( CKEDITOR.env.opera ? 'keypress' : 'keyup', accessKeyUpHandler ); + + // Prevent some keys from bubbling up. (#4269) + for ( var event in { keyup :1, keydown :1, keypress :1 } ) + element.on( event, preventKeyBubbling ); + } + else + { + this._.parentDialog = CKEDITOR.dialog._.currentTop; + var parentElement = this._.parentDialog.getElement().getFirst(); + parentElement.$.style.zIndex -= Math.floor( this._.editor.config.baseFloatZIndex / 2 ); + CKEDITOR.dialog._.currentTop = this; + } + + // Register the Esc hotkeys. + registerAccessKey( this, this, '\x1b', null, function() + { + this.getButton( 'cancel' ) && this.getButton( 'cancel' ).click(); + } ); + + // Reset the hasFocus state. + this._.hasFocus = false; + + CKEDITOR.tools.setTimeout( function() + { + this.layout(); + this.parts.dialog.setStyle( 'visibility', '' ); + + // Execute onLoad for the first show. + this.fireOnce( 'load', {} ); + CKEDITOR.ui.fire( 'ready', this ); + + this.fire( 'show', {} ); + this._.editor.fire( 'dialogShow', this ); + + // Save the initial values of the dialog. + this.foreach( function( contentObj ) { contentObj.setInitValue && contentObj.setInitValue(); } ); + + }, + 100, this ); + }, + + /** + * Rearrange the dialog to its previous position or the middle of the window. + * @since 3.5 + */ + layout : function() + { + var viewSize = CKEDITOR.document.getWindow().getViewPaneSize(), + dialogSize = this.getSize(); + + this.move( this._.moved ? this._.position.x : ( viewSize.width - dialogSize.width ) / 2, + this._.moved ? this._.position.y : ( viewSize.height - dialogSize.height ) / 2 ); + }, + + /** + * Executes a function for each UI element. + * @param {Function} fn Function to execute for each UI element. + * @returns {CKEDITOR.dialog} The current dialog object. + */ + foreach : function( fn ) + { + for ( var i in this._.contents ) + { + for ( var j in this._.contents[i] ) + fn( this._.contents[i][j] ); + } + return this; + }, + + /** + * Resets all input values in the dialog. + * @example + * dialogObj.reset(); + * @returns {CKEDITOR.dialog} The current dialog object. + */ + reset : (function() + { + var fn = function( widget ){ if ( widget.reset ) widget.reset( 1 ); }; + return function(){ this.foreach( fn ); return this; }; + })(), + + setupContent : function() + { + var args = arguments; + this.foreach( function( widget ) + { + if ( widget.setup ) + widget.setup.apply( widget, args ); + }); + }, + + commitContent : function() + { + var args = arguments; + this.foreach( function( widget ) + { + if ( widget.commit ) + widget.commit.apply( widget, args ); + }); + }, + + /** + * Hides the dialog box. + * @example + * dialogObj.hide(); + */ + hide : function() + { + if ( !this.parts.dialog.isVisible() ) + return; + + this.fire( 'hide', {} ); + this._.editor.fire( 'dialogHide', this ); + var element = this._.element; + element.setStyle( 'display', 'none' ); + this.parts.dialog.setStyle( 'visibility', 'hidden' ); + // Unregister all access keys associated with this dialog. + unregisterAccessKey( this ); + + // Close any child(top) dialogs first. + while( CKEDITOR.dialog._.currentTop != this ) + CKEDITOR.dialog._.currentTop.hide(); + + // Maintain dialog ordering and remove cover if needed. + if ( !this._.parentDialog ) + hideCover(); + else + { + var parentElement = this._.parentDialog.getElement().getFirst(); + parentElement.setStyle( 'z-index', parseInt( parentElement.$.style.zIndex, 10 ) + Math.floor( this._.editor.config.baseFloatZIndex / 2 ) ); + } + CKEDITOR.dialog._.currentTop = this._.parentDialog; + + // Deduct or clear the z-index. + if ( !this._.parentDialog ) + { + CKEDITOR.dialog._.currentZIndex = null; + + // Remove access key handlers. + element.removeListener( 'keydown', accessKeyDownHandler ); + element.removeListener( CKEDITOR.env.opera ? 'keypress' : 'keyup', accessKeyUpHandler ); + + // Remove bubbling-prevention handler. (#4269) + for ( var event in { keyup :1, keydown :1, keypress :1 } ) + element.removeListener( event, preventKeyBubbling ); + + var editor = this._.editor; + editor.focus(); + + if ( editor.mode == 'wysiwyg' && CKEDITOR.env.ie ) + { + var selection = editor.getSelection(); + selection && selection.unlock( true ); + } + } + else + CKEDITOR.dialog._.currentZIndex -= 10; + + delete this._.parentDialog; + // Reset the initial values of the dialog. + this.foreach( function( contentObj ) { contentObj.resetInitValue && contentObj.resetInitValue(); } ); + }, + + /** + * Adds a tabbed page into the dialog. + * @param {Object} contents Content definition. + * @example + */ + addPage : function( contents ) + { + var pageHtml = [], + titleHtml = contents.label ? ' title="' + CKEDITOR.tools.htmlEncode( contents.label ) + '"' : '', + elements = contents.elements, + vbox = CKEDITOR.dialog._.uiElementBuilders.vbox.build( this, + { + type : 'vbox', + className : 'cke_dialog_page_contents', + children : contents.elements, + expand : !!contents.expand, + padding : contents.padding, + style : contents.style || 'width: 100%;' + }, pageHtml ); + + // Create the HTML for the tab and the content block. + var page = CKEDITOR.dom.element.createFromHtml( pageHtml.join( '' ) ); + page.setAttribute( 'role', 'tabpanel' ); + + var env = CKEDITOR.env; + var tabId = 'cke_' + contents.id + '_' + CKEDITOR.tools.getNextNumber(), + tab = CKEDITOR.dom.element.createFromHtml( [ + ' 0 ? ' cke_last' : 'cke_first' ), + titleHtml, + ( !!contents.hidden ? ' style="display:none"' : '' ), + ' id="', tabId, '"', + env.gecko && env.version >= 10900 && !env.hc ? '' : ' href="javascript:void(0)"', + ' tabIndex="-1"', + ' hidefocus="true"', + ' role="tab">', + contents.label, + '' + ].join( '' ) ); + + page.setAttribute( 'aria-labelledby', tabId ); + + // Take records for the tabs and elements created. + this._.tabs[ contents.id ] = [ tab, page ]; + this._.tabIdList.push( contents.id ); + !contents.hidden && this._.pageCount++; + this._.lastTab = tab; + this.updateStyle(); + + var contentMap = this._.contents[ contents.id ] = {}, + cursor, + children = vbox.getChild(); + + while ( ( cursor = children.shift() ) ) + { + contentMap[ cursor.id ] = cursor; + if ( typeof( cursor.getChild ) == 'function' ) + children.push.apply( children, cursor.getChild() ); + } + + // Attach the DOM nodes. + + page.setAttribute( 'name', contents.id ); + page.appendTo( this.parts.contents ); + + tab.unselectable(); + this.parts.tabs.append( tab ); + + // Add access key handlers if access key is defined. + if ( contents.accessKey ) + { + registerAccessKey( this, this, 'CTRL+' + contents.accessKey, + tabAccessKeyDown, tabAccessKeyUp ); + this._.accessKeyMap[ 'CTRL+' + contents.accessKey ] = contents.id; + } + }, + + /** + * Activates a tab page in the dialog by its id. + * @param {String} id The id of the dialog tab to be activated. + * @example + * dialogObj.selectPage( 'tab_1' ); + */ + selectPage : function( id ) + { + if ( this._.currentTabId == id ) + return; + + // Returning true means that the event has been canceled + if ( this.fire( 'selectPage', { page : id, currentPage : this._.currentTabId } ) === true ) + return; + + // Hide the non-selected tabs and pages. + for ( var i in this._.tabs ) + { + var tab = this._.tabs[i][0], + page = this._.tabs[i][1]; + if ( i != id ) + { + tab.removeClass( 'cke_dialog_tab_selected' ); + page.hide(); + } + page.setAttribute( 'aria-hidden', i != id ); + } + + var selected = this._.tabs[ id ]; + selected[ 0 ].addClass( 'cke_dialog_tab_selected' ); + + // [IE] an invisible input[type='text'] will enlarge it's width + // if it's value is long when it shows, so we clear it's value + // before it shows and then recover it (#5649) + if ( CKEDITOR.env.ie6Compat || CKEDITOR.env.ie7Compat ) + { + clearOrRecoverTextInputValue( selected[ 1 ] ); + selected[ 1 ].show(); + setTimeout( function() + { + clearOrRecoverTextInputValue( selected[ 1 ], 1 ); + }, 0 ); + } + else + selected[ 1 ].show(); + + this._.currentTabId = id; + this._.currentTabIndex = CKEDITOR.tools.indexOf( this._.tabIdList, id ); + }, + + // Dialog state-specific style updates. + updateStyle : function() + { + // If only a single page shown, a different style is used in the central pane. + this.parts.dialog[ ( this._.pageCount === 1 ? 'add' : 'remove' ) + 'Class' ]( 'cke_single_page' ); + }, + + /** + * Hides a page's tab away from the dialog. + * @param {String} id The page's Id. + * @example + * dialog.hidePage( 'tab_3' ); + */ + hidePage : function( id ) + { + var tab = this._.tabs[id] && this._.tabs[id][0]; + if ( !tab || this._.pageCount == 1 || !tab.isVisible() ) + return; + // Switch to other tab first when we're hiding the active tab. + else if ( id == this._.currentTabId ) + this.selectPage( getPreviousVisibleTab.call( this ) ); + + tab.hide(); + this._.pageCount--; + this.updateStyle(); + }, + + /** + * Unhides a page's tab. + * @param {String} id The page's Id. + * @example + * dialog.showPage( 'tab_2' ); + */ + showPage : function( id ) + { + var tab = this._.tabs[id] && this._.tabs[id][0]; + if ( !tab ) + return; + tab.show(); + this._.pageCount++; + this.updateStyle(); + }, + + /** + * Gets the root DOM element of the dialog. + * @returns {CKEDITOR.dom.element} The <span> element containing this dialog. + * @example + * var dialogElement = dialogObj.getElement().getFirst(); + * dialogElement.setStyle( 'padding', '5px' ); + */ + getElement : function() + { + return this._.element; + }, + + /** + * Gets the name of the dialog. + * @returns {String} The name of this dialog. + * @example + * var dialogName = dialogObj.getName(); + */ + getName : function() + { + return this._.name; + }, + + /** + * Gets a dialog UI element object from a dialog page. + * @param {String} pageId id of dialog page. + * @param {String} elementId id of UI element. + * @example + * @returns {CKEDITOR.ui.dialog.uiElement} The dialog UI element. + */ + getContentElement : function( pageId, elementId ) + { + var page = this._.contents[ pageId ]; + return page && page[ elementId ]; + }, + + /** + * Gets the value of a dialog UI element. + * @param {String} pageId id of dialog page. + * @param {String} elementId id of UI element. + * @example + * @returns {Object} The value of the UI element. + */ + getValueOf : function( pageId, elementId ) + { + return this.getContentElement( pageId, elementId ).getValue(); + }, + + /** + * Sets the value of a dialog UI element. + * @param {String} pageId id of the dialog page. + * @param {String} elementId id of the UI element. + * @param {Object} value The new value of the UI element. + * @example + */ + setValueOf : function( pageId, elementId, value ) + { + return this.getContentElement( pageId, elementId ).setValue( value ); + }, + + /** + * Gets the UI element of a button in the dialog's button row. + * @param {String} id The id of the button. + * @example + * @returns {CKEDITOR.ui.dialog.button} The button object. + */ + getButton : function( id ) + { + return this._.buttons[ id ]; + }, + + /** + * Simulates a click to a dialog button in the dialog's button row. + * @param {String} id The id of the button. + * @example + * @returns The return value of the dialog's "click" event. + */ + click : function( id ) + { + return this._.buttons[ id ].click(); + }, + + /** + * Disables a dialog button. + * @param {String} id The id of the button. + * @example + */ + disableButton : function( id ) + { + return this._.buttons[ id ].disable(); + }, + + /** + * Enables a dialog button. + * @param {String} id The id of the button. + * @example + */ + enableButton : function( id ) + { + return this._.buttons[ id ].enable(); + }, + + /** + * Gets the number of pages in the dialog. + * @returns {Number} Page count. + */ + getPageCount : function() + { + return this._.pageCount; + }, + + /** + * Gets the editor instance which opened this dialog. + * @returns {CKEDITOR.editor} Parent editor instances. + */ + getParentEditor : function() + { + return this._.editor; + }, + + /** + * Gets the element that was selected when opening the dialog, if any. + * @returns {CKEDITOR.dom.element} The element that was selected, or null. + */ + getSelectedElement : function() + { + return this.getParentEditor().getSelection().getSelectedElement(); + }, + + /** + * Adds element to dialog's focusable list. + * + * @param {CKEDITOR.dom.element} element + * @param {Number} [index] + */ + addFocusable: function( element, index ) { + if ( typeof index == 'undefined' ) + { + index = this._.focusList.length; + this._.focusList.push( new Focusable( this, element, index ) ); + } + else + { + this._.focusList.splice( index, 0, new Focusable( this, element, index ) ); + for ( var i = index + 1 ; i < this._.focusList.length ; i++ ) + this._.focusList[ i ].focusIndex++; + } + } + }; + + CKEDITOR.tools.extend( CKEDITOR.dialog, + /** + * @lends CKEDITOR.dialog + */ + { + /** + * Registers a dialog. + * @param {String} name The dialog's name. + * @param {Function|String} dialogDefinition + * A function returning the dialog's definition, or the URL to the .js file holding the function. + * The function should accept an argument "editor" which is the current editor instance, and + * return an object conforming to {@link CKEDITOR.dialog.dialogDefinition}. + * @example + * @see CKEDITOR.dialog.dialogDefinition + */ + add : function( name, dialogDefinition ) + { + // Avoid path registration from multiple instances override definition. + if ( !this._.dialogDefinitions[name] + || typeof dialogDefinition == 'function' ) + this._.dialogDefinitions[name] = dialogDefinition; + }, + + exists : function( name ) + { + return !!this._.dialogDefinitions[ name ]; + }, + + getCurrent : function() + { + return CKEDITOR.dialog._.currentTop; + }, + + /** + * The default OK button for dialogs. Fires the "ok" event and closes the dialog if the event succeeds. + * @static + * @field + * @example + * @type Function + */ + okButton : (function() + { + var retval = function( editor, override ) + { + override = override || {}; + return CKEDITOR.tools.extend( { + id : 'ok', + type : 'button', + label : editor.lang.common.ok, + 'class' : 'cke_dialog_ui_button_ok', + onClick : function( evt ) + { + var dialog = evt.data.dialog; + if ( dialog.fire( 'ok', { hide : true } ).hide !== false ) + dialog.hide(); + } + }, override, true ); + }; + retval.type = 'button'; + retval.override = function( override ) + { + return CKEDITOR.tools.extend( function( editor ){ return retval( editor, override ); }, + { type : 'button' }, true ); + }; + return retval; + })(), + + /** + * The default cancel button for dialogs. Fires the "cancel" event and closes the dialog if no UI element value changed. + * @static + * @field + * @example + * @type Function + */ + cancelButton : (function() + { + var retval = function( editor, override ) + { + override = override || {}; + return CKEDITOR.tools.extend( { + id : 'cancel', + type : 'button', + label : editor.lang.common.cancel, + 'class' : 'cke_dialog_ui_button_cancel', + onClick : function( evt ) + { + var dialog = evt.data.dialog; + if ( dialog.fire( 'cancel', { hide : true } ).hide !== false ) + dialog.hide(); + } + }, override, true ); + }; + retval.type = 'button'; + retval.override = function( override ) + { + return CKEDITOR.tools.extend( function( editor ){ return retval( editor, override ); }, + { type : 'button' }, true ); + }; + return retval; + })(), + + /** + * Registers a dialog UI element. + * @param {String} typeName The name of the UI element. + * @param {Function} builder The function to build the UI element. + * @example + */ + addUIElement : function( typeName, builder ) + { + this._.uiElementBuilders[ typeName ] = builder; + } + }); + + CKEDITOR.dialog._ = + { + uiElementBuilders : {}, + + dialogDefinitions : {}, + + currentTop : null, + + currentZIndex : null + }; + + // "Inherit" (copy actually) from CKEDITOR.event. + CKEDITOR.event.implementOn( CKEDITOR.dialog ); + CKEDITOR.event.implementOn( CKEDITOR.dialog.prototype, true ); + + var defaultDialogDefinition = + { + resizable : CKEDITOR.DIALOG_RESIZE_BOTH, + minWidth : 600, + minHeight : 400, + buttons : [ CKEDITOR.dialog.okButton, CKEDITOR.dialog.cancelButton ] + }; + + // Tool function used to return an item from an array based on its id + // property. + var getById = function( array, id, recurse ) + { + for ( var i = 0, item ; ( item = array[ i ] ) ; i++ ) + { + if ( item.id == id ) + return item; + if ( recurse && item[ recurse ] ) + { + var retval = getById( item[ recurse ], id, recurse ) ; + if ( retval ) + return retval; + } + } + return null; + }; + + // Tool function used to add an item into an array. + var addById = function( array, newItem, nextSiblingId, recurse, nullIfNotFound ) + { + if ( nextSiblingId ) + { + for ( var i = 0, item ; ( item = array[ i ] ) ; i++ ) + { + if ( item.id == nextSiblingId ) + { + array.splice( i, 0, newItem ); + return newItem; + } + + if ( recurse && item[ recurse ] ) + { + var retval = addById( item[ recurse ], newItem, nextSiblingId, recurse, true ); + if ( retval ) + return retval; + } + } + + if ( nullIfNotFound ) + return null; + } + + array.push( newItem ); + return newItem; + }; + + // Tool function used to remove an item from an array based on its id. + var removeById = function( array, id, recurse ) + { + for ( var i = 0, item ; ( item = array[ i ] ) ; i++ ) + { + if ( item.id == id ) + return array.splice( i, 1 ); + if ( recurse && item[ recurse ] ) + { + var retval = removeById( item[ recurse ], id, recurse ); + if ( retval ) + return retval; + } + } + return null; + }; + + /** + * This class is not really part of the API. It is the "definition" property value + * passed to "dialogDefinition" event handlers. + * @constructor + * @name CKEDITOR.dialog.dialogDefinitionObject + * @extends CKEDITOR.dialog.dialogDefinition + * @example + * CKEDITOR.on( 'dialogDefinition', function( evt ) + * { + * var definition = evt.data.definition; + * var content = definition.getContents( 'page1' ); + * ... + * } ); + */ + var definitionObject = function( dialog, dialogDefinition ) + { + // TODO : Check if needed. + this.dialog = dialog; + + // Transform the contents entries in contentObjects. + var contents = dialogDefinition.contents; + for ( var i = 0, content ; ( content = contents[i] ) ; i++ ) + contents[ i ] = content && new contentObject( dialog, content ); + + CKEDITOR.tools.extend( this, dialogDefinition ); + }; + + definitionObject.prototype = + /** @lends CKEDITOR.dialog.dialogDefinitionObject.prototype */ + { + /** + * Gets a content definition. + * @param {String} id The id of the content definition. + * @returns {CKEDITOR.dialog.contentDefinition} The content definition + * matching id. + */ + getContents : function( id ) + { + return getById( this.contents, id ); + }, + + /** + * Gets a button definition. + * @param {String} id The id of the button definition. + * @returns {CKEDITOR.dialog.buttonDefinition} The button definition + * matching id. + */ + getButton : function( id ) + { + return getById( this.buttons, id ); + }, + + /** + * Adds a content definition object under this dialog definition. + * @param {CKEDITOR.dialog.contentDefinition} contentDefinition The + * content definition. + * @param {String} [nextSiblingId] The id of an existing content + * definition which the new content definition will be inserted + * before. Omit if the new content definition is to be inserted as + * the last item. + * @returns {CKEDITOR.dialog.contentDefinition} The inserted content + * definition. + */ + addContents : function( contentDefinition, nextSiblingId ) + { + return addById( this.contents, contentDefinition, nextSiblingId ); + }, + + /** + * Adds a button definition object under this dialog definition. + * @param {CKEDITOR.dialog.buttonDefinition} buttonDefinition The + * button definition. + * @param {String} [nextSiblingId] The id of an existing button + * definition which the new button definition will be inserted + * before. Omit if the new button definition is to be inserted as + * the last item. + * @returns {CKEDITOR.dialog.buttonDefinition} The inserted button + * definition. + */ + addButton : function( buttonDefinition, nextSiblingId ) + { + return addById( this.buttons, buttonDefinition, nextSiblingId ); + }, + + /** + * Removes a content definition from this dialog definition. + * @param {String} id The id of the content definition to be removed. + * @returns {CKEDITOR.dialog.contentDefinition} The removed content + * definition. + */ + removeContents : function( id ) + { + removeById( this.contents, id ); + }, + + /** + * Removes a button definition from the dialog definition. + * @param {String} id The id of the button definition to be removed. + * @returns {CKEDITOR.dialog.buttonDefinition} The removed button + * definition. + */ + removeButton : function( id ) + { + removeById( this.buttons, id ); + } + }; + + /** + * This class is not really part of the API. It is the template of the + * objects representing content pages inside the + * CKEDITOR.dialog.dialogDefinitionObject. + * @constructor + * @name CKEDITOR.dialog.contentDefinitionObject + * @example + * CKEDITOR.on( 'dialogDefinition', function( evt ) + * { + * var definition = evt.data.definition; + * var content = definition.getContents( 'page1' ); + * content.remove( 'textInput1' ); + * ... + * } ); + */ + function contentObject( dialog, contentDefinition ) + { + this._ = + { + dialog : dialog + }; + + CKEDITOR.tools.extend( this, contentDefinition ); + } + + contentObject.prototype = + /** @lends CKEDITOR.dialog.contentDefinitionObject.prototype */ + { + /** + * Gets a UI element definition under the content definition. + * @param {String} id The id of the UI element definition. + * @returns {CKEDITOR.dialog.uiElementDefinition} + */ + get : function( id ) + { + return getById( this.elements, id, 'children' ); + }, + + /** + * Adds a UI element definition to the content definition. + * @param {CKEDITOR.dialog.uiElementDefinition} elementDefinition The + * UI elemnet definition to be added. + * @param {String} nextSiblingId The id of an existing UI element + * definition which the new UI element definition will be inserted + * before. Omit if the new button definition is to be inserted as + * the last item. + * @returns {CKEDITOR.dialog.uiElementDefinition} The element + * definition inserted. + */ + add : function( elementDefinition, nextSiblingId ) + { + return addById( this.elements, elementDefinition, nextSiblingId, 'children' ); + }, + + /** + * Removes a UI element definition from the content definition. + * @param {String} id The id of the UI element definition to be + * removed. + * @returns {CKEDITOR.dialog.uiElementDefinition} The element + * definition removed. + * @example + */ + remove : function( id ) + { + removeById( this.elements, id, 'children' ); + } + }; + + function initDragAndDrop( dialog ) + { + var lastCoords = null, + abstractDialogCoords = null, + element = dialog.getElement().getFirst(), + editor = dialog.getParentEditor(), + magnetDistance = editor.config.dialog_magnetDistance, + margins = editor.skin.margins || [ 0, 0, 0, 0 ]; + + if ( typeof magnetDistance == 'undefined' ) + magnetDistance = 20; + + function mouseMoveHandler( evt ) + { + var dialogSize = dialog.getSize(), + viewPaneSize = CKEDITOR.document.getWindow().getViewPaneSize(), + x = evt.data.$.screenX, + y = evt.data.$.screenY, + dx = x - lastCoords.x, + dy = y - lastCoords.y, + realX, realY; + + lastCoords = { x : x, y : y }; + abstractDialogCoords.x += dx; + abstractDialogCoords.y += dy; + + if ( abstractDialogCoords.x + margins[3] < magnetDistance ) + realX = - margins[3]; + else if ( abstractDialogCoords.x - margins[1] > viewPaneSize.width - dialogSize.width - magnetDistance ) + realX = viewPaneSize.width - dialogSize.width + ( editor.lang.dir == 'rtl' ? 0 : margins[1] ); + else + realX = abstractDialogCoords.x; + + if ( abstractDialogCoords.y + margins[0] < magnetDistance ) + realY = - margins[0]; + else if ( abstractDialogCoords.y - margins[2] > viewPaneSize.height - dialogSize.height - magnetDistance ) + realY = viewPaneSize.height - dialogSize.height + margins[2]; + else + realY = abstractDialogCoords.y; + + dialog.move( realX, realY, 1 ); + + evt.data.preventDefault(); + } + + function mouseUpHandler( evt ) + { + CKEDITOR.document.removeListener( 'mousemove', mouseMoveHandler ); + CKEDITOR.document.removeListener( 'mouseup', mouseUpHandler ); + + if ( CKEDITOR.env.ie6Compat ) + { + var coverDoc = currentCover.getChild( 0 ).getFrameDocument(); + coverDoc.removeListener( 'mousemove', mouseMoveHandler ); + coverDoc.removeListener( 'mouseup', mouseUpHandler ); + } + } + + dialog.parts.title.on( 'mousedown', function( evt ) + { + lastCoords = { x : evt.data.$.screenX, y : evt.data.$.screenY }; + + CKEDITOR.document.on( 'mousemove', mouseMoveHandler ); + CKEDITOR.document.on( 'mouseup', mouseUpHandler ); + abstractDialogCoords = dialog.getPosition(); + + if ( CKEDITOR.env.ie6Compat ) + { + var coverDoc = currentCover.getChild( 0 ).getFrameDocument(); + coverDoc.on( 'mousemove', mouseMoveHandler ); + coverDoc.on( 'mouseup', mouseUpHandler ); + } + + evt.data.preventDefault(); + }, dialog ); + } + + function initResizeHandles( dialog ) + { + var def = dialog.definition, + resizable = def.resizable; + + if ( resizable == CKEDITOR.DIALOG_RESIZE_NONE ) + return; + + var editor = dialog.getParentEditor(); + var wrapperWidth, wrapperHeight, + viewSize, origin, startSize, + dialogCover; + + function positionDialog( right ) + { + // Maintain righthand sizing in RTL. + if ( dialog._.moved && editor.lang.dir == 'rtl' ) + { + var element = dialog._.element.getFirst(); + element.setStyle( 'right', right + "px" ); + element.removeStyle( 'left' ); + } + else if ( !dialog._.moved ) + dialog.layout(); + } + + var mouseDownFn = CKEDITOR.tools.addFunction( function( $event ) + { + startSize = dialog.getSize(); + + var content = dialog.parts.contents, + iframeDialog = content.$.getElementsByTagName( 'iframe' ).length; + + // Shim to help capturing "mousemove" over iframe. + if ( iframeDialog ) + { + dialogCover = CKEDITOR.dom.element.createFromHtml( '
        ' ); + content.append( dialogCover ); + } + + // Calculate the offset between content and chrome size. + wrapperHeight = startSize.height - dialog.parts.contents.getSize( 'height', ! ( CKEDITOR.env.gecko || CKEDITOR.env.opera || CKEDITOR.env.ie && CKEDITOR.env.quirks ) ); + wrapperWidth = startSize.width - dialog.parts.contents.getSize( 'width', 1 ); + + origin = { x : $event.screenX, y : $event.screenY }; + + viewSize = CKEDITOR.document.getWindow().getViewPaneSize(); + + CKEDITOR.document.on( 'mousemove', mouseMoveHandler ); + CKEDITOR.document.on( 'mouseup', mouseUpHandler ); + + if ( CKEDITOR.env.ie6Compat ) + { + var coverDoc = currentCover.getChild( 0 ).getFrameDocument(); + coverDoc.on( 'mousemove', mouseMoveHandler ); + coverDoc.on( 'mouseup', mouseUpHandler ); + } + + $event.preventDefault && $event.preventDefault(); + }); + + // Prepend the grip to the dialog. + dialog.on( 'load', function() + { + var direction = ''; + if ( resizable == CKEDITOR.DIALOG_RESIZE_WIDTH ) + direction = ' cke_resizer_horizontal'; + else if ( resizable == CKEDITOR.DIALOG_RESIZE_HEIGHT ) + direction = ' cke_resizer_vertical'; + var resizer = CKEDITOR.dom.element.createFromHtml( '
        ' ); + dialog.parts.footer.append( resizer, 1 ); + }); + editor.on( 'destroy', function() { CKEDITOR.tools.removeFunction( mouseDownFn ); } ); + + function mouseMoveHandler( evt ) + { + var rtl = editor.lang.dir == 'rtl', + dx = ( evt.data.$.screenX - origin.x ) * ( rtl ? -1 : 1 ), + dy = evt.data.$.screenY - origin.y, + width = startSize.width, + height = startSize.height, + internalWidth = width + dx * ( dialog._.moved ? 1 : 2 ), + internalHeight = height + dy * ( dialog._.moved ? 1 : 2 ), + element = dialog._.element.getFirst(), + right = rtl && element.getComputedStyle( 'right' ), + position = dialog.getPosition(); + + // IE might return "auto", we need exact position. + if ( right ) + right = right == 'auto' ? viewSize.width - ( position.x || 0 ) - element.getSize( 'width' ) : parseInt( right, 10 ); + + if ( position.y + internalHeight > viewSize.height ) + internalHeight = viewSize.height - position.y; + + if ( ( rtl ? right : position.x ) + internalWidth > viewSize.width ) + internalWidth = viewSize.width - ( rtl ? right : position.x ); + + // Make sure the dialog will not be resized to the wrong side when it's in the leftmost position for RTL. + if ( ( resizable == CKEDITOR.DIALOG_RESIZE_WIDTH || resizable == CKEDITOR.DIALOG_RESIZE_BOTH ) && !( rtl && dx > 0 && !position.x ) ) + width = Math.max( def.minWidth || 0, internalWidth - wrapperWidth ); + + if ( resizable == CKEDITOR.DIALOG_RESIZE_HEIGHT || resizable == CKEDITOR.DIALOG_RESIZE_BOTH ) + height = Math.max( def.minHeight || 0, internalHeight - wrapperHeight ); + + dialog.resize( width, height ); + // The right property might get broken during resizing, so computing it before the resizing. + positionDialog( right ); + + evt.data.preventDefault(); + } + + function mouseUpHandler() + { + CKEDITOR.document.removeListener( 'mouseup', mouseUpHandler ); + CKEDITOR.document.removeListener( 'mousemove', mouseMoveHandler ); + + if ( dialogCover ) + { + dialogCover.remove(); + dialogCover = null; + } + + if ( CKEDITOR.env.ie6Compat ) + { + var coverDoc = currentCover.getChild( 0 ).getFrameDocument(); + coverDoc.removeListener( 'mouseup', mouseUpHandler ); + coverDoc.removeListener( 'mousemove', mouseMoveHandler ); + } + + // Switch back to use the left property, if RTL is used. + if ( editor.lang.dir == 'rtl' ) + { + var element = dialog._.element.getFirst(), + left = element.getComputedStyle( 'left' ); + + // IE might return "auto", we need exact position. + if ( left == 'auto' ) + left = viewSize.width - parseInt( element.getStyle( 'right' ), 10 ) - dialog.getSize().width; + else + left = parseInt( left, 10 ); + + element.removeStyle( 'right' ); + // Make sure the left property gets applied, even if it is the same as previously. + dialog._.position.x += 1; + dialog.move( left, dialog._.position.y ); + } + } + } + + var resizeCover; + // Caching resuable covers and allowing only one cover + // on screen. + var covers = {}, + currentCover; + + function showCover( editor ) + { + var win = CKEDITOR.document.getWindow(); + var config = editor.config, + backgroundColorStyle = config.dialog_backgroundCoverColor || 'white', + backgroundCoverOpacity = config.dialog_backgroundCoverOpacity, + baseFloatZIndex = config.baseFloatZIndex, + coverKey = CKEDITOR.tools.genKey( + backgroundColorStyle, + backgroundCoverOpacity, + baseFloatZIndex ), + coverElement = covers[ coverKey ]; + + if ( !coverElement ) + { + var html = [ + '
        ' + ]; + + if ( CKEDITOR.env.ie6Compat ) + { + // Support for custom document.domain in IE. + var isCustomDomain = CKEDITOR.env.isCustomDomain(), + iframeHtml = ''; + + html.push( + '' + + '' ); + } + + html.push( '
        ' ); + + coverElement = CKEDITOR.dom.element.createFromHtml( html.join( '' ) ); + coverElement.setOpacity( backgroundCoverOpacity != undefined ? backgroundCoverOpacity : 0.5 ); + + coverElement.appendTo( CKEDITOR.document.getBody() ); + covers[ coverKey ] = coverElement; + } + else + coverElement. show(); + + currentCover = coverElement; + var resizeFunc = function() + { + var size = win.getViewPaneSize(); + coverElement.setStyles( + { + width : size.width + 'px', + height : size.height + 'px' + } ); + }; + + var scrollFunc = function() + { + var pos = win.getScrollPosition(), + cursor = CKEDITOR.dialog._.currentTop; + coverElement.setStyles( + { + left : pos.x + 'px', + top : pos.y + 'px' + }); + + if ( cursor ) + { + do + { + var dialogPos = cursor.getPosition(); + cursor.move( dialogPos.x, dialogPos.y ); + } while ( ( cursor = cursor._.parentDialog ) ); + } + }; + + resizeCover = resizeFunc; + win.on( 'resize', resizeFunc ); + resizeFunc(); + // Using Safari/Mac, focus must be kept where it is (#7027) + if ( !( CKEDITOR.env.mac && CKEDITOR.env.webkit ) ) + coverElement.focus(); + + if ( CKEDITOR.env.ie6Compat ) + { + // IE BUG: win.$.onscroll assignment doesn't work.. it must be window.onscroll. + // So we need to invent a really funny way to make it work. + var myScrollHandler = function() + { + scrollFunc(); + arguments.callee.prevScrollHandler.apply( this, arguments ); + }; + win.$.setTimeout( function() + { + myScrollHandler.prevScrollHandler = window.onscroll || function(){}; + window.onscroll = myScrollHandler; + }, 0 ); + scrollFunc(); + } + } + + function hideCover() + { + if ( !currentCover ) + return; + + var win = CKEDITOR.document.getWindow(); + currentCover.hide(); + win.removeListener( 'resize', resizeCover ); + + if ( CKEDITOR.env.ie6Compat ) + { + win.$.setTimeout( function() + { + var prevScrollHandler = window.onscroll && window.onscroll.prevScrollHandler; + window.onscroll = prevScrollHandler || null; + }, 0 ); + } + resizeCover = null; + } + + function removeCovers() + { + for ( var coverId in covers ) + covers[ coverId ].remove(); + covers = {}; + } + + var accessKeyProcessors = {}; + + var accessKeyDownHandler = function( evt ) + { + var ctrl = evt.data.$.ctrlKey || evt.data.$.metaKey, + alt = evt.data.$.altKey, + shift = evt.data.$.shiftKey, + key = String.fromCharCode( evt.data.$.keyCode ), + keyProcessor = accessKeyProcessors[( ctrl ? 'CTRL+' : '' ) + ( alt ? 'ALT+' : '') + ( shift ? 'SHIFT+' : '' ) + key]; + + if ( !keyProcessor || !keyProcessor.length ) + return; + + keyProcessor = keyProcessor[keyProcessor.length - 1]; + keyProcessor.keydown && keyProcessor.keydown.call( keyProcessor.uiElement, keyProcessor.dialog, keyProcessor.key ); + evt.data.preventDefault(); + }; + + var accessKeyUpHandler = function( evt ) + { + var ctrl = evt.data.$.ctrlKey || evt.data.$.metaKey, + alt = evt.data.$.altKey, + shift = evt.data.$.shiftKey, + key = String.fromCharCode( evt.data.$.keyCode ), + keyProcessor = accessKeyProcessors[( ctrl ? 'CTRL+' : '' ) + ( alt ? 'ALT+' : '') + ( shift ? 'SHIFT+' : '' ) + key]; + + if ( !keyProcessor || !keyProcessor.length ) + return; + + keyProcessor = keyProcessor[keyProcessor.length - 1]; + if ( keyProcessor.keyup ) + { + keyProcessor.keyup.call( keyProcessor.uiElement, keyProcessor.dialog, keyProcessor.key ); + evt.data.preventDefault(); + } + }; + + var registerAccessKey = function( uiElement, dialog, key, downFunc, upFunc ) + { + var procList = accessKeyProcessors[key] || ( accessKeyProcessors[key] = [] ); + procList.push( { + uiElement : uiElement, + dialog : dialog, + key : key, + keyup : upFunc || uiElement.accessKeyUp, + keydown : downFunc || uiElement.accessKeyDown + } ); + }; + + var unregisterAccessKey = function( obj ) + { + for ( var i in accessKeyProcessors ) + { + var list = accessKeyProcessors[i]; + for ( var j = list.length - 1 ; j >= 0 ; j-- ) + { + if ( list[j].dialog == obj || list[j].uiElement == obj ) + list.splice( j, 1 ); + } + if ( list.length === 0 ) + delete accessKeyProcessors[i]; + } + }; + + var tabAccessKeyUp = function( dialog, key ) + { + if ( dialog._.accessKeyMap[key] ) + dialog.selectPage( dialog._.accessKeyMap[key] ); + }; + + var tabAccessKeyDown = function( dialog, key ) + { + }; + + // ESC, ENTER + var preventKeyBubblingKeys = { 27 :1, 13 :1 }; + var preventKeyBubbling = function( e ) + { + if ( e.data.getKeystroke() in preventKeyBubblingKeys ) + e.data.stopPropagation(); + }; + + (function() + { + CKEDITOR.ui.dialog = + { + /** + * The base class of all dialog UI elements. + * @constructor + * @param {CKEDITOR.dialog} dialog Parent dialog object. + * @param {CKEDITOR.dialog.uiElementDefinition} elementDefinition Element + * definition. Accepted fields: + *
          + *
        • id (Required) The id of the UI element. See {@link + * CKEDITOR.dialog#getContentElement}
        • + *
        • type (Required) The type of the UI element. The + * value to this field specifies which UI element class will be used to + * generate the final widget.
        • + *
        • title (Optional) The popup tooltip for the UI + * element.
        • + *
        • hidden (Optional) A flag that tells if the element + * should be initially visible.
        • + *
        • className (Optional) Additional CSS class names + * to add to the UI element. Separated by space.
        • + *
        • style (Optional) Additional CSS inline styles + * to add to the UI element. A semicolon (;) is required after the last + * style declaration.
        • + *
        • accessKey (Optional) The alphanumeric access key + * for this element. Access keys are automatically prefixed by CTRL.
        • + *
        • on* (Optional) Any UI element definition field that + * starts with on followed immediately by a capital letter and + * probably more letters is an event handler. Event handlers may be further + * divided into registered event handlers and DOM event handlers. Please + * refer to {@link CKEDITOR.ui.dialog.uiElement#registerEvents} and + * {@link CKEDITOR.ui.dialog.uiElement#eventProcessors} for more + * information.
        • + *
        + * @param {Array} htmlList + * List of HTML code to be added to the dialog's content area. + * @param {Function|String} nodeNameArg + * A function returning a string, or a simple string for the node name for + * the root DOM node. Default is 'div'. + * @param {Function|Object} stylesArg + * A function returning an object, or a simple object for CSS styles applied + * to the DOM node. Default is empty object. + * @param {Function|Object} attributesArg + * A fucntion returning an object, or a simple object for attributes applied + * to the DOM node. Default is empty object. + * @param {Function|String} contentsArg + * A function returning a string, or a simple string for the HTML code inside + * the root DOM node. Default is empty string. + * @example + */ + uiElement : function( dialog, elementDefinition, htmlList, nodeNameArg, stylesArg, attributesArg, contentsArg ) + { + if ( arguments.length < 4 ) + return; + + var nodeName = ( nodeNameArg.call ? nodeNameArg( elementDefinition ) : nodeNameArg ) || 'div', + html = [ '<', nodeName, ' ' ], + styles = ( stylesArg && stylesArg.call ? stylesArg( elementDefinition ) : stylesArg ) || {}, + attributes = ( attributesArg && attributesArg.call ? attributesArg( elementDefinition ) : attributesArg ) || {}, + innerHTML = ( contentsArg && contentsArg.call ? contentsArg.call( this, dialog, elementDefinition ) : contentsArg ) || '', + domId = this.domId = attributes.id || CKEDITOR.tools.getNextId() + '_uiElement', + id = this.id = elementDefinition.id, + i; + + // Set the id, a unique id is required for getElement() to work. + attributes.id = domId; + + // Set the type and definition CSS class names. + var classes = {}; + if ( elementDefinition.type ) + classes[ 'cke_dialog_ui_' + elementDefinition.type ] = 1; + if ( elementDefinition.className ) + classes[ elementDefinition.className ] = 1; + var attributeClasses = ( attributes['class'] && attributes['class'].split ) ? attributes['class'].split( ' ' ) : []; + for ( i = 0 ; i < attributeClasses.length ; i++ ) + { + if ( attributeClasses[i] ) + classes[ attributeClasses[i] ] = 1; + } + var finalClasses = []; + for ( i in classes ) + finalClasses.push( i ); + attributes['class'] = finalClasses.join( ' ' ); + + // Set the popup tooltop. + if ( elementDefinition.title ) + attributes.title = elementDefinition.title; + + // Write the inline CSS styles. + var styleStr = ( elementDefinition.style || '' ).split( ';' ); + for ( i in styles ) + styleStr.push( i + ':' + styles[i] ); + if ( elementDefinition.hidden ) + styleStr.push( 'display:none' ); + for ( i = styleStr.length - 1 ; i >= 0 ; i-- ) + { + if ( styleStr[i] === '' ) + styleStr.splice( i, 1 ); + } + if ( styleStr.length > 0 ) + attributes.style = ( attributes.style ? ( attributes.style + '; ' ) : '' ) + styleStr.join( '; ' ); + + // Write the attributes. + for ( i in attributes ) + html.push( i + '="' + CKEDITOR.tools.htmlEncode( attributes[i] ) + '" '); + + // Write the content HTML. + html.push( '>', innerHTML, '' ); + + // Add contents to the parent HTML array. + htmlList.push( html.join( '' ) ); + + ( this._ || ( this._ = {} ) ).dialog = dialog; + + // Override isChanged if it is defined in element definition. + if ( typeof( elementDefinition.isChanged ) == 'boolean' ) + this.isChanged = function(){ return elementDefinition.isChanged; }; + if ( typeof( elementDefinition.isChanged ) == 'function' ) + this.isChanged = elementDefinition.isChanged; + + // Add events. + CKEDITOR.event.implementOn( this ); + + this.registerEvents( elementDefinition ); + if ( this.accessKeyUp && this.accessKeyDown && elementDefinition.accessKey ) + registerAccessKey( this, dialog, 'CTRL+' + elementDefinition.accessKey ); + + var me = this; + dialog.on( 'load', function() + { + if ( me.getInputElement() ) + { + me.getInputElement().on( 'focus', function() + { + dialog._.tabBarMode = false; + dialog._.hasFocus = true; + me.fire( 'focus' ); + }, me ); + } + } ); + + // Register the object as a tab focus if it can be included. + if ( this.keyboardFocusable ) + { + this.tabIndex = elementDefinition.tabIndex || 0; + + this.focusIndex = dialog._.focusList.push( this ) - 1; + this.on( 'focus', function() + { + dialog._.currentFocusIndex = me.focusIndex; + } ); + } + + // Completes this object with everything we have in the + // definition. + CKEDITOR.tools.extend( this, elementDefinition ); + }, + + /** + * Horizontal layout box for dialog UI elements, auto-expends to available width of container. + * @constructor + * @extends CKEDITOR.ui.dialog.uiElement + * @param {CKEDITOR.dialog} dialog + * Parent dialog object. + * @param {Array} childObjList + * Array of {@link CKEDITOR.ui.dialog.uiElement} objects inside this + * container. + * @param {Array} childHtmlList + * Array of HTML code that correspond to the HTML output of all the + * objects in childObjList. + * @param {Array} htmlList + * Array of HTML code that this element will output to. + * @param {CKEDITOR.dialog.uiElementDefinition} elementDefinition + * The element definition. Accepted fields: + *
          + *
        • widths (Optional) The widths of child cells.
        • + *
        • height (Optional) The height of the layout.
        • + *
        • padding (Optional) The padding width inside child + * cells.
        • + *
        • align (Optional) The alignment of the whole layout + *
        • + *
        + * @example + */ + hbox : function( dialog, childObjList, childHtmlList, htmlList, elementDefinition ) + { + if ( arguments.length < 4 ) + return; + + this._ || ( this._ = {} ); + + var children = this._.children = childObjList, + widths = elementDefinition && elementDefinition.widths || null, + height = elementDefinition && elementDefinition.height || null, + styles = {}, + i; + /** @ignore */ + var innerHTML = function() + { + var html = [ '' ]; + for ( i = 0 ; i < childHtmlList.length ; i++ ) + { + var className = 'cke_dialog_ui_hbox_child', + styles = []; + if ( i === 0 ) + className = 'cke_dialog_ui_hbox_first'; + if ( i == childHtmlList.length - 1 ) + className = 'cke_dialog_ui_hbox_last'; + html.push( ' 0 ) + html.push( 'style="' + styles.join('; ') + '" ' ); + html.push( '>', childHtmlList[i], '' ); + } + html.push( '' ); + return html.join( '' ); + }; + + var attribs = { role : 'presentation' }; + elementDefinition && elementDefinition.align && ( attribs.align = elementDefinition.align ); + + CKEDITOR.ui.dialog.uiElement.call( + this, + dialog, + elementDefinition || { type : 'hbox' }, + htmlList, + 'table', + styles, + attribs, + innerHTML ); + }, + + /** + * Vertical layout box for dialog UI elements. + * @constructor + * @extends CKEDITOR.ui.dialog.hbox + * @param {CKEDITOR.dialog} dialog + * Parent dialog object. + * @param {Array} childObjList + * Array of {@link CKEDITOR.ui.dialog.uiElement} objects inside this + * container. + * @param {Array} childHtmlList + * Array of HTML code that correspond to the HTML output of all the + * objects in childObjList. + * @param {Array} htmlList + * Array of HTML code that this element will output to. + * @param {CKEDITOR.dialog.uiElementDefinition} elementDefinition + * The element definition. Accepted fields: + *
          + *
        • width (Optional) The width of the layout.
        • + *
        • heights (Optional) The heights of individual cells. + *
        • + *
        • align (Optional) The alignment of the layout.
        • + *
        • padding (Optional) The padding width inside child + * cells.
        • + *
        • expand (Optional) Whether the layout should expand + * vertically to fill its container.
        • + *
        + * @example + */ + vbox : function( dialog, childObjList, childHtmlList, htmlList, elementDefinition ) + { + if ( arguments.length < 3 ) + return; + + this._ || ( this._ = {} ); + + var children = this._.children = childObjList, + width = elementDefinition && elementDefinition.width || null, + heights = elementDefinition && elementDefinition.heights || null; + /** @ignore */ + var innerHTML = function() + { + var html = [ '' ); + for ( var i = 0 ; i < childHtmlList.length ; i++ ) + { + var styles = []; + html.push( '' ); + } + html.push( '
        0 ) + html.push( 'style="', styles.join( '; ' ), '" ' ); + html.push( ' class="cke_dialog_ui_vbox_child">', childHtmlList[i], '
        ' ); + return html.join( '' ); + }; + CKEDITOR.ui.dialog.uiElement.call( this, dialog, elementDefinition || { type : 'vbox' }, htmlList, 'div', null, { role : 'presentation' }, innerHTML ); + } + }; + })(); + + CKEDITOR.ui.dialog.uiElement.prototype = + { + /** + * Gets the root DOM element of this dialog UI object. + * @returns {CKEDITOR.dom.element} Root DOM element of UI object. + * @example + * uiElement.getElement().hide(); + */ + getElement : function() + { + return CKEDITOR.document.getById( this.domId ); + }, + + /** + * Gets the DOM element that the user inputs values. + * This function is used by setValue(), getValue() and focus(). It should + * be overrided in child classes where the input element isn't the root + * element. + * @returns {CKEDITOR.dom.element} The element where the user input values. + * @example + * var rawValue = textInput.getInputElement().$.value; + */ + getInputElement : function() + { + return this.getElement(); + }, + + /** + * Gets the parent dialog object containing this UI element. + * @returns {CKEDITOR.dialog} Parent dialog object. + * @example + * var dialog = uiElement.getDialog(); + */ + getDialog : function() + { + return this._.dialog; + }, + + /** + * Sets the value of this dialog UI object. + * @param {Object} value The new value. + * @param {Boolean} noChangeEvent Internal commit, to supress 'change' event on this element. + * @returns {CKEDITOR.dialog.uiElement} The current UI element. + * @example + * uiElement.setValue( 'Dingo' ); + */ + setValue : function( value, noChangeEvent ) + { + this.getInputElement().setValue( value ); + !noChangeEvent && this.fire( 'change', { value : value } ); + return this; + }, + + /** + * Gets the current value of this dialog UI object. + * @returns {Object} The current value. + * @example + * var myValue = uiElement.getValue(); + */ + getValue : function() + { + return this.getInputElement().getValue(); + }, + + /** + * Tells whether the UI object's value has changed. + * @returns {Boolean} true if changed, false if not changed. + * @example + * if ( uiElement.isChanged() ) + *   confirm( 'Value changed! Continue?' ); + */ + isChanged : function() + { + // Override in input classes. + return false; + }, + + /** + * Selects the parent tab of this element. Usually called by focus() or overridden focus() methods. + * @returns {CKEDITOR.dialog.uiElement} The current UI element. + * @example + * focus : function() + * { + * this.selectParentTab(); + * // do something else. + * } + */ + selectParentTab : function() + { + var element = this.getInputElement(), + cursor = element, + tabId; + while ( ( cursor = cursor.getParent() ) && cursor.$.className.search( 'cke_dialog_page_contents' ) == -1 ) + { /*jsl:pass*/ } + + // Some widgets don't have parent tabs (e.g. OK and Cancel buttons). + if ( !cursor ) + return this; + + tabId = cursor.getAttribute( 'name' ); + // Avoid duplicate select. + if ( this._.dialog._.currentTabId != tabId ) + this._.dialog.selectPage( tabId ); + return this; + }, + + /** + * Puts the focus to the UI object. Switches tabs if the UI object isn't in the active tab page. + * @returns {CKEDITOR.dialog.uiElement} The current UI element. + * @example + * uiElement.focus(); + */ + focus : function() + { + this.selectParentTab().getInputElement().focus(); + return this; + }, + + /** + * Registers the on* event handlers defined in the element definition. + * The default behavior of this function is: + *
          + *
        1. + * If the on* event is defined in the class's eventProcesors list, + * then the registration is delegated to the corresponding function + * in the eventProcessors list. + *
        2. + *
        3. + * If the on* event is not defined in the eventProcessors list, then + * register the event handler under the corresponding DOM event of + * the UI element's input DOM element (as defined by the return value + * of {@link CKEDITOR.ui.dialog.uiElement#getInputElement}). + *
        4. + *
        + * This function is only called at UI element instantiation, but can + * be overridded in child classes if they require more flexibility. + * @param {CKEDITOR.dialog.uiElementDefinition} definition The UI element + * definition. + * @returns {CKEDITOR.dialog.uiElement} The current UI element. + * @example + */ + registerEvents : function( definition ) + { + var regex = /^on([A-Z]\w+)/, + match; + + var registerDomEvent = function( uiElement, dialog, eventName, func ) + { + dialog.on( 'load', function() + { + uiElement.getInputElement().on( eventName, func, uiElement ); + }); + }; + + for ( var i in definition ) + { + if ( !( match = i.match( regex ) ) ) + continue; + if ( this.eventProcessors[i] ) + this.eventProcessors[i].call( this, this._.dialog, definition[i] ); + else + registerDomEvent( this, this._.dialog, match[1].toLowerCase(), definition[i] ); + } + + return this; + }, + + /** + * The event processor list used by + * {@link CKEDITOR.ui.dialog.uiElement#getInputElement} at UI element + * instantiation. The default list defines three on* events: + *
          + *
        1. onLoad - Called when the element's parent dialog opens for the + * first time
        2. + *
        3. onShow - Called whenever the element's parent dialog opens.
        4. + *
        5. onHide - Called whenever the element's parent dialog closes.
        6. + *
        + * @field + * @type Object + * @example + * // This connects the 'click' event in CKEDITOR.ui.dialog.button to onClick + * // handlers in the UI element's definitions. + * CKEDITOR.ui.dialog.button.eventProcessors = CKEDITOR.tools.extend( {}, + *   CKEDITOR.ui.dialog.uiElement.prototype.eventProcessors, + *   { onClick : function( dialog, func ) { this.on( 'click', func ); } }, + *   true ); + */ + eventProcessors : + { + onLoad : function( dialog, func ) + { + dialog.on( 'load', func, this ); + }, + + onShow : function( dialog, func ) + { + dialog.on( 'show', func, this ); + }, + + onHide : function( dialog, func ) + { + dialog.on( 'hide', func, this ); + } + }, + + /** + * The default handler for a UI element's access key down event, which + * tries to put focus to the UI element.
        + * Can be overridded in child classes for more sophisticaed behavior. + * @param {CKEDITOR.dialog} dialog The parent dialog object. + * @param {String} key The key combination pressed. Since access keys + * are defined to always include the CTRL key, its value should always + * include a 'CTRL+' prefix. + * @example + */ + accessKeyDown : function( dialog, key ) + { + this.focus(); + }, + + /** + * The default handler for a UI element's access key up event, which + * does nothing.
        + * Can be overridded in child classes for more sophisticated behavior. + * @param {CKEDITOR.dialog} dialog The parent dialog object. + * @param {String} key The key combination pressed. Since access keys + * are defined to always include the CTRL key, its value should always + * include a 'CTRL+' prefix. + * @example + */ + accessKeyUp : function( dialog, key ) + { + }, + + /** + * Disables a UI element. + * @example + */ + disable : function() + { + var element = this.getInputElement(); + element.setAttribute( 'disabled', 'true' ); + element.addClass( 'cke_disabled' ); + }, + + /** + * Enables a UI element. + * @example + */ + enable : function() + { + var element = this.getInputElement(); + element.removeAttribute( 'disabled' ); + element.removeClass( 'cke_disabled' ); + }, + + /** + * Determines whether an UI element is enabled or not. + * @returns {Boolean} Whether the UI element is enabled. + * @example + */ + isEnabled : function() + { + return !this.getInputElement().getAttribute( 'disabled' ); + }, + + /** + * Determines whether an UI element is visible or not. + * @returns {Boolean} Whether the UI element is visible. + * @example + */ + isVisible : function() + { + return this.getInputElement().isVisible(); + }, + + /** + * Determines whether an UI element is focus-able or not. + * Focus-able is defined as being both visible and enabled. + * @returns {Boolean} Whether the UI element can be focused. + * @example + */ + isFocusable : function() + { + if ( !this.isEnabled() || !this.isVisible() ) + return false; + return true; + } + }; + + CKEDITOR.ui.dialog.hbox.prototype = CKEDITOR.tools.extend( new CKEDITOR.ui.dialog.uiElement, + /** + * @lends CKEDITOR.ui.dialog.hbox.prototype + */ + { + /** + * Gets a child UI element inside this container. + * @param {Array|Number} indices An array or a single number to indicate the child's + * position in the container's descendant tree. Omit to get all the children in an array. + * @returns {Array|CKEDITOR.ui.dialog.uiElement} Array of all UI elements in the container + * if no argument given, or the specified UI element if indices is given. + * @example + * var checkbox = hbox.getChild( [0,1] ); + * checkbox.setValue( true ); + */ + getChild : function( indices ) + { + // If no arguments, return a clone of the children array. + if ( arguments.length < 1 ) + return this._.children.concat(); + + // If indices isn't array, make it one. + if ( !indices.splice ) + indices = [ indices ]; + + // Retrieve the child element according to tree position. + if ( indices.length < 2 ) + return this._.children[ indices[0] ]; + else + return ( this._.children[ indices[0] ] && this._.children[ indices[0] ].getChild ) ? + this._.children[ indices[0] ].getChild( indices.slice( 1, indices.length ) ) : + null; + } + }, true ); + + CKEDITOR.ui.dialog.vbox.prototype = new CKEDITOR.ui.dialog.hbox(); + + + + (function() + { + var commonBuilder = { + build : function( dialog, elementDefinition, output ) + { + var children = elementDefinition.children, + child, + childHtmlList = [], + childObjList = []; + for ( var i = 0 ; ( i < children.length && ( child = children[i] ) ) ; i++ ) + { + var childHtml = []; + childHtmlList.push( childHtml ); + childObjList.push( CKEDITOR.dialog._.uiElementBuilders[ child.type ].build( dialog, child, childHtml ) ); + } + return new CKEDITOR.ui.dialog[elementDefinition.type]( dialog, childObjList, childHtmlList, output, elementDefinition ); + } + }; + + CKEDITOR.dialog.addUIElement( 'hbox', commonBuilder ); + CKEDITOR.dialog.addUIElement( 'vbox', commonBuilder ); + })(); + + /** + * Generic dialog command. It opens a specific dialog when executed. + * @constructor + * @augments CKEDITOR.commandDefinition + * @param {string} dialogName The name of the dialog to open when executing + * this command. + * @example + * // Register the "link" command, which opens the "link" dialog. + * editor.addCommand( 'link', new CKEDITOR.dialogCommand( 'link' ) ); + */ + CKEDITOR.dialogCommand = function( dialogName ) + { + this.dialogName = dialogName; + }; + + CKEDITOR.dialogCommand.prototype = + { + /** @ignore */ + exec : function( editor ) + { + editor.openDialog( this.dialogName ); + }, + + // Dialog commands just open a dialog ui, thus require no undo logic, + // undo support should dedicate to specific dialog implementation. + canUndo: false, + + editorFocus : CKEDITOR.env.ie || CKEDITOR.env.webkit + }; + + (function() + { + var notEmptyRegex = /^([a]|[^a])+$/, + integerRegex = /^\d*$/, + numberRegex = /^\d*(?:\.\d+)?$/; + + CKEDITOR.VALIDATE_OR = 1; + CKEDITOR.VALIDATE_AND = 2; + + CKEDITOR.dialog.validate = + { + functions : function() + { + return function() + { + /** + * It's important for validate functions to be able to accept the value + * as argument in addition to this.getValue(), so that it is possible to + * combine validate functions together to make more sophisticated + * validators. + */ + var value = this && this.getValue ? this.getValue() : arguments[0]; + + var msg = undefined, + relation = CKEDITOR.VALIDATE_AND, + functions = [], i; + + for ( i = 0 ; i < arguments.length ; i++ ) + { + if ( typeof( arguments[i] ) == 'function' ) + functions.push( arguments[i] ); + else + break; + } + + if ( i < arguments.length && typeof( arguments[i] ) == 'string' ) + { + msg = arguments[i]; + i++; + } + + if ( i < arguments.length && typeof( arguments[i]) == 'number' ) + relation = arguments[i]; + + var passed = ( relation == CKEDITOR.VALIDATE_AND ? true : false ); + for ( i = 0 ; i < functions.length ; i++ ) + { + if ( relation == CKEDITOR.VALIDATE_AND ) + passed = passed && functions[i]( value ); + else + passed = passed || functions[i]( value ); + } + + if ( !passed ) + { + if ( msg !== undefined ) + alert( msg ); + if ( this && ( this.select || this.focus ) ) + ( this.select || this.focus )(); + return false; + } + + return true; + }; + }, + + regex : function( regex, msg ) + { + /* + * Can be greatly shortened by deriving from functions validator if code size + * turns out to be more important than performance. + */ + return function() + { + var value = this && this.getValue ? this.getValue() : arguments[0]; + if ( !regex.test( value ) ) + { + if ( msg !== undefined ) + alert( msg ); + if ( this && ( this.select || this.focus ) ) + { + if ( this.select ) + this.select(); + else + this.focus(); + } + return false; + } + return true; + }; + }, + + notEmpty : function( msg ) + { + return this.regex( notEmptyRegex, msg ); + }, + + integer : function( msg ) + { + return this.regex( integerRegex, msg ); + }, + + 'number' : function( msg ) + { + return this.regex( numberRegex, msg ); + }, + + equals : function( value, msg ) + { + return this.functions( function( val ){ return val == value; }, msg ); + }, + + notEqual : function( value, msg ) + { + return this.functions( function( val ){ return val != value; }, msg ); + } + }; + + CKEDITOR.on( 'instanceDestroyed', function( evt ) + { + // Remove dialog cover on last instance destroy. + if ( CKEDITOR.tools.isEmpty( CKEDITOR.instances ) ) + { + var currentTopDialog; + while ( ( currentTopDialog = CKEDITOR.dialog._.currentTop ) ) + currentTopDialog.hide(); + removeCovers(); + } + + var dialogs = evt.editor._.storedDialogs; + for ( var name in dialogs ) + dialogs[ name ].destroy(); + + }); + + })(); + + // Extend the CKEDITOR.editor class with dialog specific functions. + CKEDITOR.tools.extend( CKEDITOR.editor.prototype, + /** @lends CKEDITOR.editor.prototype */ + { + /** + * Loads and opens a registered dialog. + * @param {String} dialogName The registered name of the dialog. + * @param {Function} callback The function to be invoked after dialog instance created. + * @see CKEDITOR.dialog.add + * @example + * CKEDITOR.instances.editor1.openDialog( 'smiley' ); + * @returns {CKEDITOR.dialog} The dialog object corresponding to the dialog displayed. null if the dialog name is not registered. + */ + openDialog : function( dialogName, callback ) + { + if ( this.mode == 'wysiwyg' && CKEDITOR.env.ie ) + { + var selection = this.getSelection(); + selection && selection.lock(); + } + + var dialogDefinitions = CKEDITOR.dialog._.dialogDefinitions[ dialogName ], + dialogSkin = this.skin.dialog; + + if ( CKEDITOR.dialog._.currentTop === null ) + showCover( this ); + + // If the dialogDefinition is already loaded, open it immediately. + if ( typeof dialogDefinitions == 'function' && dialogSkin._isLoaded ) + { + var storedDialogs = this._.storedDialogs || + ( this._.storedDialogs = {} ); + + var dialog = storedDialogs[ dialogName ] || + ( storedDialogs[ dialogName ] = new CKEDITOR.dialog( this, dialogName ) ); + + callback && callback.call( dialog, dialog ); + dialog.show(); + + return dialog; + } + else if ( dialogDefinitions == 'failed' ) + throw new Error( '[CKEDITOR.dialog.openDialog] Dialog "' + dialogName + '" failed when loading definition.' ); + + var me = this; + + function onDialogFileLoaded( success ) + { + var dialogDefinition = CKEDITOR.dialog._.dialogDefinitions[ dialogName ], + skin = me.skin.dialog; + + // Check if both skin part and definition is loaded. + if ( !skin._isLoaded || loadDefinition && typeof success == 'undefined' ) + return; + + // In case of plugin error, mark it as loading failed. + if ( typeof dialogDefinition != 'function' ) + CKEDITOR.dialog._.dialogDefinitions[ dialogName ] = 'failed'; + + me.openDialog( dialogName, callback ); + } + + if ( typeof dialogDefinitions == 'string' ) + { + var loadDefinition = 1; + CKEDITOR.scriptLoader.load( CKEDITOR.getUrl( dialogDefinitions ), onDialogFileLoaded, null, 0, 1 ); + } + + CKEDITOR.skins.load( this, 'dialog', onDialogFileLoaded ); + + return null; + } + }); +})(); + +CKEDITOR.plugins.add( 'dialog', + { + requires : [ 'dialogui' ] + }); + +// Dialog related configurations. + +/** + * The color of the dialog background cover. It should be a valid CSS color + * string. + * @name CKEDITOR.config.dialog_backgroundCoverColor + * @type String + * @default 'white' + * @example + * config.dialog_backgroundCoverColor = 'rgb(255, 254, 253)'; + */ + +/** + * The opacity of the dialog background cover. It should be a number within the + * range [0.0, 1.0]. + * @name CKEDITOR.config.dialog_backgroundCoverOpacity + * @type Number + * @default 0.5 + * @example + * config.dialog_backgroundCoverOpacity = 0.7; + */ + +/** + * If the dialog has more than one tab, put focus into the first tab as soon as dialog is opened. + * @name CKEDITOR.config.dialog_startupFocusTab + * @type Boolean + * @default false + * @example + * config.dialog_startupFocusTab = true; + */ + +/** + * The distance of magnetic borders used in moving and resizing dialogs, + * measured in pixels. + * @name CKEDITOR.config.dialog_magnetDistance + * @type Number + * @default 20 + * @example + * config.dialog_magnetDistance = 30; + */ + +/** + * The guideline to follow when generating the dialog buttons. There are 3 possible options: + *
          + *
        • 'OS' - the buttons will be displayed in the default order of the user's OS;
        • + *
        • 'ltr' - for Left-To-Right order;
        • + *
        • 'rtl' - for Right-To-Left order.
        • + *
        + * @name CKEDITOR.config.dialog_buttonsOrder + * @type String + * @default 'OS' + * @since 3.5 + * @example + * config.dialog_buttonsOrder = 'rtl'; + */ + +/** + * The dialog contents to removed. It's a string composed by dialog name and tab name with a colon between them. + * Separate each pair with semicolon (see example). + * Note: All names are case-sensitive. + * Note: Be cautious when specifying dialog tabs that are mandatory, like "info", dialog functionality might be broken because of this! + * @name CKEDITOR.config.removeDialogTabs + * @type String + * @since 3.5 + * @default '' + * @example + * config.removeDialogTabs = 'flash:advanced;image:Link'; + */ + +/** + * Fired when a dialog definition is about to be used to create a dialog into + * an editor instance. This event makes it possible to customize the definition + * before creating it. + *

        Note that this event is called only the first time a specific dialog is + * opened. Successive openings will use the cached dialog, and this event will + * not get fired.

        + * @name CKEDITOR#dialogDefinition + * @event + * @param {CKEDITOR.dialog.dialogDefinition} data The dialog defination that + * is being loaded. + * @param {CKEDITOR.editor} editor The editor instance that will use the + * dialog. + */ + +/** + * Fired when a tab is going to be selected in a dialog + * @name CKEDITOR.dialog#selectPage + * @event + * @param {String} page The id of the page that it's gonna be selected. + * @param {String} currentPage The id of the current page. + */ + +/** + * Fired when the user tries to dismiss a dialog + * @name CKEDITOR.dialog#cancel + * @event + * @param {Boolean} hide Whether the event should proceed or not. + */ + +/** + * Fired when the user tries to confirm a dialog + * @name CKEDITOR.dialog#ok + * @event + * @param {Boolean} hide Whether the event should proceed or not. + */ + +/** + * Fired when a dialog is shown + * @name CKEDITOR.dialog#show + * @event + */ + +/** + * Fired when a dialog is shown + * @name CKEDITOR.editor#dialogShow + * @event + */ + +/** + * Fired when a dialog is hidden + * @name CKEDITOR.dialog#hide + * @event + */ + +/** + * Fired when a dialog is hidden + * @name CKEDITOR.editor#dialogHide + * @event + */ + +/** + * Fired when a dialog is being resized. The event is fired on + * the 'CKEDITOR.dialog' object, not a dialog instance. + * @name CKEDITOR.dialog#resize + * @since 3.5 + * @event + * @param {CKEDITOR.dialog} dialog The dialog being resized. + * @param {String} skin The skin name. + * @param {Number} width The new width. + * @param {Number} height The new height. + */ diff --git a/library/custom_template/ckeditor/_source/plugins/dialogadvtab/plugin.js b/library/custom_template/ckeditor/_source/plugins/dialogadvtab/plugin.js new file mode 100644 index 000000000..407694025 --- /dev/null +++ b/library/custom_template/ckeditor/_source/plugins/dialogadvtab/plugin.js @@ -0,0 +1,213 @@ +/* +Copyright (c) 2003-2011, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.html or http://ckeditor.com/license +*/ + +(function() +{ + +function setupAdvParams( element ) +{ + var attrName = this.att; + + var value = element && element.hasAttribute( attrName ) && element.getAttribute( attrName ) || ''; + + if ( value !== undefined ) + this.setValue( value ); +} + +function commitAdvParams() +{ + // Dialogs may use different parameters in the commit list, so, by + // definition, we take the first CKEDITOR.dom.element available. + var element; + + for ( var i = 0 ; i < arguments.length ; i++ ) + { + if ( arguments[ i ] instanceof CKEDITOR.dom.element ) + { + element = arguments[ i ]; + break; + } + } + + if ( element ) + { + var attrName = this.att, + value = this.getValue(); + + // Broadcast Lang Dir change + if ( attrName == 'dir' ) + { + var dir = element.getAttribute( attrName ); + if ( dir != value && element.getParent() ) + this._.dialog._.editor.fire( 'dirChanged', { node : element, dir : value || element.getDirection( 1 ) } ); + } + + if ( value ) + element.setAttribute( attrName, value ); + else + element.removeAttribute( attrName, value ); + } +} + +CKEDITOR.plugins.add( 'dialogadvtab', +{ + /** + * + * @param tabConfig + * id, dir, classes, styles + */ + createAdvancedTab : function( editor, tabConfig ) + { + if ( !tabConfig ) + tabConfig = { id:1, dir:1, classes:1, styles:1 }; + + var lang = editor.lang.common; + + var result = + { + id : 'advanced', + label : lang.advancedTab, + title : lang.advancedTab, + elements : + [ + { + type : 'vbox', + padding : 1, + children : [] + } + ] + }; + + var contents = []; + + if ( tabConfig.id || tabConfig.dir ) + { + if ( tabConfig.id ) + { + contents.push( + { + id : 'advId', + att : 'id', + type : 'text', + label : lang.id, + setup : setupAdvParams, + commit : commitAdvParams + }); + } + + if ( tabConfig.dir ) + { + contents.push( + { + id : 'advLangDir', + att : 'dir', + type : 'select', + label : lang.langDir, + 'default' : '', + style : 'width:100%', + items : + [ + [ lang.notSet, '' ], + [ lang.langDirLTR, 'ltr' ], + [ lang.langDirRTL, 'rtl' ] + ], + setup : setupAdvParams, + commit : commitAdvParams + }); + } + + result.elements[ 0 ].children.push( + { + type : 'hbox', + widths : [ '50%', '50%' ], + children : [].concat( contents ) + }); + } + + if ( tabConfig.styles || tabConfig.classes ) + { + contents = []; + + if ( tabConfig.styles ) + { + contents.push( + { + id : 'advStyles', + att : 'style', + type : 'text', + label : lang.styles, + 'default' : '', + + getStyle : function( name, defaultValue ) + { + var match = this.getValue().match( new RegExp( name + '\\s*:\s*([^;]*)', 'i') ); + return match ? match[ 1 ] : defaultValue; + }, + + updateStyle : function( name, value ) + { + var styles = this.getValue(); + + // Remove the current value. + if ( styles ) + { + styles = styles + .replace( new RegExp( '\\s*' + name + '\s*:[^;]*(?:$|;\s*)', 'i' ), '' ) + .replace( /^[;\s]+/, '' ) + .replace( /\s+$/, '' ); + } + + if ( value ) + { + styles && !(/;\s*$/).test( styles ) && ( styles += '; ' ); + styles += name + ': ' + value; + } + + this.setValue( styles, 1 ); + + }, + + setup : setupAdvParams, + + commit : commitAdvParams + + }); + } + + if ( tabConfig.classes ) + { + contents.push( + { + type : 'hbox', + widths : [ '45%', '55%' ], + children : + [ + { + id : 'advCSSClasses', + att : 'class', + type : 'text', + label : lang.cssClasses, + 'default' : '', + setup : setupAdvParams, + commit : commitAdvParams + + } + ] + }); + } + + result.elements[ 0 ].children.push( + { + type : 'hbox', + widths : [ '50%', '50%' ], + children : [].concat( contents ) + }); + } + + return result; + } +}); + +})(); diff --git a/library/custom_template/ckeditor/_source/plugins/dialogui/plugin.js b/library/custom_template/ckeditor/_source/plugins/dialogui/plugin.js new file mode 100644 index 000000000..de505b0bf --- /dev/null +++ b/library/custom_template/ckeditor/_source/plugins/dialogui/plugin.js @@ -0,0 +1,1537 @@ +/* +Copyright (c) 2003-2011, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.html or http://ckeditor.com/license +*/ + +/** @fileoverview The "dialogui" plugin. */ + +CKEDITOR.plugins.add( 'dialogui' ); + +(function() +{ + var initPrivateObject = function( elementDefinition ) + { + this._ || ( this._ = {} ); + this._['default'] = this._.initValue = elementDefinition['default'] || ''; + this._.required = elementDefinition[ 'required' ] || false; + var args = [ this._ ]; + for ( var i = 1 ; i < arguments.length ; i++ ) + args.push( arguments[i] ); + args.push( true ); + CKEDITOR.tools.extend.apply( CKEDITOR.tools, args ); + return this._; + }, + textBuilder = + { + build : function( dialog, elementDefinition, output ) + { + return new CKEDITOR.ui.dialog.textInput( dialog, elementDefinition, output ); + } + }, + commonBuilder = + { + build : function( dialog, elementDefinition, output ) + { + return new CKEDITOR.ui.dialog[elementDefinition.type]( dialog, elementDefinition, output ); + } + }, + containerBuilder = + { + build : function( dialog, elementDefinition, output ) + { + var children = elementDefinition.children, + child, + childHtmlList = [], + childObjList = []; + for ( var i = 0 ; ( i < children.length && ( child = children[i] ) ) ; i++ ) + { + var childHtml = []; + childHtmlList.push( childHtml ); + childObjList.push( CKEDITOR.dialog._.uiElementBuilders[ child.type ].build( dialog, child, childHtml ) ); + } + return new CKEDITOR.ui.dialog[ elementDefinition.type ]( dialog, childObjList, childHtmlList, output, elementDefinition ); + } + }, + commonPrototype = + { + isChanged : function() + { + return this.getValue() != this.getInitValue(); + }, + + reset : function( noChangeEvent ) + { + this.setValue( this.getInitValue(), noChangeEvent ); + }, + + setInitValue : function() + { + this._.initValue = this.getValue(); + }, + + resetInitValue : function() + { + this._.initValue = this._['default']; + }, + + getInitValue : function() + { + return this._.initValue; + } + }, + commonEventProcessors = CKEDITOR.tools.extend( {}, CKEDITOR.ui.dialog.uiElement.prototype.eventProcessors, + { + onChange : function( dialog, func ) + { + if ( !this._.domOnChangeRegistered ) + { + dialog.on( 'load', function() + { + this.getInputElement().on( 'change', function() + { + // Make sure 'onchange' doesn't get fired after dialog closed. (#5719) + if ( !dialog.parts.dialog.isVisible() ) + return; + + this.fire( 'change', { value : this.getValue() } ); + }, this ); + }, this ); + this._.domOnChangeRegistered = true; + } + + this.on( 'change', func ); + } + }, true ), + eventRegex = /^on([A-Z]\w+)/, + cleanInnerDefinition = function( def ) + { + // An inner UI element should not have the parent's type, title or events. + for ( var i in def ) + { + if ( eventRegex.test( i ) || i == 'title' || i == 'type' ) + delete def[i]; + } + return def; + }; + + CKEDITOR.tools.extend( CKEDITOR.ui.dialog, + /** @lends CKEDITOR.ui.dialog */ + { + /** + * Base class for all dialog elements with a textual label on the left. + * @constructor + * @example + * @extends CKEDITOR.ui.dialog.uiElement + * @param {CKEDITOR.dialog} dialog + * Parent dialog object. + * @param {CKEDITOR.dialog.uiElementDefinition} elementDefinition + * The element definition. Accepted fields: + *
          + *
        • label (Required) The label string.
        • + *
        • labelLayout (Optional) Put 'horizontal' here if the + * label element is to be layed out horizontally. Otherwise a vertical + * layout will be used.
        • + *
        • widths (Optional) This applies only for horizontal + * layouts - an 2-element array of lengths to specify the widths of the + * label and the content element.
        • + *
        + * @param {Array} htmlList + * List of HTML code to output to. + * @param {Function} contentHtml + * A function returning the HTML code string to be added inside the content + * cell. + */ + labeledElement : function( dialog, elementDefinition, htmlList, contentHtml ) + { + if ( arguments.length < 4 ) + return; + + var _ = initPrivateObject.call( this, elementDefinition ); + _.labelId = CKEDITOR.tools.getNextId() + '_label'; + var children = this._.children = []; + /** @ignore */ + var innerHTML = function() + { + var html = [], + requiredClass = elementDefinition.required ? ' cke_required' : '' ; + if ( elementDefinition.labelLayout != 'horizontal' ) + html.push( '', + '' ); + else + { + var hboxDefinition = { + type : 'hbox', + widths : elementDefinition.widths, + padding : 0, + children : + [ + { + type : 'html', + html : '