[TASK] Apply uglify to TypeScript builds 39/55639/5
authorAndreas Fernandez <a.fernandez@scripting-base.de>
Fri, 9 Feb 2018 22:53:06 +0000 (23:53 +0100)
committerBenjamin Kott <benjamin.kott@outlook.com>
Sat, 10 Feb 2018 22:30:05 +0000 (23:30 +0100)
The Grunt task `copy:ts_files` now modifies the uglify configuration
on-the-fly to minify the files compiled by TypeScript.

Resolves: #83251
Releases: master
Change-Id: I11faf7ae39f2605b4e8a8a6972f4f16c4b80138f
Reviewed-on: https://review.typo3.org/55639
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Joerg Boesche <typo3@joergboesche.de>
Reviewed-by: Frank Naegler <frank.naegler@typo3.org>
Tested-by: Frank Naegler <frank.naegler@typo3.org>
Reviewed-by: Benjamin Kott <benjamin.kott@outlook.com>
Tested-by: Benjamin Kott <benjamin.kott@outlook.com>
28 files changed:
Build/Gruntfile.js
typo3/sysext/backend/Resources/Public/JavaScript/BackendException.js
typo3/sysext/backend/Resources/Public/JavaScript/ColorPicker.js
typo3/sysext/backend/Resources/Public/JavaScript/ContextHelp.js
typo3/sysext/backend/Resources/Public/JavaScript/DebugConsole.js
typo3/sysext/backend/Resources/Public/JavaScript/Event/ClientRequest.js
typo3/sysext/backend/Resources/Public/JavaScript/Event/Consumable.js
typo3/sysext/backend/Resources/Public/JavaScript/Event/ConsumerScope.js
typo3/sysext/backend/Resources/Public/JavaScript/Event/InteractionRequest.js
typo3/sysext/backend/Resources/Public/JavaScript/Event/InteractionRequestAssignment.js
typo3/sysext/backend/Resources/Public/JavaScript/Event/InteractionRequestMap.js
typo3/sysext/backend/Resources/Public/JavaScript/Event/TriggerRequest.js
typo3/sysext/backend/Resources/Public/JavaScript/FormEngineReview.js
typo3/sysext/backend/Resources/Public/JavaScript/GridEditor.js
typo3/sysext/backend/Resources/Public/JavaScript/ImageManipulation.js
typo3/sysext/backend/Resources/Public/JavaScript/Login.js
typo3/sysext/backend/Resources/Public/JavaScript/Popover.js
typo3/sysext/backend/Resources/Public/JavaScript/RenameFile.js
typo3/sysext/backend/Resources/Public/JavaScript/Storage.js
typo3/sysext/backend/Resources/Public/JavaScript/Storage/Client.js
typo3/sysext/backend/Resources/Public/JavaScript/Storage/Persistent.js
typo3/sysext/backend/Resources/Public/JavaScript/Tabs.js
typo3/sysext/backend/Resources/Public/JavaScript/UserPassLogin.js
typo3/sysext/backend/Resources/Public/JavaScript/Utility.js
typo3/sysext/backend/Resources/Public/JavaScript/Wizard/NewContentElement.js
typo3/sysext/backend/Tests/JavaScript/BackendExceptionTest.js
typo3/sysext/backend/Tests/JavaScript/GridEditorTest.js
typo3/sysext/t3editor/Resources/Public/JavaScript/T3editor.js

index 4ba83f2..9eb05d3 100644 (file)
@@ -238,7 +238,22 @@ module.exports = function (grunt) {
           rename: function (dest, src) {
             var srccleaned = src.replace('Resources/Private/TypeScript', 'Resources/Public/JavaScript');
             srccleaned = srccleaned.replace('Tests/TypeScript', 'Tests/JavaScript');
-            return dest + srccleaned;
+            var destination = dest + srccleaned;
+
+            // Apply uglify configuration for regular files only
+            var config = {
+              uglify: {
+                typescript: {
+                  files: []
+                }
+              }
+            };
+            var uglyfile = {};
+            uglyfile[destination] = destination;
+            config.uglify.typescript.files.push(uglyfile);
+            grunt.config.merge(config);
+
+            return destination;
           }
         }]
       },
@@ -494,6 +509,26 @@ module.exports = function (grunt) {
             }
           }
         ]
+      },
+      typescript: {
+        options: {
+          banner: '/*\n' +
+          ' * This file is part of the TYPO3 CMS project.\n' +
+          ' *\n' +
+          ' * It is free software; you can redistribute it and/or modify it under\n' +
+          ' * the terms of the GNU General Public License, either version 2\n' +
+          ' * of the License, or any later version.\n' +
+          ' *\n' +
+          ' * For the full copyright and license information, please read the\n' +
+          ' * LICENSE.txt file that was distributed with this source code.\n' +
+          ' *\n' +
+          ' * The TYPO3 project - inspiring people to share!' +
+          '\n' +
+          ' */' +
+          '\n'
+        },
+        // Generated by copy:ts_files task
+        files: {}
       }
     }
   });
@@ -573,7 +608,7 @@ module.exports = function (grunt) {
    * - 2) Compiles all TypeScript files (*.ts) which are located in sysext/<EXTKEY>/Resources/Private/TypeScript/*.ts
    * - 3) Copy all generated JavaScript and Map files to public folders
    */
-  grunt.registerTask('scripts', ['tsconfig', 'tslint', 'tsclean', 'exec:ts', 'copy:ts_files']);
+  grunt.registerTask('scripts', ['tsconfig', 'tslint', 'tsclean', 'exec:ts', 'copy:ts_files', 'uglify:typescript']);
 
   /**
    * grunt tsclean task
index 3f752b1..49c589e 100644 (file)
  *
  * The TYPO3 project - inspiring people to share!
  */
-define(["require", "exports"], function (require, exports) {
-    "use strict";
-    Object.defineProperty(exports, "__esModule", { value: true });
-    var BackendException = (function () {
-        function BackendException(message, code) {
-            if (message === void 0) { message = ''; }
-            if (code === void 0) { code = 0; }
-            this.message = message;
-            this.code = code;
-        }
-        return BackendException;
-    }());
-    exports.BackendException = BackendException;
-});
+define(["require","exports"],function(a,b){"use strict";Object.defineProperty(b,"__esModule",{value:!0});var c=function(){function a(a,b){void 0===a&&(a=""),void 0===b&&(b=0),this.message=a,this.code=b}return a}();b.BackendException=c});
\ No newline at end of file
index 6f027e8..775814a 100644 (file)
  *
  * The TYPO3 project - inspiring people to share!
  */
-define(["require", "exports", "jquery", "TYPO3/CMS/Core/Contrib/jquery.minicolors"], function (require, exports, $) {
-    "use strict";
-    /**
-     * Module: TYPO3/CMS/Backend/ColorPicker
-     * contains all logic for the color picker used in FormEngine
-     * @exports TYPO3/CMS/Backend/ColorPicker
-     */
-    var ColorPicker = (function () {
-        /**
-         * The constructor, set the class properties default values
-         */
-        function ColorPicker() {
-            this.selector = '.t3js-color-picker';
-        }
-        /**
-         * Initialize the color picker for the given selector
-         */
-        ColorPicker.prototype.initialize = function () {
-            $(this.selector).minicolors({
-                format: 'hex',
-                position: 'bottom left',
-                theme: 'bootstrap',
-            });
-            $(document).on('change', '.t3js-colorpicker-value-trigger', function (event) {
-                var $element = $(event.target);
-                if ($element.val() !== '') {
-                    $element.closest('.t3js-formengine-field-item')
-                        .find('.t3js-color-picker')
-                        .val($element.val())
-                        .trigger('paste');
-                    $element.val('');
-                }
-            });
-        };
-        return ColorPicker;
-    }());
-    return new ColorPicker();
-});
+define(["require","exports","jquery","TYPO3/CMS/Core/Contrib/jquery.minicolors"],function(a,b,c){"use strict";var d=function(){function a(){this.selector=".t3js-color-picker"}return a.prototype.initialize=function(){c(this.selector).minicolors({format:"hex",position:"bottom left",theme:"bootstrap"}),c(document).on("change",".t3js-colorpicker-value-trigger",function(a){var b=c(a.target);""!==b.val()&&(b.closest(".t3js-formengine-field-item").find(".t3js-color-picker").val(b.val()).trigger("paste"),b.val(""))})},a}();return new d});
\ No newline at end of file
index c8b00f6..bf9be08 100644 (file)
  *
  * The TYPO3 project - inspiring people to share!
  */
-define(["require", "exports", "jquery", "./Popover", "bootstrap"], function (require, exports, $, Popover) {
-    "use strict";
-    /**
-     * Module: TYPO3/CMS/Backend/ContextHelp
-     * API for context help.
-     * @exports TYPO3/CMS/Backend/ContextHelp
-     */
-    var ContextHelp = (function () {
-        function ContextHelp() {
-            this.ajaxUrl = TYPO3.settings.ajaxUrls.context_help;
-            this.trigger = 'click';
-            this.placement = 'auto';
-            this.selector = '.t3-help-link';
-            this.initialize();
-        }
-        /**
-         * @return {Window}
-         */
-        ContextHelp.resolveBackend = function () {
-            if (typeof window.opener !== 'undefined' && window.opener !== null) {
-                return window.opener.top;
-            }
-            else {
-                return top;
-            }
-        };
-        ContextHelp.prototype.initialize = function () {
-            var _this = this;
-            var backendWindow = ContextHelp.resolveBackend();
-            if (typeof backendWindow.TYPO3.settings.ContextHelp !== 'undefined') {
-                this.helpModuleUrl = backendWindow.TYPO3.settings.ContextHelp.moduleUrl;
-            }
-            if (typeof TYPO3.ShortcutMenu === 'undefined' && typeof backendWindow.TYPO3.ShortcutMenu === 'undefined') {
-                // @FIXME: if we are in the popup... remove the bookmark / shortcut button
-                // @TODO: make it possible to use the bookmark button also in popup mode
-                $('.icon-actions-system-shortcut-new').closest('.btn').hide();
-            }
-            var title = '&nbsp;';
-            if (typeof backendWindow.TYPO3.lang !== 'undefined') {
-                title = backendWindow.TYPO3.lang.csh_tooltip_loading;
-            }
-            var $element = $(this.selector);
-            $element
-                .attr('data-loaded', 'false')
-                .attr('data-html', 'true')
-                .attr('data-original-title', title)
-                .attr('data-placement', this.placement)
-                .attr('data-trigger', this.trigger);
-            Popover.popover($element);
-            $(document).on('show.bs.popover', this.selector, function (e) {
-                var $me = $(e.currentTarget);
-                var description = $me.data('description');
-                if (typeof description !== 'undefined' && description !== '') {
-                    Popover.setOptions($me, {
-                        title: $me.data('title'),
-                        content: description
-                    });
-                }
-                else if ($me.attr('data-loaded') === 'false' && $me.data('table')) {
-                    _this.loadHelp($me);
-                }
-                // if help icon is in DocHeader, force open to bottom
-                if ($me.closest('.t3js-module-docheader').length) {
-                    Popover.setOption($me, 'placement', 'bottom');
-                }
-            }).on('shown.bs.popover', this.selector, function (e) {
-                var $popover = $(e.target).data('bs.popover').$tip;
-                if (!$popover.find('.popover-title').is(':visible')) {
-                    $popover.addClass('no-title');
-                }
-            }).on('click', '.tipIsLinked', function (e) {
-                $('.popover').each(function (index, popover) {
-                    var $popover = $(popover);
-                    if ($popover.has(e.target).length) {
-                        console.log($popover.data('bs.popover'));
-                        _this.showHelpPopup($popover.data('bs.popover').$element);
-                    }
-                });
-            }).on('click', 'body', function (e) {
-                $(_this.selector).each(function (index, triggerElement) {
-                    var $triggerElement = $(triggerElement);
-                    // the 'is' for buttons that trigger popups
-                    // the 'has' for icons within a button that triggers a popup
-                    if (!$triggerElement.is(e.target)
-                        && $triggerElement.has(e.target).length === 0
-                        && $('.popover').has(e.target).length === 0) {
-                        Popover.hide($triggerElement);
-                    }
-                });
-            });
-        };
-        /**
-         * Open the help popup
-         *
-         * @param {JQuery} $trigger
-         */
-        ContextHelp.prototype.showHelpPopup = function ($trigger) {
-            try {
-                var cshWindow = window.open(this.helpModuleUrl +
-                    '&tx_documentation_help_documentationcshmanual[table]=' + $trigger.data('table') +
-                    '&tx_documentation_help_documentationcshmanual[field]=' + $trigger.data('field'), 'ContextHelpWindow', 'height=400,width=600,status=0,menubar=0,scrollbars=1');
-                cshWindow.focus();
-                Popover.hide($trigger);
-                return cshWindow;
-            }
-            catch (e) {
-                // do nothing
-            }
-        };
-        /**
-         * Load help data
-         *
-         * @param {JQuery} $trigger
-         */
-        ContextHelp.prototype.loadHelp = function ($trigger) {
-            var table = $trigger.data('table');
-            var field = $trigger.data('field');
-            // If a table is defined, use ajax call to get the tooltip's content
-            if (table) {
-                // Load content
-                $.getJSON(this.ajaxUrl, {
-                    params: {
-                        action: 'getContextHelp',
-                        table: table,
-                        field: field
-                    }
-                }).done(function (data) {
-                    var title = data.title || '';
-                    var content = data.content || '<p></p>';
-                    Popover.setOptions($trigger, {
-                        title: title,
-                        content: content
-                    });
-                    $trigger
-                        .attr('data-loaded', 'true')
-                        .one('hidden.bs.popover', function () {
-                        Popover.show($trigger);
-                    });
-                    Popover.hide($trigger);
-                });
-            }
-        };
-        return ContextHelp;
-    }());
-    return new ContextHelp();
-});
+define(["require","exports","jquery","./Popover","bootstrap"],function(a,b,c,d){"use strict";var e=function(){function a(){this.ajaxUrl=TYPO3.settings.ajaxUrls.context_help,this.trigger="click",this.placement="auto",this.selector=".t3-help-link",this.initialize()}return a.resolveBackend=function(){return"undefined"!=typeof window.opener&&null!==window.opener?window.opener.top:top},a.prototype.initialize=function(){var b=this,e=a.resolveBackend();"undefined"!=typeof e.TYPO3.settings.ContextHelp&&(this.helpModuleUrl=e.TYPO3.settings.ContextHelp.moduleUrl),"undefined"==typeof TYPO3.ShortcutMenu&&"undefined"==typeof e.TYPO3.ShortcutMenu&&c(".icon-actions-system-shortcut-new").closest(".btn").hide();var f="&nbsp;";"undefined"!=typeof e.TYPO3.lang&&(f=e.TYPO3.lang.csh_tooltip_loading);var g=c(this.selector);g.attr("data-loaded","false").attr("data-html","true").attr("data-original-title",f).attr("data-placement",this.placement).attr("data-trigger",this.trigger),d.popover(g),c(document).on("show.bs.popover",this.selector,function(a){var e=c(a.currentTarget),f=e.data("description");"undefined"!=typeof f&&""!==f?d.setOptions(e,{title:e.data("title"),content:f}):"false"===e.attr("data-loaded")&&e.data("table")&&b.loadHelp(e),e.closest(".t3js-module-docheader").length&&d.setOption(e,"placement","bottom")}).on("shown.bs.popover",this.selector,function(a){var b=c(a.target).data("bs.popover").$tip;b.find(".popover-title").is(":visible")||b.addClass("no-title")}).on("click",".tipIsLinked",function(a){c(".popover").each(function(d,e){var f=c(e);f.has(a.target).length&&(console.log(f.data("bs.popover")),b.showHelpPopup(f.data("bs.popover").$element))})}).on("click","body",function(a){c(b.selector).each(function(b,e){var f=c(e);f.is(a.target)||0!==f.has(a.target).length||0!==c(".popover").has(a.target).length||d.hide(f)})})},a.prototype.showHelpPopup=function(a){try{var b=window.open(this.helpModuleUrl+"&tx_documentation_help_documentationcshmanual[table]="+a.data("table")+"&tx_documentation_help_documentationcshmanual[field]="+a.data("field"),"ContextHelpWindow","height=400,width=600,status=0,menubar=0,scrollbars=1");return b.focus(),d.hide(a),b}catch(a){}},a.prototype.loadHelp=function(a){var b=a.data("table"),e=a.data("field");b&&c.getJSON(this.ajaxUrl,{params:{action:"getContextHelp",table:b,field:e}}).done(function(b){var c=b.title||"",e=b.content||"<p></p>";d.setOptions(a,{title:c,content:e}),a.attr("data-loaded","true").one("hidden.bs.popover",function(){d.show(a)}),d.hide(a)})},a}();return new e});
\ No newline at end of file
index c5ddfc1..6fda0a1 100644 (file)
  *
  * The TYPO3 project - inspiring people to share!
  */
-define(["require", "exports", "jquery"], function (require, exports, $) {
-    "use strict";
-    /**
-     * Module: TYPO3/CMS/Backend/DebugConsole
-     * The debug console shown at the bottom of the backend
-     * @exports TYPO3/CMS/Backend/DebugConsole
-     */
-    var DebugConsole = (function () {
-        function DebugConsole() {
-            var _this = this;
-            this.settings = {
-                autoscroll: true,
-            };
-            $(function () {
-                _this.createDom();
-            });
-        }
-        /**
-         * Increment the counter of unread messages in the given tab
-         *
-         * @param {JQuery} $tab
-         */
-        DebugConsole.incrementInactiveTabCounter = function ($tab) {
-            if (!$tab.hasClass('active')) {
-                var $badge = $tab.find('.badge');
-                var value = parseInt($badge.text(), 10);
-                if (isNaN(value)) {
-                    value = 0;
-                }
-                $badge.text(++value);
-            }
-        };
-        /**
-         * Add the debug message to the console
-         *
-         * @param {String} message
-         * @param {String} header
-         * @param {String} [group=Debug]
-         */
-        DebugConsole.prototype.add = function (message, header, group) {
-            this.attachToViewport();
-            var $line = $('<p />').html(message);
-            if (typeof header !== 'undefined' && header.length > 0) {
-                $line.prepend($('<strong />').text(header));
-            }
-            if (typeof group === 'undefined' || group.length === 0) {
-                group = 'Debug';
-            }
-            var tabIdentifier = 'debugtab-' + group.toLowerCase().replace(/\W+/g, '-');
-            var $debugTabs = this.$consoleDom.find('.t3js-debuggroups');
-            var $tabContent = this.$consoleDom.find('.t3js-debugcontent');
-            var $tab = this.$consoleDom.find('.t3js-debuggroups li[data-identifier=' + tabIdentifier + ']');
-            // check if group tab exists
-            if ($tab.length === 0) {
-                // create new tab
-                $tab =
-                    $('<li />', { role: 'presentation', 'data-identifier': tabIdentifier }).append($('<a />', {
-                        'aria-controls': tabIdentifier,
-                        'data-toggle': 'tab',
-                        href: '#' + tabIdentifier,
-                        role: 'tab'
-                    }).text(group + ' ').append($('<span />', { 'class': 'badge' }))).on('shown.bs.tab', function (e) {
-                        $(e.currentTarget).find('.badge').text('');
-                    });
-                $debugTabs.append($tab);
-                $tabContent.append($('<div />', { role: 'tabpanel', 'class': 'tab-pane', id: tabIdentifier }).append($('<div />', { 'class': 't3js-messages messages' })));
-            }
-            // activate the first tab if no one is active
-            if ($debugTabs.find('.active').length === 0) {
-                $debugTabs.find('a:first').tab('show');
-            }
-            DebugConsole.incrementInactiveTabCounter($tab);
-            this.incrementUnreadMessagesIfCollapsed();
-            var $messageBox = $('#' + tabIdentifier + ' .t3js-messages');
-            var isMessageBoxActive = $messageBox.parent().hasClass('active');
-            $messageBox.append($line);
-            if (this.settings.autoscroll && isMessageBoxActive) {
-                $messageBox.scrollTop($messageBox.prop('scrollHeight'));
-            }
-        };
-        DebugConsole.prototype.createDom = function () {
-            var _this = this;
-            if (typeof this.$consoleDom !== 'undefined') {
-                return;
-            }
-            this.$consoleDom =
-                $('<div />', { id: 'typo3-debug-console' }).append($('<div />', { 'class': 't3js-topbar topbar' }).append($('<p />', { 'class': 'pull-left' }).text(' TYPO3 Debug Console').prepend($('<span />', { 'class': 'fa fa-terminal topbar-icon' })).append($('<span />', { 'class': 'badge' })), $('<div />', { 'class': 't3js-buttons btn-group pull-right' })), $('<div />').append($('<div />', { role: 'tabpanel' }).append($('<ul />', { 'class': 'nav nav-tabs t3js-debuggroups', role: 'tablist' })), $('<div />', { 'class': 'tab-content t3js-debugcontent' })));
-            this.addButton($('<button />', {
-                'class': 'btn btn-default btn-sm ' + (this.settings.autoscroll ? 'active' : ''),
-                title: TYPO3.lang['debuggerconsole.autoscroll']
-            }).append($('<span />', { 'class': 't3-icon fa fa-magnet' })), function () {
-                $(_this).button('toggle');
-                _this.settings.autoscroll = !_this.settings.autoscroll;
-            }).addButton($('<button />', {
-                'class': 'btn btn-default btn-sm',
-                title: TYPO3.lang['debuggerconsole.toggle.collapse']
-            }).append($('<span />', { 'class': 't3-icon fa fa-chevron-down' })), function (e) {
-                var $button = $(e.currentTarget);
-                var $icon = $button.find('.t3-icon');
-                var $innerContainer = _this.$consoleDom.find('.t3js-topbar').next();
-                $innerContainer.toggle();
-                if ($innerContainer.is(':visible')) {
-                    $button.attr('title', TYPO3.lang['debuggerconsole.toggle.collapse']);
-                    $icon.toggleClass('fa-chevron-down', true).toggleClass('fa-chevron-up', false);
-                    _this.resetGlobalUnreadCounter();
-                }
-                else {
-                    $button.attr('title', TYPO3.lang['debuggerconsole.toggle.expand']);
-                    $icon.toggleClass('fa-chevron-down', false).toggleClass('fa-chevron-up', true);
-                }
-            }).addButton($('<button />', {
-                'class': 'btn btn-default btn-sm',
-                title: TYPO3.lang['debuggerconsole.clear']
-            }).append($('<span />', { class: 't3-icon fa fa-undo' })), function () {
-                _this.flush();
-            }).addButton($('<button />', {
-                'class': 'btn btn-default btn-sm',
-                title: TYPO3.lang['debuggerconsole.close']
-            }).append($('<span />', { 'class': 't3-icon fa fa-times' })), function () {
-                _this.destroy();
-                _this.createDom();
-            });
-        };
-        /**
-         * Adds a button and it's callback to the console's toolbar
-         *
-         * @param {JQuery} $button
-         * @param callback
-         * @returns {DebugConsole}
-         */
-        DebugConsole.prototype.addButton = function ($button, callback) {
-            $button.on('click', callback);
-            this.$consoleDom.find('.t3js-buttons').append($button);
-            return this;
-        };
-        /**
-         * Attach the Debugger Console to the viewport
-         */
-        DebugConsole.prototype.attachToViewport = function () {
-            var $viewport = $('.t3js-scaffold-content');
-            if ($viewport.has(this.$consoleDom).length === 0) {
-                $viewport.append(this.$consoleDom);
-            }
-        };
-        /**
-         * Increment the counter of unread messages in the tabbar
-         */
-        DebugConsole.prototype.incrementUnreadMessagesIfCollapsed = function () {
-            var $topbar = this.$consoleDom.find('.t3js-topbar');
-            var $innerContainer = $topbar.next();
-            if ($innerContainer.is(':hidden')) {
-                var $badge = $topbar.find('.badge');
-                var value = parseInt($badge.text(), 10);
-                if (isNaN(value)) {
-                    value = 0;
-                }
-                $badge.text(++value);
-            }
-        };
-        /**
-         * Reset global unread counter
-         */
-        DebugConsole.prototype.resetGlobalUnreadCounter = function () {
-            this.$consoleDom.find('.t3js-topbar').find('.badge').text('');
-        };
-        /**
-         * Reset the console
-         */
-        DebugConsole.prototype.flush = function () {
-            var $debugTabs = this.$consoleDom.find('.t3js-debuggroups');
-            var $tabContent = this.$consoleDom.find('.t3js-debugcontent');
-            $debugTabs.children().remove();
-            $tabContent.children().remove();
-        };
-        /**
-         * Destroy everything of the console
-         */
-        DebugConsole.prototype.destroy = function () {
-            this.$consoleDom.remove();
-            this.$consoleDom = undefined;
-        };
-        return DebugConsole;
-    }());
-    var debugConsole = new DebugConsole();
-    // expose as global object
-    TYPO3.DebugConsole = debugConsole;
-    return debugConsole;
-});
+define(["require","exports","jquery"],function(a,b,c){"use strict";var d=function(){function a(){var a=this;this.settings={autoscroll:!0},c(function(){a.createDom()})}return a.incrementInactiveTabCounter=function(a){if(!a.hasClass("active")){var b=a.find(".badge"),c=parseInt(b.text(),10);isNaN(c)&&(c=0),b.text(++c)}},a.prototype.add=function(b,d,e){this.attachToViewport();var f=c("<p />").html(b);"undefined"!=typeof d&&d.length>0&&f.prepend(c("<strong />").text(d)),"undefined"!=typeof e&&0!==e.length||(e="Debug");var g="debugtab-"+e.toLowerCase().replace(/\W+/g,"-"),h=this.$consoleDom.find(".t3js-debuggroups"),i=this.$consoleDom.find(".t3js-debugcontent"),j=this.$consoleDom.find(".t3js-debuggroups li[data-identifier="+g+"]");0===j.length&&(j=c("<li />",{role:"presentation","data-identifier":g}).append(c("<a />",{"aria-controls":g,"data-toggle":"tab",href:"#"+g,role:"tab"}).text(e+" ").append(c("<span />",{class:"badge"}))).on("shown.bs.tab",function(a){c(a.currentTarget).find(".badge").text("")}),h.append(j),i.append(c("<div />",{role:"tabpanel",class:"tab-pane",id:g}).append(c("<div />",{class:"t3js-messages messages"})))),0===h.find(".active").length&&h.find("a:first").tab("show"),a.incrementInactiveTabCounter(j),this.incrementUnreadMessagesIfCollapsed();var k=c("#"+g+" .t3js-messages"),l=k.parent().hasClass("active");k.append(f),this.settings.autoscroll&&l&&k.scrollTop(k.prop("scrollHeight"))},a.prototype.createDom=function(){var a=this;"undefined"==typeof this.$consoleDom&&(this.$consoleDom=c("<div />",{id:"typo3-debug-console"}).append(c("<div />",{class:"t3js-topbar topbar"}).append(c("<p />",{class:"pull-left"}).text(" TYPO3 Debug Console").prepend(c("<span />",{class:"fa fa-terminal topbar-icon"})).append(c("<span />",{class:"badge"})),c("<div />",{class:"t3js-buttons btn-group pull-right"})),c("<div />").append(c("<div />",{role:"tabpanel"}).append(c("<ul />",{class:"nav nav-tabs t3js-debuggroups",role:"tablist"})),c("<div />",{class:"tab-content t3js-debugcontent"}))),this.addButton(c("<button />",{class:"btn btn-default btn-sm "+(this.settings.autoscroll?"active":""),title:TYPO3.lang["debuggerconsole.autoscroll"]}).append(c("<span />",{class:"t3-icon fa fa-magnet"})),function(){c(a).button("toggle"),a.settings.autoscroll=!a.settings.autoscroll}).addButton(c("<button />",{class:"btn btn-default btn-sm",title:TYPO3.lang["debuggerconsole.toggle.collapse"]}).append(c("<span />",{class:"t3-icon fa fa-chevron-down"})),function(b){var d=c(b.currentTarget),e=d.find(".t3-icon"),f=a.$consoleDom.find(".t3js-topbar").next();f.toggle(),f.is(":visible")?(d.attr("title",TYPO3.lang["debuggerconsole.toggle.collapse"]),e.toggleClass("fa-chevron-down",!0).toggleClass("fa-chevron-up",!1),a.resetGlobalUnreadCounter()):(d.attr("title",TYPO3.lang["debuggerconsole.toggle.expand"]),e.toggleClass("fa-chevron-down",!1).toggleClass("fa-chevron-up",!0))}).addButton(c("<button />",{class:"btn btn-default btn-sm",title:TYPO3.lang["debuggerconsole.clear"]}).append(c("<span />",{class:"t3-icon fa fa-undo"})),function(){a.flush()}).addButton(c("<button />",{class:"btn btn-default btn-sm",title:TYPO3.lang["debuggerconsole.close"]}).append(c("<span />",{class:"t3-icon fa fa-times"})),function(){a.destroy(),a.createDom()}))},a.prototype.addButton=function(a,b){return a.on("click",b),this.$consoleDom.find(".t3js-buttons").append(a),this},a.prototype.attachToViewport=function(){var a=c(".t3js-scaffold-content");0===a.has(this.$consoleDom).length&&a.append(this.$consoleDom)},a.prototype.incrementUnreadMessagesIfCollapsed=function(){var a=this.$consoleDom.find(".t3js-topbar"),b=a.next();if(b.is(":hidden")){var c=a.find(".badge"),d=parseInt(c.text(),10);isNaN(d)&&(d=0),c.text(++d)}},a.prototype.resetGlobalUnreadCounter=function(){this.$consoleDom.find(".t3js-topbar").find(".badge").text("")},a.prototype.flush=function(){var a=this.$consoleDom.find(".t3js-debuggroups"),b=this.$consoleDom.find(".t3js-debugcontent");a.children().remove(),b.children().remove()},a.prototype.destroy=function(){this.$consoleDom.remove(),this.$consoleDom=void 0},a}(),e=new d;return TYPO3.DebugConsole=e,e});
\ No newline at end of file
index 1052a89..cdb24d5 100644 (file)
  *
  * The TYPO3 project - inspiring people to share!
  */
-var __extends = (this && this.__extends) || (function () {
-    var extendStatics = Object.setPrototypeOf ||
-        ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
-        function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
-    return function (d, b) {
-        extendStatics(d, b);
-        function __() { this.constructor = d; }
-        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
-    };
-})();
-define(["require", "exports", "./InteractionRequest"], function (require, exports, InteractionRequest) {
-    "use strict";
-    var ClientRequest = (function (_super) {
-        __extends(ClientRequest, _super);
-        function ClientRequest(type, clientEvent) {
-            if (clientEvent === void 0) { clientEvent = null; }
-            var _this = _super.call(this, type) || this;
-            _this.clientEvent = clientEvent;
-            return _this;
-        }
-        return ClientRequest;
-    }(InteractionRequest));
-    return ClientRequest;
-});
+var __extends=this&&this.__extends||function(){var a=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(a,b){a.__proto__=b}||function(a,b){for(var c in b)b.hasOwnProperty(c)&&(a[c]=b[c])};return function(b,c){function d(){this.constructor=b}a(b,c),b.prototype=null===c?Object.create(c):(d.prototype=c.prototype,new d)}}();define(["require","exports","./InteractionRequest"],function(a,b,c){"use strict";var d=function(a){function b(b,c){void 0===c&&(c=null);var d=a.call(this,b)||this;return d.clientEvent=c,d}return __extends(b,a),b}(c);return d});
\ No newline at end of file
index fcabab4..e462d79 100644 (file)
@@ -10,7 +10,4 @@
  *
  * The TYPO3 project - inspiring people to share!
  */
-define(["require", "exports"], function (require, exports) {
-    "use strict";
-    Object.defineProperty(exports, "__esModule", { value: true });
-});
+define(["require","exports"],function(a,b){"use strict";Object.defineProperty(b,"__esModule",{value:!0})});
\ No newline at end of file
index 440cab8..98307e9 100644 (file)
  *
  * The TYPO3 project - inspiring people to share!
  */
-define(["require", "exports", "jquery"], function (require, exports, $) {
-    "use strict";
-    var ConsumerScope = (function () {
-        function ConsumerScope() {
-            this.consumers = [];
-        }
-        ConsumerScope.prototype.getConsumers = function () {
-            return this.consumers;
-        };
-        ConsumerScope.prototype.hasConsumer = function (consumer) {
-            return this.consumers.indexOf(consumer) !== -1;
-        };
-        ConsumerScope.prototype.attach = function (consumer) {
-            if (!this.hasConsumer(consumer)) {
-                this.consumers.push(consumer);
-            }
-        };
-        ConsumerScope.prototype.detach = function (consumer) {
-            this.consumers = this.consumers.filter(function (currentConsumer) { return currentConsumer !== consumer; });
-        };
-        ConsumerScope.prototype.invoke = function (request) {
-            var deferreds = [];
-            this.consumers.forEach(function (consumer) {
-                var deferred = consumer.consume.call(consumer, request);
-                if (deferred) {
-                    deferreds.push(deferred);
-                }
-            });
-            return $.when.apply($, deferreds);
-        };
-        return ConsumerScope;
-    }());
-    return new ConsumerScope();
-});
+define(["require","exports","jquery"],function(a,b,c){"use strict";var d=function(){function a(){this.consumers=[]}return a.prototype.getConsumers=function(){return this.consumers},a.prototype.hasConsumer=function(a){return this.consumers.indexOf(a)!==-1},a.prototype.attach=function(a){this.hasConsumer(a)||this.consumers.push(a)},a.prototype.detach=function(a){this.consumers=this.consumers.filter(function(b){return b!==a})},a.prototype.invoke=function(a){var b=[];return this.consumers.forEach(function(c){var d=c.consume.call(c,a);d&&b.push(d)}),c.when.apply(c,b)},a}();return new d});
\ No newline at end of file
index 1b726f5..4f654e9 100644 (file)
  *
  * The TYPO3 project - inspiring people to share!
  */
-define(["require", "exports"], function (require, exports) {
-    "use strict";
-    var InteractionRequest = (function () {
-        function InteractionRequest(type, parentRequest) {
-            if (parentRequest === void 0) { parentRequest = null; }
-            this.processed = false;
-            this.processedData = null;
-            this.type = type;
-            this.parentRequest = parentRequest;
-        }
-        Object.defineProperty(InteractionRequest.prototype, "outerMostRequest", {
-            get: function () {
-                var request = this;
-                while (request.parentRequest instanceof InteractionRequest) {
-                    request = request.parentRequest;
-                }
-                return request;
-            },
-            enumerable: true,
-            configurable: true
-        });
-        InteractionRequest.prototype.isProcessed = function () {
-            return this.processed;
-        };
-        InteractionRequest.prototype.getProcessedData = function () {
-            return this.processedData;
-        };
-        InteractionRequest.prototype.setProcessedData = function (processedData) {
-            if (processedData === void 0) { processedData = null; }
-            this.processed = true;
-            this.processedData = processedData;
-        };
-        return InteractionRequest;
-    }());
-    return InteractionRequest;
-});
+define(["require","exports"],function(a,b){"use strict";var c=function(){function a(a,b){void 0===b&&(b=null),this.processed=!1,this.processedData=null,this.type=a,this.parentRequest=b}return Object.defineProperty(a.prototype,"outerMostRequest",{get:function(){for(var b=this;b.parentRequest instanceof a;)b=b.parentRequest;return b},enumerable:!0,configurable:!0}),a.prototype.isProcessed=function(){return this.processed},a.prototype.getProcessedData=function(){return this.processedData},a.prototype.setProcessedData=function(a){void 0===a&&(a=null),this.processed=!0,this.processedData=a},a}();return c});
\ No newline at end of file
index fcabab4..e462d79 100644 (file)
@@ -10,7 +10,4 @@
  *
  * The TYPO3 project - inspiring people to share!
  */
-define(["require", "exports"], function (require, exports) {
-    "use strict";
-    Object.defineProperty(exports, "__esModule", { value: true });
-});
+define(["require","exports"],function(a,b){"use strict";Object.defineProperty(b,"__esModule",{value:!0})});
\ No newline at end of file
index 9983ef9..ccbf077 100644 (file)
  *
  * The TYPO3 project - inspiring people to share!
  */
-define(["require", "exports"], function (require, exports) {
-    "use strict";
-    var InteractionRequestMap = (function () {
-        function InteractionRequestMap() {
-            this.assignments = [];
-        }
-        InteractionRequestMap.prototype.attachFor = function (request, deferred) {
-            var targetAssignment = this.getFor(request);
-            if (targetAssignment === null) {
-                targetAssignment = { request: request, deferreds: [] };
-                this.assignments.push(targetAssignment);
-            }
-            targetAssignment.deferreds.push(deferred);
-        };
-        InteractionRequestMap.prototype.detachFor = function (request) {
-            var targetAssignment = this.getFor(request);
-            this.assignments = this.assignments.filter(function (assignment) { return assignment === targetAssignment; });
-        };
-        InteractionRequestMap.prototype.getFor = function (triggerEvent) {
-            var targetAssignment = null;
-            this.assignments.some(function (assignment) {
-                if (assignment.request === triggerEvent) {
-                    targetAssignment = assignment;
-                    return true;
-                }
-                return false;
-            });
-            return targetAssignment;
-        };
-        InteractionRequestMap.prototype.resolveFor = function (triggerEvent) {
-            var targetAssignment = this.getFor(triggerEvent);
-            if (targetAssignment === null) {
-                return false;
-            }
-            targetAssignment.deferreds.forEach(function (deferred) { return deferred.resolve(); });
-            this.detachFor(triggerEvent);
-            return true;
-        };
-        InteractionRequestMap.prototype.rejectFor = function (triggerEvent) {
-            var targetAssignment = this.getFor(triggerEvent);
-            if (targetAssignment === null) {
-                return false;
-            }
-            targetAssignment.deferreds.forEach(function (deferred) { return deferred.reject(); });
-            this.detachFor(triggerEvent);
-            return true;
-        };
-        return InteractionRequestMap;
-    }());
-    return new InteractionRequestMap();
-});
+define(["require","exports"],function(a,b){"use strict";var c=function(){function a(){this.assignments=[]}return a.prototype.attachFor=function(a,b){var c=this.getFor(a);null===c&&(c={request:a,deferreds:[]},this.assignments.push(c)),c.deferreds.push(b)},a.prototype.detachFor=function(a){var b=this.getFor(a);this.assignments=this.assignments.filter(function(a){return a===b})},a.prototype.getFor=function(a){var b=null;return this.assignments.some(function(c){return c.request===a&&(b=c,!0)}),b},a.prototype.resolveFor=function(a){var b=this.getFor(a);return null!==b&&(b.deferreds.forEach(function(a){return a.resolve()}),this.detachFor(a),!0)},a.prototype.rejectFor=function(a){var b=this.getFor(a);return null!==b&&(b.deferreds.forEach(function(a){return a.reject()}),this.detachFor(a),!0)},a}();return new c});
\ No newline at end of file
index 28d91df..a0923b0 100644 (file)
  *
  * The TYPO3 project - inspiring people to share!
  */
-var __extends = (this && this.__extends) || (function () {
-    var extendStatics = Object.setPrototypeOf ||
-        ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
-        function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
-    return function (d, b) {
-        extendStatics(d, b);
-        function __() { this.constructor = d; }
-        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
-    };
-})();
-define(["require", "exports", "./InteractionRequest"], function (require, exports, InteractionRequest) {
-    "use strict";
-    var TriggerRequest = (function (_super) {
-        __extends(TriggerRequest, _super);
-        function TriggerRequest(type, parentRequest) {
-            if (parentRequest === void 0) { parentRequest = null; }
-            return _super.call(this, type, parentRequest) || this;
-        }
-        TriggerRequest.prototype.concerns = function (ancestorRequest) {
-            if (this === ancestorRequest) {
-                return true;
-            }
-            var request = this;
-            while (request.parentRequest instanceof InteractionRequest) {
-                request = request.parentRequest;
-                if (request === ancestorRequest) {
-                    return true;
-                }
-            }
-            return false;
-        };
-        TriggerRequest.prototype.concernsTypes = function (types) {
-            if (types.indexOf(this.type) !== -1) {
-                return true;
-            }
-            var request = this;
-            while (request.parentRequest instanceof InteractionRequest) {
-                request = request.parentRequest;
-                if (types.indexOf(request.type) !== -1) {
-                    return true;
-                }
-            }
-            return false;
-        };
-        return TriggerRequest;
-    }(InteractionRequest));
-    return TriggerRequest;
-});
+var __extends=this&&this.__extends||function(){var a=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(a,b){a.__proto__=b}||function(a,b){for(var c in b)b.hasOwnProperty(c)&&(a[c]=b[c])};return function(b,c){function d(){this.constructor=b}a(b,c),b.prototype=null===c?Object.create(c):(d.prototype=c.prototype,new d)}}();define(["require","exports","./InteractionRequest"],function(a,b,c){"use strict";var d=function(a){function b(b,c){return void 0===c&&(c=null),a.call(this,b,c)||this}return __extends(b,a),b.prototype.concerns=function(a){if(this===a)return!0;for(var b=this;b.parentRequest instanceof c;)if(b=b.parentRequest,b===a)return!0;return!1},b.prototype.concernsTypes=function(a){if(a.indexOf(this.type)!==-1)return!0;for(var b=this;b.parentRequest instanceof c;)if(b=b.parentRequest,a.indexOf(b.type)!==-1)return!0;return!1},b}(c);return d});
\ No newline at end of file
index 5fc9dbf..6a32397 100644 (file)
  *
  * The TYPO3 project - inspiring people to share!
  */
-define(["require", "exports", "jquery", "TYPO3/CMS/Backend/FormEngine", "bootstrap"], function (require, exports, $, FormEngine) {
-    "use strict";
-    /**
-     * Module: TYPO3/CMS/Backend/FormEngineReview
-     * Enables interaction with record fields that need review
-     * @exports TYPO3/CMS/Backend/FormEngineReview
-     */
-    var FormEngineReview = (function () {
-        /**
-         * The constructor, set the class properties default values
-         */
-        function FormEngineReview() {
-            var _this = this;
-            /**
-             * Checks if fields have failed validation. In such case, the markup is rendered and the toggle button is unlocked.
-             */
-            this.checkForReviewableField = function () {
-                var me = _this;
-                var $invalidFields = FormEngineReview.findInvalidField();
-                var $toggleButton = $('.' + _this.toggleButtonClass);
-                if ($invalidFields.length > 0) {
-                    var $list_1 = $('<div />', { class: 'list-group' });
-                    $invalidFields.each(function () {
-                        var $field = $(this);
-                        var $input = $field.find('[data-formengine-validation-rules]');
-                        var inputId = $input.attr('id');
-                        if (typeof inputId === 'undefined') {
-                            inputId = $input.parent().children('[id]').first().attr('id');
-                        }
-                        $list_1.append($('<a />', {
-                            'class': 'list-group-item ' + me.fieldListItemClass,
-                            'data-field-id': inputId,
-                            'href': '#',
-                        }).text($field.find(me.labelSelector).text()));
-                    });
-                    $toggleButton.removeClass('hidden');
-                    // bootstrap has no official API to update the content of a popover w/o destroying it
-                    var $popover = $toggleButton.data('bs.popover');
-                    if ($popover) {
-                        $popover.options.content = $list_1.wrapAll('<div>').parent().html();
-                        $popover.setContent();
-                        $popover.$tip.addClass($popover.options.placement);
-                    }
-                }
-                else {
-                    $toggleButton.addClass('hidden').popover('hide');
-                }
-            };
-            /**
-             * Finds the field in the form and focuses it
-             *
-             * @param {Event} e
-             */
-            this.switchToField = function (e) {
-                e.preventDefault();
-                var $listItem = $(e.currentTarget);
-                var referenceFieldId = $listItem.data('fieldId');
-                var $referenceField = $('#' + referenceFieldId);
-                // iterate possibly nested tab panels
-                $referenceField.parents('[id][role="tabpanel"]').each(function () {
-                    $('[aria-controls="' + $(this).attr('id') + '"]').tab('show');
-                });
-                $referenceField.focus();
-            };
-            this.toggleButtonClass = 't3js-toggle-review-panel';
-            this.fieldListItemClass = 't3js-field-item';
-            this.labelSelector = '.t3js-formengine-label';
-            this.initialize();
-        }
-        /**
-         * Fetches all fields that have a failed validation
-         *
-         * @return {$}
-         */
-        FormEngineReview.findInvalidField = function () {
-            return $(document).find('.tab-content .' + FormEngine.Validation.errorClass);
-        };
-        /**
-         * Renders an invisible button to toggle the review panel into the least possible toolbar
-         *
-         * @param {Object} context
-         */
-        FormEngineReview.attachButtonToModuleHeader = function (context) {
-            var $leastButtonBar = $('.t3js-module-docheader-bar-buttons').children().last().find('[role="toolbar"]');
-            var $button = $('<a />', {
-                class: 'btn btn-danger btn-sm hidden ' + context.toggleButtonClass,
-                href: '#',
-                title: TYPO3.lang['buttons.reviewFailedValidationFields'],
-            }).append($('<span />', { class: 'fa fa-fw fa-info' }));
-            $button.popover({
-                container: 'body',
-                html: true,
-                placement: 'bottom',
-            });
-            $leastButtonBar.prepend($button);
-        };
-        /**
-         * Initialize the events
-         */
-        FormEngineReview.prototype.initialize = function () {
-            var me = this;
-            var $document = $(document);
-            $(function () {
-                FormEngineReview.attachButtonToModuleHeader(me);
-            });
-            $document.on('click', '.' + this.fieldListItemClass, this.switchToField);
-            $document.on('t3-formengine-postfieldvalidation', this.checkForReviewableField);
-        };
-        return FormEngineReview;
-    }());
-    return new FormEngineReview();
-});
+define(["require","exports","jquery","TYPO3/CMS/Backend/FormEngine","bootstrap"],function(a,b,c,d){"use strict";var e=function(){function a(){var b=this;this.checkForReviewableField=function(){var d=b,e=a.findInvalidField(),f=c("."+b.toggleButtonClass);if(e.length>0){var g=c("<div />",{class:"list-group"});e.each(function(){var a=c(this),b=a.find("[data-formengine-validation-rules]"),e=b.attr("id");"undefined"==typeof e&&(e=b.parent().children("[id]").first().attr("id")),g.append(c("<a />",{class:"list-group-item "+d.fieldListItemClass,"data-field-id":e,href:"#"}).text(a.find(d.labelSelector).text()))}),f.removeClass("hidden");var h=f.data("bs.popover");h&&(h.options.content=g.wrapAll("<div>").parent().html(),h.setContent(),h.$tip.addClass(h.options.placement))}else f.addClass("hidden").popover("hide")},this.switchToField=function(a){a.preventDefault();var b=c(a.currentTarget),d=b.data("fieldId"),e=c("#"+d);e.parents('[id][role="tabpanel"]').each(function(){c('[aria-controls="'+c(this).attr("id")+'"]').tab("show")}),e.focus()},this.toggleButtonClass="t3js-toggle-review-panel",this.fieldListItemClass="t3js-field-item",this.labelSelector=".t3js-formengine-label",this.initialize()}return a.findInvalidField=function(){return c(document).find(".tab-content ."+d.Validation.errorClass)},a.attachButtonToModuleHeader=function(a){var b=c(".t3js-module-docheader-bar-buttons").children().last().find('[role="toolbar"]'),d=c("<a />",{class:"btn btn-danger btn-sm hidden "+a.toggleButtonClass,href:"#",title:TYPO3.lang["buttons.reviewFailedValidationFields"]}).append(c("<span />",{class:"fa fa-fw fa-info"}));d.popover({container:"body",html:!0,placement:"bottom"}),b.prepend(d)},a.prototype.initialize=function(){var b=this,d=c(document);c(function(){a.attachButtonToModuleHeader(b)}),d.on("click","."+this.fieldListItemClass,this.switchToField),d.on("t3-formengine-postfieldvalidation",this.checkForReviewableField)},a}();return new e});
\ No newline at end of file
index a827bc5..66ed74a 100644 (file)
  *
  * The TYPO3 project - inspiring people to share!
  */
