Asp.net源码专业站
首页->学教实践->在线考试系统源码(毕业设计)>>Public.js>>源码在线查看
温馨提示:代码在线浏览功能只能做为源码浏览参考,如果想更进一步了解该代码请下载:在线考试系统源码(毕业设计)
当前文件:文件类型 HBDGI338O5Y15/Public.js[12K,2009-6-12 11:43:44]打开代码结构图
普通视图
		            
1/*Selected Row*/ 2function pointTo() 3{ 4 var src = event.srcElement.parentElement; 5 if (src && src.tagName =='TR') 6 { 7 ClearSel(); 8 src.className="SelectedColor"; 9 } 10} 11 12/*Clear Row BackGroundColor*/ 13function ClearSel() 14{ 15 var objTr=document.all.tags('Tr'); 16 for (var i=1;i<objTr.length;i++) 17 { 18 if (objTr[i].id != "") 19 { 20 if ( i%2!=0 ) 21 { 22 //objTr[i].className="unselectedColor"; 23 objTr[i].className="altercolor"; 24 } 25 else 26 { 27 //objTr[i].className="altercolor"; 28 objTr[i].className="unselectedColor"; 29 } 30 } 31 } 32} 33 34/*Data Pickup Window*/ 35function DataSelectWindow(url) 36{ 37 var sFeature="dialogWidth:300px;dialogHeight:320px;center:yes;help:no;resizable:yes;status:no;"; 38 var sItemID=""; 39 var sUrl=url; 40 41 var retObj=window.showModalDialog(sUrl,"",sFeature); 42 if (retObj!=null && retObj.id!="*") 43 { 44 //get your data here,such as 45 //element.itemid=retObj.id; 46 } 47} 48 49/*Tree Select Window*/ 50function TreeSelectWindowForMultTree(url) 51{ 52 var vv=new Object(); 53 title=encodeURI('查找'); 54 window_style="dialogWidth:280px;dialogHeight:400px;status:no;resizable: yes;scroll:no"; 55 vv=window.showModalDialog(url,'',window_style); 56 if(vv!=null) 57 return vv; 58 59 //get your data here; 60 61} 62 63/*Tree Select Window*/ 64function TreeSelectWindow(url) 65{ 66 var vv=new Object(); 67 window_style="dialogWidth:274px;dialogHeight:385px;status:no;resizable:no;scroll:no"; 68 vv=window.showModalDialog(url,"查询",window_style); 69 if(vv != null) 70 return vv; 71} 72 73/*Tree Select Window*/ 74function TreeSelectPromptWindow(url) 75{ 76 var result = new Object(); 77 var window_style="dialogWidth:258px;dialogHeight:385px;status:no;resizable:yes;scroll:no"; 78 result = window.showModalDialog(url,"查询",window_style); 79 if( result == null) 80 return null; 81 else 82 return result; 83} 84 85 86 87/*Switch Bar Control*/ 88function switchSysBar(stype) 89{ 90 if (stype==7){ 91 document.all("frmTitle").style.display="none"; 92 document.all("switchPoint").style.visibility=""; 93 document.all("open_btn").style.width=18; 94 } 95 else{ 96 document.all("frmTitle").style.display=""; 97 document.all("switchPoint").style.visibility="hidden"; 98 document.all("open_btn").style.width=6; 99 } 100} 101 102/*Switch Bar Control*/ 103function switchSysBarInContainer(stype) 104{ 105 if (stype==7){ 106 document.all("frmTitle").style.display="none"; 107 document.all("frminterval").style.display=""; 108 document.all("switchPoint").style.visibility=""; 109 document.all("open_btn").style.width=18; 110 111 var workLeftTd = document.all("workLeft"); 112 workLeftTd.style.width = "18px"; 113 workLeftTd.children[0].style.width="18px"; 114 } 115 else{ 116 document.all("frmTitle").style.display=""; 117 document.all("frminterval").style.display="none"; 118 document.all("switchPoint").style.visibility="hidden"; 119 document.all("open_btn").style.width=6; 120 121 var workLeftTd = document.all("workLeft"); 122 workLeftTd.style.width = "160px"; 123 workLeftTd.children[0].style.width="160px"; 124 } 125} 126 127/*Item Select Init*/ 128function initIt() 129{ 130 divColl = document.all.tags("DIV"); 131 for (i=0; i<divColl.length; i++) { 132 whichEl = divColl(i); 133 if (whichEl.className == "child") whichEl.style.display = "none"; 134 } 135} 136 137/*Item Expand*/ 138function expandIt(el,picname) 139{ 140 whichEl = eval(el + "Child"); 141 img=eval(picname); 142 if (whichEl.style.display == "none") { 143 whichEl.style.display = "block"; 144 img.src="images/TRUE.GIF" 145 } 146 else { 147 whichEl.style.display = "none"; 148 img.src="images/FALSE.GIF" 149 } 150} 151 152/*Message Window*/ 153function MsgWindow(url,title) 154{ 155 //alert(url); 156 //var sFeature="dialogWidth:410px;dialogHeight:106px;center:yes;help:no;resizable:yes;status:no;scroll:no"; 157 var sFeature="dialogWidth:425px;dialogHeight:106px;center:yes;help:no;resizable:yes;status:no;scroll:no"; //baty changed 158 var sItemID=""; 159 var sUrl=url; 160 161 var retObj=window.showModalDialog(sUrl,title,sFeature); 162 return(retObj); 163} 164 165/*KeyWord search*/ 166function KeyWordSearch() 167{ 168 var DialogStyle = "dialogWidth:300px;dialogHeight:110px;status:no;resizable:no"; 169 170 var result = window.showModalDialog("../HumanManage/SimpleSelectPrompt.htm","关键字查询",DialogStyle); 171 if(result!="" && result!=null) 172 { 173 return result; 174 } 175 else 176 { return ""; 177 } 178} 179 180/*面试安排*/ 181function ConfirmWindow(url,title) 182{ 183 var sFeature="dialogWidth:350px;dialogHeight:330px;center:yes;help:no;resizable:no;status:no;"; 184 var sItemID=""; 185 var sUrl=url; 186 187 var retObj=window.showModalDialog(sUrl,title,sFeature); 188 return(retObj); 189} 190 191/*招聘信息确认窗口*/ 192function ConfirmWindow2(url,title) 193{ 194 var sFeature="dialogWidth:300px;dialogHeight:185px;center:yes;help:no;resizable:no;status:no;"; 195 var sItemID=""; 196 var sUrl=url; 197 198 var retObj=window.showModalDialog(sUrl,title,sFeature); 199 return(retObj); 200} 201 202/*去除字符串两边的空格*/ 203function Jtrim(str){ 204 var i = 0; 205 var len = str.length; 206 if ( str == "" ) return( str ); 207 j = len -1; 208 flagbegin = true; 209 flagend = true; 210 while ( flagbegin == true && i< len){ 211 if ( str.charAt(i) == " " ){ 212 i=i+1; 213 flagbegin=true; 214 } 215 else{ 216 flagbegin=false; 217 } 218 } 219 while (flagend== true && j>=0){ 220 if (str.charAt(j)==" "){ 221 j=j-1; 222 flagend=true; 223 } 224 else{ 225 flagend=false; 226 } 227 } 228 if ( i > j ) return ("") 229 trimstr = str.substring(i,j+1); 230 return trimstr; 231} 232 233//清除toolbar元素 234function ClearToolbar(toolbar) 235{ 236 toolbar.clear(); 237} 238 239//创建按钮 itemid按钮ID, itemtitle按钮名称, itemimageurl按钮使用的图片, textstatus文本所处的位置:right,none,bottom 240function CreateButton(toolbar,itemid,itemtitle,itemimageurl,textstatus) 241{ 242 var num; 243 num = toolbar.numItems; 244 if(textstatus == null) 245 { 246 toolbar.createButtonAt(num,"<TBNS:ToolbarButton ID=\"" + itemid + "\" title=\"" + itemtitle + "\" imageUrl=\"" + itemimageurl + "\">" + itemtitle + "</TBNS:ToolbarButton>"); 247 } 248 else 249 { 250 if(textstatus.toLowerCase() == "bottom") 251 { 252 toolbar.createButtonAt(num,"<TBNS:ToolbarButton ID=\"" + itemid + "\" title=\"" + itemtitle + "\" text=\"<br>" + itemtitle + "\" imageUrl=\"" + itemimageurl + "\" defaultstyle=\"text-align:center\"></TBNS:ToolbarButton>"); 253 } 254 } 255} 256 257//创建最左边的LABEL 258function CreateLabelLeft(toolbar) 259{ 260 var num; 261 num = toolbar.numItems; 262 toolbar.createLabelAt(num,"<TBNS:ToolbarLabel imageUrl=\"../images/Toolbar_left_1.gif\"></TBNS:ToolbarLabel>"); 263} 264 265//创建分割按钮的LABEL 266function CreateLabelGroup(toolbar) 267{ 268 var num; 269 num = toolbar.numItems; 270 toolbar.createLabelAt(num,"<TBNS:ToolbarLabel imageUrl=\"../images/Toolbar_group_1.gif\"></TBNS:ToolbarLabel>"); 271} 272 273//修改按钮状态――使按钮处于有效或者无效状态//num,按钮按照从左到右所处位置的索引,从0开始//value = true,则按钮处于无效状态//value = false,则按钮处于有效状态 274 275 276function DisableToolbar(toolbar,num,value) 277{ 278 var toolItem = toolbar.getItem(num); 279 toolItem.setAttribute("disabled", value); 280} 281 282//修改按钮状态――使按钮处于有效或者无效状态(批量修改) 283//startnum,按钮按照从左到右所处位置的索引 284//length,批量修改按钮的数量 285//value = true,则按钮处于无效状态//value = false,则按钮处于有效状态 286 287 288function DisableToolbarGroup(toolbar,startnum,length,value) 289{ 290 for(var i=startnum; i< startnum + length; i++) 291 { 292 var toolItem = toolbar.getItem(i); 293 if(toolItem == null) 294 { 295 continue; 296 } 297 toolItem.setAttribute("disabled", value); 298 } 299} 300 301function test() 302{alert("Ok");} 303 304//弹出对话框,返回值由rtnValue组成。 305//@param url. The url of target page to be displayed in the dialogbox 306//@param agrument feature of dialog 307function showDialogBox(dialogboxUrl, url, title, feature, argument) 308{ 309 //alert("oK"); 310 var arg; 311 var argObject = new Object(); 312 if(dialogboxUrl == null) 313 { 314 alert("Argument dialogboxUrl is null. "); 315 } 316 317 if(url == null) 318 { 319 alert("Argument url is null. "); 320 } 321 322 url = encodeURIComponent(url); 323 324 dialogboxUrl = dialogboxUrl + "?DialogURL=" + url; 325 326 argObject.title = title; 327 argObject.argument = argument; 328 329 if(feature == null) 330 { 331 feature = "scroll: no; status: no; unadorned : no; help : no;"; 332 } 333 334 var rtnValue = window.showModalDialog(dialogboxUrl, argObject, feature); 335 //alert("public.js?"+rtnValue); 336 return rtnValue; 337} 338 339//弹出对话框,返回值是argument。 340function showDialogBoxReturnArg(dialogboxUrl, url, title, feature, argument) 341{ 342 var arg; 343 var argObject = new Object(); 344 if(dialogboxUrl == null) 345 { 346 alert("Argument dialogboxUrl is null. "); 347 } 348 349 if(url == null) 350 { 351 alert("Argument url is null. "); 352 } 353 354 url = encodeURIComponent(url); 355 356 dialogboxUrl = dialogboxUrl + "?DialogURL=" + url; 357 358 argObject.title = title; 359 argObject.argument = argument; 360 361 if(feature == null) 362 { 363 feature = "scroll: no; status: no; unadorned : no; help : no;"; 364 } 365 366 var rtnArg ; 367 window.showModalDialog(dialogboxUrl, argObject, feature); 368 rtnArg = argObject.argument; 369 return rtnArg; 370} 371 372 373//弹出Modeless对话框 374 375 376function showModelessDialogBox(dialogboxUrl, url, title, feature) 377{ 378 var arg; 379 if(dialogboxUrl == null) 380 { 381 alert("Argument dialogboxUrl is null. "); 382 } 383 384 if(url == null) 385 { 386 alert("Argument url is null. "); 387 } 388 389 url = encodeURIComponent(url); 390 //title = encodeURIComponent(title); 391 392 dialogboxUrl = dialogboxUrl + "?DialogURL=" + url; 393 394 if(arg == null) 395 { 396 arg = ""; 397 } 398 399 if(feature == null) 400 { 401 feature = "scroll: no; status: no; unadorned : no; help : no;"; 402 } 403 404 return window.showModelessDialog(dialogboxUrl, arg, feature); 405} 406 407//弹出Modeless对话框,返回值是argument两部分组成。 408function showModelessDialogBoxReturnArg(dialogboxUrl, url, title, feature, argument) 409{ 410 var arg = new Object(); 411 arg.argument = argument; 412 if(dialogboxUrl == null) 413 { 414 alert("Argument dialogboxUrl is null. "); 415 } 416 417 if(url == null) 418 { 419 alert("Argument url is null. "); 420 } 421 422 url = encodeURIComponent(url); 423 //title = encodeURIComponent(title); 424 425 dialogboxUrl = dialogboxUrl + "?DialogURL=" + url; 426 427 if(arg == null) 428 { 429 arg = ""; 430 } 431 432 if(feature == null) 433 { 434 feature = "scroll: no; status: no; unadorned : no; help : no;"; 435 } 436 437 var dialogReturnValue; 438 window.showModelessDialog(dialogboxUrl, arg, feature); 439 dialogReturnValue = arg.argument; 440 return dialogReturnValue; 441} 442 443/***********显示QuickTree(组织单元、岗位、员工树)*********************/ 444//selectType,选择类型,分为三类:OrgUnit、Position、Employee 445//showType,显示类型,分为五类:OrgUnit、 OrgUnit,Position、OrgUnit,Employee、OrgUnit,Position,Employee、OrgUnit1,OrgUnit2 446//allowMultiSelect,是否允许多选 447 448 449//CustomRootItemData,权限字符串 450//ShowLevel,显示的层数,默认3 451/***********************************************************************/ 452function showQuickTree(selectType,showType,allowMultiSelect,CustomRootItemData,showLevel) 453{ 454 var dialogboxUrl,url, title, feature,rtnValue; 455 456 //检查参数的准确性 457 if(selectType.toLowerCase() != "orgunit" 458 && selectType.toLowerCase() != "position" 459 && selectType.toLowerCase() != "employee") 460 { 461 alert("第一个参数selectType不正确,应该为下面三种之一:OrgUnit、Position、Employee"); 462 return null; 463 } 464 465 switch(showType.toLowerCase()) 466 { 467 case "orgunit" : 468 showType = "OrgUnit"; 469 title = "组织单元树"; 470 break; 471 case "orgunit,position": 472 showType = "OrgUnit,Position"; 473 title = "岗位树"; 474 break; 475 case "orgunit,employee": 476 showType = "OrgUnit,Employee"; 477 title = "员工树"; 478 break; 479 case "orgunit,position,employee": 480 showType = "OrgUnit,Employee,Position"; 481 title = "组织单元、岗位、员工树"; 482 break; 483 case "orgunit1,orgunit2": 484 showType = "OrgUnit1,OrgUnit2"; 485 title = "集团、公司树"; 486 break; 487 default: 488 alert("第二个参数showType不正确,应该为下面四种之一:OrgUnit、 OrgUnit,Position、OrgUnit,Employee、OrgUnit,Position,Employee"); 489 return null; 490 break; 491 } 492 493 dialogboxUrl = "../DialogBox.aspx"; 494 495 feature = "dialogWidth:300px;dialogHeight:385px;center:yes;help:no;resizable:yes;status:no;scroll:no"; 496 497 var tempShowLevel = 3; //默认3层 498 499 500 if(showLevel != null) 501 { 502 tempShowLevel = showLevel; 503 } 504 505 url = "Trees/QuickTree.aspx?SelectType="+selectType+"&ShowType="+showType+"&ShowLevel="+tempShowLevel+"&FrameworkId=efd9de08-df92-48c9-9ad4-adfdbf66af2b&CustomRootItem=true&CustomRootItemDataType=Code&CustomRootItemData="+CustomRootItemData; 506 507 if(allowMultiSelect == true) 508 { 509 url += "&AllowMultiSelect=true"; 510 var argument = null; 511 rtnValue = showDialogBoxReturnArg(dialogboxUrl, url, title, feature, argument); 512 } 513 else 514 { 515 rtnValue = showDialogBox(dialogboxUrl, url, title, feature); 516 } 517 518 return rtnValue; 519}
还没有找到您心仪的内容?请用.net源码大搜捕
代码片断 打包下载该项目完整源码:在线考试系统源码(毕业设计)
51Aspx.com 版权所有 CopyRight © 2006-2010. 京ICP备06046876号 本站法律顾问:ITlaw-庄毅雄律师
返回顶部
客户服务:点击这里进行客户咨询 业务合作:点击这里洽谈业务合作 合作热线:010-68880146