script/Common.js
(开头部分) 2KB这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。
String.prototype.trim = function() {
return this.replace(/(^\s*)|(\s*$)/g, "");
}
function checkTxtEmpty(elements) {
for (var i in elements) {
var element = document.getElementById(elements[i].id);
if (element.value.trim().length < 1) {
element.focus();
alert(elements[i].value);
return false;
}
}
return true;
}
function BoxShow(path) {
var str = "<img src=' "+ path + "' alt='' />";
TINY.box.show(str, 0, 0, 0, 1)
}
function BrowseServer(startupPath, functionData) {
// You can use the "CKFinder" class to render CKFinder in a page:
var finder = new CKFinder();
// The path for the installation of CKFinder (default = "/ckfinder/").
finder.BasePath = '../ckfinder/';
//Startup path in a form: "Type:/path/to/directory/"
finder.StartupPath = startupPath;
// Name of a function which is called when a file is selected in CKFinder.
finder.SelectFunction = SetFileField;
// Additional data to be passed to the SelectFunction in a second argument.
// We'll use this feature to pass the Id of a field that will be updated.
finder.SelectFunctionData = functionData;
// Name of a function which is called when a thumbnail is selected in CKFinder.
finder.SelectThumbnailFunction = ShowThumbnails;
// Launch CKFinder
finder.Popup();
}
// This is a sample function which is called when a file is selected in CKFinder.
function SetFileField(fileUrl, data) {
document.getElementById(data["selectFunctionData"]).value = fileUrl;
}
// This is a sample function which is called when a thumbnail is selected in CKFinder.
function ShowThumbnails(fileUrl, data) {
var sFileName = decodeURIComponent(fileUrl.replace(/^.*[\/\\]/g, ''));
document.getElementById('thumbnails').innerHTML +=
'<div class="thumb">' +
'<img src="' + fileUrl + '" />' +
'<div class="caption">' +
'<a href="' + data["fileUrl"] + '" target="_blank">' + sFileName + '</a> (' + data["fileSize"] + 'KB)' +
'</div>' +
'</div>';
后面还有 6 行代码,购买后查看完整代码
24 小时内免费解锁 3 个项目,之后 1 积分/个。 规则说明
AI 解读
登录后可用,每次 10 积分,解读结果公开显示在下面。
还没有人解读过这个文件。