-var __values = (this && this.__values) || function (o) {
-    var m = typeof Symbol === "function" && o[Symbol.iterator], i = 0;
-    if (m) return m.call(o);
-    return {
-        next: function () {
-            if (o && i >= o.length) o = void 0;
-            return { value: o && o[i++], done: !o };
-        }
-    };
-};
-define(["require", "exports", "jquery", "TYPO3/CMS/Backend/Modal", "TYPO3/CMS/Backend/Severity", "bootstrap"], function (require, exports, $, Modal, Severity) {
-    "use strict";
-    Object.defineProperty(exports, "__esModule", { value: true });
-    /**
-     * Module: TYPO3/CMS/Backend/GridEditor
-     * @exports TYPO3/CMS/Backend/GridEditor
-     */
-    var GridEditor = (function () {
-        /**
-         *
-         * @param {GridEditorConfigurationInterface} config
-         */
-        function GridEditor(config) {
-            if (config === void 0) { config = null; }
-            var _this = this;
-            this.colCount = 1;
-            this.rowCount = 1;
-            this.nameLabel = 'name';
-            this.columnLabel = 'columen label';
-            this.defaultCell = { spanned: 0, rowspan: 1, colspan: 1, name: '', colpos: '', column: undefined };
-            this.selectorEditor = '.t3js-grideditor';
-            this.selectorAddColumn = '.t3js-grideditor-addcolumn';
-            this.selectorRemoveColumn = '.t3js-grideditor-removecolumn';
-            this.selectorAddRowTop = '.t3js-grideditor-addrow-top';
-            this.selectorRemoveRowTop = '.t3js-grideditor-removerow-top';
-            this.selectorAddRowBottom = '.t3js-grideditor-addrow-bottom';
-            this.selectorRemoveRowBottom = '.t3js-grideditor-removerow-bottom';
-            this.selectorLinkEditor = '.t3js-grideditor-link-editor';
-            this.selectorLinkExpandRight = '.t3js-grideditor-link-expand-right';
-            this.selectorLinkShrinkLeft = '.t3js-grideditor-link-shrink-left';
-            this.selectorLinkExpandDown = '.t3js-grideditor-link-expand-down';
-            this.selectorLinkShrinkUp = '.t3js-grideditor-link-shrink-up';
-            this.selectorDocHeaderSave = '.t3js-grideditor-savedok';
-            this.selectorDocHeaderSaveClose = '.t3js-grideditor-savedokclose';
-            this.selectorConfigPreview = '.t3js-grideditor-preview-config';
-            this.selectorConfigPreviewButton = '.t3js-grideditor-preview-button';
-            /**
-             *
-             * @param {Event} e
-             */
-            this.modalButtonClickHandler = function (e) {
-                var button = e.target;
-                if (button.name === 'cancel') {
-                    Modal.currentModal.trigger('modal-dismiss');
-                }
-                else if (button.name === 'ok') {
-                    _this.setName(Modal.currentModal.find('.t3js-grideditor-field-name').val(), Modal.currentModal.data('col'), Modal.currentModal.data('row'));
-                    _this.setColumn(Modal.currentModal.find('.t3js-grideditor-field-colpos').val(), Modal.currentModal.data('col'), Modal.currentModal.data('row'));
-                    _this.drawTable();
-                    _this.writeConfig(_this.export2LayoutRecord());
-                    Modal.currentModal.trigger('modal-dismiss');
-                }
-            };
-            /**
-             *
-             * @param {Event} e
-             */
-            this.addColumnHandler = function (e) {
-                e.preventDefault();
-                _this.addColumn();
-                _this.drawTable();
-                _this.writeConfig(_this.export2LayoutRecord());
-            };
-            /**
-             *
-             * @param {Event} e
-             */
-            this.removeColumnHandler = function (e) {
-                e.preventDefault();
-                _this.removeColumn();
-                _this.drawTable();
-                _this.writeConfig(_this.export2LayoutRecord());
-            };
-            /**
-             *
-             * @param {Event} e
-             */
-            this.addRowTopHandler = function (e) {
-                e.preventDefault();
-                _this.addRowTop();
-                _this.drawTable();
-                _this.writeConfig(_this.export2LayoutRecord());
-            };
-            /**
-             *
-             * @param {Event} e
-             */
-            this.addRowBottomHandler = function (e) {
-                e.preventDefault();
-                _this.addRowBottom();
-                _this.drawTable();
-                _this.writeConfig(_this.export2LayoutRecord());
-            };
-            /**
-             *
-             * @param {Event} e
-             */
-            this.removeRowTopHandler = function (e) {
-                e.preventDefault();
-                _this.removeRowTop();
-                _this.drawTable();
-                _this.writeConfig(_this.export2LayoutRecord());
-            };
-            /**
-             *
-             * @param {Event} e
-             */
-            this.removeRowBottomHandler = function (e) {
-                e.preventDefault();
-                _this.removeRowBottom();
-                _this.drawTable();
-                _this.writeConfig(_this.export2LayoutRecord());
-            };
-            /**
-             *
-             * @param {Event} e
-             */
-            this.linkEditorHandler = function (e) {
-                e.preventDefault();
-                var $element = $(e.target);
-                _this.showOptions($element.data('col'), $element.data('row'));
-            };
-            /**
-             *
-             * @param {Event} e
-             */
-            this.linkExpandRightHandler = function (e) {
-                e.preventDefault();
-                var $element = $(e.target);
-                _this.addColspan($element.data('col'), $element.data('row'));
-                _this.drawTable();
-                _this.writeConfig(_this.export2LayoutRecord());
-            };
-            /**
-             *
-             * @param {Event} e
-             */
-            this.linkShrinkLeftHandler = function (e) {
-                e.preventDefault();
-                var $element = $(e.target);
-                _this.removeColspan($element.data('col'), $element.data('row'));
-                _this.drawTable();
-                _this.writeConfig(_this.export2LayoutRecord());
-            };
-            /**
-             *
-             * @param {Event} e
-             */
-            this.linkExpandDownHandler = function (e) {
-                e.preventDefault();
-                var $element = $(e.target);
-                _this.addRowspan($element.data('col'), $element.data('row'));
-                _this.drawTable();
-                _this.writeConfig(_this.export2LayoutRecord());
-            };
-            /**
-             *
-             * @param {Event} e
-             */
-            this.linkShrinkUpHandler = function (e) {
-                e.preventDefault();
-                var $element = $(e.target);
-                _this.removeRowspan($element.data('col'), $element.data('row'));
-                _this.drawTable();
-                _this.writeConfig(_this.export2LayoutRecord());
-            };
-            /**
-             *
-             * @param {Event} e
-             */
-            this.configPreviewButtonHandler = function (e) {
-                e.preventDefault();
-                var $preview = $(_this.selectorConfigPreview);
-                var $button = $(_this.selectorConfigPreviewButton);
-                if ($preview.is(':visible')) {
-                    $button.empty().append(TYPO3.lang['button.showPageTsConfig']);
-                    $(_this.selectorConfigPreview).slideUp();
-                }
-                else {
-                    $button.empty().append(TYPO3.lang['button.hidePageTsConfig']);
-                    $(_this.selectorConfigPreview).slideDown();
-                }
-            };
-            var $element = $(this.selectorEditor);
-            this.colCount = $element.data('colcount');
-            this.rowCount = $element.data('rowcount');
-            this.field = $('input[name="' + $element.data('field') + '"]');
-            this.data = $element.data('data');
-            this.nameLabel = config !== null ? config.nameLabel : 'Name';
-            this.columnLabel = config !== null ? config.columnLabel : 'Column';
-            this.targetElement = $(this.selectorEditor);
-            $(this.selectorConfigPreview).hide();
-            $(this.selectorConfigPreviewButton).empty().append(TYPO3.lang['button.showPageTsConfig']);
-            this.initializeEvents();
-            this.drawTable();
-            this.writeConfig(this.export2LayoutRecord());
-        }
-        /**
-         * Remove all markup
-         *
-         * @param {String} input
-         * @returns {string}
-         */
-        GridEditor.stripMarkup = function (input) {
-            input = input.replace(/<(.*)>/gi, '');
-            return $('<p>' + input + '</p>').text();
-        };
-        /**
-         *
-         */
-        GridEditor.prototype.initializeEvents = function () {
-            $(document).on('click', this.selectorAddColumn, this.addColumnHandler);
-            $(document).on('click', this.selectorRemoveColumn, this.removeColumnHandler);
-            $(document).on('click', this.selectorAddRowTop, this.addRowTopHandler);
-            $(document).on('click', this.selectorAddRowBottom, this.addRowBottomHandler);
-            $(document).on('click', this.selectorRemoveRowTop, this.removeRowTopHandler);
-            $(document).on('click', this.selectorRemoveRowBottom, this.removeRowBottomHandler);
-            $(document).on('click', this.selectorLinkEditor, this.linkEditorHandler);
-            $(document).on('click', this.selectorLinkExpandRight, this.linkExpandRightHandler);
-            $(document).on('click', this.selectorLinkShrinkLeft, this.linkShrinkLeftHandler);
-            $(document).on('click', this.selectorLinkExpandDown, this.linkExpandDownHandler);
-            $(document).on('click', this.selectorLinkShrinkUp, this.linkShrinkUpHandler);
-            $(document).on('click', this.selectorConfigPreviewButton, this.configPreviewButtonHandler);
-        };
-        /**
-         * Create a new cell from defaultCell
-         * @returns {Object}
-         */
-        GridEditor.prototype.getNewCell = function () {
-            return $.extend({}, this.defaultCell);
-        };
-        /**
-         * write data back to hidden field
-         *
-         * @param data
-         */
-        GridEditor.prototype.writeConfig = function (data) {
-            this.field.val(data);
-            var configLines = data.split('\n');
-            var config = '';
-            try {
-                for (var configLines_1 = __values(configLines), configLines_1_1 = configLines_1.next(); !configLines_1_1.done; configLines_1_1 = configLines_1.next()) {
-                    var line = configLines_1_1.value;
-                    if (line) {
-                        config += '\t\t\t' + line + '\n';
-                    }
-                }
-            }
-            catch (e_1_1) { e_1 = { error: e_1_1 }; }
-            finally {
-                try {
-                    if (configLines_1_1 && !configLines_1_1.done && (_a = configLines_1.return)) _a.call(configLines_1);
-                }
-                finally { if (e_1) throw e_1.error; }
-            }
-            $(this.selectorConfigPreview).find('code').empty().append('mod.web_layout.BackendLayouts {\n' +
-                '  exampleKey {\n' +
-                '    title = Example\n' +
-                '    icon = EXT:example_extension/Resources/Public/Images/BackendLayouts/default.gif\n' +
-                '    config {\n' +
-                config.replace(new RegExp('\t', 'g'), '  ') +
-                '    }\n' +
-                '  }\n' +
-                '}\n');
-            var e_1, _a;
-        };
-        /**
-         * Add a new row at the top
-         */
-        GridEditor.prototype.addRowTop = function () {
-            var newRow = [];
-            for (var i = 0; i < this.colCount; i++) {
-                var newCell = this.getNewCell();
-                newCell.name = i + 'x' + this.data.length;
-                newRow[i] = newCell;
-            }
-            this.data.unshift(newRow);
-            this.rowCount++;
-        };
-        /**
-         * Add a new row at the bottom
-         */
-        GridEditor.prototype.addRowBottom = function () {
-            var newRow = [];
-            for (var i = 0; i < this.colCount; i++) {
-                var newCell = this.getNewCell();
-                newCell.name = i + 'x' + this.data.length;
-                newRow[i] = newCell;
-            }
-            this.data.push(newRow);
-            this.rowCount++;
-        };
-        /**
-         * Removes the first row of the grid and adjusts all cells that might be effected
-         * by that change. (Removing colspans)
-         */
-        GridEditor.prototype.removeRowTop = function () {
-            if (this.rowCount <= 1) {
-                return false;
-            }
-            var newData = [];
-            for (var rowIndex = 1; rowIndex < this.rowCount; rowIndex++) {
-                newData.push(this.data[rowIndex]);
-            }
-            // fix rowspan in former last row
-            for (var colIndex = 0; colIndex < this.colCount; colIndex++) {
-                if (this.data[0][colIndex].spanned === 1) {
-                    this.findUpperCellWidthRowspanAndDecreaseByOne(colIndex, 0);
-                }
-            }
-            this.data = newData;
-            this.rowCount--;
-            return true;
-        };
-        /**
-         * Removes the last row of the grid and adjusts all cells that might be effected
-         * by that change. (Removing colspans)
-         */
-        GridEditor.prototype.removeRowBottom = function () {
-            if (this.rowCount <= 1) {
-                return false;
-            }
-            var newData = [];
-            for (var rowIndex = 0; rowIndex < this.rowCount - 1; rowIndex++) {
-                newData.push(this.data[rowIndex]);
-            }
-            // fix rowspan in former last row
-            for (var colIndex = 0; colIndex < this.colCount; colIndex++) {
-                if (this.data[this.rowCount - 1][colIndex].spanned === 1) {
-                    this.findUpperCellWidthRowspanAndDecreaseByOne(colIndex, this.rowCount - 1);
-                }
-            }
-            this.data = newData;
-            this.rowCount--;
-            return true;
-        };
-        /**
-         * Takes a cell and looks above it if there are any cells that have colspans that
-         * spans into the given cell. This is used when a row was removed from the grid
-         * to make sure that no cell with wrong colspans exists in the grid.
-         *
-         * @param {number} col
-         * @param {number} row integer
-         */
-        GridEditor.prototype.findUpperCellWidthRowspanAndDecreaseByOne = function (col, row) {
-            var upperCell = this.getCell(col, row - 1);
-            if (!upperCell) {
-                return false;
-            }
-            if (upperCell.spanned === 1) {
-                this.findUpperCellWidthRowspanAndDecreaseByOne(col, row - 1);
-            }
-            else {
-                if (upperCell.rowspan > 1) {
-                    this.removeRowspan(col, row - 1);
-                }
-            }
-            return true;
-        };
-        /**
-         * Removes the outermost right column from the grid.
-         */
-        GridEditor.prototype.removeColumn = function () {
-            if (this.colCount <= 1) {
-                return false;
-            }
-            var newData = [];
-            for (var rowIndex = 0; rowIndex < this.rowCount; rowIndex++) {
-                var newRow = [];
-                for (var colIndex = 0; colIndex < this.colCount - 1; colIndex++) {
-                    newRow.push(this.data[rowIndex][colIndex]);
-                }
-                if (this.data[rowIndex][this.colCount - 1].spanned === 1) {
-                    this.findLeftCellWidthColspanAndDecreaseByOne(this.colCount - 1, rowIndex);
-                }
-                newData.push(newRow);
-            }
-            this.data = newData;
-            this.colCount--;
-            return true;
-        };
-        /**
-         * Checks if there are any cells on the left side of a given cell with a
-         * rowspan that spans over the given cell.
-         *
-         * @param {number} col
-         * @param {number} row
-         */
-        GridEditor.prototype.findLeftCellWidthColspanAndDecreaseByOne = function (col, row) {
-            var leftCell = this.getCell(col - 1, row);
-            if (!leftCell) {
-                return false;
-            }
-            if (leftCell.spanned === 1) {
-                this.findLeftCellWidthColspanAndDecreaseByOne(col - 1, row);
-            }
-            else {
-                if (leftCell.colspan > 1) {
-                    this.removeColspan(col - 1, row);
-                }
-            }
-            return true;
-        };
-        /**
-         * Adds a column at the right side of the grid.
-         */
-        GridEditor.prototype.addColumn = function () {
-            for (var rowIndex = 0; rowIndex < this.rowCount; rowIndex++) {
-                var newCell = this.getNewCell();
-                newCell.name = this.colCount + 'x' + rowIndex;
-                this.data[rowIndex].push(newCell);
-            }
-            this.colCount++;
-        };
-        /**
-         * Draws the grid as table into a given container.
-         * It also adds all needed links and bindings to the cells to make it editable.
-         */
-        GridEditor.prototype.drawTable = function () {
-            var $colgroup = $('<colgroup>');
-            for (var col = 0; col < this.colCount; col++) {
-                var percent = 100 / this.colCount;
-                $colgroup.append($('<col>').css({
-                    width: parseInt(percent.toString(), 10) + '%',
-                }));
-            }
-            var $table = $('<table id="base" class="table editor">');
-            $table.append($colgroup);
-            for (var row = 0; row < this.rowCount; row++) {
-                var rowData = this.data[row];
-                if (rowData.length === 0) {
-                    continue;
-                }
-                var $row = $('<tr>');
-                for (var col = 0; col < this.colCount; col++) {
-                    var cell = this.data[row][col];
-                    if (cell.spanned === 1) {
-                        continue;
-                    }
-                    var percentRow = 100 / this.rowCount;
-                    var percentCol = 100 / this.colCount;
-                    var $cell = $('<td>').css({
-                        height: parseInt(percentRow.toString(), 10) * cell.rowspan + '%',
-                        width: parseInt(percentCol.toString(), 10) * cell.colspan + '%',
-                    });
-                    var $container = $('<div class="cell_container">');
-                    $cell.append($container);
-                    var $anchor = $('<a href="#" data-col="' + col + '" data-row="' + row + '">');
-                    $container.append($anchor
-                        .clone()
-                        .attr('class', 't3js-grideditor-link-editor link link_editor')
-                        .attr('title', TYPO3.lang.grid_editCell));
-                    if (this.cellCanSpanRight(col, row)) {
-                        $container.append($anchor
-                            .clone()
-                            .attr('class', 't3js-grideditor-link-expand-right link link_expand_right')
-                            .attr('title', TYPO3.lang.grid_mergeCell));
-                    }
-                    if (this.cellCanShrinkLeft(col, row)) {
-                        $container.append($anchor
-                            .clone()
-                            .attr('class', 't3js-grideditor-link-shrink-left link link_shrink_left')
-                            .attr('title', TYPO3.lang.grid_splitCell));
-                    }
-                    if (this.cellCanSpanDown(col, row)) {
-                        $container.append($anchor
-                            .clone()
-                            .attr('class', 't3js-grideditor-link-expand-down link link_expand_down')
-                            .attr('title', TYPO3.lang.grid_mergeCell));
-                    }
-                    if (this.cellCanShrinkUp(col, row)) {
-                        $container.append($anchor
-                            .clone()
-                            .attr('class', 't3js-grideditor-link-shrink-up link link_shrink_up')
-                            .attr('title', TYPO3.lang.grid_splitCell));
-                    }
-                    $cell.append($('<div class="cell_data">')
-                        .html(TYPO3.lang.grid_name + ': '
-                        + (cell.name ? GridEditor.stripMarkup(cell.name) : TYPO3.lang.grid_notSet)
-                        + '<br />'
-                        + TYPO3.lang.grid_column + ': '
-                        + (typeof cell.column === 'undefined' || isNaN(cell.column)
-                            ? TYPO3.lang.grid_notSet
-                            : parseInt(cell.column, 10))));
-                    if (cell.colspan > 1) {
-                        $cell.attr('colspan', cell.colspan);
-                    }
-                    if (cell.rowspan > 1) {
-                        $cell.attr('rowspan', cell.rowspan);
-                    }
-                    $row.append($cell);
-                }
-                $table.append($row);
-            }
-            $(this.targetElement).empty().append($table);
-        };
-        /**
-         * Sets the name of a certain grid element.
-         *
-         * @param {String} newName
-         * @param {number} col
-         * @param {number} row
-         *
-         * @returns {Boolean}
-         */
-        GridEditor.prototype.setName = function (newName, col, row) {
-            var cell = this.getCell(col, row);
-            if (!cell) {
-                return false;
-            }
-            cell.name = GridEditor.stripMarkup(newName);
-            return true;
-        };
-        /**
-         * Sets the column field for a certain grid element. This is NOT the column of the
-         * element itself.
-         *
-         * @param {number} newColumn
-         * @param {number} col
-         * @param {number} row
-         *
-         * @returns {Boolean}
-         */
-        GridEditor.prototype.setColumn = function (newColumn, col, row) {
-            var cell = this.getCell(col, row);
-            if (!cell) {
-                return false;
-            }
-            cell.column = parseInt(newColumn.toString(), 10);
-            return true;
-        };
-        /**
-         * Creates an ExtJs Window with two input fields and shows it. On save, the data
-         * is written into the grid element.
-         *
-         * @param {number} col
-         * @param {number} row
-         *
-         * @returns {Boolean}
-         */
-        GridEditor.prototype.showOptions = function (col, row) {
-            var cell = this.getCell(col, row);
-            if (!cell) {
-                return false;
-            }
-            var colPos;
-            if (cell.column === 0) {
-                colPos = 0;
-            }
-            else if (cell.column) {
-                colPos = parseInt(cell.column.toString(), 10);
-            }
-            else {
-                colPos = '';
-            }
-            var $markup = $('<div>');
-            var $formGroup = $('<div class="form-group">');
-            var $label = $('<label>');
-            var $input = $('<input>');
-            $markup.append([
-                $formGroup
-                    .clone()
-                    .append([
-                    $label
-                        .clone()
-                        .text(TYPO3.lang.grid_nameHelp),
-                    $input
-                        .clone()
-                        .attr('type', 'text')
-                        .attr('class', 't3js-grideditor-field-name form-control')
-                        .attr('name', 'name')
-                        .val(GridEditor.stripMarkup(cell.name) || ''),
-                ]),
-                $formGroup
-                    .clone()
-                    .append([
-                    $label
-                        .clone()
-                        .text(TYPO3.lang.grid_columnHelp),
-                    $input
-                        .clone()
-                        .attr('type', 'text')
-                        .attr('class', 't3js-grideditor-field-colpos form-control')
-                        .attr('name', 'column')
-                        .val(colPos),
-                ]),
-            ]);
-            var $modal = Modal.show(TYPO3.lang.grid_windowTitle, $markup, Severity.notice, [
-                {
-                    active: true,
-                    btnClass: 'btn-default',
-                    name: 'cancel',
-                    text: $(this).data('button-close-text') || TYPO3.lang['button.cancel'] || 'Cancel',
-                },
-                {
-                    btnClass: 'btn-primary',
-                    name: 'ok',
-                    text: $(this).data('button-ok-text') || TYPO3.lang['button.ok'] || 'OK',
-                },
-            ]);
-            $modal.data('col', col);
-            $modal.data('row', row);
-            $modal.on('button.clicked', this.modalButtonClickHandler);
-            return true;
-        };
-        /**
-         * Returns a cell element from the grid.
-         *
-         * @param {number} col
-         * @param {number} row
-         */
-        GridEditor.prototype.getCell = function (col, row) {
-            if (col > this.colCount - 1) {
-                return false;
-            }
-            if (row > this.rowCount - 1) {
-                return false;
-            }
-            if (this.data.length > row - 1 && this.data[row].length > col - 1) {
-                return this.data[row][col];
-            }
-            return null;
-        };
-        /**
-         * Checks whether a cell can span to the right or not. A cell can span to the right
-         * if it is not in the last column and if there is no cell beside it that is
-         * already overspanned by some other cell.
-         *
-         * @param {number} col
-         * @param {number} row
-         * @returns {Boolean}
-         */
-        GridEditor.prototype.cellCanSpanRight = function (col, row) {
-            if (col === this.colCount - 1) {
-                return false;
-            }
-            var cell = this.getCell(col, row);
-            var checkCell;
-            if (cell.rowspan > 1) {
-                for (var rowIndex = row; rowIndex < row + cell.rowspan; rowIndex++) {
-                    checkCell = this.getCell(col + cell.colspan, rowIndex);
-                    if (!checkCell || checkCell.spanned === 1 || checkCell.colspan > 1 || checkCell.rowspan > 1) {
-                        return false;
-                    }
-                }
-            }
-            else {
-                checkCell = this.getCell(col + cell.colspan, row);
-                if (!checkCell || cell.spanned === 1 || checkCell.spanned === 1 || checkCell.colspan > 1
-                    || checkCell.rowspan > 1) {
-                    return false;
-                }
-            }
-            return true;
-        };
-        /**
-         * Checks whether a cell can span down or not.
-         *
-         * @param {number} col
-         * @param {number} row
-         * @returns {Boolean}
-         */
-        GridEditor.prototype.cellCanSpanDown = function (col, row) {
-            if (row === this.rowCount - 1) {
-                return false;
-            }
-            var cell = this.getCell(col, row);
-            var checkCell;
-            if (cell.colspan > 1) {
-                // we have to check all cells on the right side for the complete colspan
-                for (var colIndex = col; colIndex < col + cell.colspan; colIndex++) {
-                    checkCell = this.getCell(colIndex, row + cell.rowspan);
-                    if (!checkCell || checkCell.spanned === 1 || checkCell.colspan > 1 || checkCell.rowspan > 1) {
-                        return false;
-                    }
-                }
-            }
-            else {
-                checkCell = this.getCell(col, row + cell.rowspan);
-                if (!checkCell || cell.spanned === 1 || checkCell.spanned === 1 || checkCell.colspan > 1
-                    || checkCell.rowspan > 1) {
-                    return false;
-                }
-            }
-            return true;
-        };
-        /**
-         * Checks if a cell can shrink to the left. It can shrink if the colspan of the
-         * cell is bigger than 1.
-         *
-         * @param {number} col
-         * @param {number} row
-         * @returns {Boolean}
-         */
-        GridEditor.prototype.cellCanShrinkLeft = function (col, row) {
-            return (this.data[row][col].colspan > 1);
-        };
-        /**
-         * Returns if a cell can shrink up. This is the case if a cell has at least
-         * a rowspan of 2.
-         *
-         * @param {number} col
-         * @param {number} row
-         * @returns {Boolean}
-         */
-        GridEditor.prototype.cellCanShrinkUp = function (col, row) {
-            return (this.data[row][col].rowspan > 1);
-        };
-        /**
-         * Adds a colspan to a grid element.
-         *
-         * @param {number} col
-         * @param {number} row
-         * @returns {Boolean}
-         */
-        GridEditor.prototype.addColspan = function (col, row) {
-            var cell = this.getCell(col, row);
-            if (!cell || !this.cellCanSpanRight(col, row)) {
-                return false;
-            }
-            for (var rowIndex = row; rowIndex < row + cell.rowspan; rowIndex++) {
-                this.data[rowIndex][col + cell.colspan].spanned = 1;
-            }
-            cell.colspan += 1;
-            return true;
-        };
-        /**
-         * Adds a rowspan to grid element.
-         *
-         * @param {number} col
-         * @param {number} row
-         * @returns {Boolean}
-         */
-        GridEditor.prototype.addRowspan = function (col, row) {
-            var cell = this.getCell(col, row);
-            if (!cell || !this.cellCanSpanDown(col, row)) {
-                return false;
-            }
-            for (var colIndex = col; colIndex < col + cell.colspan; colIndex++) {
-                this.data[row + cell.rowspan][colIndex].spanned = 1;
-            }
-            cell.rowspan += 1;
-            return true;
-        };
-        /**
-         * Removes a colspan from a grid element.
-         *
-         * @param {number} col
-         * @param {number} row
-         * @returns {Boolean}
-         */
-        GridEditor.prototype.removeColspan = function (col, row) {
-            var cell = this.getCell(col, row);
-            if (!cell || !this.cellCanShrinkLeft(col, row)) {
-                return false;
-            }
-            cell.colspan -= 1;
-            for (var rowIndex = row; rowIndex < row + cell.rowspan; rowIndex++) {
-                this.data[rowIndex][col + cell.colspan].spanned = 0;
-            }
-            return true;
-        };
-        /**
-         * Removes a rowspan from a grid element.
-         *
-         * @param {number} col
-         * @param {number} row
-         * @returns {Boolean}
-         */
-        GridEditor.prototype.removeRowspan = function (col, row) {
-            var cell = this.getCell(col, row);
-            if (!cell || !this.cellCanShrinkUp(col, row)) {
-                return false;
-            }
-            cell.rowspan -= 1;
-            for (var colIndex = col; colIndex < col + cell.colspan; colIndex++) {
-                this.data[row + cell.rowspan][colIndex].spanned = 0;
-            }
-            return true;
-        };
-        /**
-         * Exports the current grid to a TypoScript notation that can be read by the
-         * page module and is human readable.
-         *
-         * @returns {String}
-         */
-        GridEditor.prototype.export2LayoutRecord = function () {
-            var result = 'backend_layout {\n\tcolCount = ' + this.colCount + '\n\trowCount = ' + this.rowCount + '\n\trows {\n';
-            for (var row = 0; row < this.rowCount; row++) {
-                result += '\t\t' + (row + 1) + ' {\n';
-                result += '\t\t\tcolumns {\n';
-                var colIndex = 0;
-                for (var col = 0; col < this.colCount; col++) {
-                    var cell = this.getCell(col, row);
-                    if (cell) {
-                        if (!cell.spanned) {
-                            colIndex++;
-                            result += '\t\t\t\t' + (colIndex) + ' {\n';
-                            result += '\t\t\t\t\tname = ' + ((!cell.name) ? col + 'x' + row : cell.name) + '\n';
-                            if (cell.colspan > 1) {
-                                result += '\t\t\t\t\tcolspan = ' + cell.colspan + '\n';
-                            }
-                            if (cell.rowspan > 1) {
-                                result += '\t\t\t\t\trowspan = ' + cell.rowspan + '\n';
-                            }
-                            if (typeof (cell.column) === 'number') {
-                                result += '\t\t\t\t\tcolPos = ' + cell.column + '\n';
-                            }
-                            result += '\t\t\t\t}\n';
-                        }
-                    }
-                }
-                result += '\t\t\t}\n';
-                result += '\t\t}\n';
-            }
-            result += '\t}\n}\n';
-            return result;
-        };
-        return GridEditor;
-    }());
-    exports.GridEditor = GridEditor;
-});
+var __values=this&&this.__values||function(a){var b="function"==typeof Symbol&&a[Symbol.iterator],c=0;return b?b.call(a):{next:function(){return a&&c>=a.length&&(a=void 0),{value:a&&a[c++],done:!a}}}};define(["require","exports","jquery","TYPO3/CMS/Backend/Modal","TYPO3/CMS/Backend/Severity","bootstrap"],function(a,b,c,d,e){"use strict";Object.defineProperty(b,"__esModule",{value:!0});var f=function(){function a(a){void 0===a&&(a=null);var b=this;this.colCount=1,this.rowCount=1,this.nameLabel="name",this.columnLabel="columen label",this.defaultCell={spanned:0,rowspan:1,colspan:1,name:"",colpos:"",column:void 0},this.selectorEditor=".t3js-grideditor",this.selectorAddColumn=".t3js-grideditor-addcolumn",this.selectorRemoveColumn=".t3js-grideditor-removecolumn",this.selectorAddRowTop=".t3js-grideditor-addrow-top",this.selectorRemoveRowTop=".t3js-grideditor-removerow-top",this.selectorAddRowBottom=".t3js-grideditor-addrow-bottom",this.selectorRemoveRowBottom=".t3js-grideditor-removerow-bottom",this.selectorLinkEditor=".t3js-grideditor-link-editor",this.selectorLinkExpandRight=".t3js-grideditor-link-expand-right",this.selectorLinkShrinkLeft=".t3js-grideditor-link-shrink-left",this.selectorLinkExpandDown=".t3js-grideditor-link-expand-down",this.selectorLinkShrinkUp=".t3js-grideditor-link-shrink-up",this.selectorDocHeaderSave=".t3js-grideditor-savedok",this.selectorDocHeaderSaveClose=".t3js-grideditor-savedokclose",this.selectorConfigPreview=".t3js-grideditor-preview-config",this.selectorConfigPreviewButton=".t3js-grideditor-preview-button",this.modalButtonClickHandler=function(a){var c=a.target;"cancel"===c.name?d.currentModal.trigger("modal-dismiss"):"ok"===c.name&&(b.setName(d.currentModal.find(".t3js-grideditor-field-name").val(),d.currentModal.data("col"),d.currentModal.data("row")),b.setColumn(d.currentModal.find(".t3js-grideditor-field-colpos").val(),d.currentModal.data("col"),d.currentModal.data("row")),b.drawTable(),b.writeConfig(b.export2LayoutRecord()),d.currentModal.trigger("modal-dismiss"))},this.addColumnHandler=function(a){a.preventDefault(),b.addColumn(),b.drawTable(),b.writeConfig(b.export2LayoutRecord())},this.removeColumnHandler=function(a){a.preventDefault(),b.removeColumn(),b.drawTable(),b.writeConfig(b.export2LayoutRecord())},this.addRowTopHandler=function(a){a.preventDefault(),b.addRowTop(),b.drawTable(),b.writeConfig(b.export2LayoutRecord())},this.addRowBottomHandler=function(a){a.preventDefault(),b.addRowBottom(),b.drawTable(),b.writeConfig(b.export2LayoutRecord())},this.removeRowTopHandler=function(a){a.preventDefault(),b.removeRowTop(),b.drawTable(),b.writeConfig(b.export2LayoutRecord())},this.removeRowBottomHandler=function(a){a.preventDefault(),b.removeRowBottom(),b.drawTable(),b.writeConfig(b.export2LayoutRecord())},this.linkEditorHandler=function(a){a.preventDefault();var d=c(a.target);b.showOptions(d.data("col"),d.data("row"))},this.linkExpandRightHandler=function(a){a.preventDefault();var d=c(a.target);b.addColspan(d.data("col"),d.data("row")),b.drawTable(),b.writeConfig(b.export2LayoutRecord())},this.linkShrinkLeftHandler=function(a){a.preventDefault();var d=c(a.target);b.removeColspan(d.data("col"),d.data("row")),b.drawTable(),b.writeConfig(b.export2LayoutRecord())},this.linkExpandDownHandler=function(a){a.preventDefault();var d=c(a.target);b.addRowspan(d.data("col"),d.data("row")),b.drawTable(),b.writeConfig(b.export2LayoutRecord())},this.linkShrinkUpHandler=function(a){a.preventDefault();var d=c(a.target);b.removeRowspan(d.data("col"),d.data("row")),b.drawTable(),b.writeConfig(b.export2LayoutRecord())},this.configPreviewButtonHandler=function(a){a.preventDefault();var d=c(b.selectorConfigPreview),e=c(b.selectorConfigPreviewButton);d.is(":visible")?(e.empty().append(TYPO3.lang["button.showPageTsConfig"]),c(b.selectorConfigPreview).slideUp()):(e.empty().append(TYPO3.lang["button.hidePageTsConfig"]),c(b.selectorConfigPreview).slideDown())};var e=c(this.selectorEditor);this.colCount=e.data("colcount"),this.rowCount=e.data("rowcount"),this.field=c('input[name="'+e.data("field")+'"]'),this.data=e.data("data"),this.nameLabel=null!==a?a.nameLabel:"Name",this.columnLabel=null!==a?a.columnLabel:"Column",this.targetElement=c(this.selectorEditor),c(this.selectorConfigPreview).hide(),c(this.selectorConfigPreviewButton).empty().append(TYPO3.lang["button.showPageTsConfig"]),this.initializeEvents(),this.drawTable(),this.writeConfig(this.export2LayoutRecord())}return a.stripMarkup=function(a){return a=a.replace(/<(.*)>/gi,""),c("<p>"+a+"</p>").text()},a.prototype.initializeEvents=function(){c(document).on("click",this.selectorAddColumn,this.addColumnHandler),c(document).on("click",this.selectorRemoveColumn,this.removeColumnHandler),c(document).on("click",this.selectorAddRowTop,this.addRowTopHandler),c(document).on("click",this.selectorAddRowBottom,this.addRowBottomHandler),c(document).on("click",this.selectorRemoveRowTop,this.removeRowTopHandler),c(document).on("click",this.selectorRemoveRowBottom,this.removeRowBottomHandler),c(document).on("click",this.selectorLinkEditor,this.linkEditorHandler),c(document).on("click",this.selectorLinkExpandRight,this.linkExpandRightHandler),c(document).on("click",this.selectorLinkShrinkLeft,this.linkShrinkLeftHandler),c(document).on("click",this.selectorLinkExpandDown,this.linkExpandDownHandler),c(document).on("click",this.selectorLinkShrinkUp,this.linkShrinkUpHandler),c(document).on("click",this.selectorConfigPreviewButton,this.configPreviewButtonHandler)},a.prototype.getNewCell=function(){return c.extend({},this.defaultCell)},a.prototype.writeConfig=function(a){this.field.val(a);var b=a.split("\n"),d="";try{for(var e=__values(b),f=e.next();!f.done;f=e.next()){var g=f.value;g&&(d+="\t\t\t"+g+"\n")}}catch(a){h={error:a}}finally{try{f&&!f.done&&(i=e.return)&&i.call(e)}finally{if(h)throw h.error}}c(this.selectorConfigPreview).find("code").empty().append("mod.web_layout.BackendLayouts {\n  exampleKey {\n    title = Example\n    icon = EXT:example_extension/Resources/Public/Images/BackendLayouts/default.gif\n    config {\n"+d.replace(new RegExp("\t","g"),"  ")+"    }\n  }\n}\n");var h,i},a.prototype.addRowTop=function(){for(var a=[],b=0;b<this.colCount;b++){var c=this.getNewCell();c.name=b+"x"+this.data.length,a[b]=c}this.data.unshift(a),this.rowCount++},a.prototype.addRowBottom=function(){for(var a=[],b=0;b<this.colCount;b++){var c=this.getNewCell();c.name=b+"x"+this.data.length,a[b]=c}this.data.push(a),this.rowCount++},a.prototype.removeRowTop=function(){if(this.rowCount<=1)return!1;for(var a=[],b=1;b<this.rowCount;b++)a.push(this.data[b]);for(var c=0;c<this.colCount;c++)1===this.data[0][c].spanned&&this.findUpperCellWidthRowspanAndDecreaseByOne(c,0);return this.data=a,this.rowCount--,!0},a.prototype.removeRowBottom=function(){if(this.rowCount<=1)return!1;for(var a=[],b=0;b<this.rowCount-1;b++)a.push(this.data[b]);for(var c=0;c<this.colCount;c++)1===this.data[this.rowCount-1][c].spanned&&this.findUpperCellWidthRowspanAndDecreaseByOne(c,this.rowCount-1);return this.data=a,this.rowCount--,!0},a.prototype.findUpperCellWidthRowspanAndDecreaseByOne=function(a,b){var c=this.getCell(a,b-1);return!!c&&(1===c.spanned?this.findUpperCellWidthRowspanAndDecreaseByOne(a,b-1):c.rowspan>1&&this.removeRowspan(a,b-1),!0)},a.prototype.removeColumn=function(){if(this.colCount<=1)return!1;for(var a=[],b=0;b<this.rowCount;b++){for(var c=[],d=0;d<this.colCount-1;d++)c.push(this.data[b][d]);1===this.data[b][this.colCount-1].spanned&&this.findLeftCellWidthColspanAndDecreaseByOne(this.colCount-1,b),a.push(c)}return this.data=a,this.colCount--,!0},a.prototype.findLeftCellWidthColspanAndDecreaseByOne=function(a,b){var c=this.getCell(a-1,b);return!!c&&(1===c.spanned?this.findLeftCellWidthColspanAndDecreaseByOne(a-1,b):c.colspan>1&&this.removeColspan(a-1,b),!0)},a.prototype.addColumn=function(){for(var a=0;a<this.rowCount;a++){var b=this.getNewCell();b.name=this.colCount+"x"+a,this.data[a].push(b)}this.colCount++},a.prototype.drawTable=function(){for(var b=c("<colgroup>"),d=0;d<this.colCount;d++){var e=100/this.colCount;b.append(c("<col>").css({width:parseInt(e.toString(),10)+"%"}))}var f=c('<table id="base" class="table editor">');f.append(b);for(var g=0;g<this.rowCount;g++){var h=this.data[g];if(0!==h.length){for(var i=c("<tr>"),d=0;d<this.colCount;d++){var j=this.data[g][d];if(1!==j.spanned){var k=100/this.rowCount,l=100/this.colCount,m=c("<td>").css({height:parseInt(k.toString(),10)*j.rowspan+"%",width:parseInt(l.toString(),10)*j.colspan+"%"}),n=c('<div class="cell_container">');m.append(n);var o=c('<a href="#" data-col="'+d+'" data-row="'+g+'">');n.append(o.clone().attr("class","t3js-grideditor-link-editor link link_editor").attr("title",TYPO3.lang.grid_editCell)),this.cellCanSpanRight(d,g)&&n.append(o.clone().attr("class","t3js-grideditor-link-expand-right link link_expand_right").attr("title",TYPO3.lang.grid_mergeCell)),this.cellCanShrinkLeft(d,g)&&n.append(o.clone().attr("class","t3js-grideditor-link-shrink-left link link_shrink_left").attr("title",TYPO3.lang.grid_splitCell)),this.cellCanSpanDown(d,g)&&n.append(o.clone().attr("class","t3js-grideditor-link-expand-down link link_expand_down").attr("title",TYPO3.lang.grid_mergeCell)),this.cellCanShrinkUp(d,g)&&n.append(o.clone().attr("class","t3js-grideditor-link-shrink-up link link_shrink_up").attr("title",TYPO3.lang.grid_splitCell)),m.append(c('<div class="cell_data">').html(TYPO3.lang.grid_name+": "+(j.name?a.stripMarkup(j.name):TYPO3.lang.grid_notSet)+"<br />"+TYPO3.lang.grid_column+": "+("undefined"==typeof j.column||isNaN(j.column)?TYPO3.lang.grid_notSet:parseInt(j.column,10)))),j.colspan>1&&m.attr("colspan",j.colspan),j.rowspan>1&&m.attr("rowspan",j.rowspan),i.append(m)}}f.append(i)}}c(this.targetElement).empty().append(f)},a.prototype.setName=function(b,c,d){var e=this.getCell(c,d);return!!e&&(e.name=a.stripMarkup(b),!0)},a.prototype.setColumn=function(a,b,c){var d=this.getCell(b,c);return!!d&&(d.column=parseInt(a.toString(),10),!0)},a.prototype.showOptions=function(b,f){var g=this.getCell(b,f);if(!g)return!1;var h;h=0===g.column?0:g.column?parseInt(g.column.toString(),10):"";var i=c("<div>"),j=c('<div class="form-group">'),k=c("<label>"),l=c("<input>");i.append([j.clone().append([k.clone().text(TYPO3.lang.grid_nameHelp),l.clone().attr("type","text").attr("class","t3js-grideditor-field-name form-control").attr("name","name").val(a.stripMarkup(g.name)||"")]),j.clone().append([k.clone().text(TYPO3.lang.grid_columnHelp),l.clone().attr("type","text").attr("class","t3js-grideditor-field-colpos form-control").attr("name","column").val(h)])]);var m=d.show(TYPO3.lang.grid_windowTitle,i,e.notice,[{active:!0,btnClass:"btn-default",name:"cancel",text:c(this).data("button-close-text")||TYPO3.lang["button.cancel"]||"Cancel"},{btnClass:"btn-primary",name:"ok",text:c(this).data("button-ok-text")||TYPO3.lang["button.ok"]||"OK"}]);return m.data("col",b),m.data("row",f),m.on("button.clicked",this.modalButtonClickHandler),!0},a.prototype.getCell=function(a,b){return!(a>this.colCount-1)&&(!(b>this.rowCount-1)&&(this.data.length>b-1&&this.data[b].length>a-1?this.data[b][a]:null))},a.prototype.cellCanSpanRight=function(a,b){if(a===this.colCount-1)return!1;var c,d=this.getCell(a,b);if(d.rowspan>1){for(var e=b;e<b+d.rowspan;e++)if(c=this.getCell(a+d.colspan,e),!c||1===c.spanned||c.colspan>1||c.rowspan>1)return!1}else if(c=this.getCell(a+d.colspan,b),!c||1===d.spanned||1===c.spanned||c.colspan>1||c.rowspan>1)return!1;return!0},a.prototype.cellCanSpanDown=function(a,b){if(b===this.rowCount-1)return!1;var c,d=this.getCell(a,b);if(d.colspan>1){for(var e=a;e<a+d.colspan;e++)if(c=this.getCell(e,b+d.rowspan),!c||1===c.spanned||c.colspan>1||c.rowspan>1)return!1}else if(c=this.getCell(a,b+d.rowspan),!c||1===d.spanned||1===c.spanned||c.colspan>1||c.rowspan>1)return!1;return!0},a.prototype.cellCanShrinkLeft=function(a,b){return this.data[b][a].colspan>1},a.prototype.cellCanShrinkUp=function(a,b){return this.data[b][a].rowspan>1},a.prototype.addColspan=function(a,b){var c=this.getCell(a,b);if(!c||!this.cellCanSpanRight(a,b))return!1;for(var d=b;d<b+c.rowspan;d++)this.data[d][a+c.colspan].spanned=1;return c.colspan+=1,!0},a.prototype.addRowspan=function(a,b){var c=this.getCell(a,b);if(!c||!this.cellCanSpanDown(a,b))return!1;for(var d=a;d<a+c.colspan;d++)this.data[b+c.rowspan][d].spanned=1;return c.rowspan+=1,!0},a.prototype.removeColspan=function(a,b){var c=this.getCell(a,b);if(!c||!this.cellCanShrinkLeft(a,b))return!1;c.colspan-=1;for(var d=b;d<b+c.rowspan;d++)this.data[d][a+c.colspan].spanned=0;return!0},a.prototype.removeRowspan=function(a,b){var c=this.getCell(a,b);if(!c||!this.cellCanShrinkUp(a,b))return!1;c.rowspan-=1;for(var d=a;d<a+c.colspan;d++)this.data[b+c.rowspan][d].spanned=0;return!0},a.prototype.export2LayoutRecord=function(){for(var a="backend_layout {\n\tcolCount = "+this.colCount+"\n\trowCount = "+this.rowCount+"\n\trows {\n",b=0;b<this.rowCount;b++){a+="\t\t"+(b+1)+" {\n",a+="\t\t\tcolumns {\n";for(var c=0,d=0;d<this.colCount;d++){var e=this.getCell(d,b);e&&(e.spanned||(c++,a+="\t\t\t\t"+c+" {\n",a+="\t\t\t\t\tname = "+(e.name?e.name:d+"x"+b)+"\n",e.colspan>1&&(a+="\t\t\t\t\tcolspan = "+e.colspan+"\n"),e.rowspan>1&&(a+="\t\t\t\t\trowspan = "+e.rowspan+"\n"),"number"==typeof e.column&&(a+="\t\t\t\t\tcolPos = "+e.column+"\n"),a+="\t\t\t\t}\n"))}a+="\t\t\t}\n",a+="\t\t}\n"}return a+="\t}\n}\n"},a}();b.GridEditor=f});
\ No newline at end of file
index fb4f076..58ad95a 100644 (file)
  *
  * The TYPO3 project - inspiring people to share!
  */
-define(["require", "exports", "jquery", "TYPO3/CMS/Backend/Modal", "TYPO3/CMS/Core/Contrib/imagesloaded.pkgd.min", "jquery-ui/draggable", "jquery-ui/resizable"], function (require, exports, $, Modal, ImagesLoaded) {
-    "use strict";
-    /**
-     * Module: TYPO3/CMS/Backend/ImageManipulation
-     * Contains all logic for the image crop GUI including setting focusAreas
-     * @exports TYPO3/CMS/Backend/ImageManipulation
-     */
-    var ImageManipulation = (function () {
-        function ImageManipulation() {
-            var _this = this;
-            this.cropImageContainerSelector = '#t3js-crop-image-container';
-            this.cropImageSelector = '#t3js-crop-image';
-            this.coverAreaSelector = '.t3js-cropper-cover-area';
-            this.cropInfoSelector = '.t3js-cropper-info-crop';
-            this.focusAreaSelector = '#t3js-cropper-focus-area';
-            this.defaultFocusArea = {
-                height: 1 / 3,
-                width: 1 / 3,
-                x: 0,
-                y: 0,
-            };
-            this.defaultOpts = {
-                autoCrop: true,
-                autoCropArea: '0.7',
-                dragMode: 'crop',
-                guides: true,
-                responsive: true,
-                viewMode: 1,
-                zoomable: false,
-            };
-            this.resizeTimeout = 450;
-            /**
-             * @method cropBuiltHandler
-             * @desc Internal cropper handler. Called when the cropper has been instantiated
-             * @private
-             */
-            this.cropBuiltHandler = function () {
-                var imageData = _this.cropper.cropper('getImageData');
-                var image = _this.currentModal.find(_this.cropImageSelector);
-                _this.imageOriginalSizeFactor = image.data('originalWidth') / imageData.naturalWidth;
-                // iterate over the crop variants and set up their respective preview
-                _this.cropVariantTriggers.each(function (index, elem) {
-                    var cropVariantId = $(elem).attr('data-crop-variant-id');
-                    var cropArea = _this.convertRelativeToAbsoluteCropArea(_this.data[cropVariantId].cropArea, imageData);
-                    var variant = $.extend(true, {}, _this.data[cropVariantId], { cropArea: cropArea });
-                    _this.updatePreviewThumbnail(variant, $(elem));
-                });
-                _this.currentCropVariant.cropArea = _this.convertRelativeToAbsoluteCropArea(_this.currentCropVariant.cropArea, imageData);
-                // can't use .t3js-* as selector because it is an extraneous selector
-                _this.cropBox = _this.currentModal.find('.cropper-crop-box');
-                _this.setCropArea(_this.currentCropVariant.cropArea);
-                // check if new cropVariant has coverAreas
-                if (_this.currentCropVariant.coverAreas) {
-                    // init or reinit focusArea
-                    _this.initCoverAreas(_this.cropBox, _this.currentCropVariant.coverAreas);
-                }
-                // check if new cropVariant has focusArea
-                if (_this.currentCropVariant.focusArea) {
-                    // init or reinit focusArea
-                    if (ImageManipulation.isEmptyArea(_this.currentCropVariant.focusArea)) {
-                        // if an empty focusArea is set initialise it with the default
-                        _this.currentCropVariant.focusArea = $.extend(true, {}, _this.defaultFocusArea);
-                    }
-                    _this.initFocusArea(_this.cropBox);
-                    _this.scaleAndMoveFocusArea(_this.currentCropVariant.focusArea);
-                }
-                if (_this.currentCropVariant.selectedRatio) {
-                    _this.setAspectRatio(_this.currentCropVariant.allowedAspectRatios[_this.currentCropVariant.selectedRatio]);
-                    // set data explicitly or setAspectRatio up-scales the crop
-                    _this.setCropArea(_this.currentCropVariant.cropArea);
-                    _this.currentModal.find("[data-option='" + _this.currentCropVariant.selectedRatio + "']").addClass('active');
-                }
-                _this.cropperCanvas.addClass('is-visible');
-            };
-            /**
-             * @method cropMoveHandler
-             * @desc Internal cropper handler. Called when the cropping area is moving
-             * @private
-             */
-            this.cropMoveHandler = function (e) {
-                _this.currentCropVariant.cropArea = $.extend(true, _this.currentCropVariant.cropArea, {
-                    height: Math.floor(e.height),
-                    width: Math.floor(e.width),
-                    x: Math.floor(e.x),
-                    y: Math.floor(e.y),
-                });
-                _this.updatePreviewThumbnail(_this.currentCropVariant, _this.activeCropVariantTrigger);
-                _this.updateCropVariantData(_this.currentCropVariant);
-                var naturalWidth = Math.round(_this.currentCropVariant.cropArea.width * _this.imageOriginalSizeFactor);
-                var naturalHeight = Math.round(_this.currentCropVariant.cropArea.height * _this.imageOriginalSizeFactor);
-                _this.cropInfo.text(naturalWidth + "\u00D7" + naturalHeight + " px");
-            };
-            /**
-             * @method cropStartHandler
-             * @desc Internal cropper handler. Called when the cropping starts moving
-             * @private
-             */
-            this.cropStartHandler = function () {
-                if (_this.currentCropVariant.focusArea) {
-                    _this.focusArea.draggable('option', 'disabled', true);
-                    _this.focusArea.resizable('option', 'disabled', true);
-                }
-            };
-            /**
-             * @method cropEndHandler
-             * @desc Internal cropper handler. Called when the cropping ends moving
-             * @private
-             */
-            this.cropEndHandler = function () {
-                if (_this.currentCropVariant.focusArea) {
-                    _this.focusArea.draggable('option', 'disabled', false);
-                    _this.focusArea.resizable('option', 'disabled', false);
-                }
-            };
-            // silence is golden
-            $(window).resize(function () {
-                if (_this.cropper) {
-                    _this.cropper.cropper('destroy');
-                }
-            });
-            this.resizeEnd(function () {
-                if (_this.cropper) {
-                    _this.init();
-                }
-            });
-        }
-        /**
-         * @method isCropAreaEmpty
-         * @desc Checks if an area is set or pristine
-         * @param {Area} area - The area to check
-         * @return {boolean}
-         * @static
-         */
-        ImageManipulation.isEmptyArea = function (area) {
-            return $.isEmptyObject(area);
-        };
-        /**
-         * @method wait
-         * @desc window.setTimeout shim
-         * @param {Function} fn - The function to execute
-         * @param {number} ms - The time in [ms] to wait until execution
-         * @return {boolean}
-         * @public
-         * @static
-         */
-        ImageManipulation.wait = function (fn, ms) {
-            window.setTimeout(fn, ms);
-        };
-        /**
-         * @method toCssPercent
-         * @desc Takes a number, and converts it to CSS percentage length
-         * @param {number} num - The number to convert
-         * @return {string}
-         * @public
-         * @static
-         */
-        ImageManipulation.toCssPercent = function (num) {
-            return num * 100 + "%";
-        };
-        /**
-         * @method serializeCropVariants
-         * @desc Serializes crop variants for persistence or preview
-         * @param {Object} cropVariants
-         * @returns string
-         */
-        ImageManipulation.serializeCropVariants = function (cropVariants) {
-            var omitUnused = function (key, value) {
-                return (key === 'id'
-                    || key === 'title'
-                    || key === 'allowedAspectRatios'
-                    || key === 'coverAreas') ? undefined : value;
-            };
-            return JSON.stringify(cropVariants, omitUnused);
-        };
-        /**
-         * @method initializeTrigger
-         * @desc Assign a handler to .t3js-image-manipulation-trigger.
-         *       Show the modal and kick-off image manipulation
-         * @public
-         */
-        ImageManipulation.prototype.initializeTrigger = function () {
-            var _this = this;
-            var triggerHandler = function (e) {
-                e.preventDefault();
-                _this.trigger = $(e.currentTarget);
-                _this.show();
-            };
-            $('.t3js-image-manipulation-trigger').off('click').click(triggerHandler);
-        };
-        /**
-         * @method initializeCropperModal
-         * @desc Initialize the cropper modal and dispatch the cropper init
-         * @private
-         */
-        ImageManipulation.prototype.initializeCropperModal = function () {
-            var _this = this;
-            var image = this.currentModal.find(this.cropImageSelector);
-            ImagesLoaded(image, function () {
-                setTimeout(function () {
-                    _this.init();
-                }, 100);
-            });
-        };
-        /**
-         * @method show
-         * @desc Load the image and setup the modal UI
-         * @private
-         */
-        ImageManipulation.prototype.show = function () {
-            var _this = this;
-            var modalTitle = this.trigger.data('modalTitle');
-            var buttonPreviewText = this.trigger.data('buttonPreviewText');
-            var buttonDismissText = this.trigger.data('buttonDismissText');
-            var buttonSaveText = this.trigger.data('buttonSaveText');
-            var imageUri = this.trigger.data('url');
-            var initCropperModal = this.initializeCropperModal.bind(this);
-            /**
-             * Open modal with image to crop
-             */
-            this.currentModal = Modal.advanced({
-                additionalCssClasses: ['modal-image-manipulation'],
-                ajaxCallback: initCropperModal,
-                buttons: [
-                    {
-                        btnClass: 'btn-default pull-left',
-                        dataAttributes: {
-                            method: 'preview',
-                        },
-                        icon: 'actions-view',
-                        text: buttonPreviewText,
-                    },
-                    {
-                        btnClass: 'btn-default',
-                        dataAttributes: {
-                            method: 'dismiss',
-                        },
-                        icon: 'actions-close',
-                        text: buttonDismissText,
-                    },
-                    {
-                        btnClass: 'btn-primary',
-                        dataAttributes: {
-                            method: 'save',
-                        },
-                        icon: 'actions-document-save',
-                        text: buttonSaveText,
-                    },
-                ],
-                callback: function (currentModal) {
-                    currentModal.find('.t3js-modal-body')
-                        .addClass('cropper');
-                },
-                content: imageUri,
-                size: Modal.sizes.full,
-                style: Modal.styles.dark,
-                title: modalTitle,
-                type: 'ajax',
-            });
-            this.currentModal.on('hide.bs.modal', function (e) {
-                _this.destroy();
-            });
-            // do not dismiss the modal when clicking beside it to avoid data loss
-            this.currentModal.data('bs.modal').options.backdrop = 'static';
-        };
-        /**
-         * @method init
-         * @desc Initializes the cropper UI and sets up all the event indings for the UI
-         * @private
-         */
-        ImageManipulation.prototype.init = function () {
-            var _this = this;
-            var image = this.currentModal.find(this.cropImageSelector);
-            var imageHeight = $(image).height();
-            var imageWidth = $(image).width();
-            var data = this.trigger.attr('data-crop-variants');
-            if (!data) {
-                throw new TypeError('ImageManipulation: No cropVariants data found for image');
-            }
-            // if we have data already set we assume an internal reinit eg. after resizing
-            this.data = $.isEmptyObject(this.data) ? JSON.parse(data) : this.data;
-            // initialize our class members
-            this.currentModal.find(this.cropImageContainerSelector).css({ height: imageHeight, width: imageWidth });
-            this.cropVariantTriggers = this.currentModal.find('.t3js-crop-variant-trigger');
-            this.activeCropVariantTrigger = this.currentModal.find('.t3js-crop-variant-trigger.is-active');
-            this.cropInfo = this.currentModal.find(this.cropInfoSelector);
-            this.saveButton = this.currentModal.find('[data-method=save]');
-            this.previewButton = this.currentModal.find('[data-method=preview]');
-            this.dismissButton = this.currentModal.find('[data-method=dismiss]');
-            this.resetButton = this.currentModal.find('[data-method=reset]');
-            this.cropperCanvas = this.currentModal.find('#js-crop-canvas');
-            this.aspectRatioTrigger = this.currentModal.find('[data-method=setAspectRatio]');
-            this.currentCropVariant = this.data[this.activeCropVariantTrigger.attr('data-crop-variant-id')];
-            /**
-             * Assign EventListener to cropVariantTriggers
-             */
-            this.cropVariantTriggers.off('click').on('click', function (e) {
-                /**
-                 * Is the current cropVariantTrigger is active, bail out.
-                 * Bootstrap doesn't provide this functionality when collapsing the Collaps panels
-                 */
-                if ($(e.currentTarget).hasClass('is-active')) {
-                    e.stopPropagation();
-                    e.preventDefault();
-                    return;
-                }
-                _this.activeCropVariantTrigger.removeClass('is-active');
-                $(e.currentTarget).addClass('is-active');
-                _this.activeCropVariantTrigger = $(e.currentTarget);
-                var cropVariant = _this.data[_this.activeCropVariantTrigger.attr('data-crop-variant-id')];
-                var imageData = _this.cropper.cropper('getImageData');
-                cropVariant.cropArea = _this.convertRelativeToAbsoluteCropArea(cropVariant.cropArea, imageData);
-                _this.currentCropVariant = $.extend(true, {}, cropVariant);
-                _this.update(cropVariant);
-            });
-            /**
-             * Assign EventListener to aspectRatioTrigger
-             */
-            this.aspectRatioTrigger.off('click').on('click', function (e) {
-                var ratioId = $(e.currentTarget).attr('data-option');
-                var temp = $.extend(true, {}, _this.currentCropVariant);
-                var ratio = temp.allowedAspectRatios[ratioId];
-                _this.setAspectRatio(ratio);
-                // set data explicitly or setAspectRatio upscales the crop
-                _this.setCropArea(temp.cropArea);
-                _this.currentCropVariant = $.extend(true, {}, temp, { selectedRatio: ratioId });
-                _this.update(_this.currentCropVariant);
-            });
-            /**
-             * Assign EventListener to saveButton
-             */
-            this.saveButton.off('click').on('click', function () {
-                _this.save(_this.data);
-            });
-            /**
-             * Assign EventListener to previewButton if preview url exists
-             */
-            if (this.trigger.attr('data-preview-url')) {
-                this.previewButton.off('click').on('click', function () {
-                    _this.openPreview(_this.data);
-                });
-            }
-            else {
-                this.previewButton.hide();
-            }
-            /**
-             * Assign EventListener to dismissButton
-             */
-            this.dismissButton.off('click').on('click', function () {
-                _this.currentModal.modal('hide');
-            });
-            /**
-             * Assign EventListener to resetButton
-             */
-            this.resetButton.off('click').on('click', function (e) {
-                var imageData = _this.cropper.cropper('getImageData');
-                var resetCropVariantString = $(e.currentTarget).attr('data-crop-variant');
-                e.preventDefault();
-                e.stopPropagation();
-                if (!resetCropVariantString) {
-                    throw new TypeError('TYPO3 Cropper: No cropVariant data attribute found on reset element.');
-                }
-                var resetCropVariant = JSON.parse(resetCropVariantString);
-                var absoluteCropArea = _this.convertRelativeToAbsoluteCropArea(resetCropVariant.cropArea, imageData);
-                _this.currentCropVariant = $.extend(true, {}, resetCropVariant, { cropArea: absoluteCropArea });
-                _this.update(_this.currentCropVariant);
-            });
-            // if we start without an cropArea, maximize the cropper
-            if (ImageManipulation.isEmptyArea(this.currentCropVariant.cropArea)) {
-                this.defaultOpts = $.extend({
-                    autoCropArea: 1,
-                }, this.defaultOpts);
-            }
-            /**
-             * Initialise the cropper
-             *
-             * Note: We use the extraneous jQuery object here, as CropperJS won't work inside the <iframe>
-             * The top.require is now inlined @see ImageManipulationElemen.php:143
-             * TODO: Find a better solution for cross iframe communications
-             */
-            this.cropper = top.$(image).cropper($.extend(this.defaultOpts, {
-                built: this.cropBuiltHandler,
-                crop: this.cropMoveHandler,
-                cropend: this.cropEndHandler,
-                cropstart: this.cropStartHandler,
-                data: this.currentCropVariant.cropArea,
-            }));
-        };
-        /**
-         * @method update
-         * @desc Update current cropArea position and size when changing cropVariants
-         * @param {CropVariant} cropVariant - The new cropVariant to update the UI with
-         */
-        ImageManipulation.prototype.update = function (cropVariant) {
-            var temp = $.extend(true, {}, cropVariant);
-            var selectedRatio = cropVariant.allowedAspectRatios[cropVariant.selectedRatio];
-            this.currentModal.find('[data-option]').removeClass('active');
-            this.currentModal.find("[data-option=\"" + cropVariant.selectedRatio + "\"]").addClass('active');
-            /**
-             * Setting the aspect ratio cause a redraw of the crop area so we need to manually reset it to last data
-             */
-            this.setAspectRatio(selectedRatio);
-            this.setCropArea(temp.cropArea);
-            this.currentCropVariant = $.extend(true, {}, temp, cropVariant);
-            this.cropBox.find(this.coverAreaSelector).remove();
-            // if the current container has a focus area element, deregister and cleanup prior to initialization
-            if (this.cropBox.has(this.focusAreaSelector).length) {
-                this.focusArea.resizable('destroy').draggable('destroy');
-                this.focusArea.remove();
-            }
-            // check if new cropVariant has focusArea
-            if (cropVariant.focusArea) {
-                // init or reinit focusArea
-                if (ImageManipulation.isEmptyArea(cropVariant.focusArea)) {
-                    this.currentCropVariant.focusArea = $.extend(true, {}, this.defaultFocusArea);
-                }
-                this.initFocusArea(this.cropBox);
-                this.scaleAndMoveFocusArea(this.currentCropVariant.focusArea);
-            }
-            // check if new cropVariant has coverAreas
-            if (cropVariant.coverAreas) {
-                // init or reinit focusArea
-                this.initCoverAreas(this.cropBox, this.currentCropVariant.coverAreas);
-            }
-            this.updatePreviewThumbnail(this.currentCropVariant, this.activeCropVariantTrigger);
-        };
-        /**
-         * @method initFocusArea
-         * @desc Initializes the focus area inside a container and registers the resizable and draggable interfaces to it
-         * @param {JQuery} container
-         * @private
-         */
-        ImageManipulation.prototype.initFocusArea = function (container) {
-            var _this = this;
-            this.focusArea = $('<div id="t3js-cropper-focus-area" class="cropper-focus-area"></div>');
-            container.append(this.focusArea);
-            this.focusArea
-                .draggable({
-                containment: container,
-                create: function () {
-                    _this.scaleAndMoveFocusArea(_this.currentCropVariant.focusArea);
-                },
-                drag: function () {
-                    var _a = container.offset(), left = _a.left, top = _a.top;
-                    var _b = _this.focusArea.offset(), fLeft = _b.left, fTop = _b.top;
-                    var _c = _this.currentCropVariant, focusArea = _c.focusArea, coverAreas = _c.coverAreas;
-                    focusArea.x = (fLeft - left) / container.width();
-                    focusArea.y = (fTop - top) / container.height();
-                    _this.updatePreviewThumbnail(_this.currentCropVariant, _this.activeCropVariantTrigger);
-                    if (_this.checkFocusAndCoverAreasCollision(focusArea, coverAreas)) {
-                        _this.focusArea.addClass('has-nodrop');
-                    }
-                    else {
-                        _this.focusArea.removeClass('has-nodrop');
-                    }
-                },
-                revert: function () {
-                    var revertDelay = 250;
-                    var _a = container.offset(), left = _a.left, top = _a.top;
-                    var _b = _this.focusArea.offset(), fLeft = _b.left, fTop = _b.top;
-                    var _c = _this.currentCropVariant, focusArea = _c.focusArea, coverAreas = _c.coverAreas;
-                    if (_this.checkFocusAndCoverAreasCollision(focusArea, coverAreas)) {
-                        _this.focusArea.removeClass('has-nodrop');
-                        ImageManipulation.wait(function () {
-                            focusArea.x = (fLeft - left) / container.width();
-                            focusArea.y = (fTop - top) / container.height();
-                            _this.updateCropVariantData(_this.currentCropVariant);
-                        }, revertDelay);
-                        return true;
-                    }
-                    return false;
-                },
-                revertDuration: 200,
-                stop: function () {
-                    var _a = container.offset(), left = _a.left, top = _a.top;
-                    var _b = _this.focusArea.offset(), fLeft = _b.left, fTop = _b.top;
-                    var focusArea = _this.currentCropVariant.focusArea;
-                    focusArea.x = (fLeft - left) / container.width();
-                    focusArea.y = (fTop - top) / container.height();
-                    _this.scaleAndMoveFocusArea(focusArea);
-                },
-            })
-                .resizable({
-                containment: container,
-                handles: 'all',
-                resize: function () {
-                    var _a = container.offset(), left = _a.left, top = _a.top;
-                    var _b = _this.focusArea.offset(), fLeft = _b.left, fTop = _b.top;
-                    var _c = _this.currentCropVariant, focusArea = _c.focusArea, coverAreas = _c.coverAreas;
-                    focusArea.height = _this.focusArea.height() / container.height();
-                    focusArea.width = _this.focusArea.width() / container.width();
-                    focusArea.x = (fLeft - left) / container.width();
-                    focusArea.y = (fTop - top) / container.height();
-                    _this.updatePreviewThumbnail(_this.currentCropVariant, _this.activeCropVariantTrigger);
-                    if (_this.checkFocusAndCoverAreasCollision(focusArea, coverAreas)) {
-                        _this.focusArea.addClass('has-nodrop');
-                    }
-                    else {
-                        _this.focusArea.removeClass('has-nodrop');
-                    }
-                },
-                stop: function (event, ui) {
-                    var revertDelay = 250;
-                    var _a = container.offset(), left = _a.left, top = _a.top;
-                    var _b = _this.focusArea.offset(), fLeft = _b.left, fTop = _b.top;
-                    var _c = _this.currentCropVariant, focusArea = _c.focusArea, coverAreas = _c.coverAreas;
-                    if (_this.checkFocusAndCoverAreasCollision(focusArea, coverAreas)) {
-                        ui.element.animate($.extend(ui.originalPosition, ui.originalSize), revertDelay, function () {
-                            focusArea.height = _this.focusArea.height() / container.height();
-                            focusArea.height = _this.focusArea.height() / container.height();
-                            focusArea.width = _this.focusArea.width() / container.width();
-                            focusArea.x = (fLeft - left) / container.width();
-                            focusArea.y = (fTop - top) / container.height();
-                            _this.scaleAndMoveFocusArea(focusArea);
-                            _this.focusArea.removeClass('has-nodrop');
-                        });
-                    }
-                    else {
-                        _this.scaleAndMoveFocusArea(focusArea);
-                    }
-                },
-            });
-        };
-        /**
-         * @method initCoverAreas
-         * @desc Initialise cover areas inside the cropper container
-         * @param {JQuery} container - The container element to append the cover areas
-         * @param {Array<Area>} coverAreas - An array of areas to construxt the cover area elements from
-         */
-        ImageManipulation.prototype.initCoverAreas = function (container, coverAreas) {
-            coverAreas.forEach(function (coverArea) {
-                var coverAreaCanvas = $('<div class="cropper-cover-area t3js-cropper-cover-area"></div>');
-                container.append(coverAreaCanvas);
-                coverAreaCanvas.css({
-                    height: ImageManipulation.toCssPercent(coverArea.height),
-                    left: ImageManipulation.toCssPercent(coverArea.x),
-                    top: ImageManipulation.toCssPercent(coverArea.y),
-                    width: ImageManipulation.toCssPercent(coverArea.width),
-                });
-            });
-        };
-        /**
-         * @method updatePreviewThumbnail
-         * @desc Sync the croping (and focus area) to the preview thumbnail
-         * @param {CropVariant} cropVariant - The crop variant to preview in the thumbnail
-         * @param {JQuery} cropVariantTrigger - The crop variant element containing the thumbnail
-         * @private
-         */
-        ImageManipulation.prototype.updatePreviewThumbnail = function (cropVariant, cropVariantTrigger) {
-            var styles;
-            var cropperPreviewThumbnailCrop = cropVariantTrigger.find('.t3js-cropper-preview-thumbnail-crop-area');
-            var cropperPreviewThumbnailImage = cropVariantTrigger.find('.t3js-cropper-preview-thumbnail-crop-image');
-            var cropperPreviewThumbnailFocus = cropVariantTrigger.find('.t3js-cropper-preview-thumbnail-focus-area');
-            var imageData = this.cropper.cropper('getImageData');
-            // update the position/dimension of the crop area in the preview
-            cropperPreviewThumbnailCrop.css({
-                height: ImageManipulation.toCssPercent(cropVariant.cropArea.height / imageData.naturalHeight),
-                left: ImageManipulation.toCssPercent(cropVariant.cropArea.x / imageData.naturalWidth),
-                top: ImageManipulation.toCssPercent(cropVariant.cropArea.y / imageData.naturalHeight),
-                width: ImageManipulation.toCssPercent(cropVariant.cropArea.width / imageData.naturalWidth),
-            });
-            // show and update focusArea in the preview only if we really have one configured
-            if (cropVariant.focusArea) {
-                cropperPreviewThumbnailFocus.css({
-                    height: ImageManipulation.toCssPercent(cropVariant.focusArea.height),
-                    left: ImageManipulation.toCssPercent(cropVariant.focusArea.x),
-                    top: ImageManipulation.toCssPercent(cropVariant.focusArea.y),
-                    width: ImageManipulation.toCssPercent(cropVariant.focusArea.width),
-                });
-            }
-            // destruct the preview container's CSS properties
-            styles = cropperPreviewThumbnailCrop.css([
-                'width', 'height', 'left', 'top',
-            ]);
-            /**
-             * Apply negative margins on the previewThumbnailImage to make the illusion of an offset
-             */
-            cropperPreviewThumbnailImage.css({
-                height: parseFloat(styles.height) * (1 / (cropVariant.cropArea.height / imageData.naturalHeight)) + "px",
-                margin: -1 * parseFloat(styles.left) + "px",
-                marginTop: -1 * parseFloat(styles.top) + "px",
-                width: parseFloat(styles.width) * (1 / (cropVariant.cropArea.width / imageData.naturalWidth)) + "px",
-            });
-        };
-        /**
-         * @method scaleAndMoveFocusArea
-         * @desc Calculation logic for moving the focus area given the
-         *       specified constrains of a crop and an optional cover area
-         * @param {Area} focusArea - The translation data
-         */
-        ImageManipulation.prototype.scaleAndMoveFocusArea = function (focusArea) {
-            this.focusArea.css({
-                height: ImageManipulation.toCssPercent(focusArea.height),
-                left: ImageManipulation.toCssPercent(focusArea.x),
-                top: ImageManipulation.toCssPercent(focusArea.y),
-                width: ImageManipulation.toCssPercent(focusArea.width),
-            });
-            this.currentCropVariant.focusArea = focusArea;
-            this.updatePreviewThumbnail(this.currentCropVariant, this.activeCropVariantTrigger);
-            this.updateCropVariantData(this.currentCropVariant);
-        };
-        /**
-         * @method updateCropVariantData
-         * @desc Immutably updates the currently selected cropVariant data
-         * @param {CropVariant} currentCropVariant - The cropVariant to immutably save
-         * @private
-         */
-        ImageManipulation.prototype.updateCropVariantData = function (currentCropVariant) {
-            var imageData = this.cropper.cropper('getImageData');
-            var absoluteCropArea = this.convertAbsoluteToRelativeCropArea(currentCropVariant.cropArea, imageData);
-            this.data[currentCropVariant.id] = $.extend(true, {}, currentCropVariant, { cropArea: absoluteCropArea });
-        };
-        /**
-         * @method setAspectRatio
-         * @desc Sets the cropper to a specific ratio
-         * @param {ratio} ratio - The ratio value to apply
-         * @private
-         */
-        ImageManipulation.prototype.setAspectRatio = function (ratio) {
-            this.cropper.cropper('setAspectRatio', ratio.value);
-        };
-        /**
-         * @method setCropArea
-         * @desc Sets the cropper to a specific crop area
-         * @param {cropArea} cropArea - The crop area to apply
-         * @private
-         */
-        ImageManipulation.prototype.setCropArea = function (cropArea) {
-            var currentRatio = this.currentCropVariant.allowedAspectRatios[this.currentCropVariant.selectedRatio];
-            if (currentRatio.value === 0) {
-                this.cropper.cropper('setData', {
-                    height: cropArea.height,
-                    width: cropArea.width,
-                    x: cropArea.x,
-                    y: cropArea.y,
-                });
-            }
-            else {
-                this.cropper.cropper('setData', {
-                    height: cropArea.height,
-                    x: cropArea.x,
-                    y: cropArea.y,
-                });
-            }
-        };
-        /**
-         * @method checkFocusAndCoverAreas
-         * @desc Checks is one focus area and one or more cover areas overlap
-         * @param focusArea
-         * @param coverAreas
-         * @return {boolean}
-         */
-        ImageManipulation.prototype.checkFocusAndCoverAreasCollision = function (focusArea, coverAreas) {
-            if (!coverAreas) {
-                return false;
-            }
-            return coverAreas
-                .some(function (coverArea) {
-                // noinspection OverlyComplexBooleanExpressionJS
-                return (focusArea.x < coverArea.x + coverArea.width &&
-                    focusArea.x + focusArea.width > coverArea.x &&
-                    focusArea.y < coverArea.y + coverArea.height &&
-                    focusArea.height + focusArea.y > coverArea.y);
-            });
-        };
-        /**
-         * @method convertAbsoluteToRelativeCropArea
-         * @desc Converts a crop area from absolute pixel-based into relative length values
-         * @param {Area} cropArea - The crop area to convert from
-         * @param {CropperImageData} imageData - The image data
-         * @return {Area}
-         */
-        ImageManipulation.prototype.convertAbsoluteToRelativeCropArea = function (cropArea, imageData) {
-            var height = cropArea.height, width = cropArea.width, x = cropArea.x, y = cropArea.y;
-            return {
-                height: height / imageData.naturalHeight,
-                width: width / imageData.naturalWidth,
-                x: x / imageData.naturalWidth,
-                y: y / imageData.naturalHeight,
-            };
-        };
-        /**
-         * @method convertRelativeToAbsoluteCropArea
-         * @desc Converts a crop area from relative into absolute pixel-based length values
-         * @param {Area} cropArea - The crop area to convert from
-         * @param {CropperImageData} imageData - The image data
-         * @return {{height: number, width: number, x: number, y: number}}
-         */
-        ImageManipulation.prototype.convertRelativeToAbsoluteCropArea = function (cropArea, imageData) {
-            var height = cropArea.height, width = cropArea.width, x = cropArea.x, y = cropArea.y;
-            return {
-                height: height * imageData.naturalHeight,
-                width: width * imageData.naturalWidth,
-                x: x * imageData.naturalWidth,
-                y: y * imageData.naturalHeight,
-            };
-        };
-        /**
-         * @method setPreviewImages
-         * @desc Updates the preview images in the editing section with the respective crop variants
-         * @param {Object} data - The internal crop variants state
-         */
-        ImageManipulation.prototype.setPreviewImages = function (data) {
-            var _this = this;
-            var $image = this.cropper;
-            var imageData = $image.cropper('getImageData');
-            // iterate over the crop variants and set up their respective preview
-            Object.keys(data).forEach(function (cropVariantId) {
-                var cropVariant = data[cropVariantId];
-                var cropData = _this.convertRelativeToAbsoluteCropArea(cropVariant.cropArea, imageData);
-                var $preview = _this.trigger
-                    .closest('.form-group')
-                    .find(".t3js-image-manipulation-preview[data-crop-variant-id=\"" + cropVariantId + "\"]");
-                var $previewSelectedRatio = _this.trigger
-                    .closest('.form-group')
-                    .find(".t3js-image-manipulation-selected-ratio[data-crop-variant-id=\"" + cropVariantId + "\"]"); // tslint:disable-line:max-line-length
-                if ($preview.length === 0) {
-                    return;
-                }
-                var previewWidth = $preview.width();
-                var previewHeight = $preview.data('preview-height');
-                // adjust aspect ratio of preview width/height
-                var aspectRatio = cropData.width / cropData.height;
-                var tmpHeight = previewWidth / aspectRatio;
-                if (tmpHeight > previewHeight) {
-                    previewWidth = previewHeight * aspectRatio;
-                }
-                else {
-                    previewHeight = tmpHeight;
-                }
-                // preview should never be up-scaled
-                if (previewWidth > cropData.width) {
-                    previewWidth = cropData.width;
-                    previewHeight = cropData.height;
-                }
-                var ratio = previewWidth / cropData.width;
-                var $viewBox = $('<div />').html('<img src="' + $image.attr('src') + '">');
-                var $ratioTitleText = _this.currentModal.find(".t3-js-ratio-title[data-ratio-id=\"" + cropVariant.id + cropVariant.selectedRatio + "\"]"); // tslint:disable-line:max-line-length
-                $previewSelectedRatio.text($ratioTitleText.text());
-                $viewBox.addClass('cropper-preview-container');
-                $preview.empty().append($viewBox);
-                $viewBox.wrap('<span class="thumbnail thumbnail-status"></span>');
-                $viewBox.width(previewWidth).height(previewHeight).find('img').css({
-                    height: imageData.naturalHeight * ratio,
-                    left: -cropData.x * ratio,
-                    top: -cropData.y * ratio,
-                    width: imageData.naturalWidth * ratio,
-                });
-            });
-        };
-        /**
-         * @method openPreview
-         * @desc Opens a preview view with the crop variants
-         * @param {object} data - The whole data object containing all the cropVariants
-         * @private
-         */
-        ImageManipulation.prototype.openPreview = function (data) {
-            var cropVariants = ImageManipulation.serializeCropVariants(data);
-            var previewUrl = this.trigger.attr('data-preview-url');
-            previewUrl = previewUrl + '&cropVariants=' + encodeURIComponent(cropVariants);
-            window.open(previewUrl, 'TYPO3ImageManipulationPreview');
-        };
-        /**
-         * @method save
-         * @desc Saves the edited cropVariants to a hidden field
-         * @param {object} data - The whole data object containing all the cropVariants
-         * @private
-         */
-        ImageManipulation.prototype.save = function (data) {
-            var cropVariants = ImageManipulation.serializeCropVariants(data);
-            var hiddenField = $("#" + this.trigger.attr('data-field'));
-            this.trigger.attr('data-crop-variants', JSON.stringify(data));
-            this.setPreviewImages(data);
-            hiddenField.val(cropVariants);
-            this.currentModal.modal('hide');
-        };
-        /**
-         * @method destroy
-         * @desc Destroy the ImageManipulation including cropper and alike
-         * @private
-         */
-        ImageManipulation.prototype.destroy = function () {
-            if (this.currentModal) {
-                this.cropper.cropper('destroy');
-                this.cropper = null;
-                this.currentModal = null;
-                this.data = null;
-            }
-        };
-        /**
-         * @method resizeEnd
-         * @desc Calls a function when the cropper has been resized
-         * @param {Function} fn - The function to call on resize completion
-         * @private
-         */
-        ImageManipulation.prototype.resizeEnd = function (fn) {
-            var _this = this;
-            var timer;
-            $(window).on('resize', function () {
-                clearTimeout(timer);
-                timer = setTimeout(function () {
-                    fn();
-                }, _this.resizeTimeout);
-            });
-        };
-        return ImageManipulation;
-    }());
-    return new ImageManipulation();
-});
+define(["require","exports","jquery","TYPO3/CMS/Backend/Modal","TYPO3/CMS/Core/Contrib/imagesloaded.pkgd.min","jquery-ui/draggable","jquery-ui/resizable"],function(a,b,c,d,e){"use strict";var f=function(){function a(){var b=this;this.cropImageContainerSelector="#t3js-crop-image-container",this.cropImageSelector="#t3js-crop-image",this.coverAreaSelector=".t3js-cropper-cover-area",this.cropInfoSelector=".t3js-cropper-info-crop",this.focusAreaSelector="#t3js-cropper-focus-area",this.defaultFocusArea={height:1/3,width:1/3,x:0,y:0},this.defaultOpts={autoCrop:!0,autoCropArea:"0.7",dragMode:"crop",guides:!0,responsive:!0,viewMode:1,zoomable:!1},this.resizeTimeout=450,this.cropBuiltHandler=function(){var d=b.cropper.cropper("getImageData"),e=b.currentModal.find(b.cropImageSelector);b.imageOriginalSizeFactor=e.data("originalWidth")/d.naturalWidth,b.cropVariantTriggers.each(function(a,e){var f=c(e).attr("data-crop-variant-id"),g=b.convertRelativeToAbsoluteCropArea(b.data[f].cropArea,d),h=c.extend(!0,{},b.data[f],{cropArea:g});b.updatePreviewThumbnail(h,c(e))}),b.currentCropVariant.cropArea=b.convertRelativeToAbsoluteCropArea(b.currentCropVariant.cropArea,d),b.cropBox=b.currentModal.find(".cropper-crop-box"),b.setCropArea(b.currentCropVariant.cropArea),b.currentCropVariant.coverAreas&&b.initCoverAreas(b.cropBox,b.currentCropVariant.coverAreas),b.currentCropVariant.focusArea&&(a.isEmptyArea(b.currentCropVariant.focusArea)&&(b.currentCropVariant.focusArea=c.extend(!0,{},b.defaultFocusArea)),b.initFocusArea(b.cropBox),b.scaleAndMoveFocusArea(b.currentCropVariant.focusArea)),b.currentCropVariant.selectedRatio&&(b.setAspectRatio(b.currentCropVariant.allowedAspectRatios[b.currentCropVariant.selectedRatio]),b.setCropArea(b.currentCropVariant.cropArea),b.currentModal.find("[data-option='"+b.currentCropVariant.selectedRatio+"']").addClass("active")),b.cropperCanvas.addClass("is-visible")},this.cropMoveHandler=function(a){b.currentCropVariant.cropArea=c.extend(!0,b.currentCropVariant.cropArea,{height:Math.floor(a.height),width:Math.floor(a.width),x:Math.floor(a.x),y:Math.floor(a.y)}),b.updatePreviewThumbnail(b.currentCropVariant,b.activeCropVariantTrigger),b.updateCropVariantData(b.currentCropVariant);var d=Math.round(b.currentCropVariant.cropArea.width*b.imageOriginalSizeFactor),e=Math.round(b.currentCropVariant.cropArea.height*b.imageOriginalSizeFactor);b.cropInfo.text(d+"×"+e+" px")},this.cropStartHandler=function(){b.currentCropVariant.focusArea&&(b.focusArea.draggable("option","disabled",!0),b.focusArea.resizable("option","disabled",!0))},this.cropEndHandler=function(){b.currentCropVariant.focusArea&&(b.focusArea.draggable("option","disabled",!1),b.focusArea.resizable("option","disabled",!1))},c(window).resize(function(){b.cropper&&b.cropper.cropper("destroy")}),this.resizeEnd(function(){b.cropper&&b.init()})}return a.isEmptyArea=function(a){return c.isEmptyObject(a)},a.wait=function(a,b){window.setTimeout(a,b)},a.toCssPercent=function(a){return 100*a+"%"},a.serializeCropVariants=function(a){var b=function(a,b){return"id"===a||"title"===a||"allowedAspectRatios"===a||"coverAreas"===a?void 0:b};return JSON.stringify(a,b)},a.prototype.initializeTrigger=function(){var a=this,b=function(b){b.preventDefault(),a.trigger=c(b.currentTarget),a.show()};c(".t3js-image-manipulation-trigger").off("click").click(b)},a.prototype.initializeCropperModal=function(){var a=this,b=this.currentModal.find(this.cropImageSelector);e(b,function(){setTimeout(function(){a.init()},100)})},a.prototype.show=function(){var a=this,b=this.trigger.data("modalTitle"),c=this.trigger.data("buttonPreviewText"),e=this.trigger.data("buttonDismissText"),f=this.trigger.data("buttonSaveText"),g=this.trigger.data("url"),h=this.initializeCropperModal.bind(this);this.currentModal=d.advanced({additionalCssClasses:["modal-image-manipulation"],ajaxCallback:h,buttons:[{btnClass:"btn-default pull-left",dataAttributes:{method:"preview"},icon:"actions-view",text:c},{btnClass:"btn-default",dataAttributes:{method:"dismiss"},icon:"actions-close",text:e},{btnClass:"btn-primary",dataAttributes:{method:"save"},icon:"actions-document-save",text:f}],callback:function(a){a.find(".t3js-modal-body").addClass("cropper")},content:g,size:d.sizes.full,style:d.styles.dark,title:b,type:"ajax"}),this.currentModal.on("hide.bs.modal",function(b){a.destroy()}),this.currentModal.data("bs.modal").options.backdrop="static"},a.prototype.init=function(){var b=this,d=this.currentModal.find(this.cropImageSelector),e=c(d).height(),f=c(d).width(),g=this.trigger.attr("data-crop-variants");if(!g)throw new TypeError("ImageManipulation: No cropVariants data found for image");this.data=c.isEmptyObject(this.data)?JSON.parse(g):this.data,this.currentModal.find(this.cropImageContainerSelector).css({height:e,width:f}),this.cropVariantTriggers=this.currentModal.find(".t3js-crop-variant-trigger"),this.activeCropVariantTrigger=this.currentModal.find(".t3js-crop-variant-trigger.is-active"),this.cropInfo=this.currentModal.find(this.cropInfoSelector),this.saveButton=this.currentModal.find("[data-method=save]"),this.previewButton=this.currentModal.find("[data-method=preview]"),this.dismissButton=this.currentModal.find("[data-method=dismiss]"),this.resetButton=this.currentModal.find("[data-method=reset]"),this.cropperCanvas=this.currentModal.find("#js-crop-canvas"),this.aspectRatioTrigger=this.currentModal.find("[data-method=setAspectRatio]"),this.currentCropVariant=this.data[this.activeCropVariantTrigger.attr("data-crop-variant-id")],this.cropVariantTriggers.off("click").on("click",function(a){if(c(a.currentTarget).hasClass("is-active"))return a.stopPropagation(),void a.preventDefault();b.activeCropVariantTrigger.removeClass("is-active"),c(a.currentTarget).addClass("is-active"),b.activeCropVariantTrigger=c(a.currentTarget);var d=b.data[b.activeCropVariantTrigger.attr("data-crop-variant-id")],e=b.cropper.cropper("getImageData");d.cropArea=b.convertRelativeToAbsoluteCropArea(d.cropArea,e),b.currentCropVariant=c.extend(!0,{},d),b.update(d)}),this.aspectRatioTrigger.off("click").on("click",function(a){var d=c(a.currentTarget).attr("data-option"),e=c.extend(!0,{},b.currentCropVariant),f=e.allowedAspectRatios[d];b.setAspectRatio(f),b.setCropArea(e.cropArea),b.currentCropVariant=c.extend(!0,{},e,{selectedRatio:d}),b.update(b.currentCropVariant)}),this.saveButton.off("click").on("click",function(){b.save(b.data)}),this.trigger.attr("data-preview-url")?this.previewButton.off("click").on("click",function(){b.openPreview(b.data)}):this.previewButton.hide(),this.dismissButton.off("click").on("click",function(){b.currentModal.modal("hide")}),this.resetButton.off("click").on("click",function(a){var d=b.cropper.cropper("getImageData"),e=c(a.currentTarget).attr("data-crop-variant");if(a.preventDefault(),a.stopPropagation(),!e)throw new TypeError("TYPO3 Cropper: No cropVariant data attribute found on reset element.");var f=JSON.parse(e),g=b.convertRelativeToAbsoluteCropArea(f.cropArea,d);b.currentCropVariant=c.extend(!0,{},f,{cropArea:g}),b.update(b.currentCropVariant)}),a.isEmptyArea(this.currentCropVariant.cropArea)&&(this.defaultOpts=c.extend({autoCropArea:1},this.defaultOpts)),this.cropper=top.$(d).cropper(c.extend(this.defaultOpts,{built:this.cropBuiltHandler,crop:this.cropMoveHandler,cropend:this.cropEndHandler,cropstart:this.cropStartHandler,data:this.currentCropVariant.cropArea}))},a.prototype.update=function(b){var d=c.extend(!0,{},b),e=b.allowedAspectRatios[b.selectedRatio];this.currentModal.find("[data-option]").removeClass("active"),this.currentModal.find('[data-option="'+b.selectedRatio+'"]').addClass("active"),this.setAspectRatio(e),this.setCropArea(d.cropArea),this.currentCropVariant=c.extend(!0,{},d,b),this.cropBox.find(this.coverAreaSelector).remove(),this.cropBox.has(this.focusAreaSelector).length&&(this.focusArea.resizable("destroy").draggable("destroy"),this.focusArea.remove()),b.focusArea&&(a.isEmptyArea(b.focusArea)&&(this.currentCropVariant.focusArea=c.extend(!0,{},this.defaultFocusArea)),this.initFocusArea(this.cropBox),this.scaleAndMoveFocusArea(this.currentCropVariant.focusArea)),b.coverAreas&&this.initCoverAreas(this.cropBox,this.currentCropVariant.coverAreas),this.updatePreviewThumbnail(this.currentCropVariant,this.activeCropVariantTrigger)},a.prototype.initFocusArea=function(b){var d=this;this.focusArea=c('<div id="t3js-cropper-focus-area" class="cropper-focus-area"></div>'),b.append(this.focusArea),this.focusArea.draggable({containment:b,create:function(){d.scaleAndMoveFocusArea(d.currentCropVariant.focusArea)},drag:function(){var a=b.offset(),c=a.left,e=a.top,f=d.focusArea.offset(),g=f.left,h=f.top,i=d.currentCropVariant,j=i.focusArea,k=i.coverAreas;j.x=(g-c)/b.width(),j.y=(h-e)/b.height(),d.updatePreviewThumbnail(d.currentCropVariant,d.activeCropVariantTrigger),d.checkFocusAndCoverAreasCollision(j,k)?d.focusArea.addClass("has-nodrop"):d.focusArea.removeClass("has-nodrop")},revert:function(){var c=250,e=b.offset(),f=e.left,g=e.top,h=d.focusArea.offset(),i=h.left,j=h.top,k=d.currentCropVariant,l=k.focusArea,m=k.coverAreas;return!!d.checkFocusAndCoverAreasCollision(l,m)&&(d.focusArea.removeClass("has-nodrop"),a.wait(function(){l.x=(i-f)/b.width(),l.y=(j-g)/b.height(),d.updateCropVariantData(d.currentCropVariant)},c),!0)},revertDuration:200,stop:function(){var a=b.offset(),c=a.left,e=a.top,f=d.focusArea.offset(),g=f.left,h=f.top,i=d.currentCropVariant.focusArea;i.x=(g-c)/b.width(),i.y=(h-e)/b.height(),d.scaleAndMoveFocusArea(i)}}).resizable({containment:b,handles:"all",resize:function(){var a=b.offset(),c=a.left,e=a.top,f=d.focusArea.offset(),g=f.left,h=f.top,i=d.currentCropVariant,j=i.focusArea,k=i.coverAreas;j.height=d.focusArea.height()/b.height(),j.width=d.focusArea.width()/b.width(),j.x=(g-c)/b.width(),j.y=(h-e)/b.height(),d.updatePreviewThumbnail(d.currentCropVariant,d.activeCropVariantTrigger),d.checkFocusAndCoverAreasCollision(j,k)?d.focusArea.addClass("has-nodrop"):d.focusArea.removeClass("has-nodrop")},stop:function(a,e){var f=250,g=b.offset(),h=g.left,i=g.top,j=d.focusArea.offset(),k=j.left,l=j.top,m=d.currentCropVariant,n=m.focusArea,o=m.coverAreas;d.checkFocusAndCoverAreasCollision(n,o)?e.element.animate(c.extend(e.originalPosition,e.originalSize),f,function(){n.height=d.focusArea.height()/b.height(),n.height=d.focusArea.height()/b.height(),n.width=d.focusArea.width()/b.width(),n.x=(k-h)/b.width(),n.y=(l-i)/b.height(),d.scaleAndMoveFocusArea(n),d.focusArea.removeClass("has-nodrop")}):d.scaleAndMoveFocusArea(n)}})},a.prototype.initCoverAreas=function(b,d){d.forEach(function(d){var e=c('<div class="cropper-cover-area t3js-cropper-cover-area"></div>');b.append(e),e.css({height:a.toCssPercent(d.height),left:a.toCssPercent(d.x),top:a.toCssPercent(d.y),width:a.toCssPercent(d.width)})})},a.prototype.updatePreviewThumbnail=function(b,c){var d,e=c.find(".t3js-cropper-preview-thumbnail-crop-area"),f=c.find(".t3js-cropper-preview-thumbnail-crop-image"),g=c.find(".t3js-cropper-preview-thumbnail-focus-area"),h=this.cropper.cropper("getImageData");e.css({height:a.toCssPercent(b.cropArea.height/h.naturalHeight),left:a.toCssPercent(b.cropArea.x/h.naturalWidth),top:a.toCssPercent(b.cropArea.y/h.naturalHeight),width:a.toCssPercent(b.cropArea.width/h.naturalWidth)}),b.focusArea&&g.css({height:a.toCssPercent(b.focusArea.height),left:a.toCssPercent(b.focusArea.x),top:a.toCssPercent(b.focusArea.y),width:a.toCssPercent(b.focusArea.width)}),d=e.css(["width","height","left","top"]),f.css({height:parseFloat(d.height)*(1/(b.cropArea.height/h.naturalHeight))+"px",margin:-1*parseFloat(d.left)+"px",marginTop:-1*parseFloat(d.top)+"px",width:parseFloat(d.width)*(1/(b.cropArea.width/h.naturalWidth))+"px"})},a.prototype.scaleAndMoveFocusArea=function(b){this.focusArea.css({height:a.toCssPercent(b.height),left:a.toCssPercent(b.x),top:a.toCssPercent(b.y),width:a.toCssPercent(b.width)}),this.currentCropVariant.focusArea=b,this.updatePreviewThumbnail(this.currentCropVariant,this.activeCropVariantTrigger),this.updateCropVariantData(this.currentCropVariant)},a.prototype.updateCropVariantData=function(a){var b=this.cropper.cropper("getImageData"),d=this.convertAbsoluteToRelativeCropArea(a.cropArea,b);this.data[a.id]=c.extend(!0,{},a,{cropArea:d})},a.prototype.setAspectRatio=function(a){this.cropper.cropper("setAspectRatio",a.value)},a.prototype.setCropArea=function(a){var b=this.currentCropVariant.allowedAspectRatios[this.currentCropVariant.selectedRatio];0===b.value?this.cropper.cropper("setData",{height:a.height,width:a.width,x:a.x,y:a.y}):this.cropper.cropper("setData",{height:a.height,x:a.x,y:a.y})},a.prototype.checkFocusAndCoverAreasCollision=function(a,b){return!!b&&b.some(function(b){return a.x<b.x+b.width&&a.x+a.width>b.x&&a.y<b.y+b.height&&a.height+a.y>b.y})},a.prototype.convertAbsoluteToRelativeCropArea=function(a,b){var c=a.height,d=a.width,e=a.x,f=a.y;return{height:c/b.naturalHeight,width:d/b.naturalWidth,x:e/b.naturalWidth,y:f/b.naturalHeight}},a.prototype.convertRelativeToAbsoluteCropArea=function(a,b){var c=a.height,d=a.width,e=a.x,f=a.y;return{height:c*b.naturalHeight,width:d*b.naturalWidth,x:e*b.naturalWidth,y:f*b.naturalHeight}},a.prototype.setPreviewImages=function(a){var b=this,d=this.cropper,e=d.cropper("getImageData");Object.keys(a).forEach(function(f){var g=a[f],h=b.convertRelativeToAbsoluteCropArea(g.cropArea,e),i=b.trigger.closest(".form-group").find('.t3js-image-manipulation-preview[data-crop-variant-id="'+f+'"]'),j=b.trigger.closest(".form-group").find('.t3js-image-manipulation-selected-ratio[data-crop-variant-id="'+f+'"]');if(0!==i.length){var k=i.width(),l=i.data("preview-height"),m=h.width/h.height,n=k/m;n>l?k=l*m:l=n,k>h.width&&(k=h.width,l=h.height);var o=k/h.width,p=c("<div />").html('<img src="'+d.attr("src")+'">'),q=b.currentModal.find('.t3-js-ratio-title[data-ratio-id="'+g.id+g.selectedRatio+'"]');j.text(q.text()),p.addClass("cropper-preview-container"),i.empty().append(p),p.wrap('<span class="thumbnail thumbnail-status"></span>'),p.width(k).height(l).find("img").css({height:e.naturalHeight*o,left:-h.x*o,top:-h.y*o,width:e.naturalWidth*o})}})},a.prototype.openPreview=function(b){var c=a.serializeCropVariants(b),d=this.trigger.attr("data-preview-url");d=d+"&cropVariants="+encodeURIComponent(c),window.open(d,"TYPO3ImageManipulationPreview")},a.prototype.save=function(b){var d=a.serializeCropVariants(b),e=c("#"+this.trigger.attr("data-field"));this.trigger.attr("data-crop-variants",JSON.stringify(b)),this.setPreviewImages(b),e.val(d),this.currentModal.modal("hide")},a.prototype.destroy=function(){this.currentModal&&(this.cropper.cropper("destroy"),this.cropper=null,this.currentModal=null,this.data=null)},a.prototype.resizeEnd=function(a){var b,d=this;c(window).on("resize",function(){clearTimeout(b),b=setTimeout(function(){a()},d.resizeTimeout)})},a}();return new f});
\ No newline at end of file
index 5ed8919..c924dab 100644 (file)
  *
  * The TYPO3 project - inspiring people to share!
  */
