promethee 1.4.13 → 1.4.14
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +2 -0
- data/app/assets/javascripts/promethee.js +0 -1
- data/app/assets/stylesheets/promethee-edit.sass +0 -1
- data/app/views/promethee/components/aside/_show.html.erb +4 -1
- data/lib/promethee/rails/version.rb +1 -1
- metadata +16 -389
- data/node_modules/summernote/CODE_OF_CONDUCT.md +0 -46
- data/node_modules/summernote/CONTRIBUTING.md +0 -67
- data/node_modules/summernote/ISSUE_TEMPLATE.md +0 -14
- data/node_modules/summernote/LICENSE +0 -21
- data/node_modules/summernote/PULL_REQUEST_TEMPLATE.md +0 -28
- data/node_modules/summernote/README.md +0 -90
- data/node_modules/summernote/coverage/PhantomJS 2.1.1 (Mac OS X 0.0.0)/html/base.css +0 -213
- data/node_modules/summernote/coverage/PhantomJS 2.1.1 (Mac OS X 0.0.0)/html/index.html +0 -262
- data/node_modules/summernote/coverage/PhantomJS 2.1.1 (Mac OS X 0.0.0)/html/prettify.css +0 -1
- data/node_modules/summernote/coverage/PhantomJS 2.1.1 (Mac OS X 0.0.0)/html/prettify.js +0 -1
- data/node_modules/summernote/coverage/PhantomJS 2.1.1 (Mac OS X 0.0.0)/html/sort-arrow-sprite.png +0 -0
- data/node_modules/summernote/coverage/PhantomJS 2.1.1 (Mac OS X 0.0.0)/html/sorter.js +0 -158
- data/node_modules/summernote/coverage/PhantomJS 2.1.1 (Mac OS X 0.0.0)/html/src/js/base/Context.js.html +0 -758
- data/node_modules/summernote/coverage/PhantomJS 2.1.1 (Mac OS X 0.0.0)/html/src/js/base/core/async.js.html +0 -206
- data/node_modules/summernote/coverage/PhantomJS 2.1.1 (Mac OS X 0.0.0)/html/src/js/base/core/dom.js.html +0 -3329
- data/node_modules/summernote/coverage/PhantomJS 2.1.1 (Mac OS X 0.0.0)/html/src/js/base/core/env.js.html +0 -386
- data/node_modules/summernote/coverage/PhantomJS 2.1.1 (Mac OS X 0.0.0)/html/src/js/base/core/func.js.html +0 -551
- data/node_modules/summernote/coverage/PhantomJS 2.1.1 (Mac OS X 0.0.0)/html/src/js/base/core/index.html +0 -171
- data/node_modules/summernote/coverage/PhantomJS 2.1.1 (Mac OS X 0.0.0)/html/src/js/base/core/key.js.html +0 -341
- data/node_modules/summernote/coverage/PhantomJS 2.1.1 (Mac OS X 0.0.0)/html/src/js/base/core/lists.js.html +0 -695
- data/node_modules/summernote/coverage/PhantomJS 2.1.1 (Mac OS X 0.0.0)/html/src/js/base/core/range.js.html +0 -2441
- data/node_modules/summernote/coverage/PhantomJS 2.1.1 (Mac OS X 0.0.0)/html/src/js/base/editing/Bullet.js.html +0 -668
- data/node_modules/summernote/coverage/PhantomJS 2.1.1 (Mac OS X 0.0.0)/html/src/js/base/editing/History.js.html +0 -380
- data/node_modules/summernote/coverage/PhantomJS 2.1.1 (Mac OS X 0.0.0)/html/src/js/base/editing/Style.js.html +0 -539
- data/node_modules/summernote/coverage/PhantomJS 2.1.1 (Mac OS X 0.0.0)/html/src/js/base/editing/Table.js.html +0 -1787
- data/node_modules/summernote/coverage/PhantomJS 2.1.1 (Mac OS X 0.0.0)/html/src/js/base/editing/Typing.js.html +0 -335
- data/node_modules/summernote/coverage/PhantomJS 2.1.1 (Mac OS X 0.0.0)/html/src/js/base/editing/index.html +0 -145
- data/node_modules/summernote/coverage/PhantomJS 2.1.1 (Mac OS X 0.0.0)/html/src/js/base/index.html +0 -119
- data/node_modules/summernote/coverage/PhantomJS 2.1.1 (Mac OS X 0.0.0)/html/src/js/base/module/AirPopover.js.html +0 -284
- data/node_modules/summernote/coverage/PhantomJS 2.1.1 (Mac OS X 0.0.0)/html/src/js/base/module/AutoLink.js.html +0 -248
- data/node_modules/summernote/coverage/PhantomJS 2.1.1 (Mac OS X 0.0.0)/html/src/js/base/module/AutoSync.js.html +0 -122
- data/node_modules/summernote/coverage/PhantomJS 2.1.1 (Mac OS X 0.0.0)/html/src/js/base/module/Buttons.js.html +0 -2504
- data/node_modules/summernote/coverage/PhantomJS 2.1.1 (Mac OS X 0.0.0)/html/src/js/base/module/Clipboard.js.html +0 -149
- data/node_modules/summernote/coverage/PhantomJS 2.1.1 (Mac OS X 0.0.0)/html/src/js/base/module/Codeview.js.html +0 -434
- data/node_modules/summernote/coverage/PhantomJS 2.1.1 (Mac OS X 0.0.0)/html/src/js/base/module/Dropzone.js.html +0 -410
- data/node_modules/summernote/coverage/PhantomJS 2.1.1 (Mac OS X 0.0.0)/html/src/js/base/module/Editor.js.html +0 -2648
- data/node_modules/summernote/coverage/PhantomJS 2.1.1 (Mac OS X 0.0.0)/html/src/js/base/module/Fullscreen.js.html +0 -218
- data/node_modules/summernote/coverage/PhantomJS 2.1.1 (Mac OS X 0.0.0)/html/src/js/base/module/Handle.js.html +0 -494
- data/node_modules/summernote/coverage/PhantomJS 2.1.1 (Mac OS X 0.0.0)/html/src/js/base/module/HelpDialog.js.html +0 -302
- data/node_modules/summernote/coverage/PhantomJS 2.1.1 (Mac OS X 0.0.0)/html/src/js/base/module/HintPopover.js.html +0 -743
- data/node_modules/summernote/coverage/PhantomJS 2.1.1 (Mac OS X 0.0.0)/html/src/js/base/module/ImageDialog.js.html +0 -458
- data/node_modules/summernote/coverage/PhantomJS 2.1.1 (Mac OS X 0.0.0)/html/src/js/base/module/ImagePopover.js.html +0 -239
- data/node_modules/summernote/coverage/PhantomJS 2.1.1 (Mac OS X 0.0.0)/html/src/js/base/module/LinkDialog.js.html +0 -587
- data/node_modules/summernote/coverage/PhantomJS 2.1.1 (Mac OS X 0.0.0)/html/src/js/base/module/LinkPopover.js.html +0 -272
- data/node_modules/summernote/coverage/PhantomJS 2.1.1 (Mac OS X 0.0.0)/html/src/js/base/module/Placeholder.js.html +0 -182
- data/node_modules/summernote/coverage/PhantomJS 2.1.1 (Mac OS X 0.0.0)/html/src/js/base/module/Statusbar.js.html +0 -191
- data/node_modules/summernote/coverage/PhantomJS 2.1.1 (Mac OS X 0.0.0)/html/src/js/base/module/TablePopover.js.html +0 -278
- data/node_modules/summernote/coverage/PhantomJS 2.1.1 (Mac OS X 0.0.0)/html/src/js/base/module/Toolbar.js.html +0 -473
- data/node_modules/summernote/coverage/PhantomJS 2.1.1 (Mac OS X 0.0.0)/html/src/js/base/module/VideoDialog.js.html +0 -680
- data/node_modules/summernote/coverage/PhantomJS 2.1.1 (Mac OS X 0.0.0)/html/src/js/base/module/index.html +0 -353
- data/node_modules/summernote/coverage/PhantomJS 2.1.1 (Mac OS X 0.0.0)/html/src/js/base/renderer.js.html +0 -263
- data/node_modules/summernote/coverage/PhantomJS 2.1.1 (Mac OS X 0.0.0)/html/src/js/base/summernote-en-US.js.html +0 -542
- data/node_modules/summernote/coverage/PhantomJS 2.1.1 (Mac OS X 0.0.0)/html/src/js/bs3/index.html +0 -106
- data/node_modules/summernote/coverage/PhantomJS 2.1.1 (Mac OS X 0.0.0)/html/src/js/bs3/settings.js.html +0 -956
- data/node_modules/summernote/coverage/PhantomJS 2.1.1 (Mac OS X 0.0.0)/html/src/js/bs3/ui.js.html +0 -776
- data/node_modules/summernote/coverage/PhantomJS 2.1.1 (Mac OS X 0.0.0)/html/src/js/bs4/index.html +0 -106
- data/node_modules/summernote/coverage/PhantomJS 2.1.1 (Mac OS X 0.0.0)/html/src/js/bs4/settings.js.html +0 -968
- data/node_modules/summernote/coverage/PhantomJS 2.1.1 (Mac OS X 0.0.0)/html/src/js/bs4/ui.js.html +0 -791
- data/node_modules/summernote/coverage/PhantomJS 2.1.1 (Mac OS X 0.0.0)/html/src/js/index.html +0 -93
- data/node_modules/summernote/coverage/PhantomJS 2.1.1 (Mac OS X 0.0.0)/html/src/js/lite/index.html +0 -106
- data/node_modules/summernote/coverage/PhantomJS 2.1.1 (Mac OS X 0.0.0)/html/src/js/lite/settings.js.html +0 -953
- data/node_modules/summernote/coverage/PhantomJS 2.1.1 (Mac OS X 0.0.0)/html/src/js/lite/ui.js.html +0 -1919
- data/node_modules/summernote/coverage/PhantomJS 2.1.1 (Mac OS X 0.0.0)/html/src/js/lite/ui/DropdownUI.js.html +0 -260
- data/node_modules/summernote/coverage/PhantomJS 2.1.1 (Mac OS X 0.0.0)/html/src/js/lite/ui/ModalUI.js.html +0 -167
- data/node_modules/summernote/coverage/PhantomJS 2.1.1 (Mac OS X 0.0.0)/html/src/js/lite/ui/PopoverUI.js.html +0 -347
- data/node_modules/summernote/coverage/PhantomJS 2.1.1 (Mac OS X 0.0.0)/html/src/js/lite/ui/TooltipUI.js.html +0 -344
- data/node_modules/summernote/coverage/PhantomJS 2.1.1 (Mac OS X 0.0.0)/html/src/js/lite/ui/index.html +0 -132
- data/node_modules/summernote/coverage/PhantomJS 2.1.1 (Mac OS X 0.0.0)/html/src/js/summernote.js.html +0 -203
- data/node_modules/summernote/coverage/PhantomJS 2.1.1 (Mac OS X 0.0.0)/html/test/unit/base/Context.spec.js.html +0 -323
- data/node_modules/summernote/coverage/PhantomJS 2.1.1 (Mac OS X 0.0.0)/html/test/unit/base/core/dom.spec.js.html +0 -1046
- data/node_modules/summernote/coverage/PhantomJS 2.1.1 (Mac OS X 0.0.0)/html/test/unit/base/core/func.spec.js.html +0 -482
- data/node_modules/summernote/coverage/PhantomJS 2.1.1 (Mac OS X 0.0.0)/html/test/unit/base/core/index.html +0 -145
- data/node_modules/summernote/coverage/PhantomJS 2.1.1 (Mac OS X 0.0.0)/html/test/unit/base/core/key.spec.js.html +0 -140
- data/node_modules/summernote/coverage/PhantomJS 2.1.1 (Mac OS X 0.0.0)/html/test/unit/base/core/lists.spec.js.html +0 -419
- data/node_modules/summernote/coverage/PhantomJS 2.1.1 (Mac OS X 0.0.0)/html/test/unit/base/core/range.spec.js.html +0 -1286
- data/node_modules/summernote/coverage/PhantomJS 2.1.1 (Mac OS X 0.0.0)/html/test/unit/base/editing/Table.spec.js.html +0 -1724
- data/node_modules/summernote/coverage/PhantomJS 2.1.1 (Mac OS X 0.0.0)/html/test/unit/base/editing/index.html +0 -106
- data/node_modules/summernote/coverage/PhantomJS 2.1.1 (Mac OS X 0.0.0)/html/test/unit/base/editing/style.spec.js.html +0 -341
- data/node_modules/summernote/coverage/PhantomJS 2.1.1 (Mac OS X 0.0.0)/html/test/unit/base/index.html +0 -93
- data/node_modules/summernote/coverage/PhantomJS 2.1.1 (Mac OS X 0.0.0)/html/test/unit/base/module/Codeview.spec.js.html +0 -161
- data/node_modules/summernote/coverage/PhantomJS 2.1.1 (Mac OS X 0.0.0)/html/test/unit/base/module/Editor.spec.js.html +0 -1235
- data/node_modules/summernote/coverage/PhantomJS 2.1.1 (Mac OS X 0.0.0)/html/test/unit/base/module/Fullscreen.spec.js.html +0 -161
- data/node_modules/summernote/coverage/PhantomJS 2.1.1 (Mac OS X 0.0.0)/html/test/unit/base/module/index.html +0 -119
- data/node_modules/summernote/coverage/PhantomJS 2.1.1 (Mac OS X 0.0.0)/html/test/unit/bs/module/Buttons.spec.js.html +0 -770
- data/node_modules/summernote/coverage/PhantomJS 2.1.1 (Mac OS X 0.0.0)/html/test/unit/bs/module/VideoDialog.spec.js.html +0 -209
- data/node_modules/summernote/coverage/PhantomJS 2.1.1 (Mac OS X 0.0.0)/html/test/unit/bs/module/index.html +0 -106
- data/node_modules/summernote/dist/font/summernote.eot +0 -0
- data/node_modules/summernote/dist/font/summernote.ttf +0 -0
- data/node_modules/summernote/dist/font/summernote.woff +0 -0
- data/node_modules/summernote/dist/lang/summernote-ar-AR.js +0 -155
- data/node_modules/summernote/dist/lang/summernote-ar-AR.min.js +0 -3
- data/node_modules/summernote/dist/lang/summernote-bg-BG.js +0 -155
- data/node_modules/summernote/dist/lang/summernote-bg-BG.min.js +0 -3
- data/node_modules/summernote/dist/lang/summernote-ca-ES.js +0 -155
- data/node_modules/summernote/dist/lang/summernote-ca-ES.min.js +0 -3
- data/node_modules/summernote/dist/lang/summernote-cs-CZ.js +0 -149
- data/node_modules/summernote/dist/lang/summernote-cs-CZ.min.js +0 -3
- data/node_modules/summernote/dist/lang/summernote-da-DK.js +0 -155
- data/node_modules/summernote/dist/lang/summernote-da-DK.min.js +0 -3
- data/node_modules/summernote/dist/lang/summernote-de-DE.js +0 -154
- data/node_modules/summernote/dist/lang/summernote-de-DE.min.js +0 -3
- data/node_modules/summernote/dist/lang/summernote-el-GR.js +0 -155
- data/node_modules/summernote/dist/lang/summernote-el-GR.min.js +0 -3
- data/node_modules/summernote/dist/lang/summernote-es-ES.js +0 -155
- data/node_modules/summernote/dist/lang/summernote-es-ES.min.js +0 -3
- data/node_modules/summernote/dist/lang/summernote-es-EU.js +0 -154
- data/node_modules/summernote/dist/lang/summernote-es-EU.min.js +0 -3
- data/node_modules/summernote/dist/lang/summernote-fa-IR.js +0 -155
- data/node_modules/summernote/dist/lang/summernote-fa-IR.min.js +0 -3
- data/node_modules/summernote/dist/lang/summernote-fi-FI.js +0 -153
- data/node_modules/summernote/dist/lang/summernote-fi-FI.min.js +0 -3
- data/node_modules/summernote/dist/lang/summernote-fr-FR.js +0 -155
- data/node_modules/summernote/dist/lang/summernote-fr-FR.min.js +0 -3
- data/node_modules/summernote/dist/lang/summernote-gl-ES.js +0 -155
- data/node_modules/summernote/dist/lang/summernote-gl-ES.min.js +0 -3
- data/node_modules/summernote/dist/lang/summernote-he-IL.js +0 -155
- data/node_modules/summernote/dist/lang/summernote-he-IL.min.js +0 -3
- data/node_modules/summernote/dist/lang/summernote-hr-HR.js +0 -155
- data/node_modules/summernote/dist/lang/summernote-hr-HR.min.js +0 -3
- data/node_modules/summernote/dist/lang/summernote-hu-HU.js +0 -155
- data/node_modules/summernote/dist/lang/summernote-hu-HU.min.js +0 -3
- data/node_modules/summernote/dist/lang/summernote-id-ID.js +0 -155
- data/node_modules/summernote/dist/lang/summernote-id-ID.min.js +0 -3
- data/node_modules/summernote/dist/lang/summernote-it-IT.js +0 -155
- data/node_modules/summernote/dist/lang/summernote-it-IT.min.js +0 -3
- data/node_modules/summernote/dist/lang/summernote-ja-JP.js +0 -155
- data/node_modules/summernote/dist/lang/summernote-ja-JP.min.js +0 -3
- data/node_modules/summernote/dist/lang/summernote-ko-KR.js +0 -155
- data/node_modules/summernote/dist/lang/summernote-ko-KR.min.js +0 -3
- data/node_modules/summernote/dist/lang/summernote-lt-LT.js +0 -155
- data/node_modules/summernote/dist/lang/summernote-lt-LT.min.js +0 -3
- data/node_modules/summernote/dist/lang/summernote-lt-LV.js +0 -155
- data/node_modules/summernote/dist/lang/summernote-lt-LV.min.js +0 -3
- data/node_modules/summernote/dist/lang/summernote-mn-MN.js +0 -157
- data/node_modules/summernote/dist/lang/summernote-mn-MN.min.js +0 -3
- data/node_modules/summernote/dist/lang/summernote-nb-NO.js +0 -154
- data/node_modules/summernote/dist/lang/summernote-nb-NO.min.js +0 -3
- data/node_modules/summernote/dist/lang/summernote-nl-NL.js +0 -155
- data/node_modules/summernote/dist/lang/summernote-nl-NL.min.js +0 -3
- data/node_modules/summernote/dist/lang/summernote-pl-PL.js +0 -155
- data/node_modules/summernote/dist/lang/summernote-pl-PL.min.js +0 -3
- data/node_modules/summernote/dist/lang/summernote-pt-BR.js +0 -155
- data/node_modules/summernote/dist/lang/summernote-pt-BR.min.js +0 -3
- data/node_modules/summernote/dist/lang/summernote-pt-PT.js +0 -154
- data/node_modules/summernote/dist/lang/summernote-pt-PT.min.js +0 -3
- data/node_modules/summernote/dist/lang/summernote-ro-RO.js +0 -155
- data/node_modules/summernote/dist/lang/summernote-ro-RO.min.js +0 -3
- data/node_modules/summernote/dist/lang/summernote-ru-RU.js +0 -155
- data/node_modules/summernote/dist/lang/summernote-ru-RU.min.js +0 -3
- data/node_modules/summernote/dist/lang/summernote-sk-SK.js +0 -153
- data/node_modules/summernote/dist/lang/summernote-sk-SK.min.js +0 -3
- data/node_modules/summernote/dist/lang/summernote-sl-SI.js +0 -155
- data/node_modules/summernote/dist/lang/summernote-sl-SI.min.js +0 -3
- data/node_modules/summernote/dist/lang/summernote-sr-RS-Latin.js +0 -155
- data/node_modules/summernote/dist/lang/summernote-sr-RS-Latin.min.js +0 -3
- data/node_modules/summernote/dist/lang/summernote-sr-RS.js +0 -155
- data/node_modules/summernote/dist/lang/summernote-sr-RS.min.js +0 -3
- data/node_modules/summernote/dist/lang/summernote-sv-SE.js +0 -155
- data/node_modules/summernote/dist/lang/summernote-sv-SE.min.js +0 -3
- data/node_modules/summernote/dist/lang/summernote-ta-IN.js +0 -155
- data/node_modules/summernote/dist/lang/summernote-ta-IN.min.js +0 -3
- data/node_modules/summernote/dist/lang/summernote-th-TH.js +0 -155
- data/node_modules/summernote/dist/lang/summernote-th-TH.min.js +0 -3
- data/node_modules/summernote/dist/lang/summernote-tr-TR.js +0 -155
- data/node_modules/summernote/dist/lang/summernote-tr-TR.min.js +0 -3
- data/node_modules/summernote/dist/lang/summernote-uk-UA.js +0 -155
- data/node_modules/summernote/dist/lang/summernote-uk-UA.min.js +0 -3
- data/node_modules/summernote/dist/lang/summernote-uz-UZ.js +0 -112
- data/node_modules/summernote/dist/lang/summernote-uz-UZ.min.js +0 -3
- data/node_modules/summernote/dist/lang/summernote-vi-VN.js +0 -155
- data/node_modules/summernote/dist/lang/summernote-vi-VN.min.js +0 -3
- data/node_modules/summernote/dist/lang/summernote-zh-CN.js +0 -155
- data/node_modules/summernote/dist/lang/summernote-zh-CN.min.js +0 -3
- data/node_modules/summernote/dist/lang/summernote-zh-TW.js +0 -155
- data/node_modules/summernote/dist/lang/summernote-zh-TW.min.js +0 -3
- data/node_modules/summernote/dist/summernote-0.8.10-dist.zip +0 -0
- data/node_modules/summernote/dist/summernote-bs4.css +0 -1
- data/node_modules/summernote/dist/summernote-bs4.js +0 -7323
- data/node_modules/summernote/dist/summernote-bs4.js.map +0 -1
- data/node_modules/summernote/dist/summernote-bs4.min.js +0 -3
- data/node_modules/summernote/dist/summernote-lite.css +0 -1
- data/node_modules/summernote/dist/summernote-lite.js +0 -7837
- data/node_modules/summernote/dist/summernote-lite.js.map +0 -1
- data/node_modules/summernote/dist/summernote.css +0 -1
- data/node_modules/summernote/dist/summernote.js +0 -7315
- data/node_modules/summernote/dist/summernote.js.map +0 -1
- data/node_modules/summernote/dist/summernote.min.js +0 -3
- data/node_modules/summernote/examples/airmode.html +0 -35
- data/node_modules/summernote/examples/bs3.html +0 -60
- data/node_modules/summernote/examples/bs4.html +0 -57
- data/node_modules/summernote/examples/codemirror.html +0 -45
- data/node_modules/summernote/examples/external-api.html +0 -76
- data/node_modules/summernote/examples/hint-emoji.html +0 -61
- data/node_modules/summernote/examples/hint-symbols_mathematical-symbols_Greek-letters.html +0 -54
- data/node_modules/summernote/examples/hint-userdefine.html +0 -48
- data/node_modules/summernote/examples/ie8.html +0 -32
- data/node_modules/summernote/examples/jquery-custom-event.html +0 -119
- data/node_modules/summernote/examples/jquery19lt.html +0 -25
- data/node_modules/summernote/examples/lang.html +0 -33
- data/node_modules/summernote/examples/link-blank.html +0 -33
- data/node_modules/summernote/examples/lite.html +0 -24
- data/node_modules/summernote/examples/nativestyle.html +0 -32
- data/node_modules/summernote/examples/ondialog-multitab.html +0 -77
- data/node_modules/summernote/examples/ondialog.html +0 -58
- data/node_modules/summernote/examples/plugin-hello.html +0 -37
- data/node_modules/summernote/examples/rtl.html +0 -32
- data/node_modules/summernote/examples/symbols_mathematical-symbols_Greek-letters.json +0 -1118
- data/node_modules/summernote/examples/textarea.html +0 -46
- data/node_modules/summernote/examples/toolbar-container.html +0 -35
- data/node_modules/summernote/examples/with-google-font.html +0 -50
- data/node_modules/summernote/index.html +0 -33
- data/node_modules/summernote/karma.conf.js +0 -42
- data/node_modules/summernote/lang/summernote-ar-AR.js +0 -155
- data/node_modules/summernote/lang/summernote-bg-BG.js +0 -155
- data/node_modules/summernote/lang/summernote-ca-ES.js +0 -155
- data/node_modules/summernote/lang/summernote-cs-CZ.js +0 -149
- data/node_modules/summernote/lang/summernote-da-DK.js +0 -155
- data/node_modules/summernote/lang/summernote-de-DE.js +0 -154
- data/node_modules/summernote/lang/summernote-el-GR.js +0 -155
- data/node_modules/summernote/lang/summernote-es-ES.js +0 -155
- data/node_modules/summernote/lang/summernote-es-EU.js +0 -154
- data/node_modules/summernote/lang/summernote-fa-IR.js +0 -155
- data/node_modules/summernote/lang/summernote-fi-FI.js +0 -153
- data/node_modules/summernote/lang/summernote-fr-FR.js +0 -155
- data/node_modules/summernote/lang/summernote-gl-ES.js +0 -155
- data/node_modules/summernote/lang/summernote-he-IL.js +0 -155
- data/node_modules/summernote/lang/summernote-hr-HR.js +0 -155
- data/node_modules/summernote/lang/summernote-hu-HU.js +0 -155
- data/node_modules/summernote/lang/summernote-id-ID.js +0 -155
- data/node_modules/summernote/lang/summernote-it-IT.js +0 -155
- data/node_modules/summernote/lang/summernote-ja-JP.js +0 -155
- data/node_modules/summernote/lang/summernote-ko-KR.js +0 -155
- data/node_modules/summernote/lang/summernote-lt-LT.js +0 -155
- data/node_modules/summernote/lang/summernote-lt-LV.js +0 -155
- data/node_modules/summernote/lang/summernote-mn-MN.js +0 -157
- data/node_modules/summernote/lang/summernote-nb-NO.js +0 -154
- data/node_modules/summernote/lang/summernote-nl-NL.js +0 -155
- data/node_modules/summernote/lang/summernote-pl-PL.js +0 -155
- data/node_modules/summernote/lang/summernote-pt-BR.js +0 -155
- data/node_modules/summernote/lang/summernote-pt-PT.js +0 -154
- data/node_modules/summernote/lang/summernote-ro-RO.js +0 -155
- data/node_modules/summernote/lang/summernote-ru-RU.js +0 -155
- data/node_modules/summernote/lang/summernote-sk-SK.js +0 -153
- data/node_modules/summernote/lang/summernote-sl-SI.js +0 -155
- data/node_modules/summernote/lang/summernote-sr-RS-Latin.js +0 -155
- data/node_modules/summernote/lang/summernote-sr-RS.js +0 -155
- data/node_modules/summernote/lang/summernote-sv-SE.js +0 -155
- data/node_modules/summernote/lang/summernote-ta-IN.js +0 -155
- data/node_modules/summernote/lang/summernote-th-TH.js +0 -155
- data/node_modules/summernote/lang/summernote-tr-TR.js +0 -155
- data/node_modules/summernote/lang/summernote-uk-UA.js +0 -155
- data/node_modules/summernote/lang/summernote-uz-UZ.js +0 -112
- data/node_modules/summernote/lang/summernote-vi-VN.js +0 -155
- data/node_modules/summernote/lang/summernote-zh-CN.js +0 -155
- data/node_modules/summernote/lang/summernote-zh-TW.js +0 -155
- data/node_modules/summernote/package.json +0 -87
- data/node_modules/summernote/plugin/databasic/summernote-ext-databasic.css +0 -16
- data/node_modules/summernote/plugin/databasic/summernote-ext-databasic.js +0 -292
- data/node_modules/summernote/plugin/hello/summernote-ext-hello.js +0 -81
- data/node_modules/summernote/plugin/specialchars/summernote-ext-specialchars.js +0 -312
- data/node_modules/summernote/src/icons/align-center.svg +0 -11
- data/node_modules/summernote/src/icons/align-indent.svg +0 -11
- data/node_modules/summernote/src/icons/align-justify.svg +0 -11
- data/node_modules/summernote/src/icons/align-left.svg +0 -12
- data/node_modules/summernote/src/icons/align-outdent.svg +0 -11
- data/node_modules/summernote/src/icons/align-right.svg +0 -11
- data/node_modules/summernote/src/icons/align.svg +0 -8
- data/node_modules/summernote/src/icons/arrow-circle-down.svg +0 -1
- data/node_modules/summernote/src/icons/arrow-circle-left.svg +0 -1
- data/node_modules/summernote/src/icons/arrow-circle-right.svg +0 -1
- data/node_modules/summernote/src/icons/arrow-circle-up.svg +0 -1
- data/node_modules/summernote/src/icons/arrows-alt.svg +0 -11
- data/node_modules/summernote/src/icons/arrows-h.svg +0 -1
- data/node_modules/summernote/src/icons/arrows-v.svg +0 -1
- data/node_modules/summernote/src/icons/bold.svg +0 -11
- data/node_modules/summernote/src/icons/caret.svg +0 -9
- data/node_modules/summernote/src/icons/chain-broken.svg +0 -47
- data/node_modules/summernote/src/icons/circle.svg +0 -10
- data/node_modules/summernote/src/icons/close.svg +0 -16
- data/node_modules/summernote/src/icons/code.svg +0 -11
- data/node_modules/summernote/src/icons/col-after.svg +0 -96
- data/node_modules/summernote/src/icons/col-before.svg +0 -19
- data/node_modules/summernote/src/icons/col-remove.svg +0 -19
- data/node_modules/summernote/src/icons/dist/font/summernote.eot +0 -0
- data/node_modules/summernote/src/icons/dist/font/summernote.ttf +0 -0
- data/node_modules/summernote/src/icons/dist/font/summernote.woff +0 -0
- data/node_modules/summernote/src/icons/dist/summernote.html +0 -536
- data/node_modules/summernote/src/icons/dist/summernote.less +0 -511
- data/node_modules/summernote/src/icons/eraser.svg +0 -13
- data/node_modules/summernote/src/icons/font.svg +0 -11
- data/node_modules/summernote/src/icons/frame.svg +0 -10
- data/node_modules/summernote/src/icons/italic.svg +0 -11
- data/node_modules/summernote/src/icons/link.svg +0 -21
- data/node_modules/summernote/src/icons/magic.svg +0 -10
- data/node_modules/summernote/src/icons/menu-check.svg +0 -8
- data/node_modules/summernote/src/icons/minus.svg +0 -11
- data/node_modules/summernote/src/icons/orderedlist.svg +0 -12
- data/node_modules/summernote/src/icons/pencil.svg +0 -8
- data/node_modules/summernote/src/icons/picture.svg +0 -11
- data/node_modules/summernote/src/icons/question.svg +0 -10
- data/node_modules/summernote/src/icons/redo.svg +0 -10
- data/node_modules/summernote/src/icons/row-above.svg +0 -19
- data/node_modules/summernote/src/icons/row-below.svg +0 -19
- data/node_modules/summernote/src/icons/row-remove.svg +0 -19
- data/node_modules/summernote/src/icons/special-character.svg +0 -10
- data/node_modules/summernote/src/icons/square.svg +0 -10
- data/node_modules/summernote/src/icons/strikethrough.svg +0 -11
- data/node_modules/summernote/src/icons/subscript.svg +0 -11
- data/node_modules/summernote/src/icons/summernote.svg +0 -11
- data/node_modules/summernote/src/icons/superscript.svg +0 -11
- data/node_modules/summernote/src/icons/table.svg +0 -11
- data/node_modules/summernote/src/icons/templates/summernote.css +0 -110
- data/node_modules/summernote/src/icons/templates/summernote.json +0 -5
- data/node_modules/summernote/src/icons/text-height.svg +0 -11
- data/node_modules/summernote/src/icons/trash.svg +0 -17
- data/node_modules/summernote/src/icons/underline.svg +0 -11
- data/node_modules/summernote/src/icons/undo.svg +0 -10
- data/node_modules/summernote/src/icons/unorderedlist.svg +0 -9
- data/node_modules/summernote/src/icons/video.svg +0 -9
- data/node_modules/summernote/src/js/base/Context.js +0 -231
- data/node_modules/summernote/src/js/base/core/async.js +0 -47
- data/node_modules/summernote/src/js/base/core/dom.js +0 -1088
- data/node_modules/summernote/src/js/base/core/env.js +0 -107
- data/node_modules/summernote/src/js/base/core/func.js +0 -162
- data/node_modules/summernote/src/js/base/core/key.js +0 -92
- data/node_modules/summernote/src/js/base/core/lists.js +0 -210
- data/node_modules/summernote/src/js/base/core/range.js +0 -792
- data/node_modules/summernote/src/js/base/editing/Bullet.js +0 -201
- data/node_modules/summernote/src/js/base/editing/History.js +0 -105
- data/node_modules/summernote/src/js/base/editing/Style.js +0 -158
- data/node_modules/summernote/src/js/base/editing/Table.js +0 -574
- data/node_modules/summernote/src/js/base/editing/Typing.js +0 -90
- data/node_modules/summernote/src/js/base/module/AirPopover.js +0 -73
- data/node_modules/summernote/src/js/base/module/AutoLink.js +0 -61
- data/node_modules/summernote/src/js/base/module/AutoSync.js +0 -19
- data/node_modules/summernote/src/js/base/module/Buttons.js +0 -813
- data/node_modules/summernote/src/js/base/module/Clipboard.js +0 -28
- data/node_modules/summernote/src/js/base/module/Codeview.js +0 -123
- data/node_modules/summernote/src/js/base/module/Dropzone.js +0 -115
- data/node_modules/summernote/src/js/base/module/Editor.js +0 -861
- data/node_modules/summernote/src/js/base/module/Fullscreen.js +0 -51
- data/node_modules/summernote/src/js/base/module/Handle.js +0 -143
- data/node_modules/summernote/src/js/base/module/HelpDialog.js +0 -79
- data/node_modules/summernote/src/js/base/module/HintPopover.js +0 -226
- data/node_modules/summernote/src/js/base/module/ImageDialog.js +0 -131
- data/node_modules/summernote/src/js/base/module/ImagePopover.js +0 -58
- data/node_modules/summernote/src/js/base/module/LinkDialog.js +0 -174
- data/node_modules/summernote/src/js/base/module/LinkPopover.js +0 -69
- data/node_modules/summernote/src/js/base/module/Placeholder.js +0 -39
- data/node_modules/summernote/src/js/base/module/Statusbar.js +0 -42
- data/node_modules/summernote/src/js/base/module/TablePopover.js +0 -71
- data/node_modules/summernote/src/js/base/module/Toolbar.js +0 -136
- data/node_modules/summernote/src/js/base/module/VideoDialog.js +0 -205
- data/node_modules/summernote/src/js/base/renderer.js +0 -66
- data/node_modules/summernote/src/js/base/summernote-en-US.js +0 -159
- data/node_modules/summernote/src/js/bs3/settings.js +0 -297
- data/node_modules/summernote/src/js/bs3/ui.js +0 -237
- data/node_modules/summernote/src/js/bs4/settings.js +0 -301
- data/node_modules/summernote/src/js/bs4/ui.js +0 -242
- data/node_modules/summernote/src/js/lite/settings.js +0 -296
- data/node_modules/summernote/src/js/lite/ui.js +0 -618
- data/node_modules/summernote/src/js/lite/ui/DropdownUI.js +0 -65
- data/node_modules/summernote/src/js/lite/ui/ModalUI.js +0 -34
- data/node_modules/summernote/src/js/lite/ui/PopoverUI.js +0 -94
- data/node_modules/summernote/src/js/lite/ui/TooltipUI.js +0 -93
- data/node_modules/summernote/src/js/summernote.js +0 -46
- data/node_modules/summernote/src/less/elements.less +0 -149
- data/node_modules/summernote/src/less/elements.scss +0 -149
- data/node_modules/summernote/src/less/lite-ui/all.less +0 -15
- data/node_modules/summernote/src/less/lite-ui/btn-group.less +0 -51
- data/node_modules/summernote/src/less/lite-ui/buttons.less +0 -102
- data/node_modules/summernote/src/less/lite-ui/common.less +0 -20
- data/node_modules/summernote/src/less/lite-ui/dropdown.less +0 -39
- data/node_modules/summernote/src/less/lite-ui/form.less +0 -43
- data/node_modules/summernote/src/less/lite-ui/mixins.less +0 -1
- data/node_modules/summernote/src/less/lite-ui/mixins/buttons.less +0 -40
- data/node_modules/summernote/src/less/lite-ui/modal.less +0 -104
- data/node_modules/summernote/src/less/lite-ui/popover.less +0 -121
- data/node_modules/summernote/src/less/lite-ui/toolbar.less +0 -4
- data/node_modules/summernote/src/less/lite-ui/tooltip.less +0 -66
- data/node_modules/summernote/src/less/lite-ui/variables.less +0 -81
- data/node_modules/summernote/src/less/summernote-bs4.less +0 -577
- data/node_modules/summernote/src/less/summernote-bs4.scss +0 -560
- data/node_modules/summernote/src/less/summernote-lite.less +0 -601
- data/node_modules/summernote/src/less/summernote.less +0 -576
- data/node_modules/summernote/src/less/summernote.scss +0 -560
- data/node_modules/summernote/tsconfig.json +0 -12
@@ -1,792 +0,0 @@
|
|
1
|
-
import $ from 'jquery';
|
2
|
-
import env from './env';
|
3
|
-
import func from './func';
|
4
|
-
import lists from './lists';
|
5
|
-
import dom from './dom';
|
6
|
-
|
7
|
-
/**
|
8
|
-
* return boundaryPoint from TextRange, inspired by Andy Na's HuskyRange.js
|
9
|
-
*
|
10
|
-
* @param {TextRange} textRange
|
11
|
-
* @param {Boolean} isStart
|
12
|
-
* @return {BoundaryPoint}
|
13
|
-
*
|
14
|
-
* @see http://msdn.microsoft.com/en-us/library/ie/ms535872(v=vs.85).aspx
|
15
|
-
*/
|
16
|
-
function textRangeToPoint(textRange, isStart) {
|
17
|
-
let container = textRange.parentElement();
|
18
|
-
let offset;
|
19
|
-
|
20
|
-
const tester = document.body.createTextRange();
|
21
|
-
let prevContainer;
|
22
|
-
const childNodes = lists.from(container.childNodes);
|
23
|
-
for (offset = 0; offset < childNodes.length; offset++) {
|
24
|
-
if (dom.isText(childNodes[offset])) {
|
25
|
-
continue;
|
26
|
-
}
|
27
|
-
tester.moveToElementText(childNodes[offset]);
|
28
|
-
if (tester.compareEndPoints('StartToStart', textRange) >= 0) {
|
29
|
-
break;
|
30
|
-
}
|
31
|
-
prevContainer = childNodes[offset];
|
32
|
-
}
|
33
|
-
|
34
|
-
if (offset !== 0 && dom.isText(childNodes[offset - 1])) {
|
35
|
-
const textRangeStart = document.body.createTextRange();
|
36
|
-
let curTextNode = null;
|
37
|
-
textRangeStart.moveToElementText(prevContainer || container);
|
38
|
-
textRangeStart.collapse(!prevContainer);
|
39
|
-
curTextNode = prevContainer ? prevContainer.nextSibling : container.firstChild;
|
40
|
-
|
41
|
-
const pointTester = textRange.duplicate();
|
42
|
-
pointTester.setEndPoint('StartToStart', textRangeStart);
|
43
|
-
let textCount = pointTester.text.replace(/[\r\n]/g, '').length;
|
44
|
-
|
45
|
-
while (textCount > curTextNode.nodeValue.length && curTextNode.nextSibling) {
|
46
|
-
textCount -= curTextNode.nodeValue.length;
|
47
|
-
curTextNode = curTextNode.nextSibling;
|
48
|
-
}
|
49
|
-
|
50
|
-
// [workaround] enforce IE to re-reference curTextNode, hack
|
51
|
-
const dummy = curTextNode.nodeValue; // eslint-disable-line
|
52
|
-
|
53
|
-
if (isStart && curTextNode.nextSibling && dom.isText(curTextNode.nextSibling) &&
|
54
|
-
textCount === curTextNode.nodeValue.length) {
|
55
|
-
textCount -= curTextNode.nodeValue.length;
|
56
|
-
curTextNode = curTextNode.nextSibling;
|
57
|
-
}
|
58
|
-
|
59
|
-
container = curTextNode;
|
60
|
-
offset = textCount;
|
61
|
-
}
|
62
|
-
|
63
|
-
return {
|
64
|
-
cont: container,
|
65
|
-
offset: offset
|
66
|
-
};
|
67
|
-
}
|
68
|
-
|
69
|
-
/**
|
70
|
-
* return TextRange from boundary point (inspired by google closure-library)
|
71
|
-
* @param {BoundaryPoint} point
|
72
|
-
* @return {TextRange}
|
73
|
-
*/
|
74
|
-
function pointToTextRange(point) {
|
75
|
-
const textRangeInfo = function(container, offset) {
|
76
|
-
let node, isCollapseToStart;
|
77
|
-
|
78
|
-
if (dom.isText(container)) {
|
79
|
-
const prevTextNodes = dom.listPrev(container, func.not(dom.isText));
|
80
|
-
const prevContainer = lists.last(prevTextNodes).previousSibling;
|
81
|
-
node = prevContainer || container.parentNode;
|
82
|
-
offset += lists.sum(lists.tail(prevTextNodes), dom.nodeLength);
|
83
|
-
isCollapseToStart = !prevContainer;
|
84
|
-
} else {
|
85
|
-
node = container.childNodes[offset] || container;
|
86
|
-
if (dom.isText(node)) {
|
87
|
-
return textRangeInfo(node, 0);
|
88
|
-
}
|
89
|
-
|
90
|
-
offset = 0;
|
91
|
-
isCollapseToStart = false;
|
92
|
-
}
|
93
|
-
|
94
|
-
return {
|
95
|
-
node: node,
|
96
|
-
collapseToStart: isCollapseToStart,
|
97
|
-
offset: offset
|
98
|
-
};
|
99
|
-
};
|
100
|
-
|
101
|
-
const textRange = document.body.createTextRange();
|
102
|
-
const info = textRangeInfo(point.node, point.offset);
|
103
|
-
|
104
|
-
textRange.moveToElementText(info.node);
|
105
|
-
textRange.collapse(info.collapseToStart);
|
106
|
-
textRange.moveStart('character', info.offset);
|
107
|
-
return textRange;
|
108
|
-
}
|
109
|
-
|
110
|
-
/**
|
111
|
-
* Wrapped Range
|
112
|
-
*
|
113
|
-
* @constructor
|
114
|
-
* @param {Node} sc - start container
|
115
|
-
* @param {Number} so - start offset
|
116
|
-
* @param {Node} ec - end container
|
117
|
-
* @param {Number} eo - end offset
|
118
|
-
*/
|
119
|
-
class WrappedRange {
|
120
|
-
constructor(sc, so, ec, eo) {
|
121
|
-
this.sc = sc;
|
122
|
-
this.so = so;
|
123
|
-
this.ec = ec;
|
124
|
-
this.eo = eo;
|
125
|
-
|
126
|
-
// isOnEditable: judge whether range is on editable or not
|
127
|
-
this.isOnEditable = this.makeIsOn(dom.isEditable);
|
128
|
-
// isOnList: judge whether range is on list node or not
|
129
|
-
this.isOnList = this.makeIsOn(dom.isList);
|
130
|
-
// isOnAnchor: judge whether range is on anchor node or not
|
131
|
-
this.isOnAnchor = this.makeIsOn(dom.isAnchor);
|
132
|
-
// isOnCell: judge whether range is on cell node or not
|
133
|
-
this.isOnCell = this.makeIsOn(dom.isCell);
|
134
|
-
// isOnData: judge whether range is on data node or not
|
135
|
-
this.isOnData = this.makeIsOn(dom.isData);
|
136
|
-
}
|
137
|
-
|
138
|
-
// nativeRange: get nativeRange from sc, so, ec, eo
|
139
|
-
nativeRange() {
|
140
|
-
if (env.isW3CRangeSupport) {
|
141
|
-
const w3cRange = document.createRange();
|
142
|
-
w3cRange.setStart(this.sc, this.so);
|
143
|
-
w3cRange.setEnd(this.ec, this.eo);
|
144
|
-
|
145
|
-
return w3cRange;
|
146
|
-
} else {
|
147
|
-
const textRange = pointToTextRange({
|
148
|
-
node: this.sc,
|
149
|
-
offset: this.so
|
150
|
-
});
|
151
|
-
|
152
|
-
textRange.setEndPoint('EndToEnd', pointToTextRange({
|
153
|
-
node: this.ec,
|
154
|
-
offset: this.eo
|
155
|
-
}));
|
156
|
-
|
157
|
-
return textRange;
|
158
|
-
}
|
159
|
-
}
|
160
|
-
|
161
|
-
getPoints() {
|
162
|
-
return {
|
163
|
-
sc: this.sc,
|
164
|
-
so: this.so,
|
165
|
-
ec: this.ec,
|
166
|
-
eo: this.eo
|
167
|
-
};
|
168
|
-
}
|
169
|
-
|
170
|
-
getStartPoint() {
|
171
|
-
return {
|
172
|
-
node: this.sc,
|
173
|
-
offset: this.so
|
174
|
-
};
|
175
|
-
}
|
176
|
-
|
177
|
-
getEndPoint() {
|
178
|
-
return {
|
179
|
-
node: this.ec,
|
180
|
-
offset: this.eo
|
181
|
-
};
|
182
|
-
}
|
183
|
-
|
184
|
-
/**
|
185
|
-
* select update visible range
|
186
|
-
*/
|
187
|
-
select() {
|
188
|
-
const nativeRng = this.nativeRange();
|
189
|
-
if (env.isW3CRangeSupport) {
|
190
|
-
const selection = document.getSelection();
|
191
|
-
if (selection.rangeCount > 0) {
|
192
|
-
selection.removeAllRanges();
|
193
|
-
}
|
194
|
-
selection.addRange(nativeRng);
|
195
|
-
} else {
|
196
|
-
nativeRng.select();
|
197
|
-
}
|
198
|
-
|
199
|
-
return this;
|
200
|
-
}
|
201
|
-
|
202
|
-
/**
|
203
|
-
* Moves the scrollbar to start container(sc) of current range
|
204
|
-
*
|
205
|
-
* @return {WrappedRange}
|
206
|
-
*/
|
207
|
-
scrollIntoView(container) {
|
208
|
-
const height = $(container).height();
|
209
|
-
if (container.scrollTop + height < this.sc.offsetTop) {
|
210
|
-
container.scrollTop += Math.abs(container.scrollTop + height - this.sc.offsetTop);
|
211
|
-
}
|
212
|
-
|
213
|
-
return this;
|
214
|
-
}
|
215
|
-
|
216
|
-
/**
|
217
|
-
* @return {WrappedRange}
|
218
|
-
*/
|
219
|
-
normalize() {
|
220
|
-
/**
|
221
|
-
* @param {BoundaryPoint} point
|
222
|
-
* @param {Boolean} isLeftToRight
|
223
|
-
* @return {BoundaryPoint}
|
224
|
-
*/
|
225
|
-
const getVisiblePoint = function(point, isLeftToRight) {
|
226
|
-
if ((dom.isVisiblePoint(point) && !dom.isEdgePoint(point)) ||
|
227
|
-
(dom.isVisiblePoint(point) && dom.isRightEdgePoint(point) && !isLeftToRight) ||
|
228
|
-
(dom.isVisiblePoint(point) && dom.isLeftEdgePoint(point) && isLeftToRight) ||
|
229
|
-
(dom.isVisiblePoint(point) && dom.isBlock(point.node) && dom.isEmpty(point.node))) {
|
230
|
-
return point;
|
231
|
-
}
|
232
|
-
|
233
|
-
// point on block's edge
|
234
|
-
const block = dom.ancestor(point.node, dom.isBlock);
|
235
|
-
if (((dom.isLeftEdgePointOf(point, block) || dom.isVoid(dom.prevPoint(point).node)) && !isLeftToRight) ||
|
236
|
-
((dom.isRightEdgePointOf(point, block) || dom.isVoid(dom.nextPoint(point).node)) && isLeftToRight)) {
|
237
|
-
// returns point already on visible point
|
238
|
-
if (dom.isVisiblePoint(point)) {
|
239
|
-
return point;
|
240
|
-
}
|
241
|
-
// reverse direction
|
242
|
-
isLeftToRight = !isLeftToRight;
|
243
|
-
}
|
244
|
-
|
245
|
-
const nextPoint = isLeftToRight ? dom.nextPointUntil(dom.nextPoint(point), dom.isVisiblePoint)
|
246
|
-
: dom.prevPointUntil(dom.prevPoint(point), dom.isVisiblePoint);
|
247
|
-
return nextPoint || point;
|
248
|
-
};
|
249
|
-
|
250
|
-
const endPoint = getVisiblePoint(this.getEndPoint(), false);
|
251
|
-
const startPoint = this.isCollapsed() ? endPoint : getVisiblePoint(this.getStartPoint(), true);
|
252
|
-
|
253
|
-
return new WrappedRange(
|
254
|
-
startPoint.node,
|
255
|
-
startPoint.offset,
|
256
|
-
endPoint.node,
|
257
|
-
endPoint.offset
|
258
|
-
);
|
259
|
-
}
|
260
|
-
|
261
|
-
/**
|
262
|
-
* returns matched nodes on range
|
263
|
-
*
|
264
|
-
* @param {Function} [pred] - predicate function
|
265
|
-
* @param {Object} [options]
|
266
|
-
* @param {Boolean} [options.includeAncestor]
|
267
|
-
* @param {Boolean} [options.fullyContains]
|
268
|
-
* @return {Node[]}
|
269
|
-
*/
|
270
|
-
nodes(pred, options) {
|
271
|
-
pred = pred || func.ok;
|
272
|
-
|
273
|
-
const includeAncestor = options && options.includeAncestor;
|
274
|
-
const fullyContains = options && options.fullyContains;
|
275
|
-
|
276
|
-
// TODO compare points and sort
|
277
|
-
const startPoint = this.getStartPoint();
|
278
|
-
const endPoint = this.getEndPoint();
|
279
|
-
|
280
|
-
const nodes = [];
|
281
|
-
const leftEdgeNodes = [];
|
282
|
-
|
283
|
-
dom.walkPoint(startPoint, endPoint, function(point) {
|
284
|
-
if (dom.isEditable(point.node)) {
|
285
|
-
return;
|
286
|
-
}
|
287
|
-
|
288
|
-
let node;
|
289
|
-
if (fullyContains) {
|
290
|
-
if (dom.isLeftEdgePoint(point)) {
|
291
|
-
leftEdgeNodes.push(point.node);
|
292
|
-
}
|
293
|
-
if (dom.isRightEdgePoint(point) && lists.contains(leftEdgeNodes, point.node)) {
|
294
|
-
node = point.node;
|
295
|
-
}
|
296
|
-
} else if (includeAncestor) {
|
297
|
-
node = dom.ancestor(point.node, pred);
|
298
|
-
} else {
|
299
|
-
node = point.node;
|
300
|
-
}
|
301
|
-
|
302
|
-
if (node && pred(node)) {
|
303
|
-
nodes.push(node);
|
304
|
-
}
|
305
|
-
}, true);
|
306
|
-
|
307
|
-
return lists.unique(nodes);
|
308
|
-
}
|
309
|
-
|
310
|
-
/**
|
311
|
-
* returns commonAncestor of range
|
312
|
-
* @return {Element} - commonAncestor
|
313
|
-
*/
|
314
|
-
commonAncestor() {
|
315
|
-
return dom.commonAncestor(this.sc, this.ec);
|
316
|
-
}
|
317
|
-
|
318
|
-
/**
|
319
|
-
* returns expanded range by pred
|
320
|
-
*
|
321
|
-
* @param {Function} pred - predicate function
|
322
|
-
* @return {WrappedRange}
|
323
|
-
*/
|
324
|
-
expand(pred) {
|
325
|
-
const startAncestor = dom.ancestor(this.sc, pred);
|
326
|
-
const endAncestor = dom.ancestor(this.ec, pred);
|
327
|
-
|
328
|
-
if (!startAncestor && !endAncestor) {
|
329
|
-
return new WrappedRange(this.sc, this.so, this.ec, this.eo);
|
330
|
-
}
|
331
|
-
|
332
|
-
const boundaryPoints = this.getPoints();
|
333
|
-
|
334
|
-
if (startAncestor) {
|
335
|
-
boundaryPoints.sc = startAncestor;
|
336
|
-
boundaryPoints.so = 0;
|
337
|
-
}
|
338
|
-
|
339
|
-
if (endAncestor) {
|
340
|
-
boundaryPoints.ec = endAncestor;
|
341
|
-
boundaryPoints.eo = dom.nodeLength(endAncestor);
|
342
|
-
}
|
343
|
-
|
344
|
-
return new WrappedRange(
|
345
|
-
boundaryPoints.sc,
|
346
|
-
boundaryPoints.so,
|
347
|
-
boundaryPoints.ec,
|
348
|
-
boundaryPoints.eo
|
349
|
-
);
|
350
|
-
}
|
351
|
-
|
352
|
-
/**
|
353
|
-
* @param {Boolean} isCollapseToStart
|
354
|
-
* @return {WrappedRange}
|
355
|
-
*/
|
356
|
-
collapse(isCollapseToStart) {
|
357
|
-
if (isCollapseToStart) {
|
358
|
-
return new WrappedRange(this.sc, this.so, this.sc, this.so);
|
359
|
-
} else {
|
360
|
-
return new WrappedRange(this.ec, this.eo, this.ec, this.eo);
|
361
|
-
}
|
362
|
-
}
|
363
|
-
|
364
|
-
/**
|
365
|
-
* splitText on range
|
366
|
-
*/
|
367
|
-
splitText() {
|
368
|
-
const isSameContainer = this.sc === this.ec;
|
369
|
-
const boundaryPoints = this.getPoints();
|
370
|
-
|
371
|
-
if (dom.isText(this.ec) && !dom.isEdgePoint(this.getEndPoint())) {
|
372
|
-
this.ec.splitText(this.eo);
|
373
|
-
}
|
374
|
-
|
375
|
-
if (dom.isText(this.sc) && !dom.isEdgePoint(this.getStartPoint())) {
|
376
|
-
boundaryPoints.sc = this.sc.splitText(this.so);
|
377
|
-
boundaryPoints.so = 0;
|
378
|
-
|
379
|
-
if (isSameContainer) {
|
380
|
-
boundaryPoints.ec = boundaryPoints.sc;
|
381
|
-
boundaryPoints.eo = this.eo - this.so;
|
382
|
-
}
|
383
|
-
}
|
384
|
-
|
385
|
-
return new WrappedRange(
|
386
|
-
boundaryPoints.sc,
|
387
|
-
boundaryPoints.so,
|
388
|
-
boundaryPoints.ec,
|
389
|
-
boundaryPoints.eo
|
390
|
-
);
|
391
|
-
}
|
392
|
-
|
393
|
-
/**
|
394
|
-
* delete contents on range
|
395
|
-
* @return {WrappedRange}
|
396
|
-
*/
|
397
|
-
deleteContents() {
|
398
|
-
if (this.isCollapsed()) {
|
399
|
-
return this;
|
400
|
-
}
|
401
|
-
|
402
|
-
const rng = this.splitText();
|
403
|
-
const nodes = rng.nodes(null, {
|
404
|
-
fullyContains: true
|
405
|
-
});
|
406
|
-
|
407
|
-
// find new cursor point
|
408
|
-
const point = dom.prevPointUntil(rng.getStartPoint(), function(point) {
|
409
|
-
return !lists.contains(nodes, point.node);
|
410
|
-
});
|
411
|
-
|
412
|
-
const emptyParents = [];
|
413
|
-
$.each(nodes, function(idx, node) {
|
414
|
-
// find empty parents
|
415
|
-
const parent = node.parentNode;
|
416
|
-
if (point.node !== parent && dom.nodeLength(parent) === 1) {
|
417
|
-
emptyParents.push(parent);
|
418
|
-
}
|
419
|
-
dom.remove(node, false);
|
420
|
-
});
|
421
|
-
|
422
|
-
// remove empty parents
|
423
|
-
$.each(emptyParents, function(idx, node) {
|
424
|
-
dom.remove(node, false);
|
425
|
-
});
|
426
|
-
|
427
|
-
return new WrappedRange(
|
428
|
-
point.node,
|
429
|
-
point.offset,
|
430
|
-
point.node,
|
431
|
-
point.offset
|
432
|
-
).normalize();
|
433
|
-
}
|
434
|
-
|
435
|
-
/**
|
436
|
-
* makeIsOn: return isOn(pred) function
|
437
|
-
*/
|
438
|
-
makeIsOn(pred) {
|
439
|
-
return function() {
|
440
|
-
const ancestor = dom.ancestor(this.sc, pred);
|
441
|
-
return !!ancestor && (ancestor === dom.ancestor(this.ec, pred));
|
442
|
-
};
|
443
|
-
}
|
444
|
-
|
445
|
-
/**
|
446
|
-
* @param {Function} pred
|
447
|
-
* @return {Boolean}
|
448
|
-
*/
|
449
|
-
isLeftEdgeOf(pred) {
|
450
|
-
if (!dom.isLeftEdgePoint(this.getStartPoint())) {
|
451
|
-
return false;
|
452
|
-
}
|
453
|
-
|
454
|
-
const node = dom.ancestor(this.sc, pred);
|
455
|
-
return node && dom.isLeftEdgeOf(this.sc, node);
|
456
|
-
}
|
457
|
-
|
458
|
-
/**
|
459
|
-
* returns whether range was collapsed or not
|
460
|
-
*/
|
461
|
-
isCollapsed() {
|
462
|
-
return this.sc === this.ec && this.so === this.eo;
|
463
|
-
}
|
464
|
-
|
465
|
-
/**
|
466
|
-
* wrap inline nodes which children of body with paragraph
|
467
|
-
*
|
468
|
-
* @return {WrappedRange}
|
469
|
-
*/
|
470
|
-
wrapBodyInlineWithPara() {
|
471
|
-
if (dom.isBodyContainer(this.sc) && dom.isEmpty(this.sc)) {
|
472
|
-
this.sc.innerHTML = dom.emptyPara;
|
473
|
-
return new WrappedRange(this.sc.firstChild, 0, this.sc.firstChild, 0);
|
474
|
-
}
|
475
|
-
|
476
|
-
/**
|
477
|
-
* [workaround] firefox often create range on not visible point. so normalize here.
|
478
|
-
* - firefox: |<p>text</p>|
|
479
|
-
* - chrome: <p>|text|</p>
|
480
|
-
*/
|
481
|
-
const rng = this.normalize();
|
482
|
-
if (dom.isParaInline(this.sc) || dom.isPara(this.sc)) {
|
483
|
-
return rng;
|
484
|
-
}
|
485
|
-
|
486
|
-
// find inline top ancestor
|
487
|
-
let topAncestor;
|
488
|
-
if (dom.isInline(rng.sc)) {
|
489
|
-
const ancestors = dom.listAncestor(rng.sc, func.not(dom.isInline));
|
490
|
-
topAncestor = lists.last(ancestors);
|
491
|
-
if (!dom.isInline(topAncestor)) {
|
492
|
-
topAncestor = ancestors[ancestors.length - 2] || rng.sc.childNodes[rng.so];
|
493
|
-
}
|
494
|
-
} else {
|
495
|
-
topAncestor = rng.sc.childNodes[rng.so > 0 ? rng.so - 1 : 0];
|
496
|
-
}
|
497
|
-
|
498
|
-
// siblings not in paragraph
|
499
|
-
let inlineSiblings = dom.listPrev(topAncestor, dom.isParaInline).reverse();
|
500
|
-
inlineSiblings = inlineSiblings.concat(dom.listNext(topAncestor.nextSibling, dom.isParaInline));
|
501
|
-
|
502
|
-
// wrap with paragraph
|
503
|
-
if (inlineSiblings.length) {
|
504
|
-
const para = dom.wrap(lists.head(inlineSiblings), 'p');
|
505
|
-
dom.appendChildNodes(para, lists.tail(inlineSiblings));
|
506
|
-
}
|
507
|
-
|
508
|
-
return this.normalize();
|
509
|
-
}
|
510
|
-
|
511
|
-
/**
|
512
|
-
* insert node at current cursor
|
513
|
-
*
|
514
|
-
* @param {Node} node
|
515
|
-
* @return {Node}
|
516
|
-
*/
|
517
|
-
insertNode(node) {
|
518
|
-
const rng = this.wrapBodyInlineWithPara().deleteContents();
|
519
|
-
const info = dom.splitPoint(rng.getStartPoint(), dom.isInline(node));
|
520
|
-
|
521
|
-
if (info.rightNode) {
|
522
|
-
info.rightNode.parentNode.insertBefore(node, info.rightNode);
|
523
|
-
} else {
|
524
|
-
info.container.appendChild(node);
|
525
|
-
}
|
526
|
-
|
527
|
-
return node;
|
528
|
-
}
|
529
|
-
|
530
|
-
/**
|
531
|
-
* insert html at current cursor
|
532
|
-
*/
|
533
|
-
pasteHTML(markup) {
|
534
|
-
const contentsContainer = $('<div></div>').html(markup)[0];
|
535
|
-
const childNodes = lists.from(contentsContainer.childNodes);
|
536
|
-
|
537
|
-
const rng = this.wrapBodyInlineWithPara().deleteContents();
|
538
|
-
|
539
|
-
return childNodes.reverse().map(function(childNode) {
|
540
|
-
return rng.insertNode(childNode);
|
541
|
-
}).reverse();
|
542
|
-
}
|
543
|
-
|
544
|
-
/**
|
545
|
-
* returns text in range
|
546
|
-
*
|
547
|
-
* @return {String}
|
548
|
-
*/
|
549
|
-
toString() {
|
550
|
-
const nativeRng = this.nativeRange();
|
551
|
-
return env.isW3CRangeSupport ? nativeRng.toString() : nativeRng.text;
|
552
|
-
}
|
553
|
-
|
554
|
-
/**
|
555
|
-
* returns range for word before cursor
|
556
|
-
*
|
557
|
-
* @param {Boolean} [findAfter] - find after cursor, default: false
|
558
|
-
* @return {WrappedRange}
|
559
|
-
*/
|
560
|
-
getWordRange(findAfter) {
|
561
|
-
let endPoint = this.getEndPoint();
|
562
|
-
|
563
|
-
if (!dom.isCharPoint(endPoint)) {
|
564
|
-
return this;
|
565
|
-
}
|
566
|
-
|
567
|
-
const startPoint = dom.prevPointUntil(endPoint, function(point) {
|
568
|
-
return !dom.isCharPoint(point);
|
569
|
-
});
|
570
|
-
|
571
|
-
if (findAfter) {
|
572
|
-
endPoint = dom.nextPointUntil(endPoint, function(point) {
|
573
|
-
return !dom.isCharPoint(point);
|
574
|
-
});
|
575
|
-
}
|
576
|
-
|
577
|
-
return new WrappedRange(
|
578
|
-
startPoint.node,
|
579
|
-
startPoint.offset,
|
580
|
-
endPoint.node,
|
581
|
-
endPoint.offset
|
582
|
-
);
|
583
|
-
}
|
584
|
-
|
585
|
-
/**
|
586
|
-
* create offsetPath bookmark
|
587
|
-
*
|
588
|
-
* @param {Node} editable
|
589
|
-
*/
|
590
|
-
bookmark(editable) {
|
591
|
-
return {
|
592
|
-
s: {
|
593
|
-
path: dom.makeOffsetPath(editable, this.sc),
|
594
|
-
offset: this.so
|
595
|
-
},
|
596
|
-
e: {
|
597
|
-
path: dom.makeOffsetPath(editable, this.ec),
|
598
|
-
offset: this.eo
|
599
|
-
}
|
600
|
-
};
|
601
|
-
}
|
602
|
-
|
603
|
-
/**
|
604
|
-
* create offsetPath bookmark base on paragraph
|
605
|
-
*
|
606
|
-
* @param {Node[]} paras
|
607
|
-
*/
|
608
|
-
paraBookmark(paras) {
|
609
|
-
return {
|
610
|
-
s: {
|
611
|
-
path: lists.tail(dom.makeOffsetPath(lists.head(paras), this.sc)),
|
612
|
-
offset: this.so
|
613
|
-
},
|
614
|
-
e: {
|
615
|
-
path: lists.tail(dom.makeOffsetPath(lists.last(paras), this.ec)),
|
616
|
-
offset: this.eo
|
617
|
-
}
|
618
|
-
};
|
619
|
-
}
|
620
|
-
|
621
|
-
/**
|
622
|
-
* getClientRects
|
623
|
-
* @return {Rect[]}
|
624
|
-
*/
|
625
|
-
getClientRects() {
|
626
|
-
const nativeRng = this.nativeRange();
|
627
|
-
return nativeRng.getClientRects();
|
628
|
-
}
|
629
|
-
}
|
630
|
-
|
631
|
-
/**
|
632
|
-
* Data structure
|
633
|
-
* * BoundaryPoint: a point of dom tree
|
634
|
-
* * BoundaryPoints: two boundaryPoints corresponding to the start and the end of the Range
|
635
|
-
*
|
636
|
-
* See to http://www.w3.org/TR/DOM-Level-2-Traversal-Range/ranges.html#Level-2-Range-Position
|
637
|
-
*/
|
638
|
-
export default {
|
639
|
-
/**
|
640
|
-
* create Range Object From arguments or Browser Selection
|
641
|
-
*
|
642
|
-
* @param {Node} sc - start container
|
643
|
-
* @param {Number} so - start offset
|
644
|
-
* @param {Node} ec - end container
|
645
|
-
* @param {Number} eo - end offset
|
646
|
-
* @return {WrappedRange}
|
647
|
-
*/
|
648
|
-
create: function(sc, so, ec, eo) {
|
649
|
-
if (arguments.length === 4) {
|
650
|
-
return new WrappedRange(sc, so, ec, eo);
|
651
|
-
} else if (arguments.length === 2) { // collapsed
|
652
|
-
ec = sc;
|
653
|
-
eo = so;
|
654
|
-
return new WrappedRange(sc, so, ec, eo);
|
655
|
-
} else {
|
656
|
-
let wrappedRange = this.createFromSelection();
|
657
|
-
if (!wrappedRange && arguments.length === 1) {
|
658
|
-
wrappedRange = this.createFromNode(arguments[0]);
|
659
|
-
return wrappedRange.collapse(dom.emptyPara === arguments[0].innerHTML);
|
660
|
-
}
|
661
|
-
return wrappedRange;
|
662
|
-
}
|
663
|
-
},
|
664
|
-
|
665
|
-
createFromSelection: function() {
|
666
|
-
let sc, so, ec, eo;
|
667
|
-
if (env.isW3CRangeSupport) {
|
668
|
-
const selection = document.getSelection();
|
669
|
-
if (!selection || selection.rangeCount === 0) {
|
670
|
-
return null;
|
671
|
-
} else if (dom.isBody(selection.anchorNode)) {
|
672
|
-
// Firefox: returns entire body as range on initialization.
|
673
|
-
// We won't never need it.
|
674
|
-
return null;
|
675
|
-
}
|
676
|
-
|
677
|
-
const nativeRng = selection.getRangeAt(0);
|
678
|
-
sc = nativeRng.startContainer;
|
679
|
-
so = nativeRng.startOffset;
|
680
|
-
ec = nativeRng.endContainer;
|
681
|
-
eo = nativeRng.endOffset;
|
682
|
-
} else { // IE8: TextRange
|
683
|
-
const textRange = document.selection.createRange();
|
684
|
-
const textRangeEnd = textRange.duplicate();
|
685
|
-
textRangeEnd.collapse(false);
|
686
|
-
const textRangeStart = textRange;
|
687
|
-
textRangeStart.collapse(true);
|
688
|
-
|
689
|
-
let startPoint = textRangeToPoint(textRangeStart, true);
|
690
|
-
let endPoint = textRangeToPoint(textRangeEnd, false);
|
691
|
-
|
692
|
-
// same visible point case: range was collapsed.
|
693
|
-
if (dom.isText(startPoint.node) && dom.isLeftEdgePoint(startPoint) &&
|
694
|
-
dom.isTextNode(endPoint.node) && dom.isRightEdgePoint(endPoint) &&
|
695
|
-
endPoint.node.nextSibling === startPoint.node) {
|
696
|
-
startPoint = endPoint;
|
697
|
-
}
|
698
|
-
|
699
|
-
sc = startPoint.cont;
|
700
|
-
so = startPoint.offset;
|
701
|
-
ec = endPoint.cont;
|
702
|
-
eo = endPoint.offset;
|
703
|
-
}
|
704
|
-
|
705
|
-
return new WrappedRange(sc, so, ec, eo);
|
706
|
-
},
|
707
|
-
|
708
|
-
/**
|
709
|
-
* @method
|
710
|
-
*
|
711
|
-
* create WrappedRange from node
|
712
|
-
*
|
713
|
-
* @param {Node} node
|
714
|
-
* @return {WrappedRange}
|
715
|
-
*/
|
716
|
-
createFromNode: function(node) {
|
717
|
-
let sc = node;
|
718
|
-
let so = 0;
|
719
|
-
let ec = node;
|
720
|
-
let eo = dom.nodeLength(ec);
|
721
|
-
|
722
|
-
// browsers can't target a picture or void node
|
723
|
-
if (dom.isVoid(sc)) {
|
724
|
-
so = dom.listPrev(sc).length - 1;
|
725
|
-
sc = sc.parentNode;
|
726
|
-
}
|
727
|
-
if (dom.isBR(ec)) {
|
728
|
-
eo = dom.listPrev(ec).length - 1;
|
729
|
-
ec = ec.parentNode;
|
730
|
-
} else if (dom.isVoid(ec)) {
|
731
|
-
eo = dom.listPrev(ec).length;
|
732
|
-
ec = ec.parentNode;
|
733
|
-
}
|
734
|
-
|
735
|
-
return this.create(sc, so, ec, eo);
|
736
|
-
},
|
737
|
-
|
738
|
-
/**
|
739
|
-
* create WrappedRange from node after position
|
740
|
-
*
|
741
|
-
* @param {Node} node
|
742
|
-
* @return {WrappedRange}
|
743
|
-
*/
|
744
|
-
createFromNodeBefore: function(node) {
|
745
|
-
return this.createFromNode(node).collapse(true);
|
746
|
-
},
|
747
|
-
|
748
|
-
/**
|
749
|
-
* create WrappedRange from node after position
|
750
|
-
*
|
751
|
-
* @param {Node} node
|
752
|
-
* @return {WrappedRange}
|
753
|
-
*/
|
754
|
-
createFromNodeAfter: function(node) {
|
755
|
-
return this.createFromNode(node).collapse();
|
756
|
-
},
|
757
|
-
|
758
|
-
/**
|
759
|
-
* @method
|
760
|
-
*
|
761
|
-
* create WrappedRange from bookmark
|
762
|
-
*
|
763
|
-
* @param {Node} editable
|
764
|
-
* @param {Object} bookmark
|
765
|
-
* @return {WrappedRange}
|
766
|
-
*/
|
767
|
-
createFromBookmark: function(editable, bookmark) {
|
768
|
-
const sc = dom.fromOffsetPath(editable, bookmark.s.path);
|
769
|
-
const so = bookmark.s.offset;
|
770
|
-
const ec = dom.fromOffsetPath(editable, bookmark.e.path);
|
771
|
-
const eo = bookmark.e.offset;
|
772
|
-
return new WrappedRange(sc, so, ec, eo);
|
773
|
-
},
|
774
|
-
|
775
|
-
/**
|
776
|
-
* @method
|
777
|
-
*
|
778
|
-
* create WrappedRange from paraBookmark
|
779
|
-
*
|
780
|
-
* @param {Object} bookmark
|
781
|
-
* @param {Node[]} paras
|
782
|
-
* @return {WrappedRange}
|
783
|
-
*/
|
784
|
-
createFromParaBookmark: function(bookmark, paras) {
|
785
|
-
const so = bookmark.s.offset;
|
786
|
-
const eo = bookmark.e.offset;
|
787
|
-
const sc = dom.fromOffsetPath(lists.head(paras), bookmark.s.path);
|
788
|
-
const ec = dom.fromOffsetPath(lists.last(paras), bookmark.e.path);
|
789
|
-
|
790
|
-
return new WrappedRange(sc, so, ec, eo);
|
791
|
-
}
|
792
|
-
};
|