Best JavaScript code snippet using puppeteer
Custom.js
Source:Custom.js
1 var ASSourceNameList=[2 {src:"Image/Page/radioPoint.png"},3 {src:"Image/Page/checkBox.png"},4 {src:"Image/Page/basicTitleBottom.jpg"},5 {src:"Image/Page/loadingBottom.png"},6 {src:"Image/Page/loadingCover.png"},7 {src:"Image/Page/loadingSucceed.png"},8 {src:"Image/Page/loadingFail.png"},9 {src:"Image/TopLogo/TopLogo.png"},10 {name:"startScene",src:"Image/Scene/Origin/main.png"},11 {name:"userHead1",src:"Image/User/logo1.png"},12 {name:"userHead2",src:"Image/User/logo2.png"},13 {name:"cardBoardSearch1",src:"Image/CardBoard/search1.png"},14 {name:"cardBoardSearch2",src:"Image/CardBoard/search2.png"},15 {name:"cardBoardBack1",src:"Image/CardBoard/back1.png"},16 {name:"cardBoardBack2",src:"Image/CardBoard/back2.png"},17 {name:"cardBoardBack3",src:"Image/CardBoard/back3.png"},18 {src:"Image/Search/bihuaCover.png"},19 {name:"searchLight",src:"Image/Search/light.png"},20 {name:"searchFold1",src:"Image/Search/fold1.png"},21 {name:"searchFold2",src:"Image/Search/fold2.png"},22 {name:"searchSearch1",src:"Image/Search/search1.png"},23 {name:"searchSearch2",src:"Image/Search/search2.png"},24 {name:"headBack",src:"Image/Head/background.jpg"},25 {name:"icon_back",src:"Image/Head/Icon/back.png"},26 {name:"icon_backL",src:"Image/Head/Icon/backL.png"},27 {name:"shellClose1",src:"Image/Shell/close1.png"},28 {name:"shellClose2",src:"Image/Shell/close2.png"},29 {name:"frameDivideBar",src:"Image/Frame/divideBar.png"},30 {name:"frameDivideLine",src:"Image/Frame/divideLine.png"},31 {name:"anchorListPointCover",src:"Image/Frame/jumpPointCover.png"},32 {name:"anchorListEndCover",src:"Image/Frame/jumpEndCover.png"},33 {name:"anchorListLineCover",src:"Image/Frame/jumpLineCover.png"},34 {name:"anchorListLight",src:"Image/Frame/jumpLight.png"},35 {name:"pageListLine",src:"Image/Frame/jumpLine.png"},36 {name:"pageListBlock",src:"Image/Frame/jumpBlock.png"},37 {name:"frameLinkLineB",src:"Image/Frame/linkLineB.png"},38 {name:"frameLinkLineW",src:"Image/Frame/linkLineW.png"},39 {name:"CFASQrcode",src:"Image/Page/Wechat/qrcode.jpg"},40 {name:"emailListClose",src:"Image/Page/Email/close.png"},41 {name:"enroll_past",src:"Image/Page/Function/past.png"},42 {name:"enroll_waiting",src:"Image/Page/Function/waiting.png"},43 {name:"enroll_available",src:"Image/Page/Function/available.png"},44 {name:"enroll_full",src:"Image/Page/Function/full.png"},45 {name:"enroll_ban",src:"Image/Page/Function/ban.png"},46 {name:"enroll_paying",src:"Image/Page/Function/paying.png"},47 {name:"enroll_success",src:"Image/Page/Function/success.png"},48 {name:"enroll_check",src:"Image/Page/Function/check.png"},49 {name:"enroll_change",src:"Image/Page/Function/change.png"},50 {name:"editorToolIcon",src:"Image/Page/Email/toolIcon.png"},51 {name:"editorToolRegion",src:"Image/Page/Email/toolRegion.png"},52 ];53 var ASSourceLoadList=[54 {src:"Data/data0.xml"},55 {name:"loadingScene",src:"Image/Scene/main.png"},56 {src:"Image/logo.png"},57 {src:"Image/logoL.png"},58 {src:"Image/loadingCircle.png"},59 {src:"Image/loadingLight.png"},60 ];61 var ASSourceBuildList=[62 ];63 var ASSourceWaitList=[64 ];65 //Component66 var BasicWordStr=new function() {67 BasicWordList=[];68 this.setLang=function(l) {69 if (!this["word"+l] && (this.wordC || this.wordE)) {70 if (l=="C") this.setLang("E");71 else this.setLang("C");72 return;73 }74 this.lang=l;75 this.word.set({innerHTML:this["word"+this.lang]});76 this.value=this["word"+this.lang];77 if (this.width=="max") this.set({style:{width:ASGetWordWidth(this.word)+2}});78 if (this.giveupExtra) return;79 var dx=0,dy=0;80 if (this.lang=="C" && this.word.style.fontFamily.indexOf("Microsoft Yahei")>-1) {81 dy-=this.size*0.06;82 dx-=this.size*0.06;83 }84 if (this.word.style.fontFamily.indexOf("Droid Sans Fallback")>-1) {85 dy+=this.size*0.07;86 }87 if (this.lang=="E" && this.sizeE) {88 this.word.set({style:{fontSize:this.sizeE}});89 } else {90 this.word.set({style:{fontSize:this.size}});91 }92 if (this.lang=="C" && this.letterSpacingC) {93 dx+=this.letterSpacingC/2;94 this.word.set({style:{letterSpacing:this.letterSpacingC,}});95 } else {96 this.word.set({style:{letterSpacing:0,}});97 }98 this.word.set({style:{99 top:dy,100 left:dx,101 }});102 }103 this.setWord=function(typeP) {104 if ("wordC" in typeP) this.wordC=typeP.wordC;105 if ("wordE" in typeP) this.wordE=typeP.wordE;106 this.widthA=0;107 this.heightA=0;108 this.word.set({innerHTML:this.wordC}),109 this.widthA=Math.max(this.widthA,ASGetWordWidth(this.word));110 this.heightA=Math.max(this.heightA,ASGetWordHeight(this.word));111 this.word.set({innerHTML:this.wordE}),112 this.widthA=Math.max(this.widthA,ASGetWordWidth(this.word));113 this.heightA=Math.max(this.heightA,ASGetWordHeight(this.word));114 this.setLang(this.lang);115 }116 this.getValue=function() {117 return(this.value);118 }119 }120 function BasicWord(buildP) {121 if (!buildP.size) buildP.size=18;122 if (!buildP.font) buildP.font=DEFAULT_FONT;123 if (!buildP.wordC) buildP.wordC="";124 if (!buildP.wordE) buildP.wordE="";125 if (!buildP.color) buildP.color="black";126 if (!buildP.defaultL) buildP.defaultL=ASLang;127 var target=ASElement({128 nodeName:"div",129 });130 target.size=buildP.size;131 target.lang=buildP.defaultL;132 target.wordC=buildP.wordC;133 target.wordE=buildP.wordE;134 target.sizeE=buildP.sizeE;135 target.letterSpacingC=buildP.letterSpacingC;136 target.giveupExtra=buildP.giveupExtra;137 BasicWordList[BasicWordList.length]=target;138 target.word=ASElement({139 nodeName:"p",140 style:{141 position:"relative",142 fontSize:buildP.size,143 fontFamily:buildP.font,144 color:buildP.color,145 },146 });147 target.appendChild(target.word);148 target.setLang=BasicWordStr.setLang;149 target.setWord=BasicWordStr.setWord;150 target.getValue=BasicWordStr.getValue;151 target.width=buildP.width;152 target.setWord({153 wordC:buildP.wordC,154 wordE:buildP.wordE,155 });156 target.set(buildP);157 return(target);158 }159 function BasicTitle(buildP) {160 if (!buildP.size) buildP.size=30;161 // Default Title Color162 if (!buildP.color) buildP.color="rgb(230,0,0)";163 var target=ASElement({164 nodeName:"div",165 style:{166 backgroundImage:"url('"+ASGetSrcByName("basicTitleBottom")+"')",167 backgroundPosition:"0 0",168 backgroundSize:buildP.size*0.18+"px 100%",169 backgroundRepeat:"no-repeat",170 },171 });172 target.word=BasicWord({173 size:buildP.size,174 sizeE:buildP.sizeE,175 font:buildP.font,176 wordC:buildP.wordC,177 wordE:buildP.wordE,178 color:buildP.color,179 defaultL:buildP.defaultL,180 letterSpacingC:buildP.letterSpacingC,181 style:{182 position:"relative",183 marginLeft:buildP.size*0.5,184 },185 });186 target.appendChild(target.word);187 if (buildP.widthA) {188 target.set({style:{189 width:buildP.widthA,190 }});191 }192 target.set(buildP);193 return(target);194 }195 var BasicButtonStr=new function() {196 this.onmouseover=function() {197 this.bottom.setTarget({198 transform:{scale:1},199 });200 this.bottom.light.setTarget({201 opacity:1,202 });203 this.bottom.shade.setTarget({204 opacity:0,205 });206 this.word.setTarget({207 transform:{208 translateX:-2,209 translateY:-1,210 },211 });212 }213 this.onmouseout=function() {214 this.bottom.setTarget({215 transform:{scale:1},216 });217 this.bottom.light.setTarget({218 opacity:0,219 });220 this.bottom.shade.setTarget({221 opacity:0,222 });223 this.word.setTarget({224 transform:"translate(0,0)",225 });226 }227 this.onmousedown=function() {228 this.bottom.setTarget({229 transform:{scale:1},230 });231 this.bottom.light.setTarget({232 opacity:0,233 });234 this.bottom.shade.setTarget({235 opacity:1,236 });237 this.word.setTarget({238 transform:{239 translateX:2,240 translateY:1,241 },242 });243 }244 this.onmouseup=function() {245 this.bottom.setTarget({246 transform:{scale:1},247 });248 this.bottom.light.setTarget({249 opacity:1,250 });251 this.bottom.shade.setTarget({252 opacity:0,253 });254 this.word.setTarget({255 transform:{256 translateX:-2,257 translateY:-1,258 },259 });260 }261 this.resize=function(typeP) {262 if (typeP.widthA) {263 this.width0=typeP.widthA;264 this.word.set({style:{width:typeP.widthA}});265 this.set({style:{width:typeP.widthA}});266 }267 }268 }269 function BasicButton(buildP) {270 // Default Button Color271 if (!buildP.size) buildP.size=18;272 if (!buildP.color) buildP.color="rgb(240,0,0)";273 if (!buildP.colorW) buildP.colorW="white";274 if (!buildP.colorL) buildP.colorL="rgb(255,145,0)";275 var target=ASElement({276 nodeName:"div",277 style:{278 position:"relative",279 borderRadius:buildP.size*0.15,280 textAlign:"center",281 cursor:"pointer",282 },283 onmouseover:BasicButtonStr.onmouseover,284 onmouseout:BasicButtonStr.onmouseout,285 onmousedown:BasicButtonStr.onmousedown,286 onmouseup:BasicButtonStr.onmouseup,287 resize:BasicButtonStr.resize,288 });289 target.size=buildP.size;290 target.word=BasicWord({291 font:buildP.font,292 size:buildP.size,293 color:buildP.colorW,294 wordC:buildP.wordC,295 wordE:buildP.wordE,296 wCenter:true,297 style:{298 position:"absolute",299 pointerEvents:"none",300 },301 });302 target.width0=target.word.widthA+buildP.size*1;303 target.height0=target.word.heightA+buildP.size*0.5;304 if (buildP.widthA) target.width0=buildP.widthA;305 target.word.set({style:{306 top:buildP.size*0.25,307 width:"100%",308 }});309 target.bottom=ASElement({310 nodeName:"div",311 style:{312 position:"absolute",313 left:0,314 top:0,315 transformOrigin:"50% 50%",316 backgroundColor:buildP.color,317 borderRadius:buildP.size*0.15,318 width:"100%",319 height:"100%",320 boxShadow:"0 0 "+target.size*0.5+"px "+buildP.colorL+" inset",321 },322 });323 target.bottom.light=ASElement({324 nodeName:"div",325 style:{326 position:"absolute",327 top:0,328 left:0,329 borderRadius:buildP.size*0.15,330 width:"100%",331 height:"100%",332 opacity:0,333 boxShadow:(-target.size*0.1)+"px "+(-target.size*0.1)+"px "+target.size*0.4+"px rgba(255,255,255,1) inset",334 },335 });336 target.bottom.appendChild(target.bottom.light);337 target.bottom.shade=ASElement({338 nodeName:"div",339 style:{340 position:"absolute",341 top:0,342 left:0,343 borderRadius:buildP.size*0.15,344 width:"100%",345 height:"100%",346 opacity:0,347 boxShadow:(target.size*0.1)+"px "+(target.size*0.1)+"px "+target.size*0.4+"px rgba(0,0,0,0.8) inset",348 },349 });350 target.bottom.appendChild(target.bottom.shade);351 target.appendChild(target.bottom);352 target.appendChild(target.word);353 target.set({style:{354 width:target.width0,355 height:target.height0,356 }});357 target.set(buildP);358 return(target);359 }360 var BasicDoubleButtonStr=new function() {361 this.button0Onclick=function() {362 if (!this.root.wOpen) {363 this.root.open();364 } else {365 if (this.root.confirm) this.root.confirm();366 this.root.close();367 }368 this.onmouseout();369 }370 this.button1Onclick=function() {371 this.root.close();372 }373 this.onmouseoutdown=function() {374 this.close();375 }376 this.open=function() {377 if (this.wOpen) return;378 this.wOpen=true;379 this.floor1.set({style:{display:"inline-block"}});380 this.floor1.setTarget({opacity:1});381 switch (this.fx) {382 case "left": this.floor0.setTarget({transform:{translateX:-ASGetElementWidth(this.button0)+this.dx}}); break;383 case "right": this.floor0.setTarget({transform:{translateX:ASGetElementWidth(this.button1)+this.dx}}); break;384 case "up": this.floor0.setTarget({transform:{translateY:-ASGetElementHeight(this.button0)}}); break;385 case "down": this.floor0.setTarget({transform:{translateY:ASGetElementHeight(this.button1)}}); break;386 }387 this.button1.onmouseover();388 }389 this.close=function() {390 if (!this.wOpen) return;391 this.wOpen=false;392 this.floor1.setTarget({opacity:0});393 switch (this.fx) {394 case "left": this.floor0.setTarget({transform:{translateX:0}}); break;395 case "right": this.floor0.setTarget({transform:{translateX:0}}); break;396 case "up": this.floor0.setTarget({transform:{translateY:0}}); break;397 case "down": this.floor0.setTarget({transform:{translateY:0}}); break;398 }399 this.setTimeout(function() {400 if (!this.wOpen) this.floor1.set({style:{display:"none"}});401 },300);402 }403 }404 function BasicDoubleButton(buildP) {405 if (!buildP.fx) buildP.fx="up";406 var target=ASElement({407 nodeName:"div",408 style:{409 position:"relative",410 },411 onmouseoutdown:BasicDoubleButtonStr.onmouseoutdown,412 open:BasicDoubleButtonStr.open,413 close:BasicDoubleButtonStr.close,414 });415 target.fx=buildP.fx;416 target.floor0=ASElement({417 nodeName:"div",418 style:{419 position:"relative",420 },421 });422 if (!buildP.button0) buildP.button0={};423 if (!buildP.button0.size) buildP.button0.size=buildP.size;424 target.button0=BasicButton(buildP.button0);425 target.floor0.appendChild(target.button0);426 target.button0.onclick=BasicDoubleButtonStr.button0Onclick;427 target.button0.root=target;428 target.floor1=ASElement({429 nodeName:"div",430 style:{431 position:"absolute",432 opacity:0,433 },434 });435 if (!buildP.button1) buildP.button1={};436 if (!buildP.button1.size) buildP.button1.size=buildP.button0.size;437 if (!buildP.button1.color) buildP.button1.color="rgb(200,200,200)";438 if (!buildP.button1.colorL) buildP.button1.colorL="rgba(230,230,230,0.3)";439 if (!buildP.button1.colorW) buildP.button1.colorW="black";440 target.button1=BasicButton(buildP.button1);441 target.floor1.appendChild(target.button1);442 target.button1.root=target;443 target.button1.onclick=BasicDoubleButtonStr.button1Onclick;444 target.appendChild(target.floor1);445 target.appendChild(target.floor0);446 if (buildP.wAequilate) {447 var width=Math.max(ASGetElementWidth(target.button0),ASGetElementWidth(target.button1));448 target.button0.resize({widthA:width});449 target.button1.resize({widthA:width});450 }451 target.dx=(ASGetElementWidth(target.button0)-ASGetElementWidth(target.button1))/2;452 target.floor1.set({style:{left:target.dx,display:"none"}});453 delete buildP.button0;454 delete buildP.button1;455 target.set(buildP);456 return(target);457 }458 var BasicLoadingStr=new function() {459 this.restart=function() {460 this.set({style:{opacity:0}});461 this.bottom.set({style:{opacity:1}});462 this.cover.set({style:{opacity:1}});463 this.success.set({style:{opacity:0}});464 this.failed.set({style:{opacity:0}});465 }466 this.start=function() {467 this.setTarget({opacity:1});468 }469 this.succeed=function() {470 this.success.setTarget({opacity:1});471 this.bottom.setTarget({opacity:0});472 this.cover.setTarget({opacity:0});473 }474 this.fail=function() {475 this.failed.setTarget({opacity:1});476 this.bottom.setTarget({opacity:0});477 this.cover.setTarget({opacity:0});478 }479 this.end=function() {480 this.setTarget({opacity:0,speed_alpha:0.05});481 }482 }483 function BasicLoading(buildP) {484 var target=ASElement({485 nodeName:"div",486 style:{487 position:"relative",488 width:100,489 height:100,490 opacity:0,491 },492 });493 target.bottom=ASElement({494 nodeName:"img",495 src:ASGetSrcByName("loadingBottom"),496 style:{497 position:"absolute",498 width:"100%",499 height:"100%",500 },501 });502 target.appendChild(target.bottom);503 target.cover=ASElement({504 nodeName:"img",505 src:ASGetSrcByName("loadingCover"),506 style:{507 position:"absolute",508 left:0,509 top:0,510 width:"100%",511 height:"100%",512 animation:"basicLoadingRotate 0.5s linear infinite",513 },514 });515 target.appendChild(target.cover);516 target.success=ASElement({517 nodeName:"img",518 src:ASGetSrcByName("loadingSucceed"),519 style:{520 position:"absolute",521 left:0,522 top:0,523 opacity:0,524 height:"100%",525 },526 });527 target.appendChild(target.success);528 target.failed=ASElement({529 nodeName:"img",530 src:ASGetSrcByName("loadingFail"),531 style:{532 position:"absolute",533 left:0,534 top:0,535 opacity:0,536 height:"100%",537 },538 });539 target.appendChild(target.failed);540 target.restart=BasicLoadingStr.restart;541 target.start=BasicLoadingStr.start;542 target.succeed=BasicLoadingStr.succeed;543 target.fail=BasicLoadingStr.fail;544 target.end=BasicLoadingStr.end;545 target.set(buildP);546 return(target);547 }548 var BasicInputStr=new function() {549 this.inputOnfocus=function() {550 this.root.alarm.setTarget({opacity:0});551 var width1=Math.min(ASGetWordWidth(this),ASGetElementWidth(this))+6;552 if (this.root.hint) width1=Math.max(width1,ASGetElementWidth(this.root.hint)+6);553 if (this.root.wWrong) {554 this.root.notice.set({style:{left:width1+11}});555 }556 }557 this.inputOnblur=function() {558 this.root.check();559 if (this.root.onblur1) this.root.onblur1();560 }561 this.inputOninput=function() {562 var width1=Math.min(ASGetWordWidth(this),ASGetElementWidth(this))+6;563 if (this.root.hint) width1=Math.max(width1,ASGetElementWidth(this.root.hint)+6);564 this.root.wWrong=false;565 this.root.alarm.set({style:{width:width1}});566 this.root.notice.set({style:{left:width1+11}});567 for (var i=0;i<this.root.wrong.length;i++) {568 if (this.root.wrong[i].type=="onblur") continue;569 this.judge=this.root.wrong[i].judge;570 if (this.judge()) {571 this.root.wWrong=true;572 this.root.alarm.setTarget({opacity:1});573 this.root.alarm.setTimeout(function() {this.setTarget({opacity:0});},150);574 this.root.notice.setWord({575 wordC:this.root.wrong[i].wordC,576 wordE:this.root.wrong[i].wordE,577 });578 this.root.notice.setTarget({opacity:1});579 break;580 }581 }582 if (!this.root.wWrong) {583 this.root.alarm.setTarget({opacity:0});584 this.root.notice.setTarget({opacity:0});585 }586 if (this.value) {587 if (this.root.hint) this.root.hint.set({style:{opacity:0}});588 } else {589 if (this.root.hint) this.root.hint.setTarget({opacity:1});590 }591 }592 this.inputClearWrong=function() {593 var width1=Math.min(ASGetWordWidth(this.input),ASGetElementWidth(this.input))+6;594 this.alarm.set({style:{width:width1}});595 this.notice.set({style:{left:width1+11}});596 this.alarm.setTarget({opacity:0});597 this.notice.setTarget({opacity:0});598 this.wWrong=false;599 }600 this.inputCheck=function() {601 var width1=ASGetWordWidth(this.input)+6;602 if (!this.value) width1=ASGetElementWidth(this.hint)+6;603 this.wWrong=false;604 for (var i=0;i<this.wrong.length;i++) {605 this.input.judge=this.wrong[i].judge;606 if (this.input.judge()) {607 this.wWrong=true;608 this.alarm.set({style:{width:width1}});609 this.alarm.setTarget({opacity:1});610 this.notice.setWord({611 wordC:this.wrong[i].wordC,612 wordE:this.wrong[i].wordE,613 });614 this.notice.set({style:{left:width1+11}});615 this.notice.setTarget({opacity:1});616 break;617 }618 }619 if (!this.wWrong) {620 this.alarm.setTarget({opacity:0});621 this.notice.setTarget({opacity:0});622 }623 }624 this.inputFocus=function() {625 this.input.focus();626 }627 this.inputSetValue=function(str) {628 this.input.value=str;629 if (str) {630 if (this.hint) this.hint.set({style:{opacity:0}});631 } else {632 if (this.hint) this.hint.setTarget({opacity:1});633 }634 this.clearWrong();635 }636 this.inputGetValue=function() {637 return(this.input.value);638 }639 this.textSetValue=function(str) {640 for (var i=0;i<this.text.length;i++) {641 if (this.text[i].value==str) {642 this.textF.setWord({643 wordC:this.text[i].wordC,644 wordE:this.text[i].wordE,645 });646 this.textC=i;647 return;648 }649 }650 }651 this.textGetValue=function(typeP) {652 return(this.text[this.textC].value);653 }654 this.popBlockOnmouseover=function() {655 this.word.setTarget({transform:{translateX:3}});656 this.line.setTarget({opacity:1});657 }658 this.popBlockOnmouseout=function() {659 this.word.setTarget({transform:{translateX:0}});660 this.line.setTarget({opacity:0});661 }662 this.popBlockOnmousedown=function() {663 this.word.setTarget({transform:{translateX:1}});664 this.line.setTarget({opacity:1});665 }666 this.popBlockOnmouseup=function() {667 this.word.setTarget({transform:{translateX:3}});668 this.line.setTarget({opacity:1});669 }670 this.popBlockOnclick=function() {671 if (this.num==this.root.blockC) {672 if (this.root.status=="close") {673 this.root.open();674 } else {675 this.root.close();676 }677 } else {678 this.root.change(this.num);679 this.onmouseout();680 }681 }682 this.popBlockSetBlock=function(w) {683 this.blockC=w;684 this.content.appendChild(this.block[w]);685 this.block[w].set({style:{686 opacity:1,687 left:0,688 pointerEvents:"auto",689 }});690 this.block[w].bottom.set({style:{opacity:0}});691 for (var i=0;i<this.block.length;i++) {692 if (i==w) continue;693 this.block[i].set({style:{694 opacity:0,695 left:0,696 pointerEvents:"none",697 }});698 }699 }700 this.popBlockOpen=function() {701 this.status="open";702 var x0=Math.round(ASGetElementWidth(this.block[this.blockC].word)+this.size*0.8);703 for (var i=0;i<this.block.length;i++) {704 this.block[i].bottom.setTarget({opacity:1});705 if (i==this.blockC) continue;706 this.block[i].setTarget({707 left:x0,708 opacity:1,709 });710 this.block[i].set({style:{711 pointerEvents:"auto",712 }});713 x0=Math.round(x0+ASGetElementWidth(this.block[i].word)+this.size*0.8);714 }715 }716 this.popBlockClose=function() {717 this.status="close";718 for (var i=0;i<this.block.length;i++) {719 this.block[i].bottom.setTarget({opacity:0});720 if (i==this.blockC) continue;721 this.block[i].setTarget({722 left:0,723 opacity:0,724 });725 this.block[i].set({style:{726 pointerEvents:"none",727 }});728 this.block[i].onmouseout();729 }730 }731 this.popBlockChange=function(w) {732 this.status="close";733 this.blockC=w;734 this.content.appendChild(this.block[w]);735 for (var i=0;i<this.block.length;i++) {736 this.block[i].bottom.setTarget({opacity:0});737 if (i==this.blockC) {738 this.block[i].setTarget({739 left:0,740 opacity:1,741 });742 this.block[i].set({style:{743 pointerEvents:"auto",744 }});745 continue;746 }747 this.block[i].setTarget({748 left:0,749 opacity:0,750 });751 this.block[i].set({style:{752 pointerEvents:"none",753 }});754 }755 }756 this.popBlockSetValue=function(str) {757 for (var i=0;i<this.block.length;i++) {758 if (this.block[i].value==str) {759 this.setBlock(i);760 return;761 }762 }763 return(false);764 }765 this.popBlockGetValue=function() {766 return(this.block[this.blockC].value);767 }768 this.radioPointOnmouseover=function() {769 this.setTarget({transform:{scale:1.2}});770 }771 this.radioPointOnmouseout=function() {772 this.setTarget({transform:{scale:1}});773 }774 this.radioPointOnmousedown=function() {775 this.setTarget({transform:{scale:0.9}});776 }777 this.radioPointOnmouseup=function() {778 this.setTarget({transform:{scale:1.2}});779 }780 this.radioPointOnclick=function() {781 this.root.setBlock(this.num);782 if (this.root.onchoose) this.root.onchoose();783 }784 this.radioPointSetBlock=function(w) {785 this.blockC=w;786 for (var i=0;i<this.block.length;i++) {787 if (i==w) continue;788 this.block[i].point.pic.setTarget({opacity:0});789 }790 this.block[w].point.pic.setTarget({opacity:1});791 }792 this.radioPointSetValue=function(str) {793 for (var i=0;i<this.block.length;i++) {794 if (this.block[i].value==str) {795 this.setBlock(i);796 return;797 }798 }799 return(false);800 }801 this.radioPointGetValue=function() {802 return(this.block[this.blockC].value);803 }804 this.checkBoxOnmouseover=function() {805 this.setTarget({transform:{scale:1.1}});806 }807 this.checkBoxOnmouseout=function() {808 this.setTarget({transform:{scale:1}});809 }810 this.checkBoxOnmousedown=function() {811 this.setTarget({transform:{scale:0.95}});812 }813 this.checkBoxOnmouseup=function() {814 this.setTarget({transform:{scale:1.1}});815 }816 this.checkBoxOnclick=function() {817 this.root.changeABlock(this.num);818 if (this.root.block[this.num].wChosen) {819 for (var i=0;i<this.root.block.length;i++) {820 if (this.root.block[i].belong==this.root.block[this.num].value) {821 this.root.chooseABlock(i);822 }823 }824 } else {825 for (var i=0;i<this.root.block.length;i++) {826 if (this.root.block[i].belong==this.root.block[this.num].value) {827 this.root.cancelABlock(i);828 }829 }830 }831 if (this.root.onchoose) this.root.onchoose();832 }833 this.checkBoxChangeABlock=function(w) {834 if (this.block[w].wChosen) {835 this.cancelABlock(w);836 } else {837 this.chooseABlock(w);838 }839 }840 this.checkBoxChooseABlock=function(w) {841 if (typeof(w)=="string") {842 for (var i=0;i<this.block.length;i++) {843 if (this.block[i].value==w) break;844 }845 if (i>=this.block.length) return;846 w=i;847 }848 if (this.block[w].wChosen) return;849 this.block[w].wChosen=true;850 this.block[w].point.pic.setTarget({opacity:1});851 if (this.block[w].belong) {852 var yes=true;853 for (var i=0;i<this.block.length;i++) {854 if (this.block[i].belong==this.block[w].belong && !this.block[i].wChosen) {855 yes=false;856 break;857 }858 }859 if (yes) {860 this.chooseABlock(this.block[w].belong);861 }862 }863 }864 this.checkBoxCancelABlock=function(w) {865 if (typeof(w)=="string") {866 for (var i=0;i<this.block.length;i++) {867 if (this.block[i].value==w) break;868 }869 if (i>=this.block.length) return;870 w=i;871 }872 if (!this.block[w].wChosen) return;873 this.block[w].wChosen=false;874 this.block[w].point.pic.setTarget({opacity:0});875 if (this.block[w].belong) {876 this.cancelABlock(this.block[w].belong);877 }878 }879 this.checkBoxSetValue=function(a) {880 if (typeof(a)!="object") {881 this.chooseABlock(a);882 return;883 }884 var w=[];885 for (var i=0;i<this.block.length;i++) {886 this.cancelABlock(i);887 }888 for (var i=0;i<a.length;i++) {889 this.chooseABlock(a[i]);890 }891 }892 this.checkBoxGetValue=function() {893 var a=[];894 for (var i=0;i<this.block.length;i++) {895 if (this.block[i].wChosen) a[a.length]=this.block[i].value;896 }897 return(a);898 }899 }900 function BasicInput(buildP) {901 var buildP1={};902 if (buildP.model=="nickname") {903 buildP1.type="input";904 buildP1.wordC="æ± ç¨±";905 buildP1.wordE="Nickname";906 buildP1.hintC="æ²æ³å¥½- -";907 buildP1.hintE="Undefined";908 buildP1.maxLength=50;909 buildP1.wrong=[{910 wordC:"太é·äº",911 wordE:"It's too long",912 judge:function() {913 if (encodeWord(this.value).length>50) return(true);914 return(false);915 },916 }];917 }918 if (buildP.model=="name") {919 buildP1.type="input";920 buildP1.wordC="å§ å";921 buildP1.wordE="Name";922 buildP1.hintC="ä¸åè¨´ä½ â â";923 buildP1.hintE="Undefined";924 buildP1.maxLength=30;925 buildP1.wrong=[{926 wordC:"太é·äº",927 wordE:"It's too long",928 judge:function() {929 if (encodeWord(this.value).length>30) return(true);930 return(false);931 },932 }];933 }934 if (buildP.model=="place") {935 buildP1.type="text";936 buildP1.wordC="身 份";937 buildP1.wordE="Status";938 buildP1.wReadonly=true;939 buildP1.text=[{940 wordC:"æ å",941 wordE:"Friend",942 value:"N",943 },{944 wordC:"æå¡æå",945 wordE:"Member",946 value:"m",947 },{948 wordC:"æå¡æåï¼åå¹´ï¼",949 wordE:"Full Member",950 value:"M",951 },{952 wordC:"é屬å·è¡å§å¡ææå¡",953 wordE:"Subcom",954 value:"S",955 },{956 wordC:"å·è¡å§å¡ææå¡",957 wordE:"Exco",958 value:"E",959 }];960 }961 if (buildP.model=="sex") {962 buildP1.type="popBlock";963 buildP1.wordC="æ§ å¥";964 buildP1.wordE="Gender";965 buildP1.block=[{966 wordC:"æ¼¢ å",967 wordE:"Male",968 value:"M",969 },{970 wordC:"妹 å",971 wordE:"Female",972 value:"F",973 },{974 wordC:"ä¿ å¯",975 wordE:"Secret",976 color:"rgba(150,150,150,0.8)",977 value:"U",978 }];979 buildP1.firstBlock=2;980 }981 if (buildP.model=="studentID") {982 buildP1.type="input";983 buildP1.wordC="å¸ è";984 buildP1.wordE="StudentID";985 buildP1.hintC="ä¿ å¯";986 buildP1.hintE="Secret";987 buildP1.maxLength=8;988 buildP1.wrong=[{989 wordC:"åªè½æ¯æ¸åå¢",990 wordE:"Should be 0~9",991 judge:function() {992 for (var i=0;i<this.value.length;i++) {993 if (this.value.charCodeAt(i)<48 || this.value.charCodeAt(i)>57) return(true);994 }995 return(false);996 }997 },{998 wordC:"éè¦8ä½æ°å",999 wordE:"Should be 8 numbers",1000 type:"onblur",1001 judge:function() {1002 if (this.value.length!=0 && this.value.length!=8) return(true);1003 return(false);1004 }1005 }];1006 }1007 if (buildP.model=="school") {1008 buildP1.type="popBlock";1009 buildP1.wordC="å¸ é¢";1010 buildP1.wordE="School";1011 buildP1.block=[{1012 wordC:"SBM",1013 wordE:"SBM",1014 value:"SBM",1015 },{1016 wordC:"SENG",1017 wordE:"SENG",1018 value:"SENG",1019 },{1020 wordC:"SSCI",1021 wordE:"SSCI",1022 value:"SSCI",1023 },{1024 wordC:"SHSS",1025 wordE:"SHSS",1026 value:"SHSS",1027 },{1028 wordC:"IPO",1029 wordE:"IPO",1030 value:"IPO",1031 },{1032 wordC:"ä¿ å¯",1033 wordE:"Secret",1034 color:"rgba(150,150,150,0.8)",1035 value:"",1036 }];1037 buildP1.firstBlock=5;1038 }1039 if (buildP.model=="phone") {1040 buildP1.type="input";1041 buildP1.wordC="é» è©±";1042 buildP1.wordE="Phone";1043 buildP1.hintC="ä¿ å¯";1044 buildP1.hintE="Secret";1045 buildP1.maxLength=8;1046 buildP1.wrong=[{1047 wordC:"åªè½æ¯æ¸åå¢",1048 wordE:"Should be 0~9",1049 judge:function() {1050 for (var i=0;i<this.value.length;i++) {1051 if (this.value.charCodeAt(i)<48 || this.value.charCodeAt(i)>57) return(true);1052 }1053 return(false);1054 }1055 },{1056 wordC:"éè¦8ä½æ°å",1057 wordE:"Should be 8 numbers",1058 type:"onblur",1059 judge:function() {1060 if (this.value.length!=0 && this.value.length!=8) return(true);1061 return(false);1062 }1063 }];1064 }1065 if (buildP.model=="lang") {1066 buildP1.type="radioPoint";1067 buildP1.wordC="è¯ è¨<br>Language";1068 buildP1.wordE="è¯ è¨<br>Language";1069 buildP1.widthB=1000;1070 buildP1.block=[{1071 wordC:"ä¸æ",1072 wordE:"ä¸æ",1073 value:"C",1074 },{1075 wordC:"English",1076 wordE:"English",1077 value:"E",1078 }];1079 buildP1.onchoose=function() {1080 setLang(this.block[this.blockC].value);1081 addACookie("cfas_lang",this.getValue(),30*365*24*60);1082 }1083 }1084 if (buildP.model=="itsc") {1085 buildP1.type="input";1086 buildP1.wordC="ITSC";1087 buildP1.hintC="ä¾å¦ï¼fwuae";1088 buildP1.hintE="E.g. fwuae";1089 buildP1.wrong=[{1090 wordC:"åªè½æ¯å°å¯«åæ¯å¢",1091 wordE:"Should be 'a'-'z'",1092 judge:function() {1093 for (var i=0;i<this.value.length;i++) {1094 if (this.value.charCodeAt(i)<97 || this.value.charCodeAt(i)>122) return(true);1095 }1096 return(false);1097 },1098 },{1099 type:"onblur",1100 wordC:"å¿
å¡«",1101 wordE:"Compulsory",1102 judge:function() {1103 if (this.value.length==0) return(true);1104 return(false);1105 },1106 }];1107 }1108 if (buildP.model=="payway") {1109 buildP1.type="text";1110 buildP1.wordC="ä»æ¬¾æ¹å¼";1111 buildP1.wordE="How to pay";1112 buildP1.text=[{1113 wordC:"æ¼æ°èæ«æª¯ä»æ¬¾",1114 wordE:"Pay on CFAS counter",1115 value:"E",1116 },{1117 wordC:"交äºçæçæ°èExco",1118 wordE:"Pay to our Exco",1119 value:"N",1120 }];1121 }1122 if (buildP.model=="excoList") {1123 buildP1.type="radioPoint";1124 buildP1.block=[];1125 var data=ASGetSourceByName("data0").getNodeByName("exco14");1126 for (var i=0;i<data.node.length;i++) {1127 buildP1.block[i]={1128 wordC:data.node[i].getAttribute("nameC"),1129 wordE:data.node[i].getAttribute("nameE"),1130 value:data.node[i].getAttribute("itsc"),1131 }1132 }1133 }1134 for (var item in buildP1) {1135 if (!(item in buildP)) buildP[item]=buildP1[item];1136 }1137 if (!buildP.type) buildP.type="input";1138 if (!buildP.size) buildP.size=24;1139 if (!buildP.widthL) {1140 if (buildP.wordC || buildP.wordE) buildP.widthL=150;1141 }1142 if (!buildP.widthA) buildP.widthA=DEFAULT_PAGE_WIDTHL;1143 var target=ASElement({1144 nodeName:"div",1145 style:{1146 position:"relative",1147 width:buildP.widthA,1148 },1149 });1150 if (buildP.wordC || buildP.wordE) {1151 if (!buildP.colorW) buildP.colorW="rgb(200,0,0)";1152 if (!buildP.sizeW) buildP.sizeW=buildP.size*0.9;1153 target.word=BasicWord({1154 size:buildP.size,1155 wordC:buildP.wordC,1156 wordE:buildP.wordE,1157 });1158 var height1=target.word.heightA;1159 target.word=BasicWord({1160 size:buildP.sizeW,1161 color:buildP.colorW,1162 wordC:buildP.wordC,1163 wordE:buildP.wordE,1164 giveupExtra:true,1165 style:{1166 position:"absolute",1167 },1168 });1169 var height2=target.word.heightA;1170 target.word.set({style:{1171 top:(height1-height2),1172 }});1173 if (buildP.widthL!=0) {1174 target.word.set({style:{1175 width:buildP.widthL,1176 }});1177 }1178 target.appendChild(target.word);1179 }1180 var width1=buildP.widthA-buildP.widthL-10;1181 if (buildP.widthL==0 && target.word) width1=buildP.widthA-target.word.widthA-10;1182 if (buildP.wBr || (!target.word && !buildP.widthL)) width1=buildP.widthA;1183 var top=0;1184 if (buildP.wBr) top=ASGetElementHeight(target.word)*1.2;1185 target.content=ASElement({1186 nodeName:"div",1187 style:{1188 position:"relative",1189 marginTop:top,1190 left:buildP.widthA-width1,1191 width:width1,1192 },1193 });1194 target.appendChild(target.content);1195 if (buildP.type=="input") {1196 if (!buildP.wrong) buildP.wrong=[];1197 if (buildP.wCompulsory) {1198 buildP.wrong[buildP.wrong.length]={1199 wordC:"å¿
å¡«",1200 wordE:"Compulsory",1201 type:"onblur",1202 judge:function() {1203 if (this.value.length==0) return(true);1204 return(false);1205 },1206 };1207 };1208 target.alarm=ASElement({1209 nodeName:"div",1210 style:{1211 position:"absolute",1212 backgroundColor:"rgba(255,0,0,0.3)",1213 marginTop:-1,1214 left:-3,1215 opacity:0,1216 maxWidth:width1+6,1217 pointerEvents:"none",1218 },1219 });1220 target.content.appendChild(target.alarm);1221 if (buildP.hintC || buildP.hintE) {1222 if (!buildP.hintColor) buildP.hintColor="rgba(150,150,150,0.8)";1223 target.hint=BasicWord({1224 position:"absolute",1225 left:0,1226 top:0,1227 size:buildP.size,1228 color:buildP.hintColor,1229 wordC:buildP.hintC,1230 wordE:buildP.hintE,1231 width:"max",1232 giveupExtra:true,1233 style:{1234 position:"absolute",1235 pointerEvents:"none",1236 },1237 });1238 target.content.appendChild(target.hint);1239 }1240 target.input=ASElement({1241 nodeName:"input",1242 type:"text",1243 style:{1244 fontSize:buildP.size,1245 fontFamily:DEFAULT_FONT,1246 width:width1,1247 borderStyle:"none",1248 outline:"none",1249 backgroundColor:"rgba(0,0,0,0)",1250 },1251 root:target,1252 onfocus:BasicInputStr.inputOnfocus,1253 onblur:BasicInputStr.inputOnblur,1254 oninput:BasicInputStr.inputOninput,1255 });1256 target.content.appendChild(target.input);1257 if (buildP.wReadonly) target.input.set({readOnly:true});1258 if (buildP.maxLength) target.input.set({maxLength:buildP.maxLength});1259 if (buildP.onblur) {1260 target.onblur1=buildP.onblur;1261 delete buildP.onblur;1262 }1263 target.alarm.set({style:{height:ASGetElementHeight(target.input)}});1264 if (!buildP.noticeColor) buildP.noticeColor="rgb(130,130,130)";1265 target.notice=BasicWord({1266 size:buildP.size*0.8,1267 color:buildP.noticeColor,1268 wordC:"​",1269 wordE:"​",1270 width:"max",1271 style:{1272 position:"absolute",1273 pointerEvents:"none",1274 },1275 });1276 target.notice.set({style:{1277 top:target.notice.heightA/4,1278 }});1279 target.content.appendChild(target.notice);1280 target.clearWrong=BasicInputStr.inputClearWrong;1281 target.check=BasicInputStr.inputCheck;1282 target.setValue=BasicInputStr.inputSetValue;1283 target.getValue=BasicInputStr.inputGetValue;1284 target.focus=BasicInputStr.inputFocus;1285 }1286 if (buildP.type=="text") {1287 target.textF=BasicWord({1288 width:"max",1289 size:buildP.size,1290 wordC:buildP.text[0].wordC,1291 wordE:buildP.text[0].wordE,1292 giveupExtra:true,1293 });1294 target.content.appendChild(target.textF);1295 if (buildP.wReadonly) target.textF.set({1296 style:{cursor:"default"},1297 });1298 target.textC=0;1299 target.setValue=BasicInputStr.textSetValue;1300 target.getValue=BasicInputStr.textGetValue;1301 }1302 if (buildP.type=="popBlock") {1303 target.filler=BasicWord({1304 size:buildP.size,1305 wordC:"​",1306 giveupExtra:true,1307 style:{1308 pointerEvents:"none",1309 },1310 });1311 target.content.appendChild(target.filler);1312 target.block=[];1313 target.status="close";1314 for (var i=0;i<buildP.block.length;i++) {1315 target.block[i]=ASElement({1316 nodeName:"div",1317 style:{1318 position:"absolute",1319 opacity:0,1320 left:0,1321 cursor:"pointer",1322 },1323 onmouseover:BasicInputStr.popBlockOnmouseover,1324 onmouseout:BasicInputStr.popBlockOnmouseout,1325 onmousedown:BasicInputStr.popBlockOnmousedown,1326 onmouseup:BasicInputStr.popBlockOnmouseup,1327 onclick:BasicInputStr.popBlockOnclick,1328 num:i,1329 root:target,1330 value:buildP.block[i].value,1331 });1332 var block=target.block[i];1333 target.content.appendChild(block);1334 if (!buildP.block[i].color) buildP.block[i].color="black";1335 block.word=BasicWord({1336 size:buildP.size,1337 wordC:buildP.block[i].wordC,1338 wordE:buildP.block[i].wordE,1339 color:buildP.block[i].color,1340 width:"max",1341 giveupExtra:true,1342 ignoreM:true,1343 style:{1344 position:"absolute",1345 cursor:"pointer",1346 },1347 });1348 block.appendChild(block.word);1349 block.bottom=ASElement({1350 nodeName:"div",1351 style:{1352 position:"relative",1353 left:-buildP.size*0.4,1354 width:buildP.size*0.15,1355 height:block.word.heightA,1356 backgroundColor:"rgba(150,150,150,0.8)",1357 },1358 });1359 block.appendChild(block.bottom);1360 block.line=ASElement({1361 nodeName:"div",1362 style:{1363 position:"absolute",1364 left:-buildP.size*0.4,1365 width:buildP.size*0.15,1366 height:block.word.heightA,1367 backgroundColor:"rgb(230,0,0)",1368 opacity:0,1369 },1370 });1371 block.appendChild(block.line);1372 }1373 if (!buildP.firstBlock) buildP.firstBlock=0;1374 target.setBlock=BasicInputStr.popBlockSetBlock;1375 target.setBlock(buildP.firstBlock);1376 target.open=BasicInputStr.popBlockOpen;1377 target.close=BasicInputStr.popBlockClose;1378 target.change=BasicInputStr.popBlockChange;1379 target.setValue=BasicInputStr.popBlockSetValue;1380 target.getValue=BasicInputStr.popBlockGetValue;1381 delete buildP.block;1382 }1383 if (buildP.type=="radioPoint") {1384 target.block=[];1385 if (buildP.col) buildP.widthB=width1/buildP.col;1386 if (!buildP.space && !buildP.widthB) buildP.space=buildP.size*2;1387 if (buildP.space) target.content.set({style:{width:width1+buildP.space}});1388 for (var i=0;i<buildP.block.length;i++) {1389 target.block[i]=ASElement({1390 nodeName:"div",1391 value:buildP.block[i].value,1392 num:i,1393 style:{1394 position:"relative",1395 left:buildP.size,1396 },1397 });1398 target.content.appendChild(target.block[i]);1399 if (buildP.space) target.block[i].set({style:{marginRight:buildP.space}});1400 if (buildP.widthB) target.block[i].set({style:{width:buildP.widthB}});1401 var block=target.block[i];1402 if (!buildP.block[i].color) buildP.block[i].color="black";1403 block.word=BasicWord({1404 size:buildP.size,1405 wordC:buildP.block[i].wordC,1406 wordE:buildP.block[i].wordE,1407 color:buildP.block[i].color,1408 ignoreM:true,1409 width:"max",1410 giveupExtra:true,1411 });1412 block.appendChild(block.word);1413 block.point=ASElement({1414 nodeName:"div",1415 root:target,1416 num:i,1417 style:{1418 position:"absolute",1419 left:-buildP.size*1,1420 bottom:buildP.size*0.25,1421 borderRadius:buildP.size*0.7,1422 width:buildP.size*0.7,1423 height:buildP.size*0.7,1424 cursor:"pointer",1425 boxShadow:"0 0 0px "+buildP.size*0.1+"px rgba(150,150,150,0.8) inset",1426 },1427 onmouseover:BasicInputStr.radioPointOnmouseover,1428 onmouseout:BasicInputStr.radioPointOnmouseout,1429 onmousedown:BasicInputStr.radioPointOnmousedown,1430 onmouseup:BasicInputStr.radioPointOnmouseup,1431 onclick:BasicInputStr.radioPointOnclick,1432 });1433 block.appendChild(block.point);1434 block.point.pic=ASElement({1435 nodeName:"img",1436 src:ASGetSrcByName("radioPoint"),1437 style:{1438 width:"100%",1439 height:"100%",1440 opacity:0,1441 },1442 });1443 block.point.appendChild(block.point.pic);1444 }1445 if (!buildP.firstBlock) buildP.firstBlock=0;1446 target.setBlock=BasicInputStr.radioPointSetBlock;1447 target.setValue=BasicInputStr.radioPointSetValue;1448 target.getValue=BasicInputStr.radioPointGetValue;1449 target.onchoose=buildP.onchoose;1450 target.setBlock(buildP.firstBlock);1451 delete buildP.block;1452 }1453 if (buildP.type=="checkBox") {1454 target.block=[];1455 if (buildP.col) buildP.widthB=width1/buildP.col;1456 if (!buildP.space && !buildP.widthB) buildP.space=buildP.size*2;1457 if (buildP.space) target.content.set({style:{width:width1+buildP.space}});1458 for (var i=0;i<buildP.block.length;i++) {1459 target.block[i]=ASElement({1460 nodeName:"div",1461 value:buildP.block[i].value,1462 belong:buildP.block[i].belong,1463 num:i,1464 style:{1465 position:"relative",1466 left:buildP.size,1467 },1468 });1469 target.content.appendChild(target.block[i]);1470 if (buildP.space) target.block[i].set({style:{marginRight:buildP.space}});1471 if (buildP.widthB) target.block[i].set({style:{width:buildP.widthB}});1472 var block=target.block[i];1473 if (!buildP.block[i].color) buildP.block[i].color="black";1474 block.word=BasicWord({1475 size:buildP.size,1476 wordC:buildP.block[i].wordC,1477 wordE:buildP.block[i].wordE,1478 color:buildP.block[i].color,1479 ignoreM:true,1480 width:"max",1481 giveupExtra:true,1482 });1483 block.appendChild(block.word);1484 block.point=ASElement({1485 nodeName:"div",1486 root:target,1487 num:i,1488 style:{1489 position:"absolute",1490 left:-buildP.size*1,1491 bottom:buildP.size*0.25,1492 borderRadius:buildP.size*0.15,1493 width:buildP.size*0.7,1494 height:buildP.size*0.7,1495 cursor:"pointer",1496 boxShadow:"0 0 0px "+buildP.size*0.1+"px rgba(150,150,150,0.8) inset",1497 },1498 onmouseover:BasicInputStr.checkBoxOnmouseover,1499 onmouseout:BasicInputStr.checkBoxOnmouseout,1500 onmousedown:BasicInputStr.checkBoxOnmousedown,1501 onmouseup:BasicInputStr.checkBoxOnmouseup,1502 onclick:BasicInputStr.checkBoxOnclick,1503 });1504 block.appendChild(block.point);1505 block.point.pic=ASElement({1506 nodeName:"img",1507 src:ASGetSrcByName("checkBox"),1508 style:{1509 width:"100%",1510 height:"100%",1511 opacity:0,1512 },1513 });1514 block.point.appendChild(block.point.pic);1515 }1516 target.changeABlock=BasicInputStr.checkBoxChangeABlock;1517 target.chooseABlock=BasicInputStr.checkBoxChooseABlock;1518 target.cancelABlock=BasicInputStr.checkBoxCancelABlock;1519 target.getValue=BasicInputStr.checkBoxGetValue;1520 target.onchoose=buildP.onchoose;1521 delete buildP.block;1522 }1523 target.set(buildP);1524 if (buildP.value) target.setValue(buildP.value);1525 return(target);1526 }1527 var BasicSelectStr=new function() {1528 this.entryOnmousedown=function() {1529 this.root.downTimeS=ASGetTime();1530 this.wDown=true;1531 if (this.root.pressTime) this.setTimeout(this.onclick,this.root.pressTime);1532 }1533 this.entryOnmouseup=function() {1534 this.setTimeout(function() {this.wDown=false;},0);1535 }1536 this.entryOnclick=function() {1537 if (!this.wDown) return;1538 if (this.root.pressTime && ASGetTime()-this.root.downTimeS<this.root.pressTime) {1539 if (this.root.entryOnclick) this.root.entryOnclick();1540 if (this.root.wOpen) {1541 this.root.close();1542 }1543 } else {1544 if (!this.root.wOpen1545 || (this.root.pressTime && ASGetTime()-this.root.downTimeS>=this.root.pressTime)) {1546 this.root.open();1547 } else {1548 this.root.close();1549 }1550 }1551 }1552 this.blockOnmouseover=function() {1553 this.bottom.setTarget({opacity:1});1554 this.setTarget({transform:{scale:1}});1555 }1556 this.blockOnmouseout=function() {1557 this.bottom.setTarget({opacity:0});1558 this.setTarget({transform:{scale:1}});1559 }1560 this.blockOnmousedown=function() {1561 this.bottom.setTarget({opacity:1});1562 this.setTarget({transform:{scale:0.9}});1563 }1564 this.blockOnmouseup=function() {1565 this.bottom.setTarget({opacity:0});1566 this.setTarget({transform:{scale:1}});1567 }1568 this.blockOnclick=function() {1569 this.root.value=this.value;1570 this.root.blockC=this.num;1571 this.root.close();1572 if (this.root.onchoose) this.root.onchoose();1573 }1574 this.onmouseoutdown=function() {1575 this.close();1576 }1577 this.open=function() {1578 if (this.wOpen) return;1579 this.wOpen=true;1580 this.appendChild(this.menuF);1581 this.menuF.set({style:{opacity:0}});1582 this.menuF.setTimeout(function() {this.setTarget({opacity:1});},10);1583 if (this.onopen) this.onopen();1584 }1585 this.close=function() {1586 this.wOpen=false;1587 this.menuF.setTarget({opacity:0});1588 this.menuF.setTimeout(function() {1589 if (!this.root.wOpen) {1590 this.root.removeChild(this);1591 }1592 },150);1593 if (this.onclose) this.onclose();1594 }1595 }1596 function BasicSelect(buildP) {1597 if (!buildP.fx) buildP.fx="down";1598 var target=ASElement({1599 nodeName:"div",1600 style:{1601 position:"relative",1602 },1603 });1604 target.fx=buildP.fx;1605 target.wOpen=false;1606 target.blockC=-1;1607 target.value="";1608 if (buildP.firstBlock) {1609 target.blockC=buildP.firstBlock;1610 target.value=buildP.block[target.blockC].value;1611 }1612 ASOutdownList[ASOutdownList.length]=target;1613 target.onmouseoutdown=BasicSelectStr.onmouseoutdown;1614 target.entryF=ASElement({1615 nodeName:"div",1616 root:target,1617 onmousedown:BasicSelectStr.entryOnmousedown,1618 onmouseup:BasicSelectStr.entryOnmouseup,1619 onclick:BasicSelectStr.entryOnclick,1620 style:{1621 cursor:"pointer",1622 },1623 });1624 target.appendChild(target.entryF);1625 target.entry=buildP.entry;1626 target.entryF.appendChild(target.entry);1627 if (buildP.entryOnclick) {1628 if (!buildP.pressTime) buildP.pressTime=300;1629 }1630 if (!buildP.col) buildP.col=1;1631 target.col=buildP.col;1632 target.menuF=ASElement({1633 nodeName:"div",1634 style:{1635 position:"absolute",1636 },1637 root:target,1638 });1639 switch (target.fx) {1640 case "up": target.menuF.set({style:{bottom:ASGetElementHeight(target.entry)*1.1,left:0}}); break;1641 case "down": target.menuF.set({style:{top:ASGetElementHeight(target.entry)*1.1,left:0}}); break;1642 case "upRight": target.menuF.set({style:{bottom:ASGetElementHeight(target.entry)*1.1,right:0}}); break;1643 }1644 if (!buildP.widthA) {1645 buildP.widthA=0;1646 for (var i=0;i<buildP.block.length;i++) {1647 buildP.widthA=Math.max(buildP.widthA,ASGetElementWidth(buildP.block[i]));1648 }1649 buildP.widthA++;1650 }1651 if (!buildP.heightA) {1652 buildP.heightA=0;1653 var h1=0;1654 for (var i=0;i<buildP.block.length;i++) {1655 h1=Math.max(ASGetElementHeight(buildP.block[i]),h1);1656 if ((i+1)%target.col==0) {1657 buildP.heightA+=h1+0.5;1658 h1=0;1659 }1660 }1661 }1662 if (!buildP.BGC) buildP.BGC="rgb(250,250,250)";1663 if (!buildP.menuPadding) buildP.menuPadding=0;1664 target.menu=BasicScroll({1665 widthA:buildP.widthA*target.col+buildP.menuPadding*2,1666 heightA:buildP.heightA+buildP.menuPadding*2,1667 style:{1668 boxShadow:"0 0 10px rgba(0,0,0,0.8)",1669 backgroundColor:buildP.BGC,1670 },1671 });1672 target.menuF.appendChild(target.menu);1673 target.menu.container.set({style:{padding:buildP.menuPadding}});1674 if (!buildP.align) buildP.align="left";1675 target.menu.block=[];1676 for (var i=0;i<buildP.block.length;i++) {1677 target.menu.block[i]=ASElement({1678 nodeName:"div",1679 style:{1680 position:"relative",1681 width:buildP.widthA,1682 },1683 root:target,1684 value:buildP.block[i].value,1685 });1686 target.menu.container.appendChild(target.menu.block[i]);1687 if (!buildP.giveupMenuExtra && !buildP.block[i].giveupMenuExtra) {1688 target.menu.block[i].set({1689 style:{1690 cursor:"pointer",1691 },1692 onmouseover:BasicSelectStr.blockOnmouseover,1693 onmouseout:BasicSelectStr.blockOnmouseout,1694 onmousedown:BasicSelectStr.blockOnmousedown,1695 onmouseup:BasicSelectStr.blockOnmouseup,1696 onclick:BasicSelectStr.blockOnclick,1697 });1698 }1699 var block=target.menu.block[i];1700 block.bottom=ASElement({1701 nodeName:"div",1702 style:{1703 position:"absolute",1704 width:"100%",1705 height:"100%",1706 backgroundColor:"rgba(200,0,0,0.2)",1707 opacity:0,1708 },1709 });1710 block.appendChild(block.bottom);1711 block.content=buildP.block[i];1712 block.appendChild(buildP.block[i]);1713 buildP.block[i].set({style:{position:"absolute"}});1714 switch (buildP.align) {1715 case "left": break;1716 case "center": buildP.block[i].set({wCenter:true}); break;1717 }1718 block.set({style:{height:ASGetElementHeight(buildP.block[i])}});1719 if (!buildP.giveupMenuExtra && !buildP.block[i].giveupMenuExtra && !buildP.block[i].giveupMenuImg) {1720 block.region=ASElement({1721 nodeName:"img",1722 src:ASGetSrcByName("editorToolRegion"),1723 style:{1724 position:"absolute",1725 width:"100%",1726 height:"100%",1727 },1728 ondragstart:banFunction,1729 });1730 block.appendChild(block.region);1731 }1732 }1733 delete buildP.block;1734 if (buildP.menuP) target.menuF.set(buildP.menuP);1735 target.open=BasicSelectStr.open;1736 target.close=BasicSelectStr.close;1737 target.set(buildP);1738 return(target);1739 }1740 var BasicListStr=new function() {1741 this.titleOnmouseover=function() {1742 this.setTarget({transform:{translateY:-5}});1743 }1744 this.titleOnmouseout=function() {1745 this.setTarget({transform:{translateY:0}});1746 }1747 this.titleOnmousedown=function() {1748 this.setTarget({transform:{translateY:0}});1749 }1750 this.titleOnmouseup=function() {1751 this.setTarget({transform:{translateY:-5}});1752 }1753 this.titleOnclick=function() {1754 this.root.setKeyCol(this.name);1755 }1756 this.tideRow=function() {1757 var color1=["rgba(50,0,0,0.2)","rgba(0,0,0,0)"];1758 var color2=["rgba(255,255,255,0.8)","rgba(50,0,0,0.4)"];1759 for (var i=0;i<this.row.length;i++) {1760 this.row[i].set({style:{backgroundColor:color1[i%2]}});1761 for (var j=1;j<this.col.length;j++) {1762 this.row[i].line[j].set({style:{backgroundColor:color2[i%2]}});1763 }1764 }1765 }1766 this.addARow=function(data) {1767 this.row[this.row.length]=ASElement({1768 nodeName:"div",1769 style:{1770 position:"relative",1771 paddingTop:this.size*0.2,1772 paddingBottom:this.size*0.2,1773 width:this.widthA,1774 },1775 });1776 var row=this.row[this.row.length-1];1777 row.col=[];1778 row.colF=[];1779 row.line=[];1780 var heightA=0,x1=0;1781 for (var i=0;i<this.col.length;i++) {1782 row.colF[i]=ASElement({1783 nodeName:"div",1784 style:{1785 width:this.col[i].width,1786 }1787 });1788 row.appendChild(row.colF[i]);1789 var p=data[this.col[i].name];1790 p.size=this.size;1791 if (p.listType=="basicWord") {1792 if (!p.style) p.style={};1793 p.style.width="100%";1794 p.style.textAlign="center";1795 row.col[i]=BasicWord(p);1796 }1797 if (p.listType=="basicInput") {1798 row.col[i]=BasicInput(p);1799 if (!p.style) p.style={};1800 p.style.top=-this.size;1801 }1802 row.colF[i].appendChild(row.col[i]);1803 if (ASGetElementHeight(row.colF[i])>heightA) heightA=ASGetElementHeight(row.colF[i]);1804 if (i>0) {1805 row.line[i]=ASElement({1806 nodeName:"div",1807 style:{1808 position:"absolute",1809 width:1,1810 left:x1-0.5,1811 top:0,1812 },1813 });1814 row.appendChild(row.line[i]);1815 }1816 x1+=this.col[i].width;1817 }1818 for (var i=0;i<this.col.length;i++) {1819 row.colF[i].set({style:{transform:{1820 translateY:(ASGetElementHeight(row.colF[i])-heightA)/2,1821 }}});1822 if (i>0) row.line[i].set({style:{height:heightA+this.size*0.4}});1823 }1824 if (!this.keyCol) {1825 this.listF.appendChild(row);1826 this.listF.appendChild(ASElement("br"));1827 } else {1828 var k=-1;1829 for (var i=0;i<this.col.length;i++) {1830 if (this.col[i].name==this.keyCol) {1831 k=i;1832 break;1833 }1834 }1835 for (var i=this.row.length-1;i>0;i--) {1836 if (this.fx==1) {1837 if (this.row[i].col[k].getValue()>=this.row[i-1].col[k].getValue()) break;1838 } else {1839 if (this.row[i].col[k].getValue()<=this.row[i-1].col[k].getValue()) break;1840 }1841 var aa=this.row[i];1842 this.row[i]=this.row[i-1];1843 this.row[i-1]=aa;1844 }1845 if (i==this.row.length-1) {1846 this.listF.appendChild(row);1847 this.listF.appendChild(ASElement("br"));1848 } else {1849 this.listF.insertBefore(row,this.row[i+1]);1850 this.listF.insertBefore(ASElement("br"),this.row[i+1]);1851 }1852 }1853 this.tideRow();1854 }1855 this.clearRow=function() {1856 this.listF.clearChild();1857 this.row=[];1858 }1859 this.setKeyCol=function(name) {1860 if (this.keyCol==name) this.fx*=-1;1861 else this.fx=1;1862 this.keyCol=name;1863 var key=-1;1864 for (var i=0;i<this.col.length;i++) {1865 if (this.col[i].name==this.keyCol) {1866 key=i;1867 break;1868 }1869 }1870 for (var i=0;i<this.row.length-1;i++) {1871 var k=i;1872 for (var j=i+1;j<this.row.length;j++) {1873 if (this.fx==1) {1874 if (this.row[j].col[key].getValue()<this.row[k].col[key].getValue()) k=j;1875 } else {1876 if (this.row[j].col[key].getValue()>this.row[k].col[key].getValue()) k=j;1877 }1878 }1879 var aa=this.row[i];1880 this.row[i]=this.row[k];1881 this.row[k]=aa;1882 }1883 this.listF.clearChild();1884 for (var i=0;i<this.row.length;i++) {1885 this.listF.appendChild(this.row[i]);1886 this.listF.appendChild(ASElement("br"));1887 }1888 this.tideRow();1889 }1890 }1891 function BasicList(buildP) {1892 if (!buildP.size) buildP.size=24;1893 var target=ASElement({1894 nodeName:"div",1895 });1896 target.col=buildP.col;1897 target.widthA=0;1898 target.keyCol=null;1899 target.fx=1;1900 target.titleF=ASElement({1901 nodeName:"div",1902 style:{1903 position:"relative",1904 marginTop:buildP.size*0.3,1905 marginBottom:buildP.size*0.3,1906 },1907 });1908 target.appendChild(target.titleF);1909 target.titleF.word=[];1910 target.titleF.line=[];1911 for (var i=0;i<target.col.length;i++) {1912 target.titleF.word[i]=BasicWord({1913 size:buildP.size,1914 color:"rgb(230,0,0)",1915 wordC:target.col[i].wordC,1916 wordE:target.col[i].wordE,1917 ignoreM:true,1918 style:{1919 textAlign:"center",1920 width:target.col[i].width,1921 cursor:"pointer",1922 },1923 name:target.col[i].name,1924 root:target,1925 onmouseover:BasicListStr.titleOnmouseover,1926 onmouseout:BasicListStr.titleOnmouseout,1927 onmousedown:BasicListStr.titleOnmousedown,1928 onmouseup:BasicListStr.titleOnmouseup,1929 onclick:BasicListStr.titleOnclick,1930 });1931 target.titleF.appendChild(target.titleF.word[i]);1932 target.titleF.line[i]=ASElement({1933 nodeName:"div",1934 style:{1935 position:"absolute",1936 backgroundColor:"rgba(255,0,0,0.7)",1937 width:1,1938 left:target.widthA-0.5,1939 },1940 });1941 target.titleF.appendChild(target.titleF.line[i]);1942 target.widthA+=target.col[i].width;1943 }1944 target.titleF.set({style:{width:target.widthA}});1945 target.titleF.line[i]=ASElement({1946 nodeName:"div",1947 style:{1948 position:"absolute",1949 backgroundColor:"rgba(255,0,0,0.5)",1950 width:1,1951 left:target.widthA-0.5,1952 },1953 });1954 target.titleF.appendChild(target.titleF.line[i]);1955 var height=ASGetElementHeight(target.titleF);1956 for (var i=0;i<=target.col.length;i++) {1957 target.titleF.line[i].set({style:{height:height}});1958 }1959 target.set({style:{width:target.widthA}});1960 target.appendChild(ASElement("br"));1961 target.listF=ASElement({1962 nodeName:"div",1963 style:{1964 width:target.widthA,1965 },1966 });1967 target.appendChild(target.listF);1968 target.row=[];1969 target.tideRow=BasicListStr.tideRow;1970 target.addARow=BasicListStr.addARow;1971 target.clearRow=BasicListStr.clearRow;1972 target.setKeyCol=BasicListStr.setKeyCol;1973 target.set(buildP);1974 return(target);1975 }1976 var BasicScrollStr=new function() {1977 this.resize=function(typeP) {1978 if (typeP.widthA) {1979 this.set({style:{width:typeP.widthA}});1980 this.container.set({style:{width:typeP.widthA+DEFAULT_SCROLLBAR_WIDTH}});1981 this.context.set({style:{width:typeP.widthA}});1982 }1983 if (typeP.heightA) {1984 this.set({style:{height:typeP.heightA}});1985 this.container.set({style:{height:typeP.heightA}});1986 }1987 }1988 this.resizeT=function(typeP) {1989 if (typeP.widthA) {1990 this.setTarget({width:typeP.widthA});1991 this.container.setTarget({width:typeP.widthA+DEFAULT_SCROLLBAR_WIDTH});1992 this.context.setTarget({width:typeP.widthA});1993 }1994 if (typeP.heightA) {1995 this.setTarget({height:typeP.heightA});1996 this.container.setTarget({height:typeP.heightA});1997 }1998 }1999 this.changeScroll=function() {2000 if (this.targetScroll<0) return;2001 if (wSame(this.container.scrollTop,this.targetScroll,1)) {2002 this.targetScroll=-1;2003 return;2004 }2005 if (this.targetScroll>this.container.scrollTop) {2006 this.container.scrollTop+=Math.pow(this.targetScroll-this.container.scrollTop,0.65);2007 } else {2008 this.container.scrollTop-=Math.pow(this.container.scrollTop-this.targetScroll,0.65);2009 }2010 this.setTimeout(this.changeScroll,16);2011 }2012 this.scrollTo=function(s) {2013 if (s>this.container.scrollHeight-this.offsetHeight) {2014 s=this.container.scrollHeight-this.offsetHeight;2015 }2016 if (s<0) s=0;2017 if (this.targetScroll>0) {2018 this.targetScroll=s;2019 } else {2020 this.targetScroll=s;2021 this.changeScroll();2022 }2023 }2024 this.containerOnscroll=function() {2025 if (this.parentNode.onscroll) this.parentNode.onscroll();2026 }2027 this.onmousewheel=function() {2028 this.targetScroll=-1;2029 }2030 }2031 function BasicScroll(buildP) {2032 if (!buildP.widthA) buildP.widthA=0;2033 if (!buildP.heightA) buildP.heightA=0;2034 var target=ASElement({2035 nodeName:"div",2036 style:{2037 position:"relative",2038 overflow:"hidden",2039 width:buildP.widthA,2040 height:buildP.heightA,2041 },2042 onmousewheel:BasicScrollStr.onmousewheel,2043 });2044 target.targetScroll=-1;2045 target.container=ASElement({2046 nodeName:"div",2047 style:{2048 position:"relative",2049 overflowX:"hidden",2050 overflowY:"scroll",2051 width:buildP.widthA+DEFAULT_SCROLLBAR_WIDTH,2052 height:buildP.heightA,2053 },2054 onscroll:BasicScrollStr.containerOnscroll,2055 });2056 target.appendChild(target.container);2057 target.context=ASElement({2058 nodeName:"div",2059 style:{2060 width:buildP.widthA,2061 },2062 });2063 target.container.appendChild(target.context);2064 target.resize=BasicScrollStr.resize;2065 target.resizeT=BasicScrollStr.resizeT;2066 target.changeScroll=BasicScrollStr.changeScroll;2067 target.scrollTo=BasicScrollStr.scrollTo;2068 target.set(buildP);2069 return(target);2070 }2071 var BasicEditToolStr=new function() {2072 BasicEditToolList=[];2073 BasicEditToolIconList={2074 help:{2075 titleC:"幫å©",2076 titleE:"Help",2077 pos:0,2078 },2079 font:{2080 pos:1,2081 titleC:"åé«",2082 titleE:"Font",2083 onpressC:"é¸æ并æç¨åé«",2084 onpressE:"Select and apply a font",2085 onclickC:"æç¨ä¸ä¸æ¬¡é¸æçåé«",2086 onclickE:"Apply the font selected",2087 },2088 size:{2089 pos:2,2090 titleC:"åè",2091 titleE:"Size",2092 onpressC:"é¸æ并æç¨åè",2093 onpressE:"Select and apply a font size",2094 onclickC:"æç¨ä¸ä¸æ¬¡é¸æçåè",2095 onclickE:"Apply the font size selected",2096 },2097 bold:{2098 pos:3,2099 titleC:"å ç²",2100 titleE:"Bold",2101 onclickC:"使ç¨æåæ¶ç²é«",2102 onclickE:"Use or cancel bold",2103 },2104 italic:{2105 pos:4,2106 titleC:"å¾æ",2107 titleE:"Italic",2108 onclickC:"使ç¨æåæ¶æé«",2109 onclickE:"Use or cancel italics",2110 },2111 underline:{2112 pos:5,2113 titleC:"ä¸åç·",2114 titleE:"Underline",2115 onclickC:"使ç¨æåæ¶ä¸åç·",2116 onclickE:"Use or cancel underline",2117 },2118 colorW:{2119 pos:6,2120 titleC:"æåé¡è²",2121 titleE:"Font Color",2122 onpressC:"é¸æ并åºç¨æåé¡è²",2123 onpressE:"Select and apply a text color",2124 onclickC:"æç¨ä¸ä¸æ¬¡é¸æçæåé¡è²",2125 onclickE:"Apply the text color selected",2126 },2127 colorB:{2128 pos:7,2129 titleC:"èæ¯é¡è²",2130 titleE:"Back Color",2131 onpressC:"é¸æ并åºç¨èæ¯é¡è²",2132 onpressE:"Select and apply a background color",2133 onclickC:"æç¨ä¸ä¸æ¬¡é¸æçèæ¯é¡è²",2134 onclickE:"Apply the background color selected",2135 },2136 left:{2137 pos:8,2138 titleC:"åå·¦å°é½",2139 titleE:"Align Left",2140 onclickC:"åå·¦å°é½",2141 onclickE:"Align left",2142 },2143 center:{2144 pos:9,2145 titleC:"å±
ä¸å°é½",2146 titleE:"Align Center",2147 onclickC:"å±
ä¸",2148 onclickE:"Align center",2149 },2150 right:{2151 pos:10,2152 titleC:"åå³å°é½",2153 titleE:"Align Right",2154 onclickC:"åå³å°é½",2155 onclickE:"Align right",2156 },2157 full:{2158 pos:11,2159 titleC:"å
©éå°é½",2160 titleE:"Align on Both Side",2161 onclickC:"å
©éå°é½",2162 onclickE:"Align on both side",2163 },2164 divideline:{2165 pos:12,2166 titleC:"åå²ç·",2167 titleE:"Divide Line",2168 onclickC:"æ·»å ä¸æ¢åå²ç·",2169 onclickE:"Add a divide line",2170 },2171 img:{2172 pos:13,2173 titleC:"æå
¥åç",2174 titleE:"Insert Image",2175 onclickC:"æå
¥æ¬å°æ網絡åç",2176 onclickE:"Insert local or online image",2177 },2178 createlink:{2179 pos:14,2180 titleC:"è¶
éæ¥",2181 titleE:"Hyperlink",2182 onclickC:"å°é¸ä¸çæåä½çºè¶
éæ¥å°å",2183 onclickE:"Change the selected word to a hyperlink",2184 onpressC:"çºé¸ä¸çæåæ·»å è¶
éæ¥å°å",2185 onpressE:"Add a hyperlink for selected word",2186 },2187 unlink:{2188 pos:15,2189 titleC:"åæ¶è¶
éæ¥",2190 titleE:"Cancel Hyperlink",2191 onclickC:"åæ¶è¶
éæ¥",2192 onclickE:"Cancel the hyperlink",2193 },2194 }2195 this.iconOnmouseover=function() {2196 this.light.setTarget({opacity:1});2197 }2198 this.iconOnmouseout=function() {2199 this.light.setTarget({opacity:0});2200 }2201 this.iconOnmousedown=function() {2202 this.light.setTarget({opacity:1,transform:{scale:0.9}});2203 this.pic.setTarget({transform:{scale:0.9}});2204 }2205 this.iconOnmouseup=function() {2206 this.light.setTarget({opacity:1,transform:{scale:1}});2207 this.pic.setTarget({transform:{scale:1}});2208 }2209 this.simpleOnclick=function() {2210 document.execCommand(this.action,false,"");2211 this.root.content.focus();2212 }2213 this.statusOnclick=function() {2214 document.execCommand(this.action,false,"");2215 this.root.content.updateSel();2216 if (!this.wDetect) {2217 this.wDetect=true;2218 this.icon.bottom.setTarget({opacity:1});2219 } else {2220 this.wDetect=false;2221 this.icon.bottom.setTarget({opacity:0});2222 }2223 this.root.content.focus();2224 }2225 this.statusDetectStatus=function() {2226 var yes=true;2227 for (var i=0;i<this.root.content.sel.node.length;i++) {2228 var yes2=0;2229 for (var c=this.root.content.sel.node[i];c!=this.root.content;c=c.parentNode) {2230 if (!c || c.nodeType!=1) continue;2231 if (c.nodeName==this.labelName) yes2=1;2232 if (c.style[this.styleName]==this.styleValue) yes2=1;2233 if (c.style[this.styleName] && c.style[this.styleName]!=this.styleValue) yes2=-1;2234 if (yes2!=0) break;2235 }2236 if (yes2!=1) {2237 yes=false;2238 break;2239 }2240 }2241 if (yes) {2242 this.wDetect=true;2243 this.icon.bottom.setTarget({opacity:1});2244 } else {2245 this.wDetect=false;2246 this.icon.bottom.setTarget({opacity:0});2247 }2248 }2249 this.sizeAction=function(node,value) {2250 node.style.fontSize=value+"px";2251 }2252 this.selectOnclick=function() {2253 this.onchoose();2254 }2255 this.selectOnchoose=function() {2256 if (typeof(this.action)=="string") {2257 document.execCommand(this.action,false,this.value);2258 } else {2259 this.root.content.advanceCommand(this.action,this.value);2260 }2261 this.root.content.focus();2262 }2263 this.sizeOnchoose=function() {2264 if (this.root.content.sel && this.root.content.sel.isCollapsed) {2265 var aa=ASElement({2266 nodeName:"span",2267 innerHTML:"​",2268 id:"insert_"+ASGetTime(),2269 style:{2270 fontSize:this.value,2271 display:"inline_block",2272 },2273 });2274 document.execCommand("InsertHtml",false,aa.outerHTML);2275 var aa=document.getElementById(aa.id);2276 if (aa.parentNode && aa.nextSibling && aa.nextSibling.nodeName=="BR") {2277 aa.parentNode.removeChild(aa.nextSibling);2278 }2279 } else {2280 this.root.content.advanceCommand(this.action,this.value);2281 }2282 this.root.content.focus();2283 }2284 this.imgOnchoose=function() {2285 if (this.value=="local") return;2286 this.root.content.recoverSel();2287 var img=ASElement({2288 nodeName:"img",2289 src:this.value,2290 style:{2291 maxWidth:"100%",2292 },2293 });2294 document.execCommand("InsertHtml",false,img.outerHTML);2295 }2296 this.imgOnopen=function() {2297 this.menu.block[0].content.removeChild(this.menu.block[0].content.input);2298 this.menu.block[0].content.input=BasicEditToolStr.imgFileInput({root:this.root});2299 this.menu.block[0].content.appendChild(this.menu.block[0].content.input);2300 this.menu.block[1].content.input.setValue("");2301 }2302 this.imgFileInput=function(buildP) {2303 var target=ASElement({2304 nodeName:"input",2305 type:"file",2306 multiple:"true",2307 accept:"image/gif,image/jpeg,image/png",2308 style:{2309 position:"absolute",2310 left:0,2311 top:-20,2312 width:"100%",2313 height:50+20,2314 opacity:0,2315 cursor:"pointer",2316 },2317 root:buildP.root,2318 onchange:function() {2319 this.root.content.recoverSel();2320 this.file=[];2321 this.fileDoneN=0;2322 this.img=[];2323 for (var i=0;i<this.files.length;i++) {2324 this.img[i]=ASElement({2325 nodeName:"img",2326 id:"img"+i+"_"+ASGetTime(),2327 style:{2328 maxWidth:"100%",2329 },2330 });2331 this.file[i]=new FileReader();2332 this.file[i].num=i;2333 this.file[i].root=this;2334 this.file[i].readAsDataURL(this.files[i]);2335 this.file[i].onload=function() {2336 this.root.fileDoneN++;2337 var img=document.getElementById(this.root.img[this.num].id);2338 img.src=this.result;2339 }2340 document.execCommand("InsertHtml",false,this.img[i].outerHTML);2341 this.root.content.updateSel();2342 }2343 this.root.content.focus();2344 },2345 });2346 return(target);2347 }2348 this.createlinkOnclick=function() {2349 if (this.root.content.sel) {2350 document.execCommand("CreateLink",false,this.root.content.sel.toString());2351 }2352 }2353 this.createlinkOnchoose=function() {2354 this.root.content.recoverSel();2355 document.execCommand("CreateLink",false,this.value);2356 }2357 this.createlinkOnopen=function() {2358 this.menu.block[0].content.input.setValue("");2359 this.menu.block[0].content.input.focus();2360 }2361 this.onselchange=function() {2362 for (var item in this.tool) {2363 if (this.tool[item].type=="status") {2364 this.tool[item].detectStatus();2365 }2366 }2367 }2368 this.setLang=function() {2369 for (var item in this.tool) {2370 if (this.tool[item].type=="select") {2371 this.tool[item].icon.title=this.tool[item]["title"+ASLang];2372 } else {2373 this.tool[item].title=this.tool[item]["title"+ASLang];2374 }2375 }2376 }2377 }2378 function BasicEditTool(buildP) {2379 if (!buildP.size) buildP.size=35;2380 if (!buildP.tool) buildP.tool={2381 font:true,2382 size:true,2383 bold:true,2384 italic:true,2385 underline:true,2386 colorW:true,2387 colorB:true,2388 left:true,2389 center:true,2390 right:true,2391 full:true,2392 divideline:true,2393 img:true,2394 createlink:true,2395 unlink:true,2396 help:true,2397 };2398 var n=0;2399 for (var item in buildP.tool) n++;2400 var target=ASElement({2401 nodeName:"div",2402 style:{2403 position:"relative",2404 width:buildP.size*1.1*n,2405 height:buildP.size,2406 },2407 onselchange:BasicEditToolStr.onselchange,2408 });2409 if (buildP.widthA) target.set({style:{width:buildP.widthA}});2410 BasicEditToolList[BasicEditToolList.length]=target;2411 target.toolList=buildP.tool;2412 target.tool={};2413 for (var item in target.toolList) {2414 var i=BasicEditToolIconList[item];2415 var icon=ASElement({2416 nodeName:"div",2417 style:{2418 position:"relative",2419 width:buildP.size,2420 height:buildP.size,2421 },2422 onmouseover:BasicEditToolStr.iconOnmouseover,2423 onmouseout:BasicEditToolStr.iconOnmouseout,2424 onmousedown:BasicEditToolStr.iconOnmousedown,2425 onmouseup:BasicEditToolStr.iconOnmouseup,2426 });2427 icon.bottom=ASElement({2428 nodeName:"div",2429 style:{2430 position:"absolute",2431 width:"90%",2432 height:"90%",2433 margin:"5%",2434 backgroundColor:"rgba(200,0,0,0.2)",2435 opacity:0,2436 },2437 });2438 icon.appendChild(icon.bottom);2439 icon.light=ASElement({2440 nodeName:"div",2441 style:{2442 position:"absolute",2443 width:"100%",2444 height:"100%",2445 boxShadow:"0 0 3px rgba(200,0,0,0.8)",2446 opacity:0,2447 },2448 });2449 icon.appendChild(icon.light);2450 icon.pic=ASElement({2451 nodeName:"div",2452 style:{2453 position:"absolute",2454 left:"2%",2455 top:"2%",2456 width:"96%",2457 height:"96%",2458 overflow:"hidden",2459 },2460 });2461 icon.appendChild(icon.pic);2462 icon.picC=ASElement({2463 nodeName:"img",2464 src:ASGetSrcByName("editorToolIcon"),2465 onselectstart:emptyFunction,2466 style:{2467 position:"absolute",2468 height:buildP.size*0.96,2469 left:-BasicEditToolIconList[item].pos*buildP.size*0.96,2470 },2471 });2472 icon.pic.appendChild(icon.picC);2473 var p={2474 root:target,2475 titleC:BasicEditToolIconList[item].titleC,2476 titleE:BasicEditToolIconList[item].titleE,2477 style:{2478 marginLeft:buildP.size*0.1,2479 },2480 };2481 if (item=="font") {2482 p.type="select";2483 var block=[];2484 for (var j=0;j<DEFAULT_FONTLIST.length;j++) {2485 block[block.length]=BasicWord({2486 size:24*DEFAULT_FONTLIST[j][2],2487 wordC:DEFAULT_FONTLIST[j][1],2488 wordE:DEFAULT_FONTLIST[j][0],2489 width:"max",2490 font:DEFAULT_FONTLIST[j][0],2491 style:{2492 padding:"3px 10px",2493 pointerEvents:"none",2494 },2495 value:DEFAULT_FONTLIST[j][0],2496 });2497 }2498 p.block=block;2499 p.value=DEFAULT_FONT;2500 p.action="FontName";2501 p.entryOnclick=BasicEditToolStr.selectOnclick;2502 }2503 if (item=="size") {2504 p.type="select";2505 p.heightA=300;2506 var block=[BasicWord({2507 size:48,2508 wordC:"極大",2509 wordE:"Huge",2510 style:{2511 padding:"3px 10px",2512 pointerEvents:"none",2513 },2514 value:48,2515 }),BasicWord({2516 size:32,2517 wordC:"大",2518 wordE:"Large",2519 style:{2520 padding:"3px 10px",2521 pointerEvents:"none",2522 },2523 value:32,2524 }),BasicWord({2525 size:18,2526 wordC:"æ£å¸¸",2527 wordE:"Normal",2528 style:{2529 padding:"3px 10px",2530 pointerEvents:"none",2531 },2532 value:18,2533 }),BasicWord({2534 size:12,2535 wordC:"å°",2536 wordE:"Small",2537 style:{2538 padding:"3px 10px",2539 pointerEvents:"none",2540 },2541 value:12,2542 })];2543 for (var j=4;j<=15;j++) {2544 block[block.length]=BasicWord({2545 size:j*2,2546 wordE:j*2+" px",2547 style:{2548 padding:"3px 10px",2549 pointerEvents:"none",2550 },2551 value:j*2,2552 });2553 }2554 for (var j=1;j<=5;j++) {2555 block[block.length]=BasicWord({2556 size:30+j*3,2557 wordE:(30+j*3)+" px",2558 style:{2559 padding:"3px 10px",2560 pointerEvents:"none",2561 },2562 value:30+j*3,2563 });2564 }2565 p.block=block;2566 p.value=18;2567 p.action=BasicEditToolStr.sizeAction;2568 p.entryOnclick=BasicEditToolStr.selectOnclick;2569 p.onchoose=BasicEditToolStr.sizeOnchoose;2570 }2571 if (item=="bold") {2572 p.type="status";2573 p.action="Bold";2574 p.labelName="B";2575 p.styleName="fontWeight";2576 p.styleValue="bold";2577 }2578 if (item=="italic") {2579 p.type="status";2580 p.action="Italic";2581 p.labelName="I";2582 p.styleName="fontStyle";2583 p.styleValue="italic";2584 }2585 if (item=="underline") {2586 p.type="status";2587 p.action="Underline";2588 p.labelName="U";2589 p.styleName="textDecoration";2590 p.styleValue="underline";2591 }2592 if (item=="colorW" || item=="colorB") {2593 p.type="select";2594 var block=[];2595 p.col=6;2596 p.menuPadding=5;2597 var color=["#000000","#00C000","#0000C0","#8000FF","#FF8000","#C0C0C0","#FF0000","#00FF00","#0000FF","#FF00FF","#FFFF00","#FFFFFF"];2598 for (var i=0;i<color.length;i++) {2599 block[i]=ASElement({2600 nodeName:"div",2601 style:{2602 padding:6,2603 },2604 value:color[i],2605 });2606 block[i].pic=ASElement({2607 nodeName:"div",2608 style:{2609 backgroundColor:color[i],2610 width:35,2611 height:35,2612 },2613 });2614 block[i].appendChild(block[i].pic);2615 }2616 p.block=block;2617 if (item=="colorW") {2618 p.action="ForeColor";2619 p.value="black";2620 } else {2621 p.action="BackColor";2622 p.value="white";2623 }2624 p.entryOnclick=BasicEditToolStr.selectOnclick;2625 }2626 if (item=="left") {2627 p.type="simple";2628 p.action="JustifyLeft";2629 }2630 if (item=="center") {2631 p.type="simple";2632 p.action="JustifyCenter";2633 }2634 if (item=="right") {2635 p.type="simple";2636 p.action="JustifyRight";2637 }2638 if (item=="full") {2639 p.type="simple";2640 p.action="JustifyFull";2641 }2642 if (item=="divideline") {2643 p.type="simple";2644 p.action="InsertHorizontalRule";2645 }2646 if (item=="img") {2647 p.type="select";2648 p.fx="upRight";2649 var block=[];2650 block[0]=ASElement({2651 nodeName:"div",2652 style:{2653 position:"relative",2654 width:230,2655 height:50,2656 overflow:"hidden",2657 },2658 giveupMenuImg:true,2659 value:"local",2660 });2661 block[0].word=BasicWord({2662 size:24,2663 wordC:"æ¬å°åç",2664 wordE:"Local Image",2665 style:{2666 position:"relative",2667 width:"100%",2668 textAlign:"center",2669 top:7.5,2670 },2671 });2672 block[0].appendChild(block[0].word);2673 block[0].input=BasicEditToolStr.imgFileInput({root:target});2674 block[0].appendChild(block[0].input);2675 block[1]=ASElement({2676 nodeName:"div",2677 style:{2678 position:"relative",2679 width:230,2680 height:120,2681 },2682 giveupMenuExtra:true,2683 });2684 block[1].word=BasicWord({2685 size:24,2686 wordC:"網絡åç",2687 wordE:"Online Image",2688 style:{2689 position:"relative",2690 width:"100%",2691 textAlign:"center",2692 top:5,2693 },2694 });2695 block[1].appendChild(block[1].word);2696 block[1].input=BasicInput({2697 type:"input",2698 hintC:"è«è¼¸å
¥éæ¥",2699 hintE:"Hyperlink",2700 widthA:200,2701 style:{2702 position:"relative",2703 left:15,2704 marginTop:7,2705 },2706 });2707 block[1].appendChild(block[1].input);2708 block[1].confirm=BasicButton({2709 wordC:"å° å
¥",2710 wordE:"Import",2711 size:18,2712 style:{2713 position:"relative",2714 left:72,2715 marginTop:5,2716 },2717 root:block[1],2718 onclick:function() {2719 var aa=this.root.parentNode.root;2720 aa.value=this.root.input.getValue();2721 aa.onchoose();2722 aa.close();2723 },2724 });2725 block[1].appendChild(block[1].confirm);2726 p.block=block;2727 p.onchoose=BasicEditToolStr.imgOnchoose;2728 p.onopen=BasicEditToolStr.imgOnopen;2729 }2730 if (item=="createlink") {2731 p.type="select";2732 p.fx="upRight";2733 p.action="CreateLink";2734 var block=ASElement({2735 nodeName:"div",2736 style:{2737 position:"relative",2738 width:330,2739 height:50,2740 },2741 });2742 block.input=BasicInput({2743 type:"input",2744 hintC:"è«è¼¸å
¥éæ¥",2745 hintE:"Hyperlink",2746 widthA:200,2747 style:{2748 position:"absolute",2749 left:15,2750 top:7.5,2751 },2752 });2753 block.appendChild(block.input);2754 block.confirm=BasicButton({2755 wordC:"確 èª",2756 wordE:"Confirm",2757 size:18,2758 style:{2759 position:"absolute",2760 right:10,2761 top:7.5,2762 },2763 root:block,2764 onclick:function() {2765 var aa=this.root.parentNode.root;2766 aa.value=this.root.input.getValue();2767 aa.onchoose();2768 aa.close();2769 },2770 });2771 block.appendChild(block.confirm);2772 p.block=[block];2773 p.entryOnclick=BasicEditToolStr.createlinkOnclick;2774 p.onchoose=BasicEditToolStr.createlinkOnchoose;2775 p.onopen=BasicEditToolStr.createlinkOnopen;2776 p.giveupMenuExtra=true;2777 }2778 if (item=="unlink") {2779 p.type="simple";2780 p.action="Unlink";2781 }2782 if (item=="help") {2783 p.type="select";2784 p.fx="upRight";2785 p.heightA=400;2786 p.BGC="rgba(0,0,0,0.7)";2787 p.giveupMenuExtra=true;2788 var block=[ASElement({2789 nodeName:"div",2790 style:{2791 paddingTop:5,2792 paddingBottom:5,2793 },2794 })];2795 for (var item1 in buildP.tool) {2796 if (item1=="help") continue;2797 if (block[0].childNodes.length>0) {2798 block[0].appendChild(ASElement({2799 nodeName:"hr",2800 style:{2801 color:"white",2802 marginLeft:5,2803 marginRight:5,2804 marginTop:5,2805 marginBottom:5,2806 opacity:0.2,2807 },2808 }));2809 }2810 var b=ASElement({2811 nodeName:"table",2812 style:{2813 width:400,2814 minHeight:50,2815 },2816 });2817 block[0].appendChild(b);2818 b.r1=ASElement({2819 nodeName:"tr",2820 });2821 b.appendChild(b.r1);2822 b.r1.appendChild(ASElement({2823 nodeName:"td",2824 align:"center",2825 valign:"middle",2826 style:{2827 width:55,2828 },2829 }));2830 b.pic=ASElement({2831 nodeName:"div",2832 style:{2833 position:"relative",2834 width:35,2835 height:35,2836 overflow:"hidden",2837 backgroundColor:"white",2838 },2839 });2840 b.r1.lastChild.appendChild(b.pic);2841 b.picC=ASElement({2842 nodeName:"img",2843 src:ASGetSrcByName("editorToolIcon"),2844 style:{2845 position:"relative",2846 height:35,2847 left:-BasicEditToolIconList[item1].pos*35,2848 }2849 });2850 b.pic.appendChild(b.picC);2851 b.r1.appendChild(ASElement("td"));2852 for (var con in BasicEditToolIconList[item1]) {2853 if (con=="onclickC") {2854 b.r1.lastChild.appendChild(BasicWord({2855 color:"white",2856 size:18,2857 wordC:"é» æï¼",2858 wordE:"Click:",2859 style:{2860 verticalAlign:"top",2861 width:70,2862 },2863 }));2864 b.r1.lastChild.appendChild(BasicWord({2865 color:"white",2866 size:18,2867 wordC:BasicEditToolIconList[item1].onclickC,2868 wordE:BasicEditToolIconList[item1].onclickE,2869 style:{2870 width:250,2871 },2872 }));2873 b.r1.lastChild.appendChild(ASElement("br"));2874 }2875 if (con=="onpressC") {2876 b.r1.lastChild.appendChild(BasicWord({2877 color:"white",2878 size:18,2879 wordC:"é· æï¼",2880 wordE:"Press:",2881 style:{2882 verticalAlign:"top",2883 width:70,2884 },2885 }));2886 b.r1.lastChild.appendChild(BasicWord({2887 color:"white",2888 size:18,2889 wordC:BasicEditToolIconList[item1].onpressC,2890 wordE:BasicEditToolIconList[item1].onpressE,2891 style:{2892 width:250,2893 },2894 }));2895 b.r1.lastChild.appendChild(ASElement("br"));2896 }2897 }2898 }2899 p.block=block;2900 }2901 if (p.type=="simple") {2902 p.nodeName="div";2903 p.style.width=buildP.size;2904 p.style.height=buildP.size;2905 p.style.cursor="pointer";2906 p.onclick=BasicEditToolStr.simpleOnclick;2907 target.tool[item]=ASElement(p);2908 target.tool[item].appendChild(icon);2909 }2910 if (p.type=="select") {2911 p.entry=icon;2912 if (!p.fx) p.fx="up";2913 if (!p.onchoose) p.onchoose=BasicEditToolStr.selectOnchoose;2914 target.tool[item]=BasicSelect(p);2915 target.tool[item].icon=icon;2916 }2917 if (p.type=="status") {2918 p.nodeName="div",2919 p.style.width=buildP.size;2920 p.style.height=buildP.size;2921 p.style.cursor="pointer";2922 p.onclick=BasicEditToolStr.statusOnclick;2923 p.detectStatus=BasicEditToolStr.statusDetectStatus;2924 p.wDetect=false;2925 target.tool[item]=ASElement(p);2926 target.tool[item].icon=icon;2927 target.tool[item].appendChild(icon);2928 }2929 if (p.type=="input_image") {2930 p.nodeName="div";2931 p.style.position="relative",2932 p.style.width=buildP.size;2933 p.style.height=buildP.size;2934 p.style.overflow="hidden";2935 p.onchange=BasicEditToolStr.imgOnchange;2936 p.onmouseover=BasicEditToolStr.iconOnmouseover;2937 p.onmouseout=BasicEditToolStr.iconOnmouseout;2938 p.onmousedown=BasicEditToolStr.iconOnmousedown;2939 p.onmouseup=BasicEditToolStr.iconOnmouseup;2940 target.tool[item]=ASElement(p);2941 target.tool[item].appendChild(icon);2942 target.tool[item].pic=icon.pic;2943 target.tool[item].input=ASElement({2944 nodeName:"input",2945 type:"file",2946 accept:"image/gif,image/jpeg,image/png",2947 style:{2948 position:"absolute",2949 left:0,2950 top:-20,2951 width:"100%",2952 height:buildP.size+20,2953 opacity:0,2954 cursor:"pointer",2955 },2956 });2957 target.tool[item].appendChild(target.tool[item].input);2958 }2959 target.appendChild(target.tool[item]);2960 }2961 if (target.tool.help) {2962 target.tool.help.set({style:{2963 position:"absolute",2964 right:0,2965 }});2966 }2967 target.setLang=BasicEditToolStr.setLang;2968 target.setLang();2969 delete buildP.tool;2970 target.set(buildP);2971 return(target);2972 }2973 var BasicEditorStr=new function() {2974 this.resize=function(typeP) {2975 if ("widthA" in typeP) {2976 this.set({style:{width:typeP.widthA}});2977 this.contentF.set({style:{width:typeP.widthA}});2978 this.content.set({style:{width:typeP.widthA}});2979 this.toolF.set({style:{width:typeP.widthA}});2980 }2981 if ("heightA" in typeP) {2982 this.contentF.set({style:{height:typeP.heightA-this.iconSize*1.2}});2983 }2984 }2985 this.contentAdvanceCommand=function(action,value) {2986 document.execCommand("FontSize",false,7);2987 this.tide(null,action,value);2988 }2989 this.contentGetSel=function(node) {2990 if (!node) {2991 if (this.sel.anchorNode==this.sel.focusNode) {2992 this.sel.node[0]=this.sel.anchorNode;2993 return;2994 }2995 this.checkStatus="before";2996 node=this;2997 }2998 var yes=true;2999 for (var i=0;i<node.childNodes.length;i++) {3000 var c=node.childNodes[i];3001 if (c==this.sel.anchorNode || c==this.sel.focusNode) {3002 if (this.checkStatus=="before") this.checkStatus="on";3003 else this.checkStatus="end";3004 }3005 if (this.checkStatus!="before" && c.nodeType==3) this.sel.node[this.sel.node.length]=c.parentNode;3006 if (c.nodeType!=1) continue;3007 yes=false;3008 this.getSel(c);3009 if (this.checkStatus=="end") return;3010 }3011 }3012 this.contentUpdateSel=function() {3013 var sel=window.getSelection();3014 this.sel={3015 anchorNode:sel.anchorNode,3016 anchorOffset:sel.anchorOffset,3017 focusNode:sel.focusNode,3018 focusOffset:sel.focusOffset,3019 isCollapsed:sel.isCollapsed,3020 node:[],3021 range:[],3022 };3023 for (var i=0;i<sel.rangeCount;i++) {3024 this.sel.range[i]=sel.getRangeAt(i);3025 }3026 this.getSel();3027 }3028 this.contentRecoverSel=function() {3029 if (!this.sel) return;3030 var sel=window.getSelection();3031 sel.removeAllRanges();3032 for (var i=0;i<this.sel.range.length;i++) {3033 sel.addRange(this.sel.range[i]);3034 }3035 }3036 this.contentTide=function(node,action,value) {3037 if (!node) {3038 node=this;3039 }3040 if (node.size=="7") {3041 action(node,value);3042 node.size="";3043 }3044 for (var i=0;i<node.childNodes.length;i++) {3045 var c=node.childNodes[i];3046 if (c.nodeType!=1) continue;3047 this.tide(c,action,value);3048 }3049 }3050 this.contentChangeSel=function() {3051 this.updateSel();3052 this.root.tool.onselchange();3053 }3054 this.contentOnpaste=function(e) {3055 ASPasteData={3056 item:[],3057 itemDoneN:0,3058 root:this,3059 onfinish:function() {3060 var html="";3061 for (var i=0;i<ASPasteData.item.length;i++) {3062 if (ASPasteData.item[i].html) html+=ASPasteData.item[i].html;3063 }3064 document.execCommand("InsertHtml",false,escapeHtml(html));3065 },3066 };3067 var data=e.clipboardData;3068 for (var i=0;i<data.items.length;i++) {3069 ASPasteData.item[i]={3070 type:data.items[i].type,3071 };3072 if (data.items[i].type=="text/plain") {3073 if (!(i+1<data.items.length && data.items[i+1].type=="text/html")) {3074 data.items[i].getAsString(function(e) {3075 for (var i=0;i<ASPasteData.item.length;i++) {3076 if (ASPasteData.item[i].type=="text/plain" && !ASPasteData.item[i].html) {3077 ASPasteData.item[i].html=e;3078 ASPasteData.itemDoneN++;3079 if (ASPasteData.itemDoneN>=ASPasteData.item.length) ASPasteData.onfinish();3080 break;3081 }3082 }3083 });3084 } else {3085 ASPasteData.itemDoneN++;3086 continue;3087 }3088 continue;3089 }3090 if (data.items[i].type=="text/html") {3091 data.items[i].getAsString(function(e) {3092 for (var i=0;i<ASPasteData.item.length;i++) {3093 if (ASPasteData.item[i].type=="text/html" && !ASPasteData.item[i].html) {3094 var start=e.indexOf("<!--StartFragment-->")+20;3095 var end=e.indexOf("<!--EndFragment-->");3096 ASPasteData.item[i].html=e.slice(start,end);3097 ASPasteData.itemDoneN++;3098 if (ASPasteData.itemDoneN>=ASPasteData.item.length) ASPasteData.onfinish();3099 break;3100 }3101 }3102 });3103 continue;3104 }3105 if (data.items[i].type.indexOf("image")!=-1) {3106 var blob=data.items[i].getAsFile();3107 var file=new FileReader();3108 file.readAsDataURL(blob);3109 file.root=ASPasteData.item[i];3110 file.onloadend=function(e) {3111 var img=ASElement({3112 nodeName:"img",3113 src:this.result,3114 });3115 for (var i=0;i<ASPasteData.item.length;i++) {3116 if (ASPasteData.item[i].type.indexOf("image")!=-1 && !ASPasteData.item[i].html) {3117 ASPasteData.item[i].html=img.outerHTML;3118 ASPasteData.itemDoneN++;3119 if (ASPasteData.itemDoneN>=ASPasteData.item.length) ASPasteData.onfinish();3120 break;3121 }3122 }3123 }3124 continue;3125 }3126 ASPasteData.itemDoneN++;3127 }3128 return false;3129 }3130 }3131 function BasicEditor(buildP) {3132 if (!buildP.widthA) buildP.widthA=DEFAULT_PAGE_WIDTHL;3133 if (!buildP.heightA) buildP.heightA=500;3134 if (!buildP.iconSize) buildP.iconSize=35;3135 var target=ASElement({3136 nodeName:"div",3137 style:{3138 position:"relative",3139 width:buildP.widthA,3140 border:"2px solid rgba(180,180,180,0.5)",3141 },3142 });3143 target.contentF=ASElement({3144 nodeName:"div",3145 style:{3146 width:buildP.widthA,3147 height:buildP.heightA-buildP.iconSize*1.2,3148 overflowX:"hidden",3149 overflowY:"auto",3150 backgroundColor:"white",3151 },3152 });3153 target.appendChild(target.contentF);3154 target.content=ASElement({3155 nodeName:"div",3156 root:target,3157 contentEditable:true,3158 style:{3159 fontFamily:DEFAULT_FONT,3160 fontSize:18,3161 width:buildP.widthA-16-DEFAULT_SCROLLBAR_WIDTH,3162 minHeight:buildP.heightA-buildP.iconSize*1.2-16,3163 borderStyle:"none",3164 outline:"none",3165 margin:8,3166 },3167 advanceCommand:BasicEditorStr.contentAdvanceCommand,3168 getSel:BasicEditorStr.contentGetSel,3169 updateSel:BasicEditorStr.contentUpdateSel,3170 recoverSel:BasicEditorStr.contentRecoverSel,3171 tide:BasicEditorStr.contentTide,3172 changeSel:BasicEditorStr.contentChangeSel,3173 onpaste:BasicEditorStr.contentOnpaste,3174 });3175 target.contentF.appendChild(target.content);3176 target.content.onclick=target.content.changeSel;3177 target.content.onkeydown=target.content.changeSel;3178 target.content.onkeyup=target.content.changeSel;3179 target.appendChild(ASElement({3180 nodeName:"hr",3181 style:{3182 marginLeft:5,3183 marginRight:5,3184 },3185 }));3186 target.toolF=ASElement({3187 nodeName:"div",3188 style:{3189 width:buildP.widthA,3190 },3191 });3192 target.appendChild(target.toolF);3193 target.tool=BasicEditTool({3194 size:buildP.iconSize,3195 content:target.content,3196 widthA:buildP.widthA-buildP.iconSize*0.3,3197 tool:{3198 font:true,3199 size:true,3200 bold:true,3201 italic:true,3202 underline:true,3203 colorW:true,3204 colorB:true,3205 left:true,3206 center:true,3207 right:true,3208 full:true,3209 divideline:true,3210 img:true,3211 createlink:true,3212 unlink:true,3213 help:true,3214 },3215 style:{3216 marginLeft:buildP.iconSize*0.1,3217 marginTop:buildP.iconSize*0.1,3218 marginBottom:buildP.iconSize*0.1,3219 },3220 });3221 target.toolF.appendChild(target.tool);3222 target.resize=BasicEditorStr.resize;3223 target.set(buildP);3224 return(target);3225 }3226 var FlashImgStr=new function() {3227 this.getPicScale=function() {3228 switch (this.imgSize) {3229 case "integral":3230 return(Math.min(this.widthA/this.pic.naturalWidth,this.heightA/this.pic.naturalHeight));3231 break;3232 case "full":3233 return(Math.max(this.widthA/this.pic.naturalWidth,this.heightA/this.pic.naturalHeight));3234 break;3235 case "intelligent":3236 var size1=Math.min(this.widthA/this.pic.naturalWidth,this.heightA/this.pic.naturalHeight);3237 var size2=Math.max(this.widthA/this.pic.naturalWidth,this.heightA/this.pic.naturalHeight);3238 if (size2<size1*1.25) {3239 return(size2);3240 } else {3241 return(size1);3242 }3243 break;3244 }3245 return(1);3246 }3247 this.firstLoad=function() {3248 var scale=this.getPicScale();3249 this.picF1.set({3250 style:{3251 backgroundPosition:"center",3252 backgroundImage:"url('"+this.pic.src+"')",3253 backgroundSize:this.pic.naturalWidth*scale+"px "+this.pic.naturalHeight*scale+"px",3254 },3255 });3256 if (this.img.length>1) this.reload();3257 }3258 this.reload=function() {3259 this.imgC=(this.imgC+1)%this.img.length;3260 this.pic=ASElement({3261 nodeName:"img",3262 src:this.img[this.imgC],3263 });3264 }3265 this.nextAppear=function() {3266 this.picF1.setTarget({3267 opacity:0,3268 });3269 var scale=this.getPicScale();3270 this.picF2=ASElement({3271 nodeName:"div",3272 style:{3273 position:"relative",3274 overflow:"hidden",3275 width:this.widthA,3276 height:this.heightA,3277 top:-this.heightA+this.heightA%2*0.4,3278 opacity:0,3279 backgroundPosition:"center",3280 backgroundImage:"url('"+this.pic.src+"')",3281 backgroundSize:this.pic.naturalWidth*scale+"px "+this.pic.naturalHeight*scale+"px",3282 backgroundRepeat:"no-repeat",3283 },3284 });3285 if (ASBrowser!="Mobile") {3286 this.picF2.set({style:{3287 transform:{3288 translateX:-this.widthA,3289 },3290 }});3291 }3292 this.appendChild(this.picF2);3293 this.setTimeout(function() {this.picF2.setTarget({3294 opacity:1,3295 time:400,3296 transform:{3297 translateX:0,3298 },3299 })},10);3300 this.setTimeout(this.switchPic,510);3301 }3302 this.switchPic=function() {3303 this.picF1.set({style:{3304 opacity:1,3305 backgroundPosition:this.picF2.style.backgroundPosition,3306 backgroundImage:this.picF2.style.backgroundImage,3307 backgroundSize:this.picF2.style.backgroundSize,3308 }});3309 this.removeChild(this.picF2);3310 }3311 this.change=function() {3312 if (this.type=="response") {3313 if (!this.wOn) {3314 this.wPlaying=false;3315 return;3316 }3317 }3318 if (this.pic.complete) {3319 this.nextAppear();3320 }3321 this.reload();3322 var time=ASGetTime()-this.startTime-this.delay;3323 this.setTimeout(this.change,this.timeSpace-time%this.timeSpace);3324 }3325 this.onmouseover=function() {3326 if (this.type=="response") {3327 this.wOn=true;3328 if (this.img.length>1 && !this.wPlaying) {3329 this.wPlaying=true;3330 this.setTimeout(this.change,this.timeSpace);3331 this.startTime=ASGetTime();3332 this.delay=0;3333 }3334 }3335 }3336 this.onmouseout=function() {3337 if (this.type=="response") {3338 this.wOn=false;3339 }3340 }3341 }3342 function FlashImg(buildP) {3343 if (!buildP.type) buildP.type="auto";3344 if (!buildP.delay) buildP.delay=0;3345 if (!buildP.timeSpace) buildP.timeSpace=DEFAULT_FLASHIMG_TIMESPACE;3346 var target=ASElement({3347 nodeName:"div",3348 style:{3349 overflow:"hidden",3350 width:buildP.widthA,3351 height:buildP.heightA,3352 },3353 onmouseover:FlashImgStr.onmouseover,3354 onmouseout:FlashImgStr.onmouseout,3355 onclick:FlashImgStr.onclick,3356 });3357 target.type=buildP.type;3358 target.widthA=buildP.widthA;3359 target.heightA=buildP.heightA;3360 target.imgSize=buildP.imgSize;3361 target.img=buildP.img;3362 target.imgC=0;3363 target.timeSpace=buildP.timeSpace;3364 if (target.type=="response") {3365 target.wPlaying=false;3366 target.wOn=false;3367 }3368 if (target.type=="auto") {3369 target.startTime=ASGetTime();3370 target.delay=buildP.delay;3371 }3372 target.picF1=ASElement({3373 nodeName:"div",3374 style:{3375 overflow:"hidden",3376 width:target.widthA,3377 height:target.heightA,3378 backgroundRepeat:"no-repeat",3379 },3380 });3381 target.appendChild(target.picF1);3382 target.pic=ASElement({3383 nodeName:"img",3384 src:target.img[0],3385 father:target,3386 onload:function() {3387 this.father.firstLoad();3388 },3389 });3390 target.getPicScale=FlashImgStr.getPicScale;3391 target.firstLoad=FlashImgStr.firstLoad;3392 target.reload=FlashImgStr.reload;3393 target.nextAppear=FlashImgStr.nextAppear;3394 target.switchPic=FlashImgStr.switchPic;3395 target.change=FlashImgStr.change;3396 target.onmouseover=FlashImgStr.onmouseover;3397 target.onmouseout=FlashImgStr.onmouseout;3398 if (target.img.length>1) target.setTimeout(target.change,target.delay+target.timeSpace);3399 target.set(buildP);3400 return(target);3401 }3402 var AnchorListStr=new function() {3403 AnchorListList=[];3404 this.resize=function() {3405 for (var i=0;i<this.block.length;i++) {3406 this.block[i].set({style:{3407 height:ASGetElementHeight(this.block[i].wordR)+this.size*0.3,3408 }});3409 this.block[i].content.set({style:{3410 top:-ASGetElementHeight(this.block[i].wordR),3411 }});3412 }3413 this.blockPos=[];3414 this.lightL[0].set({style:{3415 height:ASGetElementHeight(this.block[0])/2-23+this.size*1.28+this.space,3416 }});3417 var y0=ASGetElementHeight(this.block[0])/2-23+this.size*1.28+this.space;3418 for (var i=1;i<this.lightL.length-1;i++) {3419 if (i-1==this.blockNum) {3420 this.light.set({style:{3421 top:y0+21-25+2,3422 }});3423 }3424 this.blockPos[i-1]=y0;3425 this.lightL[i].set({style:{3426 height:(ASGetElementHeight(this.block[i-1])+ASGetElementHeight(this.block[i]))/2+this.size*0.2-8+this.space,3427 }});3428 y0+=(ASGetElementHeight(this.block[i-1])+ASGetElementHeight(this.block[i]))/2+this.size*0.2+this.space;3429 }3430 this.blockPos[i-1]=y0;3431 this.lightL[this.lightL.length-1].set({style:{3432 height:ASGetElementHeight(this.block[this.block.length-1])/2-23+this.size*1.28+this.space,3433 }});3434 y0+=(ASGetElementHeight(this.block[i-1])+ASGetElementHeight(this.block[i]))/2+this.size*0.2+this.space;3435 this.lightC.set({style:{3436 height:y0+45,3437 }});3438 }3439 this.changeBlock=function(w) {3440 for (var i=0;i<this.block.length;i++) {3441 if (i==w) continue;3442 this.block[i].bottom.setTarget({opacity:0});3443 this.block[i].wordW.setTarget({opacity:0});3444 }3445 this.block[w].bottom.setTarget({opacity:1});3446 this.block[w].wordW.setTarget({opacity:1});3447 this.light.setTarget({3448 top:this.blockPos[w]+21-25+2,3449 time:200,3450 });3451 this.blockNum=w;3452 if (this.parentNode.parentNode.scrollTo) {3453 this.parentNode.parentNode.scrollTo(this.blockPos[w]+21-25+2+ASGetElementHeight(this.block[w])/2-15);3454 }3455 }3456 this.blockOnmouseover=function() {3457 this.word.setTarget({transform:{translateX:5}});3458 }3459 this.blockOnmouseout=function() {3460 this.word.setTarget({transform:{translateX:0}});3461 }3462 this.blockOnmousedown=function() {3463 this.word.setTarget({transform:{translateX:2}});3464 }3465 this.blockOnmouseup=function() {3466 this.word.setTarget({transform:{translateX:5}});3467 }3468 this.blockOnclick=function() {3469 if (this.parentNode.parentNode.onchoose) this.parentNode.parentNode.onchoose(this.num);3470 }3471 }3472 function AnchorList(buildP) {3473 if (!buildP.size) buildP.size=20;3474 if (!buildP.widthA) buildP.widthA=140;3475 if (!buildP.space) buildP.space=0;3476 var target=ASElement({3477 nodeName:"div",3478 });3479 target.size=buildP.size;3480 target.blockNum=0;3481 target.space=buildP.space;3482 if (buildP.startBlock) target.blockNum=buildP.startBlock;3483 AnchorListList[AnchorListList.length]=target;3484 target.lightC=ASElement({3485 nodeName:"div",3486 style:{3487 position:"absolute",3488 width:19,3489 backgroundColor:"rgb(230,230,230)",3490 },3491 });3492 target.appendChild(target.lightC);3493 target.light=ASElement({3494 nodeName:"img",3495 src:ASGetSrcByName("anchorListLight"),3496 style:{3497 position:"absolute",3498 width:"100%",3499 },3500 onload:function() {3501 this.set({style:{height:this.naturalHeight}});3502 }3503 });3504 target.lightC.appendChild(target.light);3505 target.lightF=ASElement({3506 nodeName:"div",3507 style:{3508 position:"absolute",3509 width:"100%",3510 top:0,3511 },3512 });3513 target.lightC.appendChild(target.lightF);3514 target.lightE1=ASElement({3515 nodeName:"img",3516 src:ASGetSrcByName("anchorListEndCover"),3517 style:{3518 marginBottom:-2,3519 },3520 });3521 target.lightF.appendChild(target.lightE1);3522 target.lightL=[];3523 target.lightP=[];3524 for (var i=0;i<=buildP.block.length;i++) {3525 if (i!=0) {3526 target.lightP[i]=ASElement({3527 nodeName:"img",3528 src:ASGetSrcByName("anchorListPointCover"),3529 style:{3530 marginTop:-2,3531 marginBottom:-2,3532 },3533 });3534 target.lightF.appendChild(target.lightP[i]);3535 }3536 target.lightL[i]=ASElement({3537 nodeName:"img",3538 src:ASGetSrcByName("anchorListLineCover"),3539 style:{3540 width:"100%",3541 },3542 });3543 target.lightF.appendChild(target.lightL[i]);3544 }3545 target.lightE2=ASElement({3546 nodeName:"img",3547 src:ASGetSrcByName("anchorListEndCover"),3548 style:{3549 marginTop:-2,3550 marginBottom:-1,3551 transformOrigin:"50% 50%",3552 transform:{3553 rotate:180,3554 },3555 },3556 });3557 target.lightF.appendChild(target.lightE2);3558 target.blockC=ASElement({3559 nodeName:"div",3560 style:{3561 position:"relative",3562 top:buildP.size*1.1,3563 left:14,3564 },3565 });3566 target.appendChild(target.blockC);3567 target.block=[];3568 for (var i=0;i<buildP.block.length;i++) {3569 var alpha=0;3570 if (i==target.blockNum) alpha=1;3571 target.block[target.block.length]=ASElement({3572 nodeName:"div",3573 style:{3574 display:"block",3575 marginTop:buildP.size*0.2+target.space,3576 cursor:"pointer",3577 overflow:"hidden",3578 },3579 onmouseover:AnchorListStr.blockOnmouseover,3580 onmouseout:AnchorListStr.blockOnmouseout,3581 onmousedown:AnchorListStr.blockOnmousedown,3582 onmouseup:AnchorListStr.blockOnmouseup,3583 onclick:AnchorListStr.blockOnclick,3584 num:i,3585 });3586 var block=target.block[target.block.length-1];3587 target.blockC.appendChild(block);3588 block.bottom=ASElement({3589 nodeName:"div",3590 style:{3591 position:"relative",3592 borderRadius:"0 "+buildP.size*0.3+"px "+buildP.size*0.3+"px 0",3593 backgroundColor:"rgb(240,0,0)",3594 width:"100%",3595 height:"100%",3596 opacity:alpha,3597 },3598 })3599 block.appendChild(block.bottom);3600 block.content=ASElement({3601 nodeName:"div",3602 style:{3603 position:"relative",3604 left:0,3605 width:"100%",3606 },3607 });3608 block.appendChild(block.content);3609 block.word=ASElement({3610 nodeName:"div",3611 style:{3612 position:"relative",3613 top:-target.size*0.12,3614 left:target.size*0.1,3615 marginLeft:buildP.size*0.2,3616 marginRight:buildP.size*0.6,3617 }3618 });3619 block.content.appendChild(block.word);3620 block.wordR=BasicWord({3621 size:buildP.size,3622 sizeE:buildP.size*0.8,3623 wordC:buildP.block[i].wordC,3624 wordE:buildP.block[i].wordE,3625 color:"rgb(200,0,0)",3626 style:{3627 maxWidth:buildP.widthA-40,3628 display:"block",3629 pointerEvents:"none",3630 }3631 });3632 block.word.appendChild(block.wordR);3633 block.wordW=BasicWord({3634 size:buildP.size,3635 sizeE:buildP.size*0.8,3636 wordC:buildP.block[i].wordC,3637 wordE:buildP.block[i].wordE,3638 color:"white",3639 style:{3640 top:0,3641 position:"absolute",3642 opacity:alpha,3643 maxWidth:buildP.widthA-40,3644 pointerEvents:"none",3645 },3646 });3647 block.word.appendChild(block.wordW);3648 }3649 target.resize=AnchorListStr.resize;3650 target.resize();3651 target.changeBlock=AnchorListStr.changeBlock;3652 delete buildP.block;3653 target.set(buildP);3654 return(target);3655 }3656 var PageListStr=new function() {3657 PageListList=[];3658 this.resize=function() {3659 for (var i=0;i<this.block.length;i++) {3660 this.block[i].set({style:{3661 height:ASGetElementHeight(this.block[i].wordR)+15,3662 }});3663 this.block[i].word.set({style:{3664 top:-ASGetElementHeight(this.block[i].wordR)-7.5,3665 }});3666 }3667 }3668 this.changeBlock=function(w) {3669 if (this.blockNum==w) return;3670 for (var i=0;i<this.block.length;i++) {3671 if (i==w) continue;3672 this.block[i].bottom.setTarget({opacity:0});3673 this.block[i].wordW.setTarget({opacity:0});3674 }3675 this.block[w].bottom.setTarget({opacity:1});3676 this.block[w].wordW.setTarget({opacity:1});3677 this.blockNum=w;3678 }3679 this.blockOnmouseover=function() {3680 this.word.setTarget({transform:{translateX:5}});3681 }3682 this.blockOnmouseout=function() {3683 this.word.setTarget({transform:{translateX:0}});3684 }3685 this.blockOnmousedown=function() {3686 this.word.setTarget({transform:{translateX:2}});3687 }3688 this.blockOnmouseup=function() {3689 this.word.setTarget({transform:{translateX:5}});3690 }3691 this.blockOnclick=function() {3692 if (this.parentNode.onchoose) this.parentNode.onchoose(this.num);3693 this.parentNode.changeBlock(this.num);3694 }3695 }3696 function PageList(buildP) {3697 if (!buildP.size) buildP.size=24;3698 if (!buildP.widthA) buildP.widthA=140;3699 var target=ASElement({3700 nodeName:"div",3701 style:{3702 width:buildP.widthA,3703 },3704 });3705 PageListList[PageListList.length]=target;3706 target.block=[];3707 for (var i=0;i<buildP.block.length;i++) {3708 target.appendChild(ASElement({3709 nodeName:"img",3710 src:ASGetSrcByName("pageListLine"),3711 style:{3712 width:"100%",3713 },3714 }));3715 target.block[i]=ASElement({3716 nodeName:"div",3717 style:{3718 cursor:"pointer",3719 },3720 onmouseover:PageListStr.blockOnmouseover,3721 onmouseout:PageListStr.blockOnmouseout,3722 onmousedown:PageListStr.blockOnmousedown,3723 onmouseup:PageListStr.blockOnmouseup,3724 onclick:PageListStr.blockOnclick,3725 num:i,3726 value:buildP.block[i],3727 });3728 target.appendChild(target.block[i]);3729 var block=target.block[i];3730 block.bottom=ASElement({3731 nodeName:"img",3732 src:ASGetSrcByName("pageListBlock"),3733 style:{3734 width:"100%",3735 height:"100%",3736 opacity:0,3737 },3738 });3739 block.appendChild(block.bottom);3740 block.word=ASElement({3741 nodeName:"div",3742 style:{3743 position:"relative",3744 left:12,3745 },3746 });3747 block.appendChild(block.word);3748 block.wordR=BasicWord({3749 size:buildP.size,3750 sizeE:buildP.size*0.75,3751 color:"rgb(200,0,0)",3752 wordC:buildP.block[i].nameC,3753 wordE:buildP.block[i].nameE,3754 style:{3755 maxWidth:buildP.widthA-20,3756 display:"block",3757 pointerEvents:"none",3758 },3759 });3760 block.word.appendChild(block.wordR);3761 block.wordW=BasicWord({3762 size:buildP.size,3763 sizeE:buildP.size*0.75,3764 color:"white",3765 wordC:buildP.block[i].nameC,3766 wordE:buildP.block[i].nameE,3767 style:{3768 position:"absolute",3769 top:0,3770 maxWidth:buildP.widthA-20,3771 opacity:0,3772 cursor:"pointer",3773 pointerEvents:"none",3774 },3775 });3776 block.word.appendChild(block.wordW);3777 }3778 target.appendChild(ASElement({3779 nodeName:"img",3780 src:ASGetSrcByName("pageListLine"),3781 style:{3782 width:"100%",3783 },3784 }));3785 target.resize=PageListStr.resize;3786 target.resize();3787 target.changeBlock=PageListStr.changeBlock;3788 target.changeBlock(0);3789 delete buildP.block;3790 target.set(buildP);3791 return(target);3792 }3793 var HeadIconStr=new function() {3794 this.onmouseover=function() {3795 this.setTarget({transform:{scale:1}});3796 this.pic.setTarget({opacity:1});3797 this.wMouseOver=true;3798 INTERFACE_L.head.changeLabel(this);3799 }3800 this.onmouseout=function() {3801 this.setTarget({transform:{scale:1}});3802 this.pic.setTarget({opacity:0});3803 this.wMouseOver=false;3804 INTERFACE_L.head.changeLabel(null);3805 }3806 this.onmousedown=function() {3807 this.setTarget({transform:{scale:0.9}});3808 this.pic.setTarget({opacity:1});3809 }3810 this.onmouseup=function() {3811 this.setTarget({transform:{scale:1}});3812 this.pic.setTarget({opacity:1});3813 }3814 this.onclick=function() {3815 this.onmouseout();3816 changeURL(this.linkTo);3817 }3818 }3819 function HeadIcon(buildP) {3820 var target=ASElement({3821 nodeName:"div",3822 style:{3823 width:DEFAULT_HEAD_ICON_SIZE,3824 height:DEFAULT_HEAD_ICON_SIZE,3825 backgroundImage:"url('"+buildP.src+".png"+"')",3826 backgroundSize:"100% 100%",3827 transformOrigin:"50% 50%",3828 cursor:"pointer",3829 },3830 });3831 target.pic=ASElement({3832 nodeName:"img",3833 src:buildP.src+"L.png",3834 style:{3835 opacity:0,3836 width:"100%",3837 height:"100%",3838 cursor:"pointer",3839 },3840 });3841 target.appendChild(target.pic);3842 if (buildP.nameC) {3843 target.word=BasicWord({3844 wordC:buildP.nameC,3845 wordE:buildP.nameE,3846 color:"white",3847 style:{3848 pointerEvents:"none",3849 },3850 });3851 }3852 if (buildP.hyperlink) {3853 target.region=ASElement({3854 nodeName:"a",3855 href:buildP.hyperlink,3856 target:"_blank",3857 });3858 target.appendChild(target.region);3859 target.region.appendChild(target.pic);3860 }3861 target.onmouseover=HeadIconStr.onmouseover;3862 target.onmouseout=HeadIconStr.onmouseout;3863 target.onmousedown=HeadIconStr.onmousedown;3864 target.onmouseup=HeadIconStr.onmouseup;3865 if (buildP.linkTo) target.onclick=HeadIconStr.onclick;3866 target.set(buildP);3867 return(target);3868 }3869 //Component(end)3870 function ASInitialize() {3871 UserDataList=[3872 "user",3873 "ticket",3874 "target",3875 "studentID",3876 "place",3877 "post",3878 "name",3879 "nickname",3880 "sex",3881 "phone",3882 "school",3883 "enroll",3884 "addEnroll",3885 "payto",3886 ];3887 USERDATA="NULL";3888 TARGETDATA="NULL";3889 FUNCDATA=[];3890 RequestTargetDataCallbackS=null;3891 RequestTargetDataCallbackF=null;3892 FUNCDATA={};3893 RequestFunctionDataCallbackS=null;3894 RequestFunctionDataCallbackF=null;3895 PostDataR={};3896 PostDataCallback=null;3897 JumpPros={};3898 JumpProsF={};3899 JumpProsL={};3900 var data=ASGetSourceByName("data0");3901 var data_head=data.getNodeByName("head");3902 var data_head_icon=data_head.getNodeByName("icon");3903 for (var i=0;i<data_head_icon.getNodeByName("left").node.length;i++) {3904 ASAddASourceName({name:"icon_"+data_head_icon.getNodeByName("left").node[i].getAttribute("name"),src:data_head_icon.getAttribute("root")+data_head_icon.getNodeByName("left").node[i].getAttribute("name")+".png"});3905 ASAddASourceName({name:"icon_"+data_head_icon.getNodeByName("left").node[i].getAttribute("name")+"L",src:data_head_icon.getAttribute("root")+data_head_icon.getNodeByName("left").node[i].getAttribute("name")+"L.png"});3906 }3907 for (var i=0;i<data_head_icon.getNodeByName("right").node.length;i++) {3908 ASAddASourceName({name:"icon_"+data_head_icon.getNodeByName("right").node[i].getAttribute("name"),src:data_head_icon.getAttribute("root")+data_head_icon.getNodeByName("right").node[i].getAttribute("name")+".png"});3909 ASAddASourceName({name:"icon_"+data_head_icon.getNodeByName("right").node[i].getAttribute("name")+"L",src:data_head_icon.getAttribute("root")+data_head_icon.getNodeByName("right").node[i].getAttribute("name")+"L.png"});3910 }3911 var data_cardBoard=data.getNodeByName("cardBoard");3912 ASAddASourceBuild({src:data_cardBoard.getAttribute("sceneRoot")+data_cardBoard.getNodeByName("main").getAttribute("scene")});3913 for (var i=0;i<data_cardBoard.node.length;i++) {3914 var cardBoard=data_cardBoard.node[i];3915 for (var j=0;j<cardBoard.getNodeByName("card").node.length;j++) {3916 var img=cardBoard.getNodeByName("card").node[j].getNodeByName("img");3917 ASAddASourceName({src:img.getAttribute("root")+img.node[0].getAttribute("name")});3918 }3919 }3920 for (var i=0;i<data_cardBoard.node.length;i++) {3921 if (data_cardBoard.node[i].nodeName=="main") continue;3922 ASAddASourceWait({src:data_cardBoard.getAttribute("sceneRoot")+data_cardBoard.node[i].getAttribute("scene")});3923 }3924 var data_frame=data.getNodeByName("frame");3925 for (var i=0;i<data_frame.node.length;i++) {3926 ASAddASourceBuild({src:data_frame.node[i].getAttribute("titleImg")});3927 ASAddASourceBuild({src:data_frame.node[i].getAttribute("titleImg").replace("title","title2")});3928 if (data_frame.node[i].getAttribute("scene")) {3929 ASAddASourceWait({src:data_frame.getAttribute("sceneRoot")+data_frame.node[i].getAttribute("scene")});3930 }3931 }3932 var data_functionC=data.getNodeByName("functionC");3933 // console.log(data_functionC.getAttribute("root"));3934 for (var i=0;i<data_functionC.node.length;i++) {3935 var src = data_functionC.getAttribute("root")+ data_functionC.node[i].getAttribute("img");3936 // var src=data_functionC.node[i].getNodeByName("imgB").getAttribute("root")+"(1).jpg";3937 ASAddASourceName({src:src});3938 }3939 var data_sponsor=data.getNodeByName("sponsor");3940 for (var i=0;i<data_sponsor.node.length;i++) {3941 var src=data_sponsor.getAttribute("root")+data_sponsor.node[i].getAttribute("pic");3942 ASAddASourceWait({src:src});3943 }3944 DEFAULT_LANG="C";3945 DEFAULT_FONT="Microsoft Yahei";3946 if (ASDetectFont("Microsoft Yahei")) {3947 DEFAULT_FONTLIST=[3948 ["Microsoft Yahei","å¾®è»é
é»",1],3949 ["SimHei","é»é«",1],3950 ["SimSun","å®é«",1],3951 ["KaiTi","楷é«",1],3952 ["Arial","Arial",1],3953 ["Verdana","Verdana",0.95],3954 ["Times New Roman","Times New Roman",0.95],3955 ["Comic Sans MS","Comic Sans MS",0.85],3956 ];3957 } else {3958 DEFAULT_FONT="Microsoft Yahei";3959 DEFAULT_FONTLIST=[3960 ["STHeiti","é»é«",1],3961 ["STSong","å®é«",1],3962 ["BiauKai","楷é«",1],3963 ["Arial","Arial",1],3964 ["Verdana","Verdana",0.95],3965 ["Times New Roman","Times New Roman",0.95],3966 ["Comic Sans MS","Comic Sans MS",0.85],3967 ];3968 }3969 if (ASBrowser=="Mobile") {3970 DEFAULT_FONT="Droid Sans Fallback";3971 }3972 DEFAULT_WORD_WIDTH=180;3973 DEFAULT_SCROLLBAR_WIDTH=15;3974 DEFAULT_ROLLBAR_WIDTH=7;3975 DEFAULT_TOPLOGO_WIDTH=606;3976 DEFAULT_TOPLOGO_HEIGHT=231;3977 DEFAULT_USER_IMG_WIDTH=121;3978 DEFAULT_USER_IMG_HEIGHT=150;3979 DEFAULT_CARDBOARD_WIDTH_L=100;3980 DEFAULT_CARDBOARD_HEIGHT_L=100;3981 DEFAULT_CARDBOARD_SPACE=10;3982 DEFAULT_CARD_RADIUS=2;3983 DEFAULT_FLASHIMG_TIMESPACE=6000;3984 DEFAULT_SEARCHER_SIZE=60;3985 DEFAULT_SEARCHER_RADIUS=6;3986 DEFAULT_SEARCHER_SPACE=8;3987 DEFAULT_CARDBOARD_APPEAR_WAITING=7;3988 DEFAULT_SCENE=data_cardBoard.getAttribute("sceneRoot")+data_cardBoard.getNodeByName("main").getAttribute("scene");3989 DEFAULT_CARDBOARD_BACK_X=15;3990 DEFAULT_CARDBOARD_BACK_Y=11;3991 DEFAULT_HEAD_HEIGHT=45;3992 DEFAULT_HEAD_ICON_SIZE=42;3993 DEFAULT_NOTICE_WIDTH=500;3994 DEFAULT_SHELL_WIDTH=870;3995 DEFAULT_SHELL_HEAD_HEIGHT=150;3996 DEFAULT_SHELL_CLOSE_SIZE=45;3997 DEFAULT_SHELL_BOTTOM_HEIGHT=65;3998 DEFAULT_FRAME_WIDTH=1064;3999 DEFAULT_FRAME_HEAD_MINHEIGHT=160;4000 DEFAULT_FRAME_LINK_HEIGHT=45;4001 DEFAULT_FRAME_JUMP_WIDTHL=30;4002 DEFAULT_FRAME_JUMP_WIDTHA=145;4003 DEFAULT_FRAME_BOTTOM_HEIGHT=80;4004 DEFAULT_PAGE_WIDTH=870;4005 DEFAULT_PAGE_WIDTHH=975;4006 DEFAULT_PAGE_WIDTHM=910;4007 DEFAULT_PAGE_WIDTHL=770;4008 DEFAULT_EDITOR_ICON_SIZE0=98;4009 DEFAULT_EDITOR_ICON_SIZE=45;4010 VERTICAL_SHELL_WIDTH=820;4011 VERTICAL_SHELL_HEAD_HEIGHT=250;4012 VERTICAL_SHELL_CLOSE_SIZE=80;4013 VERTICAL_SHELL_BOTTOM_HEIGHT=80;4014 VERTICAL_HEAD_HEIGHT=80;4015 VERTICAL_HEAD_ICON_SIZE=72;4016 VERTICAL_FRAME_WIDTH=980;4017 VERTICAL_FRAME_HEAD_MINHEIGHT=260;4018 VERTICAL_FRAME_DIVIDEBAR_HEIGHT=20;4019 VERTICAL_FRAME_LINK_HEIGHT=75;4020 VERTICAL_FRAME_JUMP_WIDTHL=30;4021 VERTICAL_FRAME_JUMP_WIDTHA=260;4022 VERTICAL_FRAME_BOTTOM_HEIGHT=80;4023 VERTICAL_PAGE_WIDTH=900;4024 VERTICAL_PAGE_WIDTHH=950;4025 VERTICAL_PAGE_WIDTHL=800;4026 }4027 function buildScene() {4028 SCENE=ASElement({4029 nodeName:"div",4030 style:{4031 position:"absolute",4032 },4033 });4034 SCENE.currentPic="main.png";4035 SCENE.pic0=ASElement({4036 nodeName:"img",4037 src:"Image/Scene/main.png",4038 onload:function() {4039 SCENE.reload(this.src);4040 },4041 });4042 SCENE.picF=ASElement({4043 nodeName:"div",4044 });4045 SCENE.appendChild(SCENE.picF);4046 SCENE.copyright=ASElement({4047 nodeName:"p",4048 innerHTML:"©2019-2020 Chinese Folk Art Society, HKUSTSU. All Right Reserved.",4049 style:{4050 position:"absolute",4051 transformOrigin:"50% 100%",4052 fontFamily:DEFAULT_FONT,4053 fontSize:15,4054 color:"white",4055 width:1000,4056 left:ASWindowWidth/2-500,4057 top:ASWindowHeight-30,4058 textAlign:"center",4059 textShadow:"2px 2px 5px rgba(0,0,0,0.8)",4060 pointerEvents:"none",4061 },4062 });4063 SCENE.appendChild(SCENE.copyright);4064 if (ASVersion=="vertical") SCENE.copyright.set({style:{transform:{scale:1.6}}});4065 SCENE.reload=function(src) {4066 if (this.pic) {4067 this.picF.removeChild(this.pic);4068 this.pic0=this.pic;4069 this.pic=null;4070 }4071 ROOT.set({style:{4072 backgroundImage:"url("+src+")",4073 }});4074 this.resize();4075 }4076 SCENE.resize=function() {4077 var width=ASWindowWidth,height=ASWindowHeight;4078 var scale=Math.max(width/this.pic0.naturalWidth,height/this.pic0.naturalHeight);4079 ROOT.set({style:{4080 width:width,4081 height:height,4082 backgroundSize:this.pic0.naturalWidth*scale+"px "+this.pic0.naturalHeight*scale+"px",4083 backgroundPosition:"center",4084 }});4085 if (this.pic) {4086 var scale=Math.max(width/this.pic.naturalWidth,height/this.pic.naturalHeight);4087 this.pic.set({wPrint:true,style:{4088 left:(width-this.pic.naturalWidth*scale)/2,4089 top:(height-this.pic.naturalHeight*scale)/2,4090 width:this.pic.naturalWidth*scale,4091 height:this.pic.naturalHeight*scale,4092 }});4093 }4094 this.copyright.set({style:{4095 left:ASWindowWidth/2-500,4096 top:ASWindowHeight-30,4097 }});4098 }4099 SCENE.changeVersion=function() {4100 if (ASVersion=="horizon") {4101 this.copyright.set({style:{transform:{scale:1}}});4102 } else {4103 this.copyright.set({style:{transform:{scale:1.6}}});4104 }4105 }4106 SCENE.nextAppear=function() {4107 this.setTimeout(function() {this.pic.setTarget({4108 opacity:1,4109 speed_alpha:0.05,4110 });},10);4111 this.resize();4112 this.setTimeout(function() {4113 if (!this.pic) return;4114 this.reload(this.pic.src);4115 },1000);4116 }4117 SCENE.change=function(pic) {4118 if (pic==this.currentPic) return;4119 this.currentPic=pic;4120 if (this.pic) this.picF.removeChild(this.pic);4121 this.pic=ASElement({4122 nodeName:"img",4123 src:"Image/Scene/"+pic,4124 onload:function() {4125 SCENE.nextAppear();4126 },4127 style:{4128 position:"relative",4129 opacity:0,4130 },4131 });4132 this.picF.appendChild(this.pic);4133 }4134 ROOT.appendChild(SCENE);4135 }4136 function buildPage_News() {4137 PAGE["news"]=ASElement({4138 nodeName:"div",4139 wCenter:true,4140 style:{4141 width:DEFAULT_PAGE_WIDTHL,4142 marginBottom:30,4143 },4144 });4145 PAGE["news"].build=function() {4146 this.wBuild=true;4147 var y0=0;4148 var data=ASGetSourceByName("data0").getNodeByName("news");4149 this.block=[];4150 for (var i=0;i<data.node.length;i++) {4151 if (i>0) {4152 this.appendChild(ASElement({nodeName:"hr"}));4153 }4154 this.block[i]=ASElement({4155 nodeName:"div",4156 style:{4157 width:DEFAULT_PAGE_WIDTH,4158 marginTop:40,4159 marginBottom:40,4160 },4161 });4162 this.appendChild(this.block[i]);4163 var block=this.block[i];4164 block.titleF=BasicTitle({4165 size:28,4166 wordC:data.node[i].getAttribute("titleC"),4167 wordE:data.node[i].getAttribute("titleE"),4168 widthA:DEFAULT_PAGE_WIDTHL-150,4169 });4170 block.appendChild(block.titleF);4171 block.time=BasicWord({4172 size:25,4173 wordC:data.node[i].getAttribute("timeY")+"/"+data.node[i].getAttribute("timeD"),4174 color:"rgb(200,0,0)",4175 style:{4176 },4177 });4178 block.appendChild(block.time);4179 block.word=BasicWord({4180 size:24,4181 wordC:data.node[i].getAttribute("wordC"),4182 wordE:data.node[i].getAttribute("wordE"),4183 style:{4184 width:DEFAULT_PAGE_WIDTHL-40,4185 marginTop:20,4186 marginLeft:20,4187 },4188 });4189 block.appendChild(block.word);4190 this.anchor[i].pos0=y0;4191 this.anchor[i].pos1=y0+ASGetElementHeight(block);4192 y0+=ASGetElementHeight(block)+80;4193 }4194 }4195 var data=ASGetSourceByName("data0").getNodeByName("news");4196 var page=PAGE["news"];4197 page.anchor=[];4198 for (var i=0;i<data.node.length;i++) {4199 page.anchor[i]={4200 wordC:data.node[i].getAttribute("titleC"),4201 wordE:data.node[i].getAttribute("titleE"),4202 };4203 }4204 }4205 function buildPageV_News() {4206 PAGE_V["news"]=ASElement({4207 nodeName:"div",4208 wCenter:true,4209 style:{4210 width:VERTICAL_PAGE_WIDTHL,4211 marginBottom:30,4212 },4213 });4214 PAGE_V["news"].build=function() {4215 this.wBuild=true;4216 var y0=0;4217 var data=ASGetSourceByName("data0").getNodeByName("news");4218 this.block=[];4219 for (var i=0;i<data.node.length;i++) {4220 if (i>0) {4221 this.appendChild(ASElement({nodeName:"hr"}));4222 }4223 this.block[i]=ASElement({4224 nodeName:"div",4225 style:{4226 width:DEFAULT_PAGE_WIDTH,4227 marginTop:40,4228 marginBottom:40,4229 },4230 });4231 this.appendChild(this.block[i]);4232 var block=this.block[i];4233 block.titleF=BasicTitle({4234 size:60,4235 wordC:data.node[i].getAttribute("titleC"),4236 wordE:data.node[i].getAttribute("titleE"),4237 widthA:VERTICAL_PAGE_WIDTHL,4238 });4239 block.appendChild(block.titleF);4240 block.time=BasicWord({4241 size:40,4242 wordC:data.node[i].getAttribute("timeY")+"/"+data.node[i].getAttribute("timeD"),4243 color:"rgb(200,0,0)",4244 style:{4245 marginTop:20,4246 marginLeft:33,4247 },4248 });4249 block.appendChild(block.time);4250 block.word=BasicWord({4251 size:45,4252 wordC:data.node[i].getAttribute("wordC"),4253 wordE:data.node[i].getAttribute("wordE"),4254 style:{4255 width:DEFAULT_PAGE_WIDTHL-40,4256 marginTop:20,4257 marginLeft:20,4258 },4259 });4260 block.appendChild(block.word);4261 this.anchor[i].pos0=y0;4262 this.anchor[i].pos1=y0+ASGetElementHeight(block);4263 y0+=ASGetElementHeight(block)+80;4264 }4265 }4266 var data=ASGetSourceByName("data0").getNodeByName("news");4267 var page=PAGE_V["news"];4268 page.anchor=[];4269 for (var i=0;i<data.node.length;i++) {4270 page.anchor[i]={4271 wordC:data.node[i].getAttribute("titleC"),4272 wordE:data.node[i].getAttribute("titleE"),4273 };4274 }4275 }4276 function buildPage_FunctionC() {4277 // functionC (ç¾å¨çæ´»åç製ä½é é¢)4278 PAGE["functionC"]=ASElement({4279 nodeName:"div",4280 style:{4281 width:DEFAULT_PAGE_WIDTH,4282 marginTop:30,4283 marginBottom:20,4284 },4285 });4286 PAGE["functionC"].build=function() {4287 this.wBuild=true;4288 var data=ASGetSourceByName("data0").getNodeByName("functionC");4289 this.block=[];4290 for (var i=0;i<data.node.length;i++) {4291 this.block[this.block.length]=ASElement({4292 nodeName:"div",4293 style:{4294 position:"relative",4295 width:DEFAULT_PAGE_WIDTH,4296 height:360,4297 },4298 });4299 var block=this.block[this.block.length-1];4300 this.appendChild(block);4301 // æ é¢4302 block.titleC=ASElement({4303 nodeName:"div",4304 style:{4305 minWidth:300,4306 height:40,4307 backgroundColor:"rgb(220,0,0)",4308 borderRadius:"0 4px 4px 0",4309 boxShadow:"3px 3px 5px rgba(0,0,0,0.8)",4310 cursor:"default",4311 paddingRight:40,4312 },4313 // è·åæ´»å¨ååï¼åå°funcName4314 funcName:data.node[i].getAttribute('name'),4315 onmouseover:function() {4316 // this.word.setTarget({transform:{translateX:5}});4317 },4318 onmouseout:function() {4319 // this.word.setTarget({transform:{translateX:0}});4320 },4321 onmousedown:function() {4322 // this.word.setTarget({transform:{translateX:2}});4323 },4324 onmouseup:function() {4325 // this.word.setTarget({transform:{translateX:5}});4326 },4327 onclick:function() {4328 // changeURL(this.funcName);4329 },4330 });4331 block.appendChild(block.titleC);4332 block.titleC.word=BasicWord({4333 size:26,4334 color:"white",4335 wordC:data.node[i].getAttribute("nameC"),4336 wordE:data.node[i].getAttribute("nameE"),4337 width:"max",4338 style:{4339 position:"relative",4340 left:20,4341 top:3.5,4342 pointerEvents:"none",4343 },4344 });4345 block.titleC.appendChild(block.titleC.word);4346 block.enroll=ASElement({4347 nodeName:"div",4348 style:{4349 position:"relative",4350 width:DEFAULT_PAGE_WIDTH-ASGetElementWidth(block.titleC)-10,4351 height:28,4352 },4353 });4354 block.appendChild(block.enroll);4355 block.enroll.pic=ASElement({4356 nodeName:"div",4357 style:{4358 position:"absolute",4359 height:45,4360 left:30,4361 },4362 });4363 block.enroll.appendChild(block.enroll.pic);4364 var name=data.node[i].getAttribute("enroll");4365 var id=data.node[i].nodeName;4366 if (USERDATA!="NULL" && USERDATA.func[id]) {4367 if (USERDATA.func[id].status==",") name="paying";4368 if (USERDATA.func[id].status==".") name="success";4369 }4370 block.enroll.pic.appendChild(ASElement({4371 nodeName:"img",4372 src:ASGetSrcByName("enroll_"+name),4373 style:{4374 height:"100%",4375 },4376 }));4377 var wordC="",wordE="",color="";4378 switch (name) {4379 case "ban":4380 wordC="éå ±åæ´»å";4381 wordE="Not available";4382 color="rgb(200,200,200)";4383 break;4384 case "past":4385 wordC="å·²çµæ";4386 wordE="Past";4387 color="rgb(150,150,150)";4388 break;4389 case "waiting":4390 color="rgb(200,0,0)";4391 wordC="å³å°å°ä¾";4392 wordE="Incoming";4393 break;4394 case "available":4395 wordC="å¿«ä¾å ±åï¼";4396 wordE="Sign Up Now!";4397 color="rgb(230,0,0)";4398 break;4399 case "full":4400 wordC="åé¡å·²æ»¿";4401 wordE="Places are full";4402 color="rgb(230,0,0)";4403 break;4404 case "paying":4405 wordC="çå¾
ä»æ¬¾";4406 wordE="Paying";4407 color="rgb(200,0,0)";4408 break;4409 case "success":4410 wordC="å·²å ±å";4411 wordE="Registered";4412 color="rgb(0,200,0)";4413 break;4414 }4415 block.enroll.word=BasicWord({4416 size:25,4417 wordC:wordC,4418 wordE:wordE,4419 color:color,4420 style:{4421 position:"absolute",4422 left:80,4423 top:7,4424 },4425 });4426 block.enroll.appendChild(block.enroll.word);4427 block.date=BasicWord({4428 size:25,4429 color:"rgb(230,0,0)",4430 wordC:data.node[i].getAttribute("date"),4431 wordE:data.node[i].getAttribute("date"),4432 style:{4433 position:"absolute",4434 right:0,4435 top:5,4436 },4437 });4438 block.appendChild(block.date);4439 //ä»ç´¹ä¿¡æ¯4440 block.intro=BasicWord({4441 size:22,4442 wordC:data.node[i].getAttribute("briefC"),4443 wordE:data.node[i].getAttribute("briefE"),4444 style:{4445 width:"48%",4446 marginLeft:30,4447 marginTop:20,4448 textAlign:"justify",4449 lineHeight:1.5,4450 },4451 });4452 block.appendChild(block.intro);4453 var img=[];4454 // var imgN=parseInt(data.node[i].getNodeByName("imgB").getAttribute("imgN"));4455 img[0] = data.getAttribute("root")+ data.node[i].getAttribute("img");4456 // var imageURL = ;4457 4458 // for (var j=1;j<=imgN;j++) {4459 // img[img.length]=data.node[i].getNodeByName("imgB").getAttribute("root")+"("+j+").jpg";4460 // }4461 block.imgC=ASElement({4462 nodeName:"div",4463 imageURL:data.getAttribute("root")+ data.node[i].getAttribute("img"),4464 imageNameC:data.getAttribute("root")+ data.node[i].getAttribute("nameC"),4465 imageNameE:data.getAttribute("root")+ data.node[i].getAttribute("nameE"),4466 style:{4467 float:"right",4468 width:390,4469 height:260,4470 marginTop:15,4471 },4472 onmouseover:function() {4473 this.style.cursor = 'pointer';4474 },4475 onclick:function() {4476 4477 changeURL("image?imageURL="+this.imageURL+"&nameC="+this.imageNameC+"&nameE="+this.imageNameE);4478 },4479 });4480 block.appendChild(block.imgC);4481 if (data.node[i].getAttribute("facebookL")) {4482 block.imgA=ASElement({4483 nodeName:"a",4484 href:data.node[i].getAttribute("facebookL").replace("%26","&"),4485 target:"_blank",4486 title:"facebook",4487 });4488 block.imgC.appendChild(block.imgA);4489 }4490 block.img=FlashImg({4491 type:"response",4492 widthA:390,4493 heightA:260,4494 imgSize:"intelligent", // æ´»åç
§çæ¯ä¾4495 img:img,4496 timeSpace:1500,4497 style:{4498 backgroundColor:"#fafafa",4499 },4500 });4501 if (data.node[i].getAttribute("facebookL")) block.imgA.appendChild(block.img);4502 else block.imgC.appendChild(block.img);4503 }4504 this.anchor=[];4505 var data=ASGetSourceByName("data0").getNodeByName("functionC");4506 for (var i=0;i<data.node.length;i++) {4507 this.anchor[i]={4508 wordC:data.node[i].getAttribute("nameC"),4509 wordE:data.node[i].getAttribute("nameE"),4510 pos0:i*ASGetElementHeight(this.block[i]),4511 pos1:(i+1)*ASGetElementHeight(this.block[i]),4512 };4513 }4514 }4515 PAGE["functionC"].anchor=[];4516 var data=ASGetSourceByName("data0").getNodeByName("functionC");4517 for (var i=0;i<data.node.length;i++) {4518 PAGE["functionC"].anchor[i]={4519 wordC:data.node[i].getAttribute("nameC"),4520 wordE:data.node[i].getAttribute("nameE"),4521 };4522 }4523 }4524 function buildPageV_FunctionC() {4525 PAGE_V["functionC"]=ASElement({4526 nodeName:"div",4527 style:{4528 width:VERTICAL_PAGE_WIDTH,4529 marginTop:30,4530 marginBottom:20,4531 },4532 });4533 PAGE_V["functionC"].build=function() {4534 this.wBuild=true;4535 var data=ASGetSourceByName("data0").getNodeByName("functionC");4536 this.block=[];4537 for (var i=0;i<data.node.length;i++) {4538 this.block[this.block.length]=ASElement({4539 nodeName:"div",4540 style:{4541 position:"relative",4542 width:VERTICAL_PAGE_WIDTH,4543 },4544 });4545 var block=this.block[this.block.length-1];4546 this.appendChild(block);4547 block.titleC=ASElement({4548 nodeName:"div",4549 style:{4550 position:"relative",4551 top:15,4552 minWidth:400,4553 height:80,4554 backgroundColor:"rgb(220,0,0)",4555 borderRadius:"0 4px 4px 0",4556 boxShadow:"3px 3px 5px rgba(0,0,0,0.8)",4557 cursor:"pointer",4558 paddingRight:40,4559 },4560 funcID:data.node[i].nodeName,4561 onmouseover:function() {4562 // this.word.setTarget({transform:{translateX:10}});4563 },4564 onmouseout:function() {4565 // this.word.setTarget({transform:{translateX:0}});4566 },4567 onmousedown:function() {4568 // this.word.setTarget({transform:{translateX:4}});4569 },4570 onmouseup:function() {4571 // this.word.setTarget({transform:{translateX:10}});4572 },4573 onclick:function() {4574 // changeURL(this.funcID);4575 },4576 });4577 block.appendChild(block.titleC);4578 block.titleC.word=BasicWord({4579 size:50,4580 color:"white",4581 wordC:data.node[i].getAttribute("nameC"),4582 wordE:data.node[i].getAttribute("nameE"),4583 width:"max",4584 style:{4585 position:"relative",4586 left:20,4587 top:5,4588 pointerEvents:"none",4589 },4590 });4591 block.titleC.appendChild(block.titleC.word);4592 block.date=BasicWord({4593 size:55,4594 color:"rgb(230,0,0)",4595 wordC:data.node[i].getAttribute("date"),4596 wordE:data.node[i].getAttribute("date"),4597 style:{4598 position:"absolute",4599 right:0,4600 top:17,4601 },4602 });4603 block.appendChild(block.date);4604 block.appendChild(ASElement("br"));4605 block.enroll=ASElement({4606 nodeName:"div",4607 style:{4608 marginTop:35,4609 marginleft:70,4610 height:56,4611 },4612 });4613 block.appendChild(block.enroll);4614 block.enroll.pic=ASElement({4615 nodeName:"div",4616 style:{4617 position:"absolute",4618 height:65,4619 left:25,4620 },4621 });4622 block.enroll.appendChild(block.enroll.pic);4623 var name=data.node[i].getAttribute("enroll");4624 if (USERDATA!="NULL" && USERDATA.func[data.node[i].nodeName]) {4625 if (USERDATA.func[data.node[i].nodeName].status==",") name="paying";4626 if (USERDATA.func[data.node[i].nodeName].status==".") name="success";4627 }4628 block.enroll.pic.appendChild(ASElement({4629 nodeName:"img",4630 src:ASGetSrcByName("enroll_"+name),4631 style:{4632 height:"100%",4633 },4634 }));4635 var wordC="",wordE="",color="";4636 switch (name) {4637 case "ban":4638 wordC="éå ±åæ´»å";4639 wordE="Not available";4640 color="rgb(200,200,200)";4641 break;4642 case "past":4643 wordC="å·²çµæ";4644 wordE="Past";4645 color="rgb(150,150,150)";4646 break;4647 case "waiting":4648 color="rgb(200,0,0)";4649 wordC="å³å°å°ä¾";4650 wordE="Incoming";4651 break;4652 case "available":4653 wordC="å¿«ä¾å ±åï¼";4654 wordE="Sign Up Now!";4655 color="rgb(230,0,0)";4656 break;4657 case "paying":4658 wordC="çå¾
ä»æ¬¾";4659 wordE="Paying";4660 color="rgb(200,0,0)";4661 break;4662 case "success":4663 wordC="å·²å ±å";4664 wordE="Registered";4665 color="rgb(0,200,0)";4666 break;4667 }4668 block.enroll.word=BasicWord({4669 size:45,4670 wordC:wordC,4671 wordE:wordE,4672 color:color,4673 style:{4674 position:"relative",4675 marginLeft:80,4676 top:-3,4677 },4678 });4679 block.enroll.appendChild(block.enroll.word);4680 var img=[];4681 img[0] = data.getAttribute("root")+ data.node[i].getAttribute("img");4682 //-----4683 block.imgC=ASElement({4684 nodeName:"div",4685 style:{4686 width:750,4687 height:500,4688 marginTop:40,4689 marginLeft:90,4690 },4691 });4692 block.appendChild(block.imgC);4693 block.img=FlashImg({4694 widthA:750,4695 heightA:500,4696 imgSize:"intelligent",4697 img:img,4698 delay:(i-1)*250,4699 style:{4700 backgroundColor:"#fafafa",4701 },4702 });4703 block.imgC.appendChild(block.img);4704 block.intro=BasicWord({4705 size:45,4706 wordC:data.node[i].getAttribute("briefC"),4707 wordE:data.node[i].getAttribute("briefE"),4708 style:{4709 width:VERTICAL_PAGE_WIDTH-150,4710 marginLeft:90,4711 marginTop:40,4712 textAlign:"justify",4713 lineHeight:1.5,4714 },4715 });4716 block.appendChild(block.intro);4717 this.appendChild(ASElement({4718 nodeName:"hr",4719 style:{4720 marginTop:50,4721 marginBottom:20,4722 },4723 }));4724 }4725 this.anchor=[];4726 var data=ASGetSourceByName("data0").getNodeByName("functionC");4727 var y0=0;4728 for (var i=0;i<data.node.length;i++) {4729 this.anchor[i]={4730 wordC:data.node[i].getAttribute("nameC"),4731 wordE:data.node[i].getAttribute("nameE"),4732 pos0:y0,4733 pos1:y0+ASGetElementHeight(this.block[i]),4734 };4735 y0+=ASGetElementHeight(this.block[i])+72;4736 }4737 }4738 PAGE_V["functionC"].anchor=[];4739 var data=ASGetSourceByName("data0").getNodeByName("functionC");4740 for (var i=0;i<data.node.length;i++) {4741 PAGE_V["functionC"].anchor[i]={4742 wordC:data.node[i].getAttribute("nameC"),4743 wordE:data.node[i].getAttribute("nameE"),4744 };4745 }4746 }4747 // Brief4748 function buildPage_FunctionB() {4749 var data=ASGetSourceByName("data0").getNodeByName("functionC");4750 for (var o=0;o<data.node.length;o++) {4751 PAGE[data.node[o].nodeName+"Brief"]=ASElement({4752 nodeName:"div",4753 wCenter:true,4754 style:{4755 width:DEFAULT_PAGE_WIDTHL,4756 marginTop:30,4757 marginBottom:40,4758 },4759 o:o,4760 });4761 PAGE[data.node[o].nodeName+"Brief"].build=function() {4762 this.wBuild=true;4763 var data=ASGetSourceByName("data0").getNodeByName("functionC").node[this.o];4764 this.title1=BasicTitle({4765 wordC:"æ´»åä¿¡æ¯",4766 wordE:"Information",4767 style:{4768 marginBottom:15,4769 },4770 });4771 this.appendChild(this.title1);4772 if (data.getAttribute("date")) {4773 this.date=BasicInput({4774 type:"text",4775 wordC:"æ¥ æ",4776 wordE:"Date",4777 text:[{4778 wordC:data.getAttribute("date"),4779 wordE:data.getAttribute("date"),4780 }],4781 style:{4782 marginLeft:30,4783 },4784 });4785 this.appendChild(this.date);4786 }4787 if (data.getAttribute("time")) {4788 this.time=BasicInput({4789 type:"text",4790 wordC:"æ é",4791 wordE:"Time",4792 text:[{4793 wordC:data.getAttribute("time"),4794 wordE:data.getAttribute("time"),4795 }],4796 style:{4797 marginLeft:30,4798 },4799 });4800 this.appendChild(this.time);4801 }4802 if (data.getAttribute("venue")) {4803 this.venue=BasicInput({4804 type:"text",4805 wordC:"å° é»",4806 wordE:"Venue",4807 text:[{4808 wordC:data.getAttribute("venue"),4809 wordE:data.getAttribute("venue"),4810 }],4811 style:{4812 marginLeft:30,4813 },4814 });4815 this.appendChild(this.venue);4816 }4817 if(data.getAttribute("info")){4818 this.info=BasicInput({4819 type:"text",4820 wordC:"ç® ä»",4821 wordE:"Brief",4822 text:[{4823 wordC:data.getAttribute("info"),4824 wordE:data.getAttribute("info"),4825 }],4826 style:{4827 marginLeft:30,4828 },4829 });4830 this.appendChild(this.info);4831 }4832 }4833 }4834 }4835 function buildPageV_FunctionB() {4836 var data=ASGetSourceByName("data0").getNodeByName("functionC");4837 for (var o=0;o<data.node.length;o++) {4838 PAGE_V[data.node[o].nodeName+"Brief"]=ASElement({4839 nodeName:"div",4840 wCenter:true,4841 style:{4842 width:DEFAULT_PAGE_WIDTHL,4843 marginTop:30,4844 marginBottom:40,4845 },4846 o:o,4847 });4848 PAGE_V[data.node[o].nodeName+"Brief"].build=function() {4849 this.wBuild=true;4850 var data=ASGetSourceByName("data0").getNodeByName("functionC").node[this.o];4851 this.title1=BasicTitle({4852 size:60,4853 wordC:"æ´»åä¿¡æ¯",4854 wordE:"Information",4855 style:{4856 marginBottom:15,4857 },4858 });4859 this.appendChild(this.title1);4860 if (data.getAttribute("date")) {4861 this.date=BasicInput({4862 size:45,4863 type:"text",4864 wordC:"æ¥ æ",4865 wordE:"Date",4866 text:[{4867 wordC:data.getAttribute("date"),4868 wordE:data.getAttribute("date"),4869 }],4870 style:{4871 marginLeft:30,4872 },4873 });4874 this.appendChild(this.date);4875 }4876 if (data.getAttribute("time")) {4877 this.time=BasicInput({4878 size:45,4879 type:"text",4880 wordC:"æ é",4881 wordE:"Time",4882 text:[{4883 wordC:data.getAttribute("time"),4884 wordE:data.getAttribute("time"),4885 }],4886 style:{4887 marginLeft:30,4888 },4889 });4890 this.appendChild(this.time);4891 }4892 if (data.getAttribute("venue")) {4893 this.venue=BasicInput({4894 type:"text",4895 wordC:"å° é»",4896 wordE:"Venue",4897 text:[{4898 wordC:data.getAttribute("venue"),4899 wordE:data.getAttribute("venue"),4900 }],4901 style:{4902 marginLeft:30,4903 },4904 });4905 this.appendChild(this.venue);4906 }4907 if (data.getAttribute("info")){4908 this.info=BasicInput({4909 type:"text",4910 wordC:"ç® ä»",4911 wordE:"Brief",4912 text:[{4913 wordC:data.getAttribute("info"),4914 wordE:data.getAttribute("info"),4915 }],4916 style:{4917 marginLeft:30,4918 },4919 });4920 this.appendChild(this.info);4921 }4922 }4923 }4924 }4925 // 好åæ¯ä¸ªç¨æ¥å signup form ç4926 function buildPage_FunctionS() {4927 var data=ASGetSourceByName("data0").getNodeByName("functionC");4928 for (var o=0;o<data.node.length;o++) {4929 PAGE[data.node[o].nodeName+"Signup"]=ASElement({4930 nodeName:"div",4931 wCenter:true,4932 style:{4933 position:"relative",4934 width:DEFAULT_PAGE_WIDTHL,4935 marginTop:30,4936 marginBottom:30,4937 },4938 o:o,4939 funcID:data.node[o].nodeName,4940 });4941 var page=PAGE[data.node[o].nodeName+"Signup"];4942 page.appear=function() {4943 }4944 page.update=function() {4945 this.clearChild();4946 if (USERDATA=="NULL") {4947 this.appendChild(this.page[0]);4948 return;4949 }4950 if (USERDATA.place=="E") {4951 this.appendChild(this.page[2]);4952 } else {4953 this.appendChild(this.page[1]);4954 var page=this.page[1];4955 page.input["itsc"].setValue(USERDATA.user);4956 page.input["name"].setValue(USERDATA.name);4957 page.input["place"].setValue(USERDATA.place);4958 page.input["studentID"].setValue(USERDATA.studentID);4959 page.input["phone"].setValue(USERDATA.phone);4960 if (USERDATA.place!="N") {4961 page.input["studentID"].input.set({readOnly:true});4962 } else {4963 page.input["studentID"].input.set({readOnly:false});4964 }4965 if (USERDATA.func[this.funcID]) {4966 page.save.word.setWord({4967 wordC:"æ´ æ¹",4968 wordE:"Update",4969 });4970 if (USERDATA.func[this.funcID].status==",") {4971 page.status.img.src=ASGetSrcByName("enroll_paying");4972 page.status.word.setWord({4973 wordC:"çå¾
ä»æ¬¾",4974 wordE:"Paying",4975 });4976 } else {4977 page.status.img.src=ASGetSrcByName("enroll_success");4978 page.status.word.setWord({4979 wordC:"å·²æ¥å",4980 wordE:"Registered",4981 });4982 }4983 page.input["role"].setValue(USERDATA.func[this.funcID].role);4984 page.input["excoList"].setValue(USERDATA.func[this.funcID].payto);4985 } else {4986 page.save.word.setWord({4987 wordC:"æ 交",4988 wordE:"Submit",4989 });4990 page.status.img.src=ASGetSrcByName("enroll_available");4991 page.status.word.setWord({4992 wordC:"æ£å¨å ±å",4993 wordE:"Registering",4994 });4995 }4996 }4997 this.dealFee();4998 this.setTimeout(function(){if (this.root) this.root.pageResize(this);},30);4999 }5000 page.dealFee=function() {5001 var page=this.page[1];5002 var place="N";5003 if (USERDATA!="NULL" && USERDATA.place!="N") place="M";5004 page.input["fee"].setValue(page.input["role"].getValue()+place);5005 if (page.input["fee"].text[page.input["fee"].textC].wordE=="Free") {5006 page.inputF.removeChild(page.input["payway"]);5007 page.inputF.removeChild(page.input["payway"].br);5008 page.inputF.removeChild(page.input["excoList"]);5009 page.inputF.removeChild(page.input["excoList"].br);5010 } else {5011 page.inputF.appendChild(page.input["payway"]);5012 page.inputF.appendChild(page.input["payway"].br);5013 page.inputF.appendChild(page.input["excoList"]);5014 page.inputF.appendChild(page.input["excoList"].br);5015 }5016 var page=this.page[2];5017 var place="N";5018 if (TARGETDATA!="NULL" && TARGETDATA.place!="N") place="M";5019 page.input["fee"].setValue(page.input["role"].getValue()+place);5020 if (page.input["fee"].text[page.input["fee"].textC].wordE=="Free") {5021 page.inputF.removeChild(page.input["payway"]);5022 page.inputF.removeChild(page.input["payway"].br);5023 } else {5024 page.inputF.appendChild(page.input["payway"]);5025 page.inputF.appendChild(page.input["payway"].br);5026 }5027 if (this.root) this.root.pageResize(this);5028 }5029 page.updateTargetData=function() {5030 if (USERDATA=="NULL" || USERDATA.place!="E") return;5031 var page=this.page[2];5032 if (TARGETDATA=="NULL") {5033 page.input["name"].setValue("");5034 page.input["studentID"].setValue("");5035 page.input["studentID"].input.set({readOnly:false});5036 page.input["phone"].setValue("");5037 page.input["place"].setValue("N");5038 } else {5039 page.input["name"].setValue(TARGETDATA.name);5040 page.input["studentID"].setValue(TARGETDATA.studentID);5041 if (TARGETDATA.place!="N") {5042 page.input["studentID"].input.set({readOnly:true});5043 } else {5044 page.input["studentID"].input.set({readOnly:false});5045 }5046 page.input["phone"].setValue(TARGETDATA.phone);5047 page.input["place"].setValue(TARGETDATA.place);5048 }5049 this.dealFee();5050 }5051 page.build=function() {5052 this.wBuild=true;5053 this.page=[];5054 this.page[0]=ASElement({5055 nodeName:"div",5056 root:this,5057 style:{5058 width:DEFAULT_PAGE_WIDTHL,5059 },5060 });5061 var page=this.page[0];5062 page.word=BasicWord({5063 size:60,5064 wordC:"è«å
ç»é",5065 wordE:"Please log in first.",5066 style:{5067 width:"100%",5068 textAlign:"center",5069 marginTop:50,5070 },5071 });5072 page.appendChild(page.word);5073 page.log=BasicButton({5074 size:24,5075 wordC:"ç» å
¥",5076 wordE:"Log in",5077 wCenter:true,5078 style:{5079 marginTop:30,5080 },5081 onclick:function() {5082 changeURL("login");5083 },5084 });5085 page.appendChild(page.log);5086 this.page[1]=ASElement({5087 nodeName:"div",5088 root:this,5089 style:{5090 width:DEFAULT_PAGE_WIDTHL,5091 },5092 });5093 var page=this.page[1];5094 page.succeed=function(type) {5095 if (type=="user") {5096 this.succeedU=true;5097 }5098 if (type=="func") {5099 this.succeedS=true;5100 }5101 if (this.succeedU && this.succeedS) {5102 this.loading.succeed();5103 this.root.setTimeout(function() {5104 USERDATA.func[SignupPagePostFuncData_ID]=SignupPagePostFuncData_DATA;5105 delete PostDataR.banDefault;5106 postUserDataSucceed();5107 this.loading.end();5108 },1000);5109 }5110 }5111 var data=ASGetSourceByName("data0").getNodeByName("functionC").node[this.o];5112 page.inputList=["itsc","name","studentID","phone","place","role","fee","payway","excoList"];5113 page.titleF=BasicTitle({5114 wordC:data.getAttribute("nameC")+" å ±å表",5115 wordE:"Registration Form of<br>"+data.getAttribute("nameE"),5116 style:{5117 marginBottom:15,5118 },5119 });5120 page.appendChild(page.titleF);5121 page.status=ASElement({5122 nodeName:"div",5123 style:{5124 float:"right",5125 },5126 });5127 page.appendChild(page.status);5128 page.status.img=ASElement({5129 nodeName:"img",5130 style:{5131 height:45,5132 },5133 });5134 page.status.appendChild(page.status.img);5135 page.status.word=BasicWord({5136 size:28,5137 wordC:"aa",5138 wordE:"aa",5139 color:"rgb(230,0,0)",5140 style:{5141 position:"relative",5142 top:-10,5143 left:55144 },5145 });5146 page.status.appendChild(page.status.word);5147 page.input=[];5148 page.inputF=ASElement({5149 nodeName:"div",5150 });5151 page.appendChild(page.inputF);5152 for (var i=0;i<page.inputList.length;i++) {5153 var p={5154 model:page.inputList[i],5155 style:{5156 marginTop:2,5157 marginBottom:2,5158 marginLeft:30,5159 },5160 };5161 if (page.inputList[i]=="itsc") {5162 p.hintC="";5163 p.hintE="";5164 p.wReadonly=true;5165 p.wCompulsory=true;5166 }5167 if (page.inputList[i]=="name") {5168 p.hintC="ä¾å¦ï¼LI Hua";5169 p.hintE="E.g. Jarvis";5170 p.wCompulsory=true;5171 }5172 if (page.inputList[i]=="studentID") {5173 p.hintC="ä¾å¦ï¼20326666";5174 p.hintE="E.g. 20326666";5175 p.wCompulsory=true;5176 }5177 if (page.inputList[i]=="phone") {5178 p.hintC="ä¾å¦ï¼23586666";5179 p.hintE="E.g. 23586666";5180 p.wCompulsory=true;5181 }5182 if (page.inputList[i]=="role") {5183 p.model="";5184 p.type="radioPoint";5185 p.wordC="è§ è²";5186 p.wordE="Role";5187 p.root=page;5188 p.block=[];5189 var data1=data.getNodeByName("role");5190 for (var j=0;j<data1.node.length;j++) {5191 if (data1.node[j].getAttribute("counterOnly")) continue;5192 p.block[p.block.length]={5193 wordC:data1.node[j].getAttribute("nameC"),5194 wordE:data1.node[j].getAttribute("nameE"),5195 value:j,5196 }5197 }5198 p.onchoose=function() {5199 this.root.root.dealFee();5200 }5201 }5202 if (page.inputList[i]=="fee") {5203 p.wordC="è²» ç¨";5204 p.wordE="Fee";5205 p.model="";5206 p.type="text";5207 p.text=[];5208 var data1=data.getNodeByName("role");5209 for (var j=0;j<data1.node.length;j++) {5210 var str1C=data1.node[j].getAttribute("feeN");5211 var str1E=data1.node[j].getAttribute("feeN");5212 if (str1C=="0") {5213 str1C="å
è²»";5214 str1E="Free";5215 } else {5216 str1C+="HKD";5217 str1E+="HKD";5218 }5219 var str2C=data1.node[j].getAttribute("feeM");5220 var str2E=data1.node[j].getAttribute("feeM");5221 if (str2C=="0") {5222 str2C="å
è²»";5223 str2E="Free";5224 } else {5225 str2C+="HKD";5226 str2E+="HKD";5227 }5228 p.text[p.text.length]={5229 wordC:str1C,5230 wordE:str1E,5231 value:j+"N",5232 };5233 p.text[p.text.length]={5234 wordC:str2C,5235 wordE:str2E,5236 value:j+"M",5237 };5238 }5239 }5240 if (page.inputList[i]=="payway") {5241 p.value="N";5242 }5243 if (page.inputList[i]=="excoList") {5244 p.wordC="交 äº";5245 p.wordE="Pay to";5246 p.firstBlock=3;5247 }5248 page.input[page.inputList[i]]=BasicInput(p);5249 page.inputF.appendChild(page.input[page.inputList[i]]);5250 page.input[page.inputList[i]].br=ASElement("br")5251 page.inputF.appendChild(page.input[page.inputList[i]].br);5252 }5253 if (page.input["fee"].text[page.input["fee"].textC].wordE=="Free") {5254 page.inputF.removeChild(page.input["payway"]);5255 page.inputF.removeChild(page.input["excoList"]);5256 }5257 if (data.getNodeByName("role").node.length<=1) {5258 page.inputF.removeChild(page.input["role"]);5259 }5260 page.loading=BasicLoading({5261 style:{5262 marginLeft:580,5263 width:44,5264 height:44,5265 },5266 });5267 page.appendChild(page.loading);5268 page.save=BasicButton({5269 size:24,5270 wordC:"æ 交",5271 wordE:"Submit",5272 root:page,5273 style:{5274 marginTop:30,5275 marginLeft:30,5276 },5277 onclick:function() {5278 var wWrong=false;5279 for (var i=0;i<this.root.inputList.length;i++) {5280 if (this.root.input[this.root.inputList[i]].check) this.root.input[this.root.inputList[i]].check();5281 if (this.root.input[this.root.inputList[i]].wWrong) {5282 wWrong=true;5283 }5284 }5285 if (wWrong) return;5286 this.root.loading.restart();5287 this.root.loading.setTimeout(function(){this.start();},30);5288 this.root.succeedU=false;5289 this.root.succeedF=false;5290 var data={};5291 data.user=USERDATA.user;5292 data.ticket=USERDATA.ticket;5293 data.action="postUserData";5294 data.name=this.root.input["name"].getValue();5295 data.studentID=this.root.input["studentID"].getValue();5296 data.phone=this.root.input["phone"].getValue();5297 SignupPagePostFuncData_PAGE=this.root;5298 PostDataR=data;5299 PostDataR.banDefault=true;5300 sendAJAX({5301 type:"POST",5302 src:"cgi-bin/operateData.php",5303 data:data,5304 callback:"SignupPagePostFuncData_PAGE.succeed('user');",5305 });5306 var data={};5307 data.user=USERDATA.user;5308 data.ticket=USERDATA.ticket;5309 data.action="postUserFuncData";5310 data.id=this.root.root.funcID;5311 data.role=this.root.input["role"].getValue();5312 if (this.root.input["fee"].text[this.root.input["fee"].textC].wordE=="Free") {5313 data.status=".";5314 data.payto="free";5315 } else {5316 data.status=",";5317 data.payto=this.root.input["excoList"].getValue();5318 }5319 SignupPagePostFuncData_ID=data.id;5320 SignupPagePostFuncData_DATA={5321 id:data.id,5322 user:data.user,5323 status:data.status,5324 payto:data.payto,5325 role:data.role,5326 };5327 sendAJAX({5328 type:"POST",5329 src:"cgi-bin/operateData.php",5330 data:data,5331 callback:"SignupPagePostFuncData_PAGE.succeed('func');",5332 });5333 },5334 });5335 page.appendChild(page.save);5336 this.page[2]=ASElement({5337 nodeName:"div",5338 root:this,5339 style:{5340 width:DEFAULT_PAGE_WIDTHL,5341 },5342 });5343 var page=this.page[2];5344 page.succeed=function(type) {5345 if (type=="user") {5346 this.succeedU=true;5347 }5348 if (type=="func") {5349 this.succeedS=true;5350 }5351 if (this.succeedU && this.succeedS) {5352 this.loading.succeed();5353 }5354 }5355 var data=ASGetSourceByName("data0").getNodeByName("functionC").node[this.o];5356 page.inputList=["itsc","name","studentID","phone","place","role","fee","payway"];5357 page.titleF=BasicTitle({5358 widthA:DEFAULT_PAGE_WIDTHL-300,5359 wordC:data.getAttribute("nameC")+" å ±å表",5360 wordE:"Registration Form of<br>"+data.getAttribute("nameE"),5361 style:{5362 marginBottom:15,5363 },5364 });5365 page.appendChild(page.titleF);5366 page.input=[];5367 page.inputF=ASElement({5368 nodeName:"div",5369 });5370 page.appendChild(page.inputF);5371 for (var i=0;i<page.inputList.length;i++) {5372 var p={5373 model:page.inputList[i],5374 style:{5375 marginTop:2,5376 marginBottom:2,5377 marginLeft:30,5378 },5379 };5380 if (page.inputList[i]=="itsc") {5381 p.wCompulsory=true;5382 p.root=this;5383 p.onblur=function() {5384 if (!this.wWrong) {5385 SignupPageRequestTargetData_PAGE=this.root;5386 requestTargetData(this.input.value,"SignupPageRequestTargetData_PAGE.updateTargetData();");5387 }5388 }5389 }5390 if (page.inputList[i]=="name") {5391 p.hintC="ä¾å¦ï¼LI Hua";5392 p.hintE="E.g. Jarvis";5393 p.wCompulsory=true;5394 }5395 if (page.inputList[i]=="studentID") {5396 p.hintC="ä¾å¦ï¼20326666";5397 p.hintE="E.g. 20326666";5398 p.wCompulsory=true;5399 }5400 if (page.inputList[i]=="phone") {5401 p.hintC="ä¾å¦ï¼23586666";5402 p.hintE="E.g. 23586666";5403 p.wCompulsory=true;5404 }5405 if (page.inputList[i]=="role") {5406 p.model="";5407 p.type="radioPoint";5408 p.wordC="è§ è²";5409 p.wordE="Role";5410 p.root=page;5411 p.block=[];5412 var data1=data.getNodeByName("role");5413 for (var j=0;j<data1.node.length;j++) {5414 p.block[j]={5415 wordC:data1.node[j].getAttribute("nameC"),5416 wordE:data1.node[j].getAttribute("nameE"),5417 value:j,5418 }5419 }5420 p.onchoose=function() {5421 this.root.root.dealFee();5422 }5423 }5424 if (page.inputList[i]=="fee") {5425 p.wordC="è²» ç¨";5426 p.wordE="Fee";5427 p.model="";5428 p.type="text";5429 p.text=[];5430 var data1=data.getNodeByName("role");5431 for (var j=0;j<data1.node.length;j++) {5432 var str1C=data1.node[j].getAttribute("feeN");5433 var str1E=data1.node[j].getAttribute("feeN");5434 if (str1C=="0") {5435 str1C="å
è²»";5436 str1E="Free";5437 } else {5438 str1C+="HKD";5439 str1E+="HKD";5440 }5441 var str2C=data1.node[j].getAttribute("feeM");5442 var str2E=data1.node[j].getAttribute("feeM");5443 if (str2C=="0") {5444 str2C="å
è²»";5445 str2E="Free";5446 } else {5447 str2C+="HKD";5448 str2E+="HKD";5449 }5450 p.text[p.text.length]={5451 wordC:str1C,5452 wordE:str1E,5453 value:j+"N",5454 };5455 p.text[p.text.length]={5456 wordC:str2C,5457 wordE:str2E,5458 value:j+"M",5459 };5460 }5461 }5462 if (page.inputList[i]=="payway") {5463 p.value="E";5464 }5465 page.input[page.inputList[i]]=BasicInput(p);5466 page.inputF.appendChild(page.input[page.inputList[i]]);5467 page.input[page.inputList[i]].br=ASElement("br")5468 page.inputF.appendChild(page.input[page.inputList[i]].br);5469 }5470 page.switchLang=BasicButton({5471 size:24,5472 wordC:"English Version",5473 wordE:"åæè³ä¸æ",5474 color:"rgb(240,240,240)",5475 colorL:"rgb(250,250,250)",5476 colorW:"rgb(230,0,0)",5477 style:{5478 position:"absolute",5479 top:0,5480 right:0,5481 },5482 onclick:function() {5483 if (ASLang=="C") setLang("E");5484 else setLang("C");5485 },5486 });5487 page.appendChild(page.switchLang);5488 page.loading=BasicLoading({5489 style:{5490 marginLeft:480,5491 width:44,5492 height:44,5493 },5494 });5495 page.appendChild(page.loading);5496 page.save=BasicButton({5497 size:24,5498 wordC:"æ 交",5499 wordE:"Submit",5500 root:page,5501 style:{5502 marginTop:30,5503 marginLeft:20,5504 },5505 onclick:function() {5506 var wWrong=false;5507 for (var i=0;i<this.root.inputList.length;i++) {5508 if (this.root.input[this.root.inputList[i]].check) this.root.input[this.root.inputList[i]].check();5509 if (this.root.input[this.root.inputList[i]].wWrong) {5510 wWrong=true;5511 }5512 }5513 if (wWrong) return;5514 this.root.loading.restart();5515 this.root.loading.setTimeout(function(){this.start();},30);5516 this.root.succeedU=false;5517 this.root.succeedF=false;5518 var data={};5519 data.user=USERDATA.user;5520 data.ticket=USERDATA.ticket;5521 data.target=this.root.input["itsc"].getValue();5522 data.action="postTargetData";5523 data.name=this.root.input["name"].getValue();5524 data.studentID=this.root.input["studentID"].getValue();5525 data.phone=this.root.input["phone"].getValue();5526 SignupPagePostTargetFuncData_PAGE=this.root;5527 sendAJAX({5528 type:"POST",5529 src:"cgi-bin/operateData.php",5530 data:data,5531 callback:"SignupPagePostTargetFuncData_PAGE.succeed('user');",5532 });5533 var data={};5534 data.user=USERDATA.user;5535 data.ticket=USERDATA.ticket;5536 data.target=this.root.input["itsc"].getValue();5537 data.action="postTargetFuncData";5538 data.id=this.root.root.funcID;5539 data.role=this.root.input["role"].getValue();5540 data.status=".";5541 data.payto="counter";5542 sendAJAX({5543 type:"POST",5544 src:"cgi-bin/operateData.php",5545 data:data,5546 callback:"SignupPagePostTargetFuncData_PAGE.succeed('func');",5547 });5548 },5549 });5550 page.appendChild(page.save);5551 page.clear=BasicButton({5552 size:24,5553 wordC:"æ¸
空",5554 wordE:"Clear",5555 color:"rgb(200,200,200)",5556 colorW:"black",5557 colorL:"rgb(230,230,230)",5558 root:page,5559 style:{5560 marginTop:30,5561 marginLeft:10,5562 },5563 onclick:function() {5564 TARGETDATA="NULL";5565 this.root.input["itsc"].setValue("");5566 this.root.input["name"].setValue("");5567 this.root.input["studentID"].setValue("");5568 this.root.input["phone"].setValue("");5569 this.root.input["place"].setValue("N");5570 this.root.input["role"].setValue(0);5571 this.root.root.dealFee();5572 this.root.loading.end();5573 },5574 });5575 page.appendChild(page.clear);5576 this.update();5577 }5578 }5579 }5580 function buildPageV_FunctionS() {5581 var data=ASGetSourceByName("data0").getNodeByName("functionC");5582 for (var o=0;o<data.node.length;o++) {5583 PAGE_V[data.node[o].nodeName+"Signup"]=ASElement({5584 nodeName:"div",5585 wCenter:true,5586 style:{5587 position:"relative",5588 width:VERTICAL_PAGE_WIDTHL,5589 marginTop:50,5590 marginBottom:50,5591 },5592 o:o,5593 funcID:data.node[o].nodeName,5594 });5595 var page=PAGE_V[data.node[o].nodeName+"Signup"];5596 page.appear=PAGE[data.node[o].nodeName+"Signup"].appear;5597 page.update=PAGE[data.node[o].nodeName+"Signup"].update;5598 page.dealFee=PAGE[data.node[o].nodeName+"Signup"].dealFee;5599 page.updateTargetData=PAGE[data.node[o].nodeName+"Signup"].updateTargetData;5600 page.build=function() {5601 this.wBuild=true;5602 this.page=[];5603 this.page[0]=ASElement({5604 nodeName:"div",5605 root:this,5606 style:{5607 width:VERTICAL_PAGE_WIDTHL,5608 },5609 });5610 var page=this.page[0];5611 page.word=BasicWord({5612 size:60,5613 wordC:"è«å
ç»é",5614 wordE:"Please log in first.",5615 style:{5616 width:"100%",5617 textAlign:"center",5618 marginTop:50,5619 },5620 });5621 page.appendChild(page.word);5622 page.log=BasicButton({5623 size:45,5624 wordC:"ç» å
¥",5625 wordE:"Log in",5626 wCenter:true,5627 style:{5628 marginTop:30,5629 },5630 onclick:function() {5631 changeURL("login");5632 },5633 });5634 page.appendChild(page.log);5635 this.page[1]=ASElement({5636 nodeName:"div",5637 root:this,5638 style:{5639 width:VERTICAL_PAGE_WIDTHL,5640 },5641 });5642 var page=this.page[1];5643 page.succeed=function(type) {5644 if (type=="user") {5645 this.succeedU=true;5646 }5647 if (type=="func") {5648 this.succeedS=true;5649 }5650 if (this.succeedU && this.succeedS) {5651 this.loading.succeed();5652 this.root.setTimeout(function() {5653 USERDATA.func[SignupPagePostFuncData_ID]=SignupPagePostFuncData_DATA;5654 delete PostDataR.banDefault;5655 postUserDataSucceed();5656 this.loading.end();5657 },1000);5658 }5659 }5660 var data=ASGetSourceByName("data0").getNodeByName("functionC").node[this.o];5661 page.inputList=["itsc","name","studentID","phone","place","role","fee","payway","excoList"];5662 page.titleF=BasicTitle({5663 size:60,5664 wordC:data.getAttribute("nameC")+" å ±å表",5665 wordE:"Registration Form of<br>"+data.getAttribute("nameE"),5666 style:{5667 marginBottom:15,5668 },5669 });5670 page.appendChild(page.titleF);5671 page.status=ASElement({5672 nodeName:"div",5673 style:{5674 float:"right",5675 },5676 });5677 page.appendChild(page.status);5678 page.status.img=ASElement({5679 nodeName:"img",5680 style:{5681 height:75,5682 },5683 });5684 page.status.appendChild(page.status.img);5685 page.status.word=BasicWord({5686 size:45,5687 wordC:"aa",5688 wordE:"aa",5689 color:"rgb(230,0,0)",5690 style:{5691 position:"relative",5692 top:-10,5693 left:55694 },5695 });5696 page.status.appendChild(page.status.word);5697 page.input=[];5698 page.inputF=ASElement({5699 nodeName:"div",5700 });5701 page.appendChild(page.inputF);5702 for (var i=0;i<page.inputList.length;i++) {5703 var p={5704 size:45,5705 model:page.inputList[i],5706 widthL:270,5707 widthA:VERTICAL_PAGE_WIDTHL,5708 style:{5709 marginTop:20,5710 marginBottom:2,5711 marginLeft:30,5712 },5713 };5714 if (page.inputList[i]=="itsc") {5715 p.hintC="";5716 p.hintE="";5717 p.wReadonly=true;5718 p.wCompulsory=true;5719 }5720 if (page.inputList[i]=="name") {5721 p.hintC="ä¾å¦ï¼LI Hua";5722 p.hintE="E.g. Jarvis";5723 p.wCompulsory=true;5724 }5725 if (page.inputList[i]=="studentID") {5726 p.hintC="ä¾å¦ï¼20326666";5727 p.hintE="E.g. 20326666";5728 p.wCompulsory=true;5729 }5730 if (page.inputList[i]=="phone") {5731 p.hintC="ä¾å¦ï¼23586666";5732 p.hintE="E.g. 23586666";5733 p.wCompulsory=true;5734 }5735 if (page.inputList[i]=="role") {5736 p.model="";5737 p.type="radioPoint";5738 p.wordC="è§ è²";5739 p.wordE="Role";5740 p.root=page;5741 p.block=[];5742 var data1=data.getNodeByName("role");5743 for (var j=0;j<data1.node.length;j++) {5744 if (data1.node[j].getAttribute("counterOnly")) continue;5745 p.block[p.block.length]={5746 wordC:data1.node[j].getAttribute("nameC"),5747 wordE:data1.node[j].getAttribute("nameE"),5748 value:j,5749 }5750 }5751 p.onchoose=function() {5752 this.root.root.dealFee();5753 }5754 }5755 if (page.inputList[i]=="fee") {5756 p.wordC="è²» ç¨";5757 p.wordE="Fee";5758 p.model="";5759 p.type="text";5760 p.text=[];5761 var data1=data.getNodeByName("role");5762 for (var j=0;j<data1.node.length;j++) {5763 var str1C=data1.node[j].getAttribute("feeN");5764 var str1E=data1.node[j].getAttribute("feeN");5765 if (str1C=="0") {5766 str1C="å
è²»";5767 str1E="Free";5768 } else {5769 str1C+="HKD";5770 str1E+="HKD";5771 }5772 var str2C=data1.node[j].getAttribute("feeM");5773 var str2E=data1.node[j].getAttribute("feeM");5774 if (str2C=="0") {5775 str2C="å
è²»";5776 str2E="Free";5777 } else {5778 str2C+="HKD";5779 str2E+="HKD";5780 }5781 p.text[p.text.length]={5782 wordC:str1C,5783 wordE:str1E,5784 value:j+"N",5785 };5786 p.text[p.text.length]={5787 wordC:str2C,5788 wordE:str2E,5789 value:j+"M",5790 };5791 }5792 }5793 if (page.inputList[i]=="payway") {5794 p.value="N";5795 }5796 if (page.inputList[i]=="excoList") {5797 p.wordC="交 äº";5798 p.wordE="Pay to";5799 p.firstBlock=3;5800 }5801 page.input[page.inputList[i]]=BasicInput(p);5802 page.inputF.appendChild(page.input[page.inputList[i]]);5803 page.input[page.inputList[i]].br=ASElement("br")5804 page.inputF.appendChild(page.input[page.inputList[i]].br);5805 }5806 if (page.input["fee"].text[page.input["fee"].textC].wordE=="Free") {5807 page.inputF.removeChild(page.input["payway"]);5808 page.inputF.removeChild(page.input["excoList"]);5809 }5810 if (data.getNodeByName("role").node.length<=1) {5811 page.inputF.removeChild(page.input["role"]);5812 }5813 page.loading=BasicLoading({5814 style:{5815 marginLeft:430,5816 width:88,5817 height:88,5818 },5819 });5820 page.appendChild(page.loading);5821 page.save=BasicButton({5822 size:45,5823 wordC:"æ 交",5824 wordE:"Submit",5825 root:page,5826 style:{5827 marginTop:30,5828 marginLeft:30,5829 },5830 onclick:function() {5831 var wWrong=false;5832 for (var i=0;i<this.root.inputList.length;i++) {5833 if (this.root.input[this.root.inputList[i]].check) this.root.input[this.root.inputList[i]].check();5834 if (this.root.input[this.root.inputList[i]].wWrong) {5835 wWrong=true;5836 }5837 }5838 if (wWrong) return;5839 this.root.loading.restart();5840 this.root.loading.setTimeout(function(){this.start();},30);5841 this.root.succeedU=false;5842 this.root.succeedF=false;5843 var data={};5844 data.user=USERDATA.user;5845 data.ticket=USERDATA.ticket;5846 data.action="postUserData";5847 data.name=this.root.input["name"].getValue();5848 data.studentID=this.root.input["studentID"].getValue();5849 data.phone=this.root.input["phone"].getValue();5850 SignupPagePostFuncData_PAGE=this.root;5851 PostDataR=data;5852 PostDataR.banDefault=true;5853 sendAJAX({5854 type:"POST",5855 src:"cgi-bin/operateData.php",5856 data:data,5857 callback:"SignupPagePostFuncData_PAGE.succeed('user');",5858 });5859 var data={};5860 data.user=USERDATA.user;5861 data.ticket=USERDATA.ticket;5862 data.action="postUserFuncData";5863 data.id=this.root.root.funcID;5864 data.role=this.root.input["role"].getValue();5865 if (this.root.input["fee"].text[this.root.input["fee"].textC].wordE=="Free") {5866 data.status=".";5867 data.payto="free";5868 } else {5869 data.status=",";5870 data.payto=this.root.input["excoList"].getValue();5871 }5872 SignupPagePostFuncData_ID=data.id;5873 SignupPagePostFuncData_DATA={5874 id:data.id,5875 user:data.user,5876 status:data.status,5877 payto:data.payto,5878 role:data.role,5879 };5880 sendAJAX({5881 type:"POST",5882 src:"cgi-bin/operateData.php",5883 data:data,5884 callback:"SignupPagePostFuncData_PAGE.succeed('func');",5885 });5886 },5887 });5888 page.appendChild(page.save);5889 this.page[2]=ASElement({5890 nodeName:"div",5891 root:this,5892 style:{5893 width:VERTICAL_PAGE_WIDTHL,5894 },5895 });5896 var page=this.page[2];5897 page.succeed=function(type) {5898 if (type=="user") {5899 this.succeedU=true;5900 }5901 if (type=="func") {5902 this.succeedS=true;5903 }5904 if (this.succeedU && this.succeedS) {5905 this.loading.succeed();5906 }5907 }5908 var data=ASGetSourceByName("data0").getNodeByName("functionC").node[this.o];5909 page.inputList=["itsc","name","studentID","phone","place","role","fee","payway"];5910 page.titleF=BasicTitle({5911 size:60,5912 widthA:VERTICAL_PAGE_WIDTH,5913 wordC:data.getAttribute("nameC")+" å ±å表",5914 wordE:"Registration Form of<br>"+data.getAttribute("nameE"),5915 style:{5916 marginBottom:15,5917 },5918 });5919 page.appendChild(page.titleF);5920 page.input=[];5921 page.inputF=ASElement({5922 nodeName:"div",5923 });5924 page.appendChild(page.inputF);5925 for (var i=0;i<page.inputList.length;i++) {5926 var p={5927 size:50,5928 model:page.inputList[i],5929 widthL:270,5930 widthA:VERTICAL_PAGE_WIDTHL,5931 style:{5932 marginTop:20,5933 marginBottom:2,5934 marginLeft:30,5935 },5936 };5937 if (page.inputList[i]=="itsc") {5938 p.wCompulsory=true;5939 p.root=this;5940 p.onblur=function() {5941 if (!this.wWrong) {5942 SignupPageRequestTargetData_PAGE=this.root;5943 requestTargetData(this.input.value,"SignupPageRequestTargetData_PAGE.updateTargetData();");5944 }5945 }5946 }5947 if (page.inputList[i]=="name") {5948 p.hintC="ä¾å¦ï¼LI Hua";5949 p.hintE="E.g. Jarvis";5950 p.wCompulsory=true;5951 }5952 if (page.inputList[i]=="studentID") {5953 p.hintC="ä¾å¦ï¼20326666";5954 p.hintE="E.g. 20326666";5955 p.wCompulsory=true;5956 }5957 if (page.inputList[i]=="phone") {5958 p.hintC="ä¾å¦ï¼23586666";5959 p.hintE="E.g. 23586666";5960 p.wCompulsory=true;5961 }5962 if (page.inputList[i]=="role") {5963 p.model="";5964 p.type="radioPoint";5965 p.wordC="è§ è²";5966 p.wordE="Role";5967 p.root=page;5968 p.block=[];5969 var data1=data.getNodeByName("role");5970 for (var j=0;j<data1.node.length;j++) {5971 p.block[j]={5972 wordC:data1.node[j].getAttribute("nameC"),5973 wordE:data1.node[j].getAttribute("nameE"),5974 value:j,5975 }5976 }5977 p.onchoose=function() {5978 this.root.root.dealFee();5979 }5980 }5981 if (page.inputList[i]=="fee") {5982 p.wordC="è²» ç¨";5983 p.wordE="Fee";5984 p.model="";5985 p.type="text";5986 p.text=[];5987 var data1=data.getNodeByName("role");5988 for (var j=0;j<data1.node.length;j++) {5989 var str1C=data1.node[j].getAttribute("feeN");5990 var str1E=data1.node[j].getAttribute("feeN");5991 if (str1C=="0") {5992 str1C="å
è²»";5993 str1E="Free";5994 } else {5995 str1C+="HKD";5996 str1E+="HKD";5997 }5998 var str2C=data1.node[j].getAttribute("feeM");5999 var str2E=data1.node[j].getAttribute("feeM");6000 if (str2C=="0") {6001 str2C="å
è²»";6002 str2E="Free";6003 } else {6004 str2C+="HKD";6005 str2E+="HKD";6006 }6007 p.text[p.text.length]={6008 wordC:str1C,6009 wordE:str1E,6010 value:j+"N",6011 };6012 p.text[p.text.length]={6013 wordC:str2C,6014 wordE:str2E,6015 value:j+"M",6016 };6017 }6018 }6019 if (page.inputList[i]=="payway") {6020 p.value="E";6021 }6022 page.input[page.inputList[i]]=BasicInput(p);6023 page.inputF.appendChild(page.input[page.inputList[i]]);6024 page.input[page.inputList[i]].br=ASElement("br")6025 page.inputF.appendChild(page.input[page.inputList[i]].br);6026 }6027 page.loading=BasicLoading({6028 style:{6029 marginLeft:300,6030 width:88,6031 height:88,6032 },6033 });6034 page.appendChild(page.loading);6035 page.save=BasicButton({6036 size:45,6037 wordC:"æ 交",6038 wordE:"Submit",6039 root:page,6040 style:{6041 marginTop:30,6042 marginLeft:20,6043 },6044 onclick:function() {6045 var wWrong=false;6046 for (var i=0;i<this.root.inputList.length;i++) {6047 if (this.root.input[this.root.inputList[i]].check) this.root.input[this.root.inputList[i]].check();6048 if (this.root.input[this.root.inputList[i]].wWrong) {6049 wWrong=true;6050 }6051 }6052 if (wWrong) return;6053 this.root.loading.restart();6054 this.root.loading.setTimeout(function(){this.start();},30);6055 this.root.succeedU=false;6056 this.root.succeedF=false;6057 var data={};6058 data.user=USERDATA.user;6059 data.ticket=USERDATA.ticket;6060 data.target=this.root.input["itsc"].getValue();6061 data.action="postTargetData";6062 data.name=this.root.input["name"].getValue();6063 data.studentID=this.root.input["studentID"].getValue();6064 data.phone=this.root.input["phone"].getValue();6065 SignupPagePostTargetFuncData_PAGE=this.root;6066 sendAJAX({6067 type:"POST",6068 src:"cgi-bin/operateData.php",6069 data:data,6070 callback:"SignupPagePostTargetFuncData_PAGE.succeed('user');",6071 });6072 var data={};6073 data.user=USERDATA.user;6074 data.ticket=USERDATA.ticket;6075 data.target=this.root.input["itsc"].getValue();6076 data.action="postTargetFuncData";6077 data.id=this.root.root.funcID;6078 data.role=this.root.input["role"].getValue();6079 data.status=".";6080 data.payto="counter";6081 sendAJAX({6082 type:"POST",6083 src:"cgi-bin/operateData.php",6084 data:data,6085 callback:"SignupPagePostTargetFuncData_PAGE.succeed('func');",6086 });6087 },6088 });6089 page.appendChild(page.save);6090 page.clear=BasicButton({6091 size:45,6092 wordC:"æ¸
空",6093 wordE:"Clear",6094 color:"rgb(200,200,200)",6095 colorW:"black",6096 colorL:"rgb(230,230,230)",6097 root:page,6098 style:{6099 marginTop:30,6100 marginLeft:10,6101 },6102 onclick:function() {6103 TARGETDATA="NULL";6104 this.root.input["itsc"].setValue("");6105 this.root.input["name"].setValue("");6106 this.root.input["studentID"].setValue("");6107 this.root.input["phone"].setValue("");6108 this.root.input["place"].setValue("N");6109 this.root.input["role"].setValue(0);6110 this.root.root.dealFee();6111 this.root.loading.end();6112 },6113 });6114 page.appendChild(page.clear);6115 this.update();6116 }6117 }6118 }6119 // List6120 function buildPage_FunctionL() {6121 var data=ASGetSourceByName("data0").getNodeByName("functionC");6122 for (var o=0;o<data.node.length;o++) {6123 PAGE[data.node[o].nodeName+"List"]=ASElement({6124 nodeName:"div",6125 wCenter:true,6126 style:{6127 position:"relative",6128 width:DEFAULT_PAGE_WIDTHM,6129 marginTop:15,6130 marginBottom:30,6131 },6132 o:o,6133 funcID:data.node[o].nodeName,6134 });6135 PAGE[data.node[o].nodeName+"List"].updateList=function() {6136 var data=ASGetSourceByName("data0").getNodeByName("functionC").getNodeByName(this.funcID);6137 var dataE=ASGetSourceByName("data0").getNodeByName("exco14");6138 this.list.clearRow();6139 for (var i=0;i<FUNCDATA.length;i++) {6140 var time=FUNCDATA[i].time;6141 var p={6142 time:{6143 listType:"basicWord",6144 wordE:time.substr(2,2)+"/"+time.substr(4,2)+" "+time.substr(6,2)+":"+time.substr(8,2)+":"+time.substr(10,2),6145 },6146 name:{6147 listType:"basicWord",6148 wordE:FUNCDATA[i].name,6149 },6150 place:{6151 listType:"basicWord",6152 wordC:"æ¯",6153 wordE:"Yes",6154 },6155 role:{6156 listType:"basicWord",6157 wordC:data.getNodeByName("role").node[FUNCDATA[i].role].getAttribute("nameC"),6158 wordE:data.getNodeByName("role").node[FUNCDATA[i].role].getAttribute("nameE"),6159 },6160 extra:{6161 listType:"basicWord",6162 wordC:" ",6163 wordE:" ",6164 },6165 payto:{6166 listType:"basicWord",6167 wordC:" ",6168 wordE:" ",6169 },6170 wPay:{6171 listType:"basicWord",6172 wordC:"æ¯",6173 wordE:"Yes",6174 }6175 };6176 if (FUNCDATA[i].place=="N") {6177 p.place.wordC="å¦";6178 p.place.wordE="No";6179 }6180 if (FUNCDATA[i].status==",") {6181 p.wPay.wordC="å¦";6182 p.wPay.wordE="No";6183 }6184 for (var j=0;j<dataE.node.length;j++) {6185 if (FUNCDATA[i].payto==dataE.node[j].getAttribute("itsc")) {6186 p.payto.wordC=dataE.node[j].getAttribute("nickname");6187 p.payto.wordE=dataE.node[j].getAttribute("nameE");6188 break;6189 }6190 }6191 if (FUNCDATA[i].payto==USERDATA.user) {6192 p.payto.wordC="æ";6193 p.payto.wordE="Me";6194 p.wPay={6195 listType:"basicInput",6196 type:"radioPoint",6197 block:[{6198 wordC:"æ¯",6199 wordE:"Yes",6200 value:"Yes",6201 },{6202 wordC:"å¦",6203 wordE:"No",6204 value:"No",6205 }],6206 space:30,6207 widthA:80,6208 style:{6209 left:15,6210 },6211 funcID:FUNCDATA[i].id,6212 funcTarget:FUNCDATA[i].user,6213 onchoose:function() {6214 var status=",";6215 if (this.blockC==0) status=".";6216 sendAJAX({6217 type:"POST",6218 src:"cgi-bin/operateData.php",6219 data:{6220 user:USERDATA.user,6221 ticket:USERDATA.ticket,6222 action:"postTargetFuncData",6223 id:this.funcID,6224 target:this.funcTarget,6225 status:status,6226 },6227 });6228 },6229 };6230 if (FUNCDATA[i].status==",") p.wPay.firstBlock=1;6231 }6232 this.list.addARow(p);6233 }6234 if (this.root) this.root.pageResize();6235 }6236 PAGE[data.node[o].nodeName+"List"].refresh=function() {6237 var data={};6238 data.user=USERDATA.user;6239 data.ticket=USERDATA.ticket;6240 data.action="getFuncData";6241 data.funcID=this.funcID;6242 FuncListGetFuncData_PAGE=this;6243 sendAJAX({6244 type:"POST",6245 src:"cgi-bin/operateData.php",6246 data:data,6247 callback:"FuncListGetFuncData_PAGE.updateList();",6248 });6249 }6250 PAGE[data.node[o].nodeName+"List"].appear=function() {6251 this.clearChild();6252 this.appendChild(this.page[0]);6253 this.code.setValue("");6254 }6255 PAGE[data.node[o].nodeName+"List"].build=function() {6256 this.wBuild=true;6257 var data=ASGetSourceByName("data0").getNodeByName("functionC").getNodeByName(this.funcID);6258 if (data.getNodeByName("role").node.length>1) this.wRole=true;6259 this.page=[];6260 this.page[0]=ASElement({6261 nodeName:"div",6262 style:{6263 width:"100%",6264 },6265 });6266 this.code=BasicInput({6267 type:"input",6268 wordC:"é©è碼",6269 wordE:"Check Code",6270 maxLength:8,6271 hintC:"輸å
¥å¾æå¯æ¥ç",6272 hintE:"Enter to view",6273 style:{6274 marginTop:15,6275 marginLeft:85,6276 },6277 });6278 this.page[0].appendChild(this.code);6279 this.page[0].appendChild(ASElement("br"));6280 this.check=BasicButton({6281 wordC:"確 èª",6282 wordE:"Confirm",6283 size:24,6284 root:this,6285 style:{6286 marginTop:15,6287 marginLeft:80,6288 },6289 onclick:function() {6290 if (this.root.code.getValue()=="cfas6666") {6291 this.root.clearChild();6292 this.root.appendChild(this.root.page[1]);6293 this.root.refresh();6294 }6295 },6296 });6297 this.page[0].appendChild(this.check);6298 this.page[1]=ASElement({6299 nodeName:"div",6300 style:{6301 width:"100%",6302 },6303 });6304 this.refreshB=BasicButton({6305 size:24,6306 wordC:"å· æ°",6307 wordE:"Refresh",6308 style:{6309 position:"absolute",6310 top:0,6311 right:0,6312 },6313 root:this,6314 onclick:function() {6315 this.root.refresh();6316 }6317 });6318 this.page[1].appendChild(this.refreshB);6319 var col=[{6320 name:"time",6321 wordC:"æ é",6322 wordE:"Time",6323 width:180,6324 },{6325 name:"name",6326 wordC:"å§ å",6327 wordE:"Name",6328 width:195,6329 },{6330 name:"place",6331 wordC:"æ å¡",6332 wordE:"Member",6333 width:80,6334 }];6335 if (this.wRole) {6336 col[col.length]={6337 name:"role",6338 wordC:"è§ è²",6339 wordE:"Role",6340