glebtv-ckeditor 4.5.10.3 → 4.6.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/assets/javascripts/ckeditor/config.js.erb +1 -1
- data/lib/ckeditor.rb +1 -0
- data/lib/ckeditor/version.rb +2 -2
- data/lib/generators/ckeditor/templates/active_record/carrierwave/migration.rb +1 -1
- data/lib/generators/ckeditor/templates/active_record/dragonfly/migration.rb +1 -1
- data/lib/generators/ckeditor/templates/active_record/paperclip/migration.rb +1 -1
- data/lib/generators/ckeditor/templates/active_record/refile/migration.rb +1 -1
- data/vendor/assets/javascripts/ckeditor/LICENSE.md +2 -2
- data/vendor/assets/javascripts/ckeditor/adapters/jquery.js +1 -1
- data/vendor/assets/javascripts/ckeditor/build-config.js +26 -26
- data/vendor/assets/javascripts/ckeditor/ckeditor.js +605 -576
- data/vendor/assets/javascripts/ckeditor/lang/en.js +2 -2
- data/vendor/assets/javascripts/ckeditor/lang/ru.js +2 -2
- data/vendor/assets/javascripts/ckeditor/plugins/CKCss/css/styles.css +9 -0
- data/vendor/assets/javascripts/ckeditor/plugins/CKCss/dialogs/ckcss.js +2 -1
- data/vendor/assets/javascripts/ckeditor/plugins/CKCss/plugin.js +3 -1
- data/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/a11yhelp.js +6 -6
- data/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/en.js +3 -4
- data/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/ru.js +4 -4
- data/vendor/assets/javascripts/ckeditor/plugins/about/dialogs/about.js +4 -3
- data/vendor/assets/javascripts/ckeditor/plugins/clipboard/dialogs/paste.js +1 -1
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/LICENSE.md +21 -0
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/css/codemirror.ckeditor.css +183 -0
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/css/codemirror.css +341 -0
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/css/codemirror.min.css +1 -1
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/addon/comment/comment.js +206 -0
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/addon/comment/continuecomment.js +85 -0
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/addon/dialog/dialog.css +32 -0
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/addon/dialog/dialog.js +157 -0
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/addon/edit/closebrackets.js +202 -0
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/addon/edit/closetag.js +169 -0
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/addon/edit/continuelist.js +51 -0
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/addon/edit/matchbrackets.js +122 -0
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/addon/edit/matchtags.js +66 -0
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/addon/edit/trailingspace.js +27 -0
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/addon/fold/brace-fold.js +105 -0
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/addon/fold/comment-fold.js +59 -0
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/addon/fold/foldcode.js +150 -0
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/addon/fold/foldgutter.css +20 -0
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/addon/fold/foldgutter.js +146 -0
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/addon/fold/indent-fold.js +44 -0
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/addon/fold/markdown-fold.js +49 -0
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/addon/fold/xml-fold.js +182 -0
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/addon/format/autoFormatAll.js +43 -0
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/addon/format/formatting.js +226 -0
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/addon/hint/anyword-hint.js +41 -0
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/addon/hint/css-hint.js +60 -0
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/addon/hint/html-hint.js +348 -0
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/addon/hint/javascript-hint.js +155 -0
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/addon/hint/show-hint.css +36 -0
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/addon/hint/show-hint.js +438 -0
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/addon/hint/sql-hint.js +271 -0
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/addon/hint/xml-hint.js +110 -0
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/addon/mode/loadmode.js +64 -0
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/addon/mode/multiplex.js +123 -0
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/addon/mode/multiplex_test.js +33 -0
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/addon/mode/overlay.js +85 -0
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/addon/mode/simple.js +213 -0
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/addon/search/jump-to-line.js +49 -0
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/addon/search/match-highlighter.js +165 -0
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/addon/search/matchesonscrollbar.css +8 -0
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/addon/search/matchesonscrollbar.js +97 -0
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/addon/search/search.js +252 -0
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/addon/search/searchcursor.js +189 -0
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/addon/selection/active-line.js +74 -0
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/addon/selection/mark-selection.js +118 -0
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/addon/selection/selection-pointer.js +98 -0
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/beautify-html.js +952 -0
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/beautify.js +2087 -0
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/codemirror.addons.min.js +1 -1
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/codemirror.addons.search.min.js +1 -1
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/codemirror.js +9109 -0
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/codemirror.min.js +1 -1
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/codemirror.mode.htmlmixed.min.js +1 -1
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/codemirror.mode.javascript.min.js +1 -1
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/codemirror.mode.php.min.js +1 -1
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/mode/bbcode/bbcode.js +137 -0
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/mode/bbcode/index.html +73 -0
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/mode/bbcodemixed/bbcodemixed.js +161 -0
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/mode/bbcodemixed/index.html +128 -0
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/mode/clike/clike.js +785 -0
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/mode/clike/index.html +360 -0
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/mode/clike/scala.html +767 -0
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/mode/clike/test.js +55 -0
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/mode/css/css.js +825 -0
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/mode/css/gss.html +103 -0
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/mode/css/gss_test.js +17 -0
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/mode/css/index.html +75 -0
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/mode/css/less.html +152 -0
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/mode/css/less_test.js +54 -0
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/mode/css/scss.html +157 -0
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/mode/css/scss_test.js +110 -0
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/mode/css/test.js +200 -0
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/mode/htmlembedded/htmlembedded.js +28 -0
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/mode/htmlembedded/index.html +60 -0
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/mode/htmlmixed/htmlmixed.js +152 -0
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/mode/htmlmixed/index.html +89 -0
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/mode/javascript/index.html +114 -0
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/mode/javascript/javascript.js +784 -0
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/mode/javascript/json-ld.html +72 -0
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/mode/javascript/test.js +247 -0
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/mode/javascript/typescript.html +61 -0
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/mode/php/index.html +64 -0
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/mode/php/php.js +234 -0
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/mode/php/test.js +154 -0
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/mode/xml/index.html +61 -0
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/mode/xml/test.js +51 -0
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/js/mode/xml/xml.js +394 -0
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/plugin.js +30 -24
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/theme/dracula.css +1 -1
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/theme/duotone-dark.css +35 -0
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/theme/duotone-light.css +36 -0
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/theme/panda-syntax.css +85 -0
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/theme/pastel-on-dark.css +0 -1
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/theme/solarized.css +21 -15
- data/vendor/assets/javascripts/ckeditor/plugins/colordialog/dialogs/colordialog.css +1 -1
- data/vendor/assets/javascripts/ckeditor/plugins/colordialog/dialogs/colordialog.js +1 -1
- data/vendor/assets/javascripts/ckeditor/plugins/dialog/dialogDefinition.js +1 -1
- data/vendor/assets/javascripts/ckeditor/plugins/find/dialogs/find.js +9 -9
- data/vendor/assets/javascripts/ckeditor/plugins/flash/dialogs/flash.js +12 -12
- data/vendor/assets/javascripts/ckeditor/plugins/forms/dialogs/button.js +1 -1
- data/vendor/assets/javascripts/ckeditor/plugins/forms/dialogs/checkbox.js +1 -1
- data/vendor/assets/javascripts/ckeditor/plugins/forms/dialogs/form.js +1 -1
- data/vendor/assets/javascripts/ckeditor/plugins/forms/dialogs/hiddenfield.js +1 -1
- data/vendor/assets/javascripts/ckeditor/plugins/forms/dialogs/radio.js +1 -1
- data/vendor/assets/javascripts/ckeditor/plugins/forms/dialogs/select.js +11 -11
- data/vendor/assets/javascripts/ckeditor/plugins/forms/dialogs/textarea.js +1 -1
- data/vendor/assets/javascripts/ckeditor/plugins/forms/dialogs/textfield.js +1 -1
- data/vendor/assets/javascripts/ckeditor/plugins/icons.png +0 -0
- data/vendor/assets/javascripts/ckeditor/plugins/icons_hidpi.png +0 -0
- data/vendor/assets/javascripts/ckeditor/plugins/iframe/dialogs/iframe.js +1 -1
- data/vendor/assets/javascripts/ckeditor/plugins/iframedialog/plugin.js +1 -1
- data/vendor/assets/javascripts/ckeditor/plugins/image/dialogs/image.js +28 -28
- data/vendor/assets/javascripts/ckeditor/plugins/lineheight/LICENSE +0 -0
- data/vendor/assets/javascripts/ckeditor/plugins/lineheight/README.md +0 -0
- data/vendor/assets/javascripts/ckeditor/plugins/lineheight/lang/LANG.js +3 -0
- data/vendor/assets/javascripts/ckeditor/plugins/lineheight/lang/en.js +0 -0
- data/vendor/assets/javascripts/ckeditor/plugins/lineheight/lang/ru.js +3 -3
- data/vendor/assets/javascripts/ckeditor/plugins/lineheight/plugin.js +1 -1
- data/vendor/assets/javascripts/ckeditor/plugins/lineheight/readme.txt +0 -0
- data/vendor/assets/javascripts/ckeditor/plugins/link/dialogs/anchor.js +1 -1
- data/vendor/assets/javascripts/ckeditor/plugins/link/dialogs/link.js +25 -23
- data/vendor/assets/javascripts/ckeditor/plugins/link/images/anchor.png +0 -0
- data/vendor/assets/javascripts/ckeditor/plugins/link/images/hidpi/anchor.png +0 -0
- data/vendor/assets/javascripts/ckeditor/plugins/liststyle/dialogs/liststyle.js +1 -1
- data/vendor/assets/javascripts/ckeditor/plugins/notification/lang/en.js +1 -1
- data/vendor/assets/javascripts/ckeditor/plugins/notification/lang/ru.js +1 -1
- data/vendor/assets/javascripts/ckeditor/plugins/notification/plugin.js +2 -2
- data/vendor/assets/javascripts/ckeditor/plugins/pastefromword/filter/default.js +40 -29
- data/vendor/assets/javascripts/ckeditor/plugins/scayt/dialogs/options.js +19 -19
- data/vendor/assets/javascripts/ckeditor/plugins/scayt/skins/moono-lisa/scayt.css +20 -0
- data/vendor/assets/javascripts/ckeditor/plugins/smiley/dialogs/smiley.js +1 -1
- data/vendor/assets/javascripts/ckeditor/plugins/specialchar/dialogs/lang/en.js +2 -2
- data/vendor/assets/javascripts/ckeditor/plugins/specialchar/dialogs/lang/ru.js +1 -1
- data/vendor/assets/javascripts/ckeditor/plugins/specialchar/dialogs/specialchar.js +1 -1
- data/vendor/assets/javascripts/ckeditor/plugins/stylesheetparser/plugin.js +1 -1
- data/vendor/assets/javascripts/ckeditor/plugins/stylesheetparser/samples/assets/sample.css +70 -0
- data/vendor/assets/javascripts/ckeditor/plugins/stylesheetparser/samples/stylesheetparser.html +85 -0
- data/vendor/assets/javascripts/ckeditor/plugins/table/dialogs/table.js +1 -1
- data/vendor/assets/javascripts/ckeditor/plugins/tabletools/dialogs/tableCell.js +1 -1
- data/vendor/assets/javascripts/ckeditor/plugins/templates/dialogs/templates.css +1 -1
- data/vendor/assets/javascripts/ckeditor/plugins/templates/dialogs/templates.js +1 -1
- data/vendor/assets/javascripts/ckeditor/plugins/templates/templates/default.js +2 -2
- data/vendor/assets/javascripts/ckeditor/plugins/templates/templates/images/template1.gif +0 -0
- data/vendor/assets/javascripts/ckeditor/plugins/templates/templates/images/template2.gif +0 -0
- data/vendor/assets/javascripts/ckeditor/plugins/templates/templates/images/template3.gif +0 -0
- data/vendor/assets/javascripts/ckeditor/plugins/wordcount/css/wordcount.css +0 -0
- data/vendor/assets/javascripts/ckeditor/plugins/wordcount/lang/en.js +1 -1
- data/vendor/assets/javascripts/ckeditor/plugins/wordcount/lang/ru.js +1 -1
- data/vendor/assets/javascripts/ckeditor/plugins/wordcount/plugin.js +60 -13
- data/vendor/assets/javascripts/ckeditor/plugins/wordcount/samples/wordcount.html +61 -0
- data/vendor/assets/javascripts/ckeditor/plugins/wordcount/samples/wordcountWithMaxCount.html +110 -0
- data/vendor/assets/javascripts/ckeditor/plugins/wsc/dialogs/wsc.js +9 -9
- data/vendor/assets/javascripts/ckeditor/plugins/wsc/skins/moono-lisa/wsc.css +43 -0
- data/vendor/assets/javascripts/ckeditor/plugins/youtube/LICENSE.md +15 -0
- data/vendor/assets/javascripts/ckeditor/plugins/youtube/images/icon.png +0 -0
- data/vendor/assets/javascripts/ckeditor/plugins/youtube/lang/en.js +3 -1
- data/vendor/assets/javascripts/ckeditor/plugins/youtube/lang/ru.js +1 -0
- data/vendor/assets/javascripts/ckeditor/plugins/youtube/plugin.js +448 -388
- data/vendor/assets/javascripts/ckeditor/skins/moono-lisa/dev/icons16.png +0 -0
- data/vendor/assets/javascripts/ckeditor/skins/moono-lisa/dev/icons16.svg +175 -0
- data/vendor/assets/javascripts/ckeditor/skins/moono-lisa/dev/icons32.png +0 -0
- data/vendor/assets/javascripts/ckeditor/skins/moono-lisa/dev/icons32.svg +167 -0
- data/vendor/assets/javascripts/ckeditor/skins/moono-lisa/dev/locations.json +145 -0
- data/vendor/assets/javascripts/ckeditor/skins/moono-lisa/dialog.css +5 -0
- data/vendor/assets/javascripts/ckeditor/skins/moono-lisa/dialog_ie.css +5 -0
- data/vendor/assets/javascripts/ckeditor/skins/moono-lisa/dialog_ie8.css +5 -0
- data/vendor/assets/javascripts/ckeditor/skins/moono-lisa/dialog_iequirks.css +5 -0
- data/vendor/assets/javascripts/ckeditor/skins/moono-lisa/editor.css +5 -0
- data/vendor/assets/javascripts/ckeditor/skins/moono-lisa/editor_gecko.css +5 -0
- data/vendor/assets/javascripts/ckeditor/skins/moono-lisa/editor_ie.css +5 -0
- data/vendor/assets/javascripts/ckeditor/skins/moono-lisa/editor_ie8.css +5 -0
- data/vendor/assets/javascripts/ckeditor/skins/moono-lisa/editor_iequirks.css +5 -0
- data/vendor/assets/javascripts/ckeditor/skins/moono-lisa/images/arrow.png +0 -0
- data/vendor/assets/javascripts/ckeditor/skins/moono-lisa/images/close.png +0 -0
- data/vendor/assets/javascripts/ckeditor/skins/moono-lisa/images/hidpi/close.png +0 -0
- data/vendor/assets/javascripts/ckeditor/skins/moono-lisa/images/hidpi/lock-open.png +0 -0
- data/vendor/assets/javascripts/ckeditor/skins/moono-lisa/images/hidpi/lock.png +0 -0
- data/vendor/assets/javascripts/ckeditor/skins/moono-lisa/images/hidpi/refresh.png +0 -0
- data/vendor/assets/javascripts/ckeditor/skins/moono-lisa/images/lock-open.png +0 -0
- data/vendor/assets/javascripts/ckeditor/skins/moono-lisa/images/lock.png +0 -0
- data/vendor/assets/javascripts/ckeditor/skins/moono-lisa/images/refresh.png +0 -0
- data/vendor/assets/javascripts/ckeditor/skins/moono-lisa/images/spinner.gif +0 -0
- data/vendor/assets/javascripts/ckeditor/skins/moono-lisa/readme.md +46 -0
- data/vendor/assets/javascripts/ckeditor/skins/moono-lisa/skin.js +7 -0
- data/vendor/assets/javascripts/ckeditor/skins/moono/dialog.css +1 -1
- data/vendor/assets/javascripts/ckeditor/skins/moono/dialog_ie.css +1 -1
- data/vendor/assets/javascripts/ckeditor/skins/moono/dialog_ie7.css +1 -1
- data/vendor/assets/javascripts/ckeditor/skins/moono/dialog_ie8.css +1 -1
- data/vendor/assets/javascripts/ckeditor/skins/moono/dialog_iequirks.css +1 -1
- data/vendor/assets/javascripts/ckeditor/skins/moono/editor.css +2 -2
- data/vendor/assets/javascripts/ckeditor/skins/moono/editor_gecko.css +2 -2
- data/vendor/assets/javascripts/ckeditor/skins/moono/editor_ie.css +2 -2
- data/vendor/assets/javascripts/ckeditor/skins/moono/editor_ie7.css +2 -2
- data/vendor/assets/javascripts/ckeditor/skins/moono/editor_ie8.css +2 -2
- data/vendor/assets/javascripts/ckeditor/skins/moono/editor_iequirks.css +2 -2
- data/vendor/assets/javascripts/ckeditor/skins/moono/icons.png +0 -0
- data/vendor/assets/javascripts/ckeditor/skins/moono/icons_hidpi.png +0 -0
- data/vendor/assets/javascripts/ckeditor/skins/moono/images/anchor.png +0 -0
- data/vendor/assets/javascripts/ckeditor/skins/moono/images/close.png +0 -0
- data/vendor/assets/javascripts/ckeditor/skins/moono/images/hidpi/anchor.png +0 -0
- data/vendor/assets/javascripts/ckeditor/skins/moono/images/hidpi/close.png +0 -0
- data/vendor/assets/javascripts/ckeditor/skins/moono/images/hidpi/lock-open.png +0 -0
- data/vendor/assets/javascripts/ckeditor/skins/moono/images/hidpi/lock.png +0 -0
- data/vendor/assets/javascripts/ckeditor/skins/moono/images/hidpi/refresh.png +0 -0
- data/vendor/assets/javascripts/ckeditor/skins/moono/images/lock-open.png +0 -0
- data/vendor/assets/javascripts/ckeditor/skins/moono/images/lock.png +0 -0
- data/vendor/assets/javascripts/ckeditor/skins/moono/images/refresh.png +0 -0
- data/vendor/assets/javascripts/ckeditor/skins/moono/readme.md +3 -3
- data/vendor/assets/javascripts/ckeditor/styles.js +42 -16
- metadata +161 -105
- data/app/assets/javascripts/ckeditor/config_orig.js +0 -58
- data/vendor/assets/javascripts/ckeditor/README.md +0 -39
- data/vendor/assets/javascripts/ckeditor/config.js +0 -10
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/lang/af.js +0 -12
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/lang/ar.js +0 -12
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/lang/bg.js +0 -12
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/lang/bn.js +0 -12
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/lang/bs.js +0 -12
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/lang/ca.js +0 -12
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/lang/cs.js +0 -12
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/lang/cy.js +0 -12
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/lang/da.js +0 -12
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/lang/de.js +0 -12
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/lang/el.js +0 -12
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/lang/en-au.js +0 -12
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/lang/en-ca.js +0 -12
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/lang/en-gb.js +0 -12
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/lang/eo.js +0 -12
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/lang/es.js +0 -12
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/lang/et.js +0 -12
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/lang/eu.js +0 -12
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/lang/fa.js +0 -12
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/lang/fi.js +0 -12
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/lang/fo.js +0 -12
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/lang/fr-ca.js +0 -12
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/lang/fr.js +0 -12
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/lang/gl.js +0 -12
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/lang/gu.js +0 -12
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/lang/he.js +0 -12
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/lang/hi.js +0 -12
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/lang/hr.js +0 -12
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/lang/hu.js +0 -12
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/lang/is.js +0 -12
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/lang/it.js +0 -12
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/lang/ja.js +0 -12
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/lang/ka.js +0 -12
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/lang/km.js +0 -12
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/lang/ko.js +0 -12
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/lang/ku.js +0 -12
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/lang/lt.js +0 -12
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/lang/lv.js +0 -12
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/lang/mk.js +0 -12
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/lang/mn.js +0 -12
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/lang/ms.js +0 -12
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/lang/nb.js +0 -12
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/lang/nl.js +0 -12
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/lang/no.js +0 -12
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/lang/pl.js +0 -12
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/lang/pt-br.js +0 -12
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/lang/pt.js +0 -12
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/lang/ro.js +0 -12
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/lang/sk.js +0 -12
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/lang/sl.js +0 -12
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/lang/sr-latn.js +0 -12
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/lang/sr.js +0 -12
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/lang/sv.js +0 -12
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/lang/th.js +0 -12
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/lang/tr.js +0 -12
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/lang/ug.js +0 -12
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/lang/uk.js +0 -12
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/lang/vi.js +0 -12
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/lang/zh-cn.js +0 -12
- data/vendor/assets/javascripts/ckeditor/plugins/codemirror/lang/zh.js +0 -12
@@ -0,0 +1,61 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<!--
|
3
|
+
Copyright (c) 2003-2015, CKSource - Frederico Knabben. All rights reserved.
|
4
|
+
For licensing, see LICENSE.md or http://ckeditor.com/license
|
5
|
+
-->
|
6
|
+
<html>
|
7
|
+
<head>
|
8
|
+
<meta charset="utf-8">
|
9
|
+
<title>WordCount — CKEditor Sample</title>
|
10
|
+
<script src="../../../ckeditor.js"></script>
|
11
|
+
<link href="../../../samples/sample.css" rel="stylesheet">
|
12
|
+
<meta name="ckeditor-sample-name" content="WordCount plugin">
|
13
|
+
<meta name="ckeditor-sample-group" content="Plugins">
|
14
|
+
<meta name="ckeditor-sample-description" content="Counts the words an shows the word count in the footer of the editor.">
|
15
|
+
<meta name="ckeditor-sample-isnew" content="1">
|
16
|
+
<script>
|
17
|
+
CKEDITOR.disableAutoInline = true;
|
18
|
+
</script>
|
19
|
+
</head>
|
20
|
+
<body>
|
21
|
+
<h1 class="samples">
|
22
|
+
<a href="../../../samples/index.html">CKEditor Samples</a> » WordCount Plugin
|
23
|
+
</h1>
|
24
|
+
|
25
|
+
<div class="description">
|
26
|
+
<p>
|
27
|
+
WordCount Plugin for CKEditor that counts the words an shows the word count in the footer of the editor.</a>.
|
28
|
+
</p>
|
29
|
+
<p>
|
30
|
+
In order to use the new plugin, include it in the <code><a class="samples" href="http://docs.ckeditor.com/#!/api/CKEDITOR.config-cfg-extraPlugins">config.extraPlugins</a></code> configuration setting.
|
31
|
+
</p>
|
32
|
+
<pre class="samples">
|
33
|
+
CKEDITOR.replace( '<em>textarea_id</em>', {
|
34
|
+
<strong>extraPlugins: 'wordcount'</strong>
|
35
|
+
} );
|
36
|
+
</pre>
|
37
|
+
</div>
|
38
|
+
|
39
|
+
<textarea cols="80" id="editor1" name="editor1" rows="10">
|
40
|
+
This is some <strong>sample text</strong>. You are using <a href="http://ckeditor.com/">CKEditor</a>.
|
41
|
+
</textarea>
|
42
|
+
<script>
|
43
|
+
|
44
|
+
CKEDITOR.replace('editor1', {
|
45
|
+
extraPlugins: 'wordcount'
|
46
|
+
});
|
47
|
+
|
48
|
+
</script>
|
49
|
+
|
50
|
+
<div id="footer">
|
51
|
+
<hr>
|
52
|
+
<p>
|
53
|
+
CKEditor - The text editor for the Internet - <a class="samples" href="http://ckeditor.com/">http://ckeditor.com</a>
|
54
|
+
</p>
|
55
|
+
<p id="copy">
|
56
|
+
Copyright © 2003-2015, <a class="samples" href="http://cksource.com/">CKSource</a> - Frederico
|
57
|
+
Knabben. All rights reserved.
|
58
|
+
</p>
|
59
|
+
</div>
|
60
|
+
</body>
|
61
|
+
</html>
|
@@ -0,0 +1,110 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<!--
|
3
|
+
Copyright (c) 2003-2015, CKSource - Frederico Knabben. All rights reserved.
|
4
|
+
For licensing, see LICENSE.md or http://ckeditor.com/license
|
5
|
+
-->
|
6
|
+
<html>
|
7
|
+
<head>
|
8
|
+
<meta charset="utf-8">
|
9
|
+
<title>WordCount — CKEditor Sample</title>
|
10
|
+
<script src="http://code.jquery.com/jquery-1.11.2.min.js"></script>
|
11
|
+
<script src="../../../ckeditor.js"></script>
|
12
|
+
<link href="../../../samples/sample.css" rel="stylesheet">
|
13
|
+
<meta name="ckeditor-sample-name" content="WordCount plugin">
|
14
|
+
<meta name="ckeditor-sample-group" content="Plugins">
|
15
|
+
<meta name="ckeditor-sample-description" content="Counts the words an shows the word count in the footer of the editor.">
|
16
|
+
<meta name="ckeditor-sample-isnew" content="1">
|
17
|
+
<script>
|
18
|
+
CKEDITOR.disableAutoInline = true;
|
19
|
+
</script>
|
20
|
+
</head>
|
21
|
+
<body>
|
22
|
+
<h1 class="samples">
|
23
|
+
<a href="../../../samples/index.html">CKEditor Samples</a> » WordCount Plugin
|
24
|
+
</h1>
|
25
|
+
|
26
|
+
<div class="description">
|
27
|
+
<p>
|
28
|
+
WordCount Plugin for CKEditor that counts the words an shows the word count in the footer of the editor.</a>.
|
29
|
+
</p>
|
30
|
+
<p>
|
31
|
+
In order to use the new plugin, include it in the <code><a class="samples" href="http://docs.ckeditor.com/#!/api/CKEDITOR.config-cfg-extraPlugins">config.extraPlugins</a></code> configuration setting.
|
32
|
+
</p>
|
33
|
+
<pre class="samples">
|
34
|
+
CKEDITOR.replace( '<em>textarea_id</em>', {
|
35
|
+
<strong>extraPlugins: 'wordcount',
|
36
|
+
maxWordCount: 4,
|
37
|
+
maxCharCount: 10,
|
38
|
+
// optional events
|
39
|
+
paragraphsCountGreaterThanMaxLengthEvent: function (currentLength, maxLength) {
|
40
|
+
$("#informationparagraphs").css("background-color", "crimson").css("color", "white").text(currentLength + "/" + maxLength + " - paragraphs").show();
|
41
|
+
},
|
42
|
+
wordCountGreaterThanMaxLengthEvent: function (currentLength, maxLength) {
|
43
|
+
$("#informationword").css("background-color", "crimson").css("color", "white").text(currentLength + "/" + maxLength + " - word").show();
|
44
|
+
},
|
45
|
+
charCountGreaterThanMaxLengthEvent: function (currentLength, maxLength) {
|
46
|
+
$("#informationchar").css("background-color", "crimson").css("color", "white").text(currentLength + "/" + maxLength + " - char").show();
|
47
|
+
},
|
48
|
+
charCountLessThanMaxLengthEvent: function (currentLength, maxLength) {
|
49
|
+
$("#informationchar").css("background-color", "white").css("color", "black").hide();
|
50
|
+
},
|
51
|
+
paragraphsCountLessThanMaxLengthEvent: function (currentLength, maxLength) {
|
52
|
+
$("#informationparagraphs").css("background-color", "white").css("color", "black").hide();
|
53
|
+
},
|
54
|
+
wordCountLessThanMaxLengthEvent: function (currentLength, maxLength) {
|
55
|
+
$("#informationword").css("background-color", "white").css("color", "black").hide();
|
56
|
+
}</strong>
|
57
|
+
} );
|
58
|
+
</pre>
|
59
|
+
</div>
|
60
|
+
|
61
|
+
<textarea cols="80" id="editor1" name="editor1" rows="10">
|
62
|
+
This is some <strong>sample text</strong>. You are using <a href="http://ckeditor.com/">CKEditor</a>.
|
63
|
+
</textarea>
|
64
|
+
<div id="informationchar"></div>
|
65
|
+
<div id="informationword"></div>
|
66
|
+
<div id="informationparagraphs"></div>
|
67
|
+
<script>
|
68
|
+
|
69
|
+
CKEDITOR.replace('editor1', {
|
70
|
+
extraPlugins: 'wordcount',
|
71
|
+
wordcount: {
|
72
|
+
showWordCount: true,
|
73
|
+
showCharCount: true,
|
74
|
+
maxWordCount: 4,
|
75
|
+
maxCharCount: 10,
|
76
|
+
paragraphsCountGreaterThanMaxLengthEvent: function (currentLength, maxLength) {
|
77
|
+
$("#informationparagraphs").css("background-color", "crimson").css("color", "white").text(currentLength + "/" + maxLength + " - paragraphs").show();
|
78
|
+
},
|
79
|
+
wordCountGreaterThanMaxLengthEvent: function (currentLength, maxLength) {
|
80
|
+
$("#informationword").css("background-color", "crimson").css("color", "white").text(currentLength + "/" + maxLength + " - word").show();
|
81
|
+
},
|
82
|
+
charCountGreaterThanMaxLengthEvent: function (currentLength, maxLength) {
|
83
|
+
$("#informationchar").css("background-color", "crimson").css("color", "white").text(currentLength + "/" + maxLength + " - char").show();
|
84
|
+
},
|
85
|
+
charCountLessThanMaxLengthEvent: function (currentLength, maxLength) {
|
86
|
+
$("#informationchar").css("background-color", "white").css("color", "black").hide();
|
87
|
+
},
|
88
|
+
paragraphsCountLessThanMaxLengthEvent: function (currentLength, maxLength) {
|
89
|
+
$("#informationparagraphs").css("background-color", "white").css("color", "black").hide();
|
90
|
+
},
|
91
|
+
wordCountLessThanMaxLengthEvent: function (currentLength, maxLength) {
|
92
|
+
$("#informationword").css("background-color", "white").css("color", "black").hide();
|
93
|
+
}
|
94
|
+
}
|
95
|
+
});
|
96
|
+
|
97
|
+
</script>
|
98
|
+
|
99
|
+
<div id="footer">
|
100
|
+
<hr>
|
101
|
+
<p>
|
102
|
+
CKEditor - The text editor for the Internet - <a class="samples" href="http://ckeditor.com/">http://ckeditor.com</a>
|
103
|
+
</p>
|
104
|
+
<p id="copy">
|
105
|
+
Copyright © 2003-2015, <a class="samples" href="http://cksource.com/">CKSource</a> - Frederico
|
106
|
+
Knabben. All rights reserved.
|
107
|
+
</p>
|
108
|
+
</div>
|
109
|
+
</body>
|
110
|
+
</html>
|
@@ -19,9 +19,9 @@ for(var e=0;e<b.length;e++){var d=document.createElement("option");d.text=b[e];d
|
|
19
19
|
a+";opacity: "+f+";filter: alpha(opacity\x3d"+100*f+");display: none;";k.id=d;h||e.appendChild(k);return{setDisable:function(){k.style.display="none"},setEnable:function(){k.style.display="block"}}},L=function(b,c,e){var d=new CKEDITOR.dom.element("div"),f=new CKEDITOR.dom.element("input"),h=new CKEDITOR.dom.element("label"),k="wscGrammerSuggest"+b+"_"+c;d.addClass("cke_dialog_ui_input_radio");d.setAttribute("role","presentation");d.setStyles({width:"97%",padding:"5px","white-space":"normal"});f.setAttributes({type:"radio",
|
20
20
|
value:c,name:"wscGrammerSuggest",id:k});f.setStyles({"float":"left"});f.on("click",function(b){a.textNode.GrammTab.setValue(b.sender.getValue())});e?f.setAttribute("checked",!0):!1;f.addClass("cke_dialog_ui_radio_input");h.appendText(b);h.setAttribute("for",k);h.setStyles({display:"block","line-height":"16px","margin-left":"18px","white-space":"normal"});d.append(f);d.append(h);return d},F=function(a){a=a||"true";null!==a&&"false"==a&&t()},w=function(b){var c=new I(b);b="wscLang"+a.dialog.getParentEditor().name;
|
21
21
|
b=document.getElementById(b);var e=a.iframeNumber+"_"+a.dialog._.currentTabId;a.buildOptionLang(c.setLangList,a.dialog.getParentEditor().name);u[c.getCurrentLangGroup(a.selectingLang)].onShow();F(a.show_grammar);b.onchange=function(b){b=c.getCurrentLangGroup(this.value);var f=a.dialog._.currentTabId;u[b].onShow();F(a.show_grammar);a.div_overlay.setEnable();a.selectingLang=this.value;f=a.cmd[f];b&&u[b]&&u[b].allowedTabCommands[f]||(f=u[b].defaultTabCommand);for(var h in a.cmd)if(a.cmd[h]==f){a.previousTab=
|
22
|
-
h;break}g.postMessage.send({message:{changeLang:a.selectingLang,text:a.dataTemp,cmd:f},target:a.targetFromFrame[e],id:"selectionLang_outer__page"})}},M=function(b){var c,e=function(b){b=a.dialog.getContentElement(a.dialog._.currentTabId,b)||a.LocalizationButton[b].instance;b.getElement().hasClass("cke_disabled")?b.getElement().setStyle("color","#a0a0a0"):b.disable()};c=function(b){b=a.dialog.getContentElement(a.dialog._.currentTabId,b)||a.LocalizationButton[b].instance;
|
23
|
-
"#333")};"no_any_suggestions"==b?(b="No suggestions",c=a.dialog.getContentElement(a.dialog._.currentTabId,"ChangeTo_button")||a.LocalizationButton.ChangeTo_button.instance,c.disable(),c=a.dialog.getContentElement(a.dialog._.currentTabId,"ChangeAll")||a.LocalizationButton.ChangeAll.instance,c.disable(),e("ChangeTo_button"),e("ChangeAll")):(c("ChangeTo_button"),c("ChangeAll"));return b},O={iframeOnload:function(b){a.div_overlay.setEnable();b=a.dialog._.currentTabId;
|
24
|
-
"_"+b],a.cmd[b])},suggestlist:function(b){delete b.id;a.div_overlay_no_check.setDisable();C();w(a.langList);var c=M(b.word),e="";c instanceof Array&&(c=b.word[0]);e=c=c.split(",");a.textNode.SpellTab.setValue(e[0]);b=z(A);A.clear();for(c=0;c<e.length;c++){var d=document.createElement("option");d.text=e[c];d.value=e[c];b.$.add(d,c)}v();a.div_overlay.setDisable()},grammerSuggest:function(b){delete b.id;delete b.mocklangs;C();w(a.langList);var c=b.grammSuggest[0];a.grammerSuggest.getElement().setHtml("");
|
22
|
+
h;break}g.postMessage.send({message:{changeLang:a.selectingLang,interfaceLang:a.interfaceLang,text:a.dataTemp,cmd:f},target:a.targetFromFrame[e],id:"selectionLang_outer__page"})}},M=function(b){var c,e=function(b){b=a.dialog.getContentElement(a.dialog._.currentTabId,b)||a.LocalizationButton[b].instance;b.getElement().hasClass("cke_disabled")?b.getElement().setStyle("color","#a0a0a0"):b.disable()};c=function(b){b=a.dialog.getContentElement(a.dialog._.currentTabId,b)||a.LocalizationButton[b].instance;
|
23
|
+
b.enable();b.getElement().setStyle("color","#333")};"no_any_suggestions"==b?(b="No suggestions",c=a.dialog.getContentElement(a.dialog._.currentTabId,"ChangeTo_button")||a.LocalizationButton.ChangeTo_button.instance,c.disable(),c=a.dialog.getContentElement(a.dialog._.currentTabId,"ChangeAll")||a.LocalizationButton.ChangeAll.instance,c.disable(),e("ChangeTo_button"),e("ChangeAll")):(c("ChangeTo_button"),c("ChangeAll"));return b},O={iframeOnload:function(b){a.div_overlay.setEnable();b=a.dialog._.currentTabId;
|
24
|
+
E(a.targetFromFrame[a.iframeNumber+"_"+b],a.cmd[b])},suggestlist:function(b){delete b.id;a.div_overlay_no_check.setDisable();C();w(a.langList);var c=M(b.word),e="";c instanceof Array&&(c=b.word[0]);e=c=c.split(",");a.textNode.SpellTab.setValue(e[0]);b=z(A);A.clear();for(c=0;c<e.length;c++){var d=document.createElement("option");d.text=e[c];d.value=e[c];b.$.add(d,c)}v();a.div_overlay.setDisable()},grammerSuggest:function(b){delete b.id;delete b.mocklangs;C();w(a.langList);var c=b.grammSuggest[0];a.grammerSuggest.getElement().setHtml("");
|
25
25
|
a.textNode.GrammTab.reset();a.textNode.GrammTab.setValue(c);a.textNodeInfo.GrammTab.getElement().setHtml("");a.textNodeInfo.GrammTab.getElement().setText(b.info);b=b.grammSuggest;for(var c=b.length,e=!0,d=0;d<c;d++)a.grammerSuggest.getElement().append(L(b[d],b[d],e)),e=!1;v();a.div_overlay.setDisable()},thesaurusSuggest:function(b){delete b.id;delete b.mocklangs;C();w(a.langList);a.selectNodeResponce=b;a.textNode.Thesaurus.reset();var c=z(a.selectNode.Categories),e=0;a.selectNode.Categories.clear();
|
26
26
|
for(var d in b)b=document.createElement("option"),b.text=d,b.value=d,c.$.add(b,e),e++;c=a.selectNode.Categories.getInputElement().getChildren().$[0].value;a.selectNode.Categories.getInputElement().getChildren().$[0].selected=!0;a.buildOptionSynonyms(c);v();a.div_overlay.setDisable()},finish:function(b){delete b.id;N();b=a.dialog.getContentElement(a.dialog._.currentTabId,"BlockFinishChecking").getElement();b.removeStyle("display");b.removeStyle("position");b.removeStyle("left");b.show();a.div_overlay.setDisable()},
|
27
27
|
settext:function(b){delete b.id;a.dialog.getParentEditor().getCommand("checkspell");var c=a.dialog.getParentEditor();if(c.scayt&&c.wsc.isSsrvSame){var e=c.wsc.udn;e?c.wsc.DataStorage.setData("scayt_user_dictionary_name",e):c.wsc.DataStorage.setData("scayt_user_dictionary_name","")}try{c.focus()}catch(d){}c.setData(b.text,function(){a.dataTemp="";c.unlockSelection();c.fire("saveSnapshot");a.dialog.hide()})},ReplaceText:function(b){delete b.id;a.div_overlay.setEnable();a.dataTemp=b.text;a.selectingLang=
|
@@ -29,8 +29,8 @@ b.currentLang;(b.cmd="0"!==b.len&&b.len)?a.div_overlay.setDisable():window.setTi
|
|
29
29
|
b.DefOptions.localizationButtonsAndText;a.show_grammar=b.show_grammar;a.langList=b.lang;a.bnr=b.bannerId;a.sessionid=b.sessionid;if(b.bannerId){a.setHeightBannerFrame();var e=b.banner;a.dialog.getContentElement(a.dialog._.currentTabId,"banner").getElement().setHtml(e)}else a.setHeightFrame();"undefined"==c&&(a.userDictionaryName?(c=a.userDictionaryName,e={osp:g.cookie.get("osp"),udn:a.userDictionaryName,cust_dic_ids:a.cust_dic_ids,id:"options_dic_send",udnCmd:"create"},g.postMessage.send({message:e,
|
30
30
|
target:a.targetFromFrame[void 0]})):c="");g.cookie.set("osp",b.DefOptions.osp);g.cookie.set("udn",c);g.cookie.set("cust_dic_ids",b.DefOptions.cust_dic_ids);g.postMessage.send({id:"giveOptions"})},options_dic_send:function(b){b={osp:g.cookie.get("osp"),udn:g.cookie.get("udn"),cust_dic_ids:a.cust_dic_ids,id:"options_dic_send",udnCmd:g.cookie.get("udnCmd")};g.postMessage.send({message:b,target:a.targetFromFrame[a.iframeNumber+"_"+a.dialog._.currentTabId]})},data:function(a){delete a.id},giveOptions:function(){},
|
31
31
|
setOptionsConfirmF:function(){},setOptionsConfirmT:function(){r.setValue("")},clickBusy:function(){a.div_overlay.setEnable()},suggestAllCame:function(){a.div_overlay.setDisable();a.div_overlay_no_check.setDisable()},TextCorrect:function(){w(a.langList)}},G=function(a){a=a||window.event;if((a=window.JSON.parse(a.data))&&a.id)O[a.id](a)},E=function(b,c,e,d){c=c||CKEDITOR.config.wsc_cmd;e=e||a.dataTemp;g.postMessage.send({message:{customerId:a.wsc_customerId,text:e,txt_ctrl:a.TextAreaNumber,cmd:c,cust_dic_ids:a.cust_dic_ids,
|
32
|
-
udn:a.userDictionaryName,slang:a.selectingLang,reset_suggest:d||!1,sessionid:a.sessionid},target:b,id:"data_outer__page"});a.div_overlay.setEnable()},u={superset:{onShow:function(){a.dialog.showPage("Thesaurus");a.dialog.showPage("GrammTab");l()},allowedTabCommands:{spell:!0,grammar:!0,thes:!0},defaultTabCommand:"spell"},usual:{onShow:function(){x();t();l()},allowedTabCommands:{spell:!0},defaultTabCommand:"spell"},rtl:{onShow:function(){x();t();l()},allowedTabCommands:{spell:!0},
|
33
|
-
spellgrammar:{onShow:function(){x();a.dialog.showPage("GrammTab");l()},allowedTabCommands:{spell:!0,grammar:!0},defaultTabCommand:"spell"},spellthes:{onShow:function(){a.dialog.showPage("Thesaurus");t();l()},allowedTabCommands:{spell:!0,thes:!0},defaultTabCommand:"spell"}},H=function(b){var c=(new function(a){var b={};return{getCmdByTab:function(c){for(var h in a)b[a[h]]=h;return b[c]}}}(a.cmd)).getCmdByTab(CKEDITOR.config.wsc_cmd);b.selectPage(c);a.sendData(b)},x=function(){a.dialog.hidePage("Thesaurus")},
|
32
|
+
udn:a.userDictionaryName,slang:a.selectingLang,interfaceLang:a.interfaceLang,reset_suggest:d||!1,sessionid:a.sessionid},target:b,id:"data_outer__page"});a.div_overlay.setEnable()},u={superset:{onShow:function(){a.dialog.showPage("Thesaurus");a.dialog.showPage("GrammTab");l()},allowedTabCommands:{spell:!0,grammar:!0,thes:!0},defaultTabCommand:"spell"},usual:{onShow:function(){x();t();l()},allowedTabCommands:{spell:!0},defaultTabCommand:"spell"},rtl:{onShow:function(){x();t();l()},allowedTabCommands:{spell:!0},
|
33
|
+
defaultTabCommand:"spell"},spellgrammar:{onShow:function(){x();a.dialog.showPage("GrammTab");l()},allowedTabCommands:{spell:!0,grammar:!0},defaultTabCommand:"spell"},spellthes:{onShow:function(){a.dialog.showPage("Thesaurus");t();l()},allowedTabCommands:{spell:!0,thes:!0},defaultTabCommand:"spell"}},H=function(b){var c=(new function(a){var b={};return{getCmdByTab:function(c){for(var h in a)b[a[h]]=h;return b[c]}}}(a.cmd)).getCmdByTab(CKEDITOR.config.wsc_cmd);b.selectPage(c);a.sendData(b)},x=function(){a.dialog.hidePage("Thesaurus")},
|
34
34
|
t=function(){a.dialog.hidePage("GrammTab")},l=function(){a.dialog.showPage("SpellTab")},v=function(){var b=a.dialog.getContentElement(a.dialog._.currentTabId,"bottomGroup").getElement();b.removeStyle("display");b.removeStyle("position");b.removeStyle("left");b.show()},N=function(){var b=a.dialog.getContentElement(a.dialog._.currentTabId,"bottomGroup").getElement(),c=document.activeElement,e;b.setStyles({display:"block",position:"absolute",left:"-9999px"});setTimeout(function(){b.removeStyle("display");
|
35
35
|
b.removeStyle("position");b.removeStyle("left");b.hide();a.dialog._.editor.focusManager.currentActive.focusNext();e=g.misc.findFocusable(a.dialog.parts.contents);if(g.misc.hasClass(c,"cke_dialog_tab")||g.misc.hasClass(c,"cke_dialog_contents_body")||!g.misc.isVisible(c))for(var d=0,f;d<e.count();d++){if(f=e.getItem(d),g.misc.isVisible(f.$)){try{f.$.focus()}catch(h){}break}}else try{c.focus()}catch(k){}},0)},C=function(){var b=a.dialog.getContentElement(a.dialog._.currentTabId,"BlockFinishChecking").getElement(),
|
36
36
|
c=document.activeElement,e;b.setStyles({display:"block",position:"absolute",left:"-9999px"});setTimeout(function(){b.removeStyle("display");b.removeStyle("position");b.removeStyle("left");b.hide();a.dialog._.editor.focusManager.currentActive.focusNext();e=g.misc.findFocusable(a.dialog.parts.contents);if(g.misc.hasClass(c,"cke_dialog_tab")||g.misc.hasClass(c,"cke_dialog_contents_body")||!g.misc.isVisible(c))for(var d=0,f;d<e.count();d++){if(f=e.getItem(d),g.misc.isVisible(f.$)){try{f.$.focus()}catch(h){}break}}else try{c.focus()}catch(k){}},
|
@@ -46,15 +46,15 @@ e.src=d;document.getElementsByTagName("head")[0].appendChild(e);e.onload=c;e.onr
|
|
46
46
|
new_word:e},target:a.targetFromFrame[d],id:"cmd_outer__page"});"ChangeTo"!=f&&"ChangeAll"!=f||b.fire("saveSnapshot");"FinishChecking"==f&&b.config.wsc_onFinish.call(CKEDITOR.document.getWindow().getFrame())},f={minWidth:560,minHeight:444};return{title:b.config.wsc_dialogTitle||b.lang.wsc.title,minWidth:f.minWidth,minHeight:f.minHeight,buttons:[CKEDITOR.dialog.cancelButton],onLoad:function(){a.dialog=this;x();t();l();b.plugins.scayt&&e()},onShow:function(){a.dialog=this;b.lockSelection(b.getSelection());
|
47
47
|
a.TextAreaNumber="cke_textarea_"+b.name;g.postMessage.init(G);a.dataTemp=b.getData();a.OverlayPlace=a.dialog.parts.tabs.getParent().$;if(CKEDITOR&&CKEDITOR.config){a.wsc_customerId=b.config.wsc_customerId;a.cust_dic_ids=b.config.wsc_customDictionaryIds;a.userDictionaryName=b.config.wsc_userDictionaryName;a.defaultLanguage=CKEDITOR.config.defaultLanguage;var d="file:"==document.location.protocol?"http:":document.location.protocol,d=b.config.wsc_customLoaderScript||d+"//loader.webspellchecker.net/sproxy_fck/sproxy.php?plugin\x3dfck2\x26customerid\x3d"+
|
48
48
|
a.wsc_customerId+"\x26cmd\x3dscript\x26doc\x3dwsc\x26schema\x3d22";c(this);CKEDITOR.scriptLoader.load(d,function(c){CKEDITOR.config&&CKEDITOR.config.wsc&&CKEDITOR.config.wsc.DefaultParams?(a.serverLocationHash=CKEDITOR.config.wsc.DefaultParams.serviceHost,a.logotype=CKEDITOR.config.wsc.DefaultParams.logoPath,a.loadIcon=CKEDITOR.config.wsc.DefaultParams.iconPath,a.loadIconEmptyEditor=CKEDITOR.config.wsc.DefaultParams.iconPathEmptyEditor,a.LangComparer=new CKEDITOR.config.wsc.DefaultParams._SP_FCK_LangCompare):
|
49
|
-
(a.serverLocationHash=DefaultParams.serviceHost,a.logotype=DefaultParams.logoPath,a.loadIcon=DefaultParams.iconPath,a.loadIconEmptyEditor=DefaultParams.iconPathEmptyEditor,a.LangComparer=new _SP_FCK_LangCompare);a.pluginPath=CKEDITOR.getUrl(b.plugins.wsc.path);a.iframeNumber=a.TextAreaNumber;a.templatePath=a.pluginPath+"dialogs/tmp.html";a.LangComparer.setDefaulLangCode(a.defaultLanguage);a.currentLang=b.config.wsc_lang||a.LangComparer.getSPLangCode(b.langCode)||"en_US";a.
|
50
|
-
a.div_overlay=new B({opacity:"1",background:"#fff url("+a.loadIcon+") no-repeat 50% 50%",target:a.OverlayPlace});var d=a.dialog.parts.tabs.getId(),d=CKEDITOR.document.getById(d);d.setStyle("width","97%");d.getElementsByTag("DIV").count()||d.append(a.buildSelectLang(a.dialog.getParentEditor().name));a.div_overlay_no_check=new B({opacity:"1",id:"no_check_over",background:"#fff url("+a.loadIconEmptyEditor+") no-repeat 50% 50%",target:a.OverlayPlace});c&&(H(a.dialog),a.dialog.setupContent(a.dialog));
|
49
|
+
(a.serverLocationHash=DefaultParams.serviceHost,a.logotype=DefaultParams.logoPath,a.loadIcon=DefaultParams.iconPath,a.loadIconEmptyEditor=DefaultParams.iconPathEmptyEditor,a.LangComparer=new _SP_FCK_LangCompare);a.pluginPath=CKEDITOR.getUrl(b.plugins.wsc.path);a.iframeNumber=a.TextAreaNumber;a.templatePath=a.pluginPath+"dialogs/tmp.html";a.LangComparer.setDefaulLangCode(a.defaultLanguage);a.currentLang=b.config.wsc_lang||a.LangComparer.getSPLangCode(b.langCode)||"en_US";a.interfaceLang=b.config.wsc_interfaceLang;
|
50
|
+
a.selectingLang=a.currentLang;a.div_overlay=new B({opacity:"1",background:"#fff url("+a.loadIcon+") no-repeat 50% 50%",target:a.OverlayPlace});var d=a.dialog.parts.tabs.getId(),d=CKEDITOR.document.getById(d);d.setStyle("width","97%");d.getElementsByTag("DIV").count()||d.append(a.buildSelectLang(a.dialog.getParentEditor().name));a.div_overlay_no_check=new B({opacity:"1",id:"no_check_over",background:"#fff url("+a.loadIconEmptyEditor+") no-repeat 50% 50%",target:a.OverlayPlace});c&&(H(a.dialog),a.dialog.setupContent(a.dialog));
|
51
51
|
b.plugins.scayt&&(b.wsc.isSsrvSame=function(){var a=CKEDITOR.config.wsc.DefaultParams.serviceHost.replace("lf/22/js/../../../","").split("//")[1],c=CKEDITOR.config.wsc.DefaultParams.ssrvHost,d=b.config.scayt_srcUrl,e,h,f,g,p;window.SCAYT&&window.SCAYT.CKSCAYT&&(f=SCAYT.CKSCAYT.prototype.basePath,f.split("//"),g=f.split("//")[1].split("/")[0],p=f.split(g+"/")[1].replace("/lf/scayt3/ckscayt/","")+"/script/ssrv.cgi");!d||f||b.config.scayt_servicePath||(d.split("//"),e=d.split("//")[1].split("/")[0],
|
52
52
|
h=d.split(e+"/")[1].replace("/lf/scayt3/ckscayt/ckscayt.js","")+"/script/ssrv.cgi");return"//"+a+c==="//"+(b.config.scayt_serviceHost||g||e)+"/"+(b.config.scayt_servicePath||p||h)}());if(window.SCAYT&&b.wsc&&b.wsc.isSsrvSame){var e=b.wsc.cgiOrigin();b.wsc.syncIsDone=!1;c=function(a){a.origin===e&&(a=JSON.parse(a.data),a.ud&&"undefined"!==a.ud?b.wsc.ud=a.ud:"undefined"===a.ud&&(b.wsc.ud=void 0),a.udn&&"undefined"!==a.udn?b.wsc.udn=a.udn:"undefined"===a.udn&&(b.wsc.udn=void 0),b.wsc.syncIsDone||(h(b.wsc.ud),
|
53
53
|
b.wsc.syncIsDone=!0))};var h=function(c){c=b.wsc.getLocalStorageUD();var d;c instanceof Array&&(d=c.toString());void 0!==d&&""!==d&&setTimeout(function(){b.wsc.addWords(d,function(){H(a.dialog);a.dialog.setupContent(a.dialog)})},400)};window.addEventListener?addEventListener("message",c,!1):window.attachEvent("onmessage",c);setTimeout(function(){var a=b.wsc.getLocalStorageUDN();void 0!==a&&b.wsc.operationWithUDN("restore",a)},500)}})}else a.dialog.hide()},onHide:function(){var c=CKEDITOR.plugins.scayt,
|
54
54
|
d=b.scayt;b.unlockSelection();c&&d&&c.state[b.name]&&d.setMarkupPaused(!1);a.dataTemp="";a.sessionid="";g.postMessage.unbindHandler(G);if(b.plugins.scayt&&b.wsc&&b.wsc.isSsrvSame){var c=b.wsc.udn,e=b.wsc.ud,f,l;b.scayt?(c?(b.wsc.DataStorage.setData("scayt_user_dictionary_name",c),b.scayt.restoreUserDictionary(c)):(b.wsc.DataStorage.setData("scayt_user_dictionary_name",""),b.scayt.removeUserDictionary()),e&&setTimeout(function(){f=e.split(",");for(l=0;l<f.length;l+=1)b.scayt.addWordToUserDictionary(f[l])},
|
55
55
|
200),e||b.wsc.DataStorage.setData("scayt_user_dictionary",[])):(c?b.wsc.DataStorage.setData("scayt_user_dictionary_name",c):b.wsc.DataStorage.setData("scayt_user_dictionary_name",""),e&&(f=e.split(","),b.wsc.DataStorage.setData("scayt_user_dictionary",f)))}},contents:[{id:"SpellTab",label:"SpellChecker",accessKey:"S",elements:[{type:"html",id:"banner",label:"banner",style:"",html:"\x3cdiv\x3e\x3c/div\x3e"},{type:"html",id:"Content",label:"spellContent",html:"",setup:function(b){b=a.iframeNumber+"_"+
|
56
|
-
b._.currentTabId;var c=document.getElementById(b);a.targetFromFrame[b]=c.contentWindow}},{type:"hbox",id:"bottomGroup",style:"width:560px; margin: 0 auto;",widths:["50%","50%"],children:[{type:"hbox",id:"leftCol",align:"left",width:"50%",children:[{type:"vbox",id:"rightCol1",widths:["50%","50%"],children:[{type:"text",id:"ChangeTo_label",label:a.LocalizationLabel.ChangeTo_label.text+":",labelLayout:"horizontal",labelStyle:"font: 12px/25px arial, sans-serif;",width:"140px",
|
57
|
-
this;a.LocalizationLabel.ChangeTo_label.instance=this},onHide:function(){this.reset()}},{type:"hbox",id:"rightCol",align:"right",width:"30%",children:[{type:"vbox",id:"rightCol_col__left",children:[{type:"text",id:"labelSuggestions",label:a.LocalizationLabel.Suggestions.text+":",onShow:function(){a.LocalizationLabel.Suggestions.instance=this;this.getInputElement().setStyles({display:"none"})}},{type:"html",id:"logo",html:'\x3cimg width\x3d"99" height\x3d"68" border\x3d"0" src\x3d"" title\x3d"WebSpellChecker.net" alt\x3d"WebSpellChecker.net" style\x3d"display: inline-block;"\x3e',
|
56
|
+
b._.currentTabId;var c=document.getElementById(b);a.targetFromFrame[b]=c.contentWindow}},{type:"hbox",id:"bottomGroup",style:"width:560px; margin: 0 auto;",widths:["50%","50%"],className:"wsc-spelltab-bottom",children:[{type:"hbox",id:"leftCol",align:"left",width:"50%",children:[{type:"vbox",id:"rightCol1",widths:["50%","50%"],children:[{type:"text",id:"ChangeTo_label",label:a.LocalizationLabel.ChangeTo_label.text+":",labelLayout:"horizontal",labelStyle:"font: 12px/25px arial, sans-serif;",width:"140px",
|
57
|
+
"default":"",onShow:function(){a.textNode.SpellTab=this;a.LocalizationLabel.ChangeTo_label.instance=this},onHide:function(){this.reset()}},{type:"hbox",id:"rightCol",align:"right",width:"30%",children:[{type:"vbox",id:"rightCol_col__left",children:[{type:"text",id:"labelSuggestions",label:a.LocalizationLabel.Suggestions.text+":",onShow:function(){a.LocalizationLabel.Suggestions.instance=this;this.getInputElement().setStyles({display:"none"})}},{type:"html",id:"logo",html:'\x3cimg width\x3d"99" height\x3d"68" border\x3d"0" src\x3d"" title\x3d"WebSpellChecker.net" alt\x3d"WebSpellChecker.net" style\x3d"display: inline-block;"\x3e',
|
58
58
|
setup:function(b){this.getElement().$.src=a.logotype;this.getElement().getParent().setStyles({"text-align":"left"})}}]},{type:"select",id:"list_of_suggestions",labelStyle:"font: 12px/25px arial, sans-serif;",size:"6",inputStyle:"width: 140px; height: auto;",items:[["loading..."]],onShow:function(){A=this},onChange:function(){a.textNode.SpellTab.setValue(this.getValue())}}]}]}]},{type:"hbox",id:"rightCol",align:"right",width:"50%",children:[{type:"vbox",id:"rightCol_col__left",widths:["50%","50%",
|
59
59
|
"50%","50%"],children:[{type:"button",id:"ChangeTo_button",label:a.LocalizationButton.ChangeTo_button.text,title:"Change to",style:"width: 100%;",onLoad:function(){this.getElement().setAttribute("title-cmd","ChangeTo");a.LocalizationButton.ChangeTo_button.instance=this},onClick:d},{type:"button",id:"ChangeAll",label:a.LocalizationButton.ChangeAll.text,title:"Change All",style:"width: 100%;",onLoad:function(){this.getElement().setAttribute("title-cmd",this.id);a.LocalizationButton.ChangeAll.instance=
|
60
60
|
this},onClick:d},{type:"button",id:"AddWord",label:a.LocalizationButton.AddWord.text,title:"Add word",style:"width: 100%;",onLoad:function(){this.getElement().setAttribute("title-cmd",this.id);a.LocalizationButton.AddWord.instance=this},onClick:d},{type:"button",id:"FinishChecking_button",label:a.LocalizationButton.FinishChecking_button.text,title:"Finish Checking",style:"width: 100%;margin-top: 9px;",onLoad:function(){this.getElement().setAttribute("title-cmd","FinishChecking");a.LocalizationButton.FinishChecking_button.instance=
|
@@ -0,0 +1,43 @@
|
|
1
|
+
.cke_dialog_body #overlayBlock,
|
2
|
+
.cke_dialog_body #no_check_over
|
3
|
+
{
|
4
|
+
top: 39px !important;
|
5
|
+
}
|
6
|
+
|
7
|
+
div[name=SpellTab] .wsc-spelltab-bottom .cke_dialog_ui_vbox td > .cke_dialog_ui_button:first-child
|
8
|
+
{
|
9
|
+
margin-top: 4px;
|
10
|
+
}
|
11
|
+
|
12
|
+
div[name=SpellTab] .wsc-spelltab-bottom .cke_dialog_ui_hbox_first .cke_dialog_ui_select > label
|
13
|
+
{
|
14
|
+
margin-left: 0;
|
15
|
+
}
|
16
|
+
|
17
|
+
div[name=SpellTab] .wsc-spelltab-bottom .cke_dialog_ui_hbox_first .cke_dialog_ui_select div.cke_dialog_ui_input_select
|
18
|
+
{
|
19
|
+
width: 140px !important;
|
20
|
+
}
|
21
|
+
|
22
|
+
div[name=SpellTab] .wsc-spelltab-bottom .cke_dialog_ui_hbox_first .cke_dialog_ui_select select.cke_dialog_ui_input_select,
|
23
|
+
div[name=Thesaurus] div.cke_dialog_ui_input_select select.cke_dialog_ui_input_select
|
24
|
+
{
|
25
|
+
margin-top: 1px;
|
26
|
+
}
|
27
|
+
|
28
|
+
div[name=SpellTab] .wsc-spelltab-bottom .cke_dialog_ui_hbox_first .cke_dialog_ui_select select.cke_dialog_ui_input_select:focus,
|
29
|
+
div[name=Thesaurus] div.cke_dialog_ui_input_select select.cke_dialog_ui_input_select:focus
|
30
|
+
{
|
31
|
+
margin-top: 0;
|
32
|
+
}
|
33
|
+
|
34
|
+
div[name=GrammTab] .cke_dialog_ui_vbox tbody > tr:first-child .cke_dialog_ui_button,
|
35
|
+
div[name=Thesaurus] .cke_dialog_ui_vbox tbody > tr:first-child .cke_dialog_ui_button
|
36
|
+
{
|
37
|
+
margin-top: 4px !important;
|
38
|
+
}
|
39
|
+
|
40
|
+
div[name=Thesaurus] div.cke_dialog_ui_input_select
|
41
|
+
{
|
42
|
+
width: 180px !important;
|
43
|
+
}
|
@@ -0,0 +1,15 @@
|
|
1
|
+
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
|
2
|
+
Version 2, December 2004
|
3
|
+
|
4
|
+
Copyright (C) 2004 Sam Hocevar <sam@hocevar.net>
|
5
|
+
|
6
|
+
Everyone is permitted to copy and distribute verbatim or modified
|
7
|
+
copies of this license document, and changing it is allowed as long
|
8
|
+
as the name is changed.
|
9
|
+
|
10
|
+
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
|
11
|
+
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
|
12
|
+
|
13
|
+
0. You just DO WHAT THE FUCK YOU WANT TO.
|
14
|
+
|
15
|
+
|
File without changes
|
@@ -10,6 +10,7 @@ CKEDITOR.plugins.setLang('youtube', 'en', {
|
|
10
10
|
chkPrivacy : 'Enable privacy-enhanced mode',
|
11
11
|
chkOlderCode : 'Use old embed code',
|
12
12
|
chkAutoplay: 'Autoplay',
|
13
|
+
chkControls: 'Show player controls',
|
13
14
|
noCode : 'You must input an embed code or URL',
|
14
15
|
invalidEmbed : 'The embed code you\'ve entered doesn\'t appear to be valid',
|
15
16
|
invalidUrl : 'The URL you\'ve entered doesn\'t appear to be valid',
|
@@ -19,5 +20,6 @@ CKEDITOR.plugins.setLang('youtube', 'en', {
|
|
19
20
|
noHeight : 'You must inform the height',
|
20
21
|
invalidHeight : 'Inform a valid height',
|
21
22
|
invalidTime : 'Inform a valid start time',
|
22
|
-
txtResponsive : 'Make Responsive (ignore width and height, fit to width)'
|
23
|
+
txtResponsive : 'Make Responsive (ignore width and height, fit to width)',
|
24
|
+
txtNoEmbed : 'Video image and link only'
|
23
25
|
});
|
@@ -10,6 +10,7 @@ CKEDITOR.plugins.setLang('youtube', 'ru', {
|
|
10
10
|
chkPrivacy : 'Включить режим повышенной конфиденциальности',
|
11
11
|
chkOlderCode : 'Использовать старый код вставки',
|
12
12
|
chkAutoplay: 'Автозапуск',
|
13
|
+
chkControls: 'Показать панель управления',
|
13
14
|
noCode : 'Вы должны ввести HTML-код или адрес',
|
14
15
|
invalidEmbed : 'Ваш HTML-код не похож на правильный',
|
15
16
|
invalidUrl : 'Ваш адрес видео не похож на правильный',
|
@@ -1,388 +1,448 @@
|
|
1
|
-
/*
|
2
|
-
* Youtube Embed Plugin
|
3
|
-
*
|
4
|
-
* @author Jonnas Fonini <
|
5
|
-
* @version 2.
|
6
|
-
*/
|
7
|
-
(
|
8
|
-
CKEDITOR.plugins.add(
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
{
|
45
|
-
handleEmbedChange(
|
46
|
-
},
|
47
|
-
onKeyUp : function (
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
{
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
|
188
|
-
|
189
|
-
|
190
|
-
|
191
|
-
|
192
|
-
|
193
|
-
|
194
|
-
|
195
|
-
|
196
|
-
|
197
|
-
|
198
|
-
|
199
|
-
|
200
|
-
|
201
|
-
|
202
|
-
|
203
|
-
|
204
|
-
|
205
|
-
|
206
|
-
|
207
|
-
|
208
|
-
|
209
|
-
|
210
|
-
|
211
|
-
|
212
|
-
|
213
|
-
|
214
|
-
|
215
|
-
|
216
|
-
|
217
|
-
|
218
|
-
|
219
|
-
|
220
|
-
|
221
|
-
|
222
|
-
|
223
|
-
|
224
|
-
|
225
|
-
|
226
|
-
|
227
|
-
|
228
|
-
|
229
|
-
|
230
|
-
|
231
|
-
|
232
|
-
|
233
|
-
|
234
|
-
|
235
|
-
|
236
|
-
|
237
|
-
|
238
|
-
|
239
|
-
|
240
|
-
|
241
|
-
|
242
|
-
]
|
243
|
-
|
244
|
-
|
245
|
-
|
246
|
-
|
247
|
-
|
248
|
-
|
249
|
-
|
250
|
-
|
251
|
-
|
252
|
-
|
253
|
-
|
254
|
-
|
255
|
-
|
256
|
-
|
257
|
-
|
258
|
-
|
259
|
-
if (
|
260
|
-
|
261
|
-
|
262
|
-
|
263
|
-
|
264
|
-
|
265
|
-
}
|
266
|
-
|
267
|
-
|
268
|
-
|
269
|
-
if (
|
270
|
-
|
271
|
-
|
272
|
-
|
273
|
-
|
274
|
-
|
275
|
-
{
|
276
|
-
params.
|
277
|
-
}
|
278
|
-
|
279
|
-
|
280
|
-
|
281
|
-
|
282
|
-
|
283
|
-
|
284
|
-
|
285
|
-
|
286
|
-
|
287
|
-
|
288
|
-
|
289
|
-
|
290
|
-
|
291
|
-
|
292
|
-
|
293
|
-
|
294
|
-
|
295
|
-
|
296
|
-
|
297
|
-
|
298
|
-
|
299
|
-
|
300
|
-
|
301
|
-
|
302
|
-
|
303
|
-
|
304
|
-
|
305
|
-
|
306
|
-
|
307
|
-
|
308
|
-
|
309
|
-
|
310
|
-
|
311
|
-
content += '<
|
312
|
-
content += '
|
313
|
-
|
314
|
-
|
315
|
-
|
316
|
-
content += '
|
317
|
-
|
318
|
-
|
319
|
-
|
320
|
-
|
321
|
-
|
322
|
-
|
323
|
-
|
324
|
-
|
325
|
-
|
326
|
-
|
327
|
-
|
328
|
-
|
329
|
-
|
330
|
-
|
331
|
-
|
332
|
-
|
333
|
-
|
334
|
-
|
335
|
-
|
336
|
-
}
|
337
|
-
|
338
|
-
|
339
|
-
|
340
|
-
|
341
|
-
if (
|
342
|
-
|
343
|
-
|
344
|
-
|
345
|
-
|
346
|
-
|
347
|
-
|
348
|
-
|
349
|
-
|
350
|
-
|
351
|
-
|
352
|
-
|
353
|
-
|
354
|
-
|
355
|
-
|
356
|
-
|
357
|
-
|
358
|
-
|
359
|
-
|
360
|
-
|
361
|
-
|
362
|
-
|
363
|
-
|
364
|
-
|
365
|
-
|
366
|
-
|
367
|
-
|
368
|
-
|
369
|
-
|
370
|
-
|
371
|
-
|
372
|
-
|
373
|
-
|
374
|
-
|
375
|
-
|
376
|
-
|
377
|
-
|
378
|
-
|
379
|
-
|
380
|
-
|
381
|
-
|
382
|
-
|
383
|
-
|
384
|
-
m
|
385
|
-
|
386
|
-
|
387
|
-
|
388
|
-
|
1
|
+
/*
|
2
|
+
* Youtube Embed Plugin
|
3
|
+
*
|
4
|
+
* @author Jonnas Fonini <jonnasfonini@gmail.com>
|
5
|
+
* @version 2.1.5
|
6
|
+
*/
|
7
|
+
(function () {
|
8
|
+
CKEDITOR.plugins.add('youtube', {
|
9
|
+
lang: [ 'en', 'pt', 'pt-br', 'ja', 'hu', 'it', 'fr', 'tr', 'ru', 'de', 'ar', 'nl', 'pl', 'vi', 'zh', 'el', 'he', 'es', 'nb', 'nn', 'fi', 'et', 'sk', 'cs', 'ko'],
|
10
|
+
init: function (editor) {
|
11
|
+
editor.addCommand('youtube', new CKEDITOR.dialogCommand('youtube', {
|
12
|
+
allowedContent: 'div{*}(*); iframe{*}[!width,!height,!src,!frameborder,!allowfullscreen]; object param[*]; a[*]; img[*]'
|
13
|
+
}));
|
14
|
+
|
15
|
+
editor.ui.addButton('Youtube', {
|
16
|
+
label : editor.lang.youtube.button,
|
17
|
+
toolbar : 'insert',
|
18
|
+
command : 'youtube',
|
19
|
+
icon : this.path + 'images/icon.png'
|
20
|
+
});
|
21
|
+
|
22
|
+
CKEDITOR.dialog.add('youtube', function (instance) {
|
23
|
+
var video,
|
24
|
+
disabled = editor.config.youtube_disabled_fields || [];
|
25
|
+
|
26
|
+
return {
|
27
|
+
title : editor.lang.youtube.title,
|
28
|
+
minWidth : 510,
|
29
|
+
minHeight : 200,
|
30
|
+
onShow: function () {
|
31
|
+
for (var i = 0; i < disabled.length; i++) {
|
32
|
+
this.getContentElement('youtubePlugin', disabled[i]).disable();
|
33
|
+
}
|
34
|
+
},
|
35
|
+
contents :
|
36
|
+
[{
|
37
|
+
id : 'youtubePlugin',
|
38
|
+
expand : true,
|
39
|
+
elements :
|
40
|
+
[{
|
41
|
+
id : 'txtEmbed',
|
42
|
+
type : 'textarea',
|
43
|
+
label : editor.lang.youtube.txtEmbed,
|
44
|
+
onChange : function (api) {
|
45
|
+
handleEmbedChange(this, api);
|
46
|
+
},
|
47
|
+
onKeyUp : function (api) {
|
48
|
+
handleEmbedChange(this, api);
|
49
|
+
},
|
50
|
+
validate : function () {
|
51
|
+
if (this.isEnabled()) {
|
52
|
+
if (!this.getValue()) {
|
53
|
+
alert(editor.lang.youtube.noCode);
|
54
|
+
return false;
|
55
|
+
}
|
56
|
+
else
|
57
|
+
if (this.getValue().length === 0 || this.getValue().indexOf('//') === -1) {
|
58
|
+
alert(editor.lang.youtube.invalidEmbed);
|
59
|
+
return false;
|
60
|
+
}
|
61
|
+
}
|
62
|
+
}
|
63
|
+
},
|
64
|
+
{
|
65
|
+
type : 'html',
|
66
|
+
html : editor.lang.youtube.or + '<hr>'
|
67
|
+
},
|
68
|
+
{
|
69
|
+
type : 'hbox',
|
70
|
+
widths : [ '70%', '15%', '15%' ],
|
71
|
+
children :
|
72
|
+
[
|
73
|
+
{
|
74
|
+
id : 'txtUrl',
|
75
|
+
type : 'text',
|
76
|
+
label : editor.lang.youtube.txtUrl,
|
77
|
+
onChange : function (api) {
|
78
|
+
handleLinkChange(this, api);
|
79
|
+
},
|
80
|
+
onKeyUp : function (api) {
|
81
|
+
handleLinkChange(this, api);
|
82
|
+
},
|
83
|
+
validate : function () {
|
84
|
+
if (this.isEnabled()) {
|
85
|
+
if (!this.getValue()) {
|
86
|
+
alert(editor.lang.youtube.noCode);
|
87
|
+
return false;
|
88
|
+
}
|
89
|
+
else{
|
90
|
+
video = ytVidId(this.getValue());
|
91
|
+
|
92
|
+
if (this.getValue().length === 0 || video === false)
|
93
|
+
{
|
94
|
+
alert(editor.lang.youtube.invalidUrl);
|
95
|
+
return false;
|
96
|
+
}
|
97
|
+
}
|
98
|
+
}
|
99
|
+
}
|
100
|
+
},
|
101
|
+
{
|
102
|
+
type : 'text',
|
103
|
+
id : 'txtWidth',
|
104
|
+
width : '60px',
|
105
|
+
label : editor.lang.youtube.txtWidth,
|
106
|
+
'default' : editor.config.youtube_width != null ? editor.config.youtube_width : '640',
|
107
|
+
validate : function () {
|
108
|
+
if (this.getValue()) {
|
109
|
+
var width = parseInt (this.getValue()) || 0;
|
110
|
+
|
111
|
+
if (width === 0) {
|
112
|
+
alert(editor.lang.youtube.invalidWidth);
|
113
|
+
return false;
|
114
|
+
}
|
115
|
+
}
|
116
|
+
else {
|
117
|
+
alert(editor.lang.youtube.noWidth);
|
118
|
+
return false;
|
119
|
+
}
|
120
|
+
}
|
121
|
+
},
|
122
|
+
{
|
123
|
+
type : 'text',
|
124
|
+
id : 'txtHeight',
|
125
|
+
width : '60px',
|
126
|
+
label : editor.lang.youtube.txtHeight,
|
127
|
+
'default' : editor.config.youtube_height != null ? editor.config.youtube_height : '360',
|
128
|
+
validate : function () {
|
129
|
+
if (this.getValue()) {
|
130
|
+
var height = parseInt(this.getValue()) || 0;
|
131
|
+
|
132
|
+
if (height === 0) {
|
133
|
+
alert(editor.lang.youtube.invalidHeight);
|
134
|
+
return false;
|
135
|
+
}
|
136
|
+
}
|
137
|
+
else {
|
138
|
+
alert(editor.lang.youtube.noHeight);
|
139
|
+
return false;
|
140
|
+
}
|
141
|
+
}
|
142
|
+
}
|
143
|
+
]
|
144
|
+
},
|
145
|
+
{
|
146
|
+
type : 'hbox',
|
147
|
+
widths : [ '55%', '45%' ],
|
148
|
+
children :
|
149
|
+
[
|
150
|
+
{
|
151
|
+
id : 'chkResponsive',
|
152
|
+
type : 'checkbox',
|
153
|
+
label : editor.lang.youtube.txtResponsive,
|
154
|
+
'default' : editor.config.youtube_responsive != null ? editor.config.youtube_responsive : false
|
155
|
+
},
|
156
|
+
{
|
157
|
+
id : 'chkNoEmbed',
|
158
|
+
type : 'checkbox',
|
159
|
+
label : editor.lang.youtube.txtNoEmbed,
|
160
|
+
'default' : editor.config.youtube_noembed != null ? editor.config.youtube_noembed : false
|
161
|
+
}
|
162
|
+
]
|
163
|
+
},
|
164
|
+
{
|
165
|
+
type : 'hbox',
|
166
|
+
widths : [ '55%', '45%' ],
|
167
|
+
children :
|
168
|
+
[
|
169
|
+
{
|
170
|
+
id : 'chkRelated',
|
171
|
+
type : 'checkbox',
|
172
|
+
'default' : editor.config.youtube_related != null ? editor.config.youtube_related : true,
|
173
|
+
label : editor.lang.youtube.chkRelated
|
174
|
+
},
|
175
|
+
{
|
176
|
+
id : 'chkOlderCode',
|
177
|
+
type : 'checkbox',
|
178
|
+
'default' : editor.config.youtube_older != null ? editor.config.youtube_older : false,
|
179
|
+
label : editor.lang.youtube.chkOlderCode
|
180
|
+
}
|
181
|
+
]
|
182
|
+
},
|
183
|
+
{
|
184
|
+
type : 'hbox',
|
185
|
+
widths : [ '55%', '45%' ],
|
186
|
+
children :
|
187
|
+
[
|
188
|
+
{
|
189
|
+
id : 'chkPrivacy',
|
190
|
+
type : 'checkbox',
|
191
|
+
label : editor.lang.youtube.chkPrivacy,
|
192
|
+
'default' : editor.config.youtube_privacy != null ? editor.config.youtube_privacy : false
|
193
|
+
},
|
194
|
+
{
|
195
|
+
id : 'chkAutoplay',
|
196
|
+
type : 'checkbox',
|
197
|
+
'default' : editor.config.youtube_autoplay != null ? editor.config.youtube_autoplay : false,
|
198
|
+
label : editor.lang.youtube.chkAutoplay
|
199
|
+
}
|
200
|
+
]
|
201
|
+
},
|
202
|
+
{
|
203
|
+
type : 'hbox',
|
204
|
+
widths : [ '55%', '45%'],
|
205
|
+
children :
|
206
|
+
[
|
207
|
+
{
|
208
|
+
id : 'txtStartAt',
|
209
|
+
type : 'text',
|
210
|
+
label : editor.lang.youtube.txtStartAt,
|
211
|
+
validate : function () {
|
212
|
+
if (this.getValue()) {
|
213
|
+
var str = this.getValue();
|
214
|
+
|
215
|
+
if (!/^(?:(?:([01]?\d|2[0-3]):)?([0-5]?\d):)?([0-5]?\d)$/i.test(str)) {
|
216
|
+
alert(editor.lang.youtube.invalidTime);
|
217
|
+
return false;
|
218
|
+
}
|
219
|
+
}
|
220
|
+
}
|
221
|
+
},
|
222
|
+
{
|
223
|
+
id : 'chkControls',
|
224
|
+
type : 'checkbox',
|
225
|
+
'default' : editor.config.youtube_controls != null ? editor.config.youtube_controls : true,
|
226
|
+
label : editor.lang.youtube.chkControls
|
227
|
+
}
|
228
|
+
]
|
229
|
+
}
|
230
|
+
]
|
231
|
+
}
|
232
|
+
],
|
233
|
+
onOk: function()
|
234
|
+
{
|
235
|
+
var content = '';
|
236
|
+
var responsiveStyle = '';
|
237
|
+
|
238
|
+
if (this.getContentElement('youtubePlugin', 'txtEmbed').isEnabled()) {
|
239
|
+
content = this.getValueOf('youtubePlugin', 'txtEmbed');
|
240
|
+
}
|
241
|
+
else {
|
242
|
+
var url = 'https://', params = [], startSecs;
|
243
|
+
var width = this.getValueOf('youtubePlugin', 'txtWidth');
|
244
|
+
var height = this.getValueOf('youtubePlugin', 'txtHeight');
|
245
|
+
|
246
|
+
if (this.getContentElement('youtubePlugin', 'chkPrivacy').getValue() === true) {
|
247
|
+
url += 'www.youtube-nocookie.com/';
|
248
|
+
}
|
249
|
+
else {
|
250
|
+
url += 'www.youtube.com/';
|
251
|
+
}
|
252
|
+
|
253
|
+
url += 'embed/' + video;
|
254
|
+
|
255
|
+
if (this.getContentElement('youtubePlugin', 'chkRelated').getValue() === false) {
|
256
|
+
params.push('rel=0');
|
257
|
+
}
|
258
|
+
|
259
|
+
if (this.getContentElement('youtubePlugin', 'chkAutoplay').getValue() === true) {
|
260
|
+
params.push('autoplay=1');
|
261
|
+
}
|
262
|
+
|
263
|
+
if (this.getContentElement('youtubePlugin', 'chkControls').getValue() === false) {
|
264
|
+
params.push('controls=0');
|
265
|
+
}
|
266
|
+
|
267
|
+
startSecs = this.getValueOf('youtubePlugin', 'txtStartAt');
|
268
|
+
|
269
|
+
if (startSecs) {
|
270
|
+
var seconds = hmsToSeconds(startSecs);
|
271
|
+
|
272
|
+
params.push('start=' + seconds);
|
273
|
+
}
|
274
|
+
|
275
|
+
if (params.length > 0) {
|
276
|
+
url = url + '?' + params.join('&');
|
277
|
+
}
|
278
|
+
|
279
|
+
if (this.getContentElement('youtubePlugin', 'chkResponsive').getValue() === true) {
|
280
|
+
content += '<div class="youtube-embed-wrapper" style="position:relative;padding-bottom:56.25%;padding-top:30px;height:0;overflow:hidden">';
|
281
|
+
responsiveStyle = 'style="position:absolute;top:0;left:0;width:100%;height:100%"';
|
282
|
+
}
|
283
|
+
|
284
|
+
if (this.getContentElement('youtubePlugin', 'chkOlderCode').getValue() === true) {
|
285
|
+
url = url.replace('embed/', 'v/');
|
286
|
+
url = url.replace(/&/g, '&');
|
287
|
+
|
288
|
+
if (url.indexOf('?') === -1) {
|
289
|
+
url += '?';
|
290
|
+
}
|
291
|
+
else {
|
292
|
+
url += '&';
|
293
|
+
}
|
294
|
+
url += 'hl=' + (this.getParentEditor().config.language ? this.getParentEditor().config.language : 'en') + '&version=3';
|
295
|
+
|
296
|
+
content += '<object width="' + width + '" height="' + height + '" ' + responsiveStyle + '>';
|
297
|
+
content += '<param name="movie" value="' + url + '"></param>';
|
298
|
+
content += '<param name="allowFullScreen" value="true"></param>';
|
299
|
+
content += '<param name="allowscriptaccess" value="always"></param>';
|
300
|
+
content += '<embed src="' + url + '" type="application/x-shockwave-flash" ';
|
301
|
+
content += 'width="' + width + '" height="' + height + '" '+ responsiveStyle + ' allowscriptaccess="always" ';
|
302
|
+
content += 'allowfullscreen="true"></embed>';
|
303
|
+
content += '</object>';
|
304
|
+
}
|
305
|
+
else
|
306
|
+
if (this.getContentElement('youtubePlugin', 'chkNoEmbed').getValue() === true) {
|
307
|
+
var imgSrc = '//img.youtube.com/vi/' + video + '/sddefault.jpg';
|
308
|
+
content += '<a href="' + url + '" ><img width="' + width + '" height="' + height + '" src="' + imgSrc + '" ' + responsiveStyle + '/></a>';
|
309
|
+
}
|
310
|
+
else {
|
311
|
+
content += '<iframe width="' + width + '" height="' + height + '" src="' + url + '" ' + responsiveStyle;
|
312
|
+
content += 'frameborder="0" allowfullscreen></iframe>';
|
313
|
+
}
|
314
|
+
|
315
|
+
if (this.getContentElement('youtubePlugin', 'chkResponsive').getValue() === true) {
|
316
|
+
content += '</div>';
|
317
|
+
}
|
318
|
+
}
|
319
|
+
|
320
|
+
var element = CKEDITOR.dom.element.createFromHtml(content);
|
321
|
+
var instance = this.getParentEditor();
|
322
|
+
instance.insertElement(element);
|
323
|
+
}
|
324
|
+
};
|
325
|
+
});
|
326
|
+
}
|
327
|
+
});
|
328
|
+
})();
|
329
|
+
|
330
|
+
function handleLinkChange(el, api) {
|
331
|
+
var video = ytVidId(el.getValue());
|
332
|
+
var time = ytVidTime(el.getValue());
|
333
|
+
|
334
|
+
if (el.getValue().length > 0) {
|
335
|
+
el.getDialog().getContentElement('youtubePlugin', 'txtEmbed').disable();
|
336
|
+
}
|
337
|
+
else {
|
338
|
+
el.getDialog().getContentElement('youtubePlugin', 'txtEmbed').enable();
|
339
|
+
}
|
340
|
+
|
341
|
+
if (video && time) {
|
342
|
+
var seconds = timeParamToSeconds(time);
|
343
|
+
var hms = secondsToHms(seconds);
|
344
|
+
el.getDialog().getContentElement('youtubePlugin', 'txtStartAt').setValue(hms);
|
345
|
+
}
|
346
|
+
}
|
347
|
+
|
348
|
+
function handleEmbedChange(el, api) {
|
349
|
+
if (el.getValue().length > 0) {
|
350
|
+
el.getDialog().getContentElement('youtubePlugin', 'txtUrl').disable();
|
351
|
+
}
|
352
|
+
else {
|
353
|
+
el.getDialog().getContentElement('youtubePlugin', 'txtUrl').enable();
|
354
|
+
}
|
355
|
+
}
|
356
|
+
|
357
|
+
|
358
|
+
/**
|
359
|
+
* JavaScript function to match (and return) the video Id
|
360
|
+
* of any valid Youtube Url, given as input string.
|
361
|
+
* @author: Stephan Schmitz <eyecatchup@gmail.com>
|
362
|
+
* @url: http://stackoverflow.com/a/10315969/624466
|
363
|
+
*/
|
364
|
+
function ytVidId(url) {
|
365
|
+
var p = /^(?:https?:\/\/)?(?:www\.)?(?:youtu\.be\/|youtube\.com\/(?:embed\/|v\/|watch\?v=|watch\?.+&v=))((\w|-){11})(?:\S+)?$/;
|
366
|
+
return (url.match(p)) ? RegExp.$1 : false;
|
367
|
+
}
|
368
|
+
|
369
|
+
/**
|
370
|
+
* Matches and returns time param in YouTube Urls.
|
371
|
+
*/
|
372
|
+
function ytVidTime(url) {
|
373
|
+
var p = /t=([0-9hms]+)/;
|
374
|
+
return (url.match(p)) ? RegExp.$1 : false;
|
375
|
+
}
|
376
|
+
|
377
|
+
/**
|
378
|
+
* Converts time in hms format to seconds only
|
379
|
+
*/
|
380
|
+
function hmsToSeconds(time) {
|
381
|
+
var arr = time.split(':'), s = 0, m = 1;
|
382
|
+
|
383
|
+
while (arr.length > 0) {
|
384
|
+
s += m * parseInt(arr.pop(), 10);
|
385
|
+
m *= 60;
|
386
|
+
}
|
387
|
+
|
388
|
+
return s;
|
389
|
+
}
|
390
|
+
|
391
|
+
/**
|
392
|
+
* Converts seconds to hms format
|
393
|
+
*/
|
394
|
+
function secondsToHms(seconds) {
|
395
|
+
var h = Math.floor(seconds / 3600);
|
396
|
+
var m = Math.floor((seconds / 60) % 60);
|
397
|
+
var s = seconds % 60;
|
398
|
+
|
399
|
+
var pad = function (n) {
|
400
|
+
n = String(n);
|
401
|
+
return n.length >= 2 ? n : "0" + n;
|
402
|
+
};
|
403
|
+
|
404
|
+
if (h > 0) {
|
405
|
+
return pad(h) + ':' + pad(m) + ':' + pad(s);
|
406
|
+
}
|
407
|
+
else {
|
408
|
+
return pad(m) + ':' + pad(s);
|
409
|
+
}
|
410
|
+
}
|
411
|
+
|
412
|
+
/**
|
413
|
+
* Converts time in youtube t-param format to seconds
|
414
|
+
*/
|
415
|
+
function timeParamToSeconds(param) {
|
416
|
+
var componentValue = function (si) {
|
417
|
+
var regex = new RegExp('(\\d+)' + si);
|
418
|
+
return param.match(regex) ? parseInt(RegExp.$1, 10) : 0;
|
419
|
+
};
|
420
|
+
|
421
|
+
return componentValue('h') * 3600
|
422
|
+
+ componentValue('m') * 60
|
423
|
+
+ componentValue('s');
|
424
|
+
}
|
425
|
+
|
426
|
+
/**
|
427
|
+
* Converts seconds into youtube t-param value, e.g. 1h4m30s
|
428
|
+
*/
|
429
|
+
function secondsToTimeParam(seconds) {
|
430
|
+
var h = Math.floor(seconds / 3600);
|
431
|
+
var m = Math.floor((seconds / 60) % 60);
|
432
|
+
var s = seconds % 60;
|
433
|
+
var param = '';
|
434
|
+
|
435
|
+
if (h > 0) {
|
436
|
+
param += h + 'h';
|
437
|
+
}
|
438
|
+
|
439
|
+
if (m > 0) {
|
440
|
+
param += m + 'm';
|
441
|
+
}
|
442
|
+
|
443
|
+
if (s > 0) {
|
444
|
+
param += s + 's';
|
445
|
+
}
|
446
|
+
|
447
|
+
return param;
|
448
|
+
}
|