spiderfw 0.6.38 → 0.6.39
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +13 -5
- data/CHANGELOG +23 -0
- data/VERSION +1 -1
- data/apps/core/admin/views/admin.layout.shtml +6 -0
- data/apps/core/auth/controllers/login_controller.rb +1 -1
- data/apps/core/components/assets.rb +55 -6
- data/apps/core/components/public/bootstrap/scss/_variables.scss +5 -2
- data/apps/core/components/public/bootstrap/scss/bootstrap.css +942 -236
- data/apps/core/components/public/bootstrap/scss/responsive.css +187 -30
- data/apps/core/components/public/css/tinymce/skins/lightgray/AbsoluteLayout.less +17 -0
- data/apps/core/components/public/css/tinymce/skins/lightgray/Animations.less +10 -0
- data/apps/core/components/public/css/tinymce/skins/lightgray/Button.less +172 -0
- data/apps/core/components/public/css/tinymce/skins/lightgray/ButtonGroup.less +71 -0
- data/apps/core/components/public/css/tinymce/skins/lightgray/Checkbox.less +49 -0
- data/apps/core/components/public/css/tinymce/skins/lightgray/ColorBox.less +6 -0
- data/apps/core/components/public/css/tinymce/skins/lightgray/ColorButton.less +72 -0
- data/apps/core/components/public/css/tinymce/skins/lightgray/ColorPicker.less +80 -0
- data/apps/core/components/public/css/tinymce/skins/lightgray/ComboBox.less +39 -0
- data/apps/core/components/public/css/tinymce/skins/lightgray/Container.less +9 -0
- data/apps/core/components/public/css/tinymce/skins/lightgray/Content.Inline.less +4 -0
- data/apps/core/components/public/css/tinymce/skins/lightgray/Content.Objects.less +166 -0
- data/apps/core/components/public/css/tinymce/skins/lightgray/Content.less +27 -0
- data/apps/core/components/public/css/tinymce/skins/lightgray/CropRect.less +54 -0
- data/apps/core/components/public/css/tinymce/skins/lightgray/FieldSet.less +15 -0
- data/apps/core/components/public/css/tinymce/skins/lightgray/FitLayout.less +9 -0
- data/apps/core/components/public/css/tinymce/skins/lightgray/FloatPanel.less +69 -0
- data/apps/core/components/public/css/tinymce/skins/lightgray/FlowLayout.less +36 -0
- data/apps/core/components/public/css/tinymce/skins/lightgray/Icons.Ie7.less +136 -0
- data/apps/core/components/public/css/tinymce/skins/lightgray/Icons.less +180 -0
- data/apps/core/components/public/css/tinymce/skins/lightgray/Iframe.less +6 -0
- data/apps/core/components/public/css/tinymce/skins/lightgray/ImagePanel.less +20 -0
- data/apps/core/components/public/css/tinymce/skins/lightgray/InfoBox.less +71 -0
- data/apps/core/components/public/css/tinymce/skins/lightgray/Label.less +38 -0
- data/apps/core/components/public/css/tinymce/skins/lightgray/ListBox.less +26 -0
- data/apps/core/components/public/css/tinymce/skins/lightgray/Menu.less +34 -0
- data/apps/core/components/public/css/tinymce/skins/lightgray/MenuBar.less +32 -0
- data/apps/core/components/public/css/tinymce/skins/lightgray/MenuButton.less +34 -0
- data/apps/core/components/public/css/tinymce/skins/lightgray/MenuItem.less +142 -0
- data/apps/core/components/public/css/tinymce/skins/lightgray/Mixins.less +54 -0
- data/apps/core/components/public/css/tinymce/skins/lightgray/Notification.less +144 -0
- data/apps/core/components/public/css/tinymce/skins/lightgray/Panel.less +7 -0
- data/apps/core/components/public/css/tinymce/skins/lightgray/Path.less +45 -0
- data/apps/core/components/public/css/tinymce/skins/lightgray/Progress.less +34 -0
- data/apps/core/components/public/css/tinymce/skins/lightgray/Radio.less +1 -0
- data/apps/core/components/public/css/tinymce/skins/lightgray/Reset.less +32 -0
- data/apps/core/components/public/css/tinymce/skins/lightgray/ResizeHandle.less +18 -0
- data/apps/core/components/public/css/tinymce/skins/lightgray/Scrollable.less +44 -0
- data/apps/core/components/public/css/tinymce/skins/lightgray/SelectBox.less +6 -0
- data/apps/core/components/public/css/tinymce/skins/lightgray/Slider.less +29 -0
- data/apps/core/components/public/css/tinymce/skins/lightgray/Spacer.less +5 -0
- data/apps/core/components/public/css/tinymce/skins/lightgray/SplitButton.less +49 -0
- data/apps/core/components/public/css/tinymce/skins/lightgray/StackLayout.less +5 -0
- data/apps/core/components/public/css/tinymce/skins/lightgray/TabPanel.less +44 -0
- data/apps/core/components/public/css/tinymce/skins/lightgray/TextBox.less +41 -0
- data/apps/core/components/public/css/tinymce/skins/lightgray/Throbber.less +19 -0
- data/apps/core/components/public/css/tinymce/skins/lightgray/TinyMCE.less +159 -0
- data/apps/core/components/public/css/tinymce/skins/lightgray/ToolTip.less +129 -0
- data/apps/core/components/public/css/tinymce/skins/lightgray/Variables.less +214 -0
- data/apps/core/components/public/css/tinymce/skins/lightgray/Window.less +127 -0
- data/apps/core/components/public/css/tinymce/skins/lightgray/content.inline.min.css +1 -0
- data/apps/core/components/public/css/tinymce/skins/lightgray/content.min.css +1 -0
- data/apps/core/components/public/css/tinymce/skins/lightgray/fonts/readme.md +1 -0
- data/apps/core/components/public/css/tinymce/skins/lightgray/fonts/tinymce-small.eot +0 -0
- data/apps/core/components/public/css/tinymce/skins/lightgray/fonts/tinymce-small.json +1277 -0
- data/apps/core/components/public/css/tinymce/skins/lightgray/fonts/tinymce-small.svg +63 -0
- data/apps/core/components/public/css/tinymce/skins/lightgray/fonts/tinymce-small.ttf +0 -0
- data/apps/core/components/public/css/tinymce/skins/lightgray/fonts/tinymce-small.woff +0 -0
- data/apps/core/components/public/css/tinymce/skins/lightgray/fonts/tinymce.eot +0 -0
- data/apps/core/components/public/css/tinymce/skins/lightgray/fonts/tinymce.json +3381 -0
- data/apps/core/components/public/css/tinymce/skins/lightgray/fonts/tinymce.svg +129 -0
- data/apps/core/components/public/css/tinymce/skins/lightgray/fonts/tinymce.ttf +0 -0
- data/apps/core/components/public/css/tinymce/skins/lightgray/fonts/tinymce.woff +0 -0
- data/apps/core/components/public/css/tinymce/skins/lightgray/img/anchor.gif +0 -0
- data/apps/core/components/public/css/tinymce/skins/lightgray/img/loader.gif +0 -0
- data/apps/core/components/public/css/tinymce/skins/lightgray/img/object.gif +0 -0
- data/apps/core/components/public/css/tinymce/skins/lightgray/img/trans.gif +0 -0
- data/apps/core/components/public/css/tinymce/skins/lightgray/skin.dev.less +46 -0
- data/apps/core/components/public/css/tinymce/skins/lightgray/skin.ie7.dev.less +46 -0
- data/apps/core/components/public/css/tinymce/skins/lightgray/skin.ie7.less +2542 -0
- data/apps/core/components/public/css/tinymce/skins/lightgray/skin.ie7.min.css +1 -0
- data/apps/core/components/public/css/tinymce/skins/lightgray/skin.less +2586 -0
- data/apps/core/components/public/css/tinymce/skins/lightgray/skin.min.css +1 -0
- data/apps/core/components/public/js/bootbox_2/bootbox.js +551 -0
- data/apps/core/components/public/js/jquery/jquery-ui-1.9.2/ui/i18n/jquery.ui.datepicker-it-min.js +4 -0
- data/apps/core/components/public/js/spider.js +7 -3
- data/apps/core/components/public/js/tinymce/classes/AddOnManager.js +265 -0
- data/apps/core/components/public/js/tinymce/classes/Compat.js +90 -0
- data/apps/core/components/public/js/tinymce/classes/DragDropOverrides.js +224 -0
- data/apps/core/components/public/js/tinymce/classes/Editor.js +2221 -0
- data/apps/core/components/public/js/tinymce/classes/EditorCommands.js +1028 -0
- data/apps/core/components/public/js/tinymce/classes/EditorManager.js +715 -0
- data/apps/core/components/public/js/tinymce/classes/EditorObservable.js +204 -0
- data/apps/core/components/public/js/tinymce/classes/EditorUpload.js +191 -0
- data/apps/core/components/public/js/tinymce/classes/EnterKey.js +676 -0
- data/apps/core/components/public/js/tinymce/classes/Env.js +177 -0
- data/apps/core/components/public/js/tinymce/classes/FocusManager.js +266 -0
- data/apps/core/components/public/js/tinymce/classes/ForceBlocks.js +138 -0
- data/apps/core/components/public/js/tinymce/classes/Formatter.js +2378 -0
- data/apps/core/components/public/js/tinymce/classes/LegacyInput.js +82 -0
- data/apps/core/components/public/js/tinymce/classes/Mode.js +54 -0
- data/apps/core/components/public/js/tinymce/classes/NodeChange.js +154 -0
- data/apps/core/components/public/js/tinymce/classes/NotificationManager.js +156 -0
- data/apps/core/components/public/js/tinymce/classes/Register.js +34 -0
- data/apps/core/components/public/js/tinymce/classes/SelectionOverrides.js +810 -0
- data/apps/core/components/public/js/tinymce/classes/Shortcuts.js +172 -0
- data/apps/core/components/public/js/tinymce/classes/UndoManager.js +346 -0
- data/apps/core/components/public/js/tinymce/classes/WindowManager.js +278 -0
- data/apps/core/components/public/js/tinymce/classes/caret/CaretBookmark.js +263 -0
- data/apps/core/components/public/js/tinymce/classes/caret/CaretCandidate.js +86 -0
- data/apps/core/components/public/js/tinymce/classes/caret/CaretContainer.js +151 -0
- data/apps/core/components/public/js/tinymce/classes/caret/CaretPosition.js +371 -0
- data/apps/core/components/public/js/tinymce/classes/caret/CaretUtils.js +302 -0
- data/apps/core/components/public/js/tinymce/classes/caret/CaretWalker.js +215 -0
- data/apps/core/components/public/js/tinymce/classes/caret/FakeCaret.js +192 -0
- data/apps/core/components/public/js/tinymce/classes/caret/LineUtils.js +135 -0
- data/apps/core/components/public/js/tinymce/classes/caret/LineWalker.js +166 -0
- data/apps/core/components/public/js/tinymce/classes/data/Binding.js +79 -0
- data/apps/core/components/public/js/tinymce/classes/data/ObservableArray.js +196 -0
- data/apps/core/components/public/js/tinymce/classes/data/ObservableObject.js +194 -0
- data/apps/core/components/public/js/tinymce/classes/dom/BookmarkManager.js +456 -0
- data/apps/core/components/public/js/tinymce/classes/dom/ControlSelection.js +634 -0
- data/apps/core/components/public/js/tinymce/classes/dom/DOMUtils.js +1853 -0
- data/apps/core/components/public/js/tinymce/classes/dom/Dimensions.js +64 -0
- data/apps/core/components/public/js/tinymce/classes/dom/DomQuery.js +1578 -0
- data/apps/core/components/public/js/tinymce/classes/dom/ElementUtils.js +118 -0
- data/apps/core/components/public/js/tinymce/classes/dom/EventUtils.js +583 -0
- data/apps/core/components/public/js/tinymce/classes/dom/NodePath.js +50 -0
- data/apps/core/components/public/js/tinymce/classes/dom/NodeType.js +110 -0
- data/apps/core/components/public/js/tinymce/classes/dom/Range.js +785 -0
- data/apps/core/components/public/js/tinymce/classes/dom/RangeUtils.js +628 -0
- data/apps/core/components/public/js/tinymce/classes/dom/ScriptLoader.js +254 -0
- data/apps/core/components/public/js/tinymce/classes/dom/Selection.js +1008 -0
- data/apps/core/components/public/js/tinymce/classes/dom/Serializer.js +506 -0
- data/apps/core/components/public/js/tinymce/classes/dom/Sizzle.jQuery.js +23 -0
- data/apps/core/components/public/js/tinymce/classes/dom/Sizzle.js +2039 -0
- data/apps/core/components/public/js/tinymce/classes/dom/StyleSheetLoader.js +190 -0
- data/apps/core/components/public/js/tinymce/classes/dom/TreeWalker.js +127 -0
- data/apps/core/components/public/js/tinymce/classes/dom/TridentSelection.js +508 -0
- data/apps/core/components/public/js/tinymce/classes/file/BlobCache.js +72 -0
- data/apps/core/components/public/js/tinymce/classes/file/Conversions.js +106 -0
- data/apps/core/components/public/js/tinymce/classes/file/ImageScanner.js +145 -0
- data/apps/core/components/public/js/tinymce/classes/file/Uploader.js +193 -0
- data/apps/core/components/public/js/tinymce/classes/fmt/Hooks.js +66 -0
- data/apps/core/components/public/js/tinymce/classes/fmt/Preview.js +151 -0
- data/apps/core/components/public/js/tinymce/classes/geom/ClientRect.js +136 -0
- data/apps/core/components/public/js/tinymce/classes/geom/Rect.js +214 -0
- data/apps/core/components/public/js/tinymce/classes/html/DomParser.js +822 -0
- data/apps/core/components/public/js/tinymce/classes/html/Entities.js +268 -0
- data/apps/core/components/public/js/tinymce/classes/html/Node.js +496 -0
- data/apps/core/components/public/js/tinymce/classes/html/SaxParser.js +474 -0
- data/apps/core/components/public/js/tinymce/classes/html/Schema.js +1004 -0
- data/apps/core/components/public/js/tinymce/classes/html/Serializer.js +158 -0
- data/apps/core/components/public/js/tinymce/classes/html/Styles.js +363 -0
- data/apps/core/components/public/js/tinymce/classes/html/Writer.js +199 -0
- data/apps/core/components/public/js/tinymce/classes/jquery.tinymce.js +377 -0
- data/apps/core/components/public/js/tinymce/classes/text/ExtendingChar.js +53 -0
- data/apps/core/components/public/js/tinymce/classes/text/Zwsp.js +36 -0
- data/apps/core/components/public/js/tinymce/classes/ui/AbsoluteLayout.js +63 -0
- data/apps/core/components/public/js/tinymce/classes/ui/BoxUtils.js +98 -0
- data/apps/core/components/public/js/tinymce/classes/ui/Button.js +199 -0
- data/apps/core/components/public/js/tinymce/classes/ui/ButtonGroup.js +62 -0
- data/apps/core/components/public/js/tinymce/classes/ui/Checkbox.js +162 -0
- data/apps/core/components/public/js/tinymce/classes/ui/ClassList.js +149 -0
- data/apps/core/components/public/js/tinymce/classes/ui/Collection.js +438 -0
- data/apps/core/components/public/js/tinymce/classes/ui/ColorBox.js +72 -0
- data/apps/core/components/public/js/tinymce/classes/ui/ColorButton.js +124 -0
- data/apps/core/components/public/js/tinymce/classes/ui/ColorPicker.js +206 -0
- data/apps/core/components/public/js/tinymce/classes/ui/ComboBox.js +306 -0
- data/apps/core/components/public/js/tinymce/classes/ui/Container.js +506 -0
- data/apps/core/components/public/js/tinymce/classes/ui/Control.js +1301 -0
- data/apps/core/components/public/js/tinymce/classes/ui/DomUtils.js +107 -0
- data/apps/core/components/public/js/tinymce/classes/ui/DragHelper.js +144 -0
- data/apps/core/components/public/js/tinymce/classes/ui/ElementPath.js +79 -0
- data/apps/core/components/public/js/tinymce/classes/ui/Factory.js +105 -0
- data/apps/core/components/public/js/tinymce/classes/ui/FieldSet.js +59 -0
- data/apps/core/components/public/js/tinymce/classes/ui/FilePicker.js +85 -0
- data/apps/core/components/public/js/tinymce/classes/ui/FitLayout.js +48 -0
- data/apps/core/components/public/js/tinymce/classes/ui/FlexLayout.js +246 -0
- data/apps/core/components/public/js/tinymce/classes/ui/FloatPanel.js +409 -0
- data/apps/core/components/public/js/tinymce/classes/ui/FlowLayout.js +46 -0
- data/apps/core/components/public/js/tinymce/classes/ui/Form.js +157 -0
- data/apps/core/components/public/js/tinymce/classes/ui/FormItem.js +56 -0
- data/apps/core/components/public/js/tinymce/classes/ui/FormatControls.js +535 -0
- data/apps/core/components/public/js/tinymce/classes/ui/GridLayout.js +233 -0
- data/apps/core/components/public/js/tinymce/classes/ui/Iframe.js +85 -0
- data/apps/core/components/public/js/tinymce/classes/ui/InfoBox.js +93 -0
- data/apps/core/components/public/js/tinymce/classes/ui/KeyboardNavigation.js +406 -0
- data/apps/core/components/public/js/tinymce/classes/ui/Label.js +144 -0
- data/apps/core/components/public/js/tinymce/classes/ui/Layout.js +120 -0
- data/apps/core/components/public/js/tinymce/classes/ui/ListBox.js +152 -0
- data/apps/core/components/public/js/tinymce/classes/ui/Menu.js +195 -0
- data/apps/core/components/public/js/tinymce/classes/ui/MenuBar.js +33 -0
- data/apps/core/components/public/js/tinymce/classes/ui/MenuButton.js +268 -0
- data/apps/core/components/public/js/tinymce/classes/ui/MenuItem.js +336 -0
- data/apps/core/components/public/js/tinymce/classes/ui/MessageBox.js +202 -0
- data/apps/core/components/public/js/tinymce/classes/ui/Movable.js +200 -0
- data/apps/core/components/public/js/tinymce/classes/ui/Notification.js +154 -0
- data/apps/core/components/public/js/tinymce/classes/ui/Panel.js +67 -0
- data/apps/core/components/public/js/tinymce/classes/ui/PanelButton.js +114 -0
- data/apps/core/components/public/js/tinymce/classes/ui/Path.js +127 -0
- data/apps/core/components/public/js/tinymce/classes/ui/Progress.js +81 -0
- data/apps/core/components/public/js/tinymce/classes/ui/Radio.js +29 -0
- data/apps/core/components/public/js/tinymce/classes/ui/ReflowQueue.js +79 -0
- data/apps/core/components/public/js/tinymce/classes/ui/Resizable.js +68 -0
- data/apps/core/components/public/js/tinymce/classes/ui/ResizeHandle.js +86 -0
- data/apps/core/components/public/js/tinymce/classes/ui/Scrollable.js +141 -0
- data/apps/core/components/public/js/tinymce/classes/ui/SelectBox.js +106 -0
- data/apps/core/components/public/js/tinymce/classes/ui/Selector.js +369 -0
- data/apps/core/components/public/js/tinymce/classes/ui/Slider.js +161 -0
- data/apps/core/components/public/js/tinymce/classes/ui/Spacer.js +39 -0
- data/apps/core/components/public/js/tinymce/classes/ui/SplitButton.js +146 -0
- data/apps/core/components/public/js/tinymce/classes/ui/StackLayout.js +34 -0
- data/apps/core/components/public/js/tinymce/classes/ui/TabPanel.js +178 -0
- data/apps/core/components/public/js/tinymce/classes/ui/TextBox.js +208 -0
- data/apps/core/components/public/js/tinymce/classes/ui/Throbber.js +88 -0
- data/apps/core/components/public/js/tinymce/classes/ui/Toolbar.js +56 -0
- data/apps/core/components/public/js/tinymce/classes/ui/Tooltip.js +73 -0
- data/apps/core/components/public/js/tinymce/classes/ui/Widget.js +151 -0
- data/apps/core/components/public/js/tinymce/classes/ui/Window.js +474 -0
- data/apps/core/components/public/js/tinymce/classes/util/Arr.js +153 -0
- data/apps/core/components/public/js/tinymce/classes/util/Class.js +167 -0
- data/apps/core/components/public/js/tinymce/classes/util/Color.js +235 -0
- data/apps/core/components/public/js/tinymce/classes/util/Delay.js +191 -0
- data/apps/core/components/public/js/tinymce/classes/util/EventDispatcher.js +294 -0
- data/apps/core/components/public/js/tinymce/classes/util/Fun.js +87 -0
- data/apps/core/components/public/js/tinymce/classes/util/I18n.js +116 -0
- data/apps/core/components/public/js/tinymce/classes/util/JSON.js +109 -0
- data/apps/core/components/public/js/tinymce/classes/util/JSONP.js +38 -0
- data/apps/core/components/public/js/tinymce/classes/util/JSONRequest.js +110 -0
- data/apps/core/components/public/js/tinymce/classes/util/LocalStorage.js +213 -0
- data/apps/core/components/public/js/tinymce/classes/util/Observable.js +129 -0
- data/apps/core/components/public/js/tinymce/classes/util/Promise.js +200 -0
- data/apps/core/components/public/js/tinymce/classes/util/Quirks.js +1701 -0
- data/apps/core/components/public/js/tinymce/classes/util/Tools.js +442 -0
- data/apps/core/components/public/js/tinymce/classes/util/URI.js +411 -0
- data/apps/core/components/public/js/tinymce/classes/util/VK.js +37 -0
- data/apps/core/components/public/js/tinymce/classes/util/XHR.js +110 -0
- data/apps/core/components/public/js/tinymce/jquery.tinymce.min.js +1 -0
- data/apps/core/components/public/js/tinymce/langs/it.js +219 -0
- data/apps/core/components/public/js/tinymce/langs/readme.md +3 -0
- data/apps/core/components/public/js/tinymce/license.txt +504 -0
- data/apps/core/components/public/js/tinymce/plugins/advlist/plugin.js +97 -0
- data/apps/core/components/public/js/tinymce/plugins/advlist/plugin.min.js +1 -0
- data/apps/core/components/public/js/tinymce/plugins/anchor/plugin.js +55 -0
- data/apps/core/components/public/js/tinymce/plugins/anchor/plugin.min.js +1 -0
- data/apps/core/components/public/js/tinymce/plugins/autolink/plugin.js +204 -0
- data/apps/core/components/public/js/tinymce/plugins/autolink/plugin.min.js +1 -0
- data/apps/core/components/public/js/tinymce/plugins/autoresize/plugin.js +162 -0
- data/apps/core/components/public/js/tinymce/plugins/autoresize/plugin.min.js +1 -0
- data/apps/core/components/public/js/tinymce/plugins/autosave/plugin.js +165 -0
- data/apps/core/components/public/js/tinymce/plugins/autosave/plugin.min.js +1 -0
- data/apps/core/components/public/js/tinymce/plugins/bbcode/plugin.js +123 -0
- data/apps/core/components/public/js/tinymce/plugins/bbcode/plugin.min.js +1 -0
- data/apps/core/components/public/js/tinymce/plugins/charmap/plugin.js +450 -0
- data/apps/core/components/public/js/tinymce/plugins/charmap/plugin.min.js +1 -0
- data/apps/core/components/public/js/tinymce/plugins/code/plugin.js +60 -0
- data/apps/core/components/public/js/tinymce/plugins/code/plugin.min.js +1 -0
- data/apps/core/components/public/js/tinymce/plugins/codesample/classes/Dialog.js +121 -0
- data/apps/core/components/public/js/tinymce/plugins/codesample/classes/Plugin.js +95 -0
- data/apps/core/components/public/js/tinymce/plugins/codesample/classes/Prism.js +937 -0
- data/apps/core/components/public/js/tinymce/plugins/codesample/classes/Utils.js +33 -0
- data/apps/core/components/public/js/tinymce/plugins/codesample/css/prism.css +138 -0
- data/apps/core/components/public/js/tinymce/plugins/codesample/plugin.dev.js +141 -0
- data/apps/core/components/public/js/tinymce/plugins/codesample/plugin.js +1299 -0
- data/apps/core/components/public/js/tinymce/plugins/codesample/plugin.min.js +1 -0
- data/apps/core/components/public/js/tinymce/plugins/colorpicker/plugin.js +112 -0
- data/apps/core/components/public/js/tinymce/plugins/colorpicker/plugin.min.js +1 -0
- data/apps/core/components/public/js/tinymce/plugins/compat3x/css/dialog.css +118 -0
- data/apps/core/components/public/js/tinymce/plugins/compat3x/img/buttons.png +0 -0
- data/apps/core/components/public/js/tinymce/plugins/compat3x/img/icons.gif +0 -0
- data/apps/core/components/public/js/tinymce/plugins/compat3x/img/items.gif +0 -0
- data/apps/core/components/public/js/tinymce/plugins/compat3x/img/menu_arrow.gif +0 -0
- data/apps/core/components/public/js/tinymce/plugins/compat3x/img/menu_check.gif +0 -0
- data/apps/core/components/public/js/tinymce/plugins/compat3x/img/progress.gif +0 -0
- data/apps/core/components/public/js/tinymce/plugins/compat3x/img/tabs.gif +0 -0
- data/apps/core/components/public/js/tinymce/plugins/compat3x/plugin.js +297 -0
- data/apps/core/components/public/js/tinymce/plugins/compat3x/plugin.min.js +1 -0
- data/apps/core/components/public/js/tinymce/plugins/compat3x/tiny_mce_popup.js +542 -0
- data/apps/core/components/public/js/tinymce/plugins/compat3x/utils/editable_selects.js +70 -0
- data/apps/core/components/public/js/tinymce/plugins/compat3x/utils/form_utils.js +210 -0
- data/apps/core/components/public/js/tinymce/plugins/compat3x/utils/mctabs.js +164 -0
- data/apps/core/components/public/js/tinymce/plugins/compat3x/utils/validate.js +252 -0
- data/apps/core/components/public/js/tinymce/plugins/contextmenu/plugin.js +88 -0
- data/apps/core/components/public/js/tinymce/plugins/contextmenu/plugin.min.js +1 -0
- data/apps/core/components/public/js/tinymce/plugins/directionality/plugin.js +64 -0
- data/apps/core/components/public/js/tinymce/plugins/directionality/plugin.min.js +1 -0
- data/apps/core/components/public/js/tinymce/plugins/emoticons/img/smiley-cool.gif +0 -0
- data/apps/core/components/public/js/tinymce/plugins/emoticons/img/smiley-cry.gif +0 -0
- data/apps/core/components/public/js/tinymce/plugins/emoticons/img/smiley-embarassed.gif +0 -0
- data/apps/core/components/public/js/tinymce/plugins/emoticons/img/smiley-foot-in-mouth.gif +0 -0
- data/apps/core/components/public/js/tinymce/plugins/emoticons/img/smiley-frown.gif +0 -0
- data/apps/core/components/public/js/tinymce/plugins/emoticons/img/smiley-innocent.gif +0 -0
- data/apps/core/components/public/js/tinymce/plugins/emoticons/img/smiley-kiss.gif +0 -0
- data/apps/core/components/public/js/tinymce/plugins/emoticons/img/smiley-laughing.gif +0 -0
- data/apps/core/components/public/js/tinymce/plugins/emoticons/img/smiley-money-mouth.gif +0 -0
- data/apps/core/components/public/js/tinymce/plugins/emoticons/img/smiley-sealed.gif +0 -0
- data/apps/core/components/public/js/tinymce/plugins/emoticons/img/smiley-smile.gif +0 -0
- data/apps/core/components/public/js/tinymce/plugins/emoticons/img/smiley-surprised.gif +0 -0
- data/apps/core/components/public/js/tinymce/plugins/emoticons/img/smiley-tongue-out.gif +0 -0
- data/apps/core/components/public/js/tinymce/plugins/emoticons/img/smiley-undecided.gif +0 -0
- data/apps/core/components/public/js/tinymce/plugins/emoticons/img/smiley-wink.gif +0 -0
- data/apps/core/components/public/js/tinymce/plugins/emoticons/img/smiley-yell.gif +0 -0
- data/apps/core/components/public/js/tinymce/plugins/emoticons/plugin.js +65 -0
- data/apps/core/components/public/js/tinymce/plugins/emoticons/plugin.min.js +1 -0
- data/apps/core/components/public/js/tinymce/plugins/example/dialog.html +8 -0
- data/apps/core/components/public/js/tinymce/plugins/example/plugin.js +68 -0
- data/apps/core/components/public/js/tinymce/plugins/example/plugin.min.js +1 -0
- data/apps/core/components/public/js/tinymce/plugins/example_dependency/plugin.js +22 -0
- data/apps/core/components/public/js/tinymce/plugins/example_dependency/plugin.min.js +1 -0
- data/apps/core/components/public/js/tinymce/plugins/fullpage/plugin.js +490 -0
- data/apps/core/components/public/js/tinymce/plugins/fullpage/plugin.min.js +1 -0
- data/apps/core/components/public/js/tinymce/plugins/fullscreen/plugin.js +154 -0
- data/apps/core/components/public/js/tinymce/plugins/fullscreen/plugin.min.js +1 -0
- data/apps/core/components/public/js/tinymce/plugins/hr/plugin.js +30 -0
- data/apps/core/components/public/js/tinymce/plugins/hr/plugin.min.js +1 -0
- data/apps/core/components/public/js/tinymce/plugins/image/plugin.js +630 -0
- data/apps/core/components/public/js/tinymce/plugins/image/plugin.min.js +1 -0
- data/apps/core/components/public/js/tinymce/plugins/imagetools/config/bolt/atomic.js +6 -0
- data/apps/core/components/public/js/tinymce/plugins/imagetools/config/bolt/browser.js +6 -0
- data/apps/core/components/public/js/tinymce/plugins/imagetools/config/bolt/demo.js +8 -0
- data/apps/core/components/public/js/tinymce/plugins/imagetools/config/bolt/prod.js +6 -0
- data/apps/core/components/public/js/tinymce/plugins/imagetools/plugin.js +2668 -0
- data/apps/core/components/public/js/tinymce/plugins/imagetools/plugin.min.js +1 -0
- data/apps/core/components/public/js/tinymce/plugins/imagetools/src/demo/html/demo.html +16 -0
- data/apps/core/components/public/js/tinymce/plugins/imagetools/src/demo/js/Demo.js +92 -0
- data/apps/core/components/public/js/tinymce/plugins/imagetools/src/main/js/CropRect.js +214 -0
- data/apps/core/components/public/js/tinymce/plugins/imagetools/src/main/js/Dialog.js +485 -0
- data/apps/core/components/public/js/tinymce/plugins/imagetools/src/main/js/ImagePanel.js +218 -0
- data/apps/core/components/public/js/tinymce/plugins/imagetools/src/main/js/Plugin.js +411 -0
- data/apps/core/components/public/js/tinymce/plugins/imagetools/src/main/js/UndoStack.js +57 -0
- data/apps/core/components/public/js/tinymce/plugins/importcss/plugin.js +227 -0
- data/apps/core/components/public/js/tinymce/plugins/importcss/plugin.min.js +1 -0
- data/apps/core/components/public/js/tinymce/plugins/insertdatetime/plugin.js +121 -0
- data/apps/core/components/public/js/tinymce/plugins/insertdatetime/plugin.min.js +1 -0
- data/apps/core/components/public/js/tinymce/plugins/layer/plugin.js +225 -0
- data/apps/core/components/public/js/tinymce/plugins/layer/plugin.min.js +1 -0
- data/apps/core/components/public/js/tinymce/plugins/legacyoutput/plugin.js +211 -0
- data/apps/core/components/public/js/tinymce/plugins/legacyoutput/plugin.min.js +1 -0
- data/apps/core/components/public/js/tinymce/plugins/link/plugin.js +403 -0
- data/apps/core/components/public/js/tinymce/plugins/link/plugin.min.js +1 -0
- data/apps/core/components/public/js/tinymce/plugins/lists/plugin.js +885 -0
- data/apps/core/components/public/js/tinymce/plugins/lists/plugin.min.js +1 -0
- data/apps/core/components/public/js/tinymce/plugins/media/moxieplayer.swf +0 -0
- data/apps/core/components/public/js/tinymce/plugins/media/plugin.js +878 -0
- data/apps/core/components/public/js/tinymce/plugins/media/plugin.min.js +1 -0
- data/apps/core/components/public/js/tinymce/plugins/nonbreaking/plugin.js +53 -0
- data/apps/core/components/public/js/tinymce/plugins/nonbreaking/plugin.min.js +1 -0
- data/apps/core/components/public/js/tinymce/plugins/noneditable/plugin.js +101 -0
- data/apps/core/components/public/js/tinymce/plugins/noneditable/plugin.min.js +1 -0
- data/apps/core/components/public/js/tinymce/plugins/pagebreak/plugin.js +88 -0
- data/apps/core/components/public/js/tinymce/plugins/pagebreak/plugin.min.js +1 -0
- data/apps/core/components/public/js/tinymce/plugins/paste/classes/Clipboard.js +672 -0
- data/apps/core/components/public/js/tinymce/plugins/paste/classes/Plugin.js +121 -0
- data/apps/core/components/public/js/tinymce/plugins/paste/classes/Quirks.js +159 -0
- data/apps/core/components/public/js/tinymce/plugins/paste/classes/Utils.js +140 -0
- data/apps/core/components/public/js/tinymce/plugins/paste/classes/WordFilter.js +500 -0
- data/apps/core/components/public/js/tinymce/plugins/paste/plugin.dev.js +142 -0
- data/apps/core/components/public/js/tinymce/plugins/paste/plugin.js +1708 -0
- data/apps/core/components/public/js/tinymce/plugins/paste/plugin.min.js +1 -0
- data/apps/core/components/public/js/tinymce/plugins/preview/plugin.js +88 -0
- data/apps/core/components/public/js/tinymce/plugins/preview/plugin.min.js +1 -0
- data/apps/core/components/public/js/tinymce/plugins/print/plugin.js +32 -0
- data/apps/core/components/public/js/tinymce/plugins/print/plugin.min.js +1 -0
- data/apps/core/components/public/js/tinymce/plugins/save/plugin.js +98 -0
- data/apps/core/components/public/js/tinymce/plugins/save/plugin.min.js +1 -0
- data/apps/core/components/public/js/tinymce/plugins/searchreplace/plugin.js +609 -0
- data/apps/core/components/public/js/tinymce/plugins/searchreplace/plugin.min.js +1 -0
- data/apps/core/components/public/js/tinymce/plugins/spellchecker/classes/DomTextMatcher.js +480 -0
- data/apps/core/components/public/js/tinymce/plugins/spellchecker/classes/Plugin.js +439 -0
- data/apps/core/components/public/js/tinymce/plugins/spellchecker/plugin.dev.js +139 -0
- data/apps/core/components/public/js/tinymce/plugins/spellchecker/plugin.js +1026 -0
- data/apps/core/components/public/js/tinymce/plugins/spellchecker/plugin.min.js +1 -0
- data/apps/core/components/public/js/tinymce/plugins/tabfocus/plugin.js +120 -0
- data/apps/core/components/public/js/tinymce/plugins/tabfocus/plugin.min.js +1 -0
- data/apps/core/components/public/js/tinymce/plugins/table/classes/CellSelection.js +202 -0
- data/apps/core/components/public/js/tinymce/plugins/table/classes/Dialogs.js +824 -0
- data/apps/core/components/public/js/tinymce/plugins/table/classes/Plugin.js +599 -0
- data/apps/core/components/public/js/tinymce/plugins/table/classes/Quirks.js +400 -0
- data/apps/core/components/public/js/tinymce/plugins/table/classes/ResizeBars.js +984 -0
- data/apps/core/components/public/js/tinymce/plugins/table/classes/TableGrid.js +941 -0
- data/apps/core/components/public/js/tinymce/plugins/table/classes/Utils.js +36 -0
- data/apps/core/components/public/js/tinymce/plugins/table/plugin.dev.js +142 -0
- data/apps/core/components/public/js/tinymce/plugins/table/plugin.js +4106 -0
- data/apps/core/components/public/js/tinymce/plugins/table/plugin.min.js +2 -0
- data/apps/core/components/public/js/tinymce/plugins/template/plugin.js +270 -0
- data/apps/core/components/public/js/tinymce/plugins/template/plugin.min.js +1 -0
- data/apps/core/components/public/js/tinymce/plugins/textcolor/plugin.js +282 -0
- data/apps/core/components/public/js/tinymce/plugins/textcolor/plugin.min.js +1 -0
- data/apps/core/components/public/js/tinymce/plugins/textpattern/plugin.js +268 -0
- data/apps/core/components/public/js/tinymce/plugins/textpattern/plugin.min.js +1 -0
- data/apps/core/components/public/js/tinymce/plugins/visualblocks/css/visualblocks.css +135 -0
- data/apps/core/components/public/js/tinymce/plugins/visualblocks/img/address.gif +0 -0
- data/apps/core/components/public/js/tinymce/plugins/visualblocks/img/article.gif +0 -0
- data/apps/core/components/public/js/tinymce/plugins/visualblocks/img/aside.gif +0 -0
- data/apps/core/components/public/js/tinymce/plugins/visualblocks/img/blockquote.gif +0 -0
- data/apps/core/components/public/js/tinymce/plugins/visualblocks/img/div.gif +0 -0
- data/apps/core/components/public/js/tinymce/plugins/visualblocks/img/dl.gif +0 -0
- data/apps/core/components/public/js/tinymce/plugins/visualblocks/img/figure.gif +0 -0
- data/apps/core/components/public/js/tinymce/plugins/visualblocks/img/h1.gif +0 -0
- data/apps/core/components/public/js/tinymce/plugins/visualblocks/img/h2.gif +0 -0
- data/apps/core/components/public/js/tinymce/plugins/visualblocks/img/h3.gif +0 -0
- data/apps/core/components/public/js/tinymce/plugins/visualblocks/img/h4.gif +0 -0
- data/apps/core/components/public/js/tinymce/plugins/visualblocks/img/h5.gif +0 -0
- data/apps/core/components/public/js/tinymce/plugins/visualblocks/img/h6.gif +0 -0
- data/apps/core/components/public/js/tinymce/plugins/visualblocks/img/hgroup.gif +0 -0
- data/apps/core/components/public/js/tinymce/plugins/visualblocks/img/ol.gif +0 -0
- data/apps/core/components/public/js/tinymce/plugins/visualblocks/img/p.gif +0 -0
- data/apps/core/components/public/js/tinymce/plugins/visualblocks/img/pre.gif +0 -0
- data/apps/core/components/public/js/tinymce/plugins/visualblocks/img/section.gif +0 -0
- data/apps/core/components/public/js/tinymce/plugins/visualblocks/img/ul.gif +0 -0
- data/apps/core/components/public/js/tinymce/plugins/visualblocks/plugin.js +86 -0
- data/apps/core/components/public/js/tinymce/plugins/visualblocks/plugin.min.js +1 -0
- data/apps/core/components/public/js/tinymce/plugins/visualchars/plugin.js +123 -0
- data/apps/core/components/public/js/tinymce/plugins/visualchars/plugin.min.js +1 -0
- data/apps/core/components/public/js/tinymce/plugins/wordcount/plugin.js +69 -0
- data/apps/core/components/public/js/tinymce/plugins/wordcount/plugin.min.js +1 -0
- data/apps/core/components/public/js/tinymce/skins/lightgray/AbsoluteLayout.less +17 -0
- data/apps/core/components/public/js/tinymce/skins/lightgray/Animations.less +10 -0
- data/apps/core/components/public/js/tinymce/skins/lightgray/Button.less +172 -0
- data/apps/core/components/public/js/tinymce/skins/lightgray/ButtonGroup.less +71 -0
- data/apps/core/components/public/js/tinymce/skins/lightgray/Checkbox.less +49 -0
- data/apps/core/components/public/js/tinymce/skins/lightgray/ColorBox.less +6 -0
- data/apps/core/components/public/js/tinymce/skins/lightgray/ColorButton.less +72 -0
- data/apps/core/components/public/js/tinymce/skins/lightgray/ColorPicker.less +80 -0
- data/apps/core/components/public/js/tinymce/skins/lightgray/ComboBox.less +39 -0
- data/apps/core/components/public/js/tinymce/skins/lightgray/Container.less +9 -0
- data/apps/core/components/public/js/tinymce/skins/lightgray/Content.Inline.less +4 -0
- data/apps/core/components/public/js/tinymce/skins/lightgray/Content.Objects.less +166 -0
- data/apps/core/components/public/js/tinymce/skins/lightgray/Content.less +27 -0
- data/apps/core/components/public/js/tinymce/skins/lightgray/CropRect.less +54 -0
- data/apps/core/components/public/js/tinymce/skins/lightgray/FieldSet.less +15 -0
- data/apps/core/components/public/js/tinymce/skins/lightgray/FitLayout.less +9 -0
- data/apps/core/components/public/js/tinymce/skins/lightgray/FloatPanel.less +69 -0
- data/apps/core/components/public/js/tinymce/skins/lightgray/FlowLayout.less +36 -0
- data/apps/core/components/public/js/tinymce/skins/lightgray/Icons.Ie7.less +136 -0
- data/apps/core/components/public/js/tinymce/skins/lightgray/Icons.less +180 -0
- data/apps/core/components/public/js/tinymce/skins/lightgray/Iframe.less +6 -0
- data/apps/core/components/public/js/tinymce/skins/lightgray/ImagePanel.less +20 -0
- data/apps/core/components/public/js/tinymce/skins/lightgray/InfoBox.less +71 -0
- data/apps/core/components/public/js/tinymce/skins/lightgray/Label.less +38 -0
- data/apps/core/components/public/js/tinymce/skins/lightgray/ListBox.less +26 -0
- data/apps/core/components/public/js/tinymce/skins/lightgray/Menu.less +34 -0
- data/apps/core/components/public/js/tinymce/skins/lightgray/MenuBar.less +32 -0
- data/apps/core/components/public/js/tinymce/skins/lightgray/MenuButton.less +34 -0
- data/apps/core/components/public/js/tinymce/skins/lightgray/MenuItem.less +142 -0
- data/apps/core/components/public/js/tinymce/skins/lightgray/Mixins.less +54 -0
- data/apps/core/components/public/js/tinymce/skins/lightgray/Notification.less +144 -0
- data/apps/core/components/public/js/tinymce/skins/lightgray/Panel.less +7 -0
- data/apps/core/components/public/js/tinymce/skins/lightgray/Path.less +45 -0
- data/apps/core/components/public/js/tinymce/skins/lightgray/Progress.less +34 -0
- data/apps/core/components/public/js/tinymce/skins/lightgray/Radio.less +1 -0
- data/apps/core/components/public/js/tinymce/skins/lightgray/Reset.less +32 -0
- data/apps/core/components/public/js/tinymce/skins/lightgray/ResizeHandle.less +18 -0
- data/apps/core/components/public/js/tinymce/skins/lightgray/Scrollable.less +44 -0
- data/apps/core/components/public/js/tinymce/skins/lightgray/SelectBox.less +6 -0
- data/apps/core/components/public/js/tinymce/skins/lightgray/Slider.less +29 -0
- data/apps/core/components/public/js/tinymce/skins/lightgray/Spacer.less +5 -0
- data/apps/core/components/public/js/tinymce/skins/lightgray/SplitButton.less +49 -0
- data/apps/core/components/public/js/tinymce/skins/lightgray/StackLayout.less +5 -0
- data/apps/core/components/public/js/tinymce/skins/lightgray/TabPanel.less +44 -0
- data/apps/core/components/public/js/tinymce/skins/lightgray/TextBox.less +41 -0
- data/apps/core/components/public/js/tinymce/skins/lightgray/Throbber.less +19 -0
- data/apps/core/components/public/js/tinymce/skins/lightgray/TinyMCE.less +159 -0
- data/apps/core/components/public/js/tinymce/skins/lightgray/ToolTip.less +129 -0
- data/apps/core/components/public/js/tinymce/skins/lightgray/Variables.less +214 -0
- data/apps/core/components/public/js/tinymce/skins/lightgray/Window.less +127 -0
- data/apps/core/components/public/js/tinymce/skins/lightgray/content.inline.min.css +1 -0
- data/apps/core/components/public/js/tinymce/skins/lightgray/content.min.css +1 -0
- data/apps/core/components/public/js/tinymce/skins/lightgray/fonts/readme.md +1 -0
- data/apps/core/components/public/js/tinymce/skins/lightgray/fonts/tinymce-small.eot +0 -0
- data/apps/core/components/public/js/tinymce/skins/lightgray/fonts/tinymce-small.json +1277 -0
- data/apps/core/components/public/js/tinymce/skins/lightgray/fonts/tinymce-small.svg +63 -0
- data/apps/core/components/public/js/tinymce/skins/lightgray/fonts/tinymce-small.ttf +0 -0
- data/apps/core/components/public/js/tinymce/skins/lightgray/fonts/tinymce-small.woff +0 -0
- data/apps/core/components/public/js/tinymce/skins/lightgray/fonts/tinymce.eot +0 -0
- data/apps/core/components/public/js/tinymce/skins/lightgray/fonts/tinymce.json +3381 -0
- data/apps/core/components/public/js/tinymce/skins/lightgray/fonts/tinymce.svg +129 -0
- data/apps/core/components/public/js/tinymce/skins/lightgray/fonts/tinymce.ttf +0 -0
- data/apps/core/components/public/js/tinymce/skins/lightgray/fonts/tinymce.woff +0 -0
- data/apps/core/components/public/js/tinymce/skins/lightgray/img/anchor.gif +0 -0
- data/apps/core/components/public/js/tinymce/skins/lightgray/img/loader.gif +0 -0
- data/apps/core/components/public/js/tinymce/skins/lightgray/img/object.gif +0 -0
- data/apps/core/components/public/js/tinymce/skins/lightgray/img/trans.gif +0 -0
- data/apps/core/components/public/js/tinymce/skins/lightgray/skin.dev.less +46 -0
- data/apps/core/components/public/js/tinymce/skins/lightgray/skin.ie7.dev.less +46 -0
- data/apps/core/components/public/js/tinymce/skins/lightgray/skin.ie7.less +2542 -0
- data/apps/core/components/public/js/tinymce/skins/lightgray/skin.ie7.min.css +1 -0
- data/apps/core/components/public/js/tinymce/skins/lightgray/skin.less +2586 -0
- data/apps/core/components/public/js/tinymce/skins/lightgray/skin.min.css +1 -0
- data/apps/core/components/public/js/tinymce/themes/modern/theme.js +878 -0
- data/apps/core/components/public/js/tinymce/themes/modern/theme.min.js +1 -0
- data/apps/core/components/public/js/tinymce/tinymce.dev.js +286 -0
- data/apps/core/components/public/js/tinymce/tinymce.js +45811 -0
- data/apps/core/components/public/js/tinymce/tinymce.min.js +13 -0
- data/apps/core/forms/widgets/form/form.rb +3 -1
- data/apps/core/forms/widgets/form/form.shtml +1 -0
- data/apps/core/forms/widgets/inputs/search_select/search_select.rb +1 -1
- data/apps/core/forms/widgets/inputs/select/select.rb +1 -1
- data/apps/core/forms/widgets/inputs/select/select.shtml +0 -1
- data/apps/messenger/backends/sms/skebby.rb +1 -1
- data/apps/messenger/controllers/mixins/messenger_helper.rb +23 -5
- data/lib/spiderfw/config/options/spider.rb +1 -1
- data/lib/spiderfw/controller/mixins/visual.rb +2 -0
- data/lib/spiderfw/http/adapters/rack.rb +10 -5
- data/lib/spiderfw/http/http.rb +4 -2
- data/lib/spiderfw/model/base_model.rb +4 -4
- data/lib/spiderfw/model/mappers/db_mapper.rb +4 -2
- data/lib/spiderfw/model/storage/db/adapters/mysql.rb +2 -1
- data/lib/spiderfw/model/storage/db/db_storage.rb +4 -0
- data/lib/spiderfw/spider.rb +6 -0
- data/lib/spiderfw/templates/layout.rb +1 -1
- data/lib/spiderfw/utils/monkey/object.rb +3 -0
- data/spider.gemspec +6 -2
- metadata +539 -42
- data/blueprints/.DS_Store +0 -0
@@ -0,0 +1 @@
|
|
1
|
+
!function(){var a={},b=function(b){for(var c=a[b],e=c.deps,f=c.defn,g=e.length,h=new Array(g),i=0;g>i;++i)h[i]=d(e[i]);var j=f.apply(null,h);if(void 0===j)throw"module ["+b+"] returned undefined";c.instance=j},c=function(b,c,d){if("string"!=typeof b)throw"module id must be a string";if(void 0===c)throw"no dependencies for "+b;if(void 0===d)throw"no definition function for "+b;a[b]={deps:c,defn:d,instance:void 0}},d=function(c){var d=a[c];if(void 0===d)throw"module ["+c+"] was undefined";return void 0===d.instance&&b(c),d.instance},e=function(a,b){for(var c=a.length,e=new Array(c),f=0;c>f;++f)e.push(d(a[f]));b.apply(null,b)},f={};f.bolt={module:{api:{define:c,require:e,demand:d}}};var g=c,h=function(a,b){g(a,[],function(){return b})};h("1",tinymce.PluginManager),h("2",tinymce.Env),h("3",tinymce.util.Promise),h("4",tinymce.util.URI),h("5",tinymce.util.Tools),h("6",tinymce.util.Delay),g("j",[],function(){function a(a,b){return c(document.createElement("canvas"),a,b)}function b(a){return a.getContext("2d")}function c(a,b,c){return a.width=b,a.height=c,a}return{create:a,resize:c,get2dContext:b}}),g("k",[],function(){function a(a){return a.naturalWidth||a.width}function b(a){return a.naturalHeight||a.height}return{getWidth:a,getHeight:b}}),g("l",[],function(){function a(a,b){return function(){a.apply(b,arguments)}}function b(b){if("object"!=typeof this)throw new TypeError("Promises must be constructed via new");if("function"!=typeof b)throw new TypeError("not a function");this._state=null,this._value=null,this._deferreds=[],h(b,a(d,this),a(e,this))}function c(a){var b=this;return null===this._state?void this._deferreds.push(a):void i(function(){var c=b._state?a.onFulfilled:a.onRejected;if(null===c)return void(b._state?a.resolve:a.reject)(b._value);var d;try{d=c(b._value)}catch(e){return void a.reject(e)}a.resolve(d)})}function d(b){try{if(b===this)throw new TypeError("A promise cannot be resolved with itself.");if(b&&("object"==typeof b||"function"==typeof b)){var c=b.then;if("function"==typeof c)return void h(a(c,b),a(d,this),a(e,this))}this._state=!0,this._value=b,f.call(this)}catch(g){e.call(this,g)}}function e(a){this._state=!1,this._value=a,f.call(this)}function f(){for(var a=0,b=this._deferreds.length;b>a;a++)c.call(this,this._deferreds[a]);this._deferreds=null}function g(a,b,c,d){this.onFulfilled="function"==typeof a?a:null,this.onRejected="function"==typeof b?b:null,this.resolve=c,this.reject=d}function h(a,b,c){var d=!1;try{a(function(a){d||(d=!0,b(a))},function(a){d||(d=!0,c(a))})}catch(e){if(d)return;d=!0,c(e)}}if(window.Promise)return window.Promise;var i=b.immediateFn||"function"==typeof setImmediate&&setImmediate||function(a){setTimeout(a,1)},j=Array.isArray||function(a){return"[object Array]"===Object.prototype.toString.call(a)};return b.prototype["catch"]=function(a){return this.then(null,a)},b.prototype.then=function(a,d){var e=this;return new b(function(b,f){c.call(e,new g(a,d,b,f))})},b.all=function(){var a=Array.prototype.slice.call(1===arguments.length&&j(arguments[0])?arguments[0]:arguments);return new b(function(b,c){function d(f,g){try{if(g&&("object"==typeof g||"function"==typeof g)){var h=g.then;if("function"==typeof h)return void h.call(g,function(a){d(f,a)},c)}a[f]=g,0===--e&&b(a)}catch(i){c(i)}}if(0===a.length)return b([]);for(var e=a.length,f=0;f<a.length;f++)d(f,a[f])})},b.resolve=function(a){return a&&"object"==typeof a&&a.constructor===b?a:new b(function(b){b(a)})},b.reject=function(a){return new b(function(b,c){c(a)})},b.race=function(a){return new b(function(b,c){for(var d=0,e=a.length;e>d;d++)a[d].then(b,c)})},b}),g("m",[],function(){function a(a){var b=document.createElement("a");return b.href=a,b.pathname}function b(b){var c=a(b).split("."),d=c[c.length-1],e={jpg:"image/jpeg",jpeg:"image/jpeg",png:"image/png"};return d&&(d=d.toLowerCase()),e[d]}return{guessMimeType:b}}),g("c",["l","j","m","k"],function(a,b,c,d){function e(b){return new a(function(a){function c(){b.removeEventListener("load",c),a(b)}b.complete?a(b):b.addEventListener("load",c)})}function f(a){return e(a).then(function(a){var c,e;return e=b.create(d.getWidth(a),d.getHeight(a)),c=b.get2dContext(e),c.drawImage(a,0,0),e})}function g(a){return e(a).then(function(a){var b=a.src;return 0===b.indexOf("blob:")?i(b):0===b.indexOf("data:")?j(b):f(a).then(function(a){return j(a.toDataURL(c.guessMimeType(b)))})})}function h(b){return new a(function(a){function c(){d.removeEventListener("load",c),a(d)}var d=new Image;d.addEventListener("load",c),d.src=URL.createObjectURL(b),d.complete&&c()})}function i(b){return new a(function(a){var c=new XMLHttpRequest;c.open("GET",b,!0),c.responseType="blob",c.onload=function(){200==this.status&&a(this.response)},c.send()})}function j(b){return new a(function(a){var c,d,e,f,g,h;if(b=b.split(","),f=/data:([^;]+)/.exec(b[0]),f&&(g=f[1]),c=atob(b[1]),window.WebKitBlobBuilder){for(h=new WebKitBlobBuilder,d=new ArrayBuffer(c.length),e=0;e<d.length;e++)d[e]=c.charCodeAt(e);return h.append(d),void a(h.getBlob(g))}for(d=new Uint8Array(c.length),e=0;e<d.length;e++)d[e]=c.charCodeAt(e);a(new Blob([d],{type:g}))})}function k(a){return 0===a.indexOf("blob:")?i(a):0===a.indexOf("data:")?j(a):null}function l(a,b){return j(a.toDataURL(b))}function m(b){return new a(function(a){var c=new FileReader;c.onloadend=function(){a(c.result)},c.readAsDataURL(b)})}function n(a){return m(a).then(function(a){return a.split(",")[1]})}function o(a){URL.revokeObjectURL(a.src)}return{blobToImage:h,imageToBlob:g,blobToDataUri:m,blobToBase64:n,imageToCanvas:f,canvasToBlob:l,revokeImageUrl:o,uriToBlob:k}}),g("n",[],function(){function a(a,b,c){return a=parseFloat(a),a>c?a=c:b>a&&(a=b),a}function b(){return[1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1]}function c(a,b){var c,d,e,f,g=[],h=new Array(10);for(c=0;5>c;c++){for(d=0;5>d;d++)g[d]=b[d+5*c];for(d=0;5>d;d++){for(f=0,e=0;5>e;e++)f+=a[d+5*e]*g[e];h[d+5*c]=f}}return h}function d(b,c){return c=a(c,0,1),b.map(function(b,d){return d%6===0?b=1-(1-b)*c:b*=c,a(b,0,1)})}function e(b,d){var e;return d=a(d,-1,1),d*=100,0>d?e=127+d/100*127:(e=d%1,e=0===e?l[d]:l[Math.floor(d)]*(1-e)+l[Math.floor(d)+1]*e,e=127*e+127),c(b,[e/127,0,0,0,.5*(127-e),0,e/127,0,0,.5*(127-e),0,0,e/127,0,.5*(127-e),0,0,0,1,0,0,0,0,0,1])}function f(b,d){var e,f,g,h;return d=a(d,-1,1),e=1+(d>0?3*d:d),f=.3086,g=.6094,h=.082,c(b,[f*(1-e)+e,g*(1-e),h*(1-e),0,0,f*(1-e),g*(1-e)+e,h*(1-e),0,0,f*(1-e),g*(1-e),h*(1-e)+e,0,0,0,0,0,1,0,0,0,0,0,1])}function g(b,d){var e,f,g,h,i;return d=a(d,-180,180)/180*Math.PI,e=Math.cos(d),f=Math.sin(d),g=.213,h=.715,i=.072,c(b,[g+e*(1-g)+f*-g,h+e*-h+f*-h,i+e*-i+f*(1-i),0,0,g+e*-g+.143*f,h+e*(1-h)+.14*f,i+e*-i+f*-.283,0,0,g+e*-g+f*-(1-g),h+e*-h+f*h,i+e*(1-i)+f*i,0,0,0,0,0,1,0,0,0,0,0,1])}function h(b,d){return d=a(255*d,-255,255),c(b,[1,0,0,0,d,0,1,0,0,d,0,0,1,0,d,0,0,0,1,0,0,0,0,0,1])}function i(b,d,e,f){return d=a(d,0,2),e=a(e,0,2),f=a(f,0,2),c(b,[d,0,0,0,0,0,e,0,0,0,0,0,f,0,0,0,0,0,1,0,0,0,0,0,1])}function j(b,e){return e=a(e,0,1),c(b,d([.393,.769,.189,0,0,.349,.686,.168,0,0,.272,.534,.131,0,0,0,0,0,1,0,0,0,0,0,1],e))}function k(b,e){return e=a(e,0,1),c(b,d([.33,.34,.33,0,0,.33,.34,.33,0,0,.33,.34,.33,0,0,0,0,0,1,0,0,0,0,0,1],e))}var l=[0,.01,.02,.04,.05,.06,.07,.08,.1,.11,.12,.14,.15,.16,.17,.18,.2,.21,.22,.24,.25,.27,.28,.3,.32,.34,.36,.38,.4,.42,.44,.46,.48,.5,.53,.56,.59,.62,.65,.68,.71,.74,.77,.8,.83,.86,.89,.92,.95,.98,1,1.06,1.12,1.18,1.24,1.3,1.36,1.42,1.48,1.54,1.6,1.66,1.72,1.78,1.84,1.9,1.96,2,2.12,2.25,2.37,2.5,2.62,2.75,2.87,3,3.2,3.4,3.6,3.8,4,4.3,4.7,4.9,5,5.5,6,6.5,6.8,7,7.3,7.5,7.8,8,8.4,8.7,9,9.4,9.6,9.8,10];return{identity:b,adjust:d,multiply:c,adjustContrast:e,adjustBrightness:h,adjustSaturation:f,adjustHue:g,adjustColors:i,adjustSepia:j,adjustGrayscale:k}}),g("a",["j","k","c","n"],function(a,b,c,d){function e(d,e){return c.blobToImage(d).then(function(d){function f(a,b){var c,d,e,f,g,h=a.data,i=b[0],j=b[1],k=b[2],l=b[3],m=b[4],n=b[5],o=b[6],p=b[7],q=b[8],r=b[9],s=b[10],t=b[11],u=b[12],v=b[13],w=b[14],x=b[15],y=b[16],z=b[17],A=b[18],B=b[19];for(g=0;g<h.length;g+=4)c=h[g],d=h[g+1],e=h[g+2],f=h[g+3],h[g]=c*i+d*j+e*k+f*l+m,h[g+1]=c*n+d*o+e*p+f*q+r,h[g+2]=c*s+d*t+e*u+f*v+w,h[g+3]=c*x+d*y+e*z+f*A+B;return a}var g,h=a.create(b.getWidth(d),b.getHeight(d)),i=a.get2dContext(h);return i.drawImage(d,0,0),k(d),g=f(i.getImageData(0,0,h.width,h.height),e),i.putImageData(g,0,0),c.canvasToBlob(h)})}function f(d,e){return c.blobToImage(d).then(function(d){function f(a,b,c){function d(a,b,c){return a>c?a=c:b>a&&(a=b),a}var e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u;for(g=Math.round(Math.sqrt(c.length)),h=Math.floor(g/2),e=a.data,f=b.data,t=a.width,u=a.height,j=0;u>j;j++)for(i=0;t>i;i++){for(k=l=m=0,o=0;g>o;o++)for(n=0;g>n;n++)p=d(i+n-h,0,t-1),q=d(j+o-h,0,u-1),r=4*(q*t+p),s=c[o*g+n],k+=e[r]*s,l+=e[r+1]*s,m+=e[r+2]*s;r=4*(j*t+i),f[r]=d(k,0,255),f[r+1]=d(l,0,255),f[r+2]=d(m,0,255)}return b}var g,h,i=a.create(b.getWidth(d),b.getHeight(d)),j=a.get2dContext(i);return j.drawImage(d,0,0),k(d),g=j.getImageData(0,0,i.width,i.height),h=j.getImageData(0,0,i.width,i.height),h=f(g,h,e),j.putImageData(h,0,0),c.canvasToBlob(i)})}function g(d){return function(e,f){return c.blobToImage(e).then(function(e){function g(a,b){var c,d=a.data;for(c=0;c<d.length;c+=4)d[c]=b[d[c]],d[c+1]=b[d[c+1]],d[c+2]=b[d[c+2]];return a}var h,i,j=a.create(b.getWidth(e),b.getHeight(e)),l=a.get2dContext(j),m=new Array(256);for(i=0;i<m.length;i++)m[i]=d(i,f);return l.drawImage(e,0,0),k(e),h=g(l.getImageData(0,0,j.width,j.height),m),l.putImageData(h,0,0),c.canvasToBlob(j)})}}function h(a){return function(b,c){return e(b,a(d.identity(),c))}}function i(a){return function(b){return e(b,a)}}function j(a){return function(b){return f(b,a)}}var k=c.revokeImageUrl;return{invert:i([-1,0,0,0,255,0,-1,0,0,255,0,0,-1,0,255,0,0,0,1,0]),brightness:h(d.adjustBrightness),hue:h(d.adjustHue),saturate:h(d.adjustSaturation),contrast:h(d.adjustContrast),grayscale:h(d.adjustGrayscale),sepia:h(d.adjustSepia),colorize:function(a,b,c,f){return e(a,d.adjustColors(d.identity(),b,c,f))},sharpen:j([0,-1,0,-1,5,-1,0,-1,0]),emboss:j([-2,-1,0,-1,1,1,0,1,2]),gamma:g(function(a,b){return 255*Math.pow(a/255,1-b)}),exposure:g(function(a,b){return 255*(1-Math.exp(-(a/255)*b))}),colorFilter:e,convoluteFilter:f}}),g("b",["c","j","k"],function(a,b,c){function d(d,e){return a.blobToImage(d).then(function(f){var g=b.create(c.getWidth(f),c.getHeight(f)),i=b.get2dContext(g),j=0,k=0;return e=0>e?360+e:e,90!=e&&270!=e||b.resize(g,g.height,g.width),90!=e&&180!=e||(j=g.width),270!=e&&180!=e||(k=g.height),i.translate(j,k),i.rotate(e*Math.PI/180),i.drawImage(f,0,0),h(f),a.canvasToBlob(g,d.type)})}function e(d,e){return a.blobToImage(d).then(function(d){var f=b.create(c.getWidth(d),c.getHeight(d)),g=b.get2dContext(f);return"v"==e?(g.scale(1,-1),g.drawImage(d,0,-f.height)):(g.scale(-1,1),g.drawImage(d,-f.width,0)),h(d),a.canvasToBlob(f)})}function f(c,d,e,f,g){return a.blobToImage(c).then(function(c){var i=b.create(f,g),j=b.get2dContext(i);return j.drawImage(c,-d,-e),h(c),a.canvasToBlob(i)})}function g(c,d,e){return a.blobToImage(c).then(function(f){var g=b.create(d,e),i=b.get2dContext(g);return i.drawImage(f,0,0,d,e),h(f),a.canvasToBlob(g,c.type)})}var h=a.revokeImageUrl;return{rotate:d,flip:e,crop:f,resize:g}}),g("7",["a","b"],function(a,b){var c=function(b){return a.invert(b)},d=function(b){return a.sharpen(b)},e=function(b){return a.emboss(b)},f=function(b,c){return a.gamma(b,c)},g=function(b,c){return a.exposure(b,c)},h=function(b,c,d,e){return a.colorize(b,c,d,e)},i=function(b,c){return a.brightness(b,c)},j=function(b,c){return a.hue(b,c)},k=function(b,c){return a.saturate(b,c)},l=function(b,c){return a.contrast(b,c)},m=function(b,c){return a.grayscale(b,c)},n=function(b,c){return a.sepia(b,c)},o=function(a,c){return b.flip(a,c)},p=function(a,c,d,e,f){return b.crop(a,c,d,e,f)},q=function(a,c,d){return b.resize(a,c,d)},r=function(a,c){return b.rotate(a,c)};return{invert:c,sharpen:d,emboss:e,brightness:i,hue:j,saturate:k,contrast:l,grayscale:m,sepia:n,colorize:h,gamma:f,exposure:g,flip:o,crop:p,resize:q,rotate:r}}),g("8",["c"],function(a){var b=function(b){return a.blobToImage(b)},c=function(b){return a.imageToBlob(b)},d=function(b){return a.blobToDataUri(b)},e=function(b){return a.blobToBase64(b)};return{blobToImage:b,imageToBlob:c,blobToDataUri:d,blobToBase64:e}}),h("d",tinymce.dom.DOMUtils),h("e",tinymce.ui.Factory),h("f",tinymce.ui.Form),h("g",tinymce.ui.Container),h("o",tinymce.ui.Control),h("p",tinymce.ui.DragHelper),h("q",tinymce.geom.Rect),h("s",tinymce.dom.DomQuery),h("t",tinymce.util.Observable),g("r",["s","p","q","5","t"],function(a,b,c,d,e){var f=0;return function(g,h,i,j){function k(a,b){return{x:b.x+a.x,y:b.y+a.y,w:b.w,h:b.h}}function l(a,b){return{x:b.x-a.x,y:b.y-a.y,w:b.w,h:b.h}}function m(){return l(i,g)}function n(){function e(a){var d;return new b(A,{document:j.ownerDocument,handle:A+"-"+a.name,start:function(){d=g},drag:function(b){var e,f,h,j,k;e=d.x,f=d.y,h=d.w,j=d.h,e+=b.deltaX*a.deltaX,f+=b.deltaY*a.deltaY,h+=b.deltaX*a.deltaW,j+=b.deltaY*a.deltaH,20>h&&(h=20),20>j&&(j=20),k=g=c.clamp({x:e,y:f,w:h,h:j},i,"move"==a.name),k=l(i,k),v.fire("updateRect",{rect:k}),s(k)}})}a('<div id="'+A+'" class="'+z+'croprect-container" data-mce-bogus="all">').appendTo(j),d.each(y,function(b){a("#"+A,j).append('<div id="'+A+"-"+b+'"class="'+z+'croprect-block" style="display: none" data-mce-bogus="all">')}),d.each(w,function(b){a("#"+A,j).append('<div id="'+A+"-"+b.name+'" class="'+z+"croprect-handle "+z+"croprect-handle-"+b.name+'" style="display: none" data-mce-bogus="all">')}),x=d.map(w,e),p(g)}function o(b){var c;c=d.map(w,function(a){return"#"+A+"-"+a.name}).concat(d.map(y,function(a){return"#"+A+"-"+a})).join(","),b?a(c,j).show():a(c,j).hide()}function p(b){function c(b,c){c.h<0&&(c.h=0),c.w<0&&(c.w=0),a("#"+A+"-"+b,j).css({left:c.x,top:c.y,width:c.w,height:c.h})}d.each(w,function(c){a("#"+A+"-"+c.name,j).css({left:b.w*c.xMul+b.x,top:b.h*c.yMul+b.y})}),c("top",{x:h.x,y:h.y,w:h.w,h:b.y-h.y}),c("right",{x:b.x+b.w,y:b.y,w:h.w-b.x-b.w+h.x,h:b.h}),c("bottom",{x:h.x,y:b.y+b.h,w:h.w,h:h.h-b.y-b.h+h.y}),c("left",{x:h.x,y:b.y,w:b.x-h.x,h:b.h}),c("move",b)}function q(a){g=a,p(g)}function r(a){h=a,p(g)}function s(a){q(k(i,a))}function t(a){i=a,p(g)}function u(){d.each(x,function(a){a.destroy()}),x=[]}var v,w,x,y,z="mce-",A=z+"crid-"+f++;return w=[{name:"move",xMul:0,yMul:0,deltaX:1,deltaY:1,deltaW:0,deltaH:0},{name:"nw",xMul:0,yMul:0,deltaX:1,deltaY:1,deltaW:-1,deltaH:-1},{name:"ne",xMul:1,yMul:0,deltaX:0,deltaY:1,deltaW:1,deltaH:-1},{name:"sw",xMul:0,yMul:1,deltaX:1,deltaY:0,deltaW:-1,deltaH:1},{name:"se",xMul:1,yMul:1,deltaX:0,deltaY:0,deltaW:1,deltaH:1}],y=["top","right","bottom","left"],n(j),v=d.extend({toggleVisibility:o,setClampRect:t,setRect:q,getInnerRect:m,setInnerRect:s,setViewPortRect:r,destroy:u},e)}}),g("h",["o","p","q","5","3","r"],function(a,b,c,d,e,f){function g(a){return new e(function(b){function c(){a.removeEventListener("load",c),b(a)}a.complete?b(a):a.addEventListener("load",c)})}return a.extend({Defaults:{classes:"imagepanel"},selection:function(a){return arguments.length?(this.state.set("rect",a),this):this.state.get("rect")},imageSize:function(){var a=this.state.get("viewRect");return{w:a.w,h:a.h}},toggleCropRect:function(a){this.state.set("cropEnabled",a)},imageSrc:function(a){var b=this,d=new Image;d.src=a,g(d).then(function(){var a,e,f=b.state.get("viewRect");e=b.$el.find("img"),e[0]?e.replaceWith(d):b.getEl().appendChild(d),a={x:0,y:0,w:d.naturalWidth,h:d.naturalHeight},b.state.set("viewRect",a),b.state.set("rect",c.inflate(a,-20,-20)),f&&f.w==a.w&&f.h==a.h||b.zoomFit(),b.repaintImage(),b.fire("load")})},zoom:function(a){return arguments.length?(this.state.set("zoom",a),this):this.state.get("zoom")},postRender:function(){return this.imageSrc(this.settings.imageSrc),this._super()},zoomFit:function(){var a,b,c,d,e,f,g,h=this;g=10,a=h.$el.find("img"),b=h.getEl().clientWidth,c=h.getEl().clientHeight,d=a[0].naturalWidth,e=a[0].naturalHeight,f=Math.min((b-g)/d,(c-g)/e),f>=1&&(f=1),h.zoom(f)},repaintImage:function(){var a,b,c,d,e,f,g,h,i,j;j=this.getEl(),h=this.zoom(),i=this.state.get("rect"),g=this.$el.find("img"),e=j.offsetWidth,f=j.offsetHeight,c=g[0].naturalWidth*h,d=g[0].naturalHeight*h,a=Math.max(0,e/2-c/2),b=Math.max(0,f/2-d/2),g.css({left:a,top:b,width:c,height:d}),this.cropRect&&(this.cropRect.setRect({x:i.x*h+a,y:i.y*h+b,w:i.w*h,h:i.h*h}),this.cropRect.setClampRect({x:a,y:b,w:c,h:d}),this.cropRect.setViewPortRect({x:0,y:0,w:e,h:f}))},bindStates:function(){function a(a){b.cropRect=new f(a,b.state.get("viewRect"),b.state.get("viewRect"),b.getEl()),b.cropRect.on("updateRect",function(a){var c=a.rect,d=b.zoom();c={x:Math.round(c.x/d),y:Math.round(c.y/d),w:Math.round(c.w/d),h:Math.round(c.h/d)},b.state.set("rect",c)}),b.on("remove",b.cropRect.destroy)}var b=this;b.state.on("change:cropEnabled",function(a){b.cropRect.toggleVisibility(a.value),b.repaintImage()}),b.state.on("change:zoom",function(){b.repaintImage()}),b.state.on("change:rect",function(c){var d=c.value;b.cropRect||a(d),b.cropRect.setRect(d)})}})}),g("i",[],function(){return function(){function a(a){var b;return b=f.splice(++g),f.push(a),{state:a,removed:b}}function b(){return d()?f[--g]:void 0}function c(){return e()?f[++g]:void 0}function d(){return g>0}function e(){return-1!=g&&g<f.length-1}var f=[],g=-1;return{data:f,add:a,undo:b,redo:c,canUndo:d,canRedo:e}}}),g("9",["d","5","3","e","f","g","h","7","8","i"],function(a,b,c,d,e,f,g,h,i,j){function k(a){return{blob:a,url:URL.createObjectURL(a)}}function l(a){a&&URL.revokeObjectURL(a.url)}function m(a){b.each(a,l)}function n(c,i,n){function o(a){var b,c,d,e;b=L.find("#w")[0],c=L.find("#h")[0],d=parseInt(b.value(),10),e=parseInt(c.value(),10),L.find("#constrain")[0].checked()&&ga&&ha&&d&&e&&("w"==a.control.settings.name?(e=Math.round(d*ia),c.value(e)):(d=Math.round(e*ja),b.value(d))),ga=d,ha=e}function p(a){return Math.round(100*a)+"%"}function q(){L.find("#undo").disabled(!ka.canUndo()),L.find("#redo").disabled(!ka.canRedo()),L.statusbar.find("#save").disabled(!ka.canUndo())}function r(){L.find("#undo").disabled(!0),L.find("#redo").disabled(!0)}function s(a){a&&S.imageSrc(a.url)}function t(a){return function(){var c=b.grep(fa,function(b){return b.settings.name!=a});b.each(c,function(a){a.hide()}),a.show()}}function u(a){O=k(a),s(O)}function v(a){c=k(a),s(c),m(ka.add(c).removed),q()}function w(){var a=S.selection();h.crop(c.blob,a.x,a.y,a.w,a.h).then(function(a){v(a),z()})}function x(a){var b=[].slice.call(arguments,1);return function(){var d=O||c;a.apply(this,[d.blob].concat(b)).then(u)}}function y(a){var b=[].slice.call(arguments,1);return function(){a.apply(this,[c.blob].concat(b)).then(v)}}function z(){s(c),l(O),t(M)(),q()}function A(){O&&(v(O.blob),z())}function B(){var a=S.zoom();2>a&&(a+=.1),S.zoom(a)}function C(){var a=S.zoom();a>.1&&(a-=.1),S.zoom(a)}function D(){c=ka.undo(),s(c),q()}function E(){c=ka.redo(),s(c),q()}function F(){i(c.blob),L.close()}function G(a){return new e({layout:"flex",direction:"row",labelGap:5,border:"0 0 1 0",align:"center",pack:"center",padding:"0 10 0 10",spacing:5,flex:0,minHeight:60,defaults:{classes:"imagetool",type:"button"},items:a})}function H(a,b){return G([{text:"Back",onclick:z},{type:"spacer",flex:1},{text:"Apply",subtype:"primary",onclick:A}]).hide().on("show",function(){r(),b(c.blob).then(function(a){var b=k(a);s(b),l(O),O=b})})}function I(a,b,d,e,f){function g(a){b(c.blob,a).then(function(a){var b=k(a);s(b),l(O),O=b})}return G([{text:"Back",onclick:z},{type:"spacer",flex:1},{type:"slider",flex:1,ondragend:function(a){g(a.value)},minValue:e,maxValue:f,value:d,previewFilter:p},{type:"spacer",flex:1},{text:"Apply",subtype:"primary",onclick:A}]).hide().on("show",function(){this.find("slider").value(d),r()})}function J(a,b){function d(){var a,d,e;a=L.find("#r")[0].value(),d=L.find("#g")[0].value(),e=L.find("#b")[0].value(),b(c.blob,a,d,e).then(function(a){var b=k(a);s(b),l(O),O=b})}return G([{text:"Back",onclick:z},{type:"spacer",flex:1},{type:"slider",label:"R",name:"r",minValue:0,value:1,maxValue:2,ondragend:d,previewFilter:p},{type:"slider",label:"G",name:"g",minValue:0,value:1,maxValue:2,ondragend:d,previewFilter:p},{type:"slider",label:"B",name:"b",minValue:0,value:1,maxValue:2,ondragend:d,previewFilter:p},{type:"spacer",flex:1},{text:"Apply",subtype:"primary",onclick:A}]).hide().on("show",function(){L.find("#r,#g,#b").value(1),r()})}function K(a){a.control.value()===!0&&(ia=ha/ga,ja=ga/ha)}var L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z,$,_,aa,ba,ca,da,ea,fa,ga,ha,ia,ja,ka=new j;P=G([{text:"Back",onclick:z},{type:"spacer",flex:1},{text:"Apply",subtype:"primary",onclick:w}]).hide().on("show hide",function(a){S.toggleCropRect("show"==a.type)}).on("show",r),Q=G([{text:"Back",onclick:z},{type:"spacer",flex:1},{type:"textbox",name:"w",label:"Width",size:4,onkeyup:o},{type:"textbox",name:"h",label:"Height",size:4,onkeyup:o},{type:"checkbox",name:"constrain",text:"Constrain proportions",checked:!0,onchange:K},{type:"spacer",flex:1},{text:"Apply",subtype:"primary",onclick:"submit"}]).hide().on("submit",function(a){var b=parseInt(L.find("#w").value(),10),c=parseInt(L.find("#h").value(),10);a.preventDefault(),y(h.resize,b,c)(),z()}).on("show",r),R=G([{text:"Back",onclick:z},{type:"spacer",flex:1},{icon:"fliph",tooltip:"Flip horizontally",onclick:x(h.flip,"h")},{icon:"flipv",tooltip:"Flip vertically",onclick:x(h.flip,"v")},{icon:"rotateleft",tooltip:"Rotate counterclockwise",onclick:x(h.rotate,-90)},{icon:"rotateright",tooltip:"Rotate clockwise",onclick:x(h.rotate,90)},{type:"spacer",flex:1},{text:"Apply",subtype:"primary",onclick:A}]).hide().on("show",r),V=H("Invert",h.invert),ba=H("Sharpen",h.sharpen),ca=H("Emboss",h.emboss),W=I("Brightness",h.brightness,0,-1,1),X=I("Hue",h.hue,180,0,360),Y=I("Saturate",h.saturate,0,-1,1),Z=I("Contrast",h.contrast,0,-1,1),$=I("Grayscale",h.grayscale,0,0,1),_=I("Sepia",h.sepia,0,0,1),aa=J("Colorize",h.colorize),da=I("Gamma",h.gamma,0,-1,1),ea=I("Exposure",h.exposure,1,0,2),N=G([{text:"Back",onclick:z},{type:"spacer",flex:1},{text:"hue",icon:"hue",onclick:t(X)},{text:"saturate",icon:"saturate",onclick:t(Y)},{text:"sepia",icon:"sepia",onclick:t(_)},{text:"emboss",icon:"emboss",onclick:t(ca)},{text:"exposure",icon:"exposure",onclick:t(ea)},{type:"spacer",flex:1}]).hide(),M=G([{tooltip:"Crop",icon:"crop",onclick:t(P)},{tooltip:"Resize",icon:"resize2",onclick:t(Q)},{tooltip:"Orientation",icon:"orientation",onclick:t(R)},{tooltip:"Brightness",icon:"sun",onclick:t(W)},{tooltip:"Sharpen",icon:"sharpen",onclick:t(ba)},{tooltip:"Contrast",icon:"contrast",onclick:t(Z)},{tooltip:"Color levels",icon:"drop",onclick:t(aa)},{tooltip:"Gamma",icon:"gamma",onclick:t(da)},{tooltip:"Invert",icon:"invert",onclick:t(V)}]),S=new g({flex:1,imageSrc:c.url}),T=new f({layout:"flex",direction:"column",border:"0 1 0 0",padding:5,spacing:5,items:[{type:"button",icon:"undo",tooltip:"Undo",name:"undo",onclick:D},{type:"button",icon:"redo",tooltip:"Redo",name:"redo",onclick:E},{type:"button",icon:"zoomin",tooltip:"Zoom in",onclick:B},{type:"button",icon:"zoomout",tooltip:"Zoom out",onclick:C}]}),U=new f({type:"container",layout:"flex",direction:"row",align:"stretch",flex:1,items:[T,S]}),fa=[M,P,Q,R,N,V,W,X,Y,Z,$,_,aa,ba,ca,da,ea],L=d.create("window",{layout:"flex",direction:"column",align:"stretch",minWidth:Math.min(a.DOM.getViewPort().w,800),minHeight:Math.min(a.DOM.getViewPort().h,650),title:"Edit image",items:fa.concat([U]),buttons:[{text:"Save",name:"save",subtype:"primary",onclick:F},{text:"Cancel",onclick:"close"}]}),L.renderTo(document.body).reflow(),L.on("close",function(){n(),m(ka.data),ka=null,O=null}),ka.add(c),q(),S.on("load",function(){ga=S.imageSize().w,ha=S.imageSize().h,ia=ha/ga,ja=ga/ha,L.find("#w").value(ga),L.find("#h").value(ha)})}function o(a){return new c(function(b,c){n(k(a),b,c)})}return{edit:o}}),g("0",["1","2","3","4","5","6","7","8","9"],function(a,b,c,d,e,f,g,h,i){var j=function(a){function j(b){function c(a){return a.indexOf("px")==a.length-2}var d,e;return d=b.style.width,e=b.style.height,d||e?c(d)&&c(e)?{w:parseInt(d,10),h:parseInt(e,10)}:null:(d=a.$(b).attr("width"),e=a.$(b).attr("height"),d&&e?{w:parseInt(d,10),h:parseInt(e,10)}:null)}function k(b,c){var d,e;c&&(d=b.style.width,e=b.style.height,(d||e)&&a.$(b).css({width:c.w,height:c.h}).removeAttr("data-mce-style"),d=b.width,e=b.height,(d||e)&&a.$(b).attr({width:c.w,height:c.h}))}function l(a){return{w:a.naturalWidth,h:a.naturalHeight}}function m(){return a.selection.getNode()}function n(){return"imagetools"+H++}function o(b){var c=b.src;return 0===c.indexOf("data:")||0===c.indexOf("blob:")||new d(c).host===a.documentBaseURI.host}function p(b){return-1!==e.inArray(a.settings.imagetools_cors_hosts,new d(b.src).host)}function q(){return a.settings.api_key||a.settings.imagetools_api_key}function r(a){return new c(function(b){var c,d;c=new XMLHttpRequest,c.onload=function(){b(this.response)},c.open("GET",a,!0),d=q(),d&&(c.setRequestHeader("Content-Type","application/json;charset=UTF-8"),c.setRequestHeader("tiny-api-key",d)),c.responseType="blob",c.send()})}function s(b){var c=b.src;if(p(b))return r(b.src);if(!o(b)){if(c=a.settings.imagetools_proxy,c+=(-1===c.indexOf("?")?"?":"&")+"url="+encodeURIComponent(b.src),q())return r(c);b=new Image,b.src=c}return h.imageToBlob(b)}function t(){var b;return b=a.editorUpload.blobCache.getByUri(m().src),b?b:s(m()).then(function(b){return h.blobToBase64(b).then(function(c){var d=a.editorUpload.blobCache,e=d.create(n(),b,c);return d.add(e),e})})}function u(){F=f.setEditorTimeout(a,function(){a.editorUpload.uploadImagesAuto()},3e4)}function v(){clearTimeout(F)}function w(b,c){return h.blobToDataUri(b).then(function(e){var f,g,h,i,j;return j=m(),f=n(),h=a.editorUpload.blobCache,g=d.parseDataUri(e).data,i=h.create(f,b,g),h.add(i),a.undoManager.transact(function(){function b(){a.$(j).off("load",b),a.nodeChanged(),c?a.editorUpload.uploadImagesAuto():(v(),u())}a.$(j).on("load",b),a.$(j).attr({src:i.blobUri()}).removeAttr("data-mce-src")}),i})}function x(b){return function(){return a._scanForImages().then(t).then(b).then(w)}}function y(a){return function(){return x(function(b){var c=j(m());return c&&k(m(),{w:c.h,h:c.w}),g.rotate(b.blob(),a)})()}}function z(a){return function(){return x(function(b){return g.flip(b.blob(),a)})()}}function A(){var a=m(),b=l(a);a&&s(a).then(i.edit).then(function(d){return new c(function(c){h.blobToImage(d).then(function(e){var f=l(e);b.w==f.w&&b.h==f.h||j(a)&&k(a,f),URL.revokeObjectURL(e.src),c(d)})})}).then(function(a){w(a,!0)},function(){})}function B(){a.addButton("rotateleft",{title:"Rotate counterclockwise",onclick:y(-90)}),a.addButton("rotateright",{title:"Rotate clockwise",onclick:y(90)}),a.addButton("flipv",{title:"Flip vertically",onclick:z("v")}),a.addButton("fliph",{title:"Flip horizontally",onclick:z("h")}),a.addButton("editimage",{title:"Edit image",onclick:A}),a.addButton("imageoptions",{title:"Image options",icon:"options",cmd:"mceImage"})}function C(){a.on("NodeChange",function(b){G&&G.src!=b.element.src&&(v(),a.editorUpload.uploadImagesAuto(),G=void 0),D(b.element)&&(G=b.element)})}function D(b){var c=a.dom.is(b,"img:not([data-mce-object],[data-mce-placeholder])");return c&&(o(b)||p(b)||a.settings.imagetools_proxy)}function E(){var b=a.settings.imagetools_toolbar;b||(b="rotateleft rotateright | flipv fliph | crop editimage imageoptions"),a.addContextToolbar(D,b)}var F,G,H=0;b.fileApi&&(B(),E(),C(),a.addCommand("mceEditImage",A))};return a.add("imagetools",j),function(){}}),d("0")()}();
|
@@ -0,0 +1,16 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html>
|
3
|
+
<head>
|
4
|
+
<title>ImageTools Demo Page</title>
|
5
|
+
<script src="../../../../../tinymce.js"></script>
|
6
|
+
<script src="../../../config/bolt/bootstrap-demo.js"></script>
|
7
|
+
<script>
|
8
|
+
ephox.bolt.module.api.main('tinymce/imagetoolsplugin/Demo');
|
9
|
+
</script>
|
10
|
+
</head>
|
11
|
+
|
12
|
+
<body>
|
13
|
+
<h2>ImageTools Demo Page</h2>
|
14
|
+
<div id="ephox-ui"></div>
|
15
|
+
</body>
|
16
|
+
</html>
|
@@ -0,0 +1,92 @@
|
|
1
|
+
/**
|
2
|
+
* Demo.js
|
3
|
+
*
|
4
|
+
* Released under LGPL License.
|
5
|
+
* Copyright (c) 1999-2016 Ephox Corp. All rights reserved
|
6
|
+
*
|
7
|
+
* License: http://www.tinymce.com/license
|
8
|
+
* Contributing: http://www.tinymce.com/contributing
|
9
|
+
*/
|
10
|
+
|
11
|
+
/*eslint no-console:0 */
|
12
|
+
|
13
|
+
define("tinymce/imagetoolsplugin/Demo", [
|
14
|
+
"tinymce/imagetoolsplugin/Plugin",
|
15
|
+
"global!tinymce",
|
16
|
+
"global!tinymce.dom.DomQuery",
|
17
|
+
"global!console"
|
18
|
+
], function(Plugin, tinymce, $, console) {
|
19
|
+
return function() {
|
20
|
+
var imgSrc = '../../../../../../../tests/manual/img/dogleft.jpg';
|
21
|
+
|
22
|
+
$(
|
23
|
+
'<textarea class="tinymce">' +
|
24
|
+
'<p>' +
|
25
|
+
'<img src="' + imgSrc + '" width="160" height="100">' +
|
26
|
+
'<img src="' + imgSrc + '" style="width: 160px; height: 100px">' +
|
27
|
+
'<img src="' + imgSrc + '" style="width: 20%">' +
|
28
|
+
'<img src="' + imgSrc + '">' +
|
29
|
+
'<img src="http://moxiecode.cachefly.net/tinymce/v9/images/logo.png">' +
|
30
|
+
'</p>' +
|
31
|
+
'</textarea>'
|
32
|
+
).appendTo('#ephox-ui');
|
33
|
+
|
34
|
+
tinymce.init({
|
35
|
+
//imagetools_cors_hosts: ["moxiecode.cachefly.net"],
|
36
|
+
//imagetools_proxy: "proxy.php",
|
37
|
+
|
38
|
+
//images_upload_url: 'postAcceptor.php',
|
39
|
+
//images_upload_base_path: 'base/path',
|
40
|
+
//images_upload_credentials: true,
|
41
|
+
|
42
|
+
selector: "textarea.tinymce",
|
43
|
+
theme: "modern",
|
44
|
+
plugins: [
|
45
|
+
"imagetools"
|
46
|
+
],
|
47
|
+
add_unload_trigger: false,
|
48
|
+
image_caption: true,
|
49
|
+
height: 600,
|
50
|
+
toolbar1: "undo redo | styleselect | alignleft aligncenter alignright alignjustify | link image | media | emoticons",
|
51
|
+
images_upload_handler: function(data, success, failure, openNotification) {
|
52
|
+
var notification;
|
53
|
+
|
54
|
+
console.log('blob upload [started]', data.id());
|
55
|
+
|
56
|
+
notification = openNotification();
|
57
|
+
notification.progressBar.value(100);
|
58
|
+
|
59
|
+
setTimeout(function() {
|
60
|
+
console.log('blob upload [ended]', data.id());
|
61
|
+
success(data.id() + '.png');
|
62
|
+
notification.close();
|
63
|
+
}, 1000);
|
64
|
+
}
|
65
|
+
});
|
66
|
+
|
67
|
+
function send() {
|
68
|
+
tinymce.activeEditor.uploadImages(function() {
|
69
|
+
console.log('saving:', tinymce.activeEditor.getContent());
|
70
|
+
});
|
71
|
+
}
|
72
|
+
|
73
|
+
function upload() {
|
74
|
+
console.log('upload [started]');
|
75
|
+
|
76
|
+
tinymce.activeEditor.uploadImages(function(success) {
|
77
|
+
console.log('upload [ended]', success);
|
78
|
+
});
|
79
|
+
}
|
80
|
+
|
81
|
+
function dump() {
|
82
|
+
var content = tinymce.activeEditor.getContent();
|
83
|
+
|
84
|
+
$('#view').html(content);
|
85
|
+
console.log(content);
|
86
|
+
}
|
87
|
+
|
88
|
+
$('<button>send()</button>').appendTo('#ephox-ui').on('click', send);
|
89
|
+
$('<button>upload()</button>').appendTo('#ephox-ui').on('click', upload);
|
90
|
+
$('<button>dump()</button>').appendTo('#ephox-ui').on('click', dump);
|
91
|
+
};
|
92
|
+
});
|
@@ -0,0 +1,214 @@
|
|
1
|
+
/**
|
2
|
+
* CropRect.js
|
3
|
+
*
|
4
|
+
* Released under LGPL License.
|
5
|
+
* Copyright (c) 1999-2016 Ephox Corp. All rights reserved
|
6
|
+
*
|
7
|
+
* License: http://www.tinymce.com/license
|
8
|
+
* Contributing: http://www.tinymce.com/contributing
|
9
|
+
*/
|
10
|
+
|
11
|
+
/**
|
12
|
+
* ...
|
13
|
+
*/
|
14
|
+
define("tinymce/imagetoolsplugin/CropRect", [
|
15
|
+
"global!tinymce.dom.DomQuery",
|
16
|
+
"global!tinymce.ui.DragHelper",
|
17
|
+
"global!tinymce.geom.Rect",
|
18
|
+
"global!tinymce.util.Tools",
|
19
|
+
"global!tinymce.util.Observable"
|
20
|
+
], function($, DragHelper, Rect, Tools, Observable) {
|
21
|
+
var count = 0;
|
22
|
+
|
23
|
+
return function(currentRect, viewPortRect, clampRect, containerElm) {
|
24
|
+
var instance, handles, dragHelpers, blockers, prefix = 'mce-', id = prefix + 'crid-' + (count++);
|
25
|
+
|
26
|
+
handles = [
|
27
|
+
{name: 'move', xMul: 0, yMul: 0, deltaX: 1, deltaY: 1, deltaW: 0, deltaH: 0},
|
28
|
+
{name: 'nw', xMul: 0, yMul: 0, deltaX: 1, deltaY: 1, deltaW: -1, deltaH: -1},
|
29
|
+
{name: 'ne', xMul: 1, yMul: 0, deltaX: 0, deltaY: 1, deltaW: 1, deltaH: -1},
|
30
|
+
{name: 'sw', xMul: 0, yMul: 1, deltaX: 1, deltaY: 0, deltaW: -1, deltaH: 1},
|
31
|
+
{name: 'se', xMul: 1, yMul: 1, deltaX: 0, deltaY: 0, deltaW: 1, deltaH: 1}
|
32
|
+
];
|
33
|
+
|
34
|
+
blockers = ["top", "right", "bottom", "left"];
|
35
|
+
|
36
|
+
function getAbsoluteRect(outerRect, relativeRect) {
|
37
|
+
return {
|
38
|
+
x: relativeRect.x + outerRect.x,
|
39
|
+
y: relativeRect.y + outerRect.y,
|
40
|
+
w: relativeRect.w,
|
41
|
+
h: relativeRect.h
|
42
|
+
};
|
43
|
+
}
|
44
|
+
|
45
|
+
function getRelativeRect(outerRect, innerRect) {
|
46
|
+
return {
|
47
|
+
x: innerRect.x - outerRect.x,
|
48
|
+
y: innerRect.y - outerRect.y,
|
49
|
+
w: innerRect.w,
|
50
|
+
h: innerRect.h
|
51
|
+
};
|
52
|
+
}
|
53
|
+
|
54
|
+
function getInnerRect() {
|
55
|
+
return getRelativeRect(clampRect, currentRect);
|
56
|
+
}
|
57
|
+
|
58
|
+
function render() {
|
59
|
+
function createDragHelper(handle) {
|
60
|
+
var startRect;
|
61
|
+
|
62
|
+
return new DragHelper(id, {
|
63
|
+
document: containerElm.ownerDocument,
|
64
|
+
handle: id + '-' + handle.name,
|
65
|
+
|
66
|
+
start: function() {
|
67
|
+
startRect = currentRect;
|
68
|
+
},
|
69
|
+
|
70
|
+
drag: function(e) {
|
71
|
+
var x, y, w, h, rect;
|
72
|
+
|
73
|
+
x = startRect.x;
|
74
|
+
y = startRect.y;
|
75
|
+
w = startRect.w;
|
76
|
+
h = startRect.h;
|
77
|
+
|
78
|
+
x += e.deltaX * handle.deltaX;
|
79
|
+
y += e.deltaY * handle.deltaY;
|
80
|
+
w += e.deltaX * handle.deltaW;
|
81
|
+
h += e.deltaY * handle.deltaH;
|
82
|
+
|
83
|
+
if (w < 20) {
|
84
|
+
w = 20;
|
85
|
+
}
|
86
|
+
|
87
|
+
if (h < 20) {
|
88
|
+
h = 20;
|
89
|
+
}
|
90
|
+
|
91
|
+
rect = currentRect = Rect.clamp({x: x, y: y, w: w, h: h}, clampRect, handle.name == 'move');
|
92
|
+
rect = getRelativeRect(clampRect, rect);
|
93
|
+
|
94
|
+
instance.fire('updateRect', {rect: rect});
|
95
|
+
setInnerRect(rect);
|
96
|
+
}
|
97
|
+
});
|
98
|
+
}
|
99
|
+
|
100
|
+
$('<div id="' + id + '" class="' + prefix + 'croprect-container" data-mce-bogus="all">').appendTo(containerElm);
|
101
|
+
|
102
|
+
Tools.each(blockers, function(blocker) {
|
103
|
+
$('#' + id, containerElm).append(
|
104
|
+
'<div id="' + id + '-' + blocker + '"class="' + prefix + 'croprect-block" style="display: none" data-mce-bogus="all">'
|
105
|
+
);
|
106
|
+
});
|
107
|
+
|
108
|
+
Tools.each(handles, function(handle) {
|
109
|
+
$('#' + id, containerElm).append(
|
110
|
+
'<div id="' + id + '-' + handle.name + '" class="' + prefix +
|
111
|
+
'croprect-handle ' + prefix + 'croprect-handle-' + handle.name + '" style="display: none" data-mce-bogus="all">'
|
112
|
+
);
|
113
|
+
});
|
114
|
+
|
115
|
+
dragHelpers = Tools.map(handles, createDragHelper);
|
116
|
+
|
117
|
+
repaint(currentRect);
|
118
|
+
}
|
119
|
+
|
120
|
+
function toggleVisibility(state) {
|
121
|
+
var selectors;
|
122
|
+
|
123
|
+
selectors = Tools.map(handles, function(handle) {
|
124
|
+
return '#' + id + '-' + handle.name;
|
125
|
+
}).concat(Tools.map(blockers, function(blocker) {
|
126
|
+
return '#' + id + '-' + blocker;
|
127
|
+
})).join(',');
|
128
|
+
|
129
|
+
if (state) {
|
130
|
+
$(selectors, containerElm).show();
|
131
|
+
} else {
|
132
|
+
$(selectors, containerElm).hide();
|
133
|
+
}
|
134
|
+
}
|
135
|
+
|
136
|
+
function repaint(rect) {
|
137
|
+
function updateElementRect(name, rect) {
|
138
|
+
if (rect.h < 0) {
|
139
|
+
rect.h = 0;
|
140
|
+
}
|
141
|
+
|
142
|
+
if (rect.w < 0) {
|
143
|
+
rect.w = 0;
|
144
|
+
}
|
145
|
+
|
146
|
+
$('#' + id + '-' + name, containerElm).css({
|
147
|
+
left: rect.x,
|
148
|
+
top: rect.y,
|
149
|
+
width: rect.w,
|
150
|
+
height: rect.h
|
151
|
+
});
|
152
|
+
}
|
153
|
+
|
154
|
+
Tools.each(handles, function(handle) {
|
155
|
+
$('#' + id + '-' + handle.name, containerElm).css({
|
156
|
+
left: rect.w * handle.xMul + rect.x,
|
157
|
+
top: rect.h * handle.yMul + rect.y
|
158
|
+
});
|
159
|
+
});
|
160
|
+
|
161
|
+
updateElementRect('top', {x: viewPortRect.x, y: viewPortRect.y, w: viewPortRect.w, h: rect.y - viewPortRect.y});
|
162
|
+
updateElementRect('right', {x: rect.x + rect.w, y: rect.y, w: viewPortRect.w - rect.x - rect.w + viewPortRect.x, h: rect.h});
|
163
|
+
updateElementRect('bottom', {
|
164
|
+
x: viewPortRect.x,
|
165
|
+
y: rect.y + rect.h,
|
166
|
+
w: viewPortRect.w,
|
167
|
+
h: viewPortRect.h - rect.y - rect.h + viewPortRect.y
|
168
|
+
});
|
169
|
+
updateElementRect('left', {x: viewPortRect.x, y: rect.y, w: rect.x - viewPortRect.x, h: rect.h});
|
170
|
+
updateElementRect('move', rect);
|
171
|
+
}
|
172
|
+
|
173
|
+
function setRect(rect) {
|
174
|
+
currentRect = rect;
|
175
|
+
repaint(currentRect);
|
176
|
+
}
|
177
|
+
|
178
|
+
function setViewPortRect(rect) {
|
179
|
+
viewPortRect = rect;
|
180
|
+
repaint(currentRect);
|
181
|
+
}
|
182
|
+
|
183
|
+
function setInnerRect(rect) {
|
184
|
+
setRect(getAbsoluteRect(clampRect, rect));
|
185
|
+
}
|
186
|
+
|
187
|
+
function setClampRect(rect) {
|
188
|
+
clampRect = rect;
|
189
|
+
repaint(currentRect);
|
190
|
+
}
|
191
|
+
|
192
|
+
function destroy() {
|
193
|
+
Tools.each(dragHelpers, function(helper) {
|
194
|
+
helper.destroy();
|
195
|
+
});
|
196
|
+
|
197
|
+
dragHelpers = [];
|
198
|
+
}
|
199
|
+
|
200
|
+
render(containerElm);
|
201
|
+
|
202
|
+
instance = Tools.extend({
|
203
|
+
toggleVisibility: toggleVisibility,
|
204
|
+
setClampRect: setClampRect,
|
205
|
+
setRect: setRect,
|
206
|
+
getInnerRect: getInnerRect,
|
207
|
+
setInnerRect: setInnerRect,
|
208
|
+
setViewPortRect: setViewPortRect,
|
209
|
+
destroy: destroy
|
210
|
+
}, Observable);
|
211
|
+
|
212
|
+
return instance;
|
213
|
+
};
|
214
|
+
});
|
@@ -0,0 +1,485 @@
|
|
1
|
+
/**
|
2
|
+
* Dialog.js
|
3
|
+
*
|
4
|
+
* Released under LGPL License.
|
5
|
+
* Copyright (c) 1999-2016 Ephox Corp. All rights reserved
|
6
|
+
*
|
7
|
+
* License: http://www.tinymce.com/license
|
8
|
+
* Contributing: http://www.tinymce.com/contributing
|
9
|
+
*/
|
10
|
+
|
11
|
+
/**
|
12
|
+
* ...
|
13
|
+
*/
|
14
|
+
define("tinymce/imagetoolsplugin/Dialog", [
|
15
|
+
"global!tinymce.dom.DOMUtils",
|
16
|
+
"global!tinymce.util.Tools",
|
17
|
+
"global!tinymce.util.Promise",
|
18
|
+
"global!tinymce.ui.Factory",
|
19
|
+
"global!tinymce.ui.Form",
|
20
|
+
"global!tinymce.ui.Container",
|
21
|
+
"tinymce/imagetoolsplugin/ImagePanel",
|
22
|
+
"ephox/imagetools/api/ImageTransformations",
|
23
|
+
"ephox/imagetools/api/BlobConversions",
|
24
|
+
"tinymce/imagetoolsplugin/UndoStack"
|
25
|
+
], function(DOMUtils, Tools, Promise, Factory, Form, Container, ImagePanel, ImageTransformations, BlobConversions, UndoStack) {
|
26
|
+
function createState(blob) {
|
27
|
+
return {
|
28
|
+
blob: blob,
|
29
|
+
url: URL.createObjectURL(blob)
|
30
|
+
};
|
31
|
+
}
|
32
|
+
|
33
|
+
function destroyState(state) {
|
34
|
+
if (state) {
|
35
|
+
URL.revokeObjectURL(state.url);
|
36
|
+
}
|
37
|
+
}
|
38
|
+
|
39
|
+
function destroyStates(states) {
|
40
|
+
Tools.each(states, destroyState);
|
41
|
+
}
|
42
|
+
|
43
|
+
function open(currentState, resolve, reject) {
|
44
|
+
var win, undoStack = new UndoStack(), mainPanel, filtersPanel, tempState,
|
45
|
+
cropPanel, resizePanel, flipRotatePanel, imagePanel, sidePanel, mainViewContainer,
|
46
|
+
invertPanel, brightnessPanel, huePanel, saturatePanel, contrastPanel, grayscalePanel,
|
47
|
+
sepiaPanel, colorizePanel, sharpenPanel, embossPanel, gammaPanel, exposurePanel, panels,
|
48
|
+
width, height, ratioW, ratioH;
|
49
|
+
|
50
|
+
function recalcSize(e) {
|
51
|
+
var widthCtrl, heightCtrl, newWidth, newHeight;
|
52
|
+
|
53
|
+
widthCtrl = win.find('#w')[0];
|
54
|
+
heightCtrl = win.find('#h')[0];
|
55
|
+
|
56
|
+
newWidth = parseInt(widthCtrl.value(), 10);
|
57
|
+
newHeight = parseInt(heightCtrl.value(), 10);
|
58
|
+
|
59
|
+
if (win.find('#constrain')[0].checked() && width && height && newWidth && newHeight) {
|
60
|
+
if (e.control.settings.name == 'w') {
|
61
|
+
newHeight = Math.round(newWidth * ratioW);
|
62
|
+
heightCtrl.value(newHeight);
|
63
|
+
} else {
|
64
|
+
newWidth = Math.round(newHeight * ratioH);
|
65
|
+
widthCtrl.value(newWidth);
|
66
|
+
}
|
67
|
+
}
|
68
|
+
|
69
|
+
width = newWidth;
|
70
|
+
height = newHeight;
|
71
|
+
}
|
72
|
+
|
73
|
+
function floatToPercent(value) {
|
74
|
+
return Math.round(value * 100) + '%';
|
75
|
+
}
|
76
|
+
|
77
|
+
function updateButtonUndoStates() {
|
78
|
+
win.find('#undo').disabled(!undoStack.canUndo());
|
79
|
+
win.find('#redo').disabled(!undoStack.canRedo());
|
80
|
+
win.statusbar.find('#save').disabled(!undoStack.canUndo());
|
81
|
+
}
|
82
|
+
|
83
|
+
function disableUndoRedo() {
|
84
|
+
win.find('#undo').disabled(true);
|
85
|
+
win.find('#redo').disabled(true);
|
86
|
+
}
|
87
|
+
|
88
|
+
function displayState(state) {
|
89
|
+
if (state) {
|
90
|
+
imagePanel.imageSrc(state.url);
|
91
|
+
}
|
92
|
+
}
|
93
|
+
|
94
|
+
function switchPanel(targetPanel) {
|
95
|
+
return function() {
|
96
|
+
var hidePanels = Tools.grep(panels, function(panel) {
|
97
|
+
return panel.settings.name != targetPanel;
|
98
|
+
});
|
99
|
+
|
100
|
+
Tools.each(hidePanels, function(panel) {
|
101
|
+
panel.hide();
|
102
|
+
});
|
103
|
+
|
104
|
+
targetPanel.show();
|
105
|
+
};
|
106
|
+
}
|
107
|
+
|
108
|
+
function addTempState(blob) {
|
109
|
+
tempState = createState(blob);
|
110
|
+
displayState(tempState);
|
111
|
+
}
|
112
|
+
|
113
|
+
function addBlobState(blob) {
|
114
|
+
currentState = createState(blob);
|
115
|
+
displayState(currentState);
|
116
|
+
destroyStates(undoStack.add(currentState).removed);
|
117
|
+
updateButtonUndoStates();
|
118
|
+
}
|
119
|
+
|
120
|
+
function crop() {
|
121
|
+
var rect = imagePanel.selection();
|
122
|
+
|
123
|
+
ImageTransformations.crop(currentState.blob, rect.x, rect.y, rect.w, rect.h).then(function(blob) {
|
124
|
+
addBlobState(blob);
|
125
|
+
cancel();
|
126
|
+
});
|
127
|
+
}
|
128
|
+
|
129
|
+
function tempAction(fn) {
|
130
|
+
var args = [].slice.call(arguments, 1);
|
131
|
+
|
132
|
+
return function() {
|
133
|
+
var state = tempState || currentState;
|
134
|
+
|
135
|
+
fn.apply(this, [state.blob].concat(args)).then(addTempState);
|
136
|
+
};
|
137
|
+
}
|
138
|
+
|
139
|
+
function action(fn) {
|
140
|
+
var args = [].slice.call(arguments, 1);
|
141
|
+
|
142
|
+
return function() {
|
143
|
+
fn.apply(this, [currentState.blob].concat(args)).then(addBlobState);
|
144
|
+
};
|
145
|
+
}
|
146
|
+
|
147
|
+
function cancel() {
|
148
|
+
displayState(currentState);
|
149
|
+
destroyState(tempState);
|
150
|
+
switchPanel(mainPanel)();
|
151
|
+
updateButtonUndoStates();
|
152
|
+
}
|
153
|
+
|
154
|
+
function applyTempState() {
|
155
|
+
if (tempState) {
|
156
|
+
addBlobState(tempState.blob);
|
157
|
+
cancel();
|
158
|
+
}
|
159
|
+
}
|
160
|
+
|
161
|
+
function zoomIn() {
|
162
|
+
var zoom = imagePanel.zoom();
|
163
|
+
|
164
|
+
if (zoom < 2) {
|
165
|
+
zoom += 0.1;
|
166
|
+
}
|
167
|
+
|
168
|
+
imagePanel.zoom(zoom);
|
169
|
+
}
|
170
|
+
|
171
|
+
function zoomOut() {
|
172
|
+
var zoom = imagePanel.zoom();
|
173
|
+
|
174
|
+
if (zoom > 0.1) {
|
175
|
+
zoom -= 0.1;
|
176
|
+
}
|
177
|
+
|
178
|
+
imagePanel.zoom(zoom);
|
179
|
+
}
|
180
|
+
|
181
|
+
function undo() {
|
182
|
+
currentState = undoStack.undo();
|
183
|
+
displayState(currentState);
|
184
|
+
updateButtonUndoStates();
|
185
|
+
}
|
186
|
+
|
187
|
+
function redo() {
|
188
|
+
currentState = undoStack.redo();
|
189
|
+
displayState(currentState);
|
190
|
+
updateButtonUndoStates();
|
191
|
+
}
|
192
|
+
|
193
|
+
function save() {
|
194
|
+
resolve(currentState.blob);
|
195
|
+
win.close();
|
196
|
+
}
|
197
|
+
|
198
|
+
function createPanel(items) {
|
199
|
+
return new Form({
|
200
|
+
layout: 'flex',
|
201
|
+
direction: 'row',
|
202
|
+
labelGap: 5,
|
203
|
+
border: '0 0 1 0',
|
204
|
+
align: 'center',
|
205
|
+
pack: 'center',
|
206
|
+
padding: '0 10 0 10',
|
207
|
+
spacing: 5,
|
208
|
+
flex: 0,
|
209
|
+
minHeight: 60,
|
210
|
+
defaults: {
|
211
|
+
classes: 'imagetool',
|
212
|
+
type: 'button'
|
213
|
+
},
|
214
|
+
items: items
|
215
|
+
});
|
216
|
+
}
|
217
|
+
|
218
|
+
function createFilterPanel(title, filter) {
|
219
|
+
return createPanel([
|
220
|
+
{text: 'Back', onclick: cancel},
|
221
|
+
{type: 'spacer', flex: 1},
|
222
|
+
{text: 'Apply', subtype: 'primary', onclick: applyTempState}
|
223
|
+
]).hide().on('show', function() {
|
224
|
+
disableUndoRedo();
|
225
|
+
|
226
|
+
filter(currentState.blob).then(function(blob) {
|
227
|
+
var newTempState = createState(blob);
|
228
|
+
|
229
|
+
displayState(newTempState);
|
230
|
+
destroyState(tempState);
|
231
|
+
tempState = newTempState;
|
232
|
+
});
|
233
|
+
});
|
234
|
+
}
|
235
|
+
|
236
|
+
function createVariableFilterPanel(title, filter, value, min, max) {
|
237
|
+
function update(value) {
|
238
|
+
filter(currentState.blob, value).then(function(blob) {
|
239
|
+
var newTempState = createState(blob);
|
240
|
+
displayState(newTempState);
|
241
|
+
destroyState(tempState);
|
242
|
+
tempState = newTempState;
|
243
|
+
});
|
244
|
+
}
|
245
|
+
|
246
|
+
return createPanel([
|
247
|
+
{text: 'Back', onclick: cancel},
|
248
|
+
{type: 'spacer', flex: 1},
|
249
|
+
{
|
250
|
+
type: 'slider',
|
251
|
+
flex: 1,
|
252
|
+
ondragend: function(e) {
|
253
|
+
update(e.value);
|
254
|
+
},
|
255
|
+
minValue: min,
|
256
|
+
maxValue: max,
|
257
|
+
value: value,
|
258
|
+
previewFilter: floatToPercent
|
259
|
+
},
|
260
|
+
{type: 'spacer', flex: 1},
|
261
|
+
{text: 'Apply', subtype: 'primary', onclick: applyTempState}
|
262
|
+
]).hide().on('show', function() {
|
263
|
+
this.find('slider').value(value);
|
264
|
+
disableUndoRedo();
|
265
|
+
});
|
266
|
+
}
|
267
|
+
|
268
|
+
function createRgbFilterPanel(title, filter) {
|
269
|
+
function update() {
|
270
|
+
var r, g, b;
|
271
|
+
|
272
|
+
r = win.find('#r')[0].value();
|
273
|
+
g = win.find('#g')[0].value();
|
274
|
+
b = win.find('#b')[0].value();
|
275
|
+
|
276
|
+
filter(currentState.blob, r, g, b).then(function(blob) {
|
277
|
+
var newTempState = createState(blob);
|
278
|
+
displayState(newTempState);
|
279
|
+
destroyState(tempState);
|
280
|
+
tempState = newTempState;
|
281
|
+
});
|
282
|
+
}
|
283
|
+
|
284
|
+
return createPanel([
|
285
|
+
{text: 'Back', onclick: cancel},
|
286
|
+
{type: 'spacer', flex: 1},
|
287
|
+
{
|
288
|
+
type: 'slider', label: 'R', name: 'r', minValue: 0,
|
289
|
+
value: 1, maxValue: 2, ondragend: update, previewFilter: floatToPercent
|
290
|
+
},
|
291
|
+
{
|
292
|
+
type: 'slider', label: 'G', name: 'g', minValue: 0,
|
293
|
+
value: 1, maxValue: 2, ondragend: update, previewFilter: floatToPercent
|
294
|
+
},
|
295
|
+
{
|
296
|
+
type: 'slider', label: 'B', name: 'b', minValue: 0,
|
297
|
+
value: 1, maxValue: 2, ondragend: update, previewFilter: floatToPercent
|
298
|
+
},
|
299
|
+
{type: 'spacer', flex: 1},
|
300
|
+
{text: 'Apply', subtype: 'primary', onclick: applyTempState}
|
301
|
+
]).hide().on('show', function() {
|
302
|
+
win.find('#r,#g,#b').value(1);
|
303
|
+
disableUndoRedo();
|
304
|
+
});
|
305
|
+
}
|
306
|
+
|
307
|
+
cropPanel = createPanel([
|
308
|
+
{text: 'Back', onclick: cancel},
|
309
|
+
{type: 'spacer', flex: 1},
|
310
|
+
{text: 'Apply', subtype: 'primary', onclick: crop}
|
311
|
+
]).hide().on('show hide', function(e) {
|
312
|
+
imagePanel.toggleCropRect(e.type == 'show');
|
313
|
+
}).on('show', disableUndoRedo);
|
314
|
+
|
315
|
+
function toggleConstrain(e) {
|
316
|
+
if (e.control.value() === true) {
|
317
|
+
ratioW = height / width;
|
318
|
+
ratioH = width / height;
|
319
|
+
}
|
320
|
+
}
|
321
|
+
|
322
|
+
resizePanel = createPanel([
|
323
|
+
{text: 'Back', onclick: cancel},
|
324
|
+
{type: 'spacer', flex: 1},
|
325
|
+
{type: 'textbox', name: 'w', label: 'Width', size: 4, onkeyup: recalcSize},
|
326
|
+
{type: 'textbox', name: 'h', label: 'Height', size: 4, onkeyup: recalcSize},
|
327
|
+
{type: 'checkbox', name: 'constrain', text: 'Constrain proportions', checked: true, onchange: toggleConstrain},
|
328
|
+
{type: 'spacer', flex: 1},
|
329
|
+
{text: 'Apply', subtype: 'primary', onclick: 'submit'}
|
330
|
+
]).hide().on('submit', function(e) {
|
331
|
+
var width = parseInt(win.find('#w').value(), 10),
|
332
|
+
height = parseInt(win.find('#h').value(), 10);
|
333
|
+
|
334
|
+
e.preventDefault();
|
335
|
+
|
336
|
+
action(ImageTransformations.resize, width, height)();
|
337
|
+
cancel();
|
338
|
+
}).on('show', disableUndoRedo);
|
339
|
+
|
340
|
+
flipRotatePanel = createPanel([
|
341
|
+
{text: 'Back', onclick: cancel},
|
342
|
+
{type: 'spacer', flex: 1},
|
343
|
+
{icon: 'fliph', tooltip: 'Flip horizontally', onclick: tempAction(ImageTransformations.flip, 'h')},
|
344
|
+
{icon: 'flipv', tooltip: 'Flip vertically', onclick: tempAction(ImageTransformations.flip, 'v')},
|
345
|
+
{icon: 'rotateleft', tooltip: 'Rotate counterclockwise', onclick: tempAction(ImageTransformations.rotate, -90)},
|
346
|
+
{icon: 'rotateright', tooltip: 'Rotate clockwise', onclick: tempAction(ImageTransformations.rotate, 90)},
|
347
|
+
{type: 'spacer', flex: 1},
|
348
|
+
{text: 'Apply', subtype: 'primary', onclick: applyTempState}
|
349
|
+
]).hide().on('show', disableUndoRedo);
|
350
|
+
|
351
|
+
invertPanel = createFilterPanel("Invert", ImageTransformations.invert);
|
352
|
+
sharpenPanel = createFilterPanel("Sharpen", ImageTransformations.sharpen);
|
353
|
+
embossPanel = createFilterPanel("Emboss", ImageTransformations.emboss);
|
354
|
+
|
355
|
+
brightnessPanel = createVariableFilterPanel("Brightness", ImageTransformations.brightness, 0, -1, 1);
|
356
|
+
huePanel = createVariableFilterPanel("Hue", ImageTransformations.hue, 180, 0, 360);
|
357
|
+
saturatePanel = createVariableFilterPanel("Saturate", ImageTransformations.saturate, 0, -1, 1);
|
358
|
+
contrastPanel = createVariableFilterPanel("Contrast", ImageTransformations.contrast, 0, -1, 1);
|
359
|
+
grayscalePanel = createVariableFilterPanel("Grayscale", ImageTransformations.grayscale, 0, 0, 1);
|
360
|
+
sepiaPanel = createVariableFilterPanel("Sepia", ImageTransformations.sepia, 0, 0, 1);
|
361
|
+
colorizePanel = createRgbFilterPanel("Colorize", ImageTransformations.colorize);
|
362
|
+
gammaPanel = createVariableFilterPanel("Gamma", ImageTransformations.gamma, 0, -1, 1);
|
363
|
+
exposurePanel = createVariableFilterPanel("Exposure", ImageTransformations.exposure, 1, 0, 2);
|
364
|
+
|
365
|
+
filtersPanel = createPanel([
|
366
|
+
{text: 'Back', onclick: cancel},
|
367
|
+
{type: 'spacer', flex: 1},
|
368
|
+
{text: 'hue', icon: 'hue', onclick: switchPanel(huePanel)},
|
369
|
+
{text: 'saturate', icon: 'saturate', onclick: switchPanel(saturatePanel)},
|
370
|
+
{text: 'sepia', icon: 'sepia', onclick: switchPanel(sepiaPanel)},
|
371
|
+
{text: 'emboss', icon: 'emboss', onclick: switchPanel(embossPanel)},
|
372
|
+
{text: 'exposure', icon: 'exposure', onclick: switchPanel(exposurePanel)},
|
373
|
+
{type: 'spacer', flex: 1}
|
374
|
+
]).hide();
|
375
|
+
|
376
|
+
mainPanel = createPanel([
|
377
|
+
{tooltip: 'Crop', icon: 'crop', onclick: switchPanel(cropPanel)},
|
378
|
+
{tooltip: 'Resize', icon: 'resize2', onclick: switchPanel(resizePanel)},
|
379
|
+
{tooltip: 'Orientation', icon: 'orientation', onclick: switchPanel(flipRotatePanel)},
|
380
|
+
{tooltip: 'Brightness', icon: 'sun', onclick: switchPanel(brightnessPanel)},
|
381
|
+
{tooltip: 'Sharpen', icon: 'sharpen', onclick: switchPanel(sharpenPanel)},
|
382
|
+
{tooltip: 'Contrast', icon: 'contrast', onclick: switchPanel(contrastPanel)},
|
383
|
+
{tooltip: 'Color levels', icon: 'drop', onclick: switchPanel(colorizePanel)},
|
384
|
+
{tooltip: 'Gamma', icon: 'gamma', onclick: switchPanel(gammaPanel)},
|
385
|
+
{tooltip: 'Invert', icon: 'invert', onclick: switchPanel(invertPanel)}
|
386
|
+
//{text: 'More', onclick: switchPanel(filtersPanel)}
|
387
|
+
]);
|
388
|
+
|
389
|
+
imagePanel = new ImagePanel({
|
390
|
+
flex: 1,
|
391
|
+
imageSrc: currentState.url
|
392
|
+
});
|
393
|
+
|
394
|
+
sidePanel = new Container({
|
395
|
+
layout: 'flex',
|
396
|
+
direction: 'column',
|
397
|
+
border: '0 1 0 0',
|
398
|
+
padding: 5,
|
399
|
+
spacing: 5,
|
400
|
+
items: [
|
401
|
+
{type: 'button', icon: 'undo', tooltip: 'Undo', name: 'undo', onclick: undo},
|
402
|
+
{type: 'button', icon: 'redo', tooltip: 'Redo', name: 'redo', onclick: redo},
|
403
|
+
{type: 'button', icon: 'zoomin', tooltip: 'Zoom in', onclick: zoomIn},
|
404
|
+
{type: 'button', icon: 'zoomout', tooltip: 'Zoom out', onclick: zoomOut}
|
405
|
+
]
|
406
|
+
});
|
407
|
+
|
408
|
+
mainViewContainer = new Container({
|
409
|
+
type: 'container',
|
410
|
+
layout: 'flex',
|
411
|
+
direction: 'row',
|
412
|
+
align: 'stretch',
|
413
|
+
flex: 1,
|
414
|
+
items: [sidePanel, imagePanel]
|
415
|
+
});
|
416
|
+
|
417
|
+
panels = [
|
418
|
+
mainPanel,
|
419
|
+
cropPanel,
|
420
|
+
resizePanel,
|
421
|
+
flipRotatePanel,
|
422
|
+
filtersPanel,
|
423
|
+
invertPanel,
|
424
|
+
brightnessPanel,
|
425
|
+
huePanel,
|
426
|
+
saturatePanel,
|
427
|
+
contrastPanel,
|
428
|
+
grayscalePanel,
|
429
|
+
sepiaPanel,
|
430
|
+
colorizePanel,
|
431
|
+
sharpenPanel,
|
432
|
+
embossPanel,
|
433
|
+
gammaPanel,
|
434
|
+
exposurePanel
|
435
|
+
];
|
436
|
+
|
437
|
+
win = Factory.create('window', {
|
438
|
+
layout: 'flex',
|
439
|
+
direction: 'column',
|
440
|
+
align: 'stretch',
|
441
|
+
minWidth: Math.min(DOMUtils.DOM.getViewPort().w, 800),
|
442
|
+
minHeight: Math.min(DOMUtils.DOM.getViewPort().h, 650),
|
443
|
+
title: 'Edit image',
|
444
|
+
items: panels.concat([mainViewContainer]),
|
445
|
+
buttons: [
|
446
|
+
{text: 'Save', name: 'save', subtype: 'primary', onclick: save},
|
447
|
+
{text: 'Cancel', onclick: 'close'}
|
448
|
+
]
|
449
|
+
});
|
450
|
+
|
451
|
+
win.renderTo(document.body).reflow();
|
452
|
+
|
453
|
+
win.on('close', function() {
|
454
|
+
reject();
|
455
|
+
destroyStates(undoStack.data);
|
456
|
+
undoStack = null;
|
457
|
+
tempState = null;
|
458
|
+
});
|
459
|
+
|
460
|
+
undoStack.add(currentState);
|
461
|
+
updateButtonUndoStates();
|
462
|
+
|
463
|
+
imagePanel.on('load', function() {
|
464
|
+
width = imagePanel.imageSize().w;
|
465
|
+
height = imagePanel.imageSize().h;
|
466
|
+
ratioW = height / width;
|
467
|
+
ratioH = width / height;
|
468
|
+
|
469
|
+
win.find('#w').value(width);
|
470
|
+
win.find('#h').value(height);
|
471
|
+
});
|
472
|
+
}
|
473
|
+
|
474
|
+
function edit(blob) {
|
475
|
+
return new Promise(function(resolve, reject) {
|
476
|
+
open(createState(blob), resolve, reject);
|
477
|
+
});
|
478
|
+
}
|
479
|
+
|
480
|
+
//edit('img/dogleft.jpg');
|
481
|
+
|
482
|
+
return {
|
483
|
+
edit: edit
|
484
|
+
};
|
485
|
+
});
|