📄 jitk_upload.js
字号:
/*
Modified from EsriUploadUtil
*/
var JitkUploadUtil = new function() {
var uploadJSP = "jitkupload.jsp";
var uploadSuccessJsp = "jitkUploadSuccess.jsp";
var pe, win, listener;
this.showUploadWindow = function(title, uploadListener, uploadPage, uploadSuccessPage) {
if (win) destroyWindow()
listener = uploadListener;
if (! uploadPage) uploadPage = EsriControls.contextPath + uploadJSP;
if (! uploadSuccessPage) uploadSuccessPage = EsriControls.contextPath + uploadSuccessJsp;
var time = new Date().getTime();
var divId = "jitk-upload-pe-" + time;
pe = new EsriPageElement(divId);
var divElement1 = document.createElement("div");
divElement1.className = "jitk-floating-panel-content-wrapper";
var divElement2 = document.createElement("div");
divElement2.id = "div_"+divId;
var divElement3 = document.createElement("div");
divElement3.className = "jitk-floating-panel-content";
var tableElement = document.createElement("table");
var tbody = document.createElement("tbody");
var tableElementRow = document.createElement("tr");
var tableElementColumn = document.createElement("td");
frameObject = document.createElement("iframe");
frameObject.frameBorder = 0;
frameObject.scrolling = "no";
frameObject.width = 370;
frameObject.height = 190;
frameObject.src = uploadPage + "?requestPage=" + uploadJSP + "&successPage=" + uploadSuccessPage;
tableElementColumn.appendChild(frameObject);
tableElementRow.appendChild(tableElementColumn);
tbody.appendChild(tableElementRow);
tableElement.appendChild(tbody);
divElement3.appendChild(tableElement);
divElement2.appendChild(divElement3);
divElement1.appendChild(divElement2);
var divElement4 = document.createElement("div");
divElement4.className = "jitk-floating-panel-footer";
divElement4.appendChild(document.createTextNode("Browse to the locally stored image file you want to upload."));
divElement1.appendChild(divElement4);
pe.divObject = document.body.appendChild(divElement1);
pe.divId = pe.divObject.id = divId;
win = new JitkWindow(divId, title, pe);
win.isFloatingWindow = true;
win.isRendered = true;
win.movable = true;
win.closable = true;
win.collapsable = false;
win.resizable = false;
win.init();
win.resize(390,246);
win.moveTo(300, 300);
win.toFront();
win.addUpdateListener("jitk-upload-win-listener", winListener);
}
this.getFrameDiv = function(){
return pe;
}
this.processUpload = function(filename, id) {
win.removeUpdateListener("jitk-upload-win-listener");
if (id != "") listener(filename, id);
else listener();
}
this.closeWindow = function() { destroyWindow(); }
function winListener(win) { if (win.closed) listener = null; }
function destroyWindow() {
win.hide();
pe = pe.divObject = pe.divId = win = win.divObject = win.divId = null;
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -