Refs #31493 -- Changed IIFE to ES6 blocks.

This commit is contained in:
Jon Dufresne 2020-04-26 14:12:34 -07:00 committed by Carlton Gibson
parent 5d37cc703b
commit 7271c8def4
32 changed files with 77 additions and 90 deletions

View File

@ -24,7 +24,7 @@
"space-before-blocks": ["error", "always"],
"space-before-function-paren": ["error", {"anonymous": "never", "named": "never"}],
"space-infix-ops": ["error", {"int32Hint": false}],
"strict": ["warn", "function"]
"strict": ["error", "global"]
},
"env": {
"browser": true,

View File

@ -1,5 +1,5 @@
(function() {
'use strict';
{
const SelectBox = {
cache: {},
init: function(id) {
@ -127,4 +127,4 @@
}
};
window.SelectBox = SelectBox;
})();
}

View File

@ -4,8 +4,8 @@ SelectFilter2 - Turns a multiple-select box into a filter interface.
Requires core.js and SelectBox.js.
*/
(function() {
'use strict';
{
window.SelectFilter = {
init: function(field_id, field_name, is_stacked) {
if (field_id.match(/__prefix__/)) {
@ -234,4 +234,4 @@ Requires core.js and SelectBox.js.
SelectFilter.init(el.id, data.fieldName, parseInt(data.isStacked, 10));
});
});
})();
}

View File

@ -1,6 +1,7 @@
/*global gettext, interpolate, ngettext*/
(function($) {
'use strict';
{
const $ = django.jQuery;
let lastChecked;
$.fn.actions = function(opts) {
@ -150,4 +151,4 @@
$actionsEls.actions();
}
});
})(django.jQuery);
}

View File