-define(["require", "exports", "jquery", "bootstrap", "TYPO3/CMS/Backend/jquery.clearable"], function (require, exports, $) {
-    "use strict";
-    /**
-     * Module: TYPO3/CMS/Backend/Login
-     * JavaScript module for the backend login form
-     * @exports TYPO3/CMS/Backend/Login
-     *
-     * Class and file name do not match as the class was renamed, but to keep overrides in place, the filename has to stay!
-     */
-    var BackendLogin = (function () {
-        function BackendLogin() {
-            var _this = this;
-            /**
-             * Hide all form fields and show a progress message and icon
-             */
-            this.showLoginProcess = function () {
-                _this.showLoadingIndicator();
-                $(_this.options.error).addClass('hidden');
-                $(_this.options.errorNoCookies).addClass('hidden');
-            };
-            /**
-             * Show the loading spinner in the submit button
-             */
-            this.showLoadingIndicator = function () {
-                $(_this.options.submitButton).button('loading');
-            };
-            /**
-             * Pass on to registered submit handler
-             *
-             * @param {Event} event
-             */
-            this.handleSubmit = function (event) {
-                _this.showLoginProcess();
-                if (typeof _this.options.submitHandler === 'function') {
-                    _this.options.submitHandler(event);
-                }
-            };
-            /**
-             * Store the new selected Interface in a cookie to save it for future visits
-             */
-            this.interfaceSelectorChanged = function () {
-                var now = new Date();
-                // cookie expires in one year
-                var expires = new Date(now.getTime() + 1000 * 60 * 60 * 24 * 365);
-                document.cookie = 'typo3-login-interface='
-                    + $(_this.options.interfaceField).val()
-                    + '; expires=' + expires.toUTCString() + ';';
-            };
-            /**
-             * Check if an interface was stored in a cookie and preselect it in the select box
-             */
-            this.checkForInterfaceCookie = function () {
-                if ($(_this.options.interfaceField).length) {
-                    var posStart = document.cookie.indexOf('typo3-login-interface=');
-                    if (posStart !== -1) {
-                        var selectedInterface = document.cookie.substr(posStart + 22);
-                        selectedInterface = selectedInterface.substr(0, selectedInterface.indexOf(';'));
-                        $(_this.options.interfaceField).val(selectedInterface);
-                    }
-                }
-            };
-            /**
-             * Hides input fields and shows cookie warning
-             */
-            this.showCookieWarning = function () {
-                $(_this.options.formFields).addClass('hidden');
-                $(_this.options.errorNoCookies).removeClass('hidden');
-            };
-            /**
-             * Hides cookie warning and shows input fields
-             */
-            this.hideCookieWarning = function () {
-                $(_this.options.formFields).removeClass('hidden');
-                $(_this.options.errorNoCookies).addClass('hidden');
-            };
-            /**
-             * Checks browser's cookie support
-             * see http://stackoverflow.com/questions/8112634/jquery-detecting-cookies-enabled
-             */
-            this.checkCookieSupport = function () {
-                var cookieEnabled = navigator.cookieEnabled;
-                // when cookieEnabled flag is present and false then cookies are disabled.
-                if (cookieEnabled === false) {
-                    _this.showCookieWarning();
-                }
-                else {
-                    // try to set a test cookie if we can't see any cookies and we're using
-                    // either a browser that doesn't support navigator.cookieEnabled
-                    // or IE (which always returns true for navigator.cookieEnabled)
-                    if (!document.cookie && (cookieEnabled === null || false)) {
-                        document.cookie = 'typo3-login-cookiecheck=1';
-                        if (!document.cookie) {
-                            _this.showCookieWarning();
-                        }
-                        else {
-                            // unset the cookie again
-                            document.cookie = 'typo3-login-cookiecheck=; expires=' + new Date(0).toUTCString();
-                        }
-                    }
-                }
-            };
-            /**
-             * Registers listeners for the Login Interface
-             */
-            this.initializeEvents = function () {
-                $(document).ajaxStart(_this.showLoadingIndicator);
-                $(_this.options.loginForm).on('submit', _this.handleSubmit);
-                // the Interface selector is not always present, so this check is needed
-                if ($(_this.options.interfaceField).length > 0) {
-                    $(document).on('change blur', _this.options.interfaceField, _this.interfaceSelectorChanged);
-                }
-                $('.t3js-clearable').clearable();
-                // carousel news height transition
-                $('.t3js-login-news-carousel').on('slide.bs.carousel', function (e) {
-                    var nextH = $(e.relatedTarget).height();
-                    var $element = $(e.target);
-                    $element.find('div.active').parent().animate({ height: nextH }, 500);
-                });
-            };
-            this.options = {
-                error: '.t3js-login-error',
-                errorNoCookies: '.t3js-login-error-nocookies',
-                formFields: '.t3js-login-formfields',
-                interfaceField: '.t3js-login-interface-field',
-                loginForm: '#typo3-login-form',
-                submitButton: '.t3js-login-submit',
-                submitHandler: null,
-                useridentField: '.t3js-login-userident-field',
-            };
-            this.checkCookieSupport();
-            this.checkForInterfaceCookie();
-            this.initializeEvents();
-            // prevent opening the login form in the backend frameset
-            if (top.location.href !== location.href) {
-                top.location.href = location.href;
-            }
-        }
-        return BackendLogin;
-    }());
-    return new BackendLogin();
-});
+define(["require","exports","jquery","bootstrap","TYPO3/CMS/Backend/jquery.clearable"],function(a,b,c){"use strict";var d=function(){function a(){var a=this;this.showLoginProcess=function(){a.showLoadingIndicator(),c(a.options.error).addClass("hidden"),c(a.options.errorNoCookies).addClass("hidden")},this.showLoadingIndicator=function(){c(a.options.submitButton).button("loading")},this.handleSubmit=function(b){a.showLoginProcess(),"function"==typeof a.options.submitHandler&&a.options.submitHandler(b)},this.interfaceSelectorChanged=function(){var b=new Date,d=new Date(b.getTime()+31536e6);document.cookie="typo3-login-interface="+c(a.options.interfaceField).val()+"; expires="+d.toUTCString()+";"},this.checkForInterfaceCookie=function(){if(c(a.options.interfaceField).length){var b=document.cookie.indexOf("typo3-login-interface=");if(b!==-1){var d=document.cookie.substr(b+22);d=d.substr(0,d.indexOf(";")),c(a.options.interfaceField).val(d)}}},this.showCookieWarning=function(){c(a.options.formFields).addClass("hidden"),c(a.options.errorNoCookies).removeClass("hidden")},this.hideCookieWarning=function(){c(a.options.formFields).removeClass("hidden"),c(a.options.errorNoCookies).addClass("hidden")},this.checkCookieSupport=function(){var b=navigator.cookieEnabled;b===!1?a.showCookieWarning():document.cookie||null!==b||(document.cookie="typo3-login-cookiecheck=1",document.cookie?document.cookie="typo3-login-cookiecheck=; expires="+new Date(0).toUTCString():a.showCookieWarning())},this.initializeEvents=function(){c(document).ajaxStart(a.showLoadingIndicator),c(a.options.loginForm).on("submit",a.handleSubmit),c(a.options.interfaceField).length>0&&c(document).on("change blur",a.options.interfaceField,a.interfaceSelectorChanged),c(".t3js-clearable").clearable(),c(".t3js-login-news-carousel").on("slide.bs.carousel",function(a){var b=c(a.relatedTarget).height(),d=c(a.target);d.find("div.active").parent().animate({height:b},500)})},this.options={error:".t3js-login-error",errorNoCookies:".t3js-login-error-nocookies",formFields:".t3js-login-formfields",interfaceField:".t3js-login-interface-field",loginForm:"#typo3-login-form",submitButton:".t3js-login-submit",submitHandler:null,useridentField:".t3js-login-userident-field"},this.checkCookieSupport(),this.checkForInterfaceCookie(),this.initializeEvents(),top.location.href!==location.href&&(top.location.href=location.href)}return a}();return new d});
\ No newline at end of file
index 95fc604..de328e4 100644 (file)
  *
  * The TYPO3 project - inspiring people to share!
  */
-define(["require", "exports", "jquery", "bootstrap"], function (require, exports, $) {
-    "use strict";
-    /**
-     * Module: TYPO3/CMS/Backend/Popover
-     * API for popover windows powered by Twitter Bootstrap.
-     * @exports TYPO3/CMS/Backend/Popover
-     */
-    var Popover = (function () {
-        function Popover() {
-            /**
-             * Default selector string.
-             *
-             * @return {string}
-             */
-            this.DEFAULT_SELECTOR = '[data-toggle="popover"]';
-        }
-        // noinspection JSMethodCanBeStatic
-        /**
-         * Initialize
-         */
-        Popover.prototype.initialize = function (selector) {
-            selector = selector || this.DEFAULT_SELECTOR;
-            $(selector).popover();
-        };
-        // noinspection JSMethodCanBeStatic
-        /**
-         * Popover wrapper function
-         *
-         * @param {JQuery} $element
-         */
-        Popover.prototype.popover = function ($element) {
-            $element.popover();
-        };
-        // noinspection JSMethodCanBeStatic
-        /**
-         * Set popover options on $element
-         *
-         * @param {JQuery} $element
-         * @param {PopoverOptions} options
-         */
-        Popover.prototype.setOptions = function ($element, options) {
-            options = options || {};
-            var title = options.title || $element.data('title') || '';
-            var content = options.content || $element.data('content') || '';
-            $element
-                .attr('data-original-title', title)
-                .attr('data-content', content)
-                .attr('data-placement', 'auto')
-                .popover(options);
-        };
-        // noinspection JSMethodCanBeStatic
-        /**
-         * Set popover option on $element
-         *
-         * @param {JQuery} $element
-         * @param {String} key
-         * @param {String} value
-         */
-        Popover.prototype.setOption = function ($element, key, value) {
-            $element.data('bs.popover').options[key] = value;
-        };
-        // noinspection JSMethodCanBeStatic
-        /**
-         * Show popover with title and content on $element
-         *
-         * @param {JQuery} $element
-         */
-        Popover.prototype.show = function ($element) {
-            $element.popover('show');
-        };
-        // noinspection JSMethodCanBeStatic
-        /**
-         * Hide popover on $element
-         *
-         * @param {JQuery} $element
-         */
-        Popover.prototype.hide = function ($element) {
-            $element.popover('hide');
-        };
-        // noinspection JSMethodCanBeStatic
-        /**
-         * Destroy popover on $element
-         *
-         * @param {Object} $element
-         */
-        Popover.prototype.destroy = function ($element) {
-            $element.popover('destroy');
-        };
-        // noinspection JSMethodCanBeStatic
-        /**
-         * Toggle popover on $element
-         *
-         * @param {Object} $element
-         */
-        Popover.prototype.toggle = function ($element) {
-            $element.popover('toggle');
-        };
-        return Popover;
-    }());
-    // create an instance, initialize and return it
-    var popover = new Popover();
-    popover.initialize();
-    // @deprecated since TYPO3 v9, will be removed in TYPO3 v10 prevent global object usage
-    TYPO3.Popover = popover;
-    return popover;
-});
+define(["require","exports","jquery","bootstrap"],function(a,b,c){"use strict";var d=function(){function a(){this.DEFAULT_SELECTOR='[data-toggle="popover"]'}return a.prototype.initialize=function(a){a=a||this.DEFAULT_SELECTOR,c(a).popover()},a.prototype.popover=function(a){a.popover()},a.prototype.setOptions=function(a,b){b=b||{};var c=b.title||a.data("title")||"",d=b.content||a.data("content")||"";a.attr("data-original-title",c).attr("data-content",d).attr("data-placement","auto").popover(b)},a.prototype.setOption=function(a,b,c){a.data("bs.popover").options[b]=c},a.prototype.show=function(a){a.popover("show")},a.prototype.hide=function(a){a.popover("hide")},a.prototype.destroy=function(a){a.popover("destroy")},a.prototype.toggle=function(a){a.popover("toggle")},a}(),e=new d;return e.initialize(),TYPO3.Popover=e,e});
\ No newline at end of file
index 07c9b27..9d52d5e 100644 (file)
  *
  * The TYPO3 project - inspiring people to share!
  */
-define(["require", "exports", "jquery", "TYPO3/CMS/Backend/Modal", "TYPO3/CMS/Backend/Severity"], function (require, exports, $, Modal, Severity) {
-    "use strict";
-    /**
-     * Module: TYPO3/CMS/Backend/RenameFile
-     * Modal to pick the required conflict strategy for colliding filenames
-     * @exports TYPO3/CMS/Backend/RenameFile
-     */
-    var RenameFile = (function () {
-        function RenameFile() {
-            this.initialize();
-        }
-        RenameFile.prototype.initialize = function () {
-            $('.t3js-submit-file-rename').on('click', this.checkForDuplicate);
-        };
-        RenameFile.prototype.checkForDuplicate = function (e) {
-            e.preventDefault();
-            var form = $('#' + $(e.currentTarget).attr('form'));
-            var fileNameField = form.find('input[name="data[rename][0][target]"]');
-            var conflictModeField = form.find('input[name="data[rename][0][conflictMode]"]');
-            var ajaxUrl = TYPO3.settings.ajaxUrls.file_exists;
-            $.ajax({
-                cache: false,
-                data: {
-                    fileName: fileNameField.val(),
-                    fileTarget: form.find('input[name="data[rename][0][destination]"]').val(),
-                },
-                success: function (response) {
-                    var fileExists = typeof response.uid !== 'undefined';
-                    var originalFileName = fileNameField.data('original');
-                    var newFileName = fileNameField.val();
-                    if (fileExists && originalFileName !== newFileName) {
-                        var description = TYPO3.lang['file_rename.exists.description']
-                            .replace('{0}', originalFileName).replace('{1}', newFileName);
-                        var modal = Modal.confirm(TYPO3.lang['file_rename.exists.title'], description, Severity.warning, [
-                            {
-                                active: true,
-                                btnClass: 'btn-default',
-                                name: 'cancel',
-                                text: TYPO3.lang['file_rename.actions.cancel'],
-                            },
-                            {
-                                btnClass: 'btn-primary',
-                                name: 'rename',
-                                text: TYPO3.lang['file_rename.actions.rename'],
-                            },
-                            {
-                                btnClass: 'btn-default',
-                                name: 'replace',
-                                text: TYPO3.lang['file_rename.actions.override'],
-                            },
-                        ]);
-                        modal.on('button.clicked', function (event) {
-                            if (event.target.name !== 'cancel') {
-                                conflictModeField.val(event.target.name);
-                                form.submit();
-                            }
-                            Modal.dismiss();
-                        });
-                    }
-                    else {
-                        form.submit();
-                    }
-                },
-                url: ajaxUrl,
-            });
-        };
-        return RenameFile;
-    }());
-    return new RenameFile();
-});
+define(["require","exports","jquery","TYPO3/CMS/Backend/Modal","TYPO3/CMS/Backend/Severity"],function(a,b,c,d,e){"use strict";var f=function(){function a(){this.initialize()}return a.prototype.initialize=function(){c(".t3js-submit-file-rename").on("click",this.checkForDuplicate)},a.prototype.checkForDuplicate=function(a){a.preventDefault();var b=c("#"+c(a.currentTarget).attr("form")),f=b.find('input[name="data[rename][0][target]"]'),g=b.find('input[name="data[rename][0][conflictMode]"]'),h=TYPO3.settings.ajaxUrls.file_exists;c.ajax({cache:!1,data:{fileName:f.val(),fileTarget:b.find('input[name="data[rename][0][destination]"]').val()},success:function(a){var c="undefined"!=typeof a.uid,h=f.data("original"),i=f.val();if(c&&h!==i){var j=TYPO3.lang["file_rename.exists.description"].replace("{0}",h).replace("{1}",i),k=d.confirm(TYPO3.lang["file_rename.exists.title"],j,e.warning,[{active:!0,btnClass:"btn-default",name:"cancel",text:TYPO3.lang["file_rename.actions.cancel"]},{btnClass:"btn-primary",name:"rename",text:TYPO3.lang["file_rename.actions.rename"]},{btnClass:"btn-default",name:"replace",text:TYPO3.lang["file_rename.actions.override"]}]);k.on("button.clicked",function(a){"cancel"!==a.target.name&&(g.val(a.target.name),b.submit()),d.dismiss()})}else b.submit()},url:h})},a}();return new f});
\ No newline at end of file
index 83c9af8..80174ed 100644 (file)
  *
  * The TYPO3 project - inspiring people to share!
  */
-define(["require", "exports", "./Storage/Client", "./Storage/Persistent"], function (require, exports, Client, Persistent) {
-    "use strict";
-    /**
-     * Module: TYPO3/CMS/Backend/Storage
-     * Adds a public API for the browsers' localStorage called
-     * TYPO3.Storage.Client and the Backend Users "uc",
-     * available via TYPO3.Storage.Persistent
-     * @exports TYPO3/CMS/Backend/Storage
-     * @deprecated
-     */
-    var Storage = (function () {
-        function Storage() {
-            var _this = this;
-            this.logDeprecated = function (className, methodName) {
-                if (console) {
-                    console.warn('top.TYPO3.Storage.' + className + '.' + methodName + '() is marked as deprecated since TYPO3 v9 and will be '
-                        + 'removed in TYPO3 v10.');
-                }
-            };
-            this.Client = {
-                clear: function () {
-                    _this.logDeprecated('Client', 'clear');
-                    Client.clear();
-                },
-                get: function (key) {
-                    _this.logDeprecated('Client', 'get');
-                    return Client.get(key);
-                },
-                isset: function (key) {
-                    _this.logDeprecated('Client', 'isset');
-                    return Client.isset(key);
-                },
-                set: function (key, value) {
-                    _this.logDeprecated('Client', 'set');
-                    return Client.set(key, value);
-                },
-                unset: function (key) {
-                    _this.logDeprecated('Client', 'unset');
-                    return Client.unset(key);
-                },
-            };
-            this.Persistent = {
-                addToList: function (key, value) {
-                    _this.logDeprecated('Persistent', 'addToList');
-                    return Persistent.addToList(key, value);
-                },
-                clear: function () {
-                    _this.logDeprecated('Persistent', 'clear');
-                    Persistent.clear();
-                },
-                get: function (key) {
-                    _this.logDeprecated('Persistent', 'get');
-                    return Persistent.get(key);
-                },
-                isset: function (key) {
-                    _this.logDeprecated('Persistent', 'isset');
-                    return Persistent.isset(key);
-                },
-                load: function (data) {
-                    _this.logDeprecated('Persistent', 'load');
-                    return Persistent.load(data);
-                },
-                removeFromList: function (key, value) {
-                    _this.logDeprecated('Persistent', 'removeFromList');
-                    return Persistent.removeFromList(key, value);
-                },
-                set: function (key, value) {
-                    _this.logDeprecated('Persistent', 'set');
-                    return Persistent.set(key, value);
-                },
-                unset: function (key) {
-                    _this.logDeprecated('Persistent', 'unset');
-                    return Persistent.unset(key);
-                },
-            };
-        }
-        return Storage;
-    }());
-    var storageObject;
-    try {
-        // fetch from opening window
-        if (window.opener && window.opener.TYPO3 && window.opener.TYPO3.Storage) {
-            storageObject = window.opener.TYPO3.Storage;
-        }
-        // fetch from parent
-        if (parent && parent.window.TYPO3 && parent.window.TYPO3.Storage) {
-            storageObject = parent.window.TYPO3.Storage;
-        }
-        // fetch object from outer frame
-        if (top && top.TYPO3.Storage) {
-            storageObject = top.TYPO3.Storage;
-        }
-    }
-    catch (e) {
-        // this only happens if the opener, parent or top is some other url (eg a local file)
-        // which loaded the current window. Then the browser's cross domain policy jumps in
-        // and raises an exception.
-        // for this case we are safe and we can create our global object below.
-    }
-    if (!storageObject) {
-        storageObject = new Storage();
-    }
-    TYPO3.Storage = storageObject;
-    return storageObject;
-});
+define(["require","exports","./Storage/Client","./Storage/Persistent"],function(a,b,c,d){"use strict";var e,f=function(){function a(){var a=this;this.logDeprecated=function(a,b){console&&console.warn("top.TYPO3.Storage."+a+"."+b+"() is marked as deprecated since TYPO3 v9 and will be removed in TYPO3 v10.")},this.Client={clear:function(){a.logDeprecated("Client","clear"),c.clear()},get:function(b){return a.logDeprecated("Client","get"),c.get(b)},isset:function(b){return a.logDeprecated("Client","isset"),c.isset(b)},set:function(b,d){return a.logDeprecated("Client","set"),c.set(b,d)},unset:function(b){return a.logDeprecated("Client","unset"),c.unset(b)}},this.Persistent={addToList:function(b,c){return a.logDeprecated("Persistent","addToList"),d.addToList(b,c)},clear:function(){a.logDeprecated("Persistent","clear"),d.clear()},get:function(b){return a.logDeprecated("Persistent","get"),d.get(b)},isset:function(b){return a.logDeprecated("Persistent","isset"),d.isset(b)},load:function(b){return a.logDeprecated("Persistent","load"),d.load(b)},removeFromList:function(b,c){return a.logDeprecated("Persistent","removeFromList"),d.removeFromList(b,c)},set:function(b,c){return a.logDeprecated("Persistent","set"),d.set(b,c)},unset:function(b){return a.logDeprecated("Persistent","unset"),d.unset(b)}}}return a}();try{window.opener&&window.opener.TYPO3&&window.opener.TYPO3.Storage&&(e=window.opener.TYPO3.Storage),parent&&parent.window.TYPO3&&parent.window.TYPO3.Storage&&(e=parent.window.TYPO3.Storage),top&&top.TYPO3.Storage&&(e=top.TYPO3.Storage)}catch(a){}return e||(e=new f),TYPO3.Storage=e,e});
\ No newline at end of file
index 0ed5c53..a538eb0 100644 (file)
  *
  * The TYPO3 project - inspiring people to share!
  */
-define(["require", "exports"], function (require, exports) {
-    "use strict";
-    /**
-     * Module: TYPO3/CMS/Backend/Storage/Client
-     * Wrapper for localStorage
-     * @exports TYPO3/CMS/Backend/Storage/Client
-     */
-    var Client = (function () {
-        function Client() {
-            var _this = this;
-            /**
-             * Simple localStorage wrapper, to get value from localStorage
-             * @param {string} key
-             * @returns {string}
-             */
-            this.get = function (key) {
-                return localStorage.getItem('t3-' + key);
-            };
-            /**
-             * Simple localStorage wrapper, to set value from localStorage
-             *
-             * @param {string} key
-             * @param {string} value
-             * @returns {string}
-             */
-            this.set = function (key, value) {
-                localStorage.setItem('t3-' + key, value);
-            };
-            /**
-             * Simple localStorage wrapper, to unset value from localStorage
-             *
-             * @param {string} key
-             */
-            this.unset = function (key) {
-                localStorage.removeItem('t3-' + key);
-            };
-            /**
-             * Simple localStorage wrapper, to clear localStorage
-             */
-            this.clear = function () {
-                localStorage.clear();
-            };
-            /**
-             * Checks if a key was set before, useful to not do all the undefined checks all the time
-             *
-             * @param {string} key
-             * @returns {boolean}
-             */
-            this.isset = function (key) {
-                var value = _this.get(key);
-                return (typeof value !== 'undefined' && value !== null);
-            };
-        }
-        return Client;
-    }());
-    return new Client();
-});
+define(["require","exports"],function(a,b){"use strict";var c=function(){function a(){var a=this;this.get=function(a){return localStorage.getItem("t3-"+a)},this.set=function(a,b){localStorage.setItem("t3-"+a,b)},this.unset=function(a){localStorage.removeItem("t3-"+a)},this.clear=function(){localStorage.clear()},this.isset=function(b){var c=a.get(b);return"undefined"!=typeof c&&null!==c}}return a}();return new c});
\ No newline at end of file
index 7e1a967..55b6df6 100644 (file)
  *
  * The TYPO3 project - inspiring people to share!
  */
