radiant-ck_editor_filter-extension 0.2.0 → 0.2.1
Sign up to get free protection for your applications and to get access to all the features.
- data/README.markdown +7 -1
- data/VERSION +1 -1
- data/ck_editor_filter_extension.rb +1 -1
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/CHANGES.html +1130 -373
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/INSTALL.html +2 -2
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/LICENSE.html +2 -2
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/_samples/adobeair/application.xml +32 -0
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/_samples/adobeair/run.bat +9 -0
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/_samples/adobeair/run.sh +8 -0
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/_samples/adobeair/sample.html +45 -0
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/_samples/ajax.html +23 -25
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/_samples/api.html +64 -24
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/_samples/api_dialog.html +36 -19
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/_samples/api_dialog/my_dialog.js +1 -1
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/_samples/asp/advanced.asp +105 -0
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/_samples/asp/events.asp +136 -0
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/_samples/asp/index.html +103 -0
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/_samples/asp/replace.asp +72 -0
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/_samples/asp/replaceall.asp +77 -0
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/_samples/asp/sample_posteddata.asp +46 -0
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/_samples/asp/standalone.asp +72 -0
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/_samples/assets/_posteddata.php +59 -0
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/_samples/assets/output_for_flash.fla +0 -0
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/_samples/assets/output_for_flash.swf +0 -0
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/_samples/assets/output_xhtml.css +204 -0
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/_samples/assets/parsesample.css +70 -0
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/_samples/assets/swfobject.js +18 -0
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/_samples/autogrow.html +103 -0
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/_samples/bbcode.html +136 -0
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/_samples/devtools.html +94 -0
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/_samples/divreplace.html +27 -10
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/_samples/enterkey.html +39 -12
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/_samples/fullpage.html +33 -13
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/_samples/index.html +88 -25
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/_samples/jqueryadapter.html +34 -8
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/_samples/output_for_flash.html +275 -0
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/_samples/output_html.html +285 -0
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/_samples/output_xhtml.html +181 -0
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/_samples/php/advanced.php +56 -29
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/_samples/php/events.php +58 -35
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/_samples/php/index.html +47 -0
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/_samples/php/replace.php +48 -24
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/_samples/php/replaceall.php +50 -30
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/_samples/php/standalone.php +52 -33
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/_samples/placeholder.html +81 -0
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/_samples/readonly.html +91 -0
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/_samples/replacebyclass.html +22 -7
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/_samples/replacebycode.html +25 -8
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/_samples/sample.css +85 -3
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/_samples/sample.js +1 -1
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/_samples/sample_posteddata.php +21 -59
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/_samples/sharedspaces.html +32 -10
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/_samples/skins.html +38 -11
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/_samples/stylesheetparser.html +93 -0
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/_samples/tableresize.html +115 -0
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/_samples/ui_color.html +49 -7
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/_samples/ui_languages.html +53 -23
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/_source/adapters/jquery.js +17 -8
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/_source/core/_bootstrap.js +21 -18
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/_source/core/ckeditor.js +42 -4
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/_source/core/ckeditor_base.js +66 -29
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/_source/core/ckeditor_basic.js +12 -15
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/_source/core/command.js +138 -2
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/_source/core/commanddefinition.js +59 -16
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/_source/core/config.js +142 -18
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/_source/core/dataprocessor.js +6 -7
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/_source/core/dom.js +2 -3
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/_source/core/dom/comment.js +1 -1
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/_source/core/dom/document.js +29 -2
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/_source/core/dom/documentfragment.js +3 -3
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/_source/core/dom/domobject.js +59 -11
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/_source/core/dom/element.js +249 -27
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/_source/core/dom/elementpath.js +18 -3
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/_source/core/dom/event.js +1 -1
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/_source/core/dom/node.js +84 -56
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/_source/core/dom/nodelist.js +4 -1
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/_source/core/dom/range.js +345 -48
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/_source/core/dom/rangelist.js +213 -0
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/_source/core/dom/text.js +6 -1
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/_source/core/dom/walker.js +40 -29
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/_source/core/dom/window.js +1 -1
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/_source/core/dtd.js +15 -11
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/_source/core/editor.js +336 -15
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/_source/core/editor_basic.js +19 -12
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/_source/core/env.js +80 -17
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/_source/core/event.js +12 -6
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/_source/core/eventInfo.js +5 -5
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/_source/core/focusmanager.js +27 -12
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/_source/core/htmlparser.js +17 -5
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/_source/core/htmlparser/basicwriter.js +3 -3
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/_source/core/htmlparser/cdata.js +1 -1
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/_source/core/htmlparser/comment.js +1 -1
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/_source/core/htmlparser/element.js +14 -5
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/_source/core/htmlparser/filter.js +34 -8
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/_source/core/htmlparser/fragment.js +105 -108
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/_source/core/htmlparser/text.js +1 -1
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/_source/core/lang.js +12 -7
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/_source/core/loader.js +7 -9
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/_source/core/plugindefinition.js +18 -1
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/_source/core/plugins.js +21 -3
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/_source/core/resourcemanager.js +1 -1
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/_source/core/scriptloader.js +7 -25
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/_source/core/skins.js +5 -25
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/_source/core/themes.js +1 -1
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/_source/core/tools.js +61 -12
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/_source/core/ui.js +13 -1
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/_source/lang/_languages.js +2 -1
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/_source/lang/_translationstatus.txt +58 -57
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/_source/lang/af.js +521 -410
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/_source/lang/ar.js +160 -49
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/_source/lang/bg.js +162 -51
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/_source/lang/bn.js +162 -51
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/_source/lang/bs.js +162 -51
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/_source/lang/ca.js +260 -149
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/_source/lang/cs.js +233 -122
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/_source/lang/cy.js +159 -48
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/_source/lang/da.js +162 -51
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/_source/lang/de.js +217 -106
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/_source/lang/el.js +162 -51
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/_source/lang/en-au.js +166 -55
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/_source/lang/en-ca.js +166 -55
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/_source/lang/en-gb.js +277 -166
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/_source/lang/en.js +166 -55
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/_source/lang/eo.js +162 -51
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/_source/lang/es.js +182 -71
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/_source/lang/et.js +162 -51
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/_source/lang/eu.js +162 -51
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/_source/lang/fa.js +162 -51
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/_source/lang/fi.js +178 -67
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/_source/lang/fo.js +339 -228
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/_source/lang/fr-ca.js +162 -51
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/_source/lang/fr.js +261 -150
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/_source/lang/gl.js +162 -51
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/_source/lang/gu.js +162 -51
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/_source/lang/he.js +179 -68
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/_source/lang/hi.js +162 -51
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/_source/lang/hr.js +162 -51
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/_source/lang/hu.js +341 -230
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/_source/lang/is.js +162 -51
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/_source/lang/it.js +162 -51
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/_source/lang/ja.js +195 -84
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/_source/lang/ka.js +810 -0
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/_source/lang/km.js +162 -51
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/_source/lang/ko.js +162 -51
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/_source/lang/lt.js +162 -51
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/_source/lang/lv.js +162 -51
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/_source/lang/mn.js +162 -51
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/_source/lang/ms.js +162 -51
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/_source/lang/nb.js +286 -175
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/_source/lang/nl.js +178 -67
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/_source/lang/no.js +286 -175
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/_source/lang/pl.js +279 -168
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/_source/lang/pt-br.js +318 -208
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/_source/lang/pt.js +162 -51
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/_source/lang/ro.js +162 -51
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/_source/lang/ru.js +159 -48
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/_source/lang/sk.js +192 -81
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/_source/lang/sl.js +161 -50
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/_source/lang/sr-latn.js +162 -51
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/_source/lang/sr.js +162 -51
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/_source/lang/sv.js +357 -247
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/_source/lang/th.js +162 -51
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/_source/lang/tr.js +345 -235
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/_source/lang/uk.js +387 -276
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/_source/lang/vi.js +336 -225
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/_source/lang/zh-cn.js +271 -160
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/_source/lang/zh.js +162 -51
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/_source/plugins/a11yhelp/dialogs/a11yhelp.js +16 -5
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/_source/plugins/a11yhelp/lang/en.js +3 -3
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/_source/plugins/a11yhelp/lang/he.js +216 -0
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/_source/plugins/a11yhelp/plugin.js +4 -3
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/_source/plugins/about/dialogs/about.js +4 -1
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/_source/plugins/about/plugin.js +2 -1
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/_source/plugins/adobeair/plugin.js +228 -0
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/_source/plugins/ajax/plugin.js +152 -0
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/_source/plugins/autogrow/plugin.js +88 -0
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/_source/plugins/basicstyles/plugin.js +27 -19
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/_source/plugins/bbcode/plugin.js +924 -0
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/_source/plugins/bidi/plugin.js +331 -0
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/_source/plugins/blockquote/plugin.js +8 -4
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/_source/plugins/button/plugin.js +70 -55
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/_source/plugins/clipboard/dialogs/paste.js +115 -78
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/_source/plugins/clipboard/plugin.js +133 -69
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/_source/plugins/colorbutton/plugin.js +91 -23
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/_source/plugins/colordialog/dialogs/colordialog.js +192 -43
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/_source/plugins/colordialog/plugin.js +12 -10
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/_source/plugins/contextmenu/plugin.js +124 -221
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/_source/plugins/devtools/lang/en.js +16 -0
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/_source/plugins/devtools/plugin.js +173 -0
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/_source/plugins/dialog/dialogDefinition.js +840 -56
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/_source/plugins/dialog/plugin.js +652 -301
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/_source/plugins/dialogadvtab/plugin.js +205 -0
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/_source/plugins/dialogui/plugin.js +179 -50
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/_source/plugins/div/dialogs/div.js +40 -40
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/_source/plugins/div/plugin.js +4 -4
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/_source/plugins/docprops/dialogs/docprops.js +686 -0
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/_source/plugins/docprops/plugin.js +22 -0
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/_source/plugins/domiterator/plugin.js +59 -53
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/_source/plugins/editingblock/plugin.js +62 -17
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/_source/plugins/elementspath/plugin.js +137 -108
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/_source/plugins/enterkey/plugin.js +117 -47
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/_source/plugins/entities/plugin.js +95 -45
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/_source/plugins/fakeobjects/plugin.js +22 -16
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/_source/plugins/filebrowser/plugin.js +75 -30
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/_source/plugins/find/dialogs/find.js +111 -69
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/_source/plugins/find/plugin.js +2 -1
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/_source/plugins/flash/dialogs/flash.js +28 -20
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/_source/plugins/flash/plugin.js +14 -11
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/_source/plugins/floatpanel/plugin.js +50 -21
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/_source/plugins/font/plugin.js +3 -2
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/_source/plugins/format/plugin.js +17 -13
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/_source/plugins/forms/dialogs/button.js +38 -55
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/_source/plugins/forms/dialogs/checkbox.js +21 -11
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/_source/plugins/forms/dialogs/form.js +6 -6
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/_source/plugins/forms/dialogs/hiddenfield.js +26 -17
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/_source/plugins/forms/dialogs/radio.js +6 -6
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/_source/plugins/forms/dialogs/select.js +13 -7
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/_source/plugins/forms/dialogs/textarea.js +4 -4
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/_source/plugins/forms/dialogs/textfield.js +11 -5
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/_source/plugins/forms/images/hiddenfield.gif +0 -0
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/_source/plugins/forms/plugin.js +112 -41
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/_source/plugins/horizontalrule/plugin.js +1 -1
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/_source/plugins/htmldataprocessor/plugin.js +200 -63
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/_source/plugins/htmlwriter/plugin.js +26 -21
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/_source/plugins/iframe/dialogs/iframe.js +257 -0
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/_source/plugins/iframe/images/placeholder.png +0 -0
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/_source/plugins/iframe/plugin.js +106 -0
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/_source/plugins/iframedialog/plugin.js +59 -7
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/_source/plugins/image/dialogs/image.js +243 -218
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/_source/plugins/image/plugin.js +19 -2
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/_source/plugins/indent/plugin.js +335 -223
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/_source/plugins/justify/plugin.js +115 -30
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/_source/plugins/keystrokes/plugin.js +3 -7
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/_source/plugins/link/dialogs/anchor.js +85 -40
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/_source/plugins/link/dialogs/link.js +163 -184
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/_source/plugins/link/plugin.js +180 -32
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/_source/plugins/list/plugin.js +165 -81
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/_source/plugins/listblock/plugin.js +11 -6
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/_source/plugins/liststyle/dialogs/liststyle.js +204 -0
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/_source/plugins/liststyle/plugin.js +66 -0
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/_source/plugins/maximize/plugin.js +109 -40
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/_source/plugins/menu/plugin.js +166 -67
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/_source/plugins/menubutton/plugin.js +12 -7
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/_source/plugins/newpage/plugin.js +3 -3
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/_source/plugins/pagebreak/plugin.js +95 -29
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/_source/plugins/panel/plugin.js +43 -20
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/_source/plugins/panelbutton/plugin.js +10 -11
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/_source/plugins/pastefromword/filter/default.js +316 -119
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/_source/plugins/pastefromword/plugin.js +32 -11
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/_source/plugins/pastetext/dialogs/pastetext.js +19 -29
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/_source/plugins/pastetext/plugin.js +15 -79
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/_source/plugins/placeholder/dialogs/placeholder.js +71 -0
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/_source/plugins/placeholder/lang/en.js +16 -0
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/_source/plugins/placeholder/lang/he.js +16 -0
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/_source/plugins/placeholder/placeholder.gif +0 -0
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/_source/plugins/placeholder/plugin.js +171 -0
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/_source/plugins/popup/plugin.js +9 -7
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/_source/plugins/preview/plugin.js +3 -2
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/_source/plugins/print/plugin.js +2 -1
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/_source/plugins/removeformat/plugin.js +89 -36
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/_source/plugins/resize/plugin.js +71 -18
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/_source/plugins/richcombo/plugin.js +40 -29
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/_source/plugins/save/plugin.js +2 -1
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/_source/plugins/scayt/dialogs/options.js +114 -110
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/_source/plugins/scayt/plugin.js +531 -170
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/_source/plugins/selection/plugin.js +791 -331
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/_source/plugins/showblocks/images/block_address.png +0 -0
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/_source/plugins/showblocks/images/block_blockquote.png +0 -0
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/_source/plugins/showblocks/images/block_div.png +0 -0
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/_source/plugins/showblocks/images/block_h1.png +0 -0
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/_source/plugins/showblocks/images/block_h2.png +0 -0
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/_source/plugins/showblocks/images/block_h3.png +0 -0
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/_source/plugins/showblocks/images/block_h4.png +0 -0
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/_source/plugins/showblocks/images/block_h5.png +0 -0
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/_source/plugins/showblocks/images/block_h6.png +0 -0
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/_source/plugins/showblocks/images/block_p.png +0 -0
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/_source/plugins/showblocks/images/block_pre.png +0 -0
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/_source/plugins/showblocks/plugin.js +14 -8
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/_source/plugins/showborders/plugin.js +63 -26
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/_source/plugins/smiley/dialogs/smiley.js +31 -22
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/_source/plugins/smiley/plugin.js +15 -6
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/_source/plugins/sourcearea/plugin.js +18 -14
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/_source/plugins/specialchar/dialogs/specialchar.js +36 -59
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/_source/plugins/specialchar/lang/en.js +89 -0
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/_source/plugins/specialchar/plugin.js +45 -4
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/_source/plugins/styles/plugin.js +632 -212
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/_source/plugins/{stylescombo → styles}/styles/default.js +5 -2
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/_source/plugins/stylescombo/plugin.js +77 -140
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/_source/plugins/stylesheetparser/plugin.js +143 -0
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/_source/plugins/tab/plugin.js +109 -3
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/_source/plugins/table/dialogs/table.js +106 -23
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/_source/plugins/table/plugin.js +11 -3
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/_source/plugins/tableresize/plugin.js +450 -0
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/_source/plugins/tabletools/dialogs/tableCell.js +66 -64
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/_source/plugins/tabletools/plugin.js +348 -179
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/_source/plugins/templates/dialogs/templates.js +41 -36
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/_source/plugins/templates/plugin.js +3 -4
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/_source/plugins/templates/templates/default.js +2 -2
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/_source/plugins/toolbar/plugin.js +193 -122
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/_source/plugins/uicolor/dialogs/uicolor.js +6 -5
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/_source/plugins/uicolor/lang/en.js +1 -1
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/_source/plugins/uicolor/lang/he.js +15 -0
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/_source/plugins/uicolor/plugin.js +2 -2
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/_source/plugins/uicolor/yui/assets/yui.css +1 -1
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/_source/plugins/undo/plugin.js +73 -12
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/_source/plugins/wsc/dialogs/ciframe.html +1 -1
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/_source/plugins/wsc/dialogs/tmpFrameset.html +1 -1
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/_source/plugins/wsc/dialogs/wsc.css +1 -2
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/_source/plugins/wsc/dialogs/wsc.js +20 -4
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/_source/plugins/wsc/plugin.js +2 -2
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/_source/plugins/wysiwygarea/plugin.js +751 -251
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/_source/plugins/xml/plugin.js +170 -0
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/_source/skins/kama/dialog.css +116 -18
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/_source/skins/kama/editor.css +1 -1
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/_source/skins/kama/elementspath.css +2 -1
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/_source/skins/kama/icons.css +42 -2
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/_source/skins/kama/icons.png +0 -0
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/_source/skins/kama/icons_rtl.png +0 -0
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/_source/skins/kama/mainui.css +25 -5
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/_source/skins/kama/menu.css +36 -15
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/_source/skins/kama/panel.css +18 -17
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/_source/skins/kama/presets.css +1 -1
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/_source/skins/kama/reset.css +7 -1
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/_source/skins/kama/richcombo.css +27 -10
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/_source/skins/kama/skin.js +4 -36
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/_source/skins/kama/templates.css +16 -12
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/_source/skins/kama/toolbar.css +69 -83
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/_source/skins/office2003/dialog.css +111 -13
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/_source/skins/office2003/editor.css +1 -1
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/_source/skins/office2003/elementspath.css +2 -1
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/_source/skins/office2003/icons.css +40 -1
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/_source/skins/office2003/icons.png +0 -0
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/_source/skins/office2003/icons_rtl.png +0 -0
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/_source/skins/office2003/mainui.css +33 -7
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/_source/skins/office2003/menu.css +37 -15
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/_source/skins/office2003/panel.css +23 -22
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/_source/skins/office2003/presets.css +1 -1
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/_source/skins/office2003/reset.css +7 -1
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/_source/skins/office2003/richcombo.css +40 -20
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/_source/skins/office2003/skin.js +10 -17
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/_source/skins/office2003/templates.css +16 -10
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/_source/skins/office2003/toolbar.css +79 -32
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/_source/skins/v2/dialog.css +112 -13
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/_source/skins/v2/editor.css +1 -1
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/_source/skins/v2/elementspath.css +2 -1
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/_source/skins/v2/icons.css +40 -1
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/_source/skins/v2/icons.png +0 -0
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/_source/skins/v2/icons_rtl.png +0 -0
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/_source/skins/v2/mainui.css +25 -5
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/_source/skins/v2/menu.css +38 -16
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/_source/skins/v2/panel.css +22 -21
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/_source/skins/v2/presets.css +1 -1
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/_source/skins/v2/reset.css +7 -1
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/_source/skins/v2/richcombo.css +36 -23
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/_source/skins/v2/skin.js +10 -17
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/_source/skins/v2/templates.css +16 -10
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/_source/skins/v2/toolbar.css +67 -27
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/_source/themes/default/theme.js +106 -46
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/adapters/jquery.js +2 -2
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/ckeditor.asp +955 -0
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/ckeditor.js +141 -117
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/ckeditor.pack +13 -7
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/ckeditor.php +1 -1
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/ckeditor_basic.js +4 -4
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/ckeditor_basic_source.js +2 -2
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/ckeditor_php4.php +27 -54
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/ckeditor_php5.php +26 -53
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/ckeditor_source.js +2 -2
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/config.js +1 -1
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/contents.css +4 -16
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/lang/_languages.js +2 -2
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/lang/_translationstatus.txt +58 -57
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/lang/af.js +2 -2
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/lang/ar.js +2 -2
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/lang/bg.js +2 -2
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/lang/bn.js +2 -2
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/lang/bs.js +2 -2
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/lang/ca.js +2 -2
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/lang/cs.js +2 -2
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/lang/cy.js +2 -2
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/lang/da.js +2 -2
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/lang/de.js +2 -2
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/lang/el.js +2 -2
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/lang/en-au.js +2 -2
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/lang/en-ca.js +2 -2
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/lang/en-gb.js +2 -2
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/lang/en.js +2 -2
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/lang/eo.js +2 -2
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/lang/es.js +2 -2
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/lang/et.js +2 -2
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/lang/eu.js +2 -2
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/lang/fa.js +2 -2
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/lang/fi.js +2 -2
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/lang/fo.js +2 -2
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/lang/fr-ca.js +2 -2
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/lang/fr.js +2 -2
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/lang/gl.js +2 -2
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/lang/gu.js +2 -2
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/lang/he.js +2 -2
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/lang/hi.js +2 -2
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/lang/hr.js +2 -2
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/lang/hu.js +2 -2
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/lang/is.js +2 -2
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/lang/it.js +2 -2
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/lang/ja.js +2 -2
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/lang/ka.js +6 -0
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/lang/km.js +2 -2
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/lang/ko.js +2 -2
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/lang/lt.js +2 -2
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/lang/lv.js +2 -2
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/lang/mn.js +2 -2
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/lang/ms.js +2 -2
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/lang/nb.js +2 -2
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/lang/nl.js +2 -2
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/lang/no.js +2 -2
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/lang/pl.js +2 -2
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/lang/pt-br.js +2 -2
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/lang/pt.js +2 -2
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/lang/ro.js +2 -2
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/lang/ru.js +2 -2
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/lang/sk.js +2 -2
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/lang/sl.js +2 -2
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/lang/sr-latn.js +2 -2
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/lang/sr.js +2 -2
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/lang/sv.js +2 -2
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/lang/th.js +2 -2
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/lang/tr.js +2 -2
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/lang/uk.js +2 -2
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/lang/vi.js +2 -2
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/lang/zh-cn.js +2 -2
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/lang/zh.js +2 -2
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/plugins/a11yhelp/dialogs/a11yhelp.js +2 -2
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/plugins/a11yhelp/lang/en.js +2 -2
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/plugins/a11yhelp/lang/he.js +6 -0
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/plugins/about/dialogs/about.js +2 -2
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/plugins/adobeair/plugin.js +6 -0
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/plugins/ajax/plugin.js +6 -0
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/plugins/autogrow/plugin.js +6 -0
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/plugins/bbcode/plugin.js +9 -0
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/plugins/clipboard/dialogs/paste.js +3 -3
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/plugins/colordialog/dialogs/colordialog.js +3 -2
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/plugins/devtools/lang/en.js +6 -0
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/plugins/devtools/plugin.js +6 -0
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/plugins/dialog/dialogDefinition.js +1 -1
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/plugins/div/dialogs/div.js +3 -2
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/plugins/docprops/dialogs/docprops.js +10 -0
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/plugins/docprops/plugin.js +6 -0
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/plugins/find/dialogs/find.js +5 -5
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/plugins/flash/dialogs/flash.js +5 -5
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/plugins/forms/dialogs/button.js +2 -2
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/plugins/forms/dialogs/checkbox.js +2 -2
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/plugins/forms/dialogs/form.js +2 -2
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/plugins/forms/dialogs/hiddenfield.js +2 -2
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/plugins/forms/dialogs/radio.js +2 -2
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/plugins/forms/dialogs/select.js +4 -4
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/plugins/forms/dialogs/textarea.js +2 -2
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/plugins/forms/dialogs/textfield.js +2 -2
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/plugins/forms/images/hiddenfield.gif +0 -0
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/plugins/iframe/dialogs/iframe.js +7 -0
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/plugins/iframe/images/placeholder.png +0 -0
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/plugins/iframedialog/plugin.js +2 -2
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/plugins/image/dialogs/image.js +9 -9
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/plugins/link/dialogs/anchor.js +2 -2
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/plugins/link/dialogs/link.js +7 -7
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/plugins/liststyle/dialogs/liststyle.js +6 -0
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/plugins/pastefromword/filter/default.js +7 -6
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/plugins/pastetext/dialogs/pastetext.js +2 -2
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/plugins/placeholder/dialogs/placeholder.js +6 -0
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/plugins/placeholder/lang/en.js +6 -0
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/plugins/placeholder/lang/he.js +6 -0
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/plugins/placeholder/placeholder.gif +0 -0
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/plugins/placeholder/plugin.js +6 -0
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/plugins/radiantpreview/images/radiant-preview.png +0 -0
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/plugins/scayt/dialogs/options.js +4 -4
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/plugins/scayt/dialogs/toolbar.css +1 -1
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/plugins/showblocks/images/block_address.png +0 -0
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/plugins/showblocks/images/block_blockquote.png +0 -0
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/plugins/showblocks/images/block_div.png +0 -0
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/plugins/showblocks/images/block_h1.png +0 -0
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/plugins/showblocks/images/block_h2.png +0 -0
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/plugins/showblocks/images/block_h3.png +0 -0
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/plugins/showblocks/images/block_h4.png +0 -0
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/plugins/showblocks/images/block_h5.png +0 -0
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/plugins/showblocks/images/block_h6.png +0 -0
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/plugins/showblocks/images/block_p.png +0 -0
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/plugins/showblocks/images/block_pre.png +0 -0
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/plugins/smiley/dialogs/smiley.js +3 -3
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/plugins/specialchar/dialogs/specialchar.js +3 -3
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/plugins/specialchar/lang/en.js +6 -0
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/plugins/{stylescombo → styles}/styles/default.js +2 -2
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/plugins/stylesheetparser/plugin.js +6 -0
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/plugins/table/dialogs/table.js +5 -5
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/plugins/tableresize/plugin.js +7 -0
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/plugins/tabletools/dialogs/tableCell.js +4 -4
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/plugins/templates/dialogs/templates.js +3 -3
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/plugins/templates/templates/default.js +2 -2
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/plugins/uicolor/dialogs/uicolor.js +3 -3
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/plugins/uicolor/lang/en.js +1 -1
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/plugins/uicolor/lang/he.js +6 -0
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/plugins/uicolor/plugin.js +2 -2
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/plugins/uicolor/yui/assets/yui.css +2 -2
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/plugins/uicolor/yui/yui.js +1 -1
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/plugins/wsc/dialogs/ciframe.html +1 -1
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/plugins/wsc/dialogs/tmpFrameset.html +1 -1
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/plugins/wsc/dialogs/wsc.css +2 -2
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/plugins/wsc/dialogs/wsc.js +3 -3
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/plugins/xml/plugin.js +6 -0
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/skins/kama/dialog.css +5 -5
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/skins/kama/editor.css +9 -8
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/skins/kama/icons.png +0 -0
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/skins/kama/icons_rtl.png +0 -0
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/skins/kama/skin.js +3 -3
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/skins/kama/templates.css +2 -2
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/skins/office2003/dialog.css +5 -5
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/skins/office2003/editor.css +10 -9
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/skins/office2003/icons.png +0 -0
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/skins/office2003/icons_rtl.png +0 -0
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/skins/office2003/skin.js +2 -2
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/skins/office2003/templates.css +2 -2
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/skins/v2/dialog.css +5 -4
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/skins/v2/editor.css +9 -8
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/skins/v2/icons.png +0 -0
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/skins/v2/icons_rtl.png +0 -0
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/skins/v2/skin.js +2 -2
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/skins/v2/templates.css +2 -2
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/themes/default/theme.js +4 -4
- data/public/javascripts/extensions/ck_editor_filter/radiant.ckeditor.js +21 -12
- metadata +94 -9
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/_source/core/ajax.js +0 -143
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/_source/core/imagecacher.js +0 -58
- data/public/javascripts/extensions/ck_editor_filter/ckeditor/_source/core/xml.js +0 -165
data/public/javascripts/extensions/ck_editor_filter/ckeditor/_source/plugins/selection/plugin.js
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
/*
|
2
|
-
Copyright (c) 2003-
|
2
|
+
Copyright (c) 2003-2011, CKSource - Frederico Knabben. All rights reserved.
|
3
3
|
For licensing, see LICENSE.html or http://ckeditor.com/license
|
4
4
|
*/
|
5
5
|
|
@@ -17,7 +17,7 @@ For licensing, see LICENSE.html or http://ckeditor.com/license
|
|
17
17
|
// In IE, the "selectionchange" event may still get thrown when
|
18
18
|
// releasing the WYSIWYG mode, so we need to check it first.
|
19
19
|
var sel = this.getSelection();
|
20
|
-
if ( !sel )
|
20
|
+
if ( !sel || !sel.document.getWindow().$ )
|
21
21
|
return;
|
22
22
|
|
23
23
|
var firstElement = sel.getStartElement();
|
@@ -70,30 +70,170 @@ For licensing, see LICENSE.html or http://ckeditor.com/license
|
|
70
70
|
|
71
71
|
// #### checkSelectionChange : END
|
72
72
|
|
73
|
+
function rangeRequiresFix( range )
|
74
|
+
{
|
75
|
+
function isInlineCt( node )
|
76
|
+
{
|
77
|
+
return node && node.type == CKEDITOR.NODE_ELEMENT
|
78
|
+
&& node.getName() in CKEDITOR.dtd.$removeEmpty;
|
79
|
+
}
|
80
|
+
|
81
|
+
var start = range.startContainer,
|
82
|
+
offset = range.startOffset;
|
83
|
+
|
84
|
+
if ( start.type == CKEDITOR.NODE_TEXT )
|
85
|
+
return false;
|
86
|
+
|
87
|
+
// 1. Empty inline element. <span>^</span>
|
88
|
+
// 2. Adjoin to inline element. <p><strong>text</strong>^</p>
|
89
|
+
return !CKEDITOR.tools.trim( start.getHtml() ) ? isInlineCt( start ) : isInlineCt( start.getChild( offset - 1 ) ) || isInlineCt( start.getChild( offset ) );
|
90
|
+
}
|
91
|
+
|
73
92
|
var selectAllCmd =
|
74
93
|
{
|
94
|
+
modes : { wysiwyg : 1, source : 1 },
|
95
|
+
readOnly : CKEDITOR.env.ie || CKEDITOR.env.webkit,
|
75
96
|
exec : function( editor )
|
76
97
|
{
|
77
98
|
switch ( editor.mode )
|
78
99
|
{
|
79
100
|
case 'wysiwyg' :
|
80
101
|
editor.document.$.execCommand( 'SelectAll', false, null );
|
102
|
+
// Force triggering selectionChange (#7008)
|
103
|
+
editor.forceNextSelectionCheck();
|
104
|
+
editor.selectionChange();
|
81
105
|
break;
|
82
106
|
case 'source' :
|
83
|
-
//
|
107
|
+
// Select the contents of the textarea
|
108
|
+
var textarea = editor.textarea.$;
|
109
|
+
if ( CKEDITOR.env.ie )
|
110
|
+
textarea.createTextRange().execCommand( 'SelectAll' );
|
111
|
+
else
|
112
|
+
{
|
113
|
+
textarea.selectionStart = 0;
|
114
|
+
textarea.selectionEnd = textarea.value.length;
|
115
|
+
}
|
116
|
+
textarea.focus();
|
84
117
|
}
|
85
118
|
},
|
86
119
|
canUndo : false
|
87
120
|
};
|
88
121
|
|
122
|
+
function createFillingChar( doc )
|
123
|
+
{
|
124
|
+
removeFillingChar( doc );
|
125
|
+
|
126
|
+
var fillingChar = doc.createText( '\u200B' );
|
127
|
+
doc.setCustomData( 'cke-fillingChar', fillingChar );
|
128
|
+
|
129
|
+
return fillingChar;
|
130
|
+
}
|
131
|
+
|
132
|
+
function getFillingChar( doc )
|
133
|
+
{
|
134
|
+
return doc && doc.getCustomData( 'cke-fillingChar' );
|
135
|
+
}
|
136
|
+
|
137
|
+
// Checks if a filling char has been used, eventualy removing it (#1272).
|
138
|
+
function checkFillingChar( doc )
|
139
|
+
{
|
140
|
+
var fillingChar = doc && getFillingChar( doc );
|
141
|
+
if ( fillingChar )
|
142
|
+
{
|
143
|
+
// Use this flag to avoid removing the filling char right after
|
144
|
+
// creating it.
|
145
|
+
if ( fillingChar.getCustomData( 'ready' ) )
|
146
|
+
removeFillingChar( doc );
|
147
|
+
else
|
148
|
+
fillingChar.setCustomData( 'ready', 1 );
|
149
|
+
}
|
150
|
+
}
|
151
|
+
|
152
|
+
function removeFillingChar( doc )
|
153
|
+
{
|
154
|
+
var fillingChar = doc && doc.removeCustomData( 'cke-fillingChar' );
|
155
|
+
if ( fillingChar )
|
156
|
+
{
|
157
|
+
// We can't simply remove the filling node because the user
|
158
|
+
// will actually enlarge it when typing, so we just remove the
|
159
|
+
// invisible char from it.
|
160
|
+
fillingChar.setText( fillingChar.getText().replace( /\u200B/g, '' ) );
|
161
|
+
fillingChar = 0;
|
162
|
+
}
|
163
|
+
}
|
164
|
+
|
89
165
|
CKEDITOR.plugins.add( 'selection',
|
90
166
|
{
|
91
167
|
init : function( editor )
|
92
168
|
{
|
169
|
+
// On WebKit only, we need a special "filling" char on some situations
|
170
|
+
// (#1272). Here we set the events that should invalidate that char.
|
171
|
+
if ( CKEDITOR.env.webkit )
|
172
|
+
{
|
173
|
+
editor.on( 'selectionChange', function() { checkFillingChar( editor.document ); } );
|
174
|
+
editor.on( 'beforeSetMode', function() { removeFillingChar( editor.document ); } );
|
175
|
+
editor.on( 'key', function( e )
|
176
|
+
{
|
177
|
+
// Remove the filling char before some keys get
|
178
|
+
// executed, so they'll not get blocked by it.
|
179
|
+
switch ( e.data.keyCode )
|
180
|
+
{
|
181
|
+
case 13 : // ENTER
|
182
|
+
case CKEDITOR.SHIFT + 13 : // SHIFT-ENTER
|
183
|
+
case 37 : // LEFT-ARROW
|
184
|
+
case 39 : // RIGHT-ARROW
|
185
|
+
case 8 : // BACKSPACE
|
186
|
+
removeFillingChar( editor.document );
|
187
|
+
}
|
188
|
+
}, null, null, 10 );
|
189
|
+
|
190
|
+
var fillingCharBefore,
|
191
|
+
resetSelection;
|
192
|
+
|
193
|
+
function beforeData()
|
194
|
+
{
|
195
|
+
var doc = editor.document,
|
196
|
+
fillingChar = getFillingChar( doc );
|
197
|
+
|
198
|
+
if ( fillingChar )
|
199
|
+
{
|
200
|
+
// If cursor is right blinking by side of the filler node, save it for restoring,
|
201
|
+
// as the following text substitution will blind it. (#7437)
|
202
|
+
var sel = doc.$.defaultView.getSelection();
|
203
|
+
if ( sel.type == 'Caret' && sel.anchorNode == fillingChar.$ )
|
204
|
+
resetSelection = 1;
|
205
|
+
|
206
|
+
fillingCharBefore = fillingChar.getText();
|
207
|
+
fillingChar.setText( fillingCharBefore.replace( /\u200B/g, '' ) );
|
208
|
+
}
|
209
|
+
}
|
210
|
+
function afterData()
|
211
|
+
{
|
212
|
+
var doc = editor.document,
|
213
|
+
fillingChar = getFillingChar( doc );
|
214
|
+
|
215
|
+
if ( fillingChar )
|
216
|
+
{
|
217
|
+
fillingChar.setText( fillingCharBefore );
|
218
|
+
|
219
|
+
if ( resetSelection )
|
220
|
+
{
|
221
|
+
doc.$.defaultView.getSelection().setPosition( fillingChar.$,fillingChar.getLength() );
|
222
|
+
resetSelection = 0;
|
223
|
+
}
|
224
|
+
}
|
225
|
+
}
|
226
|
+
editor.on( 'beforeUndoImage', beforeData );
|
227
|
+
editor.on( 'afterUndoImage', afterData );
|
228
|
+
editor.on( 'beforeGetData', beforeData, null, null, 0 );
|
229
|
+
editor.on( 'getData', afterData );
|
230
|
+
}
|
231
|
+
|
93
232
|
editor.on( 'contentDom', function()
|
94
233
|
{
|
95
234
|
var doc = editor.document,
|
96
|
-
body = doc.getBody()
|
235
|
+
body = doc.getBody(),
|
236
|
+
html = doc.getDocumentElement();
|
97
237
|
|
98
238
|
if ( CKEDITOR.env.ie )
|
99
239
|
{
|
@@ -103,50 +243,139 @@ For licensing, see LICENSE.html or http://ckeditor.com/license
|
|
103
243
|
// than firing the selection change event.
|
104
244
|
|
105
245
|
var savedRange,
|
106
|
-
saveEnabled
|
246
|
+
saveEnabled,
|
247
|
+
restoreEnabled = 1;
|
107
248
|
|
108
249
|
// "onfocusin" is fired before "onfocus". It makes it
|
109
250
|
// possible to restore the selection before click
|
110
251
|
// events get executed.
|
111
|
-
body.on( 'focusin', function()
|
252
|
+
body.on( 'focusin', function( evt )
|
112
253
|
{
|
254
|
+
// If there are elements with layout they fire this event but
|
255
|
+
// it must be ignored to allow edit its contents #4682
|
256
|
+
if ( evt.data.$.srcElement.nodeName != 'BODY' )
|
257
|
+
return;
|
258
|
+
|
113
259
|
// If we have saved a range, restore it at this
|
114
260
|
// point.
|
115
261
|
if ( savedRange )
|
116
262
|
{
|
117
|
-
|
118
|
-
try
|
263
|
+
if ( restoreEnabled )
|
119
264
|
{
|
120
|
-
|
265
|
+
// Well not break because of this.
|
266
|
+
try
|
267
|
+
{
|
268
|
+
savedRange.select();
|
269
|
+
}
|
270
|
+
catch (e)
|
271
|
+
{}
|
272
|
+
|
273
|
+
// Update locked selection because of the normalized text nodes. (#6083, #6987)
|
274
|
+
var lockedSelection = doc.getCustomData( 'cke_locked_selection' );
|
275
|
+
if ( lockedSelection )
|
276
|
+
{
|
277
|
+
lockedSelection.unlock();
|
278
|
+
lockedSelection.lock();
|
279
|
+
}
|
121
280
|
}
|
122
|
-
catch (e)
|
123
|
-
{}
|
124
281
|
|
125
282
|
savedRange = null;
|
126
283
|
}
|
127
284
|
});
|
128
285
|
|
129
|
-
|
286
|
+
body.on( 'focus', function()
|
130
287
|
{
|
131
288
|
// Enable selections to be saved.
|
132
|
-
saveEnabled =
|
289
|
+
saveEnabled = 1;
|
133
290
|
|
134
291
|
saveSelection();
|
135
292
|
});
|
136
293
|
|
137
|
-
body.on( 'beforedeactivate', function()
|
294
|
+
body.on( 'beforedeactivate', function( evt )
|
138
295
|
{
|
296
|
+
// Ignore this event if it's caused by focus switch between
|
297
|
+
// internal editable control type elements, e.g. layouted paragraph. (#4682)
|
298
|
+
if ( evt.data.$.toElement )
|
299
|
+
return;
|
300
|
+
|
139
301
|
// Disable selections from being saved.
|
140
|
-
saveEnabled =
|
302
|
+
saveEnabled = 0;
|
303
|
+
restoreEnabled = 1;
|
141
304
|
});
|
142
305
|
|
306
|
+
// IE before version 8 will leave cursor blinking inside the document after
|
307
|
+
// editor blurred unless we clean up the selection. (#4716)
|
308
|
+
if ( CKEDITOR.env.ie && CKEDITOR.env.version < 8 )
|
309
|
+
{
|
310
|
+
editor.on( 'blur', function( evt )
|
311
|
+
{
|
312
|
+
// Try/Catch to avoid errors if the editor is hidden. (#6375)
|
313
|
+
try
|
314
|
+
{
|
315
|
+
editor.document && editor.document.$.selection.empty();
|
316
|
+
}
|
317
|
+
catch (e) {}
|
318
|
+
});
|
319
|
+
}
|
320
|
+
|
321
|
+
// Listening on document element ensures that
|
322
|
+
// scrollbar is included. (#5280)
|
323
|
+
html.on( 'mousedown', function()
|
324
|
+
{
|
325
|
+
// Lock restore selection now, as we have
|
326
|
+
// a followed 'click' event which introduce
|
327
|
+
// new selection. (#5735)
|
328
|
+
restoreEnabled = 0;
|
329
|
+
});
|
330
|
+
|
331
|
+
html.on( 'mouseup', function()
|
332
|
+
{
|
333
|
+
restoreEnabled = 1;
|
334
|
+
});
|
335
|
+
|
336
|
+
// In IE6/7 the blinking cursor appears, but contents are
|
337
|
+
// not editable. (#5634)
|
338
|
+
if ( CKEDITOR.env.ie && ( CKEDITOR.env.ie7Compat || CKEDITOR.env.version < 8 || CKEDITOR.env.quirks ) )
|
339
|
+
{
|
340
|
+
// The 'click' event is not fired when clicking the
|
341
|
+
// scrollbars, so we can use it to check whether
|
342
|
+
// the empty space following <body> has been clicked.
|
343
|
+
html.on( 'click', function( evt )
|
344
|
+
{
|
345
|
+
if ( evt.data.getTarget().getName() == 'html' )
|
346
|
+
editor.getSelection().getRanges()[ 0 ].select();
|
347
|
+
});
|
348
|
+
}
|
349
|
+
|
350
|
+
var scroll;
|
143
351
|
// IE fires the "selectionchange" event when clicking
|
144
352
|
// inside a selection. We don't want to capture that.
|
145
|
-
body.on( 'mousedown',
|
353
|
+
body.on( 'mousedown', function( evt )
|
354
|
+
{
|
355
|
+
// IE scrolls document to top on right mousedown
|
356
|
+
// when editor has no focus, remember this scroll
|
357
|
+
// position and revert it before context menu opens. (#5778)
|
358
|
+
if ( evt.data.$.button == 2 )
|
359
|
+
{
|
360
|
+
var sel = editor.document.$.selection;
|
361
|
+
if ( sel.type == 'None' )
|
362
|
+
scroll = editor.window.getScrollPosition();
|
363
|
+
}
|
364
|
+
disableSave();
|
365
|
+
});
|
366
|
+
|
146
367
|
body.on( 'mouseup',
|
147
|
-
function()
|
368
|
+
function( evt )
|
148
369
|
{
|
149
|
-
|
370
|
+
// Restore recorded scroll position when needed on right mouseup.
|
371
|
+
if ( evt.data.$.button == 2 && scroll )
|
372
|
+
{
|
373
|
+
editor.document.$.documentElement.scrollLeft = scroll.x;
|
374
|
+
editor.document.$.documentElement.scrollTop = scroll.y;
|
375
|
+
}
|
376
|
+
scroll = null;
|
377
|
+
|
378
|
+
saveEnabled = 1;
|
150
379
|
setTimeout( function()
|
151
380
|
{
|
152
381
|
saveSelection( true );
|
@@ -158,7 +387,7 @@ For licensing, see LICENSE.html or http://ckeditor.com/license
|
|
158
387
|
body.on( 'keyup',
|
159
388
|
function()
|
160
389
|
{
|
161
|
-
saveEnabled =
|
390
|
+
saveEnabled = 1;
|
162
391
|
saveSelection();
|
163
392
|
});
|
164
393
|
|
@@ -169,7 +398,7 @@ For licensing, see LICENSE.html or http://ckeditor.com/license
|
|
169
398
|
|
170
399
|
function disableSave()
|
171
400
|
{
|
172
|
-
saveEnabled =
|
401
|
+
saveEnabled = 0;
|
173
402
|
}
|
174
403
|
|
175
404
|
function saveSelection( testIt )
|
@@ -177,7 +406,8 @@ For licensing, see LICENSE.html or http://ckeditor.com/license
|
|
177
406
|
if ( saveEnabled )
|
178
407
|
{
|
179
408
|
var doc = editor.document,
|
180
|
-
sel =
|
409
|
+
sel = editor.getSelection(),
|
410
|
+
nativeSel = sel && sel.getNative();
|
181
411
|
|
182
412
|
// There is a very specific case, when clicking
|
183
413
|
// inside a text selection. In that case, the
|
@@ -187,7 +417,7 @@ For licensing, see LICENSE.html or http://ckeditor.com/license
|
|
187
417
|
// range at the very start of the document. In
|
188
418
|
// such situation we have to test the range, to
|
189
419
|
// be sure it's valid.
|
190
|
-
if ( testIt &&
|
420
|
+
if ( testIt && nativeSel && nativeSel.type == 'None' )
|
191
421
|
{
|
192
422
|
// The "InsertImage" command can be used to
|
193
423
|
// test whether the selection is good or not.
|
@@ -200,7 +430,18 @@ For licensing, see LICENSE.html or http://ckeditor.com/license
|
|
200
430
|
}
|
201
431
|
}
|
202
432
|
|
203
|
-
|
433
|
+
// Avoid saving selection from within text input. (#5747)
|
434
|
+
var parentTag;
|
435
|
+
if ( nativeSel && nativeSel.type && nativeSel.type != 'Control'
|
436
|
+
&& ( parentTag = nativeSel.createRange() )
|
437
|
+
&& ( parentTag = parentTag.parentElement() )
|
438
|
+
&& ( parentTag = parentTag.nodeName )
|
439
|
+
&& parentTag.toLowerCase() in { input: 1, textarea : 1 } )
|
440
|
+
{
|
441
|
+
return;
|
442
|
+
}
|
443
|
+
|
444
|
+
savedRange = nativeSel && sel.getRanges()[ 0 ];
|
204
445
|
|
205
446
|
checkSelectionChangeTimeout.call( editor );
|
206
447
|
}
|
@@ -217,6 +458,9 @@ For licensing, see LICENSE.html or http://ckeditor.com/license
|
|
217
458
|
}
|
218
459
|
});
|
219
460
|
|
461
|
+
// Clear the cached range path before unload. (#7174)
|
462
|
+
editor.on( 'contentDomUnload', editor.forceNextSelectionCheck, editor );
|
463
|
+
|
220
464
|
editor.addCommand( 'selectAll', selectAllCmd );
|
221
465
|
editor.ui.addButton( 'SelectAll',
|
222
466
|
{
|
@@ -299,7 +543,7 @@ For licensing, see LICENSE.html or http://ckeditor.com/license
|
|
299
543
|
return lockedSelection;
|
300
544
|
|
301
545
|
this.document = document;
|
302
|
-
this.isLocked =
|
546
|
+
this.isLocked = 0;
|
303
547
|
this._ =
|
304
548
|
{
|
305
549
|
cache : {}
|
@@ -324,10 +568,10 @@ For licensing, see LICENSE.html or http://ckeditor.com/license
|
|
324
568
|
};
|
325
569
|
|
326
570
|
var styleObjectElements =
|
327
|
-
|
328
|
-
|
329
|
-
|
330
|
-
|
571
|
+
{
|
572
|
+
img:1,hr:1,li:1,table:1,tr:1,td:1,th:1,embed:1,object:1,ol:1,ul:1,
|
573
|
+
a:1,input:1,form:1,select:1,textarea:1,button:1,fieldset:1,thead:1,tfoot:1
|
574
|
+
};
|
331
575
|
|
332
576
|
CKEDITOR.dom.selection.prototype =
|
333
577
|
{
|
@@ -433,10 +677,22 @@ For licensing, see LICENSE.html or http://ckeditor.com/license
|
|
433
677
|
return ( cache.type = type );
|
434
678
|
},
|
435
679
|
|
436
|
-
|
437
|
-
|
680
|
+
/**
|
681
|
+
* Retrieve the {@link CKEDITOR.dom.range} instances that represent the current selection.
|
682
|
+
* Note: Some browsers returns multiple ranges even on a sequent selection, e.g. Firefox returns
|
683
|
+
* one range for each table cell when one or more table row is selected.
|
684
|
+
* @return {Array}
|
685
|
+
* @example
|
686
|
+
* var ranges = selection.getRanges();
|
687
|
+
* alert(ranges.length);
|
688
|
+
*/
|
689
|
+
getRanges : (function()
|
690
|
+
{
|
691
|
+
var func = CKEDITOR.env.ie ?
|
438
692
|
( function()
|
439
693
|
{
|
694
|
+
function getNodeIndex( node ) { return new CKEDITOR.dom.node( node ).getIndex(); }
|
695
|
+
|
440
696
|
// Finds the container and offset for a specific boundary
|
441
697
|
// of an IE range.
|
442
698
|
var getBoundaryInformation = function( range, start )
|
@@ -446,86 +702,126 @@ For licensing, see LICENSE.html or http://ckeditor.com/license
|
|
446
702
|
range.collapse( start );
|
447
703
|
|
448
704
|
// Gets the element that encloses the range entirely.
|
449
|
-
var parent = range.parentElement()
|
450
|
-
|
451
|
-
|
452
|
-
|
453
|
-
|
454
|
-
|
705
|
+
var parent = range.parentElement(),
|
706
|
+
doc = parent.ownerDocument;
|
707
|
+
|
708
|
+
// Empty parent element, e.g. <i>^</i>
|
709
|
+
if ( !parent.hasChildNodes() )
|
710
|
+
return { container : parent, offset : 0 };
|
711
|
+
|
712
|
+
var siblings = parent.children,
|
713
|
+
child,
|
714
|
+
sibling,
|
715
|
+
testRange = range.duplicate(),
|
716
|
+
startIndex = 0,
|
717
|
+
endIndex = siblings.length - 1,
|
718
|
+
index = -1,
|
719
|
+
position,
|
720
|
+
distance;
|
721
|
+
|
722
|
+
// Binary search over all element childs to test the range to see whether
|
723
|
+
// range is right on the boundary of one element.
|
724
|
+
while ( startIndex <= endIndex )
|
455
725
|
{
|
456
|
-
|
457
|
-
|
726
|
+
index = Math.floor( ( startIndex + endIndex ) / 2 );
|
727
|
+
child = siblings[ index ];
|
728
|
+
testRange.moveToElementText( child );
|
729
|
+
position = testRange.compareEndPoints( 'StartToStart', range );
|
730
|
+
|
731
|
+
if ( position > 0 )
|
732
|
+
endIndex = index - 1;
|
733
|
+
else if ( position < 0 )
|
734
|
+
startIndex = index + 1;
|
735
|
+
else
|
458
736
|
{
|
459
|
-
|
460
|
-
|
461
|
-
|
462
|
-
|
463
|
-
|
464
|
-
|
465
|
-
|
466
|
-
|
467
|
-
|
468
|
-
|
469
|
-
|
470
|
-
|
471
|
-
|
472
|
-
else if ( !comparisonStart
|
473
|
-
|| comparisonEnd == 1 && comparisonStart == -1 )
|
474
|
-
return { container : parent, offset : i };
|
475
|
-
else if ( !comparisonEnd )
|
476
|
-
return { container : parent, offset : i + 1 };
|
477
|
-
|
478
|
-
testRange = null;
|
737
|
+
// IE9 report wrong measurement with compareEndPoints when range anchors between two BRs.
|
738
|
+
// e.g. <p>text<br />^<br /></p> (#7433)
|
739
|
+
if ( CKEDITOR.env.ie9Compat && child.tagName == 'BR' )
|
740
|
+
{
|
741
|
+
var bmId = 'cke_range_marker';
|
742
|
+
range.execCommand( 'CreateBookmark', false, bmId );
|
743
|
+
child = doc.getElementsByName( bmId )[ 0 ];
|
744
|
+
var offset = getNodeIndex( child );
|
745
|
+
parent.removeChild( child );
|
746
|
+
return { container : parent, offset : offset };
|
747
|
+
}
|
748
|
+
else
|
749
|
+
return { container : parent, offset : getNodeIndex( child ) };
|
479
750
|
}
|
480
751
|
}
|
481
752
|
|
482
|
-
|
753
|
+
// All childs are text nodes,
|
754
|
+
// or to the right hand of test range are all text nodes. (#6992)
|
755
|
+
if ( index == -1 || index == siblings.length - 1 && position < 0 )
|
483
756
|
{
|
484
|
-
|
757
|
+
// Adapt test range to embrace the entire parent contents.
|
485
758
|
testRange.moveToElementText( parent );
|
486
|
-
testRange.
|
487
|
-
}
|
759
|
+
testRange.setEndPoint( 'StartToStart', range );
|
488
760
|
|
489
|
-
|
490
|
-
|
491
|
-
|
492
|
-
|
493
|
-
var distance = testRange.text.replace( /(\r\n|\r)/g, '\n' ).length;
|
761
|
+
// IE report line break as CRLF with range.text but
|
762
|
+
// only LF with textnode.nodeValue, normalize them to avoid
|
763
|
+
// breaking character counting logic below. (#3949)
|
764
|
+
distance = testRange.text.replace( /(\r\n|\r)/g, '\n' ).length;
|
494
765
|
|
495
|
-
|
496
|
-
|
766
|
+
siblings = parent.childNodes;
|
767
|
+
|
768
|
+
// Actual range anchor right beside test range at the boundary of text node.
|
769
|
+
if ( !distance )
|
770
|
+
{
|
771
|
+
child = siblings[ siblings.length - 1 ];
|
772
|
+
|
773
|
+
if ( child.nodeType == CKEDITOR.NODE_ELEMENT )
|
774
|
+
return { container : parent, offset : siblings.length };
|
775
|
+
else
|
776
|
+
return { container : child, offset : child.nodeValue.length };
|
777
|
+
}
|
778
|
+
|
779
|
+
// Start the measuring until distance overflows, meanwhile count the text nodes.
|
780
|
+
var i = siblings.length;
|
497
781
|
while ( distance > 0 )
|
498
782
|
distance -= siblings[ --i ].nodeValue.length;
|
499
|
-
}
|
500
|
-
// Measurement in IE could be somtimes wrong because of <select> element. (#4611)
|
501
|
-
catch( e )
|
502
|
-
{
|
503
|
-
distance = 0;
|
504
|
-
}
|
505
783
|
|
506
|
-
|
507
|
-
if ( distance === 0 )
|
508
|
-
{
|
509
|
-
return {
|
510
|
-
container : parent,
|
511
|
-
offset : i
|
512
|
-
};
|
784
|
+
return { container : siblings[ i ], offset : -distance };
|
513
785
|
}
|
786
|
+
// Test range was one offset beyond OR behind the anchored text node.
|
514
787
|
else
|
515
788
|
{
|
516
|
-
|
517
|
-
|
518
|
-
|
519
|
-
|
789
|
+
// Adapt one side of test range to the actual range
|
790
|
+
// for measuring the offset between them.
|
791
|
+
testRange.collapse( position > 0 ? true : false );
|
792
|
+
testRange.setEndPoint( position > 0 ? 'StartToStart' : 'EndToStart', range );
|
793
|
+
|
794
|
+
// IE report line break as CRLF with range.text but
|
795
|
+
// only LF with textnode.nodeValue, normalize them to avoid
|
796
|
+
// breaking character counting logic below. (#3949)
|
797
|
+
distance = testRange.text.replace( /(\r\n|\r)/g, '\n' ).length;
|
798
|
+
|
799
|
+
// Actual range anchor right beside test range at the inner boundary of text node.
|
800
|
+
if ( !distance )
|
801
|
+
return { container : parent, offset : getNodeIndex( child ) + ( position > 0 ? 0 : 1 ) };
|
802
|
+
|
803
|
+
// Start the measuring until distance overflows, meanwhile count the text nodes.
|
804
|
+
while ( distance > 0 )
|
805
|
+
{
|
806
|
+
try
|
807
|
+
{
|
808
|
+
sibling = child[ position > 0 ? 'previousSibling' : 'nextSibling' ];
|
809
|
+
distance -= sibling.nodeValue.length;
|
810
|
+
child = sibling;
|
811
|
+
}
|
812
|
+
// Measurement in IE could be somtimes wrong because of <select> element. (#4611)
|
813
|
+
catch( e )
|
814
|
+
{
|
815
|
+
return { container : parent, offset : getNodeIndex( child ) };
|
816
|
+
}
|
817
|
+
}
|
818
|
+
|
819
|
+
return { container : child, offset : position > 0 ? -distance : child.nodeValue.length + distance };
|
520
820
|
}
|
521
821
|
};
|
522
822
|
|
523
823
|
return function()
|
524
824
|
{
|
525
|
-
var cache = this._.cache;
|
526
|
-
if ( cache.ranges )
|
527
|
-
return cache.ranges;
|
528
|
-
|
529
825
|
// IE doesn't have range support (in the W3C way), so we
|
530
826
|
// need to do some magic to transform selections into
|
531
827
|
// CKEDITOR.dom.range instances.
|
@@ -548,11 +844,18 @@ For licensing, see LICENSE.html or http://ckeditor.com/license
|
|
548
844
|
boundaryInfo = getBoundaryInformation( nativeRange );
|
549
845
|
range.setEnd( new CKEDITOR.dom.node( boundaryInfo.container ), boundaryInfo.offset );
|
550
846
|
|
551
|
-
|
847
|
+
// Correct an invalid IE range case on empty list item. (#5850)
|
848
|
+
if ( range.endContainer.getPosition( range.startContainer ) & CKEDITOR.POSITION_PRECEDING
|
849
|
+
&& range.endOffset <= range.startContainer.getIndex() )
|
850
|
+
{
|
851
|
+
range.collapse();
|
852
|
+
}
|
853
|
+
|
854
|
+
return [ range ];
|
552
855
|
}
|
553
856
|
else if ( type == CKEDITOR.SELECTION_ELEMENT )
|
554
857
|
{
|
555
|
-
var retval =
|
858
|
+
var retval = [];
|
556
859
|
|
557
860
|
for ( var i = 0 ; i < nativeRange.length ; i++ )
|
558
861
|
{
|
@@ -573,38 +876,140 @@ For licensing, see LICENSE.html or http://ckeditor.com/license
|
|
573
876
|
return retval;
|
574
877
|
}
|
575
878
|
|
576
|
-
return
|
879
|
+
return [];
|
577
880
|
};
|
578
881
|
})()
|
579
882
|
:
|
580
883
|
function()
|
581
884
|
{
|
582
|
-
var cache = this._.cache;
|
583
|
-
if ( cache.ranges )
|
584
|
-
return cache.ranges;
|
585
885
|
|
586
886
|
// On browsers implementing the W3C range, we simply
|
587
887
|
// tranform the native ranges in CKEDITOR.dom.range
|
588
888
|
// instances.
|
589
889
|
|
590
|
-
var ranges = []
|
591
|
-
|
890
|
+
var ranges = [],
|
891
|
+
range,
|
892
|
+
doc = this.document,
|
893
|
+
sel = this.getNative();
|
592
894
|
|
593
895
|
if ( !sel )
|
594
|
-
return
|
896
|
+
return ranges;
|
897
|
+
|
898
|
+
// On WebKit, it may happen that we'll have no selection
|
899
|
+
// available. We normalize it here by replicating the
|
900
|
+
// behavior of other browsers.
|
901
|
+
if ( !sel.rangeCount )
|
902
|
+
{
|
903
|
+
range = new CKEDITOR.dom.range( doc );
|
904
|
+
range.moveToElementEditStart( doc.getBody() );
|
905
|
+
ranges.push( range );
|
906
|
+
}
|
595
907
|
|
596
908
|
for ( var i = 0 ; i < sel.rangeCount ; i++ )
|
597
909
|
{
|
598
910
|
var nativeRange = sel.getRangeAt( i );
|
599
|
-
|
911
|
+
|
912
|
+
range = new CKEDITOR.dom.range( doc );
|
600
913
|
|
601
914
|
range.setStart( new CKEDITOR.dom.node( nativeRange.startContainer ), nativeRange.startOffset );
|
602
915
|
range.setEnd( new CKEDITOR.dom.node( nativeRange.endContainer ), nativeRange.endOffset );
|
603
916
|
ranges.push( range );
|
604
917
|
}
|
918
|
+
return ranges;
|
919
|
+
};
|
605
920
|
|
606
|
-
|
607
|
-
|
921
|
+
return function( onlyEditables )
|
922
|
+
{
|
923
|
+
var cache = this._.cache;
|
924
|
+
if ( cache.ranges && !onlyEditables )
|
925
|
+
return cache.ranges;
|
926
|
+
else if ( !cache.ranges )
|
927
|
+
cache.ranges = new CKEDITOR.dom.rangeList( func.call( this ) );
|
928
|
+
|
929
|
+
// Split range into multiple by read-only nodes.
|
930
|
+
if ( onlyEditables )
|
931
|
+
{
|
932
|
+
var ranges = cache.ranges;
|
933
|
+
for ( var i = 0; i < ranges.length; i++ )
|
934
|
+
{
|
935
|
+
var range = ranges[ i ];
|
936
|
+
|
937
|
+
// Drop range spans inside one ready-only node.
|
938
|
+
var parent = range.getCommonAncestor();
|
939
|
+
if ( parent.isReadOnly() )
|
940
|
+
ranges.splice( i, 1 );
|
941
|
+
|
942
|
+
if ( range.collapsed )
|
943
|
+
continue;
|
944
|
+
|
945
|
+
var startContainer = range.startContainer,
|
946
|
+
endContainer = range.endContainer,
|
947
|
+
startOffset = range.startOffset,
|
948
|
+
endOffset = range.endOffset,
|
949
|
+
walkerRange = range.clone();
|
950
|
+
|
951
|
+
// Range may start inside a non-editable element, restart range
|
952
|
+
// by the end of it.
|
953
|
+
var readOnly;
|
954
|
+
if ( ( readOnly = startContainer.isReadOnly() ) )
|
955
|
+
range.setStartAfter( readOnly );
|
956
|
+
|
957
|
+
// Enlarge range start/end with text node to avoid walker
|
958
|
+
// being DOM destructive, it doesn't interfere our checking
|
959
|
+
// of elements below as well.
|
960
|
+
if ( startContainer && startContainer.type == CKEDITOR.NODE_TEXT )
|
961
|
+
{
|
962
|
+
if ( startOffset >= startContainer.getLength() )
|
963
|
+
walkerRange.setStartAfter( startContainer );
|
964
|
+
else
|
965
|
+
walkerRange.setStartBefore( startContainer );
|
966
|
+
}
|
967
|
+
|
968
|
+
if ( endContainer && endContainer.type == CKEDITOR.NODE_TEXT )
|
969
|
+
{
|
970
|
+
if ( !endOffset )
|
971
|
+
walkerRange.setEndBefore( endContainer );
|
972
|
+
else
|
973
|
+
walkerRange.setEndAfter( endContainer );
|
974
|
+
}
|
975
|
+
|
976
|
+
// Looking for non-editable element inside the range.
|
977
|
+
var walker = new CKEDITOR.dom.walker( walkerRange );
|
978
|
+
walker.evaluator = function( node )
|
979
|
+
{
|
980
|
+
if ( node.type == CKEDITOR.NODE_ELEMENT
|
981
|
+
&& node.isReadOnly() )
|
982
|
+
{
|
983
|
+
var newRange = range.clone();
|
984
|
+
range.setEndBefore( node );
|
985
|
+
|
986
|
+
// Drop collapsed range around read-only elements,
|
987
|
+
// it make sure the range list empty when selecting
|
988
|
+
// only non-editable elements.
|
989
|
+
if ( range.collapsed )
|
990
|
+
ranges.splice( i--, 1 );
|
991
|
+
|
992
|
+
// Avoid creating invalid range.
|
993
|
+
if ( !( node.getPosition( walkerRange.endContainer ) & CKEDITOR.POSITION_CONTAINS ) )
|
994
|
+
{
|
995
|
+
newRange.setStartAfter( node );
|
996
|
+
if ( !newRange.collapsed )
|
997
|
+
ranges.splice( i + 1, 0, newRange );
|
998
|
+
}
|
999
|
+
|
1000
|
+
return true;
|
1001
|
+
}
|
1002
|
+
|
1003
|
+
return false;
|
1004
|
+
};
|
1005
|
+
|
1006
|
+
walker.next();
|
1007
|
+
}
|
1008
|
+
}
|
1009
|
+
|
1010
|
+
return cache.ranges;
|
1011
|
+
};
|
1012
|
+
})(),
|
608
1013
|
|
609
1014
|
/**
|
610
1015
|
* Gets the DOM element in which the selection starts.
|
@@ -641,7 +1046,7 @@ For licensing, see LICENSE.html or http://ckeditor.com/license
|
|
641
1046
|
// Decrease the range content to exclude particial
|
642
1047
|
// selected node on the start which doesn't have
|
643
1048
|
// visual impact. ( #3231 )
|
644
|
-
while (
|
1049
|
+
while ( 1 )
|
645
1050
|
{
|
646
1051
|
var startContainer = range.startContainer,
|
647
1052
|
startOffset = range.startOffset;
|
@@ -661,32 +1066,25 @@ For licensing, see LICENSE.html or http://ckeditor.com/license
|
|
661
1066
|
node = node.getChild( range.startOffset );
|
662
1067
|
|
663
1068
|
if ( !node || node.type != CKEDITOR.NODE_ELEMENT )
|
664
|
-
|
665
|
-
|
666
|
-
var child = node.getFirst();
|
667
|
-
while ( child && child.type == CKEDITOR.NODE_ELEMENT )
|
1069
|
+
node = range.startContainer;
|
1070
|
+
else
|
668
1071
|
{
|
669
|
-
|
670
|
-
child
|
1072
|
+
var child = node.getFirst();
|
1073
|
+
while ( child && child.type == CKEDITOR.NODE_ELEMENT )
|
1074
|
+
{
|
1075
|
+
node = child;
|
1076
|
+
child = child.getFirst();
|
1077
|
+
}
|
671
1078
|
}
|
672
|
-
|
673
|
-
return node;
|
674
1079
|
}
|
675
|
-
|
676
|
-
|
677
|
-
|
678
|
-
|
679
|
-
|
680
|
-
|
681
|
-
|
682
|
-
node = range.parentElement();
|
683
|
-
}
|
684
|
-
else
|
685
|
-
{
|
686
|
-
node = sel.anchorNode;
|
1080
|
+
else
|
1081
|
+
{
|
1082
|
+
node = range.startContainer;
|
1083
|
+
if ( node.type != CKEDITOR.NODE_ELEMENT )
|
1084
|
+
node = node.getParent();
|
1085
|
+
}
|
687
1086
|
|
688
|
-
|
689
|
-
node = node.parentNode;
|
1087
|
+
node = node.$;
|
690
1088
|
}
|
691
1089
|
}
|
692
1090
|
|
@@ -708,26 +1106,34 @@ For licensing, see LICENSE.html or http://ckeditor.com/license
|
|
708
1106
|
if ( cache.selectedElement !== undefined )
|
709
1107
|
return cache.selectedElement;
|
710
1108
|
|
711
|
-
var
|
712
|
-
|
713
|
-
if ( this.getType() == CKEDITOR.SELECTION_ELEMENT )
|
714
|
-
{
|
715
|
-
var sel = this.getNative();
|
1109
|
+
var self = this;
|
716
1110
|
|
717
|
-
|
1111
|
+
var node = CKEDITOR.tools.tryThese(
|
1112
|
+
// Is it native IE control type selection?
|
1113
|
+
function()
|
718
1114
|
{
|
719
|
-
|
1115
|
+
return self.getNative().createRange().item( 0 );
|
1116
|
+
},
|
1117
|
+
// Figure it out by checking if there's a single enclosed
|
1118
|
+
// node of the range.
|
1119
|
+
function()
|
1120
|
+
{
|
1121
|
+
var range = self.getRanges()[ 0 ],
|
1122
|
+
enclosed,
|
1123
|
+
selected;
|
1124
|
+
|
1125
|
+
// Check first any enclosed element, e.g. <ul>[<li><a href="#">item</a></li>]</ul>
|
1126
|
+
for ( var i = 2; i && !( ( enclosed = range.getEnclosedNode() )
|
1127
|
+
&& ( enclosed.type == CKEDITOR.NODE_ELEMENT )
|
1128
|
+
&& styleObjectElements[ enclosed.getName() ]
|
1129
|
+
&& ( selected = enclosed ) ); i-- )
|
720
1130
|
{
|
721
|
-
|
1131
|
+
// Then check any deep wrapped element, e.g. [<b><i><img /></i></b>]
|
1132
|
+
range.shrink( CKEDITOR.SHRINK_ELEMENT );
|
722
1133
|
}
|
723
|
-
|
724
|
-
|
725
|
-
|
726
|
-
{
|
727
|
-
var range = sel.getRangeAt( 0 );
|
728
|
-
node = range.startContainer.childNodes[ range.startOffset ];
|
729
|
-
}
|
730
|
-
}
|
1134
|
+
|
1135
|
+
return selected.$;
|
1136
|
+
});
|
731
1137
|
|
732
1138
|
return cache.selectedElement = ( node ? new CKEDITOR.dom.element( node ) : null );
|
733
1139
|
},
|
@@ -742,7 +1148,7 @@ For licensing, see LICENSE.html or http://ckeditor.com/license
|
|
742
1148
|
// The native selection is not available when locked.
|
743
1149
|
this._.cache.nativeSel = {};
|
744
1150
|
|
745
|
-
this.isLocked =
|
1151
|
+
this.isLocked = 1;
|
746
1152
|
|
747
1153
|
// Save this selection inside the DOM document.
|
748
1154
|
this.document.setCustomData( 'cke_locked_selection', this );
|
@@ -762,7 +1168,7 @@ For licensing, see LICENSE.html or http://ckeditor.com/license
|
|
762
1168
|
var selectedElement = lockedSelection.getSelectedElement(),
|
763
1169
|
ranges = !selectedElement && lockedSelection.getRanges();
|
764
1170
|
|
765
|
-
this.isLocked =
|
1171
|
+
this.isLocked = 0;
|
766
1172
|
this.reset();
|
767
1173
|
|
768
1174
|
doc.getBody().focus();
|
@@ -776,7 +1182,7 @@ For licensing, see LICENSE.html or http://ckeditor.com/license
|
|
776
1182
|
|
777
1183
|
if ( !lockedSelection || !restore )
|
778
1184
|
{
|
779
|
-
this.isLocked =
|
1185
|
+
this.isLocked = 0;
|
780
1186
|
this.reset();
|
781
1187
|
}
|
782
1188
|
},
|
@@ -786,6 +1192,10 @@ For licensing, see LICENSE.html or http://ckeditor.com/license
|
|
786
1192
|
this._.cache = {};
|
787
1193
|
},
|
788
1194
|
|
1195
|
+
/**
|
1196
|
+
* Make the current selection of type {@link CKEDITOR.SELECTION_ELEMENT} by enclosing the specified element.
|
1197
|
+
* @param element
|
1198
|
+
*/
|
789
1199
|
selectElement : function( element )
|
790
1200
|
{
|
791
1201
|
if ( this.isLocked )
|
@@ -796,55 +1206,34 @@ For licensing, see LICENSE.html or http://ckeditor.com/license
|
|
796
1206
|
|
797
1207
|
this._.cache.selectedElement = element;
|
798
1208
|
this._.cache.startElement = element;
|
799
|
-
this._.cache.ranges =
|
1209
|
+
this._.cache.ranges = new CKEDITOR.dom.rangeList( range );
|
800
1210
|
this._.cache.type = CKEDITOR.SELECTION_ELEMENT;
|
801
1211
|
|
802
1212
|
return;
|
803
1213
|
}
|
804
1214
|
|
805
|
-
|
806
|
-
|
807
|
-
|
1215
|
+
range = new CKEDITOR.dom.range( element.getDocument() );
|
1216
|
+
range.setStartBefore( element );
|
1217
|
+
range.setEndAfter( element );
|
1218
|
+
range.select();
|
808
1219
|
|
809
|
-
|
810
|
-
|
811
|
-
// Try to select the node as a control.
|
812
|
-
range = this.document.$.body.createControlRange();
|
813
|
-
range.addElement( element.$ );
|
814
|
-
range.select();
|
815
|
-
}
|
816
|
-
catch(e)
|
817
|
-
{
|
818
|
-
// If failed, select it as a text range.
|
819
|
-
range = this.document.$.body.createTextRange();
|
820
|
-
range.moveToElementText( element.$ );
|
821
|
-
range.select();
|
822
|
-
}
|
1220
|
+
this.document.fire( 'selectionchange' );
|
1221
|
+
this.reset();
|
823
1222
|
|
824
|
-
this.reset();
|
825
|
-
}
|
826
|
-
else
|
827
|
-
{
|
828
|
-
// Create the range for the element.
|
829
|
-
range = this.document.$.createRange();
|
830
|
-
range.selectNode( element.$ );
|
831
|
-
|
832
|
-
// Select the range.
|
833
|
-
var sel = this.getNative();
|
834
|
-
sel.removeAllRanges();
|
835
|
-
sel.addRange( range );
|
836
|
-
|
837
|
-
this.reset();
|
838
|
-
}
|
839
1223
|
},
|
840
1224
|
|
1225
|
+
/**
|
1226
|
+
* Adding the specified ranges to document selection preceding
|
1227
|
+
* by clearing up the original selection.
|
1228
|
+
* @param {CKEDITOR.dom.range} ranges
|
1229
|
+
*/
|
841
1230
|
selectRanges : function( ranges )
|
842
1231
|
{
|
843
1232
|
if ( this.isLocked )
|
844
1233
|
{
|
845
1234
|
this._.cache.selectedElement = null;
|
846
|
-
this._.cache.startElement = ranges[ 0 ].getTouchedStartNode();
|
847
|
-
this._.cache.ranges = ranges;
|
1235
|
+
this._.cache.startElement = ranges[ 0 ] && ranges[ 0 ].getTouchedStartNode();
|
1236
|
+
this._.cache.ranges = new CKEDITOR.dom.rangeList( ranges );
|
848
1237
|
this._.cache.type = CKEDITOR.SELECTION_TEXT;
|
849
1238
|
|
850
1239
|
return;
|
@@ -852,8 +1241,14 @@ For licensing, see LICENSE.html or http://ckeditor.com/license
|
|
852
1241
|
|
853
1242
|
if ( CKEDITOR.env.ie )
|
854
1243
|
{
|
855
|
-
|
856
|
-
|
1244
|
+
if ( ranges.length > 1 )
|
1245
|
+
{
|
1246
|
+
// IE doesn't accept multiple ranges selection, so we join all into one.
|
1247
|
+
var last = ranges[ ranges.length -1 ] ;
|
1248
|
+
ranges[ 0 ].setEnd( last.endContainer, last.endOffset );
|
1249
|
+
ranges.length = 1;
|
1250
|
+
}
|
1251
|
+
|
857
1252
|
if ( ranges[ 0 ] )
|
858
1253
|
ranges[ 0 ].select();
|
859
1254
|
|
@@ -862,10 +1257,49 @@ For licensing, see LICENSE.html or http://ckeditor.com/license
|
|
862
1257
|
else
|
863
1258
|
{
|
864
1259
|
var sel = this.getNative();
|
865
|
-
|
1260
|
+
|
1261
|
+
// getNative() returns null if iframe is "display:none" in FF. (#6577)
|
1262
|
+
if ( !sel )
|
1263
|
+
return;
|
1264
|
+
|
1265
|
+
if ( ranges.length )
|
1266
|
+
{
|
1267
|
+
sel.removeAllRanges();
|
1268
|
+
// Remove any existing filling char first.
|
1269
|
+
CKEDITOR.env.webkit && removeFillingChar( this.document );
|
1270
|
+
}
|
866
1271
|
|
867
1272
|
for ( var i = 0 ; i < ranges.length ; i++ )
|
868
1273
|
{
|
1274
|
+
// Joining sequential ranges introduced by
|
1275
|
+
// readonly elements protection.
|
1276
|
+
if ( i < ranges.length -1 )
|
1277
|
+
{
|
1278
|
+
var left = ranges[ i ], right = ranges[ i +1 ],
|
1279
|
+
between = left.clone();
|
1280
|
+
between.setStart( left.endContainer, left.endOffset );
|
1281
|
+
between.setEnd( right.startContainer, right.startOffset );
|
1282
|
+
|
1283
|
+
// Don't confused by Firefox adjancent multi-ranges
|
1284
|
+
// introduced by table cells selection.
|
1285
|
+
if ( !between.collapsed )
|
1286
|
+
{
|
1287
|
+
between.shrink( CKEDITOR.NODE_ELEMENT, true );
|
1288
|
+
var ancestor = between.getCommonAncestor(),
|
1289
|
+
enclosed = between.getEnclosedNode();
|
1290
|
+
|
1291
|
+
// The following cases has to be considered:
|
1292
|
+
// 1. <span contenteditable="false">[placeholder]</span>
|
1293
|
+
// 2. <input contenteditable="false" type="radio"/> (#6621)
|
1294
|
+
if ( ancestor.isReadOnly() || enclosed && enclosed.isReadOnly() )
|
1295
|
+
{
|
1296
|
+
right.setStart( left.startContainer, left.startOffset );
|
1297
|
+
ranges.splice( i--, 1 );
|
1298
|
+
continue;
|
1299
|
+
}
|
1300
|
+
}
|
1301
|
+
}
|
1302
|
+
|
869
1303
|
var range = ranges[ i ];
|
870
1304
|
var nativeRange = this.document.$.createRange();
|
871
1305
|
var startContainer = range.startContainer;
|
@@ -873,16 +1307,58 @@ For licensing, see LICENSE.html or http://ckeditor.com/license
|
|
873
1307
|
// In FF2, if we have a collapsed range, inside an empty
|
874
1308
|
// element, we must add something to it otherwise the caret
|
875
1309
|
// will not be visible.
|
1310
|
+
// In Opera instead, the selection will be moved out of the
|
1311
|
+
// element. (#4657)
|
876
1312
|
if ( range.collapsed &&
|
877
|
-
( CKEDITOR.env.gecko && CKEDITOR.env.version < 10900 ) &&
|
1313
|
+
( CKEDITOR.env.opera || ( CKEDITOR.env.gecko && CKEDITOR.env.version < 10900 ) ) &&
|
878
1314
|
startContainer.type == CKEDITOR.NODE_ELEMENT &&
|
879
1315
|
!startContainer.getChildCount() )
|
880
1316
|
{
|
881
1317
|
startContainer.appendText( '' );
|
882
1318
|
}
|
883
1319
|
|
884
|
-
|
885
|
-
|
1320
|
+
if ( range.collapsed
|
1321
|
+
&& CKEDITOR.env.webkit
|
1322
|
+
&& rangeRequiresFix( range ) )
|
1323
|
+
{
|
1324
|
+
// Append a zero-width space so WebKit will not try to
|
1325
|
+
// move the selection by itself (#1272).
|
1326
|
+
var fillingChar = createFillingChar( this.document );
|
1327
|
+
range.insertNode( fillingChar ) ;
|
1328
|
+
|
1329
|
+
var next = fillingChar.getNext();
|
1330
|
+
|
1331
|
+
// If the filling char is followed by a <br>, whithout
|
1332
|
+
// having something before it, it'll not blink.
|
1333
|
+
// Let's remove it in this case.
|
1334
|
+
if ( next && !fillingChar.getPrevious() && next.type == CKEDITOR.NODE_ELEMENT && next.getName() == 'br' )
|
1335
|
+
{
|
1336
|
+
removeFillingChar( this.document );
|
1337
|
+
range.moveToPosition( next, CKEDITOR.POSITION_BEFORE_START );
|
1338
|
+
}
|
1339
|
+
else
|
1340
|
+
range.moveToPosition( fillingChar, CKEDITOR.POSITION_AFTER_END );
|
1341
|
+
}
|
1342
|
+
|
1343
|
+
nativeRange.setStart( range.startContainer.$, range.startOffset );
|
1344
|
+
|
1345
|
+
try
|
1346
|
+
{
|
1347
|
+
nativeRange.setEnd( range.endContainer.$, range.endOffset );
|
1348
|
+
}
|
1349
|
+
catch ( e )
|
1350
|
+
{
|
1351
|
+
// There is a bug in Firefox implementation (it would be too easy
|
1352
|
+
// otherwise). The new start can't be after the end (W3C says it can).
|
1353
|
+
// So, let's create a new range and collapse it to the desired point.
|
1354
|
+
if ( e.toString().indexOf( 'NS_ERROR_ILLEGAL_VALUE' ) >= 0 )
|
1355
|
+
{
|
1356
|
+
range.collapse( 1 );
|
1357
|
+
nativeRange.setEnd( range.endContainer.$, range.endOffset );
|
1358
|
+
}
|
1359
|
+
else
|
1360
|
+
throw e;
|
1361
|
+
}
|
886
1362
|
|
887
1363
|
// Select the range.
|
888
1364
|
sel.addRange( nativeRange );
|
@@ -892,49 +1368,32 @@ For licensing, see LICENSE.html or http://ckeditor.com/license
|
|
892
1368
|
}
|
893
1369
|
},
|
894
1370
|
|
1371
|
+
/**
|
1372
|
+
* Create bookmark for every single of this selection range (from #getRanges)
|
1373
|
+
* by calling the {@link CKEDITOR.dom.range.prototype.createBookmark} method,
|
1374
|
+
* with extra cares to avoid interferon among those ranges. Same arguments are
|
1375
|
+
* received as with the underlay range method.
|
1376
|
+
*/
|
895
1377
|
createBookmarks : function( serializable )
|
896
1378
|
{
|
897
|
-
|
898
|
-
ranges = this.getRanges(),
|
899
|
-
length = ranges.length,
|
900
|
-
bookmark;
|
901
|
-
for ( var i = 0; i < length ; i++ )
|
902
|
-
{
|
903
|
-
retval.push( bookmark = ranges[ i ].createBookmark( serializable, true ) );
|
904
|
-
|
905
|
-
serializable = bookmark.serializable;
|
906
|
-
|
907
|
-
var bookmarkStart = serializable ? this.document.getById( bookmark.startNode ) : bookmark.startNode,
|
908
|
-
bookmarkEnd = serializable ? this.document.getById( bookmark.endNode ) : bookmark.endNode;
|
909
|
-
|
910
|
-
// Updating the offset values for rest of ranges which have been mangled(#3256).
|
911
|
-
for ( var j = i + 1 ; j < length ; j++ )
|
912
|
-
{
|
913
|
-
var dirtyRange = ranges[ j ],
|
914
|
-
rangeStart = dirtyRange.startContainer,
|
915
|
-
rangeEnd = dirtyRange.endContainer;
|
916
|
-
|
917
|
-
rangeStart.equals( bookmarkStart.getParent() ) && dirtyRange.startOffset++;
|
918
|
-
rangeStart.equals( bookmarkEnd.getParent() ) && dirtyRange.startOffset++;
|
919
|
-
rangeEnd.equals( bookmarkStart.getParent() ) && dirtyRange.endOffset++;
|
920
|
-
rangeEnd.equals( bookmarkEnd.getParent() ) && dirtyRange.endOffset++;
|
921
|
-
}
|
922
|
-
}
|
923
|
-
|
924
|
-
return retval;
|
1379
|
+
return this.getRanges().createBookmarks( serializable );
|
925
1380
|
},
|
926
1381
|
|
1382
|
+
/**
|
1383
|
+
* Create bookmark for every single of this selection range (from #getRanges)
|
1384
|
+
* by calling the {@link CKEDITOR.dom.range.prototype.createBookmark2} method,
|
1385
|
+
* with extra cares to avoid interferon among those ranges. Same arguments are
|
1386
|
+
* received as with the underlay range method.
|
1387
|
+
*/
|
927
1388
|
createBookmarks2 : function( normalized )
|
928
1389
|
{
|
929
|
-
|
930
|
-
ranges = this.getRanges();
|
931
|
-
|
932
|
-
for ( var i = 0 ; i < ranges.length ; i++ )
|
933
|
-
bookmarks.push( ranges[i].createBookmark2( normalized ) );
|
934
|
-
|
935
|
-
return bookmarks;
|
1390
|
+
return this.getRanges().createBookmarks2( normalized );
|
936
1391
|
},
|
937
1392
|
|
1393
|
+
/**
|
1394
|
+
* Select the virtual ranges denote by the bookmarks by calling #selectRanges.
|
1395
|
+
* @param bookmarks
|
1396
|
+
*/
|
938
1397
|
selectBookmarks : function( bookmarks )
|
939
1398
|
{
|
940
1399
|
var ranges = [];
|
@@ -948,6 +1407,9 @@ For licensing, see LICENSE.html or http://ckeditor.com/license
|
|
948
1407
|
return this;
|
949
1408
|
},
|
950
1409
|
|
1410
|
+
/**
|
1411
|
+
* Retrieve the common ancestor node of the first range and the last range.
|
1412
|
+
*/
|
951
1413
|
getCommonAncestor : function()
|
952
1414
|
{
|
953
1415
|
var ranges = this.getRanges(),
|
@@ -956,7 +1418,9 @@ For licensing, see LICENSE.html or http://ckeditor.com/license
|
|
956
1418
|
return startNode.getCommonAncestor( endNode );
|
957
1419
|
},
|
958
1420
|
|
959
|
-
|
1421
|
+
/**
|
1422
|
+
* Moving scroll bar to the current selection's start position.
|
1423
|
+
*/
|
960
1424
|
scrollIntoView : function()
|
961
1425
|
{
|
962
1426
|
// If we have split the block, adds a temporary span at the
|
@@ -966,138 +1430,134 @@ For licensing, see LICENSE.html or http://ckeditor.com/license
|
|
966
1430
|
}
|
967
1431
|
};
|
968
1432
|
})();
|
1433
|
+
|
969
1434
|
( function()
|
970
1435
|
{
|
971
|
-
var notWhitespaces = CKEDITOR.dom.walker.whitespaces( true )
|
972
|
-
|
1436
|
+
var notWhitespaces = CKEDITOR.dom.walker.whitespaces( true ),
|
1437
|
+
fillerTextRegex = /\ufeff|\u00a0/,
|
1438
|
+
nonCells = { table:1,tbody:1,tr:1 };
|
1439
|
+
|
1440
|
+
CKEDITOR.dom.range.prototype.select =
|
1441
|
+
CKEDITOR.env.ie ?
|
1442
|
+
// V2
|
1443
|
+
function( forceExpand )
|
1444
|
+
{
|
1445
|
+
var collapsed = this.collapsed,
|
1446
|
+
isStartMarkerAlone, dummySpan, ieRange;
|
973
1447
|
|
974
|
-
|
975
|
-
|
976
|
-
|
977
|
-
|
978
|
-
|
979
|
-
|
980
|
-
|
981
|
-
|
1448
|
+
// Try to make a object selection.
|
1449
|
+
var selected = this.getEnclosedNode();
|
1450
|
+
if ( selected )
|
1451
|
+
{
|
1452
|
+
try
|
1453
|
+
{
|
1454
|
+
ieRange = this.document.$.body.createControlRange();
|
1455
|
+
ieRange.addElement( selected.$ );
|
1456
|
+
ieRange.select();
|
1457
|
+
return;
|
1458
|
+
}
|
1459
|
+
catch( er ) {}
|
1460
|
+
}
|
982
1461
|
|
983
|
-
|
1462
|
+
// IE doesn't support selecting the entire table row/cell, move the selection into cells, e.g.
|
1463
|
+
// <table><tbody><tr>[<td>cell</b></td>... => <table><tbody><tr><td>[cell</td>...
|
1464
|
+
if ( this.startContainer.type == CKEDITOR.NODE_ELEMENT && this.startContainer.getName() in nonCells
|
1465
|
+
|| this.endContainer.type == CKEDITOR.NODE_ELEMENT && this.endContainer.getName() in nonCells )
|
1466
|
+
{
|
1467
|
+
this.shrink( CKEDITOR.NODE_ELEMENT, true );
|
1468
|
+
}
|
984
1469
|
|
985
|
-
|
986
|
-
var startNode = bookmark.startNode;
|
1470
|
+
var bookmark = this.createBookmark();
|
987
1471
|
|
988
|
-
|
989
|
-
|
990
|
-
endNode = bookmark.endNode;
|
1472
|
+
// Create marker tags for the start and end boundaries.
|
1473
|
+
var startNode = bookmark.startNode;
|
991
1474
|
|
992
|
-
|
993
|
-
|
1475
|
+
var endNode;
|
1476
|
+
if ( !collapsed )
|
1477
|
+
endNode = bookmark.endNode;
|
994
1478
|
|
995
|
-
|
996
|
-
|
997
|
-
ieRange.moveStart( 'character', 1 );
|
1479
|
+
// Create the main range which will be used for the selection.
|
1480
|
+
ieRange = this.document.$.body.createTextRange();
|
998
1481
|
|
999
|
-
|
1000
|
-
|
1001
|
-
|
1002
|
-
|
1482
|
+
// Position the range at the start boundary.
|
1483
|
+
ieRange.moveToElementText( startNode.$ );
|
1484
|
+
ieRange.moveStart( 'character', 1 );
|
1485
|
+
|
1486
|
+
if ( endNode )
|
1487
|
+
{
|
1488
|
+
// Create a tool range for the end.
|
1489
|
+
var ieRangeEnd = this.document.$.body.createTextRange();
|
1003
1490
|
|
1004
|
-
|
1005
|
-
|
1491
|
+
// Position the tool range at the end.
|
1492
|
+
ieRangeEnd.moveToElementText( endNode.$ );
|
1006
1493
|
|
1007
|
-
|
1008
|
-
|
1009
|
-
|
1010
|
-
|
1011
|
-
|
1012
|
-
{
|
1013
|
-
// The isStartMarkerAlone logic comes from V2. It guarantees that the lines
|
1014
|
-
// will expand and that the cursor will be blinking on the right place.
|
1015
|
-
// Actually, we are using this flag just to avoid using this hack in all
|
1016
|
-
// situations, but just on those needed.
|
1017
|
-
var next = startNode.getNext( notWhitespaces );
|
1018
|
-
isStartMarkerAlone = ( !( next && next.getText && next.getText().match( fillerTextRegex ) ) // already a filler there?
|
1019
|
-
&& ( forceExpand || !startNode.hasPrevious() || ( startNode.getPrevious().is && startNode.getPrevious().is( 'br' ) ) ) );
|
1020
|
-
|
1021
|
-
// Append a temporary <span></span> before the selection.
|
1022
|
-
// This is needed to avoid IE destroying selections inside empty
|
1023
|
-
// inline elements, like <b></b> (#253).
|
1024
|
-
// It is also needed when placing the selection right after an inline
|
1025
|
-
// element to avoid the selection moving inside of it.
|
1026
|
-
dummySpan = this.document.createElement( 'span' );
|
1027
|
-
dummySpan.setHtml( '' ); // Zero Width No-Break Space (U+FEFF). See #1359.
|
1028
|
-
dummySpan.insertBefore( startNode );
|
1029
|
-
|
1030
|
-
if ( isStartMarkerAlone )
|
1494
|
+
// Move the end boundary of the main range to match the tool range.
|
1495
|
+
ieRange.setEndPoint( 'EndToEnd', ieRangeEnd );
|
1496
|
+
ieRange.moveEnd( 'character', -1 );
|
1497
|
+
}
|
1498
|
+
else
|
1031
1499
|
{
|
1032
|
-
//
|
1033
|
-
//
|
1034
|
-
//
|
1035
|
-
//
|
1036
|
-
|
1500
|
+
// The isStartMarkerAlone logic comes from V2. It guarantees that the lines
|
1501
|
+
// will expand and that the cursor will be blinking on the right place.
|
1502
|
+
// Actually, we are using this flag just to avoid using this hack in all
|
1503
|
+
// situations, but just on those needed.
|
1504
|
+
var next = startNode.getNext( notWhitespaces );
|
1505
|
+
isStartMarkerAlone = ( !( next && next.getText && next.getText().match( fillerTextRegex ) ) // already a filler there?
|
1506
|
+
&& ( forceExpand || !startNode.hasPrevious() || ( startNode.getPrevious().is && startNode.getPrevious().is( 'br' ) ) ) );
|
1507
|
+
|
1508
|
+
// Append a temporary <span></span> before the selection.
|
1509
|
+
// This is needed to avoid IE destroying selections inside empty
|
1510
|
+
// inline elements, like <b></b> (#253).
|
1511
|
+
// It is also needed when placing the selection right after an inline
|
1512
|
+
// element to avoid the selection moving inside of it.
|
1513
|
+
dummySpan = this.document.createElement( 'span' );
|
1514
|
+
dummySpan.setHtml( '' ); // Zero Width No-Break Space (U+FEFF). See #1359.
|
1515
|
+
dummySpan.insertBefore( startNode );
|
1516
|
+
|
1517
|
+
if ( isStartMarkerAlone )
|
1518
|
+
{
|
1519
|
+
// To expand empty blocks or line spaces after <br>, we need
|
1520
|
+
// instead to have any char, which will be later deleted using the
|
1521
|
+
// selection.
|
1522
|
+
// \ufeff = Zero Width No-Break Space (U+FEFF). (#1359)
|
1523
|
+
this.document.createText( '\ufeff' ).insertBefore( startNode );
|
1524
|
+
}
|
1037
1525
|
}
|
1038
|
-
}
|
1039
1526
|
|
1040
|
-
|
1041
|
-
|
1042
|
-
|
1527
|
+
// Remove the markers (reset the position, because of the changes in the DOM tree).
|
1528
|
+
this.setStartBefore( startNode );
|
1529
|
+
startNode.remove();
|
1043
1530
|
|
1044
|
-
|
1045
|
-
{
|
1046
|
-
if ( isStartMarkerAlone )
|
1531
|
+
if ( collapsed )
|
1047
1532
|
{
|
1048
|
-
|
1049
|
-
|
1533
|
+
if ( isStartMarkerAlone )
|
1534
|
+
{
|
1535
|
+
// Move the selection start to include the temporary \ufeff.
|
1536
|
+
ieRange.moveStart( 'character', -1 );
|
1050
1537
|
|
1051
|
-
|
1538
|
+
ieRange.select();
|
1539
|
+
|
1540
|
+
// Remove our temporary stuff.
|
1541
|
+
this.document.$.selection.clear();
|
1542
|
+
}
|
1543
|
+
else
|
1544
|
+
ieRange.select();
|
1052
1545
|
|
1053
|
-
|
1054
|
-
|
1546
|
+
this.moveToPosition( dummySpan, CKEDITOR.POSITION_BEFORE_START );
|
1547
|
+
dummySpan.remove();
|
1055
1548
|
}
|
1056
1549
|
else
|
1550
|
+
{
|
1551
|
+
this.setEndBefore( endNode );
|
1552
|
+
endNode.remove();
|
1057
1553
|
ieRange.select();
|
1554
|
+
}
|
1058
1555
|
|
1059
|
-
|
1060
|
-
}
|
1061
|
-
else
|
1062
|
-
{
|
1063
|
-
this.setEndBefore( endNode );
|
1064
|
-
endNode.remove();
|
1065
|
-
ieRange.select();
|
1066
|
-
}
|
1067
|
-
}
|
1068
|
-
:
|
1069
|
-
function()
|
1070
|
-
{
|
1071
|
-
var startContainer = this.startContainer;
|
1072
|
-
|
1073
|
-
// If we have a collapsed range, inside an empty element, we must add
|
1074
|
-
// something to it, otherwise the caret will not be visible.
|
1075
|
-
if ( this.collapsed && startContainer.type == CKEDITOR.NODE_ELEMENT && !startContainer.getChildCount() )
|
1076
|
-
startContainer.append( new CKEDITOR.dom.text( '' ) );
|
1077
|
-
|
1078
|
-
var nativeRange = this.document.$.createRange();
|
1079
|
-
nativeRange.setStart( startContainer.$, this.startOffset );
|
1080
|
-
|
1081
|
-
try
|
1082
|
-
{
|
1083
|
-
nativeRange.setEnd( this.endContainer.$, this.endOffset );
|
1556
|
+
this.document.fire( 'selectionchange' );
|
1084
1557
|
}
|
1085
|
-
|
1558
|
+
:
|
1559
|
+
function()
|
1086
1560
|
{
|
1087
|
-
|
1088
|
-
|
1089
|
-
// So, let's create a new range and collapse it to the desired point.
|
1090
|
-
if ( e.toString().indexOf( 'NS_ERROR_ILLEGAL_VALUE' ) >= 0 )
|
1091
|
-
{
|
1092
|
-
this.collapse( true );
|
1093
|
-
nativeRange.setEnd( this.endContainer.$, this.endOffset );
|
1094
|
-
}
|
1095
|
-
else
|
1096
|
-
throw( e );
|
1097
|
-
}
|
1098
|
-
|
1099
|
-
var selection = this.document.getSelection().getNative();
|
1100
|
-
selection.removeAllRanges();
|
1101
|
-
selection.addRange( nativeRange );
|
1102
|
-
};
|
1561
|
+
this.document.getSelection().selectRanges( [ this ] );
|
1562
|
+
};
|
1103
1563
|
} )();
|