📄 laconicsuper.js
字号:
function disableFormElements(from) {
for (var i = 0; i < from.elements.length ; i++) {
var element = from.elements[i];
if (element.type) {
if (element.type == 'text' || element.type == 'textarea') {
element.readOnly = true;
if (element.className.indexOf("Num") >= 0) {
element.className = 'readOnlyNum';
} else if (element.className.indexOf("Char") >= 0){
element.className = 'readOnlyChar';
} else {
element.className = 'readOnlyOther';
}
} else if (element.type == 'radio' ||element.type == 'checkbox'||element.type == 'select-one') {
element.disabled = true;
}
}
}
}
function hideElements(objects) {
if (objects && objects.length) {
for (var i = 0; i < objects.length; i++) {
objects[i].style.display = "none";
}
} else if (objects) {
objects.style.display = "none";
}
}
function hideTableColumnCountFromEnd(table, hideColumnFromLast, skipRow) {
for (var i = 0; i < document.all.productListTable.rows.length;i++){
if (i != skipRow-1)
table.rows[i].cells[table.rows[i].cells.length-hideColumnFromLast].style.display = "none";
}
}
function hideTableColumnCountFromStart(table, hideColumnFrom, skipRow) {
for (var i = 0; i < document.all.productListTable.rows.length;i++){
if (i != skipRow-1)
table.rows[i].cells[hideColumnFrom-1].style.display = "none";
}
}
function Dispatch(mActionCode, actionObject){
if (actionObject && actionObject.type && actionObject.type == 'button')
actionObject.disabled = true;
form = document.forms[0];
form.actionCode.value = mActionCode;
form.method = 'post';
form.submit();
}
function DispatchCloseWindow(mActionCode){
form = document.forms[0];
form.method = 'post';
form.actionCode.value = mActionCode;
form.target = parent.opener.name;
form.submit();
self.close();
}
function toggleQuery(isLoad) {
if (document.all.queryMode.value == 'QUERY' && !isLoad){
document.all.queryMode.value = 'CREATE';
Dispatch('init');
} else if (!isLoad){
document.all.queryMode.value = 'QUERY';
Dispatch('init');
} else if (document.all.queryMode.value == 'QUERY' && isLoad) {
document.all.queryButton.disabled = true;
document.all.queryImg.style.display = '';
document.all.createButton.disabled = false;
} else {
document.all.queryButton.disabled = false;
document.all.queryImg.style.display = 'none';
document.all.createButton.disabled = true;
}
}
function trim(inputString) {
// Removes leading and trailing spaces from the passed string. Also removes
// consecutive spaces and replaces it with one space. If something besides
// a string is passed in (null, custom object, etc.) then return the input.
if (typeof inputString != "string") { return inputString; }
var retValue = inputString;
var ch = retValue.substring(0, 1);
while (ch == " ") { // Check for spaces at the beginning of the string
retValue = retValue.substring(1, retValue.length);
ch = retValue.substring(0, 1);
}
ch = retValue.substring(retValue.length-1, retValue.length);
while (ch == " ") { // Check for spaces at the end of the string
retValue = retValue.substring(0, retValue.length-1);
ch = retValue.substring(retValue.length-1, retValue.length);
}
while (retValue.indexOf(" ") != -1) { // Note that there are two spaces in the string - look for multiple spaces within the string
retValue = retValue.substring(0, retValue.indexOf(" ")) + retValue.substring(retValue.indexOf(" ")+1, retValue.length); // Again, there are two spaces in each of the strings
}
return retValue; // Return the trimmed string back to the user
} // Ends the "trim" function
function openWindow(findURL, needRefresh, actionCode, rowIndex, subRowIndex, windowWidth, windowHeight) {
if (needRefresh){
Dispatch('refresh-Data');
}
var actionEvent = actionCode.split("-")[0];
var actionObject = actionCode.split("-")[1];
if(rowIndex != '' && subRowIndex != ''){
//var windowName = actionObject + '-' + rowIndex + '-' + subRowIndex;
actionCode = actionCode + '-' + rowIndex + '-'+ subRowIndex;
}else if(rowIndex != ''){
//var windowName = actionObject + '-' + rowIndex;
actionCode = actionCode + '-' + rowIndex;
}else{
//var windowName = actionObject;
}
//alert('windowName : '+windowName);
//alert('actionCode : '+actionCode);
var URL = findURL + '?actionCode='+actionCode;
var findWindow = window.open(URL ,'Test',
'scrollbars=yes,width='+windowWidth+',height='+windowHeight+',status=no,resizable=yes,top=100,right=500,dependent=yes,alwaysRaised=yes'
);
//var findWindow = window.open(URL ,windowName,
// 'scrollbars=yes,width='+windowWidth+',height='+windowHeight+',status=no,resizable=yes,top=100,right=500,dependent=yes,alwaysRaised=yes'
//);
findWindow.opener = window;
findWindow.focus();
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -