* Got rid of jo framework

* Using jqMobi as a javascript framework
* Using jqMobi-Ui as ui framework
* Implemented basic minimax AI
* Implemented minimalistic player pairing server for node.js
This commit is contained in:
Wanja 2012-04-06 01:54:53 +02:00
parent d6ec8c877e
commit ff1ffc407d
93 changed files with 5964 additions and 8077 deletions

View file

@ -4,31 +4,32 @@
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk android:minSdkVersion="8" />
<uses-sdk android:minSdkVersion="8" android:targetSdkVersion="10" />
<uses-feature android:name="android.hardware.screen.portrait"/>
<supports-screens
android:largeScreens="true"
android:normalScreens="true"
android:smallScreens="true"
android:resizeable="true"
android:anyDensity="true"
/>
<uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.VIBRATE" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_LOCATION_EXTRA_COMMANDS" />
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.RECEIVE_SMS" />
<uses-permission android:name="android.permission.RECORD_AUDIO" />
<uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS" />
<uses-permission android:name="android.permission.READ_CONTACTS" />
<uses-permission android:name="android.permission.WRITE_CONTACTS" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.GET_ACCOUNTS" />
<uses-permission android:name="android.permission.BROADCAST_STICKY" />
android:largeScreens="true"
android:normalScreens="true"
android:smallScreens="true"
android:resizeable="true"
android:anyDensity="true" />
<!--uses-permission android:name="android.permission.CAMERA" /-->
<uses-permission android:name="android.permission.VIBRATE" />
<!--uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" /-->
<!--uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" /-->
<!--uses-permission android:name="android.permission.ACCESS_LOCATION_EXTRA_COMMANDS" /-->
<!--uses-permission android:name="android.permission.READ_PHONE_STATE" /-->
<uses-permission android:name="android.permission.INTERNET" />
<!--uses-permission android:name="android.permission.RECEIVE_SMS" /-->
<!--uses-permission android:name="android.permission.RECORD_AUDIO" /-->
<!--uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS" /-->
<!--uses-permission android:name="android.permission.READ_CONTACTS" /-->
<!--uses-permission android:name="android.permission.WRITE_CONTACTS" /-->
<!--uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" /-->
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<!--uses-permission android:name="android.permission.GET_ACCOUNTS" /-->
<!--uses-permission android:name="android.permission.BROADCAST_STICKY" /-->
<application
android:icon="@drawable/ic_launcher"
@ -37,7 +38,8 @@ android:anyDensity="true"
<activity
android:name=".AndrotaflActivity"
android:label="@string/app_name"
android:configChanges="orientation|keyboardHidden" >
android:configChanges="orientation|keyboardHidden"
android:screenOrientation="portrait" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />

78
assets/www/css/icons.css Normal file
View file

@ -0,0 +1,78 @@
@font-face {
font-family: 'IcoMoon';
src:
url('icons.ttf') format('truetype'),
url('icons.svg#IcoMoon') format('svg');
font-weight: normal;
font-style: normal;
}
.icon:before {
color:inherit;font-weight:normal !important;font-family:'IcoMoon';
padding:5px;float:left;
font-size: 28px;
text-align: center;
vertical-align:middle;
line-height:auto;
}
.icon.mini:before{font-size:20px !important;height:16px !important;width:16px !important;line-height:16px !important;}
.icon.big:before{font-size:40px !important;height:32px !important;width:32px !important;line-height:32px !important;}
.icon.home:before{content:'!';}
.icon.pencil:before{content:'\22';}
.icon.picture:before{content:'#';}
.icon.camera:before{content:'$';}
.icon.headset:before{content:'%';}
.icon.paper:before{content:'&';}
.icon.stack:before{content:'\27';}
.icon.folder:before{content:'(';}
.icon.tag:before{content:')';}
.icon.basket:before{content:'*';}
.icon.phone:before{content:'+';}
.icon.mail:before{content:',';}
.icon.location:before{content:'-';}
.icon.clock:before{content:'.';}
.icon.calendar:before{content:'/';}
.icon.message:before{content:'0';}
.icon.chat:before{content:'1';}
.icon.user:before{content:'2';}
.icon.loading:before{content:'3';}
.icon.refresh:before{content:'4';}
.icon.magnifier:before{content:'5';}
.icon.key:before{content:'6';}
.icon.settings:before{content:'7';}
.icon.graph:before{content:'8';}
.icon.trash:before{content:'9';}
.icon.pin:before{content:':';}
.icon.target:before{content:';';}
.icon.download:before{content:'<';}
.icon.upload:before{content:'=';}
.icon.star:before{content:'>';}
.icon.heart:before{content:'?';}
.icon.warning:before{content:'@';}
.icon.add:before{content:'A';}
.icon.remove:before{content:'B';}
.icon.question:before{content:'C';}
.icon.info:before{content:'D';}
.icon.error:before{content:'E';}
.icon.check:before{content:'F';}
.icon.minimize:before{content:'G';}
.icon.close:before{content:'H';}
.icon.up:before{content:'I';}
.icon.down:before{content:'J';}
.icon.left:before{content:'K';}
.icon.right:before{content:'L';}
.icon.tools:before{content:'M';}
.icon.html5:before{content:'N';}
.icon.css:before{content:'O';}
.icon.js:before{content:'P';}
.icon.cloud:before{content:'Q';}
.icon.tv:before{content:'R';}
.icon.wifi:before{content:'S';}
.icon.new:before{content:'T';}
.icon.mic:before{content:'U';}
.icon.database:before{content:'V';}
.icon.busy:before{content:'W';}
.icon.bug:before{content:'X';}
.icon.lamp:before{content:'Y';}

68
assets/www/css/icons.svg Normal file
View file

@ -0,0 +1,68 @@
<?xml version="1.0" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" >
<svg xmlns="http://www.w3.org/2000/svg">
<metadata>
This is a custom SVG font generated by IcoMoon.
</metadata>
<defs>
<font id="IcoMoon" horiz-adv-x="700" >
<font-face units-per-em="1000" ascent="750" descent="-250" />
<missing-glyph horiz-adv-x="500" />
<glyph unicode="&#x21;" d="M350 613l350 -263h-73l-277 208l-277 -208h-73zM525 131v219h43v-263h-437v263h44v-219h350z" />
<glyph unicode="&#x22;" d="M498 631l133 -132l-457 -457l-174 -42l42 174zM505 541l-384 -384l37 -36l383 384zM666 666q27 -28 33 -60.5t-14 -52.5l-28 -27l-132 132l27 27q20 19 53 14t61 -33z" />
<glyph unicode="&#x23;" d="M568 307q17 0 25.5 -20.5t13.5 -45.5q5 -29 6 -66h-525q16 66 40 115t52.5 81.5t60.5 49t65 16.5q22 0 37 -13t26 -32t19 -42t15.5 -42t15.5 -32t19 -13q16 0 32.5 7t32.5 15t32.5 15t32.5 7zM700 568v-481h-700v481h700zM656 525h-613v-394h613v394zM525 376 q-26 0 -44 18t-18 43q0 26 18 44.5t44 18.5t44 -18.5t18 -44.5q0 -25 -18 -43t-44 -18z" />
<glyph unicode="&#x24;" d="M656 568q18 0 31 -12.5t13 -30.5v-438q0 -17 -13 -30.5t-31 -13.5h-613q-17 0 -30 13.5t-13 30.5v438q0 18 13 30.5t30 12.5h154l21 88h263l28 -88h147zM656 525h-183l-28 88h-189l-21 -88h-191h-1v-438h1h612v438zM350 481q36 0 68 -13.5t56 -37.5t37.5 -56t13.5 -68 t-13.5 -68t-37.5 -56t-56 -37.5t-68 -13.5t-68 13.5t-56 37.5t-37.5 56t-13.5 68t13.5 68t37.5 56t56 37.5t68 13.5zM350 175q27 0 51 10.5t42 28t28 41.5t10 51t-10 51t-28 42t-42 28t-51 10t-51 -10t-42 -28t-28.5 -42t-10.5 -51t10.5 -51t28.5 -41.5t42 -28t51 -10.5z " />
<glyph unicode="&#x25;" d="M181 303q9 1 16 -5.5t7 -16.5v-259q0 -9 -7 -15.5t-16 -5.5l-31 4q-10 2 -16.5 10t-6.5 18v238q0 10 6.5 18t16.5 10zM550 299q10 -2 16.5 -10t6.5 -18v-238q0 -10 -6.5 -18t-16.5 -10l-31 -4q-9 -1 -16 5.5t-7 15.5v259q0 10 7 16.5t16 5.5zM700 349q0 -40 -8.5 -77 t-24.5 -71q3 -11 5 -23.5t2 -25.5q0 -47 -21 -83t-55 -52v269q9 -5 17.5 -10.5t15.5 -13.5q10 34 10 75q0 60 -23 113t-62.5 92.5t-92.5 62.5t-113 23t-113 -23t-92.5 -62.5t-62.5 -92.5t-23 -113q0 -41 10 -75q7 8 15.5 13.5t17.5 10.5v-269q-34 16 -55 52t-21 83 q0 13 2 25.5t5 23.5q-16 34 -24.5 71t-8.5 77q0 73 27.5 136.5t75 111t111.5 75t136 27.5t136 -27.5t111.5 -75t75 -111t27.5 -136.5z" />
<glyph unicode="&#x26;" d="M619 550q10 -11 17 -27t7 -30v-452q0 -17 -12.5 -29t-29.5 -12h-502q-17 0 -29.5 12t-12.5 29v618q0 17 12.5 29t29.5 12h336q14 0 30.5 -6.5t26.5 -16.5zM477 653v-120h119zM615 493q0 3 -0.5 6t-1.5 7h-164v164q-6 3 -14 3h-336q-6 0 -10 -4.5t-4 -9.5v-618 q0 -5 4 -9.5t10 -4.5h502q6 0 10 4.5t4 9.5v452z" />
<glyph unicode="&#x27;" d="M613 524q19 0 31.5 -12.5t12.5 -31.5v-437q0 -17 -12.5 -30t-31.5 -13h-351q-17 0 -30 13t-13 30v47h-45q-18 0 -31.5 12t-13.5 30v44h-42q-18 0 -31 12.5t-13 30.5v436q0 18 13 31.5t31 13.5h348q19 0 32.5 -13.5t13.5 -31.5v-45h42q18 0 31 -12t13 -30v-44h46zM129 568 q0 18 13.5 30t31.5 12h262v45h-348v-438h41v351zM219 131v349q0 19 13 31.5t30 12.5h260v45h-348v-438h45zM608 479h-348v-434h348v434z" />
<glyph unicode="&#x28;" d="M699 489l1 -1l-16 -413q0 -1 -1 -2h-666h-1v2l-16 413q0 1 1 1h698zM44 538l27 89h231l17 -47h343l8 -42h-626z" />
<glyph unicode="&#x29;" d="M700 700v-267l-433 -433l-267 267l433 433h267zM596 514q18 17 18 41t-18 41q-17 18 -41 18t-41 -18q-17 -17 -17 -41t17 -41t41 -17t41 17z" />
<glyph unicode="&#x2a;" d="M700 457v-89h-36l-48 -344h-530l-47 344h-39v89h155l119 153q-8 11 -8 23q0 18 12.5 30.5t29.5 12.5q18 0 30.5 -12.5t12.5 -29.5q0 -18 -12.5 -30.5t-30.5 -12.5q-1 0 -2 0.5t-2 0.5l-105 -135h304l-105 135q-1 0 -1.5 -1t-2.5 -1q-18 0 -30.5 13t-12.5 30 q0 18 12.5 30.5t30.5 12.5q17 0 29.5 -12.5t12.5 -29.5q0 -14 -8 -24l119 -153h153zM204 204h-60v-112h60v112zM204 368h-60v-109h60v109zM321 204h-60v-112h60v112zM321 368h-60v-109h60v109zM439 204h-60v-112h60v112zM439 368h-60v-109h60v109zM556 204h-60v-112h60v112z M556 368h-60v-109h60v109z" />
<glyph unicode="&#x2b;" d="M440 192q11 6 16.5 10t13.5 12l165 -138q-10 -10 -28 -23.5t-39 -25.5q-20 -11 -40 -18.5t-35 -8.5q-29 11 -68 29.5t-81.5 44.5t-84 60t-75.5 75q-35 38 -62 81.5t-47 86.5t-33.5 82t-21.5 67q2 15 12 34t23 39q14 20 29.5 36t26.5 24l119 -178q-9 -8 -13 -12.5 t-11 -14.5q-8 -11 -6 -21.5t7 -24.5l1 -1q0 -1 1 -2q9 -16 29 -45.5t46 -63.5q37 -37 68.5 -62.5t43.5 -34.5q12 -7 22.5 -10t21.5 3zM247 496l-120 177l37 26q8 2 16 -0.5t13 -7.5l91 -139q3 -5 4 -14t-7 -14zM674 156q5 -5 6.5 -13.5t-1.5 -16.5l-29 -34l-164 138l31 31 q7 7 15 5.5t13 -5.5z" />
<glyph unicode="&#x2c;" d="M445 337l255 229v-404zM0 566l255 -229l-255 -175v404zM350 252l61 55l289 -173h-700l289 173zM679 566l-329 -245l-329 245h658z" />
<glyph unicode="&#x2d;" d="M350 700q42 0 79 -16t64 -43t43 -64t16 -79v-9v-5v-3q0 -1 -0.5 -2.5t-0.5 -2.5q-3 -31 -13.5 -68t-25.5 -76t-32.5 -79t-35.5 -77q-42 -87 -94 -176q-52 89 -94 176q-18 37 -36 77t-32.5 79t-25 76t-13.5 68q0 1 -0.5 2.5t-0.5 2.5v3v5v9q0 42 16 79t43 64t64 43t79 16z M350 415q36 0 61.5 25.5t25.5 61.5t-25.5 61.5t-61.5 25.5t-61.5 -25.5t-25.5 -61.5t25.5 -61.5t61.5 -25.5z" />
<glyph unicode="&#x2e;" d="M350 700q73 0 136.5 -27.5t111 -75t75 -111.5t27.5 -136q0 -73 -27.5 -136.5t-75 -111t-111 -75t-136.5 -27.5q-72 0 -136 27.5t-111.5 75t-75 111t-27.5 136.5q0 72 27.5 136t75 111.5t111.5 75t136 27.5zM350 56q61 0 114.5 23t93.5 63t63 93.5t23 114.5t-23 114 t-63 93t-93.5 63t-114.5 23t-114.5 -23t-93 -63t-62.5 -93t-23 -114t23 -114.5t62.5 -93.5t93 -63t114.5 -23zM521 404l8 -49l-126 -21q-5 -17 -19.5 -28t-33.5 -11q-23 0 -39 16t-16 39q0 16 8.5 29t22.5 20v193h49v-193q6 -3 10.5 -7.5l9.5 -9.5z" />
<glyph unicode="&#x2f;" d="M608 610q17 0 29.5 -15t12.5 -36v-73h-600v73q0 21 12 36t29 15h98v64q0 11 6 18.5t15 7.5t15.5 -7.5t6.5 -18.5v-64h231v64q0 11 6.5 18.5t15.5 7.5t15 -7.5t6 -18.5v-64h102zM210 515q17 0 28 11.5t11 27.5q0 21 -17 33v-19q0 -11 -6.5 -18t-15.5 -7t-15 7t-6 18v19 q-18 -11 -18 -33q0 -16 11 -27.5t28 -11.5zM485 515q17 0 28 11.5t11 27.5q0 22 -18 33v-19q0 -11 -6 -18t-15 -7t-15.5 7t-6.5 18v19q-17 -12 -17 -33q0 -16 11 -27.5t28 -11.5zM50 465h600v-415q0 -21 -12.5 -35.5t-29.5 -14.5h-517q-17 0 -29 14.5t-12 35.5v415zM452 314 h156v111h-156v-111zM452 187h156v92h-156v-92zM452 41h156v111h-156v-111zM278 314h139v111h-139v-111zM278 187h139v92h-139v-92zM278 41h139v111h-139v-111zM87 314h156v111h-156v-111zM87 187h156v92h-156v-92zM87 41h156v111h-156v-111z" />
<glyph unicode="&#x30;" d="M350 689q72 0 136 -20.5t111.5 -56.5t75 -84t27.5 -103t-27.5 -103t-75 -84t-111.5 -56.5t-136 -20.5h-6q-16 -24 -36 -47.5t-41 -44t-42 -36t-39 -22.5q23 29 35.5 61.5t12.5 67.5q0 8 -1 18.5t-3 18.5q-50 14 -92.5 38.5t-73 56.5t-47.5 71t-17 82q0 55 27.5 103t75 84 t111.5 56.5t136 20.5z" />
<glyph unicode="&#x31;" d="M88 263v87h-45q-17 0 -30 13t-13 30v220q0 17 13 30t30 13h438q18 0 31 -13t13 -30v-220q0 -17 -13 -30t-31 -13h-306zM656 437q18 0 31 -12.5t13 -31.5v-218q0 -18 -13 -31t-31 -13h-43v-88l-88 88h-263q-17 0 -30.5 13t-13.5 31v131h307q18 0 30.5 13t12.5 31v87h88z " />
<glyph unicode="&#x32;" d="M354 299q-36 0 -68 13.5t-56 37.5t-37.5 56t-13.5 69q0 36 13.5 68t37.5 55.5t56 37.5t68 14t68 -14t56 -37.5t37.5 -55.5t13.5 -68q0 -37 -13.5 -69t-37.5 -56t-56 -37.5t-68 -13.5zM508 259q40 0 75 -15t61 -41.5t41 -61.5t15 -75v-16h-700v16q0 40 15 75t41 61.5 t61 41.5t75 15h316z" />
<glyph unicode="&#x33;" d="M350 699q34 0 57.5 -24t23.5 -58q0 -33 -23.5 -56.5t-57.5 -23.5t-57.5 23.5t-23.5 56.5q0 34 23.5 58t57.5 24zM350 139q23 0 39.5 -16.5t16.5 -39.5q0 -24 -16.5 -40t-39.5 -16t-39.5 16t-16.5 40q0 23 16.5 39.5t39.5 16.5zM574 350q0 18 13 30.5t30 12.5 q19 0 32 -12.5t13 -30.5t-13 -30.5t-32 -12.5q-17 0 -30 12.5t-13 30.5zM83 419q28 0 48 -20t20 -49t-20 -49t-48 -20q-29 0 -49 20t-20 49t20 49t49 20zM513 513q-11 11 -11 26.5t11 26.5t26.5 11t26.5 -11t11 -26.5t-11 -26.5t-26.5 -11t-26.5 11zM205 205q18 -18 18 -44 t-18 -44q-18 -19 -44 -19t-44 19q-19 18 -19 44t19 44q18 18 44 18t44 -18zM575 196q14 -15 14 -35.5t-14 -35.5q-15 -14 -35.5 -14t-35.5 14q-15 15 -15 35.5t15 35.5t35.5 15t35.5 -15zM108 487q-23 22 -23 52.5t23 52.5q22 23 52.5 23t53.5 -23q22 -22 22 -52.5 t-22 -52.5q-23 -23 -53.5 -23t-52.5 23z" />
<glyph unicode="&#x34;" d="M435 348l98 98q-14 30 -35 55t-48.5 43t-60 28t-67.5 10q-48 0 -90.5 -18.5t-74 -50t-49.5 -73.5t-18 -90t18 -90.5t49.5 -74t74 -49.5t90.5 -18q36 0 69 10.5t61 29t49.5 44.5t34.5 58l83 -35q-18 -43 -48 -79t-69 -62.5t-84.5 -41t-95.5 -14.5q-67 0 -125.5 25.5 t-102 69t-69 102.5t-25.5 125q0 67 25.5 125.5t69 102t102 69t125.5 25.5q44 0 85 -11.5t77 -32.5t65.5 -50.5t50.5 -65.5l100 101v-265h-265z" />
<glyph unicode="&#x35;" d="M615 58q3 -5 1.5 -11.5t-6.5 -9.5l-59 -35q-5 -4 -11.5 -2t-8.5 8l-131 247q-39 -15 -79.5 -16t-78.5 11.5t-70.5 37.5t-54.5 62q-25 41 -31 86.5t4.5 88.5t37 80t67.5 62q41 24 86.5 30t88.5 -4.5t80.5 -37t61.5 -67.5q23 -38 30 -79.5t-0.5 -81.5t-29 -76t-54.5 -63z M395 335q28 16 46 41.5t25.5 54.5t3.5 60t-21 59t-42 46t-54.5 25t-60 3t-58.5 -21t-46 -42t-25.5 -54t-3.5 -59.5t21 -58.5t42 -46.5t54.5 -25.5t60 -3t58.5 21z" />
<glyph unicode="&#x36;" d="M638 629q31 -31 46.5 -69.5t15.5 -78t-14.5 -78t-44.5 -68.5q-42 -41 -95 -53t-106 2l-58 -60h-94v-71h-69v-71h-71v-72h-123q-13 1 -18.5 6.5t-5.5 19.5l-1 100l293 294q-14 52 -1 105.5t54 94.5q30 30 68 45t77.5 15t78 -15.5t68.5 -45.5zM596 508q16 17 16 39.5 t-17 38.5q-17 17 -39.5 17t-38.5 -16t-16 -38.5t16 -39.5q17 -17 39.5 -17t39.5 16z" />
<glyph unicode="&#x37;" d="M643 298q-8 -41 -26 -78l41 -36q-11 -21 -25 -40t-30 -36l-47 28q-29 -28 -67 -49l13 -52q-43 -22 -90 -29l-21 50q-20 -3 -41 -3q-22 0 -41 3l-21 -50q-47 7 -90 29l13 52q-40 22 -68 49l-46 -28q-16 17 -30 36t-26 40l42 36q-18 37 -26 78l-54 5q-3 22 -3 47q0 24 3 47 l54 5q8 41 26 78l-42 36q12 21 26 40t30 36l46 -28q28 27 68 49l-13 53q21 10 43.5 17t46.5 11l21 -50q10 2 20 3t21 1t21 -1t20 -3l21 50q24 -4 46.5 -11t43.5 -17l-13 -53q38 -21 67 -49l47 28q16 -17 30 -36t25 -40l-41 -36q18 -37 26 -78l54 -5q3 -23 3 -47 q0 -25 -3 -47zM350 248q21 0 39.5 8t32.5 22t22 32.5t8 39.5t-8 39.5t-22 32t-32.5 21.5t-39.5 8t-39.5 -8t-32 -21.5t-21.5 -32t-8 -39.5t8 -39.5t21.5 -32.5t32 -22t39.5 -8z" />
<glyph unicode="&#x38;" d="M525 700h131v-132l-43 45l-219 -220l-87 88l-219 -218l-44 43l263 262l87 -87l175 175zM43 0v218h88v-218h-88zM218 0v306h88v-306h-88zM393 0v350h88v-350h-88zM568 0v481h88v-481h-88z" />
<glyph unicode="&#x39;" d="M619 534l-60 -534h-418l-60 534h-52l21 88h191v35q0 17 12.5 30t30.5 13h132q18 0 30.5 -13t12.5 -30v-35h191l21 -88h-52zM254 105l-37 350h-52l37 -350h52zM379 455h-58v-350h58v350zM535 455h-52l-37 -350h52zM275 622h150v35q0 8 -9 8h-132q-9 0 -9 -8v-35z" />
<glyph unicode="&#x3a;" d="M565 570l130 -130l-98 -23l-92 92l-93 92l23 99zM240 420l148 148l178 -179l-147 -147l-33 -167l-119 118l-262 -193l193 262l-125 125zM416 479l-27 26l-117 -117l27 -26z" />
<glyph unicode="&#x3b;" d="M350 700q72 0 136 -27.5t111.5 -75t75 -111.5t27.5 -136t-27.5 -136t-75 -111.5t-111.5 -75t-136 -27.5t-136 27.5t-111.5 75t-75 111.5t-27.5 136t27.5 136t75 111.5t111.5 75t136 27.5zM372 66q52 4 98 26t81 57t56.5 80.5t26.5 98.5h-153v44h153q-4 52 -26 98t-57 81 t-81 57t-98 26v-153h-44v153q-53 -5 -98.5 -26.5t-80.5 -56.5t-57 -81t-26 -98h152v-44h-152q4 -53 26 -98.5t57 -80.5t80.5 -57t98.5 -26v152h44v-152z" />
<glyph unicode="&#x3c;" d="M609 446q40 -10 65.5 -42t25.5 -74q0 -25 -9.5 -46.5t-25.5 -37.5t-37.5 -25.5t-46.5 -9.5h-114l-117 -115l-117 115h-101q-27 0 -51 10.5t-42 28.5t-28.5 42t-10.5 51q0 28 10.5 52t28.5 42t42 28.5t51 10.5q12 0 24 -3q-1 5 -1 14q0 38 26.5 64.5t64.5 26.5 q23 0 41.5 -9.5t31.5 -25.5q23 28 56 44.5t72 16.5q33 0 62 -12.5t51 -34t35 -50t14 -61.5zM350 138l132 130h-86v173h-92v-173h-86z" />
<glyph unicode="&#x3d;" d="M609 442q40 -9 65.5 -41t25.5 -74q0 -25 -9.5 -46.5t-25.5 -37.5t-37.5 -25.5t-46.5 -9.5h-155v-109h-152v109h-142q-27 0 -51 10.5t-42 28.5t-28.5 42t-10.5 51t10.5 51t28.5 42t42 28.5t51 10.5h12.5t11.5 -2q-1 5 -1 14q0 38 26.5 64.5t64.5 26.5q23 0 41.5 -9.5 t31.5 -26.5q23 29 56 45.5t72 16.5q33 0 62 -12.5t51 -34t35 -50.5t14 -62zM396 302h86l-132 130l-132 -130h86v-173h92v173z" />
<glyph unicode="&#x3e;" d="M700 428l-210 -158l76 -253l-216 151l-216 -151l76 253l-210 158l263 6l87 249l87 -249zM491 120l-50 165l137 104l-171 4l-57 162l-57 -162l-171 -4l137 -104l-50 -165l141 99z" />
<glyph unicode="&#x3f;" d="M351 17l-17 24q-38 54 -81 95t-83 76q-34 30 -65 59t-54 61.5t-37 71t-14 86.5q0 40 15 75t41.5 61t61.5 41.5t75 15.5q48 0 89 -21.5t68 -58.5q27 37 68.5 58.5t88.5 21.5q40 0 75 -15.5t61 -41.5t41.5 -61t15.5 -75q0 -46 -14 -83.5t-37.5 -70t-54 -61.5t-63.5 -58 q-43 -38 -85.5 -79.5t-78.5 -96.5zM193 643q-32 0 -59.5 -12t-48.5 -32.5t-33 -48.5t-12 -60q0 -42 12 -75t33 -62t49.5 -56t61.5 -55q38 -32 77.5 -70t75.5 -86q37 50 77.5 88.5t78.5 72.5q32 29 60.5 55.5t49.5 55t33 61t12 71.5q0 32 -12 60t-33 48.5t-49 32.5t-59 12 q-45 0 -82.5 -23.5t-56.5 -64.5l-18 -38l-18 38q-19 41 -56.5 64.5t-82.5 23.5z" />
<glyph unicode="&#x40;" d="M690 117q18 -32 5 -54t-50 -22h-590q-37 0 -50 22t6 54l294 512q19 32 45 32t44 -32zM308 473l11 -241h61l12 241h-84zM350 73q26 0 42 16.5t16 42.5q-1 26 -16.5 43t-41.5 17t-42.5 -17t-16.5 -43t16 -42.5t42 -16.5h1z" />
<glyph unicode="&#x41;" d="M350 700q72 0 136 -27.5t111.5 -75t75 -111.5t27.5 -136t-27.5 -136t-75 -111.5t-111.5 -75t-136 -27.5t-136 27.5t-111.5 75t-75 111.5t-27.5 136t27.5 136t75 111.5t111.5 75t136 27.5zM548 412h-137v136h-122v-136h-136v-123h136v-136h122v136h137v123z" />
<glyph unicode="&#x42;" d="M350 700q72 0 136 -27.5t111.5 -75t75 -111.5t27.5 -136t-27.5 -136t-75 -111.5t-111.5 -75t-136 -27.5t-136 27.5t-111.5 75t-75 111.5t-27.5 136t27.5 136t75 111.5t111.5 75t136 27.5zM547 411h-395v-122h395v122z" />
<glyph unicode="&#x43;" d="M350 700q72 0 136 -27.5t111.5 -75t75 -111.5t27.5 -136t-27.5 -136t-75 -111.5t-111.5 -75t-136 -27.5t-136 27.5t-111.5 75t-75 111.5t-27.5 136t27.5 136t75 111.5t111.5 75t136 27.5zM350 74q26 0 44.5 18t18.5 44t-18.5 44.5t-44.5 18.5t-44 -18.5t-18 -44.5t18 -44 t44 -18zM503 455q6 18 6 37q0 28 -12 54t-32 43q-18 17 -49 28q-15 5 -31 7.5t-34 2.5q-33 0 -60 -12q-28 -10 -49 -30q-11 -11 -19 -23t-15 -26q-6 -15 -10 -31.5t-6 -34.5h87q13 84 74 84q14 0 27 -5q11 -4 22 -13q7 -7 14 -21q5 -13 5 -26q0 -7 -2 -15q0 -8 -5 -16 q-3 -6 -14 -18l-11 -11t-14 -13q-38 -31 -52 -60q-15 -30 -15 -103h83q0 54 7 69q2 7 14 19q10 12 28 25q7 7 14 13.5t14 13.5q11 12 21 29q9 15 14 33z" />
<glyph unicode="&#x44;" d="M350 700q72 0 136 -27.5t111.5 -75t75 -111.5t27.5 -136t-27.5 -136t-75 -111t-111.5 -74.5t-136 -27.5t-136 27.5t-111.5 74.5t-75 111t-27.5 136t27.5 136t75 111.5t111.5 75t136 27.5zM295 580q-21 -20 -21 -46q0 -27 21 -46q20 -19 50 -19q29 0 49 19t20 46t-20 46 t-49 19q-30 0 -50 -19zM467 144q-5 1 -9.5 1.5t-8.5 2.5q-5 1 -8.5 2t-7.5 3q-10 3 -15 11q-6 7 -6 19v228l-179 -4v-23q5 0 11.5 -1t12.5 -3t11 -3.5t8 -3.5q5 -2 8 -5.5t6 -7.5q6 -9 6 -20v-161q0 -14 -5 -19q-5 -8 -15 -11q-4 -1 -7.5 -2t-8.5 -1t-9 -0.5t-9 -1.5v-43 h225v43z" />
<glyph unicode="&#x45;" d="M495 700l205 -205v-290l-205 -205h-290l-205 205v290l205 205h290zM554 225l-125 125l125 126l-78 79l-126 -126l-126 126l-78 -79l126 -126l-126 -125l78 -79l126 126l126 -126z" />
<glyph unicode="&#x46;" d="M700 625q-53 -61 -107 -125.5t-108.5 -135t-109 -149t-108.5 -168.5q-13 15 -33 37.5t-44.5 48.5t-51 53.5t-52 53.5t-48 48.5t-38.5 37.5l66 67l158 -141q65 66 138 136q63 60 143 129.5t167 135.5z" />
<glyph unicode="&#x47;" d="M673 419q11 0 19 -8.5t8 -19.5v-82q0 -11 -8 -19.5t-19 -8.5h-646q-11 0 -19 8.5t-8 19.5v82q0 11 8 19.5t19 8.5h646v0z" />
<glyph unicode="&#x48;" d="M700 535l-185 -185l185 -185l-165 -165l-185 185l-185 -185l-165 165l185 185l-185 185l165 165l185 -185l185 185l165 -165v0z" />
<glyph unicode="&#x49;" d="M134 162l108 188l108 188l109 -188l107 -188h-216h-216v0z" />
<glyph unicode="&#x4a;" d="M566 538l-107 -188l-109 -188l-108 188l-108 188h216h216v0z" />
<glyph unicode="&#x4b;" d="M538 134l-188 107l-188 109l188 108l188 108v-216v-216v0z" />
<glyph unicode="&#x4c;" d="M162 566l188 -108l188 -108l-188 -109l-188 -107v216v216v0z" />
<glyph unicode="&#x4d;" d="M683 148q16 -14 17 -34t-13 -34l-10 -9q-14 -14 -34 -13t-34 17l-273 288q-13 -12 -22 -21.5t-14 -14.5q9 -10 17 -21t1 -23q-24 -5 -37 -16.5t-19 -23.5q-7 -14 -8 -30l-69 -69l-27.5 -27.5t-25 -25.5t-20.5 -21l-13 -13q-9 -9 -20 -8.5t-21.5 5.5t-19 11.5t-11.5 10.5 q-4 3 -10.5 11.5t-11.5 19t-5.5 21.5t8.5 20q4 4 13.5 13t21 21t25 25.5l27.5 27.5l69 69q16 1 30 8q12 6 23.5 18.5t16.5 36.5q11 7 22.5 -1t21.5 -17q4 5 13.5 14.5t23.5 22.5l-27 28q-35 -17 -75 -10.5t-69 35.5q-25 25 -33.5 58.5t1.5 65.5l100 -95l78 78l-95 100 q32 9 65 1.5t59 -33.5q29 -29 35 -69t-11 -75l29 -28q17 17 33.5 33t30 29.5t23.5 23t14 13.5q7 8 11.5 15.5t8.5 14.5q4 8 7 15l44 31l12 -12l12 -12l-32 -43q-7 -3 -15 -7q-7 -4 -14.5 -9t-14.5 -12l-13.5 -13.5l-23 -23t-29.5 -30t-32 -33.5zM269 300q9 8 -1 18 q-9 9 -18 0l-202 -203q-9 -7 0 -18q11 -9 18 0z" />
<glyph unicode="&#x4e;" d="M41 700h618l-56 -630l-254 -70l-252 70zM554 110l48 538h-503l48 -538l203 -56v-1l1 1v-1v1zM445 337h-268l-21 234h387l-7 -77v0h-295l7 -79h281l-21 -237l-158 -44v0v0h-1l-158 44l-10 121h77l6 -62l85 -23h1l86 23z" />
<glyph unicode="&#x4f;" d="M619 550q10 -11 17 -27t7 -30v-452q0 -17 -12.5 -29t-29.5 -12h-502q-17 0 -29.5 12t-12.5 29v618q0 17 12.5 29t29.5 12h336q14 0 30.5 -6.5t26.5 -16.5zM477 533h119l-119 120v-120zM615 493q0 3 -0.5 6t-1.5 7h-164v164q-6 3 -14 3h-336q-6 0 -10 -4.5t-4 -9.5v-618 q0 -5 4 -9.5t10 -4.5h502q6 0 10 4.5t4 9.5v452zM258 424q15 5 33 5h15v-33h-11q-9 0 -16 -3q-4 -1 -12 -7q-3 -2 -7 -12q-3 -8 -3 -19v-31q0 -7 -0.5 -12.5t-1.5 -10.5q-2 -5 -3.5 -9t-3.5 -7q-6 -7 -12 -10q-9 -4 -17 -5q20 -2 29 -15q9 -14 9 -39v-46q0 -11 3 -20 q2 -3 3.5 -6t3.5 -5q5 -5 12 -7q7 -3 16 -3h11v-33h-15q-37 0 -55 18q-18 17 -18 57v45q0 19 -9 28q-8 9 -27 9h-12v34h12q8 0 16 2q8 3 11 6q4 4 7 12q2 8 2 16v31q0 20 4 33q5 15 13 23q8 9 23 14zM491 296q9 -9 27 -9h12v-34h-12h-9t-7 -2q-6 -1 -11 -6q-3 -3 -7 -11 q0 -3 -0.5 -7t-0.5 -9v-47q0 -20 -4 -33q-4 -12 -13 -23q-10 -10 -24 -14q-15 -5 -33 -5h-16v33h12q8 0 16 3q6 1 12 7q5 4 7 12q3 7 3 19v46q0 7 0.5 12.5t1.5 10.5q3 10 7 17q4 6 12 9q4 2 8 3.5t9 1.5q-19 3 -29 16q-9 12 -9 39v30q0 11 -3 19q-2 8 -7 12q-6 6 -12 7 q-8 3 -16 3h-12v33h16q37 0 55 -18q19 -18 19 -57v-30q0 -18 8 -28z" />
<glyph unicode="&#x50;" d="M619 550q10 -11 17 -27t7 -30v-452q0 -17 -12.5 -29t-29.5 -12h-502q-17 0 -29.5 12t-12.5 29v618q0 17 12.5 29t29.5 12h336q14 0 30.5 -6.5t26.5 -16.5zM477 533h119l-119 120v-120zM615 493q0 3 -0.5 6t-1.5 7h-164v164q-6 3 -14 3h-336q-6 0 -10 -4.5t-4 -9.5v-618 q0 -5 4 -9.5t10 -4.5h502q6 0 10 4.5t4 9.5v452zM417 393l130 -109l-130 -109l-30 31l95 78l-95 79zM313 363l-95 -79l95 -78l-30 -31l-130 109l130 109z" />
<glyph unicode="&#x51;" d="M610 349q38 -7 64 -37t26 -71q0 -23 -8.5 -43t-23.5 -35t-35 -23.5t-42 -8.5h-416q-36 0 -68 13.5t-56 37.5t-37.5 56t-13.5 68t13.5 68t37.5 56t56 37.5t68 13.5q26 0 49 -6q12 41 46.5 67t79.5 26t78.5 -25t46.5 -66q12 4 28 4q22 0 42 -8.5t35 -23t24 -34.5t9 -43 q0 -13 -3 -23z" />
<glyph unicode="&#x52;" d="M657 449q17 0 30 -12.5t13 -30.5v-347q0 -17 -13 -29.5t-30 -12.5h-614q-17 0 -30 12.5t-13 29.5v347q0 18 13 30.5t30 12.5h401l-136 223l18 11l158 -234l159 234l17 -11l-136 -223h133zM484 374q0 9 -6 15t-15 6h-390q-9 0 -15 -6t-6 -15v-282q0 -9 6 -15t15 -6h390 q9 0 15 6t6 15v282zM598 395q-12 0 -21 -8.5t-9 -21.5q0 -12 9 -20.5t21 -8.5t20.5 8.5t8.5 20.5q0 13 -8.5 21.5t-20.5 8.5zM598 291q-12 0 -21 -8t-9 -21q0 -12 9 -20.5t21 -8.5t20.5 8.5t8.5 20.5q0 13 -8.5 21t-20.5 8zM657 99h-119v-28h119v28zM657 176h-119v-29h119 v29z" />
<glyph unicode="&#x53;" d="M350 229q15 0 28 -7.5t21 -19.5q5 -7 8 -15.5t3 -17.5t-3 -17t-8 -16q-8 -11 -21 -18t-28 -7t-28 7t-22 18q-4 8 -7 16t-3 17t3 17.5t7 15.5q9 12 22 19.5t28 7.5zM350 357q49 0 90 -23t66 -61l-50 -33q-17 26 -45 42t-61 16t-61 -16t-45 -42l-50 33q26 38 66.5 61 t89.5 23zM350 477q80 0 147 -37.5t109 -100.5l-50 -32q-33 50 -87 80t-119 30t-119 -30t-88 -80l-48 32q41 63 108 100.5t147 37.5zM350 589q55 0 105.5 -13.5t95.5 -38t82.5 -59t66.5 -76.5l-50 -33q-48 73 -127 117.5t-173 44.5t-173 -44.5t-127 -117.5l-50 33 q28 42 66 76.5t83 59t95.5 38t105.5 13.5z" />
<glyph unicode="&#x54;" d="M700 218q0 -36 -25.5 -61.5t-61.5 -25.5h-525q-37 0 -62.5 25.5t-25.5 61.5v263q0 36 25.5 61.5t62.5 25.5h525q36 0 61.5 -25.5t25.5 -61.5v-263zM218 437h-43v-139l-94 139h-38v-219h45v141l94 -141h36v219zM393 437h-131v-219h131v45h-87v43h87v44h-87v43h87v44z M656 437h-43v-169l-52 82h-28l-52 -82v169h-43v-219h57l52 83l52 -83h57v219z" />
<glyph unicode="&#x55;" d="M350 226q-23 0 -42.5 9.5t-34 26.5t-23 39t-8.5 48v228q0 25 8.5 47.5t23 39.5t34 26.5t42.5 9.5q22 0 42 -9.5t35 -26.5t23.5 -39.5t8.5 -47.5v-228q0 -26 -8.5 -48t-23.5 -39t-35 -26.5t-42 -9.5zM542 403v-54q0 -40 -13 -75.5t-36 -63.5t-54.5 -45.5t-67.5 -21.5v-101 h88v-42h-217v42h87v101q-36 4 -67.5 21.5t-54.5 45.5t-36 63.5t-13 75.5v54h42v-54q0 -34 12 -64t32 -52.5t47.5 -35.5t58.5 -13t58.5 13t48 35.5t32.5 52.5t12 64v54h41z" />
<glyph unicode="&#x56;" d="M350 700q72 0 136 -8.5t111.5 -23.5t75 -35t27.5 -42v-88q0 -23 -27.5 -43t-75 -35t-111.5 -23.5t-136 -8.5t-136 8.5t-111.5 23.5t-75 35t-27.5 43v88q0 22 27.5 42t75 35t111.5 23.5t136 8.5zM350 350q59 0 112.5 5.5t97 16t75.5 24t49 30.5q16 -14 16 -33v-87 q0 -23 -27.5 -42.5t-75 -34.5t-111.5 -23.5t-136 -8.5t-136 8.5t-111.5 23.5t-75 34.5t-27.5 42.5v87q0 19 16 33q17 -17 49.5 -30.5t76 -24t96.5 -16t112 -5.5zM350 153q59 0 112.5 6t97 16t75.5 24t49 31q8 -8 12 -16t4 -17v-88q0 -23 -27.5 -42.5t-75 -34.5t-111.5 -23.5 t-136 -8.5t-136 8.5t-111.5 23.5t-75 34.5t-27.5 42.5v88q0 9 4 17t12 16q17 -17 49.5 -31t76 -24t96.5 -16t112 -6z" />
<glyph unicode="&#x57;" d="M474 270q62 -39 100.5 -110.5t38.5 -159.5h-525q0 88 37.5 159.5t100.5 110.5q38 26 59 42.5t21 37.5t-21 37.5t-59 42.5q-63 39 -100.5 110.5t-37.5 159.5h525q0 -88 -38.5 -159.5t-100.5 -110.5q-38 -26 -59.5 -42.5t-21.5 -37.5t21.5 -37.5t59.5 -42.5zM178 568 q12 -24 28 -43h288q16 19 28 43q10 17 16 35.5t11 38.5h-398q5 -20 11 -38.5t16 -35.5zM339 284q-14 -17 -34.5 -31t-44.5 -30l-2 -2h-1q-24 -16 -44.5 -38t-34.5 -51q-10 -17 -16 -35.5t-11 -38.5h67q0 16 19 32.5t41.5 32t41.5 29t19 24.5v108zM549 58q-5 20 -11 38.5 t-16 35.5q-14 29 -34.5 51t-44.5 38h-1l-2 2q-24 16 -44.5 30t-34.5 31v-108q0 -11 18.5 -24.5t41 -29t41.5 -32t19 -32.5h68z" />
<glyph unicode="&#x58;" d="M438 615q-19 8 -43.5 13.5t-44.5 5.5t-44.5 -5.5t-43.5 -13.5v41q0 18 13 31t31 13h87q19 0 32 -13t13 -31v-41zM568 481v-88l132 -43v-44l-132 44v-132h45l87 -218h-44l-70 175h-23q-5 -13 -12 -24.5t-16 -18.5l-151 -121q-12 -11 -34 -11q-20 0 -34 11l-151 121 q-9 7 -16.5 18.5t-12.5 24.5h-23l-70 -175h-43l88 218h43v132l-131 -44v44l131 43v88h-88l-43 87v88l66 -131h77q10 10 27 20l97 48q16 8 40.5 14t42.5 6t42.5 -6t40.5 -14l97 -48q18 -11 26 -20h78l66 131v-88l-44 -87h-88zM372 525h-44v-438h44v438z" />
<glyph unicode="&#x59;" d="M350 700q44 0 82.5 -16.5t67 -44.5t45 -66.5t16.5 -81.5t-23 -93t-52 -99q-14 -25 -18.5 -47.5t-13.5 -39.5t-30.5 -27.5t-69.5 -11.5h-5q-48 0 -70 12t-32 31.5t-15 43.5t-20 48q-29 50 -51 95t-22 88t16.5 81.5t45 66.5t67 44.5t82.5 16.5zM457 315q10 19 22.5 41.5 t23.5 46t18 46.5t7 42q0 36 -14 68t-38 56t-56.5 37.5t-69.5 13.5t-69.5 -13.5t-56.5 -37.5t-38 -56t-14 -68q0 -35 20 -75.5t49 -89.5q10 -17 15 -33t10 -30q4 -14 8 -24.5t10 -17.5q15 -14 65 -14h5q24 0 40.5 3t24.5 10q5 5 8 13.5t7 22.5l9 27t14 32zM262 154 q11 -14 33 -19t60 -3q33 0 53 3.5t31 14.5v-51q-44 -14 -88 -14q-24 0 -47.5 3.5t-41.5 10.5v55zM262 64q30 -9 47.5 -10.5t40.5 -1.5t40.5 1.5t47.5 10.5q-1 -7 -5 -18t-14 -21t-26.5 -17.5t-42.5 -7.5t-42.5 7.5t-26.5 17.5t-14 21t-5 18z" />
</font></defs></svg>

