$iconElement.removeClass('fa-spin fa-circle-o-notch');
};
- /**
- * initialize and return the object
- */
- return function() {
- AjaxDataHandler.initialize();
+ $(AjaxDataHandler.initialize);
- // return the object in the global space
- return AjaxDataHandler;
- }();
+ return AjaxDataHandler;
});
* The debug console shown at the bottom of the backend
*/
define(['jquery'], function ($) {
+ 'use strict';
+
var DebugConsole = {
$consoleDom: null,
settings: {
DebugConsole.$consoleDom = null;
};
- return function () {
- $(document).ready(function() {
- DebugConsole.initialize();
- });
- TYPO3.DebugConsole = DebugConsole;
- return DebugConsole;
- }();
+ $(DebugConsole.initialize);
+
+ // expose as global object
+ TYPO3.DebugConsole = DebugConsole;
+
+ return DebugConsole;
+
});
* Calculates the height of the docHeader and hides it upon scrolling
*/
define(['jquery'], function($) {
- "use strict";
+ 'use strict';
var DocumentHeader = {
$documentHeader: null,
};
// Initialization Code
- $(document).ready(function() {
+ $(function() {
// run the flexform functions on all containers (which contains one or more sections)
$('.t3-flex-container').t3FormEngineFlexFormElement();
});
};
FormEngineValidation.registerReady = function() {
- $(document).ready(function() {
+ $(function() {
FormEngineValidation.initialize();
// Start first validation after one second, because all fields are initial empty (typo3form.fieldSet)
window.setTimeout(function() {
});
};
- /**
- * Initialize function
- */
-
-
FormEngine.Validation = FormEngineValidation;
+
return FormEngine.Validation;
});
});
};
- return function() {
- TYPO3.ImageManipulation = ImageManipulation;
- return ImageManipulation;
- }();
+ return ImageManipulation;
});
* based on jQuery UI
*/
define(['jquery', 'jquery-ui/sortable'], function ($) {
+ 'use strict';
var DragDrop = {
contentIdentifier: '.t3js-page-ce',
*/
DragDrop.onSortUpdate = function($container, ui) {
var $selectedItem = $(ui.item),
- contentElementUid = parseInt($selectedItem.data('uid'));
+ contentElementUid = parseInt($selectedItem.data('uid')),
+ parameters = {};
// send an AJAX requst via the AjaxDataHandler
if (contentElementUid > 0) {
- var parameters = {};
+
// add the information about a possible column position change
parameters['data'] = {tt_content: {}};
parameters['data']['tt_content'][contentElementUid] = {colPos: parseInt($container.data('colpos'))};
});
};
- /**
- * initialize function
- */
- return function() {
- DragDrop.initialize();
- return DragDrop;
- }();
-});
\ No newline at end of file
+ $(DragDrop.initialize);
+
+ return DragDrop;
+});
* JavaScript replacement for Legacy CSS Classes
*/
define(['jquery'], function($) {
+ 'use strict';
+
var LegacyCssClasses = {
replacements: [
{
]
};
- LegacyCssClasses.initialize = function() {
+ $(function() {
$.each(LegacyCssClasses.replacements, function(key, replacement) {
- $items = $(replacement.selector);
+ var $items = $(replacement.selector);
if ($items.length > 0) {
$items.each(function() {
- $item = $(this);
+ var $item = $(this);
if (replacement.remove.length > 0) {
$.each(replacement.remove, function(oldClassId, oldClassName) {
$item.removeClass(oldClassName);
});
}
});
- };
-
- /**
- * initialize function
- */
- return function() {
- LegacyCssClasses.initialize();
- return LegacyCssClasses;
- }();
+ });
+ return LegacyCssClasses;
});
}
};
- return function() {
- return Tree;
- }();
+ return Tree;
});
* Global search to deal with everything in the backend that is search-related
*/
define(['jquery', 'jquery/autocomplete', 'TYPO3/CMS/Backend/jquery.clearable'], function ($) {
+ 'use strict';
var containerSelector = '#typo3-cms-backend-backend-toolbaritems-livesearchtoolbaritem';
var searchFieldSelector = '.t3js-topbar-navigation-search-field';
var url = TYPO3.settings.ajaxUrls['livesearch'];
var category = '';
- var initialize = function() {
+ $(function() {
$(searchFieldSelector).autocomplete({
// ajax options
serviceUrl: url,
jump($(this).data('target'), 'web_list', 'web', $(this).data('pageid'));
});
- $(searchFieldSelector).clearable(
- {
+ $(searchFieldSelector).clearable({
onClear: function() {
$(containerSelector).removeClass('open');
}
- }
- );
- };
-
- $(document).ready(function() {
- initialize();
+ });
});
+
});
* JavaScript module for the backend login form
*/
define(['jquery', 'TYPO3/CMS/Backend/jquery.clearable', 'bootstrap'], function($) {
+ 'use strict';
+
var BackendLogin = {
options: {
loginForm: '#typo3-login-form',
* @param event
*/
BackendLogin.handleSubmit = function(event) {
- "use strict";
-
BackendLogin.showLoginProcess();
if (BackendLogin.options.submitHandler) {
BackendLogin.checkForInterfaceCookie = function() {
if ($(options.interfaceField).length) {
var posStart = document.cookie.indexOf('typo3-login-interface=');
- if (posStart != -1) {
+ if (posStart !== -1) {
var selectedInterface = document.cookie.substr(posStart + 22);
selectedInterface = selectedInterface.substr(0, selectedInterface.indexOf(';'));
+ $(options.interfaceField).val(selectedInterface);
}
- $(options.interfaceField).val(selectedInterface);
}
};
};
// initialize and return the BackendLogin object
- $(document).ready(function() {
+ $(function() {
BackendLogin.checkCookieSupport();
BackendLogin.checkForInterfaceCookie();
BackendLogin.initializeEvents();
});
// prevent opening the login form in the backend frameset
- if (top.location.href != self.location.href) {
- top.location.href = self.location.href;
+ if (top.location.href !== location.href) {
+ top.location.href = location.href;
}
return BackendLogin;
};
// initialize and return the LoginRefresh object
- return function() {
- $(document).ready(function() {
- LoginRefresh.initializeTimeoutModal();
- LoginRefresh.initializeBackendLockedModal();
- LoginRefresh.initializeLoginForm();
+ $(function() {
+ LoginRefresh.initializeTimeoutModal();
+ LoginRefresh.initializeBackendLockedModal();
+ LoginRefresh.initializeLoginForm();
- LoginRefresh.startTask();
+ LoginRefresh.startTask();
- if (typeof Notification !== 'undefined' && Notification.permission !== 'granted') {
- Notification.requestPermission();
- }
- });
+ if (typeof Notification !== 'undefined' && Notification.permission !== 'granted') {
+ Notification.requestPermission();
+ }
+ });
+
+ // expose to global
+ TYPO3.LoginRefresh = LoginRefresh;
- TYPO3.LoginRefresh = LoginRefresh;
- return LoginRefresh;
- }();
+ return LoginRefresh;
});
* This module depends on TYPO3/CMS/Backend/Notification due to top.TYPO3.Severity.
*/
define(['jquery', 'TYPO3/CMS/Backend/Notification', 'bootstrap'], function($) {
- "use strict";
+ 'use strict';
// fetch from parent
if (parent && parent.window.TYPO3 && parent.window.TYPO3.Modal) {
*/
define(['jquery'], function ($) {
+ 'use strict';
/**
* Severity object
if (Notification.messageContainer === null) {
Notification.messageContainer = $('<div id="alert-container"></div>').appendTo('body');
}
- $box = $(
+ var $box = $(
'<div class="alert alert-' + className + ' alert-dismissible fade" role="alert">' +
'<button type="button" class="close" data-dismiss="alert">' +
'<span aria-hidden="true"><i class="fa fa-times-circle"></i></span>' +
}
};
- /**
- * return the Notification object
- */
- return function () {
- if (typeof TYPO3.Severity === 'undefined') {
- TYPO3.Severity = Severity;
- }
- if (typeof top.TYPO3.Severity === 'undefined') {
- top.TYPO3.Severity = Severity;
- }
- if (typeof TYPO3.Notification === 'undefined') {
- TYPO3.Notification = Notification;
- }
- if (typeof top.TYPO3.Notification === 'undefined') {
- top.TYPO3.Notification = Notification;
- }
- return Notification;
- }();
+ if (typeof TYPO3.Severity === 'undefined') {
+ TYPO3.Severity = Severity;
+ }
+ if (typeof top.TYPO3.Severity === 'undefined') {
+ top.TYPO3.Severity = Severity;
+ }
+ if (typeof TYPO3.Notification === 'undefined') {
+ TYPO3.Notification = Notification;
+ }
+ if (typeof top.TYPO3.Notification === 'undefined') {
+ top.TYPO3.Notification = Notification;
+ }
+
+ return Notification;
});
* Javascript for show the online media dialog
*/
define(['jquery', 'nprogress', 'TYPO3/CMS/Backend/Modal', 'TYPO3/CMS/Lang/Lang'], function($, NProgress, Modal) {
- "use strict";
+ 'use strict';
var OnlineMediaPlugin = function(element) {
var me = this;
*/
PageActions.initializePageTitleRenaming = function() {
if (!PageActions.documentIsReady) {
- $(document).ready(function() {
+ $(function() {
PageActions.initializePageTitleRenaming();
});
return;
* Initializes global handling of split buttons.
*/
define(['jquery'], function($) {
- "use strict";
+ 'use strict';
var SplitButtons = {
preSubmitCallbacks: []
* Toggle the search toolbox
*/
define(['jquery', 'TYPO3/CMS/Backend/DocumentHeader', 'TYPO3/CMS/Backend/jquery.clearable'], function($, DocumentHeader) {
- "use strict";
+ 'use strict';
$(function() {
var $toolbar = $('#db_list-searchbox-toolbar');
* reloading the clear cache icon
*/
define(['jquery', 'TYPO3/CMS/Backend/Icons'], function($, Icons) {
+ 'use strict';
var ClearCacheMenu = {
options: {
});
};
- /**
- * initialize and return the ClearCacheMenu object
- */
- return function() {
- $(document).ready(function() {
- ClearCacheMenu.initializeEvents();
- });
+ $(ClearCacheMenu.initializeEvents);
- TYPO3.ClearCacheMenu = ClearCacheMenu;
- return ClearCacheMenu;
- }();
+ return ClearCacheMenu;
});
* and edit a shortcut
*/
define(['jquery', 'TYPO3/CMS/Backend/Modal', 'TYPO3/CMS/Backend/Icons'], function($, Modal, Icons) {
+ 'use strict';
var ShortcutMenu = {
options: {
});
};
- /**
- * initialize and return the ShortcutMenu object
- */
- return function() {
- $(document).ready(function() {
- ShortcutMenu.initializeEvents();
- });
+ $(ShortcutMenu.initializeEvents);
+
+ // expose as global object
+ TYPO3.ShortcutMenu = ShortcutMenu;
- TYPO3.ShortcutMenu = ShortcutMenu;
- return ShortcutMenu;
- }();
+ return ShortcutMenu;
});
* API for tooltip windows powered by Twitter Bootstrap.
*/
define(['jquery', 'bootstrap'], function($) {
+ 'use strict';
/**
* The main tooltip object
$element.tooltip('hide');
};
- Tooltip.initialize('[data-toggle="tooltip"]');
+ $(function () {
+ Tooltip.initialize('[data-toggle="tooltip"]');
+ });
+
+ // expose as global object
TYPO3.Tooltip = Tooltip;
+
return Tooltip;
});
* JavaScript module for the UsernamePasswordLoginProvider
*/
define(['jquery', 'TYPO3/CMS/Backend/Login'], function($, Login) {
+ 'use strict';
+
var UserPassLogin = {
options: {
usernameField: '.t3js-login-username-field',
* Reset user password field to prevent it from being submitted
*/
UserPassLogin.resetPassword = function() {
- "use strict";
-
var $passwordField = $(UserPassLogin.options.passwordField);
if ($passwordField.val()) {
$(Login.options.useridentField).val($passwordField.val());
};
// initialize and return the UserPassLogin object
- $(document).ready(function() {
+ $(function() {
// register submit handler
Login.options.submitHandler = UserPassLogin.resetPassword;
}
} catch (error) {} // continue
- if ($usernameField.val() == '') {
+ if ($usernameField.val() === '') {
$usernameField.focus();
} else {
$passwordField.focus();
* Colorpicker JavaScript
*/
define(['jquery'], function ($) {
+ 'use strict';
var Colorpicker = {
options: {}
});
};
- $(document).ready(function() {
- Colorpicker.initializeEvents();
- });
+ $(Colorpicker.initializeEvents);
return Colorpicker;
});
var res = 0;
for (var a = 1; a <= 5; a++) {
if (document.editform[checknames + '[' + a + ']'].checked) {
- res|=Math.pow(2,a-1);
+ res |= Math.pow(2,a-1);
}
}
document.editform[varname].value = res | (checknames === 'tx_beuser_system_beusertxpermission[check][perms_user]' ? 1 : 0);
});
};
- /**
- * initialize and return the Permissions object
- */
- return function() {
- $(document).ready(function() {
- Permissions.initializeEvents();
- });
+ $(Permissions.initializeEvents);
+
+ // expose to global
+ TYPO3.Permissions = Permissions;
- TYPO3.Permissions = Permissions;
- return Permissions;
- }();
+ return Permissions;
});
* JavaScript module for ext:documentation
*/
define(['jquery', 'datatables', 'TYPO3/CMS/Backend/jquery.clearable'], function($) {
+ 'use strict';
var Documentation = {
dataTable: null,
searchField: null,
identifier: {
documentationList: '.t3js-documentation-list',
- searchField: '.t3js-documentation-searchfield',
+ searchField: '.t3js-documentation-searchfield'
}
};
return vars;
};
- $(document).ready(function() {
+ $(function() {
// Initialize the view
Documentation.initializeView();
Documentation.dataTable.search('').draw();
}
});
-
});
+
+ return Documentation;
});
});
};
- return function() {
- $(document).ready(function() {
- var dataTable = ExtensionManager.manageExtensionListing();
-
- $(document).on('click', '.onClickMaskExtensionManager', function() {
- $(ExtensionManager.identifier.extensionManager).mask();
- NProgress.start();
- }).on('click', 'a[data-action=update-extension]', function(e) {
- e.preventDefault();
- $.ajax({
- url: $(this).attr('href'),
- dataType: 'json',
- beforeSend: function() {
- $(ExtensionManager.identifier.extensionManager).mask();
- NProgress.start();
- },
- success: ExtensionManager.updateExtension
- });
- }).on('change', 'input[name=unlockDependencyIgnoreButton]', function() {
- var $actionButton = TYPO3.jQuery('.t3js-dependencies');
- $actionButton.toggleClass('disabled', !$(this).prop('checked'));
- });
-
- $(ExtensionManager.identifier.searchField).clearable({
- onClear: function() {
- dataTable.search('').draw();
- }
- });
-
- $('.expandable').expander({
- expandEffect: 'slideDown',
- collapseEffect: 'slideUp',
- beforeExpand: function() {
- $(this).parent().css('z-index', 199);
+ $(function() {
+ var dataTable = ExtensionManager.manageExtensionListing();
+
+ $(document).on('click', '.onClickMaskExtensionManager', function() {
+ $(ExtensionManager.identifier.extensionManager).mask();
+ NProgress.start();
+ }).on('click', 'a[data-action=update-extension]', function(e) {
+ e.preventDefault();
+ $.ajax({
+ url: $(this).attr('href'),
+ dataType: 'json',
+ beforeSend: function() {
+ $(ExtensionManager.identifier.extensionManager).mask();
+ NProgress.start();
},
- afterCollapse: function() {
- $(this).parent().css('z-index', 1);
- }
+ success: ExtensionManager.updateExtension
});
+ }).on('change', 'input[name=unlockDependencyIgnoreButton]', function() {
+ var $actionButton = TYPO3.jQuery('.t3js-dependencies');
+ $actionButton.toggleClass('disabled', !$(this).prop('checked'));
+ });
- $(document).on('click', '.t3-button-action-installdistribution', function() {
- $(ExtensionManager.identifier.extensionManager).mask();
- });
+ $(ExtensionManager.identifier.searchField).clearable({
+ onClear: function() {
+ dataTable.search('').draw();
+ }
+ });
- ExtensionManager.configurationFieldSupport();
- var $validate = $('.validate');
- $validate.validate();
- $(document).on('click', '.t3js-save-close', function() {
- $validate.append($('<input />', {type: 'hidden', name: 'tx_extensionmanager_tools_extensionmanagerextensionmanager[action]', value: 'saveAndClose'})).submit();
- });
+ $('.expandable').expander({
+ expandEffect: 'slideDown',
+ collapseEffect: 'slideUp',
+ beforeExpand: function() {
+ $(this).parent().css('z-index', 199);
+ },
+ afterCollapse: function() {
+ $(this).parent().css('z-index', 1);
+ }
+ });
- // initialize the repository
- Repository.initDom();
+ $(document).on('click', '.t3-button-action-installdistribution', function() {
+ $(ExtensionManager.identifier.extensionManager).mask();
+ });
- ExtensionManager.Update.initializeEvents();
- ExtensionManager.UploadForm.initializeEvents();
+ ExtensionManager.configurationFieldSupport();
+ var $validate = $('.validate');
+ $validate.validate();
+ $(document).on('click', '.t3js-save-close', function() {
+ $validate.append($('<input />', {type: 'hidden', name: 'tx_extensionmanager_tools_extensionmanagerextensionmanager[action]', value: 'saveAndClose'})).submit();
});
- if (typeof TYPO3.ExtensionManager === 'undefined') {
- TYPO3.ExtensionManager = ExtensionManager;
- }
- }();
+ // initialize the repository
+ Repository.initDom();
+
+ ExtensionManager.Update.initializeEvents();
+ ExtensionManager.UploadForm.initializeEvents();
+ });
+
+ if (typeof TYPO3.ExtensionManager === 'undefined') {
+ TYPO3.ExtensionManager = ExtensionManager;
+ }
+
+ return ExtensionManager;
});
* JavaScript to handle confirm windows in the Import/Export module
*/
define(['jquery', 'TYPO3/CMS/Backend/Modal'], function ($, Modal) {
- "use strict";
+ 'use strict';
$(function() {
$(document).on('click', '.t3js-confirm-trigger', function() {
<hr />
<f:render partial="Action/Tool/ImportantActions/ExtensionCompatibilityTester" arguments="{_all}"/>
<script type="text/javascript">
- $(document).ready(function() {
+ $(function() {
$('button', '#checkExtensions').hide();
$('.typo3-message', '#checkExtensions').hide();
$('.message-loading', '#checkExtensions').show();
return ((elemBottom <= docViewBottom) && (elemTop >= docViewTop));
},
handleButtonScrolling: function() {
- if ($('#fixed-footer-handler').length > 0) {
- if (!this.isScrolledIntoView($('#fixed-footer-handler'))) {
+ var $fixedFooterHandler = $('#fixed-footer-handler');
+ if ($fixedFooterHandler.length > 0) {
+ if (!this.isScrolledIntoView($fixedFooterHandler)) {
$('#fixed-footer').addClass('fixed');
} else {
$('#fixed-footer').removeClass('fixed');
*/
handleCheckExtensionsSuccess: function() {
var self = this;
+ var $checkExtensions = $('#checkExtensions');
+
$.ajax({
- url: $('#checkExtensions').data('protocolurl'),
+ url: $checkExtensions.data('protocolurl'),
cache: false,
success: function(data) {
if (data) {
var extension = extensions[i];
var unloadButton = $('<button />', {
text: 'Uninstall '+ $.trim(extension),
- "class": $.trim(extension),
- click: function(e) {
- self.uninstallExtension($(this).attr('class'));
- e.preventDefault();
- return false;
- }
+ 'class': 't3-js-uninstallSingle',
+ 'data-extension': $.trim(extension)
});
var fullButton = unloadButtonWrapper.append(unloadButton);
$('.message-error .message-body', '#checkExtensions').append(fullButton);
}
+ if (extensions.length) {
+ $(document).on('click', 't3-js-uninstallSingle', function(e) {
+ self.uninstallExtension($(this).data('extension'));
+ e.preventDefault();
+ return false;
+ });
+ }
var unloadAllButton = $('<button />', {
text: 'Uninstall all incompatible extensions: '+ data,
click: function(e) {
}
});
$.getJSON(
- $('#checkExtensions').data('errorprotocolurl'),
+ $checkExtensions.data('errorprotocolurl'),
function(data) {
$.each(data, function(i, error) {
var messageToDisplay = error.message + ' in ' + error.file + ' on line ' + error.line;
- $('#checkExtensions .typo3-message.message-error').before($(
+ $checkExtensions.find('.typo3-message.message-error').before($(
'<div class="typo3-message message-warning"><div class="header-container"><div class="message-header">' +
'<strong>' + error.type + '</strong></div><div class="message-body">' +
messageToDisplay + '</div></div></div><p></p>'
cache: false,
success: function(data) {
if (data > 0) {
- $('#t3-install-menu-folderStructure a').append('<span class="t3-install-menu-errorCount">' + data + '</span>');
+ $('#t3-install-menu-folderStructure').find('a').append('<span class="t3-install-menu-errorCount">' + data + '</span>');
}
}
});
cache: false,
success: function(data) {
if (data > 0) {
- $('#t3-install-menu-systemEnvironment a').append('<span class="t3-install-menu-errorCount">' + data + '</span>');
+ $('#t3-install-menu-systemEnvironment').find('a').append('<span class="t3-install-menu-errorCount">' + data + '</span>');
}
}
});
*/
callAction: function(actionName, type) {
var self = this;
- var arguments = {
+ var data = {
install: {
controller: 'ajax',
action: actionName
}
};
if (type !== undefined) {
- arguments.install["type"] = type;
+ data.install["type"] = type;
}
this.addLoadingMessage(this.actionQueue[actionName].loadingMessage);
$.ajax({
url: location.href,
- data: arguments,
+ data: data,
cache: false,
success: function(result) {
- canContinue = self.handleResult(result, self.actionQueue[actionName].finishMessage);
+ var canContinue = self.handleResult(result, self.actionQueue[actionName].finishMessage);
if (canContinue === true && (self.actionQueue[actionName].nextActionName !== undefined)) {
self.callAction(self.actionQueue[actionName].nextActionName, type);
}
* Remove an enabled loading message
*/
removeLoadingMessage: function() {
- $('#coreUpdate .message-loading').closest('.typo3-message').remove();
+ $('#coreUpdate').find('.message-loading').closest('.typo3-message').remove();
},
/**
}
};
-$(document).ready(function() {
+$(function() {
// Used in database compare section to select/deselect checkboxes
$('.checkall').on('click', function() {
$(this).closest('fieldset').find(':checkbox').prop('checked', this.checked);
// Toggle open/close
$('.toggleButton').on('click', function() {
- $toggleGroup = $(this).closest('.toggleGroup');
+ var $toggleGroup = $(this).closest('.toggleGroup');
$toggleGroup.toggleClass('expanded');
$toggleGroup.find('.toggleData').toggle();
TYPO3.Install.Scrolling.handleButtonScrolling();
});
$('.toggleAll').on('click', function() {
- $toggleAll = $('.toggleGroup');
- if ($toggleAll.not('.expanded').length == 0) {
+ var $toggleAll = $('.toggleGroup');
+ if ($toggleAll.not('.expanded').length === 0) {
// all elements are open, close them
$toggleAll.removeClass('expanded');
$toggleAll.find('.toggleData').hide();
});
$('.item-description').find('a').on('click', function() {
- targetToggleGroupId = $(this.hash);
+ var targetToggleGroupId = $(this.hash);
if (targetToggleGroupId) {
- $currentToggleGroup = $(this).closest('.toggleGroup');
- $targetToggleGroup = $(targetToggleGroupId).closest('.toggleGroup');
- if ($targetToggleGroup != $currentToggleGroup) {
+ var $currentToggleGroup = $(this).closest('.toggleGroup');
+ var $targetToggleGroup = $(targetToggleGroupId).closest('.toggleGroup');
+ if ($targetToggleGroup !== $currentToggleGroup) {
$currentToggleGroup.removeClass('expanded');
$currentToggleGroup.find('.toggleData').hide();
$targetToggleGroup.addClass('expanded');
var mediumRegex = new RegExp('^(?=.{8,})(((?=.*[A-Z])(?=.*[a-z]))|((?=.*[A-Z])(?=.*[0-9]))|((?=.*[a-z])(?=.*[0-9]))).*$', 'g');
var enoughRegex = new RegExp('(?=.{8,}).*', 'g');
- if (value.length == 0) {
+ if (value.length === 0) {
$(this).attr('style', 'background-color:#FBB19B; border:1px solid #DC4C42');
- } else if (false == enoughRegex.test(value)) {
+ } else if (!enoughRegex.test(value)) {
$(this).attr('style', 'background-color:#FBB19B; border:1px solid #DC4C42');
} else if (strongRegex.test(value)) {
$(this).attr('style', 'background-color:#CDEACA; border:1px solid #58B548');
* Language module class
*/
define(['jquery', 'moment', 'datatables', 'TYPO3/CMS/Backend/jquery.clearable'], function($, moment) {
+ 'use strict';
+
var LanguageModule = {
me: this,
context: null,
LanguageModule.table = LanguageModule.buildLanguageTable(tableElement);
LanguageModule.initializeSearchField();
LanguageModule.initializeEventHandler();
- }
+ };
/**
* Initialize translation table
$link.addClass(action + 'Link');
$link.attr('data-action', action);
for (var name in parameters) {
- $link.attr('data-' + name, parameters[name]);
+ if (parameters.hasOwnProperty(name)) {
+ $link.attr('data-' + name, parameters[name]);
+ }
}
$link.html(content);
return $link.wrap('<span>').parent().html();
return vars;
};
- return function() {
- $(document).ready(function() {
- if ($('div.typo3-module-lang #typo3-language-list').length) {
- LanguageModule.initializeLanguageTable('div.typo3-module-lang', '#typo3-language-list');
- } else if ($('div.typo3-module-lang #typo3-translation-list').length) {
- LanguageModule.initializeTranslationTable('div.typo3-module-lang', '#typo3-translation-list');
- }
- });
+ $(function() {
+ if ($('#typo3-language-list').length) {
+ LanguageModule.initializeLanguageTable('div.typo3-module-lang', '#typo3-language-list');
+ } else if ($('#typo3-translation-list').length) {
+ LanguageModule.initializeTranslationTable('div.typo3-module-lang', '#typo3-translation-list');
+ }
+ });
- TYPO3.LanguageModule = LanguageModule;
- return LanguageModule;
- }();
+ return LanguageModule;
});
*/
define(['jquery'], function($) {
+ 'use strict';
var Linkvalidator = {};
Linkvalidator.toggleActionButton = function(prefix) {
var buttonDisable = true;
- $('.' + prefix).each(function(index) {
+ $('.' + prefix).each(function() {
if ($(this).prop('checked')) {
buttonDisable = false;
}
});
- if (prefix == 'check') {
+ if (prefix === 'check') {
$('#updateLinkList').prop('disabled', buttonDisable);
} else {
$('#refreshLinkList').prop('disabled', buttonDisable);
});
};
- // intialize and return the Linkvalidator object
- return function() {
- $(document).ready(function() {
- Linkvalidator.initializeEvents();
- });
+ $(Linkvalidator.initializeEvents);
- TYPO3.Linkvalidator = Linkvalidator;
- return Linkvalidator;
- }();
+ return Linkvalidator;
});
* - updating the menu
*/
define(['jquery', 'TYPO3/CMS/Backend/Icons'], function($, Icons) {
+ 'use strict';
var OpendocsMenu = {
options: {
/**
* Closes an open document
*
- * @param string md5sum
+ * @param {string} md5sum
*/
OpendocsMenu.closeDocument = function(md5sum) {
$.ajax({
$(OpendocsMenu.options.containerSelector).toggleClass('open');
};
- /**
- * initialize and return the Opendocs object
- */
- return function() {
- $(document).ready(function() {
- OpendocsMenu.initializeEvents();
- OpendocsMenu.updateMenu();
- });
+ $(function() {
+ OpendocsMenu.initializeEvents();
+ OpendocsMenu.updateMenu();
+ });
+
+ // expose to global
+ TYPO3.OpendocsMenu = OpendocsMenu;
- TYPO3.OpendocsMenu = OpendocsMenu;
- return OpendocsMenu;
- }();
+ return OpendocsMenu;
});
* Database record selection
*/
define(['jquery', 'TYPO3/CMS/Recordlist/ElementBrowser'], function($, ElementBrowser) {
- "use strict";
+ 'use strict';
$(function() {
$('[data-close]').on('click', function(event) {
* File selection
*/
define(['jquery', 'TYPO3/CMS/Recordlist/ElementBrowser'], function($, ElementBrowser) {
- "use strict";
+ 'use strict';
var BrowseFiles = {
elements: {}
* Folder selection
*/
define(['jquery', 'TYPO3/CMS/Recordlist/ElementBrowser', 'TYPO3/CMS/Backend/Modal'], function ($, ElementBrowser, Modal) {
- "use strict";
+ 'use strict';
$(function() {
$('[data-folder-id]').on('click', function (event) {
* ElementBrowser communication with parent windows
*/
define(['jquery'], function($) {
- "use strict";
+ 'use strict';
var ElementBrowser = {
thisScriptUrl: '',
* Check-all / uncheck-all for the Database Recordlist fieldSelectBox
*/
define(['jquery'], function($) {
- "use strict";
+ 'use strict';
$(function() {
$('.fieldSelectBox .checkAll').change(function() {
* File link interaction
*/
define(['jquery', 'TYPO3/CMS/Recordlist/LinkBrowser', 'TYPO3/CMS/Backend/LegacyTree'], function($, LinkBrowser, Tree) {
- "use strict";
+ 'use strict';
var FileLinkHandler = {
currentLink: ''
* LinkBrowser communication with parent window
*/
define(['jquery'], function($) {
- "use strict";
+ 'use strict';
var LinkBrowser = {
thisScriptUrl: '',
* Mail link interaction
*/
define(['jquery', 'TYPO3/CMS/Recordlist/LinkBrowser'], function($, LinkBrowser) {
- "use strict";
+ 'use strict';
var MailLinkHandler = {};
* Page link interaction
*/
define(['jquery', 'TYPO3/CMS/Recordlist/LinkBrowser'], function($, LinkBrowser) {
- "use strict";
+ 'use strict';
var PageLinkHandler = {
currentLink: ''
* Usability improvements for the record list
*/
define(['jquery', 'TYPO3/CMS/Backend/Storage'], function($, Storage) {
- "use strict";
+ 'use strict';
var Recordlist = {
identifier: {
* API for tooltip windows powered by Twitter Bootstrap.
*/
define(['TYPO3/CMS/Backend/Tooltip'], function(Tooltip) {
- "use strict";
+ 'use strict';
- Tooltip.initialize('.table-fit a[title]', {
- delay: {
- show: 500,
- hide: 100
- },
- trigger: 'hover',
- container: 'body'
+ $(function() {
+ Tooltip.initialize('.table-fit a[title]', {
+ delay: {
+ show: 500,
+ hide: 100
+ },
+ trigger: 'hover',
+ container: 'body'
+ });
});
});
* URL link interaction
*/
define(['jquery', 'TYPO3/CMS/Recordlist/LinkBrowser'], function($, LinkBrowser) {
- "use strict";
+ 'use strict';
var UrlLinkHandler = {};
* RequireJS module for Recycler
*/
define(['jquery', 'nprogress', 'TYPO3/CMS/Backend/Modal', 'TYPO3/CMS/Backend/jquery.clearable'], function($, NProgress, Modal) {
+ 'use strict';
+
var Recycler = {
identifiers: {
searchForm: '#recycler-form',
messageText = Recycler.createMessage(messageText, [recordTitle, '[' + records + ']']);
}
- var $message;
+ var $message = null;
if (recoverPages) {
$message = $('<div />').append(
$('<p />').text(messageText),
$(this).addClass('disabled').find('.t3-icon').unwrap().wrap($('<span />'));
};
- $(document).ready(function() {
- Recycler.initialize();
- });
+ $(Recycler.initialize);
return Recycler;
});
}
};
- $(document).ready(RsaEncryption.initialize);
+ $(RsaEncryption.initialize);
return RsaEncryption;
});
* LinkBrowser communication with parent window
*/
define(['jquery', 'TYPO3/CMS/Recordlist/LinkBrowser'], function($, LinkBrowser) {
- "use strict";
+ 'use strict';
var RteLinkBrowser = {
plugin: null,
*/
Scheduler.actOnChangeSchedulerTableGarbageCollectionAllTables = function(theCheckbox) {
var $numberOfDays = $('#task_tableGarbageCollection_numberOfDays');
+ var $taskTableGarbageCollectionTable = $('#task_tableGarbageCollection_table');
if (theCheckbox.prop('checked')) {
- $('#task_tableGarbageCollection_table').prop('disabled', true);
+ $taskTableGarbageCollectionTable.prop('disabled', true);
$numberOfDays.prop('disabled', true);
} else {
// Get number of days for selected table
var numberOfDays = parseInt($numberOfDays.val());
if (numberOfDays < 1) {
- var selectedTable = $('#task_tableGarbageCollection_table').val();
- if (typeof(defaultNumberOfDays[selectedTable]) != 'undefined') {
+ var selectedTable = $taskTableGarbageCollectionTable.val();
+ if (typeof(defaultNumberOfDays[selectedTable]) !== 'undefined') {
numberOfDays = defaultNumberOfDays[selectedTable];
}
}
- $('#task_tableGarbageCollection_table').prop('disabled', false);
+ $taskTableGarbageCollectionTable.prop('disabled', false);
if (numberOfDays > 0) {
$numberOfDays.prop('disabled', false);
}
});
};
- // initialize and return the Scheduler object
- return function() {
- $(document).ready(function() {
- Scheduler.initializeEvents();
- });
+ $(Scheduler.initializeEvents);
- TYPO3.Scheduler = Scheduler;
- return Scheduler;
- }();
+ return Scheduler;
});
* File edit for ext:t3editor
*/
define(['jquery', 'TYPO3/CMS/T3editor/T3editor'], function ($, T3editor) {
+ 'use strict';
- $(document).ready(function() {
+ $(function() {
// Remove document.editform.submit from save and close onclick
// Form will be submitted by the new on click handler
*/
define(['jquery', 'TYPO3/CMS/Backend/SplitButtons'], function ($, SplitButtons) {
+ 'use strict';
var T3editor = {
instances: {}
* Resize the editor
*/
T3editor.resize = function(codemirror, w, h) {
- var height = (h - 1),
- width = (w + 11),
+ var width = (w + 11),
$outerDiv = codemirror.options.originalTextarea.prev('.t3e_wrap'),
$mirrorWrap = codemirror.options.originalTextarea.parents('div.t3editor').find('.t3e_iframe_wrap');
}
T3editor.resize(codemirror, w, h);
- }
+ };
/**
* Convert all textareas to enable tab
/**
* Initialize and return the T3editor object
*/
- $(document).ready(function() {
+ $(function() {
T3editor.findAndInitializeEditors();
T3editor.convertTextareasEnableTab();
});
- TYPO3.T3editor = T3editor;
return T3editor;
});
*/
define(['jquery', 'jquery-ui/sortable'], function($) {
+ 'use strict';
var Taskcenter = {};
Taskcenter.initializeSorting();
};
- return function() {
- $(document).ready(function() {
- Taskcenter.initializeEvents();
- });
+ $(Taskcenter.initializeEvents);
- TYPO3.Taskcenter = Taskcenter;
- return Taskcenter;
- }();
+ return Taskcenter;
});
* e.g. updating the field and working with colors
*/
define(['jquery'], function($) {
+ 'use strict';
var ConstantEditor = {
options: {
* Registers listeners
*/
ConstantEditor.initializeEvents = function() {
+ // no DOMready needed since only events for document are registered
$(document).on('click', ConstantEditor.options.editIconSelector, function() {
ConstantEditor.changeProperty($(this));
}).on('click', ConstantEditor.options.colorSelectSelector, function() {
});
};
- /**
- * initialize and return the ConstantEditor object
- */
- return function() {
- $(document).ready(function() {
- ConstantEditor.initializeEvents();
- });
- return ConstantEditor;
- }();
+ ConstantEditor.initializeEvents();
+
+ return ConstantEditor;
});
resizableContainerIdentifier: '#resizeable',
widthSelectorIdentifier: '#width',
moduleBodySelector: '.t3js-module-body',
- storagePrefix: 'moduleData.web_view.States.'
+ storagePrefix: 'moduleData.web_view.States.',
+ $iframe: null,
+ $languageSelector: null,
+ $resizableContainer: null,
+ $widthSelector: null
};
ViewPage.initialize = function() {
- var me = this;
- me.$iframe = $('#tx_viewpage_iframe');
- me.$languageSelector = $('#language');
- me.$resizableContainer = $(me.resizableContainerIdentifier);
- me.$widthSelector = $(me.widthSelectorIdentifier);
+ ViewPage.$iframe = $('#tx_viewpage_iframe');
+ ViewPage.$languageSelector = $('#language');
+ ViewPage.$resizableContainer = $(ViewPage.resizableContainerIdentifier);
+ ViewPage.$widthSelector = $(ViewPage.widthSelectorIdentifier);
// Add event to width selector so the container is resized
- $(document).on('change', me.widthSelectorIdentifier, function() {
- var value = me.$widthSelector.val();
+ $(document).on('change', ViewPage.widthSelectorIdentifier, function() {
+ var value = ViewPage.$widthSelector.val();
if (value) {
value = value.split('|');
var height = value[1] || '100%';
if (height === '100%') {
height = ViewPage.calculateContainerMaxHeight();
}
- me.$resizableContainer.animate({
+ ViewPage.$resizableContainer.animate({
width: value[0],
height: height
});
- Storage.Persistent.set(me.storagePrefix + 'widthSelectorValue', value[0] + '|' + (value[1] || '100%'));
+ Storage.Persistent.set(ViewPage.storagePrefix + 'widthSelectorValue', value[0] + '|' + (value[1] || '100%'));
}
});
// Restore custom selector
- var storedCustomWidth = Storage.Persistent.get(me.storagePrefix + 'widthSelectorCustomValue');
+ var storedCustomWidth = Storage.Persistent.get(ViewPage.storagePrefix + 'widthSelectorCustomValue');
// Check for the " symbol is done in order to avoid problems with the old (non-jQuery) syntax which might be stored inside
// the UC from previous versions, can be removed with TYPO3 CMS9 again
if (storedCustomWidth && storedCustomWidth.indexOf('"') === -1) {
// add custom selector if stored value is not there
- if (me.$widthSelector.find('option[value="' + storedCustomWidth + '"]').length === 0) {
- me.addCustomWidthOption(storedCustomWidth);
+ if (ViewPage.$widthSelector.find('option[value="' + storedCustomWidth + '"]').length === 0) {
+ ViewPage.addCustomWidthOption(storedCustomWidth);
}
}
// Re-select stored value
- var storedWidth = Storage.Persistent.get(me.storagePrefix + 'widthSelectorValue');
+ var storedWidth = Storage.Persistent.get(ViewPage.storagePrefix + 'widthSelectorValue');
// Check for the " symbol is done in order to avoid problems with the old (non-jQuery) syntax which might be stored inside
// the UC from previous versions, can be removed with TYPO3 CMS9 again
if (storedWidth && storedWidth.indexOf('"') === -1) {
- me.$widthSelector.val(storedWidth).trigger('change');
+ ViewPage.$widthSelector.val(storedWidth).trigger('change');
}
// Initialize the jQuery UI Resizable plugin
- me.$resizableContainer.resizable({
+ ViewPage.$resizableContainer.resizable({
handles: 'e, se, s'
});
// Create and select custom option
- me.$resizableContainer.on('resizestart', function() {
+ ViewPage.$resizableContainer.on('resizestart', function() {
// Check custom option is there, if not, add it
- if (me.$widthSelector.find('#customOption').length === 0) {
- me.addCustomWidthOption('100%|100%');
+ if (ViewPage.$widthSelector.find('#customOption').length === 0) {
+ ViewPage.addCustomWidthOption('100%|100%');
}
// Select the custom option
- me.$widthSelector.find('#customOption').prop('selected', true);
+ ViewPage.$widthSelector.find('#customOption').prop('selected', true);
// Add iframe overlay to prevent loosing the mouse focus to the iframe while resizing fast
$(this).append('<div id="iframeCover" style="z-index:99;position:absolute;width:100%;top:0;left:0;height:100%;"></div>');
});
- me.$resizableContainer.on('resize', function(evt, ui) {
+ ViewPage.$resizableContainer.on('resize', function(evt, ui) {
// Update custom option
var value = ui.size.width + '|' + ui.size.height;
- var label = me.getOptionLabel(value);
- me.$widthSelector.find('#customOption').text(label).val(value);
+ var label = ViewPage.getOptionLabel(value);
+ ViewPage.$widthSelector.find('#customOption').text(label).val(value);
});
- me.$resizableContainer.on('resizestop', function() {
- Storage.Persistent.set(me.storagePrefix + 'widthSelectorCustomValue', me.$widthSelector.val()).done(function() {
- Storage.Persistent.set(me.storagePrefix + 'widthSelectorValue', me.$widthSelector.val());
+ ViewPage.$resizableContainer.on('resizestop', function() {
+ Storage.Persistent.set(ViewPage.storagePrefix + 'widthSelectorCustomValue', ViewPage.$widthSelector.val()).done(function() {
+ Storage.Persistent.set(ViewPage.storagePrefix + 'widthSelectorValue', ViewPage.$widthSelector.val());
});
// Remove iframe overlay
});
// select stored language
- var storedLanguage = Storage.Persistent.get(me.storagePrefix + 'languageSelectorValue');
+ var storedLanguage = Storage.Persistent.get(ViewPage.storagePrefix + 'languageSelectorValue');
if (storedLanguage) {
// select it
- me.$languageSelector.val(storedLanguage);
+ ViewPage.$languageSelector.val(storedLanguage);
}
// Add event to language selector
- me.$languageSelector.on('change',function() {
- var iframeUrl = me.$iframe.attr('src');
+ ViewPage.$languageSelector.on('change',function() {
+ var iframeUrl = ViewPage.$ifraViewPage.attr('src');
var iframeParameters = ViewPage.getUrlVars(iframeUrl);
// change language
- iframeParameters.L = me.$languageSelector.val();
+ iframeParameters.L = ViewPage.$languageSelector.val();
var newIframeUrl = iframeUrl.slice(0, iframeUrl.indexOf('?') + 1) + $.param(iframeParameters);
// load new url into iframe
- me.$iframe.attr('src', newIframeUrl);
- Storage.Persistent.set(me.storagePrefix + 'languageSelectorValue', me.$languageSelector.val());
+ ViewPage.$ifraViewPage.attr('src', newIframeUrl);
+ Storage.Persistent.set(ViewPage.storagePrefix + 'languageSelectorValue', ViewPage.$languageSelector.val());
});
};
return vars;
};
- $(document).ready(function() {
- ViewPage.initialize();
- });
+ $(ViewPage.initialize);
return ViewPage;
});
* JavaScript functions for creating multiple pages
*/
define(['jquery'], function($) {
+ 'use strict';
var WizardCreatePages = {
lineCounter: 5,
};
WizardCreatePages.createNewFormFields = function() {
- for (i = 0; i < 5; i++) {
+ for (var i = 0; i < 5; i++) {
var label = this.lineCounter + i + 1;
var line = tpl
.replace(/\{0\}/g, (this.lineCounter + i))
});
};
- return function() {
- $(document).ready(function() {
- WizardCreatePages.initializeEvents();
- });
+ $(WizardCreatePages.initializeEvents);
- TYPO3.WizardCreatePages = WizardCreatePages;
- return WizardCreatePages;
- }();
+ return WizardCreatePages;
});
* and jump to the workspaces module
*/
define(['jquery'], function($) {
+ 'use strict';
var WorkspacesMenu = {
options: {
}
};
- /**
- * initialize and return the WorkspacesMenu object
- */
- return function() {
- $(document).ready(function() {
- WorkspacesMenu.initializeEvents();
- WorkspacesMenu.updateBackendContext();
- });
+ $(function() {
+ WorkspacesMenu.initializeEvents();
+ WorkspacesMenu.updateBackendContext();
+ });
+
+ // expose the module in a global object
+ TYPO3.WorkspacesMenu = WorkspacesMenu;
- TYPO3.WorkspacesMenu = WorkspacesMenu;
- return WorkspacesMenu;
- }();
+ return WorkspacesMenu;
});