CRM_EasyUI_2016/Scripts/fileinput/fileinput.js
(开头部分) 99KB这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。
(function ($) {
"use strict";
String.prototype.repl = function (from, to) {
return this.split(from).join(to);
};
var isIE = function (ver) {
var div = document.createElement("div"), status;
div.innerHTML = "<!--[if IE " + ver + "]><i></i><![endif]-->";
status = (div.getElementsByTagName("i").length === 1);
document.body.appendChild(div);
div.parentNode.removeChild(div);
return status;
},
previewCache = {
data: {},
init: function (obj) {
$(".file-preview").hide();
var content = obj.initialPreview, id = obj.id;
if (content.length > 0 && !isArray(content)) {
content = content.split(obj.initialPreviewDelimiter);
}
previewCache.data[id] = {
content: content,
config: obj.initialPreviewConfig,
tags: obj.initialPreviewThumbTags,
delimiter: obj.initialPreviewDelimiter,
template: obj.previewGenericTemplate,
msg: obj.msgSelected,
initId: obj.previewInitId,
footer: obj.getLayoutTemplate('footer'),
isDelete: obj.initialPreviewShowDelete,
caption: obj.initialCaption,
actions: function (showUpload, showDelete, disabled, url, key, index) {
return obj.renderFileActions(showUpload, showDelete, disabled, url, key, index);
}
};
},
fetch: function (id) {
return previewCache.data[id].content.filter(function (n) {
return n !== undefined;
});
},
count: function (id) {
return !!previewCache.data[id] && !!previewCache.data[id].content ? previewCache.fetch(id).length : 0;
},
get: function (id, i, isDisabled) {
var ind = 'init_' + i, data = previewCache.data[id],
previewId = data.initId + '-' + ind, out;
isDisabled = isDisabled === undefined ? true : isDisabled;
if (data.content[i] === undefined) {
return '';
}
out = data.template
.repl('{previewId}', previewId)
.repl('{frameClass}', ' file-preview-initial')
.repl('{fileindex}', ind)
.repl('{content}', data.content[i])
.repl('{footer}', previewCache.footer(id, i, isDisabled));
if (data.tags.length && data.tags[i]) {
后面还有 2073 行代码,购买后查看完整代码
24 小时内免费解锁 3 个项目,之后 1 积分/个。 规则说明
AI 解读
登录后可用,每次 10 积分,解读结果公开显示在下面。
还没有人解读过这个文件。