@ -1,7 +1,7 @@
(function(a){var f;a.fn.actions=function(e){var b=a.extend({},a.fn.actions.defaults,e),g=a(this),k=!1,l=function(){a(b.acrossClears).hide();a(b.acrossQuestions).show();a(b.allContainer).hide()},m=function(){a(b.acrossClears).show();a(b.acrossQuestions).hide();a(b.actionContainer).toggleClass(b.selectedClass);a(b.allContainer).show();a(b.counterContainer).hide()},n=function(){a(b.acrossClears).hide();a(b.acrossQuestions).hide();a(b.allContainer).hide();a(b.counterContainer).show()},p=function(){n();
a(b.acrossInput).val(0);a(b.actionContainer).removeClass(b.selectedClass)},q=function(c){c?l():n();a(g).prop("checked",c).parent().parent().toggleClass(b.selectedClass,c)},h=function(){var c=a(g).filter(":checked").length,d=a(".action-counter").data("actionsIcnt");a(b.counterContainer).html(interpolate(ngettext("%(sel)s of %(cnt)s selected","%(sel)s of %(cnt)s selected",c),{sel:c,cnt:d},!0));a(b.allToggle).prop("checked",function(){if(c===g.length){var a=!0;l()}else a=!1,p();return a})};a(b.counterContainer).show();
a(this).filter(":checked").each(function(c){a(this).parent().parent().toggleClass(b.selectedClass);h();1===a(b.acrossInput).val()&&m()});a(b.allToggle).show().on("click",function(){q(a(this).prop("checked"));h()});a("a",b.acrossQuestions).on("click",function(c){c.preventDefault();a(b.acrossInput).val(1);m()});a("a",b.acrossClears).on("click",function(c){c.preventDefault();a(b.allToggle).prop("checked",!1);p();q(0);h()});f=null;a(g).on("click",function(c){c||(c=window.event);var d=c.target?c.target:
c.srcElement;if(f&&a.data(f)!==a.data(d)&&!0===c.shiftKey){var e=!1;a(f).prop("checked",d.checked).parent().parent().toggleClass(b.selectedClass,d.checked);a(g).each(function(){if(a.data(this)===a.data(f)||a.data(this)===a.data(d))e=e?!1:!0;e&&a(this).prop("checked",d.checked).parent().parent().toggleClass(b.selectedClass,d.checked)})}a(d).parent().parent().toggleClass(b.selectedClass,d.checked);f=d;h()});a("form#changelist-form table#result_list tr").on("change","td:gt(0) :input",function(){k=!0});
a('form#changelist-form button[name="index"]').on("click",function(a){if(k)return confirm(gettext("You have unsaved changes on individual editable fields. If you run an action, your unsaved changes will be lost."))});a('form#changelist-form input[name="_save"]').on("click",function(c){var d=!1;a("select option:selected",b.actionContainer).each(function(){a(this).val()&&(d=!0)});if(d)return k?confirm(gettext("You have selected an action, but you haven\u2019t saved your changes to individual fields yet. Please click OK to save. You\u2019ll need to re-run the action.")):
confirm(gettext("You have selected an action, and you haven\u2019t made any changes on individual fields. You\u2019re probably looking for the Go button rather than the Save button."))})};a.fn.actions.defaults={actionContainer:"div.actions",counterContainer:"span.action-counter",allContainer:"div.actions span.all",acrossInput:"div.actions input.select-across",acrossQuestions:"div.actions span.question",acrossClears:"div.actions span.clear",allToggle:"#action-toggle",selectedClass:"selected"};a(document).ready(function(){var e=
a("tr input.action-select");0<e.length&&e.actions()})})(django.jQuery);
'use strict';{const a=django.jQuery;let e;a.fn.actions=function(g){const b=a.extend({},a.fn.actions.defaults,g),f=a(this);let k=!1;const l=function(){a(b.acrossClears).hide();a(b.acrossQuestions).show();a(b.allContainer).hide()},m=function(){a(b.acrossClears).show();a(b.acrossQuestions).hide();a(b.actionContainer).toggleClass(b.selectedClass);a(b.allContainer).show();a(b.counterContainer).hide()},n=function(){a(b.acrossClears).hide();a(b.acrossQuestions).hide();a(b.allContainer).hide();a(b.counterContainer).show()},
p=function(){n();a(b.acrossInput).val(0);a(b.actionContainer).removeClass(b.selectedClass)},q=function(c){c?l():n();a(f).prop("checked",c).parent().parent().toggleClass(b.selectedClass,c)},h=function(){const c=a(f).filter(":checked").length,d=a(".action-counter").data("actionsIcnt");a(b.counterContainer).html(interpolate(ngettext("%(sel)s of %(cnt)s selected","%(sel)s of %(cnt)s selected",c),{sel:c,cnt:d},!0));a(b.allToggle).prop("checked",function(){let a;c===f.length?(a=!0,l()):(a=!1,p());return a})};
a(b.counterContainer).show();a(this).filter(":checked").each(function(c){a(this).parent().parent().toggleClass(b.selectedClass);h();1===a(b.acrossInput).val()&&m()});a(b.allToggle).show().on("click",function(){q(a(this).prop("checked"));h()});a("a",b.acrossQuestions).on("click",function(c){c.preventDefault();a(b.acrossInput).val(1);m()});a("a",b.acrossClears).on("click",function(c){c.preventDefault();a(b.allToggle).prop("checked",!1);p();q(0);h()});e=null;a(f).on("click",function(c){c||(c=window.event);
const d=c.target?c.target:c.srcElement;if(e&&a.data(e)!==a.data(d)&&!0===c.shiftKey){let c=!1;a(e).prop("checked",d.checked).parent().parent().toggleClass(b.selectedClass,d.checked);a(f).each(function(){if(a.data(this)===a.data(e)||a.data(this)===a.data(d))c=c?!1:!0;c&&a(this).prop("checked",d.checked).parent().parent().toggleClass(b.selectedClass,d.checked)})}a(d).parent().parent().toggleClass(b.selectedClass,d.checked);e=d;h()});a("form#changelist-form table#result_list tr").on("change","td:gt(0) :input",
function(){k=!0});a('form#changelist-form button[name="index"]').on("click",function(a){if(k)return confirm(gettext("You have unsaved changes on individual editable fields. If you run an action, your unsaved changes will be lost."))});a('form#changelist-form input[name="_save"]').on("click",function(c){let d=!1;a("select option:selected",b.actionContainer).each(function(){a(this).val()&&(d=!0)});if(d)return k?confirm(gettext("You have selected an action, but you haven\u2019t saved your changes to individual fields yet. Please click OK to save. You\u2019ll need to re-run the action.")):
confirm(gettext("You have selected an action, and you haven\u2019t made any changes on individual fields. You\u2019re probably looking for the Go button rather than the Save button."))})};a.fn.actions.defaults={actionContainer:"div.actions",counterContainer:"span.action-counter",allContainer:"div.actions span.all",acrossInput:"div.actions input.select-across",acrossQuestions:"div.actions span.question",acrossClears:"div.actions span.clear",allToggle:"#action-toggle",selectedClass:"selected"};a(document).ready(function(){const g=
a("tr input.action-select");0<g.length&&g.actions()})};

