How to use mainFrame method in Puppeteer

Best JavaScript code snippet using puppeteer

HamaSyncCommunication.js

Source:HamaSyncCommunication.js Github

copy

Full Screen

1//Mainframe get data from index.aspx 2function displayMessage(evt) {3 var message;4 5 //Return the message string to an object6 // var messageObject = JSON.parse(evt);7 var messageObject = evt;8 message = "MainFrame got " + messageObject.data ;9 console.log(message);10 if (messageObject.from == "Index") {11 if (messageObject.command == "screenSyncMessageGetAllUserInfo") {12 // console.log("MainFrame : screenSyncMessageGetAllUserInfo");13 // console.log("HSConnectIndex_screenSyncMessageGetAllUserInfo userIsHost = " + bookSyncInfo.userIsHost + " UserState = " + bookSyncInfo.UserState + " curRoom = " + bookSyncInfo.curRoom + " isConnected = " + bookSyncInfo.isConnected + " bookSyncInfo.UserLocation = " + bookSyncInfo.UserLocation);14 // console.log("HSConnectIndex_screenSyncMessageGetAllUserInfo bookSyncInfo.bookSN = " + bookSyncInfo.bookSN + " bookSyncInfo.isRequestReconnection = " + bookSyncInfo.isRequestReconnection);15 // //Update user's location16 // if ((bookSyncInfo.userIsHost == "false") && (bookSyncInfo.bookSN != "null")) {17 // //user's location18 // console.log(" gotoRoom-----bookSyncInfo.UserLocation = openBook bookSyncInfo.bookSN = " + bookSyncInfo.bookSN);19 // bookSyncInfo.UserLocation = "openBook";20 // }21 // changeSyncConnectionImg();22 // if (bookSyncInfo.bookSN == "null") {23 // //for EYMeetingHub24 // if ((bookSyncInfo.userIsHost == "false") && (bookSyncInfo.UserState == "2") && (bookSyncInfo.curRoom != "null") && (bookSyncInfo.isConnected == "true")) {25 // console.log("HSConnectIndex_screenSyncMessageGetAllUserInfo : the user isn't host. Show Main");26 // console.log("0-------MainFrame : screenSyncMessageGetAllUserInfo At Main");27 28 // //Close Hall29 // divHall_hide();30 // //Close Room31 // divRoom_hide();32 // //Close Book33 // divBook_hide();34 // //Open Syncdefault.html35 // var ID = "#guidline";36 // //var scr = "SyncDefault.htm";37 // var scr = mainPageSrc;38 // $(ID).attr("src", scr);39 // //user's location40 // bookSyncInfo.UserLocation = "atMain";41 // //Open Main42 // divMain_show();43 // if ((bookSyncInfo.UserState == "2") && (bookSyncInfo.isConnected == "true")) {44 // console.log("Send screenSyncMessageRequestBookName");45 // crossframecmd.set("MainFrame", "screenSyncMessageRequestBookName", "none");46 // sendMessageBack(crossframecmd.intoJSON());47 // /*48 // console.log("Send browserSyncMessageRequestURL");49 // crossframecmd.set("MainFrame", "browserSyncMessageRequestURL", "none");50 // sendMessageBack(crossframecmd.intoJSON());51 // */52 // console.log("Send screenSyncMessageRequestScaleAndScrollMotherBoard ");53 // crossframecmd.set("MainFrame", "screenSyncMessageRequestScaleAndScrollMotherBoard", "");54 // sendMessageBack(crossframecmd.intoJSON());55 // console.log("Send screenSyncMessageRequestPlayedAnimations");56 // crossframecmd.set("MainFrame", "screenSyncMessageRequestPlayedAnimations", "");57 // sendMessageBack(crossframecmd.intoJSON());58 // console.log("Send connectionMessageRequestSyncInfo");59 // crossframecmd.set("MainFrame", "connectionMessageRequestSyncInfo", "");60 // sendMessageBack(crossframecmd.intoJSON());61 // }62 // } else {63 // if ((bookSyncInfo.UserLocation == "atRoom") && (bookSyncInfo.userIsHost == "true")) {64 // //if(bookSyncInfo.userIsHost == "true") {65 // console.log("HSConnectIndex_screenSyncMessageGetAllUserInfo : the user ist host and location is at room. Show Room");66 // console.log("1-------MainFrame : screenSyncMessageGetAllUserInfo At Room");67 68 // isPassedOpenBookCmd = 0;69 // //close Meeting Hall70 // divHall_hide();71 // $('#halllist h1').html(bookSyncInfo.curRoomName);72 // $('#userlist').empty();73 // $('#userlist').append(addRoomTitle() + messageObject.data);74 // //Open Room75 // gotoRoom();76 // } else {77 // console.log("HSConnectIndex_screenSyncMessageGetAllUserInfo : the user ist host and location is'not at room. Show Main");78 // console.log("2-------MainFrame : screenSyncMessageGetAllUserInfo At Main");79 80 // isPassedOpenBookCmd = 0;81 // //Close Hall82 // divHall_hide();83 // //Close Room84 // divRoom_hide();85 // //Close Book86 // divBook_hide();87 // var ID = "#guidline";88 // var scr = "SyncDefault.htm";89 // if (bookSyncInfo.UserState == "2") {90 // //scr = "SyncDefault.htm";91 // scr = mainPageSrc;92 // } else {93 // scr = mainPageSrc;94 // }95 // $(ID).attr("src", scr);96 // //Open Main97 // divMain_show();98 // }99 // }100 // } else {101 // console.log("3-------MainFrame : screenSyncMessageGetAllUserInfo At Room bookSyncInfo.UserState = " + bookSyncInfo.UserState + " isSendChnageControllerCMDatRoom = " + bookSyncInfo.isSendChnageControllerCMDatRoom + " isSendUserInfoCMD = " + bookSyncInfo.isSendUserInfoCMD);102 // console.log("MainFrame : updateSyncStatusAtBook ");103 // crossframecmd.set("MainFrame", "updateSyncStatusAtBook", "");104 // postMessageToBookFrame(crossframecmd);105 // $('#halllist h1').html(bookSyncInfo.curRoomName);106 // $('#userlist').empty();107 // $('#userlist').append(addRoomTitle() + messageObject.data);108 // if ((bookSyncInfo.UserState == 1) && (bookSyncInfo.isSendChnageControllerCMDatRoom == 1)) {109 // bookSyncInfo.isSendChnageControllerCMDatRoom = 0;110 111 112 // var bookSN = bookSyncInfo.bookSN;113 // console.log("Master MainFrame : openBookName = " + bookSN);114 // crossframecmd.set("MainFrame", "screenSyncMessageOpenBook", bookSN);115 // sendMessageBack(crossframecmd.intoJSON());116 117 // console.log("Master MainFrame : openBookName page number= " + bookSyncInfo.bookpage);118 // crossframecmd.set("MainFrame", "screenSyncMessageJumpPage", bookSyncInfo.bookpage);119 // sendMessageBack(crossframecmd.intoJSON());120 // if (bookSyncInfo.bookScale != -1) {121 // var scaleScrollData = bookSyncInfo.bookScale + ";{" + bookSyncInfo.bookscrollX + "," + bookSyncInfo.bookscrollY + "}";122 // console.log("Master MainFrame : openBookName screenSyncMessageScaleAndScrollMotherBoard scaleScrollData = " + scaleScrollData);123 // crossframecmd.set("MainFrame", "screenSyncMessageScaleAndScrollMotherBoard", scaleScrollData);124 // sendMessageBack(crossframecmd.intoJSON());125 // }126 127 128 // }129 // if (( (bookSyncInfo.UserState == 2) && (bookSyncInfo.userIsHost == "false") ) || (bookSyncInfo.isRequestReconnection == 1))130 // {131 // console.log("3 client-------Send browserSyncMessageRequestURL");132 // crossframecmd.set("MainFrame", "browserSyncMessageRequestURL", "none");133 // sendMessageBack(crossframecmd.intoJSON());134 // console.log("3 client-------Send screenSyncMessageRequestBookName");135 // crossframecmd.set("MainFrame", "screenSyncMessageRequestBookName", "none");136 // sendMessageBack(crossframecmd.intoJSON());137 138 // console.log("3 client-------Send screenSyncMessageRequestPageIndex ");139 // crossframecmd.set("MainFrame", "screenSyncMessageRequestPageIndex", "");140 // sendMessageBack(crossframecmd.intoJSON());141 // console.log("3 client-------Send screenSyncMessageRequestScaleAndScrollMotherBoard ");142 // crossframecmd.set("MainFrame", "screenSyncMessageRequestScaleAndScrollMotherBoard", "");143 // sendMessageBack(crossframecmd.intoJSON());144 // console.log("3 client-------Send screenSyncMessageRequestPlayedAnimations");145 // crossframecmd.set("MainFrame", "screenSyncMessageRequestPlayedAnimations", "");146 // sendMessageBack(crossframecmd.intoJSON());147 // console.log("3 client-------Send connectionMessageRequestSyncInfo");148 // crossframecmd.set("MainFrame", "connectionMessageRequestSyncInfo", "");149 // sendMessageBack(crossframecmd.intoJSON());150 // }151 // if (bookSyncInfo.isSendUserInfoCMD == 1) {152 153 // bookSyncInfo.isSendUserInfoCMD = 0;154 // if ( (bookSyncInfo.userIsHost == "true") && (bookSyncInfo.isRequestReconnection == 0)) {155 // //Close Hall156 // divHall_hide();157 // //Close Main158 // divMain_hide();159 // //Close Book160 // divBook_hide();161 // //Open Room162 // divRoom_show();163 // //user's sublocation164 // bookSyncInfo.subUserLocation = "atRoom";165 // } else {166 // //Close Hall167 // divHall_hide();168 // //Close Main169 // divMain_hide();170 // //Close Room171 // divRoom_hide();172 // //Open Book173 // divBook_show();174 // //user's sublocation175 // bookSyncInfo.subUserLocation = null;176 // }177 // }178 // }179 // console.log('%c' + "Message from server. Code: bookSyncInfo.isRequestReconnection = 0;" + this.type, 'color: #000fff');180 181 // bookSyncInfo.isRequestReconnection = 0;182 //同步註記 培峰183 } else if (messageObject.command == "screenSyncMessageSyncPageNote") {184 console.log("MainFrame : screenSyncMessageSyncPageNote " + messageObject.data);185 // messageObject.data = messageObject.data.replace(/\"/g, '\\"');186 crossframecmd.set("MainFrame", "screenSyncMessageSyncPageNote", messageObject.data);187 postMessageToBookFrame(crossframecmd);188 189 } else if (messageObject.command == "screenSyncMessageGetAllUserInfoAtBook") { 190 // console.log("MainFrame : screenSyncMessageGetAllUserInfoAtBook " + messageObject.data);191 // changeSyncConnectionImgAtBook();192 // console.log("MainFrame : updateSyncStatusAtBook " );193 // crossframecmd.set("MainFrame", "updateSyncStatusAtBook", "");194 // postMessageToBookFrame(crossframecmd);195 196 } else if (messageObject.command == "screenSyncMessageGetRoomInfoWithAccount") {197 // console.log("MainFrame : screenSyncMessageGetRoomInfoWithAccount");198 // divhall_empty();199 // divhall_append(addMeetingHallTitle() + messageObject.data);200 // //Close Room201 // divRoom_hide();202 // //Close Book203 // divBook_hide();204 // //Close Hall205 // divHall_hide();206 // //Show Main207 // divMain_show();208 } else if (messageObject.command == "noSuchRoomAvailableError") {209 // console.log("MainFrame : noSuchRoomAvailableError");210 // console.log("HSConnectionIndex_noSuchRoomAvailableError");211 // gotoError(noSuchRoomAvailable);212 } else if (messageObject.command == "OpendivMain") {213 // console.log("MainFrame : OpendivMain");214 // //1 is to open215 // if (messageObject.data == 1) {216 // //for EYMeetingHub217 // changeMainPage();218 // changeSyncConnectionImg();219 // divMain_show();220 // } else if (messageObject.data == 0) {221 // divMain_hide();222 // }223 } else if (messageObject.command == "OpendivHall") {224 // console.log("MainFrame : OpendivHall");225 // //1 is to open226 // if (messageObject.data == 1) {227 // divHall_show();228 // } else if (messageObject.data == 0) {229 // divHall_hide();230 // }231 } else if (messageObject.command == "OpendivRoom") {232 // console.log("MainFrame : OpendivRoom");233 // //1 is to open234 // if (messageObject.data == 1) {235 // divRoom_show();236 // } else if (messageObject.data == 0) {237 // divRoom_hide();238 // }239 } else if (messageObject.command == "OpendivBook") {240 // console.log("MainFrame : OpendivBook");241 // //1 is to open242 // if (messageObject.data == 1) {243 // divBook_show();244 // } else if (messageObject.data == 0) {245 // divBook_hide();246 // }247 } else if (messageObject.command == "screenSyncMessagePrevPage") {248 console.log("MainFrame : screenSyncMessagePrevPage " + messageObject.data);249 crossframecmd.set("MainFrame", "screenSyncMessagePrevPage", messageObject.data);250 postMessageToBookFrame(crossframecmd);251 } else if (messageObject.command == "bookFrameFullScreenMode") {252 // var data = book_frame.fullScreenMode();253 // crossframecmd.set("MainFrame", "resizeBook", data);254 // postMessageToBookFrame(crossframecmd);255 } else if (messageObject.command == "updateGuidlineHeight") {256 // console.log("updateGuidlineHeight : " + messageObject.data);257 258 // var ID = "#guidline";259 // $(ID).css('height', messageObject.data);260 //同步書大部分的功能261 } else if (messageObject.command == "messageDataTypeBookSyncMessage") {262 console.log("MainFrame : messageDataTypeBookSyncMessage " + messageObject.data);263 crossframecmd.set("MainFrame", "messageDataTypeBookSyncMessage", messageObject.data);264 postMessageToBookFrame(crossframecmd);265 } else if (messageObject.command == "screenSyncMessageScaleMothBoard") {266 // console.log("MainFrame : screenSyncMessageScaleMothBoard " + messageObject.data);267 // crossframecmd.set("MainFrame", "screenSyncMessageScaleMothBoard", messageObject.data);268 // postMessageToBookFrame(crossframecmd);269 } else if (messageObject.command == "screenSyncMessageScrollMotherBoard") {270 // console.log("MainFrame : screenSyncMessageScrollMotherBoard " + messageObject.data);271 // crossframecmd.set("MainFrame", "screenSyncMessageScrollMotherBoard", messageObject.data);272 // postMessageToBookFrame(crossframecmd);273 } else if (messageObject.command == "screenSyncMessageOpenBook") {274 // console.log("MainFrame : screenSyncMessageOpenBook " + messageObject.data);275 // //get book location from webservice and change bookframe's book on OnSuccessOpenBook276 // isPassedOpenBookCmd = 0;277 278 // var datastring = "{'FileName':'" + messageObject.data + "', 'Device': 'Html5'}";279 280 // console.log("datastring " + datastring);281 // //抓取書本資訊,用不到,所以註解 軒軒282 // //getBookLocation(datastring);283 // //user's location284 // bookSyncInfo.UserLocation = "openBook";285 } else if (messageObject.command == "browserWidthHeight") {286 // console.log("MainFrame : browserWidthHeight " + messageObject.data);287 // crossframecmd.set("MainFrame", "browserWidthHeight", messageObject.data);288 // postMessageToBookFrame(crossframecmd);289 } else if (messageObject.command == "scrollWindowXY") {290 // console.log("MainFrame : scrollWindowXY " + messageObject.data);291 // crossframecmd.set("MainFrame", "scrollWindowXY", messageObject.data);292 // postMessageToBookFrame(crossframecmd);293 } else if (messageObject.command == "screenSyncMessagePlayAnimation") {294 // console.log("MainFrame : screenSyncMessagePlayAnimation " + messageObject.data);295 // crossframecmd.set("MainFrame", "screenSyncMessagePlayAnimation", messageObject.data);296 // postMessageToBookFrame(crossframecmd);297 } else if (messageObject.command == "screenSyncMessageRequestPlayedAnimations") {298 // console.log("MainFrame : screenSyncMessageRequestPlayedAnimations " + messageObject.data);299 // crossframecmd.set("MainFrame", "screenSyncMessageRequestPlayedAnimations", messageObject.data);300 // postMessageToBookFrame(crossframecmd);301 } else if (messageObject.command == "screenSyncMessageScaleAndScrollMotherBoard") {302 console.log("MainFrame : screenSyncMessageScaleAndScrollMotherBoard " + messageObject.data);303 // var temp = messageObject.data.split(';');304 crossframecmd.set("MainFrame", "screenSyncMessageScaleMothBoard", messageObject.data);305 postMessageToBookFrame(crossframecmd);306 // if (temp[0] != 1) {307 // crossframecmd.set("MainFrame", "screenSyncMessageScrollMotherBoard", temp[1]);308 // postMessageToBookFrame(crossframecmd);309 // }310 } else if (messageObject.command == "enterRoomFlowCmd") {311 // enterRoomFlow();312 } else if (messageObject.command == "leaveShowCmd") {313 // console.log("MainFrame : closeSyncStatusAtBookCMD ");314 // crossframecmd.set("MainFrame", "closeSyncStatusAtBook", "");315 // postMessageToBookFrame(crossframecmd);316 // //Open ConfEnter.aspx317 // var ID = "#guidline";318 // var scr = mainPageSrc;319 // $(ID).attr("src", scr);320 // $('#lbtnSyncConnection img').attr("src", "images/menuicon_syncclose.png"); //Close status321 // $('#lbtnConferenceNews').css("display", "block");322 323 } else if (messageObject.command == "galleryStopMove") {324 325 // console.log("MainFrame : galleryStopMove ");326 // //alert("MainFrame : galleryStopMove ");327 // crossframecmd.set("MainFrame", "galleryStopMove", "");328 // postMessageToBookFrame(crossframecmd);329 } else if (messageObject.command == "galleryRunMove") {330 // console.log("MainFrame : galleryRunMove ");331 // crossframecmd.set("MainFrame", "galleryRunMove", "");332 // postMessageToBookFrame(crossframecmd);333 } else if (messageObject.command == "reSizeToolBarforIPADAndroid") {334 // console.log("MainFrame : reSizeToolBarforIPADAndroid " + messageObject.data);335 // crossframecmd.set("MainFrame", "reSizeToolBarforIPADAndroid", messageObject.data);336 // postMessageToBookFrame(crossframecmd);337 } else if (messageObject.command == "updateSyncStatusAtBookCMD") {338 // console.log("MainFrame : updateSyncStatusAtBookCMD ");339 // crossframecmd.set("MainFrame", "updateSyncStatusAtBook", "");340 // postMessageToBookFrame(crossframecmd);341 } else if (messageObject.command == "updateTwoPageCMD") {342 // console.log("MainFrame : updateTwoPageCMD ");343 // crossframecmd.set("MainFrame", "updateTwoPageCMD", "");344 // postMessageToBookFrame(crossframecmd);345 } else if (messageObject.command == "updateSinglePageCMD") {346 // console.log("MainFrame : updateSinglePageCMD ");347 // crossframecmd.set("MainFrame", "updateSinglePageCMD", "");348 // postMessageToBookFrame(crossframecmd);349 } else if (messageObject.command == "screenSyncMessageRetuenBookcase") {350 // console.log("Get screenSyncMessageRetuenBookcase " + messageObject.data);351 // isPassedOpenBookCmd = 1;352 // book_frame.setSrc("white.htm");353 // console.log("MainFrame : closeReLoadVideoIDCMD");354 // crossframecmd.set("MainFrame", "closeReLoadVideoIDCMD", "");355 // postMessageToBookFrame(crossframecmd);356 } else if (messageObject.command == "gotoBookCMD") {357 // //Close Hall358 // divHall_hide();359 // //Close Room360 // divRoom_hide();361 // //Close Main362 // divMain_hide();363 // console.log("MainFrame : updateSyncStatusAtBook ");364 // crossframecmd.set("MainFrame", "updateSyncStatusAtBook", "");365 // postMessageToBookFrame(crossframecmd);366 // //Open Book367 // divBook_show();368 // //user's location369 // bookSyncInfo.UserLocation = "openBook";370 } else if (messageObject.command == "initGuidLine") {371 // console.log("MainFrame : initGuidLine ");372 // var ID = "#guidline";373 // $(ID).css('height', bookSyncInfo.browser_height - 105);374 }375 376 377 } else if (messageObject.from == "BookFrame") {378 // if (messageObject.command == "screenSyncMessagePrevPage") {379 // crossframecmd.set("MainFrame", "screenSyncMessagePrevPage", messageObject.data);380 // sendMessageBack(crossframecmd.intoJSON());381 // } else if (messageObject.command == "START") {382 // crossframecmd.set("MainFrame", "START", messageObject.data);383 // sendMessageBack(crossframecmd.intoJSON());384 // } else if (messageObject.command == "PAUSE") {385 // crossframecmd.set("MainFrame", "PAUSE", messageObject.data);386 // sendMessageBack(crossframecmd.intoJSON());387 // } else if (messageObject.command == "JUMP") {388 // crossframecmd.set("MainFrame", "JUMP", messageObject.data);389 // sendMessageBack(crossframecmd.intoJSON());390 // } else if (messageObject.command == "FULLSCREEN_MODE") {391 // crossframecmd.set("MainFrame", "FULLSCREEN_MODE", messageObject.data);392 // sendMessageBack(crossframecmd.intoJSON());393 // } else if (messageObject.command == "NORMAL_MODE") {394 // crossframecmd.set("MainFrame", "NORMAL_MODE", messageObject.data);395 // sendMessageBack(crossframecmd.intoJSON());396 // } else if (messageObject.command == "screenSyncMessageScaleMothBoard") {397 // crossframecmd.set("MainFrame", "screenSyncMessageScaleMothBoard", messageObject.data);398 // sendMessageBack(crossframecmd.intoJSON());399 // } else if (messageObject.command == "screenSyncMessageScrollMotherBoard") {400 // crossframecmd.set("MainFrame", "screenSyncMessageScrollMotherBoard", messageObject.data);401 // sendMessageBack(crossframecmd.intoJSON());402 // } else if (messageObject.command == "screenSyncMessageScaleAndScrollMotherBoard") {403 // crossframecmd.set("MainFrame", "screenSyncMessageScaleAndScrollMotherBoard", messageObject.data);404 // sendMessageBack(crossframecmd.intoJSON());405 // } else if (messageObject.command == "gotoHallcmd") {406 // gotoHall();407 // } else if (messageObject.command == "gotoRoomcmd") {408 // gotoRoom();409 // } else if (messageObject.command == "gotoMaincmd") {410 // bookSyncInfo.bookSN = null;411 // //leaveRoomforGotoMaincmd();412 // book_frame.setSrc("white.htm");413 // gotoMain();414 // } else if (messageObject.command == "screenSyncMessageRetuenBookcase") {415 // console.log("MainFrame : screenSyncMessageRetuenBookcase " + messageObject.data);416 // crossframecmd.set("MainFrame", "screenSyncMessageRetuenBookcase", messageObject.data);417 // sendMessageBack(crossframecmd.intoJSON());418 // book_frame.setSrc("white.htm");419 // //user's location420 // bookSyncInfo.UserLocation = "atMain";421 // } else if (messageObject.command == "WEB_OPENBROWSER") {422 // console.log("MainFrame : WEB_OPENBROWSER " + messageObject.data);423 // crossframecmd.set("MainFrame", "WEB_OPENBROWSER", messageObject.data);424 // sendMessageBack(crossframecmd.intoJSON());425 // } else if (messageObject.command == "WEB_CLOSEBROWSER") {426 // //console.log("MainFrame : WEB_CLOSEBROWSER " + messageObject.data);427 // crossframecmd.set("MainFrame", "WEB_CLOSEBROWSER", messageObject.data);428 // sendMessageBack(crossframecmd.intoJSON());429 // } else if (messageObject.command == "WEB_NAVIGATETO") {430 // console.log("MainFrame : WEB_NAVIGATETO " + messageObject.data);431 // crossframecmd.set("MainFrame", "WEB_NAVIGATETO", messageObject.data);432 // sendMessageBack(crossframecmd.intoJSON());433 // } else if (messageObject.command == "screenSyncMessageRequestPageIndex") {434 // console.log("MainFrame : screenSyncMessageRequestPageIndex " + messageObject.data);435 // crossframecmd.set("MainFrame", "screenSyncMessageRequestPageIndex", messageObject.data);436 // sendMessageBack(crossframecmd.intoJSON());437 // } else if (messageObject.command == "screenSyncMessageRequestScaleMothBoard") {438 // console.log("MainFrame : screenSyncMessageRequestScaleMothBoard " + messageObject.data);439 // crossframecmd.set("MainFrame", "screenSyncMessageRequestScaleMothBoard", messageObject.data);440 // sendMessageBack(crossframecmd.intoJSON());441 // } else if (messageObject.command == "screenSyncMessageRequestScaleAndScrollMotherBoard") {442 // console.log("MainFrame : screenSyncMessageRequestScaleAndScrollMotherBoard " + messageObject.data);443 // crossframecmd.set("MainFrame", "screenSyncMessageRequestScaleAndScrollMotherBoard", messageObject.data);444 // sendMessageBack(crossframecmd.intoJSON());445 // } else if (messageObject.command == "screenSyncMessagePlayAnimation") {446 // console.log("MainFrame : screenSyncMessagePlayAnimation " + messageObject.data);447 // crossframecmd.set("MainFrame", "screenSyncMessagePlayAnimation", messageObject.data);448 // sendMessageBack(crossframecmd.intoJSON());449 // } else if (messageObject.command == "screenSyncMessagePlayAnimation") {450 // console.log("MainFrame : screenSyncMessagePlayAnimation " + messageObject.data);451 // crossframecmd.set("MainFrame", "screenSyncMessagePlayAnimation", messageObject.data);452 // sendMessageBack(crossframecmd.intoJSON());453 // } else if (messageObject.command == "screenSyncMessageRequestPlayedAnimations") {454 // console.log("MainFrame : screenSyncMessageRequestPlayedAnimations " + messageObject.data);455 // crossframecmd.set("MainFrame", "screenSyncMessageRequestPlayedAnimations", messageObject.data);456 // sendMessageBack(crossframecmd.intoJSON());457 // } else if (messageObject.command == "syncCmd") {458 // console.log("MainFrame : syncCmd " + messageObject.data + " SyncFlag = " + bookSyncInfo.SyncFlag);459 460 // if (window.WebSocket) {461 // if (bookSyncInfo.SyncFlag == 0) {462 // console.log("MainFrame : showSyncFlagMsgCMD ");463 // crossframecmd.set("MainFrame", "showSyncFlagMsgCMD", "");464 // sendMessageBack(crossframecmd.intoJSON());465 // } else {466 // console.log("MainFrame : syncCmd " + messageObject.data);467 // crossframecmd.set("MainFrame", "syncCmd", messageObject.data);468 // sendMessageBack(crossframecmd.intoJSON());469 // }470 // }471 // } else if (messageObject.command == "eBookStyle") {472 // console.log("MainFrame : eBookStyle " + messageObject.data);473 474 475 // var tmp = messageObject.data.split(' ');476 // bookSyncInfo.eBookStyle = tmp[0];477 // bookSyncInfo.isTwoPage = tmp[1];478 // } else if (messageObject.command == "closeLoadBookMsgCMD") {479 // console.log("MainFrame : closeLoadBookMsgCMD " + messageObject.data);480 // crossframecmd.set("MainFrame", "closeLoadBookMsgCMD", "");481 // sendMessageBack(crossframecmd.intoJSON());482 // } else if (messageObject.command == "goToOriginPageIndexCMD") {483 // console.log("MainFrame : goToOriginPageIndexCMD " + messageObject.data);484 // crossframecmd.set("MainFrame", "goToOriginPageIndexCMD", "");485 // sendMessageBack(crossframecmd.intoJSON());486 // } else if (messageObject.command == "goToOriginScaleScrollCMD") {487 // console.log("MainFrame : goToOriginScaleScrollCMD " + messageObject.data);488 // crossframecmd.set("MainFrame", "goToOriginScaleScrollCMD", "");489 // sendMessageBack(crossframecmd.intoJSON());490 // } else if (messageObject.command == "goToOriginAnimationCMD") {491 // console.log("MainFrame : goToOriginAnimationCMD " + messageObject.data);492 // crossframecmd.set("MainFrame", "goToOriginAnimationCMD", "");493 // sendMessageBack(crossframecmd.intoJSON());494 // } else if (messageObject.command == "BookSyncMessage") {495 // console.log("MainFrame : BookSyncMessage " + messageObject.data);496 // crossframecmd.set("MainFrame", "BookSyncMessage", messageObject.data);497 // sendMessageBack(crossframecmd.intoJSON());498 // } else if (messageObject.command == "browserSyncMessageRequestURL") {499 // console.log("Send browserSyncMessageRequestURL");500 // crossframecmd.set("MainFrame", "browserSyncMessageRequestURL", "none");501 // sendMessageBack(crossframecmd.intoJSON());502 // }503 } else if (messageObject.from == "GuidLineFrame") {504 // if (messageObject.command == "openBook") {505 // crossframecmd.set("MainFrame", "showLoadBookMsgCMD", "");506 // sendMessageBack(crossframecmd.intoJSON());507 // //get book location from webservice and change bookframe's book on OnSuccessOpenBook.508 // //抓取書本資訊,用不到,所以註解 軒軒509 // //getBookLocation(messageObject.data);510 // //if a user is host, tell others to open the same book511 // // host = 1 , no host = 2512 // if (bookSyncInfo.UserState == 1) {513 // var arr = messageObject.data.split(',');514 // var arr0 = arr[0].split(':');515 // var arr1 = arr0[1].split('\'');516 // crossframecmd.set("MainFrame", "screenSyncMessageOpenBook", arr1[1]);517 518 // sendMessageBack(crossframecmd.intoJSON());519 // //user's location520 // bookSyncInfo.UserLocation = "openBook";521 // }522 // } else if (messageObject.command == "WEB_NAVIGATETO") {523 // console.log("MainFrame : WEB_NAVIGATETO " + messageObject.data);524 // crossframecmd.set("MainFrame", "WEB_NAVIGATETO", messageObject.data);525 // sendMessageBack(crossframecmd.intoJSON());526 527 // } else if (messageObject.command == "WEB_CLOSEBROWSER") {528 // console.log("MainFrame : WEB_CLOSEBROWSER " + messageObject.data);529 // crossframecmd.set("MainFrame", "WEB_CLOSEBROWSER", messageObject.data);530 // sendMessageBack(crossframecmd.intoJSON());531 // } else if (messageObject.command == "updatescrollguidline") {532 // }533 }534}535//介面用於接收來自MainFrame的指令536function actionMessage(evt) {537 var message;538 var messageObject = evt;539 message = "BookFrame got " + messageObject.data;540 // console.log(message);541 if (messageObject.from == "MainFrame") {542 console.log("BookFrame : " + messageObject.command + " " + messageObject.data);543 switch (messageObject.command) {544 //跳頁、翻頁545 case 'screenSyncMessagePrevPage':546 case 'screenSyncMessageNextPage':547 case 'screenSyncMessageJumpPage':548 gotoPage(Number(messageObject.data));549 break;550 //同步註記551 case 'screenSyncMessageSyncPageNote':552 SyncNotes(messageObject.data);553 break;554 //同步書的功能555 case 'messageDataTypeBookSyncMessage':556 SyncBook(messageObject.data);557 break;558 //同步縮放平移559 case 'screenSyncMessageScaleMothBoard':560 var data = messageObject.data.split(';');561 SyncZoomAndScroll(data);562 break;563 }564 // //跳頁、翻頁565 // if ((messageObject.command == "screenSyncMessagePrevPage") ||566 // (messageObject.command == "screenSyncMessageNextPage") ||567 // (messageObject.command == "screenSyncMessageJumpPage")) {568 // console.log("BookFrame : " + messageObject.command + " " + messageObject.data);569 // gotoPage(Number(messageObject.data));570 // //不知道在幹麼的,會出錯 軒軒571 // //upDateAnimationActionMap(Number(messageObject.data) + 1);572 // //syncBrushChangePage(Number(messageObject.data));573 // } else if (messageObject.command == "screenSyncMessageSyncPageNote") {574 // //同步註記575 // console.log("BookFrame : " + messageObject.command + " " + messageObject.data);576 // SyncNotes(messageObject.data);577 // } else if (messageObject.command == "messageDataTypeBookSyncMessage") {578 // //同步書的其他功能579 // console.log("BookFrame : " + messageObject.command + " " + messageObject.data);580 // // alert(messageObject.command + ', ' + messageObject.data);581 // SyncBook(messageObject.data);582 // } else if (messageObject.command == 'screenSyncMessageScaleMothBoard') {583 // //縮放平移584 // console.log("BookFrame : " + messageObject.command + " " + messageObject.data);585 // var data = messageObject.data.split(';');586 // SyncZoomAndScroll(data);587 // }588 // else if (messageObject.command == "changeController") {589 // console.log("BookFrame : " + messageObject.command + " " + messageObject.data);590 // UserState = bookSyncInfo.UserState;591 // } else if (messageObject.command == "screenSyncMessageScaleMothBoard") {592 // //Scale593 594 // console.log("BookFrame : " + messageObject.command + " " + messageObject.data);595 // if (Number(messageObject.data) == 1) {596 // if (isTwoPages == 0) {597 // SinglePageSetting();598 // } else if (isTwoPages == 1) {599 // TwoPageSetting();600 // }601 // } else {602 // if (isScaleUp == 1) {603 // if (isTwoPages == 0) {604 // SinglePageSetting();605 // } else if (isTwoPages == 1) {606 // TwoPageSetting();607 // }608 // isScaleUp = 0;609 // }610 // scaleEBooK(Number(messageObject.data));611 // }612 // } else if (messageObject.command == "screenSyncMessageScrollMotherBoard") {613 // //Scale614 // console.log("BookFrame : " + messageObject.command + " " + messageObject.data);615 // var arr = messageObject.data.split(',');616 // var tmp1 = arr[0].split('{');617 // var tmp2 = arr[1].split('}');618 // //alert(tmp1.length + " " + tmp2.length + " " + tmp1[1] + " " + tmp2[0]);619 // //scaleEBooK(Number(messageObject.data));620 // //alert("-------------------0");621 // scrollEBooK(Number(tmp1[1]), Number(tmp2[0]));622 // //alert("-------------------1");623 // } else if (messageObject.command == "browserWidthHeight") {624 // console.log("BookFrame : " + messageObject.command + " " + messageObject.data);625 // //alert("BookFrame : " + messageObject.command + " " + messageObject.data);626 // var hasTouch = 'ontouchstart' in window;627 // //for ipod Safari resize628 // if (hasTouch) {629 // var arr = messageObject.data.split(' ');630 // if ((recordWidth != Number(arr[0])) || (recordHeight != Number(arr[1]))) {631 // resizeSafari(Number(arr[0]), Number(arr[1]));632 // recordWidth = Number(arr[0]);633 // recordHeight = Number(arr[1]);634 // }635 // }636 // } else if (messageObject.command == "resizeBook") {637 // console.log("BookFrame : " + messageObject.command + " " + messageObject.data);638 // //alert("BookFrame : " + messageObject.command + " " + messageObject.data);639 // var hasTouch = 'ontouchstart' in window;640 // //for ipod Safari/Android resize641 // if (hasTouch) {642 // var arr = messageObject.data.split(' ');643 // if ((recordWidth != Number(arr[0])) || (recordHeight != Number(arr[1]))) {644 // resizeSafari(Number(arr[0]), Number(arr[1]));645 // recordWidth = Number(arr[0]);646 // recordHeight = Number(arr[1]);647 // }648 // }649 // } else if (messageObject.command == "screenSyncMessagePlayAnimation") {650 // console.log("BookFrame : " + messageObject.command + " " + messageObject.data);651 // var id = messageObject.data;652 // runSlideAnimation(id.toString());653 // } else if (messageObject.command == "screenSyncMessageRequestPlayedAnimations") {654 // //不知道在幹麼 軒軒655 // /*console.log("BookFrame : " + messageObject.command + " " + messageObject.data);656 // var data = messageObject.data.split(';');657 // var count = data.length;658 // for (var i = 0; i < count; i++) {659 660 // if (i == 0) {661 // runBeforeAnimationAction(bookSyncInfo.bookpage, data[i]);662 // }663 // var value = getAnimationIsAction(data[i]);664 // console.log(data[i] + " = " + value);665 // if (value == 0) {666 // recordPPT(data[i]);667 // setAnimationHasAction(data[i], 1);668 // }669 // runSlideAnimationEnd(data[i]);670 // }*/671 // } else if (messageObject.command == "updateSyncStatusAtBook") {672 // console.log("BookFrame : " + messageObject.command + " " + messageObject.data);673 // changeSyncConnectionImgforBook();674 // } else if (messageObject.command == "galleryStopMove") {675 // console.log("BookFrame : " + messageObject.command + " " + messageObject.data);676 // gallery.stopMove();677 // JQ("#Hamastarwrapper").css('-ms-touch-action', "auto");678 // } else if (messageObject.command == "galleryRunMove") {679 // console.log("BookFrame : " + messageObject.command + " " + messageObject.data);680 // gallery.runMove();681 // JQ("#Hamastarwrapper").css('-ms-touch-action', "none");682 // } else if (messageObject.command == "reSizeToolBarforIPADAndroid") {683 // console.log("reSizeToolBarforIPADAndroid : " + messageObject.command + " " + messageObject.data);684 // //alert("reSizeToolBarforIPADAndroid : " + messageObject.command + " " + messageObject.data);685 // var hasTouch = 'ontouchstart' in window;686 // //for ipod Safari/Android/MS tablet resize687 // if ((hasTouch) || (window.navigator.msPointerEnabled)) {688 // var arr = messageObject.data.split(' ');689 // reSizeToolBarforIPADAndroid(Number(arr[0]), Number(arr[1]), Number(arr[2]), Number(arr[3]), Number(arr[4]), Number(arr[5]));690 // }691 // } else if (messageObject.command == "updateSinglePageCMD") {692 // console.log("BookFrame : " + messageObject.command + " " + messageObject.data + " EbookStyle = " + EbookStyle);693 // //alert("BookFrame : " + messageObject.command + " " + messageObject.data + " EbookStyle = " + EbookStyle);694 // if (EbookStyle == 525740) {695 // isChangedPageMode = 1;696 // updateSinglePage();697 // }698 // } else if (messageObject.command == "updateTwoPageCMD") {699 // console.log("BookFrame : " + messageObject.command + " " + messageObject.data + " EbookStyle = " + EbookStyle);700 // //alert("BookFrame : " + messageObject.command + " " + messageObject.data + " EbookStyle = " + EbookStyle);701 // if (EbookStyle == 525740) {702 // isChangedPageMode = 1;703 // updateTwoPage();704 // }705 // } else if (messageObject.command == "closeSyncStatusAtBook") {706 // console.log("BookFrame : " + messageObject.command + " " + messageObject.data);707 // closeSyncConnectionImgforBook();708 // } else if (messageObject.command == "closeReLoadVideoIDCMD") {709 // console.log("BookFrame : " + messageObject.command + " " + messageObject.data);710 // closeReLoadVideoID();711 // }712 }...

Full Screen

Full Screen

MainFrame.js

Source:MainFrame.js Github

copy

Full Screen

1var MainFrame =2{3 //-----------------------------------------------------------------------4 // public properties (can be invoked in other pages)5 //-----------------------------------------------------------------------6 7 toolBar: null,8 9 menuTabStrip: null,10 11 tabStrip: null,1213 customModuleIds: {},14 15 //-----------------------------------------------------------------------16 // private properties (can be invoked in other pages)17 //-----------------------------------------------------------------------18 19 _barMap: {},2021 _treeMap: {},2223 _currentTree: null,2425 _confirmBeforeUnload: true,2627 _jocketMessageHandlerMap: {},28 29 _menuNumbers: clientData.menuNumbers,3031 _menuNumberUnitIds: Jui.array.toSet(clientData.menuNumberUnitIds),3233 _menuNumberProperties: clientData.menuNumberProperties,34 35 _menuTexts: {},36 37 _searchMenuBox: null,38 39 //-----------------------------------------------------------------------40 // public methods (can be invoked in other pages)41 //-----------------------------------------------------------------------4243 loadTree: function(barId)44 {45 var tree = MainFrame._treeMap[barId];46 if (tree != null) {47 Utility.invoke("Qs.Menu.getTree", {parentId:barId}, true, function(ret) {48 tree.load(MainFrame._processTreeJson(ret.data));49 tree.expandLevel(clientData.menuExpandLevel - 1);50 });51 }52 },53 54 addEntity: function(unitCode, args, dialogOptions)55 {56 CommonBusiness.openEntity(unitCode, args, "Dialog", null, dialogOptions);57 },58 59 broadcast: function(data)60 {61 var array = frames;62 while (array.length != 0) {63 var next = [];64 for (var i = 0; i < array.length; ++i) {65 var frame = array[i];66 try {67 var frameWindow = Jui.dom.getFrameWindow(frame);68 frameWindow.postMessage(data, "*");69 for (var j = 0, subFrames = frameWindow.frames; j < subFrames.length; ++j) {70 next.push(subFrames[j]);71 }72 }73 catch (e) {74 }75 }76 array = next;77 }78 },79 80 setJocketMessageHandler: function(messageCode, handler)81 {82 MainFrame._jocketMessageHandlerMap[messageCode] = handler;83 },8485 refreshMenuNumbers: function(unitId)86 {87 var unitIds = [];88 for (var i = 0, array = Jui.array.make(unitId); i < array.length; ++i) {89 if (array[i] in MainFrame._menuNumberUnitIds) {90 unitIds.push(array[i]);91 }92 }93 if (unitIds.length > 0) {94 Utility.invoke("Qs.MenuNumber.getNumbers", {unitIds:unitIds}, false, function(ret) {95 MainFrame._menuNumberChangeHandler(ret.numbers);96 });97 }98 },99 100 refreshMarquee: function()101 {102 Utility.invoke("Qs.Marquee.getActiveItems", null, false, function(ret) {103 MainFrame._marquee.load(ret.items);104 });105 },106 107 refreshSystemMessageCount: function()108 {109 var button = MainFrame.toolBar.getItem("SystemMessage");110 if (button != null) {111 Utility.invoke("Qs.SystemMessage.getNewItemCount", null, false, function(ret) {112 MainFrame.setSystemMessageCount(ret.count);113 });114 }115 },116 117 setSystemMessageCount: function(count)118 {119 var button = MainFrame.toolBar.getItem("SystemMessage");120 if (button != null) {121 if (MainFrame._systemMessageButtonText == null) {122 MainFrame._systemMessageButtonText = button.getText();123 }124 if (count <= 0) {125 button.setText(MainFrame._systemMessageButtonText);126 }127 else {128 var html = "<span style='padding-right:2px'>" + MainFrame._systemMessageButtonText + "</span>"129 + "<span class=JuiNumberBubble>" + count + "</span>";130 button.setHtml(html);131 }132 }133 },134 135 //-----------------------------------------------------------------------136 // event handlers (should not be invoked in other pages)137 //-----------------------------------------------------------------------138 139 doLoad: function()140 {141 MainFrame.resizer = Jui.option.Resizer.create({142 elements : ["MenuZone", "TabZone"],143 offset : -6,144 shrinks : [6, 6]145 });146147 MainFrame.toolBar = Jui.basic.ToolBar.create({target:"ToolBarZone"});148 MainFrame.toolBar.load(clientData.toolBarJson);149 MainFrame.doResize();150151 //create menu TabStrip152 var isTextVerticalArrangeable = /^zh-/.test(clientData.language);153 MainFrame.menuTabStrip = Jui.option.TabStrip.create({154 target : "MenuZone",155 tabPosition : "left",156 textType : isTextVerticalArrangeable ? "text" : "image"157 });158 if (!isTextVerticalArrangeable) {159 for (var i = 0; i < clientData.menuJson.length; ++i) {160 var item = clientData.menuJson[i];161 item.text = Utility.getUrl("Qs.Menu.GetModuleTextImage.file", {moduleId:item.id});162 }163 }164 MainFrame.menuTabStrip.load(clientData.menuJson);165 166 //load OutlookBars/Trees167 for (var i = 0; i < clientData.menuJson.length; ++i) {168 var tabJson = clientData.menuJson[i];169 var tabId = tabJson.id;170 var tabBody = MainFrame.menuTabStrip.getBody(tabId);171 if (tabId in MainFrame.customModuleIds) {172 continue;173 }174 if (tabJson.children == null && tabJson.data != null && tabJson.data.page != null) {175 var frameId = tabJson.data.page.replace(/\.page$/, "");176 tabBody.innerHTML = "<iframe class=FullSize id='" + frameId + "'></iframe>";177 tabBody.firstChild.src = tabJson.data.page;178 MainFrame._barMap[tabId] = "loaded";179 continue;180 }181 var barsJson = tabJson.children || [];182 var bar = Jui.option.OutlookBar.create({showBorder:false, target:tabBody});183 MainFrame._barMap[tabId] = bar; 184 bar.load(barsJson);185 for (var j = 0; j < barsJson.length; ++j) {186 var barJson = barsJson[j];187 var barId = barJson.id;188 if (!Jui.string.isEmpty(barId)) {189 var tree = Jui.option.Tree.create({190 style : "padding-left:8px;padding-top:2px;width:100%;height:100%;overflow:auto", 191 target : bar.getBody(barId),192 onleafclick : MainFrame.doTreeLeafClick193 });194 tree.load(MainFrame._processTreeJson(barJson.children || []));195 tree.expandLevel(clientData.menuExpandLevel - 1);196 MainFrame._treeMap[barId] = tree;197 }198 }199 }200 if (clientData.menuHide) {201 MainFrame.doSwitchMenuClick();202 }203204 MainFrame.tabStrip = Jui.option.TabStrip.create({205 target : "TabZone",206 dynamic : true,207 maximizable : true,208 maxTabCount : clientData.maxTabCount,209 maxTabWidth : clientData.maxTabWidth //TODO HTML5210 });211 for (var i = 0; i < clientData.autoOpenPages.length; ++i) {212 var page = clientData.autoOpenPages[i];213 var options = {lock:page.code == "Qs.Homepage"};214 Utility.openTab(page.code + '.page', null, page.title, page.icon, null, null, false, options);215 }216 if (clientData.argsFromEmail != null) {217 MainFrame._openPageFromEmail(clientData.argsFromEmail);218 }219 if (!Jui.array.isEmpty(clientData.missingPageCodes)) {220 var codes = clientData.missingPageCodes.join(", ");221 Jui.message.alert($text("Qs.MainFrame.InvalidAutoOpenPageCode").replace("${0}", codes));222 }223224 MainFrame._marquee = Jui.option.Marquee.create({225 target : "MarqueeZone",226 direction : clientData.marqueeDirection || "left",227 onitemclick : MainFrame.doMarqueeItemClick228 });229 MainFrame._openJocket();230 MainFrame._checkPassword();231 MainFrame.refreshMarquee();232 MainFrame.refreshSystemMessageCount();233 },234235 doResize: function()236 {237 //跑马灯重写算轨道距离chrome要设一点延迟,否则会导致计算不准,最终跑马灯轨道和其他元素重叠238 setTimeout(function(){239 var left = MainFrame.toolBar.getLeftRect();240 var right = MainFrame.toolBar.getRightRect();241 var container = $elem("MarqueeZone");242 container.style.left = left.right + "px";243 container.style.width = (right.left - left.right) + "px";244 },10);245 },246 247 doBeforeUnload: function()248 {249 if (MainFrame._confirmBeforeUnload) {250 return $text("Qs.System.CloseBrowserConfirm");251 }252 },253 254 doSwitchMenuClick: function()255 {256 var isShow = $elem("MenuZone").style.display == "none";257 $elem("MenuZone").style.display = isShow ? "" : "none";258 if (!isShow) {259 MainFrame._tabZoneLeft = $elem("TabZone").offsetLeft;260 }261 $elem("TabZone").style.left = isShow ? MainFrame._tabZoneLeft + "px" : "0px";262 MainFrame.resizer.setVisible(isShow);263 },264 265 doSearchMenuClick: function()266 {267 var menuZone = $elem("MenuZone");268 var isShow = !menuZone.hasAttribute("SearchMenu");269 if (menuZone.style.display == "none") {270 MainFrame.doSwitchMenuClick();271 isShow = false;272 }273 Jui.dom.tagAttribute(menuZone, "SearchMenu", isShow);274 if (MainFrame._searchMenuBox == null) {275 MainFrame._searchMenuBox = Jui.basic.InputBox.create({276 target : "SearchMenuPane",277 emptyText : $text("Public.KeywordBoxEmptyText"), 278 style : "width:100%",279 onkeydown : MainFrame.doSearchMenuBoxKeyDown280 });281 }282 },283284 doSearchMenuBoxKeyDown: function(event)285 {286 if (event.keyCode != 13) {287 return;288 }289 var keyword = Jui.string.trim(MainFrame._searchMenuBox.getValue()).toLowerCase();290 if (Jui.string.isEmpty(keyword)) {291 MainFrame._menuSearch = null;292 return;293 }294 if (MainFrame._menuSearch == null || keyword != MainFrame._menuSearch.keyword) {295 MainFrame._menuSearch = {keyword:keyword};296 }297 var setSearchResult = function(moduleId, subModuleId, menuId) {298 MainFrame.menuTabStrip.setCurrentId(moduleId);299 MainFrame._barMap[moduleId].setCurrentId(subModuleId);300 MainFrame._treeMap[subModuleId].setCurrentId(menuId);301 MainFrame._menuSearch.previousResult = subModuleId + menuId;302 };303 var firstItem = null;304 var previousResultPassed = MainFrame._menuSearch.previousResult == null;305 for (var i = 0; i < clientData.menuJson.length; ++i) {306 var module = clientData.menuJson[i];307 var subModules = module.children || [];308 for (var j = 0; j < subModules.length; ++j) {309 var subModule = subModules[j];310 var tree = MainFrame._treeMap[subModule.id];311 if (tree != null) {312 var treeItems = tree.getData(true);313 for (var k = 0; k < treeItems.length; ++k) {314 var item = treeItems[k];315 if (item.text.toLowerCase().indexOf(keyword) != -1) {316 if (previousResultPassed) {317 setSearchResult(module.id, subModule.id, item.id);318 return;319 }320 if (firstItem == null) {321 firstItem = {moduleId:module.id, subModuleId:subModule.id, menuId:item.id};322 }323 }324 if (subModule.id + item.id == MainFrame._menuSearch.previousResult) {325 previousResultPassed = true;326 }327 }328 }329 } 330 }331 if (firstItem != null) {332 setSearchResult(firstItem.moduleId, firstItem.subModuleId, firstItem.menuId);333 }334 else {335 Jui.message.hint($text("Qs.MainFrame.MenuNotFound", keyword));336 }337 },338 339 doModifyPassword: function(args)340 { 341 var options = {height:230};342 options = Jui.object.isEmpty(args) ? options : Jui.object.merge(options,args);;343 Utility.openDialog("Qs.User.PasswordModify.page", null, options, function(ret){344 if(options.hasOwnProperty('showCloseButton') && options.showCloseButton == false) {345 if (!ret.modifyPassword) {346 MainFrame.doModifyPassword(args);347 }348 }349 });350 },351 352 doLogout: function()353 {354 Jui.message.confirm($text("Qs.OnlineUser.LogoutConfirm"), function() {355 Utility.invoke("Qs.OnlineUser.logout", null, true, function() {356 MainFrame._jumpToLoginPage();357 });358 });359 },360 361 doThemeClick: function(event)362 {363 Jui.message.confirm($text("Qs.System.SwitchThemeConfirm"), function() {364 Jui.theme.setName(event.id);365 MainFrame._confirmBeforeUnload = false;366 window.location.reload();367 });368 },369 370 doFeedback: function()371 {372 window.open("mailto:" + clientData.feedbackEmail);373 },374 375 doAbout: function()376 {377 Utility.openDialog("Qs.Misc.About.page");378 },379380 doOpenSystemMessageList: function()381 {382 var pageCode = "Qs.SystemMessage.List";383 var body = MainFrame.tabStrip.getBody(pageCode);384 if (body == null) {385 var page = Utility.getPage(pageCode);386 Utility.openTab("Qs.SystemMessage.List.page", null, page.title, page.icon, null, pageCode);387 }388 else {389 MainFrame.tabStrip.setCurrentId(pageCode);390 body.contentWindow.SystemMessageList.showNewItems();391 }392 },393 394 doSystemMessageItemClick: function(event)395 {396 SystemMessage.open(event.item.id, event.item.unitId, event.item.entityId);397 if (event.allRead) {398 this.close();399 }400 },401 402 doMarqueeItemClick: function(event)403 {404 CommonBusiness.openEntity("Qs.Marquee", {entityId:event.item.id}, "Tab");405 },406 407 doOpenPageFromEmail: function()408 {409 Utility.invoke("Qs.Misc.getOnlineArgsFromEmail", null, true, function(ret) {410 if (ret.args == null) {411 Jui.message.alert($text("Qs.Misc.NoOnlineArgsFromEmail"));412 }413 else {414 MainFrame._openPageFromEmail(ret.args);415 }416 });417 },418 419 doCheckWordPaster: function()420 {421 Utility.openDialog("Qs.Misc.InstallWordPaster.page");422 },423424 doTreeLeafClick: function(event)425 {426 MainFrame._currentTree = this;427 MainFrame._execute(event);428 },429 430 doOpenHomepage: function(event)431 {432 for (var i = 0; i < clientData.autoOpenPages.length; ++i) {433 var page = clientData.autoOpenPages[i];434 if (page.code == "Qs.GraphHomepage" || page.code == "Qs.Homepage") {435 Utility.openTab(page.code + '.page', null, page.title, page.icon);436 }437 }438 },439440 doOpenQuerySchema: function(event)441 {442 var data = event.data;443 var args = {schemaId:data.schemaId};444 Utility.openTab(data.unitCode + ".List.page", args, data.unitName, event.icon);445 },446447 doMessage: function(event)448 {449 var data = event.data;450 if (data.action == "broadcast") {451 MainFrame.broadcast(data.args.data);452 }453 else if (data.action == "crossFrameCall") {454 var frame = frames[data.args.frameId];455 if (frame != null) {456 var args = {functionName:data.args.functionName, functionArgs:data.args.functionArgs};457 Utility.postMessage(Jui.dom.getFrameWindow(frame), {action:"callFunction", args:args});458 }459 }460 },461462 doJocketOpen: function()463 {464 },465 466 doJocketClose: function(code, reason)467 {468 var INVALID_HTTP_SESSION = 4900;469 if (code == INVALID_HTTP_SESSION) {470 MainFrame._jumpToLoginPage("Timeout", reason);471 }472 },473474 doJocketMessage: function(code, data)475 {476 var handler = MainFrame._jocketMessageHandlerMap[code];477 if (handler != null) {478 handler(data);479 }480 },481 482 //-----------------------------------------------------------------------483 // private methods (should not be invoked in other pages)484 //-----------------------------------------------------------------------485 486 _openJocket: function()487 {488 var jocket = new Jocket({path:"/jocket/inner"});489 jocket.on("open", MainFrame.doJocketOpen);490 jocket.on("close", MainFrame.doJocketClose);491 jocket.on("message", MainFrame.doJocketMessage);492 MainFrame.setJocketMessageHandler("Qs.Marquee.Change", MainFrame._marqueeChangeHandler);493 MainFrame.setJocketMessageHandler("Qs.Menu.NumberChange", MainFrame._menuNumberChangeHandler);494 MainFrame.setJocketMessageHandler("Qs.Session.Invalidate", MainFrame._sessionInvalidateHandler);495 MainFrame.setJocketMessageHandler("Qs.SystemMessage.New", MainFrame._newSystemMessageHandler);496 MainFrame.setJocketMessageHandler("Wf.Activity.InstantActivityFinished", MainFrame._instantActivityFinishedHandler);497 MainFrame.setJocketMessageHandler("Qs.OnlineUser.Handshake", MainFrame._onlineUserHandshakeHandler);498 },499500 _sessionInvalidateHandler: function(json)501 {502 MainFrame._jumpToLoginPage(json.action);503 },504505 _marqueeChangeHandler: function(json)506 {507 MainFrame.refreshMarquee();508 },509 510 _menuNumberChangeHandler: function(json)511 {512 var data = [];513 for (var menuId in json) {514 MainFrame._menuNumbers[menuId] = json[menuId];515 if (menuId in MainFrame._menuTexts) {516 var html = MainFrame._getMenuNodeHtml(menuId, json[menuId]);517 data.push({id:menuId, html:html});518 }519 }520 for (var barId in MainFrame._treeMap) {521 MainFrame._treeMap[barId].update(data, {});522 }523 },524 525 _newSystemMessageHandler: function()526 {527 Utility.invoke("Qs.SystemMessage.getTodoItems", null, false, function(ret) {528 if (!Jui.array.isEmpty(ret.items)) {529 var box = Jui.option.MessageReminder.open(ret);530 box.onitemclick = MainFrame.doSystemMessageItemClick;531 }532 MainFrame.setSystemMessageCount(ret.count);533 });534 },535 536 _instantActivityFinishedHandler: function(json)537 {538 MainFrame.broadcast({action:"InstantActivityFinished", args:{activityId:json.activityId}});539 },540 541 _onlineUserHandshakeHandler: function(json)542 {543 Utility.invoke("Qs.OnlineUser.respondHandshake", {key:json.key}, false);544 },545 546 _execute: function(event)547 {548 var data = event.json.data;549 if (Jui.object.isEmpty(data)) {550 Jui.message.alert("The link of this node is not set.");551 return;552 }553 if (data.page != null) {554 if (data.openMode == "Window") {555 Utility.openWindow(data.page, data.args);556 }557 else {558 var tabTitle = data.title || MainFrame._menuTexts[event.json.id] || event.json.text;559 var options = {openNewTab:data.openNewTab};560 Utility.openTab(data.page, data.args, tabTitle, event.json.icon, null, null, true, options);561 }562 }563 else {564 var temp = eval(data["function"]);565 if (!/\(/.test(data["function"])) {566 temp(event);567 }568 }569 },570571 _jumpToLoginPage: function(jumpCode, description)572 {573 var url = ".";574 if (jumpCode != null) {575 url += "?jumpCode=" + jumpCode;576 if (description != null) {577 url += "&description=" + encodeURIComponent(description);578 }579 }580 window.onbeforeunload = null;581 for (var i = 0; i < window.frames.length; ++i) {582 try {583 Jui.dom.getFrameWindow(window.frames[i]).onbeforeunload = null;584 }585 catch (e) {586 }587 }588 window.location.href = url;589 },590591 _processTreeJson: function(data)592 {593 for (var i = 0; i < data.length;) {594 var item = data[i];595 if (item.replaceByChildren && item.children != null && item.children.length > 0) {596 data = data.slice(0, i).concat(item.children, data.slice(i + 1));597 }598 else {599 MainFrame._menuTexts[item.id] = item.text;600 if (item.id in MainFrame._menuNumbers) {601 item.html = MainFrame._getMenuNodeHtml(item.id, MainFrame._menuNumbers[item.id]);602 }603 if (item.children != null && item.children.length > 0) {604 MainFrame._processTreeJson(item.children);605 }606 ++i;607 }608 }609 return data;610 },611 612 _getMenuNodeHtml: function(menuId, numbers)613 {614 var nonZeroNumbers = [];615 if (numbers != null) {616 for (var i = 0; i < numbers.length; ++i) {617 if (numbers[i] > 0) {618 var properties = (MainFrame._menuNumberProperties[menuId] || [])[i] || {};619 var html = "<label class=MenuNumber style='";620 if (properties.color != null) {621 html += "color:" + properties.color + ";";622 }623 if (properties.isBold != null) {624 html += "font-weight:bold;";625 }626 nonZeroNumbers.push(html + "'>" + numbers[i] + "</label>");627 }628 }629 }630 var html = Jui.$h(MainFrame._menuTexts[menuId]);631 if (nonZeroNumbers.length > 0) {632 var joiner = "<label class=MenuNumberSplitter>/</label>";633 html += "<span class=MenuNumbers>(" + nonZeroNumbers.join(joiner) + ")</span>";634 }635 return html;636 },637 638 _openPageFromEmail: function(args)639 {640 if (args.unitCode != null && args.entityId != null) {641 CommonBusiness.tryOpenViewPage(args.unitCode, args.entityId, true, function() {642 CommonBusiness.openEntity(args.unitCode, {entityId:args.entityId}, "Tab");643 });644 }645 },646 647 _checkPassword: function()648 {649 Utility.invoke("Qs.User.checkPassword", null, true, function(ret) {650 if (ret.needModify) {651 MainFrame.doModifyPassword({showCloseButton: !ret.forceModify});652 }653 });654 }655};656657MainFrame.setWebSocketMessageHandler = MainFrame.setJocketMessageHandler;658Utility.addFunctionAlias(MainFrame);659window.onload = MainFrame.doLoad;660window.onbeforeunload = MainFrame.doBeforeUnload;661window.onmessage = MainFrame.doMessage; ...

Full Screen

Full Screen

Topjavascript.js

Source:Topjavascript.js Github

copy

Full Screen

1//前台顶部2function topMenu(){//信用資料3 parent.frames.mainFrame.location.href='topMenu.php';4}5function upPwd(){//修改密码6 parent.frames.mainFrame.location.href='UpPwd.php';7}8function report(){//未結明細9 parent.frames.mainFrame.location.href='Report.php';10}11function repore(){//兩周報表12 parent.frames.mainFrame.location.href='Repore.php';13}14function result(){//歷史開獎15 parent.frames.mainFrame.location.href='result.php';16}17function rule(){//規則說明18 parent.frames.mainFrame.location.href='/user/rule/';19}2021function quit(){22 if(!confirm("您確定退出嗎?")){return;}23 parent.frames.mainFrame.location.href='Quit.php';2425 }2627function resut(){28 parent.frames.mainFrame.location.href='Reporse.php?gid=';29}30//前台广东31function sGame_sm_gd(){32 parent.frames.mainFrame.location.href='sGame_sm.php?g=g9';33}34function sGame_sz_gd(){35 parent.frames.mainFrame.location.href='sGame_sz.php?g=g9';36}37function sGame_1(){38 parent.frames.mainFrame.location.href='sGame.php?g=g1';39}40function sGame_2(){41 parent.frames.mainFrame.location.href='sGame.php?g=g2';42}43function sGame_3(){44 parent.frames.mainFrame.location.href='sGame.php?g=g3';45}46function sGame_4(){47 parent.frames.mainFrame.location.href='sGame.php?g=g4';48}49function sGame_5(){50 parent.frames.mainFrame.location.href='sGame.php?g=g5';51}52function sGame_6(){53 parent.frames.mainFrame.location.href='sGame.php?g=g6';54}55function sGame_7(){56 parent.frames.mainFrame.location.href='sGame.php?g=g7';57}58function sGame_8(){59 parent.frames.mainFrame.location.href='sGame.php?g=g8';60}61function sGame_l(){62 parent.frames.mainFrame.location.href='sGame_l.php?g=k1';63}64function sGame_k(){65 parent.frames.mainFrame.location.href='sGame_k.php?g=k2';66}67//前台农场68function sGame_sm_nc(){69 parent.frames.mainFrame.location.href='sGame_sm_nc.php?g=g9';70}71function sGame_sz_nc(){72 parent.frames.mainFrame.location.href='sGame_sz_nc.php?g=g9';73}74function sGamenc(url){75 parent.frames.mainFrame.location.href='sGame_nc.php?g=g'+url;76}77function sGamenc_l(){78 parent.frames.mainFrame.location.href='sGame_l_nc.php?g=k1';79}80function sGamenc_k(){81 parent.frames.mainFrame.location.href='sGame_k_nc.php?g=k2';82}83//前台重庆84function sGame_sm_cq(){85 parent.frames.mainFrame.location.href='sGame_sm_cq.php?g=g10';86}87function sGame_sz_cq(){88 parent.frames.mainFrame.location.href='sGame_sz_cq.php?g=g10';89}90function sGame_cq_1(){91 parent.frames.mainFrame.location.href='sGame_cq.php?g=g1';92}93function sGame_cq_2(){94 parent.frames.mainFrame.location.href='sGame_cq.php?g=g2';95}96function sGame_cq_3(){97 parent.frames.mainFrame.location.href='sGame_cq.php?g=g3';98}99function sGame_cq_4(){100 parent.frames.mainFrame.location.href='sGame_cq.php?g=g4';101}102function sGame_cq_5(){103 parent.frames.mainFrame.location.href='sGame_cq.php?g=g5';104}105//前台极速时时彩106function sGame_sm_jxssc(){107 parent.frames.mainFrame.location.href='sGame_sm_jxssc.php?g=g10';108}109function sGame_sz_jxssc(){110 parent.frames.mainFrame.location.href='sGame_sz_jxssc.php?g=g10';111}112function sGame_jxssc(g){113 parent.frames.mainFrame.location.href='sGame_jxssc.php?g=g'+g;114}115//前台新疆时时彩116function sGame_sm_xjssc(){117 parent.frames.mainFrame.location.href='sGame_sm_xjssc.php?g=g10';118}119function sGame_sz_xjssc(){120 parent.frames.mainFrame.location.href='sGame_sz_xjssc.php?g=g10';121}122function sGame_xjssc(g){123 parent.frames.mainFrame.location.href='sGame_xjssc.php?g=g'+g;124}125//前台天津时时彩126function sGame_sm_tjssc(){127 parent.frames.mainFrame.location.href='sGame_sm_tjssc.php?g=g10';128}129function sGame_sz_tjssc(){130 parent.frames.mainFrame.location.href='sGame_sz_tjssc.php?g=g10';131}132function sGame_tjssc(g){133 parent.frames.mainFrame.location.href='sGame_tjssc.php?g=g'+g;134}135//前台北京136function sGame_sm_pk(){137 parent.frames.mainFrame.location.href='sGame_sm_pk.php?g=g11';138}139function sGame_sz_pk(){140 parent.frames.mainFrame.location.href='sGame_sz_pk.php?g=g10';141}142function sGame_pk(){143 parent.frames.mainFrame.location.href='sGame_pk.php?g=g1';144}145function sGame_pk_3(){146 parent.frames.mainFrame.location.href='sGame_pk_3.php?g=g3';147}148function sGame_pk_7(){149 parent.frames.mainFrame.location.href='sGame_pk_7.php?g=g7';150}151//前台飞艇152function sGame_sm_xyft(){153 parent.frames.mainFrame.location.href='sGame_sm_xyft.php?g=g11';154}155function sGame_sz_xyft(){156 parent.frames.mainFrame.location.href='sGame_sz_xyft.php?g=g10';157}158function sGame_xyft(){159 parent.frames.mainFrame.location.href='sGame_xyft.php?g=g1';160}161function sGame_xyft_3(){162 parent.frames.mainFrame.location.href='sGame_xyft_3.php?g=g3';163}164function sGame_xyft_7(){165 parent.frames.mainFrame.location.href='sGame_xyft_7.php?g=g7';166}167//前台吉林168function saizi(){169 parent.frames.mainFrame.location.href='saizi.php';170}171function saizi_2(){172 parent.frames.mainFrame.location.href='saizi_2.php';173}174function kl8_gg(){175 parent.frames.mainFrame.location.href='kl8.php';176}177function kl8_zm(){178 parent.frames.mainFrame.location.href='kl8_zm.php';179}180//后台广东181function oddsFile_1(){182 parent.frames.mainFrame.location.href='oddsFile.php?cid=1';183}184function oddsFile_2(){185 parent.frames.mainFrame.location.href='oddsFile.php?cid=2';186}187function oddsFile_3(){188 parent.frames.mainFrame.location.href='oddsFile.php?cid=3';189}190function oddsFile_4(){191 parent.frames.mainFrame.location.href='oddsFile.php?cid=4';192}193function oddsFile_5(){194 parent.frames.mainFrame.location.href='oddsFile.php?cid=5';195}196function oddsFile_6(){197 parent.frames.mainFrame.location.href='oddsFile.php?cid=6';198}199function oddsFile_7(){200 parent.frames.mainFrame.location.href='oddsFile.php?cid=7';201}202function oddsFile_8(){203 parent.frames.mainFrame.location.href='oddsFile.php?cid=8';204}205function oddsFile_LH(){206 parent.frames.mainFrame.location.href='oddsFile_LH.php?cid=9';207}208function oddsFile_LM(){209 parent.frames.mainFrame.location.href='oddsFile_LM.php?cid=10';210}211function right(){212 parent.frames.mainFrame.location.href='right.php';213}214//后台农场 by qq mj215function oddsFilenc(cid){216 parent.frames.mainFrame.location.href='oddsFilenc.php?cid='+cid;217}218function oddsFile_LH_nc(cid){219 parent.frames.mainFrame.location.href='oddsFile_LH_nc.php?cid='+cid;220}221function oddsFile_LM_nc(cid){222 parent.frames.mainFrame.location.href='oddsFile_LM_nc.php?cid='+cid;223}224//后台重慶225function oddsFilecq(){226 parent.frames.mainFrame.location.href='oddsFilecq.php';227}228function oddsFiles(url){229 parent.frames.mainFrame.location.href=url+'.php';230}231//后台北京232233function oddsFilepk_1(){234 parent.frames.mainFrame.location.href='oddsFilepk.php?cid=1';235}236function oddsFilepk_2(){237 parent.frames.mainFrame.location.href='oddsFilepk.php?cid=2';238}239function oddsFilepk_3(){240 parent.frames.mainFrame.location.href='oddsFilepk.php?cid=3';241}242//后台飞艇 by qq mj243function oddsFilexyft(cid){244 parent.frames.mainFrame.location.href='oddsFilexyft.php?cid='+cid;245}246247//后台江蘇248function saizi(){249 parent.frames.mainFrame.location.href='saizi.php';250}251252//后台用戶253function Actfor_1(){254 parent.frames.mainFrame.location.href='Actfor.php?cid=1';255}256function Actfor_2(){257 parent.frames.mainFrame.location.href='Actfor.php?cid=2';258}259function Actfor_3(){260 parent.frames.mainFrame.location.href='Actfor.php?cid=3';261}262function Actfor_4(){263 parent.frames.mainFrame.location.href='Actfor.php?cid=4';264}265function Actfor_5(){266 parent.frames.mainFrame.location.href='Actfor.php?cid=5';267}268function AccountSon_List(){269 parent.frames.mainFrame.location.href='AccountSon_List.php';270}271function StudIo(){272 parent.frames.mainFrame.location.href='StudIo.php';273}274275function AccountSon_Add(){276 parent.frames.mainFrame.location.href='AccountSon_Add.php';277}278function Account_Member_2(){279 parent.frames.mainFrame.location.href='Account_Member.php?cid=<?php echo $cid?>&sid=2';280}281282//后台個人管理283284function CreditInfo(){285 parent.frames.mainFrame.location.href='CreditInfo.php';286}287function LoginLog(){288 parent.frames.mainFrame.location.href='LoginLog.php';289}290function UpdatePassword(){291 parent.frames.mainFrame.location.href='UpdatePassword.php';292}293function AutoLet(){294 parent.frames.mainFrame.location.href='AutoLet.php';295}296function Amend_Log(){297 parent.frames.mainFrame.location.href='Amend_Log.php';298}299300//后台內部管理301302function Manages(){303 parent.frames.mainFrame.location.href='manages.php';304}305function Managescz(){306 parent.frames.mainFrame.location.href='managescz.php';307}308function oddsInfo(){309 if(document.getElementById("LT")!=null)310 {311 switch(document.getElementById("LT").value)312 {313 case "1":314 parent.frames.mainFrame.location.href='oddsInfo.php';315 break; 316 case "2":317 parent.frames.mainFrame.location.href='oddsInfo3.php';318 break; 319 case "6":320 parent.frames.mainFrame.location.href='oddsInfo6.php';321 break; 322 case "7":323 parent.frames.mainFrame.location.href='oddsInfo7.php';324 break; 325 case "8":326 parent.frames.mainFrame.location.href='oddsInfo8.php';327 break; 328 } 329 }330 else331 parent.frames.mainFrame.location.href='oddsInfo.php';332}333function OddsBC(){334 parent.frames.mainFrame.location.href='OddsBC.php';335}336function NumbeInclude(){337 parent.frames.mainFrame.location.href='NumbeInclude.php';338}339function NumberInclude(){340 parent.frames.mainFrame.location.href='NumberInclude.php';341}342function mrp(){343 parent.frames.mainFrame.location.href='mrp.php';344}345function newsInfo(){346 parent.frames.mainFrame.location.href='newsInfo.php';347}348function CrystagInfo(){349 parent.frames.mainFrame.location.href='CrystagInfo.php';350}351function ReportInfoAll(){352 parent.frames.mainFrame.location.href='ReportInfoAll.php';353}354function RZGL(){355 parent.frames.mainFrame.location.href='RZGL.php';356}357function OnLine(){358 parent.frames.mainFrame.location.href='OnLine.php';359}360//新增公告361function newsAdd(){362 parent.frames.mainFrame.location.href='newsAdd.php';363}364//即时滚球365function Formerly(){366 parent.frames.mainFrame.location.href='Formerly.php';367}368function dataBak(){369 parent.frames.mainFrame.location.href='dataBak.php'; ...

Full Screen

Full Screen

mainframe-1.0.0.js

Source:mainframe-1.0.0.js Github

copy

Full Screen

1(function ($) {2 $.fn.invisible = function () {3 return this.each(function () {4 $(this).css("visibility", "hidden");5 });6 };7 $.fn.visible = function () {8 return this.each(function () {9 $(this).css("visibility", "visible");10 });11 };12}(jQuery));13var lastShowCallback = undefined;14var Mainframe = React.createClass({15 componentDidMount: function () {16 var width = $(".mainframe").width();17 var height = $(".mainframe").height();18 //$(".mainframe-tabs-H").css("min-width", width * 3);19 $(".mainframe-tabs-H").css("height", height);20 //$(".mainframe-tabs-H").css("left", ((-1) * width) + "px");21 $(".mainframe-tabs-H").css("left", "0px");22 $(".mainframe-tabs-H").css("width", width);23 $(".mainframe-center").css("width", width);24 $(".mainframe-center").css("height", height);25 //$(".mainframe-center").visible();26 $(".mainframe-center").show();27 $(".mainframe-east").css("width", width);28 $(".mainframe-east").css("height", height);29 $(".mainframe-east").css("top", "0px");30 $(".mainframe-east").css("left", "0px");31 //$(".mainframe-east").invisible();32 $(".mainframe-east").hide();33 $(".mainframe-west").css("width", width);34 $(".mainframe-west").css("height", height);35 //$(".mainframe-west").invisible();36 $(".mainframe-west").hide();37 $(".mainframe-north").css("width", width);38 $(".mainframe-north").css("height", height);39 //$(".mainframe-north").css("top", ((-1) * height) + "px");40 $(".mainframe-north").css("left", "0px");41 //$(".mainframe-north").invisible();42 $(".mainframe-north").hide();43 $(".mainframe-north").css("top", "0px");44 $(".mainframe-south").css("width", width);45 $(".mainframe-south").css("height", height);46 //$(".mainframe-south").css("top", (height) + "px");47 $(".mainframe-south").css("left", "0px");48 //$(".mainframe-south").invisible();49 $(".mainframe-south").hide();50 $(".mainframe-south").css("top", "0px");51 $(".mainframe-modal").hide();52 },53 render: function () {54 return React.createElement("div", {className: 'mainframe'},55 React.createElement("div", {className: 'mainframe-tabs'},56 React.createElement("div", {className: 'mainframe-tabs-H'},57 React.createElement("div", {className: 'mainframe-west mainframe-tab-H'}, ''),58 React.createElement("div", {className: 'mainframe-center mainframe-tab-H'}, '')59 ),60 React.createElement("div", {className: 'mainframe-modal'}),61 React.createElement("div", {className: 'mainframe-east mainframe-tabs-V'}, ''),62 React.createElement("div", {className: 'mainframe-north mainframe-tabs-V'}, ''),63 React.createElement("div", {className: 'mainframe-south mainframe-tabs-V'}, '')64 )65 );66 },67 center: function (html) {68 if (html) {69 $(".mainframe-center").html(html);70 }71 return $(".mainframe-center")72 },73 east: function (html) {74 if (html) {75 $(".mainframe-east").html(html);76 }77 return $(".mainframe-east")78 },79 west: function (html) {80 if (html) {81 $(".mainframe-west").html(html);82 }83 return $(".mainframe-west")84 },85 north: function (html) {86 if (html) {87 $(".mainframe-north").html(html);88 }89 return $(".mainframe-north")90 },91 south: function (html) {92 if (html) {93 $(".mainframe-south").html(html);94 }95 return $(".mainframe-south")96 },97 reset: function (callback) {98 var self = this;99 var isResettingNorthTwice = false;100 if (!self.isHidden($(".mainframe-north"))) {101 // On gère le cas de l'ouverture en nord de deux fenêtre consécutive (elles se ferment et se rouvre)102 // Si on reset le nord pour le rouvrir juste après (ouverture dans le callback), on le ne fait pas103 if (callback !== undefined && callback.toString().indexOf('north.visible') === -1) {104 var $north = $(".mainframe-north");105 $north.animate({'top': '-=' + $north.height() + 'px'}, $Nav.animationSpeed, function () {106 $north.invisible();107 self.reset(callback);108 });109 }110 // On garde en mémoire qu'on a bloqué l'ouverture111 else {112 isResettingNorthTwice = true;113 }114 } else if (!self.isHidden($(".mainframe-south"))) {115 var $south = $(".mainframe-south");116 // -- On cache la fenetre Sud ==> Incremente nbHideShouth117 nbHideShouth += 1;118 var heightS = $south.height();119 // -- Si nbHideShouth > 1 : On ne fait pas l'animation sinon, on ne poura pas rafficher la fenetre sud120 if (nbHideShouth > 1){121 heightS = 0;122 }123 $south.animate({'top': '+=' + heightS + 'px'}, $Nav.animationSpeed, function () {124 $south.invisible();125 self.reset(callback);126 });127 } else if (!self.isHidden($(".mainframe-west"))) {128 var $west = $(".mainframe-west");129 var $tabs = $('.mainframe-tabs-H');130 $tabs.animate({'left': '-=' + $west.width() + 'px'}, $Nav.animationSpeed, function () {131 $west.invisible();132 self.reset(callback);133 });134 } else if (!self.isHidden($(".mainframe-east"))) {135 var $east = $(".mainframe-east");136 var $tabs = $('.mainframe-tabs-H');137 $tabs.animate({'left': '+=' + $east.width() + 'px'}, $Nav.animationSpeed, function () {138 $east.invisible();139 self.reset(callback);140 });141 } else if (callback && !isResettingNorthTwice) {142 self.toggleModal();143 callback();144 } else {145 self.toggleModal();146 }147 // Si l'ouverture a été bloqué, on rejoue le callback d'ouverture de la fenêtre148 // Pour gèrer correctement les possibles swappages entre la page 1 et la page 2149 if (isResettingNorthTwice && lastShowCallback !== undefined) {150 lastShowCallback();151 }152 },153 showCenter: function (callback) {154 this.reset(callback);155 },156 showEast: function (callback) {157 var self = this;158 var $east = $(".mainframe-east");159 if (self.isHidden($east)) {160 self.reset(function () {161 $east.visible();162 var $tabs = $('.mainframe-tabs-H');163 $tabs.animate({'left': '-=' + $east.width() + 'px'}, $Nav.animationSpeed, function () {164 self.toggleModal();165 if (callback) {166 callback();167 }168 });169 });170 } else if (callback) {171 callback();172 }173 },174 showWest: function (callback) {175 var self = this;176 var $west = $(".mainframe-west");177 if (self.isHidden($west)) {178 self.reset(function () {179 $west.visible();180 var $tabs = $('.mainframe-tabs-H');181 $tabs.animate({'left': '+=' + $west.width() + 'px'}, $Nav.animationSpeed, function () {182 self.toggleModal();183 if (callback) {184 callback();185 }186 });187 });188 } else if (callback) {189 callback();190 }191 },192 showNorth: function (callback) {193 var self = this;194 var $north = $(".mainframe-north");195 if (self.isHidden($north)) {196 lastShowCallback = callback;197 self.reset(function () {198 var $modal = $(".mainframe-modal");199 $modal.show();200 $north.visible();201 $north.animate({'top': '+=' + $north.height() + 'px'}, $Nav.animationSpeed, function () {202 self.toggleModal();203 if (callback) {204 callback();205 }206 });207 });208 } else if (callback) {209 callback();210 }211 },212 showSouth: function (callback) {213 var self = this;214 var $south = $(".mainframe-south");215 if (self.isHidden($south)) {216 self.reset(function () {217 var $modal = $(".mainframe-modal");218 $modal.show();219 $south.visible();220 // -- Affiche la fenetre sud => Reinitialise le nbre de fois q'on va la cacher221 nbHideShouth = 0;222 $south.animate({'top': '-=' + $south.height() + 'px'}, $Nav.animationSpeed, function () {223 self.toggleModal();224 if (callback) {225 callback();226 }227 });228 });229 } else if (callback) {230 callback();231 }232 },233 hideEast: function (callback) {234 var self = this;235 var $east = $(".mainframe-east");236 if (!self.isHidden($east)) {237 self.reset(callback);238 } else if (callback) {239 callback();240 }241 },242 hideWest: function (callback) {243 var self = this;244 var $west = $(".mainframe-west");245 if (!self.isHidden($west)) {246 self.reset(callback);247 } else if (callback) {248 callback();249 }250 },251 hideNorth: function (callback) {252 var self = this;253 var $north = $(".mainframe-north");254 if (!self.isHidden($north)) {255 self.reset(callback);256 } else if (callback) {257 callback();258 }259 },260 hideSouth: function (callback) {261 var self = this;262 var $south = $(".mainframe-south");263 if (!self.isHidden($south)) {264 self.reset(callback);265 } else if (callback) {266 callback();267 }268 },269 isHidden: function (cmp) {270 return cmp.css('display') === 'none' || cmp.css('visibility') === 'hidden';271 },272 toggleModal: function () {273 if (this.isHidden($(".mainframe-south")) && this.isHidden($(".mainframe-north"))) {274 $(".mainframe-modal").hide();275 } else {276 $(".mainframe-modal").show();277 }278 }...

Full Screen

Full Screen

treeData.js

Source:treeData.js Github

copy

Full Screen

1demos = [2 {3 id: 'table',4 text: 'table',5 url: 'demos/table.html',6 target: 'mainFrame',7 supportUser: 'derrickliu'8 },9 {10 id: 'tree',11 text: 'tree',12 url: 'demos/tree.html',13 target: 'mainFrame',14 supportUser: 'derrickliu'15 },16 {17 id: 'validate',18 text: 'validate',19 url: 'demos/validate.html',20 target: 'mainFrame',21 supportUser: 'derrickliu'22 },23 {24 id: 'downlayer',25 text: 'downlayer',26 url: 'demos/downlayer.html',27 target: 'mainFrame',28 supportUser: 'derrickliu'29 },30 {31 id: 'dialog',32 text: 'dialog',33 url: 'demos/dialog/index.html',34 target: 'mainFrame',35 supportUser: 'derrickliu'36 },37 {38 id: 'button',39 text: 'button',40 url: 'demos/button/index.html',41 target: 'mainFrame',42 supportUser: 'derrickliu'43 },44 {45 id: 'buttoninit',46 text: '表单元素初始化调用',47 url: 'demos/buttoninit.html',48 target: 'mainFrame',49 supportUser: 'derrickliu'50 },51 {52 id: 'tabs',53 text: 'tabs',54 url: 'demos/tabs/index.html',55 target: 'mainFrame',56 supportUser: 'derrickliu'57 },58 {59 id: 'tooltip',60 text: 'tooltip',61 url: 'demos/tooltip/index.html',62 target: 'mainFrame',63 supportUser: 'derrickliu'64 },65 {66 id: 'datepicker',67 text: 'datepicker',68 url: 'demos/datepicker/index.html',69 target: 'mainFrame',70 supportUser: 'derrickliu'71 },72 {73 id: 'timepicker',74 text: 'timepicker',75 url: 'demos/timepicker.html',76 target: 'mainFrame',77 supportUser: 'derrickliu'78 },79 {80 id: 'progressbar',81 text: 'progressbar',82 url: 'demos/progressbar/index.html',83 target: 'mainFrame',84 supportUser: 'derrickliu'85 },86 {87 id: 'accordion',88 text: 'accordion',89 url: 'demos/accordion/index.html',90 target: 'mainFrame',91 supportUser: 'derrickliu'92 },93 {94 id: 'autocomplete',95 text: 'autocomplete',96 url: 'demos/autocomplete/index.html',97 target: 'mainFrame',98 supportUser: 'derrickliu'99 },100 {101 id: 'sortable',102 text: 'sortable',103 url: 'demos/sortable/index.html',104 target: 'mainFrame',105 supportUser: 'derrickliu'106 },107 {108 id: 'combobox',109 text: 'combobox',110 url: 'demos/combobox.html',111 target: 'mainFrame',112 supportUser: 'derrickliu'113 },114 {115 id: 'formauto',116 text: 'formauto',117 url: 'demos/form.auto.html',118 target: 'mainFrame',119 supportUser: 'derrickliu'120 },121 {122 id: 'overflowtips',123 text: 'overflowtips',124 url: 'demos/overflowtips.html',125 target: 'mainFrame',126 supportUser: 'derrickliu'127 },128 {129 id: 'zclip',130 text: 'zclip',131 url: 'demos/zclip.html',132 target: 'mainFrame',133 supportUser: 'derrickliu'134 },135 {136 id: 'search',137 text: '搜索切换',138 url: 'demos/search.html',139 target: 'mainFrame',140 supportUser: 'derrickliu'141 },142 {143 id: 'fileupload',144 text: 'h5上传',145 url: 'demos/fileupload.html',146 target: 'mainFrame',147 supportUser: 'derrickliu'148 },149 {150 id: 'multiselect',151 text: '多选下拉框',152 url: 'demos/multiselect.html',153 target: 'mainFrame',154 supportUser: 'derrickliu'155 }156];157docs = [158 {159 id: 'newdoc',160 text: '<b>newdoc</b>',161 url: 'yuidoc/index.html',162 target: 'mainFrame',163 supportUser: 'derrickliu'164 },165 {166 id: 'table-doc',167 text: 'table',168 url: 'docs/ui.table.html',169 target: 'mainFrame',170 supportUser: 'derrickliu'171 },172 {173 id: 'tree-doc',174 text: 'tree',175 url: 'docs/ui.tree.html',176 target: 'mainFrame',177 supportUser: 'derrickliu'178 },179 {180 id: 'validate-doc',181 text: 'validate',182 url: 'docs/ui.validate.html',183 target: 'mainFrame',184 supportUser: 'derrickliu'185 },186 {187 id: 'downlayer-doc',188 text: 'downlayer',189 url: 'docs/ui.downlayer.html',190 target: 'mainFrame',191 supportUser: 'derrickliu'192 },193 {194 id: 'page-doc',195 text: 'page',196 url: 'docs/ui.page.html',197 target: 'mainFrame',198 supportUser: 'derrickliu'199 },200 {201 id: 'formtips-doc',202 text: 'formtips',203 url: 'docs/ui.formtips.html',204 target: 'mainFrame',205 supportUser: 'derrickliu'206 },207 {208 id: 'textui-doc',209 text: 'textui',210 url: 'docs/ui.textui.html',211 target: 'mainFrame',212 supportUser: 'derrickliu'213 },214 {215 id: 'dialog-doc',216 text: 'dialog',217 url: 'docs/dialog.html',218 target: 'mainFrame',219 supportUser: 'derrickliu'220 },221 {222 id: 'tabs-doc',223 text: 'tabs',224 url: 'docs/tabs.html',225 target: 'mainFrame',226 supportUser: 'derrickliu'227 },228 {229 id: 'datepicker-doc',230 text: 'datepicker',231 url: 'docs/datepicker.html',232 target: 'mainFrame',233 supportUser: 'derrickliu'234 },235 {236 id: 'tooltip-doc',237 text: 'tooltip',238 url: 'docs/tooltip.html',239 target: 'mainFrame',240 supportUser: 'derrickliu'241 },242 {243 id: 'accordion-doc',244 text: 'accordion',245 url: 'docs/accordion.html',246 target: 'mainFrame',247 supportUser: 'derrickliu'248 },249 {250 id: 'autocomplete-doc',251 text: 'autocomplete',252 url: 'docs/autocomplete.html',253 target: 'mainFrame',254 supportUser: 'derrickliu'255 },256 {257 id: 'button-doc',258 text: 'button',259 url: 'docs/button.html',260 target: 'mainFrame',261 supportUser: 'derrickliu'262 },263 {264 id: 'progressbar-doc',265 text: 'progressbar',266 url: 'docs/progressbar.html',267 target: 'mainFrame',268 supportUser: 'derrickliu'269 },270 {271 id: 'sortable-doc',272 text: 'sortable',273 url: 'docs/sortable.html',274 target: 'mainFrame',275 supportUser: 'derrickliu'276 },277 {278 id: 'combobox-doc',279 text: 'combobox',280 url: 'docs/ui.combobox.html',281 target: 'mainFrame',282 supportUser: 'derrickliu'283 }...

Full Screen

Full Screen

menuData.js

Source:menuData.js Github

copy

Full Screen

1var privilegeDate = [{2 mid: 'aa',3 pid: '0',4 isParent: true,5 icon:'../images/MenuIcon/jishusheshiweihuguanli.gif',6 //open:true,7 name: '技术设施维护管理',8 nodes:[9 {10 mid:'ab',11 pid:'aa',12 isParent:false,13 target:'mainFrame',14 url:'../equapment/equapmentIndex.jsp',15 icon:'../images/MenuIcon/yiqishebeiguanli.gif',16 name:'仪器设备管理'17 },{18 mid:'ac',19 pid:'aa',20 isParent:false,21 target:'mainFrame',22 url:'../equapment/adjustIndex.jsp',23 icon:'../images/MenuIcon/shebeijiaozhunjianxiu.gif',24 name:'设备校准检修'25 },{26 mid:'ad',27 pid:'aa',28 isParent:false,29 target:'mainFrame',30 url:'../equapment/planIndex.jsp',31 icon:'../images/MenuIcon/shebeigouzhijihua.gif',32 name:'设备购置计划'33 }34 ]35}, {36 mid: 'ae',37 pid: '0',38 name: '技术资料图纸管理',39 icon:'../images/MenuIcon/jishuziliaotuzhiguanli.gif',40 isParent: true,41 nodes:[42 {43 mid:'af',44 pid:'ae',45 isParent:false,46 icon:'../images/MenuIcon/ziliaotuzhiguanli.gif',47 target:'mainFrame',48 url:'../dataChart/dataChartIndex.jsp',49 name:'资料图纸管理'50 }51 ]52}, 53{54 mid: 'ag',55 pid: '0',56 name: '站点设备运行管理',57 icon:'../images/MenuIcon/zhuandianshebeiyunxingguanli.gif',58 isParent: true,59 nodes:[60 {61 mid:'ah',62 pid:'ag',63 isParent: false,64 icon:'../images/MenuIcon/zhandianjibenxinxi.gif',65 target:'mainFrame',66 url:'../siteEquapment/siteInfoIndex.jsp',67 name:'站点基本信息'68 },{69 mid:'ai',70 pid:'ag',71 isParent: false,72 icon:'../images/MenuIcon/yunxingqingkuang.gif',73 target:'mainFrame',74 url:'../siteEquapment/siteRunIndex.jsp',75 name:'运行情况'76 },{77 mid:'aj',78 pid:'ag',79 isParent: false,80 icon:'../images/MenuIcon/weihuqingkuang.gif',81 target:'mainFrame',82 url:'../siteEquapment/siteMaintainIndex.jsp',83 name:'维护情况'84 }85 ]86}, {87 mid: 'ak',88 pid: '0',89 name: '监测台建筑管理',90 icon:'../images/MenuIcon/jiancetaijianzhuguanli.gif',91 isParent: true,92 nodes:[93 {94 mid:'al',95 pid:'ak',96 isParent: false,97 icon:'../images/MenuIcon/jiancetaijianzhu.gif',98 target:'mainFrame',99 url:'../building/buildingIndex.jsp',100 name:'检测台建筑管理'101 }102 ]103},104 {105 mid: 'am',106 pid: '0',107 name: '系统管理',108 icon:'../images/MenuIcon/xitongguanli.gif',109 isParent: true,110 nodes:[111 {112 mid:'an',113 pid:'am',114 name:'用户管理',115 icon:'../images/MenuIcon/yonghuguanli.gif',116 target:'mainFrame',117 url:'../system/elecUserAction_home.do',118 isParent:false119 },{120 mid:'ao',121 pid:'am',122 name:'角色管理',123 icon:'../images/MenuIcon/jueseguanli.gif',124 target:'mainFrame',125 url:'../system/elecRoleAction_home.do',126 isParent:false127 },{128 mid:'ap',129 pid:'am',130 name:'运行监控',131 icon:'../images/MenuIcon/daibanshiyi.gif',132 target:'mainFrame',133 url:'../system/elecCommonMsgAction_home.do',134 isParent:false135 },{136 mid:'aq',137 pid:'am',138 name:'数据字典维护',139 icon:'../images/MenuIcon/shujuzidianguanli.gif',140 target:'mainFrame',141 url:'../system/elecSystemDDLAction_home.do',142 isParent:false143 }144 ]145}, {146 mid: 'ar',147 pid: '0',148 name: '审批流转',149 icon:'../images/MenuIcon/shenpiliuzhuanguanli.gif',150 isParent: true,151 nodes:[152 {153 mid:'as',154 pid:'ar',155 name:'审批流程管理',156 target:'mainFrame',157 icon:'../images/MenuIcon/shenpiliuchengguanli.gif',158 url:'../workflow/processDefinitionList.jsp',159 isParent:false160 },{161 mid:'at',162 pid:'ar',163 name:'申请模板管理',164 target:'mainFrame',165 url:'../workflow/applicationTemplateList.jsp',166 icon:'../images/MenuIcon/shenqingmobanguanli.gif',167 isParent:false168 },{169 mid:'au',170 pid:'ar',171 name:'起草申请',172 target:'mainFrame',173 url:'../workflow/flowTemplateList.jsp',174 icon:'../images/MenuIcon/qicaoshenqing.gif',175 isParent:false176 },{177 mid:'av',178 pid:'ar',179 name:'待我审批',180 target:'mainFrame',181 url:'../workflow/flowMyTaskList.jsp',182 icon:'../images/MenuIcon/daiwoshenpi.gif',183 isParent:false184 },{185 mid:'aw',186 pid:'ar',187 name:'我的申请查询',188 target:'mainFrame',189 url:'../workflow/flowMyApplicationList.jsp',190 icon:'../images/MenuIcon/wodeshenqingchaxun.gif',191 isParent:false192 }193 ]...

Full Screen

Full Screen

page_connect.src.js

Source:page_connect.src.js Github

copy

Full Screen

1/*2obj_page = {3 node: DOMElemnt,4 sidebar: DOMElemnt || string,5 }6e.hash7*/8/*9 подключение страницы. старая страница при этом отключается.10 param {object} page // обьект страницы11 param {htmlElement} page.node12 param {string|object} page.sidebar // какой сайтбар отображать для стрницы13 */14cram.get_mainframe = function() {15 if (!this.mainframe) {16 this.mainframe = masterElement('ui:mainframe', false);17 var pageName;18 this.addEvent('page_connectBefore', function(e) {19 var x = (e.page||false).NAME, menu = this.mainframe.nodes.topmenu;20 if (x !== pageName) {21 pageName = x;22 rr.css_set('b-topmenu-item--active', menu.item_contacts.node, x == 'contacts');23 rr.css_set('b-topmenu-item--active', menu.item_reader.node, x == 'reader');24 };25 });26 };27 return this.mainframe;28 };29new function() {30 var __page_connect_;31 cram.page_connect_ = function(e, page) {32 return cram.page_connect(page, e);33 };34 cram.page_connect = function(page, e) {35 if (!page) return;36 if (!rr.domReady.status) {37 var x = !!__page_connect_;38 __page_connect_ = {page: page, e: e};39 if (!x) {40 rr.domReady(function(x) {41 if (x = __page_connect_) {42 cram.page_connect(x.page, x.e)43 };44 });45 };46 return;47 };48 __page_connect_ = null;49 e = e||false;50 var d = document, mainframe = this.get_mainframe(), sbar, re, x;51 var connect_page = false, connect_sidebar = false;52 this.initEvent('page_connectBefore', {53 page: page,54 event: e55 });56 d.title = (page.title || e.title || "Почта") + " \u2014 "+(window._user||false).email; //—57 if (typeof page.on_connect_before == 'function') {58 page.on_connect_before();59 };60 /* подключение страничку */61 if (mainframe.page !== page) {62 if (x = mainframe.page) {63 rr.removeNode(x.node||x);64 x.is_connected = false;65 if (typeof x.on_connect == 'function') {66 x.on_connect(false);67 };68 };69 mainframe.page = this.activePage = page;70 if (page.node.parentNode != mainframe.box) {71 mainframe.box.appendChild(page.node);72 connect_page = true;73 };74 };75 /* подключение сайтбара */76 sbar = page.sidebar;77 if (!sbar || !(sbar.nodeType < 0)) {78 sbar = null;79 //sbar = this.sidebar_mailbox || (this.sidebar_mailbox = masterElement('ui:sidebar_mailbox', false)); // по умолчанию80 };81 if (mainframe.sidebar !== sbar) {82 if (x = mainframe.sidebar) { // удаляем старый83 rr.removeNode(x.node||x);84 x.is_connected = false;85 if (typeof x.on_connect == 'function') {86 x.on_connect();87 };88 };89 if (mainframe.sidebar = sbar || null) { // добавляем новый90 mainframe.sidebar_box.appendChild(sbar.node||sbar);91 connect_sidebar = true;92 };93 };94 if (!mainframe.is_connected && typeof mainframe.connected == 'function') {95 mainframe.connected();96 };97 if (connect_page) {98 //if (!mainframe.is_connected) mainframe.connect();99 page.is_connected = true;100 if (typeof page.on_connect == 'function') {101 page.on_connect(true);102 };103 };104 if (connect_sidebar) {105 //if (!mainframe.is_connected) mainframe.connect();106 sbar.is_connected = true;107 if (typeof sbar.on_connect == 'function') {108 sbar.on_connect(true)109 };110 };111 if (e.scroll !== false) { //&& !e.has_history112 cram.moveScroll(0);113 };114 if (e.autoSetHash && e.hash) {115 // добавляем историю116 if (cram.hash_current != e.hash) {117 cram.hash_current = e.hash;118 cram.history.set(e.hash);119 };120 };121 this.initEvent('page_connect', {122 page: page,123 event: e124 });125 };126 };127/*128cram.addEvent('page_connect', function(e) {129 var nx, ev = e.event||false;130 if (nx = this.sidebar_mailbox) {131 if (ev.handler == 'open_mailbox' || ev.handler == 'open_message') {132 if (typeof nx.set_activeFolder === 'function') {133 nx.set_activeFolder(e.mbox)134 };135 return false;136 };137 if (ev.handler == 'open_contacts' || ev.handler == 'open_compose') {138 nx.set_activeFolder(false)139 };140 };141 });...

Full Screen

Full Screen

menu.js

Source:menu.js Github

copy

Full Screen

1/**2 * Created by cshlovjah on 28.07.16.3 */4var mainFrame = new mainFrame();5//Администрирование6//Пользователи7$('.user-control').on('click', function () {8 mainFrame.clearFrame('mainframe');9 mainFrame.clearFrameClass('button-panel');10 // mainFrame.addFrame('mainframe','user-table');11 $('#mainframe').append("<div id='user-table'></div>");12 var user = new User();13 user.pageableTable('user-table');14});15$('.boxes-control').on('click', function () {16 console.log("boxes control");17 mainFrame.clearFrame('mainframe');18 mainFrame.clearFrameClass('button-panel');...

Full Screen

Full Screen

Using AI Code Generation

copy

Full Screen

1const puppeteer = require('puppeteer');2(async () => {3 const browser = await puppeteer.launch({headless: false});4 const page = await browser.newPage();5 const client = await page.target().createCDPSession();6 await client.send('Emulation.clearDeviceMetricsOverride');7 await page.setViewport({width: 1920, height: 1080});8 await page.screenshot({path: 'full.png', fullPage: true});9 await browser.close();10})();11const puppeteer = require('puppeteer');12(async () => {13 const browser = await puppeteer.launch({headless: false});14 const page = await browser.newPage();15 const client = await page.target().createCDPSession();16 await client.send('Emulation.clearDeviceMetricsOverride');17 await page.setViewport({width: 1920, height: 1080});18 await page.screenshot({path: 'full.png', fullPage: true});19 await browser.close();20})();21const puppeteer = require('puppeteer');22(async () => {23 const browser = await puppeteer.launch({headless: false});24 const page = await browser.newPage();25 const client = await page.target().createCDPSession();26 await client.send('Emulation.clearDeviceMetricsOverride');27 await page.setViewport({width: 1920, height: 1080});28 await page.screenshot({path: 'full.png', fullPage: true});29 await browser.close();30})();31const puppeteer = require('puppeteer');32(async () => {33 const browser = await puppeteer.launch({headless: false});34 const page = await browser.newPage();35 const client = await page.target().createCDPSession();36 await client.send('Emulation.clearDeviceMetricsOverride');37 await page.setViewport({width: 1920, height: 1080});38 await page.screenshot({path: 'full.png', fullPage: true});39 await browser.close();40})();

Full Screen

Using AI Code Generation

copy

Full Screen

1const puppeteer = require('puppeteer');2const devices = require('puppeteer/DeviceDescriptors');3(async () => {4 const browser = await puppeteer.launch({5 });6 const page = await browser.newPage();7 await page.emulate(devices['iPhone 6']);8 });9 await page.screenshot({10 });11 await browser.close();12})();13#### 2.1.1. puppeteer.launch([options])

Full Screen

Using AI Code Generation

copy

Full Screen

1const puppeteer = require('puppeteer');2(async () => {3 const browser = await puppeteer.launch();4 const page = await browser.newPage();5 await page.screenshot({path: 'google.png'});6 await browser.close();7})();

Full Screen

Using AI Code Generation

copy

Full Screen

1const puppeteer = require('puppeteer');2(async () => {3 const browser = await puppeteer.launch({4 });5 const page = await browser.newPage();6 await page.waitForSelector('input[name="q"]');7 await page.type('input[name="q"]', 'puppeteer');8 await page.keyboard.press('Enter');9 await page.waitForSelector('a[href="

Full Screen

Using AI Code Generation

copy

Full Screen

1const puppeteer = require('puppeteer');2const fs = require('fs');3const path = require('path');4(async () => {5 try {6 const browser = await puppeteer.launch({headless: false});7 const page = await browser.newPage();8 await page.screenshot({path: 'google.png'});9 await browser.close();10 } catch (e) {11 console.log(e)12 }13})();

Full Screen

Using AI Code Generation

copy

Full Screen

1const puppeteer = require('puppeteer');2const fs = require('fs');3const path = require('path');4async function mainFrame() {5 const browser = await puppeteer.launch({6 });7 let pages = await browser.pages();8 let tab = pages[0];9 await tab.waitForSelector('input[title="Search"]');10 await tab.type('input[title="Search"]', 'pepcoding');11 await tab.click('input[value="Google Search"]');12 await tab.waitForSelector('div[class="yuRUbf"] a');13 let links = await tab.$$('div[class="yuRUbf"] a');14 let link = await tab.evaluate(function (el) {15 return el.getAttribute("href");16 }, links[0]);17 let newTab = await browser.newPage();18 await newTab.goto(link);19 await newTab.waitForSelector('a[data-analytics="NavBarProfileDropDown"]');20 await newTab.click('a[data-analytics="NavBarProfileDropDown"]');21 await newTab.waitForSelector('a[data-analytics="NavBarProfileDropDownAdministration"]');22 await newTab.click('a[data-analytics="NavBarProfileDropDownAdministration"]');23 let adminLinks = await newTab.$$('ul li a');24 let adminLink = await newTab.evaluate(function (el) {25 return el.getAttribute("href");26 }, adminLinks[1]);27 let manageChallengePage = await browser.newPage();28 await manageChallengePage.goto(adminLink);29 await manageChallengePage.waitForSelector('a[data-analytics="ManageChallenges"]');30 await manageChallengePage.click('a[data-analytics="ManageChallenges"]');31 await manageChallengePage.waitForSelector('a[href="/administration/challenges"]');32 await manageChallengePage.click('a[href="/administration/challenges"]');33 await manageChallengePage.waitForSelector('.backbone.block-center');34 let manageChallengeLinks = await manageChallengePage.$$('.backbone.block-center');35 let manageChallengeLink = await manageChallengePage.evaluate(function (el) {36 return el.getAttribute("href");37 }, manageChallengeLinks[0]);38 let manageChallengePage2 = await browser.newPage();39 await manageChallengePage2.waitForSelector('li[data-tab="moderators"]');

Full Screen

Using AI Code Generation

copy

Full Screen

1const puppeteer = require('puppeteer');2const assert = require('assert');3const { expect } = require('chai');4describe('Test', function () {5 let browser;6 let page;7 before(async function () {8 browser = await puppeteer.launch({9 });10 page = await browser.newPage();11 });12 after(async function () {13 await browser.close();14 });15 it('should open the page', async function () {16 await page.setViewport({ width: 1920, height: 1080 });17 await page.waitForSelector('input[name="q"]');18 await page.type('input[name="q"]', 'puppeteer');19 await page.waitForSelector('input[value="Google Search"]');20 await page.click('input[value="Google Search"]');21 await page.waitForSelector('h3');

Full Screen

Using AI Code Generation

copy

Full Screen

1const puppeteer = require('puppeteer');2const { expect } = require('chai');3describe('Puppeteer', function () {4 let browser;5 let page;6 before(async function () {7 browser = await puppeteer.launch({8 });9 page = await browser.newPage();10 await page.setDefaultTimeout(10000);11 await page.setDefaultNavigationTimeout(20000);12 });13 after(async function () {14 await browser.close();15 });16 it('Launch browser', async function () {17 await page.waitForTimeout(2000);18 await page.waitForTimeout(2000);19 });20 it('should have the right title', async function () {21 const title = await page.title();22 expect(title).to.be.a('string', 'Example Domain');23 });24});

Full Screen

Automation Testing Tutorials

Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.

LambdaTest Learning Hubs:

YouTube

You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.

Run Puppeteer automation tests on LambdaTest cloud grid

Perform automation testing on 3000+ real desktop and mobile devices online.

Try LambdaTest Now !!

Get 100 minutes of automation test minutes FREE!!

Next-Gen App & Browser Testing Cloud

Was this article helpful?

Helpful

NotHelpful