-define(["require", "exports", "jquery"], function (require, exports, $) {
-    "use strict";
-    /**
-     * Module: TYPO3/CMS/Backend/Storage/Persistent
-     * Wrapper for persistent storage in UC
-     * @exports TYPO3/CMS/Backend/Storage/Persistent
-     */
-    var Persistent = (function () {
-        function Persistent() {
-            var _this = this;
-            this.data = false;
-            /**
-             * Persistent storage, stores everything on the server via AJAX, does a greedy load on read
-             * common functions get/set/clear
-             *
-             * @param {String} key
-             * @returns {*}
-             */
-            this.get = function (key) {
-                var me = _this;
-                if (_this.data === false) {
-                    var value_1;
-                    _this.loadFromServer().done(function () {
-                        value_1 = me.getRecursiveDataByDeepKey(me.data, key.split('.'));
-                    });
-                    return value_1;
-                }
-                return _this.getRecursiveDataByDeepKey(_this.data, key.split('.'));
-            };
-            /**
-             * Store data persistent on server
-             *
-             * @param {String} key
-             * @param {String} value
-             * @returns {$}
-             */
-            this.set = function (key, value) {
-                if (_this.data !== false) {
-                    _this.data = _this.setRecursiveDataByDeepKey(_this.data, key.split('.'), value);
-                }
-                return _this.storeOnServer(key, value);
-            };
-            /**
-             * @param {string} key
-             * @param {string} value
-             * @returns {$}
-             */
-            this.addToList = function (key, value) {
-                var me = _this;
-                return $.ajax(TYPO3.settings.ajaxUrls.usersettings_process, {
-                    data: {
-                        action: 'addToList',
-                        key: key,
-                        value: value,
-                    },
-                    method: 'post',
-                }).done(function (data) {
-                    me.data = data;
-                });
-            };
-            /**
-             * @param {string} key
-             * @param {string} value
-             * @returns {$}
-             */
-            this.removeFromList = function (key, value) {
-                var me = _this;
-                return $.ajax(TYPO3.settings.ajaxUrls.usersettings_process, {
-                    data: {
-                        action: 'removeFromList',
-                        key: key,
-                        value: value,
-                    },
-                    method: 'post',
-                }).done(function (data) {
-                    me.data = data;
-                });
-            };
-            this.unset = function (key) {
-                var me = _this;
-                return $.ajax(TYPO3.settings.ajaxUrls.usersettings_process, {
-                    data: {
-                        action: 'unset',
-                        key: key,
-                    },
-                    method: 'post',
-                }).done(function (data) {
-                    me.data = data;
-                });
-            };
-            /**
-             * Clears the UC
-             */
-            this.clear = function () {
-                $.ajax(TYPO3.settings.ajaxUrls.usersettings_process, {
-                    data: {
-                        action: 'clear',
-                    },
-                });
-                _this.data = false;
-            };
-            /**
-             * Checks if a key was set before, useful to not do all the undefined checks all the time
-             *
-             * @param {string} key
-             * @returns {boolean}
-             */
-            this.isset = function (key) {
-                var value = _this.get(key);
-                return (typeof value !== 'undefined' && value !== null);
-            };
-            /**
-             * Loads the data from outside, only used for the initial call from BackendController
-             *
-             * @param {String} data
-             */
-            this.load = function (data) {
-                _this.data = data;
-            };
-            /**
-             * Loads all data from the server
-             *
-             * @returns {$}
-             */
-            this.loadFromServer = function () {
-                var me = _this;
-                return $.ajax(TYPO3.settings.ajaxUrls.usersettings_process, {
-                    async: false,
-                    data: {
-                        action: 'getAll',
-                    },
-                }).done(function (data) {
-                    me.data = data;
-                });
-            };
-            /**
-             * Stores data on the server, and gets the updated data on return
-             * to always be up-to-date inside the browser
-             *
-             * @param {string} key
-             * @param {string} value
-             * @returns {*}
-             */
-            this.storeOnServer = function (key, value) {
-                var me = _this;
-                return $.ajax(TYPO3.settings.ajaxUrls.usersettings_process, {
-                    data: {
-                        action: 'set',
-                        key: key,
-                        value: value,
-                    },
-                    method: 'post',
-                }).done(function (data) {
-                    me.data = data;
-                });
-            };
-            /**
-             * Helper function used to set a value which could have been a flat object key data["my.foo.bar"] to
-             * data[my][foo][bar] is called recursively by itself
-             *
-             * @param {Object} data the data to be uased as base
-             * @param {String} keyParts the keyParts for the subtree
-             * @returns {Object}
-             */
-            this.getRecursiveDataByDeepKey = function (data, keyParts) {
-                if (keyParts.length === 1) {
-                    return (data || {})[keyParts[0]];
-                }
-                var firstKey = keyParts.shift();
-                return _this.getRecursiveDataByDeepKey(data[firstKey] || {}, keyParts);
-            };
-            /**
-             * helper function used to set a value which could have been a flat object key data["my.foo.bar"] to
-             * data[my][foo][bar]
-             * is called recursively by itself
-             *
-             * @param data
-             * @param {any[]} keyParts
-             * @param {string} value
-             * @returns {any[]}
-             */
-            this.setRecursiveDataByDeepKey = function (data, keyParts, value) {
-                if (keyParts.length === 1) {
-                    data = data || {};
-                    data[keyParts[0]] = value;
-                }
-                else {
-                    var firstKey = keyParts.shift();
-                    data[firstKey] = _this.setRecursiveDataByDeepKey(data[firstKey] || {}, keyParts, value);
-                }
-                return data;
-            };
-        }
-        return Persistent;
-    }());
-    return new Persistent();
-});
+define(["require","exports","jquery"],function(a,b,c){"use strict";var d=function(){function a(){var a=this;this.data=!1,this.get=function(b){var c=a;if(a.data===!1){var d;return a.loadFromServer().done(function(){d=c.getRecursiveDataByDeepKey(c.data,b.split("."))}),d}return a.getRecursiveDataByDeepKey(a.data,b.split("."))},this.set=function(b,c){return a.data!==!1&&(a.data=a.setRecursiveDataByDeepKey(a.data,b.split("."),c)),a.storeOnServer(b,c)},this.addToList=function(b,d){var e=a;return c.ajax(TYPO3.settings.ajaxUrls.usersettings_process,{data:{action:"addToList",key:b,value:d},method:"post"}).done(function(a){e.data=a})},this.removeFromList=function(b,d){var e=a;return c.ajax(TYPO3.settings.ajaxUrls.usersettings_process,{data:{action:"removeFromList",key:b,value:d},method:"post"}).done(function(a){e.data=a})},this.unset=function(b){var d=a;return c.ajax(TYPO3.settings.ajaxUrls.usersettings_process,{data:{action:"unset",key:b},method:"post"}).done(function(a){d.data=a})},this.clear=function(){c.ajax(TYPO3.settings.ajaxUrls.usersettings_process,{data:{action:"clear"}}),a.data=!1},this.isset=function(b){var c=a.get(b);return"undefined"!=typeof c&&null!==c},this.load=function(b){a.data=b},this.loadFromServer=function(){var b=a;return c.ajax(TYPO3.settings.ajaxUrls.usersettings_process,{async:!1,data:{action:"getAll"}}).done(function(a){b.data=a})},this.storeOnServer=function(b,d){var e=a;return c.ajax(TYPO3.settings.ajaxUrls.usersettings_process,{data:{action:"set",key:b,value:d},method:"post"}).done(function(a){e.data=a})},this.getRecursiveDataByDeepKey=function(b,c){if(1===c.length)return(b||{})[c[0]];var d=c.shift();return a.getRecursiveDataByDeepKey(b[d]||{},c)},this.setRecursiveDataByDeepKey=function(b,c,d){if(1===c.length)b=b||{},b[c[0]]=d;else{var e=c.shift();b[e]=a.setRecursiveDataByDeepKey(b[e]||{},c,d)}return b}}return a}();return new d});
\ No newline at end of file
index 5cf18f0..b364d69 100644 (file)
  *
  * The TYPO3 project - inspiring people to share!
  */
-define(["require", "exports", "jquery", "./Storage/Client", "bootstrap"], function (require, exports, $, Client) {
-    "use strict";
-    /**
-     * Module: TYPO3/CMS/Backend/Tabs
-     * @exports TYPO3/CMS/Backend/Tabs
-     */
-    var Tabs = (function () {
-        function Tabs() {
-            this.cacheTimeInSeconds = 1800;
-            this.storeLastActiveTab = true;
-            this.storage = Client;
-            var that = this;
-            $('.t3js-tabs').each(function () {
-                var $tabContainer = $(this);
-                that.storeLastActiveTab = $tabContainer.data('storeLastTab') === 1;
-                var currentActiveTab = that.receiveActiveTab($tabContainer.attr('id'));
-                if (currentActiveTab) {
-                    $tabContainer.find('a[href="' + currentActiveTab + '"]').tab('show');
-                }
-                $tabContainer.on('show.bs.tab', function (e) {
-                    if (that.storeLastActiveTab) {
-                        var id = e.currentTarget.id;
-                        var target = e.target.hash;
-                        that.storeActiveTab(id, target);
-                    }
-                });
-            });
-        }
-        /**
-         * Resolve timestamp
-         */
-        Tabs.getTimestamp = function () {
-            return Math.round((new Date()).getTime() / 1000);
-        };
-        /**
-         * Receive active tab from storage
-         *
-         * @param {string} id
-         * @returns {string}
-         */
-        Tabs.prototype.receiveActiveTab = function (id) {
-            var target = this.storage.get(id) || '';
-            var expire = this.storage.get(id + '.expire') || 0;
-            if (expire > Tabs.getTimestamp()) {
-                return target;
-            }
-            return '';
-        };
-        /**
-         * Set active tab to storage
-         *
-         * @param {string} id
-         * @param {string} target
-         */
-        Tabs.prototype.storeActiveTab = function (id, target) {
-            this.storage.set(id, target);
-            this.storage.set(id + '.expire', Tabs.getTimestamp() + this.cacheTimeInSeconds);
-        };
-        return Tabs;
-    }());
-    var tabs = new Tabs();
-    return tabs;
-});
+define(["require","exports","jquery","./Storage/Client","bootstrap"],function(a,b,c,d){"use strict";var e=function(){function a(){this.cacheTimeInSeconds=1800,this.storeLastActiveTab=!0,this.storage=d;var a=this;c(".t3js-tabs").each(function(){var b=c(this);a.storeLastActiveTab=1===b.data("storeLastTab");var d=a.receiveActiveTab(b.attr("id"));d&&b.find('a[href="'+d+'"]').tab("show"),b.on("show.bs.tab",function(b){if(a.storeLastActiveTab){var c=b.currentTarget.id,d=b.target.hash;a.storeActiveTab(c,d)}})})}return a.getTimestamp=function(){return Math.round((new Date).getTime()/1e3)},a.prototype.receiveActiveTab=function(b){var c=this.storage.get(b)||"",d=this.storage.get(b+".expire")||0;return d>a.getTimestamp()?c:""},a.prototype.storeActiveTab=function(b,c){this.storage.set(b,c),this.storage.set(b+".expire",a.getTimestamp()+this.cacheTimeInSeconds)},a}(),f=new e;return f});
\ No newline at end of file
index df99e71..1623ecb 100644 (file)
  *
  * The TYPO3 project - inspiring people to share!
  */
-define(["require", "exports", "jquery", "./Login"], function (require, exports, $, Login) {
-    "use strict";
-    /**
-     * Module: TYPO3/CMS/Backend/UserPassLogin
-     * JavaScript module for the UsernamePasswordLoginProvider
-     * @exports TYPO3/CMS/Backend/UserPassLogin
-     */
-    var UserPassLogin = (function () {
-        function UserPassLogin() {
-            var _this = this;
-            /**
-             * Reset user password field to prevent it from being submitted
-             */
-            this.resetPassword = function () {
-                var $passwordField = $(_this.options.passwordField);
-                if ($passwordField.val()) {
-                    $(Login.options.useridentField).val($passwordField.val());
-                    $passwordField.val('');
-                }
-            };
-            this.showCapsLockWarning = function (event) {
-                $(event.target)
-                    .parent()
-                    .parent()
-                    .find('.t3js-login-alert-capslock')
-                    .toggleClass('hidden', !UserPassLogin.isCapslockEnabled(event));
-            };
-            this.options = {
-                passwordField: '.t3js-login-password-field',
-                usernameField: '.t3js-login-username-field',
-            };
-            // register submit handler
-            Login.options.submitHandler = this.resetPassword;
-            var $usernameField = $(this.options.usernameField);
-            var $passwordField = $(this.options.passwordField);
-            $usernameField.on('keypress', this.showCapsLockWarning);
-            $passwordField.on('keypress', this.showCapsLockWarning);
-            // if the login screen is shown in the login_frameset window for re-login,
-            // then try to get the username of the current/former login from opening windows main frame:
-            try {
-                if (parent.opener
-                    && parent.opener.TYPO3
-                    && parent.opener.TYPO3.configuration
-                    && parent.opener.TYPO3.configuration.username) {
-                    $usernameField.val(parent.opener.TYPO3.configuration.username);
-                }
-            }
-            catch (error) {
-                // continue
-            }
-            if ($usernameField.val() === '') {
-                $usernameField.focus();
-            }
-            else {
-                $passwordField.focus();
-            }
-        }
-        /**
-         * Checks whether capslock is enabled (returns TRUE if enabled, false otherwise)
-         * thanks to http://24ways.org/2007/capturing-caps-lock
-         *
-         * @param {Event} e
-         * @returns {boolean}
-         */
-        UserPassLogin.isCapslockEnabled = function (e) {
-            var ev = e ? e : window.event;
-            if (!ev) {
-                return false;
-            }
-            // get key pressed
-            var pressedKeyAsciiCode = -1;
-            if (ev.which) {
-                pressedKeyAsciiCode = ev.which;
-            }
-            else if (ev.keyCode) {
-                pressedKeyAsciiCode = ev.keyCode;
-            }
-            // get shift status
-            var shiftPressed = false;
-            if (ev.shiftKey) {
-                shiftPressed = ev.shiftKey;
-            }
-            else if (ev.modifiers) {
-                /* tslint:disable:no-bitwise */
-                shiftPressed = !!(ev.modifiers & 4);
-            }
-            return (pressedKeyAsciiCode >= 65 && pressedKeyAsciiCode <= 90 && !shiftPressed)
-                || (pressedKeyAsciiCode >= 97 && pressedKeyAsciiCode <= 122 && shiftPressed);
-        };
-        return UserPassLogin;
-    }());
-    return new UserPassLogin();
-});
+define(["require","exports","jquery","./Login"],function(a,b,c,d){"use strict";var e=function(){function a(){var b=this;this.resetPassword=function(){var a=c(b.options.passwordField);a.val()&&(c(d.options.useridentField).val(a.val()),a.val(""))},this.showCapsLockWarning=function(b){c(b.target).parent().parent().find(".t3js-login-alert-capslock").toggleClass("hidden",!a.isCapslockEnabled(b))},this.options={passwordField:".t3js-login-password-field",usernameField:".t3js-login-username-field"},d.options.submitHandler=this.resetPassword;var e=c(this.options.usernameField),f=c(this.options.passwordField);e.on("keypress",this.showCapsLockWarning),f.on("keypress",this.showCapsLockWarning);try{parent.opener&&parent.opener.TYPO3&&parent.opener.TYPO3.configuration&&parent.opener.TYPO3.configuration.username&&e.val(parent.opener.TYPO3.configuration.username)}catch(a){}""===e.val()?e.focus():f.focus()}return a.isCapslockEnabled=function(a){var b=a?a:window.event;if(!b)return!1;var c=-1;b.which?c=b.which:b.keyCode&&(c=b.keyCode);var d=!1;return b.shiftKey?d=b.shiftKey:b.modifiers&&(d=!!(4&b.modifiers)),c>=65&&c<=90&&!d||c>=97&&c<=122&&d},a}();return new e});
\ No newline at end of file
index 5df3af0..007af16 100644 (file)
  *
  * The TYPO3 project - inspiring people to share!
  */
-define(["require", "exports"], function (require, exports) {
-    "use strict";
-    /**
-     * Module: TYPO3/CMS/Backend/Utility
-     */
-    var Utility = (function () {
-        function Utility() {
-            /**
-             * Checks if a given number is really a number
-             *
-             * Taken from:
-             * http://dl.dropbox.com/u/35146/js/tests/isNumber.html
-             *
-             * @param {number} value
-             * @returns {boolean}
-             */
-            this.isNumber = function (value) {
-                return !isNaN(parseFloat(value.toString())) && isFinite(value);
-            };
-            /**
-             * Gets a parameter from a given url
-             *
-             * @param {string} url
-             * @param {string} parameter
-             * @returns {string}
-             */
-            this.getParameterFromUrl = function (url, parameter) {
-                if (typeof url.split !== 'function') {
-                    return '';
-                }
-                var parts = url.split('?');
-                var value = '';
-                if (parts.length >= 2) {
-                    var queryString = parts.join('?');
-                    var prefix = encodeURIComponent(parameter) + '=';
-                    var parameters = queryString.split(/[&;]/g);
-                    for (var i = parameters.length; i-- > 0;) {
-                        if (parameters[i].lastIndexOf(prefix, 0) !== -1) {
-                            value = parameters[i].split('=')[1];
-                            break;
-                        }
-                    }
-                }
-                return value;
-            };
-            /**
-             * Updates a parameter inside of given url
-             *
-             * @param {string} url
-             * @param {string} key
-             * @param {string} value
-             * @returns {string}
-             */
-            this.updateQueryStringParameter = function (url, key, value) {
-                var re = new RegExp('([?&])' + key + '=.*?(&|$)', 'i');
-                var separator = url.indexOf('?') !== -1 ? '&' : '?';
-                if (url.match(re)) {
-                    return url.replace(re, '$1' + key + '=' + value + '$2');
-                }
-                return url + separator + key + '=' + value;
-            };
-        }
-        return Utility;
-    }());
-    var utilityObject = new Utility();
-    // @deprecated since TYPO3 v9, will be removed in TYPO3 v10. Use the TYPO3/CMS/Backend/Utility module in AMD instead
-    TYPO3.Utility = utilityObject;
-    return utilityObject;
-});
+define(["require","exports"],function(a,b){"use strict";var c=function(){function a(){this.isNumber=function(a){return!isNaN(parseFloat(a.toString()))&&isFinite(a)},this.getParameterFromUrl=function(a,b){if("function"!=typeof a.split)return"";var c=a.split("?"),d="";if(c.length>=2)for(var e=c.join("?"),f=encodeURIComponent(b)+"=",g=e.split(/[&;]/g),h=g.length;h-- >0;)if(g[h].lastIndexOf(f,0)!==-1){d=g[h].split("=")[1];break}return d},this.updateQueryStringParameter=function(a,b,c){var d=new RegExp("([?&])"+b+"=.*?(&|$)","i"),e=a.indexOf("?")!==-1?"&":"?";return a.match(d)?a.replace(d,"$1"+b+"="+c+"$2"):a+e+b+"="+c}}return a}(),d=new c;return TYPO3.Utility=d,d});
\ No newline at end of file
index 823a719..a57825e 100644 (file)
  *
  * The TYPO3 project - inspiring people to share!
  */
-define(["require", "exports", "TYPO3/CMS/Backend/Modal", "TYPO3/CMS/Backend/Severity"], function (require, exports, Modal, Severity) {
-    "use strict";
-    /**
-     * Module: TYPO3/CMS/Backend/Wizard/NewContentElement
-     * NewContentElement JavaScript
-     * @exports TYPO3/CMS/Backend/Wizard/NewContentElement
-     */
-    var NewContentElement = (function () {
-        function NewContentElement() {
-        }
-        NewContentElement.wizard = function (url, title) {
-            Modal.advanced({
-                callback: function (currentModal) {
-                    currentModal.find('.t3js-modal-body').addClass('t3-new-content-element-wizard-window');
-                },
-                content: url,
-                severity: Severity.notice,
-                size: Modal.sizes.medium,
-                title: title,
-                type: Modal.types.ajax,
-            });
-        };
-        return NewContentElement;
-    }());
-    return NewContentElement;
-});
+define(["require","exports","TYPO3/CMS/Backend/Modal","TYPO3/CMS/Backend/Severity"],function(a,b,c,d){"use strict";var e=function(){function a(){}return a.wizard=function(a,b){c.advanced({callback:function(a){a.find(".t3js-modal-body").addClass("t3-new-content-element-wizard-window")},content:a,severity:d.notice,size:c.sizes.medium,title:b,type:c.types.ajax})},a}();return e});
\ No newline at end of file
index ebe67ed..474b26c 100644 (file)
  *
  * The TYPO3 project - inspiring people to share!
  */
-define(["require", "exports", "TYPO3/CMS/Backend/BackendException"], function (require, exports, BackendException_1) {
-    "use strict";
-    Object.defineProperty(exports, "__esModule", { value: true });
-    describe('TYPO3/CMS/Backend/BackendException', function () {
-        it('sets exception message', function () {
-            var backendException = new BackendException_1.BackendException('some message');
-            expect(backendException.message).toBe('some message');
-        });
-        it('sets exception code', function () {
-            var backendException = new BackendException_1.BackendException('', 12345);
-            expect(backendException.code).toBe(12345);
-        });
-    });
-});
+define(["require","exports","TYPO3/CMS/Backend/BackendException"],function(a,b,c){"use strict";Object.defineProperty(b,"__esModule",{value:!0}),describe("TYPO3/CMS/Backend/BackendException",function(){it("sets exception message",function(){var a=new c.BackendException("some message");expect(a.message).toBe("some message")}),it("sets exception code",function(){var a=new c.BackendException("",12345);expect(a.code).toBe(12345)})})});
\ No newline at end of file
index 9b36338..f7381a9 100644 (file)
  *
  * The TYPO3 project - inspiring people to share!
  */
-define(["require", "exports", "TYPO3/CMS/Backend/GridEditor"], function (require, exports, GridEditor_1) {
-    "use strict";
-    Object.defineProperty(exports, "__esModule", { value: true });
-    describe('TYPO3/CMS/Backend/GridEditorTest:', function () {
-        describe('tests for stripMarkup', function () {
-            it('works with string which contains html markup only', function () {
-                expect(GridEditor_1.GridEditor.stripMarkup('<b>foo</b>')).toBe('');
-            });
-            it('works with string which contains html markup and normal text', function () {
-                expect(GridEditor_1.GridEditor.stripMarkup('<b>foo</b> bar')).toBe(' bar');
-            });
-        });
-    });
-});
+define(["require","exports","TYPO3/CMS/Backend/GridEditor"],function(a,b,c){"use strict";Object.defineProperty(b,"__esModule",{value:!0}),describe("TYPO3/CMS/Backend/GridEditorTest:",function(){describe("tests for stripMarkup",function(){it("works with string which contains html markup only",function(){expect(c.GridEditor.stripMarkup("<b>foo</b>")).toBe("")}),it("works with string which contains html markup and normal text",function(){expect(c.GridEditor.stripMarkup("<b>foo</b> bar")).toBe(" bar")})})})});
\ No newline at end of file
index 80d6072..c63a559 100644 (file)
  *
  * The TYPO3 project - inspiring people to share!
  */
-define(["require", "exports", "cm/lib/codemirror", "jquery"], function (require, exports, CodeMirror, $) {
-    "use strict";
-    /**
-     * Module: TYPO3/CMS/T3editor/T3editor
-     * Renders CodeMirror into FormEngine
-     * @exports TYPO3/CMS/T3editor/T3editor
-     */
-    var T3editor = (function () {
-        /**
-         * The constructor, set the class properties default values
-         */
-        function T3editor() {
-            this.initialize();
-        }
-        /**
-         * @param {string} position
-         * @param {string} label
-         * @returns {HTMLElement}
-         */
-        T3editor.createPanelNode = function (position, label) {
-            var $panelNode = $('<div />', {
-                class: 'CodeMirror-panel CodeMirror-panel-' + position,
-                id: 'panel-' + position,
-            }).append($('<span />').text(label));
-            return $panelNode.get(0);
-        };
-        /**
-         * Initializes CodeMirror on available texteditors
-         */
-        T3editor.prototype.findAndInitializeEditors = function () {
-            $(document).find('textarea.t3editor').each(function () {
-                var $textarea = $(this);
-                if (!$textarea.prop('is_t3editor')) {
-                    var config = $textarea.data('codemirror-config');
-                    var modeParts_1 = config.mode.split('/');
-                    var addons = $.merge([modeParts_1.join('/')], JSON.parse(config.addons));
-                    var options_1 = JSON.parse(config.options);
-                    // load mode + registered addons
-                    require(addons, function () {
-                        var cm = CodeMirror.fromTextArea($textarea.get(0), {
-                            extraKeys: {
-                                'Ctrl-Alt-F': function (codemirror) {
-                                    codemirror.setOption('fullScreen', !codemirror.getOption('fullScreen'));
-                                },
-                                'Ctrl-Space': 'autocomplete',
-                                'Esc': function (codemirror) {
-                                    if (codemirror.getOption('fullScreen')) {
-                                        codemirror.setOption('fullScreen', false);
-                                    }
-                                },
-                            },
-                            fullScreen: false,
-                            lineNumbers: true,
-                            lineWrapping: true,
-                            mode: modeParts_1[modeParts_1.length - 1],
-                        });
-                        // set options
-                        $.each(options_1, function (key, value) {
-                            cm.setOption(key, value);
-                        });
-                        cm.addPanel(T3editor.createPanelNode('bottom', $textarea.attr('alt')), {
-                            position: 'bottom',
-                            stable: true,
-                        });
-                    });
-                    $textarea.prop('is_t3editor', true);
-                }
-            });
-        };
-        /**
-         * Initialize the events
-         */
-        T3editor.prototype.initialize = function () {
-            var _this = this;
-            $(function () {
-                _this.findAndInitializeEditors();
-            });
-        };
-        return T3editor;
-    }());
-    return new T3editor();
-});
+define(["require","exports","cm/lib/codemirror","jquery"],function(a,b,c,d){"use strict";var e=function(){function b(){this.initialize()}return b.createPanelNode=function(a,b){var c=d("<div />",{class:"CodeMirror-panel CodeMirror-panel-"+a,id:"panel-"+a}).append(d("<span />").text(b));return c.get(0)},b.prototype.findAndInitializeEditors=function(){d(document).find("textarea.t3editor").each(function(){var e=d(this);if(!e.prop("is_t3editor")){var f=e.data("codemirror-config"),g=f.mode.split("/"),h=d.merge([g.join("/")],JSON.parse(f.addons)),i=JSON.parse(f.options);a(h,function(){var a=c.fromTextArea(e.get(0),{extraKeys:{"Ctrl-Alt-F":function(a){a.setOption("fullScreen",!a.getOption("fullScreen"))},"Ctrl-Space":"autocomplete",Esc:function(a){a.getOption("fullScreen")&&a.setOption("fullScreen",!1)}},fullScreen:!1,lineNumbers:!0,lineWrapping:!0,mode:g[g.length-1]});d.each(i,function(b,c){a.setOption(b,c)}),a.addPanel(b.createPanelNode("bottom",e.attr("alt")),{position:"bottom",stable:!0})}),e.prop("is_t3editor",!0)}})},b.prototype.initialize=function(){var a=this;d(function(){a.findAndInitializeEditors()})},b}();return new e});
\ No newline at end of file