Function.js
上传用户:jiajie98
上传日期:2020-04-24
资源大小:1206k
文件大小:12k
- //==========================================
- //系统开发:方卡在线
- //技术支持:http://www.fangka.net/
- //技 术 QQ:861118936
- //联系邮箱:admin@fangka.net
- //==========================================
- //==========================================
- //函数名:ShowBox
- //用途:操作框弹出
- //参数:
- //==========================================
- function ShowBox(DoUrl){
- document.getElementById('BoxContent').innerHTML="<div id='LoadBox'><a href='javascript:void(0);' title='点此关闭' onclick=$('select').show();$('#Boxs').hide()><img src='Images/Loading2.gif' /></a></div>";
- $("#Boxs").show();
- $.get(DoUrl,
- function(data){
- document.getElementById('BoxContent').innerHTML=data;
- PageReSize();
- $("#AlphaBox").height($(document).height());
- if($("#Fk_Article_Content").length>0){
- $('#Fk_Article_Content').xheditor(true,{upLinkUrl:"Upload.asp?Immediate=1",upLinkExt:"zip,rar,txt",upImgUrl:"Upload.asp?Immediate=1",upImgExt:"jpg,jpeg,gif,png",upFlashUrl:"Upload.asp?Immediate=1",upFlashExt:"swf",upMediaUrl:"Upload.asp?Immediate=1",upMediaExt:"avi"});
- }
- if($("#Fk_Module_Content").length>0){
- $('#Fk_Module_Content').xheditor(true,{upLinkUrl:"Upload.asp?Immediate=1",upLinkExt:"zip,rar,txt",upImgUrl:"Upload.asp?Immediate=1",upImgExt:"jpg,jpeg,gif,png",upFlashUrl:"Upload.asp?Immediate=1",upFlashExt:"swf",upMediaUrl:"Upload.asp?Immediate=1",upMediaExt:"avi"});
- }
- if($("#Fk_Product_Content").length>0){
- $('#Fk_Product_Content').xheditor(true,{upLinkUrl:"Upload.asp?Immediate=1",upLinkExt:"zip,rar,txt",upImgUrl:"Upload.asp?Immediate=1",upImgExt:"jpg,jpeg,gif,png",upFlashUrl:"Upload.asp?Immediate=1",upFlashExt:"swf",upMediaUrl:"Upload.asp?Immediate=1",upMediaExt:"avi"});
- }
- if($("#Fk_Down_Content").length>0){
- $('#Fk_Down_Content').xheditor(true,{upLinkUrl:"Upload.asp?Immediate=1",upLinkExt:"zip,rar,txt",upImgUrl:"Upload.asp?Immediate=1",upImgExt:"jpg,jpeg,gif,png",upFlashUrl:"Upload.asp?Immediate=1",upFlashExt:"swf",upMediaUrl:"Upload.asp?Immediate=1",upMediaExt:"avi"});
- }
- return true;
- }
- );
- $('select').hide();
- }
- //==========================================
- //函数名:
- //用途:按ESC关闭弹出窗口
- //参数:
- //==========================================
- document.onkeydown=function(){
- if(window.event.keyCode==27){
- $("#Boxs").hide();
- $('select').show();
- }
- }
- //==========================================
- //函数名:PageReSize
- //用途:页面初始化
- //参数:
- //==========================================
- function PageReSize(){
- var LeftWidth=189;
- var RightWidth=$("#Bodys").width()-189;
- var WindowsHeight=$(document).height()-90;
- var LeftHeight=$("#MainLeft").height();
- var RightHeight=$("#MainRight").height();
- if(RightWidth>812){
- $("#MainRight").width(RightWidth);
- $("#AllBox").width($("#Bodys").width());
- }else{
- $("#AllBox").width(1001);
- }
- if(LeftHeight<WindowsHeight||LeftHeight<RightHeight){
- if(RightHeight>WindowsHeight){
- $("#MainLeft").height(RightHeight);
- }else{
- $("#MainLeft").height(WindowsHeight);
- }
- }
- }
- //==========================================
- //函数名:SetRContent
- //用途:替换DIV内容
- //参数:DivId:要替换的DIV
- // Urls:获取内容的链接
- //==========================================
- function SetRContent(DivId,Urls){
- document.getElementById(DivId).innerHTML="<a href='javascript:void(0);' title='点此关闭' onclick=$('select').show();$('#Boxs').hide()><img src='Images/Loading.gif' /></a>";
- $.get(Urls,
- function(data){
- document.getElementById(DivId).innerHTML=data;
- PageReSize();
- return true;
- }
- );
- PageReSize();
- }
- //==========================================
- //函数名:GetPinyin
- //用途:获取拼音
- //参数:InPutId:放置的Input
- // Urls:获取内容的链接
- //==========================================
- function GetPinyin(InPutId,Urls){
- $.get(Urls,
- function(data){
- document.getElementById(InPutId).value=data;
- return true;
- }
- );
- }
- //==========================================
- //函数名:OpenMenu
- //用途:菜单开关
- //参数:MenuId:菜单ID
- //==========================================
- function OpenMenu(MenuId){
- if($("#"+MenuId).css("display")=="block"){
- $("#"+MenuId).css("display","none");
- }else{
- $("#"+MenuId).css("display","block");
- }
- }
- //==========================================
- //函数名:DelIt
- //用途:通用删除
- //参数:Cstr:提示语句
- // Urls:执行URL
- // F5Url:刷新URL
- // F5Div:刷新DIV
- //==========================================
- function DelIt(Cstr,Urls,F5Div,F5Url){
- if(confirm(Cstr)){
- $.get(Urls,
- function(data){
- alert(data);
- var Arrstr1 = new Array();
- var Arrstr2 = new Array();
- Arrstr1 = F5Div.split("|");
- Arrstr2 = F5Url.split("|");
- for(var i=0;i<Arrstr1.length;i++){
- SetRContent(Arrstr1[i],Arrstr2[i]);
- }
- return true;
- }
- );
- }
- return;
- }
- //==========================================
- //函数名:Sends
- //用途:表单提交
- //参数:FormName:提交的FORM
- // ToUrl:提交向的链接
- // SuGo:成功后是否转向链接,1转向,0不转向
- // GoUrl:转向链接
- // SuAlert:成功后是否弹出框提示,1弹出,0不弹出
- // SuF5:成功后是否刷新DIV,1刷新,0不刷新
- // F5Url:刷新URL
- // F5Div:刷新DIV
- //==========================================
- function Sends(FormName,ToUrl,SuGo,GoUrl,SuAlert,SuF5,F5Div,F5Url){
- var options = {
- url: ToUrl,
- beforeSubmit:function(formData, jqForm, options){
- return true;
- },
- success:function(responseText, statusText){
- if(statusText=="success"){
- if(responseText.search("成功")>0){
- if(SuAlert==1){
- alert(responseText);
- }
- else{
- $("#Boxs").hide();
- var st=responseText.replace(/|||||/gi,"n");
- alert(st);
- }
- if(SuGo==1){
- location.href=GoUrl;
- }
- if(SuF5==1){
- var Arrstr1 = new Array();
- var Arrstr2 = new Array();
- Arrstr1 = F5Div.split("|");
- Arrstr2 = F5Url.split("|");
- for(var i=0;i<Arrstr1.length;i++){
- SetRContent(Arrstr1[i],Arrstr2[i]);
- }
- }
- }
- else{
- var st=responseText.replace(/|||||/gi,"n");
- alert(st);
- }
- }
- else{
- alert(statusText);
- }
- }
- };
- $('#'+FormName+'').ajaxForm(options);
- }
- //==========================================
- //函数名:Sends_Div
- //用途:表单提交更新DIV
- //参数:FormName:提交的FORM
- // ToUrl:提交向的链接
- // F5Div:刷新DIV
- //==========================================
- function Sends_Div(FormName,ToUrl,F5Div){
- document.getElementById(F5Div).innerHTML="<a href='javascript:void(0);' title='点此关闭' onclick=$('#Boxs').hide()><img src='Images/Loading.gif' /></a>";
- var options = {
- url: ToUrl,
- beforeSubmit:function(formData, jqForm, options){
- return true;
- },
- success:function(responseText, statusText){
- if(statusText=="success"){
- document.getElementById(F5Div).innerHTML=responseText;
- }
- else{
- alert(statusText);
- }
- }
- };
- $('#'+FormName+'').ajaxForm(options);
- }
- //==========================================
- //函数名:ChangeSelect
- //用途:修改Select内容
- //参数:Urls:执行URL
- // SId:操作的Select
- //==========================================
- function ChangeSelect(Urls,SId){
- $.get(Urls,
- function(data){
- if(data!=""){
- BuildSel(data,document.getElementById(SId));
- }
- return true;
- }
- );
- }
- //==========================================
- //函数名:BuildSel
- //用途:执行修改Select内容
- //参数:Urls:执行URL
- // SId:操作的Select
- //==========================================
- function BuildSel(Str,Sel){
- //先清空原来的数据.
- var Arrstr = new Array();
- Arrstr = Str.split(",,,,,");
- //开始构建新的Select.
- if(Str!=""){
- Sel.options.length=0;
- var arrst;
- for(var i=0;i<Arrstr.length;i++){
- if(Arrstr[i]!=""){
- Arrst=Arrstr[i].split("|||||");
- Sel.options[Sel.options.length]=new Option(Arrst[1],Arrst[0]);
- }
- }
- }
- }
- //==========================================
- //函数名:ModuleTypeChange
- //用途:模块类型选择内容变换
- //参数:ModuleTypeId:模板类型
- //==========================================
- function ModuleTypeChange(ModuleTypeId){
- if(ModuleTypeId==0){
- $("#Fk_Module_PageCounts").css("display","none");
- $("#Fk_Module_Keywords").css("display","block");
- $("#Fk_Module_Descriptions").css("display","block");
- $("#Fk_Module_Dirs").css("display","none");
- $("#Fk_Module_FileNames").css("display","block");
- $("#Fk_Module_Templates").css("display","block");
- $("#Fk_Module_LowTemplates").css("display","none");
- $("#Fk_Module_Urls").css("display","none");
- }
- if(ModuleTypeId==1){
- $("#Fk_Module_PageCounts").css("display","block");
- $("#Fk_Module_Keywords").css("display","block");
- $("#Fk_Module_Descriptions").css("display","block");
- $("#Fk_Module_Dirs").css("display","block");
- $("#Fk_Module_FileNames").css("display","none");
- $("#Fk_Module_Templates").css("display","block");
- $("#Fk_Module_LowTemplates").css("display","block");
- $("#Fk_Module_Urls").css("display","none");
- }
- if(ModuleTypeId==2){
- $("#Fk_Module_PageCounts").css("display","block");
- $("#Fk_Module_Keywords").css("display","block");
- $("#Fk_Module_Descriptions").css("display","block");
- $("#Fk_Module_Dirs").css("display","block");
- $("#Fk_Module_FileNames").css("display","none");
- $("#Fk_Module_Templates").css("display","block");
- $("#Fk_Module_LowTemplates").css("display","block");
- $("#Fk_Module_Urls").css("display","none");
- }
- if(ModuleTypeId==3){
- $("#Fk_Module_PageCounts").css("display","none");
- $("#Fk_Module_Keywords").css("display","block");
- $("#Fk_Module_Descriptions").css("display","block");
- $("#Fk_Module_Dirs").css("display","none");
- $("#Fk_Module_FileNames").css("display","block");
- $("#Fk_Module_Templates").css("display","block");
- $("#Fk_Module_LowTemplates").css("display","none");
- $("#Fk_Module_Urls").css("display","none");
- }
- if(ModuleTypeId==4){
- $("#Fk_Module_PageCounts").css("display","none");
- $("#Fk_Module_Keywords").css("display","block");
- $("#Fk_Module_Descriptions").css("display","block");
- $("#Fk_Module_Dirs").css("display","none");
- $("#Fk_Module_FileNames").css("display","block");
- $("#Fk_Module_Templates").css("display","block");
- $("#Fk_Module_LowTemplates").css("display","none");
- $("#Fk_Module_Urls").css("display","none");
- }
- if(ModuleTypeId==5){
- $("#Fk_Module_PageCounts").css("display","none");
- $("#Fk_Module_Keywords").css("display","none");
- $("#Fk_Module_Descriptions").css("display","none");
- $("#Fk_Module_Dirs").css("display","none");
- $("#Fk_Module_FileNames").css("display","none");
- $("#Fk_Module_Templates").css("display","none");
- $("#Fk_Module_LowTemplates").css("display","none");
- $("#Fk_Module_Urls").css("display","block");
- }
- if(ModuleTypeId==6){
- $("#Fk_Module_PageCounts").css("display","none");
- $("#Fk_Module_Keywords").css("display","none");
- $("#Fk_Module_Descriptions").css("display","none");
- $("#Fk_Module_Dirs").css("display","none");
- $("#Fk_Module_FileNames").css("display","none");
- $("#Fk_Module_Templates").css("display","block");
- $("#Fk_Module_LowTemplates").css("display","none");
- $("#Fk_Module_Urls").css("display","none");
- }
- if(ModuleTypeId==7){
- $("#Fk_Module_PageCounts").css("display","block");
- $("#Fk_Module_Keywords").css("display","block");
- $("#Fk_Module_Descriptions").css("display","block");
- $("#Fk_Module_Dirs").css("display","block");
- $("#Fk_Module_FileNames").css("display","none");
- $("#Fk_Module_Templates").css("display","block");
- $("#Fk_Module_LowTemplates").css("display","block");
- $("#Fk_Module_Urls").css("display","none");
- }
- }
- //==========================================
- //函数名:ColorPicker
- //用途:颜色选择
- //参数:ColorInput:要颜色的Input
- //==========================================
- function ColorPicker(ColorInput) {
- var sColor=dlgHelper.ChooseColorDlg();
- if(sColor.toString(16)==0){
- ColorInput.value="";
- }else{
- ColorInput.value="#"+sColor.toString(16);
- }
- }