框架升级及修复升级后的bug

This commit is contained in:
Dev
2026-10-16 18:13:09 +08:00
parent dafb0c96c0
commit 2d342bcbd7
537 changed files with 49836 additions and 40933 deletions
+26 -2
View File
@@ -165,7 +165,10 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form', 'template', 'cookie']
title: __('Operate'),
table: table,
formatter: Controller.api.formatter.operate,
align: 'right'
align: 'right',
cellStyle: function (value, row, index) {
return {css: {'min-width': '158px'}};
}
},
]
],
@@ -238,6 +241,27 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form', 'template', 'cookie']
Layer.close(index);
});
return false;
} else if (ret && ret.code === -3) {
//插件目录发现影响全局的文件
Layer.open({
content: Template("conflicttpl", ret.data),
shade: 0.8,
area: area,
title: __('Warning'),
btn: [__('Continue install'), __('Cancel')],
end: function () {
},
yes: function (index) {
up.removeFile(file);
file.force = true;
up.uploadFile(file);
Layer.close(index);
}
});
} else {
Layer.alert(ret.msg, {title: __('Warning'), icon: 0});
}
});
@@ -480,7 +504,7 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form', 'template', 'cookie']
//如果登录已经超时,重新提醒登录
if (uid && uid != ret.data.uid) {
Controller.api.userinfo.set(null);
$(".operate[data-name='" + name + "'] .btn-install").trigger("click");
$(".operate[data-name='" + name + "'] .btn-install:first").trigger("click");
return;
}
top.Fast.api.open(ret.data.payurl, __('Pay now'), {
@@ -20,7 +20,7 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form', 'template'], function
table.bootstrapTable({
url: $.fn.bootstrapTable.defaults.extend.index_url,
sortName: '',
escape: false,
escape: true,
columns: [
[
{field: 'state', checkbox: true,},
@@ -180,7 +180,7 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form', 'template'], function
var iconfunc = function () {
Layer.open({
type: 1,
area: ['99%', '98%'], //宽高
area: ['80%', '80%'], //宽高
content: Template('chooseicontpl', {iconlist: iconlist})
});
};
@@ -192,8 +192,8 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form', 'template'], function
});
$(document).on('click', ".btn-search-icon", function () {
if (iconlist.length == 0) {
$.get(Config.site.cdnurl + "/assets/libs/font-awesome/less/variables.less", function (ret) {
var exp = /fa-var-(.*):/ig;
$.get(Config.site.cdnurl + "/assets/libs/font-awesome/css/font-awesome.css", function (ret) {
var exp = /fa-(.*):before/ig;
var result;
while ((result = exp.exec(ret)) != null) {
iconlist.push(result[1]);
@@ -37,10 +37,10 @@ define(['jquery', 'bootstrap', 'backend', 'form', 'table'], function ($, undefin
return (size / Math.pow(1024, i)).toFixed(i < 2 ? 0 : 2) * 1 + ' ' + ['B', 'KB', 'MB', 'GB', 'TB'][i];
}
},
{field: 'imagewidth', title: __('Imagewidth'), sortable: true},
{field: 'imageheight', title: __('Imageheight'), sortable: true},
{field: 'imagetype', title: __('Imagetype'), sortable: true, formatter: Table.api.formatter.search, operate: 'like'},
{field: 'storage', title: __('Storage'), formatter: Table.api.formatter.search, operate: 'like'},
{field: 'imagewidth', title: __('Imagewidth'), sortable: true, formatter: Controller.api.formatter.text},
{field: 'imageheight', title: __('Imageheight'), sortable: true, formatter: Controller.api.formatter.text},
{field: 'imagetype', title: __('Imagetype'), sortable: true, formatter: Controller.api.formatter.search, operate: 'like'},
{field: 'storage', title: __('Storage'), formatter: Controller.api.formatter.search, operate: 'like'},
{field: 'mimetype', title: __('Mimetype'), formatter: Controller.api.formatter.mimetype},
{
field: 'createtime',
@@ -167,7 +167,7 @@ define(['jquery', 'bootstrap', 'backend', 'form', 'table'], function ($, undefin
{
field: 'operate', title: __('Operate'), width: 85, events: {
'click .btn-chooseone': function (e, value, row, index) {
Fast.api.close({url: row.url, multiple: multiple});
Fast.api.close($.extend({multiple: multiple}, row));
},
}, formatter: function () {
return '<a href="javascript:;" class="btn btn-danger btn-chooseone btn-xs"><i class="fa fa-check"></i> ' + __('Choose') + '</a>';
@@ -234,24 +234,63 @@ define(['jquery', 'bootstrap', 'backend', 'form', 'table'], function ($, undefin
bindevent: function () {
Form.api.bindevent($("form[role=form]"));
},
safeurl: function (value) {
value = value == null ? '' : String(value);
if (/[\x00-\x1f\x7f]/.test(value)) {
return '';
}
value = value.trim();
if (/^[a-z][a-z0-9+.-]*:/i.test(value) && !/^https?:\/\//i.test(value)) {
return '';
}
return Fast.api.escape(value);
},
formatter: {
text: function (value) {
return Fast.api.escape(value == null ? '' : String(value));
},
legacytext: function (value) {
value = value == null ? '' : String(value);
value = value.replace(/&(amp|lt|gt|quot|#0*39|#x0*27);/gi, function (match, entity) {
var entities = {
amp: '&', lt: '<', gt: '>', quot: '"',
'#39': "'", '#x27': "'"
};
entity = entity.toLowerCase().replace(/^#0+/, '#').replace(/^#x0+/, '#x');
return entities[entity] || match;
});
return Controller.api.formatter.text(value);
},
search: function (value, row, index) {
if (row && this.field && typeof row[this.field] !== 'undefined') {
value = row[this.field];
}
return Table.api.formatter.search.call(this, Controller.api.formatter.text(value), row, index);
},
thumb: function (value, row, index) {
var html = '';
var fullurl = Controller.api.safeurl(row.fullurl);
if (row.mimetype.indexOf("image") > -1) {
html = '<a href="' + row.fullurl + '" target="_blank"><img src="' + row.fullurl + row.thumb_style + '" alt="" style="max-height:60px;max-width:120px"></a>';
var thumburl = Controller.api.safeurl((row.fullurl || '') + (row.thumb_style || ''));
html = '<a href="' + fullurl + '" target="_blank"><img src="' + thumburl + '" alt="" style="max-height:60px;max-width:120px"></a>';
} else {
html = '<a href="' + row.fullurl + '" target="_blank"><img src="' + Fast.api.fixurl("ajax/icon") + "?suffix=" + row.imagetype + '" alt="" style="max-height:90px;max-width:120px"></a>';
var iconurl = Controller.api.safeurl(Fast.api.fixurl("ajax/icon") + "?suffix=" + encodeURIComponent(row.imagetype || ''));
html = '<a href="' + fullurl + '" target="_blank"><img src="' + iconurl + '" alt="" style="max-height:90px;max-width:120px"></a>';
}
return '<div style="width:120px;margin:0 auto;text-align:center;overflow:hidden;white-space: nowrap;text-overflow: ellipsis;">' + html + '</div>';
},
url: function (value, row, index) {
return '<a href="' + row.fullurl + '" target="_blank" class="label bg-green">' + row.url + '</a>';
return '<a href="' + Controller.api.safeurl(row.fullurl) + '" target="_blank" class="label bg-green">' + Controller.api.formatter.text(row.url) + '</a>';
},
filename: function (value, row, index) {
if (row && typeof row.filename !== 'undefined') {
value = row.filename;
}
value = Controller.api.formatter.legacytext(value);
return '<div style="width:150px;margin:0 auto;text-align:center;overflow:hidden;white-space: nowrap;text-overflow: ellipsis;">' + Table.api.formatter.search.call(this, value, row, index) + '</div>';
},
mimetype: function (value, row, index) {
return '<div style="width:80px;margin:0 auto;text-align:center;overflow:hidden;white-space: nowrap;text-overflow: ellipsis;">' + Table.api.formatter.search.call(this, value, row, index) + '</div>';
return '<div style="width:80px;margin:0 auto;text-align:center;overflow:hidden;white-space: nowrap;text-overflow: ellipsis;">' + Controller.api.formatter.search.call(this, value, row, index) + '</div>';
},
}
}
@@ -21,7 +21,7 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
url: $.fn.bootstrapTable.defaults.extend.index_url,
pk: 'id',
sortName: 'weigh',
escape: false,
escape: true,
columns: [
[
{checkbox: true},
@@ -21,6 +21,8 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
url: $.fn.bootstrapTable.defaults.extend.index_url,
pk: 'id',
sortName: 'user.id',
fixedColumns: true,
fixedRightNumber: 1,
columns: [
[
{checkbox: true},
+9 -7
View File
@@ -75,7 +75,7 @@
htmlForm.push('<div class="col-xs-8">');
vObjCol.operate = vObjCol.operate ? vObjCol.operate.toUpperCase() : '=';
htmlForm.push(sprintf('<input type="hidden" class="form-control operate" name="%s-operate" data-name="%s" value="%s" readonly>', vObjCol.field, vObjCol.field, vObjCol.operate));
htmlForm.push(sprintf('<input type="hidden" class="form-control operate" name="%s-operate" data-name="%s" value="%s" readonly>', vObjCol.field, vObjCol.field, Fast.api.escape(vObjCol.operate)));
var addClass = typeof vObjCol.addClass === 'undefined' ? (typeof vObjCol.addclass === 'undefined' ? 'form-control' : 'form-control ' + vObjCol.addclass) : 'form-control ' + vObjCol.addClass;
var extend = typeof vObjCol.extend === 'undefined' ? '' : vObjCol.extend;
@@ -113,11 +113,13 @@
var defaultValueArr = defaultValue.toString().match(/\|/) ? defaultValue.split('|') : ['', ''];
var placeholderArr = placeholder.toString().match(/\|/) ? placeholder.split('|') : [placeholder, placeholder];
htmlForm.push('<div class="row row-between">');
htmlForm.push(sprintf('<div class="col-xs-6"><input type="%s" class="%s" name="%s" value="%s" placeholder="%s" id="%s-min" data-index="%s" %s %s></div>', type, addClass, vObjCol.field, defaultValueArr[0], placeholderArr[0], vObjCol.field, i, style, extend));
htmlForm.push(sprintf('<div class="col-xs-6"><input type="%s" class="%s" name="%s" value="%s" placeholder="%s" id="%s-max" data-index="%s" %s %s></div>', type, addClass, vObjCol.field, defaultValueArr[1], placeholderArr[1], vObjCol.field, i, style, extend));
htmlForm.push(sprintf('<div class="col-xs-6"><input type="%s" class="%s" name="%s" value="%s" placeholder="%s" id="%s-min" data-index="%s" %s %s></div>', type, addClass, vObjCol.field, Fast.api.escape(defaultValueArr[0]), placeholderArr[0], vObjCol.field, i, style, extend));
htmlForm.push(sprintf('<div class="col-xs-6"><input type="%s" class="%s" name="%s" value="%s" placeholder="%s" id="%s-max" data-index="%s" %s %s></div>', type, addClass, vObjCol.field, Fast.api.escape(defaultValueArr[1]), placeholderArr[1], vObjCol.field, i, style, extend));
htmlForm.push('</div>');
} else {
htmlForm.push(sprintf('<input type="%s" class="%s" name="%s" value="%s" placeholder="%s" id="%s" data-index="%s" %s %s>', type, addClass, vObjCol.field, defaultValue, placeholder, vObjCol.field, i, style, extend));
htmlForm.push(sprintf('<input type="%s" class="%s" name="%s" value="%s" placeholder="%s" id="%s" data-index="%s" %s %s>', type, addClass, vObjCol.field, Fast.api.escape(defaultValue), placeholder, vObjCol.field, i, style, extend));
}
}
@@ -157,7 +159,7 @@
} else {
key = isArray ? value : key;
}
optionList.push(sprintf("<option value='" + key + "' %s>" + value + "</option>", key == vObjCol.defaultValue ? 'selected' : ''));
optionList.push(sprintf("<option value='" + Fast.api.escape(key) + "' %s>" + Fast.api.escape(value) + "</option>", key == vObjCol.defaultValue ? 'selected' : ''));
});
return optionList;
};
@@ -208,7 +210,7 @@
} else {
value = process ? process(obj.val()) : obj.val();
}
if (removeempty && (value == '' || value == null || ($.isArray(value) && value.length == 0)) && !sym.match(/null/i)) {
if (removeempty && (value === '' || value == null || ($.isArray(value) && value.length === 0)) && !sym.match(/null/i)) {
return true;
}
@@ -268,7 +270,7 @@
return "Common search";
},
formatCommonSubmitButton: function () {
return "Submit";
return "Search";
},
formatCommonResetButton: function () {
return "Reset";
+63 -15
View File
@@ -6,6 +6,7 @@ define(['jquery', 'bootstrap', 'frontend', 'form', 'template'], function ($, und
});
}
};
var AttachmentTable = null;
var Controller = {
login: function () {
@@ -99,6 +100,7 @@ define(['jquery', 'bootstrap', 'frontend', 'form', 'template'], function ($, und
},
attachment: function () {
require(['table'], function (Table) {
AttachmentTable = Table;
// 初始化表格参数配置
Table.api.init({
@@ -143,24 +145,14 @@ define(['jquery', 'bootstrap', 'frontend', 'form', 'template'], function ($, und
{field: 'state', checkbox: multiple, visible: multiple, operate: false},
{field: 'id', title: __('Id'), operate: false},
{
field: 'url', title: __('Preview'), formatter: function (value, row, index) {
var html = '';
if (row.mimetype.indexOf("image") > -1) {
html = '<a href="' + row.fullurl + '" target="_blank"><img src="' + row.fullurl + row.thumb_style + '" alt="" style="max-height:60px;max-width:120px"></a>';
} else {
html = '<a href="' + row.fullurl + '" target="_blank"><img src="' + Fast.api.fixurl("ajax/icon") + "?suffix=" + row.imagetype + '" alt="" style="max-height:90px;max-width:120px"></a>';
}
return '<div style="width:120px;margin:0 auto;text-align:center;overflow:hidden;white-space: nowrap;text-overflow: ellipsis;">' + html + '</div>';
}
field: 'url', title: __('Preview'), formatter: Controller.api.formatter.thumb
},
{
field: 'filename', title: __('Filename'), formatter: function (value, row, index) {
return '<div style="width:150px;margin:0 auto;text-align:center;overflow:hidden;white-space: nowrap;text-overflow: ellipsis;">' + Table.api.formatter.search.call(this, value, row, index) + '</div>';
}, operate: 'like'
field: 'filename', title: __('Filename'), formatter: Controller.api.formatter.filename, operate: 'like'
},
{field: 'imagewidth', title: __('Imagewidth'), operate: false},
{field: 'imageheight', title: __('Imageheight'), operate: false},
{field: 'mimetype', title: __('Mimetype'), formatter: Table.api.formatter.search},
{field: 'imagewidth', title: __('Imagewidth'), operate: false, formatter: Controller.api.formatter.text},
{field: 'imageheight', title: __('Imageheight'), operate: false, formatter: Controller.api.formatter.text},
{field: 'mimetype', title: __('Mimetype'), formatter: Controller.api.formatter.mimetype},
{field: 'createtime', title: __('Createtime'), width: 120, formatter: Table.api.formatter.datetime, datetimeFormat: 'YYYY-MM-DD', operate: 'RANGE', addclass: 'datetimerange', sortable: true},
{
field: 'operate', title: __('Operate'), width: 85, events: {
@@ -189,6 +181,62 @@ define(['jquery', 'bootstrap', 'frontend', 'form', 'template'], function ($, und
});
});
},
api: {
safeurl: function (value) {
value = value == null ? '' : String(value);
if (/[\x00-\x1f\x7f]/.test(value)) {
return '';
}
value = value.trim();
if (/^[a-z][a-z0-9+.-]*:/i.test(value) && !/^https?:\/\//i.test(value)) {
return '';
}
return Fast.api.escape(value);
},
formatter: {
text: function (value) {
return Fast.api.escape(value == null ? '' : String(value));
},
legacytext: function (value) {
value = value == null ? '' : String(value);
value = value.replace(/&(amp|lt|gt|quot|#0*39|#x0*27);/gi, function (match, entity) {
var entities = {
amp: '&', lt: '<', gt: '>', quot: '"',
'#39': "'", '#x27': "'"
};
entity = entity.toLowerCase().replace(/^#0+/, '#').replace(/^#x0+/, '#x');
return entities[entity] || match;
});
return Controller.api.formatter.text(value);
},
thumb: function (value, row, index) {
var html = '';
var fullurl = Controller.api.safeurl(row.fullurl);
if (String(row.mimetype || '').indexOf("image") > -1) {
var thumburl = Controller.api.safeurl((row.fullurl || '') + (row.thumb_style || ''));
html = '<a href="' + fullurl + '" target="_blank"><img src="' + thumburl + '" alt="" style="max-height:60px;max-width:120px"></a>';
} else {
var iconurl = Controller.api.safeurl(Fast.api.fixurl("ajax/icon") + "?suffix=" + encodeURIComponent(row.imagetype || ''));
html = '<a href="' + fullurl + '" target="_blank"><img src="' + iconurl + '" alt="" style="max-height:90px;max-width:120px"></a>';
}
return '<div style="width:120px;margin:0 auto;text-align:center;overflow:hidden;white-space: nowrap;text-overflow: ellipsis;">' + html + '</div>';
},
filename: function (value, row, index) {
if (row && typeof row.filename !== 'undefined') {
value = row.filename;
}
value = Controller.api.formatter.legacytext(value);
return '<div style="width:150px;margin:0 auto;text-align:center;overflow:hidden;white-space: nowrap;text-overflow: ellipsis;">' + AttachmentTable.api.formatter.search.call(this, value, row, index) + '</div>';
},
mimetype: function (value, row, index) {
if (row && typeof row.mimetype !== 'undefined') {
value = row.mimetype;
}
value = Controller.api.formatter.text(value);
return AttachmentTable.api.formatter.search.call(this, value, row, index);
}
}
}
};
return Controller;
File diff suppressed because one or more lines are too long
+8 -2
View File
@@ -102,6 +102,7 @@ define(['jquery', 'bootstrap', 'upload', 'validator', 'validator-lang'], functio
//绑定select元素事件
if ($(".selectpicker", form).length > 0) {
require(['bootstrap-select', 'bootstrap-select-lang'], function () {
$.fn.selectpicker.Constructor.BootstrapVersion = '3';
$('.selectpicker', form).selectpicker();
$(form).on("reset", function () {
setTimeout(function () {
@@ -218,7 +219,7 @@ define(['jquery', 'bootstrap', 'upload', 'validator', 'validator-lang'], functio
};
var origincallback = function (start, end) {
$(this.element).val(start.format(this.locale.format) + " - " + end.format(this.locale.format));
$(this.element).trigger('change');
$(this.element).trigger('change').trigger('validate');
};
$(".datetimerange", form).each(function () {
var callback = typeof $(this).data('callback') == 'function' ? $(this).data('callback') : origincallback;
@@ -226,7 +227,7 @@ define(['jquery', 'bootstrap', 'upload', 'validator', 'validator-lang'], functio
callback.call(picker, picker.startDate, picker.endDate);
});
$(this).on('cancel.daterangepicker', function (ev, picker) {
$(this).val('').trigger('change');
$(this).val('').trigger('change').trigger('validate');
});
$(this).daterangepicker($.extend(true, {}, options, $(this).data() || {}, $(this).data("daterangepicker-options") || {}));
});
@@ -294,6 +295,9 @@ define(['jquery', 'bootstrap', 'upload', 'validator', 'validator-lang'], functio
var url = Config.upload.fullmode ? Fast.api.cdnurl(data.url) : data.url;
$("#" + input_id).val(url).trigger("change").trigger("validate");
}
// 触发选择文件自定义事件
button.trigger("fa.event.selectedfile", data);
}
});
return false;
@@ -567,7 +571,9 @@ define(['jquery', 'bootstrap', 'upload', 'validator', 'validator-lang'], functio
}
};
// @formatter:on
var $disabledElements = form.find(':disabled').removeAttr('disabled');
var dataArr = form.serializeArray(), dataObj = {}, fieldName, fieldValue;
$disabledElements.attr('disabled', 'disabled');
$(dataArr).each(function (i, field) {
fieldName = field.name;
fieldValue = field.value;
File diff suppressed because one or more lines are too long
+18 -4
View File
@@ -131,7 +131,7 @@ define(['jquery', 'bootstrap', 'moment', 'moment/locale/zh-cn', 'bootstrap-table
return __('Common search');
},
formatCommonSubmitButton: function () {
return __('Submit');
return __('Search');
},
formatCommonResetButton: function () {
return __('Reset');
@@ -764,7 +764,7 @@ define(['jquery', 'bootstrap', 'moment', 'moment/locale/zh-cn', 'bootstrap-table
suffix = /[\.]?([a-zA-Z0-9]+)$/.exec(value);
suffix = suffix ? suffix[1] : 'file';
url = Fast.api.fixurl("ajax/icon?suffix=" + suffix);
html.push('<a href="' + value + '" target="_blank"><img src="' + url + '" class="' + classname + '"></a>');
html.push('<a href="' + value + '" target="_blank"><img src="' + url + '" class="' + classname + '" width="30" height="30"></a>');
});
return html.join(' ');
},
@@ -788,6 +788,7 @@ define(['jquery', 'bootstrap', 'moment', 'moment/locale/zh-cn', 'bootstrap-table
if (typeof this.custom !== 'undefined') {
custom = $.extend(custom, this.custom);
}
value = row[this.field] || value;
value = value == null || value.length === 0 ? '' : value.toString();
var keys = typeof this.searchList === 'object' ? Object.keys(this.searchList) : [];
var index = keys.indexOf(value);
@@ -800,6 +801,8 @@ define(['jquery', 'bootstrap', 'moment', 'moment/locale/zh-cn', 'bootstrap-table
if (!display) {
display = __(value.charAt(0).toUpperCase() + value.slice(1));
}
value = Fast.api.escape(value);
display = Fast.api.escape(display);
var html = '<span class="text-' + color + '">' + (icon ? '<i class="' + icon + '"></i> ' : '') + display + '</span>';
if (this.operate != false) {
html = '<a href="javascript:;" class="searchit" data-toggle="tooltip" title="' + __('Click to search %s', display) + '" data-field="' + this.field + '" data-value="' + value + '">' + html + '</a>';
@@ -866,6 +869,15 @@ define(['jquery', 'bootstrap', 'moment', 'moment/locale/zh-cn', 'bootstrap-table
value = Fast.api.escape(customValue);
field = this.customField;
}
if (typeof that.searchList === 'object' && typeof that.searchList.then === 'function') {
$.when(that.searchList).done(function (ret) {
if (ret.data && ret.data.searchlist && $.isArray(ret.data.searchlist)) {
that.searchList = ret.data.searchlist;
} else if (ret.constructor === Array || ret.constructor === Object) {
that.searchList = ret;
}
})
}
if (typeof that.searchList === 'object' && typeof that.custom === 'undefined') {
var i = 0;
var searchValues = Object.values(colorArr);
@@ -879,14 +891,16 @@ define(['jquery', 'bootstrap', 'moment', 'moment/locale/zh-cn', 'bootstrap-table
//渲染Flag
var html = [];
var arr = value != '' ? value.split(',') : [];
var arr = $.isArray(value) ? value : value != '' ? value.split(',') : [];
var color, display, label;
$.each(arr, function (i, value) {
value = value == null || value.length === 0 ? '' : value.toString();
if (value == '')
if (value === '')
return true;
color = value && typeof colorArr[value] !== 'undefined' ? colorArr[value] : 'primary';
display = typeof that.searchList !== 'undefined' && typeof that.searchList[value] !== 'undefined' ? that.searchList[value] : __(value.charAt(0).toUpperCase() + value.slice(1));
value = Fast.api.escape(value);
display = Fast.api.escape(display);
label = '<span class="label label-' + color + '">' + display + '</span>';
if (that.operate) {
html.push('<a href="javascript:;" class="searchit" data-toggle="tooltip" title="' + __('Click to search %s', display) + '" data-field="' + field + '" data-value="' + value + '">' + label + '</a>');
+11 -7
View File
@@ -1,5 +1,5 @@
/** vim: et:ts=4:sw=4:sts=4
* @license RequireJS 2.3.2 Copyright jQuery Foundation and other contributors.
* @license RequireJS 2.3.7 Copyright jQuery Foundation and other contributors.
* Released under MIT license, https://github.com/requirejs/requirejs/blob/master/LICENSE
*/
//Not using strict: uneven strict support in browsers, #392, and causes
@@ -11,7 +11,7 @@ var requirejs, require, define;
(function (global, setTimeout) {
var req, s, head, baseElement, dataMain, src,
interactiveScript, currentlyAddingScript, mainScript, subPath,
version = '2.3.2',
version = '2.3.7',
commentRegExp = /\/\*[\s\S]*?\*\/|([^:"'=]|^)\/\/.*$/mg,
cjsRequireRegExp = /[^.]\s*require\s*\(\s*["']([^'"\s]+)["']\s*\)/g,
jsSuffixRegExp = /\.js$/,
@@ -33,7 +33,8 @@ var requirejs, require, define;
contexts = {},
cfg = {},
globalDefQueue = [],
useInteractive = false;
useInteractive = false,
disallowedProps = ['__proto__', 'constructor'];
//Could match something like ')//comment', do not lose the prefix to comment.
function commentReplace(match, singlePrefix) {
@@ -94,7 +95,7 @@ var requirejs, require, define;
function eachProp(obj, func) {
var prop;
for (prop in obj) {
if (hasProp(obj, prop)) {
if (hasProp(obj, prop) && disallowedProps.indexOf(prop) == -1) {
if (func(obj[prop], prop)) {
break;
}
@@ -165,7 +166,7 @@ var requirejs, require, define;
* @returns {Error}
*/
function makeError(id, msg, err, requireModules) {
var e = new Error(msg + '\nhttp://requirejs.org/docs/errors.html#' + id);
var e = new Error(msg + '\nhttps://requirejs.org/docs/errors.html#' + id);
e.requireType = id;
e.requireModules = requireModules;
if (err) {
@@ -440,7 +441,9 @@ var requirejs, require, define;
//Account for relative paths if there is a base name.
if (name) {
if (prefix) {
if (pluginModule && pluginModule.normalize) {
if (isNormalized) {
normalizedName = name;
} else if (pluginModule && pluginModule.normalize) {
//Plugin is loaded, use its normalize method.
normalizedName = pluginModule.normalize(name, function (name) {
return normalize(name, parentName, applyMap);
@@ -972,7 +975,8 @@ var requirejs, require, define;
//prefix and name should already be normalized, no need
//for applying map config again either.
normalizedMap = makeModuleMap(map.prefix + '!' + name,
this.map.parentMap);
this.map.parentMap,
true);
on(normalizedMap,
'defined', bind(this, function (value) {
this.map.normalizedMap = normalizedMap;
File diff suppressed because one or more lines are too long