View File

@ -2,8 +2,8 @@
// Inserts shortcut buttons after all of the following:
// <input type="text" class="vDateField">
// <input type="text" class="vTimeField">
(function() {
'use strict';
{
const DateTimeShortcuts = {
calendars: [],
calendarInputs: [],
@ -416,4 +416,4 @@
window.addEventListener('load', DateTimeShortcuts.init);
window.DateTimeShortcuts = DateTimeShortcuts;
})();
}

View File

@ -1,9 +1,9 @@
/*global SelectBox, interpolate*/
// Handles related-objects functionality: lookup link for raw_id_fields
// and Add Another links.
(function($) {
'use strict';
{
const $ = django.jQuery;
function showAdminPopup(triggeringLink, name_regexp, add_popup) {
const name = triggeringLink.id.replace(name_regexp, '');
@ -156,5 +156,4 @@
}
});
});
})(django.jQuery);
}

View File

@ -1,5 +1,6 @@
(function($) {
'use strict';
{
const $ = django.jQuery;
const init = function($element, options) {
const settings = $.extend({
ajax: {
@ -34,4 +35,4 @@
return $newFormset.find('.admin-autocomplete').djangoAdminSelect2();
};
})(this));
}(django.jQuery));
}

View File

@ -3,9 +3,8 @@
calendar.js - Calendar functions by Adrian Holovaty
depends on core.js for utility functions like removeChildren or quickElement
*/
(function() {
'use strict';
{
// CalendarNamespace -- Provides a collection of HTML calendar-related helper functions
const CalendarNamespace = {
monthsOfYear: [
@ -205,4 +204,4 @@ depends on core.js for utility functions like removeChildren or quickElement
};
window.Calendar = Calendar;
window.CalendarNamespace = CalendarNamespace;
})();
}

View File

@ -1,6 +1,5 @@
(function() {
'use strict';
{
// Call function fn when the DOM is loaded and ready. If it is already
// loaded, call the function now.
// http://youmightnotneedjquery.com/#ready
@ -26,4 +25,4 @@
el.addEventListener('click', handleClick);
});
});
})();
}

View File

@ -1,5 +1,5 @@
(function() {
'use strict';
{
const inputTags = ['BUTTON', 'INPUT', 'SELECT', 'TEXTAREA'];
const modelName = document.getElementById('django-admin-form-add-constants').dataset.modelName;
if (modelName) {
@ -14,4 +14,4 @@
}
}
}
})();
}

View File

@ -1,6 +1,6 @@
/*global gettext*/
(function() {
'use strict';
{
window.addEventListener('load', function() {
// Add anchor tag for Show/Hide link
const fieldsets = document.querySelectorAll('fieldset.collapse');
@ -42,4 +42,4 @@
inlineDivs[i].addEventListener('click', toggleFunc);
}
});
})();
}

View File

