How to use _lock method in root

Best JavaScript code snippet using root

quest2.js

Source:quest2.js Github

copy

Full Screen

1'use strict';2module.exports = 3 {4 "quest": {5 "page": [6 {7 "container": "",8 "desc": "Bitters Town has not been built yet. There's nothing to do but go adventuring.",9 "events": {10 "trap": {11 "_id": "0",12 "_chance": "0"13 },14 "treasure": {15 "_id": "0",16 "_chance": "0"17 },18 "environment": {19 "_id": "0",20 "_chance": "0"21 },22 "encounter": {23 "_id": "0",24 "_chance": "0"25 }26 },27 "exits": {28 "link": [29 {30 "_id": "0",31 "_lock": "0",32 "__text": "West"33 },34 {35 "_id": "1",36 "_lock": "0",37 "__text": "East"38 },39 {40 "_id": "0",41 "_lock": "0",42 "__text": "North"43 },44 {45 "_id": "0",46 "_lock": "0",47 "__text": "South"48 },49 {50 "_id": "0",51 "_lock": "0",52 "__text": "Up"53 },54 {55 "_id": "0",56 "_lock": "0",57 "__text": "Down"58 }59 ]60 },61 "_id": "0",62 "_name": "Bitters Town"63 },64 {65 "container": "",66 "desc": "A narrow road winds eastward along the coast, with sparse grass and tiny blue flowers along the North berm. South of the roadside is an alarming drop to the rocky shore and crashing surf, but betweeen two Salt bushes you notice a gap that seems to lead downwards.",67 "events": {68 "trap": {69 "_id": "0",70 "_chance": "0"71 },72 "treasure": {73 "_id": "0",74 "_chance": "0"75 },76 "environment": {77 "_id": "0",78 "_chance": "0"79 },80 "encounter": {81 "_id": "0",82 "_chance": "0"83 }84 },85 "exits": {86 "link": [87 {88 "_id": "0",89 "_lock": "0",90 "__text": "West"91 },92 {93 "_id": "0",94 "_lock": "0",95 "__text": "East"96 },97 {98 "_id": "0",99 "_lock": "0",100 "__text": "North"101 },102 {103 "_id": "0",104 "_lock": "0",105 "__text": "South"106 },107 {108 "_id": "0",109 "_lock": "0",110 "__text": "Up"111 },112 {113 "_id": "2",114 "_lock": "0",115 "__text": "Down"116 }117 ]118 },119 "_id": "1",120 "_name": "The Road to Bitters Town"121 },122 {123 "container": "",124 "desc": "There is a succession of slick ledges and jagged outcroppings of greasy black rock providing a precarious route from the road to the sandy beach far below. ",125 "events": {126 "trap": {127 "_id": "0",128 "_chance": "0"129 },130 "treasure": {131 "_id": "0",132 "_chance": "0"133 },134 "environment": {135 "_id": "0",136 "_chance": "0"137 },138 "encounter": {139 "_id": "0",140 "_chance": "0"141 }142 },143 "exits": {144 "link": [145 {146 "_id": "0",147 "_lock": "0",148 "__text": "West"149 },150 {151 "_id": "0",152 "_lock": "0",153 "__text": "East"154 },155 {156 "_id": "0",157 "_lock": "0",158 "__text": "North"159 },160 {161 "_id": "0",162 "_lock": "0",163 "__text": "South"164 },165 {166 "_id": "1",167 "_lock": "0",168 "__text": "Up"169 },170 {171 "_id": "3",172 "_lock": "0",173 "__text": "Down"174 }175 ]176 },177 "_id": "2",178 "_name": "The Rocky Trail"179 },180 {181 "container": "",182 "desc": "The beach gently slopes down for some distance into the lapping tides. The expanse of glistening grey sand stretches away to the east. To the west, at the foot of the trail, waves crash violently into a cluster of craggy black boulders that extend far out into the ocean from the cliff. To the North, you see the mouth of an enormous cave. ",183 "events": {184 "trap": {185 "_id": "0",186 "_chance": "0"187 },188 "treasure": {189 "_id": "0",190 "_chance": "0"191 },192 "environment": {193 "_id": "0",194 "_chance": "0"195 },196 "encounter": {197 "_id": "0",198 "_chance": "0"199 }200 },201 "exits": {202 "link": [203 {204 "_id": "2",205 "_lock": "0",206 "__text": "West"207 },208 {209 "_id": "4",210 "_lock": "0",211 "__text": "East"212 },213 {214 "_id": "5",215 "_lock": "0",216 "__text": "North"217 },218 {219 "_id": "0",220 "_lock": "0",221 "__text": "South"222 },223 {224 "_id": "2",225 "_lock": "0",226 "__text": "Up"227 },228 {229 "_id": "0",230 "_lock": "0",231 "__text": "Down"232 }233 ]234 },235 "_id": "3",236 "_name": "The Beach"237 },238 {239 "container": "",240 "desc": "The beach curves northeastwards around a promontory, and ends in a cul-de-sac among more craggy volcanic rocks. There are a few small tide pools closer to the cliff, and there seems to be motion within them. In the face of the cliff itself, there is an indentation where the rock appears smoother and more regular.",241 "events": {242 "trap": {243 "_id": "0",244 "_chance": "0"245 },246 "treasure": {247 "_id": "0",248 "_chance": "0"249 },250 "environment": {251 "_id": "0",252 "_chance": "0"253 },254 "encounter": {255 "_id": "0",256 "_chance": "0"257 }258 },259 "exits": {260 "link": [261 {262 "_id": "3",263 "_lock": "0",264 "__text": "West"265 },266 {267 "_id": "0",268 "_lock": "0",269 "__text": "East"270 },271 {272 "_id": "0",273 "_lock": "0",274 "__text": "North"275 },276 {277 "_id": "0",278 "_lock": "0",279 "__text": "South"280 },281 {282 "_id": "0",283 "_lock": "0",284 "__text": "Up"285 },286 {287 "_id": "0",288 "_lock": "0",289 "__text": "Down"290 }291 ]292 },293 "_id": "4",294 "_name": "The Tide Pools"295 },296 {297 "container": "",298 "desc": "The round opening is thrice the height of a man and leads to a passageway northwards into the face of the cliff. The concave stone walls are slimy and eroded, but a sandy floor allows you to keep your footing. The air reeks of rotting fish. The cave quickly narrows as it progresses further inside, until it's about eight cubits high. The floorwhen exposed is slick weathered stone. Thirty paces along the way into the deepening gloom, a series of very wide steps leads downwards into the darkness on your left. To your right, a square opening braced by rough timbers leads to a horizontal shaft. The cave also continues northward, curving away to the right. ",299 "events": {300 "trap": {301 "_id": "0",302 "_chance": "0"303 },304 "treasure": {305 "_id": "0",306 "_chance": "0"307 },308 "environment": {309 "_id": "0",310 "_chance": "0"311 },312 "encounter": {313 "_id": "0",314 "_chance": "0"315 }316 },317 "exits": {318 "link": [319 {320 "_id": "6",321 "_lock": "0",322 "__text": "West"323 },324 {325 "_id": "8",326 "_lock": "0",327 "__text": "East"328 },329 {330 "_id": "7",331 "_lock": "0",332 "__text": "North"333 },334 {335 "_id": "3",336 "_lock": "0",337 "__text": "South"338 },339 {340 "_id": "0",341 "_lock": "0",342 "__text": "Up"343 },344 {345 "_id": "0",346 "_lock": "0",347 "__text": "Down"348 }349 ]350 },351 "_id": "5",352 "_name": "The Cave Entrance"353 },354 {355 "container": "",356 "desc": "A colossal stairway descends westwards, wide enough for five armed men to walk abreast. Each step is a platform three paces long and a cubit high. The stone has been weathered smooth as if by millenia of frequent use. The passage forms a descending rounded shaft with no true walls or ceiling, but the series of steps within are squared and even. 100 long steps down from the cave entrance, there is an intersection. ",357 "events": {358 "trap": {359 "_id": "0",360 "_chance": "0"361 },362 "treasure": {363 "_id": "0",364 "_chance": "0"365 },366 "environment": {367 "_id": "0",368 "_chance": "0"369 },370 "encounter": {371 "_id": "0",372 "_chance": "0"373 }374 },375 "exits": {376 "link": [377 {378 "_id": "11",379 "_lock": "0",380 "__text": "West"381 },382 {383 "_id": "5",384 "_lock": "0",385 "__text": "East"386 },387 {388 "_id": "0",389 "_lock": "0",390 "__text": "North"391 },392 {393 "_id": "0",394 "_lock": "0",395 "__text": "South"396 },397 {398 "_id": "0",399 "_lock": "0",400 "__text": "Up"401 },402 {403 "_id": "0",404 "_lock": "0",405 "__text": "Down"406 }407 ]408 },409 "_id": "6",410 "_name": "The Grand Stairway"411 },412 {413 "container": "",414 "desc": "The tunnel continues from the cave entrance, sloping downwards and gradually turning to the east. A hundred paces from the Grand Staircase, a gate of heavy iron bars is anchored solidly into the stone from floor to ceiling. A sturdy lock secures the gate.",415 "events": {416 "trap": {417 "_id": "0",418 "_chance": "0"419 },420 "treasure": {421 "_id": "0",422 "_chance": "0"423 },424 "environment": {425 "_id": "0",426 "_chance": "0"427 },428 "encounter": {429 "_id": "0",430 "_chance": "0"431 }432 },433 "exits": {434 "link": [435 {436 "_id": "0",437 "_lock": "0",438 "__text": "West"439 },440 {441 "_id": "15",442 "_lock": "1",443 "__text": "East"444 },445 {446 "_id": "0",447 "_lock": "0",448 "__text": "North"449 },450 {451 "_id": "5",452 "_lock": "0",453 "__text": "South"454 },455 {456 "_id": "0",457 "_lock": "0",458 "__text": "Up"459 },460 {461 "_id": "0",462 "_lock": "0",463 "__text": "Down"464 }465 ]466 },467 "_id": "7",468 "_name": "The Descending Passageway"469 },470 {471 "container": "",472 "desc": "A short, crude shaft leads from the Cave Entrance to a large chamber fifty paces long and half as wide. Clusters of stalactites and stalagmites obscure your view, but the area is filled with the detritus of some activity in the distant past. There are rotting remains of extensive wooden scaffoldings in several places, piles of rubble from smashed rocks, and signs of digging. There are rags, waste, and rusted tools on the floor, some strewn about and some in jumbled heaps. You see at least three human skeletons. Two are in the northeast corner of the chamber, and one is laid across an iron grate to the South. ",473 "events": {474 "trap": {475 "_id": "0",476 "_chance": "0"477 },478 "treasure": {479 "_id": "0",480 "_chance": "0"481 },482 "environment": {483 "_id": "0",484 "_chance": "0"485 },486 "encounter": {487 "_id": "0",488 "_chance": "0"489 }490 },491 "exits": {492 "link": [493 {494 "_id": "5",495 "_lock": "0",496 "__text": "West"497 },498 {499 "_id": "0",500 "_lock": "0",501 "__text": "East"502 },503 {504 "_id": "9",505 "_lock": "0",506 "__text": "North"507 },508 {509 "_id": "10",510 "_lock": "1",511 "__text": "South"512 },513 {514 "_id": "0",515 "_lock": "0",516 "__text": "Up"517 },518 {519 "_id": "0",520 "_lock": "0",521 "__text": "Down"522 }523 ]524 },525 "_id": "8",526 "_name": "The Ruined Excavation"527 },528 {529 "container": "",530 "desc": "A crude spiral staircase has been roughly hacked from the rock, allowing a single person to painstakingly move between the ruined excavation and the group of rooms directly below. ",531 "events": {532 "trap": {533 "_id": "0",534 "_chance": "0"535 },536 "treasure": {537 "_id": "0",538 "_chance": "0"539 },540 "environment": {541 "_id": "0",542 "_chance": "0"543 },544 "encounter": {545 "_id": "0",546 "_chance": "0"547 }548 },549 "exits": {550 "link": [551 {552 "_id": "0",553 "_lock": "0",554 "__text": "West"555 },556 {557 "_id": "0",558 "_lock": "0",559 "__text": "East"560 },561 {562 "_id": "0",563 "_lock": "0",564 "__text": "North"565 },566 {567 "_id": "0",568 "_lock": "0",569 "__text": "South"570 },571 {572 "_id": "8",573 "_lock": "0",574 "__text": "Up"575 },576 {577 "_id": "16",578 "_lock": "0",579 "__text": "Down"580 }581 ]582 },583 "_id": "9",584 "_name": "The Spiral Stairs"585 },586 {587 "container": "",588 "desc": "A cylindrical enclosure of stones resembling a country well is covered with a locked iron grate. The depth of the dark shaft within cannot be ascertained, but iron handholds and sections of plank have been fashioned into a ladder down one wall, descending into the ominous darkness. ",589 "events": {590 "trap": {591 "_id": "0",592 "_chance": "0"593 },594 "treasure": {595 "_id": "0",596 "_chance": "0"597 },598 "environment": {599 "_id": "0",600 "_chance": "0"601 },602 "encounter": {603 "_id": "0",604 "_chance": "0"605 }606 },607 "exits": {608 "link": [609 {610 "_id": "0",611 "_lock": "0",612 "__text": "West"613 },614 {615 "_id": "0",616 "_lock": "0",617 "__text": "East"618 },619 {620 "_id": "0",621 "_lock": "0",622 "__text": "North"623 },624 {625 "_id": "0",626 "_lock": "0",627 "__text": "South"628 },629 {630 "_id": "8",631 "_lock": "0",632 "__text": "Up"633 },634 {635 "_id": "0",636 "_lock": "0",637 "__text": "Down"638 }639 ]640 },641 "_id": "10",642 "_name": "The Dark Shaft"643 },644 {645 "container": "",646 "desc": "You've reached a large chamber that resembles a vast hemispherical bubble within the earth. The floor is level, flat and worn. The dome above is twice the height as that of the stairs, with an elaborate network of delicate gilded patterns adorning the milky stone. At the edges of the chamber, The Grand stairway continues ever downwards to the West, but there is another, wider but more eroded series of descending steps to the South. To the North is an ornate archway which leads to an obviously manmade corridor. ",647 "events": {648 "trap": {649 "_id": "0",650 "_chance": "0"651 },652 "treasure": {653 "_id": "0",654 "_chance": "0"655 },656 "environment": {657 "_id": "0",658 "_chance": "0"659 },660 "encounter": {661 "_id": "0",662 "_chance": "0"663 }664 },665 "exits": {666 "link": [667 {668 "_id": "13",669 "_lock": "0",670 "__text": "West"671 },672 {673 "_id": "6",674 "_lock": "0",675 "__text": "East"676 },677 {678 "_id": "12",679 "_lock": "0",680 "__text": "North"681 },682 {683 "_id": "14",684 "_lock": "0",685 "__text": "South"686 },687 {688 "_id": "0",689 "_lock": "0",690 "__text": "Up"691 },692 {693 "_id": "0",694 "_lock": "0",695 "__text": "Down"696 }697 ]698 },699 "_id": "11",700 "_name": "The Platform"701 },702 {703 "container": "",704 "desc": "The great southern corridor will lead to an astonishing new area.",705 "events": {706 "trap": {707 "_id": "0",708 "_chance": "0"709 },710 "treasure": {711 "_id": "0",712 "_chance": "0"713 },714 "environment": {715 "_id": "0",716 "_chance": "0"717 },718 "encounter": {719 "_id": "0",720 "_chance": "0"721 }722 },723 "exits": {724 "link": [725 {726 "_id": "0",727 "_lock": "0",728 "__text": "West"729 },730 {731 "_id": "0",732 "_lock": "0",733 "__text": "East"734 },735 {736 "_id": "0",737 "_lock": "0",738 "__text": "North"739 },740 {741 "_id": "11",742 "_lock": "0",743 "__text": "South"744 },745 {746 "_id": "0",747 "_lock": "0",748 "__text": "Up"749 },750 {751 "_id": "0",752 "_lock": "0",753 "__text": "Down"754 }755 ]756 },757 "_id": "12",758 "_name": "The Great Southern Corridor"759 },760 {761 "container": "",762 "desc": "The colossal stairway continues to descend, and its dimensions remain the same scale. However, after a hundred steps and then another hundred, the excruciating trek continues ever downwards. After five hundred steps, there is an opening into a cavernous darkness. ",763 "events": {764 "trap": {765 "_id": "0",766 "_chance": "0"767 },768 "treasure": {769 "_id": "0",770 "_chance": "0"771 },772 "environment": {773 "_id": "0",774 "_chance": "0"775 },776 "encounter": {777 "_id": "0",778 "_chance": "0"779 }780 },781 "exits": {782 "link": [783 {784 "_id": "0",785 "_lock": "0",786 "__text": "West"787 },788 {789 "_id": "8",790 "_lock": "0",791 "__text": "East"792 },793 {794 "_id": "0",795 "_lock": "0",796 "__text": "North"797 },798 {799 "_id": "0",800 "_lock": "0",801 "__text": "South"802 },803 {804 "_id": "0",805 "_lock": "0",806 "__text": "Up"807 },808 {809 "_id": "0",810 "_lock": "0",811 "__text": "Down"812 }813 ]814 },815 "_id": "13",816 "_name": "The Grand Stairway"817 },818 {819 "container": "",820 "desc": "The eroded stone stairway continues downward to the South from the Platform. The smell of salt and decay hangs heavy in the humid air, and after a hundred steps you see clear seawater completely filling the passageway further below. The stairs continue on down beneath the surface and into the deep. ",821 "events": {822 "trap": {823 "_id": "0",824 "_chance": "0"825 },826 "treasure": {827 "_id": "0",828 "_chance": "0"829 },830 "environment": {831 "_id": "0",832 "_chance": "0"833 },834 "encounter": {835 "_id": "0",836 "_chance": "0"837 }838 },839 "exits": {840 "link": [841 {842 "_id": "0",843 "_lock": "0",844 "__text": "West"845 },846 {847 "_id": "0",848 "_lock": "0",849 "__text": "East"850 },851 {852 "_id": "0",853 "_lock": "0",854 "__text": "North"855 },856 {857 "_id": "0",858 "_lock": "0",859 "__text": "South"860 },861 {862 "_id": "11",863 "_lock": "0",864 "__text": "Up"865 },866 {867 "_id": "0",868 "_lock": "0",869 "__text": "Down"870 }871 ]872 },873 "_id": "14",874 "_name": "The Passage to the Deep"875 },876 {877 "container": "",878 "desc": "You can't go here. ",879 "events": {880 "trap": {881 "_id": "0",882 "_chance": "0"883 },884 "treasure": {885 "_id": "0",886 "_chance": "0"887 },888 "environment": {889 "_id": "0",890 "_chance": "0"891 },892 "encounter": {893 "_id": "0",894 "_chance": "0"895 }896 },897 "exits": {898 "link": [899 {900 "_id": "7",901 "_lock": "0",902 "__text": "West"903 },904 {905 "_id": "0",906 "_lock": "0",907 "__text": "East"908 },909 {910 "_id": "0",911 "_lock": "0",912 "__text": "North"913 },914 {915 "_id": "0",916 "_lock": "0",917 "__text": "South"918 },919 {920 "_id": "0",921 "_lock": "0",922 "__text": "Up"923 },924 {925 "_id": "0",926 "_lock": "0",927 "__text": "Down"928 }929 ]930 },931 "_id": "15",932 "_name": "The Secured Passageway"933 },934 {935 "container": "",936 "desc": "This is a very large room with the remnants of smashed and rotting furniture here and there. There are doors to the North, East and West, and the Spiral Staircase is at the South end. ",937 "events": {938 "trap": {939 "_id": "0",940 "_chance": "0"941 },942 "treasure": {943 "_id": "0",944 "_chance": "0"945 },946 "environment": {947 "_id": "0",948 "_chance": "0"949 },950 "encounter": {951 "_id": "0",952 "_chance": "0"953 }954 },955 "exits": {956 "link": [957 {958 "_id": "24",959 "_lock": "0",960 "__text": "West"961 },962 {963 "_id": "17",964 "_lock": "0",965 "__text": "East"966 },967 {968 "_id": "15",969 "_lock": "0",970 "__text": "North"971 },972 {973 "_id": "9",974 "_lock": "0",975 "__text": "South"976 },977 {978 "_id": "0",979 "_lock": "0",980 "__text": "Up"981 },982 {983 "_id": "0",984 "_lock": "0",985 "__text": "Down"986 }987 ]988 },989 "_id": "16",990 "_name": "The Common Room"991 },992 {993 "container": "",994 "desc": "This open tiled area has doors to the North, East and South and opens out on the West into the Common Room.",995 "events": {996 "trap": {997 "_id": "0",998 "_chance": "0"999 },1000 "treasure": {1001 "_id": "0",1002 "_chance": "0"1003 },1004 "environment": {1005 "_id": "0",1006 "_chance": "0"1007 },1008 "encounter": {1009 "_id": "0",1010 "_chance": "0"1011 }1012 },1013 "exits": {1014 "link": [1015 {1016 "_id": "16",1017 "_lock": "0",1018 "__text": "West"1019 },1020 {1021 "_id": "21",1022 "_lock": "0",1023 "__text": "East"1024 },1025 {1026 "_id": "18",1027 "_lock": "0",1028 "__text": "North"1029 },1030 {1031 "_id": "22",1032 "_lock": "0",1033 "__text": "South"1034 },1035 {1036 "_id": "0",1037 "_lock": "0",1038 "__text": "Up"1039 },1040 {1041 "_id": "0",1042 "_lock": "0",1043 "__text": "Down"1044 }1045 ]1046 },1047 "_id": "17",1048 "_name": "The Entry Hall"1049 },1050 {1051 "container": "",1052 "desc": "There are large piles of worthless debris filling most of this room, but you do see a few intact crates and two sturdy chests. There are doors to the East and South. ",1053 "events": {1054 "trap": {1055 "_id": "0",1056 "_chance": "0"1057 },1058 "treasure": {1059 "_id": "0",1060 "_chance": "0"1061 },1062 "environment": {1063 "_id": "0",1064 "_chance": "0"1065 },1066 "encounter": {1067 "_id": "0",1068 "_chance": "0"1069 }1070 },1071 "exits": {1072 "link": [1073 {1074 "_id": "0",1075 "_lock": "0",1076 "__text": "West"1077 },1078 {1079 "_id": "19",1080 "_lock": "0",1081 "__text": "East"1082 },1083 {1084 "_id": "0",1085 "_lock": "0",1086 "__text": "North"1087 },1088 {1089 "_id": "17",1090 "_lock": "0",1091 "__text": "South"1092 },1093 {1094 "_id": "0",1095 "_lock": "0",1096 "__text": "Up"1097 },1098 {1099 "_id": "0",1100 "_lock": "0",1101 "__text": "Down"1102 }1103 ]1104 },1105 "_id": "18",1106 "_name": "The Small Storage Room"1107 },1108 {1109 "container": "",1110 "desc": "This small room has a large polished wooden desk and empty shelves along the North wall which are remarkably intact compared to the other rooms in this area. Rotted pulp which may once have been paper litters much of the floor. There are doors to the West and South.",1111 "events": {1112 "trap": {1113 "_id": "0",1114 "_chance": "0"1115 },1116 "treasure": {1117 "_id": "0",1118 "_chance": "0"1119 },1120 "environment": {1121 "_id": "0",1122 "_chance": "0"1123 },1124 "encounter": {1125 "_id": "0",1126 "_chance": "0"1127 }1128 },1129 "exits": {1130 "link": [1131 {1132 "_id": "18",1133 "_lock": "0",1134 "__text": "West"1135 },1136 {1137 "_id": "0",1138 "_lock": "0",1139 "__text": "East"1140 },1141 {1142 "_id": "0",1143 "_lock": "0",1144 "__text": "North"1145 },1146 {1147 "_id": "20",1148 "_lock": "0",1149 "__text": "South"1150 },1151 {1152 "_id": "0",1153 "_lock": "0",1154 "__text": "Up"1155 },1156 {1157 "_id": "0",1158 "_lock": "0",1159 "__text": "Down"1160 }1161 ]1162 },1163 "_id": "19",1164 "_name": "The Storage Office"1165 },1166 {1167 "container": "",1168 "desc": "There are dozens of sturdy-looking crates stacked on all sides of this much larger room, which appear to be untouched by the ravages of time. You also see two tall cabinets and two locked chests. There is a door to the North. ",1169 "events": {1170 "trap": {1171 "_id": "0",1172 "_chance": "0"1173 },1174 "treasure": {1175 "_id": "0",1176 "_chance": "0"1177 },1178 "environment": {1179 "_id": "0",1180 "_chance": "0"1181 },1182 "encounter": {1183 "_id": "0",1184 "_chance": "0"1185 }1186 },1187 "exits": {1188 "link": [1189 {1190 "_id": "0",1191 "_lock": "0",1192 "__text": "West"1193 },1194 {1195 "_id": "0",1196 "_lock": "0",1197 "__text": "East"1198 },1199 {1200 "_id": "19",1201 "_lock": "0",1202 "__text": "North"1203 },1204 {1205 "_id": "0",1206 "_lock": "0",1207 "__text": "South"1208 },1209 {1210 "_id": "0",1211 "_lock": "0",1212 "__text": "Up"1213 },1214 {1215 "_id": "0",1216 "_lock": "0",1217 "__text": "Down"1218 }1219 ]1220 },1221 "_id": "20",1222 "_name": "The Great Storage Room"1223 },1224 {1225 "container": "",1226 "desc": "Two large stone tables dominate the center of this room, surrounded by a dozen or more rotting wooden chairs. Broken crockery and shattered plates are strewn about the floor. There is an opening to the Entry Hall to the West, and at the South side of the room an alcove turns a corner leading into the Kitchen. ",1227 "events": {1228 "trap": {1229 "_id": "0",1230 "_chance": "0"1231 },1232 "treasure": {1233 "_id": "0",1234 "_chance": "0"1235 },1236 "environment": {1237 "_id": "0",1238 "_chance": "0"1239 },1240 "encounter": {1241 "_id": "0",1242 "_chance": "0"1243 }1244 },1245 "exits": {1246 "link": [1247 {1248 "_id": "17",1249 "_lock": "0",1250 "__text": "West"1251 },1252 {1253 "_id": "0",1254 "_lock": "0",1255 "__text": "East"1256 },1257 {1258 "_id": "0",1259 "_lock": "0",1260 "__text": "North"1261 },1262 {1263 "_id": "22",1264 "_lock": "0",1265 "__text": "South"1266 },1267 {1268 "_id": "0",1269 "_lock": "0",1270 "__text": "Up"1271 },1272 {1273 "_id": "0",1274 "_lock": "0",1275 "__text": "Down"1276 }1277 ]1278 },1279 "_id": "21",1280 "_name": "The Mess Hall"1281 },1282 {1283 "container": "",1284 "desc": "The Basins, shelves, hearths and chimneys in this large workspace indicate this was once a kitchen. The worktables, pots and utensils that have not been carried away by looters and scavengers are smashed, rusted, and otherwise ruined. There is a sturdy door to the South and on the East an alcove opens into the Mess Hall. ",1285 "events": {1286 "trap": {1287 "_id": "0",1288 "_chance": "0"1289 },1290 "treasure": {1291 "_id": "0",1292 "_chance": "0"1293 },1294 "environment": {1295 "_id": "0",1296 "_chance": "0"1297 },1298 "encounter": {1299 "_id": "0",1300 "_chance": "0"1301 }1302 },1303 "exits": {1304 "link": [1305 {1306 "_id": "0",1307 "_lock": "0",1308 "__text": "West"1309 },1310 {1311 "_id": "21",1312 "_lock": "0",1313 "__text": "East"1314 },1315 {1316 "_id": "17",1317 "_lock": "0",1318 "__text": "North"1319 },1320 {1321 "_id": "23",1322 "_lock": "0",1323 "__text": "South"1324 },1325 {1326 "_id": "0",1327 "_lock": "0",1328 "__text": "Up"1329 },1330 {1331 "_id": "0",1332 "_lock": "0",1333 "__text": "Down"1334 }1335 ]1336 },1337 "_id": "22",1338 "_name": "The Kitchen"1339 },1340 {1341 "container": "",1342 "desc": "This stone-walled room is lined with shelves of various heights which still contain some intact lidded pots. Rotting sacks are piled on the floor at one side, and a few smashed crates which now seem to be empty. Examination of the pots reveals the fragrance of exotic spices, but only dust remains. The door to the North leads back to the Kitchen.",1343 "events": {1344 "trap": {1345 "_id": "0",1346 "_chance": "0"1347 },1348 "treasure": {1349 "_id": "0",1350 "_chance": "0"1351 },1352 "environment": {1353 "_id": "0",1354 "_chance": "0"1355 },1356 "encounter": {1357 "_id": "0",1358 "_chance": "0"1359 }1360 },1361 "exits": {1362 "link": [1363 {1364 "_id": "0",1365 "_lock": "0",1366 "__text": "West"1367 },1368 {1369 "_id": "0",1370 "_lock": "0",1371 "__text": "East"1372 },1373 {1374 "_id": "22",1375 "_lock": "0",1376 "__text": "North"1377 },1378 {1379 "_id": "0",1380 "_lock": "0",1381 "__text": "South"1382 },1383 {1384 "_id": "0",1385 "_lock": "0",1386 "__text": "Up"1387 },1388 {1389 "_id": "0",1390 "_lock": "0",1391 "__text": "Down"1392 }1393 ]1394 },1395 "_id": "23",1396 "_name": "The Pantry"1397 },1398 {1399 "container": "",1400 "desc": "Several well-preserved couches and decorative tables are found in this area, although a couple have been overturned. A pile of rags and human bones lies on the floor to the West, near the archway leading to another room. There are doorways to the North and South, and an archway to the East back to the Common Room. ",1401 "events": {1402 "trap": {1403 "_id": "0",1404 "_chance": "0"1405 },1406 "treasure": {1407 "_id": "0",1408 "_chance": "0"1409 },1410 "environment": {1411 "_id": "0",1412 "_chance": "0"1413 },1414 "encounter": {1415 "_id": "0",1416 "_chance": "0"1417 }1418 },1419 "exits": {1420 "link": [1421 {1422 "_id": "27",1423 "_lock": "0",1424 "__text": "West"1425 },1426 {1427 "_id": "16",1428 "_lock": "0",1429 "__text": "East"1430 },1431 {1432 "_id": "25",1433 "_lock": "0",1434 "__text": "North"1435 },1436 {1437 "_id": "29",1438 "_lock": "0",1439 "__text": "South"1440 },1441 {1442 "_id": "0",1443 "_lock": "0",1444 "__text": "Up"1445 },1446 {1447 "_id": "0",1448 "_lock": "0",1449 "__text": "Down"1450 }1451 ]1452 },1453 "_id": "24",1454 "_name": "The Barracks Entry"1455 },1456 {1457 "container": "",1458 "desc": "Four collapsed sets of bunk beds in this small room indicate that it was once a sleeping quarters for multiple parties. There are four chests as well, but they are all smashed or opened, and all are empty. There are doors to the West and South. ",1459 "events": {1460 "trap": {1461 "_id": "0",1462 "_chance": "0"1463 },1464 "treasure": {1465 "_id": "0",1466 "_chance": "0"1467 },1468 "environment": {1469 "_id": "0",1470 "_chance": "0"1471 },1472 "encounter": {1473 "_id": "0",1474 "_chance": "0"1475 }1476 },1477 "exits": {1478 "link": [1479 {1480 "_id": "26",1481 "_lock": "0",1482 "__text": "West"1483 },1484 {1485 "_id": "0",1486 "_lock": "0",1487 "__text": "East"1488 },1489 {1490 "_id": "0",1491 "_lock": "0",1492 "__text": "North"1493 },1494 {1495 "_id": "24",1496 "_lock": "0",1497 "__text": "South"1498 },1499 {1500 "_id": "0",1501 "_lock": "0",1502 "__text": "Up"1503 },1504 {1505 "_id": "0",1506 "_lock": "0",1507 "__text": "Down"1508 }1509 ]1510 },1511 "_id": "25",1512 "_name": "The Northeast Barracks"1513 },1514 {1515 "container": "",1516 "desc": "Four collapsed sets of bunk beds crowd this small room. There are four chests here. Most have been smashed or opened, but one remains intact.",1517 "events": {1518 "trap": {1519 "_id": "0",1520 "_chance": "0"1521 },1522 "treasure": {1523 "_id": "0",1524 "_chance": "0"1525 },1526 "environment": {1527 "_id": "0",1528 "_chance": "0"1529 },1530 "encounter": {1531 "_id": "0",1532 "_chance": "0"1533 }1534 },1535 "exits": {1536 "link": [1537 {1538 "_id": "0",1539 "_lock": "0",1540 "__text": "West"1541 },1542 {1543 "_id": "25",1544 "_lock": "0",1545 "__text": "East"1546 },1547 {1548 "_id": "0",1549 "_lock": "0",1550 "__text": "North"1551 },1552 {1553 "_id": "27",1554 "_lock": "0",1555 "__text": "South"1556 },1557 {1558 "_id": "0",1559 "_lock": "0",1560 "__text": "Up"1561 },1562 {1563 "_id": "0",1564 "_lock": "0",1565 "__text": "Down"1566 }1567 ]1568 },1569 "_id": "26",1570 "_name": "The Northwest Barracks"1571 },1572 {1573 "container": "",1574 "desc": "This spacious room contains a few sofas, chairs and tables which seem to be reasonably unweathered. There are two ornate rugs on the stone floor, and the furniture seems to remain placed in its original arrangement. There are doors to the North and South, an archway to the East leading to the Entry, and another archway to the West leading into a larger room. ",1575 "events": {1576 "trap": {1577 "_id": "0",1578 "_chance": "0"1579 },1580 "treasure": {1581 "_id": "0",1582 "_chance": "0"1583 },1584 "environment": {1585 "_id": "0",1586 "_chance": "0"1587 },1588 "encounter": {1589 "_id": "0",1590 "_chance": "0"1591 }1592 },1593 "exits": {1594 "link": [1595 {1596 "_id": "30",1597 "_lock": "0",1598 "__text": "West"1599 },1600 {1601 "_id": "24",1602 "_lock": "0",1603 "__text": "East"1604 },1605 {1606 "_id": "26",1607 "_lock": "0",1608 "__text": "North"1609 },1610 {1611 "_id": "28",1612 "_lock": "0",1613 "__text": "South"1614 },1615 {1616 "_id": "0",1617 "_lock": "0",1618 "__text": "Up"1619 },1620 {1621 "_id": "0",1622 "_lock": "0",1623 "__text": "Down"1624 }1625 ]1626 },1627 "_id": "27",1628 "_name": "The Barracks Foyer"1629 },1630 {1631 "container": "",1632 "desc": "This cozy room has two large beds, as well a sturdy wooden desk. A lion skin rug covers most of the stone floor, and there is a solid-looking locked chest at the foot of each bed. There are doors to the North and East.",1633 "events": {1634 "trap": {1635 "_id": "0",1636 "_chance": "0"1637 },1638 "treasure": {1639 "_id": "0",1640 "_chance": "0"1641 },1642 "environment": {1643 "_id": "0",1644 "_chance": "0"1645 },1646 "encounter": {1647 "_id": "0",1648 "_chance": "0"1649 }1650 },1651 "exits": {1652 "link": [1653 {1654 "_id": "0",1655 "_lock": "0",1656 "__text": "West"1657 },1658 {1659 "_id": "29",1660 "_lock": "0",1661 "__text": "East"1662 },1663 {1664 "_id": "27",1665 "_lock": "0",1666 "__text": "North"1667 },1668 {1669 "_id": "0",1670 "_lock": "0",1671 "__text": "South"1672 },1673 {1674 "_id": "0",1675 "_lock": "0",1676 "__text": "Up"1677 },1678 {1679 "_id": "0",1680 "_lock": "0",1681 "__text": "Down"1682 }1683 ]1684 },1685 "_id": "28",1686 "_name": "The South Barracks"1687 },1688 {1689 "container": "",1690 "desc": "This large area has basins, tubs, fountains and oubliettes carved from the stone in a thoughtful arragement. There are stone benches along the South wall. This is obviously a lavatory created for the use of all the occupants of this complex. There are doors to the North and West. ",1691 "events": {1692 "trap": {1693 "_id": "0",1694 "_chance": "0"1695 },1696 "treasure": {1697 "_id": "0",1698 "_chance": "0"1699 },1700 "environment": {1701 "_id": "0",1702 "_chance": "0"1703 },1704 "encounter": {1705 "_id": "0",1706 "_chance": "0"1707 }1708 },1709 "exits": {1710 "link": [1711 {1712 "_id": "28",1713 "_lock": "0",1714 "__text": "West"1715 },1716 {1717 "_id": "0",1718 "_lock": "0",1719 "__text": "East"1720 },1721 {1722 "_id": "24",1723 "_lock": "0",1724 "__text": "North"1725 },1726 {1727 "_id": "0",1728 "_lock": "0",1729 "__text": "South"1730 },1731 {1732 "_id": "0",1733 "_lock": "0",1734 "__text": "Up"1735 },1736 {1737 "_id": "0",1738 "_lock": "0",1739 "__text": "Down"1740 }1741 ]1742 },1743 "_id": "29",1744 "_name": "The Lavatory"1745 },1746 {1747 "container": "",1748 "desc": "This very large room has implements of battle displayed on the walls and in numerous racks along the sides. There is display space for adequate weaponry and armor to equip a score of men, but many pieces have been removed. You see several serviceable swords, axes, shields and helmets here. The 3 large cabinets alond the east wall may contain more equipment. There is an opening into the Barracks Foyer to the East and stairs leading downward to the South.",1749 "events": {1750 "trap": {1751 "_id": "0",1752 "_chance": "0"1753 },1754 "treasure": {1755 "_id": "0",1756 "_chance": "0"1757 },1758 "environment": {1759 "_id": "0",1760 "_chance": "0"1761 },1762 "encounter": {1763 "_id": "0",1764 "_chance": "0"1765 }1766 },1767 "exits": {1768 "link": [1769 {1770 "_id": "27",1771 "_lock": "0",1772 "__text": "West"1773 },1774 {1775 "_id": "0",1776 "_lock": "0",1777 "__text": "East"1778 },1779 {1780 "_id": "0",1781 "_lock": "0",1782 "__text": "North"1783 },1784 {1785 "_id": "31",1786 "_lock": "0",1787 "__text": "South"1788 },1789 {1790 "_id": "0",1791 "_lock": "0",1792 "__text": "Up"1793 },1794 {1795 "_id": "0",1796 "_lock": "0",1797 "__text": "Down"1798 }1799 ]1800 },1801 "_id": "30",1802 "_name": "The Armory"1803 },1804 {1805 "container": "",1806 "desc": "Stairs lead downward from the South end of the Armory to a cozy-looking room below. Fine, polished wooden paneling ornaments the walls on either side. There are a dozen steps.",1807 "events": {1808 "trap": {1809 "_id": "0",1810 "_chance": "0"1811 },1812 "treasure": {1813 "_id": "0",1814 "_chance": "0"1815 },1816 "environment": {1817 "_id": "0",1818 "_chance": "0"1819 },1820 "encounter": {1821 "_id": "0",1822 "_chance": "0"1823 }1824 },1825 "exits": {1826 "link": [1827 {1828 "_id": "0",1829 "_lock": "0",1830 "__text": "West"1831 },1832 {1833 "_id": "0",1834 "_lock": "0",1835 "__text": "East"1836 },1837 {1838 "_id": "30",1839 "_lock": "0",1840 "__text": "North"1841 },1842 {1843 "_id": "32",1844 "_lock": "0",1845 "__text": "South"1846 },1847 {1848 "_id": "0",1849 "_lock": "0",1850 "__text": "Up"1851 },1852 {1853 "_id": "0",1854 "_lock": "0",1855 "__text": "Down"1856 }1857 ]1858 },1859 "_id": "31",1860 "_name": "The Back Stairway"1861 },1862 {1863 "container": "",1864 "desc": "This is the Lounge, description pending. Exits North, East, South, West.",1865 "events": {1866 "trap": {1867 "_id": "0",1868 "_chance": "0"1869 },1870 "treasure": {1871 "_id": "0",1872 "_chance": "0"1873 },1874 "environment": {1875 "_id": "0",1876 "_chance": "0"1877 },1878 "encounter": {1879 "_id": "0",1880 "_chance": "0"1881 }1882 },1883 "exits": {1884 "link": [1885 {1886 "_id": "33",1887 "_lock": "0",1888 "__text": "West"1889 },1890 {1891 "_id": "36",1892 "_lock": "0",1893 "__text": "East"1894 },1895 {1896 "_id": "31",1897 "_lock": "0",1898 "__text": "North"1899 },1900 {1901 "_id": "35",1902 "_lock": "0",1903 "__text": "South"1904 },1905 {1906 "_id": "0",1907 "_lock": "0",1908 "__text": "Up"1909 },1910 {1911 "_id": "0",1912 "_lock": "0",1913 "__text": "Down"1914 }1915 ]1916 },1917 "_id": "32",1918 "_name": "The Lounge"1919 },1920 {1921 "container": "",1922 "desc": "This is the Archaeologist's Study, description pending. Exits North, East, and South.",1923 "events": {1924 "trap": {1925 "_id": "0",1926 "_chance": "0"1927 },1928 "treasure": {1929 "_id": "0",1930 "_chance": "0"1931 },1932 "environment": {1933 "_id": "0",1934 "_chance": "0"1935 },1936 "encounter": {1937 "_id": "0",1938 "_chance": "0"1939 }1940 },1941 "exits": {1942 "link": [1943 {1944 "_id": "34",1945 "_lock": "1",1946 "__text": "North"1947 },1948 {1949 "_id": "0",1950 "_lock": "0",1951 "__text": "West"1952 },1953 {1954 "_id": "32",1955 "_lock": "0",1956 "__text": "East"1957 },1958 {1959 "_id": "0",1960 "_lock": "0",1961 "__text": "North"1962 },1963 {1964 "_id": "35",1965 "_lock": "0",1966 "__text": "South"1967 },1968 {1969 "_id": "0",1970 "_lock": "0",1971 "__text": "Up"1972 },1973 {1974 "_id": "0",1975 "_lock": "0",1976 "__text": "Down"1977 }1978 ]1979 },1980 "_id": "33",1981 "_name": "The Archaeologist's Study"1982 },1983 {1984 "container": "",1985 "desc": "This is the Archaeologist's Quarters, description pending. Exit South.",1986 "events": {1987 "trap": {1988 "_id": "0",1989 "_chance": "0"1990 },1991 "treasure": {1992 "_id": "0",1993 "_chance": "0"1994 },1995 "environment": {1996 "_id": "0",1997 "_chance": "0"1998 },1999 "encounter": {2000 "_id": "0",2001 "_chance": "0"2002 }2003 },2004 "exits": {2005 "link": [2006 {2007 "_id": "0",2008 "_lock": "0",2009 "__text": "West"2010 },2011 {2012 "_id": "0",2013 "_lock": "0",2014 "__text": "East"2015 },2016 {2017 "_id": "0",2018 "_lock": "0",2019 "__text": "North"2020 },2021 {2022 "_id": "33",2023 "_lock": "1",2024 "__text": "South"2025 },2026 {2027 "_id": "0",2028 "_lock": "0",2029 "__text": "Up"2030 },2031 {2032 "_id": "0",2033 "_lock": "0",2034 "__text": "Down"2035 }2036 ]2037 },2038 "_id": "34",2039 "_name": "The Archaeologist's Quarters"2040 },2041 {2042 "container": "",2043 "desc": "This is the Library, description pending. Exits North, East, West. ",2044 "events": {2045 "trap": {2046 "_id": "0",2047 "_chance": "0"2048 },2049 "treasure": {2050 "_id": "0",2051 "_chance": "0"2052 },2053 "environment": {2054 "_id": "0",2055 "_chance": "0"2056 },2057 "encounter": {2058 "_id": "0",2059 "_chance": "0"2060 }2061 },2062 "exits": {2063 "link": [2064 {2065 "_id": "33",2066 "_lock": "0",2067 "__text": "West"2068 },2069 {2070 "_id": "36",2071 "_lock": "0",2072 "__text": "East"2073 },2074 {2075 "_id": "32",2076 "_lock": "0",2077 "__text": "North"2078 },2079 {2080 "_id": "0",2081 "_lock": "0",2082 "__text": "South"2083 },2084 {2085 "_id": "0",2086 "_lock": "0",2087 "__text": "Up"2088 },2089 {2090 "_id": "0",2091 "_lock": "0",2092 "__text": "Down"2093 }2094 ]2095 },2096 "_id": "35",2097 "_name": "The Library"2098 },2099 {2100 "container": "",2101 "desc": "This is the Wizard's Quarters, description pending. Exits North and West.",2102 "events": {2103 "trap": {2104 "_id": "0",2105 "_chance": "0"2106 },2107 "treasure": {2108 "_id": "0",2109 "_chance": "0"2110 },2111 "environment": {2112 "_id": "0",2113 "_chance": "0"2114 },2115 "encounter": {2116 "_id": "0",2117 "_chance": "0"2118 }2119 },2120 "exits": {2121 "link": [2122 {2123 "_id": "37",2124 "_lock": "0",2125 "__text": "North"2126 },2127 {2128 "_id": "32",2129 "_lock": "0",2130 "__text": "West"2131 },2132 {2133 "_id": "0",2134 "_lock": "0",2135 "__text": "East"2136 },2137 {2138 "_id": "0",2139 "_lock": "0",2140 "__text": "North"2141 },2142 {2143 "_id": "0",2144 "_lock": "0",2145 "__text": "South"2146 },2147 {2148 "_id": "0",2149 "_lock": "0",2150 "__text": "Up"2151 },2152 {2153 "_id": "0",2154 "_lock": "0",2155 "__text": "Down"2156 }2157 ]2158 },2159 "_id": "36",2160 "_name": "The Wizard's Quarters"2161 },2162 {2163 "container": "",2164 "desc": "This is the Wizard's Study, description pending. Exits South and East.",2165 "events": {2166 "trap": {2167 "_id": "0",2168 "_chance": "0"2169 },2170 "treasure": {2171 "_id": "0",2172 "_chance": "0"2173 },2174 "environment": {2175 "_id": "0",2176 "_chance": "0"2177 },2178 "encounter": {2179 "_id": "0",2180 "_chance": "0"2181 }2182 },2183 "exits": {2184 "link": [2185 {2186 "_id": "0",2187 "_lock": "0",2188 "__text": "West"2189 },2190 {2191 "_id": "38",2192 "_lock": "0",2193 "__text": "East"2194 },2195 {2196 "_id": "0",2197 "_lock": "0",2198 "__text": "North"2199 },2200 {2201 "_id": "36",2202 "_lock": "0",2203 "__text": "South"2204 },2205 {2206 "_id": "0",2207 "_lock": "0",2208 "__text": "Up"2209 },2210 {2211 "_id": "0",2212 "_lock": "0",2213 "__text": "Down"2214 }2215 ]2216 },2217 "_id": "37",2218 "_name": "The Wizard's Study"2219 },2220 {2221 "container": "",2222 "desc": "This is the Wizard's Workshop, description pending. Exits East, South, and West.",2223 "events": {2224 "trap": {2225 "_id": "0",2226 "_chance": "0"2227 },2228 "treasure": {2229 "_id": "0",2230 "_chance": "0"2231 },2232 "environment": {2233 "_id": "0",2234 "_chance": "0"2235 },2236 "encounter": {2237 "_id": "0",2238 "_chance": "0"2239 }2240 },2241 "exits": {2242 "link": [2243 {2244 "_id": "37",2245 "_lock": "1",2246 "__text": "West"2247 },2248 {2249 "_id": "39",2250 "_lock": "0",2251 "__text": "East"2252 },2253 {2254 "_id": "0",2255 "_lock": "0",2256 "__text": "North"2257 },2258 {2259 "_id": "35",2260 "_lock": "0",2261 "__text": "South"2262 },2263 {2264 "_id": "0",2265 "_lock": "0",2266 "__text": "Up"2267 },2268 {2269 "_id": "0",2270 "_lock": "0",2271 "__text": "Down"2272 }2273 ]2274 },2275 "_id": "38",2276 "_name": "The Wizard's Workshop"2277 },2278 {2279 "container": "",2280 "desc": "This is the Portal Platform, description pending. ",2281 "events": {2282 "trap": {2283 "_id": "0",2284 "_chance": "0"2285 },2286 "treasure": {2287 "_id": "0",2288 "_chance": "0"2289 },2290 "environment": {2291 "_id": "0",2292 "_chance": "0"2293 },2294 "encounter": {2295 "_id": "0",2296 "_chance": "0"2297 }2298 },2299 "exits": {2300 "link": [2301 {2302 "_id": "38",2303 "_lock": "0",2304 "__text": "West"2305 },2306 {2307 "_id": "3",2308 "_lock": "0",2309 "__text": "East"2310 },2311 {2312 "_id": "0",2313 "_lock": "0",2314 "__text": "North"2315 },2316 {2317 "_id": "0",2318 "_lock": "0",2319 "__text": "South"2320 },2321 {2322 "_id": "0",2323 "_lock": "0",2324 "__text": "Up"2325 },2326 {2327 "_id": "0",2328 "_lock": "0",2329 "__text": "Down"2330 }2331 ]2332 },2333 "_id": "39",2334 "_name": "Portal Platform "2335 }2336 ],2337 }...

Full Screen

Full Screen

lock.js

Source:lock.js Github

copy

Full Screen

1var app = app || {};2(function() {3 var loadings = {};4 5 app.loading = function(id){6 if(!id || loadings[id])7 return;8 var o = $(id), display = o.css('display'),9 p = $('<p class="app-loading"><img src="images/loading.gif" /></p>');10 o.hide().after(p);11 loadings[id] = {self: o, loading: p, display: display};12 };13 app.removeLoading = function(id){14 if(!id || !loadings[id])15 return;16 loadings[id].loading.remove();17 loadings[id].self.css('display', loadings[id].display);18 delete loadings[id];19 };20 app.cleanLoading = function(){21 for(var k in loadings) {22 app.removeLoading(k);23 }24 };25 26})();27/* Class Lock */28(function() {29var _lock = {30 lock: false, el: null, t1: 500, t2: 2000,31 msg: {}, handle: 0, success: null, error: null, fail: null,32 33 begin: function() {34 var l = _lock;35 if(!(l.lock)) { return false; }36 l.handle = window.setTimeout(l.addLoading, l.t1);37 return true;38 },39 40 addLoading: function() {41 var l = _lock;42 if(l.lock) {43 app.loading(l.el);44 if(app.Package.ALLOW_MISS) {45 l.handle = window.setTimeout(app.Lock.fail, l.t2);46 }47 }48 },49 50 stop: function() {51 var l = _lock;52 window.clearTimeout(l.handle);53 l.lock = false;54 l.handle = 0;55 app.removeLoading(l.el);56 l.success = l.fail = l.error = l.el = null;57 l.msg = {};58 },59 60 callback: function(method, data) {61 var l = _lock, msg = {msg: l.msg}, f = l[method];62 app.removeLoading(l.el);63 (typeof data == 'object') || (data = {data: data});64 (typeof f === 'function') && f.call(msg, data);65 if(data.notRemove === true) {66 app.loading(l.el);67 } else {68 l.stop();69 }70 },71};72app.Lock = {73 isLocking: function() { return _lock.lock; },74 75 getMessage: function() { return _lock.msg; },76 77 attach: function(selector, timeShowLoading, timeEnd, options) {78 var timeBegin = timeShowLoading;79 if(!options) {80 if(typeof timeEnd === 'object') {81 options = timeEnd;82 timeEnd = undefined;83 } else if(typeof timeBegin === 'object') {84 options = timeBegin;85 timeBegin = undefined;86 } else if(typeof selector === 'object'){87 options = selector;88 selector = options.loading;89 }90 }91 if(timeBegin == undefined) {92 if(options.tbegin != null) { timeBegin = options.tbegin + 0; }93 else { timeBegin = 500; }94 }95 if(timeEnd == undefined) {96 if(options.tbegin != null) { timeEnd = options.tend + 0; }97 else { timeEnd = timeBegin + 2000; }98 }99 if(timeEnd < 0) {100 timeEnd = 2147483647;101 }102 if(timeBegin >= 0 && timeEnd > timeBegin) {103 var l = _lock;104 if(l.lock)105 return false; /* necessary */106 l.lock = true;107 options || (options = {});108 l.el = selector;109 l.t1 = timeBegin;110 l.t2 = timeEnd - timeBegin;111 l.success = options.success;112 l.fail = options.fail;113 l.error = options.error;114 l.msg = options.data;115 return l.begin();116 }117 return false;118 },119 120 detach: function(data) {121 _lock.callback((data && data.err) ? 'error' : 'success', data);122 },123 124 remove: function() {125 _lock.stop();126 },127 128 removeLoading: function() {129 app.removeLoading(_lock.el);130 },131 132 addLoading: function() {133 app.loading(_lock.el);134 },135 136 fail: function() {137 _lock.callback('fail');138 },139 140 error: function(data) {141 _lock.callback('error', data);142 },143 144 success: function(data) {145 _lock.callback('success', data);146 },147 148};...

Full Screen

Full Screen

LockFixture.ts

Source:LockFixture.ts Github

copy

Full Screen

1const assert = require('chai').assert;2import { ILock } from 'pip-services3-components-nodex';3let LOCK1: string = "lock_1";4let LOCK2: string = "lock_2";5let LOCK3: string = "lock_3";6export class LockFixture {7 private _lock: ILock;8 public constructor(lock: ILock) {9 this._lock = lock;10 }11 public async testTryAcquireLock(): Promise<void> {12 // Try to acquire lock for the first time13 let ok = await this._lock.tryAcquireLock(null, LOCK1, 3000);14 assert.isTrue(ok);15 // Try to acquire lock for the second time16 ok = await this._lock.tryAcquireLock(null, LOCK1, 3000);17 assert.isFalse(ok);18 // Release the lock19 await this._lock.releaseLock(null, LOCK1);20 // Try to acquire lock for the third time21 ok = await this._lock.tryAcquireLock(null, LOCK1, 3000);22 assert.isTrue(ok);23 await this._lock.releaseLock(null, LOCK1);24 }25 public async testAcquireLock(): Promise<void> {26 // Acquire lock for the first time27 await this._lock.acquireLock(null, LOCK2, 3000, 1000);28 // Acquire lock for the second time29 try {30 await this._lock.acquireLock(null, LOCK2, 3000, 1000);31 assert.fail("Expected exception on the second lock attempt");32 } catch {33 // Expected exception...34 }35 // Release the lock36 await this._lock.releaseLock(null, LOCK2);37 // Acquire lock for the third time38 await this._lock.acquireLock(null, LOCK2, 3000, 1000);39 await this._lock.releaseLock(null, LOCK2);40 }41 public async testReleaseLock(): Promise<void> {42 // Acquire lock for the first time43 let ok = await this._lock.tryAcquireLock(null, LOCK3, 3000);44 assert.isTrue(ok);45 // Release the lock for the first time46 await this._lock.releaseLock(null, LOCK3);47 // Release the lock for the second time48 await this._lock.releaseLock(null, LOCK3);49 }50 ...

Full Screen

Full Screen

Using AI Code Generation

copy

Full Screen

1var root = this;2root._lock = function() {3 root._locked = true;4}5root._unlock = function() {6 root._locked = false;7}8root._isLocked = function() {9 return root._locked;10}11root._lock();

Full Screen

Using AI Code Generation

copy

Full Screen

1var root = _lock(1);2var obj = root.create();3_unlock(1);4obj.someMethod();5var obj = _lock(1).create();6_unlock(1);7obj.someMethod();8var obj = _lock(1).create();9obj.someMethod();10_unlock(1);11var obj = _lock(1).create();12obj.someMethod();13var obj = _lock(1).create();14obj.someMethod();15var obj = _lock(1).create();16obj.someMethod();17var obj = _lock(1).create();18obj.someMethod();19var obj = _lock(1).create();20obj.someMethod();21var obj = _lock(1).create();22obj.someMethod();

Full Screen

Automation Testing Tutorials

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

LambdaTest Learning Hubs:

YouTube

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

Run root automation tests on LambdaTest cloud grid

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

Try LambdaTest Now !!

Get 100 minutes of automation test minutes FREE!!

Next-Gen App & Browser Testing Cloud

Was this article helpful?

Helpful

NotHelpful