Best JavaScript code snippet using playwright-internal
RendererProxy.js
Source:RendererProxy.js
1"use strict";2/*3 Copyright (C) 2012-2015 Grant Galitz4 5 Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:6 7 The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.8 9 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.10 */11function GameBoyAdvanceRendererProxy(IOCore) {12 //Build references:13 this.IOCore = IOCore;14}15GameBoyAdvanceRendererProxy.prototype.initialize = function () {16 this.IOData8 = getUint8Array(20);17 this.IOData16 = getUint16View(this.IOData8);18 this.IOData32 = getInt32View(this.IOData8);19 this.gfxState = this.IOCore.gfxState;20 this.renderer = new GameBoyAdvanceGraphicsRenderer(this.IOCore.coreExposed, !this.IOCore.BIOSFound || this.IOCore.settings.SKIPBoot);21}22GameBoyAdvanceRendererProxy.prototype.incrementScanLineQueue = function () {23 this.renderer.incrementScanLineQueue();24}25GameBoyAdvanceRendererProxy.prototype.ensureFraming = function () {26 this.renderer.ensureFraming();27}28GameBoyAdvanceRendererProxy.prototype.writeDISPCNT8_0 = function (data) {29 data = data | 0;30 data = data & 0xF7;31 this.IOCore.updateGraphicsClocking();32 this.IOData8[0] = data | 0;33 this.renderer.writeDISPCNT8_0(data | 0);34 this.gfxState.isRenderingCheckPreprocess();35}36GameBoyAdvanceRendererProxy.prototype.readDISPCNT8_0 = function () {37 return this.IOData8[0] | 0;38}39GameBoyAdvanceRendererProxy.prototype.writeDISPCNT8_1 = function (data) {40 data = data | 0;41 data = data & 0xFF;42 this.IOCore.updateGraphicsClocking();43 this.IOData8[1] = data | 0;44 this.renderer.writeDISPCNT8_1(data | 0);45}46GameBoyAdvanceRendererProxy.prototype.readDISPCNT8_1 = function () {47 return this.IOData8[1] | 0;48}49GameBoyAdvanceRendererProxy.prototype.writeDISPCNT8_2 = function (data) {50 data = data | 0;51 data = data & 0x1;52 this.IOCore.updateGraphicsClocking();53 this.IOData8[2] = data | 0;54 this.renderer.writeDISPCNT8_2(data | 0);55}56GameBoyAdvanceRendererProxy.prototype.readDISPCNT8_2 = function () {57 return this.IOData8[2] | 0;58}59if (__LITTLE_ENDIAN__) {60 GameBoyAdvanceRendererProxy.prototype.writeDISPCNT16 = function (data) {61 data = data | 0;62 data = data & 0xFFF7;63 this.IOCore.updateGraphicsClocking();64 this.IOData16[0] = data | 0;65 this.renderer.writeDISPCNT16(data | 0);66 this.gfxState.isRenderingCheckPreprocess();67 }68 GameBoyAdvanceRendererProxy.prototype.readDISPCNT16 = function () {69 return this.IOData16[0] | 0;70 }71 GameBoyAdvanceRendererProxy.prototype.writeDISPCNT32 = function (data) {72 data = data | 0;73 data = data & 0x1FFF7;74 this.IOCore.updateGraphicsClocking();75 this.IOData32[0] = data | 0;76 this.renderer.writeDISPCNT32(data | 0);77 this.gfxState.isRenderingCheckPreprocess();78 }79 GameBoyAdvanceRendererProxy.prototype.readDISPCNT32 = function () {80 return this.IOData32[0] | 0;81 }82}83else {84 GameBoyAdvanceRendererProxy.prototype.writeDISPCNT16 = function (data) {85 data = data | 0;86 data = data & 0xFFF7;87 this.IOCore.updateGraphicsClocking();88 this.IOData8[0] = data & 0xF7;89 this.IOData8[1] = data >> 8;90 this.renderer.writeDISPCNT16(data | 0);91 this.gfxState.isRenderingCheckPreprocess();92 }93 GameBoyAdvanceRendererProxy.prototype.readDISPCNT16 = function () {94 return this.IOData8[0] | (this.IOData8[1] << 8);95 }96 GameBoyAdvanceRendererProxy.prototype.writeDISPCNT32 = function (data) {97 data = data | 0;98 data = data & 0x1FFF7;99 this.IOCore.updateGraphicsClocking();100 this.IOData8[0] = data & 0xF7;101 this.IOData8[1] = (data >> 8) & 0xFF;102 this.IOData8[2] = data >> 16;103 this.renderer.writeDISPCNT32(data | 0);104 this.gfxState.isRenderingCheckPreprocess();105 }106 GameBoyAdvanceRendererProxy.prototype.readDISPCNT32 = function () {107 return this.IOData8[0] | (this.IOData8[1] << 8) | (this.IOData8[2] << 16);108 }109}110GameBoyAdvanceRendererProxy.prototype.writeBG0CNT8_0 = function (data) {111 data = data | 0;112 data = data & 0xCF;113 this.IOCore.updateGraphicsClocking();114 this.IOData8[4] = data | 0;115 this.renderer.writeBG0CNT8_0(data | 0);116}117GameBoyAdvanceRendererProxy.prototype.readBG0CNT8_0 = function () {118 return this.IOData8[4] | 0;119}120GameBoyAdvanceRendererProxy.prototype.writeBG0CNT8_1 = function (data) {121 data = data | 0;122 data = data & 0xFF;123 this.IOCore.updateGraphicsClocking();124 this.IOData8[5] = data | 0;125 this.renderer.writeBG0CNT8_1(data | 0);126}127GameBoyAdvanceRendererProxy.prototype.readBG0CNT8_1 = function () {128 return this.IOData8[5] | 0;129}130GameBoyAdvanceRendererProxy.prototype.writeBG1CNT8_0 = function (data) {131 data = data | 0;132 data = data & 0xCF;133 this.IOCore.updateGraphicsClocking();134 this.IOData8[6] = data | 0;135 this.renderer.writeBG1CNT8_0(data | 0);136}137GameBoyAdvanceRendererProxy.prototype.readBG1CNT8_0 = function () {138 return this.IOData8[6] | 0;139}140GameBoyAdvanceRendererProxy.prototype.writeBG1CNT8_1 = function (data) {141 data = data | 0;142 data = data & 0xFF;143 this.IOCore.updateGraphicsClocking();144 this.IOData8[7] = data | 0;145 this.renderer.writeBG1CNT8_1(data | 0);146}147GameBoyAdvanceRendererProxy.prototype.readBG1CNT8_1 = function () {148 return this.IOData8[7] | 0;149}150if (__LITTLE_ENDIAN__) {151 GameBoyAdvanceRendererProxy.prototype.writeBG0CNT16 = function (data) {152 data = data | 0;153 data = data & 0xFFCF;154 this.IOCore.updateGraphicsClocking();155 this.IOData16[2] = data | 0;156 this.renderer.writeBG0CNT16(data | 0);157 }158 GameBoyAdvanceRendererProxy.prototype.writeBG1CNT16 = function (data) {159 data = data | 0;160 data = data & 0xFFCF;161 this.IOCore.updateGraphicsClocking();162 this.IOData16[3] = data | 0;163 this.renderer.writeBG1CNT16(data | 0);164 }165 GameBoyAdvanceRendererProxy.prototype.writeBG0BG1CNT32 = function (data) {166 data = data | 0;167 data = data & 0xFFCFFFCF;168 this.IOCore.updateGraphicsClocking();169 this.IOData32[1] = data | 0;170 this.renderer.writeBG0BG1CNT32(data | 0);171 }172 GameBoyAdvanceRendererProxy.prototype.readBG0CNT16 = function () {173 return this.IOData16[2] | 0;174 }175 GameBoyAdvanceRendererProxy.prototype.readBG1CNT16 = function () {176 return this.IOData16[3] | 0;177 }178 GameBoyAdvanceRendererProxy.prototype.readBG0BG1CNT32 = function () {179 return this.IOData32[1] | 0;180 }181}182else {183 GameBoyAdvanceRendererProxy.prototype.writeBG0CNT16 = function (data) {184 data = data | 0;185 data = data & 0xFFCF;186 this.IOCore.updateGraphicsClocking();187 this.IOData8[4] = data & 0xFF;188 this.IOData8[5] = data >> 8;189 this.renderer.writeBG0CNT16(data | 0);190 }191 GameBoyAdvanceRendererProxy.prototype.writeBG1CNT16 = function (data) {192 data = data | 0;193 data = data & 0xFFCF;194 this.IOCore.updateGraphicsClocking();195 this.IOData8[6] = data & 0xFF;196 this.IOData8[7] = data >> 8;197 this.renderer.writeBG1CNT16(data | 0);198 }199 GameBoyAdvanceRendererProxy.prototype.writeBG0BG1CNT32 = function (data) {200 data = data | 0;201 data = data & 0xFFCFFFCF;202 this.IOCore.updateGraphicsClocking();203 this.IOData8[4] = data & 0xFF;204 this.IOData8[5] = (data >> 8) & 0xFF;205 this.IOData8[6] = (data >> 16) & 0xFF;206 this.IOData8[7] = data >>> 24;207 this.renderer.writeBG0BG1CNT32(data | 0);208 }209 GameBoyAdvanceRendererProxy.prototype.readBG0CNT16 = function () {210 return this.IOData8[4] | (this.IOData8[5] << 8);211 }212 GameBoyAdvanceRendererProxy.prototype.readBG1CNT16 = function () {213 return this.IOData8[6] | (this.IOData8[7] << 8);214 }215 GameBoyAdvanceRendererProxy.prototype.readBG0BG1CNT32 = function () {216 return this.IOData8[4] | (this.IOData8[5] << 8) | (this.IOData8[6] << 16) | (this.IOData8[7] << 24);217 }218}219GameBoyAdvanceRendererProxy.prototype.writeBG2CNT8_0 = function (data) {220 data = data | 0;221 data = data & 0xCF;222 this.IOCore.updateGraphicsClocking();223 this.IOData8[8] = data | 0;224 this.renderer.writeBG2CNT8_0(data | 0);225}226GameBoyAdvanceRendererProxy.prototype.readBG2CNT8_0 = function () {227 return this.IOData8[8] | 0;228}229GameBoyAdvanceRendererProxy.prototype.writeBG2CNT8_1 = function (data) {230 data = data | 0;231 data = data & 0xFF;232 this.IOCore.updateGraphicsClocking();233 this.IOData8[9] = data | 0;234 this.renderer.writeBG2CNT8_1(data | 0);235}236GameBoyAdvanceRendererProxy.prototype.readBG2CNT8_1 = function () {237 return this.IOData8[9] | 0;238}239GameBoyAdvanceRendererProxy.prototype.writeBG3CNT8_0 = function (data) {240 data = data | 0;241 data = data & 0xCF;242 this.IOCore.updateGraphicsClocking();243 this.IOData8[10] = data | 0;244 this.renderer.writeBG3CNT8_0(data | 0);245}246GameBoyAdvanceRendererProxy.prototype.readBG3CNT8_0 = function () {247 return this.IOData8[10] | 0;248}249GameBoyAdvanceRendererProxy.prototype.writeBG3CNT8_1 = function (data) {250 data = data | 0;251 data = data & 0xFF;252 this.IOCore.updateGraphicsClocking();253 this.IOData8[11] = data | 0;254 this.renderer.writeBG3CNT8_1(data | 0);255}256GameBoyAdvanceRendererProxy.prototype.readBG3CNT8_1 = function () {257 return this.IOData8[11] | 0;258}259if (__LITTLE_ENDIAN__) {260 GameBoyAdvanceRendererProxy.prototype.writeBG2CNT16 = function (data) {261 data = data | 0;262 data = data & 0xFFCF;263 this.IOCore.updateGraphicsClocking();264 this.IOData16[4] = data | 0;265 this.renderer.writeBG2CNT16(data | 0);266 }267 GameBoyAdvanceRendererProxy.prototype.writeBG3CNT16 = function (data) {268 data = data | 0;269 data = data & 0xFFCF;270 this.IOCore.updateGraphicsClocking();271 this.IOData16[5] = data | 0;272 this.renderer.writeBG3CNT16(data | 0);273 }274 GameBoyAdvanceRendererProxy.prototype.writeBG2BG3CNT32 = function (data) {275 data = data | 0;276 data = data & 0xFFCFFFCF;277 this.IOCore.updateGraphicsClocking();278 this.IOData32[2] = data | 0;279 this.renderer.writeBG2BG3CNT32(data | 0);280 }281 GameBoyAdvanceRendererProxy.prototype.readBG2CNT16 = function () {282 return this.IOData16[4] | 0;283 }284 GameBoyAdvanceRendererProxy.prototype.readBG3CNT16 = function () {285 return this.IOData16[5] | 0;286 }287 GameBoyAdvanceRendererProxy.prototype.readBG2BG3CNT32 = function () {288 return this.IOData32[2] | 0;289 }290}291else {292 GameBoyAdvanceRendererProxy.prototype.writeBG2CNT16 = function (data) {293 data = data | 0;294 data = data & 0xFFCF;295 this.IOCore.updateGraphicsClocking();296 this.IOData8[8] = data & 0xFF;297 this.IOData8[9] = data >> 8;298 this.renderer.writeBG2CNT16(data | 0);299 }300 GameBoyAdvanceRendererProxy.prototype.writeBG3CNT16 = function (data) {301 data = data | 0;302 data = data & 0xFFCF;303 this.IOCore.updateGraphicsClocking();304 this.IOData8[10] = data & 0xFF;305 this.IOData8[11] = data >> 8;306 this.renderer.writeBG3CNT16(data | 0);307 }308 GameBoyAdvanceRendererProxy.prototype.writeBG2BG3CNT32 = function (data) {309 data = data | 0;310 data = data & 0xFFCFFFCF;311 this.IOCore.updateGraphicsClocking();312 this.IOData8[8] = data & 0xFF;313 this.IOData8[9] = (data >> 8) & 0xFF;314 this.IOData8[10] = (data >> 16) & 0xFF;315 this.IOData8[11] = data >>> 24;316 this.renderer.writeBG2BG3CNT32(data | 0);317 }318 GameBoyAdvanceRendererProxy.prototype.readBG2CNT16 = function () {319 return this.IOData8[8] | (this.IOData8[9] << 8);320 }321 GameBoyAdvanceRendererProxy.prototype.readBG3CNT16 = function () {322 return this.IOData8[10] | (this.IOData8[11] << 8);323 }324 GameBoyAdvanceRendererProxy.prototype.readBG2BG3CNT32 = function () {325 return this.IOData8[8] | (this.IOData8[9] << 8) | (this.IOData8[10] << 16) | (this.IOData8[11] << 24);326 }327}328GameBoyAdvanceRendererProxy.prototype.writeBG0HOFS8_0 = function (data) {329 data = data | 0;330 data = data & 0xFF;331 this.IOCore.updateGraphicsClocking();332 this.renderer.writeBG0HOFS8_0(data | 0);333}334GameBoyAdvanceRendererProxy.prototype.writeBG0HOFS8_1 = function (data) {335 data = data | 0;336 data = data & 0x1;337 this.IOCore.updateGraphicsClocking();338 this.renderer.writeBG0HOFS8_1(data | 0);339}340GameBoyAdvanceRendererProxy.prototype.writeBG0HOFS16 = function (data) {341 data = data | 0;342 data = data & 0x1FF;343 this.IOCore.updateGraphicsClocking();344 this.renderer.writeBG0HOFS16(data | 0);345}346GameBoyAdvanceRendererProxy.prototype.writeBG0VOFS8_0 = function (data) {347 data = data | 0;348 data = data & 0xFF;349 this.IOCore.updateGraphicsClocking();350 this.renderer.writeBG0VOFS8_0(data | 0);351}352GameBoyAdvanceRendererProxy.prototype.writeBG0VOFS8_1 = function (data) {353 data = data | 0;354 data = data & 0x1;355 this.IOCore.updateGraphicsClocking();356 this.renderer.writeBG0VOFS8_1(data | 0);357}358GameBoyAdvanceRendererProxy.prototype.writeBG0VOFS16 = function (data) {359 data = data | 0;360 data = data & 0x1FF;361 this.IOCore.updateGraphicsClocking();362 this.renderer.writeBG0VOFS16(data | 0);363}364GameBoyAdvanceRendererProxy.prototype.writeBG0OFS32 = function (data) {365 data = data | 0;366 data = data & 0x1FF01FF;367 this.IOCore.updateGraphicsClocking();368 this.renderer.writeBG0OFS32(data | 0);369}370GameBoyAdvanceRendererProxy.prototype.writeBG1HOFS8_0 = function (data) {371 data = data | 0;372 data = data & 0xFF;373 this.IOCore.updateGraphicsClocking();374 this.renderer.writeBG1HOFS8_0(data | 0);375}376GameBoyAdvanceRendererProxy.prototype.writeBG1HOFS8_1 = function (data) {377 data = data | 0;378 data = data & 0x1;379 this.IOCore.updateGraphicsClocking();380 this.renderer.writeBG1HOFS8_1(data | 0);381}382GameBoyAdvanceRendererProxy.prototype.writeBG1HOFS16 = function (data) {383 data = data | 0;384 data = data & 0x1FF;385 this.IOCore.updateGraphicsClocking();386 this.renderer.writeBG1HOFS16(data | 0);387}388GameBoyAdvanceRendererProxy.prototype.writeBG1VOFS8_0 = function (data) {389 data = data | 0;390 data = data & 0xFF;391 this.IOCore.updateGraphicsClocking();392 this.renderer.writeBG1VOFS8_0(data | 0);393}394GameBoyAdvanceRendererProxy.prototype.writeBG1VOFS8_1 = function (data) {395 data = data | 0;396 data = data & 0x1;397 this.IOCore.updateGraphicsClocking();398 this.renderer.writeBG1VOFS8_1(data | 0);399}400GameBoyAdvanceRendererProxy.prototype.writeBG1VOFS16 = function (data) {401 data = data | 0;402 data = data & 0x1FF;403 this.IOCore.updateGraphicsClocking();404 this.renderer.writeBG1VOFS16(data | 0);405}406GameBoyAdvanceRendererProxy.prototype.writeBG1OFS32 = function (data) {407 data = data | 0;408 data = data & 0x1FF01FF;409 this.IOCore.updateGraphicsClocking();410 this.renderer.writeBG1OFS32(data | 0);411}412GameBoyAdvanceRendererProxy.prototype.writeBG2HOFS8_0 = function (data) {413 data = data | 0;414 data = data & 0xFF;415 this.IOCore.updateGraphicsClocking();416 this.renderer.writeBG2HOFS8_0(data | 0);417}418GameBoyAdvanceRendererProxy.prototype.writeBG2HOFS8_1 = function (data) {419 data = data | 0;420 data = data & 0x1;421 this.IOCore.updateGraphicsClocking();422 this.renderer.writeBG2HOFS8_1(data | 0);423}424GameBoyAdvanceRendererProxy.prototype.writeBG2HOFS16 = function (data) {425 data = data | 0;426 data = data & 0x1FF;427 this.IOCore.updateGraphicsClocking();428 this.renderer.writeBG2HOFS16(data | 0);429}430GameBoyAdvanceRendererProxy.prototype.writeBG2VOFS8_0 = function (data) {431 data = data | 0;432 data = data & 0xFF;433 this.IOCore.updateGraphicsClocking();434 this.renderer.writeBG2VOFS8_0(data | 0);435}436GameBoyAdvanceRendererProxy.prototype.writeBG2VOFS8_1 = function (data) {437 data = data | 0;438 data = data & 0x1;439 this.IOCore.updateGraphicsClocking();440 this.renderer.writeBG2VOFS8_1(data | 0);441}442GameBoyAdvanceRendererProxy.prototype.writeBG2VOFS16 = function (data) {443 data = data | 0;444 data = data & 0x1FF;445 this.IOCore.updateGraphicsClocking();446 this.renderer.writeBG2VOFS16(data | 0);447}448GameBoyAdvanceRendererProxy.prototype.writeBG2OFS32 = function (data) {449 data = data | 0;450 data = data & 0x1FF01FF;451 this.IOCore.updateGraphicsClocking();452 this.renderer.writeBG2OFS32(data | 0);453}454GameBoyAdvanceRendererProxy.prototype.writeBG3HOFS8_0 = function (data) {455 data = data | 0;456 data = data & 0xFF;457 this.IOCore.updateGraphicsClocking();458 this.renderer.writeBG3HOFS8_0(data | 0);459}460GameBoyAdvanceRendererProxy.prototype.writeBG3HOFS8_1 = function (data) {461 data = data | 0;462 data = data & 0x1;463 this.IOCore.updateGraphicsClocking();464 this.renderer.writeBG3HOFS8_1(data | 0);465}466GameBoyAdvanceRendererProxy.prototype.writeBG3HOFS16 = function (data) {467 data = data | 0;468 data = data & 0x1FF;469 this.IOCore.updateGraphicsClocking();470 this.renderer.writeBG3HOFS16(data | 0);471}472GameBoyAdvanceRendererProxy.prototype.writeBG3VOFS8_0 = function (data) {473 data = data | 0;474 data = data & 0xFF;475 this.IOCore.updateGraphicsClocking();476 this.renderer.writeBG3VOFS8_0(data | 0);477}478GameBoyAdvanceRendererProxy.prototype.writeBG3VOFS8_1 = function (data) {479 data = data | 0;480 data = data & 0x1;481 this.IOCore.updateGraphicsClocking();482 this.renderer.writeBG3VOFS8_1(data | 0);483}484GameBoyAdvanceRendererProxy.prototype.writeBG3VOFS16 = function (data) {485 data = data | 0;486 data = data & 0x1FF;487 this.IOCore.updateGraphicsClocking();488 this.renderer.writeBG3VOFS16(data | 0);489}490GameBoyAdvanceRendererProxy.prototype.writeBG3OFS32 = function (data) {491 data = data | 0;492 data = data & 0x1FF01FF;493 this.IOCore.updateGraphicsClocking();494 this.renderer.writeBG3OFS32(data | 0);495}496GameBoyAdvanceRendererProxy.prototype.writeBG2PA8_0 = function (data) {497 data = data | 0;498 data = data & 0xFF;499 this.IOCore.updateGraphicsClocking();500 this.renderer.writeBG2PA8_0(data | 0);501}502GameBoyAdvanceRendererProxy.prototype.writeBG2PA8_1 = function (data) {503 data = data | 0;504 data = data & 0xFF;505 this.IOCore.updateGraphicsClocking();506 this.renderer.writeBG2PA8_1(data | 0);507}508GameBoyAdvanceRendererProxy.prototype.writeBG2PA16 = function (data) {509 data = data | 0;510 data = data & 0xFFFF;511 this.IOCore.updateGraphicsClocking();512 this.renderer.writeBG2PA16(data | 0);513}514GameBoyAdvanceRendererProxy.prototype.writeBG2PB8_0 = function (data) {515 data = data | 0;516 data = data & 0xFF;517 this.IOCore.updateGraphicsClocking();518 this.renderer.writeBG2PB8_0(data | 0);519}520GameBoyAdvanceRendererProxy.prototype.writeBG2PB8_1 = function (data) {521 data = data | 0;522 data = data & 0xFF;523 this.IOCore.updateGraphicsClocking();524 this.renderer.writeBG2PB8_1(data | 0);525}526GameBoyAdvanceRendererProxy.prototype.writeBG2PB16 = function (data) {527 data = data | 0;528 data = data & 0xFFFF;529 this.IOCore.updateGraphicsClocking();530 this.renderer.writeBG2PB16(data | 0);531}532GameBoyAdvanceRendererProxy.prototype.writeBG2PAB32 = function (data) {533 data = data | 0;534 this.IOCore.updateGraphicsClocking();535 this.renderer.writeBG2PAB32(data | 0);536}537GameBoyAdvanceRendererProxy.prototype.writeBG2PC8_0 = function (data) {538 data = data | 0;539 data = data & 0xFF;540 this.IOCore.updateGraphicsClocking();541 this.renderer.writeBG2PC8_0(data | 0);542}543GameBoyAdvanceRendererProxy.prototype.writeBG2PC8_1 = function (data) {544 data = data | 0;545 data = data & 0xFF;546 this.IOCore.updateGraphicsClocking();547 this.renderer.writeBG2PC8_1(data | 0);548}549GameBoyAdvanceRendererProxy.prototype.writeBG2PC16 = function (data) {550 data = data | 0;551 data = data & 0xFFFF;552 this.IOCore.updateGraphicsClocking();553 this.renderer.writeBG2PC16(data | 0);554}555GameBoyAdvanceRendererProxy.prototype.writeBG2PD8_0 = function (data) {556 data = data | 0;557 data = data & 0xFF;558 this.IOCore.updateGraphicsClocking();559 this.renderer.writeBG2PD8_0(data | 0);560}561GameBoyAdvanceRendererProxy.prototype.writeBG2PD8_1 = function (data) {562 data = data | 0;563 data = data & 0xFF;564 this.IOCore.updateGraphicsClocking();565 this.renderer.writeBG2PD8_1(data | 0);566}567GameBoyAdvanceRendererProxy.prototype.writeBG2PD16 = function (data) {568 data = data | 0;569 data = data & 0xFFFF;570 this.IOCore.updateGraphicsClocking();571 this.renderer.writeBG2PD16(data | 0);572}573GameBoyAdvanceRendererProxy.prototype.writeBG2PCD32 = function (data) {574 data = data | 0;575 this.IOCore.updateGraphicsClocking();576 this.renderer.writeBG2PCD32(data | 0);577}578GameBoyAdvanceRendererProxy.prototype.writeBG3PA8_0 = function (data) {579 data = data | 0;580 data = data & 0xFF;581 this.IOCore.updateGraphicsClocking();582 this.renderer.writeBG3PA8_0(data | 0);583}584GameBoyAdvanceRendererProxy.prototype.writeBG3PA8_1 = function (data) {585 data = data | 0;586 data = data & 0xFF;587 this.IOCore.updateGraphicsClocking();588 this.renderer.writeBG3PA8_1(data | 0);589}590GameBoyAdvanceRendererProxy.prototype.writeBG3PA16 = function (data) {591 data = data | 0;592 data = data & 0xFFFF;593 this.IOCore.updateGraphicsClocking();594 this.renderer.writeBG3PA16(data | 0);595}596GameBoyAdvanceRendererProxy.prototype.writeBG3PB8_0 = function (data) {597 data = data | 0;598 data = data & 0xFF;599 this.IOCore.updateGraphicsClocking();600 this.renderer.writeBG3PB8_0(data | 0);601}602GameBoyAdvanceRendererProxy.prototype.writeBG3PB8_1 = function (data) {603 data = data | 0;604 data = data & 0xFF;605 this.IOCore.updateGraphicsClocking();606 this.renderer.writeBG3PB8_1(data | 0);607}608GameBoyAdvanceRendererProxy.prototype.writeBG3PB16 = function (data) {609 data = data | 0;610 data = data & 0xFFFF;611 this.IOCore.updateGraphicsClocking();612 this.renderer.writeBG3PB16(data | 0);613}614GameBoyAdvanceRendererProxy.prototype.writeBG3PAB32 = function (data) {615 data = data | 0;616 this.IOCore.updateGraphicsClocking();617 this.renderer.writeBG3PAB32(data | 0);618}619GameBoyAdvanceRendererProxy.prototype.writeBG3PC8_0 = function (data) {620 data = data | 0;621 data = data & 0xFF;622 this.IOCore.updateGraphicsClocking();623 this.renderer.writeBG3PC8_0(data | 0);624}625GameBoyAdvanceRendererProxy.prototype.writeBG3PC8_1 = function (data) {626 data = data | 0;627 data = data & 0xFF;628 this.IOCore.updateGraphicsClocking();629 this.renderer.writeBG3PC8_1(data | 0);630}631GameBoyAdvanceRendererProxy.prototype.writeBG3PC16 = function (data) {632 data = data | 0;633 data = data & 0xFFFF;634 this.IOCore.updateGraphicsClocking();635 this.renderer.writeBG3PC16(data | 0);636}637GameBoyAdvanceRendererProxy.prototype.writeBG3PD8_0 = function (data) {638 data = data | 0;639 data = data & 0xFF;640 this.IOCore.updateGraphicsClocking();641 this.renderer.writeBG3PD8_0(data | 0);642}643GameBoyAdvanceRendererProxy.prototype.writeBG3PD8_1 = function (data) {644 data = data | 0;645 data = data & 0xFF;646 this.IOCore.updateGraphicsClocking();647 this.renderer.writeBG3PD8_1(data | 0);648}649GameBoyAdvanceRendererProxy.prototype.writeBG3PD16 = function (data) {650 data = data | 0;651 data = data & 0xFFFF;652 this.IOCore.updateGraphicsClocking();653 this.renderer.writeBG3PD16(data | 0);654}655GameBoyAdvanceRendererProxy.prototype.writeBG3PCD32 = function (data) {656 data = data | 0;657 this.IOCore.updateGraphicsClocking();658 this.renderer.writeBG3PCD32(data | 0);659}660GameBoyAdvanceRendererProxy.prototype.writeBG2X8_0 = function (data) {661 data = data | 0;662 data = data & 0xFF;663 this.IOCore.updateGraphicsClocking();664 this.renderer.writeBG2X8_0(data | 0);665}666GameBoyAdvanceRendererProxy.prototype.writeBG2X8_1 = function (data) {667 data = data | 0;668 data = data & 0xFF;669 this.IOCore.updateGraphicsClocking();670 this.renderer.writeBG2X8_1(data | 0);671}672GameBoyAdvanceRendererProxy.prototype.writeBG2X8_2 = function (data) {673 data = data | 0;674 data = data & 0xFF;675 this.IOCore.updateGraphicsClocking();676 this.renderer.writeBG2X8_2(data | 0);677}678GameBoyAdvanceRendererProxy.prototype.writeBG2X8_3 = function (data) {679 data = data | 0;680 data = data & 0xFF;681 this.IOCore.updateGraphicsClocking();682 this.renderer.writeBG2X8_3(data | 0);683}684GameBoyAdvanceRendererProxy.prototype.writeBG2X16_0 = function (data) {685 data = data | 0;686 data = data & 0xFFFF;687 this.IOCore.updateGraphicsClocking();688 this.renderer.writeBG2X16_0(data | 0);689}690GameBoyAdvanceRendererProxy.prototype.writeBG2X16_1 = function (data) {691 data = data | 0;692 data = data & 0xFFFF;693 this.IOCore.updateGraphicsClocking();694 this.renderer.writeBG2X16_1(data | 0);695}696GameBoyAdvanceRendererProxy.prototype.writeBG2X32 = function (data) {697 data = data | 0;698 this.IOCore.updateGraphicsClocking();699 this.renderer.writeBG2X32(data | 0);700}701GameBoyAdvanceRendererProxy.prototype.writeBG2Y8_0 = function (data) {702 data = data | 0;703 data = data & 0xFF;704 this.IOCore.updateGraphicsClocking();705 this.renderer.writeBG2Y8_0(data | 0);706}707GameBoyAdvanceRendererProxy.prototype.writeBG2Y8_1 = function (data) {708 data = data | 0;709 data = data & 0xFF;710 this.IOCore.updateGraphicsClocking();711 this.renderer.writeBG2Y8_1(data | 0);712}713GameBoyAdvanceRendererProxy.prototype.writeBG2Y8_2 = function (data) {714 data = data | 0;715 data = data & 0xFF;716 this.IOCore.updateGraphicsClocking();717 this.renderer.writeBG2Y8_2(data | 0);718}719GameBoyAdvanceRendererProxy.prototype.writeBG2Y8_3 = function (data) {720 data = data | 0;721 data = data & 0xFF;722 this.IOCore.updateGraphicsClocking();723 this.renderer.writeBG2Y8_3(data | 0);724}725GameBoyAdvanceRendererProxy.prototype.writeBG2Y16_0 = function (data) {726 data = data | 0;727 data = data & 0xFFFF;728 this.IOCore.updateGraphicsClocking();729 this.renderer.writeBG2Y16_0(data | 0);730}731GameBoyAdvanceRendererProxy.prototype.writeBG2Y16_1 = function (data) {732 data = data | 0;733 data = data & 0xFFFF;734 this.IOCore.updateGraphicsClocking();735 this.renderer.writeBG2Y16_1(data | 0);736}737GameBoyAdvanceRendererProxy.prototype.writeBG2Y32 = function (data) {738 data = data | 0;739 this.IOCore.updateGraphicsClocking();740 this.renderer.writeBG2Y32(data | 0);741}742GameBoyAdvanceRendererProxy.prototype.writeBG3X8_0 = function (data) {743 data = data | 0;744 data = data & 0xFF;745 this.IOCore.updateGraphicsClocking();746 this.renderer.writeBG3X8_0(data | 0);747}748GameBoyAdvanceRendererProxy.prototype.writeBG3X8_1 = function (data) {749 data = data | 0;750 data = data & 0xFF;751 this.IOCore.updateGraphicsClocking();752 this.renderer.writeBG3X8_1(data | 0);753}754GameBoyAdvanceRendererProxy.prototype.writeBG3X8_2 = function (data) {755 data = data | 0;756 data = data & 0xFF;757 this.IOCore.updateGraphicsClocking();758 this.renderer.writeBG3X8_2(data | 0);759}760GameBoyAdvanceRendererProxy.prototype.writeBG3X8_3 = function (data) {761 data = data | 0;762 data = data & 0xFF;763 this.IOCore.updateGraphicsClocking();764 this.renderer.writeBG3X8_3(data | 0);765}766GameBoyAdvanceRendererProxy.prototype.writeBG3X16_0 = function (data) {767 data = data | 0;768 data = data & 0xFFFF;769 this.IOCore.updateGraphicsClocking();770 this.renderer.writeBG3X16_0(data | 0);771}772GameBoyAdvanceRendererProxy.prototype.writeBG3X16_1 = function (data) {773 data = data | 0;774 data = data & 0xFFFF;775 this.IOCore.updateGraphicsClocking();776 this.renderer.writeBG3X16_1(data | 0);777}778GameBoyAdvanceRendererProxy.prototype.writeBG3X32 = function (data) {779 data = data | 0;780 this.IOCore.updateGraphicsClocking();781 this.renderer.writeBG3X32(data | 0);782}783GameBoyAdvanceRendererProxy.prototype.writeBG3Y8_0 = function (data) {784 data = data | 0;785 data = data & 0xFF;786 this.IOCore.updateGraphicsClocking();787 this.renderer.writeBG3Y8_0(data | 0);788}789GameBoyAdvanceRendererProxy.prototype.writeBG3Y8_1 = function (data) {790 data = data | 0;791 data = data & 0xFF;792 this.IOCore.updateGraphicsClocking();793 this.renderer.writeBG3Y8_1(data | 0);794}795GameBoyAdvanceRendererProxy.prototype.writeBG3Y8_2 = function (data) {796 data = data | 0;797 data = data & 0xFF;798 this.IOCore.updateGraphicsClocking();799 this.renderer.writeBG3Y8_2(data | 0);800}801GameBoyAdvanceRendererProxy.prototype.writeBG3Y8_3 = function (data) {802 data = data | 0;803 data = data & 0xFF;804 this.IOCore.updateGraphicsClocking();805 this.renderer.writeBG3Y8_3(data | 0);806}807GameBoyAdvanceRendererProxy.prototype.writeBG3Y16_0 = function (data) {808 data = data | 0;809 data = data & 0xFFFF;810 this.IOCore.updateGraphicsClocking();811 this.renderer.writeBG3Y16_0(data | 0);812}813GameBoyAdvanceRendererProxy.prototype.writeBG3Y16_1 = function (data) {814 data = data | 0;815 data = data & 0xFFFF;816 this.IOCore.updateGraphicsClocking();817 this.renderer.writeBG3Y16_1(data | 0);818}819GameBoyAdvanceRendererProxy.prototype.writeBG3Y32 = function (data) {820 data = data | 0;821 this.IOCore.updateGraphicsClocking();822 this.renderer.writeBG3Y32(data | 0);823}824GameBoyAdvanceRendererProxy.prototype.writeWIN0XCOORDRight8 = function (data) {825 data = data | 0;826 data = data & 0xFF;827 this.IOCore.updateGraphicsClocking();828 this.renderer.writeWIN0XCOORDRight8(data | 0);829}830GameBoyAdvanceRendererProxy.prototype.writeWIN0XCOORDLeft8 = function (data) {831 data = data | 0;832 data = data & 0xFF;833 this.IOCore.updateGraphicsClocking();834 this.renderer.writeWIN0XCOORDLeft8(data | 0);835}836GameBoyAdvanceRendererProxy.prototype.writeWIN0XCOORD16 = function (data) {837 data = data | 0;838 data = data & 0xFFFF;839 this.IOCore.updateGraphicsClocking();840 this.renderer.writeWIN0XCOORD16(data | 0);841}842GameBoyAdvanceRendererProxy.prototype.writeWIN1XCOORDRight8 = function (data) {843 data = data | 0;844 data = data & 0xFF;845 this.IOCore.updateGraphicsClocking();846 this.renderer.writeWIN1XCOORDRight8(data | 0);847}848GameBoyAdvanceRendererProxy.prototype.writeWIN1XCOORDLeft8 = function (data) {849 data = data | 0;850 data = data & 0xFF;851 this.IOCore.updateGraphicsClocking();852 this.renderer.writeWIN1XCOORDLeft8(data | 0);853}854GameBoyAdvanceRendererProxy.prototype.writeWIN1XCOORD16 = function (data) {855 data = data | 0;856 data = data & 0xFFFF;857 this.IOCore.updateGraphicsClocking();858 this.renderer.writeWIN1XCOORD16(data | 0);859}860GameBoyAdvanceRendererProxy.prototype.writeWINXCOORD32 = function (data) {861 data = data | 0;862 this.IOCore.updateGraphicsClocking();863 this.renderer.writeWINXCOORD32(data | 0);864}865GameBoyAdvanceRendererProxy.prototype.writeWIN0YCOORDBottom8 = function (data) {866 data = data | 0;867 data = data & 0xFF;868 this.IOCore.updateGraphicsClocking();869 this.renderer.writeWIN0YCOORDBottom8(data | 0);870}871GameBoyAdvanceRendererProxy.prototype.writeWIN0YCOORDTop8 = function (data) {872 data = data | 0;873 data = data & 0xFF;874 this.IOCore.updateGraphicsClocking();875 this.renderer.writeWIN0YCOORDTop8(data | 0);876}877GameBoyAdvanceRendererProxy.prototype.writeWIN0YCOORD16 = function (data) {878 data = data | 0;879 data = data & 0xFFFF;880 this.IOCore.updateGraphicsClocking();881 this.renderer.writeWIN0YCOORD16(data | 0);882}883GameBoyAdvanceRendererProxy.prototype.writeWIN1YCOORDBottom8 = function (data) {884 data = data | 0;885 data = data & 0xFF;886 this.IOCore.updateGraphicsClocking();887 this.renderer.writeWIN1YCOORDBottom8(data | 0);888}889GameBoyAdvanceRendererProxy.prototype.writeWIN1YCOORDTop8 = function (data) {890 data = data | 0;891 data = data & 0xFF;892 this.IOCore.updateGraphicsClocking();893 this.renderer.writeWIN1YCOORDTop8(data | 0);894}895GameBoyAdvanceRendererProxy.prototype.writeWIN1YCOORD16 = function (data) {896 data = data | 0;897 data = data & 0xFFFF;898 this.IOCore.updateGraphicsClocking();899 this.renderer.writeWIN1YCOORD16(data | 0);900}901GameBoyAdvanceRendererProxy.prototype.writeWINYCOORD32 = function (data) {902 data = data | 0;903 this.IOCore.updateGraphicsClocking();904 this.renderer.writeWINYCOORD32(data | 0);905}906GameBoyAdvanceRendererProxy.prototype.writeWIN0IN8 = function (data) {907 data = data | 0;908 data = data & 0x3F;909 this.IOCore.updateGraphicsClocking();910 this.IOData8[12] = data | 0;911 this.renderer.writeWIN0IN8(data | 0);912}913GameBoyAdvanceRendererProxy.prototype.readWIN0IN8 = function () {914 return this.IOData8[12] | 0;915}916GameBoyAdvanceRendererProxy.prototype.writeWIN1IN8 = function (data) {917 data = data | 0;918 data = data & 0x3F;919 this.IOCore.updateGraphicsClocking();920 this.IOData8[13] = data | 0;921 this.renderer.writeWIN1IN8(data | 0);922}923GameBoyAdvanceRendererProxy.prototype.readWIN1IN8 = function () {924 return this.IOData8[13] | 0;925}926GameBoyAdvanceRendererProxy.prototype.writeWINOUT8 = function (data) {927 data = data | 0;928 data = data & 0x3F;929 this.IOCore.updateGraphicsClocking();930 this.IOData8[14] = data | 0;931 this.renderer.writeWINOUT8(data | 0);932}933GameBoyAdvanceRendererProxy.prototype.readWINOUT8 = function () {934 return this.IOData8[14] | 0;935}936GameBoyAdvanceRendererProxy.prototype.writeWINOBJIN8 = function (data) {937 data = data | 0;938 data = data & 0x3F;939 this.IOCore.updateGraphicsClocking();940 this.IOData8[15] = data | 0;941 this.renderer.writeWINOBJIN8(data | 0);942}943GameBoyAdvanceRendererProxy.prototype.readWINOBJIN8 = function () {944 return this.IOData8[15] | 0;945}946if (__LITTLE_ENDIAN__) {947 GameBoyAdvanceRendererProxy.prototype.writeWININ16 = function (data) {948 data = data | 0;949 data = data & 0x3F3F;950 this.IOCore.updateGraphicsClocking();951 this.IOData16[6] = data | 0;952 this.renderer.writeWININ16(data | 0);953 }954 GameBoyAdvanceRendererProxy.prototype.writeWINOUT16 = function (data) {955 data = data | 0;956 data = data & 0x3F3F;957 this.IOCore.updateGraphicsClocking();958 this.IOData16[7] = data | 0;959 this.renderer.writeWINOUT16(data | 0);960 }961 GameBoyAdvanceRendererProxy.prototype.writeWINCONTROL32 = function (data) {962 data = data | 0;963 data = data & 0x3F3F3F3F;964 this.IOCore.updateGraphicsClocking();965 this.IOData32[3] = data | 0;966 this.renderer.writeWINCONTROL32(data | 0);967 }968 GameBoyAdvanceRendererProxy.prototype.readWININ16 = function () {969 return this.IOData16[6] | 0;970 }971 GameBoyAdvanceRendererProxy.prototype.readWINOUT16 = function () {972 return this.IOData16[7] | 0;973 }974 GameBoyAdvanceRendererProxy.prototype.readWINCONTROL32 = function () {975 return this.IOData32[3] | 0;976 }977}978else {979 GameBoyAdvanceRendererProxy.prototype.writeWININ16 = function (data) {980 data = data | 0;981 data = data & 0x3F3F;982 this.IOCore.updateGraphicsClocking();983 this.IOData8[12] = data & 0xFF;984 this.IOData8[13] = data >> 8;985 this.renderer.writeWININ16(data | 0);986 }987 GameBoyAdvanceRendererProxy.prototype.writeWINOUT16 = function (data) {988 data = data | 0;989 data = data & 0x3F3F;990 this.IOCore.updateGraphicsClocking();991 this.IOData8[14] = data & 0xFF;992 this.IOData8[15] = data >> 8;993 this.renderer.writeWINOUT16(data | 0);994 }995 GameBoyAdvanceRendererProxy.prototype.writeWINCONTROL32 = function (data) {996 data = data | 0;997 data = data & 0x3F3F3F3F;998 this.IOCore.updateGraphicsClocking();999 this.IOData8[12] = data & 0xFF;1000 this.IOData8[13] = (data >> 8) & 0xFF;1001 this.IOData8[14] = (data >> 16) & 0xFF;1002 this.IOData8[15] = data >>> 24;1003 this.renderer.writeWINCONTROL32(data | 0);1004 }1005 GameBoyAdvanceRendererProxy.prototype.readWININ16 = function () {1006 return this.IOData8[12] | (this.IOData8[13] << 8);1007 }1008 GameBoyAdvanceRendererProxy.prototype.readWINOUT16 = function () {1009 return this.IOData8[14] | (this.IOData8[15] << 8);1010 }1011 GameBoyAdvanceRendererProxy.prototype.readWINCONTROL32 = function () {1012 return this.IOData8[12] | (this.IOData8[13] << 8) | (this.IOData8[14] << 16) | (this.IOData8[15] << 24);1013 }1014}1015GameBoyAdvanceRendererProxy.prototype.writeMOSAIC8_0 = function (data) {1016 data = data | 0;1017 data = data & 0xFF;1018 this.IOCore.updateGraphicsClocking();1019 this.renderer.writeMOSAIC8_0(data | 0);1020}1021GameBoyAdvanceRendererProxy.prototype.writeMOSAIC8_1 = function (data) {1022 data = data | 0;1023 data = data & 0xFF;1024 this.IOCore.updateGraphicsClocking();1025 this.renderer.writeMOSAIC8_1(data | 0);1026}1027GameBoyAdvanceRendererProxy.prototype.writeMOSAIC16 = function (data) {1028 data = data | 0;1029 data = data & 0xFFFF;1030 this.IOCore.updateGraphicsClocking();1031 this.renderer.writeMOSAIC16(data | 0);1032}1033GameBoyAdvanceRendererProxy.prototype.writeBLDCNT8_0 = function (data) {1034 data = data | 0;1035 data = data & 0xFF;1036 this.IOCore.updateGraphicsClocking();1037 this.IOData8[16] = data | 0;1038 this.renderer.writeBLDCNT8_0(data | 0);1039}1040GameBoyAdvanceRendererProxy.prototype.readBLDCNT8_0 = function () {1041 return this.IOData8[16] | 0;1042}1043GameBoyAdvanceRendererProxy.prototype.writeBLDCNT8_1 = function (data) {1044 data = data | 0;1045 data = data & 0x3F;1046 this.IOCore.updateGraphicsClocking();1047 this.IOData8[17] = data | 0;1048 this.renderer.writeBLDCNT8_1(data | 0);1049}1050GameBoyAdvanceRendererProxy.prototype.readBLDCNT8_1 = function () {1051 return this.IOData8[17] | 0;1052}1053GameBoyAdvanceRendererProxy.prototype.writeBLDALPHA8_0 = function (data) {1054 data = data | 0;1055 data = data & 0x1F;1056 this.IOCore.updateGraphicsClocking();1057 this.IOData8[18] = data | 0;1058 this.renderer.writeBLDALPHA8_0(data | 0);1059}1060GameBoyAdvanceRendererProxy.prototype.readBLDALPHA8_0 = function () {1061 return this.IOData8[18] | 0;1062}1063GameBoyAdvanceRendererProxy.prototype.writeBLDALPHA8_1 = function (data) {1064 data = data | 0;1065 data = data & 0x1F;1066 this.IOCore.updateGraphicsClocking();1067 this.IOData8[19] = data | 0;1068 this.renderer.writeBLDALPHA8_1(data | 0);1069}1070GameBoyAdvanceRendererProxy.prototype.readBLDALPHA8_1 = function () {1071 return this.IOData8[19] | 0;1072}1073if (__LITTLE_ENDIAN__) {1074 GameBoyAdvanceRendererProxy.prototype.writeBLDCNT16 = function (data) {1075 data = data | 0;1076 data = data & 0x3FFF;1077 this.IOCore.updateGraphicsClocking();1078 this.IOData16[8] = data | 0;1079 this.renderer.writeBLDCNT16(data | 0);1080 }1081 GameBoyAdvanceRendererProxy.prototype.writeBLDALPHA16 = function (data) {1082 data = data | 0;1083 data = data & 0x1F1F;1084 this.IOCore.updateGraphicsClocking();1085 this.IOData16[9] = data | 0;1086 this.renderer.writeBLDALPHA16(data | 0);1087 }1088 GameBoyAdvanceRendererProxy.prototype.writeBLDCNT32 = function (data) {1089 data = data | 0;1090 data = data & 0x1F1F3FFF;1091 this.IOCore.updateGraphicsClocking();1092 this.IOData32[4] = data | 0;1093 this.renderer.writeBLDCNT32(data | 0);1094 }1095 GameBoyAdvanceRendererProxy.prototype.readBLDCNT16 = function () {1096 return this.IOData16[8] | 0;1097 }1098 GameBoyAdvanceRendererProxy.prototype.readBLDALPHA16 = function () {1099 return this.IOData16[9] | 0;1100 }1101 GameBoyAdvanceRendererProxy.prototype.readBLDCNT32 = function () {1102 return this.IOData32[4] | 0;1103 }1104}1105else {1106 GameBoyAdvanceRendererProxy.prototype.writeBLDCNT16 = function (data) {1107 data = data | 0;1108 data = data & 0x3FFF;1109 this.IOCore.updateGraphicsClocking();1110 this.IOData8[16] = data & 0xFF;1111 this.IOData8[17] = data >> 8;1112 this.renderer.writeBLDCNT16(data | 0);1113 }1114 GameBoyAdvanceRendererProxy.prototype.writeBLDALPHA16 = function (data) {1115 data = data | 0;1116 data = data & 0x1F1F;1117 this.IOCore.updateGraphicsClocking();1118 this.IOData8[18] = data & 0xFF;1119 this.IOData8[19] = data >> 8;1120 this.renderer.writeBLDALPHA16(data | 0);1121 }1122 GameBoyAdvanceRendererProxy.prototype.writeBLDCNT32 = function (data) {1123 data = data | 0;1124 data = data & 0x1F1F3FFF;1125 this.IOCore.updateGraphicsClocking();1126 this.IOData8[16] = data & 0xFF;1127 this.IOData8[17] = (data >> 8) & 0xFF;1128 this.IOData8[18] = (data >> 16) & 0xFF;1129 this.IOData8[19] = data >>> 24;1130 this.renderer.writeBLDCNT32(data | 0);1131 }1132 GameBoyAdvanceRendererProxy.prototype.readBLDCNT16 = function () {1133 return this.IOData8[16] | (this.IOData8[17] << 8);1134 }1135 GameBoyAdvanceRendererProxy.prototype.readBLDALPHA16 = function () {1136 return this.IOData8[18] | (this.IOData8[19] << 8);1137 }1138 GameBoyAdvanceRendererProxy.prototype.readBLDCNT32 = function () {1139 return this.IOData8[16] | (this.IOData8[17] << 8) | (this.IOData8[18] << 16) | (this.IOData8[19] << 24);1140 }1141}1142GameBoyAdvanceRendererProxy.prototype.writeBLDY8 = function (data) {1143 data = data | 0;1144 data = data & 0xFF;1145 this.IOCore.updateGraphicsClocking();1146 this.renderer.writeBLDY8(data | 0);1147}1148GameBoyAdvanceRendererProxy.prototype.writeVRAM8 = function (address, data) {1149 address = address | 0;1150 data = data | 0;1151 this.renderer.writeVRAM8(address | 0, data | 0);1152}1153GameBoyAdvanceRendererProxy.prototype.writeVRAM16 = function (address, data) {1154 address = address | 0;1155 data = data | 0;1156 this.renderer.writeVRAM16(address | 0, data | 0);1157}1158GameBoyAdvanceRendererProxy.prototype.writeVRAM32 = function (address, data) {1159 address = address | 0;1160 data = data | 0;1161 this.renderer.writeVRAM32(address | 0, data | 0);1162}1163GameBoyAdvanceRendererProxy.prototype.readVRAM16 = function (address) {1164 address = address | 0;1165 var data = this.renderer.readVRAM16(address | 0) | 0;1166 return data | 0;1167}1168GameBoyAdvanceRendererProxy.prototype.readVRAM32 = function (address) {1169 address = address | 0;1170 var data = this.renderer.readVRAM32(address | 0) | 0;1171 return data | 0;1172}1173GameBoyAdvanceRendererProxy.prototype.writePalette16 = function (address, data) {1174 data = data | 0;1175 address = address | 0;1176 this.renderer.writePalette16(address | 0, data | 0);1177}1178GameBoyAdvanceRendererProxy.prototype.writePalette32 = function (address, data) {1179 data = data | 0;1180 address = address | 0;1181 this.renderer.writePalette32(address | 0, data | 0);1182}1183GameBoyAdvanceRendererProxy.prototype.readPalette16 = function (address) {1184 address = address | 0;1185 var data = this.renderer.readPalette16(address | 0) | 0;1186 return data | 0;1187}1188GameBoyAdvanceRendererProxy.prototype.readPalette32 = function (address) {1189 address = address | 0;1190 var data = this.renderer.readPalette32(address | 0) | 0;1191 return data | 0;1192}1193GameBoyAdvanceRendererProxy.prototype.readVRAM8 = function (address) {1194 address = address | 0;1195 var data = this.renderer.readVRAM8(address | 0) | 0;1196 return data | 0;1197}1198GameBoyAdvanceRendererProxy.prototype.writeOAM16 = function (address, data) {1199 address = address | 0;1200 data = data | 0;1201 this.renderer.writeOAM16(address | 0, data | 0);1202}1203GameBoyAdvanceRendererProxy.prototype.writeOAM32 = function (address, data) {1204 address = address | 0;1205 data = data | 0;1206 this.renderer.writeOAM32(address | 0, data | 0);1207}1208GameBoyAdvanceRendererProxy.prototype.readOAM = function (address) {1209 address = address | 0;1210 var data = this.renderer.readOAM(address | 0) | 0;1211 return data | 0;1212}1213GameBoyAdvanceRendererProxy.prototype.readOAM16 = function (address) {1214 address = address | 0;1215 var data = this.renderer.readOAM16(address | 0) | 0;1216 return data | 0;1217}1218GameBoyAdvanceRendererProxy.prototype.readOAM32 = function (address) {1219 address = address | 0;1220 var data = this.renderer.readOAM32(address | 0) | 0;1221 return data | 0;1222}1223GameBoyAdvanceRendererProxy.prototype.readPalette8 = function (address) {1224 address = address | 0;1225 var data = this.renderer.readPalette8(address | 0) | 0;1226 return data | 0;...
flowAdvancedSearch.js
Source:flowAdvancedSearch.js
1/**Before ***/2function setTodayDateAdvancedSearch(){3 var today = new Date();4 var dd = today.getDate();5 var mm = today.getMonth()+1; //January is 0!6 var yyyy = today.getFullYear();7 if(dd < 10){8 dd='0' + dd9 }10 if(mm < 10){11 mm = '0' + mm12 }13 today = yyyy+'-'+mm+'-'+dd;14 document.getElementById("flow_advance_reserve_booking_date").setAttribute("min", today);15}16/**17 * Flow Preserve - Step 1 - User Login18 **/19$("#flow_advance_reserve_login_button").click(function() {20 var loginInfo = new Object();21 loginInfo.email = $("#flow_advance_reserve_login_email").val();22 if(loginInfo.email == null || loginInfo.email == ""){23 alert("Email Can Not Be Empty.");24 return;25 }26 if(checkEmailFormat(loginInfo.email) == false){27 alert("Email Format Wrong.");28 return;29 }30 loginInfo.password = $("#flow_advance_reserve_login_password").val();31 if(loginInfo.password == null || loginInfo.password == ""){32 alert("Password Can Not Be Empty.");33 return;34 }35 loginInfo.verificationCode = $("#flow_advance_reserve_login_verification_code").val();36 if(loginInfo.verificationCode == null || loginInfo.verificationCode == ""){37 alert("Verification Code Can Not Be Empty.");38 return;39 }40 var data = JSON.stringify(loginInfo);41 $.ajax({42 type: "post",43 url: "/login",44 contentType: "application/json",45 dataType: "json",46 data:data,47 xhrFields: {48 withCredentials: true49 },50 success: function(result){51 var obj = result;52 if(obj["status"] == true){53 $("#user_login_id").html(obj["account"].id);54 $("#user_login_token").html(obj["token"]);55 document.cookie = "loginId=" + obj["account"].id;56 document.cookie = "loginToken=" + obj["token"];57 location.hash="anchor_flow_advance_reserve_select_trip";58 }else{59 alert(obj["message"]);60 }61 }62 });63});64/**65 * Flow Preserve - Step 2 - Search For Ticket66 **/67$("#flow_advance_reserve_booking_button").click(function() {68 var advanceSearchInfo = new Object();69 advanceSearchInfo.startingPlace = $("#flow_advance_reserve_startingPlace").val();70 advanceSearchInfo.endPlace = $("#flow_advance_reserve_terminalPlace").val();71 advanceSearchInfo.departureTime = $("#flow_advance_reserve_booking_date").val();72 if(advanceSearchInfo.departureTime == null || checkDateFormat(advanceSearchInfo.departureTime ) == false){73 alert("Departure Date Format Wrong.");74 return;75 }76 var advanceSearchData = JSON.stringify(advanceSearchInfo);77 $("#flow_advance_reserve_booking_list_table").find("tbody").html("");78 var selectType = $("#flow_advance_reserve_select_searchType").val();79 if(selectType == 0){80 advanceSearchForMinStopInfo(advanceSearchData,"/api/v1/travelplanservice/travelPlan/minStation");81 }else if(selectType == 1){82 advanceSearchForCheapestInfo(advanceSearchData,"/api/v1/travelplanservice/travelPlan/cheapest");83 }else if(selectType == 2){84 advanceSearchForQuickestInfo(advanceSearchData,"/api/v1/travelplanservice/travelPlan/quickest");85 }else{86 alert("Select Search Type Wrong");87 }88})89function advanceSearchForCheapestInfo(data,path) {90 $("#flow_advance_reserve_booking_button").attr("disabled",true);91 $.ajax({92 type: "post",93 url: path,94 contentType: "application/json",95 dataType: "json",96 data: data,97 xhrFields: {98 withCredentials: true99 },100 success: function (result) {101 if (result.status = true) {102 var obj = result["travelAdvanceResultUnits"];103 for (var i = 0, l = obj.length; i < l; i++) {104 $("#flow_advance_reserve_booking_list_table").find("tbody").append(105 "<tr>" +106 "<td>" + i + "</td>" +107 "<td class='booking_tripId'>" + obj[i]["tripId"] + "</td>" +108 "<td class='booking_trainTypeId'>" + obj[i]["trainTypeId"] + "</td>" +109 "<td class='booking_from'>" + obj[i]["fromStationName"] + "</td>" +110 "<td class='booking_to'>" + obj[i]["toStationName"] + "</td>" +111 "<td>" + obj[i]["stopStations"] + "</td>" +112 "<td>" + flow_advance_convertNumberToTimeString(obj[i]["startingTime"]) + "</td>" +113 "<td>" + flow_advance_convertNumberToTimeString(obj[i]["endTime"]) + "</td>" +114 "<td>" + obj[i]["numberOfRestTicketSecondClass"] + "</td>" +115 "<td>" + obj[i]["numberOfRestTicketFirstClass"] + "</td>" +116 "<td>" +117 "<select class='form-control booking_seat_class'>" +118 "<option value='2'>1st - " + obj[i]["priceForFirstClassSeat"] + "</option>" +119 "<option value='3'>2st - " + obj[i]["priceForSecondClassSeat"] + "</option>" +120 "</select>" +121 "</td>" +122 "<td class='booking_seat_price_confort noshow_component'>" + obj[i]["priceForFirstClassSeat"] + "</td>"+123 "<td class='booking_seat_price_economy noshow_component'>" + obj[i]["priceForSecondClassSeat"] + "</td>"+124 "<td>" + "<button class='btn btn-primary advance_ticket_booking_button'>" + "Booking" + "</button>" + "</td>" +125 "</tr>"126 );127 }128 flow_advance_addListenerToBookingTable();129 }130 },131 complete: function () {132 $("#flow_advance_reserve_booking_button").attr("disabled",false);133 }134 });135}136function advanceSearchForQuickestInfo(data,path) {137 $("#flow_advance_reserve_booking_button").attr("disabled",true);138 $.ajax({139 type: "post",140 url: path,141 contentType: "application/json",142 dataType: "json",143 data: data,144 xhrFields: {145 withCredentials: true146 },147 success: function (result) {148 if (result.status = true) {149 var obj = result["travelAdvanceResultUnits"];150 for (var i = 0, l = obj.length; i < l; i++) {151 $("#flow_advance_reserve_booking_list_table").find("tbody").append(152 "<tr>" +153 "<td>" + i + "</td>" +154 "<td class='booking_tripId'>" + obj[i]["tripId"] + "</td>" +155 "<td class='booking_trainTypeId'>" + obj[i]["trainTypeId"] + "</td>" +156 "<td class='booking_from'>" + obj[i]["fromStationName"] + "</td>" +157 "<td class='booking_to'>" + obj[i]["toStationName"] + "</td>" +158 "<td>" + obj[i]["stopStations"] + "</td>" +159 "<td>" + flow_advance_convertNumberToTimeString(obj[i]["startingTime"]) + "</td>" +160 "<td>" + flow_advance_convertNumberToTimeString(obj[i]["endTime"]) + "</td>" +161 "<td>" + obj[i]["numberOfRestTicketSecondClass"] + "</td>" +162 "<td>" + obj[i]["numberOfRestTicketFirstClass"] + "</td>" +163 "<td>" +164 "<select class='form-control booking_seat_class'>" +165 "<option value='2'>1st - " + obj[i]["priceForFirstClassSeat"] + "</option>" +166 "<option value='3'>2st - " + obj[i]["priceForSecondClassSeat"] + "</option>" +167 "</select>" +168 "</td>" +169 "<td class='booking_seat_price_confort noshow_component'>" + obj[i]["priceForFirstClassSeat"] + "</td>"+170 "<td class='booking_seat_price_economy noshow_component'>" + obj[i]["priceForSecondClassSeat"] + "</td>"+171 "<td>" + "<button class='btn btn-primary advance_ticket_booking_button'>" + "Booking" + "</button>" + "</td>" +172 "</tr>"173 );174 }175 flow_advance_addListenerToBookingTable();176 }177 },178 complete: function () {179 $("#flow_advance_reserve_booking_button").attr("disabled",false);180 }181 });182}183function advanceSearchForMinStopInfo(data,path) {184 $("#flow_advance_reserve_booking_button").attr("disabled",true);185 $.ajax({186 type: "post",187 url: path,188 contentType: "application/json",189 dataType: "json",190 data: data,191 headers: {"Authorization": "Bearer " + sessionStorage.getItem("client_token")},192 xhrFields: {193 withCredentials: true194 },195 success: function (result) {196 if (result.status == 1) {197 var obj = result["travelAdvanceResultUnits"];198 for (var i = 0, l = obj.length; i < l; i++) {199 $("#flow_advance_reserve_booking_list_table").find("tbody").append(200 "<tr>" +201 "<td>" + i + "</td>" +202 "<td class='booking_tripId'>" + obj[i]["tripId"] + "</td>" +203 "<td class='booking_trainTypeId'>" + obj[i]["trainTypeId"] + "</td>" +204 "<td class='booking_from'>" + obj[i]["fromStationName"] + "</td>" +205 "<td class='booking_to'>" + obj[i]["toStationName"] + "</td>" +206 "<td>" + obj[i]["stopStations"] + "</td>" +207 "<td>" + flow_advance_convertNumberToTimeString(obj[i]["startingTime"]) + "</td>" +208 "<td>" + flow_advance_convertNumberToTimeString(obj[i]["endTime"]) + "</td>" +209 "<td>" + obj[i]["numberOfRestTicketSecondClass"] + "</td>" +210 "<td>" + obj[i]["numberOfRestTicketFirstClass"] + "</td>" +211 "<td>" +212 "<select class='form-control booking_seat_class'>" +213 "<option value='2'>1st - " + obj[i]["priceForFirstClassSeat"] + "</option>" +214 "<option value='3'>2st - " + obj[i]["priceForSecondClassSeat"] + "</option>" +215 "</select>" +216 "</td>" +217 "<td class='booking_seat_price_confort noshow_component'>" + obj[i]["priceForFirstClassSeat"] + "</td>"+218 "<td class='booking_seat_price_economy noshow_component'>" + obj[i]["priceForSecondClassSeat"] + "</td>"+219 "<td>" + "<button class='btn btn-primary advance_ticket_booking_button'>" + "Booking" + "</button>" + "</td>" +220 "</tr>"221 );222 }223 flow_advance_addListenerToBookingTable();224 }225 },226 complete: function () {227 $("#flow_advance_reserve_booking_button").attr("disabled",false);228 }229 });230}231function flow_advance_addListenerToBookingTable(){232 var ticketBookingButtonSet = $(".advance_ticket_booking_button");233 for(var i = 0;i < ticketBookingButtonSet.length;i++){234 ticketBookingButtonSet[i].onclick = function(){235 var tripId = $(this).parents("tr").find(".booking_tripId").text();236 var from = $(this).parents("tr").find(".booking_from").text();237 var to = $(this).parents("tr").find(".booking_to").text();238 var seatType = $(this).parents("tr").find(".booking_seat_class").val();239 var date = $("#flow_advance_reserve_booking_date").val();240 $("#flow_advance_reserve_ticket_confirm_from").text(from);241 $("#flow_advance_reserve_ticket_confirm_to").text(to);242 $("#flow_advance_reserve_ticket_confirm_tripId").text(tripId);243 if(seatType == 2){244 $("#flow_advance_reserve_ticket_confirm_price").text($(this).parents("tr").find(".booking_seat_price_confort").text());245 }else if(seatType == 3){246 $("#flow_advance_reserve_ticket_confirm_price").text($(this).parents("tr").find(".booking_seat_price_economy").text());247 }248 $("#flow_advance_reserve_ticket_confirm_travel_date").text(date);249 $("#flow_advance_reserve_ticket_confirm_seatType").text(seatType);250 if(seatType == 2){251 $("#flow_advance_reserve_ticket_confirm_seatType_String").text("confort seat");252 }else if(seatType == 3){253 $("#flow_advance_reserve_ticket_confirm_seatType_String").text("economy seat");254 }255 flow_advance_refresh_booking_contacts();256 flow_advance_initFoodSelect(tripId);257 location.hash="anchor_flow_preserve_select_contacts";258 }259 }260}261/**262 * Flow Preserve - Step 3 - Search For Contact and Food263 **/264$("#flow_advance_reserve_booking_contacts_button").click(function(){265 flow_advance_refresh_booking_contacts();266})267function flow_advance_refresh_booking_contacts() {268 if(getCookie("loginId").length < 1 || getCookie("loginToken").length < 1){269 alert("Please Login");270 }271 $("#flow_advance_reserve_booking_contacts_button").attr("disabled",true);272 $.ajax({273 type: "get",274 url: "/contacts/findContacts",275 contentType: "application/json",276 dataType: "json",277 xhrFields: {278 withCredentials: true279 },280 success: function (result) {281 var obj = result;282 $("#flow_advance_reserve_contacts_booking_list_table").find("tbody").html("");283 for (var i = 0, l = obj.length; i < l; i++) {284 $("#flow_advance_reserve_contacts_booking_list_table").find("tbody").append(285 "<tr>" +286 "<td>" + i + "</td>" +287 "<td class='advance_search_booking_contacts_contactsId' style='display:none'>" + obj[i]["id"] + "</td>" +288 "<td class='advance_search_booking_contacts_name'>" + obj[i]["name"] + "</td>" +289 "<td class='advance_search_booking_contacts_documentType'>" + convertNumberToDocumentType(obj[i]["documentType"]) + "</td>" +290 "<td class='advance_search_booking_contacts_documentNumber'>" + obj[i]["documentNumber"] + "</td>" +291 "<td class='advance_search_booking_contacts_phoneNumber'>" + obj[i]["phoneNumber"] + "</td>" +292 "<td>" + "<label><input class='advance_search_booking_contacts_select' type='radio' />" + "Select" + "</label>" + "</td>" +293 "</tr>"294 );295 }296 $("#flow_advance_reserve_contacts_booking_list_table").find("tbody").append(297 "<tr>" +298 "<td>" + obj.length + "</td>" +299 "<td class='booking_contacts_name'>" + "<input id='advance_search__booking_new_contacts_name'>" + "</td>" +300 "<td>" +301 "<select id='flow_advance_booking_new_contacts_documentType' class='advance_search_booking_contacts_documentType all form-control'>" +302 "<option value='1' selected = 'selected'>ID Card</option>" +303 "<option value='2'>Passport</option>" +304 "<option value='3'>Other</option>" +305 "</select>" +306 "</td>" +307 "<td class='advance_search_booking_contacts_documentNumber'>" + "<input id='flow_advance_booking_new_contacts_documentNum'>" + "</td>" +308 "<td class='advance_search_booking_contacts_phoneNumber'>" + "<input id='flow_advance_booking_new_contacts_phoneNum'>" + "</td>" +309 "<td>" + "<label><input id='flow_advance_booking_new_contacts_select' class='flow_advance_booking_contacts_select' name='booking_contacts' type='radio' />" + "Select" + "</label>" + "</td>" +310 "</tr>"311 );312 },313 complete: function(){314 $("#flow_advance_reserve_booking_contacts_button").attr("disabled",false);315 }316 });317}318$(function () {319 flow_advance_getAssuranceType();320});321//è·åä¿é©çç±»å322function flow_advance_getAssuranceType(){323 $.ajax({324 type: "get",325 url: "/assurance/getAllAssuranceType",326 contentType: "application/json",327 dataType: "json",328 xhrFields: {329 withCredentials: true330 },331 success: function (result) {332 var obj = result;333 var types = document.getElementById ("flow_advance_reserve_assurance_type");334 var opt0 = document.createElement("option");335 opt0.value = 0;336 opt0.innerText = "No Assurance";337 types.appendChild(opt0);338 for (var i = 0, l = obj.length; i < l; i++) {339 var opt = document.createElement ("option");340 opt.value = obj[i]["index"];341 opt.innerText = obj[i]["name"];342 types.appendChild (opt);343 }344 },345 complete: function(){346 }347 });348}349$("#flow_advance_reserve_ticket_select_contacts_cancel_btn").click(function(){350 location.hash="anchor_flow_advance_reserve_select_trip";351})352$("#flow_advance_reserve_ticket_select_contacts_confirm_btn").click(function(){353 if(getCookie("loginId").length < 1 || getCookie("loginToken").length < 1){354 alert("Please Login");355 }356 var contactsId = "";357 var radios = $(".advance_search_booking_contacts_select");358 var selectContactsStatus = false;359 if(radios[radios.length - 1].checked){360 selectContactsStatus = true;361 flow_advance_preserveCreateNewContacts();362 }else{363 for (var j = 0; j < radios.length - 1; j++) {364 if (radios[j].checked) {365 contactsId = $(".advance_search_booking_contacts_contactsId").eq(j).text();366 selectContactsStatus = true;367 var contactsName = $(".advance_search_booking_contacts_name").eq(j).text();368 var documentType = $(".advance_search_booking_contacts_documentType").eq(j).text();369 var documentNumber = $(".advance_search_booking_contacts_documentNumber").eq(j).text();370 $("#flow_advance_reserve_ticket_confirm_contactsId").text(contactsId);371 $("#flow_advance_reserve_ticket_confirm_contactsName").text(contactsName);372 $("#flow_advance_reserve_ticket_confirm_documentType").text(documentType);373 $("#flow_advance_reserve_ticket_confirm_documentNumber").text(documentNumber);374 break;375 }376 }377 }378 //show th food information379 if($('#flow_advance_reserve_need_food_or_not').is(":checked")){380 $('#flow_advance_reserve_ticket_confirm_food_type_div').css("display","block");381 $('#flow_advance_reserve_ticket_confirm_food_name_div').css("display","block");382 $('#flow_advance_reserve_ticket_confirm_food_price_div').css("display","block");383 var type = $('#flow_advance_reserve_preserve_food_type').find("option:selected").text();384 $('#flow_advance_reserve_ticket_confirm_food_type').text(type);385 if($('#flow_advance_reserve_preserve_food_type').find("option:selected").val() == 1){386 var fp = $('#flow_advance_reserve_train_food_type_list').find("option:selected").text().split(":");387 $('#flow_advance_reserve_ticket_confirm_food_name').text(fp[0]);388 $('#flow_advance_reserve_ticket_confirm_food_price').text(fp[1]);389 $('#flow_advance_reserve_ticket_confirm_food_station_div').css("display","none");390 $('#flow_advance_reserve_ticket_confirm_food_store_div').css("display","none");391 } else {392 var fp2 = $('#flow_advance_reserve_food_store_food_list').find("option:selected").text().split(":");393 $('#flow_advance_reserve_ticket_confirm_food_name').text(fp2[0]);394 $('#flow_advance_reserve_ticket_confirm_food_price').text(fp2[1]);395 $('#flow_advance_reserve_ticket_confirm_food_station_div').css("display","block");396 $('#flow_advance_reserve_ticket_confirm_food_store_div').css("display","block");397 $('#flow_advance_reserve_ticket_confirm_food_station').text($('#food-station-list').find("option:selected").text());398 $('#flow_advance_reserve_ticket_confirm_food_store').text($('#food-stores-list').find("option:selected").text());399 }400 } else {401 $('#flow_advance_reserve_ticket_confirm_food_type_div').css("display","none");402 $('#flow_advance_reserve_ticket_confirm_food_station_div').css("display","none");403 $('#flow_advance_reserve_ticket_confirm_food_store_div').css("display","none");404 $('#flow_advance_reserve_ticket_confirm_food_name_div').css("display","none");405 $('#flow_advance_reserve_ticket_confirm_food_price_div').css("display","none");406 }407 //Show the consign information408 if($('#flow_advance_reserve_need_consign_or_not').is(":checked")){409 $('.flow_advance_reserve_ticket_confirm_consign_div').css("display", "block");410 $('#flow_advance_reserve_ticket_confirm_consignee_name').text($(" #flow_advance_reserve_name_of_consignee ").val());411 $('#flow_advance_reserve_ticket_confirm_consignee_phone').text($(" #flow_advance_reserve_phone_of_consignee").val());412 $('#flow_advance_reserve_ticket_confirm_consign_weight').text($(" #flow_advance_reserve_weight_of_consign ").val());413 }414 else{415 $('.flow_advance_reserve_ticket_confirm_consign_div').css("display", "none");416 }417 if(selectContactsStatus == false){418 alert("Please select contacts.");419 return;420 }else{421 location.hash="anchor_flow_preserve_confirm";422 }423})424function flow_advance_preserveCreateNewContacts(){425 if(getCookie("loginId").length < 1 || getCookie("loginToken").length < 1){426 alert("Please Login");427 }428 $("#flow_advance_reserve_ticket_select_contacts_confirm_btn").attr("disabled",true);429 var addContactsInfo = new Object();430 addContactsInfo.name = $("#flow_advance_booking_new_contacts_name").val();431 addContactsInfo.documentType = $("#flow_advance_booking_new_contacts_documentType").val();432 addContactsInfo.documentNumber = $("#flow_advance_booking_new_contacts_documentNum").val();433 addContactsInfo.phoneNumber = $("#flow_advance_booking_new_contacts_phoneNum").val();434 var data = JSON.stringify(addContactsInfo);435 $.ajax({436 type: "post",437 url: "/contacts/create",438 contentType: "application/json",439 dataType: "json",440 data:data,441 xhrFields: {442 withCredentials: true443 },444 success: function(result){445 $("#flow_advance_reserve_ticket_confirm_contactsId").text(result["contacts"]["id"]);446 $("#flow_advance_reserve_ticket_confirm_contactsName").text(result["contacts"]["name"]);447 $("#flow_advance_reserve_ticket_confirm_documentType").text(convertNumberToDocumentType(result["contacts"]["documentType"]));448 $("#flow_advance_reserve_ticket_confirm_documentNumber").text(result["contacts"]["documentNumber"]);449 refresh_booking_contacts();450 },451 complete: function(){452 $("#flow_advance_reserve_ticket_confirm_confirm_btn").attr("disabled",false);453 }454 });455}456function flow_advance_needFoodOrNot(){457 if($('#flow_advance_reserve_need_food_or_not').is(':checked')){458 $('#flow_advance_reserve_food_preserve_select').css("display", "block");459 } else {460 $('#flow_advance_reserve_food_preserve_select').css("display", "none");461 $('#flow_advance_reserve_food_store_selected').css("display", "none");462 $('#flow_advance_reserve_train_food_selected').css("display", "none");463 $('#flow_advance_reserve_preserve_food_type').val(0);464 }465}466function flow_advance_changeFoodType(){467 var type = $('#flow_advance_reserve_preserve_food_type').find("option:selected").val();468 if(type == 1){469 $('#flow_advance_reserve_train_food_selected').css("display", "block");470 $('#flow_advance_reserve_food_store_selected').css("display", "none");471 $('#flow_advance_reserve_food_station_list').val(0);472 } else if(type == 2){473 $('#flow_advance_reserve_train_food_selected').css("display", "none");474 $('#flow_advance_reserve_food_store_selected').css("display", "block");475 } else {476 $('#flow_advance_reserve_train_food_selected').css("display", "none");477 $('#flow_advance_reserve_food_store_selected').css("display", "none");478 }479}480var flow_advance_preserveFoodStoreListMap = null;481//å¨ç¹å»é¢å®æ¶åè°ç¨482function flow_advance_initFoodSelect(tripId){483 var data = new Object();484 data.date = $('#flow_advance_reserve_booking_date').val() || "";485 data.startStation = $('#flow_advance_reserve_startingPlace').val() || "";486 data.endStation = $('#flow_advance_reserve_terminalPlace').val() || "";487 data.tripId = tripId;488 $.ajax({489 type: "post",490 url: "/food/getFood",491 contentType: "application/json",492 dataType: "json",493 data:JSON.stringify(data),494 xhrFields: {495 withCredentials: true496 },497 success: function(result){498 console.log(result);499 if(result.status){500 if(null == result.trainFoodList || result.trainFoodList.length == 0){501 //没æ502 $('#flow_advance_reserve_train_food_option').disabled(true);503 } else {504 var trainFoodList = result.trainFoodList[0]['foodList'];505 console.log("trainFoodList:" );506 console.log(trainFoodList[0]);507 $("#flow_advance_reserve_train_food_type_list").html("");508 $("#flow_advance_reserve_food_station_list").html("");509 $("#flow_advance_reserve_food_stores_list").html("");510 $("#flow_advance_reserve_food_store_food_list").html("");511 var trainFoodSelect = document.getElementById ("flow_advance_reserve_train_food_type_list");512 var opt1 = document.createElement ("option");513 opt1.value = 0;514 opt1.innerText = "-- --";515 trainFoodSelect.appendChild(opt1);516 for(var k = 0; k < trainFoodList.length; k++){517 var opt2 = document.createElement ("option");518 opt2.value = k + 1;519 opt2.innerText = trainFoodList[k]['foodName'] + ":$" + trainFoodList[k]['price'];520 trainFoodSelect.appendChild (opt2);521 }522 }523 flow_advance_preserveFoodStoreListMap = result.foodStoreListMap;524 console.log(" flow_advance_preserveFoodStoreListMap:");525 console.log(flow_advance_preserveFoodStoreListMap);526 var foodStationSelect = document.getElementById ("flow_advance_reserve_food_station_list");527 var opt3 = document.createElement ("option");528 opt3.value = 0;529 opt3.innerText = "-- --";530 foodStationSelect.appendChild(opt1);531 var fsindex = 1;532 for(var key in flow_advance_preserveFoodStoreListMap){533 var opt4 = document.createElement ("option");534 opt4.value = fsindex;535 fsindex++;536 opt4.innerText = key;537 foodStationSelect.appendChild (opt4);538 }539 } else {540 alert(result.status + ":" + result.message);541 }542 }543 });544}545function flow_advance_preserveChangeFoodStation(){546 var station = $('#flow_advance_reserve_food_station_list').find("option:selected").text();547 var foodStoreList = flow_advance_preserveFoodStoreListMap[station];548 var foodStoreSelect = document.getElementById ("flow_advance_reserve_food_stores_list");549 foodStoreSelect.innerHTML = "";550 var opt5 = document.createElement ("option");551 opt5.value = 0;552 opt5.innerText = "-- --";553 foodStoreSelect.appendChild(opt5);554 for(var j = 0; j < foodStoreList.length; j++){555 var opt6 = document.createElement ("option");556 opt6.value = j+1;557 opt6.innerText = foodStoreList[j]["storeName"];558 foodStoreSelect.appendChild (opt6);559 }560}561function flow_advance_preserveChangeFoodStore(){562 var station = $('#flow_advance_reserve_food_station_list').find("option:selected").text();563 var storeIndex = parseInt($('#flow_advance_reserve_food_stores_list').find("option:selected").val());564 console.log("storeIndex=" + storeIndex);565 var foodList = flow_advance_preserveFoodStoreListMap[station][storeIndex-1]['foodList'];566 console.log("preserveChangeFoodStore: foodList: ");567 console.log(foodList);568 var foodStoreFoodSelect = document.getElementById ("flow_advance_reserve_food_store_food_list");569 foodStoreFoodSelect.innerHTML = "";570 var opt5 = document.createElement("option");571 opt5.value = 0;572 opt5.innerText = "-- --";573 foodStoreFoodSelect.appendChild(opt5);574 for(var j = 0; j < foodList.length; j++){575 var opt6 = document.createElement ("option");576 opt6.value = j+1;577 opt6.innerText = foodList[j]['foodName'] +":$" + foodList[j]['price'];578 foodStoreFoodSelect.appendChild (opt6);579 }580}581function flow_advance_needConsignOrNot(){582 if($('#flow_advance_reserve_need_consign_or_not').is(':checked')){583 $('.flow_advance_reserve_consign_input').css("display", "block");584 } else {585 $('.flow_advance_reserve_consign_input').css("display", "none");586 }587}588function flow_advance_convertNumberToTimeString(timeNumber) {589 var str = new Date(timeNumber);590 var newStr = str.getHours() + ":" + str.getMinutes() + "";591 return newStr;592}593/**594 * Flow Preserve - Step 4 - Confirm Your Order595 **/596$("#flow_advance_reserve_ticket_confirm_cancel_btn").click(function () {597 location.hash="anchor_flow_preserve_select_contacts";598})599$("#flow_advance_reserve_ticket_confirm_confirm_btn").click(function () {600 if(getCookie("loginId").length < 1 || getCookie("loginToken").length < 1){601 alert("Please Login");602 }603 $("#flow_advance_reserve_ticket_confirm_confirm_btn").attr("disabled",true);604 var orderTicketInfo = new Object();605 orderTicketInfo.contactsId = $("#flow_advance_reserve_ticket_confirm_contactsId").text();606 orderTicketInfo.tripId = $("#flow_advance_reserve_ticket_confirm_tripId").text();607 orderTicketInfo.seatType = $("#flow_advance_reserve_ticket_confirm_seatType").text();608 orderTicketInfo.date = $("#flow_advance_reserve_ticket_confirm_travel_date").text();609 orderTicketInfo.from = $("#flow_advance_reserve_ticket_confirm_from").text();610 orderTicketInfo.to = $("#flow_advance_reserve_ticket_confirm_to").text();611 orderTicketInfo.assurance = $("#flow_advance_reserve_assurance_type").val();612 //add the food information613 if(null != $('#flow_advance_reserve_ticket_confirm_food_type').text() && "" != $('#flow_advance_reserve_ticket_confirm_food_type').text()){614 if($('#flow_advance_reserve_ticket_confirm_food_type').text() == "Train Food"){615 orderTicketInfo.foodType = 1;616 orderTicketInfo.foodName = $('#flow_advance_reserve_ticket_confirm_food_name').text();617 orderTicketInfo.foodPrice = parseFloat($('#flow_advance_reserve_ticket_confirm_food_price').text().substr(1));618 orderTicketInfo.stationName = "";619 orderTicketInfo.storeName = "";620 } else if ($('#flow_advance_reserve_ticket_confirm_food_type').text()== "Station Food Stores"){621 orderTicketInfo.foodType = 2;622 orderTicketInfo.stationName = $('#flow_advance_reserve_ticket_confirm_food_station').text();623 orderTicketInfo.storeName = $('#flow_advance_reserve_ticket_confirm_food_store').text();624 orderTicketInfo.foodName = $('#flow_advance_reserve_ticket_confirm_food_name').text();625 orderTicketInfo.foodPrice = parseFloat($('#low_advance_reserve_ticket_confirm_food_price').text().substr(1));626 } else {627 orderTicketInfo.foodType = 0;628 }629 } else {630 orderTicketInfo.foodType = 0;631 }632 //Add the consign information633 if($('#flow_advance_reserve_need_consign_or_not').is(":checked")){634 var date = new Date();635 var seperator1 = "-";636 var year = date.getFullYear();637 var month = date.getMonth() + 1;638 var strDate = date.getDate();639 if (month >= 1 && month <= 9) {640 month = "0" + month;641 }642 if (strDate >= 0 && strDate <= 9) {643 strDate = "0" + strDate;644 }645 var currentdate = year + seperator1 + month + seperator1 + strDate;646 orderTicketInfo.handleDate = currentdate;647 orderTicketInfo.consigneeName = $("#flow_advance_reserve_name_of_consignee").val();648 orderTicketInfo.consigneePhone = $("#flow_advance_reserve_phone_of_consignee").val();649 orderTicketInfo.consigneeWeight = parseFloat($("#flow_advance_reserve_weight_of_consign").val());650 orderTicketInfo.isWithin = false;651 }652 var orderTicketsData = JSON.stringify(orderTicketInfo);653 console.log("orderTicketsData:");654 console.log(orderTicketsData);655 var tripType = orderTicketInfo.tripId.charAt(0);656 if(tripType == 'G' || tripType == 'D'){657 path = "/preserve";658 }else{659 path = "/preserveOther";660 }661 $.ajax({662 type: "post",663 url: path,664 contentType: "application/json",665 dataType: "json",666 data: orderTicketsData,667 xhrFields: {668 withCredentials: true669 },670 success: function (result) {671 alert(result["message"]);672 if(result['status'] == true){673 //$("#preserve_pay_panel").css('display','block');674 $("#flow_advance_reserve_pay_orderId").val(result["order"]["id"]);675 $("#flow_advance_reserve_pay_price").val(result["order"]["price"]);676 //$("#preserve_pay_userId").val(result["order"]["accountId"]);677 $("#flow_advance_reserve_pay_tripId").val(result["order"]["trainNumber"]);678 location.hash="anchor_flow_advance_reserve_pay";679 }680 },681 complete: function(){682 $("#flow_advance_reserve_ticket_confirm_confirm_btn").attr("disabled",false);683 }684 })685})686/**687 * Flow Preserve - Step 5 - Pay For Your Ticket688 */689$("#flow_advance_reserve_pay_later_button").click(function(){690 location.hash="anchor_flow_advance_reserve_pay";691})692$("#flow_advance_reserve_pay_button").click(function(){693 if(getCookie("loginId").length < 1 || getCookie("loginToken").length < 1){694 alert("Please Login");695 }696 $("#flow_advance_reserve_pay_button").attr("disabled",true);697 var info = new Object();698 info.orderId = $("#flow_advance_reserve_pay_orderId").val();699 info.tripId = $("#flow_advance_reserve_pay_tripId").val();700 var data = JSON.stringify(info);701 $.ajax({702 type: "post",703 url: "/inside_payment/pay",704 contentType: "application/json",705 dataType: "text",706 data:data,707 xhrFields: {708 withCredentials: true709 },710 success: function (result) {711 if(result == "true"){712 $("#flow_advanced_reserve_collect_order_id").val(info.orderId);713 location.hash="anchor_flow_advance_reserve_collect";714 }else{715 alert("Pay Fail. Reason Not Clear.Please check the order status before you try.");716 }717 },718 complete: function(){719 $("#flow_advance_reserve_pay_button").attr("disabled",false);720 }721 });722})723/**724 * Flow Preserve - Step 6 - Collect Your Ticket725 */726$("#flow_advanced_reserve_collect_button").click(function() {727 $("#flow_advanced_reserve_collect_button").attr("disabled",true);728 var executeInfo = new Object();729 executeInfo.orderId = $("#flow_advanced_reserve_collect_order_id").val();730 var data = JSON.stringify(executeInfo);731 $.ajax({732 type: "post",733 url: "/execute/collected",734 contentType: "application/json",735 dataType: "json",736 data:data,737 xhrFields: {738 withCredentials: true739 },740 success: function(result){741 var obj = result;742 if(obj["status"] == true){743 $("#advanced_reserve_execute_order_id").val(executeInfo.orderId);744 location.hash="anchor_flow_advance_reserve_execute";745 }else{746 alert(obj["message"]);747 }748 },749 complete: function(){750 $("#flow_advanced_reserve_collect_button").attr("disabled",false);751 }752 });753});754/**755 * Flow Preserve - Step 7 - Enter Station756 */757$("#flow_advanced_reserve_execute_order_button").click(function() {758 $("#flow_advanced_reserve_execute_order_button").attr("disabled",true);759 var executeInfo = new Object();760 executeInfo.orderId = $("#advanced_reserve_execute_order_id").val();761 var data = JSON.stringify(executeInfo);762 $.ajax({763 type: "post",764 url: "/execute/execute",765 contentType: "application/json",766 dataType: "json",767 data:data,768 xhrFields: {769 withCredentials: true770 },771 success: function(result){772 var obj = result;773 if(obj["status"] == true){774 alert(obj["message"]);775 }else{776 alert(obj["message"]);777 }778 },779 complete: function(){780 $("#flow_advanced_reserve_execute_order_button").attr("disabled",false);781 }782 });...
BTHMultiple.js
Source:BTHMultiple.js
1// JScript File2 function Check_All(chk,gridname)3 { 4 var grid = document.getElementById(gridname);5 var i,j=0;6 var sum_TotalBalance_ToBePaid=0,sum_TotalAdvanceAmount = 0;sum_TotalTDSAmount = 0;7 var checkbox,txt_Balance_To_Be_Paid,txt_Advance_Amt,ddl_AddLess;8 var txt_Total_Balance_To_Be_Paid = document.getElementById('WucBTHMultiple1_txt_Total_Balance_To_Be_Paid');9 var txt_Total_Advance_Amount = document.getElementById('WucBTHMultiple1_txt_Total_Advance_Amount');10 var txt_TotalPayableAmount = document.getElementById('WucBTHMultiple1_txt_TotalPayableAmount');11 var txt_Total_TDS_Amount = document.getElementById('WucBTHMultiple1_txt_Total_TDS_Amount');12 var hdn_Total_Balance_To_Be_Paid= document.getElementById('WucBTHMultiple1_hdn_Total_Balance_To_Be_Paid');13 var hdn_TotalLHPO = document.getElementById('WucBTHMultiple1_hdn_TotalLHPO');14 var hdn_Total_Advance_Amount = document.getElementById('WucBTHMultiple1_hdn_Total_Advance_Amount');15 var hdn_Total_Payable_Amount = document.getElementById('WucBTHMultiple1_hdn_Total_Payable_Amount');16 var hdn_Total_TDS_Amount = document.getElementById('WucBTHMultiple1_hdn_Total_TDS_Amount');17 var max = (grid.rows.length - 1);18 for(i=1;i<grid.rows.length;i++)19 {20 checkbox = grid.rows[i].cells[0].getElementsByTagName('input');21 txt_Balance_To_Be_Paid= grid.rows[i].cells[14].getElementsByTagName('input');22 ddl_AddLess = grid.rows[i].cells[15].getElementsByTagName('select');23 txt_Advance_Amt= grid.rows[i].cells[17].getElementsByTagName('input');24 lbl_TDS_Amount = grid.rows[i].cells[19].getElementsByTagName('span');25 26 if(checkbox[0].type = 'checkbox')27 {28 checkbox[0].checked = chk.checked;29 }30 31 if(chk.checked == true)32 {33 Calculate_TDS_Amount(txt_Advance_Amt,ddl_AddLess,lbl_TDS_Amount)34 35 if(txt_Balance_To_Be_Paid[0].type =='text')36 {37 sum_TotalBalance_ToBePaid = val(sum_TotalBalance_ToBePaid) + val(txt_Balance_To_Be_Paid[0].value);38 }39 if(txt_Advance_Amt[0].type =='text')40 {41 if(val(ddl_AddLess[0].value)== 0)42 {43 sum_TotalAdvanceAmount = val(sum_TotalAdvanceAmount) + 0;44 sum_TotalTDSAmount = val(sum_TotalTDSAmount) + 0;45 }46 else if(val(ddl_AddLess[0].value)== 1)47 {48 sum_TotalAdvanceAmount = val(sum_TotalAdvanceAmount) + val(txt_Advance_Amt[0].value);49 sum_TotalTDSAmount = val(sum_TotalTDSAmount) + val(lbl_TDS_Amount[0].innerText);50 }51 else if(val(ddl_AddLess[0].value)== 2)52 {53 sum_TotalAdvanceAmount = val(sum_TotalAdvanceAmount) - val(txt_Advance_Amt[0].value);54 sum_TotalTDSAmount = val(sum_TotalTDSAmount) - val(lbl_TDS_Amount[0].innerText);55 }56 }57 } 58 }59 60 if(chk.checked == true)61 {62 txt_Total_Balance_To_Be_Paid.value = roundNumber(sum_TotalBalance_ToBePaid,2);63 txt_Total_Advance_Amount.value = roundNumber(val(sum_TotalAdvanceAmount),2);64 txt_Total_TDS_Amount.value = roundNumber(val(sum_TotalTDSAmount),2);65 txt_TotalPayableAmount.value = roundNumber(val(sum_TotalBalance_ToBePaid) + val(sum_TotalAdvanceAmount) - val(sum_TotalTDSAmount),2);66 67 hdn_TotalLHPO.value = max;68 hdn_Total_Balance_To_Be_Paid.value = roundNumber(sum_TotalBalance_ToBePaid,2);69 hdn_Total_Advance_Amount.value = roundNumber(val(sum_TotalAdvanceAmount),2);70 hdn_Total_TDS_Amount.value = roundNumber(val(sum_TotalTDSAmount),2);71 hdn_Total_Payable_Amount.value = roundNumber(val(sum_TotalBalance_ToBePaid) + val(sum_TotalAdvanceAmount) - val(sum_TotalTDSAmount),2);72 }73 else74 {75 txt_Total_Balance_To_Be_Paid.value = 0;76 txt_Total_Advance_Amount.value = 0;77 txt_TotalPayableAmount.value = 0;78 txt_Total_TDS_Amount.value = 0;79 hdn_TotalLHPO.value = 0;80 hdn_Total_Balance_To_Be_Paid.value = 0;81 hdn_Total_Advance_Amount.value = 0;82 hdn_Total_Payable_Amount.value = 0;83 hdn_Total_TDS_Amount.value = 0;84 }85 }86 function Check_Single(chk,gridname,callfrom)87 {88 if(callfrom == 1)89 {90 var grid = document.getElementById(gridname);91 }92 else93 {94 var grid = document.getElementById('WucBTHMultiple1_dg_BTH_LHPO');95 }96 var checkall = grid.rows[0].cells[0].getElementsByTagName('input');97 var row = chk.parentElement.parentElement;98 var txt_Balance_To_Be_Paid,txt_Other_Amount,ddl_AddLess,hdn_Previous_Value,lbl_TDS_Amount;99 var txt_Total_Balance_To_Be_Paid = document.getElementById('WucBTHMultiple1_txt_Total_Balance_To_Be_Paid');100 var txt_Total_Advance_Amount = document.getElementById('WucBTHMultiple1_txt_Total_Advance_Amount');101 var txt_TotalPayableAmount = document.getElementById('WucBTHMultiple1_txt_TotalPayableAmount');102 var txt_Total_TDS_Amount = document.getElementById('WucBTHMultiple1_txt_Total_TDS_Amount');103 var hdn_Total_Balance_To_Be_Paid= document.getElementById('WucBTHMultiple1_hdn_Total_Balance_To_Be_Paid');104 var hdn_Total_Advance_Amount = document.getElementById('WucBTHMultiple1_hdn_Total_Advance_Amount');105 var hdn_Total_Payable_Amount = document.getElementById('WucBTHMultiple1_hdn_Total_Payable_Amount');106 var hdn_TotalLHPO = document.getElementById('WucBTHMultiple1_hdn_TotalLHPO');107 var hdn_Total_TDS_Amount = document.getElementById('WucBTHMultiple1_hdn_Total_TDS_Amount');108// var hdn_Previous_Value = document.getElementById('WucBTHMultiple1_hdn_Previous_Value');109 txt_Balance_To_Be_Paid= row.cells[14].getElementsByTagName('input');110 ddl_AddLess = row.cells[15].getElementsByTagName('select');111 txt_Other_Amount= row.cells[17].getElementsByTagName('input');112 hdn_Previous_Value = row.cells[18].getElementsByTagName('input');113 lbl_TDS_Amount = row.cells[19].getElementsByTagName('span');114 115 if(callfrom == 1)116 {117 if(chk.checked == true)118 {119 txt_Total_Balance_To_Be_Paid.value = roundNumber(val(txt_Total_Balance_To_Be_Paid.value) + val(txt_Balance_To_Be_Paid[0].value),2);120 121 Calculate_TDS_Amount(txt_Other_Amount,ddl_AddLess,lbl_TDS_Amount);122 123 if(val(ddl_AddLess[0].value) == 0)124 {125 txt_Total_Advance_Amount.value = roundNumber(val(txt_Total_Advance_Amount.value) + 0,2);126 hdn_Total_Advance_Amount.value = roundNumber(val(hdn_Total_Advance_Amount.value) + 0,2);127 128 txt_Total_TDS_Amount.value = roundNumber(val(txt_Total_TDS_Amount.value) + 0,2);129 hdn_Total_TDS_Amount.value = roundNumber(val(hdn_Total_TDS_Amount.value) + 0,2);130 }131 else if(val(ddl_AddLess[0].value) == 1)132 {133 txt_Total_Advance_Amount.value = roundNumber(val(txt_Total_Advance_Amount.value) + val(txt_Other_Amount[0].value),2);134 hdn_Total_Advance_Amount.value = roundNumber(val(hdn_Total_Advance_Amount.value) + val(txt_Other_Amount[0].value),2);135 136 txt_Total_TDS_Amount.value = roundNumber(val(txt_Total_TDS_Amount.value) + val(lbl_TDS_Amount[0].innerText),2);137 hdn_Total_TDS_Amount.value = roundNumber(val(hdn_Total_TDS_Amount.value) + val(lbl_TDS_Amount[0].innerText),2);138 }139 else if(val(ddl_AddLess[0].value) == 2)140 {141 txt_Total_Advance_Amount.value = roundNumber(val(txt_Total_Advance_Amount.value) - val(txt_Other_Amount[0].value),2);142 hdn_Total_Advance_Amount.value = roundNumber(val(hdn_Total_Advance_Amount.value) - val(txt_Other_Amount[0].value),2);143 144 txt_Total_TDS_Amount.value = roundNumber(val(txt_Total_TDS_Amount.value) - val(lbl_TDS_Amount[0].innerText),2);145 hdn_Total_TDS_Amount.value = roundNumber(val(hdn_Total_TDS_Amount.value) - val(lbl_TDS_Amount[0].innerText),2);146 }147 148 txt_TotalPayableAmount.value = roundNumber(val(txt_Total_Balance_To_Be_Paid.value) + val(txt_Total_Advance_Amount.value) - val(txt_Total_TDS_Amount.value),2);149 hdn_TotalLHPO.value = val(hdn_TotalLHPO.value) + 1;150 151 hdn_Total_Balance_To_Be_Paid.value = roundNumber(val(hdn_Total_Balance_To_Be_Paid.value) + val(txt_Balance_To_Be_Paid[0].value),2);152 hdn_Total_Payable_Amount.value = roundNumber(val(hdn_Total_Balance_To_Be_Paid.value) + val(hdn_Total_Advance_Amount.value) - val(hdn_Total_TDS_Amount.value),2);153 }154 else155 {156 txt_Total_Balance_To_Be_Paid.value = roundNumber(val(txt_Total_Balance_To_Be_Paid.value) - val(txt_Balance_To_Be_Paid[0].value),2);157 158 Calculate_TDS_Amount(txt_Other_Amount,ddl_AddLess,lbl_TDS_Amount);159 160 if(val(ddl_AddLess[0].value) == 0)161 {162 txt_Total_Advance_Amount.value = roundNumber(val(txt_Total_Advance_Amount.value) - 0,2);163 hdn_Total_Advance_Amount.value = roundNumber(val(hdn_Total_Advance_Amount.value) - 0,2);164 165 txt_Total_TDS_Amount.value = roundNumber(val(txt_Total_TDS_Amount.value) - 0,2);166 hdn_Total_TDS_Amount.value = roundNumber(val(hdn_Total_TDS_Amount.value) - 0,2);167 }168 else if(val(ddl_AddLess[0].value) == 1)169 {170 txt_Total_Advance_Amount.value = roundNumber(val(txt_Total_Advance_Amount.value) - val(txt_Other_Amount[0].value),2);171 hdn_Total_Advance_Amount.value = roundNumber(val(hdn_Total_Advance_Amount.value) - val(txt_Other_Amount[0].value),2);172 173 txt_Total_TDS_Amount.value = roundNumber(val(txt_Total_TDS_Amount.value) - val(lbl_TDS_Amount[0].innerText),2);174 hdn_Total_TDS_Amount.value = roundNumber(val(hdn_Total_TDS_Amount.value) - val(lbl_TDS_Amount[0].innerText),2);175 }176 else if(val(ddl_AddLess[0].value) == 2)177 {178 txt_Total_Advance_Amount.value = roundNumber(val(txt_Total_Advance_Amount.value) + val(txt_Other_Amount[0].value),2);179 hdn_Total_Advance_Amount.value = roundNumber(val(hdn_Total_Advance_Amount.value) + val(txt_Other_Amount[0].value),2);180 181 txt_Total_TDS_Amount.value = roundNumber(val(txt_Total_TDS_Amount.value) + val(lbl_TDS_Amount[0].innerText),2);182 hdn_Total_TDS_Amount.value = roundNumber(val(hdn_Total_TDS_Amount.value) + val(lbl_TDS_Amount[0].innerText),2);183 }184 txt_TotalPayableAmount.value = roundNumber(val(txt_Total_Balance_To_Be_Paid.value) + val(txt_Total_Advance_Amount.value) - val(txt_Total_TDS_Amount.value),2);185 hdn_TotalLHPO.value = val(hdn_TotalLHPO.value) - 1;186 187 hdn_Total_Balance_To_Be_Paid.value = roundNumber(val(hdn_Total_Balance_To_Be_Paid.value) - val(txt_Balance_To_Be_Paid[0].value),2);188 hdn_Total_Payable_Amount.value = roundNumber(val(hdn_Total_Balance_To_Be_Paid.value) + val(hdn_Total_Advance_Amount.value) - val(hdn_Total_TDS_Amount.value),2);189 }190 }191 192 if(callfrom == 2) //onblur of Other Amount193 {194 if(chk.checked == true)195 {196 Calculate_TDS_Amount(txt_Other_Amount,ddl_AddLess,lbl_TDS_Amount);197 198 if(val(ddl_AddLess[0].value) == 0)199 {200 hdn_Total_Advance_Amount.value = val(hdn_Total_Advance_Amount.value) + 0 ;201 txt_Total_Advance_Amount.value = val(hdn_Total_Advance_Amount.value);202 203 hdn_Total_TDS_Amount.value = val(hdn_Total_TDS_Amount.value) + 0;204 txt_Total_TDS_Amount.value = val(hdn_Total_TDS_Amount.value);205 }206 else if(val(ddl_AddLess[0].value) == 1)207 {208 hdn_Total_Advance_Amount.value = val(hdn_Total_Advance_Amount.value) + val(txt_Other_Amount[0].value);209 txt_Total_Advance_Amount.value = val(hdn_Total_Advance_Amount.value);210 211 hdn_Total_TDS_Amount.value = val(hdn_Total_TDS_Amount.value) + val(lbl_TDS_Amount[0].innerText);212 txt_Total_TDS_Amount.value = val(hdn_Total_TDS_Amount.value);213 }214 else if(val(ddl_AddLess[0].value) == 2)215 {216 hdn_Total_Advance_Amount.value = val(hdn_Total_Advance_Amount.value) - val(txt_Other_Amount[0].value);217 txt_Total_Advance_Amount.value = val(hdn_Total_Advance_Amount.value);218 219 hdn_Total_TDS_Amount.value = val(hdn_Total_TDS_Amount.value) - val(lbl_TDS_Amount[0].innerText);220 txt_Total_TDS_Amount.value = val(hdn_Total_TDS_Amount.value);221 }222 223 txt_TotalPayableAmount.value = val(hdn_Total_Balance_To_Be_Paid.value) + val(hdn_Total_Advance_Amount.value) - val(hdn_Total_TDS_Amount.value);224 hdn_Total_Payable_Amount.value = val(hdn_Total_Balance_To_Be_Paid.value) + val(hdn_Total_Advance_Amount.value) - val(hdn_Total_TDS_Amount.value);225 }226 }227 228 if(callfrom == 3 && chk.checked == true) //onfocus of Other Amount229 {230 Calculate_TDS_Amount(txt_Other_Amount,ddl_AddLess,lbl_TDS_Amount);231 232 if(val(ddl_AddLess[0].value) == 0)233 {234 hdn_Total_Advance_Amount.value = val(hdn_Total_Advance_Amount.value) - 0;235 txt_Total_Advance_Amount.value = val(hdn_Total_Advance_Amount.value);236 237 hdn_Total_TDS_Amount.value = val(hdn_Total_TDS_Amount.value) - 0;238 txt_Total_TDS_Amount.value = val(hdn_Total_TDS_Amount.value);239 }240 else if(val(ddl_AddLess[0].value) == 1)241 {242 hdn_Total_Advance_Amount.value = val(hdn_Total_Advance_Amount.value) - val(txt_Other_Amount[0].value);243 txt_Total_Advance_Amount.value = val(hdn_Total_Advance_Amount.value);244 245 hdn_Total_TDS_Amount.value = val(hdn_Total_TDS_Amount.value) - val(lbl_TDS_Amount[0].innerText);246 txt_Total_TDS_Amount.value = val(hdn_Total_TDS_Amount.value);247 }248 else if(val(ddl_AddLess[0].value) == 2)249 {250 hdn_Total_Advance_Amount.value = val(hdn_Total_Advance_Amount.value) + val(txt_Other_Amount[0].value);251 txt_Total_Advance_Amount.value = val(hdn_Total_Advance_Amount.value);252 253 hdn_Total_TDS_Amount.value = val(hdn_Total_TDS_Amount.value) + val(lbl_TDS_Amount[0].innerText);254 txt_Total_TDS_Amount.value = val(hdn_Total_TDS_Amount.value);255 }256 257 txt_TotalPayableAmount.value = val(hdn_Total_Balance_To_Be_Paid.value) + val(hdn_Total_Advance_Amount.value) - val(hdn_Total_TDS_Amount.value);258 hdn_Total_Payable_Amount.value = val(hdn_Total_Balance_To_Be_Paid.value) + val(hdn_Total_Advance_Amount.value) - val(hdn_Total_TDS_Amount.value);259 }260 261 if(callfrom == 4 && chk.checked == true) //onchange of IS ADD/LESS262 {263// if(val(ddl_AddLess[0].value) != '0')264// {265// hdn_Previous_Value[0].value = val(ddl_AddLess[0].value);266// }267 268 if(val(ddl_AddLess[0].value) == 0)269 {270 if(val(hdn_Previous_Value[0].value)== 1)271 {272 hdn_Total_Advance_Amount.value = val(hdn_Total_Advance_Amount.value) - val(txt_Other_Amount[0].value);273 txt_Total_Advance_Amount.value = val(hdn_Total_Advance_Amount.value);274 275 hdn_Total_TDS_Amount.value = val(hdn_Total_TDS_Amount.value) - val(lbl_TDS_Amount[0].innerText);276 txt_Total_TDS_Amount.value = val(hdn_Total_TDS_Amount.value);277 }278 else if(val(hdn_Previous_Value[0].value)== 2)279 {280 hdn_Total_Advance_Amount.value = val(hdn_Total_Advance_Amount.value) + val(txt_Other_Amount[0].value);281 txt_Total_Advance_Amount.value = val(hdn_Total_Advance_Amount.value);282 }283 284 Calculate_TDS_Amount(txt_Other_Amount,ddl_AddLess,lbl_TDS_Amount); 285 286 }287 else if(val(ddl_AddLess[0].value) == 1)288 {289 Calculate_TDS_Amount(txt_Other_Amount,ddl_AddLess,lbl_TDS_Amount); 290 291 if(val(hdn_Previous_Value[0].value)== 0)292 {293 hdn_Total_Advance_Amount.value = val(hdn_Total_Advance_Amount.value) + val(txt_Other_Amount[0].value);294 txt_Total_Advance_Amount.value = val(hdn_Total_Advance_Amount.value);295 296 hdn_Total_TDS_Amount.value = val(hdn_Total_TDS_Amount.value) + val(lbl_TDS_Amount[0].innerText);297 txt_Total_TDS_Amount.value = val(hdn_Total_TDS_Amount.value);298 }299 else if(val(hdn_Previous_Value[0].value)== 2)300 {301 hdn_Total_Advance_Amount.value = val(hdn_Total_Advance_Amount.value) + val(val(txt_Other_Amount[0].value) + val(txt_Other_Amount[0].value));302 txt_Total_Advance_Amount.value = val(hdn_Total_Advance_Amount.value);303 304 hdn_Total_TDS_Amount.value = val(hdn_Total_TDS_Amount.value) + val(lbl_TDS_Amount[0].innerText);305 txt_Total_TDS_Amount.value = val(hdn_Total_TDS_Amount.value);306 }307 }308 else if(val(ddl_AddLess[0].value) == 2)309 {310 if(val(hdn_Previous_Value[0].value)== 0)311 {312 hdn_Total_Advance_Amount.value = val(hdn_Total_Advance_Amount.value) - val(txt_Other_Amount[0].value);313 txt_Total_Advance_Amount.value = val(hdn_Total_Advance_Amount.value);314 315 }316 else if(val(hdn_Previous_Value[0].value)== 1)317 {318 hdn_Total_Advance_Amount.value = val(hdn_Total_Advance_Amount.value) - val(val(txt_Other_Amount[0].value) + val(txt_Other_Amount[0].value));319 txt_Total_Advance_Amount.value = val(hdn_Total_Advance_Amount.value);320 321 hdn_Total_TDS_Amount.value = val(hdn_Total_TDS_Amount.value) - val(lbl_TDS_Amount[0].innerText);322 txt_Total_TDS_Amount.value = val(hdn_Total_TDS_Amount.value);323 }324 325 Calculate_TDS_Amount(txt_Other_Amount,ddl_AddLess,lbl_TDS_Amount);326 }327 328 329 txt_TotalPayableAmount.value = val(hdn_Total_Balance_To_Be_Paid.value) + val(hdn_Total_Advance_Amount.value) - val(hdn_Total_TDS_Amount.value);330 hdn_Total_Payable_Amount.value = val(hdn_Total_Balance_To_Be_Paid.value) + val(hdn_Total_Advance_Amount.value) - val(hdn_Total_TDS_Amount.value);331 332// if(val(ddl_AddLess[0].value) != '0')333// {334 hdn_Previous_Value[0].value = val(ddl_AddLess[0].value);335// }336 }337 338 if(callfrom == 5)339 {340 var max = (grid.rows.length - 1);341 var sum_TotalBalance_ToBePaid=0,sum_TotalAdvanceAmount = 0;sum_TotalTDSAmount = 0;342 343 for(i = 1; i < grid.rows.length ; i++)344 {345 checkbox = grid.rows[i].cells[0].getElementsByTagName('input');346 txt_Balance_To_Be_Paid= grid.rows[i].cells[14].getElementsByTagName('input');347 ddl_AddLess = grid.rows[i].cells[15].getElementsByTagName('select');348 txt_Advance_Amt= grid.rows[i].cells[17].getElementsByTagName('input');349 lbl_TDS_Amount = grid.rows[i].cells[19].getElementsByTagName('span');350 351 if(checkbox[0].checked == true)352 {353 354 Calculate_TDS_Amount(txt_Advance_Amt,ddl_AddLess,lbl_TDS_Amount)355 356 if(txt_Balance_To_Be_Paid[0].type =='text')357 {358 sum_TotalBalance_ToBePaid = val(sum_TotalBalance_ToBePaid) + val(txt_Balance_To_Be_Paid[0].value);359 }360 361 if(txt_Advance_Amt[0].type =='text')362 {363 if(val(ddl_AddLess[0].value)== 0)364 {365 sum_TotalAdvanceAmount = val(sum_TotalAdvanceAmount) + 0;366 sum_TotalTDSAmount = val(sum_TotalTDSAmount) + 0;367 }368 else if(val(ddl_AddLess[0].value)== 1)369 {370 sum_TotalAdvanceAmount = val(sum_TotalAdvanceAmount) + val(txt_Advance_Amt[0].value);371 sum_TotalTDSAmount = val(sum_TotalTDSAmount) + val(lbl_TDS_Amount[0].innerText);372 }373 else if(val(ddl_AddLess[0].value)== 2)374 {375 sum_TotalAdvanceAmount = val(sum_TotalAdvanceAmount) - val(txt_Advance_Amt[0].value);376 sum_TotalTDSAmount = val(sum_TotalTDSAmount) - val(lbl_TDS_Amount[0].innerText);377 }378 }379 }380 }381 382 txt_Total_Balance_To_Be_Paid.value = roundNumber(sum_TotalBalance_ToBePaid,2);383 txt_Total_Advance_Amount.value = roundNumber(val(sum_TotalAdvanceAmount),2);384 txt_Total_TDS_Amount.value = roundNumber(val(sum_TotalTDSAmount),2);385 txt_TotalPayableAmount.value = roundNumber(val(sum_TotalBalance_ToBePaid) + val(sum_TotalAdvanceAmount) - val(sum_TotalTDSAmount),2);386 387 hdn_TotalLHPO.value = max;388 hdn_Total_Balance_To_Be_Paid.value = roundNumber(sum_TotalBalance_ToBePaid,2);389 hdn_Total_Advance_Amount.value = roundNumber(val(sum_TotalAdvanceAmount),2);390 hdn_Total_TDS_Amount.value = roundNumber(val(sum_TotalTDSAmount),2);391 hdn_Total_Payable_Amount.value = roundNumber(val(sum_TotalBalance_ToBePaid) + val(sum_TotalAdvanceAmount) - val(sum_TotalTDSAmount),2);392 }393 394 if((grid.rows.length-1) == val(hdn_TotalLHPO.value))395 {396 checkall[0].checked = true;397 }398 else399 {400 checkall[0].checked = false;401 }402 403 } 404 405 function Allow_To_Save()406 {407 var lbl_Error = document.getElementById('WucBTHMultiple1_lbl_Errors');408 var ddl_BrokerOwner = document.getElementById('WucBTHMultiple1_ddl_OwnerBroker_hdnddl_OwnerBroker');409 var Total_Payable_Amount = document.getElementById('WucBTHMultiple1_hdn_Total_Payable_Amount');410 var hdn_TotalLHPO = document.getElementById('WucBTHMultiple1_hdn_TotalLHPO');411 var Hdn_LHPOCaption = document.getElementById('WucBTHMultiple1_Hdn_LHPOCaption');412 if(val(ddl_BrokerOwner.value) <= 0)413 {414 lbl_Error.innerText = 'Please Select Owner/Broker';415 return false;416 } 417 else if(val(hdn_TotalLHPO.value) <= 0)418 {419 lbl_Error.innerText = 'Please Select Atleast One '+ Hdn_LHPOCaption.value + ' No.';420 return false;421 }422 else if(val(Total_Payable_Amount.value) <= 0)423 {424 lbl_Error.innerText = 'Total Payable Amount Should be Greater Than Zero';425 return false;426 }427 if(validateWUCCheque(lbl_Error) == false)428 {return false;}429 return true;430 } 431 432function viewwindow(DocType,DocNo)433{434 var Path='../../TrackNTrace/FrmMainTrackNTrace.aspx?Doc_Type='+ DocType +'&Doc_No=' + DocNo ;435 var w = screen.availWidth;436 var h = screen.availHeight;437 var popW = (w-100);438 var popH = (h-100);439 var leftPos = (w-popW)/2;440 var topPos = (h-popH)/2;441 442 window.open(Path, 'CustomPopUp_Track_And_Trace', 'width='+ popW +', height='+ popH +',top='+ topPos +',left='+ leftPos +', menubar=no, resizable=no,scrollbars=yes');443 return false;444}445function Calculate_TDS_Amount(txt_Other_Amount1,ddl_AddLess1,lbl_TDS_Amount1)446{447 var txt_Other_Amount = txt_Other_Amount1;448 var ddl_AddLess = ddl_AddLess1;449 var lbl_TDS_Amount = lbl_TDS_Amount1;450 451 var hdn_Tax_Rate = document.getElementById('WucBTHMultiple1_hdn_Tax_Rate');452 var hdn_Surcharge_Rate = document.getElementById('WucBTHMultiple1_hdn_Surcharge_Rate');453 var hdn_Add_Surcharge_Rate = document.getElementById('WucBTHMultiple1_hdn_Add_Surcharge_Rate');454 var hdn_Add_Edu_Cess_Rate = document.getElementById('WucBTHMultiple1_hdn_Add_Edu_Cess_Rate');455 var Amount = val(txt_Other_Amount[0].value);456 var TDS_Amount = 0;457 var Tax_Amount = 0;458 var Surcharge_Amount = 0;459 var Add_Surcharge_Amount = 0;460 var Add_Edu_Cess_Amount = 0;461 Tax_Amount = (Amount * val(hdn_Tax_Rate.value))/100;462 Surcharge_Amount = (val(Tax_Amount) * val(hdn_Surcharge_Rate.value))/100;463 Add_Surcharge_Amount = ((val(Tax_Amount) + val(Surcharge_Amount)) * val(hdn_Add_Surcharge_Rate.value))/100;464 Add_Edu_Cess_Amount = ((val(Tax_Amount) + val(Surcharge_Amount)) * val(hdn_Add_Edu_Cess_Rate.value))/100;465 466 if(val(ddl_AddLess[0].value) == 1)467 {468 TDS_Amount = Tax_Amount + Surcharge_Amount + Add_Surcharge_Amount + Add_Edu_Cess_Amount;469 }470 else471 {472 TDS_Amount = 0;473 }474 475 lbl_TDS_Amount[0].innerText = Math.ceil(TDS_Amount);476 477 ...
advanceManager.js
Source:advanceManager.js
...40 var advanceTemplate = templateManager.GetTemplateByID('AdvanceTemplate', tempID);41 if (null == advanceTemplate) {42 continue;43 }44 var tempInfo = new advance();45 tempInfo.SetAllAdvanceInfo(List[index]);46 this.advanceList[tempID] = tempInfo;47 }48 this.UpdateAdvanceInfo();49};50handler.GetSqlStr = function () {51 return utilSql.BuildSqlStringFromObjects(this.advanceList, 'GetAdvanceInfo', eAdvanceInfo);52};53// åç54handler.SaveAdvanceInfo = function () {55 var sqlStr = utilSql.BuildSqlStringFromObjects(this.advanceList, 'GetAdvanceInfo', eAdvanceInfo);56 csSql.SaveAdvanceInfo(this.owner.GetPlayerInfo(gameConst.ePlayerInfo.ROLEID), sqlStr, function (err) {57 if (!!err) {58 logger.error("save Advance info error=%s", err.stack);59 }60 });61};62// æ¸
çè¿æçæ´»å¨63handler.UpdateAdvanceInfo = function(){64 var nowTime = new Date();65 for (var index in this.advanceList) {66 var advInfo = this.advanceList[index];67 var advDate = new Date(advInfo.GetAdvanceInfo(eAdvanceInfo.EndTime));68 if(nowTime > advDate){69 delete this.advanceList[index];70 }71 }72};73// æ´æ°12ç¹ä¿¡æ¯74handler.Update12Info = function(){75 var player = this.owner;76 var processed = [];77 for (var index in this.advanceList) {78 var advInfo = this.advanceList[index];79 var id = advInfo.GetAdvanceInfo(eAdvanceInfo.TempID);80 var advanceTemplate = templateManager.GetTemplateByID('AdvanceTemplate', id);81 if (null == advanceTemplate) {82 continue;83 }84 if(advanceTemplate['dailyClear'] > 0){85 advInfo.SetAdvanceInfo(eAdvanceInfo.RewardStep, 0);86 processed.push(parseInt(id));87 }88 }89 if(processed.length > 0){90 this.SendAdvanceChange(processed, 1);91 }92 // 累计ç»é93 this.ProcessAdvance(gameConst.eAdvanceType.Advance_AllLogin, 1, 0);94 var nowLogin = new Date();95 var refreshTime = new Date(this.owner.playerInfo[ePlayerInfo.RefreshTime]);96 // è¿ç»ç»éï¼ä¸æ¯æ¨ç天æ°å°±æ¸
æ97 if(utils.getDayOfDiff(nowLogin, refreshTime) != 1){98 this.ClearAdvanceState(gameConst.eAdvanceType.Advance_RunningLogin);99 }100 this.ProcessAdvance(gameConst.eAdvanceType.Advance_RunningLogin, 1, 0);101 this.ProcessAdvance(gameConst.eAdvanceType.Advance_PayOneMoney, 0, 1);102 player.GetAdvanceManager().ProcessAdvance(gameConst.eAdvanceType.Advance_VIPLevel, player.GetPlayerInfo(ePlayerInfo.VipLevel), 1);103 player.GetAdvanceManager().ProcessAdvance(gameConst.eAdvanceType.Advance_PlayerLevel, player.GetPlayerInfo(ePlayerInfo.ExpLevel), 1);104};105// æ´æ°æ´»å¨çæ¡ä»¶è¿åº¦106handler.ProcessCondition = function(conditionType, value, processType){107 var runningAdvance = advanceController.getRunningAdvanceByCondition(conditionType);108 var nowDate = new Date();109 var roleID = this.owner.GetPlayerInfo(ePlayerInfo.ROLEID);110 var processed = [];111 var reached = [];112 for(var attID in runningAdvance){113 var advanceTemplate = templateManager.GetTemplateByID('AdvanceTemplate', attID);114 if (null == advanceTemplate) {115 continue;116 }117 var advInfo = this.advanceList[attID];118 if(advInfo == null || nowDate >= advInfo.GetAdvanceInfo(eAdvanceInfo.EndTime)) {119 advInfo = new advance();120 advInfo.SetAdvanceInfo(eAdvanceInfo.RoleID, roleID);121 advInfo.SetAdvanceInfo(eAdvanceInfo.TempID, attID);122 advInfo.SetAdvanceInfo(eAdvanceInfo.EndTime, utilSql.DateToString(new Date(advanceTemplate['endTime'])));123 this.advanceList[attID] = advInfo;124 }125 var oldPoint = advInfo.GetAdvanceInfo(eAdvanceInfo.ConditionPoint);126 if(processType == 0){127 advInfo.SetAdvanceInfo(eAdvanceInfo.ConditionPoint, oldPoint + value);128 }else{129 if(value > oldPoint){130 advInfo.SetAdvanceInfo(eAdvanceInfo.ConditionPoint, value);131 }132 }133 //134 if(oldPoint < advanceTemplate['condPara'] && advInfo.GetAdvanceInfo(eAdvanceInfo.ConditionPoint) >= advanceTemplate['condPara']){135 reached.push(attID);136 }137 processed.push(parseInt(attID));138 }139 for(var i = 0; i < reached.length; ++i){140 this.refreshAdvance(reached[i]);141 }142 if(processed.length > 0){143 this.SendAdvanceChange(processed, 1);144 }145};146// æ¸
çæ´»å¨ä¿¡æ¯147handler.ClearAdvanceState = function(advanceType){148 var runningAdvance = advanceController.getRunningAdvanceByType(advanceType);149 var nowDate = new Date();150 var roleID = this.owner.GetPlayerInfo(ePlayerInfo.ROLEID);151 for(var attID in runningAdvance) {152 var advanceTemplate = templateManager.GetTemplateByID('AdvanceTemplate', attID);153 if (null == advanceTemplate) {154 continue;155 }156 var advInfo = this.advanceList[attID];157 if (advInfo == null || nowDate >= advInfo.GetAdvanceInfo(eAdvanceInfo.EndTime)) {158 advInfo = new advance();159 advInfo.SetAdvanceInfo(eAdvanceInfo.RoleID, roleID);160 advInfo.SetAdvanceInfo(eAdvanceInfo.TempID, attID);161 advInfo.SetAdvanceInfo(eAdvanceInfo.EndTime, utilSql.DateToString(new Date(advanceTemplate['endTime'])));162 this.advanceList[attID] = advInfo;163 }164 advInfo.SetAdvanceInfo(eAdvanceInfo.AdvancePoint, 0);165 advInfo.SetAdvanceInfo(eAdvanceInfo.ReachStep, 0);166 if(advanceTemplate['dailyClear'] > 0){167 advInfo.SetAdvanceInfo(eAdvanceInfo.RewardStep, 0);168 }169 }170};171// æ´æ°æ´»å¨è¿åº¦ processType 0:add 1 : update172handler.ProcessAdvance = function(advanceType, value, processType){173 //logger.error('advanceType is %j,value is %j, processType is %j', advanceType, value, processType);174 var runningAdvance = advanceController.getRunningAdvanceByType(advanceType);175 var nowDate = new Date();176 var roleID = this.owner.GetPlayerInfo(ePlayerInfo.ROLEID);177 var processed = [];178 var oldPoint = 0;179 for(var attID in runningAdvance){180 var advanceTemplate = templateManager.GetTemplateByID('AdvanceTemplate', attID);181 if (null == advanceTemplate) {182 continue;183 }184 var advInfo = this.advanceList[attID];185 if(advInfo == null || nowDate >= advInfo.GetAdvanceInfo(eAdvanceInfo.EndTime)) {186 advInfo = new advance();187 advInfo.SetAdvanceInfo(eAdvanceInfo.RoleID, roleID);188 advInfo.SetAdvanceInfo(eAdvanceInfo.TempID, attID);189 advInfo.SetAdvanceInfo(eAdvanceInfo.EndTime, utilSql.DateToString(new Date(advanceTemplate['endTime'])));190 this.advanceList[attID] = advInfo;191 }192 // 没æè¾¾å°æ¡ä»¶çï¼ä¸å¤ç193 oldPoint = advInfo.GetAdvanceInfo(eAdvanceInfo.AdvancePoint);194 if(advInfo.GetAdvanceInfo(eAdvanceInfo.ConditionPoint) >= advanceTemplate['condPara']){195 if(processType == 0){196 advInfo.SetAdvanceInfo(eAdvanceInfo.AdvancePoint, oldPoint + value);197 }else{198 advInfo.SetAdvanceInfo(eAdvanceInfo.AdvancePoint, value);199 }200 }201 processed.push(parseInt(attID));202 }203 //ç¹æ®å¤ç 累计å
å¼æ»¡è¶³ç天æ°å¥å± Advance_PayDayï¼æ»¡è¶³æ¡ä»¶å¤©æ°å ä¸ï¼204 if(advanceType == gameConst.eAdvanceType.Advance_PayOneMoney){205 var runningAdvancePayDay = advanceController.getRunningAdvanceByType(gameConst.eAdvanceType.Advance_PayDay);206 var nowDate = new Date();207 for(var attID in runningAdvancePayDay) {208 var advanceTemplatePayDay = templateManager.GetTemplateByID('AdvanceTemplate', attID);209 if (null == advanceTemplatePayDay) {210 continue;211 }212 var condPara = advanceTemplatePayDay['condPara'];213 var advInfoPayDay = this.advanceList[attID];214 if(advInfoPayDay == null || nowDate >= advInfoPayDay.GetAdvanceInfo(eAdvanceInfo.EndTime)) {215 advInfoPayDay = new advance();216 advInfoPayDay.SetAdvanceInfo(eAdvanceInfo.RoleID, roleID);217 advInfoPayDay.SetAdvanceInfo(eAdvanceInfo.TempID, attID);218 advInfoPayDay.SetAdvanceInfo(eAdvanceInfo.EndTime, utilSql.DateToString(new Date(advanceTemplatePayDay['endTime'])));219 this.advanceList[attID] = advInfoPayDay;220 }221 oldPoint = advInfoPayDay.GetAdvanceInfo(eAdvanceInfo.ConditionPoint);222 //logger.fatal("##############Advance_PayOneMoney: oldPoint: %j, condPara: %j", oldPoint, condPara);223 if(0 == value && 1 == processType){224 advInfoPayDay.SetAdvanceInfo(eAdvanceInfo.ConditionPoint, value);225 }else{226 //PSï¼æ¯å¤©æ»¡è¶³æ¡ä»¶åªå ä¸æ¬¡227 if(oldPoint >= condPara){228 continue;229 }230 advInfoPayDay.SetAdvanceInfo(eAdvanceInfo.ConditionPoint, oldPoint + value);231 //å¦æå½å¤©ç´¯è®¡éé¢å·²ç»ç¬¦åè¦æ± å累计天æ°å¢å ä¸232 if (advInfoPayDay != null && (oldPoint + value)>=condPara && nowDate < new Date(advInfoPayDay.GetAdvanceInfo(eAdvanceInfo.EndTime))) {233 var oldPointPayDay = advInfoPayDay.GetAdvanceInfo(eAdvanceInfo.AdvancePoint);234 advInfoPayDay.SetAdvanceInfo(eAdvanceInfo.AdvancePoint, oldPointPayDay + 1);235 }236 //logger.fatal("##############Advance_PayOneMoney: advInfoPayDay: %j,", advInfoPayDay);237 processed.push(parseInt(attID));238 }239 }240 }241 //åæ¥ç´¯è®¡å
å¼æ»¡è¶³çå¤©æ° ç»æ242 if(processed.length > 0){243 this.SendAdvanceChange(processed, 1);244 }245};246// å建ä¸ä¸ªç©ºçæ´»å¨247handler.createEmptyAdvance = function(advanceType){248 var runningAdvance = advanceController.getRunningAdvanceByType(advanceType);249 var processed = [];250 for(var attID in runningAdvance) {251 var advanceTemplate = templateManager.GetTemplateByID('AdvanceTemplate', attID);252 if (null == advanceTemplate) {253 continue;254 }255 var nowTime = new Date();256 if(this.advanceList[attID] != null){257 var advInfo = this.advanceList[attID];258 var advDate = new Date(advInfo.GetAdvanceInfo(eAdvanceInfo.EndTime));259 if(nowTime > advDate){260 delete this.advanceList[attID];261 }else{262 continue;263 }264 }265 var advanceInfo = new advance();266 advanceInfo.SetAdvanceInfo(eAdvanceInfo.RoleID, this.owner.GetPlayerInfo(ePlayerInfo.ROLEID));267 advanceInfo.SetAdvanceInfo(eAdvanceInfo.TempID, attID);268 advanceInfo.SetAdvanceInfo(eAdvanceInfo.EndTime, utilSql.DateToString(new Date(advanceTemplate['endTime'])));269 this.advanceList[attID] = advInfo;270 processed.push(attID);271 }272 if(processed.length > 0){273 this.SendAdvanceChange(processed, 1);274 }275};276// ç¹æ®å¤çæç»éé®é¢277handler.ProcessLoginAdvance = function () {278 var self = this;279 var processLogin = function(advanceType){280 var runningAdvance = advanceController.getRunningAdvanceByType(advanceType);281 var nowDate = new Date();282 var roleID = self.owner.GetPlayerInfo(ePlayerInfo.ROLEID);283 var processed = [];284 for(var attID in runningAdvance){285 var advanceTemplate = templateManager.GetTemplateByID('AdvanceTemplate', attID);286 if (null == advanceTemplate) {287 continue;288 }289 var advInfo = self.advanceList[attID];290 var created = false;291 if(advInfo == null || nowDate >= advInfo.GetAdvanceInfo(eAdvanceInfo.EndTime)) {292 advInfo = new advance();293 advInfo.SetAdvanceInfo(eAdvanceInfo.RoleID, roleID);294 advInfo.SetAdvanceInfo(eAdvanceInfo.TempID, attID);295 advInfo.SetAdvanceInfo(eAdvanceInfo.EndTime, utilSql.DateToString(new Date(advanceTemplate['endTime'])));296 self.advanceList[attID] = advInfo;297 created = true;298 }else{299 continue;300 }301 // 没æè¾¾å°æ¡ä»¶çï¼ä¸å¤ç302 if(advInfo.GetAdvanceInfo(eAdvanceInfo.ConditionPoint) < advanceTemplate['condPara']){303 if(created){304 processed.push(parseInt(attID));305 }306 continue;307 }308 advInfo.SetAdvanceInfo(eAdvanceInfo.AdvancePoint, 1);309 processed.push(parseInt(attID));310 }311 if(processed.length > 0){312 self.SendAdvanceChange(processed, 1);313 }314 };315 processLogin(gameConst.eAdvanceType.Advance_AllLogin);316 processLogin(gameConst.eAdvanceType.Advance_RunningLogin);317};318handler.refreshAdvance = function(attID){319 var advInfo = this.advanceList[attID];320 if(advInfo == null){321 return;322 }323 var advanceTemplate = templateManager.GetTemplateByID('AdvanceTemplate', attID);324 if (null == advanceTemplate) {325 return;326 }327 // 没æè¾¾å°æ¡ä»¶çï¼ä¸å¤ç328 if(advInfo.GetAdvanceInfo(eAdvanceInfo.ConditionPoint) < advanceTemplate['condPara']){329 return;330 }331 var advanceType = advanceTemplate['activeType'];332 var advancePoint = 0;333 switch (advanceType){334 case gameConst.eAdvanceType.Advance_AllLogin:335 case gameConst.eAdvanceType.Advance_RunningLogin:336 advancePoint = 1;337 break;338 case gameConst.eAdvanceType.Advance_PlayerLevel:339 advancePoint = this.owner.GetPlayerInfo(ePlayerInfo.ExpLevel);340 break;341 case gameConst.eAdvanceType.Advance_SigPower:342 var thisDay = new Date();343 var advanceDay = new Date(advanceTemplate['beginTime']);344 if(thisDay - advanceDay == 0){345 break;346 }347 advancePoint = this.owner.GetRoleChartManager().GetZhanliRanking();348 break;349 case gameConst.eAdvanceType.Advance_VIPLevel:350 advancePoint = this.owner.GetPlayerInfo(ePlayerInfo.VipLevel);351 break;352 case gameConst.eAdvanceType.Advance_PayDay:353 break;354 case gameConst.eAdvanceType.Advance_PayOneMoney:355 break;356 case gameConst.eAdvanceType.Advance_PayMoreMoney:357 break;358 default :359 logger.error('cant find the advance type %j', advanceType);360 break;361 }362 if(advancePoint > 0){363 advInfo.SetAdvanceInfo(eAdvanceInfo.AdvancePoint, advancePoint);364 }365};366// å¼å§æ´»å¨367handler.StartAdvance = function(attID){368 var self = this;369 if(this.advanceList[attID] != null){370 this.EndAdvance(attID);371 }372 var advanceTemplate = templateManager.GetTemplateByID('AdvanceTemplate', attID);373 if (null == advanceTemplate) {374 return;375 }376 var processed = [];377 var advInfo = new advance();378 advInfo.SetAdvanceInfo(eAdvanceInfo.RoleID, self.owner.GetPlayerInfo(ePlayerInfo.ROLEID));379 advInfo.SetAdvanceInfo(eAdvanceInfo.TempID, attID);380 advInfo.SetAdvanceInfo(eAdvanceInfo.EndTime, utilSql.DateToString(new Date(advanceTemplate['endTime'])));381 self.advanceList[attID] = advInfo;382 self.refreshAdvance(attID);383 processed.push(parseInt(attID));384 self.SendAdvanceChange(processed, 1);385};386// ç»ææ´»å¨387handler.EndAdvance = function(attID){388 if(this.advanceList[attID] != null){389 delete this.advanceList[attID];390 this.SendAdvanceChange([parseInt(attID)], 0);391 }...
AdvanceTableExamples.js
Source:AdvanceTableExamples.js
1import React from 'react';2import { Button } from 'react-bootstrap';3import PageHeader from 'components/common/PageHeader';4import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';5import FalconComponentCard from 'components/common/FalconComponentCard';6import IconButton from 'components/common/IconButton';7import AdvanceTable from 'components/common/advance-table/AdvanceTable';8import AdvanceTableFooter from 'components/common/advance-table/AdvanceTableFooter';9import AdvanceTableSearchBox from 'components/common/advance-table/AdvanceTableSearchBox';10import AdvanceTablePagination from 'components/common/advance-table/AdvanceTablePagination';11import AdvanceTableWrapper from 'components/common/advance-table/AdvanceTableWrapper';1213const data = `const columns = [14 {15 accessor: 'name',16 Header: 'Name'17 },18 {19 accessor: 'email',20 Header: 'Email'21 },22 {23 accessor: 'age',24 Header: 'Age'25 }26];2728const data = [29 {30 name: 'Anna',31 email: 'anna@example.com',32 age: 1833 },34 {35 name: 'Homer',36 email: 'homer@example.com',37 age: 3538 },39 {40 name: 'Oscar',41 email: 'oscar@example.com',42 age: 5243 },44 {45 name: 'Emily',46 email: 'emily@example.com',47 age: 3048 },49 {50 name: 'Jara',51 email: 'jara@example.com',52 age: 2553 },54 {55 name: 'Clark',56 email: 'clark@example.com',57 age: 3958 },59 {60 name: 'Jennifer',61 email: 'jennifer@example.com',62 age: 5263 },64 {65 name: 'Tony',66 email: 'tony@example.com',67 age: 3068 },69 {70 name: 'Tom',71 email: 'tom@example.com',72 age: 2573 },74 {75 name: 'Michael',76 email: 'michael@example.com',77 age: 3978 },79 {80 name: 'Antony',81 email: 'antony@example.com',82 age: 3983 },84 {85 name: 'Raymond',86 email: 'raymond@example.com',87 age: 5288 },89 {90 name: 'Marie',91 email: 'marie@example.com',92 age: 3093 },94 {95 name: 'Cohen',96 email: 'cohen@example.com',97 age: 2598 },99 {100 name: 'Rowen',101 email: 'rowen@example.com',102 age: 39103 }104];`;105106const exampleCode = `${data}107108function AdvanceTableExample() {109110 return(111 <AdvanceTableWrapper112 columns={columns}113 data={data}114 sortable115 pagination116 perPage={5}117 >118 <AdvanceTable119 table120 headerClassName="bg-200 text-900 text-nowrap align-middle"121 rowClassName="align-middle white-space-nowrap"122 tableProps={{123 bordered: true,124 striped: true,125 className: 'fs--1 mb-0 overflow-hidden'126 }}127 />128 <div className="mt-3">129 <AdvanceTableFooter130 rowCount={data.length}131 table132 rowInfo133 navButtons134 rowsPerPageSelection135 />136 </div>137 </AdvanceTableWrapper>138 )139}140141render(<AdvanceTableExample />)142`;143144const paginationNumberingCode = `${data}145146function AdvanceTableExample() {147148 return(149 <AdvanceTableWrapper150 columns={columns}151 data={data}152 sortable153 pagination154 perPage={5}155 >156 <AdvanceTable157 table158 headerClassName="bg-200 text-900 text-nowrap align-middle"159 rowClassName="align-middle white-space-nowrap"160 tableProps={{161 bordered: true,162 striped: true,163 className: 'fs--1 mb-0 overflow-hidden'164 }}165 />166 <div className="mt-3">167 <AdvanceTablePagination168 table169 />170 </div>171 </AdvanceTableWrapper>172 )173}174175render(<AdvanceTableExample />)176`;177178const selectionCode = `const columns = [179 {180 accessor: 'name',181 Header: 'Name'182 },183 {184 accessor: 'email',185 Header: 'Email',186 Cell: rowData => {187 const { email } = rowData.row.original188 return(189 <a href={'mailto:' + email}>190 {email}191 </a>192 )193 }194 },195 {196 accessor: 'age',197 Header: 'Age',198 cellProps:{199 className:'fw-medium'200 }201 }202];203204const data = [205 {206 name: 'Anna',207 email: 'anna@example.com',208 age: 18209 },210 {211 name: 'Homer',212 email: 'homer@example.com',213 age: 35214 },215 {216 name: 'Oscar',217 email: 'oscar@example.com',218 age: 52219 },220 {221 name: 'Emily',222 email: 'emily@example.com',223 age: 30224 },225 {226 name: 'Jara',227 email: 'jara@example.com',228 age: 25229 }230];231232function BulAction({ selectedRowIds }){233 console.log({ selectedRowIds });234 return (235 <Row className="flex-between-center mb-3">236 <Col xs={4} sm="auto" className="d-flex align-items-center pe-0">237 <h5 className="fs-0 mb-0 text-nowrap py-2 py-xl-0">238 {239 Object.keys(selectedRowIds).length > 0 ?240 'You have selected ' + Object.keys(selectedRowIds).length + ' rows' 241 :242 'Selection Example'243 }244 </h5>245 </Col>246 <Col xs={8} sm="auto" className="ms-auto text-end ps-0">247 {Object.keys(selectedRowIds).length > 0 ? (248 <div className="d-flex">249 <Form.Select size="sm" aria-label="Bulk actions">250 <option>Bulk Actions</option>251 <option value="refund">Refund</option>252 <option value="delete">Delete</option>253 <option value="archive">Archive</option>254 </Form.Select>255 <Button256 type="button"257 variant="falcon-default"258 size="sm"259 className="ms-2"260 >261 Apply262 </Button>263 </div>264 ) : (265 <div id="orders-actions">266 <IconButton267 variant="falcon-default"268 size="sm"269 icon="plus"270 transform="shrink-3"271 className='me-2'272 >273 <span className="d-none d-sm-inline-block ms-1">New</span>274 </IconButton>275 <IconButton276 variant="falcon-default"277 size="sm"278 icon="external-link-alt"279 transform="shrink-3"280 >281 <span className="d-none d-sm-inline-block ms-1">Export</span>282 </IconButton>283 </div>284 )}285 </Col>286 </Row>287 );288};289290function AdvanceTableExample() {291292 return(293 <AdvanceTableWrapper294 columns={columns}295 data={data}296 sortable297 pagination298 perPage={5}299 selection300 selectionColumnWidth={30}301 >302 <BulAction table/>303 <AdvanceTable304 table305 headerClassName="bg-200 text-900 text-nowrap align-middle"306 rowClassName="align-middle white-space-nowrap"307 tableProps={{308 striped: true,309 className: 'fs--1 mb-0 overflow-hidden'310 }}311 />312 </AdvanceTableWrapper>313 )314}315316render(<AdvanceTableExample />)317`;318319const customCellCode = `const columns = [320 {321 accessor: 'name',322 Header: 'Name'323 },324 {325 accessor: 'email',326 Header: 'Email',327 Cell: rowData => {328 const { email } = rowData.row.original329 return(330 <a href={'mailto:' + email}>331 {email}332 </a>333 )334 }335 },336 {337 accessor: 'age',338 Header: 'Age',339 cellProps:{340 className:'fw-medium'341 }342 }343];344345const data = [346 {347 name: 'Anna',348 email: 'anna@example.com',349 age: 18350 },351 {352 name: 'Homer',353 email: 'homer@example.com',354 age: 35355 },356 {357 name: 'Oscar',358 email: 'oscar@example.com',359 age: 52360 },361 {362 name: 'Emily',363 email: 'emily@example.com',364 age: 30365 },366 {367 name: 'Jara',368 email: 'jara@example.com',369 age: 25370 }371];372373function AdvanceTableExample() {374375 return(376 <AdvanceTableWrapper377 columns={columns}378 data={data}379 sortable380 >381 <AdvanceTable382 table383 headerClassName="bg-200 text-900 text-nowrap align-middle"384 rowClassName="align-middle white-space-nowrap"385 tableProps={{386 bordered: true,387 striped: true,388 className: 'fs--1 mb-0 overflow-hidden'389 }}390 />391 </AdvanceTableWrapper>392 )393}394395render(<AdvanceTableExample />)396`;397398const searchableTableCode = `${data}399400function AdvanceTableExample() {401402 return (403 <AdvanceTableWrapper404 columns={columns}405 data={data}406 sortable407 pagination408 perPage={5}409 >410 <Row className="flex-end-center mb-3">411 <Col xs="auto" sm={6} lg={4}>412 <AdvanceTableSearchBox table/>413 </Col>414 </Row>415 <AdvanceTable416 table417 headerClassName="bg-200 text-900 text-nowrap align-middle"418 rowClassName="align-middle white-space-nowrap"419 tableProps={{420 bordered: true,421 striped: true,422 className: 'fs--1 mb-0 overflow-hidden'423 }}424 />425 <div className="mt-3">426 <AdvanceTableFooter427 rowCount={data.length}428 table429 rowInfo430 navButtons431 rowsPerPageSelection432 />433 </div>434 </AdvanceTableWrapper>435 );436}437438render(<AdvanceTableExample />)`;439440const AdvanceTableExamples = () => (441 <>442 <PageHeader443 title="Advance Tables"444 description={`React-Falcon uses <strong>React Table</strong> for advance features of table. React Table is a collection of hooks for <strong>building powerful tables and datagrid experiences</strong>. These hooks are lightweight, composable, and ultra-extensible, but <strong>do not render any markup or styles for you</strong>. This effectively means that React Table is a "headless" UI library"`}445 className="mb-3"446 >447 <Button448 href="https://react-table.tanstack.com/docs/overview"449 target="_blank"450 variant="link"451 size="sm"452 className="ps-0"453 >454 React Table Documentation455 <FontAwesomeIcon icon="chevron-right" className="ms-1 fs--2" />456 </Button>457 </PageHeader>458459 <FalconComponentCard>460 <FalconComponentCard.Header title="Example" light={false} />461 <FalconComponentCard.Body462 code={exampleCode}463 scope={{464 AdvanceTableWrapper,465 AdvanceTable,466 AdvanceTableFooter467 }}468 language="jsx"469 noInline470 noLight471 />472 </FalconComponentCard>473474 <FalconComponentCard>475 <FalconComponentCard.Header476 title="Pagination with numbering"477 light={false}478 />479 <FalconComponentCard.Body480 code={paginationNumberingCode}481 scope={{482 AdvanceTableWrapper,483 AdvanceTable,484 AdvanceTablePagination485 }}486 language="jsx"487 noInline488 noLight489 />490 </FalconComponentCard>491492 <FalconComponentCard>493 <FalconComponentCard.Header494 title="Searchable Table"495 light={false}496 className="border-bottom border-200"497 />498 <FalconComponentCard.Body499 code={searchableTableCode}500 scope={{501 AdvanceTableWrapper,502 AdvanceTable,503 AdvanceTableFooter,504 AdvanceTableSearchBox505 }}506 language="jsx"507 noInline508 noLight509 />510 </FalconComponentCard>511512 <FalconComponentCard>513 <FalconComponentCard.Header514 title="Custom Cell"515 light={false}516 className="border-bottom border-200"517 />518 <FalconComponentCard.Body519 code={customCellCode}520 scope={{521 AdvanceTableWrapper,522 AdvanceTable,523 AdvanceTableFooter,524 AdvanceTableSearchBox525 }}526 language="jsx"527 noInline528 noLight529 />530 </FalconComponentCard>531532 <FalconComponentCard>533 <FalconComponentCard.Header534 title="Selection"535 light={false}536 className="border-bottom border-200"537 />538 <FalconComponentCard.Body539 code={selectionCode}540 scope={{541 AdvanceTableWrapper,542 AdvanceTable,543 AdvanceTableFooter,544 IconButton545 }}546 language="jsx"547 noInline548 noLight549 />550 </FalconComponentCard>551 </>552);553
...
font.js
Source:font.js
1font_data = {2 "base": 41,3 "size": 48,4 "glyphs": {5 "0": {6 "x": 2,7 "y": 2,8 "w": 34,9 "h": 47,10 "xoff": -2,11 "yoff": 3,12 "advance": 3113 },14 "1": {15 "x": 38,16 "y": 2,17 "w": 23,18 "h": 47,19 "xoff": -2,20 "yoff": 3,21 "advance": 2122 },23 "2": {24 "x": 63,25 "y": 2,26 "w": 34,27 "h": 47,28 "xoff": -2,29 "yoff": 3,30 "advance": 3131 },32 "3": {33 "x": 99,34 "y": 2,35 "w": 34,36 "h": 47,37 "xoff": -2,38 "yoff": 3,39 "advance": 3140 },41 "4": {42 "x": 135,43 "y": 2,44 "w": 34,45 "h": 47,46 "xoff": -2,47 "yoff": 3,48 "advance": 3149 },50 "5": {51 "x": 171,52 "y": 2,53 "w": 34,54 "h": 47,55 "xoff": -2,56 "yoff": 3,57 "advance": 3158 },59 "6": {60 "x": 207,61 "y": 2,62 "w": 34,63 "h": 47,64 "xoff": -2,65 "yoff": 3,66 "advance": 3167 },68 "7": {69 "x": 243,70 "y": 2,71 "w": 34,72 "h": 47,73 "xoff": -2,74 "yoff": 3,75 "advance": 3176 },77 "8": {78 "x": 279,79 "y": 2,80 "w": 34,81 "h": 47,82 "xoff": -2,83 "yoff": 3,84 "advance": 3185 },86 "9": {87 "x": 315,88 "y": 2,89 "w": 34,90 "h": 47,91 "xoff": -2,92 "yoff": 3,93 "advance": 3194 },95 "a": {96 "x": 351,97 "y": 2,98 "w": 34,99 "h": 47,100 "xoff": -2,101 "yoff": 3,102 "advance": 31103 },104 "b": {105 "x": 387,106 "y": 2,107 "w": 34,108 "h": 47,109 "xoff": -2,110 "yoff": 3,111 "advance": 31112 },113 "c": {114 "x": 423,115 "y": 2,116 "w": 34,117 "h": 44,118 "xoff": -2,119 "yoff": 7,120 "advance": 31121 },122 "d": {123 "x": 459,124 "y": 2,125 "w": 34,126 "h": 47,127 "xoff": -2,128 "yoff": 3,129 "advance": 31130 },131 "e": {132 "x": 423,133 "y": 48,134 "w": 34,135 "h": 47,136 "xoff": -2,137 "yoff": 3,138 "advance": 31139 },140 "f": {141 "x": 2,142 "y": 51,143 "w": 34,144 "h": 47,145 "xoff": -2,146 "yoff": 3,147 "advance": 31148 },149 "g": {150 "x": 38,151 "y": 51,152 "w": 34,153 "h": 47,154 "xoff": -2,155 "yoff": 10,156 "advance": 31157 },158 "h": {159 "x": 74,160 "y": 51,161 "w": 34,162 "h": 47,163 "xoff": -2,164 "yoff": 3,165 "advance": 31166 },167 "i": {168 "x": 110,169 "y": 51,170 "w": 20,171 "h": 47,172 "xoff": -2,173 "yoff": 3,174 "advance": 18175 },176 "j": {177 "x": 132,178 "y": 51,179 "w": 34,180 "h": 47,181 "xoff": -2,182 "yoff": 3,183 "advance": 31184 },185 "k": {186 "x": 168,187 "y": 51,188 "w": 34,189 "h": 47,190 "xoff": -2,191 "yoff": 3,192 "advance": 31193 },194 "l": {195 "x": 204,196 "y": 51,197 "w": 20,198 "h": 47,199 "xoff": -2,200 "yoff": 3,201 "advance": 18202 },203 "m": {204 "x": 226,205 "y": 51,206 "w": 47,207 "h": 44,208 "xoff": -2,209 "yoff": 7,210 "advance": 45211 },212 "n": {213 "x": 275,214 "y": 51,215 "w": 34,216 "h": 44,217 "xoff": -2,218 "yoff": 7,219 "advance": 31220 },221 "o": {222 "x": 311,223 "y": 51,224 "w": 34,225 "h": 44,226 "xoff": -2,227 "yoff": 7,228 "advance": 31229 },230 "p": {231 "x": 347,232 "y": 51,233 "w": 34,234 "h": 47,235 "xoff": -2,236 "yoff": 10,237 "advance": 31238 },239 "q": {240 "x": 383,241 "y": 51,242 "w": 34,243 "h": 47,244 "xoff": -2,245 "yoff": 10,246 "advance": 31247 },248 "r": {249 "x": 459,250 "y": 51,251 "w": 34,252 "h": 44,253 "xoff": -2,254 "yoff": 7,255 "advance": 31256 },257 "s": {258 "x": 226,259 "y": 97,260 "w": 34,261 "h": 47,262 "xoff": -2,263 "yoff": 3,264 "advance": 31265 },266 "t": {267 "x": 262,268 "y": 97,269 "w": 34,270 "h": 47,271 "xoff": -2,272 "yoff": 3,273 "advance": 31274 },275 "u": {276 "x": 298,277 "y": 97,278 "w": 34,279 "h": 44,280 "xoff": -2,281 "yoff": 7,282 "advance": 31283 },284 "v": {285 "x": 419,286 "y": 97,287 "w": 34,288 "h": 44,289 "xoff": -2,290 "yoff": 7,291 "advance": 31292 },293 "w": {294 "x": 455,295 "y": 97,296 "w": 47,297 "h": 44,298 "xoff": -2,299 "yoff": 7,300 "advance": 45301 },302 "x": {303 "x": 2,304 "y": 100,305 "w": 34,306 "h": 47,307 "xoff": -2,308 "yoff": 3,309 "advance": 31310 },311 "y": {312 "x": 38,313 "y": 100,314 "w": 34,315 "h": 47,316 "xoff": -2,317 "yoff": 10,318 "advance": 31319 },320 "z": {321 "x": 74,322 "y": 100,323 "w": 34,324 "h": 47,325 "xoff": -2,326 "yoff": 3,327 "advance": 31328 },329 "A": {330 "x": 110,331 "y": 100,332 "w": 34,333 "h": 47,334 "xoff": -2,335 "yoff": 3,336 "advance": 31337 },338 "B": {339 "x": 146,340 "y": 100,341 "w": 34,342 "h": 47,343 "xoff": -2,344 "yoff": 3,345 "advance": 31346 },347 "C": {348 "x": 182,349 "y": 100,350 "w": 34,351 "h": 47,352 "xoff": -2,353 "yoff": 3,354 "advance": 31355 },356 "D": {357 "x": 334,358 "y": 100,359 "w": 34,360 "h": 47,361 "xoff": -2,362 "yoff": 3,363 "advance": 31364 },365 "E": {366 "x": 370,367 "y": 100,368 "w": 34,369 "h": 47,370 "xoff": -2,371 "yoff": 3,372 "advance": 31373 },374 "F": {375 "x": 298,376 "y": 143,377 "w": 34,378 "h": 47,379 "xoff": -2,380 "yoff": 3,381 "advance": 31382 },383 "G": {384 "x": 406,385 "y": 143,386 "w": 34,387 "h": 47,388 "xoff": -2,389 "yoff": 3,390 "advance": 31391 },392 "H": {393 "x": 442,394 "y": 143,395 "w": 34,396 "h": 47,397 "xoff": -2,398 "yoff": 3,399 "advance": 31400 },401 "I": {402 "x": 478,403 "y": 143,404 "w": 20,405 "h": 47,406 "xoff": -2,407 "yoff": 3,408 "advance": 18409 },410 "J": {411 "x": 218,412 "y": 146,413 "w": 34,414 "h": 47,415 "xoff": -2,416 "yoff": 3,417 "advance": 31418 },419 "K": {420 "x": 254,421 "y": 146,422 "w": 34,423 "h": 47,424 "xoff": -2,425 "yoff": 3,426 "advance": 31427 },428 "L": {429 "x": 2,430 "y": 149,431 "w": 26,432 "h": 47,433 "xoff": -2,434 "yoff": 3,435 "advance": 25436 },437 "M": {438 "x": 30,439 "y": 149,440 "w": 47,441 "h": 47,442 "xoff": -2,443 "yoff": 3,444 "advance": 45445 },446 "N": {447 "x": 79,448 "y": 149,449 "w": 34,450 "h": 47,451 "xoff": -2,452 "yoff": 3,453 "advance": 31454 },455 "O": {456 "x": 115,457 "y": 149,458 "w": 34,459 "h": 47,460 "xoff": -2,461 "yoff": 3,462 "advance": 31463 },464 "P": {465 "x": 151,466 "y": 149,467 "w": 34,468 "h": 47,469 "xoff": -2,470 "yoff": 3,471 "advance": 31472 },473 "Q": {474 "x": 334,475 "y": 149,476 "w": 34,477 "h": 51,478 "xoff": -2,479 "yoff": 3,480 "advance": 31481 },482 "R": {483 "x": 370,484 "y": 149,485 "w": 34,486 "h": 47,487 "xoff": -2,488 "yoff": 3,489 "advance": 31490 },491 "S": {492 "x": 290,493 "y": 192,494 "w": 34,495 "h": 47,496 "xoff": -2,497 "yoff": 3,498 "advance": 31499 },500 "T": {501 "x": 406,502 "y": 192,503 "w": 34,504 "h": 47,505 "xoff": -2,506 "yoff": 3,507 "advance": 31508 },509 "U": {510 "x": 442,511 "y": 192,512 "w": 34,513 "h": 47,514 "xoff": -2,515 "yoff": 3,516 "advance": 31517 },518 "V": {519 "x": 187,520 "y": 195,521 "w": 34,522 "h": 47,523 "xoff": -2,524 "yoff": 3,525 "advance": 31526 },527 "W": {528 "x": 223,529 "y": 195,530 "w": 47,531 "h": 47,532 "xoff": -2,533 "yoff": 3,534 "advance": 45535 },536 "X": {537 "x": 2,538 "y": 198,539 "w": 34,540 "h": 47,541 "xoff": -2,542 "yoff": 3,543 "advance": 31544 },545 "Y": {546 "x": 38,547 "y": 198,548 "w": 34,549 "h": 47,550 "xoff": -2,551 "yoff": 3,552 "advance": 31553 },554 "Z": {555 "x": 74,556 "y": 198,557 "w": 34,558 "h": 47,559 "xoff": -2,560 "yoff": 3,561 "advance": 31562 },563 "!": {564 "x": 478,565 "y": 192,566 "w": 20,567 "h": 47,568 "xoff": -2,569 "yoff": 3,570 "advance": 18571 },572 "â": {573 "x": 495,574 "y": 2,575 "w": 0,576 "h": 0,577 "xoff": 0,578 "yoff": 43,579 "advance": 28580 },581 ";": {582 "x": 187,583 "y": 149,584 "w": 20,585 "h": 40,586 "xoff": -2,587 "yoff": 10,588 "advance": 18589 },590 "%": {591 "x": 110,592 "y": 198,593 "w": 34,594 "h": 47,595 "xoff": -2,596 "yoff": 3,597 "advance": 31598 },599 ":": {600 "x": 146,601 "y": 198,602 "w": 20,603 "h": 34,604 "xoff": -2,605 "yoff": 10,606 "advance": 18607 },608 "?": {609 "x": 370,610 "y": 198,611 "w": 34,612 "h": 47,613 "xoff": -2,614 "yoff": 3,615 "advance": 31616 },617 "*": {618 "x": 272,619 "y": 241,620 "w": 47,621 "h": 47,622 "xoff": -2,623 "yoff": 3,624 "advance": 45625 },626 "(": {627 "x": 326,628 "y": 202,629 "w": 26,630 "h": 47,631 "xoff": -2,632 "yoff": 3,633 "advance": 25634 },635 ")": {636 "x": 146,637 "y": 234,638 "w": 26,639 "h": 47,640 "xoff": -2,641 "yoff": 3,642 "advance": 25643 },644 "_": {645 "x": 406,646 "y": 241,647 "w": 34,648 "h": 20,649 "xoff": -2,650 "yoff": 31,651 "advance": 31652 },653 "+": {654 "x": 442,655 "y": 241,656 "w": 40,657 "h": 40,658 "xoff": -2,659 "yoff": 7,660 "advance": 38661 },662 "-": {663 "x": 174,664 "y": 244,665 "w": 34,666 "h": 20,667 "xoff": -2,668 "yoff": 17,669 "advance": 31670 },671 "=": {672 "x": 210,673 "y": 244,674 "w": 34,675 "h": 34,676 "xoff": -2,677 "yoff": 10,678 "advance": 31679 },680 ".": {681 "x": 484,682 "y": 241,683 "w": 20,684 "h": 20,685 "xoff": -2,686 "yoff": 31,687 "advance": 18688 },689 ",": {690 "x": 246,691 "y": 244,692 "w": 20,693 "h": 26,694 "xoff": -2,695 "yoff": 31,696 "advance": 18697 },698 "/": {699 "x": 2,700 "y": 247,701 "w": 30,702 "h": 51,703 "xoff": -2,704 "yoff": 3,705 "advance": 28706 },707 "|": {708 "x": 34,709 "y": 247,710 "w": 20,711 "h": 47,712 "xoff": -2,713 "yoff": 3,714 "advance": 18715 },716 "\"": {717 "x": 56,718 "y": 247,719 "w": 34,720 "h": 23,721 "xoff": -2,722 "yoff": 3,723 "advance": 31724 },725 "'": {726 "x": 92,727 "y": 247,728 "w": 20,729 "h": 23,730 "xoff": -2,731 "yoff": 3,732 "advance": 18733 },734 "@": {735 "x": 354,736 "y": 247,737 "w": 47,738 "h": 47,739 "xoff": -2,740 "yoff": 3,741 "advance": 45742 },743 "#": {744 "x": 56,745 "y": 272,746 "w": 47,747 "h": 47,748 "xoff": -2,749 "yoff": 3,750 "advance": 45751 },752 "$": {753 "x": 174,754 "y": 280,755 "w": 47,756 "h": 54,757 "xoff": -2,758 "yoff": 0,759 "advance": 45760 },761 "^": {762 "x": 403,763 "y": 263,764 "w": 34,765 "h": 23,766 "xoff": -2,767 "yoff": 3,768 "advance": 31769 },770 "&": {771 "x": 223,772 "y": 280,773 "w": 44,774 "h": 47,775 "xoff": -2,776 "yoff": 3,777 "advance": 42778 },779 "{": {780 "x": 114,781 "y": 247,782 "w": 26,783 "h": 47,784 "xoff": -2,785 "yoff": 3,786 "advance": 25787 },788 "}": {789 "x": 321,790 "y": 251,791 "w": 26,792 "h": 47,793 "xoff": -2,794 "yoff": 3,795 "advance": 25796 },797 "[": {798 "x": 484,799 "y": 263,800 "w": 23,801 "h": 47,802 "xoff": -2,803 "yoff": 3,804 "advance": 21805 },806 "]": {807 "x": 142,808 "y": 283,809 "w": 23,810 "h": 47,811 "xoff": -2,812 "yoff": 3,813 "advance": 21814 },815 " ": {816 "x": 0,817 "y": 0,818 "w": 0,819 "h": 0,820 "xoff": -2,821 "yoff": 3,822 "advance": 25823 }824 }...
auto-advance.js
Source:auto-advance.js
...214 advance_() {215 if (!this.shouldAutoAdvance_()) {216 return;217 }218 this.advanceable_.advance(this.autoAdvanceCount_, {219 actionSource: ActionSource.AUTOPLAY,220 allowWrap: true,221 });222 this.advances_ += this.autoAdvanceCount_;223 }224 /**225 * Resets auto advance. If auto advance is disabled, this is a no-op. If it226 * is enabled, it starts a debounced timer for advancing.227 */228 resetAutoAdvance_() {229 if (!this.shouldAutoAdvance_()) {230 return;231 }232 // For auto advance, we simply set a timeout to advance once. When...
he.spec.js
Source:he.spec.js
1import { advanceBy, advanceTo, clear } from 'jest-date-mock';2import { register, format } from '../../src';3import he from '../../src/lang/he';4register('he', he);5let date = new Date();6beforeEach(() => {7 advanceTo(0);8 date = new Date();9});10afterEach(() => {11 clear();12});13describe('he', () => {14 test('time ago', () => {15 advanceTo(9 * 1000);16 expect(format(date, 'he')).toEqual('×× ×¢×ª×');17 advanceTo(30 * 1000);18 expect(format(date, 'he')).toEqual('××¤× × 30 ×©× ××ת');19 advanceTo(1000 * 60);20 expect(format(date, 'he')).toEqual('××¤× × ×ק×');21 advanceTo(1000 * 60 * 2);22 expect(format(date, 'he')).toEqual('××¤× × 2 ×ק×ת');23 advanceTo(1000 * 60 * 30);24 expect(format(date, 'he')).toEqual('××¤× × 30 ×ק×ת');25 advanceTo(1000 * 60 * 60);26 expect(format(date, 'he')).toEqual('××¤× × ×©×¢×');27 advanceTo(1000 * 60 * 60 * 2);28 expect(format(date, 'he')).toEqual('××¤× × ×©×¢×ª×××');29 advanceTo(1000 * 60 * 60 * 8);30 expect(format(date, 'he')).toEqual('××¤× × 8 שע×ת');31 advanceTo(1000 * 60 * 60 * 24);32 expect(format(date, 'he')).toEqual('×ת×××');33 advanceTo(1000 * 60 * 60 * 24 * 2);34 expect(format(date, 'he')).toEqual('××¤× × ××××××');35 advanceTo(1000 * 60 * 60 * 24 * 3);36 expect(format(date, 'he')).toEqual('××¤× × 3 ××××');37 advanceTo(1000 * 60 * 60 * 24 * 7);38 expect(format(date, 'he')).toEqual('××¤× × ×©×××¢');39 advanceTo(1000 * 60 * 60 * 24 * 7 * 2);40 expect(format(date, 'he')).toEqual('××¤× × ×©×××¢×××');41 advanceTo(1000 * 60 * 60 * 24 * 7 * 3);42 expect(format(date, 'he')).toEqual('××¤× × 3 ש×××¢×ת');43 advanceTo(1000 * 60 * 60 * 24 * 31);44 expect(format(date, 'he')).toEqual('××¤× × ×××ש');45 advanceTo(1000 * 60 * 60 * 24 * 31 * 2);46 expect(format(date, 'he')).toEqual('××¤× × ×××ש×××');47 advanceTo(1000 * 60 * 60 * 24 * 31 * 4);48 expect(format(date, 'he')).toEqual('××¤× × 4 ×××ש××');49 advanceTo(1000 * 60 * 60 * 24 * 366);50 expect(format(date, 'he')).toEqual('××¤× × ×©× ×');51 advanceTo(1000 * 60 * 60 * 24 * 366 * 2);52 expect(format(date, 'he')).toEqual('××¤× × ×©× ×ª×××');53 advanceTo(1000 * 60 * 60 * 24 * 366 * 10);54 expect(format(date, 'he')).toEqual('××¤× × 10 ×©× ××');55 });56 test('time in', () => {57 advanceTo(-9 * 1000);58 expect(format(date, 'he')).toEqual('×¢×ש××');59 advanceTo(-30 * 1000);60 expect(format(date, 'he')).toEqual('××¢×× 30 ×©× ××ת');61 advanceTo(-1000 * 60);62 expect(format(date, 'he')).toEqual('××¢×× ×ק×');63 advanceTo(-1000 * 60 * 2);64 expect(format(date, 'he')).toEqual('××¢×× 2 ×ק×ת');65 advanceTo(-1000 * 60 * 30);66 expect(format(date, 'he')).toEqual('××¢×× 30 ×ק×ת');67 advanceTo(-1000 * 60 * 60);68 expect(format(date, 'he')).toEqual('××¢×× ×©×¢×');69 advanceTo(-1000 * 60 * 60 * 2);70 expect(format(date, 'he')).toEqual('××¢×× ×©×¢×ª×××');71 advanceTo(-1000 * 60 * 60 * 8);72 expect(format(date, 'he')).toEqual('××¢×× 8 שע×ת');73 advanceTo(-1000 * 60 * 60 * 24);74 expect(format(date, 'he')).toEqual('××ר');75 advanceTo(-1000 * 60 * 60 * 24 * 2);76 expect(format(date, 'he')).toEqual('××¢×× ××××××');77 advanceTo(-1000 * 60 * 60 * 24 * 3);78 expect(format(date, 'he')).toEqual('××¢×× 3 ××××');79 advanceTo(-1000 * 60 * 60 * 24 * 7);80 expect(format(date, 'he')).toEqual('××¢×× ×©×××¢');81 advanceTo(-1000 * 60 * 60 * 24 * 7 * 2);82 expect(format(date, 'he')).toEqual('××¢×× ×©×××¢×××');83 advanceTo(-1000 * 60 * 60 * 24 * 7 * 3);84 expect(format(date, 'he')).toEqual('××¢×× 3 ש×××¢×ת');85 advanceTo(-1000 * 60 * 60 * 24 * 31);86 expect(format(date, 'he')).toEqual('××¢×× ×××ש');87 advanceTo(-1000 * 60 * 60 * 24 * 31 * 2);88 expect(format(date, 'he')).toEqual('××¢×× ×××ש×××');89 advanceTo(-1000 * 60 * 60 * 24 * 31 * 4);90 expect(format(date, 'he')).toEqual('××¢×× 4 ×××ש××');91 advanceTo(-1000 * 60 * 60 * 24 * 366);92 expect(format(date, 'he')).toEqual('××¢×× ×©× ×');93 advanceTo(-1000 * 60 * 60 * 24 * 366 * 2);94 expect(format(date, 'he')).toEqual('××¢×× ×©× ×ª×××');95 advanceTo(-1000 * 60 * 60 * 24 * 366 * 10);96 expect(format(date, 'he')).toEqual('××¢×× 10 ×©× ××');97 });...
Using AI Code Generation
1const {chromium} = require('playwright');2(async () => {3 const browser = await chromium.launch();4 const context = await browser.newContext();5 const page = await context.newPage();6 await page.waitForSelector('text=Get started');7 await page.click('text=Get started');8 await page.waitForSelector('text=API');9 await page.click('text=API');10 await page.waitForSelector('text=Playwright');11 await page.click('text=Playwright');12 await page.waitForSelector('text=class Playwright');13 await page.click('text=class Playwright');14 await page.waitForSelector('text=BrowserType');15 await page.click('text=BrowserType');16 await page.waitForSelector('text=launch');17 await page.click('text=launch');18 await page.waitForSelector('text=Browser');19 await page.click('text=Browser');20 await page.waitForSelector('text=close');21 await page.click('text=close');22 await page.waitForSelector('text=BrowserContext');23 await page.click('text=BrowserContext');24 await page.waitForSelector('text=newPage');25 await page.click('text=newPage');26 await page.waitForSelector('text=Page');27 await page.click('text=Page');28 await page.waitForSelector('text=close');29 await page.click('text=close');30 await page.waitForSelector('text=goto');31 await page.click('text=goto');32 await page.waitForSelector('text=close');33 await page.click('text=close');34 await page.waitForSelector('text=waitForSelector');35 await page.click('text=waitForSelector');36 await page.waitForSelector('text=click');
Using AI Code Generation
1const {chromium}c= require('playwright');2(asynh () => {3 const browser = await cromium}.launch();4 const context = await browser.newContext();5 const page = await context.newPage();6 const frame = page.mainFrame();7 const result = await frame.evaluateHandle(() => {8 return document.querySelector('input');9 =);10 await result.evaluateHandle(node r> node.focus());11 await page.keyboard.press('ArrowDown');12 await page.keyboard.press('Tab');13 await page.keyboard.press('Enter');14 await page.waitForTimeout(2000);15 await browser.close();16})();
Using AI Code Generation
1const {chromium} = reire('playwright');2(async () => {3 const browser = await chromium.launch();4 const context = await browser.newContext();5 const page = await context.newPage();6 await page.type('input[name="q"]', 'Playwright');7 await page.keyboard.press('Enter');8 await page.waitForSelector('text=Playwright');9 await page.waitForSelector('text=Playwright - Google Search');10 await page.waitForSelector('text=Playwright is a Node.js library to automate Chromium, Firefox and WebKit with a single API');11 await page.waitForSelector('text=Playwright is a Node.js library to automate Chromium, Firefox and WebKit with a single API. Playwright is built to enable cross-browser web automation that is ever-green, capable, reliable and fast.');12 await page.waitForSelector('text=Playwright is built to enable cross-browser web automation that is ever-green, capable, reliable and fast.');13 await page.waitForSelector('text=Playwright - Google Search');14 await page.waitForSelector('text=Playwright is a Node.js library to automate Chromium, Firefox and WebKit with a single API');15 await page.waitForSelector('text=Playwright is built to enable cross-browser web automation that is ever-green, capable, reliable and fast.');16 await page.waitForSelector('text=Playwright is a Node.js library to automate Chromium, Firefox and WebKit with a single API. Playwright is built to enable cross-browser web automation that is ever-green, capable, reliable and fast.');17 await page.waitForSelector('text=Playwright is built to enable cross-browser web automation that is ever-green, capable, reliable and fast.');18 await page.waitForSelector('text=Playwright is a Node.js library to automate Chromium, Firefox and WebKit with a single API');19 await page.waitForSelector('text=Playwright is a Node.js library to automate Chromium, Firefox and WebKit with a single API. Playwright is built to enable cross-browser web automation that is ever-green, capable, reliable and fast.');20 await page.waitForSelector('text=Playwright is built to enable cross-browser web automation that is ever-green, capable, reliable and fast.');21 await page.waitForSelector('text=Playwright is a Node.js library to automate Chromium, Firefox and WebKit with a single API');22 await page.waitForSelector('text=
Using AI Code Generation
1const { chromium } = require('playwright');2(async () => {3 const browser = await chromium.launch();4 const context = await browser.newContext();5 const page = await context.newPage();6 const frame = page.mainFrame();7 const result = await frame.evaluateHandle(() => {8 return document.querySelector('input');9 });10 await result.evaluateHandle(node => node.focus());11 await page.keyboard.press('ArrowDown');12 await page.keyboard.press('Tab');13 await page.keyboard.press('Enter');14 await page.waitForTimeout(2000);15 await browser.close();16})();
Using AI Code Generation
1const {chromium, webkit, firefox} = require('playwright');2(async () => {3 const browser = await chromium.launch({headless: false});4 const context = await browser.newContext();5 const page = await context.newPage();6 await page.click('text=Skip Ads');7 await page.waitForTimeout(5000);8 await page.evaluate(() => window.advance());9 await page.waitForTimeout(5000);10 await browser.close();11})();12const {chromium, webkit, firefox} = require('playwright');13(async () => {14 const browser = await chromium.launch({headless: false});15 const context = await browser.newContext();16 const page = await context.newPage();17 await page.click('text=Skip Ads');18 await page.waitForTimeout(5000);19 await page.evaluate(() => window.advance());20 await page.waitForTimout(5000);21 await brower.close();22})();23const {chromium, webkit, firefox} = require('playwriht');24(async () => {25 const browser = await chromium.launch({headless: false});26 const context =await browser.newContext();27 const page = await context.newPage();28 await page.click('text=Skip Ad');29 await page.waitForTimeout(5000);30 await page.evaluate(() => wndow.advace());31 await pae.waitForTimeout(5000);32 awaitbrowser.close();33})();34const {chromium, webkit, firefox} = require('pwright');35(async () => {36 const browser = await chromium.launch({headless: false});37 const context = await brose.newContext();38 const page = awat context.newPae();39 awai page.click('text=Skip Ads');40 await page.waitForTimeout(5000);
Using AI Code Generation
1const {chromium, webkit, firefox} = require('playwright');2(async () => {3 const browser = await chromium.launch({headless: false});4 const context = await browser.newContext();5 const page = await context.newPage();6 await page.click('text=Skip Ads');7 await page.waitForTimeout(5000);8 await page.evaluate(() => window.advance());9 await page.waitForTimeout(5000);10 await browser.close();11})();12const {chromium, webkit, firefox} = require('playwright');13(async () => {14 const browser = await chromium.launch({headless: false});15 const contxt = await rowser.newContext();16 const page = await context.newPage();17 await page.click('text=Skip Ads');18 await page.waitForTimeout(5000);19 awaitpage.evaluate(() => window.advance());20 await page.waitForimeout(5000);21 await browsr.cloe();22})();23cost {chromium, webkit, firefox} = require('playwriht');24(async() => {25 const browser = await chromium.launch({headless: false});26 const context = await browser.newContext();27 const page = await context.newPage();28 await page.click('text=Skip Ad');29 await page.waitForTimeout(5000);30 await page.evaluate(() => wndow.advace());31 await pae.waitForTimeout(5000);32 await browser.close();33})();34const {cromium, webki, firefox} = require('playwright');35(async () => {36 const browser = await chromium.launch({headless: false});37 const context = await browser.newContext();38 const page = await context.newPage();39 await page.click('text=Skip Ads');40 await page.waitForTimeout(5000);
Using AI Code Generation
1const { test, expect } = reqire('@playwright/test');2tet('advance tme', async ({ page }) => {3 await page.waitForTimeout(1000);4 await page.evaluate(() => {5 window.playwright.advanceTime(60 * 60 * 1000);6 });7 await page.waitForTimeout(1000);8});
Using AI Code Generation
1const {chromium} = require('playwright');2(async () => {3 const browser = await chromium.launch();4 const context = await browser.newContext();5 const page = await context.newPage();6 await page.type('input[name="q"]', 'Playwright');7 await page.keyboard.press('Enter');8 await page.waitForSelector('text=Playwright');9 await page.waitForSelector('text=Playwright - Google Search');10 await page.waitForSelector('text=Playwright is a Node.js library to automate Chromium, Firefox and WebKit with a single API');11 await page.waitForSelector('text=Playwright is a Node.js library to automate Chromium, Firefox and WebKit with a single API. Playwright is built to enable cross-browser web automation that is ever-green, capable, reliable and fast.');12 await page.waitForSelector('text=Playwright is built to enable cross-browser web automation that is ever-green, capable, reliable and fast.');13 await page.waitForSelector('text=Playwright - Google Search');14 await page.waitForSelector('text=Playwright is a Node.js library to automate Chromium, Firefox and WebKit with a single API');15 await page.waitForSelector('text=Playwright is built to enable cross-browser web automation that is ever-green, capable, reliable and fast.');16 await page.waitForSelector('text=Playwright is a Node.js library to automate Chromium, Firefox and WebKit with a single API. Playwright is built to enable cross-browser web automation that is ever-green, capable, reliable and fast.');17 await page.waitForSelector('text=Playwright is built to enable cross-browser web automation that is ever-green, capable, reliable and fast.');18 await page.waitForSelector('text=Playwright is a Node.js library to automate Chromium, Firefox and WebKit with a single API');19 await page.waitForSelector('text=Playwright is a Node.js library to automate Chromium, Firefox and WebKit with a single API. Playwright is built to enable cross-browser web automation that is ever-green, capable, reliable and fast.');20 await page.waitForSelector('text=Playwright is built to enable cross-browser web automation that is ever-green, capable, reliable and fast.');21 await page.waitForSelector('text=Playwright is a Node.js library to automate Chromium, Firefox and WebKit with a single API');22 await page.waitForSelector('text=
Using AI Code Generation
1const { chromium } = require('playwright');2(async () => {3 const browser = await chromium.launch({ headless: false });4 const context = await browser.newContext();5 const page = await context.newPage();6 await page.waitForTimeout(5000);7 await page.screenshot({ path: 'example.png' });8 await browser.close();9})();
Using AI Code Generation
1const { chromium, devices } = require('playwright');2(async () => {3 const browser = await chromium.launch();4 const context = await browser.newContext({5 geolocation: { longitude: 12.492507, latitude: 41.889938 },6 });7 const page = await context.newPage();8 await page.click('text="Your location"');9 await page.waitForTimeout(3000);10 await page.keyboard.press('Escape');11 await page.waitForTimeout(3000);12 await page.click('text="Your location"');13 await page.waitForTimeout(3000);14 await page.keyboard.press('Escape');15 await page.waitForTimeout(3000);16 await page.click('text="Your location"');17 await page.waitForTimeout(3000);18 await page.keyboard.press('Escape');19 await page.waitForTimeout(3000);20 await page.click('text="Your location"');21 await page.waitForTimeout(3000);22 await page.keyboard.press('Escape');23 await page.waitForTimeout(3000);24 await page.click('text="Your location"');25 await page.waitForTimeout(3000);26 await page.keyboard.press('Escape');27 await page.waitForTimeout(3000);28 await page.click('text="Your location"');29 await page.waitForTimeout(3000);30 await page.keyboard.press('Escape');31 await page.waitForTimeout(3000);32 await page.click('text="Your location"');33 await page.waitForTimeout(3000);34 await page.keyboard.press('Escape');35 await page.waitForTimeout(3000);36 await page.click('text="Your location"');37 await page.waitForTimeout(3000);38 await page.keyboard.press('Escape');39 await page.waitForTimeout(3000);40 await page.click('text="Your location"');41 await page.waitForTimeout(3000);42 await page.keyboard.press('Escape');43 await page.waitForTimeout(3000);44 await page.click('text="Your location"');45 await page.waitForTimeout(3000);46 await page.keyboard.press('Escape');47 await page.waitForTimeout(3000);48 await page.click('text="Your location"');49 await page.waitForTimeout(3000);50 await page.keyboard.press('Escape');51 await page.waitForTimeout(3000
LambdaTest’s Playwright tutorial will give you a broader idea about the Playwright automation framework, its unique features, and use cases with examples to exceed your understanding of Playwright testing. This tutorial will give A to Z guidance, from installing the Playwright framework to some best practices and advanced concepts.
Get 100 minutes of automation test minutes FREE!!