Best JavaScript code snippet using protractor
ucMessageTypeTpl.js
Source:ucMessageTypeTpl.js
1/*2 å为7ç§æ¶æ¯ç±»åï¼ææ¬ãè¯é³ãå¾çãåçãææ¡£ãæ°é»ãå
³èææ¡£3 æ¥æ¶çdataåæ°éé¢æ5个对象ï¼åå«ä¸ºï¼4 memberId: å½åç¨æ·çidï¼ç¨å½åç¨æ·idåæ¥æ¶æ°æ®dataéé¢çæ¶æ¯from(å为sendidåreceiveid)å¤æï¼5 ç¸åçè¯å³èªå·±åéæ¶æ¯ï¼ä¸åæ¯å
¶ä»äººåéæ¶æ¯ã6 chatType: æå人è天è¿æ¯ç¾¤ç»è天7 msgType: ææ¶æ¯ç±»åï¼ä¾å¦ææ¬æ¶æ¯ãè¯é³æ¶æ¯ãå¾çæ¶æ¯ç8 from: æå½æ¶åéæ¶æ¯ç人åid9 body: æ¥æ¶æ¶æ¯å
容10 chatId: ææ¬æ¡æ¶æ¯çid11 name:å½åæ¶æ¯ç人åå称12 var data = {13 memberId:chat.userId,14 from:chat.userId,15 chatType:"chat",16 msgType:"text"17 body:val,18 chatId:chatid,19 time:"20:03",20 name:"å¼ ä¸"21 }22*/ 23function msgType (data) {24 var li = "";25 if(data.memberId == data.from){26 li = "<li class=\"cmp-table-view-cell\" id=\"" + data.chatId + "\" timestamp='" + data.timestamp + "' isown=\"true\">";27 }28 else{29 li = "<li class=\"cmp-table-view-cell\" id=\"" + data.chatId + "\" timestamp='" + data.timestamp + "' isown=\"false\">";30 }31 // æ¶é´æ³32 if(data.msgType == "time"){33 li += "<div class=\"uc-chat-date\">" + data.body + "</div></li>";34 return li;35 }36 //ç³»ç»æ¶æ¯37 if(data.msgType == "system"){38 li += "<div class=\"uc-chat-system\">" + data.body + "</div></li>";39 return li;40 }41 // ææ¬42 else if(data.msgType == "text") {43 if(data.memberId == data.from){44 li += "<div class=\"uc-me-text\"><div class=\"uc-chat-base\">";45 if(data.chatType == "groupchat"){46 li += "<div class=\"uc-me-username\">" + data.name + "</div>";47 }48 li += "<div class=\"position_relative\">"49 +"<i class=\"uc-bubble-arrow uc-arrow1\"></i>"50 +"<div class=\"uc-me-chat-base\" data-type=\"" + data.msgType + "\" data-from=\"" + data.from + "\">"51 +"<span class=\"uc-chat-text\">" + data.body + "</span>";52 if(data.chatType == "chat"){53 li += "<span class=\"uc-chat-read-state " + data.readStateClass + "\">" + data.readState + "</span>"54 }55 li += "<textarea class=\"uc-copy-text\" id=\"text_" + data.chatId + "\">" + data.body + "</textarea>"56 +"</div></div></div>"57 +"<div class=\"uc-m-h\"><img src=\"" + cmp.member.iconUrl + "\" class=\"uc-me-chat-head\" /></div>"58 +"</div>";59 }else{60 li += "<div class=\"uc-other-text\"><div class=\"uc-o-h\"><img src=\"" + data.headSrc + "\" class=\"uc-other-chat-head\" id=\"h_" + data.toId + "\" /></div><div class=\"uc-chat-base\">";61 if(data.chatType == "groupchat"){62 li += "<div class=\"uc-o-username\">" + data.name + "</div>";63 }64 li += "<div class=\"position_relative\">"65 +"<i class=\"uc-bubble-arrow uc-arrow2\"></i>"66 +"<div class=\"uc-other-chat-base\" data-type=\"" + data.msgType + "\" data-from=\"" + data.from + "\">"67 +"<span class=\"uc-chat-text\">" + data.body + "</span>"68 +"<textarea class=\"uc-copy-text\" id=\"text_" + data.chatId + "\">" + data.body + "</textarea>"69 +"</div>"70 +"<div>"71 +"</div>"72 +"</div>";73 }74 li += "</li>";75 return li;76 }77 // è¯é³78 else if(data.msgType == "voice"){79 if(data.memberId === data.from){80 li += "<div class=\"uc-me-voice\"><div class=\"uc-chat-base\" style=\"display:none;\">";81 if(data.chatType == "groupchat"){82 li += "<div class=\"uc-me-username\">" + data.name + "</div>";83 }84 li += "<div class=\"position_relative\">"85 +"<i class=\"uc-bubble-arrow uc-arrow1\"></i>"86 +"<div data-tmp=\"" + data.isNative + "\" class=\"voice uc-me-chat-base\" id=\"" + data.body.id + "\" src=\"" + data.body.src + "\" data-type=\"" + data.msgType + "\" data-from=\"" + data.from + "\" data-to=\"" + data.toJid + "\">"87 + "<span class=\"vtime\">" + data.body.times + "</span>''<img class=\"uc-record\" src=\"../img/voice/me-voice3@2x.png\" alt=\"\" />";88 if(data.chatType == "chat"){89 li += "<span class=\"uc-chat-read-state " + data.readStateClass + "\">" + data.readState + "</span>"90 }91 li += "</div></div></div>"92 +"<div class=\"uc-m-h\"><img src=\"" + cmp.member.iconUrl + "\" class=\"uc-me-chat-head\" /></div>"93 +"</div>";94 }else{95 li += "<div class=\"uc-other-voice\"><div class=\"uc-o-h\"><img src=\"" + data.headSrc + "\" class=\"uc-other-chat-head\" id=\"h_" + data.toId + "\" /></div><div class=\"uc-chat-base\" style=\"display:none;\">";96 if(data.chatType == "groupchat"){97 li += "<div class=\"uc-o-username\">" + data.name + "</div>";98 }99 li += "<div class=\"position_relative\">"100 +"<i class=\"uc-bubble-arrow uc-arrow2\"></i>"101 +"<div data-tmp=\"" + data.isNative + "\" class=\"voice uc-other-chat-base\" id=\"" + data.body.id + "\" src=\"" + data.body.src + "\" data-type=\"" + data.msgType + "\" data-from=\"" + data.from + "\" data-to=\"" + data.toJid + "\">"102 +"<img class=\"uc-record\" src=\"../img/voice/o-voice3@2x.png\" alt=\"\" /><span class=\"vtime\">" + data.body.times + "</span>''"103 +"<span class=\"" + (data.isRead == 'read' ? 'uc-chat-unread-dot-over' : 'uc-chat-unread-dot' ) + "\"></span>"104 +"</div>"105 +"</div>"106 +"</div>"107 +"</div>";108 }109 li += "</li>";110 return li;111 }112 // å¾ç113 else if(data.msgType == "image"){114 if(data.memberId === data.from){115 li += "<div class=\"uc-me-picture\"><div class=\"uc-chat-base\">";116 if(data.chatType == "groupchat"){117 li += "<div class=\"uc-me-username\">" + data.name + "</div>";118 }119 li += "<div class=\"position_relative\">"120 +"<i class=\"uc-bubble-arrow uc-arrow1\"></i>"121 +"<div class=\"uc-me-chat-base\" data-type=\"" + data.msgType + "\" data-from=\"" + data.from + "\">"122 +"<div class=\"uc-me-p-overflow\">"123 +"<img src='" + data.imgUrl + "' imgId = '" + data.mId + "' imgTitle = '" + data.mTitle + "' imgLoad=\"true\" class=\"uc-chat-img\" />"124 +"<div class=\"imgMask\"></div>"125 +"</div>";126 if(data.chatType == "chat"){127 li += "<span class=\"uc-chat-read-state " + data.readStateClass + "\">" + data.readState + "</span>"128 }129 li += "</div></div></div>"130 +"<div class=\"uc-m-h\"><img src=\""+ cmp.member.iconUrl +"\" class=\"uc-me-chat-head\" /></div>"131 +"</div>";132 }else{133 li += "<div class=\"uc-other-picture\"><div class=\"uc-o-h\"><img src=\"" + data.headSrc + "\" class=\"uc-other-chat-head\" id=\"h_" + data.toId + "\" /></div><div class=\"uc-chat-base\">";134 if(data.chatType == "groupchat"){135 li += "<div class=\"uc-o-username\">" + data.name + "</div>";136 }137 li += "<div class=\"position_relative\">"138 +"<i class=\"uc-bubble-arrow uc-arrow2\"></i>"139 +"<div class=\"uc-other-chat-base\" data-type=\"" + data.msgType + "\" data-from=\"" + data.from + "\">"140 +"<img src='" + data.imgUrl + "' imgId = '" + data.mId + "' imgTitle = '" + data.mTitle + "' imgLoad=\"true\" class=\"uc-chat-img\" />"141 +"<div class=\"imgMask\"></div>"142 +"</div>"143 +"</div>"144 +"</div>"145 +"</div>";146 }147 li += "</li>";148 return li;149 }150 // åç151 else if(data.msgType === "card"){152 if(data.memberId === data.from){153 li += "<div class=\"uc-me-card\" data-type=\"card\"><div class=\"uc-chat-base\">";154 if(data.chatType == "groupchat"){155 li += "<div class=\"uc-me-username\">" + data.name + "</div>";156 }157 li += "<div class=\"position_relative\">"158 +"<i class=\"uc-bubble-arrow uc-arrow1\"></i>"159 +"<div class=\"uc-me-chat-base uc-card\" data-type=\"" + data.msgType + "\" data-from=\"" + data.from + "\">"160 +"<div class=\"uc-info\">"161 +"<img src=\"../img/head.png\" class=\"uc-card-head cmp-pull-left\" />"162 +"<div class=\"cmp-pull-left uc-card-width\">"163 +"<h3 class=\"uc-card-name\">çæ·
çæ·
çæ·
çæ·
çæ·
</h3>"164 +"<span class=\"uc-card-phone\">13123948931312394893</span>"165 +"</div>"166 +"</div>"167 +"<p class=\"uc-card-b\">æ¬å°åç</p>";168 if(data.chatType == "chat"){169 li += "<span class=\"uc-chat-read-state " + data.readStateClass + "\">" + data.readState + "</span>"170 }171 li += "</div></div></div>"172 +"<div class=\"uc-m-h\"><img src=\"" + cmp.member.iconUrl + "\" class=\"uc-me-chat-head\" /></div>"173 +"</div>";174 }else{175 li += "<div class=\"uc-other-card\" data-type=\"card\"><div class=\"uc-o-h\"><img src=\"" + data.headSrc + "\" class=\"uc-other-chat-head\" id=\"h_" + data.toId + "\" /></div><div class=\"uc-chat-base\">";176 if(data.chatType == "groupchat"){177 li += "<div class=\"uc-o-username\">" + data.name + "</div>";178 }179 li += "<div class=\"position_relative\">"180 +"<i class=\"uc-bubble-arrow uc-arrow3\"></i>"181 +"<div class=\"uc-other-chat-base\" data-type=\"" + data.msgType + "\" data-from=\"" + data.from + "\">"182 +"<div class=\"uc-info\">"183 +"<img src=\"\" class=\"uc-card-head\" />"184 +"<div class=\"uc-card-width\">"185 +"<h3 class=\"uc-card-name\">çæ·
çæ·
çæ·
çæ·
çæ·
</h3>"186 +"<span class=\"uc-card-phone\">13123948931312394893</span>"187 +"</div>"188 +"</div>"189 +"<p class=\"uc-card-b\">æ¬å°åç</p>"190 +"</div>"191 +"</div>"192 +"</div>"193 +"</div>";194 }195 li += "</li>";196 return li;197 }198 // 离线ææ¡£199 else if(data.msgType === "filetrans"){200 if(data.memberId === data.from){201 li += "<div class=\"uc-me-doc\"><div class=\"uc-chat-base\">";202 if(data.chatType == "groupchat"){203 li += "<div class=\"uc-me-username\">" + data.name + "</div>";204 }205 li += "<div class=\"position_relative\">"206 +"<i class=\"uc-bubble-arrow uc-arrow1\"></i>"207 +"<div class=\"uc-me-chat-base uc-doc\" data-type=\"" + data.msgType + "\" data-fid=\"" + data.fid + "\" data-path=\"" + data.path + "\" data-from=\"" + data.from + "\" data-size=\"" + data.fileSize + "\">"208 +"<div class=\"cmp-icon-document " + data.icon + "\"></div>"209 +"<div class=\"uc-doc-info\">"210 +"<h3 class=\"uc-doc-name\">"+ data.fname +"</h3>"211 +"<div class=\"uc-doc-state\">"212 +"<div class=\"uc-doc-size cmp-pull-left\">"+ data.size +"</div>"213 +"<div class=\"uc-doc-s cmp-pull-right\"></div>"214 +"</div>"215 +"</div>";216 if(data.chatType == "chat"){217 li += "<span class=\"uc-chat-read-state " + data.readStateClass + "\">" + data.readState + "</span>"218 }219 li += "</div></div></div>"220 +"<div class=\"uc-m-h\"><img src=\"" + cmp.member.iconUrl + "\" class=\"uc-me-chat-head\" /></div>"221 +"</div>";222 }else{223 li += "<div class=\"uc-other-doc\"><div class=\"uc-o-h\"><img src=\"" + data.headSrc + "\" class=\"uc-other-chat-head\" id=\"h_" + data.toId + "\" /></div><div class=\"uc-chat-base\">";224 if(data.chatType == "groupchat"){225 li += "<div class=\"uc-o-username\">" + data.name + "</div>";226 }227 li += "<div class=\"position_relative\">"228 +"<i class=\"uc-bubble-arrow uc-arrow3\"></i>"229 +"<div class=\"uc-other-chat-base uc-doc\" data-type=\"" + data.msgType + "\" data-fid=\"" + data.fid + "\" data-path=\"" + data.path + "\" data-from=\"" + data.from + "\" data-size=\"" + data.fileSize + "\">"230 +"<div class=\"cmp-icon-document " + data.icon + "\"></div>"231 +"<div class=\"uc-doc-info\">"232 +"<h3 class=\"uc-doc-name\">"+ data.fname +"</h3>"233 +"<div class=\"uc-doc-state\">"234 +"<div class=\"uc-doc-size cmp-pull-left\">"+ data.size +"</div>"235 +"<div class=\"uc-doc-s cmp-pull-right\"></div>"236 +"</div>"237 +"</div>"238 +"</div>"239 +"</div>"240 +"</div>"241 +"</div>";242 }243 li += "</li>";244 return li;245 }246 // æ°é»247 else if(data.msgType === "new"){248 if(data.memberId === data.from){249 li += "<div class=\"uc-me-new\" data-type=\"new\"><div class=\"uc-chat-base\">";250 if(data.chatType == "groupchat"){251 li += "<div class=\"uc-me-username\">" + data.name + "</div>";252 }253 li += "<div class=\"position_relative\">"254 +"<i class=\"uc-bubble-arrow uc-arrow1\"></i>"255 +"<div class=\"uc-me-chat-base uc-new\" data-type=\"" + data.msgType + "\" data-from=\"" + data.from + "\">"256 +"<h3 class=\"uc-new-name\">ççµè§å°±ä»æ¬¾è§åº¦çé件ç空é´æ³ç空é´</h3>"257 +"<div class=\"uc-new-info\">"258 +"<div class=\"cmp-pull-left\">ä¸æµ·åºå¸åºé¨</div>"259 +"<div class=\"cmp-pull-right\" style=\"margin-top:5px\">"260 +"<img class=\"uc-new-img\" src=\"../img/img4.jpg\" />"261 +"</div>"262 +"</div>";263 if(data.chatType == "chat"){264 li += "<span class=\"uc-chat-read-state " + data.readStateClass + "\">" + data.readState + "</span>"265 }266 li += "</div></div></div>"267 +"<div class=\"uc-m-h\"><img src=\"" + cmp.member.iconUrl + "\" class=\"uc-me-chat-head\" /></div>"268 +"</div>";269 }else{270 li += "<div class=\"uc-other-new\" data-type=\"new\"><div class=\"uc-o-h\"><img src=\"" + data.headSrc + "\" class=\"uc-other-chat-head\" id=\"h_" + data.toId + "\" /></div><div class=\"uc-chat-base\">";271 if(data.chatType == "groupchat"){272 li += "<div class=\"uc-o-username\">" + data.name + "</div>";273 }274 li += "<div class=\"position_relative\">"275 +"<i class=\"uc-bubble-arrow uc-arrow3\"></i>"276 +"<div class=\"uc-other-chat-base uc-new\" data-type=\"" + data.msgType + "\" data-from=\"" + data.from + "\">"277 +"<h3 class=\"uc-new-name\">ççµè§å°±ä»æ¬¾è§åº¦çé件ç空é´æ³ç空é´æ³è¯å®ç§¯åçè§åº¦çé件çè§</h3>"278 +"<div class=\"uc-new-info\">"279 +"<div class=\"cmp-pull-left\">ä¸æµ·åºå¸åºé¨</div>"280 +"<div class=\"cmp-pull-right\" style=\"margin-top:5px\">"281 +"<img class=\"uc-new-img\" src=\"../img/img4.jpg\" />"282 +"</div>"283 +"</div>"284 +"</div>"285 +"</div>"286 +"</div>"287 +"</div>";288 }289 li += "</li>";290 return li;291 }292 // å
³èææ¡£293 else if(data.msgType === "a8"){294 if(data.memberId === data.from){295 li += "<div class=\"uc-me-a8\" data-type=\"a8\"><div class=\"uc-chat-base\">";296 if(data.chatType == "groupchat"){297 li += "<div class=\"uc-me-username\">" + data.name + "</div>";298 }299 li += "<div class=\"position_relative\">"300 +"<i class=\"uc-bubble-arrow uc-arrow1\"></i>"301 +"<div class=\"uc-me-chat-base uc-a8\" data-type=\"" + data.msgType + "\" data-from=\"" + data.from + "\">"302 +"<div class=\"uc-a8-info\">"303 +"<div class=\"uc-doc-icon iconfont icon-PC-teamwork cmp-pull-left\"></div>"304 +"<h3 class=\"cmp-pull-left uc-a8-name\">ççµè§å°±ä»æ¬¾è§åº¦çé件ç空é´æ³ç空é´</h3>"305 +"</div>"306 +"<div class=\"uc-a8-n\">[åå]ä¸æµ·åºå¸åºé¨</div>";307 if(data.chatType == "chat"){308 li += "<span class=\"uc-chat-read-state " + data.readStateClass + "\">" + data.readState + "</span>"309 }310 li += "</div></div></div>"311 +"<div class=\"uc-m-h\"><img src=\"" + cmp.member.iconUrl + "\" class=\"uc-me-chat-head\" /></div>"312 +"</div>";313 }else{314 li += "<div class=\"uc-other-a8\" data-type=\"a8\"><div class=\"uc-o-h\"><img src=\"" + data.headSrc + "\" class=\"uc-other-chat-head\" id=\"h_" + data.toId + "\" /></div><div class=\"uc-chat-base\">";315 if(data.chatType == "groupchat"){316 li += "<div class=\"uc-o-username\">" + data.name + "</div>";317 }318 li += "<div class=\"position_relative\">"319 +"<i class=\"uc-bubble-arrow uc-arrow3\"></i>"320 +"<div class=\"uc-other-chat-base uc-a8\" data-type=\"" + data.msgType + "\" data-from=\"" + data.from + "\">"321 +"<div class=\"uc-a8-info\">"322 +"<div class=\"uc-doc-icon iconfont icon-PC-teamwork cmp-pull-left\"></div>"323 +"<h3 class=\"uc-a8-name\">ççµè§å°±ä»æ¬¾è§åº¦çé件ç空é´æ³ç空é´</h3>"324 +"</div>"325 +"<div class=\"uc-a8-n\">[åå]ä¸æµ·åºå¸åºé¨</div>"326 +"</div>"327 +"</div>"328 +"</div>"329 +"</div>";330 }331 li += "</li>";332 return li;333 }
...
PhotoData.js
Source:PhotoData.js
1const photos = [2 {3 order: 2,4 title: "Alex1",5 url: "https://drive.google.com/uc?id=1TVDQNaqaYOxRZ8TJwTBauax44kFgalJJ",6 description: "Catching football",7 },8 {9 order: 27,10 title: "Alex2",11 url: "https://drive.google.com/uc?id=122LM_3v8bfMTWkzGu3N3SeLBq-vBKhjI",12 description: "Man looking into sky",13 },14 {15 order: 41,16 title: "Alex3",17 url: "https://drive.google.com/uc?id=1_zjlv1AtefKrDHDX4jK5pOkaeqPqI75l",18 description: "Man touching chin",19 },20 {21 order: 28,22 title: "Bane1",23 url: "https://drive.google.com/uc?id=1km9nA7fkmT6PnZavA6hG0BmaNEMM2Uw6",24 description: "Man in football gear",25 },26 {27 order: 26,28 title: "Bane2",29 url: "https://drive.google.com/uc?id=1m07TcvpMvM2Wia7Qs38zMm2RYIzHlviN",30 description: "Football players in position",31 },32 {33 order: 42,34 title: "Benny1",35 url: "https://drive.google.com/uc?id=1Uq5smgdcrgG50vW6_NvfvE1ykD_vLI2h",36 description: "Man lifting weight",37 },38 {39 order: 43,40 title: "Benny2",41 url: "https://drive.google.com/uc?id=1MMdp6Hd05t4DuCCx2j3WYR9ytn7DnhdD",42 description: "Man lifting weight",43 },44 {45 order: 44,46 title: "Body Building1",47 url: "https://drive.google.com/uc?id=1PieBB9ZBgVZwmpq-3V-eHuE1Kgl77hrC",48 description: "Man posing",49 },50 {51 order: 45,52 title: "Brian",53 url: "https://drive.google.com/uc?id=1ge99eE6OixTWl1DQVcHcUCeQ_u7liPI3",54 description: "Man sweating",55 },56 {57 order: 46,58 title: "Bronny1",59 url: "https://drive.google.com/uc?id=1TPNlHzIyrIaTc1LXJwU4cks7HsT_ojC2",60 description: "Man with headphones on",61 },62 {63 order: 47,64 title: "Canal1",65 url: "https://drive.google.com/uc?id=1apmqtMBZVy_4aiL5DWDD55apiPsDx-YY",66 description: "Football team",67 },68 {69 order: 29,70 title: "Canal2",71 url: "https://drive.google.com/uc?id=1NDsl76XzWlopcFC5OCLOyEBs93TgWZmy",72 description: "Football team",73 },74 {75 order: 48,76 title: "Canal3",77 url: "https://drive.google.com/uc?id=1kQd9AjzF48Tueb8DSmWChYedZzpeifl_",78 description: "Football team",79 },80 {81 order: 49,82 title: "Canal4",83 url: "https://drive.google.com/uc?id=1VLzam6EK9D5PPRrkGxy5SZ1j7FVrWnBz",84 description: "Football team",85 },86 {87 order: 50,88 title: "Canal5",89 url: "https://drive.google.com/uc?id=1-bK4dVQ8T5KuM9bYH1Hb_iLfhPV9be4I",90 description: "Football team",91 },92 {93 order: 32,94 title: "Cardale1",95 url: "https://drive.google.com/uc?id=1ccrPuFKa-RPE1w8JoYP_X5FGCRFa1666",96 description: "Man pointing",97 },98 {99 order: 51,100 title: "Cardale2",101 url: "https://drive.google.com/uc?id=1C8gVSlhf_D_R8a2ei7eTzOdxvU86WGCE",102 description: "Man preparing to throw football",103 },104 {105 order: 52,106 title: "Cardale3",107 url: "https://drive.google.com/uc?id=1Ej2tU6xtnrM76fhNpc2-qS5qvsgqYTC_",108 description: "Man just threw football",109 },110 {111 order: 53,112 title: "Cassi1",113 url: "https://drive.google.com/uc?id=1WfxOZfiyZAEKmhS7_yAuDGO3PnzugvuZ",114 description: "Couple kissing",115 },116 {117 order: 54,118 title: "Cassi2",119 url: "https://drive.google.com/uc?id=1_aKLR0AoAuTp1EHUdddYbGnqGtPC19YT",120 description: "Couple putting ring on",121 },122 {123 order: 30,124 title: "Dentist1",125 url: "https://drive.google.com/uc?id=18oUP4fFZVFh-oFwOmTDmyKh2UUBY3rdw",126 description: "Dentist working on patient",127 },128 {129 order: 31,130 title: "Dentist2",131 url: "https://drive.google.com/uc?id=1PE_nmBUfBipzq60kgfxIkCMBv0STkzGH",132 description: "Dentist working on patient",133 },134 {135 order: 55,136 title: "Dentist3",137 url: "https://drive.google.com/uc?id=1GBYQwOQCPVhZ4BQUhUIHWGFPLhPJmpE1",138 description: "Dentist working on patient",139 },140 {141 order: 25,142 title: "Dentist4",143 url: "https://drive.google.com/uc?id=18r3Q6-ZjJqlYoLQHQY45hFUkhSCNRTfN",144 description: "Dentist working on patient",145 },146 {147 order: 40,148 title: "Dentist5",149 url: "https://drive.google.com/uc?id=1UrKcsIfgVwr8I9h-ZYH7ZHclThWbKFnE",150 description: "Dentist smiling",151 },152 {153 order: 56,154 title: "Don1",155 url: "https://drive.google.com/uc?id=1xAsknGAroL3IRfiC7wTpq1dn5ClvdKbn",156 description: "Shirtless man",157 },158 {159 order: 39,160 title: "Elvin1",161 url: "https://drive.google.com/uc?id=1IXfMw-lIkBSrRrSur3BcNQ46OxDSUpqJ",162 description: "Man with medals on track",163 },164 {165 order: 57,166 title: "Elvin2",167 url: "https://drive.google.com/uc?id=10-qKvvRcSH8YhFcgWjs9k4icosViW2Ur",168 description: "Man on track",169 },170 {171 order: 33,172 title: "Fighters1",173 url: "https://drive.google.com/uc?id=1SozsuOl_2LfFyhCGKGZ4kv_JKKoZoqZw",174 description: "Football player",175 },176 {177 order: 58,178 title: "Golf1",179 url: "https://drive.google.com/uc?id=1r1JFXX3Nwk5ac6zdBVSjizvk_ciPPy0u",180 description: "golf player",181 },182 {183 order: 59,184 title: "Golf2",185 url: "https://drive.google.com/uc?id=1PCPQLuFfXBHTws3Cy3EPiSHnMf4kFjhG",186 description: "golf player",187 },188 {189 order: 35,190 title: "Golf3",191 url: "https://drive.google.com/uc?id=1erydGTfn9LXVCV4jJjrkU9qLo9ZTYB0m",192 description: "golf players",193 },194 {195 order: 5,196 title: "Golf4",197 url: "https://drive.google.com/uc?id=1VF4EmKxxnViIiZuIgF48YhZAGZd0K7D3",198 description: "swinging golf club",199 },200 {201 order: 34,202 title: "Golf5",203 url: "https://drive.google.com/uc?id=14jhGOA-vUSB8e3ii5MuLmiO8kxEsjvCT",204 description: "standing by golf cart",205 },206 {207 order: 60,208 title: "Golf6",209 url: "https://drive.google.com/uc?id=1cJJr6FdpX3v_njDPntYw3tOMYhqNIsGz",210 description: "golfers standing on putting green",211 },212 {213 order: 9,214 title: "Golf7",215 url: "https://drive.google.com/uc?id=1MJaym1pI3zxPAcIeYCQ83ni1j6pzV064",216 description: "golfers",217 },218 {219 order: 11,220 title: "Golf8",221 url: "https://drive.google.com/uc?id=1m6LSMj9C_cln0bSfkoW5G5_TZ25WH24h",222 description: "Man swinging golf club",223 },224 {225 order: 15,226 title: "Hannah1",227 url: "https://drive.google.com/uc?id=1pSZf5fI7X-QJAwWeSneW0-Gl4tZ8ZTSt",228 description: "Woman standing next to body of water",229 },230 {231 order: 1,232 title: "Hannah2",233 url: "https://drive.google.com/uc?id=1F0v6UEWhiftRbwKWaOO4Zp5ZDvRxSD0Z",234 description: "Woman dancing next to body of water",235 },236 {237 order: 23,238 title: "Hannah3",239 url: "https://drive.google.com/uc?id=1TqRryo59ZMRJJg12C6hW7oHsEa64Dh5G",240 description: "Woman with a pleasant smile",241 },242 {243 order: 13,244 title: "Hannah4",245 url: "https://drive.google.com/uc?id=1dE-Kv_U0nKS0J_Hz7A4zqBZoTyyvOpml",246 description: "Woman smiling brightly in a field of yellow flowers",247 },248 {249 order: 61,250 title: "Hannah5",251 url: "https://drive.google.com/uc?id=15BknFcPpBfabSPy6Rg4XnGhPNONywTF3",252 description:253 "Woman smiling brightly while sitting in a field of yellow flowers",254 },255 {256 order: 62,257 title: "Hannah5",258 url: "https://drive.google.com/uc?id=178xh1rJexe0DXaIzzG838FT0454kP_yV",259 description:260 "Woman smiling brightly while leaning up against a white brick wall",261 },262 {263 order: 63,264 title: "Jaden1",265 url: "https://drive.google.com/uc?id=13Oaq3tXdYYflOMvg8e60XL4ZB-WEZaI3",266 description:267 "Track athlete flexing his large right bicep and pointing at the camera",268 },269 {270 order: 64,271 title: "Jaden2",272 url: "https://drive.google.com/uc?id=1FRgjRdi_cZMFRc_yhzJU6KseswuM6w7f",273 description: "Track athlete standing in the field looking off to our left",274 },275 {276 order: 37,277 title: "Jaden3",278 url: "https://drive.google.com/uc?id=1F1GjkNc4xKd91mQx2mLwN3Z3EPJIfv-I",279 description: "Track athlete standing in the field taking a deep breath",280 },281 {282 order: 65,283 title: "Jaden4",284 url: "https://drive.google.com/uc?id=18OKbyFMQN9FTyQsR4MDU9SXnqCmSXZ6v",285 description: "Track athlete squatting",286 },287 {288 order: 36,289 title: "Jaden5",290 url: "https://drive.google.com/uc?id=1rl_BaB0VIo5yfgftNQW4WUPSKdNHw5v5",291 description: "Track athlete pointing at you",292 },293 {294 order: 66,295 title: "Jamie1",296 url: "https://drive.google.com/uc?id=1vrhrDSxwd4sVd6c-0CmC4NWaQ7BKcJL3",297 description: "Man in purple jacket squatting in front of skyline",298 },299 {300 order: 3,301 title: "Jamie2",302 url: "https://drive.google.com/uc?id=1Z_fClr3v4Xmp-bh__m1PWmSTAo6yYjE2",303 description: "Man in purple jacket stretching in front of skyline",304 },305 {306 order: 67,307 title: "Jamie3",308 url: "https://drive.google.com/uc?id=1Pw7aWLZNnLUTaMZXkOXqSmeTOS-YcrL1",309 description: "Man fixing his purple jacket sleeve",310 },311 {312 order: 12,313 title: "Jamie4",314 url: "https://drive.google.com/uc?id=1Mc84Byun1wkPtYuLCNAjVWB5BN6WTbwf",315 description: "Man sitting on ledge with ripped jeans and a tank top",316 },317 {318 order: 68,319 title: "Jamie5",320 url: "https://drive.google.com/uc?id=1AWagRaWNpk7Q6XjWaZ_mKdp0lE39Vfdt",321 description:322 "Man sitting on ledge with ripped jeans and a tank top looking into the camera",323 },324 {325 order: 8,326 title: "Josh",327 url: "https://drive.google.com/uc?id=1wbNeCVKG1QyjLMjP37h69fK7Z-5i9lCD",328 description: "Being proposed to, she's amazed at the opportunity",329 },330 {331 order: 69,332 title: "Kaden1",333 url: "https://drive.google.com/uc?id=1qf3lIEhyQRgFaehUm5QB_ppU5PUrLt9H",334 description:335 "Football player in full gear staring off into the distance as if he misses his mom",336 },337 {338 order: 70,339 title: "Kaden2",340 url: "https://drive.google.com/uc?id=1XSH79aKLjWH4GDYx7XaxKRFhflSFkcfs",341 description: "Football player with helmet off",342 },343 {344 order: 71,345 title: "Kaden3",346 url: "https://drive.google.com/uc?id=1W-JcmX-4Y1uBORwx4phaHZlT8cJVWLDA",347 description: "Football player with helmet off and head cocked to the side",348 },349 {350 order: 6,351 title: "Kaden4",352 url: "https://drive.google.com/uc?id=1eEX-TnICOD1njC642rjeUz42jwkm1sHa",353 description: "Football player getting ready to play",354 },355 {356 order: 72,357 title: "Korbin1",358 url: "https://drive.google.com/uc?id=15JyrVWeZQssf-8dSqhrVp4xA9pD4F_Ys",359 description: "So so happy",360 },361 {362 order: 73,363 title: "Korbin2",364 url: "https://drive.google.com/uc?id=1LUqT_kQLUFLI37tVCj0hjHWcjAMzBa2O",365 description: "So so happy",366 },367 {368 order: 74,369 title: "Korbin3",370 url: "https://drive.google.com/uc?id=1ZVffzYcjsxvvP4GMoSLdDjFongXa_lMG",371 description: "So so happy",372 },373 {374 order: 24,375 title: "Korbin4",376 url: "https://drive.google.com/uc?id=1ws_jYaK1bB08yB87zIssCmimj-9r81bq",377 description: "Track athlete in blocks",378 },379 {380 order: 22,381 title: "Korbin5",382 url: "https://drive.google.com/uc?id=1dDdUCfIqhQLMGNCh2yBJKm2vtkol_5uo",383 description: "Track athlete leaning on fence",384 },385 {386 order: 75,387 title: "Korbin6",388 url: "https://drive.google.com/uc?id=17hccSoVY45hHY1BS1fzoDI42anUbw2SO",389 description: "Track athlete with medals around his arms",390 },391 {392 order: 76,393 title: "Korbin7",394 url: "https://drive.google.com/uc?id=1oOioWaBUZgVHAmRnqVtiscEOXmQGwZoz",395 description: "Track athlete with medals around his neck",396 },397 {398 order: 21,399 title: "Lebron1",400 url: "https://drive.google.com/uc?id=1iZTm8DyUdNrAX_j4U4MbmHHFgzx_aqDv",401 description: "Lebron James",402 },403 {404 order: 77,405 title: "Lebron2",406 url: "https://drive.google.com/uc?id=1tR9ycy9Kgq7XsrwEhFdkGLeL3RLJswFJ",407 description: "Lebron James",408 },409 {410 order: 78,411 title: "Lebron3",412 url: "https://drive.google.com/uc?id=1rxWEG6ij1jyyfKNn2Qrl7b1OwH4Yee2r",413 description: "Lebron James",414 },415 {416 order: 7,417 title: "Lebron4",418 url: "https://drive.google.com/uc?id=1OFPD2S0Jb5_P0GYP82jp7G7TN2DyWXgs",419 description: "Lebron James",420 },421 {422 order: 79,423 title: "Lebron5",424 url: "https://drive.google.com/uc?id=1lTUe3s_HiGTgnh8xAvtWHVh-1dCpleK_",425 description: "Lebron James",426 },427 // {428 // order: 80,429 // title: "Malik1",430 // url: "https://drive.google.com/uc?id=1F5bnG9NiKYn5e2xe20F6Ukc1Ehyo5-Ws/",431 // description: "Malik Harrison",432 // },433 {434 order: 16,435 title: "Malik2",436 url: "https://drive.google.com/uc?id=1176A2oWvEIhhyFEDsOYl7f5kzSo0Af3D",437 description: "Malik Harrison",438 },439 {440 order: 81,441 title: "Malik3",442 url: "https://drive.google.com/uc?id=1HI9xUHfqLpWvLv5ySrccnw0IgG_SwLDs",443 description: "Malik Harrison",444 },445 {446 order: 14,447 title: "Malik4",448 url: "https://drive.google.com/uc?id=15mZ599BIRy7pj66ztphnC47p-8uKErl2",449 description: "Malik Harrison",450 },451 {452 order: 82,453 title: "Malik5",454 url: "https://drive.google.com/uc?id=1pMzC9b1dGUiFbN_f9iXJtTA2gRCeGmFT",455 description: "Malik Harrison",456 },457 {458 order: 83,459 title: "Michelle1",460 url: "https://drive.google.com/uc?id=1JODHKQIdCe3PcQ-07Pru4-g5oWpZD1Yc",461 description: "In gym smiling person",462 },463 {464 order: 20,465 title: "Michelle2",466 url: "https://drive.google.com/uc?id=1MVXWVndT5_RtXwCEUMrG9o_-CgGFabM2",467 description: "Holding sledge hammer with a very serious face",468 },469 {470 order: 84,471 title: "Michelle3",472 url: "https://drive.google.com/uc?id=1VhaE3dJK-b0uCE6JBeDt2T3m7TfeF8ig",473 description: "Working out with some serious muscle definition",474 },475 {476 order: 85,477 title: "Michelle4",478 url: "https://drive.google.com/uc?id=1pvC9BTnLECsVhfjIv23LBULyf3v7ujuE",479 description: "Working out with some serious muscle definition",480 },481 {482 order: 18,483 title: "Mike1",484 url: "https://drive.google.com/uc?id=1ouCoxKMs22amtASpKeBPIie0AnRyGHZo",485 description: "Lifting weights, he got cool dreads",486 },487 {488 order: 10,489 title: "Mike2",490 url: "https://drive.google.com/uc?id=1EN1XAKiq3xRgHgzdeoEHjTvfxmcaph0u",491 description: "Lifting weights, dreads flowing",492 },493 {494 order: 86,495 title: "Mike3",496 url: "https://drive.google.com/uc?id=1E3gHp1FHPuera-Xx5tpUPHzN01Rzgd8i",497 description: "It's like a talking smile",498 },499 {500 order: 87,501 title: "Tyler1",502 url: "https://drive.google.com/uc?id=1WBaZLCfPX-LMs7-_S9PN8eJCyp2HqQQ8",503 description:504 "His shirt says that real life is greater than the internet and he really wants you to know it",505 },506 {507 order: 88,508 title: "Tyler2",509 url: "https://drive.google.com/uc?id=15AHsfkvrD72XRF__XfUd4pqGVxlFao72",510 description:511 "Doing some sort of hand signal that some people think is cool",512 },513 {514 order: 89,515 title: "Tyler3",516 url: "https://drive.google.com/uc?id=1VwTFgR8Q7oMmQyj5SueH7-GuIigFIxBK",517 description: "Standing in front of a fancy car pointing at you",518 },519 {520 order: 90,521 title: "Tyler4",522 url: "https://drive.google.com/uc?id=1_OX1JS_R1F9Toobd5mtXJAXXLaHq8JGW",523 description: "Two people talking, one looking very serious okay",524 },525 {526 order: 4,527 title: "Tyler5",528 url: "https://drive.google.com/uc?id=13NKkqohg54eIZBsL8udOFOQa8b132Zin",529 description: "Standing in front of car with arms spread wide",530 },531 {532 order: 17,533 title: "Tyler6",534 url: "https://drive.google.com/uc?id=1kF5MXq9yZZe_Xrlf1Q7QlvbLTi4PntRJ",535 description: "Smiling in front of skyline",536 },537 {538 order: 19,539 title: "Tyler7",540 url: "https://drive.google.com/uc?id=1vMEEynR40WpQSKJOrZetmV5A12KIFQex",541 description:542 "Standing in front of fancy car with hands up like what question mark",543 },544 {545 order: 91,546 title: "Tyler8",547 url: "https://drive.google.com/uc?id=1cpIiS1AGSPoYvF0bygdxzIJmY0SEhK9o",548 description: "Sitting on stoop, is he afraid to leave?",549 },550 {551 order: 92,552 title: "Zerrers1",553 url: "https://drive.google.com/uc?id=1DhEbfqDf5KK1u5dNaNBmAPS9b6JK7j7U",554 description: "Happy happy couple",555 },556 {557 order: 38,558 title: "Zerrers2",559 url: "https://drive.google.com/uc?id=1Vr9XBvzPhLoG_xffhIBIkWyeTCEnrHzm",560 description: "Happy couple laughing and looking into each other's eyes",561 },562];563export default photos;...
uc_bank.js
Source:uc_bank.js
1$(document).ready(function(){2 $(document).on("pageInit", "#uc_bank", function(e, id, page) {3 $("#uc_bank .delete").click(function(){4 var id = $.trim($(this).attr("data-id"));5 $.confirm("确认è¦å é¤åï¼",function() {6 var ajaxurl = WAP_PATH+'/member.php?ctl=uc_del_bank';7 var query = newObject();8 query.id = id;9 query.post_type = "json";10 $.ajax({11 url:ajaxurl,12 data:query,13 type:"Post",14 dataType:"json",15 success:function(data){16 $.alert(data.show_err,function(){17 reloadpage(WAP_PATH+'/member.php?ctl=uc_bank',"#uc_bank",".content",function(){18 RouterBack(WAP_PATH+'/member.php?ctl=uc_bank',"#uc_bank","#uc_bank");19 });20 });21 22 }23 });24 },function() {25 return false;26 });27 28 });29 30 $("#uc_bank button.uc_bank").click(function(){31 var ips_money = $("#uc_bank #ips_money").val();32 if(ips_money==0){33 $.alert("å¯ç¨èµé为0,ä¸å¯è¿è¡æç°ï¼");34 return false;35 }36 37 var ajaxurl = WAP_PATH+'/member.php?ctl=uc_bank';38 var query = newObject();39 query.pTrdAmt = $.trim($("#uc_bank #pTrdAmt").val());40 41 query.post_type = "json";42 $.ajax({43 url:ajaxurl,44 data:query,45 type:"Post",46 dataType:"json",47 success:function(data){48 if(data.response_code == 1){49 window.location.href = data.dw_url;50 }51 52 }53 });54 });55 56 $("#uc_bank #pTrdAmt").keyup(function(){57 setBkCarryResult();58 });59 $("#uc_bank #pTrdAmt").blur(function(){60 setBkCarryResult();61 });62 });63 64 $(document).on("pageInit", "#uc_add_bank", function(e, id, page) {65 $("#uc_add_bank .seclet_but").click(function(){66 $("#uc_add_bank .bank_seclet").toggle();67 });68 $("#uc_add_bank .bank_seclet li").click(function(){69 var value=$(this).html();70 $("#uc_add_bank .this_bank").html(value);71 $(this).parent().hide();72 $(this).addClass("active").siblings().removeClass("active");73 });74 75 $.ajax({76 url:APP_ROOT+"/system/region.js",77 cache:true,78 success:function(result){79 eval(result);80 load_bk_select("1",regionConf);81 $("#uc_add_bank select[name='region_lv2']").live("change",function(){82 load_bk_select("2",regionConf);83 });84 $("#uc_add_bank select[name='region_lv3']").live("change",function(){85 load_bk_select("3",regionConf);86 });87 }88 });89 90 91 $("#uc_add_bank #add_bank").click(function(){92 var ajaxurl = WAP_PATH+'/member.php?ctl=uc_save_bank';93 var query = newObject();94 95 query.bank_id = $("#uc_add_bank li.active input").val();96 query.bankzone = $.trim($("#uc_add_bank #bankzone").val());97 query.bankcard = $.trim($("#uc_add_bank #bankcard").val());98 query.region_lv1 = $.trim($("#uc_add_bank #region_lv1").val());99 query.region_lv2 = $.trim($("#uc_add_bank #region_lv2").val());100 query.region_lv3 = $.trim($("#uc_add_bank #region_lv3").val());101 query.region_lv4 = $.trim($("#uc_add_bank #region_lv4").val());102 query.post_type = "json";103 $.ajax({104 url:ajaxurl,105 data:query,106 type:"Post",107 dataType:"json",108 success:function(data){109 if(data.user_login_status==1){110 $.alert(data.show_err,function(){111 if(data.response_code==1){112 reloadpage(WAP_PATH+'/member.php?ctl=uc_bank','#uc_bank','.content',function(){113 RouterBack(WAP_PATH+'/member.php?ctl=uc_bank','#uc_bank','#uc_bank');114 });115 }116 });117 118 }119 else{120 RouterURL(WAP_PATH+'/member.php?ctl=login','#login');121 }122 }123 });124 });125 });126 127 $(document).on("pageInit", "#uc_carry_money", function(e, id, page) {128 $("#uc_carry_money .seclet_but").click(function(){129 $("#uc_carry_money .bank_seclet").toggle();130 });131 $("#uc_carry_money .bank_seclet li").click(function(){132 var value=$(this).html();133 $("#uc_carry_money .this_bank").html(value);134 $(this).parent().hide();135 $(this).addClass("active").siblings().removeClass("active");136 });137 138 139 $("#uc_carry_money .but_this").click(function(){140 var paypassword = $.trim($("#uc_carry_money #paypassword").val());141 var ajaxurl = WAP_PATH+'/member.php?ctl=uc_save_carry';142 var query = newObject();143 query.bid = $.trim($("#uc_carry_money #band_id").val());144 query.amount = $.trim($("#uc_carry_money #Jcarry_amount").val());145 query.paypassword = $.trim($("#uc_carry_money #paypassword").val());146 query.post_type = "json";147 148 $.ajax({149 url:ajaxurl,150 data:query,151 type:"Post",152 dataType:"json",153 success:function(data){154 $.alert(data.show_err,function(){155 if(data.response_code==1){156 RouterURL(WAP_PATH+'/member.php?ctl=uc_carry_money_log','#uc_carry_money_log',2);157 }158 });159 160 161 }162 });163 });164 165 166 $("#uc_carry_money #Jcarry_amount").blur(function(){167 setNrCarryResult();168 });169 }); 170 171});172function load_bk_select(lv,regionConf)173{174 var name = "region_lv"+lv;175 var next_name = "region_lv"+(parseInt(lv)+1);176 var id = $("#uc_add_bank select[name='"+name+"']").val();177 178 var x = "";179 if(lv==1){180 var evalStr="regionConf.r"+id+".c";181 x="ç";182 }183 if(lv==2){184 var evalStr="regionConf.r"+$("#uc_add_bank select[name='region_lv1']").val()+".c.r"+id+".c";185 x="å¸";186 }187 if(lv==3){188 var evalStr="regionConf.r"+$("#uc_add_bank select[name='region_lv1']").val()+".c.r"+$("#uc_add_bank select[name='region_lv2']").val()+".c.r"+id+".c";189 x="åº";190 }191 192 if(id==0)193 {194 var html = "<option value='0'>éæ©"+x+"</option>";195 }196 else197 {198 var regionConfs=eval(evalStr);199 evalStr+=".";200 var html = "<option value='0'>éæ©"+x+"</option>";201 for(var key in regionConfs)202 {203 html+="<option value='"+eval(evalStr+key+".i")+"'>"+eval(evalStr+key+".n")+"</option>";204 }205 }206 $("#uc_add_bank select[name='"+next_name+"']").html(html);207 208 if(lv != 4)209 {210 load_bk_select(parseInt(lv)+1);211 }212}213 /*第ä¸ç§å½¢å¼ 第äºç§å½¢å¼ æ´æ¢æ¾ç¤ºæ ·å¼*/214function setBkTabS(sname,cursel,n){215 for(i=1;i<=n;i++){216 var menu=$("#uc_bank #"+sname+i);217 var con=$("#uc_bank #con_"+sname+"_"+i);218 if(i==cursel){219 con.show();220 menu.addClass("hover");221 }222 else{223 con.hide();224 menu.removeClass("hover");225 }226 }227}228function setBkCarryResult(){229 var json_fee = $("#uc_bank input[name='json_fee']").val();230 json_fee = $.parseJSON(json_fee);231 var carry_amount = 0;232 if ($.trim($("#uc_bank #pTrdAmt").val()).length > 0) {233 if ($("#uc_bank #pTrdAmt").val() == "-") {234 carry_amount = "-0";235 }236 else{237 carry_amount = parseFloat($("#pTrdAmt").val());238 }239 }240 carry_amount=$.trim($("#uc_bank #pTrdAmt").val());241 carry_amount = parseFloat(carry_amount);242 243 var fee = 0;244 var fee_type = 0;245 246 if(json_fee.length > 0){247 if(carry_amount >= json_fee[json_fee.length-1].max_price){248 fee = json_fee[json_fee.length-1].fee;249 fee_type = json_fee[json_fee.length-1].fee_type;250 251 }252 else{253 $.each(json_fee,function(n,data) {254 if(carry_amount >=data.min_price && carry_amount<=data.max_price) { 255 fee = data.fee;256 fee_type = data.fee_type;257 258 }259 }); 260 }261 }262 263 fee = parseFloat(fee);264 if(fee_type == 1){265 fee = carry_amount * fee * 0.01;266 }267 268 $("#uc_bank #Jcarry_fee").html(fee+" å
");269}270function setNrCarryResult(){271 var json_fee = $("#uc_carry_money input[name='json_fee']").val();272 json_fee = $.parseJSON(json_fee);273 var carry_amount = 0;274 var total_amount = parseFloat($("#uc_carry_money input[name='money']").val());275 var nmc_amount = parseFloat($("#uc_carry_money input[name='nmc_amount']").val());276 277 if ($.trim($("#uc_carry_money #Jcarry_amount").val()).length > 0) {278 if ($("#uc_carry_money #Jcarry_amount").val() == "-") {279 carry_amount = "-0";280 }281 else{282 carry_amount = parseFloat($("#uc_carry_money #Jcarry_amount").val());283 }284 }285 286 var fee = 10;287 carry_amount = parseFloat(carry_amount);288 var realAmount = carry_amount+fee;289 290 if(carry_amount < 0){291 $.alert("请è¾å
¥æ£ç¡®éé¢");292 293 }294 else if(carry_amount > total_amount - nmc_amount){295 $.alert("æ¨çå¯æç°ä½é¢ä¸è¶³");296 }297 else if(carry_amount == 0){298 $.alert("åç°æä½åªè½æ¯0.1å
");299 }300 else{301 $("#uc_carry_money #Jcarry_balance").html("");302 }303 304 var fee = 0;305 var fee_type = 0;306 307 if(json_fee.length > 0){308 if(carry_amount >= json_fee[json_fee.length-1].max_price){309 fee = json_fee[json_fee.length-1].fee;310 fee_type = json_fee[json_fee.length-1].fee_type;311 312 }313 else{314 $.each(json_fee,function(n,data) {315 if(carry_amount >=data.min_price && carry_amount<=data.max_price) { 316 fee = data.fee;317 fee_type = data.fee_type;318 319 }320 }); 321 }322 }323 324 fee = parseFloat(fee);325 if(fee_type == 1){326 fee = carry_amount * fee * 0.01;327 }328 var nmc_amount = $.trim($("#uc_carry_money #Jcarry_nmc_amount").val());329 var carry_balance = total_amount-carry_amount-fee-nmc_amount;330 331 if(carry_balance<0){332 $.alert("æ¨çè´¦æ·ä½é¢ä¸è¶³");333 }334 335 $("#uc_carry_money #Jcarry_fee").html(fee+" å
");336 337 var realAmount = carry_amount+fee;338 $("#uc_carry_money #Jcarry_realAmount").html(realAmount+" å
");339 var acount_balance = total_amount-carry_amount-fee;340 $("#uc_carry_money #Jcarry_acount_balance_res").val(acount_balance);341 $("#uc_carry_money #Jcarry_acount_balance").html(acount_balance + nmc_amount+" å
");...
rocketchat.js
Source:rocketchat.js
1import emojione from 'emojione';2import { Meteor } from 'meteor/meteor';3import { Tracker } from 'meteor/tracker';4import mem from 'mem';5import { emojioneRender, emojioneRenderFromShort } from './emojioneRender';6import { emojisByCategory, emojiCategories, toneList } from './emojiPicker';7import { emoji } from '../../emoji';8import { getUserPreference } from '../../utils';9// TODO remove fix below when issue is solved: https://github.com/joypixels/emojione/issues/61710// add missing emojis not provided by JS object, but included on emoji.json11emojione.shortnames += '|:tm:|:copyright:|:registered:|:digit_zero:|:digit_one:|:digit_two:|:digit_three:|:digit_four:|:digit_five:|:digit_six:|:digit_seven:|:digit_eight:|:digit_nine:|:pound_symbol:|:asterisk_symbol:';12emojione.regShortNames = new RegExp(`<object[^>]*>.*?<\/object>|<span[^>]*>.*?<\/span>|<(?:object|embed|svg|img|div|span|p|a)[^>]*>|(${ emojione.shortnames })`, 'gi');13emojione.emojioneList[':tm:'] = {14 uc_base: '2122',15 uc_output: '2122-fe0f',16 uc_match: '2122-fe0f',17 uc_greedy: '2122-fe0f',18 shortnames: [],19 category: 'symbols',20 emojiPackage: 'emojione',21};22emojione.emojioneList[':copyright:'] = {23 uc_base: '00a9',24 uc_output: '00a9-f0ef',25 uc_match: '00a9-fe0f',26 uc_greedy: '00a9-fe0f',27 shortnames: [],28 category: 'symbols',29 emojiPackage: 'emojione',30};31emojione.emojioneList[':registered:'] = {32 uc_base: '00ae',33 uc_output: '00ae-fe0f',34 uc_match: '00ae-fe0f',35 uc_greedy: '00ae-fe0f',36 shortnames: [],37 category: 'symbols',38 emojiPackage: 'emojione',39};40emojione.emojioneList[':digit_zero:'] = {41 uc_base: '0030',42 uc_output: '0030-fe0f',43 uc_match: '0030-fe0f',44 uc_greedy: '0030-fe0f',45 shortnames: [],46 category: 'symbols',47 emojiPackage: 'emojione',48};49emojione.emojioneList[':digit_one:'] = {50 uc_base: '0031',51 uc_output: '0031-fe0f',52 uc_match: '0031-fe0f',53 uc_greedy: '0031-fe0f',54 shortnames: [],55 category: 'symbols',56 emojiPackage: 'emojione',57};58emojione.emojioneList[':digit_two:'] = {59 uc_base: '0032',60 uc_output: '0032-fe0f',61 uc_match: '0032-fe0f',62 uc_greedy: '0032-fe0f',63 shortnames: [],64 category: 'symbols',65 emojiPackage: 'emojione',66};67emojione.emojioneList[':digit_three:'] = {68 uc_base: '0033',69 uc_output: '0033-fe0f',70 uc_match: '0033-fe0f',71 uc_greedy: '0033-fe0f',72 shortnames: [],73 category: 'symbols',74 emojiPackage: 'emojione',75};76emojione.emojioneList[':digit_four:'] = {77 uc_base: '0034',78 uc_output: '0034-fe0f',79 uc_match: '0034-fe0f',80 uc_greedy: '0034-fe0f',81 shortnames: [],82 category: 'symbols',83 emojiPackage: 'emojione',84};85emojione.emojioneList[':digit_five:'] = {86 uc_base: '0035',87 uc_output: '0035-fe0f',88 uc_match: '0035-fe0f',89 uc_greedy: '0035-fe0f',90 shortnames: [],91 category: 'symbols',92 emojiPackage: 'emojione',93};94emojione.emojioneList[':digit_six:'] = {95 uc_base: '0036',96 uc_output: '0036-fe0f',97 uc_match: '0036-fe0f',98 uc_greedy: '0036-fe0f',99 shortnames: [],100 category: 'symbols',101 emojiPackage: 'emojione',102};103emojione.emojioneList[':digit_seven:'] = {104 uc_base: '0037',105 uc_output: '0037-fe0f',106 uc_match: '0037-fe0f',107 uc_greedy: '0037-fe0f',108 shortnames: [],109 category: 'symbols',110 emojiPackage: 'emojione',111};112emojione.emojioneList[':digit_eight:'] = {113 uc_base: '0038',114 uc_output: '0038-fe0f',115 uc_match: '0038-fe0f',116 uc_greedy: '0038-fe0f',117 shortnames: [],118 category: 'symbols',119 emojiPackage: 'emojione',120};121emojione.emojioneList[':digit_nine:'] = {122 uc_base: '0039',123 uc_output: '0039-fe0f',124 uc_match: '0039-fe0f',125 uc_greedy: '0039-fe0f',126 shortnames: [],127 category: 'symbols',128 emojiPackage: 'emojione',129};130emojione.emojioneList[':pound_symbol:'] = {131 uc_base: '0023',132 uc_output: '0023-fe0f',133 uc_match: '0023-fe0f',134 uc_greedy: '0023-fe0f',135 shortnames: [],136 category: 'symbols',137 emojiPackage: 'emojione',138};139emojione.emojioneList[':asterisk_symbol:'] = {140 uc_base: '002a',141 uc_output: '002a-fe0f',142 uc_match: '002a-fe0f',143 uc_greedy: '002a-fe0f',144 shortnames: [],145 category: 'symbols',146 emojiPackage: 'emojione',147};148// end fix149// fix for :+1: - had to replace all function that does its conversion: https://github.com/joypixels/emojione/blob/4.5.0/lib/js/emojione.js#L249150(function(ns) {151 ns.shortnameConversionMap = mem(ns.shortnameConversionMap, { maxAge: 1000 });152 ns.unicodeCharRegex = mem(ns.unicodeCharRegex, { maxAge: 1000 });153 const convertShortName = mem(function(shortname) {154 // the fix is basically adding this .replace(/[+]/g, '\\$&')155 if ((typeof shortname === 'undefined') || (shortname === '') || (ns.shortnames.indexOf(shortname.replace(/[+]/g, '\\$&')) === -1)) {156 // if the shortname doesnt exist just return the entire match157 return shortname;158 }159 // map shortname to parent160 if (!ns.emojioneList[shortname]) {161 for (const emoji in ns.emojioneList) {162 if (!ns.emojioneList.hasOwnProperty(emoji) || (emoji === '')) { continue; }163 if (ns.emojioneList[emoji].shortnames.indexOf(shortname) === -1) { continue; }164 shortname = emoji;165 break;166 }167 }168 const unicode = ns.emojioneList[shortname].uc_output;169 const fname = ns.emojioneList[shortname].uc_base;170 const category = fname.indexOf('-1f3f') >= 0 ? 'diversity' : ns.emojioneList[shortname].category;171 const title = ns.imageTitleTag ? `title="${ shortname }"` : '';172 // const size = ns.spriteSize === '32' || ns.spriteSize === '64' ? ns.spriteSize : '32';173 // if the emoji path has been set, we'll use the provided path, otherwise we'll use the default path174 const ePath = ns.defaultPathPNG !== ns.imagePathPNG ? ns.imagePathPNG : `${ ns.defaultPathPNG + ns.emojiSize }/`;175 // depending on the settings, we'll either add the native unicode as the alt tag, otherwise the shortname176 const alt = ns.unicodeAlt ? ns.convert(unicode.toUpperCase()) : shortname;177 if (ns.sprites) {178 return `<span class="emojione emojione-${ category } _${ fname }" ${ title }>${ alt }</span>`;179 }180 return `<img class="emojione" alt="${ alt }" ${ title } src="${ ePath }${ fname }${ ns.fileExtension }"/>`;181 }, { maxAge: 1000 });182 const convertUnicode = mem(function(entire, m1, m2, m3) {183 const mappedUnicode = ns.mapUnicodeToShort();184 if ((typeof m3 === 'undefined') || (m3 === '') || !(ns.unescapeHTML(m3) in ns.asciiList)) {185 // if the ascii doesnt exist just return the entire match186 return entire;187 }188 m3 = ns.unescapeHTML(m3);189 const unicode = ns.asciiList[m3];190 const shortname = mappedUnicode[unicode];191 const category = unicode.indexOf('-1f3f') >= 0 ? 'diversity' : ns.emojioneList[shortname].category;192 const title = ns.imageTitleTag ? `title="${ ns.escapeHTML(m3) }"` : '';193 // const size = ns.spriteSize === '32' || ns.spriteSize === '64' ? ns.spriteSize : '32';194 // if the emoji path has been set, we'll use the provided path, otherwise we'll use the default path195 const ePath = ns.defaultPathPNG !== ns.imagePathPNG ? ns.imagePathPNG : `${ ns.defaultPathPNG + ns.emojiSize }/`;196 // depending on the settings, we'll either add the native unicode as the alt tag, otherwise the shortname197 const alt = ns.unicodeAlt ? ns.convert(unicode.toUpperCase()) : ns.escapeHTML(m3);198 if (ns.sprites) {199 return `${ m2 }<span class="emojione emojione-${ category } _${ unicode }" ${ title }>${ alt }</span>`;200 }201 return `${ m2 }<img class="emojione" alt="${ alt }" ${ title } src="${ ePath }${ unicode }${ ns.fileExtension }"/>`;202 }, { maxAge: 1000, cacheKey: JSON.stringify });203 ns.shortnameToImage = function(str) {204 // replace regular shortnames first205 str = str.replace(ns.regShortNames, convertShortName);206 // if ascii smileys are turned on, then we'll replace them!207 if (ns.ascii) {208 const asciiRX = ns.riskyMatchAscii ? ns.regAsciiRisky : ns.regAscii;209 return str.replace(asciiRX, convertUnicode);210 }211 return str;212 };213}(emojione));214emoji.packages.emojione = emojione;215emoji.packages.emojione.sprites = true;216emoji.packages.emojione.emojisByCategory = emojisByCategory;217emoji.packages.emojione.emojiCategories = emojiCategories;218emoji.packages.emojione.toneList = toneList;219emoji.packages.emojione.render = emojioneRender;220emoji.packages.emojione.renderPicker = emojioneRenderFromShort;221// http://stackoverflow.com/a/26990347 function isSet() from Gajus222function isSetNotNull(fn) {223 let value;224 try {225 value = fn();226 } catch (e) {227 value = null;228 }229 return value !== null && value !== undefined;230}231// RocketChat.emoji.list is the collection of emojis from all emoji packages232for (const key in emojione.emojioneList) {233 if (emojione.emojioneList.hasOwnProperty(key)) {234 const currentEmoji = emojione.emojioneList[key];235 currentEmoji.emojiPackage = 'emojione';236 emoji.list[key] = currentEmoji;237 if (currentEmoji.shortnames) {238 currentEmoji.shortnames.forEach((shortname) => {239 emoji.list[shortname] = currentEmoji;240 });241 }242 }243}244// Additional settings -- ascii emojis245Meteor.startup(function() {246 Tracker.autorun(function() {247 if (isSetNotNull(() => emoji.packages.emojione)) {248 if (isSetNotNull(() => getUserPreference(Meteor.userId(), 'convertAsciiEmoji'))) {249 emoji.packages.emojione.ascii = getUserPreference(Meteor.userId(), 'convertAsciiEmoji');250 } else {251 emoji.packages.emojione.ascii = true;252 }253 }254 });...
uc_roles.js
Source:uc_roles.js
1/**2 * @file3 * Enables and disables expiration fields to prevent invalid configurations.4 */5/**6 * Disables duration amount when its type is "never".7 */8function _uc_role_expiration_disable_check(granularity, quantity) {9 // 'never' means there's no point in setting a duration.10 if ($(granularity).val() == 'never') {11 $(quantity).attr('disabled', 'disabled').val('');12 }13 // Anything besides 'never' should enable setting a duration.14 else {15 $(quantity).removeAttr('disabled');16 }17}18/**19 * Switch between relative and absolute expiration durations.20 */21function expiration_switcher() {22 if ($('#edit-expiration').val() == 'abs') {23 $("#edit-uc-roles-expire-relative-duration-wrapper").hide();24 $("#edit-uc-roles-expire-relative-granularity-wrapper").hide();25 $("#edit-uc-roles-by-quantity-wrapper").hide();26 $("#edit-uc-roles-expire-absolute-wrapper").show();27 }28 else {29 $("#edit-uc-roles-expire-absolute-wrapper").hide();30 $("#edit-uc-roles-expire-relative-duration-wrapper").show();31 $("#edit-uc-roles-expire-relative-granularity-wrapper").show();32 $("#edit-uc-roles-by-quantity-wrapper").show();33 }34}35/**36 * Set the default state for expiration duration.37 */38function expiration_switcher_default() {39 if ($('#edit-uc-roles-default-end-expiration').val() == 'abs') {40 $("#edit-uc-roles-default-length-wrapper").attr('style', 'display:none;');41 $("#edit-uc-roles-default-granularity-wrapper").attr('style', 'display:none;');42 $("#edit-uc-roles-default-by-quantity-wrapper").attr('style', 'display:none;');43 $("#edit-uc-roles-default-end-time-wrapper").removeAttr('style');44 }45 else {46 $("#edit-uc-roles-default-length-wrapper").removeAttr('style');47 $("#edit-uc-roles-default-granularity-wrapper").removeAttr('style');48 $("#edit-uc-roles-default-by-quantity-wrapper").removeAttr('style');49 $("#edit-uc-roles-default-end-time-wrapper").attr('style', 'display:none;');50 }51}52/**53 * Override the expiration duration default state.54 */55function uc_roles_expiration_default_override() {56 if ($('#edit-end-override').length == 0) {57 return;58 }59 if ($('#edit-end-override').attr('checked')) {60 $('#edit-expiration-wrapper').removeAttr('style');61 $('#edit-uc-roles-expire-absolute-wrapper').removeAttr('style');62 $('#edit-uc-roles-expire-relative-duration-wrapper').removeAttr('style');63 $('#edit-uc-roles-expire-relative-granularity-wrapper').removeAttr('style');64 $('#edit-uc-roles-by-quantity-wrapper').removeAttr('style');65 expiration_switcher();66 }67 else {68 $('#edit-expiration-wrapper').attr('style', 'display:none;');69 $('#edit-uc-roles-expire-relative-duration-wrapper').attr('style', 'display:none;');70 $('#edit-uc-roles-expire-relative-granularity-wrapper').attr('style', 'display:none;');71 $('#edit-uc-roles-by-quantity-wrapper').attr('style', 'display:none;');72 $('#edit-uc-roles-expire-absolute-wrapper').attr('style', 'display:none;');73 }74}75$(document).ready(76 function() {77 _uc_role_expiration_disable_check('#edit-uc-roles-expire-relative-granularity', '#edit-uc-roles-expire-relative-duration');78 _uc_role_expiration_disable_check('#edit-uc-roles-default-granularity', '#edit-uc-roles-default-length');79 _uc_role_expiration_disable_check('#edit-uc-roles-reminder-granularity', '#edit-uc-roles-reminder-length');80 uc_roles_expiration_default_override();81 expiration_switcher_default();82 }83);84// When you change the role expiration time select.85Drupal.behaviors.ucRoleExpirationTime = function(context) {86 $("#edit-expiration:not(.ucRoleExpirationTime-processed)", context).addClass('ucRoleExpirationTime-processed').change(87 function() {88 expiration_switcher();89 }90 );91}92// When you change the default role expiration time select.93Drupal.behaviors.ucRoleDefaultExpirationTimeDefault = function(context) {94 $("#edit-uc-roles-default-end-expiration:not(.ucRoleDefaultExpirationTimeDefault-processed)", context).addClass('ucRoleDefaultExpirationTimeDefault-processed').change(95 function() {96 expiration_switcher_default();97 }98 );99}100// When you change the role expiration time select.101Drupal.behaviors.ucRoleExpirationTimeDefault = function(context) {102 $("#edit-uc-roles-end-expiration:not(.ucRoleExpirationTimeDefault-processed)", context).addClass('ucRoleExpirationTimeDefault-processed').change(103 function() {104 expiration_switcher_default();105 }106 );107}108// When you change the role expiration granularity select.109Drupal.behaviors.ucRoleExpirationGranularity = function(context) {110 $('#edit-uc-roles-expire-relative-granularity:not(.ucRoleExpirationGranularity-processed)', context).addClass('ucRoleExpirationGranularity-processed').change(111 function() {112 _uc_role_expiration_disable_check('#edit-uc-roles-expire-relative-granularity', '#edit-uc-roles-expire-relative-duration');113 }114 );115}116// When you change the default role expiration granularity select.117Drupal.behaviors.ucRoleDefaultExpirationGranularity = function(context) {118 $('#edit-uc-roles-default-granularity:not(.ucRoleDefaultExpirationGranularity-processed)', context).addClass('ucRoleDefaultExpirationGranularity-processed').change(119 function() {120 _uc_role_expiration_disable_check('#edit-uc-roles-default-granularity', '#edit-uc-roles-default-length');121 }122 );123}124// When you change the default role expiration granularity select.125Drupal.behaviors.ucRoleReminderExpirationGranularity = function(context) {126 $('#edit-uc-roles-reminder-granularity:not(.ucRoleReminderExpirationGranularity-processed)', context).addClass('ucRoleReminderExpirationGranularity-processed').change(127 function() {128 _uc_role_expiration_disable_check('#edit-uc-roles-reminder-granularity', '#edit-uc-roles-reminder-length');129 }130 );131}132// When you change the default role expiration granularity select.133Drupal.behaviors.ucRoleExpirationEndOverride = function(context) {134 $('#edit-end-override:not(.ucRoleExpirationEndOverride-processed)', context).addClass('ucRoleExpirationEndOverride-processed').click(135 function() {136 uc_roles_expiration_default_override();137 }138 );...
uc_learn.js
Source:uc_learn.js
1$(document).on("pageInit", "#uc_learn", function(e, id, page) {2 var now_page = 1;3 var all_page = 0;4 var loading = false;5 $("#uc_learn .infinite-scroll-preloader").hide();6 $(page).on('infinite', function() {7 all_page=$("#uc_learn .infinite-scroll").attr("all_page");8 if (loading || now_page >= all_page) return;9 $("#uc_learn .infinite-scroll-preloader").show();10 loading = true;11 var query = newObject();12 query.p = now_page + 1;13 query.is_ajax = 1;14 query = get_url_params(query);15 delete query.ctl; 16 $.ajax({17 url:$("#uc_learn .infinite-scroll").attr("ajaxurl"),18 data:query,19 success:function(result){20 now_page ++;21 loading = false;22 $("#uc_learn .infinite-scroll .invest").append(result);23 $("#uc_learn .infinite-scroll .top_menu_list").last().remove();24 $("#uc_learn .infinite-scroll .pull-to-refresh-layer").last().remove();25 $("#uc_learn .infinite-scroll-preloader").hide();26 $.refreshScroller();27 }28 });29 });30 31 $("#uc_learn .j_do_interest").click(function(){32 if(confirm("ç¡®å®é¢åæ¶çï¼"))33 {34 var ajaxurl = WAP_PATH+'/index.php?ctl=uc_learn_do_interest';35 var query = newObject();36 query.post_type = "json";37 $.ajax({38 url:ajaxurl,39 data:query,40 type:"Post",41 dataType:"json",42 success:function(data){43 $.alert(data.show_err,function(){44 reloadpage(WAP_PATH+'/index.php?ctl=uc_learn','#uc_learn','.content');45 RouterURL(WAP_PATH+'/index.php?ctl=uc_learn','#uc_learn');46 });47 }48 49 });50 } 51 });52 53 54 $("#uc_learn .J_do_invest").click(function(){55 $.confirm("ç¡®å®æèµï¼",function(){56 var ajaxurl = WAP_PATH+'/index.php?ctl=uc_learn_do_invest';57 var learn_id = $.trim($("#learn_id").val());58 var money = $.trim($("#money").val());59 var query = newObject();60 query.learn_id = $.trim($("#learn_id").val());61 query.money = $.trim($("#money").val());62 query.post_type = "json";63 $.ajax({64 url:ajaxurl,65 data:query,66 type:"Post",67 dataType:"json",68 success:function(data){69 $.alert(data.show_err,function(){70 reloadpage(WAP_PATH+'/index.php?ctl=uc_learn&t=load','#uc_learn','.content');71 RouterURL(WAP_PATH+'/index.php?ctl=uc_learn&t=load','#uc_learn');72 }); 73 }74 75 });76 },function(){77 return false;78 }); 79 });80}); 81$(document).on("pageInit", "#uc_learn_deal_invest", function(e, id, page) {82 83 var now_page = 1;84 var all_page = 0;85 var loading = false;86 $("#uc_learn_deal_invest .infinite-scroll-preloader").hide();87 $(page).on('infinite', function() {88 all_page=$("#uc_learn_deal_invest .detail_content").attr("all_page");89 now_page = $("#uc_learn_deal_invest .detail_content").attr("now_page");90 now_page = parseInt(now_page);91 if (loading || now_page >= all_page) return;92 $("#uc_learn_deal_invest .infinite-scroll-preloader").show();93 loading = true;94 var query = newObject();95 query.page = now_page + 1;96 query.is_ajax = 1;97 98 var parms = get_search_parms();99 var ajaxurl = $("#uc_learn_deal_invest .infinite-scroll").attr("ajaxurl");100 $.ajax({101 url:ajaxurl + parms,102 data:query,103 success:function(result){104 now_page ++;105 $("#uc_learn_deal_invest .detail_content").attr("now_page",now_page);106 loading = false;107 $("#uc_learn_deal_invest .infinite-scroll .detail_content").append(result);108 $("#uc_learn_deal_invest .infinite-scroll-preloader").hide();109 $.refreshScroller();110 }111 });112 113 });114 115 $("#uc_learn_deal_invest .tz_link_btn").click(function(){116 117 var ajaxurl = WAP_PATH+'/index.php?ctl=uc_learn_bid';118 var id = $(this).attr("data-id");119 var query = newObject();120 query.id = $(this).attr("data-id");121 122 query.post_type = "json";123 $.ajax({124 url:ajaxurl,125 data:query,126 type:"Post",127 dataType:"json",128 success:function(data){129 if(data.status == 0){130 $.alert(data.show_err);131 reploadpage(WAP_PATH+'/index.php?ctl=uc_learn_deal_invest',"#uc_learn_deal_invest",'.content');132 RouterURL(WAP_PATH+'/index.php?ctl=uc_learn_deal_invest',"#uc_learn_deal_invest");133 }else{134 RouterURL(WAP_PATH+'/index.php?ctl=uc_learn_bid&id='+id,"#uc_learn_bid",2);135 }136 137 }138 139 });140 141 });142});143$(document).on("pageInit", "#uc_learn_bid", function(e, id, page) {144 $("#uc_learn_bid #submitt").click(function(){145 var ajaxurl = WAP_PATH+'/index.php?ctl=uc_learn_dobid';146 var deal_id = $.trim($("#uc_learn_bid #deal_id").val());147 var learn_id = $.trim($("#uc_learn_bid #learn_id").val());148 var bid_money = $.trim($("#uc_learn_bid #bid_money").val());149 var bid_paypassword = $.trim($("#uc_learn_bid #bid_paypassword").val());150 var query = newObject();151 query.deal_id = deal_id;152 query.learn_id = learn_id;153 query.bid_paypassword = bid_paypassword;154 query.bid_money = bid_money;155 156 query.post_type = "json";157 $.ajax({158 url:ajaxurl,159 data:query,160 type:"Post",161 dataType:"json",162 success:function(data){163 $.alert(data.show_err);164 if(data.status==1){165 RouterURL(WAP_PATH+'/index.php?ctl=uc_invest','#uc_invest',2);166 }else{167 168 reloadpage(WAP_PATH+'/index.php?ctl=uc_learn_bid&id='+deal_id,"#uc_learn_bid",".content");169 RouterURL(WAP_PATH+'/index.php?ctl=uc_learn_bid&id='+deal_id,'#uc_learn_bid');170 }171 172 }173 174 });175 176 $(this).parents(".float_block").hide();177 });...
uc_file.js
Source:uc_file.js
1/**2 * @file3 * Modifies the file selection and download access expiration interfaces.4 */5var uc_file_list = {};6/**7 * Disables duration amount when its type is "never".8 */9function _uc_file_expiration_disable_check(granularity, quantity) {10 // 'never' means there's no point in setting a duration.11 if ($(granularity).val() == 'never') {12 $(quantity).attr('disabled', 'disabled').val('');13 }14 // Anything besides 'never' should enable setting a duration.15 else {16 $(quantity).removeAttr('disabled');17 }18}19/**20 * Adds files to delete to the list.21 */22function _uc_file_delete_list_populate() {23 $('.affected-file-name').empty().append(uc_file_list[$('#edit-recurse-directories').attr('checked')]);24}25$(document).ready(26 function() {27 _uc_file_expiration_disable_check('#edit-uc-file-download-limit-duration-granularity', '#edit-uc-file-download-limit-duration-qty');28 _uc_file_expiration_disable_check('#edit-download-limit-duration-granularity', '#edit-download-limit-duration-qty');29 _uc_file_expiration_disable_check('#edit-download-limit-duration-granularity', '#edit-download-limit-duration-qty');30 _uc_file_delete_list_populate();31 toggle_limit_settings('#edit-download-override', '#edit-download-limit-number-wrapper');32 toggle_limit_settings('#edit-location-override', '#edit-download-limit-addresses-wrapper');33 toggle_limit_settings('#edit-time-override', '#edit-download-limit-duration-qty-wrapper');34 toggle_limit_settings('#edit-time-override', '#edit-download-limit-duration-granularity-wrapper');35 }36);37// When you change the global file expiration granularity select.38Drupal.behaviors.ucGlobalFileDownloadGranularity = function(context) {39 $('#edit-uc-file-download-limit-duration-granularity:not(.ucGlobalFileDownloadGranularity-processed)', context).addClass('ucGlobalFileDownloadGranularity-processed').change(40 function() {41 _uc_file_expiration_disable_check('#edit-uc-file-download-limit-duration-granularity', '#edit-uc-file-download-limit-duration-qty');42 }43 );44}45// When you change the per-file expiration granularity select.46Drupal.behaviors.ucFileDownloadGranularity = function(context) {47 $('#edit-download-limit-duration-granularity:not(.ucFileDownloadGranularity-processed)', context).addClass('ucFileDownloadGranularity-processed').change(48 function() {49 _uc_file_expiration_disable_check('#edit-download-limit-duration-granularity', '#edit-download-limit-duration-qty');50 }51 );52}53// When you click 'Check all' on the file action form.54Drupal.behaviors.ucFileSelectAll = function(context) {55 $('#uc_file_select_all:not(.ucFileSelectAll-processed)', context).addClass('ucFileSelectAll-processed').click(56 function() {57 $('.form-checkbox').attr('checked', true);58 }59 );60}61// When you click 'Uncheck all' on the file action form.62Drupal.behaviors.ucFileSelectNone = function(context) {63 $('#uc_file_select_none:not(.ucFileSelectNone-processed)', context).addClass('ucFileSelectNone-processed').click(64 function() {65 $('.form-checkbox').removeAttr('checked');66 }67 );68}69// When you (un)check the recursion option on the file deletion form.70Drupal.behaviors.ucFileDeleteList = function(context) {71 $('#edit-recurse-directories:not(.ucFileDeleteList-processed)', context).addClass('ucFileDeleteList-processed').change(72 function() {73 _uc_file_delete_list_populate()74 }75 );76}77/**78 * Give visual feedback to the user about download numbers.79 *80 * TODO: would be to use AJAX to get the new download key and81 * insert it into the link if the user hasn't exceeded download limits.82 * I dunno if that's technically feasible though.83 */84function uc_file_update_download(id, accessed, limit) {85 if (accessed < limit || limit == -1) {86 // Handle the max download number as well.87 var downloads = '';88 downloads += accessed + 1;89 downloads += '/';90 downloads += limit == -1 ? 'Unlimited' : limit;91 $('td#download-' + id).html(downloads);92 $('td#download-' + id).attr("onclick", "");93 }94}95Drupal.behaviors.ucFileLimitDownloads = function(context) {96 $('#edit-download-override:not(.ucFileLimitDownloads-processed)', context).addClass('ucFileLimitDownloads-processed').click(97 function() {98 toggle_limit_settings('#edit-download-override', '#edit-download-limit-number-wrapper');99 }100 );101}102Drupal.behaviors.ucFileLimitLocations = function(context) {103 $('#edit-location-override:not(.ucFileLimitLocations-processed)', context).addClass('ucFileLimitLocations-processed').click(104 function() {105 toggle_limit_settings('#edit-location-override', '#edit-download-limit-addresses-wrapper');106 }107 );108}109Drupal.behaviors.ucFileLimitTime = function(context) {110 $('#edit-time-override:not(.ucFileLimitTime-processed)', context).addClass('ucFileLimitTime-processed').click(111 function() {112 toggle_limit_settings('#edit-time-override', '#edit-download-limit-duration-qty-wrapper');113 toggle_limit_settings('#edit-time-override', '#edit-download-limit-duration-granularity-wrapper');114 }115 );116}117/**118 * Toggle the limit settings.119 */120function toggle_limit_settings(cause, effect) {121 if ($(cause).attr('checked')) {122 $(effect).show();123 }124 else {125 $(effect).hide();126 }...
uc_store.js
Source:uc_store.js
1/**2 * @file3 * Add click events to the orders table and administration dashboard.4 */5/**6 * Add the "show links" click behavior on the store admin display.7 */8Drupal.behaviors.ucStoreMoreLinks = function(context) {9 $('.uc-store-admin-panel:not(.ucStoreMoreLinks-processed)', context).addClass('ucStoreMoreLinks-processed').each(10 function() {11 var panel_id = this.id.substring(6);12 $('#show-links-' + panel_id).click(13 function() {14 var panel_id = this.id.substring(11);15 $('#panel-' + panel_id + ' .panel-links').toggle();16 if ($('#panel-' + panel_id + ' .panel-show-link').html() == '<a>' + Drupal.settings.ucTextShow + '</a>') {17 $('#panel-' + panel_id + ' .panel-show-link').html('<a>' + Drupal.settings.ucTextHide + '</a>');18 }19 else {20 $('#panel-' + panel_id + ' .panel-show-link').html('<a>' + Drupal.settings.ucTextShow + '</a>');21 }22 }23 );24 }25 );26}27/**28 * Add the double click behavior to the order table rows29 */30Drupal.behaviors.ucCustomerOrder = function(context) {31 $('.uc-customer-table tr.odd, .uc-customer-table tr.even:not(.ucCustomerOrder-processed)', context).addClass('ucCustomerOrder-processed').each(32 function() {33 $(this).dblclick(34 function() {35 window.location = Drupal.settings.basePath + '?q=admin/store/customers/orders/' + this.id.substring(9);36 }37 );38 }39 );40}41/**42 * Add the double click to the customer orders table rows.43 */44Drupal.behaviors.ucCustomerOrders = function(context) {45 $('.uc-cust-orders-table tr.odd, .uc-cust-orders-table tr.even:not(.ucCustomerOrders-processed)', context).addClass('ucCustomerOrders-processed').each(46 function() {47 $(this).dblclick(48 function() {49 window.location = Drupal.settings.basePath + '?q=admin/store/orders/' + this.id.substring(6);50 }51 );52 }53 );...
Using AI Code Generation
1var ptor = protractor.getInstance();2var searchBox = ptor.findElement(protractor.By.input('yourName'));3searchBox.sendKeys('Julie');4var greeting = ptor.findElement(protractor.By.binding('yourName'));5expect(greeting.getText()).toEqual('Hello Julie!');6var ptor = protractor.getInstance();7var searchBox = ptor.findElement(protractor.By.input('yourName'));8searchBox.sendKeys('Julie');9var greeting = ptor.findElement(protractor.By.binding('yourName'));10expect(greeting.getText()).toEqual('Hello Julie!');11var ptor = protractor.getInstance();12var searchBox = ptor.findElement(protractor.By.input('yourName'));13searchBox.sendKeys('Julie');14var greeting = ptor.findElement(protractor.By.binding('yourName'));15expect(greeting.getText()).toEqual('Hello Julie!');16var ptor = protractor.getInstance();17var searchBox = ptor.findElement(protractor.By.input('yourName'));18searchBox.sendKeys('Julie');19var greeting = ptor.findElement(protractor.By.binding('yourName'));20expect(greeting.getText()).toEqual('Hello Julie!');21var ptor = protractor.getInstance();22var searchBox = ptor.findElement(protractor.By.input('yourName'));23searchBox.sendKeys('Julie');24var greeting = ptor.findElement(protractor.By.binding('yourName'));25expect(greeting.getText()).toEqual('Hello Julie!');26var ptor = protractor.getInstance();27var searchBox = ptor.findElement(protractor.By.input('yourName'));28searchBox.sendKeys('Julie');29var greeting = ptor.findElement(protractor.By.binding('yourName'));30expect(greeting.getText()).toEqual('Hello Julie!');31var ptor = protractor.getInstance();32var searchBox = ptor.findElement(protractor.By.input('yourName'));33searchBox.sendKeys('Julie');
Using AI Code Generation
1var ptor = protractor.getInstance();2ptor.addMockModule('modName', function() {3 angular.module('modName', []).value('foo', 'bar');4});5var ptor = protractor.getInstance();6ptor.addMockModule('modName', function() {7 angular.module('modName', []).value('foo', 'bar');8});9var ptor = protractor.getInstance();10ptor.addMockModule('modName', function() {11 angular.module('modName', []).value('foo', 'bar');12});13var ptor = protractor.getInstance();14ptor.addMockModule('modName', function() {15 angular.module('modName', []).value('foo', 'bar');16});17var ptor = protractor.getInstance();18ptor.addMockModule('modName', function() {19 angular.module('modName', []).value('foo', 'bar');20});21var ptor = protractor.getInstance();22ptor.addMockModule('modName', function() {23 angular.module('modName', []).value('foo', 'bar');24});25var ptor = protractor.getInstance();26ptor.addMockModule('modName', function() {27 angular.module('modName', []).value('foo', 'bar');28});29var ptor = protractor.getInstance();30ptor.addMockModule('modName', function() {31 angular.module('modName', []).value('foo', 'bar');32});33var ptor = protractor.getInstance();34ptor.addMockModule('modName', function() {35 angular.module('modName', []).value('foo', 'bar');36});37var ptor = protractor.getInstance();38ptor.addMockModule('modName', function() {39 angular.module('modName', []).value('foo', 'bar');40});
Using AI Code Generation
1var uc = require('protractor-use-case');2var useCase = new uc.UseCase(protractor, browser);3describe('UseCase 1', function() {4 it('should open the angular js website', function() {5 });6});7describe('UseCase 2', function() {8 it('should open the angular js website', function() {9 });10});11var uc = require('protractor-use-case');12var useCase = new uc.UseCase(protractor, browser);13describe('UseCase 1', function() {14 it('should open the angular js website', function() {15 });16});17describe('UseCase 2', function() {18 it('should open the angular js website', function() {19 });20});21describe('UseCase 3', function() {22 it('should open the angular js website', function() {23 });24});25#### new UseCase(protractor, browser)26#### UseCase#openUrl(url)27#### UseCase#waitForElement(element, timeout)28#### UseCase#waitForElementToBeClickable(element
Using AI Code Generation
1var ptor = protractor.getInstance();2var uc = ptor.findElement(protractor.By.id('search')).sendKeys('test');3var ptor = protractor.getInstance();4var uc = ptor.findElement(protractor.By.id('search')).sendKeys('test');5var ptor = protractor.getInstance();6var uc = ptor.findElement(protractor.By.id('search')).sendKeys('test');7var ptor = protractor.getInstance();8var uc = ptor.findElement(protractor.By.id('search')).sendKeys('test');9var ptor = protractor.getInstance();10var uc = ptor.findElement(protractor.By.id('search')).sendKeys('test');11var ptor = protractor.getInstance();12var uc = ptor.findElement(protractor.By.id('search')).sendKeys('test');13var ptor = protractor.getInstance();14var uc = ptor.findElement(protractor.By.id('search')).sendKeys('test');15var ptor = protractor.getInstance();16var uc = ptor.findElement(protractor.By.id('search')).sendKeys('test');17var ptor = protractor.getInstance();18var uc = ptor.findElement(protractor.By.id('search')).sendKeys('test');19var ptor = protractor.getInstance();20var uc = ptor.findElement(protractor.By.id('search')).sendKeys('test');21var ptor = protractor.getInstance();22var uc = ptor.findElement(protractor.By.id('search')).sendKeys('test');23var ptor = protractor.getInstance();24var uc = ptor.findElement(protractor.By.id('search')).sendKeys('test');25var ptor = protractor.getInstance();26var uc = ptor.findElement(protractor.By.id('search')).sendKeys('test');27var ptor = protractor.getInstance();28var uc = ptor.findElement(protractor.By.id('search')).sendKeys('test');29var ptor = protractor.getInstance();
Using AI Code Generation
1var ptor = protractor.getInstance();2var uc = ptor.UC;3uc.login('admin','admin');4uc.logout();5var ptor = protractor.getInstance();6var uc = ptor.UC;7uc.login('admin','admin');8uc.logout();9var ptor = protractor.getInstance();10var uc = ptor.UC;11uc.login('admin','admin');12uc.logout();13var ptor = protractor.getInstance();14var uc = ptor.UC;15uc.login('admin','admin');16uc.logout();17var ptor = protractor.getInstance();18var uc = ptor.UC;19uc.login('admin','admin');20uc.logout();21var ptor = protractor.getInstance();22var uc = ptor.UC;23uc.login('admin','admin');24uc.logout();25var ptor = protractor.getInstance();26var uc = ptor.UC;27uc.login('admin','admin');28uc.logout();29var ptor = protractor.getInstance();30var uc = ptor.UC;31uc.login('admin','admin');32uc.logout();33var ptor = protractor.getInstance();34var uc = ptor.UC;35uc.login('admin','admin');36uc.logout();37var ptor = protractor.getInstance();38var uc = ptor.UC;39uc.login('admin','admin');40uc.logout();41var ptor = protractor.getInstance();42var uc = ptor.UC;43uc.login('admin','admin');44uc.logout();45var ptor = protractor.getInstance();46var uc = ptor.UC;47uc.login('admin','admin');48uc.logout();49var ptor = protractor.getInstance();50var uc = ptor.UC;51uc.login('admin','admin');52uc.logout();53var ptor = protractor.getInstance();54var uc = ptor.UC;
Using AI Code Generation
1var ptor = protractor.getInstance();2var uc = ptor.findElement(protractor.By.css('.ui-autocomplete'));3uc.sendKeys('a');4Error: No element found using locator: By.cssSelector(.ui-autocomplete)5You can use element.all(protractor.By.css('.ui-autocomplete')).sendKeys('a');6Error: No element found using locator: By.cssSelector(.ui-autocomplete)7Error: No element found using locator: By.cssSelector(.ui-autocomplete)8Error: No element found using locator: By.cssSelector(.ui-autocomplete)9Error: No element found using locator: By.cssSelector(.ui-autocomplete)10Error: No element found using locator: By.cssSelector(.ui-autocomplete)11Error: No element found using locator: By.cssSelector(.ui-autocomplete)
Protractor is developed by Google Developers to test Angular and AngularJS code. Today, it is used to test non-Angular applications as well. It performs a real-world user-like test against your application in a real browser. It comes under an end-to-end testing framework. As of now, Selenium Protractor has proved to be a popular framework for end-to-end automation for AngularJS.
Let’s talk about what it does:
Protractor is a JavaScript framework, end-to-end test automation framework for Angular and AngularJS applications.
Protractor Selenium provides new locator methods that actually make it easier to find elements in the DOM.
Two files are required to execute Protractor Selenium tests for end-to-end automation: Specs & Config. Go through the link above to understand in a better way.
To carry out extensive, automated cross browser testing, you can't imagine installing thousands of the available browsers on your own workstation. The only way to increase browser usage is through remote execution on the cloud. To execute your automation test scripts across a variety of platforms and browser versions, LambdaTest offers more than 3000 browsers.
We recommend Selenium for end-to-end automation for AngularJS because both are maintained and owned by Google, and they build JavaScript test automation framework to handle AngularJS components in a way that better matches how developers use it.
For scripting, selenium locators are essential since if they're off, your automation scripts won't run. Therefore, in any testing framework, these Selenium locators are the foundation of your Selenium test automation efforts.
To make sure that your Selenium automation tests function as intended, debugging can be an effective option. Check the blog to know more.
If you are not familiar with writing Selenium test automation on Protractor, here is a blog for you to get you understand in depth.
Selenium tests are asynchronous and there are various reasons for a timeout to occur in a Protractor test. Find out how to handle timeouts in this Protractor tutorial.
In this Protractor tutorial, learn how to handle frames or iframes in Selenium with Protractor for automated browser testing.
Handle alerts and popups in Protractor more efficiently. It can be confusing. Here's a simple guide to understand how to handle alerts and popups in Selenium.
Get 100 minutes of automation test minutes FREE!!