@ -1,2 +1,2 @@
'use strict';(function(){window.addEventListener("load",function(){var d=document.querySelectorAll("fieldset.collapse");for(var c=0;c<d.length;c++){var a=d[c];if(0===a.querySelectorAll("div.errors, ul.errorlist").length){a.classList.add("collapsed");a=a.querySelector("h2");const b=document.createElement("a");b.id="fieldsetcollapser"+c;b.className="collapse-toggle";b.href="#";b.textContent=gettext("Show");a.appendChild(document.createTextNode(" ("));a.appendChild(b);a.appendChild(document.createTextNode(")"))}}d=
function(b){if(b.target.matches(".collapse-toggle")){b.preventDefault();b.stopPropagation();const a=b.target.closest("fieldset");a.classList.contains("collapsed")?(b.target.textContent=gettext("Hide"),a.classList.remove("collapsed")):(b.target.textContent=gettext("Show"),a.classList.add("collapsed"))}};c=document.querySelectorAll("fieldset.module");for(a=0;a<c.length;a++)c[a].addEventListener("click",d)})})();
'use strict';window.addEventListener("load",function(){var d=document.querySelectorAll("fieldset.collapse");for(var c=0;c<d.length;c++){var a=d[c];if(0===a.querySelectorAll("div.errors, ul.errorlist").length){a.classList.add("collapsed");a=a.querySelector("h2");const b=document.createElement("a");b.id="fieldsetcollapser"+c;b.className="collapse-toggle";b.href="#";b.textContent=gettext("Show");a.appendChild(document.createTextNode(" ("));a.appendChild(b);a.appendChild(document.createTextNode(")"))}}d=
function(b){if(b.target.matches(".collapse-toggle")){b.preventDefault();b.stopPropagation();const a=b.target.closest("fieldset");a.classList.contains("collapsed")?(b.target.textContent=gettext("Hide"),a.classList.remove("collapsed")):(b.target.textContent=gettext("Show"),a.classList.add("collapsed"))}};c=document.querySelectorAll("fieldset.module");for(a=0;a<c.length;a++)c[a].addEventListener("click",d)});

View File

@ -1,8 +1,8 @@
// Core javascript helper functions
'use strict';
// quickElement(tagType, parentReference [, textInChildNode, attribute, attributeValue ...]);
function quickElement() {
'use strict';
const obj = document.createElement(arguments[0]);
if (arguments[2]) {
const textNode = document.createTextNode(arguments[2]);
@ -18,7 +18,6 @@ function quickElement() {
// "a" is reference to an object
function removeChildren(a) {
'use strict';
while (a.hasChildNodes()) {
a.removeChild(a.lastChild);
}
@ -29,7 +28,6 @@ function removeChildren(a) {
// See https://www.quirksmode.org/js/findpos.html
// ----------------------------------------------------------------------------
function findPosX(obj) {
'use strict';
let curleft = 0;
if (obj.offsetParent) {
while (obj.offsetParent) {
@ -43,7 +41,6 @@ function findPosX(obj) {
}
function findPosY(obj) {
'use strict';
let curtop = 0;
if (obj.offsetParent) {
while (obj.offsetParent) {
@ -59,8 +56,7 @@ function findPosY(obj) {
//-----------------------------------------------------------------------------
// Date object extensions
// ----------------------------------------------------------------------------
(function() {
'use strict';
{
Date.prototype.getTwelveHours = function() {
return this.getHours() % 12 || 12;
};
@ -164,5 +160,4 @@ function findPosY(obj) {
// date extraction.
return new Date(Date.UTC(year, month, day));
};
})();
}

View File

@ -15,8 +15,9 @@
* Licensed under the New BSD License
* See: https://opensource.org/licenses/bsd-license.php
*/
(function($) {
'use strict';
{
const $ = django.jQuery;
$.fn.formset = function(opts) {
const options = $.extend({}, $.fn.formset.defaults, opts);
const $this = $(this);
@ -344,4 +345,4 @@
}
});
});
})(django.jQuery);
}

View File

@ -1,6 +1,6 @@
'use strict';(function(b){b.fn.formset=function(c){const a=b.extend({},b.fn.formset.defaults,c),e=b(this),l=e.parent(),m=function(a,d,h){const g=new RegExp("("+d+"-(\\d+|__prefix__))");d=d+"-"+h;b(a).prop("for")&&b(a).prop("for",b(a).prop("for").replace(g,d));a.id&&(a.id=a.id.replace(g,d));a.name&&(a.name=a.name.replace(g,d))},f=b("#id_"+a.prefix+"-TOTAL_FORMS").prop("autocomplete","off");let n=parseInt(f.val(),10);const h=b("#id_"+a.prefix+"-MAX_NUM_FORMS").prop("autocomplete","off"),q=b("#id_"+
a.prefix+"-MIN_NUM_FORMS").prop("autocomplete","off");let k;const t=function(g){g.preventDefault();g=b("#"+a.prefix+"-empty");const d=g.clone(!0);d.removeClass(a.emptyCssClass).addClass(a.formCssClass).attr("id",a.prefix+"-"+n);r(d);d.find("*").each(function(){m(this,a.prefix,f.val())});d.insertBefore(b(g));b(f).val(parseInt(f.val(),10)+1);n+=1;""!==h.val()&&0>=h.val()-f.val()&&k.parent().hide();p(d.closest(".inline-group"));a.added&&a.added(d);b(document).trigger("formset:added",[d,a.prefix])},r=
function(b){b.is("tr")?b.children(":last").append('<div><a class="'+a.deleteCssClass+'" href="#">'+a.deleteText+"</a></div>"):b.is("ul")||b.is("ol")?b.append('<li><a class="'+a.deleteCssClass+'" href="#">'+a.deleteText+"</a></li>"):b.children(":first").append('<span><a class="'+a.deleteCssClass+'" href="#">'+a.deleteText+"</a></span>");b.find("a."+a.deleteCssClass).on("click",u.bind(this))},u=function(g){g.preventDefault();var d=b(g.target).closest("."+a.formCssClass);g=d.closest(".inline-group");
'use strict';{const b=django.jQuery;b.fn.formset=function(c){const a=b.extend({},b.fn.formset.defaults,c),e=b(this),l=e.parent(),m=function(a,d,h){const g=new RegExp("("+d+"-(\\d+|__prefix__))");d=d+"-"+h;b(a).prop("for")&&b(a).prop("for",b(a).prop("for").replace(g,d));a.id&&(a.id=a.id.replace(g,d));a.name&&(a.name=a.name.replace(g,d))},f=b("#id_"+a.prefix+"-TOTAL_FORMS").prop("autocomplete","off");let n=parseInt(f.val(),10);const h=b("#id_"+a.prefix+"-MAX_NUM_FORMS").prop("autocomplete","off"),q=
b("#id_"+a.prefix+"-MIN_NUM_FORMS").prop("autocomplete","off");let k;const t=function(g){g.preventDefault();g=b("#"+a.prefix+"-empty");const d=g.clone(!0);d.removeClass(a.emptyCssClass).addClass(a.formCssClass).attr("id",a.prefix+"-"+n);r(d);d.find("*").each(function(){m(this,a.prefix,f.val())});d.insertBefore(b(g));b(f).val(parseInt(f.val(),10)+1);n+=1;""!==h.val()&&0>=h.val()-f.val()&&k.parent().hide();p(d.closest(".inline-group"));a.added&&a.added(d);b(document).trigger("formset:added",[d,a.prefix])},
r=function(b){b.is("tr")?b.children(":last").append('<div><a class="'+a.deleteCssClass+'" href="#">'+a.deleteText+"</a></div>"):b.is("ul")||b.is("ol")?b.append('<li><a class="'+a.deleteCssClass+'" href="#">'+a.deleteText+"</a></li>"):b.children(":first").append('<span><a class="'+a.deleteCssClass+'" href="#">'+a.deleteText+"</a></span>");b.find("a."+a.deleteCssClass).on("click",u.bind(this))},u=function(g){g.preventDefault();var d=b(g.target).closest("."+a.formCssClass);g=d.closest(".inline-group");
var f=d.prev();f.length&&f.hasClass("row-form-errors")&&f.remove();d.remove();--n;a.removed&&a.removed(d);b(document).trigger("formset:removed",[d,a.prefix]);d=b("."+a.formCssClass);b("#id_"+a.prefix+"-TOTAL_FORMS").val(d.length);(""===h.val()||0<h.val()-d.length)&&k.parent().show();p(g);let c;f=function(){m(this,a.prefix,c)};c=0;for(g=d.length;c<g;c++)m(b(d).get(c),a.prefix,c),b(d.get(c)).find("*").each(f)},p=function(a){""!==q.val()&&0<=q.val()-f.val()?a.find(".inline-deletelink").hide():a.find(".inline-deletelink").show()};
e.each(function(c){b(this).not("."+a.emptyCssClass).addClass(a.formCssClass)});e.filter("."+a.formCssClass+":not(.has_original):not(."+a.emptyCssClass+")").each(function(){r(b(this))});p(e);k=a.addButton;(function(){if(null===k)if("TR"===e.prop("tagName")){const b=e.eq(-1).children().length;l.append('<tr class="'+a.addCssClass+'"><td colspan="'+b+'"><a href="#">'+a.addText+"</a></tr>");k=l.find("tr:last a")}else e.filter(":last").after('<div class="'+a.addCssClass+'"><a href="#">'+a.addText+"</a></div>"),
k=e.filter(":last").next().find("a");k.on("click",t)})();c=""===h.val()||0<h.val()-f.val();e.length&&c?k.parent().show():k.parent().hide();return this};b.fn.formset.defaults={prefix:"form",addText:"add another",deleteText:"remove",addCssClass:"add-row",deleteCssClass:"delete-row",emptyCssClass:"empty-row",formCssClass:"dynamic-form",added:null,removed:null,addButton:null};b.fn.tabularFormset=function(c,a){c=b(this);const e=function(){"undefined"!==typeof SelectFilter&&(b(".selectfilter").each(function(a,
@ -8,4 +8,4 @@ b){a=b.name.split("-");SelectFilter.init(b.id,a[a.length-1],!1)}),b(".selectfilt
formCssClass:"dynamic-"+a.prefix,deleteCssClass:"inline-deletelink",deleteText:a.deleteText,emptyCssClass:"empty-form",added:function(a){l(a);"undefined"!==typeof DateTimeShortcuts&&(b(".datetimeshortcuts").remove(),DateTimeShortcuts.init());e()},addButton:a.addButton});return c};b.fn.stackedFormset=function(c,a){const e=b(this),l=function(a){b(c).find(".inline_label").each(function(a){a+=1;b(this).html(b(this).html().replace(/(#\d+)/g,"#"+a))})},m=function(){"undefined"!==typeof SelectFilter&&(b(".selectfilter").each(function(a,
b){a=b.name.split("-");SelectFilter.init(b.id,a[a.length-1],!1)}),b(".selectfilterstacked").each(function(a,b){a=b.name.split("-");SelectFilter.init(b.id,a[a.length-1],!0)}))},f=function(a){a.find(".prepopulated_field").each(function(){const c=b(this).find("input, select, textarea"),f=c.data("dependency_list")||[],e=[];b.each(f,function(b,c){e.push("#"+a.find(".form-row .field-"+c).find("input, select, textarea").attr("id"))});e.length&&c.prepopulate(e,c.attr("maxlength"))})};e.formset({prefix:a.prefix,
addText:a.addText,formCssClass:"dynamic-"+a.prefix,deleteCssClass:"inline-deletelink",deleteText:a.deleteText,emptyCssClass:"empty-form",removed:l,added:function(a){f(a);"undefined"!==typeof DateTimeShortcuts&&(b(".datetimeshortcuts").remove(),DateTimeShortcuts.init());m();l(a)},addButton:a.addButton});return e};b(document).ready(function(){b(".js-inline-admin-formset").each(function(){var c=b(this).data();const a=c.inlineFormset;switch(c.inlineType){case "stacked":c=a.name+"-group .inline-related";
b(c).stackedFormset(c,a.options);break;case "tabular":c=a.name+"-group .tabular.inline-related tbody:first > tr.form-row",b(c).tabularFormset(c,a.options)}})})})(django.jQuery);
b(c).stackedFormset(c,a.options);break;case "tabular":c=a.name+"-group .tabular.inline-related tbody:first > tr.form-row",b(c).tabularFormset(c,a.options)}})})};

View File

@ -1,4 +1,5 @@
/*global jQuery:false*/
'use strict';
/* Puts the included jQuery into our own namespace using noConflict and passing
* it 'true'. This ensures that the included jQuery doesn't pollute the global
* namespace (i.e. this preserves pre-existing values for both window.$ and

View File

@ -1,6 +1,6 @@
/*global opener */
(function() {
'use strict';
{
const initData = JSON.parse(document.getElementById('django-admin-popup-response-constants').dataset.popupResponse);
switch(initData.action) {
case 'change':
@ -13,4 +13,4 @@
opener.dismissAddRelatedObjectPopup(window, initData.value, initData.obj);
break;
}
})();
}

View File

@ -1,6 +1,7 @@
/*global URLify*/
(function($) {
'use strict';
{
const $ = django.jQuery;
$.fn.prepopulate = function(dependencies, maxLength, allowUnicode) {
/*
Depends on urlify.js
@ -39,4 +40,4 @@
}
});
};
})(django.jQuery);
}

View File

@ -1 +1 @@
'use strict';(function(b){b.fn.prepopulate=function(d,f,g){return this.each(function(){const a=b(this),h=function(){if(!a.data("_changed")){var e=[];b.each(d,function(a,c){c=b(c);0<c.val().length&&e.push(c.val())});a.val(URLify(e.join(" "),f,g))}};a.data("_changed",!1);a.on("change",function(){a.data("_changed",!0)});if(!a.val())b(d.join(",")).on("keyup change focus",h)})}})(django.jQuery);
'use strict';{const b=django.jQuery;b.fn.prepopulate=function(d,f,g){return this.each(function(){const a=b(this),h=function(){if(!a.data("_changed")){var e=[];b.each(d,function(a,c){c=b(c);0<c.val().length&&e.push(c.val())});a.val(URLify(e.join(" "),f,g))}};a.data("_changed",!1);a.on("change",function(){a.data("_changed",!0)});if(!a.val())b(d.join(",")).on("keyup change focus",h)})}};

View File

@ -1,5 +1,6 @@
(function($) {
'use strict';
{
const $ = django.jQuery;
const fields = $('#django-admin-prepopulated-fields-constants').data('prepopulatedFields');
$.each(fields, function(index, field) {
$('.empty-form .form-row .field-' + field.name + ', .empty-form.form-row .field-' + field.name).addClass('prepopulated_field');
@ -7,4 +8,4 @@
field.dependency_ids, field.maxLength, field.allowUnicode
);
});
})(django.jQuery);
}

View File

@ -1,7 +1,6 @@
/*global XRegExp*/
(function() {
'use strict';
{
const LATIN_MAP = {
'À': 'A', 'Á': 'A', 'Â': 'A', 'Ã': 'A', 'Ä': 'A', 'Å': 'A', 'Æ': 'AE',
'Ç': 'C', 'È': 'E', 'É': 'E', 'Ê': 'E', 'Ë': 'E', 'Ì': 'I', 'Í': 'I',
@ -193,4 +192,4 @@
return s;
}
window.URLify = URLify;
})();
}

View File

@ -1,7 +1,6 @@
/* global ol */
function GeometryTypeControl(opt_options) {
'use strict';
function GeometryTypeControl(opt_options) {
// Map control to switch type when geometry type is unknown
const options = opt_options || {};
@ -37,8 +36,7 @@ function GeometryTypeControl(opt_options) {
ol.inherits(GeometryTypeControl, ol.control.Control);
// TODO: allow deleting individual features (#8972)
(function() {
'use strict';
{
const jsonFormat = new ol.format.GeoJSON();
function MapWidget(options) {
@ -227,4 +225,4 @@ ol.inherits(GeometryTypeControl, ol.control.Control);
};
window.MapWidget = MapWidget;
})();
}

View File

@ -1,5 +1,4 @@
/* global QUnit, DateTimeShortcuts */
/* eslint strict: 0 */
'use strict';
QUnit.module('admin.DateTimeShortcuts');

View File

@ -1,5 +1,4 @@
/* global QUnit, SelectBox */
/* eslint strict: 0 */
'use strict';
QUnit.module('admin.SelectBox');

View File

@ -1,5 +1,4 @@
/* global QUnit, SelectFilter */
/* eslint strict: 0 */
'use strict';
QUnit.module('admin.SelectFilter2');

View File

@ -1,5 +1,4 @@
/* global QUnit, URLify */
/* eslint strict: 0 */
'use strict';
QUnit.module('admin.URLify');

View File

@ -1,5 +1,4 @@
/* global QUnit */
/* eslint strict: 0 */
'use strict';
QUnit.module('admin.actions', {

View File

@ -1,5 +1,4 @@
/* global QUnit */
/* eslint strict: 0 */
'use strict';
QUnit.module('admin.core');

View File

@ -1,5 +1,4 @@
/* global QUnit */
/* eslint strict: 0 */
'use strict';
QUnit.module('admin.inlines: tabular formsets', {

View File

@ -1,5 +1,6 @@
(function(globals) {
'use strict';
{
const globals = this;
const django = globals.django;
django.pluralidx = function(count) { return (count === 1) ? 0 : 1; };
@ -86,5 +87,4 @@
globals.npgettext = django.npgettext;
globals.interpolate = django.interpolate;
globals.get_format = django.get_format;
}(this));
};

View File

@ -1,5 +1,4 @@
/* global QUnit, MapWidget */
/* eslint strict: 0 */
'use strict';
QUnit.module('gis.OLMapWidget');