Commit 21b7925b authored by Tino Goratsch's avatar Tino Goratsch

slightly modernize the javascript files

parent ed42176a
......@@ -3,7 +3,7 @@
* See the LICENSE file at the top-level module directory for licencing details.
*/
jQuery(document).ready(function($) {
jQuery(document).ready(($) => {
$('input[name="active"]').on('click change', function () {
$('#publication-period-wrapper').toggle(this.value === '1');
}).filter(':checked').click();
......
......@@ -3,7 +3,7 @@
* See the LICENSE file at the top-level module directory for licencing details.
*/
jQuery(document).ready(function ($) {
jQuery(document).ready(($) => {
const $recaptchaWrapper = $('#recaptcha-wrapper'),
serviceIds = [
'captcha.extension.recaptcha_captcha_extension'
......
......@@ -4,7 +4,7 @@
*/
/* global onloadCallback:true */
onloadCallback = function () {
onloadCallback = () => {
jQuery('.recaptcha-placeholder').each(function () {
if (jQuery(this).children().length === 0) {
const widgetId = grecaptcha.render(this.id, {
......@@ -17,11 +17,11 @@ onloadCallback = function () {
});
};
jQuery(document).on('acp3.captcha.recaptcha', function () {
jQuery(document).on('acp3.captcha.recaptcha', () => {
onloadCallback();
});
jQuery(document).on('acp3.ajaxFrom.submit.fail', function (event, ajaxForm) {
jQuery(document).on('acp3.ajaxFrom.submit.fail', (event, ajaxForm) => {
const $reCaptchaPlaceholder = jQuery(ajaxForm.element).find('.recaptcha-placeholder');
if ($reCaptchaPlaceholder && $reCaptchaPlaceholder.length > 0) {
......
......@@ -67,11 +67,11 @@ jQuery.fn.insertEmoticon = function (textareaId) {
});
// Aktuelle Cursorposition speichern
textarea.blur(function () {
textarea.blur(() => {
caretPosition = textarea.getCaretPosition();
});
};
jQuery(document).ready(function ($) {
jQuery(document).ready(($) => {
$('.icons a').insertEmoticon($('.icons').data('emoticons-input'));
});
jQuery(document).ready(function ($) {
jQuery(document).ready(($) => {
$('input[name="active"]').on('click change', function () {
$('#publication-period-wrapper').toggle(this.value === '1');
}).filter(':checked').click();
......
......@@ -3,7 +3,7 @@
* See the LICENSE file at the top-level module directory for licensing details.
*/
jQuery(document).ready(function ($) {
jQuery(document).ready(($) => {
$('input[name="active"]').on('click change', function () {
$('#publication-period-wrapper').toggle(this.value === '1');
}).filter(':checked').click();
......
jQuery(document).ready(function ($) {
jQuery(document).ready(($) => {
$('input[name="overlay"]')
.on('change click', function () {
$('#comments-container').toggle(this.value == 0);
$('#comments-container').toggle(Number(this.value) === 0);
})
.filter(':checked').trigger('click');
});
"use strict";jQuery(document).ready(function(a){a("input[name=\"overlay\"]").on("change click",function(){a("#comments-container").toggle(0==this.value)}).filter(":checked").trigger("click")});
\ No newline at end of file
"use strict";jQuery(document).ready(function(a){a("input[name=\"overlay\"]").on("change click",function(){a("#comments-container").toggle(0===+this.value)}).filter(":checked").trigger("click")});
\ No newline at end of file
jQuery(document).ready(function ($) {
jQuery(document).ready(($) => {
$('#notify').on('change', function () {
$('#notify-email')
.closest('.form-group').toggle(this.value != 0);
.closest('.form-group').toggle(Number(this.value) !== 0);
}).children('option:selected').trigger('change');
});
"use strict";jQuery(document).ready(function(a){a("#notify").on("change",function(){a("#notify-email").closest(".form-group").toggle(0!=this.value)}).children("option:selected").trigger("change")});
\ No newline at end of file
"use strict";jQuery(document).ready(function(a){a("#notify").on("change",function(){a("#notify-email").closest(".form-group").toggle(0!==+this.value)}).children("option:selected").trigger("change")});
\ No newline at end of file
......@@ -3,6 +3,6 @@
* See the LICENSE file at the top-level module directory for licensing details.
*/
jQuery(document).ready(function ($) {
jQuery(document).ready(($) => {
$('#modal-create [data-ajax-form="true"]').formSubmit();
});
......@@ -3,7 +3,7 @@
* See the LICENSE file at the top-level module directory for licensing details.
*/
jQuery(document).ready(function ($) {
jQuery(document).ready(($) => {
$('#modal-create').on('shown.bs.modal', function () {
$(this).find('[data-ajax-form="true"]').formSubmit();
});
......
jQuery(document).ready(function ($) {
jQuery(document).ready(($) => {
const $module = $('#module-container'),
$link = $('#link-container'),
$hints = $link.find('.help-block'),
......@@ -8,9 +8,10 @@ jQuery(document).ready(function ($) {
// Wenn Menüpunkt nicht angezeigt werden soll, Linkziel verstecken
$('input[name="display"]').change(function () {
$target.toggle(this.value == 1);
const value = Number(this.value);
$target.toggle(value === 1);
if (this.value == 0) {
if (value === 0) {
// Force the link target to open on the same page programmatically,
// as the user can not select it for them self
$('#target').val(1);
......
"use strict";jQuery(document).ready(function(a){var b=a("#module-container"),c=a("#link-container"),d=c.find(".help-block"),e=a("#articles-container"),f=a("#target-container"),g=/^articles\/index\/details\/id_(\d+)\/$/;// Wenn Menüpunkt nicht angezeigt werden soll, Linkziel verstecken
a("input[name=\"display\"]").change(function(){f.toggle(1==this.value),0==this.value&&a("#target").val(1)});var h=a("#mode"),i=h.val();// Seitentyp
a("input[name=\"display\"]").change(function(){var b=+this.value;f.toggle(1==b),0==b&&a("#target").val(1)});var h=a("#mode"),i=h.val();// Seitentyp
h.change(function(){var f=parseInt(this.value);if(1!==f)2===f?(b.hide(),d.show(),c.show(),e.hide()):3===f?(b.hide(),d.hide(),c.show(),e.hide()):4===f?(b.hide(),d.hide(),c.hide(),e.show()):(b.hide(),d.hide(),c.hide(),e.hide());else// Modul im Dropdown-Menü selektieren, falls zuvor als Modus eine dynamische Seite aktiv war
if(b.show(),d.hide(),c.hide(),e.hide(),2===i){var h=a("#uri"),j=h.val().match(/^([a-z\d_-]+)\/([a-z\d_-]+\/)+$/);!h.val().match(g)&&null!=j[1]&&0<a("#module").find("option[value=\""+j[1]+"\"]").length&&a("#link-module").val(j[1])}i=f}).change(),a("#uri").blur(function(){var b=a(this).val().match(g);null!==b[1]&&0<a("#articles").find("option[value=\""+b[1]+"\"]").length&&(a("#mode").val(4).change(),a("#link-articles").val(b[1]))})});
\ No newline at end of file
jQuery(document).ready(function ($) {
jQuery(document).ready(($) => {
const $parentId = $('#parent-id'),
$blockId = $('#block-id'),
defaultBlockIndex = $blockId.find('option:selected').index() || 0;
......
......@@ -3,7 +3,7 @@
* See the LICENSE file at the top-level module directory for licencing details.
*/
jQuery(document).ready(function($) {
jQuery(document).ready(($) => {
$('input[name="active"]').on('click change', function () {
$('#publication-period-wrapper').toggle(this.value === '1');
}).filter(':checked').click();
......
jQuery(document).ready(function ($) {
jQuery(document).ready(($) => {
$('input[name="readmore"]').on('click change', function () {
$('#readmore-container').toggle(this.value === '1');
}).filter(':checked').click();
......
jQuery(document).ready(function ($) {
jQuery(document).ready(($) => {
const $resourcesTable = $('#resources-table');
$resourcesTable.find('tbody tr:not(.sub-table-header)').hide();
......
......@@ -3,8 +3,8 @@
* See the LICENSE file at the top-level module directory for licencing details.
*/
jQuery(document).ready(function($) {
$('#search-advanced-toggle').click(function() {
jQuery(document).ready(($) => {
$('#search-advanced-toggle').click(() => {
$('#search-advanced-wrapper').toggleClass('hidden');
});
});
......@@ -3,7 +3,7 @@
* See the LICENSE file at the top-level module directory for licencing details.
*/
jQuery(document).ready(function ($) {
jQuery(document).ready(($) => {
$(':radio[name="sitemap_is_enabled"]').on('click change', function () {
$('#seo-sitemap-wrapper').toggle(parseInt(this.value) === 1);
}).filter(':checked').triggerHandler('click');
......
......@@ -79,7 +79,7 @@
};
})(jQuery);
jQuery(document).ready(function ($) {
jQuery(document).ready(($) => {
$('#seo-alias-suggestion').suggestAlias({
prefix: $('[data-seo-slug-prefix]').data('seo-slug-prefix'),
slugBaseElement: $('[data-seo-slug-base="true"]'),
......
......@@ -3,7 +3,7 @@
* See the LICENCE file at the top-level module directory for licencing details.
*/
jQuery(document).ready(function ($) {
jQuery(document).ready(($) => {
$('#services').on('change', function () {
$('#fb-credentials-wrapper').toggle($(this).val() && $(this).val().indexOf('facebook') !== -1);
}).triggerHandler('change');
......
......@@ -3,7 +3,7 @@
* See the LICENCE file at the top-level module directory for licencing details.
*/
jQuery(document).ready(function ($) {
jQuery(document).ready(($) => {
$('#rating-wrapper')
.on('change', ':radio', function () {
$('.rating__average').remove();
......
......@@ -3,12 +3,12 @@
* See the LICENCE file at the top-level module directory for licencing details.
*/
jQuery(document).ready(function($) {
$(':radio[name="share_active"]').on('click change', function() {
jQuery(document).ready(($) => {
$(':radio[name="share_active"]').on('click change', function () {
$('#share-services-wrapper').toggle(parseInt(this.value) === 1);
}).filter(':checked').triggerHandler('click');
$(':radio[name="share_customize_services"]').on('click change', function() {
$(':radio[name="share_customize_services"]').on('click change', function () {
$('#share-custom-services-wrapper').toggle(parseInt(this.value) === 1);
}).filter(':checked').triggerHandler('click');
});
jQuery(document).ready(function ($) {
jQuery(document).ready(($) => {
$(':radio[name="site_subtitle_mode"]').on('click change', function () {
$('#site-subtitle-homepage-home-container').toggle(this.value != 3);
$('#site-subtitle-homepage-home-container').toggle(Number(this.value) !== 3);
}).filter(':checked').triggerHandler('click');
$(':radio[name="cookie_consent_is_enabled"]').on('click change', function () {
$('#cookie-consent-container').toggle(this.value == 1);
$('#cookie-consent-container').toggle(Number(this.value) === 1);
}).filter(':checked').triggerHandler('click');
$(':radio[name="maintenance_mode"]').on('click change', function () {
$('#maintenance-message-container').toggle(this.value == 1);
$('#maintenance-message-container').toggle(Number(this.value) === 1);
}).filter(':checked').triggerHandler('click');
$(':radio[name="mailer_smtp_auth"]').on('click change', function () {
$('#mailer-smtp-2').toggle(this.value == 1);
$('#mailer-smtp-2').toggle(Number(this.value) === 1);
}).filter(':checked').triggerHandler('click');
$('#mailer-type').on('change', function () {
......
"use strict";jQuery(document).ready(function(a){a(":radio[name=\"site_subtitle_mode\"]").on("click change",function(){a("#site-subtitle-homepage-home-container").toggle(3!=this.value)}).filter(":checked").triggerHandler("click"),a(":radio[name=\"cookie_consent_is_enabled\"]").on("click change",function(){a("#cookie-consent-container").toggle(1==this.value)}).filter(":checked").triggerHandler("click"),a(":radio[name=\"maintenance_mode\"]").on("click change",function(){a("#maintenance-message-container").toggle(1==this.value)}).filter(":checked").triggerHandler("click"),a(":radio[name=\"mailer_smtp_auth\"]").on("click change",function(){a("#mailer-smtp-2").toggle(1==this.value)}).filter(":checked").triggerHandler("click"),a("#mailer-type").on("change",function(){"smtp"===a(this).val()?(a("#mailer-smtp-1").show(),a("input[name=\"mailer_smtp_auth\"]:checked").trigger("click")):a("#mailer-smtp-1, #mailer-smtp-2").hide()}).trigger("change")});
\ No newline at end of file
"use strict";jQuery(document).ready(function(a){a(":radio[name=\"site_subtitle_mode\"]").on("click change",function(){a("#site-subtitle-homepage-home-container").toggle(3!==+this.value)}).filter(":checked").triggerHandler("click"),a(":radio[name=\"cookie_consent_is_enabled\"]").on("click change",function(){a("#cookie-consent-container").toggle(1===+this.value)}).filter(":checked").triggerHandler("click"),a(":radio[name=\"maintenance_mode\"]").on("click change",function(){a("#maintenance-message-container").toggle(1===+this.value)}).filter(":checked").triggerHandler("click"),a(":radio[name=\"mailer_smtp_auth\"]").on("click change",function(){a("#mailer-smtp-2").toggle(1===+this.value)}).filter(":checked").triggerHandler("click"),a("#mailer-type").on("change",function(){"smtp"===a(this).val()?(a("#mailer-smtp-1").show(),a("input[name=\"mailer_smtp_auth\"]:checked").trigger("click")):a("#mailer-smtp-1, #mailer-smtp-2").hide()}).trigger("change")});
\ No newline at end of file
......@@ -3,14 +3,14 @@
* See the LICENCE file at the top-level module directory for licencing details.
*/
jQuery(document).ready(function($) {
$('[data-add-tab-identifier]').each(function() {
jQuery(document).ready(($) => {
$('[data-add-tab-identifier]').each(function () {
const tabIdentifier = $(this).data('add-tab-identifier'),
$element = $(tabIdentifier),
$tabContent = $element.closest('.tab-content'),
$tabs = $tabContent.prev('.nav-tabs'),
tabTitle = $(this).data('add-tab-title'),
newTabItem = '<li><a href="' + tabIdentifier + '" data-toggle="tab">' + tabTitle + '</a></li>';
newTabItem = `<li><a href="${tabIdentifier}" data-toggle="tab">${tabTitle}</a></li>`;
$tabs.append(newTabItem);
});
......
"use strict";/*
* Copyright (c) by the ACP3 Developers.
* See the LICENCE file at the top-level module directory for licencing details.
*/jQuery(document).ready(function(a){a("[data-add-tab-identifier]").each(function(){var b=a(this).data("add-tab-identifier"),c=a(b),d=c.closest(".tab-content"),e=d.prev(".nav-tabs"),f=a(this).data("add-tab-title");e.append("<li><a href=\""+b+"\" data-toggle=\"tab\">"+f+"</a></li>")})});
\ No newline at end of file
*/jQuery(document).ready(function(a){a("[data-add-tab-identifier]").each(function(){var b=a(this).data("add-tab-identifier"),c=a(b),d=c.closest(".tab-content"),e=d.prev(".nav-tabs"),f=a(this).data("add-tab-title"),g="<li><a href=\"".concat(b,"\" data-toggle=\"tab\">").concat(f,"</a></li>");e.append(g)})});
\ No newline at end of file
......@@ -390,7 +390,7 @@
};
})(jQuery, window, document);
jQuery(document).ready(function ($) {
jQuery(document).ready(($) => {
$('[data-ajax-form="true"]').formSubmit();
$(document).on('draw.dt', function (e) {
......
......@@ -3,7 +3,7 @@
* See the LICENSE file at the top-level module directory for licencing details.
*/
jQuery(document).ready(function ($) {
jQuery(document).ready(($) => {
const $cookieNotice = $('#cookie-consent'),
cookieName = 'ACCEPT_COOKIES';
......
......@@ -3,8 +3,8 @@
* See the LICENCE file at the top-level module directory for licencing details.
*/
jQuery(document).ready(function ($) {
$('[data-datatable-init]').each(function() {
jQuery(document).ready(($) => {
$('[data-datatable-init]').each(function () {
const $this = $(this),
json = $this.data('datatable-init');
......
jQuery(document).ready(function ($) {
jQuery(document).ready(($) => {
const $datepickerRange = $('[data-datepicker-range]'),
$datepicker = $('[data-datepicker]');
if ($datepickerRange.length > 0) {
$datepickerRange.each(function () {
const datepickers = $datepickerRange.data('datepicker-range');
const datepickers = $(this).data('datepicker-range');
if (datepickers.start && datepickers.end) {
const $datepickerStart = $(datepickers.start),
......
"use strict";jQuery(document).ready(function(a){var b=a("[data-datepicker-range]"),c=a("[data-datepicker]");0<b.length&&b.each(function(){var c=b.data("datepicker-range");if(c.start&&c.end){var d=a(c.start),f=a(c.end);d.datetimepicker(),f.datetimepicker(),d.on("dp.change",function(a){f.data("DateTimePicker").minDate(a.date)}),f.data("DateTimePicker").minDate(c.startDefaultDate)}}),0<c.length&&c.each(function(){a(this).datetimepicker()})});
\ No newline at end of file
"use strict";jQuery(document).ready(function(a){var b=a("[data-datepicker-range]"),c=a("[data-datepicker]");0<b.length&&b.each(function(){var b=a(this).data("datepicker-range");if(b.start&&b.end){var c=a(b.start),d=a(b.end);c.datetimepicker(),d.datetimepicker(),c.on("dp.change",function(a){d.data("DateTimePicker").minDate(a.date)}),d.data("DateTimePicker").minDate(b.startDefaultDate)}}),0<c.length&&c.each(function(){a(this).datetimepicker()})});
\ No newline at end of file
jQuery(document).ready(function ($) {
jQuery(document).ready(($) => {
const $window = $(window);
$window.on('hashchange', function () {
......
......@@ -114,7 +114,7 @@ jQuery.fn.deleteMarkedResults = function (options) {
return $this;
};
jQuery(document).ready(function ($) {
jQuery(document).ready(($) => {
const $markAll = $('[data-mark-all-id]');
$markAll.each((index, element) => {
......
/* global wysiwygCallback */
jQuery(document).ready(function ($) {
jQuery(document).ready(($) => {
$('#page-break-form').find('.modal-footer button.btn-primary').click(function (e) {
e.preventDefault();
......
......@@ -2,7 +2,7 @@
* Copyright (c) by the ACP3 Developers.
* See the LICENSE file at the top-level module directory for licencing details.
*/
jQuery(document).ready(function ($) {
jQuery(document).ready(($) => {
const ajaxUrl = $('#config-form').data('available-databases-url'),
$dbName = $('#db-name'),
$formFields = $('#db-host, #db-user, #db-password'),
......
......@@ -173,8 +173,8 @@
</div>
</form>
{javascripts}
<script defer src="{$ROOT_DIR}ACP3/Modules/ACP3/System/Resources/Assets/js/ajax-form.js"></script>
<script defer src="{$INSTALLER_ROOT_DIR}Installer/Modules/Install/Resources/Assets/js/available_databases.js"></script>
<script defer src="{$ROOT_DIR}ACP3/Modules/ACP3/System/Resources/Assets/js/partials/ajax-form.min.js"></script>
<script defer src="{$INSTALLER_ROOT_DIR}Installer/Modules/Install/Resources/Assets/js/available_databases.min.js"></script>
{/javascripts}
{/if}
{/block}
......@@ -9,6 +9,6 @@
</div>
</form>
{javascripts}
<script defer src="{$ROOT_DIR}ACP3/Modules/ACP3/System/Resources/Assets/js/ajax-form.js"></script>
<script defer src="{$ROOT_DIR}ACP3/Modules/ACP3/System/Resources/Assets/js/partials/ajax-form.min.js"></script>
{/javascripts}
{/block}
......@@ -3,7 +3,7 @@
* See the LICENSE file at the top-level module directory for licencing details.
*/
jQuery(document).ready(function ($) {
jQuery(document).ready(($) => {
const $doc = $(document),
$languages = $('#languages');
......
......@@ -77,7 +77,7 @@
</div>
<script defer src="{$ROOT_DIR}ACP3/Modules/ACP3/System/Resources/Assets/js/jquery.min.js"></script>
<script defer src="{$ROOT_DIR}ACP3/Modules/ACP3/System/Resources/Assets/js/bootstrap.min.js"></script>
<script defer src="{$DESIGN_PATH}Assets/js/language-switcher.js"></script>
<script defer src="{$DESIGN_PATH}Assets/js/language-switcher.min.js"></script>
<!-- JAVASCRIPTS -->
</body>
</html>
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment