promethee 1.4.8 → 1.4.9
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +1 -6
- data/app/assets/javascripts/promethee.js +4 -0
- data/app/assets/stylesheets/promethee-edit.sass +1 -0
- data/config/initializers/assets.rb +1 -0
- data/lib/promethee/rails/version.rb +1 -1
- data/node_modules/angular-summernote/CHANGELOG.md +149 -0
- data/node_modules/angular-summernote/LICENSE-MIT +22 -0
- data/node_modules/angular-summernote/README.md +270 -0
- data/node_modules/angular-summernote/bower.json +49 -0
- data/{vendor/assets/javascripts → node_modules/angular-summernote/dist}/angular-summernote.js +0 -0
- data/node_modules/angular-summernote/dist/angular-summernote.min.js +2 -0
- data/node_modules/angular-summernote/examples/fontstyle-plugin.html +48 -0
- data/node_modules/angular-summernote/examples/index.html +180 -0
- data/node_modules/angular-summernote/examples/index2.html +60 -0
- data/node_modules/angular-summernote/examples/index3.html +57 -0
- data/node_modules/angular-summernote/gulpfile.js +115 -0
- data/node_modules/angular-summernote/package.json +53 -0
- data/node_modules/angular-summernote/src/angular-summernote.js +206 -0
- data/node_modules/angular-summernote/test/angular-summernote.test.js +660 -0
- data/node_modules/angular-summernote/test/chai.conf.js +6 -0
- data/node_modules/angular-summernote/test/coverage/Chrome 37.0.2062 (Mac OS X 10.9.4)/index.html +350 -0
- data/node_modules/angular-summernote/test/coverage/Chrome 37.0.2062 (Mac OS X 10.9.4)/prettify.css +1 -0
- data/node_modules/angular-summernote/test/coverage/Chrome 37.0.2062 (Mac OS X 10.9.4)/prettify.js +1 -0
- data/node_modules/angular-summernote/test/coverage/Chrome 37.0.2062 (Mac OS X 10.9.4)/src/angular-summernote.js.html +694 -0
- data/node_modules/angular-summernote/test/coverage/Chrome 37.0.2062 (Mac OS X 10.9.4)/src/index.html +350 -0
- data/node_modules/angular-summernote/test/karma-angular-1-2-x.conf.js +33 -0
- data/node_modules/angular-summernote/test/karma-angular-1-3-x.conf.js +33 -0
- data/node_modules/angular-summernote/test/karma-angular-1-4-x.conf.js +33 -0
- data/node_modules/angular-summernote/test/karma-shared.conf.js +64 -0
- data/node_modules/angular-summernote/test/karma.conf.js +33 -0
- data/{vendor/assets/javascripts/summernote/locales/de-DE.js → node_modules/angular-summernote/test/lang/summernote-de-DE.js} +2 -17
- data/node_modules/angular-summernote/test/mocha.conf.js +3 -0
- data/node_modules/angular-ui-sortable/API.md +84 -0
- data/node_modules/angular-ui-sortable/CONTRIBUTING.md +12 -0
- data/node_modules/angular-ui-sortable/LICENSE +21 -0
- data/node_modules/angular-ui-sortable/README.md +350 -0
- data/node_modules/angular-ui-sortable/bower.json +26 -0
- data/node_modules/angular-ui-sortable/demo/demo.css +34 -0
- data/node_modules/angular-ui-sortable/demo/demo.html +29 -0
- data/node_modules/angular-ui-sortable/demo/demo.js +41 -0
- data/node_modules/angular-ui-sortable/dist/sortable.js +593 -0
- data/node_modules/angular-ui-sortable/dist/sortable.min.js +8 -0
- data/node_modules/angular-ui-sortable/gruntFile.js +202 -0
- data/node_modules/angular-ui-sortable/package.json +48 -0
- data/node_modules/angular-ui-sortable/publish.js +41 -0
- data/{vendor/assets/javascripts/ui-sortable.js → node_modules/angular-ui-sortable/src/sortable.js} +106 -200
- data/node_modules/angular-ui-sortable/test/bower_overrides.json +13 -0
- data/node_modules/angular-ui-sortable/test/karma.conf.js +85 -0
- data/node_modules/angular-ui-sortable/test/libs/jquery.simulate.dragandrevert.js +60 -0
- data/node_modules/angular-ui-sortable/test/sortable.e2e.callbacks.attr.spec.js +199 -0
- data/node_modules/angular-ui-sortable/test/sortable.e2e.callbacks.spec.js +729 -0
- data/node_modules/angular-ui-sortable/test/sortable.e2e.directiveoptions.spec.js +554 -0
- data/node_modules/angular-ui-sortable/test/sortable.e2e.directives.spec.js +371 -0
- data/node_modules/angular-ui-sortable/test/sortable.e2e.events.spec.js +167 -0
- data/node_modules/angular-ui-sortable/test/sortable.e2e.multi.spec.js +1232 -0
- data/node_modules/angular-ui-sortable/test/sortable.e2e.nested.spec.js +186 -0
- data/node_modules/angular-ui-sortable/test/sortable.e2e.spec.js +895 -0
- data/node_modules/angular-ui-sortable/test/sortable.spec.js +440 -0
- data/node_modules/angular-ui-sortable/test/sortable.test-directives.js +54 -0
- data/node_modules/angular-ui-sortable/test/sortable.test-helper.js +114 -0
- data/node_modules/angular-ui-sortable/test/sortable.tests.css +12 -0
- data/node_modules/ng-file-upload/LICENSE +20 -0
- data/node_modules/ng-file-upload/README.md +616 -0
- data/{vendor/assets/javascripts/ng-file-upload → node_modules/ng-file-upload/dist}/FileAPI.flash.swf +0 -0
- data/{vendor/assets/javascripts/ng-file-upload → node_modules/ng-file-upload/dist}/FileAPI.js +0 -0
- data/{vendor/assets/javascripts/ng-file-upload → node_modules/ng-file-upload/dist}/FileAPI.min.js +0 -0
- data/{vendor/assets/javascripts/ng-file-upload → node_modules/ng-file-upload/dist}/ng-file-upload-all.js +0 -0
- data/{vendor/assets/javascripts/ng-file-upload → node_modules/ng-file-upload/dist}/ng-file-upload-all.min.js +0 -0
- data/{vendor/assets/javascripts/ng-file-upload → node_modules/ng-file-upload/dist}/ng-file-upload-shim.js +0 -0
- data/{vendor/assets/javascripts/ng-file-upload → node_modules/ng-file-upload/dist}/ng-file-upload-shim.min.js +0 -0
- data/{vendor/assets/javascripts/ng-file-upload → node_modules/ng-file-upload/dist}/ng-file-upload.js +0 -0
- data/{vendor/assets/javascripts/ng-file-upload → node_modules/ng-file-upload/dist}/ng-file-upload.min.js +0 -0
- data/node_modules/ng-file-upload/index.js +2 -0
- data/node_modules/ng-file-upload/package.json +42 -0
- data/node_modules/summernote/CODE_OF_CONDUCT.md +46 -0
- data/node_modules/summernote/CONTRIBUTING.md +67 -0
- data/node_modules/summernote/ISSUE_TEMPLATE.md +14 -0
- data/node_modules/summernote/LICENSE +21 -0
- data/node_modules/summernote/PULL_REQUEST_TEMPLATE.md +28 -0
- data/node_modules/summernote/README.md +90 -0
- data/node_modules/summernote/coverage/PhantomJS 2.1.1 (Mac OS X 0.0.0)/html/base.css +213 -0
- data/node_modules/summernote/coverage/PhantomJS 2.1.1 (Mac OS X 0.0.0)/html/index.html +262 -0
- data/node_modules/summernote/coverage/PhantomJS 2.1.1 (Mac OS X 0.0.0)/html/prettify.css +1 -0
- data/node_modules/summernote/coverage/PhantomJS 2.1.1 (Mac OS X 0.0.0)/html/prettify.js +1 -0
- 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 +158 -0
- data/node_modules/summernote/coverage/PhantomJS 2.1.1 (Mac OS X 0.0.0)/html/src/js/base/Context.js.html +758 -0
- data/node_modules/summernote/coverage/PhantomJS 2.1.1 (Mac OS X 0.0.0)/html/src/js/base/core/async.js.html +206 -0
- data/node_modules/summernote/coverage/PhantomJS 2.1.1 (Mac OS X 0.0.0)/html/src/js/base/core/dom.js.html +3329 -0
- data/node_modules/summernote/coverage/PhantomJS 2.1.1 (Mac OS X 0.0.0)/html/src/js/base/core/env.js.html +386 -0
- data/node_modules/summernote/coverage/PhantomJS 2.1.1 (Mac OS X 0.0.0)/html/src/js/base/core/func.js.html +551 -0
- data/node_modules/summernote/coverage/PhantomJS 2.1.1 (Mac OS X 0.0.0)/html/src/js/base/core/index.html +171 -0
- data/node_modules/summernote/coverage/PhantomJS 2.1.1 (Mac OS X 0.0.0)/html/src/js/base/core/key.js.html +341 -0
- data/node_modules/summernote/coverage/PhantomJS 2.1.1 (Mac OS X 0.0.0)/html/src/js/base/core/lists.js.html +695 -0
- data/node_modules/summernote/coverage/PhantomJS 2.1.1 (Mac OS X 0.0.0)/html/src/js/base/core/range.js.html +2441 -0
- data/node_modules/summernote/coverage/PhantomJS 2.1.1 (Mac OS X 0.0.0)/html/src/js/base/editing/Bullet.js.html +668 -0
- data/node_modules/summernote/coverage/PhantomJS 2.1.1 (Mac OS X 0.0.0)/html/src/js/base/editing/History.js.html +380 -0
- data/node_modules/summernote/coverage/PhantomJS 2.1.1 (Mac OS X 0.0.0)/html/src/js/base/editing/Style.js.html +539 -0
- data/node_modules/summernote/coverage/PhantomJS 2.1.1 (Mac OS X 0.0.0)/html/src/js/base/editing/Table.js.html +1787 -0
- data/node_modules/summernote/coverage/PhantomJS 2.1.1 (Mac OS X 0.0.0)/html/src/js/base/editing/Typing.js.html +335 -0
- data/node_modules/summernote/coverage/PhantomJS 2.1.1 (Mac OS X 0.0.0)/html/src/js/base/editing/index.html +145 -0
- data/node_modules/summernote/coverage/PhantomJS 2.1.1 (Mac OS X 0.0.0)/html/src/js/base/index.html +119 -0
- data/node_modules/summernote/coverage/PhantomJS 2.1.1 (Mac OS X 0.0.0)/html/src/js/base/module/AirPopover.js.html +284 -0
- data/node_modules/summernote/coverage/PhantomJS 2.1.1 (Mac OS X 0.0.0)/html/src/js/base/module/AutoLink.js.html +248 -0
- data/node_modules/summernote/coverage/PhantomJS 2.1.1 (Mac OS X 0.0.0)/html/src/js/base/module/AutoSync.js.html +122 -0
- data/node_modules/summernote/coverage/PhantomJS 2.1.1 (Mac OS X 0.0.0)/html/src/js/base/module/Buttons.js.html +2504 -0
- data/node_modules/summernote/coverage/PhantomJS 2.1.1 (Mac OS X 0.0.0)/html/src/js/base/module/Clipboard.js.html +149 -0
- data/node_modules/summernote/coverage/PhantomJS 2.1.1 (Mac OS X 0.0.0)/html/src/js/base/module/Codeview.js.html +434 -0
- data/node_modules/summernote/coverage/PhantomJS 2.1.1 (Mac OS X 0.0.0)/html/src/js/base/module/Dropzone.js.html +410 -0
- data/node_modules/summernote/coverage/PhantomJS 2.1.1 (Mac OS X 0.0.0)/html/src/js/base/module/Editor.js.html +2648 -0
- data/node_modules/summernote/coverage/PhantomJS 2.1.1 (Mac OS X 0.0.0)/html/src/js/base/module/Fullscreen.js.html +218 -0
- data/node_modules/summernote/coverage/PhantomJS 2.1.1 (Mac OS X 0.0.0)/html/src/js/base/module/Handle.js.html +494 -0
- data/node_modules/summernote/coverage/PhantomJS 2.1.1 (Mac OS X 0.0.0)/html/src/js/base/module/HelpDialog.js.html +302 -0
- data/node_modules/summernote/coverage/PhantomJS 2.1.1 (Mac OS X 0.0.0)/html/src/js/base/module/HintPopover.js.html +743 -0
- data/node_modules/summernote/coverage/PhantomJS 2.1.1 (Mac OS X 0.0.0)/html/src/js/base/module/ImageDialog.js.html +458 -0
- data/node_modules/summernote/coverage/PhantomJS 2.1.1 (Mac OS X 0.0.0)/html/src/js/base/module/ImagePopover.js.html +239 -0
- data/node_modules/summernote/coverage/PhantomJS 2.1.1 (Mac OS X 0.0.0)/html/src/js/base/module/LinkDialog.js.html +587 -0
- data/node_modules/summernote/coverage/PhantomJS 2.1.1 (Mac OS X 0.0.0)/html/src/js/base/module/LinkPopover.js.html +272 -0
- data/node_modules/summernote/coverage/PhantomJS 2.1.1 (Mac OS X 0.0.0)/html/src/js/base/module/Placeholder.js.html +182 -0
- data/node_modules/summernote/coverage/PhantomJS 2.1.1 (Mac OS X 0.0.0)/html/src/js/base/module/Statusbar.js.html +191 -0
- data/node_modules/summernote/coverage/PhantomJS 2.1.1 (Mac OS X 0.0.0)/html/src/js/base/module/TablePopover.js.html +278 -0
- data/node_modules/summernote/coverage/PhantomJS 2.1.1 (Mac OS X 0.0.0)/html/src/js/base/module/Toolbar.js.html +473 -0
- data/node_modules/summernote/coverage/PhantomJS 2.1.1 (Mac OS X 0.0.0)/html/src/js/base/module/VideoDialog.js.html +680 -0
- data/node_modules/summernote/coverage/PhantomJS 2.1.1 (Mac OS X 0.0.0)/html/src/js/base/module/index.html +353 -0
- data/node_modules/summernote/coverage/PhantomJS 2.1.1 (Mac OS X 0.0.0)/html/src/js/base/renderer.js.html +263 -0
- data/node_modules/summernote/coverage/PhantomJS 2.1.1 (Mac OS X 0.0.0)/html/src/js/base/summernote-en-US.js.html +542 -0
- data/node_modules/summernote/coverage/PhantomJS 2.1.1 (Mac OS X 0.0.0)/html/src/js/bs3/index.html +106 -0
- data/node_modules/summernote/coverage/PhantomJS 2.1.1 (Mac OS X 0.0.0)/html/src/js/bs3/settings.js.html +956 -0
- data/node_modules/summernote/coverage/PhantomJS 2.1.1 (Mac OS X 0.0.0)/html/src/js/bs3/ui.js.html +776 -0
- data/node_modules/summernote/coverage/PhantomJS 2.1.1 (Mac OS X 0.0.0)/html/src/js/bs4/index.html +106 -0
- data/node_modules/summernote/coverage/PhantomJS 2.1.1 (Mac OS X 0.0.0)/html/src/js/bs4/settings.js.html +968 -0
- data/node_modules/summernote/coverage/PhantomJS 2.1.1 (Mac OS X 0.0.0)/html/src/js/bs4/ui.js.html +791 -0
- data/node_modules/summernote/coverage/PhantomJS 2.1.1 (Mac OS X 0.0.0)/html/src/js/index.html +93 -0
- data/node_modules/summernote/coverage/PhantomJS 2.1.1 (Mac OS X 0.0.0)/html/src/js/lite/index.html +106 -0
- data/node_modules/summernote/coverage/PhantomJS 2.1.1 (Mac OS X 0.0.0)/html/src/js/lite/settings.js.html +953 -0
- data/node_modules/summernote/coverage/PhantomJS 2.1.1 (Mac OS X 0.0.0)/html/src/js/lite/ui.js.html +1919 -0
- data/node_modules/summernote/coverage/PhantomJS 2.1.1 (Mac OS X 0.0.0)/html/src/js/lite/ui/DropdownUI.js.html +260 -0
- data/node_modules/summernote/coverage/PhantomJS 2.1.1 (Mac OS X 0.0.0)/html/src/js/lite/ui/ModalUI.js.html +167 -0
- data/node_modules/summernote/coverage/PhantomJS 2.1.1 (Mac OS X 0.0.0)/html/src/js/lite/ui/PopoverUI.js.html +347 -0
- data/node_modules/summernote/coverage/PhantomJS 2.1.1 (Mac OS X 0.0.0)/html/src/js/lite/ui/TooltipUI.js.html +344 -0
- data/node_modules/summernote/coverage/PhantomJS 2.1.1 (Mac OS X 0.0.0)/html/src/js/lite/ui/index.html +132 -0
- data/node_modules/summernote/coverage/PhantomJS 2.1.1 (Mac OS X 0.0.0)/html/src/js/summernote.js.html +203 -0
- data/node_modules/summernote/coverage/PhantomJS 2.1.1 (Mac OS X 0.0.0)/html/test/unit/base/Context.spec.js.html +323 -0
- data/node_modules/summernote/coverage/PhantomJS 2.1.1 (Mac OS X 0.0.0)/html/test/unit/base/core/dom.spec.js.html +1046 -0
- data/node_modules/summernote/coverage/PhantomJS 2.1.1 (Mac OS X 0.0.0)/html/test/unit/base/core/func.spec.js.html +482 -0
- data/node_modules/summernote/coverage/PhantomJS 2.1.1 (Mac OS X 0.0.0)/html/test/unit/base/core/index.html +145 -0
- data/node_modules/summernote/coverage/PhantomJS 2.1.1 (Mac OS X 0.0.0)/html/test/unit/base/core/key.spec.js.html +140 -0
- data/node_modules/summernote/coverage/PhantomJS 2.1.1 (Mac OS X 0.0.0)/html/test/unit/base/core/lists.spec.js.html +419 -0
- data/node_modules/summernote/coverage/PhantomJS 2.1.1 (Mac OS X 0.0.0)/html/test/unit/base/core/range.spec.js.html +1286 -0
- data/node_modules/summernote/coverage/PhantomJS 2.1.1 (Mac OS X 0.0.0)/html/test/unit/base/editing/Table.spec.js.html +1724 -0
- data/node_modules/summernote/coverage/PhantomJS 2.1.1 (Mac OS X 0.0.0)/html/test/unit/base/editing/index.html +106 -0
- data/node_modules/summernote/coverage/PhantomJS 2.1.1 (Mac OS X 0.0.0)/html/test/unit/base/editing/style.spec.js.html +341 -0
- data/node_modules/summernote/coverage/PhantomJS 2.1.1 (Mac OS X 0.0.0)/html/test/unit/base/index.html +93 -0
- data/node_modules/summernote/coverage/PhantomJS 2.1.1 (Mac OS X 0.0.0)/html/test/unit/base/module/Codeview.spec.js.html +161 -0
- data/node_modules/summernote/coverage/PhantomJS 2.1.1 (Mac OS X 0.0.0)/html/test/unit/base/module/Editor.spec.js.html +1235 -0
- data/node_modules/summernote/coverage/PhantomJS 2.1.1 (Mac OS X 0.0.0)/html/test/unit/base/module/Fullscreen.spec.js.html +161 -0
- data/node_modules/summernote/coverage/PhantomJS 2.1.1 (Mac OS X 0.0.0)/html/test/unit/base/module/index.html +119 -0
- data/node_modules/summernote/coverage/PhantomJS 2.1.1 (Mac OS X 0.0.0)/html/test/unit/bs/module/Buttons.spec.js.html +770 -0
- data/node_modules/summernote/coverage/PhantomJS 2.1.1 (Mac OS X 0.0.0)/html/test/unit/bs/module/VideoDialog.spec.js.html +209 -0
- data/node_modules/summernote/coverage/PhantomJS 2.1.1 (Mac OS X 0.0.0)/html/test/unit/bs/module/index.html +106 -0
- 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/{vendor/assets/javascripts/summernote/locales/ar-AR.js → node_modules/summernote/dist/lang/summernote-ar-AR.js} +55 -4
- data/node_modules/summernote/dist/lang/summernote-ar-AR.min.js +3 -0
- data/{vendor/assets/javascripts/summernote/locales/bg-BG.js → node_modules/summernote/dist/lang/summernote-bg-BG.js} +60 -4
- data/node_modules/summernote/dist/lang/summernote-bg-BG.min.js +3 -0
- data/{vendor/assets/javascripts/summernote/locales/ca-ES.js → node_modules/summernote/dist/lang/summernote-ca-ES.js} +12 -4
- data/node_modules/summernote/dist/lang/summernote-ca-ES.min.js +3 -0
- data/{vendor/assets/javascripts/summernote/locales/cs-CZ.js → node_modules/summernote/dist/lang/summernote-cs-CZ.js} +50 -4
- data/node_modules/summernote/dist/lang/summernote-cs-CZ.min.js +3 -0
- data/{vendor/assets/javascripts/summernote/locales/da-DK.js → node_modules/summernote/dist/lang/summernote-da-DK.js} +46 -5
- data/node_modules/summernote/dist/lang/summernote-da-DK.min.js +3 -0
- data/node_modules/summernote/dist/lang/summernote-de-DE.js +154 -0
- data/node_modules/summernote/dist/lang/summernote-de-DE.min.js +3 -0
- data/{vendor/assets/javascripts/summernote/locales/el-GR.js → node_modules/summernote/dist/lang/summernote-el-GR.js} +11 -3
- data/node_modules/summernote/dist/lang/summernote-el-GR.min.js +3 -0
- data/{vendor/assets/javascripts/summernote/locales/es-ES.js → node_modules/summernote/dist/lang/summernote-es-ES.js} +12 -4
- data/node_modules/summernote/dist/lang/summernote-es-ES.min.js +3 -0
- data/{vendor/assets/javascripts/summernote/locales/es-EU.js → node_modules/summernote/dist/lang/summernote-es-EU.js} +55 -4
- data/node_modules/summernote/dist/lang/summernote-es-EU.min.js +3 -0
- data/{vendor/assets/javascripts/summernote/locales/fa-IR.js → node_modules/summernote/dist/lang/summernote-fa-IR.js} +55 -5
- data/node_modules/summernote/dist/lang/summernote-fa-IR.min.js +3 -0
- data/{vendor/assets/javascripts/summernote/locales/fi-FI.js → node_modules/summernote/dist/lang/summernote-fi-FI.js} +52 -3
- data/node_modules/summernote/dist/lang/summernote-fi-FI.min.js +3 -0
- data/{vendor/assets/javascripts/summernote/locales/fr-FR.js → node_modules/summernote/dist/lang/summernote-fr-FR.js} +3 -2
- data/node_modules/summernote/dist/lang/summernote-fr-FR.min.js +3 -0
- data/{vendor/assets/javascripts/summernote/locales/gl-ES.js → node_modules/summernote/dist/lang/summernote-gl-ES.js} +12 -4
- data/node_modules/summernote/dist/lang/summernote-gl-ES.min.js +3 -0
- data/{vendor/assets/javascripts/summernote/locales/he-IL.js → node_modules/summernote/dist/lang/summernote-he-IL.js} +51 -3
- data/node_modules/summernote/dist/lang/summernote-he-IL.min.js +3 -0
- data/{vendor/assets/javascripts/summernote/locales/hr-HR.js → node_modules/summernote/dist/lang/summernote-hr-HR.js} +54 -3
- data/node_modules/summernote/dist/lang/summernote-hr-HR.min.js +3 -0
- data/{vendor/assets/javascripts/summernote/locales/hu-HU.js → node_modules/summernote/dist/lang/summernote-hu-HU.js} +25 -5
- data/node_modules/summernote/dist/lang/summernote-hu-HU.min.js +3 -0
- data/{vendor/assets/javascripts/summernote/locales/id-ID.js → node_modules/summernote/dist/lang/summernote-id-ID.js} +56 -4
- data/node_modules/summernote/dist/lang/summernote-id-ID.min.js +3 -0
- data/{vendor/assets/javascripts/summernote/locales/it-IT.js → node_modules/summernote/dist/lang/summernote-it-IT.js} +55 -4
- data/node_modules/summernote/dist/lang/summernote-it-IT.min.js +3 -0
- data/{vendor/assets/javascripts/summernote/locales/ja-JP.js → node_modules/summernote/dist/lang/summernote-ja-JP.js} +32 -10
- data/node_modules/summernote/dist/lang/summernote-ja-JP.min.js +3 -0
- data/{vendor/assets/javascripts/summernote/locales/ko-KR.js → node_modules/summernote/dist/lang/summernote-ko-KR.js} +44 -4
- data/node_modules/summernote/dist/lang/summernote-ko-KR.min.js +3 -0
- data/{vendor/assets/javascripts/summernote/locales/lt-LT.js → node_modules/summernote/dist/lang/summernote-lt-LT.js} +52 -4
- data/node_modules/summernote/dist/lang/summernote-lt-LT.min.js +3 -0
- data/{vendor/assets/javascripts/summernote/locales/lt-LV.js → node_modules/summernote/dist/lang/summernote-lt-LV.js} +27 -7
- data/node_modules/summernote/dist/lang/summernote-lt-LV.min.js +3 -0
- data/{vendor/assets/javascripts/summernote/locales/mn-MN.js → node_modules/summernote/dist/lang/summernote-mn-MN.js} +43 -4
- data/node_modules/summernote/dist/lang/summernote-mn-MN.min.js +3 -0
- data/{vendor/assets/javascripts/summernote/locales/nb-NO.js → node_modules/summernote/dist/lang/summernote-nb-NO.js} +53 -3
- data/node_modules/summernote/dist/lang/summernote-nb-NO.min.js +3 -0
- data/{vendor/assets/javascripts/summernote/locales/nl-NL.js → node_modules/summernote/dist/lang/summernote-nl-NL.js} +55 -4
- data/node_modules/summernote/dist/lang/summernote-nl-NL.min.js +3 -0
- data/{vendor/assets/javascripts/summernote/locales/pl-PL.js → node_modules/summernote/dist/lang/summernote-pl-PL.js} +46 -3
- data/node_modules/summernote/dist/lang/summernote-pl-PL.min.js +3 -0
- data/{vendor/assets/javascripts/summernote/locales/pt-BR.js → node_modules/summernote/dist/lang/summernote-pt-BR.js} +25 -8
- data/node_modules/summernote/dist/lang/summernote-pt-BR.min.js +3 -0
- data/{vendor/assets/javascripts/summernote/locales/pt-PT.js → node_modules/summernote/dist/lang/summernote-pt-PT.js} +54 -3
- data/node_modules/summernote/dist/lang/summernote-pt-PT.min.js +3 -0
- data/node_modules/summernote/dist/lang/summernote-ro-RO.js +155 -0
- data/node_modules/summernote/dist/lang/summernote-ro-RO.min.js +3 -0
- data/{vendor/assets/javascripts/summernote/locales/ru-RU.js → node_modules/summernote/dist/lang/summernote-ru-RU.js} +46 -3
- data/node_modules/summernote/dist/lang/summernote-ru-RU.min.js +3 -0
- data/{vendor/assets/javascripts/summernote/locales/sk-SK.js → node_modules/summernote/dist/lang/summernote-sk-SK.js} +54 -3
- data/node_modules/summernote/dist/lang/summernote-sk-SK.min.js +3 -0
- data/{vendor/assets/javascripts/summernote/locales/sl-SI.js → node_modules/summernote/dist/lang/summernote-sl-SI.js} +53 -4
- data/node_modules/summernote/dist/lang/summernote-sl-SI.min.js +3 -0
- data/{vendor/assets/javascripts/summernote/locales/sr-RS-Latin.js → node_modules/summernote/dist/lang/summernote-sr-RS-Latin.js} +54 -3
- data/node_modules/summernote/dist/lang/summernote-sr-RS-Latin.min.js +3 -0
- data/{vendor/assets/javascripts/summernote/locales/sr-RS.js → node_modules/summernote/dist/lang/summernote-sr-RS.js} +54 -3
- data/node_modules/summernote/dist/lang/summernote-sr-RS.min.js +3 -0
- data/{vendor/assets/javascripts/summernote/locales/sv-SE.js → node_modules/summernote/dist/lang/summernote-sv-SE.js} +55 -4
- data/node_modules/summernote/dist/lang/summernote-sv-SE.min.js +3 -0
- data/{vendor/assets/javascripts/summernote/locales/ta-IN.js → node_modules/summernote/dist/lang/summernote-ta-IN.js} +46 -4
- data/node_modules/summernote/dist/lang/summernote-ta-IN.min.js +3 -0
- data/node_modules/summernote/dist/lang/summernote-th-TH.js +155 -0
- data/node_modules/summernote/dist/lang/summernote-th-TH.min.js +3 -0
- data/{vendor/assets/javascripts/summernote/locales/tr-TR.js → node_modules/summernote/dist/lang/summernote-tr-TR.js} +3 -2
- data/node_modules/summernote/dist/lang/summernote-tr-TR.min.js +3 -0
- data/{vendor/assets/javascripts/summernote/locales/uk-UA.js → node_modules/summernote/dist/lang/summernote-uk-UA.js} +48 -4
- data/node_modules/summernote/dist/lang/summernote-uk-UA.min.js +3 -0
- data/node_modules/summernote/dist/lang/summernote-uz-UZ.js +112 -0
- data/node_modules/summernote/dist/lang/summernote-uz-UZ.min.js +3 -0
- data/{vendor/assets/javascripts/summernote/locales/vi-VN.js → node_modules/summernote/dist/lang/summernote-vi-VN.js} +55 -4
- data/node_modules/summernote/dist/lang/summernote-vi-VN.min.js +3 -0
- data/{vendor/assets/javascripts/summernote/locales/zh-CN.js → node_modules/summernote/dist/lang/summernote-zh-CN.js} +20 -7
- data/node_modules/summernote/dist/lang/summernote-zh-CN.min.js +3 -0
- data/{vendor/assets/javascripts/summernote/locales/zh-TW.js → node_modules/summernote/dist/lang/summernote-zh-TW.js} +45 -3
- data/node_modules/summernote/dist/lang/summernote-zh-TW.min.js +3 -0
- data/node_modules/summernote/dist/summernote-0.8.10-dist.zip +0 -0
- data/node_modules/summernote/dist/summernote-bs4.css +1 -0
- data/node_modules/summernote/dist/summernote-bs4.js +7323 -0
- data/node_modules/summernote/dist/summernote-bs4.js.map +1 -0
- data/node_modules/summernote/dist/summernote-bs4.min.js +3 -0
- data/node_modules/summernote/dist/summernote-lite.css +1 -0
- data/node_modules/summernote/dist/summernote-lite.js +7837 -0
- data/node_modules/summernote/dist/summernote-lite.js.map +1 -0
- data/node_modules/summernote/dist/summernote.css +1 -0
- data/node_modules/summernote/dist/summernote.js +7315 -0
- data/node_modules/summernote/dist/summernote.js.map +1 -0
- data/node_modules/summernote/dist/summernote.min.js +3 -0
- data/node_modules/summernote/examples/airmode.html +35 -0
- data/node_modules/summernote/examples/bs3.html +60 -0
- data/node_modules/summernote/examples/bs4.html +57 -0
- data/node_modules/summernote/examples/codemirror.html +45 -0
- data/node_modules/summernote/examples/external-api.html +76 -0
- data/node_modules/summernote/examples/hint-emoji.html +61 -0
- data/node_modules/summernote/examples/hint-symbols_mathematical-symbols_Greek-letters.html +54 -0
- data/node_modules/summernote/examples/hint-userdefine.html +48 -0
- data/node_modules/summernote/examples/ie8.html +32 -0
- data/node_modules/summernote/examples/jquery-custom-event.html +119 -0
- data/node_modules/summernote/examples/jquery19lt.html +25 -0
- data/node_modules/summernote/examples/lang.html +33 -0
- data/node_modules/summernote/examples/link-blank.html +33 -0
- data/node_modules/summernote/examples/lite.html +24 -0
- data/node_modules/summernote/examples/nativestyle.html +32 -0
- data/node_modules/summernote/examples/ondialog-multitab.html +77 -0
- data/node_modules/summernote/examples/ondialog.html +58 -0
- data/node_modules/summernote/examples/plugin-hello.html +37 -0
- data/node_modules/summernote/examples/rtl.html +32 -0
- data/node_modules/summernote/examples/symbols_mathematical-symbols_Greek-letters.json +1118 -0
- data/node_modules/summernote/examples/textarea.html +46 -0
- data/node_modules/summernote/examples/toolbar-container.html +35 -0
- data/node_modules/summernote/examples/with-google-font.html +50 -0
- data/node_modules/summernote/index.html +33 -0
- data/node_modules/summernote/karma.conf.js +42 -0
- data/node_modules/summernote/lang/summernote-ar-AR.js +155 -0
- data/node_modules/summernote/lang/summernote-bg-BG.js +155 -0
- data/node_modules/summernote/lang/summernote-ca-ES.js +155 -0
- data/node_modules/summernote/lang/summernote-cs-CZ.js +149 -0
- data/node_modules/summernote/lang/summernote-da-DK.js +155 -0
- data/node_modules/summernote/lang/summernote-de-DE.js +154 -0
- data/node_modules/summernote/lang/summernote-el-GR.js +155 -0
- data/node_modules/summernote/lang/summernote-es-ES.js +155 -0
- data/node_modules/summernote/lang/summernote-es-EU.js +154 -0
- data/node_modules/summernote/lang/summernote-fa-IR.js +155 -0
- data/node_modules/summernote/lang/summernote-fi-FI.js +153 -0
- data/node_modules/summernote/lang/summernote-fr-FR.js +155 -0
- data/node_modules/summernote/lang/summernote-gl-ES.js +155 -0
- data/node_modules/summernote/lang/summernote-he-IL.js +155 -0
- data/node_modules/summernote/lang/summernote-hr-HR.js +155 -0
- data/node_modules/summernote/lang/summernote-hu-HU.js +155 -0
- data/node_modules/summernote/lang/summernote-id-ID.js +155 -0
- data/node_modules/summernote/lang/summernote-it-IT.js +155 -0
- data/node_modules/summernote/lang/summernote-ja-JP.js +155 -0
- data/node_modules/summernote/lang/summernote-ko-KR.js +155 -0
- data/node_modules/summernote/lang/summernote-lt-LT.js +155 -0
- data/node_modules/summernote/lang/summernote-lt-LV.js +155 -0
- data/node_modules/summernote/lang/summernote-mn-MN.js +157 -0
- data/node_modules/summernote/lang/summernote-nb-NO.js +154 -0
- data/node_modules/summernote/lang/summernote-nl-NL.js +155 -0
- data/node_modules/summernote/lang/summernote-pl-PL.js +155 -0
- data/node_modules/summernote/lang/summernote-pt-BR.js +155 -0
- data/node_modules/summernote/lang/summernote-pt-PT.js +154 -0
- data/node_modules/summernote/lang/summernote-ro-RO.js +155 -0
- data/node_modules/summernote/lang/summernote-ru-RU.js +155 -0
- data/node_modules/summernote/lang/summernote-sk-SK.js +153 -0
- data/node_modules/summernote/lang/summernote-sl-SI.js +155 -0
- data/node_modules/summernote/lang/summernote-sr-RS-Latin.js +155 -0
- data/node_modules/summernote/lang/summernote-sr-RS.js +155 -0
- data/node_modules/summernote/lang/summernote-sv-SE.js +155 -0
- data/node_modules/summernote/lang/summernote-ta-IN.js +155 -0
- data/node_modules/summernote/lang/summernote-th-TH.js +155 -0
- data/node_modules/summernote/lang/summernote-tr-TR.js +155 -0
- data/node_modules/summernote/lang/summernote-uk-UA.js +155 -0
- data/node_modules/summernote/lang/summernote-uz-UZ.js +112 -0
- data/node_modules/summernote/lang/summernote-vi-VN.js +155 -0
- data/node_modules/summernote/lang/summernote-zh-CN.js +155 -0
- data/node_modules/summernote/lang/summernote-zh-TW.js +155 -0
- data/node_modules/summernote/package.json +87 -0
- data/{vendor/assets/javascripts → node_modules}/summernote/plugin/databasic/summernote-ext-databasic.css +0 -0
- data/{vendor/assets/javascripts → node_modules}/summernote/plugin/databasic/summernote-ext-databasic.js +62 -73
- data/{vendor/assets/javascripts → node_modules}/summernote/plugin/hello/summernote-ext-hello.js +9 -10
- data/{vendor/assets/javascripts → node_modules}/summernote/plugin/specialchars/summernote-ext-specialchars.js +22 -25
- data/node_modules/summernote/src/icons/align-center.svg +11 -0
- data/node_modules/summernote/src/icons/align-indent.svg +11 -0
- data/node_modules/summernote/src/icons/align-justify.svg +11 -0
- data/node_modules/summernote/src/icons/align-left.svg +12 -0
- data/node_modules/summernote/src/icons/align-outdent.svg +11 -0
- data/node_modules/summernote/src/icons/align-right.svg +11 -0
- data/node_modules/summernote/src/icons/align.svg +8 -0
- data/node_modules/summernote/src/icons/arrow-circle-down.svg +1 -0
- data/node_modules/summernote/src/icons/arrow-circle-left.svg +1 -0
- data/node_modules/summernote/src/icons/arrow-circle-right.svg +1 -0
- data/node_modules/summernote/src/icons/arrow-circle-up.svg +1 -0
- data/node_modules/summernote/src/icons/arrows-alt.svg +11 -0
- data/node_modules/summernote/src/icons/arrows-h.svg +1 -0
- data/node_modules/summernote/src/icons/arrows-v.svg +1 -0
- data/node_modules/summernote/src/icons/bold.svg +11 -0
- data/node_modules/summernote/src/icons/caret.svg +9 -0
- data/node_modules/summernote/src/icons/chain-broken.svg +47 -0
- data/node_modules/summernote/src/icons/circle.svg +10 -0
- data/node_modules/summernote/src/icons/close.svg +16 -0
- data/node_modules/summernote/src/icons/code.svg +11 -0
- data/node_modules/summernote/src/icons/col-after.svg +96 -0
- data/node_modules/summernote/src/icons/col-before.svg +19 -0
- data/node_modules/summernote/src/icons/col-remove.svg +19 -0
- 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 +536 -0
- data/node_modules/summernote/src/icons/dist/summernote.less +511 -0
- data/node_modules/summernote/src/icons/eraser.svg +13 -0
- data/node_modules/summernote/src/icons/font.svg +11 -0
- data/node_modules/summernote/src/icons/frame.svg +10 -0
- data/node_modules/summernote/src/icons/italic.svg +11 -0
- data/node_modules/summernote/src/icons/link.svg +21 -0
- data/node_modules/summernote/src/icons/magic.svg +10 -0
- data/node_modules/summernote/src/icons/menu-check.svg +8 -0
- data/node_modules/summernote/src/icons/minus.svg +11 -0
- data/node_modules/summernote/src/icons/orderedlist.svg +12 -0
- data/node_modules/summernote/src/icons/pencil.svg +8 -0
- data/node_modules/summernote/src/icons/picture.svg +11 -0
- data/node_modules/summernote/src/icons/question.svg +10 -0
- data/node_modules/summernote/src/icons/redo.svg +10 -0
- data/node_modules/summernote/src/icons/row-above.svg +19 -0
- data/node_modules/summernote/src/icons/row-below.svg +19 -0
- data/node_modules/summernote/src/icons/row-remove.svg +19 -0
- data/node_modules/summernote/src/icons/special-character.svg +10 -0
- data/node_modules/summernote/src/icons/square.svg +10 -0
- data/node_modules/summernote/src/icons/strikethrough.svg +11 -0
- data/node_modules/summernote/src/icons/subscript.svg +11 -0
- data/node_modules/summernote/src/icons/summernote.svg +11 -0
- data/node_modules/summernote/src/icons/superscript.svg +11 -0
- data/node_modules/summernote/src/icons/table.svg +11 -0
- data/node_modules/summernote/src/icons/templates/summernote.css +110 -0
- data/node_modules/summernote/src/icons/templates/summernote.json +5 -0
- data/node_modules/summernote/src/icons/text-height.svg +11 -0
- data/node_modules/summernote/src/icons/trash.svg +17 -0
- data/node_modules/summernote/src/icons/underline.svg +11 -0
- data/node_modules/summernote/src/icons/undo.svg +10 -0
- data/node_modules/summernote/src/icons/unorderedlist.svg +9 -0
- data/node_modules/summernote/src/icons/video.svg +9 -0
- data/node_modules/summernote/src/js/base/Context.js +231 -0
- data/node_modules/summernote/src/js/base/core/async.js +47 -0
- data/node_modules/summernote/src/js/base/core/dom.js +1088 -0
- data/node_modules/summernote/src/js/base/core/env.js +107 -0
- data/node_modules/summernote/src/js/base/core/func.js +162 -0
- data/node_modules/summernote/src/js/base/core/key.js +92 -0
- data/node_modules/summernote/src/js/base/core/lists.js +210 -0
- data/node_modules/summernote/src/js/base/core/range.js +792 -0
- data/node_modules/summernote/src/js/base/editing/Bullet.js +201 -0
- data/node_modules/summernote/src/js/base/editing/History.js +105 -0
- data/node_modules/summernote/src/js/base/editing/Style.js +158 -0
- data/node_modules/summernote/src/js/base/editing/Table.js +574 -0
- data/node_modules/summernote/src/js/base/editing/Typing.js +90 -0
- data/node_modules/summernote/src/js/base/module/AirPopover.js +73 -0
- data/node_modules/summernote/src/js/base/module/AutoLink.js +61 -0
- data/node_modules/summernote/src/js/base/module/AutoSync.js +19 -0
- data/node_modules/summernote/src/js/base/module/Buttons.js +813 -0
- data/node_modules/summernote/src/js/base/module/Clipboard.js +28 -0
- data/node_modules/summernote/src/js/base/module/Codeview.js +123 -0
- data/node_modules/summernote/src/js/base/module/Dropzone.js +115 -0
- data/node_modules/summernote/src/js/base/module/Editor.js +861 -0
- data/node_modules/summernote/src/js/base/module/Fullscreen.js +51 -0
- data/node_modules/summernote/src/js/base/module/Handle.js +143 -0
- data/node_modules/summernote/src/js/base/module/HelpDialog.js +79 -0
- data/node_modules/summernote/src/js/base/module/HintPopover.js +226 -0
- data/node_modules/summernote/src/js/base/module/ImageDialog.js +131 -0
- data/node_modules/summernote/src/js/base/module/ImagePopover.js +58 -0
- data/node_modules/summernote/src/js/base/module/LinkDialog.js +174 -0
- data/node_modules/summernote/src/js/base/module/LinkPopover.js +69 -0
- data/node_modules/summernote/src/js/base/module/Placeholder.js +39 -0
- data/node_modules/summernote/src/js/base/module/Statusbar.js +42 -0
- data/node_modules/summernote/src/js/base/module/TablePopover.js +71 -0
- data/node_modules/summernote/src/js/base/module/Toolbar.js +136 -0
- data/node_modules/summernote/src/js/base/module/VideoDialog.js +205 -0
- data/node_modules/summernote/src/js/base/renderer.js +66 -0
- data/node_modules/summernote/src/js/base/summernote-en-US.js +159 -0
- data/node_modules/summernote/src/js/bs3/settings.js +297 -0
- data/node_modules/summernote/src/js/bs3/ui.js +237 -0
- data/node_modules/summernote/src/js/bs4/settings.js +301 -0
- data/node_modules/summernote/src/js/bs4/ui.js +242 -0
- data/node_modules/summernote/src/js/lite/settings.js +296 -0
- data/node_modules/summernote/src/js/lite/ui.js +618 -0
- data/node_modules/summernote/src/js/lite/ui/DropdownUI.js +65 -0
- data/node_modules/summernote/src/js/lite/ui/ModalUI.js +34 -0
- data/node_modules/summernote/src/js/lite/ui/PopoverUI.js +94 -0
- data/node_modules/summernote/src/js/lite/ui/TooltipUI.js +93 -0
- data/node_modules/summernote/src/js/summernote.js +46 -0
- data/node_modules/summernote/src/less/elements.less +149 -0
- data/node_modules/summernote/src/less/elements.scss +149 -0
- data/node_modules/summernote/src/less/lite-ui/all.less +15 -0
- data/node_modules/summernote/src/less/lite-ui/btn-group.less +51 -0
- data/node_modules/summernote/src/less/lite-ui/buttons.less +102 -0
- data/node_modules/summernote/src/less/lite-ui/common.less +20 -0
- data/node_modules/summernote/src/less/lite-ui/dropdown.less +39 -0
- data/node_modules/summernote/src/less/lite-ui/form.less +43 -0
- data/node_modules/summernote/src/less/lite-ui/mixins.less +1 -0
- data/node_modules/summernote/src/less/lite-ui/mixins/buttons.less +40 -0
- data/node_modules/summernote/src/less/lite-ui/modal.less +104 -0
- data/node_modules/summernote/src/less/lite-ui/popover.less +121 -0
- data/node_modules/summernote/src/less/lite-ui/toolbar.less +4 -0
- data/node_modules/summernote/src/less/lite-ui/tooltip.less +66 -0
- data/node_modules/summernote/src/less/lite-ui/variables.less +81 -0
- data/node_modules/summernote/src/less/summernote-bs4.less +577 -0
- data/node_modules/summernote/src/less/summernote-bs4.scss +560 -0
- data/node_modules/summernote/src/less/summernote-lite.less +601 -0
- data/node_modules/summernote/src/less/summernote.less +576 -0
- data/node_modules/summernote/src/less/summernote.scss +560 -0
- data/node_modules/summernote/tsconfig.json +12 -0
- metadata +459 -69
- data/vendor/assets/fonts/summernote.eot +0 -0
- data/vendor/assets/fonts/summernote.ttf +0 -0
- data/vendor/assets/fonts/summernote.woff +0 -0
- data/vendor/assets/javascripts/summernote/index.js +0 -1
- data/vendor/assets/javascripts/summernote/locales/index.js +0 -1
- data/vendor/assets/javascripts/summernote/locales/ro-RO.js +0 -102
- data/vendor/assets/javascripts/summernote/locales/th-TH.js +0 -106
- data/vendor/assets/javascripts/summernote/summernote-bs4.js +0 -7990
- data/vendor/assets/javascripts/summernote/summernote-lite.js +0 -8598
- data/vendor/assets/javascripts/summernote/summernote.js +0 -7987
- data/vendor/assets/stylesheets/summernote-bs4.css +0 -1
- data/vendor/assets/stylesheets/summernote-lite.css +0 -1
- data/vendor/assets/stylesheets/summernote.scss +0 -1
@@ -0,0 +1,574 @@
|
|
1
|
+
import $ from 'jquery';
|
2
|
+
import dom from '../core/dom';
|
3
|
+
import range from '../core/range';
|
4
|
+
import lists from '../core/lists';
|
5
|
+
|
6
|
+
/**
|
7
|
+
* @class Create a virtual table to create what actions to do in change.
|
8
|
+
* @param {object} startPoint Cell selected to apply change.
|
9
|
+
* @param {enum} where Where change will be applied Row or Col. Use enum: TableResultAction.where
|
10
|
+
* @param {enum} action Action to be applied. Use enum: TableResultAction.requestAction
|
11
|
+
* @param {object} domTable Dom element of table to make changes.
|
12
|
+
*/
|
13
|
+
const TableResultAction = function(startPoint, where, action, domTable) {
|
14
|
+
const _startPoint = { 'colPos': 0, 'rowPos': 0 };
|
15
|
+
const _virtualTable = [];
|
16
|
+
const _actionCellList = [];
|
17
|
+
|
18
|
+
/// ///////////////////////////////////////////
|
19
|
+
// Private functions
|
20
|
+
/// ///////////////////////////////////////////
|
21
|
+
|
22
|
+
/**
|
23
|
+
* Set the startPoint of action.
|
24
|
+
*/
|
25
|
+
function setStartPoint() {
|
26
|
+
if (!startPoint || !startPoint.tagName || (startPoint.tagName.toLowerCase() !== 'td' && startPoint.tagName.toLowerCase() !== 'th')) {
|
27
|
+
console.error('Impossible to identify start Cell point.', startPoint);
|
28
|
+
return;
|
29
|
+
}
|
30
|
+
_startPoint.colPos = startPoint.cellIndex;
|
31
|
+
if (!startPoint.parentElement || !startPoint.parentElement.tagName || startPoint.parentElement.tagName.toLowerCase() !== 'tr') {
|
32
|
+
console.error('Impossible to identify start Row point.', startPoint);
|
33
|
+
return;
|
34
|
+
}
|
35
|
+
_startPoint.rowPos = startPoint.parentElement.rowIndex;
|
36
|
+
}
|
37
|
+
|
38
|
+
/**
|
39
|
+
* Define virtual table position info object.
|
40
|
+
*
|
41
|
+
* @param {int} rowIndex Index position in line of virtual table.
|
42
|
+
* @param {int} cellIndex Index position in column of virtual table.
|
43
|
+
* @param {object} baseRow Row affected by this position.
|
44
|
+
* @param {object} baseCell Cell affected by this position.
|
45
|
+
* @param {bool} isSpan Inform if it is an span cell/row.
|
46
|
+
*/
|
47
|
+
function setVirtualTablePosition(rowIndex, cellIndex, baseRow, baseCell, isRowSpan, isColSpan, isVirtualCell) {
|
48
|
+
const objPosition = {
|
49
|
+
'baseRow': baseRow,
|
50
|
+
'baseCell': baseCell,
|
51
|
+
'isRowSpan': isRowSpan,
|
52
|
+
'isColSpan': isColSpan,
|
53
|
+
'isVirtual': isVirtualCell
|
54
|
+
};
|
55
|
+
if (!_virtualTable[rowIndex]) {
|
56
|
+
_virtualTable[rowIndex] = [];
|
57
|
+
}
|
58
|
+
_virtualTable[rowIndex][cellIndex] = objPosition;
|
59
|
+
}
|
60
|
+
|
61
|
+
/**
|
62
|
+
* Create action cell object.
|
63
|
+
*
|
64
|
+
* @param {object} virtualTableCellObj Object of specific position on virtual table.
|
65
|
+
* @param {enum} resultAction Action to be applied in that item.
|
66
|
+
*/
|
67
|
+
function getActionCell(virtualTableCellObj, resultAction, virtualRowPosition, virtualColPosition) {
|
68
|
+
return {
|
69
|
+
'baseCell': virtualTableCellObj.baseCell,
|
70
|
+
'action': resultAction,
|
71
|
+
'virtualTable': {
|
72
|
+
'rowIndex': virtualRowPosition,
|
73
|
+
'cellIndex': virtualColPosition
|
74
|
+
}
|
75
|
+
};
|
76
|
+
}
|
77
|
+
|
78
|
+
/**
|
79
|
+
* Recover free index of row to append Cell.
|
80
|
+
*
|
81
|
+
* @param {int} rowIndex Index of row to find free space.
|
82
|
+
* @param {int} cellIndex Index of cell to find free space in table.
|
83
|
+
*/
|
84
|
+
function recoverCellIndex(rowIndex, cellIndex) {
|
85
|
+
if (!_virtualTable[rowIndex]) {
|
86
|
+
return cellIndex;
|
87
|
+
}
|
88
|
+
if (!_virtualTable[rowIndex][cellIndex]) {
|
89
|
+
return cellIndex;
|
90
|
+
}
|
91
|
+
|
92
|
+
let newCellIndex = cellIndex;
|
93
|
+
while (_virtualTable[rowIndex][newCellIndex]) {
|
94
|
+
newCellIndex++;
|
95
|
+
if (!_virtualTable[rowIndex][newCellIndex]) {
|
96
|
+
return newCellIndex;
|
97
|
+
}
|
98
|
+
}
|
99
|
+
}
|
100
|
+
|
101
|
+
/**
|
102
|
+
* Recover info about row and cell and add information to virtual table.
|
103
|
+
*
|
104
|
+
* @param {object} row Row to recover information.
|
105
|
+
* @param {object} cell Cell to recover information.
|
106
|
+
*/
|
107
|
+
function addCellInfoToVirtual(row, cell) {
|
108
|
+
const cellIndex = recoverCellIndex(row.rowIndex, cell.cellIndex);
|
109
|
+
const cellHasColspan = (cell.colSpan > 1);
|
110
|
+
const cellHasRowspan = (cell.rowSpan > 1);
|
111
|
+
const isThisSelectedCell = (row.rowIndex === _startPoint.rowPos && cell.cellIndex === _startPoint.colPos);
|
112
|
+
setVirtualTablePosition(row.rowIndex, cellIndex, row, cell, cellHasRowspan, cellHasColspan, false);
|
113
|
+
|
114
|
+
// Add span rows to virtual Table.
|
115
|
+
const rowspanNumber = cell.attributes.rowSpan ? parseInt(cell.attributes.rowSpan.value, 10) : 0;
|
116
|
+
if (rowspanNumber > 1) {
|
117
|
+
for (let rp = 1; rp < rowspanNumber; rp++) {
|
118
|
+
const rowspanIndex = row.rowIndex + rp;
|
119
|
+
adjustStartPoint(rowspanIndex, cellIndex, cell, isThisSelectedCell);
|
120
|
+
setVirtualTablePosition(rowspanIndex, cellIndex, row, cell, true, cellHasColspan, true);
|
121
|
+
}
|
122
|
+
}
|
123
|
+
|
124
|
+
// Add span cols to virtual table.
|
125
|
+
const colspanNumber = cell.attributes.colSpan ? parseInt(cell.attributes.colSpan.value, 10) : 0;
|
126
|
+
if (colspanNumber > 1) {
|
127
|
+
for (let cp = 1; cp < colspanNumber; cp++) {
|
128
|
+
const cellspanIndex = recoverCellIndex(row.rowIndex, (cellIndex + cp));
|
129
|
+
adjustStartPoint(row.rowIndex, cellspanIndex, cell, isThisSelectedCell);
|
130
|
+
setVirtualTablePosition(row.rowIndex, cellspanIndex, row, cell, cellHasRowspan, true, true);
|
131
|
+
}
|
132
|
+
}
|
133
|
+
}
|
134
|
+
|
135
|
+
/**
|
136
|
+
* Process validation and adjust of start point if needed
|
137
|
+
*
|
138
|
+
* @param {int} rowIndex
|
139
|
+
* @param {int} cellIndex
|
140
|
+
* @param {object} cell
|
141
|
+
* @param {bool} isSelectedCell
|
142
|
+
*/
|
143
|
+
function adjustStartPoint(rowIndex, cellIndex, cell, isSelectedCell) {
|
144
|
+
if (rowIndex === _startPoint.rowPos && _startPoint.colPos >= cell.cellIndex && cell.cellIndex <= cellIndex && !isSelectedCell) {
|
145
|
+
_startPoint.colPos++;
|
146
|
+
}
|
147
|
+
}
|
148
|
+
|
149
|
+
/**
|
150
|
+
* Create virtual table of cells with all cells, including span cells.
|
151
|
+
*/
|
152
|
+
function createVirtualTable() {
|
153
|
+
const rows = domTable.rows;
|
154
|
+
for (let rowIndex = 0; rowIndex < rows.length; rowIndex++) {
|
155
|
+
const cells = rows[rowIndex].cells;
|
156
|
+
for (let cellIndex = 0; cellIndex < cells.length; cellIndex++) {
|
157
|
+
addCellInfoToVirtual(rows[rowIndex], cells[cellIndex]);
|
158
|
+
}
|
159
|
+
}
|
160
|
+
}
|
161
|
+
|
162
|
+
/**
|
163
|
+
* Get action to be applied on the cell.
|
164
|
+
*
|
165
|
+
* @param {object} cell virtual table cell to apply action
|
166
|
+
*/
|
167
|
+
function getDeleteResultActionToCell(cell) {
|
168
|
+
switch (where) {
|
169
|
+
case TableResultAction.where.Column:
|
170
|
+
if (cell.isColSpan) {
|
171
|
+
return TableResultAction.resultAction.SubtractSpanCount;
|
172
|
+
}
|
173
|
+
break;
|
174
|
+
case TableResultAction.where.Row:
|
175
|
+
if (!cell.isVirtual && cell.isRowSpan) {
|
176
|
+
return TableResultAction.resultAction.AddCell;
|
177
|
+
} else if (cell.isRowSpan) {
|
178
|
+
return TableResultAction.resultAction.SubtractSpanCount;
|
179
|
+
}
|
180
|
+
break;
|
181
|
+
}
|
182
|
+
return TableResultAction.resultAction.RemoveCell;
|
183
|
+
}
|
184
|
+
|
185
|
+
/**
|
186
|
+
* Get action to be applied on the cell.
|
187
|
+
*
|
188
|
+
* @param {object} cell virtual table cell to apply action
|
189
|
+
*/
|
190
|
+
function getAddResultActionToCell(cell) {
|
191
|
+
switch (where) {
|
192
|
+
case TableResultAction.where.Column:
|
193
|
+
if (cell.isColSpan) {
|
194
|
+
return TableResultAction.resultAction.SumSpanCount;
|
195
|
+
} else if (cell.isRowSpan && cell.isVirtual) {
|
196
|
+
return TableResultAction.resultAction.Ignore;
|
197
|
+
}
|
198
|
+
break;
|
199
|
+
case TableResultAction.where.Row:
|
200
|
+
if (cell.isRowSpan) {
|
201
|
+
return TableResultAction.resultAction.SumSpanCount;
|
202
|
+
} else if (cell.isColSpan && cell.isVirtual) {
|
203
|
+
return TableResultAction.resultAction.Ignore;
|
204
|
+
}
|
205
|
+
break;
|
206
|
+
}
|
207
|
+
return TableResultAction.resultAction.AddCell;
|
208
|
+
}
|
209
|
+
|
210
|
+
function init() {
|
211
|
+
setStartPoint();
|
212
|
+
createVirtualTable();
|
213
|
+
}
|
214
|
+
|
215
|
+
/// ///////////////////////////////////////////
|
216
|
+
// Public functions
|
217
|
+
/// ///////////////////////////////////////////
|
218
|
+
|
219
|
+
/**
|
220
|
+
* Recover array os what to do in table.
|
221
|
+
*/
|
222
|
+
this.getActionList = function() {
|
223
|
+
const fixedRow = (where === TableResultAction.where.Row) ? _startPoint.rowPos : -1;
|
224
|
+
const fixedCol = (where === TableResultAction.where.Column) ? _startPoint.colPos : -1;
|
225
|
+
|
226
|
+
let actualPosition = 0;
|
227
|
+
let canContinue = true;
|
228
|
+
while (canContinue) {
|
229
|
+
const rowPosition = (fixedRow >= 0) ? fixedRow : actualPosition;
|
230
|
+
const colPosition = (fixedCol >= 0) ? fixedCol : actualPosition;
|
231
|
+
const row = _virtualTable[rowPosition];
|
232
|
+
if (!row) {
|
233
|
+
canContinue = false;
|
234
|
+
return _actionCellList;
|
235
|
+
}
|
236
|
+
const cell = row[colPosition];
|
237
|
+
if (!cell) {
|
238
|
+
canContinue = false;
|
239
|
+
return _actionCellList;
|
240
|
+
}
|
241
|
+
|
242
|
+
// Define action to be applied in this cell
|
243
|
+
let resultAction = TableResultAction.resultAction.Ignore;
|
244
|
+
switch (action) {
|
245
|
+
case TableResultAction.requestAction.Add:
|
246
|
+
resultAction = getAddResultActionToCell(cell);
|
247
|
+
break;
|
248
|
+
case TableResultAction.requestAction.Delete:
|
249
|
+
resultAction = getDeleteResultActionToCell(cell);
|
250
|
+
break;
|
251
|
+
}
|
252
|
+
_actionCellList.push(getActionCell(cell, resultAction, rowPosition, colPosition));
|
253
|
+
actualPosition++;
|
254
|
+
}
|
255
|
+
|
256
|
+
return _actionCellList;
|
257
|
+
};
|
258
|
+
|
259
|
+
init();
|
260
|
+
};
|
261
|
+
/**
|
262
|
+
*
|
263
|
+
* Where action occours enum.
|
264
|
+
*/
|
265
|
+
TableResultAction.where = { 'Row': 0, 'Column': 1 };
|
266
|
+
/**
|
267
|
+
*
|
268
|
+
* Requested action to apply enum.
|
269
|
+
*/
|
270
|
+
TableResultAction.requestAction = { 'Add': 0, 'Delete': 1 };
|
271
|
+
/**
|
272
|
+
*
|
273
|
+
* Result action to be executed enum.
|
274
|
+
*/
|
275
|
+
TableResultAction.resultAction = { 'Ignore': 0, 'SubtractSpanCount': 1, 'RemoveCell': 2, 'AddCell': 3, 'SumSpanCount': 4 };
|
276
|
+
|
277
|
+
/**
|
278
|
+
*
|
279
|
+
* @class editing.Table
|
280
|
+
*
|
281
|
+
* Table
|
282
|
+
*
|
283
|
+
*/
|
284
|
+
export default class Table {
|
285
|
+
/**
|
286
|
+
* handle tab key
|
287
|
+
*
|
288
|
+
* @param {WrappedRange} rng
|
289
|
+
* @param {Boolean} isShift
|
290
|
+
*/
|
291
|
+
tab(rng, isShift) {
|
292
|
+
const cell = dom.ancestor(rng.commonAncestor(), dom.isCell);
|
293
|
+
const table = dom.ancestor(cell, dom.isTable);
|
294
|
+
const cells = dom.listDescendant(table, dom.isCell);
|
295
|
+
|
296
|
+
const nextCell = lists[isShift ? 'prev' : 'next'](cells, cell);
|
297
|
+
if (nextCell) {
|
298
|
+
range.create(nextCell, 0).select();
|
299
|
+
}
|
300
|
+
}
|
301
|
+
|
302
|
+
/**
|
303
|
+
* Add a new row
|
304
|
+
*
|
305
|
+
* @param {WrappedRange} rng
|
306
|
+
* @param {String} position (top/bottom)
|
307
|
+
* @return {Node}
|
308
|
+
*/
|
309
|
+
addRow(rng, position) {
|
310
|
+
const cell = dom.ancestor(rng.commonAncestor(), dom.isCell);
|
311
|
+
|
312
|
+
const currentTr = $(cell).closest('tr');
|
313
|
+
const trAttributes = this.recoverAttributes(currentTr);
|
314
|
+
const html = $('<tr' + trAttributes + '></tr>');
|
315
|
+
|
316
|
+
const vTable = new TableResultAction(cell, TableResultAction.where.Row,
|
317
|
+
TableResultAction.requestAction.Add, $(currentTr).closest('table')[0]);
|
318
|
+
const actions = vTable.getActionList();
|
319
|
+
|
320
|
+
for (let idCell = 0; idCell < actions.length; idCell++) {
|
321
|
+
const currentCell = actions[idCell];
|
322
|
+
const tdAttributes = this.recoverAttributes(currentCell.baseCell);
|
323
|
+
switch (currentCell.action) {
|
324
|
+
case TableResultAction.resultAction.AddCell:
|
325
|
+
html.append('<td' + tdAttributes + '>' + dom.blank + '</td>');
|
326
|
+
break;
|
327
|
+
case TableResultAction.resultAction.SumSpanCount:
|
328
|
+
if (position === 'top') {
|
329
|
+
const baseCellTr = currentCell.baseCell.parent;
|
330
|
+
const isTopFromRowSpan = (!baseCellTr ? 0 : currentCell.baseCell.closest('tr').rowIndex) <= currentTr[0].rowIndex;
|
331
|
+
if (isTopFromRowSpan) {
|
332
|
+
const newTd = $('<div></div>').append($('<td' + tdAttributes + '>' + dom.blank + '</td>').removeAttr('rowspan')).html();
|
333
|
+
html.append(newTd);
|
334
|
+
break;
|
335
|
+
}
|
336
|
+
}
|
337
|
+
let rowspanNumber = parseInt(currentCell.baseCell.rowSpan, 10);
|
338
|
+
rowspanNumber++;
|
339
|
+
currentCell.baseCell.setAttribute('rowSpan', rowspanNumber);
|
340
|
+
break;
|
341
|
+
}
|
342
|
+
}
|
343
|
+
|
344
|
+
if (position === 'top') {
|
345
|
+
currentTr.before(html);
|
346
|
+
} else {
|
347
|
+
const cellHasRowspan = (cell.rowSpan > 1);
|
348
|
+
if (cellHasRowspan) {
|
349
|
+
const lastTrIndex = currentTr[0].rowIndex + (cell.rowSpan - 2);
|
350
|
+
$($(currentTr).parent().find('tr')[lastTrIndex]).after($(html));
|
351
|
+
return;
|
352
|
+
}
|
353
|
+
currentTr.after(html);
|
354
|
+
}
|
355
|
+
}
|
356
|
+
|
357
|
+
/**
|
358
|
+
* Add a new col
|
359
|
+
*
|
360
|
+
* @param {WrappedRange} rng
|
361
|
+
* @param {String} position (left/right)
|
362
|
+
* @return {Node}
|
363
|
+
*/
|
364
|
+
addCol(rng, position) {
|
365
|
+
const cell = dom.ancestor(rng.commonAncestor(), dom.isCell);
|
366
|
+
const row = $(cell).closest('tr');
|
367
|
+
const rowsGroup = $(row).siblings();
|
368
|
+
rowsGroup.push(row);
|
369
|
+
|
370
|
+
const vTable = new TableResultAction(cell, TableResultAction.where.Column,
|
371
|
+
TableResultAction.requestAction.Add, $(row).closest('table')[0]);
|
372
|
+
const actions = vTable.getActionList();
|
373
|
+
|
374
|
+
for (let actionIndex = 0; actionIndex < actions.length; actionIndex++) {
|
375
|
+
const currentCell = actions[actionIndex];
|
376
|
+
const tdAttributes = this.recoverAttributes(currentCell.baseCell);
|
377
|
+
switch (currentCell.action) {
|
378
|
+
case TableResultAction.resultAction.AddCell:
|
379
|
+
if (position === 'right') {
|
380
|
+
$(currentCell.baseCell).after('<td' + tdAttributes + '>' + dom.blank + '</td>');
|
381
|
+
} else {
|
382
|
+
$(currentCell.baseCell).before('<td' + tdAttributes + '>' + dom.blank + '</td>');
|
383
|
+
}
|
384
|
+
break;
|
385
|
+
case TableResultAction.resultAction.SumSpanCount:
|
386
|
+
if (position === 'right') {
|
387
|
+
let colspanNumber = parseInt(currentCell.baseCell.colSpan, 10);
|
388
|
+
colspanNumber++;
|
389
|
+
currentCell.baseCell.setAttribute('colSpan', colspanNumber);
|
390
|
+
} else {
|
391
|
+
$(currentCell.baseCell).before('<td' + tdAttributes + '>' + dom.blank + '</td>');
|
392
|
+
}
|
393
|
+
break;
|
394
|
+
}
|
395
|
+
}
|
396
|
+
}
|
397
|
+
|
398
|
+
/*
|
399
|
+
* Copy attributes from element.
|
400
|
+
*
|
401
|
+
* @param {object} Element to recover attributes.
|
402
|
+
* @return {string} Copied string elements.
|
403
|
+
*/
|
404
|
+
recoverAttributes(el) {
|
405
|
+
let resultStr = '';
|
406
|
+
|
407
|
+
if (!el) {
|
408
|
+
return resultStr;
|
409
|
+
}
|
410
|
+
|
411
|
+
const attrList = el.attributes || [];
|
412
|
+
|
413
|
+
for (let i = 0; i < attrList.length; i++) {
|
414
|
+
if (attrList[i].name.toLowerCase() === 'id') {
|
415
|
+
continue;
|
416
|
+
}
|
417
|
+
|
418
|
+
if (attrList[i].specified) {
|
419
|
+
resultStr += ' ' + attrList[i].name + '=\'' + attrList[i].value + '\'';
|
420
|
+
}
|
421
|
+
}
|
422
|
+
|
423
|
+
return resultStr;
|
424
|
+
}
|
425
|
+
|
426
|
+
/**
|
427
|
+
* Delete current row
|
428
|
+
*
|
429
|
+
* @param {WrappedRange} rng
|
430
|
+
* @return {Node}
|
431
|
+
*/
|
432
|
+
deleteRow(rng) {
|
433
|
+
const cell = dom.ancestor(rng.commonAncestor(), dom.isCell);
|
434
|
+
const row = $(cell).closest('tr');
|
435
|
+
const cellPos = row.children('td, th').index($(cell));
|
436
|
+
const rowPos = row[0].rowIndex;
|
437
|
+
|
438
|
+
const vTable = new TableResultAction(cell, TableResultAction.where.Row,
|
439
|
+
TableResultAction.requestAction.Delete, $(row).closest('table')[0]);
|
440
|
+
const actions = vTable.getActionList();
|
441
|
+
|
442
|
+
for (let actionIndex = 0; actionIndex < actions.length; actionIndex++) {
|
443
|
+
if (!actions[actionIndex]) {
|
444
|
+
continue;
|
445
|
+
}
|
446
|
+
|
447
|
+
const baseCell = actions[actionIndex].baseCell;
|
448
|
+
const virtualPosition = actions[actionIndex].virtualTable;
|
449
|
+
const hasRowspan = (baseCell.rowSpan && baseCell.rowSpan > 1);
|
450
|
+
let rowspanNumber = (hasRowspan) ? parseInt(baseCell.rowSpan, 10) : 0;
|
451
|
+
switch (actions[actionIndex].action) {
|
452
|
+
case TableResultAction.resultAction.Ignore:
|
453
|
+
continue;
|
454
|
+
case TableResultAction.resultAction.AddCell:
|
455
|
+
const nextRow = row.next('tr')[0];
|
456
|
+
if (!nextRow) { continue; }
|
457
|
+
const cloneRow = row[0].cells[cellPos];
|
458
|
+
if (hasRowspan) {
|
459
|
+
if (rowspanNumber > 2) {
|
460
|
+
rowspanNumber--;
|
461
|
+
nextRow.insertBefore(cloneRow, nextRow.cells[cellPos]);
|
462
|
+
nextRow.cells[cellPos].setAttribute('rowSpan', rowspanNumber);
|
463
|
+
nextRow.cells[cellPos].innerHTML = '';
|
464
|
+
} else if (rowspanNumber === 2) {
|
465
|
+
nextRow.insertBefore(cloneRow, nextRow.cells[cellPos]);
|
466
|
+
nextRow.cells[cellPos].removeAttribute('rowSpan');
|
467
|
+
nextRow.cells[cellPos].innerHTML = '';
|
468
|
+
}
|
469
|
+
}
|
470
|
+
continue;
|
471
|
+
case TableResultAction.resultAction.SubtractSpanCount:
|
472
|
+
if (hasRowspan) {
|
473
|
+
if (rowspanNumber > 2) {
|
474
|
+
rowspanNumber--;
|
475
|
+
baseCell.setAttribute('rowSpan', rowspanNumber);
|
476
|
+
if (virtualPosition.rowIndex !== rowPos && baseCell.cellIndex === cellPos) { baseCell.innerHTML = ''; }
|
477
|
+
} else if (rowspanNumber === 2) {
|
478
|
+
baseCell.removeAttribute('rowSpan');
|
479
|
+
if (virtualPosition.rowIndex !== rowPos && baseCell.cellIndex === cellPos) { baseCell.innerHTML = ''; }
|
480
|
+
}
|
481
|
+
}
|
482
|
+
continue;
|
483
|
+
case TableResultAction.resultAction.RemoveCell:
|
484
|
+
// Do not need remove cell because row will be deleted.
|
485
|
+
continue;
|
486
|
+
}
|
487
|
+
}
|
488
|
+
row.remove();
|
489
|
+
}
|
490
|
+
|
491
|
+
/**
|
492
|
+
* Delete current col
|
493
|
+
*
|
494
|
+
* @param {WrappedRange} rng
|
495
|
+
* @return {Node}
|
496
|
+
*/
|
497
|
+
deleteCol(rng) {
|
498
|
+
const cell = dom.ancestor(rng.commonAncestor(), dom.isCell);
|
499
|
+
const row = $(cell).closest('tr');
|
500
|
+
const cellPos = row.children('td, th').index($(cell));
|
501
|
+
|
502
|
+
const vTable = new TableResultAction(cell, TableResultAction.where.Column,
|
503
|
+
TableResultAction.requestAction.Delete, $(row).closest('table')[0]);
|
504
|
+
const actions = vTable.getActionList();
|
505
|
+
|
506
|
+
for (let actionIndex = 0; actionIndex < actions.length; actionIndex++) {
|
507
|
+
if (!actions[actionIndex]) {
|
508
|
+
continue;
|
509
|
+
}
|
510
|
+
switch (actions[actionIndex].action) {
|
511
|
+
case TableResultAction.resultAction.Ignore:
|
512
|
+
continue;
|
513
|
+
case TableResultAction.resultAction.SubtractSpanCount:
|
514
|
+
const baseCell = actions[actionIndex].baseCell;
|
515
|
+
const hasColspan = (baseCell.colSpan && baseCell.colSpan > 1);
|
516
|
+
if (hasColspan) {
|
517
|
+
let colspanNumber = (baseCell.colSpan) ? parseInt(baseCell.colSpan, 10) : 0;
|
518
|
+
if (colspanNumber > 2) {
|
519
|
+
colspanNumber--;
|
520
|
+
baseCell.setAttribute('colSpan', colspanNumber);
|
521
|
+
if (baseCell.cellIndex === cellPos) { baseCell.innerHTML = ''; }
|
522
|
+
} else if (colspanNumber === 2) {
|
523
|
+
baseCell.removeAttribute('colSpan');
|
524
|
+
if (baseCell.cellIndex === cellPos) { baseCell.innerHTML = ''; }
|
525
|
+
}
|
526
|
+
}
|
527
|
+
continue;
|
528
|
+
case TableResultAction.resultAction.RemoveCell:
|
529
|
+
dom.remove(actions[actionIndex].baseCell, true);
|
530
|
+
continue;
|
531
|
+
}
|
532
|
+
}
|
533
|
+
}
|
534
|
+
|
535
|
+
/**
|
536
|
+
* create empty table element
|
537
|
+
*
|
538
|
+
* @param {Number} rowCount
|
539
|
+
* @param {Number} colCount
|
540
|
+
* @return {Node}
|
541
|
+
*/
|
542
|
+
createTable(colCount, rowCount, options) {
|
543
|
+
const tds = [];
|
544
|
+
let tdHTML;
|
545
|
+
for (let idxCol = 0; idxCol < colCount; idxCol++) {
|
546
|
+
tds.push('<td>' + dom.blank + '</td>');
|
547
|
+
}
|
548
|
+
tdHTML = tds.join('');
|
549
|
+
|
550
|
+
const trs = [];
|
551
|
+
let trHTML;
|
552
|
+
for (let idxRow = 0; idxRow < rowCount; idxRow++) {
|
553
|
+
trs.push('<tr>' + tdHTML + '</tr>');
|
554
|
+
}
|
555
|
+
trHTML = trs.join('');
|
556
|
+
const $table = $('<table>' + trHTML + '</table>');
|
557
|
+
if (options && options.tableClassName) {
|
558
|
+
$table.addClass(options.tableClassName);
|
559
|
+
}
|
560
|
+
|
561
|
+
return $table[0];
|
562
|
+
}
|
563
|
+
|
564
|
+
/**
|
565
|
+
* Delete current table
|
566
|
+
*
|
567
|
+
* @param {WrappedRange} rng
|
568
|
+
* @return {Node}
|
569
|
+
*/
|
570
|
+
deleteTable(rng) {
|
571
|
+
const cell = dom.ancestor(rng.commonAncestor(), dom.isCell);
|
572
|
+
$(cell).closest('table').remove();
|
573
|
+
}
|
574
|
+
}
|