Edit D:\AVA\AVAStandard\AVA.ResourcesPlatform.AdminUI\JS\zh-CN\Public.js
??//?????? String.prototype.trim = function () { return this.replace(/(^\s*)|(\s*$)/g, ""); } String.prototype.lTrim = function () { return this.replace(/(^\s*)/g, ""); } String.prototype.rTrim = function () { return this.replace(/(\s*$)/g, ""); } String.prototype.realLength = function () { return this.replace(/[^\x00-\xff]/g, "**").length; } String.prototype.realSubString = function (realLen) { if (!realLen) { return ''; } //???????????2????????1??? var a = 0; //?????? var i = 0; //?????? var temp = ''; for (i = 0; i < this.length; i++) { if (this.charCodeAt(i) > 255) { //????????????2 a += 2; } else { a++; } //??????????????????????????????????????? if (a > realLen) { return temp; } //?????????????????? temp += this.charAt(i); } //?????????????????????????????? return this; } //??? var Tools = new Object(); ////$(function() { //????????????? form??ubmit??? // alert($("form[action='']").length); $("form[action='']").submit(function () { return false; }) //???????????????? $("[type=password]").bind("focus", function () { this.select(); }) //??extarea???maxlenght??? $("textarea").bind("keyup", function () { var mlength = this.getAttribute ? parseInt(this.getAttribute("maxlength")) : ""; if (this.getAttribute && this.value.realLength() > mlength) { this.value = this.value.realSubString(mlength) alert("????????????{0}??????????????????".replace('{0}', mlength)); } }) //???textArea???????? $.each($("textarea"), function (i, item) { var mlength = item.getAttribute ? parseInt(item.getAttribute("maxlength")) : ""; if (item.getAttribute) { var mlengthMsg = "????????{0}??????".replace('{0}', mlength); item.title = item.title + " " + mlengthMsg; item.title = item.title.trim(); } }); //?????????????????mg??????????????? $.each($("img.default-image"), function (i, img) { var src = img.src; img.defaultSrc = src; //???defaultSrc $(img).bind("error", function () { //alert("error" + this.src); this.src = this.defaultSrc; }).bind("load", function () { //alert("load" + this.src); }); }); $.each($(".delete-image"), function (i, item) { if ($(this).siblings("input").val().length != 0) { $(this).removeClass("hidden"); } }) $(".delete-image").bind("click", function () { //?????? $(this).siblings("input").val(""); //?????? $.each($(this).siblings("img"), function (i, item) { //???????? if (typeof (item.defaultSrc) != "undefined") { item.src = item.defaultSrc; } else { item.src = ""; } }); $(this).addClass("hidden"); return false; }); //???????????? $(".default-image").bind("load", function () { if (this.height > 200) { this.height = 200; } }) //????????? $.each($(".delete-file"), function (i, item) { if ($(this).siblings("input").val().length != 0) { $(this).removeClass("hidden"); } }) $.each($(".download-file"), function (i, item) { if ($(this).siblings("input").val().length != 0) { $(this).removeClass("hidden"); } }) $(".delete-file").bind("click", function () { //?????? $(this).siblings("input").val(""); $(this).siblings(".download-file").addClass("hidden"); $(this).addClass("hidden"); return false; }); //????? $(".select-clear").bind("click", function () { //?????? $(this).siblings("input").val(""); $(this).addClass("hidden"); //?????? $(this).siblings("input").focus(); $(this).siblings("input").blur(); return false; }); //???????????????????????????????? $.each($(".select-clear"), function (i, item) { if ($(this).siblings("input").val().length != 0) { $(this).removeClass("hidden"); } }) function YKPage(json) { //????????? var first = document.getElementById("pageFirst"); var prev = document.getElementById("pagePrev"); var next = document.getElementById("pageNext"); var last = document.getElementById("pageLast"); var select = document.getElementById("pageList"); var record = document.getElementById("pageRecord"); var color = "#999999"; //?????????? $("#frmQuery [name=PageIndex]").attr("value", json.PageIndex); //??? record.innerHTML = json.RecordCount; if (json.RecordCount == 0) { first.style.color = prev.style.color = next.style.color = last.style.color = color; first.href = prev.href = next.href = last.href = "#page=0"; first.onclick = function () { return false; }; prev.onclick = function () { return false; }; next.onclick = function () { return false; }; last.onclick = function () { return false; }; select.length = 0; var option_node = new Option("0 / 0", "0"); select.options.add(option_node); return; } //???????????? first.href = "#page=first"; if (json.PageIndex == 1) { first.style.color = color; first.onclick = function () { return false; } } else { first.style.color = ""; first.onclick = function () { $("#frmQuery [name=PageIndex]").attr("value", 1); Search(); return false; } } //??? last.href = "#page=last"; if (json.PageIndex == json.PageCount) { last.style.color = color; last.onclick = function () { return false; } } else { last.style.color = ""; last.onclick = function () { $("#frmQuery [name=PageIndex]").attr("value", json.PageCount); Search(); return false; } } //????? prev.href = "#page=" + (json.PageIndex - 1 < 1 ? 1 : json.PageIndex - 1); ; if (json.PageIndex == 1) { prev.style.color = color; prev.onclick = function () { return false; } } else { prev.style.color = ""; prev.onclick = function () { $("#frmQuery [name=PageIndex]").attr("value", json.PageIndex - 1); Search(); return false; } } //????? next.href = "#page=" + (json.PageIndex + 1 > json.PageCount ? json.PageCount : json.PageIndex + 1); if (json.PageIndex == json.PageCount) { next.style.color = color; next.onclick = function () { return false; } } else { next.style.color = ""; next.onclick = function () { $("#frmQuery [name=PageIndex]").attr("value", json.PageIndex + 1); Search(); return false; } } //??? select.length = 0; for (var i = 1; i <= json.PageCount; i++) { var option_node = new Option(); option_node.text = i + " / " + json.PageCount; option_node.value = i; //????????? if (i == json.PageIndex) { option_node.selected = true; } select.options.add(option_node); } select.onchange = function () { $("#frmQuery [name=PageIndex]").attr("value", this.value); Search(); } }; //????? function GoList(param) { var url = "list.aspx" if (typeof (param) != "undefined") { url += "?" + param; } window.location.href = url; return false; } //??? function GoReturn() { //window.location.href = document.referrer; window.history.back(); return false; }; //?????? function GoUrl(url) { window.location.href = url; return false; } function GoAdd(param) { var url = "edit.aspx"; if (typeof (param) != "undefined") { url += "?" + param; } window.location.href = url; return false; }; //??????? function SwitchTag(obj) { var tag = $(obj).next("div").next("div"); if (tag.css("display") == "none") { $(tag).slideDown(); $(obj).find("b").removeClass("Bclded").addClass("Bopned"); } else { $(tag).slideUp(); $(obj).find("b").removeClass("Bopned").addClass("Bclded"); } }; //???????? function Select(valuevalue, namevalue, temp1value, temp2value, temp3value) { $(window.parent.window.document).find(valueControl).val(valuevalue); $(window.parent.window.document).find(nameControl).val(namevalue); if (typeof (temp1value) != "undefined" && typeof (temp1valueControl) != "undefined") { $(window.parent.window.document).find(temp1valueControl).val(temp1value); } if (typeof (temp2value) != "undefined" && typeof (temp2valueControl) != "undefined") { $(window.parent.window.document).find(temp2valueControl).val(temp2value); } if (typeof (temp3value) != "undefined" && typeof (temp3valueControl) != "undefined") { $(window.parent.window.document).find(temp2valueControl).val(temp3value); } //?????? $(window.parent.window.document).find(valueControl).siblings(".select-clear").removeClass("hidden"); $(window.parent.window.document).find(nameControl).focus(); window.parent.window.$.fn.fancybox.close(); } //?????? function UploadFile(valueControl, title, type, path, fileName, width, height,sizeControl) { $.fn.fancybox.show({ 'zoomSpeedIn': 600, 'zoomSpeedOut': 500, frameWidth: 500, frameHeight: 350, frameURL: Global.Site + "/tools/uploadform.aspx?title=" + encodeURIComponent(title) + "&type=" + encodeURIComponent(type) + "&path=" + encodeURIComponent(path) + "&fileName=" + encodeURIComponent(fileName) + "&height=" + encodeURIComponent(height) + "&width=" + encodeURIComponent(width) + "&valueControl=" + encodeURIComponent(valueControl) + "&sizeControl=" + encodeURIComponent(sizeControl), hideOnContentClick: false }); return false; } //????????? $(".btn-dft-gc").bind("mouseup", function () { $(this).removeClass("btn-dft-gc-active").addClass("btn-dft-gc-hover"); }).bind("mousedown", function () { $(this).removeClass("btn-dft-gc-hover").addClass("btn-dft-gc-active"); }).bind("mouseover", function () { $(this).removeClass("btn-dft-gc-active").addClass("btn-dft-gc-hover"); }).bind("mouseout", function () { $(this).removeClass("btn-dft-gc-hover btn-dft-gc-active"); }); $(".btn-dft-gl").bind("mouseup", function () { $(this).removeClass("btn-dft-gl-active").addClass("btn-dft-gl-hover"); }).bind("mousedown", function () { $(this).removeClass("btn-dft-gl-hover").addClass("btn-dft-gl-active"); }).bind("mouseover", function () { $(this).removeClass("btn-dft-gl-active").addClass("btn-dft-gl-hover"); }).bind("mouseout", function () { $(this).removeClass("btn-dft-gl-hover btn-dft-gl-active"); }); $(".btn-dft-gr").bind("mouseup", function () { $(this).removeClass("btn-dft-gr-active").addClass("btn-dft-gr-hover"); }).bind("mousedown", function () { $(this).removeClass("btn-dft-gr-hover").addClass("btn-dft-gr-active"); }).bind("mouseover", function () { $(this).removeClass("btn-dft-gr-active").addClass("btn-dft-gr-hover"); }).bind("mouseout", function () { $(this).removeClass("btn-dft-gr-hover btn-dft-gr-active"); }); $(".btn-dft-impt").bind("mouseup", function () { $(this).removeClass("btn-dft-impt-active").addClass("btn-dft-impt-hover"); }).bind("mousedown", function () { $(this).removeClass("btn-dft-impt-hover").addClass("btn-dft-impt-active"); }).bind("mouseover", function () { $(this).removeClass("btn-dft-impt-active").addClass("btn-dft-impt-hover"); }).bind("mouseout", function () { $(this).removeClass("btn-dft-impt-hover btn-dft-impt-active"); }); $(".btn-dft-icon").bind("mouseup", function () { $(this).removeClass("btn-dft-icon-active").addClass("btn-dft-icon-hover"); }).bind("mousedown", function () { $(this).removeClass("btn-dft-icon-hover").addClass("btn-dft-icon-active"); }).bind("mouseover", function () { $(this).removeClass("btn-dft-icon-active").addClass("btn-dft-icon-hover"); }).bind("mouseout", function () { $(this).removeClass("btn-dft-icon-hover btn-dft-icon-active"); }); $(".btn-dft").not(".btn-dft-gc ").not(".btn-dft-gl ").not(".btn-dft-gr ").not(".btn-dft-icon ").bind("mouseup", function () { $(this).removeClass("btn-dft-active").addClass("btn-dft-hover"); }).bind("mousedown", function () { $(this).removeClass("btn-dft-hover").addClass("btn-dft-active"); }).bind("mouseover", function () { $(this).removeClass("btn-dft-active").addClass("btn-dft-hover"); }).bind("mouseout", function () { $(this).removeClass("btn-dft-hover btn-dft-active"); }); $(".ipt-t.ipt-t-dft").bind("focus", function () { $(this).addClass("ipt-t-dft-active"); }).bind("blur", function () { $(this).removeClass("ipt-t-dft-active"); }) //????????? $(function () { if ($.xheditor) { $("textarea.xheditor").xheditor({ tools: "mini" }); $("textarea.xheditor-mini").xheditor({ tools: "mini" }); $("textarea.xheditor-simple").xheditor({ tools: "simple" }) $('textarea.xheditor-full').xheditor({ tools: "full", upLinkUrl: Global.Site + "/js/zh-cn/XhEditor/upload.aspx", upLinkExt: "zip,rar,txt,7z", upImgUrl: Global.Site + "/js/zh-cn/XhEditor/upload.aspx", upImgExt: "jpg,jpeg,gif", upFlashUrl: Global.Site + "/js/zh-cn/XhEditor/upload.aspx", upFlashExt: "swf", upMediaUrl: Global.Site + "/js/zh-cn/XhEditor/upload.aspx", upMediaExt: "avi,asf,wmv,mp4" }) $('textarea.xheditor-edit').xheditor({ tools: "full", upLinkUrl: Global.Site + "/js/zh-cn/XhEditor/upload.aspx", upLinkExt: "zip,rar,txt,7z", upImgUrl: Global.Site + "/js/zh-cn/XhEditor/upload.aspx", upImgExt: "jpg,jpeg,gif", upFlashUrl: Global.Site + "/js/zh-cn/XhEditor/upload.aspx", upFlashExt: "swf", upMediaUrl: Global.Site + "/js/zh-cn/XhEditor/upload.aspx", upMediaExt: "avi,asf,wmv,mp4" }) } }); $(".gWel-tab .tabs li").each(function (i) { $(this).bind("click", function () { //?????????class on???????????i??lass on??? if (!$(this).hasClass("on")) { $(this).parents("ul").find("li").removeClass("on") $(this).addClass("on"); //????????iv var panel = $(this).parents(".gWel-tab").find(".pans .panel"); panel.hide(); var ifrm = panel.eq(i).find(".ifrmtab"); if (ifrm.length > 0) { // if (ifrm[0].src == null || ifrm[0].src == "" || ifrm[0].src == ifrm[0].title) { // ifrm[0].src = ifrm[0].title; // } ifrm[0].src = ifrm[0].title; //???IFrame??? ifrm.height($("#divMain").height() - 80); } panel.eq(i).show(); } }); }); //?????????????????? var panelTab = $.url.param("panel") if (typeof (panelTab) != "undefined") { $(".gWel-tab .tabs li").eq(panelTab).click(); } else { if ($(".gWel-tab .tabs li").length > 0) { $(".gWel-tab .tabs li").eq(0).click(); } } $(function () { //?????? //??????????? if ($.tipsy) { $(".tooltip").tipsy({ fade: true }); } if ($.datepicker) { $(".date").live("focus", function () { $(this).datepicker(); }); } if ($.datepicker) { $(".datetime").live("focus", function () { $(this).datetimepicker(); }); } if ($.timepicker) { $(".time").live("focus", function () { $(this).timepicker({}); }); } });
Ms-Dos/Windows
Unix
Write backup
jsp File Browser version 1.2 by
www.vonloesch.de