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,51 +0,0 @@
|
|
1
|
-
import $ from 'jquery';
|
2
|
-
|
3
|
-
export default class Fullscreen {
|
4
|
-
constructor(context) {
|
5
|
-
this.context = context;
|
6
|
-
|
7
|
-
this.$editor = context.layoutInfo.editor;
|
8
|
-
this.$toolbar = context.layoutInfo.toolbar;
|
9
|
-
this.$editable = context.layoutInfo.editable;
|
10
|
-
this.$codable = context.layoutInfo.codable;
|
11
|
-
|
12
|
-
this.$window = $(window);
|
13
|
-
this.$scrollbar = $('html, body');
|
14
|
-
|
15
|
-
this.onResize = () => {
|
16
|
-
this.resizeTo({
|
17
|
-
h: this.$window.height() - this.$toolbar.outerHeight()
|
18
|
-
});
|
19
|
-
};
|
20
|
-
}
|
21
|
-
|
22
|
-
resizeTo(size) {
|
23
|
-
this.$editable.css('height', size.h);
|
24
|
-
this.$codable.css('height', size.h);
|
25
|
-
if (this.$codable.data('cmeditor')) {
|
26
|
-
this.$codable.data('cmeditor').setsize(null, size.h);
|
27
|
-
}
|
28
|
-
}
|
29
|
-
|
30
|
-
/**
|
31
|
-
* toggle fullscreen
|
32
|
-
*/
|
33
|
-
toggle() {
|
34
|
-
this.$editor.toggleClass('fullscreen');
|
35
|
-
if (this.isFullscreen()) {
|
36
|
-
this.$editable.data('orgHeight', this.$editable.css('height'));
|
37
|
-
this.$window.on('resize', this.onResize).trigger('resize');
|
38
|
-
this.$scrollbar.css('overflow', 'hidden');
|
39
|
-
} else {
|
40
|
-
this.$window.off('resize', this.onResize);
|
41
|
-
this.resizeTo({ h: this.$editable.data('orgHeight') });
|
42
|
-
this.$scrollbar.css('overflow', 'visible');
|
43
|
-
}
|
44
|
-
|
45
|
-
this.context.invoke('toolbar.updateFullscreen', this.isFullscreen());
|
46
|
-
}
|
47
|
-
|
48
|
-
isFullscreen() {
|
49
|
-
return this.$editor.hasClass('fullscreen');
|
50
|
-
}
|
51
|
-
}
|
@@ -1,143 +0,0 @@
|
|
1
|
-
import $ from 'jquery';
|
2
|
-
import dom from '../core/dom';
|
3
|
-
|
4
|
-
export default class Handle {
|
5
|
-
constructor(context) {
|
6
|
-
this.context = context;
|
7
|
-
this.$document = $(document);
|
8
|
-
this.$editingArea = context.layoutInfo.editingArea;
|
9
|
-
this.options = context.options;
|
10
|
-
this.lang = this.options.langInfo;
|
11
|
-
|
12
|
-
this.events = {
|
13
|
-
'summernote.mousedown': (we, e) => {
|
14
|
-
if (this.update(e.target)) {
|
15
|
-
e.preventDefault();
|
16
|
-
}
|
17
|
-
},
|
18
|
-
'summernote.keyup summernote.scroll summernote.change summernote.dialog.shown': () => {
|
19
|
-
this.update();
|
20
|
-
},
|
21
|
-
'summernote.disable': () => {
|
22
|
-
this.hide();
|
23
|
-
},
|
24
|
-
'summernote.codeview.toggled': () => {
|
25
|
-
this.update();
|
26
|
-
}
|
27
|
-
};
|
28
|
-
}
|
29
|
-
|
30
|
-
initialize() {
|
31
|
-
this.$handle = $([
|
32
|
-
'<div class="note-handle">',
|
33
|
-
'<div class="note-control-selection">',
|
34
|
-
'<div class="note-control-selection-bg"></div>',
|
35
|
-
'<div class="note-control-holder note-control-nw"></div>',
|
36
|
-
'<div class="note-control-holder note-control-ne"></div>',
|
37
|
-
'<div class="note-control-holder note-control-sw"></div>',
|
38
|
-
'<div class="',
|
39
|
-
(this.options.disableResizeImage ? 'note-control-holder' : 'note-control-sizing'),
|
40
|
-
' note-control-se"></div>',
|
41
|
-
(this.options.disableResizeImage ? '' : '<div class="note-control-selection-info"></div>'),
|
42
|
-
'</div>',
|
43
|
-
'</div>'
|
44
|
-
].join('')).prependTo(this.$editingArea);
|
45
|
-
|
46
|
-
this.$handle.on('mousedown', (event) => {
|
47
|
-
if (dom.isControlSizing(event.target)) {
|
48
|
-
event.preventDefault();
|
49
|
-
event.stopPropagation();
|
50
|
-
|
51
|
-
const $target = this.$handle.find('.note-control-selection').data('target');
|
52
|
-
const posStart = $target.offset();
|
53
|
-
const scrollTop = this.$document.scrollTop();
|
54
|
-
|
55
|
-
const onMouseMove = (event) => {
|
56
|
-
this.context.invoke('editor.resizeTo', {
|
57
|
-
x: event.clientX - posStart.left,
|
58
|
-
y: event.clientY - (posStart.top - scrollTop)
|
59
|
-
}, $target, !event.shiftKey);
|
60
|
-
|
61
|
-
this.update($target[0]);
|
62
|
-
};
|
63
|
-
|
64
|
-
this.$document
|
65
|
-
.on('mousemove', onMouseMove)
|
66
|
-
.one('mouseup', (e) => {
|
67
|
-
e.preventDefault();
|
68
|
-
this.$document.off('mousemove', onMouseMove);
|
69
|
-
this.context.invoke('editor.afterCommand');
|
70
|
-
});
|
71
|
-
|
72
|
-
if (!$target.data('ratio')) { // original ratio.
|
73
|
-
$target.data('ratio', $target.height() / $target.width());
|
74
|
-
}
|
75
|
-
}
|
76
|
-
});
|
77
|
-
|
78
|
-
// Listen for scrolling on the handle overlay.
|
79
|
-
this.$handle.on('wheel', (e) => {
|
80
|
-
e.preventDefault();
|
81
|
-
this.update();
|
82
|
-
});
|
83
|
-
}
|
84
|
-
|
85
|
-
destroy() {
|
86
|
-
this.$handle.remove();
|
87
|
-
}
|
88
|
-
|
89
|
-
update(target) {
|
90
|
-
if (this.context.isDisabled()) {
|
91
|
-
return false;
|
92
|
-
}
|
93
|
-
|
94
|
-
const isImage = dom.isImg(target);
|
95
|
-
const $selection = this.$handle.find('.note-control-selection');
|
96
|
-
|
97
|
-
this.context.invoke('imagePopover.update', target);
|
98
|
-
|
99
|
-
if (isImage) {
|
100
|
-
const $image = $(target);
|
101
|
-
const position = $image.position();
|
102
|
-
const pos = {
|
103
|
-
left: position.left + parseInt($image.css('marginLeft'), 10),
|
104
|
-
top: position.top + parseInt($image.css('marginTop'), 10)
|
105
|
-
};
|
106
|
-
|
107
|
-
// exclude margin
|
108
|
-
const imageSize = {
|
109
|
-
w: $image.outerWidth(false),
|
110
|
-
h: $image.outerHeight(false)
|
111
|
-
};
|
112
|
-
|
113
|
-
$selection.css({
|
114
|
-
display: 'block',
|
115
|
-
left: pos.left,
|
116
|
-
top: pos.top,
|
117
|
-
width: imageSize.w,
|
118
|
-
height: imageSize.h
|
119
|
-
}).data('target', $image); // save current image element.
|
120
|
-
|
121
|
-
const origImageObj = new Image();
|
122
|
-
origImageObj.src = $image.attr('src');
|
123
|
-
|
124
|
-
const sizingText = imageSize.w + 'x' + imageSize.h + ' (' + this.lang.image.original + ': ' + origImageObj.width + 'x' + origImageObj.height + ')';
|
125
|
-
$selection.find('.note-control-selection-info').text(sizingText);
|
126
|
-
this.context.invoke('editor.saveTarget', target);
|
127
|
-
} else {
|
128
|
-
this.hide();
|
129
|
-
}
|
130
|
-
|
131
|
-
return isImage;
|
132
|
-
}
|
133
|
-
|
134
|
-
/**
|
135
|
-
* hide
|
136
|
-
*
|
137
|
-
* @param {jQuery} $handle
|
138
|
-
*/
|
139
|
-
hide() {
|
140
|
-
this.context.invoke('editor.clearTarget');
|
141
|
-
this.$handle.children().hide();
|
142
|
-
}
|
143
|
-
}
|
@@ -1,79 +0,0 @@
|
|
1
|
-
import $ from 'jquery';
|
2
|
-
import env from '../core/env';
|
3
|
-
|
4
|
-
export default class HelpDialog {
|
5
|
-
constructor(context) {
|
6
|
-
this.context = context;
|
7
|
-
|
8
|
-
this.ui = $.summernote.ui;
|
9
|
-
this.$body = $(document.body);
|
10
|
-
this.$editor = context.layoutInfo.editor;
|
11
|
-
this.options = context.options;
|
12
|
-
this.lang = this.options.langInfo;
|
13
|
-
}
|
14
|
-
|
15
|
-
initialize() {
|
16
|
-
const $container = this.options.dialogsInBody ? this.$body : this.$editor;
|
17
|
-
|
18
|
-
const body = [
|
19
|
-
'<p class="text-center">',
|
20
|
-
'<a href="http://summernote.org/" target="_blank">Summernote @@VERSION@@</a> · ',
|
21
|
-
'<a href="https://github.com/summernote/summernote" target="_blank">Project</a> · ',
|
22
|
-
'<a href="https://github.com/summernote/summernote/issues" target="_blank">Issues</a>',
|
23
|
-
'</p>'
|
24
|
-
].join('');
|
25
|
-
|
26
|
-
this.$dialog = this.ui.dialog({
|
27
|
-
title: this.lang.options.help,
|
28
|
-
fade: this.options.dialogsFade,
|
29
|
-
body: this.createShortcutList(),
|
30
|
-
footer: body,
|
31
|
-
callback: ($node) => {
|
32
|
-
$node.find('.modal-body,.note-modal-body').css({
|
33
|
-
'max-height': 300,
|
34
|
-
'overflow': 'scroll'
|
35
|
-
});
|
36
|
-
}
|
37
|
-
}).render().appendTo($container);
|
38
|
-
}
|
39
|
-
|
40
|
-
destroy() {
|
41
|
-
this.ui.hideDialog(this.$dialog);
|
42
|
-
this.$dialog.remove();
|
43
|
-
}
|
44
|
-
|
45
|
-
createShortcutList() {
|
46
|
-
const keyMap = this.options.keyMap[env.isMac ? 'mac' : 'pc'];
|
47
|
-
return Object.keys(keyMap).map((key) => {
|
48
|
-
const command = keyMap[key];
|
49
|
-
const $row = $('<div><div class="help-list-item"/></div>');
|
50
|
-
$row.append($('<label><kbd>' + key + '</kdb></label>').css({
|
51
|
-
'width': 180,
|
52
|
-
'margin-right': 10
|
53
|
-
})).append($('<span/>').html(this.context.memo('help.' + command) || command));
|
54
|
-
return $row.html();
|
55
|
-
}).join('');
|
56
|
-
}
|
57
|
-
|
58
|
-
/**
|
59
|
-
* show help dialog
|
60
|
-
*
|
61
|
-
* @return {Promise}
|
62
|
-
*/
|
63
|
-
showHelpDialog() {
|
64
|
-
return $.Deferred((deferred) => {
|
65
|
-
this.ui.onDialogShown(this.$dialog, () => {
|
66
|
-
this.context.triggerEvent('dialog.shown');
|
67
|
-
deferred.resolve();
|
68
|
-
});
|
69
|
-
this.ui.showDialog(this.$dialog);
|
70
|
-
}).promise();
|
71
|
-
}
|
72
|
-
|
73
|
-
show() {
|
74
|
-
this.context.invoke('editor.saveRange');
|
75
|
-
this.showHelpDialog().then(() => {
|
76
|
-
this.context.invoke('editor.restoreRange');
|
77
|
-
});
|
78
|
-
}
|
79
|
-
}
|
@@ -1,226 +0,0 @@
|
|
1
|
-
import $ from 'jquery';
|
2
|
-
import func from '../core/func';
|
3
|
-
import lists from '../core/lists';
|
4
|
-
import dom from '../core/dom';
|
5
|
-
import range from '../core/range';
|
6
|
-
import key from '../core/key';
|
7
|
-
|
8
|
-
const POPOVER_DIST = 5;
|
9
|
-
|
10
|
-
export default class HintPopover {
|
11
|
-
constructor(context) {
|
12
|
-
this.context = context;
|
13
|
-
|
14
|
-
this.ui = $.summernote.ui;
|
15
|
-
this.$editable = context.layoutInfo.editable;
|
16
|
-
this.options = context.options;
|
17
|
-
this.hint = this.options.hint || [];
|
18
|
-
this.direction = this.options.hintDirection || 'bottom';
|
19
|
-
this.hints = $.isArray(this.hint) ? this.hint : [this.hint];
|
20
|
-
|
21
|
-
this.events = {
|
22
|
-
'summernote.keyup': (we, e) => {
|
23
|
-
if (!e.isDefaultPrevented()) {
|
24
|
-
this.handleKeyup(e);
|
25
|
-
}
|
26
|
-
},
|
27
|
-
'summernote.keydown': (we, e) => {
|
28
|
-
this.handleKeydown(e);
|
29
|
-
},
|
30
|
-
'summernote.disable summernote.dialog.shown': () => {
|
31
|
-
this.hide();
|
32
|
-
}
|
33
|
-
};
|
34
|
-
}
|
35
|
-
|
36
|
-
shouldInitialize() {
|
37
|
-
return this.hints.length > 0;
|
38
|
-
}
|
39
|
-
|
40
|
-
initialize() {
|
41
|
-
this.lastWordRange = null;
|
42
|
-
this.$popover = this.ui.popover({
|
43
|
-
className: 'note-hint-popover',
|
44
|
-
hideArrow: true,
|
45
|
-
direction: ''
|
46
|
-
}).render().appendTo(this.options.container);
|
47
|
-
|
48
|
-
this.$popover.hide();
|
49
|
-
this.$content = this.$popover.find('.popover-content,.note-popover-content');
|
50
|
-
this.$content.on('click', '.note-hint-item', () => {
|
51
|
-
this.$content.find('.active').removeClass('active');
|
52
|
-
$(this).addClass('active');
|
53
|
-
this.replace();
|
54
|
-
});
|
55
|
-
}
|
56
|
-
|
57
|
-
destroy() {
|
58
|
-
this.$popover.remove();
|
59
|
-
}
|
60
|
-
|
61
|
-
selectItem($item) {
|
62
|
-
this.$content.find('.active').removeClass('active');
|
63
|
-
$item.addClass('active');
|
64
|
-
|
65
|
-
this.$content[0].scrollTop = $item[0].offsetTop - (this.$content.innerHeight() / 2);
|
66
|
-
}
|
67
|
-
|
68
|
-
moveDown() {
|
69
|
-
const $current = this.$content.find('.note-hint-item.active');
|
70
|
-
const $next = $current.next();
|
71
|
-
|
72
|
-
if ($next.length) {
|
73
|
-
this.selectItem($next);
|
74
|
-
} else {
|
75
|
-
let $nextGroup = $current.parent().next();
|
76
|
-
|
77
|
-
if (!$nextGroup.length) {
|
78
|
-
$nextGroup = this.$content.find('.note-hint-group').first();
|
79
|
-
}
|
80
|
-
|
81
|
-
this.selectItem($nextGroup.find('.note-hint-item').first());
|
82
|
-
}
|
83
|
-
}
|
84
|
-
|
85
|
-
moveUp() {
|
86
|
-
const $current = this.$content.find('.note-hint-item.active');
|
87
|
-
const $prev = $current.prev();
|
88
|
-
|
89
|
-
if ($prev.length) {
|
90
|
-
this.selectItem($prev);
|
91
|
-
} else {
|
92
|
-
let $prevGroup = $current.parent().prev();
|
93
|
-
|
94
|
-
if (!$prevGroup.length) {
|
95
|
-
$prevGroup = this.$content.find('.note-hint-group').last();
|
96
|
-
}
|
97
|
-
|
98
|
-
this.selectItem($prevGroup.find('.note-hint-item').last());
|
99
|
-
}
|
100
|
-
}
|
101
|
-
|
102
|
-
replace() {
|
103
|
-
const $item = this.$content.find('.note-hint-item.active');
|
104
|
-
|
105
|
-
if ($item.length) {
|
106
|
-
const node = this.nodeFromItem($item);
|
107
|
-
// XXX: consider to move codes to editor for recording redo/undo.
|
108
|
-
this.lastWordRange.insertNode(node);
|
109
|
-
range.createFromNode(node).collapse().select();
|
110
|
-
|
111
|
-
this.lastWordRange = null;
|
112
|
-
this.hide();
|
113
|
-
this.context.triggerEvent('change', this.$editable.html(), this.$editable[0]);
|
114
|
-
this.context.invoke('editor.focus');
|
115
|
-
}
|
116
|
-
}
|
117
|
-
|
118
|
-
nodeFromItem($item) {
|
119
|
-
const hint = this.hints[$item.data('index')];
|
120
|
-
const item = $item.data('item');
|
121
|
-
let node = hint.content ? hint.content(item) : item;
|
122
|
-
if (typeof node === 'string') {
|
123
|
-
node = dom.createText(node);
|
124
|
-
}
|
125
|
-
return node;
|
126
|
-
}
|
127
|
-
|
128
|
-
createItemTemplates(hintIdx, items) {
|
129
|
-
const hint = this.hints[hintIdx];
|
130
|
-
return items.map((item, idx) => {
|
131
|
-
const $item = $('<div class="note-hint-item"/>');
|
132
|
-
$item.append(hint.template ? hint.template(item) : item + '');
|
133
|
-
$item.data({
|
134
|
-
'index': hintIdx,
|
135
|
-
'item': item
|
136
|
-
});
|
137
|
-
return $item;
|
138
|
-
});
|
139
|
-
}
|
140
|
-
|
141
|
-
handleKeydown(e) {
|
142
|
-
if (!this.$popover.is(':visible')) {
|
143
|
-
return;
|
144
|
-
}
|
145
|
-
|
146
|
-
if (e.keyCode === key.code.ENTER) {
|
147
|
-
e.preventDefault();
|
148
|
-
this.replace();
|
149
|
-
} else if (e.keyCode === key.code.UP) {
|
150
|
-
e.preventDefault();
|
151
|
-
this.moveUp();
|
152
|
-
} else if (e.keyCode === key.code.DOWN) {
|
153
|
-
e.preventDefault();
|
154
|
-
this.moveDown();
|
155
|
-
}
|
156
|
-
}
|
157
|
-
|
158
|
-
searchKeyword(index, keyword, callback) {
|
159
|
-
const hint = this.hints[index];
|
160
|
-
if (hint && hint.match.test(keyword) && hint.search) {
|
161
|
-
const matches = hint.match.exec(keyword);
|
162
|
-
hint.search(matches[1], callback);
|
163
|
-
} else {
|
164
|
-
callback();
|
165
|
-
}
|
166
|
-
}
|
167
|
-
|
168
|
-
createGroup(idx, keyword) {
|
169
|
-
const $group = $('<div class="note-hint-group note-hint-group-' + idx + '"/>');
|
170
|
-
this.searchKeyword(idx, keyword, (items) => {
|
171
|
-
items = items || [];
|
172
|
-
if (items.length) {
|
173
|
-
$group.html(this.createItemTemplates(idx, items));
|
174
|
-
this.show();
|
175
|
-
}
|
176
|
-
});
|
177
|
-
|
178
|
-
return $group;
|
179
|
-
}
|
180
|
-
|
181
|
-
handleKeyup(e) {
|
182
|
-
if (!lists.contains([key.code.ENTER, key.code.UP, key.code.DOWN], e.keyCode)) {
|
183
|
-
const wordRange = this.context.invoke('editor.createRange').getWordRange();
|
184
|
-
const keyword = wordRange.toString();
|
185
|
-
if (this.hints.length && keyword) {
|
186
|
-
this.$content.empty();
|
187
|
-
|
188
|
-
const bnd = func.rect2bnd(lists.last(wordRange.getClientRects()));
|
189
|
-
if (bnd) {
|
190
|
-
this.$popover.hide();
|
191
|
-
this.lastWordRange = wordRange;
|
192
|
-
this.hints.forEach((hint, idx) => {
|
193
|
-
if (hint.match.test(keyword)) {
|
194
|
-
this.createGroup(idx, keyword).appendTo(this.$content);
|
195
|
-
}
|
196
|
-
});
|
197
|
-
// select first .note-hint-item
|
198
|
-
this.$content.find('.note-hint-item:first').addClass('active');
|
199
|
-
|
200
|
-
// set position for popover after group is created
|
201
|
-
if (this.direction === 'top') {
|
202
|
-
this.$popover.css({
|
203
|
-
left: bnd.left,
|
204
|
-
top: bnd.top - this.$popover.outerHeight() - POPOVER_DIST
|
205
|
-
});
|
206
|
-
} else {
|
207
|
-
this.$popover.css({
|
208
|
-
left: bnd.left,
|
209
|
-
top: bnd.top + bnd.height + POPOVER_DIST
|
210
|
-
});
|
211
|
-
}
|
212
|
-
}
|
213
|
-
} else {
|
214
|
-
this.hide();
|
215
|
-
}
|
216
|
-
}
|
217
|
-
}
|
218
|
-
|
219
|
-
show() {
|
220
|
-
this.$popover.show();
|
221
|
-
}
|
222
|
-
|
223
|
-
hide() {
|
224
|
-
this.$popover.hide();
|
225
|
-
}
|
226
|
-
}
|