gnuside-aloha-rails 0.23.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/LICENSE +18 -0
- data/README.md +48 -0
- data/Rakefile +69 -0
- data/app/assets/javascripts/aloha.js +3 -0
- data/app/assets/javascripts/aloha/preinit.js.erb +1 -0
- data/lib/aloha-rails.rb +1 -0
- data/lib/aloha/rails.rb +2 -0
- data/lib/aloha/rails/engine.rb +9 -0
- data/lib/aloha/rails/version.rb +7 -0
- data/lib/tasks/aloha-assets.rake +9 -0
- data/vendor/assets/javascripts/aloha/css/aloha.scss +31 -0
- data/vendor/assets/javascripts/aloha/img/arrow-down.png +0 -0
- data/vendor/assets/javascripts/aloha/img/arrow-left.png +0 -0
- data/vendor/assets/javascripts/aloha/img/arrow.png +0 -0
- data/vendor/assets/javascripts/aloha/img/base-multi.png +0 -0
- data/vendor/assets/javascripts/aloha/img/base.png +0 -0
- data/vendor/assets/javascripts/aloha/img/bg.png +0 -0
- data/vendor/assets/javascripts/aloha/img/breadcrumb-divider.png +0 -0
- data/vendor/assets/javascripts/aloha/img/gentics-logo.png +0 -0
- data/vendor/assets/javascripts/aloha/img/grabhandle.png +0 -0
- data/vendor/assets/javascripts/aloha/img/maximize.png +0 -0
- data/vendor/assets/javascripts/aloha/img/multisplit-base.jpg +0 -0
- data/vendor/assets/javascripts/aloha/img/multisplit-close.gif +0 -0
- data/vendor/assets/javascripts/aloha/img/multisplit-open.gif +0 -0
- data/vendor/assets/javascripts/aloha/img/pin.png +0 -0
- data/vendor/assets/javascripts/aloha/img/removeformat.png +0 -0
- data/vendor/assets/javascripts/aloha/img/text_indent.png +0 -0
- data/vendor/assets/javascripts/aloha/img/text_indent_remove.png +0 -0
- data/vendor/assets/javascripts/aloha/lib/aloha-jquery-noconflict.js +14 -0
- data/vendor/assets/javascripts/aloha/lib/aloha.js +595 -0
- data/vendor/assets/javascripts/aloha/lib/aloha/block-jump.js +153 -0
- data/vendor/assets/javascripts/aloha/lib/aloha/command.js +287 -0
- data/vendor/assets/javascripts/aloha/lib/aloha/console.js +347 -0
- data/vendor/assets/javascripts/aloha/lib/aloha/contenthandlermanager.js +104 -0
- data/vendor/assets/javascripts/aloha/lib/aloha/copypaste.js +108 -0
- data/vendor/assets/javascripts/aloha/lib/aloha/core.js +623 -0
- data/vendor/assets/javascripts/aloha/lib/aloha/ecma5shims.js +326 -0
- data/vendor/assets/javascripts/aloha/lib/aloha/editable.js +1042 -0
- data/vendor/assets/javascripts/aloha/lib/aloha/engine.js +8646 -0
- data/vendor/assets/javascripts/aloha/lib/aloha/ephemera.js +492 -0
- data/vendor/assets/javascripts/aloha/lib/aloha/ierange-m2.js +29 -0
- data/vendor/assets/javascripts/aloha/lib/aloha/jquery.aloha.js +542 -0
- data/vendor/assets/javascripts/aloha/lib/aloha/markup.js +1276 -0
- data/vendor/assets/javascripts/aloha/lib/aloha/nls/ca/i18n.js +11 -0
- data/vendor/assets/javascripts/aloha/lib/aloha/nls/de/i18n.js +11 -0
- data/vendor/assets/javascripts/aloha/lib/aloha/nls/i18n.js +20 -0
- data/vendor/assets/javascripts/aloha/lib/aloha/nls/mk/i18n.js +11 -0
- data/vendor/assets/javascripts/aloha/lib/aloha/nls/pt-br/i18n.js +11 -0
- data/vendor/assets/javascripts/aloha/lib/aloha/nls/ru/i18n.js +11 -0
- data/vendor/assets/javascripts/aloha/lib/aloha/nls/uk/i18n.js +11 -0
- data/vendor/assets/javascripts/aloha/lib/aloha/nls/zh-hans/i18n.js +11 -0
- data/vendor/assets/javascripts/aloha/lib/aloha/observable.js +113 -0
- data/vendor/assets/javascripts/aloha/lib/aloha/plugin.js +281 -0
- data/vendor/assets/javascripts/aloha/lib/aloha/pluginmanager.js +203 -0
- data/vendor/assets/javascripts/aloha/lib/aloha/rangy-core.js +30 -0
- data/vendor/assets/javascripts/aloha/lib/aloha/registry.js +137 -0
- data/vendor/assets/javascripts/aloha/lib/aloha/repository.js +255 -0
- data/vendor/assets/javascripts/aloha/lib/aloha/repositorymanager.js +742 -0
- data/vendor/assets/javascripts/aloha/lib/aloha/repositoryobjects.js +162 -0
- data/vendor/assets/javascripts/aloha/lib/aloha/selection.js +2402 -0
- data/vendor/assets/javascripts/aloha/lib/aloha/sidebar.js +1045 -0
- data/vendor/assets/javascripts/aloha/lib/aloha/state-override.js +147 -0
- data/vendor/assets/javascripts/aloha/lib/css.js +455 -0
- data/vendor/assets/javascripts/aloha/lib/i18n.js +192 -0
- data/vendor/assets/javascripts/aloha/lib/require.js +2053 -0
- data/vendor/assets/javascripts/aloha/lib/text.js +288 -0
- data/vendor/assets/javascripts/aloha/lib/util/arrays.js +287 -0
- data/vendor/assets/javascripts/aloha/lib/util/boundary-markers.js +86 -0
- data/vendor/assets/javascripts/aloha/lib/util/browser.js +32 -0
- data/vendor/assets/javascripts/aloha/lib/util/class.js +78 -0
- data/vendor/assets/javascripts/aloha/lib/util/dom.js +1888 -0
- data/vendor/assets/javascripts/aloha/lib/util/dom2.js +908 -0
- data/vendor/assets/javascripts/aloha/lib/util/functions.js +62 -0
- data/vendor/assets/javascripts/aloha/lib/util/html.js +311 -0
- data/vendor/assets/javascripts/aloha/lib/util/json2.js +464 -0
- data/vendor/assets/javascripts/aloha/lib/util/keys.js +65 -0
- data/vendor/assets/javascripts/aloha/lib/util/lang.js +89 -0
- data/vendor/assets/javascripts/aloha/lib/util/maps.js +130 -0
- data/vendor/assets/javascripts/aloha/lib/util/misc.js +51 -0
- data/vendor/assets/javascripts/aloha/lib/util/position.js +176 -0
- data/vendor/assets/javascripts/aloha/lib/util/range-context.js +776 -0
- data/vendor/assets/javascripts/aloha/lib/util/range.js +917 -0
- data/vendor/assets/javascripts/aloha/lib/util/strings.js +122 -0
- data/vendor/assets/javascripts/aloha/lib/util/trees.js +336 -0
- data/vendor/assets/javascripts/aloha/lib/vendor/3rdparty.txt +70 -0
- data/vendor/assets/javascripts/aloha/lib/vendor/amplify.store.js +298 -0
- data/vendor/assets/javascripts/aloha/lib/vendor/class.js +76 -0
- data/vendor/assets/javascripts/aloha/lib/vendor/grid.locale.de.js +138 -0
- data/vendor/assets/javascripts/aloha/lib/vendor/grid.locale.en.js +133 -0
- data/vendor/assets/javascripts/aloha/lib/vendor/ierange-m2.js +508 -0
- data/vendor/assets/javascripts/aloha/lib/vendor/jquery-1.7.2.js +9421 -0
- data/vendor/assets/javascripts/aloha/lib/vendor/jquery-ui-1.9.0.custom-aloha.js +14711 -0
- data/vendor/assets/javascripts/aloha/lib/vendor/jquery.jqgrid.js +474 -0
- data/vendor/assets/javascripts/aloha/lib/vendor/jquery.jstree.js +4549 -0
- data/vendor/assets/javascripts/aloha/lib/vendor/jquery.layout-1.3.0-rc30.7.js +5924 -0
- data/vendor/assets/javascripts/aloha/lib/vendor/pubsub/js/pubsub-unminified.js +187 -0
- data/vendor/assets/javascripts/aloha/lib/vendor/pubsub/js/pubsub.js +2 -0
- data/vendor/assets/javascripts/aloha/lib/vendor/rangy-core.js +3295 -0
- data/vendor/assets/javascripts/aloha/lib/vendor/repository-browser/css/jstree.css +88 -0
- data/vendor/assets/javascripts/aloha/lib/vendor/repository-browser/css/repository-browser.css +744 -0
- data/vendor/assets/javascripts/aloha/lib/vendor/repository-browser/img/arrow-000-medium.png +0 -0
- data/vendor/assets/javascripts/aloha/lib/vendor/repository-browser/img/arrow-180.png +0 -0
- data/vendor/assets/javascripts/aloha/lib/vendor/repository-browser/img/arrow-315-medium.png +0 -0
- data/vendor/assets/javascripts/aloha/lib/vendor/repository-browser/img/arrow-stop-180.png +0 -0
- data/vendor/assets/javascripts/aloha/lib/vendor/repository-browser/img/arrow-stop.png +0 -0
- data/vendor/assets/javascripts/aloha/lib/vendor/repository-browser/img/arrow.png +0 -0
- data/vendor/assets/javascripts/aloha/lib/vendor/repository-browser/img/control-stop-square-small.png +0 -0
- data/vendor/assets/javascripts/aloha/lib/vendor/repository-browser/img/folder-horizontal-open.png +0 -0
- data/vendor/assets/javascripts/aloha/lib/vendor/repository-browser/img/folder-open.png +0 -0
- data/vendor/assets/javascripts/aloha/lib/vendor/repository-browser/img/magnifier-left.png +0 -0
- data/vendor/assets/javascripts/aloha/lib/vendor/repository-browser/img/page.png +0 -0
- data/vendor/assets/javascripts/aloha/lib/vendor/repository-browser/img/picture.png +0 -0
- data/vendor/assets/javascripts/aloha/lib/vendor/repository-browser/img/sort-alphabet-descending.png +0 -0
- data/vendor/assets/javascripts/aloha/lib/vendor/repository-browser/img/sort-alphabet.png +0 -0
- data/vendor/assets/javascripts/aloha/lib/vendor/repository-browser/img/throbber.gif +0 -0
- data/vendor/assets/javascripts/aloha/lib/vendor/repository-browser/js/repository-browser-unminified.js +1450 -0
- data/vendor/assets/javascripts/aloha/lib/vendor/repository-browser/js/repository-browser.js +32 -0
- data/vendor/assets/javascripts/aloha/lib/vendor/sanitize.js +278 -0
- data/vendor/assets/javascripts/aloha/plugins/common/abbr/css/abbr.css +1 -0
- data/vendor/assets/javascripts/aloha/plugins/common/abbr/img/remabbr.png +0 -0
- data/vendor/assets/javascripts/aloha/plugins/common/abbr/lib/abbr-plugin.js +304 -0
- data/vendor/assets/javascripts/aloha/plugins/common/abbr/nls/ca/i18n.js +6 -0
- data/vendor/assets/javascripts/aloha/plugins/common/abbr/nls/de/i18n.js +6 -0
- data/vendor/assets/javascripts/aloha/plugins/common/abbr/nls/i18n.js +15 -0
- data/vendor/assets/javascripts/aloha/plugins/common/abbr/nls/mk/i18n.js +6 -0
- data/vendor/assets/javascripts/aloha/plugins/common/abbr/nls/pt-br/i18n.js +6 -0
- data/vendor/assets/javascripts/aloha/plugins/common/abbr/nls/ru/i18n.js +6 -0
- data/vendor/assets/javascripts/aloha/plugins/common/abbr/nls/uk/i18n.js +6 -0
- data/vendor/assets/javascripts/aloha/plugins/common/abbr/nls/zh-hans/i18n.js +6 -0
- data/vendor/assets/javascripts/aloha/plugins/common/abbr/package.json +1 -0
- data/vendor/assets/javascripts/aloha/plugins/common/align/LICENSE +166 -0
- data/vendor/assets/javascripts/aloha/plugins/common/align/README +12 -0
- data/vendor/assets/javascripts/aloha/plugins/common/align/css/align.css +31 -0
- data/vendor/assets/javascripts/aloha/plugins/common/align/img/align.png +0 -0
- data/vendor/assets/javascripts/aloha/plugins/common/align/lib/align-plugin.js +465 -0
- data/vendor/assets/javascripts/aloha/plugins/common/align/nls/ca/i18n.js +6 -0
- data/vendor/assets/javascripts/aloha/plugins/common/align/nls/de/i18n.js +9 -0
- data/vendor/assets/javascripts/aloha/plugins/common/align/nls/i18n.js +18 -0
- data/vendor/assets/javascripts/aloha/plugins/common/align/nls/mk/i18n.js +6 -0
- data/vendor/assets/javascripts/aloha/plugins/common/align/nls/pt-br/i18n.js +6 -0
- data/vendor/assets/javascripts/aloha/plugins/common/align/nls/ru/i18n.js +6 -0
- data/vendor/assets/javascripts/aloha/plugins/common/align/nls/uk/i18n.js +6 -0
- data/vendor/assets/javascripts/aloha/plugins/common/align/nls/zh-hans/i18n.js +6 -0
- data/vendor/assets/javascripts/aloha/plugins/common/align/package.json +2 -0
- data/vendor/assets/javascripts/aloha/plugins/common/block/README +0 -0
- data/vendor/assets/javascripts/aloha/plugins/common/block/css/block.css +110 -0
- data/vendor/assets/javascripts/aloha/plugins/common/block/img/toolbar-draghandle.gif +0 -0
- data/vendor/assets/javascripts/aloha/plugins/common/block/lib/block-plugin.js +347 -0
- data/vendor/assets/javascripts/aloha/plugins/common/block/lib/block.js +1277 -0
- data/vendor/assets/javascripts/aloha/plugins/common/block/lib/blockcontenthandler.js +118 -0
- data/vendor/assets/javascripts/aloha/plugins/common/block/lib/blockmanager.js +621 -0
- data/vendor/assets/javascripts/aloha/plugins/common/block/lib/editor.js +331 -0
- data/vendor/assets/javascripts/aloha/plugins/common/block/lib/editormanager.js +55 -0
- data/vendor/assets/javascripts/aloha/plugins/common/block/lib/sidebarattributeeditor.js +126 -0
- data/vendor/assets/javascripts/aloha/plugins/common/block/nls/ca/i18n.js +3 -0
- data/vendor/assets/javascripts/aloha/plugins/common/block/nls/de/i18n.js +3 -0
- data/vendor/assets/javascripts/aloha/plugins/common/block/nls/i18n.js +12 -0
- data/vendor/assets/javascripts/aloha/plugins/common/block/nls/mk/i18n.js +3 -0
- data/vendor/assets/javascripts/aloha/plugins/common/block/nls/pt-br/i18n.js +3 -0
- data/vendor/assets/javascripts/aloha/plugins/common/block/nls/ru/i18n.js +3 -0
- data/vendor/assets/javascripts/aloha/plugins/common/block/nls/uk/i18n.js +3 -0
- data/vendor/assets/javascripts/aloha/plugins/common/block/nls/zh-hans/i18n.js +3 -0
- data/vendor/assets/javascripts/aloha/plugins/common/block/package.json +11 -0
- data/vendor/assets/javascripts/aloha/plugins/common/characterpicker/css/characterpicker.css +44 -0
- data/vendor/assets/javascripts/aloha/plugins/common/characterpicker/img/icon.png +0 -0
- data/vendor/assets/javascripts/aloha/plugins/common/characterpicker/lib/characterpicker-plugin.js +466 -0
- data/vendor/assets/javascripts/aloha/plugins/common/characterpicker/nls/ca/i18n.js +3 -0
- data/vendor/assets/javascripts/aloha/plugins/common/characterpicker/nls/de/i18n.js +3 -0
- data/vendor/assets/javascripts/aloha/plugins/common/characterpicker/nls/i18n.js +12 -0
- data/vendor/assets/javascripts/aloha/plugins/common/characterpicker/nls/mk/i18n.js +3 -0
- data/vendor/assets/javascripts/aloha/plugins/common/characterpicker/nls/pt-br/i18n.js +3 -0
- data/vendor/assets/javascripts/aloha/plugins/common/characterpicker/nls/ru/i18n.js +3 -0
- data/vendor/assets/javascripts/aloha/plugins/common/characterpicker/nls/uk/i18n.js +3 -0
- data/vendor/assets/javascripts/aloha/plugins/common/characterpicker/nls/zh-hans/i18n.js +3 -0
- data/vendor/assets/javascripts/aloha/plugins/common/commands/css/abbr.css +0 -0
- data/vendor/assets/javascripts/aloha/plugins/common/commands/lib/commands-plugin.js +33 -0
- data/vendor/assets/javascripts/aloha/plugins/common/commands/lib/inserthtml.js +126 -0
- data/vendor/assets/javascripts/aloha/plugins/common/commands/package.json +1 -0
- data/vendor/assets/javascripts/aloha/plugins/common/contenthandler/README.md +0 -0
- data/vendor/assets/javascripts/aloha/plugins/common/contenthandler/lib/blockelementcontenthandler.js +144 -0
- data/vendor/assets/javascripts/aloha/plugins/common/contenthandler/lib/contenthandler-plugin.js +65 -0
- data/vendor/assets/javascripts/aloha/plugins/common/contenthandler/lib/contenthandler-utils.js +58 -0
- data/vendor/assets/javascripts/aloha/plugins/common/contenthandler/lib/genericcontenthandler.js +359 -0
- data/vendor/assets/javascripts/aloha/plugins/common/contenthandler/lib/oembedcontenthandler.js +461 -0
- data/vendor/assets/javascripts/aloha/plugins/common/contenthandler/lib/sanitizecontenthandler.js +186 -0
- data/vendor/assets/javascripts/aloha/plugins/common/contenthandler/lib/wordcontenthandler.js +461 -0
- data/vendor/assets/javascripts/aloha/plugins/common/contenthandler/package.json +1 -0
- data/vendor/assets/javascripts/aloha/plugins/common/dom-to-xhtml/lib/dom-to-xhtml-plugin.js +74 -0
- data/vendor/assets/javascripts/aloha/plugins/common/dom-to-xhtml/lib/dom-to-xhtml.js +415 -0
- data/vendor/assets/javascripts/aloha/plugins/common/format/img/em.png +0 -0
- data/vendor/assets/javascripts/aloha/plugins/common/format/img/strong.png +0 -0
- data/vendor/assets/javascripts/aloha/plugins/common/format/lib/format-plugin.js +594 -0
- data/vendor/assets/javascripts/aloha/plugins/common/format/nls/ca/i18n.js +52 -0
- data/vendor/assets/javascripts/aloha/plugins/common/format/nls/de/i18n.js +52 -0
- data/vendor/assets/javascripts/aloha/plugins/common/format/nls/i18n.js +61 -0
- data/vendor/assets/javascripts/aloha/plugins/common/format/nls/mk/i18n.js +52 -0
- data/vendor/assets/javascripts/aloha/plugins/common/format/nls/pt-br/i18n.js +52 -0
- data/vendor/assets/javascripts/aloha/plugins/common/format/nls/ru/i18n.js +52 -0
- data/vendor/assets/javascripts/aloha/plugins/common/format/nls/uk/i18n.js +52 -0
- data/vendor/assets/javascripts/aloha/plugins/common/format/nls/zh-hans/i18n.js +52 -0
- data/vendor/assets/javascripts/aloha/plugins/common/highlighteditables/css/highlighteditables.css +14 -0
- data/vendor/assets/javascripts/aloha/plugins/common/highlighteditables/lib/highlighteditables-plugin.js +100 -0
- data/vendor/assets/javascripts/aloha/plugins/common/highlighteditables/package.json +1 -0
- data/vendor/assets/javascripts/aloha/plugins/common/horizontalruler/css/horizontalruler.css +3 -0
- data/vendor/assets/javascripts/aloha/plugins/common/horizontalruler/img/icon.png +0 -0
- data/vendor/assets/javascripts/aloha/plugins/common/horizontalruler/lib/horizontalruler-plugin.js +95 -0
- data/vendor/assets/javascripts/aloha/plugins/common/horizontalruler/nls/ca/i18n.js +3 -0
- data/vendor/assets/javascripts/aloha/plugins/common/horizontalruler/nls/de/i18n.js +3 -0
- data/vendor/assets/javascripts/aloha/plugins/common/horizontalruler/nls/i18n.js +12 -0
- data/vendor/assets/javascripts/aloha/plugins/common/horizontalruler/nls/mk/i18n.js +3 -0
- data/vendor/assets/javascripts/aloha/plugins/common/horizontalruler/nls/pt-br/i18n.js +3 -0
- data/vendor/assets/javascripts/aloha/plugins/common/horizontalruler/nls/ru/i18n.js +3 -0
- data/vendor/assets/javascripts/aloha/plugins/common/horizontalruler/nls/uk/i18n.js +3 -0
- data/vendor/assets/javascripts/aloha/plugins/common/horizontalruler/nls/zh-hans/i18n.js +3 -0
- data/vendor/assets/javascripts/aloha/plugins/common/image/README.md +66 -0
- data/vendor/assets/javascripts/aloha/plugins/common/image/css/image.css +133 -0
- data/vendor/assets/javascripts/aloha/plugins/common/image/img/blank.jpg +0 -0
- data/vendor/assets/javascripts/aloha/plugins/common/image/img/crop-buttons.gif +0 -0
- data/vendor/assets/javascripts/aloha/plugins/common/image/img/cropnresize.png +0 -0
- data/vendor/assets/javascripts/aloha/plugins/common/image/img/handle-sw.png +0 -0
- data/vendor/assets/javascripts/aloha/plugins/common/image/img/image-align-left.png +0 -0
- data/vendor/assets/javascripts/aloha/plugins/common/image/img/image-align-none.png +0 -0
- data/vendor/assets/javascripts/aloha/plugins/common/image/img/image-align-right.png +0 -0
- data/vendor/assets/javascripts/aloha/plugins/common/image/img/image-border.png +0 -0
- data/vendor/assets/javascripts/aloha/plugins/common/image/img/image-title.png +0 -0
- data/vendor/assets/javascripts/aloha/plugins/common/image/img/image.gif +0 -0
- data/vendor/assets/javascripts/aloha/plugins/common/image/img/padding-decrease.gif +0 -0
- data/vendor/assets/javascripts/aloha/plugins/common/image/img/padding-increase.gif +0 -0
- data/vendor/assets/javascripts/aloha/plugins/common/image/img/page.png +0 -0
- data/vendor/assets/javascripts/aloha/plugins/common/image/img/size-decrease.gif +0 -0
- data/vendor/assets/javascripts/aloha/plugins/common/image/img/size-increase.gif +0 -0
- data/vendor/assets/javascripts/aloha/plugins/common/image/lib/image-floatingMenu.js +308 -0
- data/vendor/assets/javascripts/aloha/plugins/common/image/lib/image-plugin-actions.js +0 -0
- data/vendor/assets/javascripts/aloha/plugins/common/image/lib/image-plugin.js +1341 -0
- data/vendor/assets/javascripts/aloha/plugins/common/image/nls/ca/i18n.js +32 -0
- data/vendor/assets/javascripts/aloha/plugins/common/image/nls/de/i18n.js +32 -0
- data/vendor/assets/javascripts/aloha/plugins/common/image/nls/i18n.js +41 -0
- data/vendor/assets/javascripts/aloha/plugins/common/image/nls/mk/i18n.js +32 -0
- data/vendor/assets/javascripts/aloha/plugins/common/image/nls/pt-br/i18n.js +32 -0
- data/vendor/assets/javascripts/aloha/plugins/common/image/nls/ru/i18n.js +32 -0
- data/vendor/assets/javascripts/aloha/plugins/common/image/nls/uk/i18n.js +32 -0
- data/vendor/assets/javascripts/aloha/plugins/common/image/nls/zh-hans/i18n.js +32 -0
- data/vendor/assets/javascripts/aloha/plugins/common/image/package.json +1 -0
- data/vendor/assets/javascripts/aloha/plugins/common/image/vendor/jcrop/jcrop.gif +0 -0
- data/vendor/assets/javascripts/aloha/plugins/common/image/vendor/jcrop/jquery.jcrop.css +46 -0
- data/vendor/assets/javascripts/aloha/plugins/common/image/vendor/jcrop/jquery.jcrop.min.js +165 -0
- data/vendor/assets/javascripts/aloha/plugins/common/image/vendor/mousewheel/mousewheel.js +85 -0
- data/vendor/assets/javascripts/aloha/plugins/common/image/vendor/ui/ui-lightness/images/ui-bg_diagonals-thick_18_b81900_40x40.png +0 -0
- data/vendor/assets/javascripts/aloha/plugins/common/image/vendor/ui/ui-lightness/images/ui-bg_diagonals-thick_20_666666_40x40.png +0 -0
- data/vendor/assets/javascripts/aloha/plugins/common/image/vendor/ui/ui-lightness/images/ui-bg_flat_10_000000_40x100.png +0 -0
- data/vendor/assets/javascripts/aloha/plugins/common/image/vendor/ui/ui-lightness/images/ui-bg_glass_100_f6f6f6_1x400.png +0 -0
- data/vendor/assets/javascripts/aloha/plugins/common/image/vendor/ui/ui-lightness/images/ui-bg_glass_100_fdf5ce_1x400.png +0 -0
- data/vendor/assets/javascripts/aloha/plugins/common/image/vendor/ui/ui-lightness/images/ui-bg_glass_65_ffffff_1x400.png +0 -0
- data/vendor/assets/javascripts/aloha/plugins/common/image/vendor/ui/ui-lightness/images/ui-bg_gloss-wave_35_f6a828_500x100.png +0 -0
- data/vendor/assets/javascripts/aloha/plugins/common/image/vendor/ui/ui-lightness/images/ui-bg_highlight-soft_100_eeeeee_1x100.png +0 -0
- data/vendor/assets/javascripts/aloha/plugins/common/image/vendor/ui/ui-lightness/images/ui-bg_highlight-soft_75_ffe45c_1x100.png +0 -0
- data/vendor/assets/javascripts/aloha/plugins/common/image/vendor/ui/ui-lightness/images/ui-icons_222222_256x240.png +0 -0
- data/vendor/assets/javascripts/aloha/plugins/common/image/vendor/ui/ui-lightness/images/ui-icons_228ef1_256x240.png +0 -0
- data/vendor/assets/javascripts/aloha/plugins/common/image/vendor/ui/ui-lightness/images/ui-icons_ef8c08_256x240.png +0 -0
- data/vendor/assets/javascripts/aloha/plugins/common/image/vendor/ui/ui-lightness/images/ui-icons_ffd27a_256x240.png +0 -0
- data/vendor/assets/javascripts/aloha/plugins/common/image/vendor/ui/ui-lightness/images/ui-icons_ffffff_256x240.png +0 -0
- data/vendor/assets/javascripts/aloha/plugins/common/link/css/link.css +52 -0
- data/vendor/assets/javascripts/aloha/plugins/common/link/extra/delicious.js +264 -0
- data/vendor/assets/javascripts/aloha/plugins/common/link/extra/linklist.js +247 -0
- data/vendor/assets/javascripts/aloha/plugins/common/link/extra/slowlinklist.js +247 -0
- data/vendor/assets/javascripts/aloha/plugins/common/link/lib/link-plugin.js +958 -0
- data/vendor/assets/javascripts/aloha/plugins/common/link/nls/ca/i18n.js +14 -0
- data/vendor/assets/javascripts/aloha/plugins/common/link/nls/de/i18n.js +14 -0
- data/vendor/assets/javascripts/aloha/plugins/common/link/nls/i18n.js +23 -0
- data/vendor/assets/javascripts/aloha/plugins/common/link/nls/mk/i18n.js +14 -0
- data/vendor/assets/javascripts/aloha/plugins/common/link/nls/pt-br/i18n.js +14 -0
- data/vendor/assets/javascripts/aloha/plugins/common/link/nls/ru/i18n.js +14 -0
- data/vendor/assets/javascripts/aloha/plugins/common/link/nls/uk/i18n.js +14 -0
- data/vendor/assets/javascripts/aloha/plugins/common/link/nls/zh-hans/i18n.js +14 -0
- data/vendor/assets/javascripts/aloha/plugins/common/list/lib/list-plugin.js +878 -0
- data/vendor/assets/javascripts/aloha/plugins/common/list/nls/ca/i18n.js +7 -0
- data/vendor/assets/javascripts/aloha/plugins/common/list/nls/de/i18n.js +7 -0
- data/vendor/assets/javascripts/aloha/plugins/common/list/nls/i18n.js +16 -0
- data/vendor/assets/javascripts/aloha/plugins/common/list/nls/mk/i18n.js +7 -0
- data/vendor/assets/javascripts/aloha/plugins/common/list/nls/pt-br/i18n.js +7 -0
- data/vendor/assets/javascripts/aloha/plugins/common/list/nls/ru/i18n.js +7 -0
- data/vendor/assets/javascripts/aloha/plugins/common/list/nls/uk/i18n.js +7 -0
- data/vendor/assets/javascripts/aloha/plugins/common/list/nls/zh-hans/i18n.js +7 -0
- data/vendor/assets/javascripts/aloha/plugins/common/list/package.json +1 -0
- data/vendor/assets/javascripts/aloha/plugins/common/paste/lib/paste-plugin.js +457 -0
- data/vendor/assets/javascripts/aloha/plugins/common/paste/package.json +8 -0
- data/vendor/assets/javascripts/aloha/plugins/common/table/css/table.css +125 -0
- data/vendor/assets/javascripts/aloha/plugins/common/table/img/down.cur +0 -0
- data/vendor/assets/javascripts/aloha/plugins/common/table/img/left.cur +0 -0
- data/vendor/assets/javascripts/aloha/plugins/common/table/img/table_layout.png +0 -0
- data/vendor/assets/javascripts/aloha/plugins/common/table/img/wai-green.png +0 -0
- data/vendor/assets/javascripts/aloha/plugins/common/table/img/wai-red.png +0 -0
- data/vendor/assets/javascripts/aloha/plugins/common/table/lib/table-cell.js +542 -0
- data/vendor/assets/javascripts/aloha/plugins/common/table/lib/table-create-layer.js +213 -0
- data/vendor/assets/javascripts/aloha/plugins/common/table/lib/table-plugin-utils.js +494 -0
- data/vendor/assets/javascripts/aloha/plugins/common/table/lib/table-plugin.js +1596 -0
- data/vendor/assets/javascripts/aloha/plugins/common/table/lib/table-selection.js +468 -0
- data/vendor/assets/javascripts/aloha/plugins/common/table/lib/table.js +2110 -0
- data/vendor/assets/javascripts/aloha/plugins/common/table/nls/ca/i18n.js +28 -0
- data/vendor/assets/javascripts/aloha/plugins/common/table/nls/de/i18n.js +29 -0
- data/vendor/assets/javascripts/aloha/plugins/common/table/nls/i18n.js +38 -0
- data/vendor/assets/javascripts/aloha/plugins/common/table/nls/mk/i18n.js +28 -0
- data/vendor/assets/javascripts/aloha/plugins/common/table/nls/pt-br/i18n.js +28 -0
- data/vendor/assets/javascripts/aloha/plugins/common/table/nls/ru/i18n.js +28 -0
- data/vendor/assets/javascripts/aloha/plugins/common/table/nls/uk/i18n.js +28 -0
- data/vendor/assets/javascripts/aloha/plugins/common/table/nls/zh-hans/i18n.js +28 -0
- data/vendor/assets/javascripts/aloha/plugins/common/table/package.json +1 -0
- data/vendor/assets/javascripts/aloha/plugins/common/ui/css/jquery-ui-1.9m6.css +430 -0
- data/vendor/assets/javascripts/aloha/plugins/common/ui/css/ui.css +689 -0
- data/vendor/assets/javascripts/aloha/plugins/common/ui/img/blockquote.png +0 -0
- data/vendor/assets/javascripts/aloha/plugins/common/ui/img/character-picker.png +0 -0
- data/vendor/assets/javascripts/aloha/plugins/common/ui/img/em.png +0 -0
- data/vendor/assets/javascripts/aloha/plugins/common/ui/img/format-block.png +0 -0
- data/vendor/assets/javascripts/aloha/plugins/common/ui/img/format-inline.png +0 -0
- data/vendor/assets/javascripts/aloha/plugins/common/ui/img/indent.png +0 -0
- data/vendor/assets/javascripts/aloha/plugins/common/ui/img/jqueryui/ui-icons_222222_256x240.png +0 -0
- data/vendor/assets/javascripts/aloha/plugins/common/ui/img/justify.png +0 -0
- data/vendor/assets/javascripts/aloha/plugins/common/ui/img/language-annotation.png +0 -0
- data/vendor/assets/javascripts/aloha/plugins/common/ui/img/metaview.png +0 -0
- data/vendor/assets/javascripts/aloha/plugins/common/ui/img/metaview/anchor.png +0 -0
- data/vendor/assets/javascripts/aloha/plugins/common/ui/img/metaview/blockquote.png +0 -0
- data/vendor/assets/javascripts/aloha/plugins/common/ui/img/metaview/caption.png +0 -0
- data/vendor/assets/javascripts/aloha/plugins/common/ui/img/metaview/cite.png +0 -0
- data/vendor/assets/javascripts/aloha/plugins/common/ui/img/metaview/dd.png +0 -0
- data/vendor/assets/javascripts/aloha/plugins/common/ui/img/metaview/div.png +0 -0
- data/vendor/assets/javascripts/aloha/plugins/common/ui/img/metaview/dl.png +0 -0
- data/vendor/assets/javascripts/aloha/plugins/common/ui/img/metaview/dt.png +0 -0
- data/vendor/assets/javascripts/aloha/plugins/common/ui/img/metaview/h1.png +0 -0
- data/vendor/assets/javascripts/aloha/plugins/common/ui/img/metaview/h2.png +0 -0
- data/vendor/assets/javascripts/aloha/plugins/common/ui/img/metaview/h3.png +0 -0
- data/vendor/assets/javascripts/aloha/plugins/common/ui/img/metaview/h4.png +0 -0
- data/vendor/assets/javascripts/aloha/plugins/common/ui/img/metaview/h5.png +0 -0
- data/vendor/assets/javascripts/aloha/plugins/common/ui/img/metaview/h6.png +0 -0
- data/vendor/assets/javascripts/aloha/plugins/common/ui/img/metaview/p.png +0 -0
- data/vendor/assets/javascripts/aloha/plugins/common/ui/img/metaview/pre.png +0 -0
- data/vendor/assets/javascripts/aloha/plugins/common/ui/img/metaview/q.png +0 -0
- data/vendor/assets/javascripts/aloha/plugins/common/ui/img/metaview/table.png +0 -0
- data/vendor/assets/javascripts/aloha/plugins/common/ui/img/metaview/td.png +0 -0
- data/vendor/assets/javascripts/aloha/plugins/common/ui/img/metaview/th.png +0 -0
- data/vendor/assets/javascripts/aloha/plugins/common/ui/img/multisplit-close.gif +0 -0
- data/vendor/assets/javascripts/aloha/plugins/common/ui/img/multisplit-open.gif +0 -0
- data/vendor/assets/javascripts/aloha/plugins/common/ui/img/outdent.png +0 -0
- data/vendor/assets/javascripts/aloha/plugins/common/ui/img/quote.png +0 -0
- data/vendor/assets/javascripts/aloha/plugins/common/ui/img/removeformat.png +0 -0
- data/vendor/assets/javascripts/aloha/plugins/common/ui/img/strong.png +0 -0
- data/vendor/assets/javascripts/aloha/plugins/common/ui/img/tree.png +0 -0
- data/vendor/assets/javascripts/aloha/plugins/common/ui/lib/arena.js +11 -0
- data/vendor/assets/javascripts/aloha/plugins/common/ui/lib/autocomplete.js +70 -0
- data/vendor/assets/javascripts/aloha/plugins/common/ui/lib/button.js +114 -0
- data/vendor/assets/javascripts/aloha/plugins/common/ui/lib/component.js +121 -0
- data/vendor/assets/javascripts/aloha/plugins/common/ui/lib/container.js +210 -0
- data/vendor/assets/javascripts/aloha/plugins/common/ui/lib/context.js +53 -0
- data/vendor/assets/javascripts/aloha/plugins/common/ui/lib/dialog.js +215 -0
- data/vendor/assets/javascripts/aloha/plugins/common/ui/lib/floating.js +405 -0
- data/vendor/assets/javascripts/aloha/plugins/common/ui/lib/menuButton.js +169 -0
- data/vendor/assets/javascripts/aloha/plugins/common/ui/lib/multiSplit.js +237 -0
- data/vendor/assets/javascripts/aloha/plugins/common/ui/lib/port-helper-attribute-field.js +440 -0
- data/vendor/assets/javascripts/aloha/plugins/common/ui/lib/port-helper-multi-split.js +71 -0
- data/vendor/assets/javascripts/aloha/plugins/common/ui/lib/scopes.js +187 -0
- data/vendor/assets/javascripts/aloha/plugins/common/ui/lib/settings.js +202 -0
- data/vendor/assets/javascripts/aloha/plugins/common/ui/lib/subguarded.js +183 -0
- data/vendor/assets/javascripts/aloha/plugins/common/ui/lib/surface.js +106 -0
- data/vendor/assets/javascripts/aloha/plugins/common/ui/lib/tab.js +316 -0
- data/vendor/assets/javascripts/aloha/plugins/common/ui/lib/text.js +33 -0
- data/vendor/assets/javascripts/aloha/plugins/common/ui/lib/toggleButton.js +57 -0
- data/vendor/assets/javascripts/aloha/plugins/common/ui/lib/toolbar.js +251 -0
- data/vendor/assets/javascripts/aloha/plugins/common/ui/lib/ui-plugin.js +169 -0
- data/vendor/assets/javascripts/aloha/plugins/common/ui/lib/ui.js +181 -0
- data/vendor/assets/javascripts/aloha/plugins/common/ui/lib/utils.js +104 -0
- data/vendor/assets/javascripts/aloha/plugins/common/ui/nls/ca/i18n.js +46 -0
- data/vendor/assets/javascripts/aloha/plugins/common/ui/nls/de/i18n.js +48 -0
- data/vendor/assets/javascripts/aloha/plugins/common/ui/nls/i18n.js +75 -0
- data/vendor/assets/javascripts/aloha/plugins/common/ui/nls/mk/i18n.js +46 -0
- data/vendor/assets/javascripts/aloha/plugins/common/ui/nls/pt-br/i18n.js +46 -0
- data/vendor/assets/javascripts/aloha/plugins/common/ui/nls/ru/i18n.js +46 -0
- data/vendor/assets/javascripts/aloha/plugins/common/ui/nls/uk/i18n.js +46 -0
- data/vendor/assets/javascripts/aloha/plugins/common/ui/nls/zh-hans/i18n.js +46 -0
- data/vendor/assets/javascripts/aloha/plugins/common/ui/vendor/jquery-ui-autocomplete-html.js +42 -0
- data/vendor/assets/javascripts/aloha/plugins/common/undo/lib/undo-plugin.js +165 -0
- data/vendor/assets/javascripts/aloha/plugins/common/undo/package.json +7 -0
- data/vendor/assets/javascripts/aloha/plugins/common/undo/vendor/diff_match_patch_uncompressed.js +2155 -0
- data/vendor/assets/javascripts/aloha/plugins/common/undo/vendor/undo.js +121 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/attributes/README +0 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/attributes/css/attributes.css +12 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/attributes/lib/attributes-plugin.js +237 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/attributes/nls/ca/i18n.js +5 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/attributes/nls/de/i18n.js +5 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/attributes/nls/i18n.js +14 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/attributes/nls/mk/i18n.js +5 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/attributes/nls/pt-br/i18n.js +5 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/attributes/nls/ru/i18n.js +5 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/attributes/nls/uk/i18n.js +5 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/attributes/nls/zh-hans/i18n.js +5 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/captioned-image/css/captioned-image.css +15 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/captioned-image/lib/captioned-image-plugin.js +555 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/cite/README +0 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/cite/css/cite.css +39 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/cite/img/blockquote.png +0 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/cite/img/icon_cite.png +0 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/cite/lib/cite-plugin.js +614 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/cite/nls/ca/i18n.js +4 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/cite/nls/de/i18n.js +4 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/cite/nls/i18n.js +13 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/cite/nls/mk/i18n.js +4 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/cite/nls/pt-br/i18n.js +4 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/cite/nls/ru/i18n.js +4 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/cite/nls/uk/i18n.js +4 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/cite/nls/zh-hans/i18n.js +4 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/cite/package.json +1 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/comments/img/add-icon.png +0 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/comments/img/add.png +0 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/comments/img/comments.png +0 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/comments/img/hr.png +0 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/comments/img/textbox.png +0 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/comments/lib/comments-plugin.js +692 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/comments/lib/comments.css +442 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/comments/package.json +1 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/draganddropfiles/README.md +5 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/draganddropfiles/TODO.md +2 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/draganddropfiles/img/cross.png +0 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/draganddropfiles/img/hourglass.png +0 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/draganddropfiles/img/loading.gif +0 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/draganddropfiles/img/page.png +0 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/draganddropfiles/img/tick.png +0 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/draganddropfiles/lib/draganddropfiles-plugin.js +4 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/draganddropfiles/lib/dragndropfiles.css +110 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/draganddropfiles/lib/dragndropfiles.js +363 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/draganddropfiles/lib/dropfilesrepository.js +365 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/draganddropfiles/nls/ca/i18n.js +3 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/draganddropfiles/nls/de/i18n.js +3 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/draganddropfiles/nls/i18n.js +12 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/draganddropfiles/nls/mk/i18n.js +3 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/draganddropfiles/nls/pt-br/i18n.js +3 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/draganddropfiles/nls/ru/i18n.js +3 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/draganddropfiles/nls/uk/i18n.js +3 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/draganddropfiles/nls/zh-hans/i18n.js +3 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/draganddropfiles/package.json +1 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/formatlesspaste/README.md +1 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/formatlesspaste/css/formatless.css +7 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/formatlesspaste/img/button.png +0 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/formatlesspaste/lib/formatlesshandler.js +97 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/formatlesspaste/lib/formatlesspaste-plugin.js +230 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/formatlesspaste/nls/ca/i18n.js +3 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/formatlesspaste/nls/de/i18n.js +3 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/formatlesspaste/nls/i18n.js +12 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/formatlesspaste/nls/mk/i18n.js +3 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/formatlesspaste/nls/pt-br/i18n.js +3 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/formatlesspaste/nls/ru/i18n.js +3 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/formatlesspaste/nls/uk/i18n.js +3 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/formatlesspaste/nls/zh-hans/i18n.js +3 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/formatlesspaste/package.json +8 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/headerids/README +0 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/headerids/css/headerids.css +8 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/headerids/lib/headerids-plugin.js +254 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/headerids/nls/ca/i18n.js +6 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/headerids/nls/de/i18n.js +6 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/headerids/nls/i18n.js +15 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/headerids/nls/mk/i18n.js +6 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/headerids/nls/pt-br/i18n.js +6 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/headerids/nls/ru/i18n.js +6 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/headerids/nls/uk/i18n.js +6 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/headerids/nls/zh-hans/i18n.js +6 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/hints/README.md +12 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/hints/css/hints.css +29 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/hints/lib/hints-plugin.js +97 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/hints/package.json +9 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/hints/vendor/tipsy.js +242 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/imagebrowser/README +0 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/imagebrowser/lib/imagebrowser-plugin.js +160 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/imagebrowser/nls/ca/i18n.js +6 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/imagebrowser/nls/de/i18n.js +6 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/imagebrowser/nls/i18n.js +15 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/imagebrowser/nls/mk/i18n.js +6 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/imagebrowser/nls/pt-br/i18n.js +6 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/imagebrowser/nls/ru/i18n.js +6 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/imagebrowser/nls/uk/i18n.js +6 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/imagebrowser/nls/zh-hans/i18n.js +6 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/README +0 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/ad.png +0 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/ae.png +0 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/af.png +0 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/ag.png +0 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/ai.png +0 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/al.png +0 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/am.png +0 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/an.png +0 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/ao.png +0 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/ar.png +0 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/as.png +0 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/at.png +0 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/au.png +0 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/aw.png +0 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/ax.png +0 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/az.png +0 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/ba.png +0 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/bb.png +0 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/bd.png +0 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/be.png +0 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/bf.png +0 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/bg.png +0 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/bh.png +0 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/bi.png +0 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/bj.png +0 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/bm.png +0 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/bn.png +0 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/bo.png +0 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/br.png +0 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/bs.png +0 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/bt.png +0 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/bv.png +0 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/bw.png +0 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/by.png +0 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/bz.png +0 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/ca.png +0 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/catalonia.png +0 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/cc.png +0 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/cd.png +0 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/cf.png +0 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/cg.png +0 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/ch.png +0 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/ci.png +0 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/ck.png +0 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/cl.png +0 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/cm.png +0 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/cn.png +0 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/co.png +0 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/cr.png +0 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/cs.png +0 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/cu.png +0 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/cv.png +0 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/cx.png +0 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/cy.png +0 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/cz.png +0 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/de.png +0 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/dj.png +0 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/dk.png +0 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/dm.png +0 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/do.png +0 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/dz.png +0 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/ec.png +0 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/ee.png +0 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/eg.png +0 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/eh.png +0 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/en.png +0 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/er.png +0 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/es.png +0 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/et.png +0 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/europeanunion.png +0 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/fam.png +0 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/fi.png +0 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/fj.png +0 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/fk.png +0 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/fm.png +0 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/fo.png +0 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/fr.png +0 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/ga.png +0 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/gb.png +0 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/gd.png +0 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/ge.png +0 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/gf.png +0 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/gh.png +0 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/gi.png +0 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/gl.png +0 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/gm.png +0 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/gn.png +0 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/gp.png +0 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/gq.png +0 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/gr.png +0 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/gs.png +0 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/gt.png +0 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/gu.png +0 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/gw.png +0 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/gy.png +0 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/hk.png +0 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/hm.png +0 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/hn.png +0 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/hr.png +0 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/ht.png +0 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/hu.png +0 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/id.png +0 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/ie.png +0 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/il.png +0 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/in.png +0 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/io.png +0 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/iq.png +0 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/ir.png +0 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/is.png +0 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/it.png +0 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/jm.png +0 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/jo.png +0 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/jp.png +0 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/ke.png +0 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/kg.png +0 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/kh.png +0 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/ki.png +0 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/km.png +0 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/kn.png +0 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/kp.png +0 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/kr.png +0 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/kw.png +0 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/ky.png +0 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/kz.png +0 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/la.png +0 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/lb.png +0 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/lc.png +0 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/li.png +0 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/lk.png +0 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/lr.png +0 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/ls.png +0 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/lt.png +0 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/lu.png +0 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/lv.png +0 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/ly.png +0 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/ma.png +0 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/mc.png +0 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/md.png +0 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/me.png +0 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/mg.png +0 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/mh.png +0 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/mk.png +0 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/ml.png +0 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/mm.png +0 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/mn.png +0 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/mo.png +0 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/mp.png +0 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/mq.png +0 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/mr.png +0 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/ms.png +0 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/mt.png +0 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/mu.png +0 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/mv.png +0 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/mw.png +0 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/mx.png +0 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/my.png +0 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/mz.png +0 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/na.png +0 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/nc.png +0 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/ne.png +0 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/nf.png +0 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/ng.png +0 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/ni.png +0 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/nl.png +0 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/no.png +0 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/np.png +0 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/nr.png +0 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/nu.png +0 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/nz.png +0 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/om.png +0 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/pa.png +0 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/pe.png +0 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/pf.png +0 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/pg.png +0 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/ph.png +0 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/pk.png +0 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/pl.png +0 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/pm.png +0 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/pn.png +0 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/pr.png +0 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/ps.png +0 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/pt.png +0 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/pw.png +0 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/py.png +0 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/qa.png +0 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/re.png +0 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/ro.png +0 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/rs.png +0 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/ru.png +0 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/rw.png +0 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/sa.png +0 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/sb.png +0 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/sc.png +0 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/scotland.png +0 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/sd.png +0 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/se.png +0 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/sg.png +0 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/sh.png +0 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/si.png +0 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/sj.png +0 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/sk.png +0 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/sl.png +0 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/sm.png +0 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/sn.png +0 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/so.png +0 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/sr.png +0 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/st.png +0 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/sv.png +0 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/sy.png +0 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/sz.png +0 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/tc.png +0 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/td.png +0 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/tf.png +0 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/tg.png +0 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/th.png +0 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/tj.png +0 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/tk.png +0 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/tl.png +0 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/tm.png +0 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/tn.png +0 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/to.png +0 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/tr.png +0 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/tt.png +0 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/tv.png +0 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/tw.png +0 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/tz.png +0 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/ua.png +0 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/ug.png +0 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/um.png +0 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/us.png +0 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/uy.png +0 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/uz.png +0 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/va.png +0 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/vc.png +0 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/ve.png +0 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/vg.png +0 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/vi.png +0 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/vn.png +0 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/vu.png +0 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/wales.png +0 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/wf.png +0 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/ws.png +0 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/ye.png +0 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/yt.png +0 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/za.png +0 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/zm.png +0 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/img/flags/zw.png +0 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/lib/linkbrowser-plugin.js +161 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/nls/ca/i18n.js +6 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/nls/de/i18n.js +6 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/nls/i18n.js +15 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/nls/mk/i18n.js +6 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/nls/pt-br/i18n.js +6 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/nls/ru/i18n.js +6 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/nls/uk/i18n.js +6 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/linkbrowser/nls/zh-hans/i18n.js +6 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/linkchecker/nls/ca/i18n.js +28 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/linkchecker/nls/de/i18n.js +28 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/linkchecker/nls/i18n.js +37 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/linkchecker/nls/mk/i18n.js +28 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/linkchecker/nls/pt-br/i18n.js +28 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/linkchecker/nls/ru/i18n.js +28 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/linkchecker/nls/uk/i18n.js +28 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/linkchecker/nls/zh-hans/i18n.js +28 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/linkchecker/package.json +1 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/linkchecker/proxy.php.example +244 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/linkchecker/src/linkchecker.css +14 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/linkchecker/src/linkchecker.js +269 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/listenforcer/lib/listenforcer-plugin.js +190 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/metaview/README +0 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/metaview/css/metaview.css +78 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/metaview/img/anchor.png +0 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/metaview/img/blockquote.png +0 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/metaview/img/button.png +0 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/metaview/img/caption.png +0 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/metaview/img/cite.png +0 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/metaview/img/dd.png +0 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/metaview/img/div.png +0 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/metaview/img/dl.png +0 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/metaview/img/dt.png +0 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/metaview/img/h1.png +0 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/metaview/img/h2.png +0 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/metaview/img/h3.png +0 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/metaview/img/h4.png +0 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/metaview/img/h5.png +0 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/metaview/img/h6.png +0 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/metaview/img/hr.png +0 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/metaview/img/icon_cite.png +0 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/metaview/img/p.png +0 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/metaview/img/pre.png +0 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/metaview/img/table.png +0 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/metaview/img/td.png +0 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/metaview/img/th.png +0 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/metaview/lib/metaview-plugin.js +185 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/metaview/nls/ca/i18n.js +3 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/metaview/nls/de/i18n.js +3 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/metaview/nls/i18n.js +12 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/metaview/nls/mk/i18n.js +3 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/metaview/nls/pt-br/i18n.js +3 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/metaview/nls/ru/i18n.js +3 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/metaview/nls/uk/i18n.js +3 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/metaview/nls/zh-hans/i18n.js +3 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/numerated-headers/README +0 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/numerated-headers/css/numerated-headers.css +7 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/numerated-headers/img/headers.png +0 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/numerated-headers/lib/numerated-headers-plugin.js +421 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/numerated-headers/nls/ca/i18n.js +5 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/numerated-headers/nls/de/i18n.js +6 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/numerated-headers/nls/i18n.js +15 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/numerated-headers/nls/mk/i18n.js +5 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/numerated-headers/nls/pt-br/i18n.js +5 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/numerated-headers/nls/ru/i18n.js +5 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/numerated-headers/nls/uk/i18n.js +5 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/numerated-headers/nls/zh-hans/i18n.js +5 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/profiler/css/profiler.css +34 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/profiler/lib/profiler-plugin.js +304 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/ribbon/README.md +8 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/ribbon/css/ribbon.css +54 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/ribbon/img/fade-in.png +0 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/ribbon/img/fade-out.png +0 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/ribbon/lib/ribbon-plugin.js +144 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/ribbon/package.json +1 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/sourceview/css/sourceview.css +18 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/sourceview/lib/sourceview-plugin.js +252 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/sourceview/vendor/htmlbeautifier.js +468 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/textcolor/css/textcolor.css +65 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/textcolor/img/icon.png +0 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/textcolor/lib/textcolor-plugin.js +420 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/textcolor/nls/de/i18n.js +3 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/textcolor/nls/i18n.js +6 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/toc/lib/toc-plugin.js +399 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/toc/nls/ca/i18n.js +3 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/toc/nls/de/i18n.js +3 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/toc/nls/i18n.js +12 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/toc/nls/mk/i18n.js +3 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/toc/nls/pt-br/i18n.js +3 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/toc/nls/ru/i18n.js +3 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/toc/nls/uk/i18n.js +3 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/toc/nls/zh-hans/i18n.js +3 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/toc/package.json +1 -0
- data/vendor/assets/javascripts/aloha/plugins/extra/validation/lib/validation-plugin.js +277 -0
- data/vendor/assets/stylesheets/aloha-common-extra.css +24 -0
- data/vendor/assets/stylesheets/aloha-core.css +19 -0
- data/vendor/assets/stylesheets/aloha-reset.css +24 -0
- data/vendor/assets/stylesheets/aloha-sidebar.css +296 -0
- data/vendor/assets/stylesheets/aloha.css +31 -0
- metadata +898 -0
@@ -0,0 +1,1277 @@
|
|
1
|
+
/* block.js is part of Aloha Editor project http://aloha-editor.org
|
2
|
+
*
|
3
|
+
* Aloha Editor is a WYSIWYG HTML5 inline editing library and editor.
|
4
|
+
* Copyright (c) 2010-2012 Gentics Software GmbH, Vienna, Austria.
|
5
|
+
* Contributors http://aloha-editor.org/contribution.php
|
6
|
+
*
|
7
|
+
* Aloha Editor is free software; you can redistribute it and/or
|
8
|
+
* modify it under the terms of the GNU General Public License
|
9
|
+
* as published by the Free Software Foundation; either version 2
|
10
|
+
* of the License, or any later version.
|
11
|
+
*
|
12
|
+
* Aloha Editor is distributed in the hope that it will be useful,
|
13
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
14
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
15
|
+
* GNU General Public License for more details.
|
16
|
+
*
|
17
|
+
* You should have received a copy of the GNU General Public License
|
18
|
+
* along with this program; if not, write to the Free Software
|
19
|
+
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
20
|
+
*
|
21
|
+
* As an additional permission to the GNU GPL version 2, you may distribute
|
22
|
+
* non-source (e.g., minimized or compacted) forms of the Aloha-Editor
|
23
|
+
* source code without the copy of the GNU GPL normally required,
|
24
|
+
* provided you include this license notice and a URL through which
|
25
|
+
* recipients can access the Corresponding Source.
|
26
|
+
*/
|
27
|
+
/**
|
28
|
+
* Module which contains the base class for Blocks, and a Default/Debug block.
|
29
|
+
*
|
30
|
+
* @name block.block
|
31
|
+
* @namespace block/block
|
32
|
+
*/
|
33
|
+
define([
|
34
|
+
'aloha',
|
35
|
+
'jquery',
|
36
|
+
'block/blockmanager',
|
37
|
+
'aloha/observable',
|
38
|
+
'ui/scopes',
|
39
|
+
'util/class',
|
40
|
+
'PubSub'
|
41
|
+
], function(
|
42
|
+
Aloha,
|
43
|
+
jQuery,
|
44
|
+
BlockManager,
|
45
|
+
Observable,
|
46
|
+
Scopes,
|
47
|
+
Class,
|
48
|
+
PubSub
|
49
|
+
){
|
50
|
+
'use strict';
|
51
|
+
|
52
|
+
var GENTICS = window.GENTICS;
|
53
|
+
|
54
|
+
/**
|
55
|
+
* An aloha block has the following special properties, being readable through the
|
56
|
+
* "attr" function:
|
57
|
+
* - aloha-block-type -- TYPE of the AlohaBlock as registered by the BlockManager
|
58
|
+
*
|
59
|
+
* @name block.block.AbstractBlock
|
60
|
+
* @class An abstract block that must be used as a base class for custom blocks
|
61
|
+
*/
|
62
|
+
var AbstractBlock = Class.extend(Observable,
|
63
|
+
/** @lends block.block.AbstractBlock */
|
64
|
+
{
|
65
|
+
|
66
|
+
/**
|
67
|
+
* Event which is triggered if the block attributes change.
|
68
|
+
*
|
69
|
+
* @name block.block.AbstractBlock#change
|
70
|
+
* @event
|
71
|
+
*/
|
72
|
+
|
73
|
+
/**
|
74
|
+
* Title of the block, used to display the name in the sidebar editor.
|
75
|
+
*
|
76
|
+
* @type String
|
77
|
+
* @api
|
78
|
+
*/
|
79
|
+
title: null,
|
80
|
+
|
81
|
+
/**
|
82
|
+
* Id of the underlying $element, used to identify the block.
|
83
|
+
* @type String
|
84
|
+
*/
|
85
|
+
id: null,
|
86
|
+
|
87
|
+
/**
|
88
|
+
* The wrapping element of the block.
|
89
|
+
* @type jQuery
|
90
|
+
* @api
|
91
|
+
*/
|
92
|
+
$element: null,
|
93
|
+
|
94
|
+
/**
|
95
|
+
* if TRUE, the rendering is currently taking place. Used to prevent recursion
|
96
|
+
* errors.
|
97
|
+
* @type Boolean
|
98
|
+
*/
|
99
|
+
_currentlyRendering: false,
|
100
|
+
|
101
|
+
/**
|
102
|
+
* set to TRUE once the block is fully initialized.
|
103
|
+
*
|
104
|
+
* @type Boolean
|
105
|
+
*/
|
106
|
+
_initialized: false,
|
107
|
+
|
108
|
+
/**
|
109
|
+
* Set to TRUE if the last click activated a *nested editable*.
|
110
|
+
* If FALSE; the block itself is selected.
|
111
|
+
* This is needed when a block is deleted in IE7/8.
|
112
|
+
*/
|
113
|
+
_isInsideNestedEditable: false,
|
114
|
+
|
115
|
+
/**************************
|
116
|
+
* SECTION: Initialization and Lifecycle
|
117
|
+
**************************/
|
118
|
+
|
119
|
+
/**
|
120
|
+
* Initialize the basic block. Do not call directly; instead use jQuery(...).alohaBlock() to
|
121
|
+
* create new blocks.
|
122
|
+
*
|
123
|
+
* This function shall only be called through the BlockManager. See BlockManager::_blockify().
|
124
|
+
*
|
125
|
+
* When a block is fully initialized, an "aloha.block.initialized"
|
126
|
+
* message is published.
|
127
|
+
*
|
128
|
+
* @param {jQuery} $element Element that declares the block
|
129
|
+
* @param {Object} attributes that shall be set to the block
|
130
|
+
* @constructor
|
131
|
+
*/
|
132
|
+
_constructor: function ($element, attributes) {
|
133
|
+
var that = this;
|
134
|
+
|
135
|
+
this.$element = $element;
|
136
|
+
|
137
|
+
if ($element.attr('id')) {
|
138
|
+
this.id = $element.attr('id');
|
139
|
+
} else {
|
140
|
+
this.id = GENTICS.Utils.guid();
|
141
|
+
$element.attr('id', this.id);
|
142
|
+
}
|
143
|
+
|
144
|
+
$element.contentEditable(false);
|
145
|
+
|
146
|
+
$element.addClass('aloha-block');
|
147
|
+
|
148
|
+
if (this.isDraggable()) {
|
149
|
+
// Remove default drag/drop behavior of the browser
|
150
|
+
$element.find('img').attr('draggable', 'false');
|
151
|
+
$element.find('a').attr('draggable', 'false');
|
152
|
+
}
|
153
|
+
|
154
|
+
// set the attributes
|
155
|
+
jQuery.each(attributes, function (k, v) {
|
156
|
+
that._setAttribute(k, v);
|
157
|
+
});
|
158
|
+
|
159
|
+
// While the event handler is defined here, it is connected to the DOM element inside "_connectThisBlockToDomElement"
|
160
|
+
this._onElementClickHandler = function (event) {
|
161
|
+
// We only activate ourselves if we are the innermost aloha-block.
|
162
|
+
// If we are not the innermost aloha-block, we get highlighted (but not activated) automatically
|
163
|
+
// by the innermost block.
|
164
|
+
if (jQuery(event.target).closest('.aloha-block').get(0) === that.$element.get(0)) {
|
165
|
+
that._fixScrollPositionBugsInIE();
|
166
|
+
that.activate(event.target, event);
|
167
|
+
}
|
168
|
+
};
|
169
|
+
|
170
|
+
// Register event handlers on the block
|
171
|
+
this._connectThisBlockToDomElement($element, function () {
|
172
|
+
PubSub.pub('aloha.block.initialized', {block: that});
|
173
|
+
});
|
174
|
+
|
175
|
+
// This is executed when a block is selected through caret handling
|
176
|
+
// TODO!
|
177
|
+
//Aloha.bind('aloha-block-selected', function(event,obj) {
|
178
|
+
// if (that.$element.get(0) === obj) {
|
179
|
+
// that.activate();
|
180
|
+
// }
|
181
|
+
//});
|
182
|
+
|
183
|
+
this._initialized = true;
|
184
|
+
},
|
185
|
+
|
186
|
+
/**
|
187
|
+
* Is set inside the constructor to the event handler function
|
188
|
+
* which should be executed when the element is clicked.
|
189
|
+
*
|
190
|
+
* NOTE: Purely internal, "this" is not available inside this method!
|
191
|
+
*/
|
192
|
+
_onElementClickHandler: null,
|
193
|
+
|
194
|
+
/**
|
195
|
+
* We need to tell Aloha that we handle the event already;
|
196
|
+
* else a selection of a nested editable will *not* select
|
197
|
+
* the block.
|
198
|
+
*
|
199
|
+
* This callback is bound to the mousedown, focus and dblclick events.
|
200
|
+
*
|
201
|
+
* NOTE: Purely internal, "this" is not available inside this method!
|
202
|
+
*/
|
203
|
+
_preventSelectionChangedEventHandler: function ($event) {
|
204
|
+
if (('dblclick' !== $event.type)
|
205
|
+
&& !jQuery($event.target).is('.aloha-editable')) {
|
206
|
+
Aloha.Selection.preventSelectionChanged();
|
207
|
+
}
|
208
|
+
},
|
209
|
+
|
210
|
+
/**
|
211
|
+
* This method connects this block object to the passed DOM element.
|
212
|
+
* In detail, this method does the following:
|
213
|
+
*
|
214
|
+
* - if this.$element is already set, remove all block event handlers
|
215
|
+
* - sets this.$element = jQuery(newElement)
|
216
|
+
* - initialize event listeners on this.$element
|
217
|
+
* - call init()
|
218
|
+
*
|
219
|
+
* The method is called in two contexts: First, when a block is constructed
|
220
|
+
* to initialize the event listeners etc. Second, it is ALSO called when
|
221
|
+
* a block inside a nested block with editable in between is detected
|
222
|
+
* as inconsistent.
|
223
|
+
*/
|
224
|
+
_connectThisBlockToDomElement: function(newElement, callback) {
|
225
|
+
var that = this;
|
226
|
+
var $newElement = jQuery(newElement);
|
227
|
+
this._disconnectFromDomElement();
|
228
|
+
this.$element = $newElement;
|
229
|
+
|
230
|
+
this.$element.bind('click', this._onElementClickHandler);
|
231
|
+
this.$element.bind('mousedown', this._preventSelectionChangedEventHandler);
|
232
|
+
this.$element.bind('focus', this._preventSelectionChangedEventHandler);
|
233
|
+
this.$element.bind('dblclick', this._preventSelectionChangedEventHandler);
|
234
|
+
|
235
|
+
this.init(this.$element, function() {
|
236
|
+
// WORKAROUND against loading order dependencies. If we have
|
237
|
+
// nested Blocks inside each other (with no editables in between)
|
238
|
+
// it could be that the *inner* block is initialized *before* the outer one.
|
239
|
+
//
|
240
|
+
// However, the inner block needs to know whether it shall render drag handles or not,
|
241
|
+
// and this depends on whether it is inside an editable or a block.
|
242
|
+
//
|
243
|
+
// In order to fix this case, we delay the the drag-handle-rendering (and all the other
|
244
|
+
// post-processing) to the next JavaScript Run Loop using a small timeout.
|
245
|
+
window.setTimeout(function() {
|
246
|
+
that._postProcessElementIfNeeded();
|
247
|
+
if (callback) {
|
248
|
+
callback();
|
249
|
+
}
|
250
|
+
}, 5);
|
251
|
+
});
|
252
|
+
},
|
253
|
+
|
254
|
+
/**
|
255
|
+
* Disconnect the block from the DOM element
|
256
|
+
*/
|
257
|
+
_disconnectFromDomElement: function() {
|
258
|
+
if (this.$element) {
|
259
|
+
this.$element.unbind('click', this._onElementClickHandler);
|
260
|
+
this.$element.unbind('mousedown', this._preventSelectionChangedEventHandler);
|
261
|
+
this.$element.unbind('focus', this._preventSelectionChangedEventHandler);
|
262
|
+
this.$element.unbind('dblclick', this._preventSelectionChangedEventHandler);
|
263
|
+
}
|
264
|
+
},
|
265
|
+
|
266
|
+
/**
|
267
|
+
* IE HACK: Our beloved Internet Explorer sometimes scrolls to the top
|
268
|
+
* of the page when activating an aloha block, and on numerous other occasions
|
269
|
+
* like when an <span> block is moved via drag/drop.
|
270
|
+
*
|
271
|
+
* We can detect this and scroll right back; although this will flicker
|
272
|
+
* a little (but still a lot better than before)
|
273
|
+
*/
|
274
|
+
_fixScrollPositionBugsInIE: function() {
|
275
|
+
var scrollPositionBefore = jQuery(window).scrollTop();
|
276
|
+
window.setTimeout(function() {
|
277
|
+
if (jQuery(window).scrollTop() !== scrollPositionBefore) {
|
278
|
+
jQuery(window).scrollTop(scrollPositionBefore);
|
279
|
+
}
|
280
|
+
}, 10);
|
281
|
+
},
|
282
|
+
/**
|
283
|
+
* Template method to initialize the block. Can be used to set attributes
|
284
|
+
* on the block, depending on the block contents. You will most probably
|
285
|
+
* use $element and this.attr() inside this function.
|
286
|
+
*
|
287
|
+
* !!! This method can be called *multiple times*, as it is called each time
|
288
|
+
* when $element has been disconnected from the DOM (which can happen because of various reasons)
|
289
|
+
* and the block needs to re-initialize. So make sure this method can be called *MULTIPLE TIMES*
|
290
|
+
* and always returns predictable results. This method must be idempotent, same as update().
|
291
|
+
*
|
292
|
+
* Furthermore, always when this method is finished, you need to call postProcessFn() afterwards.
|
293
|
+
* This function adds drag handles and other controls if necessary.
|
294
|
+
*
|
295
|
+
* @param {jQuery} $element a shortcut to the block's DOM element (this.$element) for easy processing
|
296
|
+
* @param {Function} postProcessFn this function MUST be called at all times the $element has been updated; as it adds drag/drop/delete/... handles if necessary
|
297
|
+
* @api
|
298
|
+
*/
|
299
|
+
init: function($element, postProcessFn) {
|
300
|
+
postProcessFn();
|
301
|
+
},
|
302
|
+
|
303
|
+
/**
|
304
|
+
* Callback which is executed when somebody triggers destroy().
|
305
|
+
*
|
306
|
+
* This only allows destruction if the block is *inside* an aloha-editable and *not* inside an aloha-block.
|
307
|
+
*
|
308
|
+
* @return {Boolean} true of destruction should happen, false otherwise
|
309
|
+
*/
|
310
|
+
shouldDestroy: function() {
|
311
|
+
var $closest = this.$element.parent().closest('.aloha-block,.aloha-editable,.aloha-block-collection');
|
312
|
+
if ($closest.hasClass('aloha-block-collection') && this.$element[0].tagName.toLowerCase() === 'div') {
|
313
|
+
return true;
|
314
|
+
} else {
|
315
|
+
return $closest.hasClass('aloha-editable');
|
316
|
+
}
|
317
|
+
},
|
318
|
+
|
319
|
+
/**
|
320
|
+
* Destroy this block instance completely. Removes the element from the DOM,
|
321
|
+
* unregisters it, and triggers a block-delete event on the BlockManager.
|
322
|
+
*
|
323
|
+
* @param {Boolean} force TRUE if you want to force deletion, despite shouldDestroy() returning false.
|
324
|
+
* @api
|
325
|
+
*/
|
326
|
+
destroy: function(force) {
|
327
|
+
if (!this.shouldDestroy() && force !== true) return;
|
328
|
+
|
329
|
+
var that = this;
|
330
|
+
var newRange = new GENTICS.Utils.RangeObject();
|
331
|
+
|
332
|
+
newRange.startContainer = newRange.endContainer = this.$element.parent()[0];
|
333
|
+
newRange.startOffset = newRange.endOffset = GENTICS.Utils.Dom.getIndexInParent(this.$element[0]);
|
334
|
+
|
335
|
+
BlockManager.trigger('block-delete', this);
|
336
|
+
this.free();
|
337
|
+
|
338
|
+
var isInlineElement = this.$element[0].tagName.toLowerCase() === 'span';
|
339
|
+
|
340
|
+
this.$element.fadeOut('fast', function() {
|
341
|
+
that.$element.remove();
|
342
|
+
BlockManager.trigger('block-selection-change', []);
|
343
|
+
window.setTimeout(function() {
|
344
|
+
if (isInlineElement) {
|
345
|
+
newRange.select();
|
346
|
+
}
|
347
|
+
}, 5);
|
348
|
+
});
|
349
|
+
},
|
350
|
+
|
351
|
+
/**
|
352
|
+
* Remove this block, but leave the original DOM element
|
353
|
+
*/
|
354
|
+
unblock: function () {
|
355
|
+
// TODO set old value of contentEditable
|
356
|
+
// TODO set old values for draggable attributes
|
357
|
+
|
358
|
+
// deactivate
|
359
|
+
this.deactivate();
|
360
|
+
// remove handlers
|
361
|
+
this._disconnectFromDomElement();
|
362
|
+
// remove block class
|
363
|
+
this.$element.removeClass('aloha-block');
|
364
|
+
// remove block handles
|
365
|
+
this.$element.children('.aloha-block-handle').remove();
|
366
|
+
// unregister the block
|
367
|
+
this.free();
|
368
|
+
},
|
369
|
+
|
370
|
+
/**
|
371
|
+
* Free internal state associated with this block.
|
372
|
+
*
|
373
|
+
* Should be called when a block is not used any more to prevent
|
374
|
+
* memory leaks.
|
375
|
+
*
|
376
|
+
* Any invokations of instance methods after this method has
|
377
|
+
* been called will result in undefined behaviour.
|
378
|
+
*
|
379
|
+
* @api
|
380
|
+
*/
|
381
|
+
free: function () {
|
382
|
+
BlockManager._unregisterBlock(this);
|
383
|
+
this.unbindAll();
|
384
|
+
},
|
385
|
+
|
386
|
+
/**************************
|
387
|
+
* SECTION: Getters and Helpers
|
388
|
+
**************************/
|
389
|
+
|
390
|
+
/**
|
391
|
+
* Get the id of the block
|
392
|
+
* @returns {String}
|
393
|
+
*/
|
394
|
+
getId: function() {
|
395
|
+
return this.id;
|
396
|
+
},
|
397
|
+
|
398
|
+
/**
|
399
|
+
* Get a schema of attributes which shall be rendered / edited
|
400
|
+
* in the sidebar.
|
401
|
+
*
|
402
|
+
* @api
|
403
|
+
* @returns {Object}
|
404
|
+
*/
|
405
|
+
getSchema: function() {
|
406
|
+
return null;
|
407
|
+
},
|
408
|
+
|
409
|
+
/**
|
410
|
+
* Template Method which should return the block title. Needed for editing sidebar.
|
411
|
+
* By default, the block title is returned.
|
412
|
+
*
|
413
|
+
* @api
|
414
|
+
*/
|
415
|
+
getTitle: function() {
|
416
|
+
return this.title;
|
417
|
+
},
|
418
|
+
|
419
|
+
/**
|
420
|
+
* Returns true if the block is draggable because it is inside an aloha-editable, false otherwise.
|
421
|
+
*
|
422
|
+
* You cannot depend on this method's result during the *init* phase of the Aloha Block, as the
|
423
|
+
* outer block might not be initialized at that point yet. Thus, do not call this method inside init().
|
424
|
+
*
|
425
|
+
* @return Boolean
|
426
|
+
*/
|
427
|
+
isDraggable: function() {
|
428
|
+
if (this.$element[0].tagName.toLowerCase() === 'div' && this.$element.parents('.aloha-editable,.aloha-block,.aloha-block-collection').first().hasClass('aloha-block-collection')) {
|
429
|
+
// Here, we are inside an aloha-block-collection, and thus also need to be draggable.
|
430
|
+
return true;
|
431
|
+
}
|
432
|
+
return this.$element.parents('.aloha-editable,.aloha-block').first().hasClass('aloha-editable');
|
433
|
+
},
|
434
|
+
|
435
|
+
/**************************
|
436
|
+
* SECTION: Activation / Deactivation
|
437
|
+
**************************/
|
438
|
+
|
439
|
+
/**
|
440
|
+
* activates the block
|
441
|
+
* will select the block's contents, highlight it, update the floating menu and update the sidebar (if needed).
|
442
|
+
*
|
443
|
+
* When calling programmatically, do not set eventTarget or event arguments.
|
444
|
+
* @api
|
445
|
+
*/
|
446
|
+
activate: function(eventTarget, event) {
|
447
|
+
var highlightedBlocks = [];
|
448
|
+
|
449
|
+
// Deactivate currently highlighted blocks
|
450
|
+
jQuery.each(BlockManager._getHighlightedBlocks(), function() {
|
451
|
+
this.deactivate();
|
452
|
+
});
|
453
|
+
|
454
|
+
// Activate current block
|
455
|
+
if (this.$element.attr('data-block-skip-scope') !== 'true') {
|
456
|
+
Scopes.setScope('Aloha.Block.' + this.attr('aloha-block-type'));
|
457
|
+
}
|
458
|
+
this.$element.addClass('aloha-block-active');
|
459
|
+
this._highlight();
|
460
|
+
highlightedBlocks.push(this);
|
461
|
+
|
462
|
+
// Highlight parent blocks
|
463
|
+
this.$element.parents('.aloha-block').each(function() {
|
464
|
+
var block = BlockManager.getBlock(this);
|
465
|
+
if (block) {
|
466
|
+
block._highlight();
|
467
|
+
highlightedBlocks.push(block);
|
468
|
+
}
|
469
|
+
});
|
470
|
+
|
471
|
+
// Browsers do not remove the cursor, so we enforce it when an aditable is clicked.
|
472
|
+
// However, when the user clicked inside a nested editable, we will not remove the cursor (as the user wants to start typing then)
|
473
|
+
// small HACK: we also do not deactivate if we are inside an aloha-table-cell-editable.
|
474
|
+
if (jQuery(eventTarget).closest('.aloha-editable,.aloha-block,.aloha-table-cell-editable,.aloha-table-cell_active').first().hasClass('aloha-block')) {
|
475
|
+
this._isInsideNestedEditable = false;
|
476
|
+
Aloha.getSelection().removeAllRanges();
|
477
|
+
} else {
|
478
|
+
this._isInsideNestedEditable = true;
|
479
|
+
if (event) {
|
480
|
+
// We now update the selection, as you clicked *inside* an editable inside the block
|
481
|
+
Aloha.Selection.updateSelection(event);
|
482
|
+
}
|
483
|
+
}
|
484
|
+
// Trigger block activate & selection change events.
|
485
|
+
BlockManager.trigger('block-activate', highlightedBlocks);
|
486
|
+
BlockManager.trigger('block-selection-change', highlightedBlocks);
|
487
|
+
},
|
488
|
+
|
489
|
+
/**
|
490
|
+
* Deactive the block
|
491
|
+
*/
|
492
|
+
deactivate: function() {
|
493
|
+
var that = this;
|
494
|
+
var deactivatedBlocks = [this];
|
495
|
+
this._unhighlight();
|
496
|
+
this.$element.parents('.aloha-block').each(function() {
|
497
|
+
deactivatedBlocks.push(this);
|
498
|
+
that._unhighlight();
|
499
|
+
});
|
500
|
+
|
501
|
+
this.$element.removeClass('aloha-block-active');
|
502
|
+
|
503
|
+
// Trigger block deactivate & selection change events.
|
504
|
+
BlockManager.trigger('block-deactivate', deactivatedBlocks);
|
505
|
+
BlockManager.trigger('block-selection-change', []);
|
506
|
+
},
|
507
|
+
|
508
|
+
/**
|
509
|
+
* @returns {Boolean} True if this block is active
|
510
|
+
*/
|
511
|
+
isActive: function() {
|
512
|
+
return this.$element.hasClass('aloha-block-active');
|
513
|
+
},
|
514
|
+
|
515
|
+
/**
|
516
|
+
* Internal helper which sets a block as highlighted, because the block itself
|
517
|
+
* or a child block has been activated.
|
518
|
+
*/
|
519
|
+
_highlight: function() {
|
520
|
+
this.$element.addClass('aloha-block-highlighted');
|
521
|
+
BlockManager._setHighlighted(this);
|
522
|
+
},
|
523
|
+
|
524
|
+
/**
|
525
|
+
* Internal helper which sets a block as un-highlighted.
|
526
|
+
*/
|
527
|
+
_unhighlight: function() {
|
528
|
+
this.$element.removeClass('aloha-block-highlighted');
|
529
|
+
BlockManager._setUnhighlighted(this);
|
530
|
+
},
|
531
|
+
|
532
|
+
/**************************
|
533
|
+
* SECTION: Block Rendering
|
534
|
+
**************************/
|
535
|
+
|
536
|
+
/**
|
537
|
+
* Internal _update method, which needs to be called internally if a property
|
538
|
+
* changed. This is just a wrapper around update().
|
539
|
+
*/
|
540
|
+
_update: function() {
|
541
|
+
var that = this;
|
542
|
+
if (this._currentlyRendering) return;
|
543
|
+
if (!this._initialized) return;
|
544
|
+
|
545
|
+
this._currentlyRendering = true;
|
546
|
+
|
547
|
+
this.update(this.$element, function() {
|
548
|
+
that._postProcessElementIfNeeded();
|
549
|
+
});
|
550
|
+
|
551
|
+
this._currentlyRendering = false;
|
552
|
+
},
|
553
|
+
|
554
|
+
/**
|
555
|
+
* Template method to render contents of the block, must be implemented by specific block type.
|
556
|
+
* $element can be augumented by additional DOM elements like drag/drop handles. If you do
|
557
|
+
* any jQuery selection, you need to ignore all results which have a "aloha-block-handle" class
|
558
|
+
* set.
|
559
|
+
*
|
560
|
+
* Furthermore, always when you update $element, you need to call postProcessFn() afterwards.
|
561
|
+
* This function adds drag handles and other controls if necessary.
|
562
|
+
*
|
563
|
+
* This method should *only* be called from the internal _update method.
|
564
|
+
*
|
565
|
+
* @param {jQuery} $element a shortcut to the block's DOM element (this.$element) for easy processing
|
566
|
+
* @param {Function} postProcessFn this function MUST be called at all times the $element has been updated; as it adds drag/drop/delete/... handles if necessary
|
567
|
+
*
|
568
|
+
* @api
|
569
|
+
*/
|
570
|
+
update: function($element, postProcessFn) {
|
571
|
+
postProcessFn();
|
572
|
+
},
|
573
|
+
|
574
|
+
|
575
|
+
/**
|
576
|
+
* Post processor, being called to augument the Block Element's DOM by drag handles etc.
|
577
|
+
*
|
578
|
+
* This method must be idempotent. I.e. it must produce the same results
|
579
|
+
* when called once or twice.
|
580
|
+
*/
|
581
|
+
_postProcessElementIfNeeded: function() {
|
582
|
+
this.createEditablesIfNeeded();
|
583
|
+
this._checkThatNestedBlocksAreStillConsistent();
|
584
|
+
this._makeNestedBlockCollectionsSortable();
|
585
|
+
|
586
|
+
this.renderBlockHandlesIfNeeded();
|
587
|
+
if (this.isDraggable() && this.$element[0].tagName.toLowerCase() === 'span') {
|
588
|
+
this._setupDragDropForInlineElements();
|
589
|
+
this._disableUglyInternetExplorerDragHandles();
|
590
|
+
} else if (this.isDraggable() && this.$element[0].tagName.toLowerCase() === 'div') {
|
591
|
+
this._setupDragDropForBlockElements();
|
592
|
+
this._disableUglyInternetExplorerDragHandles();
|
593
|
+
}
|
594
|
+
this._hideDragHandlesIfDragDropDisabled();
|
595
|
+
this._attachDropzoneHighlightEvents();
|
596
|
+
},
|
597
|
+
|
598
|
+
/**
|
599
|
+
* Due to indeterminate initialization order of nested blocks,
|
600
|
+
* it can happen that blockifying a parent block deconnects $element inside
|
601
|
+
* child blocks.
|
602
|
+
*
|
603
|
+
* This is the case we detect here; and if it happens, we reconnect the
|
604
|
+
* block to its currently visible DOM element.
|
605
|
+
*/
|
606
|
+
_checkThatNestedBlocksAreStillConsistent: function() {
|
607
|
+
this.$element.find('.aloha-block').each(function() {
|
608
|
+
var block = BlockManager.getBlock(this);
|
609
|
+
if (block && block.$element[0] !== this) {
|
610
|
+
block._connectThisBlockToDomElement(this);
|
611
|
+
}
|
612
|
+
});
|
613
|
+
},
|
614
|
+
|
615
|
+
/**
|
616
|
+
* If a nested element is marked as "aloha-block-collection",
|
617
|
+
* we want to make it sortable, by calling the appropriate Block Manager
|
618
|
+
* function.
|
619
|
+
*/
|
620
|
+
_makeNestedBlockCollectionsSortable: function() {
|
621
|
+
var that = this;
|
622
|
+
this.$element.find('.aloha-block-collection').each(function() {
|
623
|
+
var $blockCollection = jQuery(this);
|
624
|
+
if ($blockCollection.closest('.aloha-block').get(0) === that.$element.get(0)) {
|
625
|
+
// We are only responsible for one-level-down Block Collections, not
|
626
|
+
// for nested ones.
|
627
|
+
BlockManager.createBlockLevelSortableForEditableOrBlockCollection($blockCollection);
|
628
|
+
}
|
629
|
+
})
|
630
|
+
},
|
631
|
+
|
632
|
+
/**
|
633
|
+
* Helper which disables the ugly IE drag handles. They are still shown, but at
|
634
|
+
* least they do not work anymore
|
635
|
+
*/
|
636
|
+
_disableUglyInternetExplorerDragHandles: function() {
|
637
|
+
if (jQuery.browser.msie) {
|
638
|
+
this.$element.get( 0 ).onresizestart = function ( e ) { return false; };
|
639
|
+
this.$element.get( 0 ).oncontrolselect = function ( e ) { return false; };
|
640
|
+
// We do NOT abort the "ondragstart" event as it is required for drag/drop.
|
641
|
+
this.$element.get( 0 ).onmovestart = function ( e ) { return false; };
|
642
|
+
// We do NOT abort the "onselectstart" event because this would disable selection in nested editables
|
643
|
+
}
|
644
|
+
},
|
645
|
+
|
646
|
+
/**
|
647
|
+
* Removes the draghandle class from block handle,
|
648
|
+
* if drag & drop is disabled for the editable
|
649
|
+
*/
|
650
|
+
_hideDragHandlesIfDragDropDisabled: function() {
|
651
|
+
if ( !this._dd_isDragdropEnabled() ){
|
652
|
+
this.$element.find('.aloha-block-draghandle').each(function () {
|
653
|
+
var $draghandle = jQuery(this);
|
654
|
+
if (!isDragdropEnabledForElement($draghandle)) {
|
655
|
+
$draghandle.removeClass('aloha-block-draghandle');
|
656
|
+
}
|
657
|
+
});
|
658
|
+
}
|
659
|
+
},
|
660
|
+
|
661
|
+
/**
|
662
|
+
* Attach mousedown/up events to block's draghandle
|
663
|
+
* to toggle dropzones when dragging starts and ends.
|
664
|
+
*/
|
665
|
+
_attachDropzoneHighlightEvents: function() {
|
666
|
+
var that = this;
|
667
|
+
|
668
|
+
this.$element.delegate( ".aloha-block-draghandle", "mousedown", function() {
|
669
|
+
var dropzones = that.$element.parents( ".aloha-editable" ).first().data( "block-dropzones" ) || [];
|
670
|
+
jQuery.each( dropzones, function(i, editable_selector) {
|
671
|
+
var editables = jQuery( editable_selector );
|
672
|
+
jQuery( editables ).each(function() {
|
673
|
+
if (jQuery( this ).data( "block-dragdrop" )) {
|
674
|
+
jQuery( this ).addClass( "aloha-block-dropzone" );
|
675
|
+
}
|
676
|
+
});
|
677
|
+
});
|
678
|
+
|
679
|
+
// Remove the dropzones as soon as the mouse is released,
|
680
|
+
// irrespective of where the drop took place.
|
681
|
+
jQuery( document ).one( "mouseup.aloha-block-dropzone", function(e) {
|
682
|
+
var dropzones = that.$element.parents( ".aloha-editable" ).first().data( "block-dropzones" ) || [];
|
683
|
+
jQuery.each( dropzones, function(i, editable_selector) {
|
684
|
+
jQuery( editable_selector ).removeClass( "aloha-block-dropzone" );
|
685
|
+
});
|
686
|
+
});
|
687
|
+
});
|
688
|
+
},
|
689
|
+
|
690
|
+
/**************************
|
691
|
+
* SECTION: Drag&Drop for INLINE elements
|
692
|
+
**************************/
|
693
|
+
_setupDragDropForInlineElements: function() {
|
694
|
+
var that = this;
|
695
|
+
|
696
|
+
// Here, we store the character DOM element which has been hovered upon recently.
|
697
|
+
// This is needed as somehow, the "drop" event on the character is not fired.
|
698
|
+
// Furthermore, we use it to know whether we need to "revert" the draggable to the original state or not.
|
699
|
+
var lastHoveredCharacter = null;
|
700
|
+
|
701
|
+
// Unless this flag is set to true, drag operation should be reverted.
|
702
|
+
// Firing of "drop" event will set this to true.
|
703
|
+
var blockDroppedProperly = false;
|
704
|
+
|
705
|
+
// HACK for IE7: Internet Explorer 7 has a very weird behavior in
|
706
|
+
// not always firing the "drop" callback of the inner droppable... However,
|
707
|
+
// the "over" and "out" callbacks are fired correctly.
|
708
|
+
// Because of this, we handle the "drop" inside the "stop" callback in IE7
|
709
|
+
// instead of the "drop" callback (where it is handled in all other browsers)
|
710
|
+
|
711
|
+
// This $currentDraggable is also needed as part of the IE 7 hack.
|
712
|
+
// $currentDraggable contains a reference to the current draggable, but
|
713
|
+
// only makes sense to read when lastHoveredCharacter !== NULL.
|
714
|
+
var $currentDraggable = null;
|
715
|
+
|
716
|
+
// We need to store the droppables created at the start of the drag,
|
717
|
+
// they should be destroyed when the drag stops.
|
718
|
+
var $createdDroppables = null;
|
719
|
+
|
720
|
+
// This dropFn is the callback which handles the actual moving of
|
721
|
+
// nodes. We created a separate function for it, as it is called inside the "stop" callback
|
722
|
+
// in IE7 and inside the "drop" callback in all other browsers.
|
723
|
+
var dropFn = function() {
|
724
|
+
if (lastHoveredCharacter) {
|
725
|
+
// the user recently hovered over a character
|
726
|
+
var $dropReferenceNode = jQuery(lastHoveredCharacter);
|
727
|
+
|
728
|
+
if ($dropReferenceNode.is('.aloha-block-dropInlineElementIntoEmptyBlock')) {
|
729
|
+
// the user wanted to drop INTO an empty block!
|
730
|
+
$dropReferenceNode.children().remove();
|
731
|
+
$dropReferenceNode.append($currentDraggable);
|
732
|
+
} else if ($dropReferenceNode.is('.aloha-block-droppable-right')) {
|
733
|
+
$dropReferenceNode.html($dropReferenceNode.html() + ' ');
|
734
|
+
|
735
|
+
// Move draggable after drop reference node
|
736
|
+
$dropReferenceNode.after($currentDraggable);
|
737
|
+
} else {
|
738
|
+
// Insert space in the beginning of the drop reference node
|
739
|
+
if ($dropReferenceNode.prev('[data-i]').length > 0) {
|
740
|
+
// If not the last element, insert space in front of next element (i.e. after the moved block)
|
741
|
+
$dropReferenceNode.prev('[data-i]').html($dropReferenceNode.prev('[data-i]').html() + ' ');
|
742
|
+
}
|
743
|
+
$dropReferenceNode.html(' ' + $dropReferenceNode.html());
|
744
|
+
|
745
|
+
// Move draggable before drop reference node
|
746
|
+
$dropReferenceNode.before($currentDraggable);
|
747
|
+
}
|
748
|
+
|
749
|
+
$currentDraggable.removeClass('ui-draggable').css({'left': 0, 'top': 0}); // Remove "draggable" options... somehow "Destroy" does not work
|
750
|
+
that._fixScrollPositionBugsInIE();
|
751
|
+
}
|
752
|
+
jQuery('.aloha-block-dropInlineElementIntoEmptyBlock').removeClass('aloha-block-dropInlineElementIntoEmptyBlock');
|
753
|
+
|
754
|
+
// clear the created droppables
|
755
|
+
$createdDroppables.droppable( "destroy" );
|
756
|
+
$createdDroppables = null;
|
757
|
+
|
758
|
+
blockDroppedProperly = true;
|
759
|
+
};
|
760
|
+
var editablesWhichNeedToBeCleaned = [];
|
761
|
+
this.$element.draggable({
|
762
|
+
handle: '.aloha-block-draghandle',
|
763
|
+
scope: 'aloha-block-inlinedragdrop',
|
764
|
+
disabled: !this._dd_isDragdropEnabled(),
|
765
|
+
revert: function() {
|
766
|
+
return (lastHoveredCharacter === null || !blockDroppedProperly);
|
767
|
+
},
|
768
|
+
revertDuration: 250,
|
769
|
+
stop: function() {
|
770
|
+
if (jQuery.browser.msie && 7 === parseInt(jQuery.browser.version, 10)) {
|
771
|
+
dropFn();
|
772
|
+
}
|
773
|
+
jQuery.each(editablesWhichNeedToBeCleaned, function() {
|
774
|
+
that._dd_traverseDomTreeAndRemoveSpans(this);
|
775
|
+
});
|
776
|
+
$currentDraggable = null;
|
777
|
+
|
778
|
+
editablesWhichNeedToBeCleaned = [];
|
779
|
+
},
|
780
|
+
start: function() {
|
781
|
+
blockDroppedProperly = false;
|
782
|
+
editablesWhichNeedToBeCleaned = [];
|
783
|
+
|
784
|
+
// In order to make Inline Blocks droppable into empty paragraphs, we insert a manually before the placeholder-br.
|
785
|
+
// -> for IE
|
786
|
+
jQuery('.aloha-editable').children('p:empty').html(' ');
|
787
|
+
|
788
|
+
|
789
|
+
// Make **ALL** editables on the page droppable, such that it is possible
|
790
|
+
// to drag/drop *across* editable boundaries
|
791
|
+
var droppableCfg = {
|
792
|
+
// make block elements droppable
|
793
|
+
tolerance: 'pointer',
|
794
|
+
addClasses: false, // performance optimization
|
795
|
+
scope: 'aloha-block-inlinedragdrop',
|
796
|
+
|
797
|
+
/**
|
798
|
+
* When hovering over a paragraph, we make convert its contents into spans, to make
|
799
|
+
* them droppable.
|
800
|
+
*/
|
801
|
+
over: function(event, ui) {
|
802
|
+
if (jQuery.inArray(this, editablesWhichNeedToBeCleaned) === -1) {
|
803
|
+
editablesWhichNeedToBeCleaned.push(this);
|
804
|
+
}
|
805
|
+
|
806
|
+
var hasOnlyProppingBr = (
|
807
|
+
1 === jQuery(this).contents().length &&
|
808
|
+
1 === jQuery(this).children('br').length
|
809
|
+
);
|
810
|
+
$currentDraggable = ui.draggable;
|
811
|
+
|
812
|
+
if (jQuery(this).is(':empty') ||
|
813
|
+
hasOnlyProppingBr ||
|
814
|
+
jQuery(this).html() === ' ') {
|
815
|
+
// The user is hovering over an empty
|
816
|
+
// container; simply highlight the container.
|
817
|
+
jQuery(this).addClass(
|
818
|
+
'aloha-block-dropInlineElementIntoEmptyBlock');
|
819
|
+
lastHoveredCharacter = this;
|
820
|
+
return;
|
821
|
+
}
|
822
|
+
|
823
|
+
that._dd_traverseDomTreeAndWrapCharactersWithSpans(this);
|
824
|
+
jQuery('span[data-i]', this).droppable({
|
825
|
+
tolerance: 'pointer',
|
826
|
+
addClasses: false,
|
827
|
+
scope: 'aloha-block-inlinedragdrop',
|
828
|
+
over: function() {
|
829
|
+
if (lastHoveredCharacter) {
|
830
|
+
// Just to be sure, we remove the css class of the last hovered character.
|
831
|
+
// This is needed such that spans are deselected which contain multiple
|
832
|
+
// lines.
|
833
|
+
jQuery(lastHoveredCharacter).removeClass('aloha-block-droppable');
|
834
|
+
}
|
835
|
+
lastHoveredCharacter = this;
|
836
|
+
jQuery(this).addClass('aloha-block-droppable');
|
837
|
+
},
|
838
|
+
out: function() {
|
839
|
+
jQuery(this).removeClass('aloha-block-droppable');
|
840
|
+
if (lastHoveredCharacter === this) {
|
841
|
+
lastHoveredCharacter = null;
|
842
|
+
}
|
843
|
+
}
|
844
|
+
});
|
845
|
+
// Now that we updated the droppables in the system, we need to recalculate
|
846
|
+
// the Drag Drop offsets.
|
847
|
+
jQuery.ui.ddmanager.prepareOffsets(ui.draggable.data('draggable'), event);
|
848
|
+
},
|
849
|
+
out: function() {
|
850
|
+
jQuery(this).removeClass('aloha-block-dropInlineElementIntoEmptyBlock');
|
851
|
+
},
|
852
|
+
|
853
|
+
/**
|
854
|
+
* When dropping over a paragraph, we use the "lastHoveredCharacter"
|
855
|
+
* as drop target.
|
856
|
+
*/
|
857
|
+
drop: function() {
|
858
|
+
if (!(jQuery.browser.msie && 7 === parseInt(jQuery.browser.version, 10))) {
|
859
|
+
dropFn();
|
860
|
+
}
|
861
|
+
}
|
862
|
+
};
|
863
|
+
|
864
|
+
$createdDroppables = jQuery( ".aloha-editable.aloha-block-dropzone" ).children( ":not(.aloha-block)" );
|
865
|
+
$createdDroppables.droppable( droppableCfg );
|
866
|
+
// Small HACK: Also make table cells droppable
|
867
|
+
jQuery('.aloha-table-cell-editable').droppable(droppableCfg);
|
868
|
+
}
|
869
|
+
});
|
870
|
+
},
|
871
|
+
|
872
|
+
/**
|
873
|
+
* Helper which traverses the DOM tree starting from el and wraps all non-empty texts with spans,
|
874
|
+
* such that they can act as drop target.
|
875
|
+
*
|
876
|
+
* @param {DomElement} el
|
877
|
+
*/
|
878
|
+
_dd_traverseDomTreeAndWrapCharactersWithSpans: function(el) {
|
879
|
+
var child;
|
880
|
+
for(var i=0, l=el.childNodes.length; i < l; i++) {
|
881
|
+
child = el.childNodes[i];
|
882
|
+
if (child.nodeType === 1) { // DOM Nodes
|
883
|
+
if (!~child.className.indexOf('aloha-block') && child.attributes['data-i'] === undefined) {
|
884
|
+
// We only recurse if child does NOT have the class "aloha-block", and is NOT data-i
|
885
|
+
this._dd_traverseDomTreeAndWrapCharactersWithSpans(child);
|
886
|
+
} else if (child.attributes['data-i']) {
|
887
|
+
// data-i set -> we have converted this hierarchy level already --> early return!
|
888
|
+
return;
|
889
|
+
}
|
890
|
+
} else if (child.nodeType === 3) { // Text Nodes
|
891
|
+
var numberOfSpansInserted = this._dd_insertSpans(child);
|
892
|
+
i += numberOfSpansInserted;
|
893
|
+
l += numberOfSpansInserted;
|
894
|
+
}
|
895
|
+
}
|
896
|
+
},
|
897
|
+
|
898
|
+
/**
|
899
|
+
* Helper which splits text on word boundaries, adding whitespaces to the following element.
|
900
|
+
* Examples:
|
901
|
+
* - "Hello world" -> ["Hello", " world"]
|
902
|
+
* - " Hello world" -> [" Hello", " world"]
|
903
|
+
* --> see the unit tests for the specification
|
904
|
+
*/
|
905
|
+
_dd_splitText: function(text) {
|
906
|
+
var textParts = text.split(/(?=\b)/);
|
907
|
+
var cleanedTextParts = [];
|
908
|
+
|
909
|
+
var isWhitespace = false;
|
910
|
+
for (var i=0,l=textParts.length; i<l; i++) {
|
911
|
+
if (!/[^\t\n\r ]/.test(textParts[i])) {
|
912
|
+
// if the current text part is just whitespace, we add a flag...
|
913
|
+
isWhitespace = true;
|
914
|
+
} else {
|
915
|
+
if (isWhitespace) {
|
916
|
+
// we have a whitespace to add
|
917
|
+
cleanedTextParts.push(' ' + textParts[i]);
|
918
|
+
isWhitespace = false;
|
919
|
+
} else {
|
920
|
+
cleanedTextParts.push(textParts[i]);
|
921
|
+
}
|
922
|
+
}
|
923
|
+
}
|
924
|
+
if (isWhitespace) {
|
925
|
+
cleanedTextParts[cleanedTextParts.length - 1] += ' ';
|
926
|
+
}
|
927
|
+
return cleanedTextParts;
|
928
|
+
},
|
929
|
+
|
930
|
+
/**
|
931
|
+
* This is a helper for _dd_traverseDomTreeAndWrapCharactersWithSpans,
|
932
|
+
* performing the actual conversion.
|
933
|
+
*
|
934
|
+
* This function returns the number of additional DOM elements inserted.
|
935
|
+
* This is "numberOfSpansCreated - 1" (because one text node has been initially there)
|
936
|
+
*/
|
937
|
+
_dd_insertSpans: function(el) {
|
938
|
+
var text = el.nodeValue;
|
939
|
+
|
940
|
+
// If node just contains empty strings, we do not do anything.
|
941
|
+
// Use ECMA-262 Edition 3 String and RegExp features
|
942
|
+
if (!/[^\t\n\r ]/.test(text)) {
|
943
|
+
return 0;
|
944
|
+
}
|
945
|
+
var newNodes = document.createDocumentFragment();
|
946
|
+
|
947
|
+
var splitText = this._dd_splitText(text);
|
948
|
+
|
949
|
+
var l = splitText.length;
|
950
|
+
var x, word, leftWordPartLength, t;
|
951
|
+
var numberOfSpansInserted = 0;
|
952
|
+
|
953
|
+
for (var i=0; i<l; i++) {
|
954
|
+
// left half of word
|
955
|
+
word = splitText[i];
|
956
|
+
if (word.length === 0) continue;
|
957
|
+
// We use "floor" here such that sentence delimiters like "!" can have a block placed afterwards
|
958
|
+
leftWordPartLength = Math.floor(word.length/2);
|
959
|
+
|
960
|
+
// For Internet Explorer, we only make dropping AFTER words possible to improve performance
|
961
|
+
var browserMajorVersion = parseInt(jQuery.browser.version, 10);
|
962
|
+
if (jQuery.browser.msie && (7 === browserMajorVersion || 8 === browserMajorVersion)) {
|
963
|
+
leftWordPartLength = 0;
|
964
|
+
}
|
965
|
+
|
966
|
+
if (leftWordPartLength > 0) {
|
967
|
+
x = document.createElement('span');
|
968
|
+
x.appendChild(document.createTextNode(word.substr(0, leftWordPartLength)));
|
969
|
+
x.setAttribute('data-i', i);
|
970
|
+
|
971
|
+
newNodes.appendChild(x);
|
972
|
+
numberOfSpansInserted++;
|
973
|
+
}
|
974
|
+
|
975
|
+
// right half of word
|
976
|
+
x = document.createElement('span');
|
977
|
+
t = word.substr(leftWordPartLength);
|
978
|
+
x.appendChild(document.createTextNode(t));
|
979
|
+
x.setAttribute('data-i', i);
|
980
|
+
x.setAttribute('class', 'aloha-block-droppable-right');
|
981
|
+
|
982
|
+
newNodes.appendChild(x);
|
983
|
+
numberOfSpansInserted++;
|
984
|
+
}
|
985
|
+
el.parentNode.replaceChild(newNodes, el);
|
986
|
+
return numberOfSpansInserted-1;
|
987
|
+
},
|
988
|
+
|
989
|
+
/**
|
990
|
+
* After the Drag/Drop operation, we need to remove the SPAN elements
|
991
|
+
* again.
|
992
|
+
*/
|
993
|
+
_dd_traverseDomTreeAndRemoveSpans: function(el) {
|
994
|
+
var nodesToDelete = [], convertBack;
|
995
|
+
convertBack = function(el) {
|
996
|
+
var currentlyTraversingExpandedText = false, currentText, lastNode;
|
997
|
+
var child;
|
998
|
+
for(var i=0, l=el.childNodes.length; i < l; i++) {
|
999
|
+
child = el.childNodes[i];
|
1000
|
+
if (child.nodeType === 1) { // Node
|
1001
|
+
if (child.attributes['data-i'] !== undefined) {
|
1002
|
+
if (!currentlyTraversingExpandedText) {
|
1003
|
+
// We did not traverse expanded text before, and just entered an expanded text section
|
1004
|
+
// thus, we reset all variables to their initial state
|
1005
|
+
currentlyTraversingExpandedText = true;
|
1006
|
+
currentText = '';
|
1007
|
+
lastNode = undefined;
|
1008
|
+
}
|
1009
|
+
if (currentlyTraversingExpandedText) {
|
1010
|
+
// We are currently traversing the expanded text nodes, so we collect their data
|
1011
|
+
// together in the currentText variable. We know that they only
|
1012
|
+
// have one TextNode child, as this is the way we constructed them.
|
1013
|
+
//
|
1014
|
+
// Note: we do NOT use child.innerHTML here, as this returns HTML entities;
|
1015
|
+
// but we need the HTML entities already processed:
|
1016
|
+
// - child.innerHTML returns "Hello World"
|
1017
|
+
// - child.firstChild.nodeValue returns "Hello World"
|
1018
|
+
currentText += child.firstChild.nodeValue;
|
1019
|
+
|
1020
|
+
if (lastNode) {
|
1021
|
+
nodesToDelete.push(lastNode);
|
1022
|
+
}
|
1023
|
+
lastNode = child;
|
1024
|
+
}
|
1025
|
+
} else {
|
1026
|
+
if (currentlyTraversingExpandedText) {
|
1027
|
+
currentlyTraversingExpandedText = false;
|
1028
|
+
// We just left a region with data-i elements set.
|
1029
|
+
// so, we need to store the currentText back to the region.
|
1030
|
+
// We do this by using the last visited node as anchor.
|
1031
|
+
lastNode.parentNode.replaceChild(document.createTextNode(currentText), lastNode);
|
1032
|
+
}
|
1033
|
+
// Recursion
|
1034
|
+
if (!~child.className.indexOf('aloha-block')) {
|
1035
|
+
// If child does not have the class "aloha-block", we iterate into it
|
1036
|
+
convertBack(child);
|
1037
|
+
}
|
1038
|
+
}
|
1039
|
+
}
|
1040
|
+
}
|
1041
|
+
if (currentlyTraversingExpandedText) {
|
1042
|
+
// Special case: the last child node *is* a wrapped text node and we are at the end of the collection.
|
1043
|
+
// In this case, we convert the text as well.
|
1044
|
+
lastNode.parentNode.replaceChild(document.createTextNode(currentText), lastNode);
|
1045
|
+
}
|
1046
|
+
};
|
1047
|
+
|
1048
|
+
convertBack(el);
|
1049
|
+
|
1050
|
+
for (var i=0, l=nodesToDelete.length; i<l; i++) {
|
1051
|
+
nodesToDelete[i].parentNode.removeChild(nodesToDelete[i]);
|
1052
|
+
}
|
1053
|
+
},
|
1054
|
+
|
1055
|
+
/**
|
1056
|
+
* Helper method to check whether the drag & drop is enabled
|
1057
|
+
* for the editable, which this block belongs to.
|
1058
|
+
*/
|
1059
|
+
_dd_isDragdropEnabled: function () {
|
1060
|
+
return isDragdropEnabledForElement(this.$element.parent());
|
1061
|
+
},
|
1062
|
+
|
1063
|
+
/**************************
|
1064
|
+
* SECTION: Drag&Drop for Block elements
|
1065
|
+
**************************/
|
1066
|
+
|
1067
|
+
_setupDragDropForBlockElements: function() {
|
1068
|
+
// Mark the drag handle with an extra CSS class, such that it is picked up by BlockManager.initializeBlockLevelDragDrop()
|
1069
|
+
this.$element.find('.aloha-block-draghandle').addClass('aloha-block-draghandle-blocklevel');
|
1070
|
+
},
|
1071
|
+
|
1072
|
+
|
1073
|
+
/**************************
|
1074
|
+
* SECTION: Other Rendering Helpers
|
1075
|
+
**************************/
|
1076
|
+
|
1077
|
+
/**
|
1078
|
+
* Create editables from the inner content that was
|
1079
|
+
* rendered for this block.
|
1080
|
+
*
|
1081
|
+
* This method must be idempotent. I.e. it must produce the same results
|
1082
|
+
* when called once or twice.
|
1083
|
+
*
|
1084
|
+
* Override to use a custom implementation and to pass
|
1085
|
+
* special configuration to .aloha()
|
1086
|
+
*/
|
1087
|
+
createEditablesIfNeeded: function() {
|
1088
|
+
// TODO: only create them if they are no aloha element yet...
|
1089
|
+
// TODO: should only happen inside Aloha
|
1090
|
+
this.$element.find('.aloha-editable').aloha();
|
1091
|
+
},
|
1092
|
+
|
1093
|
+
/**
|
1094
|
+
* Render block toolbar elements
|
1095
|
+
*
|
1096
|
+
* This method must be idempotent. I.e. it must produce the same results
|
1097
|
+
* when called once or twice.
|
1098
|
+
*
|
1099
|
+
* Template method to render custom block UI.
|
1100
|
+
* @api
|
1101
|
+
*/
|
1102
|
+
renderBlockHandlesIfNeeded: function() {
|
1103
|
+
if (this.isDraggable()) {
|
1104
|
+
if (this.$element.children('.aloha-block-draghandle').length === 0) {
|
1105
|
+
this.$element.prepend('<span class="aloha-block-handle aloha-block-draghandle aloha-cleanme"></span>');
|
1106
|
+
}
|
1107
|
+
}
|
1108
|
+
},
|
1109
|
+
|
1110
|
+
/**************************
|
1111
|
+
* SECTION: Attribute Handling
|
1112
|
+
**************************/
|
1113
|
+
|
1114
|
+
/**
|
1115
|
+
* Get or set one or many attribute, similar to the jQuery attr() function.
|
1116
|
+
*
|
1117
|
+
* The attribute keys are converted internally to lowercase,
|
1118
|
+
* so attr('foo', 'bar') and attr('FoO', 'bar') are the same internally.
|
1119
|
+
* The same applies to reading.
|
1120
|
+
*
|
1121
|
+
* It is not allowed to set internal attributes (starting with aloha-block-) through this API.
|
1122
|
+
*
|
1123
|
+
* @api
|
1124
|
+
* @param {String|Object} attributeNameOrObject
|
1125
|
+
* @param {String} attributeValue
|
1126
|
+
* @param {Boolean} Optional. If true, we do not fire change events.
|
1127
|
+
*/
|
1128
|
+
attr: function(attributeNameOrObject, attributeValue, suppressEvents) {
|
1129
|
+
var that = this, attributeChanged = false;
|
1130
|
+
|
1131
|
+
if (arguments.length >= 2) {
|
1132
|
+
if (attributeNameOrObject.substr(0, 12) === 'aloha-block-') {
|
1133
|
+
Aloha.Log.error('block/block', 'It is not allowed to set internal block attributes (starting with aloha-block-) through Block.attr() (You tried to set ' + attributeNameOrObject + ')');
|
1134
|
+
return;
|
1135
|
+
}
|
1136
|
+
if (this._getAttribute(attributeNameOrObject) !== attributeValue) {
|
1137
|
+
attributeChanged = true;
|
1138
|
+
}
|
1139
|
+
this._setAttribute(attributeNameOrObject, attributeValue);
|
1140
|
+
} else if (typeof attributeNameOrObject === 'object') {
|
1141
|
+
jQuery.each(attributeNameOrObject, function(key, value) {
|
1142
|
+
if (key.substr(0, 12) === 'aloha-block-') {
|
1143
|
+
Aloha.Log.error('block/block', 'It is not allowed to set internal block attributes (starting with aloha-block-) through Block.attr() (You tried to set ' + key + ')');
|
1144
|
+
return;
|
1145
|
+
}
|
1146
|
+
if (that._getAttribute(key) !== value) {
|
1147
|
+
attributeChanged = true;
|
1148
|
+
}
|
1149
|
+
that._setAttribute(key, value);
|
1150
|
+
});
|
1151
|
+
} else if (typeof attributeNameOrObject === 'string') {
|
1152
|
+
return this._getAttribute(attributeNameOrObject);
|
1153
|
+
} else {
|
1154
|
+
return this._getAttributes();
|
1155
|
+
}
|
1156
|
+
if (attributeChanged && !suppressEvents) {
|
1157
|
+
this._update();
|
1158
|
+
this.trigger('change');
|
1159
|
+
if (Aloha.activeEditable) {
|
1160
|
+
Aloha.activeEditable.smartContentChange({type: 'block-change'});
|
1161
|
+
}
|
1162
|
+
}
|
1163
|
+
return null;
|
1164
|
+
},
|
1165
|
+
|
1166
|
+
/**
|
1167
|
+
* Internal helper for setting a single attribute.
|
1168
|
+
*/
|
1169
|
+
_setAttribute: function(name, value) {
|
1170
|
+
this.$element.attr('data-' + name.toLowerCase(), value);
|
1171
|
+
},
|
1172
|
+
|
1173
|
+
/**
|
1174
|
+
* Internal helper for getting an attribute
|
1175
|
+
*/
|
1176
|
+
_getAttribute: function(name) {
|
1177
|
+
return this.$element.attr('data-' + name.toLowerCase());
|
1178
|
+
},
|
1179
|
+
|
1180
|
+
/**
|
1181
|
+
* Internal helper for getting all attributes
|
1182
|
+
*/
|
1183
|
+
_getAttributes: function() {
|
1184
|
+
var attributes = {};
|
1185
|
+
|
1186
|
+
// element.data() not always up-to-date, that's why we iterate over the attributes directly.
|
1187
|
+
jQuery.each(this.$element[0].attributes, function(i, attribute) {
|
1188
|
+
if (attribute.name.substr(0, 5) === 'data-') {
|
1189
|
+
attributes[attribute.name.substr(5).toLowerCase()] = attribute.value;
|
1190
|
+
}
|
1191
|
+
});
|
1192
|
+
|
1193
|
+
return attributes;
|
1194
|
+
}
|
1195
|
+
});
|
1196
|
+
|
1197
|
+
/**
|
1198
|
+
* @name block.block.DefaultBlock
|
1199
|
+
* @class A default block that renders the initial content
|
1200
|
+
* @extends block.block.AbstractBlock
|
1201
|
+
*/
|
1202
|
+
var DefaultBlock = AbstractBlock.extend(
|
1203
|
+
/** @lends block.block.DefaultBlock */
|
1204
|
+
{
|
1205
|
+
update: function($element, postProcessFn) {
|
1206
|
+
postProcessFn();
|
1207
|
+
}
|
1208
|
+
});
|
1209
|
+
|
1210
|
+
/**
|
1211
|
+
* @name block.block.DebugBlock
|
1212
|
+
* @class A debug block outputs its attributes in a table
|
1213
|
+
* @extends block.block.AbstractBlock
|
1214
|
+
*/
|
1215
|
+
var DebugBlock = AbstractBlock.extend(
|
1216
|
+
/** @lends block.block.DebugBlock */
|
1217
|
+
{
|
1218
|
+
title: 'Debugging',
|
1219
|
+
init: function($element, postProcessFn) {
|
1220
|
+
this.update($element, postProcessFn);
|
1221
|
+
},
|
1222
|
+
update: function($element, postProcessFn) {
|
1223
|
+
$element.css({display: 'block'});
|
1224
|
+
var renderedAttributes = '<table class="debug-block">';
|
1225
|
+
jQuery.each(this.attr(), function(k, v) {
|
1226
|
+
renderedAttributes += '<tr><th>' + k + '</th><td>' + v + '</td></tr>';
|
1227
|
+
});
|
1228
|
+
|
1229
|
+
renderedAttributes += '</table>';
|
1230
|
+
|
1231
|
+
$element.html(renderedAttributes);
|
1232
|
+
postProcessFn();
|
1233
|
+
}
|
1234
|
+
});
|
1235
|
+
|
1236
|
+
/**
|
1237
|
+
* @name block.block.EmptyBlock
|
1238
|
+
* @class An empty block doesn't render any tag fill icons or borders (no Aloha tags)
|
1239
|
+
* @extends block.block.AbstractBlock
|
1240
|
+
*/
|
1241
|
+
var EmptyBlock = AbstractBlock.extend (
|
1242
|
+
/** @lends block.block.EmptyBlock */
|
1243
|
+
{
|
1244
|
+
title: 'EmptyBlock',
|
1245
|
+
init: function() {},
|
1246
|
+
activate: function () {},
|
1247
|
+
deactivate: function () {},
|
1248
|
+
renderBlockHandlesIfNeeded: function () {}
|
1249
|
+
});
|
1250
|
+
|
1251
|
+
/**
|
1252
|
+
* Tests whether the given element is contained in an editable for
|
1253
|
+
* which the block dragdrop feature is enabled.
|
1254
|
+
*
|
1255
|
+
* @param {!jQuery} $element
|
1256
|
+
* The element that may or may not be contained in an editable.
|
1257
|
+
* @return {boolean}
|
1258
|
+
* True, unless the given $element is contained in an
|
1259
|
+
* editable for which the dragdrop feature has been disabled.
|
1260
|
+
*/
|
1261
|
+
function isDragdropEnabledForElement($element) {
|
1262
|
+
var editable = $element.closest(".aloha-editable");
|
1263
|
+
if (editable.length) {
|
1264
|
+
return !!editable.data("block-dragdrop");
|
1265
|
+
} else {
|
1266
|
+
// no editable specified, let's make drag & drop enabled by default.
|
1267
|
+
return true;
|
1268
|
+
}
|
1269
|
+
}
|
1270
|
+
|
1271
|
+
return {
|
1272
|
+
AbstractBlock: AbstractBlock,
|
1273
|
+
DefaultBlock: DefaultBlock,
|
1274
|
+
DebugBlock: DebugBlock,
|
1275
|
+
EmptyBlock: EmptyBlock
|
1276
|
+
};
|
1277
|
+
});
|