After

Width:  |  Height:  |  Size: 22 KiB

BIN
assets/www/css/icons.ttf Normal file

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 503 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 503 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 990 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 766 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 759 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 182 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 766 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 697 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 766 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 759 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 759 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 708 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 766 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 759 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 266 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 844 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 503 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 766 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 759 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 173 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 182 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 173 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 182 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 503 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 766 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 759 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 176 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 203 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 176 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 486 B

View file

@ -1,47 +0,0 @@
joscroller {
position: absolute;
display: block;
height: auto;
width: auto;
top: 0; left: 0; bottom: 0; right: 0;
overflow: auto;
padding: 0;
margin: 0;
-webkit-transform: none;
-moz-transform: none;
-o-transform: none;
-ms-transform: none;
}
joscroller > * {
position: relative;
top: auto;
}
.flick {
-webkit-transition: none;
-moz-transition: none;
-o-transition: none;
}
.flickback {
-webkit-transition: none;
-moz-transition: none;
-o-transition: none;
}
.flickfast {
-webkit-transition: none;
-moz-transition: none;
-o-transition: none;
}
jocard {
padding-bottom: 0;
}
jocontainer {
height: inherit;
}
joscroller {
display: block;
height: 100%;
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 365 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 601 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 772 B

File diff suppressed because it is too large Load diff

Binary file not shown.

Before

Width:  |  Height:  |  Size: 567 B

View file

@ -1,53 +0,0 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="viewport" content="initial-scale=1.0, maximum-scale=1.0, user-scalable=no, width=device-width">
<meta name="format-detection" content="false">
<title>joTest</title>
<link rel="stylesheet" href="simple/simple.css" type="text/css">
</head>
<body>
<!--
Sample page with static markup to make it easier to create CSS.
Adjust the stylesheet link above to pull in the stylesheet you
want to work on.
-->
<jostack>
<jocard>
<jotitle>Hello, Jo</jotitle>
<jocaption>This is a sample static HTML page with Jo UI markup. It is designed
to make it easier to design stylesheets which work with Jo.
</jocaption>
<jodivider></jodivider>
<jocaption>Menu sample</jocaption>
<jogroup>
<jomenu>
<jomenuitem>Menu Item 1</jomenuitem>
<jomenuitem class="selected">Menu Item 2</jomenuitem>
<jomenuitem>Menu Item 3</jomenuitem>
</jomenu>
</jogroup>
<jodivider></jodivider>
<jocaption>Dialog Sample</jocaption>
<jogroup>
<jolabel>Username</jolabel>
<joinput class="focus">Jo</joinput>
<jolabel>Password</jolabel>
<joinput class="password">12345</joinput class="password">
<jolabel class="disabled">Realm</jolabel>
<joinput class="disabled">Disabled Input</joinput>
</jogroup>
<jofooter>
<jodivider></jodivider>
<jobutton>Go, Jo</jobutton>
<jobutton class="disabled">Cancel</jobutton>
</jofooter>
</jocard>
</jostack>
</body>
</html>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 382 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 270 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 762 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 480 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 784 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 779 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 478 B

View file

@ -1,34 +0,0 @@
joscroller > * {
-webkit-user-drag: element;
}
jotoolbar joflexrow jobutton.back {
display: none;
}
jotoolbar {
padding-top: 10px;
padding-bottom: 5px;
}
jopopup {
max-width: inherit;
margin: 0;
-webkit-border-radius: 20px 20px 0 0;
-webkit-transform: translateY(100%);
border-bottom: none;
}
jopopup.show {
-webkit-transform: translateY(0);
}
joshim>joflexcol>*:first-child {
-webkit-box-flex: 1;
}
joshim>joflexcol>*:last-child {
display: none;
}
jobackbutton.active {
display: none;
}

1017
assets/www/css/jq.ui.css Normal file

File diff suppressed because it is too large Load diff

View file

@ -1,52 +1,75 @@
/* Tafl board */
jotaflboard {
display: block;
margin: 6px;
#board {
display: table;
width: 100%;
height: 100%;
border: 1px solid white;
margin-left: auto;
margin-right: auto;
}
jocard {
margin: auto;
text-align: center;
#board .row {
display: table-row;
}
jotaflboard {
border-collapse: collapse;
#board .square {
display: table-cell;
margin-left: 6px;
margin-right: 6px;
background-repeat: no-repeat;
background-position: center center;
background-size: 100%;
}
jotaflboard td {
padding: 0px;
width: 27px;
height: 27px;
#game_container {
position: absolute;
left: 0;
right: 0;
top: 0;
bottom: 0;
border: 1px solid grey;
padding: 5px;
padding-top: 0px;
padding-bottom: 15px;
background-repeat: no-repeat !important;
background-position: center center !important;
background-size: 100% 100% !important;
overflow: hidden;
}
jotaflboard td.W {
#game_panel > div {
height: 100%;
}
.white {
background-image: url(white.png);
}
jotaflboard td.B {
.black {
background-image: url(black.png);
}
jotaflboard td.K {
.king {
background-image: url(king.png);
}
jotaflboard td.throne {
.throne {
background-color: #ccc;
}
jotaflboard td.selected {
background-color: yellow;
.active {
background-color: #dd6;
}
@media only screen and (orientation:landscape) {
#header, #menu {
display: none;
}
#navbar {
display: block;
}
}

View file

@ -1,24 +1,66 @@
<!DOCTYPE HTML>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML Basic 1.1//EN"
"http://www.w3.org/TR/xhtml-basic/xhtml-basic11.dtd">
<html>
<head>
<title>PhoneGap</title>
<meta name="viewport" content="width=320, initial-scale=1">
<!-- Libraries -->
<link rel="stylesheet" type="text/css" href="css/jo/jo.css" />
<script type="text/javascript" charset="utf-8" src="js/cordova-1.5.0.js"></script>
<script type="text/javascript" charset="utf-8" src="js/socket.io.min.js"></script>
<!-- Application Code -->
<link rel="stylesheet" type="text/css" href="css/ui.css" />
<script type="text/javascript" charset="utf-8" src="js/tafl.js"></script>
<script type="text/javascript" charset="utf-8" src="js/net.js"></script>
</head>
<body>
<script type="text/javascript" charset="utf-8" src="js/jo_min.js"></script>
<script type="text/javascript" charset="utf-8" src="js/ui.js"></script>
</body>
<head>
<title>Androtafl</title>
<meta http-equiv="Content-type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1" />
<meta name="apple-mobile-web-app-capable" content="yes" />
<!-- Libraries -->
<script type="text/javascript" charset="utf-8" src="js/cordova-1.5.0.js"></script>
<script type="text/javascript" charset="utf-8" src="js/socket.io.min.js"></script>
<link rel="stylesheet" type="text/css" href="css/jq.ui.css" />
<script type="text/javascript" charset="utf-8" src="js/jq.mobi.min.js"></script>
<script type="text/javascript" charset="utf-8" src="js/jq.ui.min.js"></script>
<!-- include touch.js on desktop browsers only -->
<script type="text/javascript">
if (!((window.DocumentTouch && document instanceof DocumentTouch) || 'ontouchstart' in window)) {
var script = document.createElement("script");
script.src = "js/touch.js";
var tag = $("head").append(script);
$.os.android = true; //let's make it run like an android device
$.os.desktop = true;
}
</script>
<!-- Application Code -->
<link rel="stylesheet" type="text/css" href="css/ui.css" />
<script type="text/javascript" charset="utf-8" src="js/tafl.js"></script>
<script type="text/javascript" charset="utf-8" src="js/net.js"></script>
<script type="text/javascript" charset="utf-8" src="js/ui.js"></script>
</head>
<body>
<div id="jQUi">
<div id="header">
<p>Score <span id="score"></span></p>
</div>
<div id="content">
<div id="main_panel" title="Androtafl" class="panel" selected="true">
<ul>
<li><a href="#game_panel" onclick="javascript:game_starter.network_game();">Network: random opponent</a></li>
<li><a href="#game_panel" onclick="javascript:game_starter.game_vs_black_ai();">Game against black AI</a></li>
<li><a href="#game_panel" onclick="javascript:game_starter.game_vs_white_ai();">Game against white AI</a></li>
</ul>
</div>
<div id="game_panel" title="Androtafl" class="panel" scrolling="no">
<div id="game_container">
<div id="board"></div>
</div>
</div>
</div>
<div id="navbar">
<div class="horzRule"></div>
<a href="#main" id="navbar_home" class="icon home">home</a>
<a href="javascript:boardui.rate_current_state();" id="navbar_rate_this" class="icon">rate</a>
</div>
</div>
</body>
</html>

File diff suppressed because it is too large Load diff

View file

@ -1,379 +0,0 @@
joLog=function(){var strings=[];for(var i=0;i<arguments.length;i++){strings.push(arguments[i]);}
console.log(strings.join(" "));}
Function.prototype.extend=function(superclass,proto){this.prototype=new superclass();if(proto){for(var i in proto)
this.prototype[i]=proto[i];}};if(typeof Function.prototype.bind==='undefined'){Function.prototype.bind=function(context){var self=this;function callbind(){return self.apply(context,arguments);}
return callbind;};}
if(typeof HTMLElement==='undefined')
HTMLElement=Object;if(typeof console==='undefined'||typeof console.log!=='function')
console={log:function(msg){}};jo={platform:"webkit",version:"0.4.1",useragent:['ipad','iphone','webos','bada','android','opera','chrome','safari','mozilla','gecko','explorer'],debug:false,setDebug:function(state){this.debug=state;},flag:{stopback:false},load:function(call,context){joDOM.enable();this.loadEvent=new joSubject(this);this.unloadEvent=new joSubject(this);document.body.onMouseDown=function(e){e.preventDefault();};document.body.onDragStart=function(e){e.preventDefault();};if(typeof navigator=='object'&&navigator.userAgent){var agent=navigator.userAgent.toLowerCase();for(var i=0;i<this.useragent.length;i++){if(agent.indexOf(this.useragent[i])>=0){this.platform=this.useragent[i];break;}}}
if(joEvent){var o=document.createElement('div');var test=("ontouchstart"in o);if(!test){o.setAttribute("ontouchstart",'return;');test=(typeof o.ontouchstart==='function');}
joEvent.touchy=test;o=null;}
if(joGesture)
joGesture.load();var s=joScroller.prototype;if(typeof document.body.style.webkitTransition!=="undefined"){}
else if(typeof document.body.style.MozTransition!=="undefined"){s.transitionEnd="transitionend";s.setPosition=function(x,y,node){node.style.MozTransform="translate("+x+"px,"+y+"px)";};}
else if(typeof document.body.style.msTransform!=="undefined"){s.transitionEnd="transitionend";s.setPosition=function(x,y,node){node.style.msTransform="translate("+x+"px,"+y+"px)";};}
else if(typeof document.body.style.OTransition!=="undefined"){s.transitionEnd="otransitionend";s.setPosition=function(x,y,node){node.style.OTransform="translate("+x+"px,"+y+"px)";};}
else{s.velocity=0;s.bump=0;s.transitionEnd="transitionend";s.setPosition=function(x,y,node){if(this.vertical)
node.style.top=y+"px";if(this.horizontal)
node.style.left=x+"px";};}
joLog("Jo",this.version,"loaded for",this.platform,"environment");this.loadEvent.fire();},tagMap:{},tagMapLoaded:false,initTagMap:function(){if(this.tagMapLoaded)
return;var key=this.tagMap;key.JOVIEW=joView;key.BODY=joScreen;for(var p in window){var o=window[p];if(typeof o==='function'&&o.prototype&&typeof o.prototype.tagName!=='undefined'&&o.prototype instanceof joView){var tag=o.prototype.tagName.toUpperCase();if(o.prototype.type){if(!key[tag])
key[tag]={};key[tag][o.prototype.type]=o;}
else{key[tag]=o;}}}},getPlatform:function(){return this.platform;},matchPlatform:function(test){return(test.indexOf(this.platform)>=0);},getVersion:function(){return this.version;},getLanguage:function(){return this.language;}};joDOM={enabled:false,get:function(id){if(typeof id==="string"){return document.getElementById(id);}
else if(typeof id==='object'){if(id instanceof joView)
return id.container;else
return id;}},remove:function(node){if(node.parentNode){node.parentNode.removeChild(node);}},enable:function(){this.enabled=true;},getParentWithin:function(node,ancestor){while(node.parentNode!==window&&node.parentNode!==ancestor){node=node.parentNode;}
return node;},addCSSClass:function(node,classname){var node=joDOM.get(node);if(typeof node.className!=="undefined"){var n=node.className.split(/\s+/);for(var i=0,l=n.length;i<l;i++){if(n[i]==classname)
return;}
n.push(classname);node.className=n.join(" ");}
else{node.className=classname;}},removeCSSClass:function(node,classname,toggle){var node=joDOM.get(node);if(typeof node.className!=="undefined"){var n=node.className.split(/\s+/);for(var i=0,l=n.length;i<l;i++){if(n[i]==classname){if(l==1)
node.className="";else{n.splice(i,i);node.className=n.join(" ");}
return;}}
if(toggle){n.push(classname);node.className=n.join(" ");}}
else{node.className=classname;}},toggleCSSClass:function(node,classname){this.removeCSSClass(node,classname,true);},create:function(tag,style){if(!this.enabled)
return null;if(typeof tag==="object"&&typeof tag.tagName==="string"){var o=document.createElement(tag.tagName);if(tag.className)
this.setStyle(o,tag.className);}
else{var o=document.createElement(tag);if(style)
this.setStyle(o,style);}
return o;},setStyle:function(node,style){if(typeof style==="string"){node.className=style;}
else if(typeof style==="object"){for(var i in style){switch(i){case"id":case"className":node[i]=style[i];break;default:node.style[i]=style[i];}}}
else if(typeof style!=="undefined"){throw("joDOM.setStyle(): unrecognized type for style argument; must be object or string.");}},applyCSS:function(style,oldnode){if(oldnode)
document.body.removeChild(oldnode);var css=joDOM.create('jostyle');css.innerHTML='<style>'+style+'</style>';document.body.appendChild(css);return css;},removeCSS:function(node){document.body.removeChild(node);},loadCSS:function(filename,oldnode){if(oldnode)
var css=oldnode;else
var css=joDOM.create('link');css.rel='stylesheet';css.type='text/css';css.href=filename+(jo.debug?("?"+joTime.timestamp()):"");if(!oldnode)
document.body.appendChild(css);return css;},pageOffsetLeft:function(node){var l=0;while(typeof node!=='undefined'&&node&&node.parentNode!==window){if(node.offsetLeft)
l+=node.offsetLeft;node=node.parentNode;}
return l;},pageOffsetTop:function(node){var t=0;while(typeof node!=='undefined'&&node&&node.parentNode!==window){t+=node.offsetTop;node=node.parentNode;}
return t;}};joCSSRule=function(data){this.setData(data);};joCSSRule.prototype={container:null,setData:function(data){this.data=data||"";this.enable();},clear:function(){this.setData();},disable:function(){joDOM.removeCSS(this.container);},enable:function(){this.container=joDOM.applyCSS(this.data,this.container);}};joEvent={eventMap:{"mousedown":"touchstart","mousemove":"touchmove","mouseup":"touchend","mouseout":"touchcancel"},touchy:false,getTarget:function(e){if(!e)
var e=window.event;return e.target?e.target:e.srcElement;},capture:function(element,event,call,context,data){return this.on(element,event,call,context,data,true);},on:function(element,event,call,context,data,capture){if(!call||!element)
return false;if(this.touchy){if(this.eventMap[event])
event=this.eventMap[event];}
var element=joDOM.get(element);var call=call;var data=data||"";function wrappercall(e){if(e.touches&&e.touches.length==1){var touches=e.touches[0];e.pageX=touches.pageX;e.pageY=touches.pageY;e.screenX=touches.screenX;e.screenY=touches.screenY;e.clientX=touches.clientX;e.clientY=touches.clientY;}
if(context)
call.call(context,e,data);else
call(e,data);};wrappercall.capture=capture||false;if(!window.addEventListener)
element.attachEvent("on"+event,wrappercall);else
element.addEventListener(event,wrappercall,capture||false);return wrappercall;},remove:function(element,event,call,capture){if(this.touchy){if(this.eventMap[event]){event=this.eventMap[event];}}
if(typeof element.removeEventListener!=='undefined')
element.removeEventListener(event,call,capture||false);},stop:function(e){if(e.stopPropagation)
e.stopPropagation();else
e.cancelBubble=true;},preventDefault:function(e){e.preventDefault();},block:function(e){if(window.event)
var e=window.event;if(typeof e.target=='undefined')
e.target=e.srcElement;switch(e.target.nodeName.toLowerCase()){case'input':case'textarea':return true;break;default:return false;}}};joSubject=function(subject){this.subscriptions=[];this.subject=subject;};joSubject.prototype={last:-1,subscribe:function(call,observer,data){if(!call)
return false;var o={"call":call};if(observer)
o.observer=observer;if(data)
o.data=data;this.subscriptions.push(o);return this.subject;},unsubscribe:function(call,observer){if(!call)
return false;for(var i=0,l=this.subscriptions.length;i<l;i++){var sub=this.subscriptions[i];if(sub.call===call&&(typeof sub.observer==='undefined'||sub.observer===observer)){this.subscriptions.splice(i,1);break;}}
return this.subject;},resume:function(data){if(this.last!=-1)
this.fire(data,true);return this.subject;},fire:function(data,resume){if(typeof data==='undefined')
data="";var i=(resume)?(this.last||0):0;this.last=-1;for(var l=this.subscriptions.length;i<l;i++){var sub=this.subscriptions[i];var subjectdata=(typeof sub.data!=='undefined')?sub.data:null;if(sub.observer)
sub.call.call(sub.observer,data,this.subject,subjectdata);else
sub.call(data,this.subject,subjectdata);if(sub.capture){this.last=i+1;break;}}
return this.subject;},capture:function(call,observer,data){if(!call)
return false;var o={"call":call,capture:true};if(observer)
o.observer=observer;if(data)
o.data=data;this.subscriptions.unshift(o);return this.subject;},release:function(call,observer){return this.unsubscribe(call,observer);}};var SEC=1000;var MIN=60*SEC;var HOUR=60*MIN;var DAY=24*HOUR;joTime={timestamp:function(){var now=new Date();return now/1;}};function joDefer(call,context,delay,data){if(!delay)
var delay=100;if(!context)
var context=this;var timer=window.setTimeout(function(){call.call(context,data);},delay);return timer;};joYield=joDefer;joCache={cache:{},set:function(key,call,context){if(call)
this.cache[key]={"call":call,"context":context||this};},get:function(key){var cache=this.cache[key]||null;if(cache){if(!cache.view)
cache.view=cache.call.apply(cache.context,arguments);return cache.view;}
else{return new joView("View not found: "+key);}}};joChain=function(){this.queue=[];this.active=false;this.addEvent=new joSubject("add",this);this.startEvent=new joSubject("start",this);this.stopEvent=new joSubject("stop",this);this.nextEvent=new joSubject("next",this);this.stop();this.delay=100;};joChain.prototype={add:function(call,context,data){if(!context)
var context=this;if(!data)
var data="";this.queue.push({"call":call,"context":context,"data":data});if(this.active&&!this.timer)
this.next();},start:function(){this.active=true;this.startEvent.fire();this.next();},stop:function(){this.active=false;if(this.timer!=null)
window.clearTimeout(this.timer);this.timer=null;this.stopEvent.fire();},next:function(){var nextcall=this.queue.shift();if(!nextcall){this.timer=null;return;}
this.nextEvent.fire(nextcall);nextcall.call.call(nextcall.context,nextcall.data);if(this.queue.length)
this.timer=joEvent.yield(this.next,this,this.delay);else
this.timer=null;}};joClipboard={data:"",get:function(){return joPreference.get("joClipboardData")||this.data;},set:function(clip){this.data=clip;joPreference.set("joClipboardData");}};joDataSource=function(data){this.changeEvent=new joSubject(this);this.errorEvent=new joSubject(this);if(typeof data!=="undefined")
this.setData(data);else
this.data="";};joDataSource.prototype={autoSave:true,data:null,setQuery:function(query){this.query=query;},setAutoSave:function(state){this.autoSave=state;return this;},setData:function(data){var last=this.data;this.data=data;if(data!==last)
this.changeEvent.fire(data);},getData:function(){return this.data;},getDataCount:function(){return this.getData().length;},getPageCount:function(){if(this.pageSize)
return Math.floor(this.getData().length/this.pageSize)+1;else
return 1;},getPage:function(index){var start=index*this.pageSize;var end=start+this.pageSize;if(end>this.getData().length)
end=this.getData().length;if(start<0)
start=0;return this.data.slice(start,end);},refresh:function(){},setPageSize:function(length){this.pageSize=length;},getPageSze:function(){return this.pageSize;},load:function(data){this.data=data;this.changeEvent.fire(data);},error:function(msg){this.errorEvent.fire(msg);}};joRecord=function(data){joDataSource.call(this,data);this.delegate={};};joRecord.extend(joDataSource,{link:function(p){return this.getDelegate(p);},getDelegate:function(p){if(!this.delegate[p])
this.delegate[p]=new joProperty(this,p);return this.delegate[p];},getProperty:function(p){return this.data[p];},setProperty:function(p,data){if(this.data[p]===data)
return;this.data[p]=data;this.changeEvent.fire(this);if(this.autoSave)
this.save();return this;},load:function(){console.log("TODO: extend the load() method");return this;},save:function(){console.log("TODO: extend the save() method");return this;}});joProperty=function(datasource,p){joDataSource.call(this);this.changeEvent=new joSubject(this);datasource.changeEvent.subscribe(this.onSourceChange,this);this.datasource=datasource;this.p=p;};joProperty.extend(joDataSource,{setData:function(data){if(this.datasource)
this.datasource.setProperty(this.p,data);return this;},getData:function(){if(!this.datasource)
return null;return this.datasource.getProperty(this.p);},onSourceChange:function(){this.changeEvent.fire(this.getData());}});joDatabase=function(datafile,size){this.openEvent=new joEvent.Subject(this);this.closeEvent=new joEvent.Subject(this);this.errorEvent=new joEvent.Subject(this);this.datafile=datafile;this.size=size||256000;this.db=null;};joDatabase.prototype={open:function(){this.db=openDatabase(this.datafile,"1.0",this.datafile,this.size);if(this.db){this.openEvent.fire();}
else{joLog("DataBase Error",this.db);this.errorEvent.fire();}},close:function(){this.db.close();this.closeEvent.fire();},now:function(offset){var date=new Date();if(offset)
date.setDate(date.valueOf()+(offset*1000*60*60*24));return date.format("yyyy-mm-dd");}};joSQLDataSource=function(db,query,args){this.db=db;this.query=(typeof query=='undefined')?"":query;this.args=(typeof args=='undefined')?[]:args;this.changeEvent=new joEvent.subject(this);this.errorEvent=new joEvent.subject(this);};joSQLDataSource.prototype={setDatabase:function(db){this.db=db;},setQuery:function(query){this.query=query;},setData:function(data){this.data=data;this.changeEvent.fire();},clear:function(){this.data=[];this.changeEvent.fire();},setParameters:function(args){this.args=args;},execute:function(query,args){this.setQuery(query||"");this.setParameters(args);if(this.query)
this.refresh();},refresh:function(){if(!this.db){this.errorEvent.fire();return;}
var self=this;if(arguments.length){var args=[];for(var i=0;i<arguments.length;i++)
args.push(arguments[i]);}
else{var args=this.args;}
var query=this.query;function success(t,result){self.data=[];for(var i=0,l=result.rows.length;i<l;i++){var row=result.rows.item(i);self.data.push(row);}
self.changeEvent.fire(self.data);}
function error(){joLog('SQL error',query,"argument count",args.length);self.errorEvent.fire();}
this.db.db.transaction(function(t){t.executeSql(query,args,success,error);});}};joFileSource=function(url,timeout){this.changeEvent=new joSubject(this);this.errorEvent=new joSubject(this);if(timeout)
this.setTimeout(timeout);if(url)
this.setQuery(url);};joFileSource.extend(joDataSource,{baseurl:'',query:'',load:function(){var get=this.baseurl+this.query;joFile(get,this.callBack,this);},callBack:function(data,error){if(error)
this.errorEvent.fire(error);else
this.setData(data);}});joFile=function(url,call,context,timeout){var req=new XMLHttpRequest();if(!req)
return onerror();if(!timeout)
var timeout=60*SEC;var timer=(timeout>0)?setTimeout(onerror,timeout):null;req.open('GET',url,true);req.onreadystatechange=onchange;req.onError=onerror;req.send(null);function onchange(e){if(timer)
timer=clearTimeout(timer);if(req.readyState==4)
handler(req.responseText,0);}
function onerror(){handler(null,true);}
function handler(data,error){if(call){if(context)
call.call(context,data,error);else
call(error,data,error);}}}
function joScript(url,call,context){var node=joDOM.create('script');if(!node)
return;node.onload=onload;node.onerror=onerror;node.src=url;document.body.appendChild(node);function onerror(){handler(true);}
function onload(){handler(false);}
function handler(error){if(call){if(context)
call.call(context,error,url);else
call(error,url);}
document.body.removeChild(node);node=null;}}
joPreference=joRecord;joYQL=function(query){joDataSource.call(this);this.setQuery(query);};joYQL.extend(joDataSource,{baseurl:'http://query.yahooapis.com/v1/public/yql?',format:'json',query:'',exec:function(){var get=this.baseurl+"q="+encodeURIComponent(this.query)
+"&format="+this.format+"&callback="+joDepot(this.load,this);joScript(get,this.callBack,this);},load:function(data){var results=data.query&&data.query.results&&data.query.results.item;if(!results)
this.errorEvent.fire(data);else{this.data=results;this.changeEvent.fire(results);}},callBack:function(error){if(error)
this.errorEvent.fire();}});joDepotCall=[];joDepot=function(call,context){joDepotCall.push(handler);function handler(data){if(context)
call.call(context,data);else
call(data);};return"joDepotCall["+(joDepotCall.length-1)+"]";};joInterface=function(parent){jo.initTagMap();return this.get(parent);};joInterface.prototype={get:function(parent){parent=joDOM.get(parent);if(!parent)
parent=document.body;var ui={};var setContainer=joView.setContainer;var draw=joView.draw;parse(parent);joView.setContainer=setContainer;joView.draw=draw;function parse(node){if(!node)
return;var args="";if(node.childNodes&&node.firstChild){var kids=node.childNodes;args=[];for(var i=0,l=kids.length;i<l;i++){var p=parse(kids[i]);if(p)
args.push(p);}}
return newview(node,args);}
function newview(node,args){var tag=node.tagName;var view=node;if(jo.tagMap[tag]){if(args instanceof Array&&args.length){if(args.length==1)
args=args[0];}
if(args instanceof Text)
args=node.nodeData;if(!args)
args=node.value||node.checked||node.innerText||node.innerHTML;joView.setContainer=function(){this.container=node;return this;};if(typeof jo.tagMap[tag]==="function"){var o=jo.tagMap[tag];}
else{var t=node.type||node.getAttribute("type");var o=jo.tagMap[tag][t];}
if(typeof o==="function")
var view=new o(args);else
joLog("joInterface can't process ",tag,"'type' attribute?");}
if(node.id)
ui[node.id]=view;return view;}
return ui;}};joCollect={get:function(parent){return new joInterface(parent);}};joView=function(data){this.changeEvent=new joSubject(this);this.setContainer();if(data)
this.setData(data);};joView.prototype={tagName:"joview",busyNode:null,container:null,data:null,getContainer:function(){return this.container;},setContainer:function(container){this.container=joDOM.get(container);if(!this.container)
this.container=this.createContainer();this.setEvents();return this;},createContainer:function(){return joDOM.create(this);},clear:function(){this.data="";if(this.container)
this.container.innerHTML="";this.changeEvent.fire();},setData:function(data){this.data=data;this.refresh();return this;},getData:function(){return this.data;},refresh:function(){if(!this.container||typeof this.data=="undefined")
return 0;this.container.innerHTML="";this.draw();this.changeEvent.fire(this.data);},draw:function(){this.container.innerHTML=this.data;},setStyle:function(style){joDOM.setStyle(this.container,style);return this;},attach:function(parent){if(!this.container)
return this;var node=joDOM.get(parent)||document.body;node.appendChild(this.container);return this;},detach:function(parent){if(!this.container)
return this;var node=joDOM.get(parent)||document.body;if(this.container&&this.container.parentNode===node)
node.removeChild(this.container);return this;},setEvents:function(){}};joContainer=function(data){joView.apply(this,arguments);};joContainer.extend(joView,{tagName:"jocontainer",title:null,getContent:function(){return this.container.childNodes;},setTitle:function(title){this.title=title;return this;},setData:function(data){this.data=data;this.refresh();return this;},activate:function(){},deactivate:function(){},push:function(data){if(typeof data==='object'){if(data instanceof Array){for(var i=0;i<data.length;i++)
this.push(data[i]);}
else if(data instanceof joView&&data.container!==this.container){this.container.appendChild(data.container);}
else if(data instanceof HTMLElement){this.container.appendChild(data);}}
else{var o=document.createElement("div");o.innerHTML=data;this.container.appendChild(o);}},getTitle:function(){return this.title;},refresh:function(){if(this.container)
this.container.innerHTML="";this.draw();this.changeEvent.fire();},draw:function(){this.push(this.data);}});joControl=function(data,value){this.selectEvent=new joSubject(this);this.enabled=true;this.value=null;if(typeof value!=="undefined"&&value!=null){if(value instanceof joDataSource)
this.setValueSource(value);else
this.value=value;}
if(data instanceof joDataSource){joView.call(this);this.setDataSource(data);}
else{joView.apply(this,arguments);}};joControl.extend(joView,{tagName:"jocontrol",setEvents:function(){joEvent.on(this.container,"click",this.onMouseDown,this);joEvent.on(this.container,"blur",this.onBlur,this);joEvent.on(this.container,"focus",this.onFocus,this);},onMouseDown:function(e){this.select(e);},select:function(e){if(e)
joEvent.stop(e);this.selectEvent.fire(this.data);},enable:function(){joDOM.removeCSSClass(this.container,'disabled');this.container.contentEditable=true;this.enabled=true;return this;},disable:function(){joDOM.addCSSClass(this.container,'disabled');this.container.contentEditable=false;this.enabled=false;return this;},setReadOnly:function(value){if(typeof value==='undefined'||value)
this.container.setAttribute('readonly','1');else
this.container.removeAttribute('readonly');return this;},onFocus:function(e){joEvent.stop(e);if(this.enabled)
joFocus.set(this);},onBlur:function(e){this.data=(this.container.value)?this.container.value:this.container.innerHTML;joEvent.stop(e);if(this.enabled){this.blur();this.changeEvent.fire(this.data);}},focus:function(e){if(!this.enabled)
return;joDOM.addCSSClass(this.container,'focus');if(!e)
this.container.focus();return this;},setValue:function(value){this.value=value;this.changeEvent.fire(value);return this;},getValue:function(){return this.value;},blur:function(){joDOM.removeCSSClass(this.container,'focus');return this;},setDataSource:function(source){this.dataSource=source;source.changeEvent.subscribe(this.setData,this);this.setData(source.getData()||null);this.changeEvent.subscribe(source.setData,source);return this;},setValueSource:function(source){this.valueSource=source;source.changeEvent.subscribe(this.setValue,this);this.setValue(source.getData()||null);this.selectEvent.subscribe(source.setData,source);return this;}});joButton=function(data,classname){joControl.apply(this,arguments);this.enabled=true;if(classname)
this.container.className=classname;};joButton.extend(joControl,{tagName:"jobutton",createContainer:function(){var o=joDOM.create(this.tagName);if(o)
o.setAttribute("tabindex","1");return o;},enable:function(){this.container.setAttribute("tabindex","1");return joControl.prototype.enable.call(this);},disable:function(){this.container.removeAttribute("tabindex");return joControl.prototype.disable.call(this);}});joBusy=function(data){joContainer.apply(this,arguments);};joBusy.extend(joContainer,{tagName:"jobusy",draw:function(){this.container.innerHTML="";for(var i=0;i<9;i++)
this.container.appendChild(joDom.create("jobusyblock"));},setMessage:function(msg){this.message=msg||"";},setEvents:function(){return this;}});joList=function(){this.setIndex=this.setValue;this.getIndex=this.getValue;joControl.apply(this,arguments);};joList.extend(joControl,{tagName:"jolist",defaultMessage:"",lastNode:null,value:null,autoSort:false,setDefault:function(msg){this.defaultMessage=msg;if(typeof this.data==='undefined'||!this.data||!this.data.length){if(typeof msg==='object'){this.innerHTML="";if(msg instanceof joView)
this.container.appendChild(msg.container);else if(msg instanceof HTMLElement)
this.container.appendChild(msg);}
else{this.innerHTML=msg;}}
return this;},draw:function(){var html="";var length=0;if(typeof this.data==='undefined'||!this.data||!this.data.length){if(this.defaultMessage)
this.container.innerHTML=this.defaultMessage;return;}
for(var i=0,l=this.data.length;i<l;i++){var element=this.formatItem(this.data[i],i,length);if(element==null)
continue;if(typeof element==="string")
html+=element;else
this.container.appendChild((element instanceof joView)?element.container:element);++length;}
if(html.length)
this.container.innerHTML=html;if(this.value>=0)
this.setValue(this.value,true);return;},deselect:function(){if(typeof this.container=='undefined'||!this.container['childNodes'])
return;var node=this.getNode(this.value);if(node){if(this.lastNode){joDOM.removeCSSClass(this.lastNode,"selected");this.value=null;}}
return this;},setValue:function(index,silent){this.value=index;if(index==null)
return;if(typeof this.container==='undefined'||!this.container||!this.container.firstChild){return this;}
var node=this.getNode(this.value);if(node){if(this.lastNode)
joDOM.removeCSSClass(this.lastNode,"selected");joDOM.addCSSClass(node,"selected");this.lastNode=node;}
if(index>=0&&!silent){this.fireSelect(index);this.changeEvent.fire(index);}
return this;},getNode:function(index){return this.container.childNodes[index];},fireSelect:function(index){this.selectEvent.fire(index);},getValue:function(){return this.value;},onMouseDown:function(e){joEvent.stop(e);var node=joEvent.getTarget(e);var index=-1;while(index==-1&&node!==this.container){index=node.getAttribute("index")||-1;node=node.parentNode;}
if(index>=0)
this.setValue(index);},refresh:function(){if(this.autoSort)
this.sort();joControl.prototype.refresh.apply(this);},getNodeData:function(index){if(this.data&&this.data.length&&index>=0&&index<this.data.length)
return this.data[index];else
return null;},getLength:function(){return this.length||this.data.length||0;},sort:function(){this.data.sort(this.compareItems);},getNodeIndex:function(element){var index=element.getAttribute('index');if(typeof index!=="undefined"&&index!=null)
return parseInt(index)
else
return-1;},formatItem:function(itemData,index){var element=document.createElement('jolistitem');element.innerHTML=itemData;element.setAttribute("index",index);return element;},compareItems:function(a,b){if(a>b)
return 1;else if(a==b)
return 0;else
return-1;},setAutoSort:function(state){this.autoSort=state;return this;},next:function(){if(this.getValue()<this.getLength()-1)
this.setValue(this.value+1);},prev:function(){if(this.getValue()>0)
this.setValue(this.value-1);}});joBusy=function(data){joContainer.apply(this,arguments);};joBusy.extend(joContainer,{tagName:"jobusy",draw:function(){this.container.innerHTML="";for(var i=0;i<9;i++)
this.container.appendChild(joDom.create("jobusyblock"));},setMessage:function(msg){this.message=msg||"";},setEvents:function(){return this;}});joCaption=function(data){joControl.apply(this,arguments);};joCaption.extend(joControl,{tagName:"jocaption"});joCard=function(data){joContainer.apply(this,arguments);};joCard.extend(joContainer,{tagName:"jocard"});joStack=function(data){this.visible=false;this.data=[];joContainer.apply(this,arguments);if(this.data&&!(this.data instanceof Array))
this.data=[this.data];else if(this.data.length>1)
this.data=[this.data[0]];if(this.container&&this.container.firstChild)
this.container.innerHTML="";this.setLocked(true);this.pushEvent=new joSubject(this);this.popEvent=new joSubject(this);this.homeEvent=new joSubject(this);this.showEvent=new joSubject(this);this.hideEvent=new joSubject(this);this.backEvent=new joSubject(this);this.forwardEvent=new joSubject(this);this.index=0;this.lastIndex=0;this.lastNode=null;};joStack.extend(joContainer,{tagName:"jostack",type:"fixed",eventset:false,setEvents:function(){},onClick:function(e){joEvent.stop(e);},forward:function(){if(this.index<this.data.length-1){this.index++;this.draw();this.forwardEvent.fire();}},back:function(){if(this.index>0){this.index--;this.draw();this.backEvent.fire();}},draw:function(){if(!this.container)
this.createContainer();if(!this.data||!this.data.length)
return;jo.flag.stopback=this.index?true:false;var container=this.container;var oldchild=this.lastNode;var newnode=getnode(this.data[this.index]);var newchild=this.getChildStyleContainer(newnode);function getnode(o){return(o instanceof joView)?o.container:o;}
if(!newchild)
return;if(this.index>this.lastIndex){var oldclass="prev";var newclass="next";joDOM.addCSSClass(newchild,newclass);}
else if(this.index<this.lastIndex){var oldclass="next";var newclass="prev";joDOM.addCSSClass(newchild,newclass);}
else{}
this.appendChild(newnode);var self=this;var transitionevent=null;joDefer(animate,this,1);function animate(){if(typeof window.onwebkittransitionend!=='undefined')
transitionevent=joEvent.on(newchild,"webkitTransitionEnd",cleanup,self);else
joDefer(cleanup,this,200);if(newclass&&newchild)
joDOM.removeCSSClass(newchild,newclass);if(oldclass&&oldchild)
joDOM.addCSSClass(oldchild,oldclass);}
function cleanup(){if(oldchild){self.removeChild(oldchild);joDOM.removeCSSClass(oldchild,"next");joDOM.removeCSSClass(oldchild,"prev");}
if(newchild){if(transitionevent)
joEvent.remove(newchild,"webkitTransitionEnd",transitionevent);joDOM.removeCSSClass(newchild,"next");joDOM.removeCSSClass(newchild,"prev");}}
if(typeof this.data[this.index].activate!=="undefined")
this.data[this.index].activate.call(this.data[this.index]);this.lastIndex=this.index;this.lastNode=newchild;},appendChild:function(child){this.container.appendChild(child);},getChildStyleContainer:function(child){return child;},getChild:function(){return this.container.firstChild;},getContentContainer:function(){return this.container;},removeChild:function(child){if(child&&child.parentNode===this.container)
this.container.removeChild(child);},isVisible:function(){return this.visible;},push:function(o){if(this.data&&this.data.length&&this.data[this.data.length-1]===o)
return;this.data.push(o);this.index=this.data.length-1;this.draw();this.pushEvent.fire(o);},setLocked:function(state){this.locked=(state)?1:0;},pop:function(){if(this.data.length>this.locked){var o=this.data.pop();this.index=this.data.length-1;this.draw();if(typeof o.deactivate==="function")
o.deactivate.call(o);if(!this.data.length)
this.hide();}
if(this.data.length>0)
this.popEvent.fire();},home:function(){if(this.data&&this.data.length&&this.data.length>1){var o=this.data[0];var c=this.data[this.index];if(o===c)
return;this.data=[o];this.lastIndex=1;this.index=0;this.draw();this.popEvent.fire();this.homeEvent.fire();}},showHome:function(){this.home();if(!this.visible){this.visible=true;joDOM.addCSSClass(this.container,"show");this.showEvent.fire();}},getTitle:function(){var c=this.data[this.index];if(typeof c.getTitle==='function')
return c.getTitle();else
return false;},show:function(){if(!this.visible){this.visible=true;joDOM.addCSSClass(this.container,"show");joDefer(this.showEvent.fire,this.showEvent,500);}},hide:function(){if(this.visible){this.visible=false;joDOM.removeCSSClass(this.container,"show");joDefer(this.hideEvent.fire,this.hideEvent,500);}}});joScroller=function(data){this.points=[];this.eventset=false;this.horizontal=0;this.vertical=1;this.inMotion=false;this.moved=false;this.mousemove=null;this.mouseup=null;this.bump=0;joContainer.apply(this,arguments);};joScroller.extend(joContainer,{tagName:"joscroller",velocity:1.6,transitionEnd:"webkitTransitionEnd",setEvents:function(){joEvent.capture(this.container,"click",this.onClick,this);joEvent.on(this.container,"mousedown",this.onDown,this);},onFlick:function(e){},onClick:function(e){if(this.moved){this.moved=false;joEvent.stop(e);joEvent.preventDefault(e);}},onDown:function(e){joEvent.stop(e);this.reset();var node=this.container.firstChild;joDOM.removeCSSClass(node,"flick");joDOM.removeCSSClass(node,"flickback");joDOM.removeCSSClass(node,"flickfast");this.start=this.getMouse(e);this.points.unshift(this.start);this.inMotion=true;if(!this.mousemove){this.mousemove=joEvent.capture(document.body,"mousemove",this.onMove,this);this.mouseup=joEvent.capture(document.body,"mouseup",this.onUp,this);}},reset:function(){this.points=[];this.moved=false;this.inMotion=false;},onMove:function(e){if(!this.inMotion)
return;joEvent.stop(e);e.preventDefault();var point=this.getMouse(e);var y=point.y-this.points[0].y;var x=point.x-this.points[0].x;this.points.unshift(point);if(this.points.length>7)
this.points.pop();var self=this;this.timer=window.setTimeout(function(){if(self.inMotion&&self.points.length>1)
self.points.pop();},100);this.scrollBy(x,y,true);if(!this.moved&&this.points.length>3)
this.moved=true;},onUp:function(e){if(!this.inMotion)
return;joEvent.remove(document.body,"mousemove",this.mousemove,true);joEvent.remove(document.body,"mouseup",this.mouseup,true);this.mousemove=null;this.inMotion=false;joEvent.stop(e);joEvent.preventDefault(e);var end=this.getMouse(e);var node=this.container.firstChild;var top=this.getTop();var left=this.getLeft();var dy=0;var dx=0;for(var i=0;i<this.points.length-1;i++){dy+=(this.points[i].y-this.points[i+1].y);dx+=(this.points[i].x-this.points[i+1].x);}
var max=0-node.offsetHeight+this.container.offsetHeight;var maxx=0-node.offsetWidth+this.container.offsetWidth;if((Math.abs(dy)*this.vertical>4||Math.abs(dx)*this.horizontal>4)){var flick=dy*(this.velocity*(node.offsetHeight/this.container.offsetHeight));var flickx=dx*(this.velocity*(node.offsetWidth/this.container.offsetWidth));if((flick+top<max||flick+top>0)||(flickx+left<maxx||flickx+left>0)){joDOM.addCSSClass(node,"flickfast");}
else{joDOM.addCSSClass(node,"flick");}
this.scrollBy(flickx,flick,false);joDefer(this.snapBack,this,3000);}
else{joDefer(this.snapBack,this,10);}},getMouse:function(e){return{x:(this.horizontal)?e.screenX:0,y:(this.vertical)?e.screenY:0};},scrollBy:function(x,y,test){var node=this.container.firstChild;var top=this.getTop();var left=this.getLeft();var dy=Math.floor(top+y);var dx=Math.floor(left+x);if(this.vertical&&(node.offsetHeight<=this.container.offsetHeight))
return;var max=0-node.offsetHeight+this.container.offsetHeight;var maxx=0-node.offsetWidth+this.container.offsetWidth;var ody=dy;var odx=dx;if(this.bump){if(dy>this.bump)
dy=this.bump;else if(dy<max-this.bump)
dy=max-this.bump;if(dx>this.bump)
dx=this.bump;else if(dy<maxx-this.bump)
dx=maxx-this.bump;}
if(!this.eventset)
this.eventset=joEvent.capture(node,this.transitionEnd,this.snapBack,this);if(top!=dx||left!=dy)
this.moveTo(dx,dy);},scrollTo:function(y,instant){var node=this.container.firstChild;if(!node)
return;if(typeof y=='object'){if(y instanceof HTMLElement)
var e=y;else if(y instanceof joView)
var e=y.container;var t=0-e.offsetTop;var h=e.offsetHeight+80;var y=top;var top=this.getTop();var bottom=top-this.container.offsetHeight;if(t-h<bottom)
y=(t-h)+this.container.offsetHeight;if(y<t)
y=t;}
if(y<0-node.offsetHeight)
y=0-node.offsetHeight;else if(y>0)
y=0;if(!instant){joDOM.addCSSClass(node,'flick');}
else{joDOM.removeCSSClass(node,'flick');joDOM.removeCSSClass(node,'flickback');}
this.moveTo(0,y);},snapBack:function(){var node=this.container.firstChild;var top=this.getTop();var left=this.getLeft();var dy=top;var dx=left;var max=0-node.offsetHeight+this.container.offsetHeight;var maxx=0-node.offsetWidth+this.container.offsetWidth;if(this.eventset)
joEvent.remove(node,this.transitionEnd,this.eventset);this.eventset=null;joDOM.removeCSSClass(node,'flick');if(dy>0)
dy=0;else if(dy<max)
dy=max;if(dx>0)
dx=0;else if(dx<maxx)
dx=maxx;if(dx!=left||dy!=top){joDOM.addCSSClass(node,'flickback');this.moveTo(dx,dy);}},setScroll:function(x,y){this.horizontal=x?1:0;this.vertical=y?1:0;return this;},moveTo:function(x,y){var node=this.container.firstChild;if(!node)
return;this.setPosition(x*this.horizontal,y*this.vertical,node);node.jotop=y;node.joleft=x;},setPosition:function(x,y,node){node.style.webkitTransform="translate3d("+x+"px, "+y+"px, 0)";},getTop:function(){return this.container.firstChild.jotop||0;},getLeft:function(){return this.container.firstChild.joleft||0;},setData:function(data){joContainer.prototype.setData.apply(this,arguments);}});joDivider=function(data){joView.apply(this,arguments);};joDivider.extend(joView,{tagName:"jodivider"});joExpando=function(data){this.openEvent=new joSubject(this);this.closeEvent=new joSubject(this);joContainer.apply(this,arguments);};joExpando.extend(joContainer,{tagName:"joexpando",draw:function(){if(!this.data)
return;joContainer.prototype.draw.apply(this,arguments);this.setToggleEvent();},setEvents:function(){},setToggleEvent:function(){joEvent.on(this.container.childNodes[0],"click",this.toggle,this);},toggle:function(){if(this.container.className.indexOf("open")>=0)
this.close();else
this.open();},open:function(){joDOM.addCSSClass(this.container,"open");this.openEvent.fire();},close:function(){joDOM.removeCSSClass(this.container,"open");this.closeEvent.fire();}});joExpandoContent=function(){joContainer.apply(this,arguments);};joExpandoContent.extend(joContainer,{tagName:"joexpandocontent"});joExpandoTitle=function(data){joControl.apply(this,arguments);};joExpandoTitle.extend(joControl,{tagName:"joexpandotitle",setData:function(){joView.prototype.setData.apply(this,arguments);this.draw();},draw:function(){this.container.innerHTML=this.data+"<joicon></joicon>";}});joFlexrow=function(data){joContainer.apply(this,arguments);};joFlexrow.extend(joContainer,{tagName:"joflexrow"});joFlexcol=function(data){joContainer.apply(this,arguments);};joFlexcol.extend(joContainer,{tagName:"joflexcol"});joFocus={last:null,set:function(control){if(this.last&&this.last!==control)
this.last.blur();if(control&&control instanceof joControl){control.focus();this.last=control;}},get:function(control){return this.last;},refresh:function(){if(this.last)
this.last.focus();},clear:function(){this.set();}};joFooter=function(data){joContainer.apply(this,arguments);};joFooter.extend(joContainer,{tagName:"jofooter"});joGesture={load:function(){this.upEvent=new joSubject(this);this.downEvent=new joSubject(this);this.leftEvent=new joSubject(this);this.rightEvent=new joSubject(this);this.forwardEvent=new joSubject(this);this.backEvent=new joSubject(this);this.homeEvent=new joSubject(this);this.closeEvent=new joSubject(this);this.activateEvent=new joSubject(this);this.deactivateEvent=new joSubject(this);this.resizeEvent=new joSubject(this);this.setEvents();},setEvents:function(){joEvent.on(document.body,"keydown",this.onKeyDown,this);joEvent.on(document.body,"keyup",this.onKeyUp,this);joEvent.on(document.body,"unload",this.closeEvent,this);joEvent.on(window,"activate",this.activateEvent,this);joEvent.on(window,"deactivate",this.deactivateEvent,this);joEvent.on(window,"resize",this.resize,this);},resize:function(){this.resizeEvent.fire(window);},onKeyUp:function(e){if(!e)
var e=window.event;if(e.keyCode==18){this.altkey=false;return;}
if(e.keyCode==27){if(jo.flag.stopback){joEvent.stop(e);joEvent.preventDefault(e);}
this.backEvent.fire("back");return;}
if(!this.altkey)
return;joEvent.stop(e);switch(e.keyCode){case 37:this.leftEvent.fire("left");break;case 38:this.upEvent.fire("up");break;case 39:this.rightEvent.fire("right");break;case 40:this.downEvent.fire("down");break;case 27:this.backEvent.fire("back");break;case 13:this.forwardEvent.fire("forward");break;}},onKeyDown:function(e){if(!e)
var e=window.event;if(e.keyCode==27){joEvent.stop(e);joEvent.preventDefault(e);}
else if(e.keyCode==13&&joFocus.get()instanceof joInput){joEvent.stop(e);}
else if(e.keyCode==18){this.altkey=true;}
return;}};joGroup=function(data){joContainer.apply(this,arguments);};joGroup.extend(joContainer,{tagName:"jogroup"});joHTML=function(data){joControl.apply(this,arguments);};joHTML.extend(joControl,{tagName:"johtml",setEvents:function(){joEvent.on(this.container,"click",this.onClick,this);},onClick:function(e){joEvent.stop(e);joEvent.preventDefault(e);var container=this.container;var hrefnode=findhref(joEvent.getTarget(e));if(hrefnode){this.selectEvent.fire(hrefnode.href);}
function findhref(node){if(!node)
return null;if(node.href)
return node;if(typeof node.parentNode!=="undefined"&&node.parentNode!==container)
return findhref(node.parentNode);else
return null;}}});joInput=function(data){joControl.apply(this,arguments);};joInput.extend(joControl,{tagName:"input",type:"text",setData:function(data){if(data!==this.data){this.data=data;if(typeof this.container.value!=="undefined")
this.container.value=data;else
this.container.innerHTML=data;this.changeEvent.fire(this.data);}},getData:function(){if(typeof this.container.value!=="undefined")
return this.container.value;else
return this.container.innerHTML;},enable:function(){this.container.setAttribute("tabindex","1");joControl.prototype.enable.call(this);},disable:function(){this.container.removeAttribute("tabindex");joControl.prototype.disable.call(this);},createContainer:function(){var o=joDOM.create(this);if(!o)
return;o.setAttribute("type","text");o.setAttribute("tabindex","1");o.contentEditable=this.enabled;return o;},setEvents:function(){joControl.prototype.setEvents.call(this);joEvent.on(this.container,"keydown",this.onKeyDown,this);},onKeyDown:function(e){if(e.keyCode==13){e.preventDefault();joEvent.stop(e);}
return false;},draw:function(){if(this.container.value)
this.value=this.data;else
this.innerHTML=this.value;},onMouseDown:function(e){joEvent.stop(e);this.focus();},storeData:function(){this.data=this.getData();if(this.dataSource)
this.dataSource.set(this.value);}});joLabel=function(data){joControl.apply(this,arguments);};joLabel.extend(joControl,{tagName:"jolabel"});joMenu=function(){joList.apply(this,arguments);};joMenu.extend(joList,{tagName:"jomenu",itemTagName:"jomenuitem",value:null,fireSelect:function(index){if(typeof this.data[index].id!=="undefined"&&this.data[index].id)
this.selectEvent.fire(this.data[index].id);else
this.selectEvent.fire(index);},formatItem:function(item,index){var o=joDOM.create(this.itemTagName);o.setAttribute("index",index);if(typeof item==="object"){o.innerHTML=item.title;if(item.icon){o.style.backgroundImage="url("+item.icon+")";joDOM.addCSSClass(o,"icon");}}
else{o.innerHTML=item;}
return o;}});joOption=function(){joMenu.apply(this,arguments);};joOption.extend(joMenu,{tagName:"jooption",itemTagName:"jooptionitem"});joPasswordInput=function(data){joInput.apply(this,arguments);};joPasswordInput.extend(joInput,{className:"password",type:"password"});joPopup=function(){this.showEvent=new joSubject(this);this.hideEvent=new joSubject(this);joContainer.apply(this,arguments);};joPopup.extend(joContainer,{tagName:"jopopup",setEvents:function(){joEvent.on(this.container,"mousedown",this.onClick,this);},onClick:function(e){joEvent.stop(e);},hide:function(){joEvent.on(this.container,"webkitTransitionEnd",this.onHide,this);this.container.className='hide';},onHide:function(){this.hideEvent.fire();},show:function(){this.container.className='show';this.showEvent.fire();}});joScreen=function(){this.resizeEvent=new joSubject(this);this.menuEvent=new joSubject(this);this.activateEvent=new joSubject(this);this.deactivateEvent=new joSubject(this);this.backEvent=new joSubject(this);this.forwardEvent=new joSubject(this);joContainer.apply(this,arguments);};joScreen.extend(joContainer,{tagName:"screen",setupEvents:function(){joEvent.on(window,"resize",this.resizeEvent.fire,this);joEvent.on(window,"appmenushow",this.menuEvent.fire,this);joEvent.on(window,"activate",this.activateEvent.fire,this);joEvent.on(window,"deactivate",this.deactivateEvent.fire,this);joEvent.on(window,"back",this.backEvent.fire,this);},createContainer:function(){return document.body;},showPopup:function(data){if(!this.popup){this.shim=new joShim(new joFlexcol(['&nbsp',this.popup=new joPopup(data),'&nbsp']));}
else{this.popup.setData(data);}
this.shim.show();this.popup.show();},hidePopup:function(){if(this.shim)
this.shim.hide();},alert:function(title,msg,options,context){var buttons=[];var callback;var context=(typeof context==='object')?context:null;if(typeof options==='object'){if(options instanceof Array){for(var i=0;i<options.length;i++)
addbutton(options[i]);}
else{addbutton(options);}}
else if(typeof options==='string'){addbutton({label:options});}
else{if(typeof options==='function')
callback=options;addbutton();}
var view=[new joTitle(title),new joHTML(msg),buttons];this.showPopup(view);var self=this;function addbutton(options){if(!options)
var options={label:'OK'};var button=new joButton(options.label);button.selectEvent.subscribe(function(){if(options.action)
options.action.call(options.context);defaultaction();},options.context||self);buttons.push(button);}
function defaultaction(){self.hidePopup();if(callback){if(context)
callback.call(context);else
callback();}}}});joShim=function(){this.showEvent=new joSubject(this);this.hideEvent=new joSubject(this);this.selectEvent=new joSubject(this);joContainer.apply(this,arguments);};joShim.extend(joContainer,{tagName:"joshim",setEvents:function(){joEvent.on(this.container,"mousedown",this.onMouseDown,this);},onMouseDown:function(e){joEvent.stop(e);this.hide();},hide:function(){this.container.className='';joEvent.on(this.container,"webkitTransitionEnd",this.onHide,this);},show:function(){this.attach();this.container.className='show';joEvent.on(this.container,"webkitTransitionEnd",this.onShow,this);if(!this.lastParent)
this.lastParent=document.body;},onShow:function(){this.showEvent.fire();},onHide:function(){this.detach();this.hideEvent.fire();}});joSound=function(filename,repeat){this.endedEvent=new joSubject(this);this.errorEvent=new joSubject(this);if(typeof Audio=='undefined')
return;this.filename=filename;this.audio=new Audio();this.audio.autoplay=false;if(!this.audio)
return;joDefer(function(){this.audio.src=filename;this.audio.load();},this,5);this.setRepeatCount(repeat);joEvent.on(this.audio,"ended",this.onEnded,this);};joSound.prototype={play:function(){if(!this.audio||this.audio.volume==0)
return;this.audio.play();return this;},onEnded:function(e){this.endedEvent.fire(this.repeat);if(++this.repeat<this.repeatCount)
this.play();else
this.repeat=0;},setRepeatCount:function(repeat){this.repeatCount=repeat;this.repeat=0;return this;},pause:function(){if(!this.audio)
return;this.audio.pause();return this;},rewind:function(){if(!this.audio)
return;try{this.audio.currentTime=0.0;}
catch(e){joLog("joSound: can't rewind...");}
this.repeat=0;return this;},stop:function(){this.pause();this.rewind();this.repeat=0;return this;},setVolume:function(vol){if(!this.audio||vol<0||vol>1)
return;this.audio.volume=vol;return this;}};joStackScroller=function(data){this.scrollers=[new joScroller(),new joScroller()];this.scroller=this.scrollers[0];joStack.apply(this,arguments);this.scroller.attach(this.container);};joStackScroller.extend(joStack,{type:"scroll",scrollerindex:1,scroller:null,scrollers:[],switchScroller:function(){this.scrollerindex=this.scrollerindex?0:1;this.scroller=this.scrollers[this.scrollerindex];},getLastScroller:function(){return this.scrollers[this.scrollerindex?0:1];},scrollTo:function(something){this.scroller.scrollTo(something);},scrollBy:function(y){this.scroller.scrollBy(y);},getChildStyleContainer:function(){return this.scroller.container;},getContentContainer:function(){return this.scroller.container;},appendChild:function(child){var scroller=this.scroller;scroller.setData(child);this.container.appendChild(scroller.container);},getChild:function(){return this.scroller.container||null;},forward:function(){if(this.index<this.data.length-1)
this.switchScroller();joStack.prototype.forward.call(this);},back:function(){if(this.index>0)
this.switchScroller();joStack.prototype.forward.call(this);},home:function(){if(this.data&&this.data.length&&this.data.length>1){this.switchScroller();joStack.prototype.home.call(this);}},push:function(o){if(this.data&&this.data.length&&this.data[this.data.length-1]===o)
return;this.switchScroller();joDOM.removeCSSClass(o,'flick');joDOM.removeCSSClass(o,'flickback');this.scroller.setData(o);this.scroller.scrollTo(0,true);joStack.prototype.push.call(this,o);},pop:function(){if(this.data.length>this.locked)
this.switchScroller();joStack.prototype.pop.call(this);}});joTabBar=function(){joList.apply(this,arguments);};joTabBar.extend(joList,{tagName:"jotabbar",formatItem:function(data,index){var o=document.createElement("jotab");if(data.label)
o.innerHTML=data.label;if(data.type)
o.className=data.type;o.setAttribute("index",index);return o;}});joTable=function(data){joList.apply(this,arguments);};joTable.extend(joList,{tagName:"jotable",formatItem:function(row,index){var tr=document.createElement("tr");for(var i=0,l=row.length;i<l;i++){var o=document.createElement(index?"td":"th");o.innerHTML=row[i];o.setAttribute("index",index*l+i);tr.appendChild(o);}
return tr;},getNode:function(index){var row=this.getRow(index);var col=this.getCol(index);return this.container.childNodes[row].childNodes[col];},getRow:function(index){if(typeof index=="undefined")
var index=this.getIndex();var rowsize=this.data[0].length;return Math.floor(index/rowsize);},getCol:function(index){if(typeof index=="undefined")
var index=this.getIndex();var rowsize=this.data[0].length;return index%rowsize;}});joTextarea=function(data){joInput.apply(this,arguments);};joTextarea.extend(joInput,{tagName:"textarea",onKeyDown:function(e){return false;}});joTitle=function(data){joView.apply(this,arguments);};joTitle.extend(joView,{tagName:"jotitle"});joToolbar=function(data){joContainer.apply(this,arguments);};joToolbar.extend(joContainer,{tagName:"jotoolbar"});joForm=function(){joContainer.apply(this,arguments);};joForm.extend(joContainer,{tagName:"form"});joDialog=function(data){joShim.call(this,new joFlexcol(['',new joPopup(new joScroller(data)).setStyle("show"),'']));};joDialog.extend(joShim,{});joSelectList=function(){joList.apply(this,arguments);};joSelectList.extend(joList,{tagName:"joselectlist"});joNavbar=function(title){if(title)
this.firstTitle=title;var ui=[this.titlebar=new joView(title||'&nbsp;').setStyle('title'),new joFlexrow([this.back=new joBackButton('Back').selectEvent.subscribe(this.back,this),""])];joContainer.call(this,ui);};joNavbar.extend(joContainer,{tagName:"jonavbar",stack:null,back:function(){if(this.stack)
this.stack.pop();},setStack:function(stack){if(this.stack){this.stack.pushEvent.unsubscribe(this.update,this);this.stack.popEvent.unsubscribe(this.update,this);}
if(!stack){this.stack=null;return;}
this.stack=stack;stack.pushEvent.subscribe(this.update,this);stack.popEvent.subscribe(this.update,this);this.refresh();},update:function(){if(!this.stack)
return;joDOM.removeCSSClass(this.back,'selected');joDOM.removeCSSClass(this.back,'focus');if(this.stack.data.length>1)
joDOM.addCSSClass(this.back,'active');else
joDOM.removeCSSClass(this.back,'active');var title=this.stack.getTitle();if(typeof title==='string')
this.titlebar.setData(title);else
this.titlebar.setData(this.firstTitle);},setTitle:function(title){this.titlebar.setData(title);this.firstTitle=title;return this;}});joBackButton=function(){joButton.apply(this,arguments);};joBackButton.extend(joButton,{tagName:"jobackbutton"});joSelect=function(data,value){var v=value;if(value instanceof joDataSource)
v=value.getData();var ui=[this.field=new joSelectTitle(v),this.list=new joSelectList(data,value)];this.field.setList(this.list);this.changeEvent=this.list.changeEvent;this.selectEvent=this.list.selectEvent;joExpando.call(this,ui);this.container.setAttribute("tabindex",1);this.field.setData(this.list.value);this.list.selectEvent.subscribe(this.setValue,this);};joSelect.extend(joExpando,{setValue:function(value,list){if(list){this.field.setData(value);this.close();}
else{this.field.setData(value);}},getValue:function(){return this.list.getValue();},setEvents:function(){joControl.prototype.setEvents.call(this);},onBlur:function(e){joEvent.stop(e);joDOM.removeCSSClass(this,"focus");this.close();}});joSelectTitle=function(){joExpandoTitle.apply(this,arguments);};joSelectTitle.extend(joExpandoTitle,{list:null,setList:function(list){this.list=list;},setData:function(value){if(this.list)
joExpandoTitle.prototype.setData.call(this,this.list.getNodeData(value)||"Select...");else
joExpandoTitle.prototype.setData.call(this,value);}});joToggle=function(data){joControl.call(this,data);};joToggle.extend(joControl,{tagName:"jotoggle",button:null,labels:["Off","On"],setLabels:function(labels){if(labels instanceof Array)
this.labels=labels;else if(arguments.length==2)
this.labels=arguments;this.draw();return this;},select:function(e){if(e)
joEvent.stop(e);this.setData((this.data)?false:true);},onBlur:function(e){joEvent.stop(e);this.blur();},draw:function(){if(!this.container)
return;if(!this.container.firstChild){this.button=joDOM.create("div");this.container.appendChild(this.button);}
this.button.innerHTML=this.labels[(this.data)?1:0];if(this.data)
joDOM.addCSSClass(this.container,"on");else
joDOM.removeCSSClass(this.container,"on");}});joSlider=function(value){this.min=0;this.max=1;this.snap=0;this.range=1;this.thumb=null;this.horizontal=1;this.vertical=0;this.moved=false;this.jump=true;joControl.call(this,null,value);};joSlider.extend(joControl,{tagName:"joslider",setRange:function(min,max,snap){if(min>=max){joLog("WARNING: joSlider.setRange, min must be less than max.");return this;}
this.min=min||0;this.max=max||1;if(min<0&&max>=0)
this.range=Math.abs(min)+max;else if(min<0&&max<=0)
this.range=min-max;else
this.range=max-min;if(typeof snap!=='undefined')
this.snap=(snap>=0&&snap<=this.range)?snap:0;else
this.snap=0;this.setValue(this.value);return this;},setValue:function(value,silent){var v=this.adjustValue(value);if(v!=this.value){joControl.prototype.setValue.call(this,v);if(!silent)
this.draw();}
return this;},adjustValue:function(v){var value=v;if(this.snap)
value=Math.floor(value/this.snap)*this.snap;if(value<this.min)
value=this.min;else if(value>this.max)
value=this.max;return value;},createContainer:function(){var o=joDOM.create(this.tagName);if(o){o.setAttribute("tabindex","1");var t=joDOM.create("josliderthumb");o.appendChild(t);this.thumb=t;}
return o;},onDown:function(e){joEvent.stop(e);this.reset();var node=this.container.firstChild;this.inMotion=true;this.moved=false;if(!this.mousemove){this.mousemove=joEvent.on(document.body,"mousemove",this.onMove,this);this.mouseup=joEvent.capture(document.body,"mouseup",this.onUp,this);}},reset:function(){this.moved=false;this.inMotion=false;this.firstX=-1;this.firstY=-1;},onMove:function(e){if(!this.inMotion)
return;joEvent.stop(e);e.preventDefault();var point=this.getMouse(e);var y=point.y;var x=point.x;if(this.firstX==-1){this.firstX=x;this.firstY=y;this.ox=this.thumb.offsetLeft;this.oy=this.thumb.offsetTop;}
var x=(x-this.firstX)+this.ox;var y=(y-this.firstY)+this.oy;if(x>4||y>4)
this.moved=true;var t=this.thumb.offsetWidth;var w=this.container.offsetWidth-t;if(x<0)
x=0;else if(x>w)
x=w;if(!this.snap)
this.moveTo(x);this.setValue((x/w)*this.range+this.min,!this.snap);},moveTo:function(x){this.thumb.style.left=x+"px";},initValue:function(value){var t=this.container.firstChild.offsetWidth;var w=this.container.offsetWidth-t;var x=Math.floor((this.value/this.range)*w);this.moveTo(x);return this;},onUp:function(e){if(!this.inMotion)
return;joEvent.remove(document.body,"mousemove",this.mousemove);joEvent.remove(document.body,"mouseup",this.mouseup);this.mousemove=null;joEvent.stop(e);joEvent.preventDefault(e);joDefer(function(){this.reset();},this);},setEvents:function(){joEvent.on(this.container,"click",this.onClick,this);joEvent.on(this.thumb,"mousedown",this.onDown,this);joGesture.resizeEvent.subscribe(this.draw,this);console.log('setevents');},onClick:function(e){if(this.inMotion||this.moved)
return;joEvent.stop(e);joEvent.preventDefault(e);var point=this.getMouse(e);var l=joDOM.pageOffsetLeft(this.container);var x=Math.floor((point.x-l)-this.thumb.offsetWidth*1.5);var t=this.thumb.offsetWidth;x=x-t;var w=this.container.offsetWidth-t;if((x<t&&this.snap)||x<0)
x=0;else if(x>w)
x=w;this.setValue((x/w)*this.range+this.min);},getMouse:function(e){return{x:(this.horizontal)?e.screenX:0,y:(this.vertical)?e.screenY:0};},draw:function(){if(!this.container)
this.setContainer();this.initValue(this.value);}});

1895
assets/www/js/jq.mobi.js Normal file

File diff suppressed because it is too large Load diff

31
assets/www/js/jq.mobi.min.js vendored Normal file
View file

@ -0,0 +1,31 @@
if(!window.jq||typeof jq!=="function"){var jq=function(g){function u(a){return a in s?s[a]:s[a]=RegExp("(^|\\s)"+a+"(\\s|$)")}function o(a){for(var c=0;c<a.length;c++)a.indexOf(a[c])!=c&&(a.splice(c,1),c--);return a}function v(a,c){var b=[];if(a==f)return b;for(;a;a=a.nextSibling)a.nodeType==1&&a!==c&&b.push(a);return b}function n(){}function w(a,c){a.os={};a.os.webkit=c.match(/WebKit\/([\d.]+)/)?!0:!1;a.os.android=c.match(/(Android)\s+([\d.]+)/)||c.match(/Silk-Accelerated/)?!0:!1;a.os.ipad=c.match(/(iPad).*OS\s([\d_]+)/)?
!0:!1;a.os.iphone=!a.os.ipad&&c.match(/(iPhone\sOS)\s([\d_]+)/)?!0:!1;a.os.webos=c.match(/(webOS|hpwOS)[\s\/]([\d.]+)/)?!0:!1;a.os.touchpad=a.os.webos&&c.match(/TouchPad/)?!0:!1;a.os.ios=a.os.ipad||a.os.iphone;a.os.blackberry=c.match(/BlackBerry/)||c.match(/PlayBook/)?!0:!1;a.os.opera=c.match(/Opera Mobi/)?!0:!1;a.os.fennec=c.match(/fennec/i)?!0:!1;a.os.desktop=!(a.os.ios||a.os.android||a.os.blackberry||a.os.opera||a.os.fennec)}function A(a,c,b,e){c=x(c);if(c.ns)var d=RegExp("(?:^| )"+c.ns.replace(" ",
" .* ?")+"(?: |$)");return(p[a._jqmid||(a._jqmid=t++)]||[]).filter(function(a){return a&&(!c.e||a.e==c.e)&&(!c.ns||d.test(a.ns))&&(!b||a.fn==b||typeof a.fn==="function"&&typeof b==="function"&&""+a.fn===""+b)&&(!e||a.sel==e)})}function x(a){a=(""+a).split(".");return{e:a[0],ns:a.slice(1).sort().join(" ")}}function y(a,c,b){d.isObject(a)?d.each(a,b):a.split(/\s/).forEach(function(a){b(a,c)})}function q(a,c,b,e,h){var f=a._jqmid||(a._jqmid=t++),g=p[f]||(p[f]=[]);y(c,b,function(b,c){var f=h&&h(c,b),
l=f||c,i=function(b){var c=l.apply(a,[b].concat(b.data));c===!1&&b.preventDefault();return c},f=d.extend(x(b),{fn:c,proxy:i,sel:e,del:f,i:g.length});g.push(f);a.addEventListener(f.e,i,!1)})}function r(a,c,b,e){var d=a._jqmid||(a._jqmid=t++);y(c||"",b,function(b,c){A(a,b,c,e).forEach(function(b){delete p[d][b.i];a.removeEventListener(b.e,b.proxy,!1)})})}function B(a){var c=d.extend({originalEvent:a},a);d.each(C,function(b,e){c[b]=function(){this[e]=D;return a[b].apply(a,arguments)};c[e]=E});return c}
var f,i=g.document,k=[],F=k.slice,s=[],G=1,H=/^\s*<(\w+)[^>]*>/,j={},m=function(a,c){this.length=0;if(a)if(a instanceof m&&c==f)return a;else if(d.isFunction(a))return d(i).ready(a);else if(d.isArray(a)&&a.length!=f){for(var b=0;b<a.length;b++)this[this.length++]=a[b];return this}else if(d.isObject(a)&&d.isObject(c)){if(a.length==f)a.parentNode==c&&(this[this.length++]=a);else for(b=0;b<a.length;b++)a[b].parentNode==c&&(this[this.length++]=a[b]);return this}else if(d.isObject(a)&&c==f)return this[this.length++]=
a,this;else if(c!==f){if(c instanceof m)return c.find(a)}else c=i;else return this;if(b=this.selector(a,c))if(d.isArray(b))for(var e=0;e<b.length;e++)this[this.length++]=b[e];else this[this.length++]=b;return this},d=function(a,c){return new m(a,c)};d.map=function(a,c){var b,e=[],h;if(d.isArray(a))for(h=0;h<a.length;h++)b=c(a[h],h),b!==f&&e.push(b);else if(d.isObject(a))for(h in a)a.hasOwnProperty(h)&&(b=c(a[h],h),b!==f&&e.push(b));return d([e])};d.each=function(a,c){var b;if(d.isArray(a))for(b=0;b<
a.length;b++){if(c(b,a[b])===!1)break}else if(d.isObject(a))for(b in a)if(a.hasOwnProperty(b)&&c(b,a[b])===!1)break;return a};d.extend=function(a){a==f&&(a=this);if(arguments.length===1){for(var c in a)this[c]=a[c];return this}else F.call(arguments,1).forEach(function(b){for(var c in b)a[c]=b[c]});return a};d.isArray=function(a){return a instanceof Array&&a.push!=f};d.isFunction=function(a){return typeof a==="function"};d.isObject=function(a){return typeof a==="object"};d.fn=m.prototype={constructor:m,
forEach:k.forEach,reduce:k.reduce,push:k.push,indexOf:k.indexOf,concat:k.concat,selector:function(a,c){var b;try{if(a=a.trim(),a[0]==="#"&&a.indexOf(" ")===-1&&a.indexOf(">")===-1)b=c==i?c.getElementById(a.replace("#","")):[].slice.call(c.querySelectorAll(a));else if(a[0]==="<"&&a[a.length-1]===">"){var e=i.createElement("div");e.innerHTML=a.trim();b=[].slice.call(e.childNodes)}else b=[].slice.call(c.querySelectorAll(a))}catch(d){}return b},oldElement:f,slice:k.slice,setupOld:function(a){if(a==f)return d();
a.oldElement=this;return a},map:function(a){return d.map(this,function(c,b){return a.call(c,b,c)})},each:function(a){this.forEach(function(c,b){a.call(c,b,c)});return this},ready:function(a){(i.readyState==="complete"||i.readyState==="loaded")&&a();i.addEventListener("DOMContentLoaded",a,!1);return this},find:function(a){if(this.length===0)return f;for(var c=[],b,e=0;e<this.length;e++){b=d(a,this[e]);for(var h=0;h<b.length;h++)c.push(b[h])}return d(o(c))},html:function(a){if(this.length===0)return f;
if(a===f)return this[0].innerHTML;for(var c=0;c<this.length;c++)this[c].innerHTML=a;return this},text:function(a){if(this.length===0)return f;if(a===f)return this[0].textContent;for(var c=0;c<this.length;c++)this[c].textContent=a;return this},css:function(a,c,b){b=b!=f?b:this[0];if(this.length===0)return f;if(c==f&&typeof a==="string")return g.getComputedStyle(b),b.style[a]?b.style[a]:g.getComputedStyle(b)[a];for(b=0;b<this.length;b++)if(d.isObject(a))for(var e in a)this[b].style[e]=a[e];else this[b].style[a]=
c;return this},empty:function(){for(var a=0;a<this.length;a++)this[a].innerHTML="";return this},hide:function(){if(this.length===0)return this;for(var a=0;a<this.length;a++)if(this.css("display",null,this[a])!="none")this[a].setAttribute("jqmOldStyle",this.css("display",null,this[a])),this[a].style.display="none";return this},show:function(){if(this.length===0)return this;for(var a=0;a<this.length;a++)if(this.css("display",null,this[a])=="none")this[a].style.display=this[a].getAttribute("jqmOldStyle")?
this[a].getAttribute("jqmOldStyle"):"block",this[a].removeAttribute("jqmOldStyle");return this},toggle:function(a){for(var c=a===!0?!0:!1,b=0;b<this.length;b++)g.getComputedStyle(this[b]).display!=="none"||a!==f&&c===!1?(this[b].setAttribute("jqmOldStyle",this[b].style.display),this[b].style.display="none"):(this[b].style.display=this[b].getAttribute("jqmOldStyle")!=f?this[b].getAttribute("jqmOldStyle"):"block",this[b].removeAttribute("jqmOldStyle"));return this},val:function(a){if(this.length===
0)return f;if(a==f)return this[0].value;for(var c=0;c<this.length;c++)this[c].value=a;return this},attr:function(a,c){if(this.length===0)return f;if(c===f&&!d.isObject(a))return this[0].jqmCacheId&&j[this[0].jqmCacheId][a]?this[0].jqmCacheId&&j[this[0].jqmCacheId][a]:this[0].getAttribute(a);for(var b=0;b<this.length;b++)if(d.isObject(a))for(var e in a)d(this[b]).attr(e,a[e]);else if(d.isArray(c)||d.isObject(c)||d.isFunction(c)){if(!this[b].jqmCacheId)this[b].jqmCacheId=d.uuid();j[this[b].jqmCacheId]||
(j[this[b].jqmCacheId]={});j[this[b].jqmCacheId][a]=c}else c==null&&c!==f?(this[b].removeAttribute(a),this[b].jqmCacheId&&j[this[b].jqmCacheId][a]&&delete j[this[b].jqmCacheId][a]):this[b].setAttribute(a,c);return this},removeAttr:function(a){for(var c=this,b=0;b<this.length;b++)a.split(/\s+/g).forEach(function(e){c[b].removeAttribute(e);c[b].jqmCacheId&&j[c[b].jqmCacheId][a]&&delete j[c[b].jqmCacheId][a]});return this},remove:function(a){a=d(this).filter(a);if(a==f)return this;for(var c=0;c<a.length;c++)a[c].parentNode.removeChild(a[c]);
return this},addClass:function(a){for(var c=0;c<this.length;c++){var b=this[c].className,e=[],d=this;a.split(/\s+/g).forEach(function(a){d.hasClass(a,d[c])||e.push(a)});this[c].className+=(b?" ":"")+e.join(" ");this[c].className=this[c].className.trim()}return this},removeClass:function(a){for(var c=0;c<this.length;c++){if(a==f){this[c].className="";break}var b=this[c].className;a.split(/\s+/g).forEach(function(a){b=b.replace(u(a)," ")});this[c].className=b.length>0?b.trim():""}return this},hasClass:function(a,
c){if(this.length===0)return!1;c||(c=this[0]);return u(a).test(c.className)},append:function(a,c){if(a&&a.length!=f&&a.length===0)return this;if(d.isArray(a)||d.isObject(a))a=d(a);var b;for(b=0;b<this.length;b++)if(a.length&&typeof a!="string")for(var a=d(a),e=0;e<a.length;e++)c!=f?this[b].insertBefore(a[e],this[b].firstChild):this[b].appendChild(a[e]);else{e=H.test(a)?d(a):f;if(e==f||e.length==0)e=i.createTextNode(a);if(e.nodeName!=f&&e.nodeName.toLowerCase()=="script"&&(!e.type||e.type.toLowerCase()===
"text/javascript"))g.eval(e.innerHTML);else if(e instanceof m)for(var h=0;h<e.length;h++)c!=f?this[b].insertBefore(e[h],this[b].firstChild):this[b].appendChild(e[h]);else c!=f?this[b].insertBefore(e,this[b].firstChild):this[b].appendChild(e)}return this},prepend:function(a){return this.append(a,1)},insertBefore:function(a,c){if(this.length==0)return this;a=d(a).get(0);if(!a||a.length==0)return this;for(var b=0;b<this.length;b++)c?a.parentNode.insertBefore(this[b],a.nextSibling):a.parentNode.insertBefore(this[b],
a);return this},insertAfter:function(a){this.insertBefore(a,!0)},get:function(a){a=a==f?0:a;a<0&&(a+=this.length);return this[a]?this[a]:f},offset:function(){if(this.length===0)return f;var a=this[0].getBoundingClientRect();return{left:a.left+g.pageXOffset,top:a.top+g.pageYOffset,width:parseInt(this[0].style.width),height:parseInt(this[0].style.height)}},parent:function(a){if(this.length==0)return f;for(var c=[],b=0;b<this.length;b++)this[b].parentNode&&c.push(this[b].parentNode);return this.setupOld(d(o(c)).filter(a))},
children:function(a){if(this.length==0)return f;for(var c=[],b=0;b<this.length;b++)c=c.concat(v(this[b].firstChild));return this.setupOld(d(c).filter(a))},siblings:function(a){if(this.length==0)return f;for(var c=[],b=0;b<this.length;b++)this[b].parentNode&&(c=c.concat(v(this[b].parentNode.firstChild,this[b])));return this.setupOld(d(c).filter(a))},closest:function(a,c){if(this.length==0)return f;var b=this[0],e=d(a,c);if(e.length==0)return d();for(;b&&e.indexOf(b)==-1;)b=b!==c&&b!==i&&b.parentNode;
return d(b)},filter:function(a){if(this.length==0)return f;if(a==f)return this;for(var c=[],b=0;b<this.length;b++){var e=this[b];e.parentNode&&d(a,e.parentNode).indexOf(e)>=0&&c.push(e)}return this.setupOld(d(o(c)))},not:function(a){if(this.length==0)return f;for(var c=[],b=0;b<this.length;b++){var e=this[b];e.parentNode&&d(a,e.parentNode).indexOf(e)==-1&&c.push(e)}return this.setupOld(d(o(c)))},data:function(a,c){return this.attr("data-"+a,c)},end:function(){return this.oldElement!=f?this.oldElement:
d()},clone:function(a){a=a===!1?!1:!0;if(this.length==0)return f;for(var c=[],b=0;b<this.length;b++)c.push(this[b].cloneNode(a));return d(c)},size:function(){return this.length},serialize:function(a){if(this.length==0)return"";for(var c={},b=0;b<this.length;b++)this.slice.call(this[b].elements).forEach(function(a){var b=a.getAttribute("type");if(a.nodeName.toLowerCase()!="fieldset"&&!a.disabled&&b!="submit"&&b!="reset"&&b!="button"&&(b!="radio"&&b!="checkbox"||a.checked))c[a.getAttribute("name")]=
a.value});return d.param(c,a)}};var z={type:"GET",beforeSend:n,success:n,error:n,complete:n,context:f,timeout:0,crossDomain:!1};d.jsonP=function(a){var c="jsonp_callback"+ ++G,b="",e=i.createElement("script");g[c]=function(f){clearTimeout(b);d(e).remove();delete g[c];a.success.call(void 0,f)};e.src=a.url.replace(/=\?/,"="+c);if(a.error)e.onerror=function(){clearTimeout(b);a.error.call(void 0,"","error")};d("head").append(e);a.timeout>0&&(b=setTimeout(function(){a.error.call(void 0,"","timeout")},
a.timeout));return{}};d.ajax=function(a){var c;try{c=new g.XMLHttpRequest;var b=a||{},e;for(e in z)b[e]||(b[e]=z[e]);if(!b.url)b.url=g.location;if(!b.contentType)b.contentType="application/x-www-form-urlencoded";if(!b.headers)b.headers={};if(b.dataType)switch(b.dataType){case "script":b.dataType="text/javascript, application/javascript";break;case "json":b.dataType="application/json";break;case "xml":b.dataType="application/xml, text/xml";break;case "html":b.dataType="text/html";break;case "text":b.dataType=
"text/plain";break;default:b.dataType="text/html";break;case "jsonp":return d.jsonP(a)}else b.dataType="text/html";if(d.isObject(b.data))b.data=d.param(b.data);b.type.toLowerCase()==="get"&&b.data&&(b.url+=b.url.indexOf("?")===-1?"?"+b.data:"&"+b.data);if(/=\?/.test(b.url))return d.jsonP(b);if(!b.crossDomain)b.crossDomain=/^([\w-]+:)?\/\/([^\/]+)/.test(b.url)&&RegExp.$2!=g.location.host;if(!b.crossDomain)b.headers=d.extend({"X-Requested-With":"XMLHttpRequest"},b.headers);var f,l=b.context,i=/^([\w-]+:)\/\//.test(b.url)?
RegExp.$1:g.location.protocol;c.onreadystatechange=function(){var a=b.dataType;if(c.readyState===4){clearTimeout(f);var d,e=!1;if(c.status>=200&&c.status<300||c.status===0&&i=="file:"){if(a==="application/json"&&!/^\s*$/.test(c.responseText))try{d=JSON.parse(c.responseText)}catch(g){e=g}else d=c.responseText;c.status===0&&d.length===0&&(e=!0);e?b.error.call(l,c,"parsererror",e):b.success.call(l,d,"success",c)}else e=!0,b.error.call(l,c,"error");b.complete.call(l,c,e?"error":"success")}};c.open(b.type,
b.url,!0);if(b.contentType)b.headers["Content-Type"]=b.contentType;for(var j in b.headers)c.setRequestHeader(j,b.headers[j]);if(b.beforeSend.call(l,c,b)===!1)return c.abort(),!1;b.timeout>0&&(f=setTimeout(function(){c.onreadystatechange=n;c.abort();b.error.call(l,c,"timeout")},b.timeout));c.send(b.data)}catch(k){console.log(k)}return c};d.get=function(a,c){return this.ajax({url:a,success:c})};d.post=function(a,c,b,e){typeof c==="function"&&(b=c,c={});e===f&&(e="html");return this.ajax({url:a,type:"POST",
data:c,dataType:e,success:b})};d.getJSON=function(a,c,b){typeof c==="function"&&(b=c,c={});return this.ajax({url:a,data:c,success:b,dataType:"json"})};d.param=function(a,c){var b=[];if(a instanceof m)a.each(function(){b.push((c?c+"[]":this.id)+"="+encodeURIComponent(this.value))});else for(var e in a){var f=c?c+"["+e+"]":e,g=a[e];b.push(d.isObject(g)?d.param(g,f):f+"="+encodeURIComponent(g))}return b.join("&")};d.parseJSON=function(a){return JSON.parse(a)};d.parseXML=function(a){return(new DOMParser).parseFromString(a,
"text/xml")};w(d,navigator.userAgent);d.__detectUA=w;if(typeof String.prototype.trim!=="function")String.prototype.trim=function(){this.replace(/(\r\n|\n|\r)/gm,"").replace(/^\s+|\s+$/,"");return this};d.uuid=function(){var a=function(){return((1+Math.random())*65536|0).toString(16).substring(1)};return a()+a()+"-"+a()+"-"+a()+"-"+a()+"-"+a()+a()+a()};var p={},t=1,I={};d.event={add:q,remove:r};d.fn.bind=function(a,c){for(var b=0;b<this.length;b++)q(this[b],a,c);return this};d.fn.unbind=function(a,
c){for(var b=0;b<this.length;b++)r(this[b],a,c);return this};d.fn.one=function(a,c){return this.each(function(b,e){q(this,a,c,null,function(a,b){return function(){var c=a.apply(e,arguments);r(e,b,a);return c}})})};var D=function(){return!0},E=function(){return!1},C={preventDefault:"isDefaultPrevented",stopImmediatePropagation:"isImmediatePropagationStopped",stopPropagation:"isPropagationStopped"};d.fn.delegate=function(a,c,b){for(var e=0;e<this.length;e++){var f=this[e];q(f,c,b,a,function(b){return function(c){var e,
g=d(c.target).closest(a,f).get(0);if(g)return e=d.extend(B(c),{currentTarget:g,liveFired:f}),b.apply(g,[e].concat([].slice.call(arguments,1)))}})}return this};d.fn.undelegate=function(a,c,b){for(var e=0;e<this.length;e++)r(this[e],c,b,a);return this};d.fn.on=function(a,c,b){return c===f||d.isFunction(c)?this.bind(a,c):this.delegate(c,a,b)};d.fn.off=function(a,c,b){return c===f||d.isFunction(c)?this.unbind(a,c):this.undelegate(c,a,b)};d.fn.trigger=function(a,c){typeof a=="string"&&(a=d.Event(a));a.data=
c;for(var b=0;b<this.length;b++)this[b].dispatchEvent(a);return this};d.Event=function(a,c){var b=i.createEvent(I[a]||"Events"),e=!0;if(c)for(var d in c)d=="bubbles"?e=!!c[d]:b[d]=c[d];b.initEvent(a,e,!0,null,null,null,null,null,null,null,null,null,null,null,null);return b};d.proxy=function(a,c){return function(b){return a.call(c,b)}};return d}(window);"$"in window||(window.$=jq);if(!window.numOnly)window.numOnly=function(g){isNaN(parseFloat(g))&&(g=g.replace(/[^0-9.-]/,""));return parseFloat(g)}};

1894
assets/www/js/jq.ui.js Normal file

File diff suppressed because it is too large Load diff

127
assets/www/js/jq.ui.min.js vendored Normal file
View file

@ -0,0 +1,127 @@
if(!window.jq||typeof jq!=="function"){var jq=function(k){function i(t){return t in y?y[t]:y[t]=RegExp("(^|\\s)"+t+"(\\s|$)")}function d(t){for(var a=0;a<t.length;a++)t.indexOf(t[a])!=a&&(t.splice(a,1),a--);return t}function l(a,h){var e=[];if(a==o)return e;for(;a;a=a.nextSibling)a.nodeType==1&&a!==h&&e.push(a);return e}function c(){}function n(a,h){a.os={};a.os.webkit=h.match(/WebKit\/([\d.]+)/)?!0:!1;a.os.android=h.match(/(Android)\s+([\d.]+)/)||h.match(/Silk-Accelerated/)?!0:!1;a.os.ipad=h.match(/(iPad).*OS\s([\d_]+)/)?
!0:!1;a.os.iphone=!a.os.ipad&&h.match(/(iPhone\sOS)\s([\d_]+)/)?!0:!1;a.os.webos=h.match(/(webOS|hpwOS)[\s\/]([\d.]+)/)?!0:!1;a.os.touchpad=a.os.webos&&h.match(/TouchPad/)?!0:!1;a.os.ios=a.os.ipad||a.os.iphone;a.os.blackberry=h.match(/BlackBerry/)||h.match(/PlayBook/)?!0:!1;a.os.opera=h.match(/Opera Mobi/)?!0:!1;a.os.fennec=h.match(/fennec/i)?!0:!1;a.os.desktop=!(a.os.ios||a.os.android||a.os.blackberry||a.os.opera||a.os.fennec)}function f(t,h,e,b){h=a(h);if(h.ns)var g=RegExp("(?:^| )"+h.ns.replace(" ",
" .* ?")+"(?: |$)");return(z[t._jqmid||(t._jqmid=B++)]||[]).filter(function(a){return a&&(!h.e||a.e==h.e)&&(!h.ns||g.test(a.ns))&&(!e||a.fn==e||typeof a.fn==="function"&&typeof e==="function"&&""+a.fn===""+e)&&(!b||a.sel==b)})}function a(a){a=(""+a).split(".");return{e:a[0],ns:a.slice(1).sort().join(" ")}}function b(a,h,e){m.isObject(a)?m.each(a,e):a.split(/\s/).forEach(function(a){e(a,h)})}function g(t,h,e,g,q){var c=t._jqmid||(t._jqmid=B++),f=z[c]||(z[c]=[]);b(h,e,function(e,h){var b=q&&q(h,e),
c=b||h,n=function(a){var e=c.apply(t,[a].concat(a.data));e===!1&&a.preventDefault();return e},b=m.extend(a(e),{fn:h,proxy:n,sel:g,del:b,i:f.length});f.push(b);t.addEventListener(b.e,n,!1)})}function q(a,h,e,g){var q=a._jqmid||(a._jqmid=B++);b(h||"",e,function(e,h){f(a,e,h,g).forEach(function(e){delete z[q][e.i];a.removeEventListener(e.e,e.proxy,!1)})})}function C(a){var h=m.extend({originalEvent:a},a);m.each(D,function(e,b){h[e]=function(){this[b]=E;return a[e].apply(a,arguments)};h[b]=F});return h}
var o,p=k.document,r=[],s=r.slice,y=[],u=1,v=/^\s*<(\w+)[^>]*>/,w={},x=function(a,h){this.length=0;if(a)if(a instanceof x&&h==o)return a;else if(m.isFunction(a))return m(p).ready(a);else if(m.isArray(a)&&a.length!=o){for(var e=0;e<a.length;e++)this[this.length++]=a[e];return this}else if(m.isObject(a)&&m.isObject(h)){if(a.length==o)a.parentNode==h&&(this[this.length++]=a);else for(e=0;e<a.length;e++)a[e].parentNode==h&&(this[this.length++]=a[e]);return this}else if(m.isObject(a)&&h==o)return this[this.length++]=
a,this;else if(h!==o){if(h instanceof x)return h.find(a)}else h=p;else return this;if(e=this.selector(a,h))if(m.isArray(e))for(var b=0;b<e.length;b++)this[this.length++]=e[b];else this[this.length++]=e;return this},m=function(a,h){return new x(a,h)};m.map=function(a,h){var e,b=[],g;if(m.isArray(a))for(g=0;g<a.length;g++)e=h(a[g],g),e!==o&&b.push(e);else if(m.isObject(a))for(g in a)a.hasOwnProperty(g)&&(e=h(a[g],g),e!==o&&b.push(e));return m([b])};m.each=function(a,h){var e;if(m.isArray(a))for(e=0;e<
a.length;e++){if(h(e,a[e])===!1)break}else if(m.isObject(a))for(e in a)if(a.hasOwnProperty(e)&&h(e,a[e])===!1)break;return a};m.extend=function(a){a==o&&(a=this);if(arguments.length===1){for(var h in a)this[h]=a[h];return this}else s.call(arguments,1).forEach(function(e){for(var h in e)a[h]=e[h]});return a};m.isArray=function(a){return a instanceof Array&&a.push!=o};m.isFunction=function(a){return typeof a==="function"};m.isObject=function(a){return typeof a==="object"};m.fn=x.prototype={constructor:x,
forEach:r.forEach,reduce:r.reduce,push:r.push,indexOf:r.indexOf,concat:r.concat,selector:function(a,h){var e;try{if(a=a.trim(),a[0]==="#"&&a.indexOf(" ")===-1&&a.indexOf(">")===-1)e=h==p?h.getElementById(a.replace("#","")):[].slice.call(h.querySelectorAll(a));else if(a[0]==="<"&&a[a.length-1]===">"){var b=p.createElement("div");b.innerHTML=a.trim();e=[].slice.call(b.childNodes)}else e=[].slice.call(h.querySelectorAll(a))}catch(g){}return e},oldElement:o,slice:r.slice,setupOld:function(a){if(a==o)return m();
a.oldElement=this;return a},map:function(a){return m.map(this,function(h,e){return a.call(h,e,h)})},each:function(a){this.forEach(function(h,e){a.call(h,e,h)});return this},ready:function(a){(p.readyState==="complete"||p.readyState==="loaded")&&a();p.addEventListener("DOMContentLoaded",a,!1);return this},find:function(a){if(this.length===0)return o;for(var h=[],e,b=0;b<this.length;b++){e=m(a,this[b]);for(var g=0;g<e.length;g++)h.push(e[g])}return m(d(h))},html:function(a){if(this.length===0)return o;
if(a===o)return this[0].innerHTML;for(var h=0;h<this.length;h++)this[h].innerHTML=a;return this},text:function(a){if(this.length===0)return o;if(a===o)return this[0].textContent;for(var h=0;h<this.length;h++)this[h].textContent=a;return this},css:function(a,h,e){e=e!=o?e:this[0];if(this.length===0)return o;if(h==o&&typeof a==="string")return k.getComputedStyle(e),e.style[a]?e.style[a]:k.getComputedStyle(e)[a];for(e=0;e<this.length;e++)if(m.isObject(a))for(var b in a)this[e].style[b]=a[b];else this[e].style[a]=
h;return this},empty:function(){for(var a=0;a<this.length;a++)this[a].innerHTML="";return this},hide:function(){if(this.length===0)return this;for(var a=0;a<this.length;a++)if(this.css("display",null,this[a])!="none")this[a].setAttribute("jqmOldStyle",this.css("display",null,this[a])),this[a].style.display="none";return this},show:function(){if(this.length===0)return this;for(var a=0;a<this.length;a++)if(this.css("display",null,this[a])=="none")this[a].style.display=this[a].getAttribute("jqmOldStyle")?
this[a].getAttribute("jqmOldStyle"):"block",this[a].removeAttribute("jqmOldStyle");return this},toggle:function(a){for(var h=a===!0?!0:!1,e=0;e<this.length;e++)k.getComputedStyle(this[e]).display!=="none"||a!==o&&h===!1?(this[e].setAttribute("jqmOldStyle",this[e].style.display),this[e].style.display="none"):(this[e].style.display=this[e].getAttribute("jqmOldStyle")!=o?this[e].getAttribute("jqmOldStyle"):"block",this[e].removeAttribute("jqmOldStyle"));return this},val:function(a){if(this.length===
0)return o;if(a==o)return this[0].value;for(var h=0;h<this.length;h++)this[h].value=a;return this},attr:function(a,h){if(this.length===0)return o;if(h===o&&!m.isObject(a))return this[0].jqmCacheId&&w[this[0].jqmCacheId][a]?this[0].jqmCacheId&&w[this[0].jqmCacheId][a]:this[0].getAttribute(a);for(var e=0;e<this.length;e++)if(m.isObject(a))for(var b in a)m(this[e]).attr(b,a[b]);else if(m.isArray(h)||m.isObject(h)||m.isFunction(h)){if(!this[e].jqmCacheId)this[e].jqmCacheId=m.uuid();w[this[e].jqmCacheId]||
(w[this[e].jqmCacheId]={});w[this[e].jqmCacheId][a]=h}else h==null&&h!==o?(this[e].removeAttribute(a),this[e].jqmCacheId&&w[this[e].jqmCacheId][a]&&delete w[this[e].jqmCacheId][a]):this[e].setAttribute(a,h);return this},removeAttr:function(a){for(var h=this,e=0;e<this.length;e++)a.split(/\s+/g).forEach(function(b){h[e].removeAttribute(b);h[e].jqmCacheId&&w[h[e].jqmCacheId][a]&&delete w[h[e].jqmCacheId][a]});return this},remove:function(a){a=m(this).filter(a);if(a==o)return this;for(var h=0;h<a.length;h++)a[h].parentNode.removeChild(a[h]);
return this},addClass:function(a){for(var h=0;h<this.length;h++){var e=this[h].className,b=[],g=this;a.split(/\s+/g).forEach(function(a){g.hasClass(a,g[h])||b.push(a)});this[h].className+=(e?" ":"")+b.join(" ");this[h].className=this[h].className.trim()}return this},removeClass:function(a){for(var h=0;h<this.length;h++){if(a==o){this[h].className="";break}var e=this[h].className;a.split(/\s+/g).forEach(function(a){e=e.replace(i(a)," ")});this[h].className=e.length>0?e.trim():""}return this},hasClass:function(a,
h){if(this.length===0)return!1;h||(h=this[0]);return i(a).test(h.className)},append:function(a,h){if(a&&a.length!=o&&a.length===0)return this;if(m.isArray(a)||m.isObject(a))a=m(a);var e;for(e=0;e<this.length;e++)if(a.length&&typeof a!="string")for(var a=m(a),b=0;b<a.length;b++)h!=o?this[e].insertBefore(a[b],this[e].firstChild):this[e].appendChild(a[b]);else{b=v.test(a)?m(a):o;if(b==o||b.length==0)b=p.createTextNode(a);if(b.nodeName!=o&&b.nodeName.toLowerCase()=="script"&&(!b.type||b.type.toLowerCase()===
"text/javascript"))k.eval(b.innerHTML);else if(b instanceof x)for(var g=0;g<b.length;g++)h!=o?this[e].insertBefore(b[g],this[e].firstChild):this[e].appendChild(b[g]);else h!=o?this[e].insertBefore(b,this[e].firstChild):this[e].appendChild(b)}return this},prepend:function(a){return this.append(a,1)},insertBefore:function(a,b){if(this.length==0)return this;a=m(a).get(0);if(!a||a.length==0)return this;for(var e=0;e<this.length;e++)b?a.parentNode.insertBefore(this[e],a.nextSibling):a.parentNode.insertBefore(this[e],
a);return this},insertAfter:function(a){this.insertBefore(a,!0)},get:function(a){a=a==o?0:a;a<0&&(a+=this.length);return this[a]?this[a]:o},offset:function(){if(this.length===0)return o;var a=this[0].getBoundingClientRect();return{left:a.left+k.pageXOffset,top:a.top+k.pageYOffset,width:parseInt(this[0].style.width),height:parseInt(this[0].style.height)}},parent:function(a){if(this.length==0)return o;for(var b=[],e=0;e<this.length;e++)this[e].parentNode&&b.push(this[e].parentNode);return this.setupOld(m(d(b)).filter(a))},
children:function(a){if(this.length==0)return o;for(var b=[],e=0;e<this.length;e++)b=b.concat(l(this[e].firstChild));return this.setupOld(m(b).filter(a))},siblings:function(a){if(this.length==0)return o;for(var b=[],e=0;e<this.length;e++)this[e].parentNode&&(b=b.concat(l(this[e].parentNode.firstChild,this[e])));return this.setupOld(m(b).filter(a))},closest:function(a,b){if(this.length==0)return o;var e=this[0],g=m(a,b);if(g.length==0)return m();for(;e&&g.indexOf(e)==-1;)e=e!==b&&e!==p&&e.parentNode;
return m(e)},filter:function(a){if(this.length==0)return o;if(a==o)return this;for(var b=[],e=0;e<this.length;e++){var g=this[e];g.parentNode&&m(a,g.parentNode).indexOf(g)>=0&&b.push(g)}return this.setupOld(m(d(b)))},not:function(a){if(this.length==0)return o;for(var b=[],e=0;e<this.length;e++){var g=this[e];g.parentNode&&m(a,g.parentNode).indexOf(g)==-1&&b.push(g)}return this.setupOld(m(d(b)))},data:function(a,b){return this.attr("data-"+a,b)},end:function(){return this.oldElement!=o?this.oldElement:
m()},clone:function(a){a=a===!1?!1:!0;if(this.length==0)return o;for(var b=[],e=0;e<this.length;e++)b.push(this[e].cloneNode(a));return m(b)},size:function(){return this.length},serialize:function(a){if(this.length==0)return"";for(var b={},e=0;e<this.length;e++)this.slice.call(this[e].elements).forEach(function(a){var e=a.getAttribute("type");if(a.nodeName.toLowerCase()!="fieldset"&&!a.disabled&&e!="submit"&&e!="reset"&&e!="button"&&(e!="radio"&&e!="checkbox"||a.checked))b[a.getAttribute("name")]=
a.value});return m.param(b,a)}};var A={type:"GET",beforeSend:c,success:c,error:c,complete:c,context:o,timeout:0,crossDomain:!1};m.jsonP=function(a){var b="jsonp_callback"+ ++u,e="",g=p.createElement("script");k[b]=function(q){clearTimeout(e);m(g).remove();delete k[b];a.success.call(void 0,q)};g.src=a.url.replace(/=\?/,"="+b);if(a.error)g.onerror=function(){clearTimeout(e);a.error.call(void 0,"","error")};m("head").append(g);a.timeout>0&&(e=setTimeout(function(){a.error.call(void 0,"","timeout")},
a.timeout));return{}};m.ajax=function(a){var b;try{b=new k.XMLHttpRequest;var e=a||{},g;for(g in A)e[g]||(e[g]=A[g]);if(!e.url)e.url=k.location;if(!e.contentType)e.contentType="application/x-www-form-urlencoded";if(!e.headers)e.headers={};if(e.dataType)switch(e.dataType){case "script":e.dataType="text/javascript, application/javascript";break;case "json":e.dataType="application/json";break;case "xml":e.dataType="application/xml, text/xml";break;case "html":e.dataType="text/html";break;case "text":e.dataType=
"text/plain";break;default:e.dataType="text/html";break;case "jsonp":return m.jsonP(a)}else e.dataType="text/html";if(m.isObject(e.data))e.data=m.param(e.data);e.type.toLowerCase()==="get"&&e.data&&(e.url+=e.url.indexOf("?")===-1?"?"+e.data:"&"+e.data);if(/=\?/.test(e.url))return m.jsonP(e);if(!e.crossDomain)e.crossDomain=/^([\w-]+:)?\/\/([^\/]+)/.test(e.url)&&RegExp.$2!=k.location.host;if(!e.crossDomain)e.headers=m.extend({"X-Requested-With":"XMLHttpRequest"},e.headers);var q,f=e.context,n=/^([\w-]+:)\/\//.test(e.url)?
RegExp.$1:k.location.protocol;b.onreadystatechange=function(){var a=e.dataType;if(b.readyState===4){clearTimeout(q);var g,c=!1;if(b.status>=200&&b.status<300||b.status===0&&n=="file:"){if(a==="application/json"&&!/^\s*$/.test(b.responseText))try{g=JSON.parse(b.responseText)}catch(d){c=d}else g=b.responseText;b.status===0&&g.length===0&&(c=!0);c?e.error.call(f,b,"parsererror",c):e.success.call(f,g,"success",b)}else c=!0,e.error.call(f,b,"error");e.complete.call(f,b,c?"error":"success")}};b.open(e.type,
e.url,!0);if(e.contentType)e.headers["Content-Type"]=e.contentType;for(var d in e.headers)b.setRequestHeader(d,e.headers[d]);if(e.beforeSend.call(f,b,e)===!1)return b.abort(),!1;e.timeout>0&&(q=setTimeout(function(){b.onreadystatechange=c;b.abort();e.error.call(f,b,"timeout")},e.timeout));b.send(e.data)}catch(l){console.log(l)}return b};m.get=function(a,b){return this.ajax({url:a,success:b})};m.post=function(a,b,e,g){typeof b==="function"&&(e=b,b={});g===o&&(g="html");return this.ajax({url:a,type:"POST",
data:b,dataType:g,success:e})};m.getJSON=function(a,b,e){typeof b==="function"&&(e=b,b={});return this.ajax({url:a,data:b,success:e,dataType:"json"})};m.param=function(a,b){var e=[];if(a instanceof x)a.each(function(){e.push((b?b+"[]":this.id)+"="+encodeURIComponent(this.value))});else for(var g in a){var q=b?b+"["+g+"]":g,c=a[g];e.push(m.isObject(c)?m.param(c,q):q+"="+encodeURIComponent(c))}return e.join("&")};m.parseJSON=function(a){return JSON.parse(a)};m.parseXML=function(a){return(new DOMParser).parseFromString(a,
"text/xml")};n(m,navigator.userAgent);m.__detectUA=n;if(typeof String.prototype.trim!=="function")String.prototype.trim=function(){this.replace(/(\r\n|\n|\r)/gm,"").replace(/^\s+|\s+$/,"");return this};m.uuid=function(){var a=function(){return((1+Math.random())*65536|0).toString(16).substring(1)};return a()+a()+"-"+a()+"-"+a()+"-"+a()+"-"+a()+a()+a()};var z={},B=1,G={};m.event={add:g,remove:q};m.fn.bind=function(a,b){for(var e=0;e<this.length;e++)g(this[e],a,b);return this};m.fn.unbind=function(a,
b){for(var e=0;e<this.length;e++)q(this[e],a,b);return this};m.fn.one=function(a,b){return this.each(function(e,c){g(this,a,b,null,function(a,b){return function(){var e=a.apply(c,arguments);q(c,b,a);return e}})})};var E=function(){return!0},F=function(){return!1},D={preventDefault:"isDefaultPrevented",stopImmediatePropagation:"isImmediatePropagationStopped",stopPropagation:"isPropagationStopped"};m.fn.delegate=function(a,b,e){for(var c=0;c<this.length;c++){var q=this[c];g(q,b,e,a,function(b){return function(e){var g,
c=m(e.target).closest(a,q).get(0);if(c)return g=m.extend(C(e),{currentTarget:c,liveFired:q}),b.apply(c,[g].concat([].slice.call(arguments,1)))}})}return this};m.fn.undelegate=function(a,b,e){for(var g=0;g<this.length;g++)q(this[g],b,e,a);return this};m.fn.on=function(a,b,e){return b===o||m.isFunction(b)?this.bind(a,b):this.delegate(b,a,e)};m.fn.off=function(a,b,e){return b===o||m.isFunction(b)?this.unbind(a,b):this.undelegate(b,a,e)};m.fn.trigger=function(a,b){typeof a=="string"&&(a=m.Event(a));a.data=
b;for(var e=0;e<this.length;e++)this[e].dispatchEvent(a);return this};m.Event=function(a,b){var e=p.createEvent(G[a]||"Events"),g=!0;if(b)for(var c in b)c=="bubbles"?g=!!b[c]:e[c]=b[c];e.initEvent(a,g,!0,null,null,null,null,null,null,null,null,null,null,null,null);return e};m.proxy=function(a,b){return function(e){return a.call(b,e)}};return m}(window);"$"in window||(window.$=jq);if(!window.numOnly)window.numOnly=function(k){isNaN(parseFloat(k))&&(k=k.replace(/[^0-9.-]/,""));return parseFloat(k)}};(function(k){k.fn.css3Animate=function(d){for(var l,c=0;c<this.length;c++)l=new i(this[c],d);return this.length==1?l:this};k.css3AnimateQueue=function(){return new i.queue};var i=function(){if(window.WebKitCSSMatrix){var d="m11"in new WebKitCSSMatrix?"3d(":"(",l="m11"in new WebKitCSSMatrix?",0)":")",c=function(n,f){this.el=typeof n=="string"||n instanceof String?document.getElementById(n):n;if(!(this instanceof c))return new c(n,f);if(this.el){var a=this;if(f){this.el.addEventListener("webkitTransitionEnd",
a.finishAnimation,!1);f.callback?(this.callback=f.callback,this.moving=!0,this.timeout=window.setTimeout(function(){if(a.moving==!0&&a.callback&&typeof(a.callback=="function"))a.moving=!1,a.callback(),delete this.callback},numOnly(f.time)+50)):this.moving=!1;f.y||(f.y=0);f.x||(f.x=0);f.previous&&(f.y+=numOnly((new WebKitCSSMatrix(window.getComputedStyle(this.el).webkitTransform)).f),f.x+=numOnly((new WebKitCSSMatrix(window.getComputedStyle(this.el).webkitTransform)).e));if(!f.origin)f.origin="0% 0%";
if(!f.scale)f.scale="1";if(!f.rotateY)f.rotateY="0";if(!f.rotateX)f.rotateX="0";if(!f.skewY)f.skewY="0";if(!f.skewX)f.skewX="0";f.timingFunction||(f.timingFunction="linear");f.time=(""+f.time).indexOf("s")==-1?f.time+"ms":f.time;if(typeof f.x=="number"||f.x.indexOf("%")==-1&&f.x.toLowerCase().indexOf("px")==-1&&f.x.toLowerCase().indexOf("deg")==-1)f.x=parseInt(f.x)+"px";if(typeof f.y=="number"||f.y.indexOf("%")==-1&&f.y.toLowerCase().indexOf("px")==-1&&f.y.toLowerCase().indexOf("deg")==-1)f.y=parseInt(f.y)+
"px";this.el.style.webkitTransform="translate"+d+f.x+","+f.y+l+" scale("+parseFloat(f.scale)+") rotate("+f.rotateX+") rotateY("+f.rotateY+") skew("+f.skewX+","+f.skewY+")";this.el.style.webkitBackfaceVisiblity="hidden";this.el.style.webkitTransition="all "+f.time+" "+f.timingFunction;this.el.style.webkitTransformOrigin=f.origin;if(f.width)this.el.style.width=f.width;if(f.height)this.el.style.height=f.height;if(f.opacity!==void 0)this.el.style.opacity=f.opacity}else alert("Please provide configuration options for animation of "+
n)}};c.prototype={finishAnimation:function(c){c.preventDefault();if(this.moving)this.moving=!1,this.el.removeEventListener("webkitTransitionEnd",this.finishAnimation,!0),this.callback&&typeof(this.callback=="function")&&(this.timeout&&window.clearTimeout(this.timeout),this.callback(),delete this.callback)}};return c}}();i.queue=function(){return{elements:[],push:function(d){this.elements.push(d)},pop:function(){return this.elements.pop()},run:function(){var d=this;if(this.elements.length!=0&&(typeof this.elements[0]==
"function"&&this.shift()(),this.elements.length!=0)){var l=this.shift();if(this.elements.length>0)l.callback=function(){d.run()};i(l.id,l)}},shift:function(){return this.elements.shift()}}}})(jq);(function(k){var i=[];k.fn.scroller=function(l){var c;if(l===void 0&&this.length>0)return i[this[0].id]?i[this[0].id]:null;for(var n=0;n<this.length;n++)c=new d(this[n],l),this[n].id&&(i[this[n].id]=c);return this.length==1?c:this};var d=function(){function d(a,b){var g=document.createElement("div");g.style.position="absolute";g.style.width=a+"px";g.style.height=b+"px";g.style.webkitBorderRadius="2px";g.style.opacity=0;g.className="scrollBar";g.style.background="black";return g}if(window.WebKitCSSMatrix){var c=
"m11"in new WebKitCSSMatrix?"3d(":"(",n="m11"in new WebKitCSSMatrix?",0)":")",f=function(a,b){if(this.el=typeof a=="string"||a instanceof String?document.getElementById(a):a){if(this instanceof f)for(j in b)this[j]=b[j];else return new f(a,b);try{this.container=this.el.parentNode;this.initEvents();if(this.verticalScroll&&this.verticalScroll==!0&&this.scrollBars==!0){var g=d(5,20);g.style.top="0px";if(this.vScrollCSS)g.className=this.vScrollCSS;g.style.opacity="0";this.container.appendChild(g);this.vscrollBar=
g;g=null}if(this.horizontalScroll&&this.horizontalScroll==!0&&this.scrollBars==!0){g=d(20,5);g.style.bottom="0px";if(this.hScrollCSS)g.className=this.hScrollCSS;g.style.opacity="0";this.container.appendChild(g);this.hscrollBar=g}this.horizontalScroll&&(this.el.style["float"]="left");this.el.hasScroller=!0}catch(c){alert("error adding scroller"+c)}}else alert("Could not find element for scroller "+a)};f.prototype={lockX:0,lockY:0,boolScrollLock:!1,currentScrollingObject:null,bottomMargin:0,maxTop:0,
startTop:0,verticalScroll:!0,horizontalScroll:!1,scrollBars:!0,vscrollBar:null,hscrollBar:null,hScrollCSS:"scrollBar",vScrollCSS:"scrollBar",divHeight:0,lastScrollbar:"",timeMoved:0,vdistanceMoved:0,hdistanceMoved:0,prevTime:0,finishScrollingObject:null,container:null,maxLeft:0,startLeft:0,rightMargin:0,divWidth:0,refresh:!1,refreshFunction:null,listeners:{start:"",move:"",end:""},elementScrolling:!1,scrollingFinishCB:!1,handleEvent:function(a){switch(a.type){case "touchstart":this.touchStart(a);
break;case "touchmove":this.touchMove(a);break;case "touchend":this.touchEnd(a)}},initEvents:function(){this.el.addEventListener("touchstart",this,!1);this.el.addEventListener("touchmove",this,!1);this.el.addEventListener("touchend",this,!1)},removeEvents:function(){this.el.removeEventListener("touchstart",this);this.el.removeEventListener("touchmove",this);this.el.removeEventListener("touchend",this)},hideScrollbars:function(){if(this.hscrollBar)this.hscrollBar.style.opacity=0,this.hscrollBar.style.webkitTransitionDuration=
"0ms";if(this.vscrollBar)this.vscrollBar.style.opacity=0,this.vscrollBar.style.webkitTransitionDuration="0ms"},touchStart:function(a){var b=this.container,g=this.el;that=this;if(b){this.elementScrolling&&clearTimeout(that.scrollingFinishCB);try{if(a.touches[0].target&&a.touches[0].target.type!=void 0){var c=a.touches[0].target.tagName.toLowerCase();if(c=="select"||c=="input"||c=="button")return}if(this.refresh&&this.refresh==!0&&document.getElementById(this.el.id+"_pulldown")==null){var f=jq("<div id='"+
this.el.id+"_pulldown' class='jqscroll_refresh' style='border-radius:.6em;border: 1px solid #2A2A2A;background-image: -webkit-gradient(linear,left top,left bottom,color-stop(0,#666666),color-stop(1,#222222));background:#222222;margin:0px;height:60px;top:0px;margin-left:5px;margin-right:5px;position:absolute;-webkit-transform: translate3d(0, -65px, 0);top:0,left:0,right:0;text-align:center;line-height:60px;color:white;'>Pull to Refresh</div>").get();f.style.width=this.container.clientWidth+"px";k(this.el).prepend(f)}this.hdistanceMoved=
this.vdistanceMoved=this.timeMoved=0;this.finishScrollingObject=this.prevTime=null;var d=k(b);this.bottomMargin=b.clientHeight>window.innerHeight?window.innerHeight:b.clientHeight-numOnly(d.css("marginTop"))-numOnly(d.css("paddingTop"))-numOnly(d.css("marginBottom"))-numOnly(d.css("paddingBottom"));this.maxTop=g.clientHeight-this.bottomMargin;this.divHeight=g.clientHeight;this.rightMargin=b.clientWidth>window.innerWidth?window.innerWidth:b.clientWidth-numOnly(d.css("marginLeft"))-numOnly(d.css("paddingLeft"))-
numOnly(d.css("marginRight"))-numOnly(d.css("paddingRight"));this.maxLeft=g.clientWidth-this.rightMargin;this.divWidth=g.clientWidth;if(!(this.maxTop<0&&this.maxLeft<0)&&(this.lockX=a.touches[0].pageX,this.lockY=a.touches[0].pageY,a.touches.length==1&&this.boolScrollLock==!1)){try{this.startTop=numOnly((new WebKitCSSMatrix(window.getComputedStyle(g).webkitTransform)).f)-numOnly(this.container.scrollTop),this.startLeft=numOnly((new WebKitCSSMatrix(window.getComputedStyle(g).webkitTransform)).e)-numOnly(this.container.scrollLeft)}catch(n){this.startTop=
0+this.container.scrollTop,this.startLeft=0+this.container.scrollLeft,console.log("error scroller touchstart "+n)}this.container.scrollTop=this.container.scrollLeft=0;this.currentScrollingObject=g;this.scrollerMoveCSS(g,{x:this.startLeft,y:this.startTop},0);if(this.vscrollBar&&this.maxTop>0){this.vscrollBar.style.height=parseFloat(this.bottomMargin/this.divHeight)*this.bottomMargin+"px";var l=this.bottomMargin-numOnly(this.vscrollBar.style.height)-(this.maxTop+this.startTop)/this.maxTop*(this.bottomMargin-
numOnly(this.vscrollBar.style.height));this.scrollerMoveCSS(this.vscrollBar,{x:0,y:l},0);this.container.clientWidth>window.innerWidth?this.vscrollBar.style.left=window.innerWidth-numOnly(this.vscrollBar.style.width)*3+"px":this.vscrollBar.style.right="0px";this.vscrollBar.webkitTransition="";this.vscrollBar.style.opacity=1}if(this.hscrollBar&&this.maxLeft>0)this.hscrollBar.style.width=parseFloat(this.rightMargin/this.divWidth)*this.rightMargin+"px",l=this.rightMargin-numOnly(this.hscrollBar.style.width)-
(this.maxTop+this.startLeft)/this.maxtLeft*(this.rightMargin-numOnly(this.hscrollBar.style.width)),this.scrollerMoveCSS(this.hscrollBar,{x:l,y:0},0),this.container.clientHeight>window.innerHeight?this.hscrollBar.style.top=window.innerHeight-numOnly(this.hscrollBar.style.height)+"px":this.hscrollBar.style.bottom=numOnly(this.hscrollBar.style.height),this.vscrollBar.webkitTransition="",this.hscrollBar.style.opacity=1}}catch(i){alert("error in scrollStart: "+i)}}},touchMove:function(a){try{if(this.currentScrollingObject!=
null){a.preventDefault();var b={x:0,y:0},g=0,c=0,f=0,d=0;if(this.verticalScroll&&this.maxTop>0){var n=this.lockY-a.touches[0].pageY,n=-n,g=this.startTop+n;try{c=numOnly((new WebKitCSSMatrix(window.getComputedStyle(this.el).webkitTransform)).f)}catch(l){c=0}b.y=g}if(this.horizontalScroll&&this.maxLeft>0){var i=this.lockX-a.touches[0].pageX,i=-i,n=f=this.startLeft+i;try{d=-numOnly((new WebKitCSSMatrix(window.getComputedStyle(this.el).webkitTransform)).e)}catch(k){d=0}b.x=n}if(this.maxTop>0&&(b.y>0||
b.y<-1*this.maxTop)){var u=(this.container.clientHeight-(b.y>0?b.y:-1*(b.y+this.maxTop)))/this.container.clientHeight;u<0.5&&(u=0.5);b.y>0?b.y*=u:b.y-=(b.y+this.maxTop)*u}this.scrollerMoveCSS(this.currentScrollingObject,b,0);if(this.vscrollBar){var v=this.bottomMargin-numOnly(this.vscrollBar.style.height)-(this.maxTop+g)/this.maxTop*(this.bottomMargin-numOnly(this.vscrollBar.style.height));this.scrollerMoveCSS(this.vscrollBar,{x:0,y:v},0)}this.hscrollBar&&(v=this.rightMargin-numOnly(this.hscrollBar.style.width)-
(this.maxLeft+f)/this.maxLeft*(this.rightMargin-numOnly(this.hscrollBar.style.width)),this.scrollerMoveCSS(this.hscrollBar,{x:v,y:0},0));if(this.prevTime){var w=Math.abs(c)-Math.abs(g),x=Math.abs(d)-Math.abs(f),m=a.timeStamp-this.prevTime;m<500?(this.timeMoved+=m,this.vdistanceMoved+=w,this.hdistanceMoved+=x):this.hdistanceMoved=this.vdistanceMoved=this.timeMoved=0}this.prevTime=a.timeStamp}}catch(A){alert("error in scrollMove: "+A)}},touchEnd:function(a){if(this.currentScrollingObject!=null){a.preventDefault();
this.finishScrollingObject=this.currentScrollingObject;this.currentScrollingObject=null;var a={x:0,y:0},b=300,g;if(this.verticalScroll&&this.maxTop>0){var c=-this.vdistanceMoved,b=this.timeMoved,f=numOnly((new WebKitCSSMatrix(window.getComputedStyle(this.el).webkitTransform)).f);g=f;c=this.calculateMomentum(c,b);b=c.time;f<0&&(f-=c.dist);f>0&&(f=0,b=200);f<-this.maxTop&&(f=-this.maxTop,b=200);a.y=f}if(this.horizontalScroll&&this.maxLeft>0)c=-this.hdistanceMoved,b=this.timeMoved,f=(new WebKitCSSMatrix(window.getComputedStyle(this.el).webkitTransform)).e,
c=this.calculateMomentum(c,b),b=c.time,f<0&&(f-=c.dist),f>0&&(f=0,b=200),f<-this.maxLeft&&(f=-this.maxLeft,b=200),a.x=f;var d=this;this.refresh&&g>60&&this.refreshFunction&&this.refreshFunction.call();b<300&&(b=300);this.scrollerMoveCSS(this.finishScrollingObject,a,b,"cubic-bezier(0.33,0.66,0.66,1)");if(this.vscrollBar){g=this.bottomMargin-numOnly(this.vscrollBar.style.height)-(this.maxTop+a.y)/this.maxTop*(this.bottomMargin-numOnly(this.vscrollBar.style.height));if(g>this.bottomMargin)g=this.bottomMargin;
g<0&&(g=0);this.scrollerMoveCSS(this.vscrollBar,{x:0,y:g},b,"cubic-bezier(0.33,0.66,0.66,1)")}if(this.hscrollBar){g=this.rightMargin-numOnly(this.hscrollBar.style.width)-(this.maxLeft+a.x)/this.maxLeft*(this.rightMargin-numOnly(this.hscrollBar.style.width));if(g>this.rightMargin)g=this.rightMargin;g<0&&(g=0);this.scrollerMoveCSS(this.hscrollBar,{x:g,y:0},b,"cubic-bezier(0.33,0.66,0.66,1)")}isNaN(b)?(d.hideScrollbars(),d.elementScrolling=!1):this.scrollingFinishCB=setTimeout(function(){d.hideScrollbars();
d.elementScrolling=!1},b);this.elementScrolling=!0}this.vdistanceMoved=this.hdistanceMoved=0},scrollerMoveCSS:function(a,b,g,f){g||(g=0);f||(f="linear");a.style.webkitTransform="translate"+c+b.x+"px,"+b.y+"px"+n;a.style.webkitTransitionDuration=g+"ms";a.style.webkitBackfaceVisiblity="hidden";a.style.webkitTransitionTimingFunction=f},scrollTo:function(a,b){b||(b=0);this.scrollerMoveCSS(this.el,a,b);if(this.vscrollBar){a=this.bottomMargin-numOnly(this.vscrollBar.style.height)-(this.maxTop+a.y)/this.maxTop*
(this.bottomMargin-numOnly(this.vscrollBar.style.height));if(a>this.bottomMargin)a=this.bottomMargin;a<0&&(a=0);this.scrollerMoveCSS(this.vscrollBar,{x:0,y:a},b,"ease-out");this.vscrollBar.style.opacity="0"}if(this.hscrollBar){a=this.rightMargin-numOnly(this.hscrollBar.style.width)-(this.maxLeft+a.x)/this.maxLeft*(this.rightMargin-numOnly(this.hscrollBar.style.width));if(a>this.rightMargin)a=this.rightMargin;a<0&&(a=0);this.scrollerMoveCSS(this.hscrollBar,{x:a,y:0},b,"ease-out");this.hscrollBar.style.opacity=
"0"}},scrollBy:function(a,b){this.startTop=numOnly((new WebKitCSSMatrix(window.getComputedStyle(this.el).webkitTransform)).f)-numOnly(this.container.scrollTop);this.startLeft=numOnly((new WebKitCSSMatrix(window.getComputedStyle(this.el).webkitTransform)).e)-numOnly(this.container.scrollLeft);this.scrollTo({y:this.startTop-a.y,x:this.startLeft-a.x},b)},calculateMomentum:function(a,b){var g=Math.abs(a)/b,c=g*g/0.0024,f=0;c*=a<0?-1:1;return{dist:c,time:g/0.0012}}};return f}}()})(jq);(function(k){k.passwordBox=function(){return new i};var i=function(){this.oldPasswords={}};i.prototype={showPasswordPlainText:!1,getOldPasswords:function(d){var l=d&&document.getElementById(d)?document.getElementById(d):document;if(l){d=l.getElementsByTagName("input");for(l=0;l<d.length;l++)if(d[l].type=="password")d[l].type="text",d[l].style["-webkit-text-security"]="disc"}else alert("Could not find container element for passwordBox "+d)},changePasswordVisiblity:function(d,l){d=parseInt(d);document.getElementById(l).style["-webkit-text-security"]=
d==1?"none":"disc"}}})(jq);(function(k){k.selectBox={oldSelects:{},scroller:null,getOldSelects:function(i){if(k.os.android!=!1)if(k.fn.scroller){var d=i&&document.getElementById(i)?document.getElementById(i):document;if(d){for(var i=d.getElementsByTagName("select"),l=this,d=0;d<i.length;d++)this.oldSelects[i[d].id]||function(c){var d=document.createElement("div"),f=parseInt(c.style.width)>0?parseInt(c.style.width):100,a=parseInt(c.style.height)>0?parseInt(c.style.height):20;d.style.width=f+"px";d.style.height=a+"px";d.style.position=
"absolute";d.style.left="0px";d.style.top="0px";d.style.zIndex="1";if(c.value)d.innerHTML=c.options[c.selectedIndex].text;d.style.background="url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABEAAAAeCAIAAABFWWJ4AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyBpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuMC1jMDYwIDYxLjEzNDc3NywgMjAxMC8wMi8xMi0xNzozMjowMCAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENTNSBXaW5kb3dzIiB4bXBNTTpJbnN0YW5jZUlEPSJ4bXAuaWlkOkM1NjQxRUQxNUFEODExRTA5OUE3QjE3NjI3MzczNDAzIiB4bXBNTTpEb2N1bWVudElEPSJ4bXAuZGlkOkM1NjQxRUQyNUFEODExRTA5OUE3QjE3NjI3MzczNDAzIj4gPHhtcE1NOkRlcml2ZWRGcm9tIHN0UmVmOmluc3RhbmNlSUQ9InhtcC5paWQ6QzU2NDFFQ0Y1QUQ4MTFFMDk5QTdCMTc2MjczNzM0MDMiIHN0UmVmOmRvY3VtZW50SUQ9InhtcC5kaWQ6QzU2NDFFRDA1QUQ4MTFFMDk5QTdCMTc2MjczNzM0MDMiLz4gPC9yZGY6RGVzY3JpcHRpb24+IDwvcmRmOlJERj4gPC94OnhtcG1ldGE+IDw/eHBhY2tldCBlbmQ9InIiPz6YWbdCAAAAlklEQVR42mIsKChgIBGwAHFPTw/xGkpKSlggrG/fvhGjgYuLC0gyMZAOoPb8//9/0Or59+8f8XrICQN66SEnDOgcp3AgKiqKqej169dY9Hz69AnCuHv3rrKyMrIKoAhcVlBQELt/gIqwstHD4B8quH37NlAQSKKJEwg3iLbBED8kpeshoGcwh5uuri5peoBFMEluAwgwAK+5aXfuRb4gAAAAAElFTkSuQmCC') right top no-repeat";
d.style.backgroundColor="white";d.className="jqmobiSelect_fakeInput "+c.className;d.id=c.id+"_jqmobiSelect";d.style.border="1px solid gray";d.style.color="black";d.linkId=c.id;d.onclick=function(){l.initDropDown(this.linkId)};c.parentNode.appendChild(d);c.parentNode.style.position="relative";c.style.display="none";c.style.webkitAppearance="none";for(f=0;f<c.options.length;f++){if(c.options[f].selected)d.value=c.options[f].text;c.options[f].watch("selected",function(a,g,c){if(c==!0)l.updateMaskValue(this.parentNode.id,
this.text,this.value),this.parentNode.value=this.value;return c})}c.watch("selectedIndex",function(a,g,c){if(this.options[c])l.updateMaskValue(this.id,this.options[c].text,this.options[c].value),this.value=this.options[c].value;return c});imageMask=d=null;l.oldSelects[c.id]=1}(i[d]);l.createHtml()}else alert("Could not find container element for jq.web.selectBox "+i)}else alert("This library requires jq.web.Scroller")},updateDropdown:function(i){if(i=document.getElementById(i)){for(var d=0;d<i.options.length;d++){if(i.options[d].selected)fakeInput.value=
i.options[d].text;i.options[d].watch("selected",function(d,c,n){if(n==!0)that.updateMaskValue(this.parentNode.id,this.text,this.value),this.parentNode.value=this.value;return n})}i=null}},initDropDown:function(i){var d=this,l=document.getElementById(i);if(!l.disabled&&l&&l.options&&l.options.length!=0){var c=0;document.getElementById("jqmobiSelectBoxScroll").innerHTML="";document.getElementById("jqmobiSelectBoxHeaderTitle").innerHTML=l.name!=void 0&&l.name!="undefined"&&l.name!=""?l.name:i;for(var n=
0;n<l.options.length;n++){l.options[n].watch("selected",function(a,b,g){if(g==!0)d.updateMaskValue(this.parentNode.id,this.text,this.value),this.parentNode.value=this.value;return g});var f=l.value==l.options[n].value?!0:!1,a="",b=document.createElement("div");b.className="jqmobiSelectRow";f?(a="checked",c=n,f="id='jqmobiSelectBox_found'",b.className="jqmobiSelectRowFound"):f="";b.id=f;b.style.cssText=";line-height:40px;font-size:14px;padding-left:10px;height:40px;width:100%;position:relative;width:100%;border-bottom:1px solid black;background:white;";
var g=document.createElement("a");g.href="javascript:;";b.tmpValue=n;b.onclick=function(){d.setDropDownValue(i,this.tmpValue)};g.style.cssText="text-decoration:none;color:black;";g.innerHTML=l.options[n].text;var q=document.createElement("span");q.style.cssText="float:right;margin-right:20px;margin-top:-2px";var k=document.createElement("button");f?(k.style.cssText="background: #000;padding: 0px 0px;border-radius:15px;border:3px solid black;",k.className="jqmobiSelectRowButtonFound"):(k.style.cssText=
"background: #ffffff;padding: 0px 0px;border-radius:15px;border:3px solid black;",k.className="jqmobiSelectRowButton");k.style.width="20px";k.style.height="20px";k.checked=a;g.className="jqmobiSelectRowText";q.appendChild(k);b.appendChild(g);b.appendChild(q);document.getElementById("jqmobiSelectBoxScroll").appendChild(b);g=k=q=null}try{document.getElementById("jqmobiSelectModal").style.display="block"}catch(o){console.log("Error showing div "+o)}try{if(b){var p=numOnly(b.style.height),r=numOnly(document.getElementById("jqmobiSelectBoxHeader").style.height);
this.scroller.scrollTo({x:0,y:c*p+r>=numOnly(document.getElementById("jqmobiSelectBoxFix").clientHeight)-r?c*-p+r:0})}}catch(s){console.log("error init dropdown"+s)}l=b=null}},updateMaskValue:function(i,d,l){var c=document.getElementById(i+"_jqmobiSelect"),i=document.getElementById(i);if(c)c.innerHTML=d;if(typeof i.onchange=="function")i.onchange(l)},setDropDownValue:function(i,d){var l=document.getElementById(i);if(l)l.selectedIndex=d;this.scroller.scrollTo({x:0,y:0});this.hideDropDown()},hideDropDown:function(){document.getElementById("jqmobiSelectModal").style.display=
"none";document.getElementById("jqmobiSelectBoxScroll").innerHTML=""},createHtml:function(){var i=this;if(!document.getElementById("jqmobiSelectBoxContainer")){var d=document.createElement("div");d.style.cssText="position:absolute;top:0px;bottom:0px;left:0px;right:0px;background:rgba(0,0,0,.7);z-index:200000;display:none;";d.id="jqmobiSelectModal";var l=document.createElement("div");l.id="jqmobiSelectBoxContainer";l.style.cssText="position:absolute;top:8%;bottom:10%;display:block;width:90%;margin:auto;margin-left:5%;height:90%px;background:white;color:black;border:1px solid black;border-radius:6px;";
l.innerHTML="<div id='jqmobiSelectBoxHeader' style=\"display:block;font-family:'Eurostile-Bold', Eurostile, Helvetica, Arial, sans-serif;color:#fff;font-weight:bold;font-size:18px;line-height:34px;height:34px; text-transform:uppercase;text-align:left;text-shadow:rgba(0,0,0,.9) 0px -1px 1px; padding: 0px 8px 0px 8px; border-top-left-radius:5px; border-top-right-radius:5px; -webkit-border-top-left-radius:5px; -webkit-border-top-right-radius:5px; background:#39424b; margin:1px;\"><div style='float:left;' id='jqmobiSelectBoxHeaderTitle'></div><div style='float:right;width:60px;margin-top:-5px'><div id='jqmobiSelectClose' class='button' style='width:60px;height:32px;line-height:32px;'>Close</div></div></div>";
l.innerHTML+='<div id="jqmobiSelectBoxFix" style="position:relative;height:90%;background:white;overflow:hidden;width:100%;"><div id="jqmobiSelectBoxScroll"></div></div>';i=this;d.appendChild(l);k(document).ready(function(){jq("#jQUi")?jq("#jQUi").append(d):document.body.appendChild(d);k("#jqmobiSelectClose").get().onclick=function(){i.hideDropDown()};var c=k("<style>.jqselectscrollBarV{opacity:1 !important;}</style>").get();document.body.appendChild(c);try{i.scroller=k("#jqmobiSelectBoxScroll").scroller({scroller:!1,
verticalScroll:!0,vScrollCSS:"jqselectscrollBarV"})}catch(n){console.log("Error creating select html "+n)}c=l=d=null})}}};if(!HTMLElement.prototype.watch)HTMLElement.prototype.watch=function(i,d){var l=this[i],c=l,n=function(){return c},f=function(a){l=c;return c=d.call(this,i,l,a)};delete this[i]&&(HTMLElement.defineProperty?HTMLElement.defineProperty(this,i,{get:n,set:f,enumerable:!1,configurable:!0}):HTMLElement.prototype.__defineGetter__&&HTMLElement.prototype.__defineSetter__&&(HTMLElement.prototype.__defineGetter__.call(this,
i,n),HTMLElement.prototype.__defineSetter__.call(this,i,f)))};if(!HTMLElement.prototype.unwatch)HTMLElement.prototype.unwatch=function(i){var d=this[i];delete this[i];this[i]=d}})(jq);(function(k){k.fn.actionsheet=function(d){for(var l,c=0;c<this.length;c++)l=new i(this[c],d);return this.length==1?l:this};var i=function(){if(window.WebKitCSSMatrix){var d=function(i,c){if(this.el=typeof i=="string"||i instanceof String?document.getElementById(i):i){if(this instanceof d){if(typeof c=="object")for(j in c)this[j]=c[j]}else return new d(i,c);try{var n=this,f;if(typeof c=="string")f=k('<div id="jq_actionsheet"><div style="width:100%">'+c+"<a href='javascript:;' class='cancel'>Cancel</a></div></div>");
else if(typeof c=="object"){f=k('<div id="jq_actionsheet"><div style="width:100%"></div></div>');var a=k(f.children().get());c.push({text:"Cancel",cssClasses:"cancel"});for(var b=0;b<c.length;b++){var g=k('<a href="javascript:;" >'+(c[b].text||"TEXT NOT ENTERED")+"</a>");g[0].onclick=c[b].handler||function(){};c[b].cssClasses&&c[b].cssClasses.length>0&&g.addClass(c[b].cssClasses);a.append(g)}}k(i).find("#jq_actionsheet").remove();actionsheetEl=k(i).append(f);f.get().style.webkitTransition="all 0ms";
f.css("bottom",-(parseInt(f.css("height"))+10)+"px");this.el.style.overflow="hidden";f.on("click","a",function(){n.hideSheet()});this.activeSheet=f;setTimeout(function(){f.get().style.webkitTransition="all 200ms";f.css("bottom","0px")},10)}catch(q){alert("error adding actionsheet"+q)}}else alert("Could not find element for actionsheet "+i)};d.prototype={activeSheet:null,hideSheet:function(){var d=this;this.activeSheet.off("click","a",function(){d.hideSheet()});this.activeSheet.remove();this.activeSheet=
null;this.el.style.overflow="none"}};return d}}()})(jq);(function(k){k.fn.popup=function(c){return new d(this[0],c)};var i=[],d=function(){var c=function(c,d){if(this.container=typeof c==="string"||c instanceof String?document.getElementById(c):c)try{if(typeof d==="string"||typeof d==="number")d={message:d,cancelOnly:"true",cancelText:"OK"};this.id=id=d.id=d.id||k.uuid();this.title=d.suppressTitle?"":d.title||"Alert";this.message=d.message||"";this.cancelText=d.cancelText||"Cancel";this.cancelCallback=d.cancelCallback||function(){};this.cancelClass=d.cancelClass||
"button";this.doneText=d.doneText||"Done";this.doneCallback=d.doneCallback||function(a){a.hide()};this.doneClass=d.doneClass||"button";this.cancelOnly=d.cancelOnly||!1;this.onShow=d.onShow||function(){};this.autoCloseDone=d.autoCloseDone!==void 0?d.autoCloseDone:!0;i.push(this);i.length==1&&this.show()}catch(a){console.log("error adding popup "+a)}else alert("Error finding container for popup "+c)};c.prototype={id:null,title:null,message:null,cancelText:null,cancelCallback:null,cancelClass:null,doneText:null,
doneCallback:null,doneClass:null,cancelOnly:!1,onShow:null,autoCloseDone:!0,supressTitle:!1,show:function(){var c=this,d='<div id="'+this.id+'" class="jqPopup hidden">\t \t\t\t\t<header>'+this.title+'</header>\t \t\t\t\t<div><div style="width:1px;height:1px;-webkit-transform:translate3d(0,0,0);float:right"></div>'+this.message+'</div>\t \t\t\t\t<footer>\t \t\t\t\t\t<a href="javascript:;" class="'+this.cancelClass+'" id="cancel">'+this.cancelText+'</a>\t \t\t\t\t\t<a href="javascript:;" class="'+
this.doneClass+'" id="action">'+this.doneText+"</a>\t \t\t\t\t</footer>\t \t\t\t</div></div>";k(this.container).append(k(d));k("#"+this.id).bind("close",function(){c.hide()});this.cancelOnly&&(k("#"+this.id).find("A#action").hide(),k("#"+this.id).find("A#cancel").addClass("center"));k("#"+this.id).find("A").each(function(){var a=k(this);a.bind("click",function(b){a.attr("id")=="cancel"?(c.cancelCallback.call(c.cancelCallback,c),c.hide()):(c.doneCallback.call(c.doneCallback,c),c.autoCloseDone&&
c.hide());b.preventDefault()})});c.positionPopup();k.blockUI(0.5);k("#"+c.id).removeClass("hidden");k("#"+c.id).bind("orientationchange",function(){c.positionPopup()});this.onShow(this)},hide:function(){var c=this;k("#"+c.id).addClass("hidden");k.unblockUI();setTimeout(function(){c.remove()},250)},remove:function(){k("#"+this.id+" BUTTON#action").unbind("click");k("#"+this.id+" BUTTON#cancel").unbind("click");k("#"+this.id).unbind("orientationchange").remove();i.splice(0,1);i.length>0&&i[0].show()},
positionPopup:function(){var c=k("#"+this.id);c.css("top",window.innerHeight/2.5+window.pageYOffset-c[0].clientHeight/2+"px");c.css("left",window.innerWidth/2-c[0].clientWidth/2+"px")}};return c}(),l=!1;k.blockUI=function(c){l||(c=c?" style='opacity:"+c+";'":"",k("BODY").prepend(k("<div id='mask'"+c+"></div>")),k("BODY DIV#mask").bind("touchstart",function(c){c.preventDefault()}),k("BODY DIV#mask").bind("touchmove",function(c){c.preventDefault()}),l=!0)};k.unblockUI=function(){l=!1;k("BODY DIV#mask").unbind("touchstart");
k("BODY DIV#mask").unbind("touchmove");k("BODY DIV#mask").remove()};window.alert=function(c){k(document.body).popup(c.toString())};window.confirm=function(){throw"Due to iOS eating touch events from native confirms, please use our popup plugin instead";}})(jq);(function(k){function i(a){a=a.indexOf("#")==-1?"#"+a:a;return jq(a).get(0)}var d=window.location.pathname,l=window.location.hash,c=l,n=function(){var a=this;window.AppMobi?document.addEventListener("appMobi.device.ready",function(){a.hasLaunched=!0;a.autoLaunch&&a.launch()},!1):document.readyState=="complete"||document.readyState=="loaded"?(a.hasLaunched=!0,a.autoLaunch&&a.launch()):document.addEventListener("DOMContentLoaded",function(){a.hasLaunched=!0;a.autoLaunch&&a.launch()},!1);if(!window.AppMobi)AppMobi=
{},AppMobi.webRoot="";window.addEventListener("popstate",function(){a.goBack()},!1);this.availableTransitions={};this.availableTransitions.up=a.slideUpTransition;this.availableTransitions.down=a.slideDownTransition;this.availableTransitions.fade=a.fadeTransition;this.availableTransitions.flip=a.flipTransition;this.availableTransitions.pop=a.popTransition;this.availableTransitions["default"]=a.slideTransition;this.availableTransitions.none=a.noTransition};n.prototype={isAppMobi:!1,titlebar:"",navbar:"",
header:"",viewportContainer:"",backButton:"",remotePages:{},history:[],homeDiv:"",screenWidth:"",content:"",modalWindow:"",customFooter:!1,defaultFooter:"",customMenu:!1,defaultMenu:"",_readyFunc:null,doingTransition:!1,passwordBox:new jq.passwordBox,selectBox:jq.selectBox,ajaxUrl:"",transitionType:"slide",scrollingDivs:[],firstDiv:"",remoteJSPages:{},hasLaunched:!1,launchCompleted:!1,activeDiv:"",css3animate:function(a,b){try{jq(a).css3Animate(b)}catch(c){console.log("Error animating "+c.message+
" "+a.id)}},loadDefaultHash:!0,useAjaxCacheBuster:!1,actionsheet:function(a){return jq("#jQUi").actionsheet(a)},popup:function(a){return k("#jQUi").popup(a)},blockUI:function(a){k.blockUI(a)},unblockUI:function(){k.unblockUI()},removeFooterMenu:function(){jq("#navbar").hide();jq("#content").css("bottom","0px");this.showNavMenu=!1},showNavMenu:!0,autoLaunch:!0,showBackbutton:!0,backButtonText:"",resetScrollers:!0,ready:function(a){this.launchCompleted?a():document.addEventListener("jq.ui.ready",a,
!1)},setBackButtonStyle:function(a){i("backButton").className=a},goBack:function(){if(this.history.length>0){var a=this.history.pop();this.loadContent(a.target+"",0,1,a.transition);this.transitionType=a.transition}},clearHistory:function(){this.history=[];this.backButton.style.visibility="hidden"},updateBadge:function(a,b,c){c===void 0&&(c="");a[0]!="#"&&(a="#"+a);var d=jq(a).find("span.jq-badge");d.length==0?(jq(a).css("position")!="absolute"&&jq(a).css("position","relative"),jq(a).append("<span class='jq-badge "+
c+"'>"+b+"</span>")):d.html(b)},removeBadge:function(a){jq(a).find("span.jq-badge").remove()},toggleNavMenu:function(a){if(jq.ui.showNavMenu)if(jq("#navbar").css("display")!="none"&&(a!==void 0&&a!==!0||a===void 0))jq("#content").css("bottom","0px"),jq("#navbar").hide();else if(a===void 0||a!==void 0&&a===!0)jq("#navbar").show(),jq("#content").css("bottom",jq("#navbar").css("height"))},toggleHeaderMenu:function(a){if(jq("#header").css("display")!="none"&&(a!==void 0&&a!==!0||a===void 0))jq("#content").css("top",
"0px"),jq("#header").hide();else if(a===void 0||a!==void 0&&a===!0)jq("#header").show(),jq("#content").css("top",jq("#header").css("height"))},toggleSideMenu:function(a){if(jq("#content").hasClass("hasMenu"))if(jq("#menu").css("display")!="block"&&(a!==void 0&&a!==!1||a===void 0))this.scrollingDivs.menu_scroller.initEvents(),jq("#menu").show(),window.setTimeout(function(){jq("#menu").addClass("on");jq("#header").addClass("on");jq("#navbar").addClass("on");jq("#content").addClass("on")},1);else if(a===
void 0||a!==void 0&&a===!1)this.scrollingDivs.menu_scroller.removeEvents(),jq("#header").removeClass("on"),jq("#menu").removeClass("on"),jq("#navbar").removeClass("on"),jq("#content").removeClass("on"),setTimeout(function(){jq("#menu").hide()},300)},updateNavbar:function(){for(var a=this,b=jq(this.navbar).find("a"),c=0;c<b.length;c++)b[c].setAttribute("data-ignore-pressed","true"),b[c].setAttribute("resetHistory","true"),b[c].oldclick=b[c].onclick,b[c].onclick=function(b){a.doingTransition||(jq("#navbar a").removeClass("selected"),
jq(this).addClass("selected"),this.oldclick&&this.oldclick(b))};b=null},updateNavbarElements:function(a){var b=jq("#navbar");if(!(a===void 0||a==null)){if(typeof a=="string")return b.html(a),null;b.html("");for(var c=0;c<a.length;c++){var d=a[c].cloneNode(!0);if(a[c].oldhash)d.href=a[c].oldhref,d.onclick=a[c].oldonclick;b.append(d)}this.updateNavbar()}},updateSideMenu:function(a){var b=this,c=jq("#menu_scroller");if(!(a===void 0||a==null)){if(typeof a=="string")return c.html(a),null;c.html("");var d=
document.createElement("a");d.className="closebutton jqMenuClose";d.href="javascript:;";d.onclick=function(){b.toggleSideMenu()};c.append(d);d=document.createElement("div");d.className="jqMenuHeader";d.innerHTML="Menu";c.append(d);for(d=0;d<a.length;d++){var f=a[d].cloneNode(!0);if(a[d].oldhash)f.href=a[d].oldhref,f.onclick=a[d].oldonclick;c.append(f)}this.scrollingDivs.menu_scroller.hideScrollbars();this.scrollingDivs.menu_scroller.scrollTo({x:0,y:0},"0")}},setTitle:function(a){this.titleBar.innerHTML=
a},setBackButtonText:function(a){this.backButton.innerHTML=this.backButtonText.length>0?this.backButtonText:a},showMask:function(a){a||(a="Loading Content");jq("#jQui_mask>h1").html(a);i("jQui_mask").style.display="block"},hideMask:function(){i("jQui_mask").style.display="none"},showModal:function(a){try{if(i(a))jq("#modalContainer").html(i(a).childNodes[0].innerHTML+""),jq("#modalContainer").append("<a href='javascript:;' onclick='$.ui.hideModal();' class='closebutton modalbutton'></a>"),this.modalWindow.style.display=
"block",content=button=null,this.scrollingDivs.modal_container.initEvents(),this.scrollToTop("modal")}catch(b){console.log("Error with modal - "+b,this.modalWindow)}},hideModal:function(){i("modalContainer").innerHTML="";i("jQui_modal").style.display="none";this.scrollingDivs.modal_container.removeEvents()},updateContentDiv:function(a,b){var c=i(a);if(c)c.getAttribute("scrolling")&&c.getAttribute("scrolling").toLowerCase()=="no"?c.innerHTML=b:c.childNodes[0].innerHTML=b},addContentDiv:function(a,
b,c,d,f){var k=i(a);if(!k)k=document.createElement("div"),k.id=a,k.title=c,k.innerHTML=b;k.className="panel";this.addDivAndScroll(k,d,f)},addDivAndScroll:function(a){var b=!0;a.getAttribute("scrolling")&&a.getAttribute("scrolling").toLowerCase()=="no"&&(b=!1);if(b){var c=a.cloneNode(!1);a.title=null;a.id=null;a.removeAttribute("footer");a.removeAttribute("nav");jq(a).removeClass("panel");a.style.width="100%";c.appendChild(a);this.content.appendChild(c);this.selectBox.getOldSelects(c.id);this.passwordBox.getOldPasswords(c.id);
b&&(this.scrollingDivs[c.id]=jq(a).scroller({scrollBars:!0,verticalScroll:!0,horizontalScroll:!1,vScrollCSS:"jqmScrollbar",refresh:!1}),this.scrollingDivs[c.id].removeEvents())}else this.content.appendChild(a)},updateAnchors:function(){},scrollToTop:function(a){this.scrollingDivs[a]&&this.scrollingDivs[a].scrollTo({x:0,y:0},0)},updateOrientation:function(){for(var a in this.scrollingDivs)typeof this.scrollingDivs[a]!=="function"&&this.scrollToTop(a);this.css3animate(this.activeDiv,{x:"100%",time:"0ms"})},
parsePanelFunctions:function(a,b){var c=this,d=a.getAttribute("data-footer");window.setTimeout(function(){d&&d.toLowerCase()=="none"?c.toggleNavMenu(!1):c.toggleNavMenu(!0);if(d&&c.customFooter!=d)c.customFooter=d,c.updateNavbarElements(jq("#"+d).children());else if(d!=c.customFooter)c.customFooter&&c.updateNavbarElements(c.defaultFooter),c.customFooter=!1;a.getAttribute("data-tab")&&(jq("#navbar a").removeClass("selected"),jq("#"+a.getAttribute("data-tab")).addClass("selected"))},10);var f=a.getAttribute("data-nav");
if(f&&this.customMenu!=f)this.customMenu=f,this.updateSideMenu(jq("#"+f).children());else if(f!=this.customMenu)this.customMenu&&this.updateSideMenu(this.defaultMenu),this.customMenu=!1;f=a.getAttribute("data-load");if(typeof f=="string"&&window[f])window[f](a);if(b&&(f=b.getAttribute("data-unload"),typeof f=="string"&&window[f]))window[f](b);this.menu.style.display=="block"&&this.toggleSideMenu()},parseScriptTags:function(a){if(a)for(var a=a.getElementsByTagName("script"),b=0;b<a.length;b++)if(a[b].src.length>
0&&!that.remoteJSPages[a[b].src]){var c=document.createElement("script");c.type=a[b].type;c.src=a[b].src;document.getElementsByTagName("head")[0].appendChild(c);that.remoteJSPages[a[b].src]=1}else window.eval(a[b].innerHTML)},loadContent:function(a,b,g,q,l){if(!this.doingTransition)try{what=null;var n=this;n.hideMask();var p=!0;if(a.indexOf("#")==-1){var r="url"+f(a);i(r)&&(p=!1,l.getAttribute("data-refresh-ajax")==="true"||l.refresh&&l.refresh===!0?p=!0:a="#"+r)}if(a.indexOf("#")==-1&&l&&p){if(!(this.activeDiv.id==
"jQui_ajax"&&a==this.ajaxUrl)){a.indexOf("http")==-1&&(a=AppMobi.webRoot+a);var s=new XMLHttpRequest;s.onreadystatechange=function(){if(s.readyState==4&&s.status==200){var c=this.doingTransition=!1;if(i(r)!==void 0)n.updateContentDiv(r,s.responseText),i(r).title=l.title?l.title:a;else if(l.getAttribute("data-persist-ajax")){var d=l.getAttribute("data-pull-scroller")==="true"?!0:!1;refreshFunction=d?function(){l.refresh=!0;n.loadContent(a,b,g,q,l);l.refresh=!1}:null;n.addContentDiv(r,s.responseText,
d,refreshFunction);i(r).title=l.title?l.title:a}else n.updateContentDiv("jQui_ajax",s.responseText),i("jQui_ajax").title=l.title?l.title:a,n.loadContent("#jQui_ajax",b,g),c=!0;d=document.createElement("div");d.innerHTML=s.responseText;n.parseScriptTags(d);if(!c)return n.loadContent("#"+r)}};ajaxUrl=a;var y=this.useAjaxCacheBuster?a+(a.split("?")[1]?"&":"?")+"cache="+Math.random()*1E16:a;s.open("GET",y,!0);s.send();this.showMask()}}else{what=a.replace("#","");var u=what.indexOf("/"),p="";u!=-1&&(p=
what.substr(u),what=what.substr(0,u));what=i(what);if(!what)throw"Target: "+a+" was not found";if(what!=this.activeDiv||g){if(what.getAttribute("data-modal")=="true"||what.getAttribute("modal")=="true")return this.showModal(what.id);what.style.display="block";this.transitionType=q;var v=this.activeDiv,u=what;if(v!=u){b?(this.history=[],this.history.push({target:"#"+this.firstDiv.id,transition:q})):g||this.history.push({target:c,transition:q});try{window.history.pushState(what.id,what.id,d+"#"+what.id+
p),k(window).trigger("hashchange",{newUrl:d+"#"+what.id+p,oldURL:d+c})}catch(w){}c="#"+what.id+p;this.resetScrollers&&this.scrollingDivs[what.id]&&this.scrollingDivs[what.id].scrollTo({x:0,y:0});this.doingTransition=!0;this.availableTransitions[q]?this.availableTransitions[q].call(this,v,u,g):this.availableTransitions["default"].call(this,v,u,g);g?this.history.length>0&&this.setBackButtonText(i(this.history[this.history.length-1].target.replace("#","")).title):this.activeDiv.title?this.setBackButtonText(this.activeDiv.title):
this.setBackButtonText("Back");if(what.title)this.titleBar.innerHTML=what.title;b&&this.setBackButtonText(this.firstDiv.title);if(this.history.length==0)this.backButton.style.visibility="hidden",this.history=[];else if(this.showBackbutton)this.backButton.style.visibility="visible";this.activeDiv=what;this.scrollingDivs[this.activeDiv.id]&&this.scrollingDivs[this.activeDiv.id].initEvents();this.scrollingDivs[v.id]&&this.scrollingDivs[v.id].removeEvents();this.parsePanelFunctions(what,v);window.scrollTo(1,
1)}}}}catch(x){console.log("Error with loading content "+x+" - "+a)}},launch:function(){if(this.hasLaunched==!1||this.launchCompleted)this.hasLaunched=!0;else{this.isAppMobi=window.AppMobi&&typeof AppMobi=="object"&&AppMobi.app!==void 0?!0:!1;var a=this;this.viewportContainer=jq("#jQUi");this.navbar=i("navbar");this.content=i("content");this.header=i("header");this.menu=i("menu");if(this.viewportContainer.length==0){var b=document.createElement("div");b.id="jQUi";for(var c=document.body;c.firstChild;)b.appendChild(c.firstChild);
jq(document.body).prepend(b);this.viewportContainer=jq("#jQUi")}if(!this.navbar)this.navbar=document.createElement("div"),this.navbar.id="navbar",this.navbar.style.cssText="display:none",this.viewportContainer.append(this.navbar);if(!this.header)this.header=document.createElement("div"),this.header.id="header",this.viewportContainer.prepend(this.header);if(!this.menu)this.menu=document.createElement("div"),this.menu.id="menu",this.menu.style.overflow="hidden",this.menu.innerHTML="<div id='menu_scroller'></div>",
this.viewportContainer.append(this.menu),this.scrollingDivs.menu_scroller=jq("#menu_scroller").scroller({scrollBars:!0,verticalScroll:!0,vScrollCSS:"jqmScrollbar"});if(!this.content)this.content=document.createElement("div"),this.content.id="content",this.viewportContainer.append(this.content);this.header.innerHTML='<a id="backButton" href="javascript:;"></a> <h1 id="pageTitle"></h1>'+header.innerHTML;this.backButton=i("backButton");this.backButton.className="button";this.backButton.onclick=function(){a.goBack()};
this.backButton.style.visibility="hidden";this.titleBar=i("pageTitle");this.addContentDiv("jQui_ajax","");var d=document.createElement("div");d.id="jQui_mask";d.className="ui-loader";d.innerHTML="<span class='ui-icon ui-icon-loading spin'></span><h1>Loading Content</h1>";d.style.zIndex=2E4;d.style.display="none";document.body.appendChild(d);var f=document.createElement("div");f.id="jQui_modal";this.viewportContainer.append(f);f.appendChild(jq("<div id='modalContainer'></div>").get());this.scrollingDivs.modal_container=
jq("#modalContainer").scroller({scrollBars:!0,vertical:!0,vScrollCSS:"jqmScrollbar"});this.modalWindow=f;this.updateNavbar();for(var n={},b=this.viewportContainer.get().querySelectorAll(".panel"),c=0;c<b.length;c++){var p=b[c],r=p,s;if(p.parentNode&&p.parentNode.id!="content"){if(p.parentNode.removeChild(p),s=p.id,this.addDivAndScroll(r),r.getAttribute("selected"))this.firstDiv=i(s)}else if(!p.parsedContent&&(p.parsedContent=1,p.parentNode.removeChild(p),s=p.id,this.addDivAndScroll(r),r.getAttribute("selected")))this.firstDiv=
i(s);p.getAttribute("data-defer")&&(n[s]=p.getAttribute("data-defer"));p=null}var b=null,y;for(y in n)(function(b){jq.ajax({url:AppMobi.webRoot+n[b],success:function(c){c.length!=0&&(k.ui.updateContentDiv(b,c),a.parseScriptTags(jq(b).get()))},error:function(){console.log("Error with deferred load "+n[b])}})})(y);if(this.firstDiv)a=this,this.activeDiv=this.firstDiv,this.scrollingDivs[this.activeDiv.id]&&this.scrollingDivs[this.activeDiv.id].initEvents(),window.setTimeout(function(){a.firstDiv.style.display=
"block";a.css3animate(a.firstDiv,{x:"100%",time:"0ms"});if(a.activeDiv.title)a.titleBar.innerHTML=a.activeDiv.title;a.parsePanelFunctions(a.activeDiv);l.length>0&&a.loadDefaultHash&&a.loadContent(l);d=f=null;a.launchCompleted=!0;jq(document).trigger("jq.ui.ready");jq("#splashscreen").remove();a.defaultFooter=jq("#navbar").children();var b=jq("nav").get();a.defaultMenu=jq(b).children();a.updateSideMenu(a.defaultMenu)},100)}},slideTransition:function(a,b,c){a.style.display="block";b.style.display="block";
var d=this;c?(d.css3animate(a,{x:"200%",time:"200ms",callback:function(){d.css3animate(a,{x:0,time:"1ms",callback:function(){d.finishTransition(a)}})}}),d.css3animate(b,{x:"0%",time:"1ms",callback:function(){d.css3animate(b,{x:"100%",time:"200ms"})}})):(d.css3animate(a,{x:"0%",time:"200ms",callback:function(){d.finishTransition(a)}}),d.css3animate(b,{x:"200%",time:"1ms",callback:function(){d.css3animate(b,{x:"100%",time:"200ms"})}}))},slideUpTransition:function(a,b,c){a.style.display="block";b.style.display=
"block";var d=this;c?(d.css3animate(b,{x:"100%",y:"0%",time:"1ms"}),d.css3animate(a,{y:"100%",x:"100%",time:"200ms",callback:function(){d.css3animate(a,{x:0,y:0,time:"1ms",callback:function(){d.finishTransition(a)}});b.style.zIndex=2;a.style.zIndex=1}})):(a.style.zIndex=1,b.style.zIndex=2,d.css3animate(a,{x:"100%",time:"200ms",callback:function(){d.css3animate(a,{x:0,y:0,time:"1ms",callback:function(){d.finishTransition(a)}})}}),d.css3animate(b,{y:"100%",x:"100%",time:"1ms",callback:function(){d.css3animate(b,
{y:"0%",x:"100%",time:"200ms"})}}))},slideDownTransition:function(a,b,c){a.style.display="block";b.style.display="block";var d=this;c?(d.css3animate(b,{x:"100%",y:"0%",time:"1ms"}),d.css3animate(a,{y:"-100%",x:"100%",time:"200ms",callback:function(){d.css3animate(a,{x:0,y:0,time:"1ms",callback:function(){d.finishTransition(a)}});b.style.zIndex=2;a.style.zIndex=1}})):(a.style.zIndex=1,b.style.zIndex=2,d.css3animate(a,{x:"100%",time:"200ms",callback:function(){d.css3animate(a,{x:0,y:0,time:"1ms",callback:function(){d.finishTransition(a)}})}}),
d.css3animate(b,{y:"-100%",x:"100%",time:"1ms",callback:function(){d.css3animate(b,{y:"0%",x:"100%",time:"200ms"})}}))},flipTransition:function(a,b,c){a.style.display="block";b.style.display="block";var d=this;c?(d.css3animate(b,{x:"200%",time:"1ms",scale:0.8,rotateY:"180deg",callback:function(){d.css3animate(b,{x:"100%",time:"200ms"})}}),d.css3animate(a,{x:"200%",time:"200ms",scale:0.8,rotateY:"180deg",callback:function(){d.css3animate(a,{x:0,time:"1ms",opacity:1,callback:function(){d.finishTransition(a)}});
b.style.zIndex=2;a.style.zIndex=1}})):(a.style.zIndex=1,b.style.zIndex=2,d.css3animate(a,{x:"200%",time:"200ms",scale:".8",rotateY:"180deg",callback:function(){d.css3animate(a,{x:0,y:0,time:"1ms",callback:function(){d.finishTransition(a)}})}}),d.css3animate(b,{x:"200%",time:"1ms",scale:0.8,rotateY:"180deg",callback:function(){d.css3animate(b,{x:"100%",time:"200ms"})}}))},fadeTransition:function(a,b,c){a.style.display="block";b.style.display="block";var d=this;c?(d.css3animate(b,{x:"100%",time:"1ms"}),
d.css3animate(a,{x:"100%",time:"200ms",opacity:0.1,callback:function(){d.css3animate(a,{x:0,time:"1ms",opacity:1,callback:function(){d.finishTransition(a)}});b.style.zIndex=2;a.style.zIndex=1}})):(a.style.zIndex=1,b.style.zIndex=2,d.css3animate(a,{x:"100%",time:"200ms",callback:function(){d.css3animate(a,{x:0,y:0,time:"1ms",callback:function(){d.finishTransition(a)}})}}),b.style.opacity=0,d.css3animate(b,{x:"100%",time:"1ms",callback:function(){d.css3animate(b,{x:"100%",time:"200ms",opacity:1})}}))},
popTransition:function(a,b,c){a.style.display="block";b.style.display="block";var d=this;c?(d.css3animate(b,{x:"100%",time:"1ms"}),d.css3animate(a,{x:"100%",time:"200ms",opacity:0.1,scale:0.2,origin:"50% 50%",callback:function(){d.css3animate(a,{x:0,time:"1ms",callback:function(){d.finishTransition(a)}});b.style.zIndex=2;a.style.zIndex=1}})):(a.style.zIndex=1,b.style.zIndex=2,d.css3animate(a,{x:"100%",time:"200ms",callback:function(){d.css3animate(a,{x:0,y:0,time:"1ms",callback:function(){d.finishTransition(a)}})}}),
d.css3animate(b,{x:"100%",y:"0%",time:"1ms",scale:0.2,origin:"50% 50%",opacity:0.1,callback:function(){d.css3animate(b,{x:"100%",time:"200ms",scale:1,opacity:1,origin:"0% 0%"})}}))},noTransition:function(a,b,c){a.style.display="block";b.style.display="block";c?(this.css3animate(b,{x:"100%",time:"1ms"}),this.css3animate(a,{x:0,time:"1ms"})):(this.css3animate(a,{x:0,y:0,time:"1ms"}),this.css3animate(b,{x:"100%",time:"1ms"}));this.finishTransition(a);b.style.zIndex=2;a.style.zIndex=1},finishTransition:function(a){a.style.display=
"none";this.doingTransition=!1}};var f=function(a,b){b==void 0&&(b=0);var c=0,c=0;b^=-1;for(var d=0,f=a.length;d<f;d++)c=(b^a.charCodeAt(d))&255,c="0x"+"00000000 77073096 EE0E612C 990951BA 076DC419 706AF48F E963A535 9E6495A3 0EDB8832 79DCB8A4 E0D5E91E 97D2D988 09B64C2B 7EB17CBD E7B82D07 90BF1D91 1DB71064 6AB020F2 F3B97148 84BE41DE 1ADAD47D 6DDDE4EB F4D4B551 83D385C7 136C9856 646BA8C0 FD62F97A 8A65C9EC 14015C4F 63066CD9 FA0F3D63 8D080DF5 3B6E20C8 4C69105E D56041E4 A2677172 3C03E4D1 4B04D447 D20D85FD A50AB56B 35B5A8FA 42B2986C DBBBC9D6 ACBCF940 32D86CE3 45DF5C75 DCD60DCF ABD13D59 26D930AC 51DE003A C8D75180 BFD06116 21B4F4B5 56B3C423 CFBA9599 B8BDA50F 2802B89E 5F058808 C60CD9B2 B10BE924 2F6F7C87 58684C11 C1611DAB B6662D3D 76DC4190 01DB7106 98D220BC EFD5102A 71B18589 06B6B51F 9FBFE4A5 E8B8D433 7807C9A2 0F00F934 9609A88E E10E9818 7F6A0DBB 086D3D2D 91646C97 E6635C01 6B6B51F4 1C6C6162 856530D8 F262004E 6C0695ED 1B01A57B 8208F4C1 F50FC457 65B0D9C6 12B7E950 8BBEB8EA FCB9887C 62DD1DDF 15DA2D49 8CD37CF3 FBD44C65 4DB26158 3AB551CE A3BC0074 D4BB30E2 4ADFA541 3DD895D7 A4D1C46D D3D6F4FB 4369E96A 346ED9FC AD678846 DA60B8D0 44042D73 33031DE5 AA0A4C5F DD0D7CC9 5005713C 270241AA BE0B1010 C90C2086 5768B525 206F85B3 B966D409 CE61E49F 5EDEF90E 29D9C998 B0D09822 C7D7A8B4 59B33D17 2EB40D81 B7BD5C3B C0BA6CAD EDB88320 9ABFB3B6 03B6E20C 74B1D29A EAD54739 9DD277AF 04DB2615 73DC1683 E3630B12 94643B84 0D6D6A3E 7A6A5AA8 E40ECF0B 9309FF9D 0A00AE27 7D079EB1 F00F9344 8708A3D2 1E01F268 6906C2FE F762575D 806567CB 196C3671 6E6B06E7 FED41B76 89D32BE0 10DA7A5A 67DD4ACC F9B9DF6F 8EBEEFF9 17B7BE43 60B08ED5 D6D6A3E8 A1D1937E 38D8C2C4 4FDFF252 D1BB67F1 A6BC5767 3FB506DD 48B2364B D80D2BDA AF0A1B4C 36034AF6 41047A60 DF60EFC3 A867DF55 316E8EEF 4669BE79 CB61B38C BC66831A 256FD2A0 5268E236 CC0C7795 BB0B4703 220216B9 5505262F C5BA3BBE B2BD0B28 2BB45A92 5CB36A04 C2D7FFA7 B5D0CF31 2CD99E8B 5BDEAE1D 9B64C2B0 EC63F226 756AA39C 026D930A 9C0906A9 EB0E363F 72076785 05005713 95BF4A82 E2B87A14 7BB12BAE 0CB61B38 92D28E9B E5D5BE0D 7CDCEFB7 0BDBDF21 86D3D2D4 F1D4E242 68DDB3F8 1FDA836E 81BE16CD F6B9265B 6FB077E1 18B74777 88085AE6 FF0F6A70 66063BCA 11010B5C 8F659EFF F862AE69 616BFFD3 166CCF45 A00AE278 D70DD2EE 4E048354 3903B3C2 A7672661 D06016F7 4969474D 3E6E77DB AED16A4A D9D65ADC 40DF0B66 37D83BF0 A9BCAE53 DEBB9EC5 47B2CF7F 30B5FFE9 BDBDF21C CABAC28A 53B39330 24B4A3A6 BAD03605 CDD70693 54DE5729 23D967BF B3667A2E C4614AB8 5D681B02 2A6F2B94 B40BBE37 C30C8EA1 5A05DF1B 2D02EF8D".substr(c*
9,8),b=b>>>8^c;return b^-1};k.ui=new n})(jq);
(function(){function k(){if(jq.os.desktop)return l.css("height","100%");jq.os.android?(window.scrollTo(1,1),document.documentElement.scrollHeight<window.outerHeight/window.devicePixelRatio&&l.css("height",window.outerHeight/window.devicePixelRatio+"px")):(document.documentElement.style.height="5000px",window.scrollTo(0,1),document.documentElement.style.height=window.innerHeight+"px",l.css("height",window.innerHeight+"px"))}function i(c){typeof c==="string"&&(c=document.getElementById(c));c.addEventListener("touchstart",
this,!1)}function d(c){if(c.tagName.toLowerCase()!="a"&&c.parentNode)c=c.parentNode;if(c.tagName.toLowerCase()=="a"){if(c.href.toLowerCase().indexOf("javascript:")!==-1||c.getAttribute("data-ignore"))return!1;if(c.onclick&&!jq.os.desktop)c.onclick();if(c.href.indexOf("tel:")===0)return!1;if(c.hash.indexOf("#")===-1&&c.target.length>0){if(c.href.toLowerCase().indexOf("javascript:")!=0){if(jq.ui.isAppMobi)AppMobi.device.launchExternal(c.href);else if(jq.os.desktop)window.open(c);else if(!jq.os.desktop){var d=
document.createEvent("Event");d.initEvent("click",!0,!1);c.target="_blank";c.dispatchEvent(d)}return!0}return!1}if(c.href.indexOf("#")!==-1&&c.hash.length==0||c.href.length==0)return!0;var d=c.getAttribute("data-transition"),f=c.getAttribute("data-resetHistory");f&&f.toLowerCase();jq.ui.loadContent(c.hash.length>0?c.hash:c.href,c.resetHistory,0,d,c);return!0}}var l;jq(document).ready(function(){jq("nav").length>0&&(jq("#jQUi #header").addClass("hasMenu"),jq("#jQUi #content").addClass("hasMenu"),jq("#jQUi #navbar").addClass("hasMenu"));
l=jq("#jQUi");k()});document.addEventListener("appMobi.device.ready",function(){setTimeout(function(){l.css("height","100%");document.body.style.height="100%";document.documentElement.style.minHeight=window.innerHeight},300)});window.addEventListener("orientationchange",function(){jq.ui.updateOrientation();window.setTimeout(function(){k()},200)},!1);(jq.os.desktop||jq.os.android)&&window.addEventListener("resize",function(){jq.ui.updateOrientation();window.setTimeout(function(){k()},100)},!1);i.prototype=
{dX:0,dY:0,cX:0,cY:0,handleEvent:function(c){switch(c.type){case "touchstart":this.onTouchStart(c);break;case "touchmove":this.onTouchMove(c);break;case "touchend":this.onTouchEnd(c)}},onTouchStart:function(c){this.dX=c.touches[0].pageX;this.dY=c.touches[0].pageY;var d=c.target;if(d.nodeType==3)d=d.parentNode;var f=d.tagName.toLowerCase();f=="a"&&d.href.indexOf("tel:")===0||f=="input"||f=="select"||f=="textarea"?d.focus():c.preventDefault();this.moved=!1;document.addEventListener("touchmove",this,
!0);document.addEventListener("touchend",this,!0)},onTouchMove:function(c){this.moved=!0;this.cX=c.touches[0].pageX-this.dX;this.cY=c.touches[0].pageY-this.dY},onTouchEnd:function(c){document.removeEventListener("touchmove",this,!1);document.removeEventListener("touchend",this,!1);if(!jq.os.blackberry&&!this.moved||jq.os.blackberry&&(Math.abs(this.cX)<5||Math.abs(this.cY)<5)){c=c.target;if(c.nodeType==3)c=c.parentNode;if(d(c))return!1;var i=document.createEvent("MouseEvents");i.initEvent("click",
!0,!0);c.dispatchEvent(i);c&&c.type!=void 0&&(i=c.tagName.toLowerCase(),(i=="select"||i=="input"||i=="textarea")&&c.focus())}this.dX=this.cX=this.cY=this.dY=0}};jq(document).ready(function(){document.body.addEventListener("touchmove",function(c){c.preventDefault();c.stopPropagation();window.scrollTo(1,1)},!1);jq.os.desktop?document.getElementById("jQUi").addEventListener("click",function(c){var i=c.target;if(i.nodeType==3)i=i.parentNode;if(d(i))return c.preventDefault(),!1},!1):new i(document.getElementById("jQUi"))})})();
(function(k){function i(){d.last&&Date.now()-d.last>=c&&(d.el.trigger("longTap"),d={})}var d={},l,c=750;k(document).ready(function(){k(document.body).bind("touchstart",function(n){var f=Date.now(),a=f-(d.last||f);d.el=k("tagName"in n.touches[0].target?n.touches[0].target:n.touches[0].target.parentNode);l&&clearTimeout(l);d.x1=n.touches[0].pageX;d.y1=n.touches[0].pageY;if(a>0&&a<=250)d.isDoubleTap=!0;d.last=f;setTimeout(i,c);d.el.data("ignore-pressed")||d.el.addClass("selected")}).bind("touchmove",
function(c){d.x2=c.touches[0].pageX;d.y2=c.touches[0].pageY}).bind("touchend",function(){if(d.el)d.el.data("ignore-pressed")||d.el.removeClass("selected"),d.isDoubleTap?(d.el.trigger("doubleTap"),d={}):d.x2>0||d.y2>0?((Math.abs(d.x1-d.x2)>30||Math.abs(d.y1-d.y2)>30)&&d.el.trigger("swipe")&&d.el.trigger("swipe"+(Math.abs(d.x1-d.x2)>=Math.abs(d.y1-d.y2)?d.x1-d.x2>0?"Left":"Right":d.y1-d.y2>0?"Up":"Down")),d.x1=d.x2=d.y1=d.y2=d.last=0):"last"in d&&(d.el.trigger("tap"),l=setTimeout(function(){l=null;
d.el&&d.el.trigger("singleTap");d={}},250))}).bind("touchcancel",function(){d={}})});["swipe","swipeLeft","swipeRight","swipeUp","swipeDown","doubleTap","tap","singleTap","longTap"].forEach(function(c){k.fn[c]=function(d){return this.bind(c,d)}})})(jq);

View file

@ -5,16 +5,15 @@ var TaflNet = {
if (!address) address = "chrummibei.ch:47413";
var s = io.connect("http://"+address);
this.socket = s;
s.on('connect', function() {
console.log("Connected");
s.emit('client.hello');
});
s.on('server.hello', function(data) {
console.log("Got hello");
console.log(s.emit('game.find_opponent'));
s.emit('game.find_opponent');
});
s.on('game.start', function(data) {
@ -32,6 +31,8 @@ var TaflNet = {
send_move: function(move) {
var s = this.socket;
if (! s)
throw "NotConnected";
s.emit('move.send', move);
},

View file

@ -2,296 +2,456 @@
* This is the JS Tafl Game lib and part of Androtafl.
*/
Array.prototype.has = function(obj) {
var i = this.length;
while (i--) {
if (this[i] === obj) {
return true;
}
}
return false;
var i = this.length;
while (i--) {
if (this[i] === obj) { return true; }
}
return false;
};
String.prototype.setCharAt = function(index,chr) {
if(index > this.length-1) return this;
return this.substr(0,index) + chr + this.substr(index+1);
String.prototype.setCharAt = function(index, chr) {
if (index > this.length - 1) return this;
return this.substr(0, index) + chr + this.substr(index + 1);
}
function TaflState() {
'use strict';
this.board = [''];
this.board = [ '' ];
this.N = 0;
this.to_move = 'w';
this.legal_moves_cache = null;
this.winner = null;
this.win_reason = null;
// AI related variables
this.initial_W = null;
this.initial_B = null;
this.loadBoard = function(board) {
var i, j, pieces;
this.board = board;
this.N = board.length;
if (board[0].length !== this.N) throw "BoardNotSquare";
pieces = Tafl.count_pieces(board);
this.initial_W = pieces.W;
this.initial_B = pieces.B;
};
this.clone = function() {
var i, t = new TaflState();
for (i = 0; i < this.N; ++i) {
t.board[i] = this.board[i];
}
t.N = this.N;
t.to_move = this.to_move;
t.legal_moves_cache = this.legal_moves_cache;
t.winner = this.winner;
t.win_reason = this.win_reason;
t.initial_W = this.initial_W;
t.initial_B = this.initial_B;
return t;
}
}
var Tafl = {
legal_moves: function(s) {
legal_moves : function(s) {
if (s.legal_moves_cache) return s.legal_moves_cache;
var i,j,k, N=s.N, moves=[], legal_fields;
for (i=0; i<N; ++i) {
for (j=0; j<N; ++j) {
if (! this.is_moving_color(s, [i,j])) continue;
legal_fields = ['.'];
if (s.board[i][j] === 'K') legal_fields.push(','); // Only king can step on throne
for (k=i+1; k<N; ++k) {
var i, j, k, N = s.N, moves = [], legal_fields;
for (i = 0; i < N; ++i) {
for (j = 0; j < N; ++j) {
if (!this.is_moving_color(s, [ i, j ])) continue;
legal_fields = [ '.' ];
if (s.board[i][j] === 'K') legal_fields.push(','); // Only king
// can step
// on throne
for (k = i + 1; k < N; ++k) {
if (legal_fields.has(s.board[k][j])) {
moves.push([ [i,j], [k,j] ]);
} else break;
moves.push([ [ i, j ], [ k, j ] ]);
} else {
if (s.board[k][j] !== ',') {
break;
}
}
}
for (k=1; k<i+1; ++k) {
if (legal_fields.has(s.board[i-k][j])) {
moves.push([ [i,j], [i-k,j] ]);
} else break;
for (k = 1; k < i + 1; ++k) {
if (legal_fields.has(s.board[i - k][j])) {
moves.push([ [ i, j ], [ i - k, j ] ]);
} else {
if (s.board[i - k][j] !== ',') {
break;
}
}
}
for (k=j+1; k<N; ++k) {
for (k = j + 1; k < N; ++k) {
if (legal_fields.has(s.board[i][k])) {
moves.push([ [i,j], [i,k] ]);
} else break;
moves.push([ [ i, j ], [ i, k ] ]);
} else {
if (s.board[i][k] !== ',') {
break;
}
}
}
for (k=1; k<j+1; ++k) {
if (legal_fields.has(s.board[i][j-k])) {
moves.push([ [i,j], [i,j-k] ]);
} else break;
for (k = 1; k < j + 1; ++k) {
if (legal_fields.has(s.board[i][j - k])) {
moves.push([ [ i, j ], [ i, j - k ] ]);
} else {
if (s.board[i][j - k] !== ',') {
break;
}
}
}
}
}
s.legal_moves_cache = moves;
return moves;
},
make_move: function(s, move) {
make_move : function(s, move) {
function replaceCharAt(string, index) {
}
if (! this.movelist_has_move(this.legal_moves(s), move) ) throw "IllegalMove";
var i=move[0][0],j=move[0][1],k=move[1][0],l=move[1][1],c, piece,empty='.', t;
if (!this.movelist_has_move(this.legal_moves(s), move))
throw "IllegalMove";
var i = move[0][0], j = move[0][1], k = move[1][0], l = move[1][1], c, piece, empty = '.', t;
piece = s.board[i][j];
if (piece === 'k') empty = ','; // King was on throne
if (piece === 'k' && s.board[k][l] === '.') piece = 'K'; // King steps off the throne
if (piece === 'k' && s.board[k][l] === '.') piece = 'K'; // King
// steps off
// the
// throne
s.board[k] = s.board[k].setCharAt(l, piece);
s.board[i] = s.board[i].setCharAt(j, empty);;
c = this.get_captures(s, [k,l]);
for ( t=0; t < c.length; ++t ) {
s.board[i] = s.board[i].setCharAt(j, empty);
c = this.get_captures(s, [ k, l ]);
for (t = 0; t < c.length; ++t) {
s.board[c[t][0]] = s.board[c[t][0]].setCharAt(c[t][1], '.');
}
if (s.to_move === 'W') s.to_move = 'B';
else s.to_move = 'W';
if (s.to_move === 'W')
s.to_move = 'B';
else
s.to_move = 'W';
s.legal_moves_cache = null;
},
get_captures: function(s, last_move) {
var captures = [], k=last_move[0], l=last_move[1], directions,
d, di, dj, king_pos, i,j, king_capturers;
get_captures : function(s, last_move) {
var captures = [], k = last_move[0], l = last_move[1], directions, d, di, dj, king_pos, i, j, king_capturers;
directions = [[1,0],[-1,0],[0,1],[0,-1]];
for (d=0; d < directions.length; ++d) {
di = directions[d][0]; dj = directions[d][1];
directions = [ [ 1, 0 ], [ -1, 0 ], [ 0, 1 ], [ 0, -1 ] ];
if (k+2*di < 0 || k+2*di >= s.N || l+2*dj < 0 || l+2*dj >= s.N) continue;
for (d = 0; d < directions.length; ++d) {
di = directions[d][0];
dj = directions[d][1];
if (this.is_not_moving_color(s, [k+di, l+dj]) &&
this.is_moving_color(s, [k+2*di, l+2*dj]) &&
s.board[k+di][l+dj].toUpperCase() !== 'K') {
captures.push([k+di, l+dj]);
if (k + 2 * di < 0 || k + 2 * di >= s.N || l + 2 * dj < 0
|| l + 2 * dj >= s.N) continue;
if (this.is_not_moving_color(s, [ k + di, l + dj ])
&& this.is_moving_color(s, [ k + 2 * di, l + 2 * dj ])
&& s.board[k + di][l + dj].toUpperCase() !== 'K') {
captures.push([ k + di, l + dj ]);
}
}
// Check if king is captured separately
king_pos = this.find_king(s);
i = king_pos[0]; j=king_pos[1];
king_capturers = ['W',',']; // Kings can be captured by white stones
// or the throne
if (i > 0 && j > 0 && i < s.N-1 && j < s.N-1) { // King is in not on
// an edge
if (king_capturers.has(s.board[i][j-1]) && king_capturers.has(s.board[i][j+1]) &&
king_capturers.has(s.board[i-1][j]) && king_capturers.has(s.board[i+1][j])) {
captures.push([i,j]);
i = king_pos[0];
j = king_pos[1];
king_capturers = [ 'W', ',' ]; // Kings can be captured by white stones
// or the throne
if (i > 0 && j > 0 && i < s.N - 1 && j < s.N - 1) { // King is in not on
// an edge
if (king_capturers.has(s.board[i][j - 1])
&& king_capturers.has(s.board[i][j + 1])
&& king_capturers.has(s.board[i - 1][j])
&& king_capturers.has(s.board[i + 1][j])) {
captures.push([ i, j ]);
}
}
return captures;
},
is_moving_color: function(s, pos) {
var i=pos[0], j=pos[1];
is_moving_color : function(s, pos) {
var i = pos[0], j = pos[1];
if (s.to_move === s.board[i][j]) return true;
// K and k are both kings
if (s.to_move === 'B' && s.board[i][j].toUpperCase() === 'K') return true;
if (s.to_move === 'B' && s.board[i][j].toUpperCase() === 'K')
return true;
return false;
},
is_not_moving_color: function(s, pos) { // Returns true if it's a piece, but not of the current color
if (this.is_moving_color(s, pos) || ['.', ','].has(s.board[pos[0]][pos[1]])) {
is_not_moving_color : function(s, pos) { // Returns true if it's a piece,
// but not of the current color
if (this.is_moving_color(s, pos)
|| [ '.', ',' ].has(s.board[pos[0]][pos[1]])) {
return false;
} else {
return true;
}
},
find_king: function(s) {
var i,j;
for (i=0; i<s.N; ++i){
find_king : function(s) {
var i, j;
for (i = 0; i < s.N; ++i) {
j = s.board[i].toUpperCase().indexOf('K'); // Kind is in the field?
if (j >= 0) return [i,j];
if (j >= 0) return [ i, j ];
}
return null;
},
terminal_test: function(s) {
terminal_test : function(s) {
var i, j, king_found = false, corners;
// find position of king and check if he's on an edge
for (i=0; i<s.N; ++i){
for (i = 0; i < s.N; ++i) {
j = s.board[i].toUpperCase().indexOf('K'); // King is in the field?
if (j >= 0) { // Found king
// King is at an edge
if (i === 0 || i === s.N-1 || j === 0 || j === s.N-1) {
if (i === 0 || i === s.N - 1 || j === 0 || j === s.N - 1) {
s.winner = 'B';
s.win_reason = 'KingEscaped';
return true;
}
king_found = true;
break;
}
}
if (king_found === false) {
s.winner = 'W';
s.win_reason = 'NoKing';
return true; // King was captured
}
// Are there any legal moves? If not, player loses
if (this.legal_moves(s).length == 0) {
if (s.to_move === 'W') s.winner = 'B';
else s.winner = 'W';
if (s.to_move === 'W')
s.winner = 'B';
else
s.winner = 'W';
s.win_reason = 'NoLegalMoves';
return true;
}
return false; // no one won, yet
},
movelist_has_move: function(movelist, move) {
movelist_has_move : function(movelist, move) {
var i;
for (i = 0; i < movelist.length; ++i) {
if (movelist[i][0][0] === move[0][0] &&
movelist[i][0][1] === move[0][1] &&
movelist[i][1][0] === move[1][0] &&
movelist[i][1][1] === move[1][1])
return true;
if (movelist[i][0][0] === move[0][0]
&& movelist[i][0][1] === move[0][1]
&& movelist[i][1][0] === move[1][0]
&& movelist[i][1][1] === move[1][1]) return true;
}
return false;
},
initialStates: {
Hnefatafl: {
board: function(){return [
"...WWWWW...", // W = attacker
".....W.....", // B = defender
"...........", // k = king on throne
"W....B....W",
"W...BBB...W",
"WW.BBkBB.WW",
"W...BBB...W",
"W....B....W",
"...........",
".....W.....",
"...WWWWW..."]},
to_move: function(){return "W"},
count_pieces : function(board) {
var i, j, whites = 0, blacks = 0;
for (i = 0; i < board.length; ++i) {
for (j = 0; j < board.length; ++j) {
switch (board[i][j]) {
case 'W':
++whites;
break;
case 'B':
case 'k':
case 'K':
++blacks;
break;
}
}
}
return {
W : whites,
B : blacks
};
},
initialStates : {
Hnefatafl : {
board : function() {
return [ "...WWWWW...", // W = attacker
".....W.....", // B = defender
"...........", // k = king on throne
"W....B....W",
"W...BBB...W",
"WW.BBkBB.WW",
"W...BBB...W",
"W....B....W",
"...........",
".....W.....",
"...WWWWW..." ]
},
to_move : function() {
return "W"
},
}
}
};
var TaflUnitTest = function() {
function test(name,a,b) {
if (a !== b) console.log("Unit test '" + name + "' failed: '" + a + "' !== '" + b + "'");
//else console.log("Unit test " + name + " passed");
function test(name, a, b) {
if (a !== b)
console.log("Unit test '" + name + "' failed: '" + a + "' !== '"
+ b + "'");
// else console.log("Unit test " + name + " passed");
}
var state = new TaflState();
state.loadBoard(Tafl.initialStates.Hnefatafl.board());
state.to_move = Tafl.initialStates.Hnefatafl.to_move();
test("is_moving_color 1", true, Tafl.is_moving_color(state, [0, 4])); // W
test("is_moving_color 2", false, Tafl.is_moving_color(state, [1, 4])); // .
test("is_moving_color 3", false, Tafl.is_moving_color(state, [4, 5])); // B
test("is_moving_color 4", false, Tafl.is_moving_color(state, [5, 5])); // k
test("is_not_moving_color 1", false, Tafl.is_not_moving_color(state, [0, 0])); // W
test("is_not_moving_color 2", false, Tafl.is_not_moving_color(state, [1, 4])); // .
test("is_not_moving_color 3", true, Tafl.is_not_moving_color(state, [4, 5])); // B
test("is_not_moving_color 4", true, Tafl.is_not_moving_color(state, [4, 5])); // k
test("is_moving_color 1", true, Tafl.is_moving_color(state, [ 0, 4 ])); // W
test("is_moving_color 2", false, Tafl.is_moving_color(state, [ 1, 4 ])); // .
test("is_moving_color 3", false, Tafl.is_moving_color(state, [ 4, 5 ])); // B
test("is_moving_color 4", false, Tafl.is_moving_color(state, [ 5, 5 ])); // k
test("is_not_moving_color 1", false, Tafl.is_not_moving_color(state,
[ 0, 0 ])); // W
test("is_not_moving_color 2", false, Tafl.is_not_moving_color(state,
[ 1, 4 ])); // .
test("is_not_moving_color 3", true, Tafl.is_not_moving_color(state,
[ 4, 5 ])); // B
test("is_not_moving_color 4", true, Tafl.is_not_moving_color(state,
[ 4, 5 ])); // k
test("loadBoard", state.board[3], "W....B....W");
Tafl.make_move(state, [[10, 7], [10, 9]]);
Tafl.make_move(state, [ [ 10, 7 ], [ 10, 9 ] ]);
test("make_move white", state.board[10], "...WWWW..W.");
Tafl.make_move(state, [[5, 7], [10, 7]]);
Tafl.make_move(state, [ [ 5, 7 ], [ 10, 7 ] ]);
test("make_move black 1", state.board[5], "WW.BBkB..WW");
test("make_move black 2", state.board[10], "...WWWWB.W.");
Tafl.make_move(state, [[10, 9], [10, 8]]);
Tafl.make_move(state, [ [ 10, 9 ], [ 10, 8 ] ]);
test("capture", state.board[10], "...WWWW.W..");
};
var TaflAI = {
// 1 = current player wins, -1 = other player wins
rate_state : function(original_state) {
// We'll change the state, so don't alternate the one given
var state = original_state.clone();
// Prefactor 1 for white, -1 for black
var p = (state.to_move === 'W') ? 1 : -1;
if (Tafl.terminal_test(state) === true) {
if (state.winner === 'W') return p;
if (state.winner === 'B') return -p;
}
// Rating weights
var w = {
captures : 0.4,
freedom : 0.3
};
var rating = 0;
// Rate amount of pieces left
var pieces = Tafl.count_pieces(state.board);
rating -= p * w.captures * (1 - pieces.W / state.initial_W); // every lost W is good for black
rating += p * w.captures * (1 - pieces.B / state.initial_B); // every lost B is good for white
var p_moves = Tafl.legal_moves(state).length;
state.to_move = (state.to_move === 'W') ? 'B' : 'W';
state.legal_moves_cache = null;
var np_moves = Tafl.legal_moves(state).length;
rating += w.freedom * (p_moves - np_moves) / (p_moves + np_moves);
return rating;
},
minimax: function(state, depth) {
var rating = this.rate_state(state);
if ((rating == 1 || rating == -1) || depth <= 0) { return rating; }
var a = -10;
var legal_moves = Tafl.legal_moves(state);
for (var i = 0; i < legal_moves.length; ++i) {
var new_state = state.clone();
Tafl.make_move(new_state, legal_moves[i]);
a = Math.max(a, -this.minimax(new_state, depth - 1));
}
return a;
},
get_best_move: function(state, depth) {
var a = -10;
var legal_moves = Tafl.legal_moves(state);
var best_move;
for (var i = 0; i < legal_moves.length; ++i) {
var new_state = state.clone();
Tafl.make_move(new_state, legal_moves[i]);
var b = -this.minimax(new_state, depth - 1);
if (b > a) {
console.log("Found a move with rating " + b + " that is better than " + a);
best_move = legal_moves[i];
a = b;
}
}
return {alpha: a, move: best_move};
},
};
var exports = {};
exports.tafl = Tafl;
exports.taflstate = TaflState;
exports.taflai = TaflAI;
exports.taflunittest = TaflUnitTest;

92
assets/www/js/touch.js Normal file
View file

@ -0,0 +1,92 @@
redirectMouseToTouch = function(type, originalEvent)
{
//stop propagation, and remove default behavior for everything but INPUT, TEXTAREA & SELECT fields
// originalEvent.stopPropagation();
if (originalEvent.target.tagName.toUpperCase().indexOf("SELECT") == -1 &&
originalEvent.target.tagName.toUpperCase().indexOf("TEXTAREA") == -1 &&
originalEvent.target.tagName.toUpperCase().indexOf("INPUT") == -1) //SELECT, TEXTAREA & INPUT
{
//if(type != 'touchstart')
//originalEvent.stopPropagation();//originalEvent.preventDefault();
//else
//originalEvent.preventDefault();
originalEvent.stopPropagation();
}
var touchevt = document.createEvent("Event");
touchevt.initEvent(type, true, true);
touchevt.touches = new Array();
touchevt.touches[0] = new Object();
touchevt.touches[0].pageX = originalEvent.pageX;
touchevt.touches[0].pageY = originalEvent.pageY;
touchevt.touches[0].target = originalEvent.target;
touchevt.changedTouches = touchevt.touches; //for jqtouch
touchevt.targetTouches = touchevt.touches; //for jqtouch
touchevt.target = originalEvent.target;
originalEvent.target.dispatchEvent(touchevt);
return touchevt;
}
emulateTouchEvents = function()
{
var ee = document;
document.mouseMoving = false;
document.addEventListener("mousedown", function(e)
{
try
{
this.mouseMoving = true;
var touchevt = redirectMouseToTouch("touchstart", e);
if (document.ontouchstart)
document.ontouchstart(touchevt);
if(e.target.ontouchstart)
e.target.ontouchstart(e);
} catch (e) {
}
});
//ee[x].onmouseup=function(e)
document.addEventListener("mouseup", function(e)
{
try
{
this.mouseMoving = false;
var touchevt = redirectMouseToTouch("touchend", e);
if (document.ontouchend)
document.ontouchend(touchevt);
if(e.target.ontouchend)
e.target.ontouchend(e);
}
catch (e) {
}
});
//ee[x].onmousemove=function(e)
document.addEventListener("mousemove", function(e)
{
try
{
if (!this.mouseMoving)
return
var touchevt = redirectMouseToTouch("touchmove", e);
if (document.ontouchmove)
document.ontouchmove(touchevt);
if(e.target.ontouchmove)
e.target.ontouchmove(e);
}
catch (e) {
}
});
// }
}
emulateTouchEvents();
window.addEventListener("resize",function(){
var touchevt = document.createEvent("Event");
touchevt.initEvent("orientationchange", true, true);
document.dispatchEvent(touchevt);
},false);

View file

@ -1,181 +1,306 @@
jo.load();
//Test
//TaflUnitTest();
var uiScreen;
/* Initialize and prepare the game */
var tafl_game = new TaflState();
tafl_game.loadBoard(Tafl.initialStates.Hnefatafl.board());
tafl_game.to_move = Tafl.initialStates.Hnefatafl.to_move();
var N = tafl_game.board.length;
var uiBoard;
var myColor;
function prepareBoard(board) {
var ret_board = [];
for (var i=0; i<board.length; ++i) {
ret_board.push(board[i].split(''));
}
return ret_board;
}
function updateBoard(board) {
var N = board.length;
/* Create special boardui objects that handles ui related game functions */
var boardui = {
moveFrom: null,
my_color: 'W',
activeField: null,
active_field: null,
for (var i=0; i<board.length; ++i) {
for (var j=0; j<board[i].length; ++j) {
uiBoard.data[i][j] = board[i][j];
}
}
}
/* Subclass of joTable */
joTaflBoard = function(data) {
joTable.apply(this, arguments);
};
joTaflBoard.extend(joTable, {
tagName: "jotaflboard",
max_width: null,
max_height: null,
// default row formatter
formatItem: function(row, index) {
var tr = document.createElement("tr");
is_ai: {'W': false, 'B': true },
for (var i = 0, l = row.length; i < l; i++) {
var o = document.createElement("td");
//o.innerHTML = row[i];
o.innerHTML = "&nbsp;";
// this is a little brittle, but plays nicely with joList's select event
o.setAttribute("index", index * l + i);
o.setAttribute("type", row[i]);
var classes;
switch (row[i]) {
case "k": classes="K throne"; break;
case ",": classes="throne"; break;
case ".": classes="empty"; break;
default: classes=row[i];
}
o.setAttribute("class", classes);
tr.appendChild(o);
}
init: function() {
this.max_width = document.getElementById('board').offsetWidth;
this.max_height = document.getElementById('board').offsetHeight;
return tr;
return (this.max_width > 0 && this.max_height > 0);
},
setCell: function(i, j) {
this.setValue(i*this.data.length + j);
}
});
var uiBoardData = prepareBoard(tafl_game.board);
var uiBoard = new joTaflBoard(uiBoardData);
// Build board widget and connect events
var moveFrom = null;
uiBoard.selectEvent.subscribe(function(index, table){
if (tafl_game.to_move !== myColor) {
// not my turn
table.deselect();
return;
};
get_classes: function(type) {
switch (type) {
case 'W': return ['white'];
case 'B': return ['black'];
case 'K': return ['king'];
case 'k': return ['king','throne'];
case ',': return ['throne'];
default: return ['empty'];
};
},
var i = table.getRow();
var j = table.getCol();
if (moveFrom === null) {
if (Tafl.is_moving_color(tafl_game, [i, j])) {
fill_board: function(board) {
var N = board.length;
for (var i = 0; i < N; ++i) {
var row = $('<div class="row"></div>');
// Check if there is a move possible from this location
var legal_moves = Tafl.legal_moves(tafl_game);
for (var k = 0; k < legal_moves.length; ++k) {
if (legal_moves[k][0][0] === i && legal_moves[k][0][1] === j) {
moveFrom = [i,j];
return;
for (var j = 0; j < N; ++j) {
var square_classes = this.get_classes(board[i][j]).join(' ');
var square = $('<div id="square_'+i+'_'+j+'" class="square '+square_classes+'">&nbsp;</div>');
square.data("square_i", i);
square.data("square_j", j);
square.data("type", board[i][j]);
row.append(square);
}
$("#board").append(row);
}
$("#board").on("click", "div.square", this.square_clicked);
},
update_board: function(board) {
var N = board.length;
for (var i = 0; i < N; ++i) {
for (var j = 0; j < N; ++j) {
var square = $("#square_" + i + "_" + j);
if (square.data("type") !== board[i][j]) { // something changed
// Remove old classes
$.each(this.get_classes(square.data("type")), function(x,cls) {
square.removeClass(cls);
});
// Add new classes
$.each(this.get_classes(board[i][j]), function(x,cls) {
square.addClass(cls);
});
square.data("type", board[i][j]);
}
}
// If this is reached, no possible move from here
}
},
fix_board_size: function() {
function styleToPx(style) {
return parseInt(style.substr(0, style.length-2));
}
table.deselect();
} else {
if (moveFrom[0] === i && moveFrom[1] === j) { // Deactivate active piece
moveFrom = null;
var cont = $("#game_container");
var width = cont[0].offsetWidth - styleToPx(cont.css("padding-left")) - styleToPx(cont.css("padding-right"));
var height = cont[0].offsetHeight - styleToPx(cont.css("padding-top")) - styleToPx(cont.css("padding-bottom"));
if (width > height) {
$("#board").css('width', height + "px");
$("#board").css('height', height + "px");
} else {
$("#board").css('height', width + "px");
$("#board").css('width', width + "px");
}
},
activate: function(i,j) {
this.deactivate();
this.active_field = $("#square_"+i+"_"+j);
this.active_field.addClass("active");
},
deactivate: function() {
if (this.active_field) {
this.active_field.removeClass("active");
this.active_field = null;
}
},
square_clicked: function() {
if (tafl_game.to_move !== boardui.my_color) {
// not my turn
return;
};
var i = parseInt($(this).data("square_i"));
var j = parseInt($(this).data("square_j"));
//this.style.border = '2px solid green';
if (boardui.moveFrom === null) {
if (Tafl.is_moving_color(tafl_game, [i, j])) {
// Check if there is a move possible from this location
var legal_moves = Tafl.legal_moves(tafl_game);
for (var k = 0; k < legal_moves.length; ++k) {
if (legal_moves[k][0][0] === i && legal_moves[k][0][1] === j) {
boardui.moveFrom = [i,j];
boardui.activate(i, j);
return;
}
}
// If this is reached, no possible move from here
}
} else {
if (boardui.moveFrom[0] === i && boardui.moveFrom[1] === j) { // Deactivate active piece
boardui.moveFrom = null;
boardui.deactivate();
return;
}
try {
var move = [boardui.moveFrom, [i, j]];
boardui.make_move(move);
TaflNet.send_move(move);
boardui.moveFrom = null;
boardui.deactivate();
} catch(e) {
if (e === "IllegalMove") {
boardui.moveFrom = null;
boardui.deactivate();
console.log("IllegalMove");
} else if (e === "NotConnected") {
boardui.moveFrom = null;
boardui.deactivate();
} else {
throw e;
}
}
}
},
make_move: function(move) {
Tafl.make_move(tafl_game, move);
this.update_board(tafl_game.board);
if (Tafl.terminal_test(tafl_game) === true) {
// Game ended
var win_reason;
switch(tafl_game.win_reason) {
case 'NoKing': win_reason = 'The King was captured.'; break;
case 'KingEscaped': win_reason = 'The King escaped.'; break;
case 'NoLegalMoves': win_reason = 'There are no legal moves.'; break;
default: win_reason = 'For a unknown reason';
}
var winner = (tafl_game.winner == 'W')?'White':'Black';
boardui.alert(win_reason + "<br/>" + winner + " player wins.");
} else {
// Check if AI has to make the next move, and if so do it
boardui.make_ai_move();
}
},
make_ai_move: function() {
console.log(boardui.is_ai[tafl_game.to_move]);
if (boardui.is_ai[tafl_game.to_move] !== true) {
return;
}
try {
var move = [moveFrom, [i, j]];
makeMove(move);
TaflNet.send_move(move);
moveFrom = null;
table.deselect();
} catch(e) {
if (e === "IllegalMove") {
table.deselect();
moveFrom = null;
joLog("IllegalMove");
} else {
throw e;
}
}
}
// Start new thread for this
setTimeout(function() {
var ai_move = TaflAI.get_best_move(tafl_game, 2);
boardui.make_move(ai_move.move);
}, 0);
},
alert: function(message) {
$.ui.popup(message);
},
rate_current_state: function() {
var score = TaflAI.rate_state(tafl_game);
$("#score").text(score);
},
};
$().ready(function(){
// Fill board
var waitForCss = setInterval(function(){
if (boardui.init()) {
// Game init successful
clearInterval(waitForCss);
boardui.fix_board_size();
boardui.fill_board(tafl_game.board);
}
}, 50);
window.onresize = function() {
setTimeout(boardui.fix_board_size, 50);
};
/*
window.onorientationchange = function() {
console.log(window.orientation);
switch (window.orientation) {
case 90:
case -90:
boardui.fix_board_size();
break;
default:
boardui.fix_board_size();
break;
}
};
*/
});
function makeMove(move) {
Tafl.make_move(tafl_game, move);
var game_starter = {
network_game: function() {
TaflNet.connect();
document.addEventListener("pause", killNet, false);
document.addEventListener("offline", killNet, false);
},
updateBoard(tafl_game.board);
uiBoard.refresh();
game_vs_white_ai: function() {
boardui.is_ai['W'] = true;
boardui.is_ai['B'] = false;
boardui.my_color = 'B';
boardui.make_ai_move();
},
if (Tafl.terminal_test(tafl_game) === true) {
// Game ended
var win_reason;
game_vs_black_ai: function() {
boardui.is_ai['W'] = false;
boardui.is_ai['B'] = true;
boardui.my_color = 'W';
switch(tafl_game.win_reason) {
case 'NoKing': win_reason = 'The King was captured.'; break;
case 'KingEscaped': win_reason = 'The King escaped.'; break;
case 'NoLegalMoves': win_reason = 'There are no legal moves.'; break;
default: win_reason = 'For a unknown reason';
}
var winner = (tafl_game.winner == 'W')?'White':'Black';
uiScreen.alert(win_reason + "<br/>" + winner + " player wins.");
}
}
// Build page
var uiCard = new joCard([
new joTitle("Androtafl"),
uiBoard
]);
var uiStack = new joStack();
var uiScreen = new joScreen(uiStack);
uiStack.push(uiCard);
// Connect Network
TaflNet.connect();
boardui.make_ai_move();
},
};
TaflNet.on_game_start = function(data) {
myColor = data.your_color;
var colorName = (myColor == 'W')?'White':'Black';
boardui.my_color = data.your_color;
var colorName = (data.your_color == 'W')?'White':'Black';
uiScreen.alert("Game started. You're " + colorName);
boardui.alert("Game started. You're " + colorName);
};
TaflNet.on_move = function(move) {
makeMove(move);
boardui.make_move(move);
boardui.activate(move[1][0], move[1][1]);
};
// Hook up some events to kill the network if app closes
function killNet() {
var s = TaflNet.socket;
s.disconnect();
}

View file

@ -6,10 +6,23 @@ var tafllib = require('../assets/www/js/tafl');
var tafl = tafllib.tafl;
var games = {};
var players = {};
var sockets_waiting = [];
var ready = function(socket) { socket.emit('ready'); };
function generateRandomString(entropy) {
if (! entropy) { entropy = 8; }
var characters = 'abcdefghijklmnopqrstuvwxyz0123456789';
var randStr = '';
for (var i = 0; i < entropy; ++i) {
randStr += characters[Math.floor(Math.random() * characters.length)];
}
return randStr;
}
io.sockets.on('connection', function(socket) {
socket.emit('server.hello');
@ -22,8 +35,17 @@ io.sockets.on('connection', function(socket) {
socket.set('game.id', game_id, ready(socket));
});
socket.on('client.hello', function() {
console.log("Got hello");
socket.on('client.hello', function(user_id) {
// generate user-id
if (! user_id)
user_id = generateRandomString(16);
socket.set('player.id', user_id);
socket.emit('player.id.set', user_id);
players[user_id] = socket;
console.log("Got hello from " + user_id);
});
socket.on('game.find_opponent', function() {