diff --git a/README.md b/README.md index f64ae32b7..8f536812c 100644 --- a/README.md +++ b/README.md @@ -1,16 +1,16 @@ [OpenSprinkler Hosted Controller](http://salbahra.github.io/OpenSprinkler-Hosted-Controller) ======================== -A mobile frontend for the OpenSprinkler irrigation device. Designed to allow manual control, program management (view, edit, delete and add), initiate a run-once program, view status, adjust rain delay, and change OpenSprinkler settings. - -This version is designed for multiple users and uses no central storage. This version does not have the logging feature and also lacks weather based rain delay. Please see the main version of this software [here](https://github.com/salbahra/OpenSprinkler-Controller) +A mobile frontend for the OpenSprinkler irrigation device. Designed to allow manual control, program management (view, edit, delete and add), initiate a run-once program, view status, adjust rain delay, and change OpenSprinkler settings. Screenshots available below. Overview: --------- + This application interfaces with the interval program on the OpenSprinkler which is the default software available. The application has been tested on firmware version 2.0.0 but should be compatible with 1.8.x and newer. -+ This software requires direct access to your OpenSprinkler which may require port forwarding. ++ The provided interface does not rely on the javascript files hosted by Ray therefore will work on a locally hosted server even without an internet connection (with the local asset option enabled, which is disabled by default). However an internet connection (with a properly configured web server and port forwarding) will allow you to access the application from anywhere. + ++ The application is written in Javascript and HTML/CSS. + For current discussion about the project please refer to the [forum post](http://rayshobby.net/phpBB3/viewtopic.php?f=2&t=154). @@ -23,42 +23,30 @@ Very well put together by Ray, thanks! Screenshots: ------------ -![Splash Screen](http://albahra.com/journal/wp-content/uploads/2013/07/startup-iphone5-retina-175x300.png) ![Home Screen](http://albahra.com/journal/wp-content/uploads/2013/07/iOS-Simulator-Screen-shot-Jul-18-2013-6.36.32-PM-169x300.png) ![Status Page](http://albahra.com/journal/wp-content/uploads/2013/07/iOS-Simulator-Screen-shot-Jul-23-2013-6.24.41-PM-169x300.png) ![Program Preview](http://albahra.com/journal/wp-content/uploads/2013/07/iOS-Simulator-Screen-shot-Jul-2-2013-10.46.37-PM-169x300.png) ![Program Editor](http://albahra.com/journal/wp-content/uploads/2013/07/iOS-Simulator-Screen-shot-Jul-27-2013-5.55.42-PM-169x300.png) ![Manual Program](http://albahra.com/journal/wp-content/uploads/2013/07/iOS-Simulator-Screen-shot-Jul-2-2013-10.30.53-PM-169x300.png) ![Rain Delay](http://albahra.com/journal/wp-content/uploads/2013/07/iOS-Simulator-Screen-shot-Jul-2-2013-10.56.03-PM-169x300.png) ![Run Once](http://albahra.com/journal/wp-content/uploads/2013/07/iOS-Simulator-Screen-shot-Jul-31-2013-8.40.23-PM-169x300.png) ![Settings](http://albahra.com/journal/wp-content/uploads/2013/08/iOS-Simulator-Screen-shot-Aug-1-2013-6.52.25-PM-169x300.png) - - -Raspberry Pi Users: -------------------- +![Splash Screen](http://albahra.com/journal/wp-content/uploads/2013/07/startup-iphone5-retina-175x300.png) ![Home Screen](http://albahra.com/journal/wp-content/uploads/2014/02/iOS-Simulator-Screen-shot-Jan-26-2014-7.15.37-PM-169x300.png) ![Status Page](http://albahra.com/journal/wp-content/uploads/2014/02/iOS-Simulator-Screen-shot-Jan-26-2014-7.15.45-PM-169x300.png) ![Program Preview](http://albahra.com/journal/wp-content/uploads/2014/02/iOS-Simulator-Screen-shot-Feb-9-2014-4.25.52-PM-169x300.png) ![Program Editor](http://albahra.com/journal/wp-content/uploads/2014/02/iOS-Simulator-Screen-shot-Jan-26-2014-7.24.09-PM-169x300.png) ![Manual Program](http://albahra.com/journal/wp-content/uploads/2014/02/iOS-Simulator-Screen-shot-Jan-26-2014-7.24.18-PM-169x300.png) ![Rain Delay](http://albahra.com/journal/wp-content/uploads/2014/02/iOS-Simulator-Screen-shot-Feb-9-2014-4.23.45-PM-169x300.png) ![Run Once](http://albahra.com/journal/wp-content/uploads/2014/02/iOS-Simulator-Screen-shot-Jan-26-2014-7.24.54-PM-169x300.png) ![Settings](http://albahra.com/journal/wp-content/uploads/2014/02/iOS-Simulator-Screen-shot-Feb-9-2014-4.26.09-PM-169x300.png) -+ The application should also operate on the OpenSprinkler for Raspberry Pi so long the Raspberry Pi has the interval program installed. More information is available on [Ray's Blog Post](http://rayshobby.net/?p=6339). - + This is a seperate program that needs to be running on the Raspberry Pi. - + Please rememeber this is a front end for a hardware device. In the case of the OpenSprinkler Pi, the hardware happens to be the Pi combined with the interval program software. - -+ In order for the interval program to be 100% compatibile with the web app you must be using an interval program built on or after June 22, 2013. Install Instructions: --------------------- -+ You first need a working OpenSprinkler setup that you can access via a browser - + For further information please refer to the OpenSprinkler online user manual available on [Ray's Website](http://rayshobby.net/?page_id=192) - -+ Install prerequisites as needed (example for Debian using Apache web server) - + ```apt-get install apache2 php5 libapache2-mod-php5 git``` +```sh +#install files +git clone https://github.com/salbahra/OpenSprinkler-Hosted-Controller.git /var/www/sprinklers -+ Create the directory you wish to place the files in (ex. /var/www/sprinklers for http://yourwebsite/sprinklers) - + ```mkdir -m 777 /var/www/sprinklers``` +``` +> If you don't have Git, you can download the [ZIP](https://github.com/salbahra/OpenSprinkler-Controller/archive/master.zip) file and extract to a local directory. -+ Download the files to your web directory using git - + ```git clone https://github.com/salbahra/OpenSprinkler-Hosted-Controller.git /var/www/sprinklers``` ++ Now, visit the site using any browser (replacing IPAddr with the server IP): http://IPAddr/sprinklers -+ From there you may attempt to access the front end which will guide you through the rest of the install process. +> The webapp can also be installed to the SD card of the OpenSprinkler and run directly from the device. For this you will need to grab the specially formatted version from the sdcard branch. Update Instructions: -------------------- -+ Navigate to the web directory where the files are stored - + ```cd /var/www/sprinklers``` - -+ Trigger a remote update using git - + ```git pull``` +```sh +#change to the install directory +cd /var/www/sprinklers -[![githalytics.com alpha](https://cruel-carlota.pagodabox.com/87d3c8783710e88024be2bf608fe8195 "githalytics.com")](http://githalytics.com/salbahra/OpenSprinkler-Controller) \ No newline at end of file +#perform update +git pull +``` diff --git a/config.php b/config.php deleted file mode 100644 index 136b0344b..000000000 --- a/config.php +++ /dev/null @@ -1,6 +0,0 @@ - \ No newline at end of file diff --git a/css/jquery.mobile.flatui.min.css b/css/jquery.mobile.flatui.min.css deleted file mode 100644 index 905347001..000000000 --- a/css/jquery.mobile.flatui.min.css +++ /dev/null @@ -1 +0,0 @@ -.ui-bar-a{border:1px solid #2c3e50;background:#2c3e50;color:#fff;font-weight:700;font-family:Lato,sans-serif}.ui-bar-a .ui-link-inherit{color:#3e3e3e}.ui-bar-a a.ui-link{color:#7cc4e7;font-weight:700}.ui-bar-a a.ui-link:visited{color:#2489ce}.ui-bar-a a.ui-link:hover{color:#2489ce}.ui-bar-a a.ui-link:active{color:#2489ce}.ui-bar-a input,.ui-bar-a select,.ui-bar-a textarea,.ui-bar-a button{font-family:Lato,sans-serif}.ui-body-a,.ui-overlay-a{border:2px solid #2c3e50;color:#34495e;background:#2c3e50;background-image:none}.ui-body-a{font-family:Lato,sans-serif}.ui-body-a input,.ui-body-a select,.ui-body-a textarea,.ui-body-a button{font-family:Lato,sans-serif}.ui-body-a .ui-link-inherit{color:#333}.ui-body-a .ui-link{color:#2c3e50;font-weight:700}.ui-body-a .ui-link:visited,.ui-body-a .ui-link:hover,.ui-body-a .ui-link:active{color:#4e6d8d}.ui-body-a.ui-input-text{border:2px solid #eee}.ui-body-a.ui-input-text.ui-focus{border:2px solid #4e6d8d;-webkit-transition:border linear .2s;-moz-transition:border linear .2s;-o-transition:border linear .2s;transition:border linear .2s}.ui-btn-up-a{border:1px solid #2c3e50;background:#2c3e50;font-weight:700;color:#fff}.ui-btn-up-a:visited,.ui-btn-up-a a.ui-link-inherit{color:#fff}.ui-btn-hover-a{border:1px solid #4e6d8d;background:#4e6d8d;font-weight:700;color:#fff}.ui-btn-hover-a:visited,.ui-btn-hover-a:hover,.ui-btn-hover-a a.ui-link-inherit{color:#fff}.ui-btn-down-a{border:1px solid #4e6d8d;background:#4e6d8d;font-weight:700;color:#fff}.ui-btn-down-a:visited,.ui-btn-down-a:hover,.ui-btn-down-a a.ui-link-inherit{color:#fff}.ui-btn-up-a,.ui-btn-hover-a,.ui-btn-down-a{font-family:Lato,sans-serif;text-decoration:none}.ui-bar-a .ui-btn-up-a,.ui-bar-a .ui-btn-down-a,.ui-bar-a .ui-btn-hover-a{background-color:#2c3e50;border:1px solid #2c3e50}.ui-bar-b{border:1px solid #16a085;background:#16a085;color:#fff;font-weight:700;font-family:Lato,sans-serif}.ui-bar-b .ui-link-inherit{color:#3e3e3e}.ui-bar-b a.ui-link{color:#7cc4e7;font-weight:700}.ui-bar-b a.ui-link:visited{color:#2489ce}.ui-bar-b a.ui-link:hover{color:#2489ce}.ui-bar-b a.ui-link:active{color:#2489ce}.ui-bar-b input,.ui-bar-b select,.ui-bar-b textarea,.ui-bar-b button{font-family:Lato,sans-serif}.ui-body-b,.ui-overlay-b{border:2px solid #16a085;color:#34495e;background:#fff;background-image:none}.ui-body-b{font-family:Lato,sans-serif}.ui-body-b input,.ui-body-b select,.ui-body-b textarea,.ui-body-b button{font-family:Lato,sans-serif}.ui-body-b .ui-link-inherit{color:#333}.ui-body-b .ui-link{color:#16a085;font-weight:700}.ui-body-b .ui-link:visited,.ui-body-b .ui-link:hover,.ui-body-b .ui-link:active{color:#1abc9c}.ui-body-b.ui-input-text{border:2px solid #eee}.ui-body-b.ui-input-text.ui-focus{border:2px solid #1abc9c;-webkit-transition:border linear .2s;-moz-transition:border linear .2s;-o-transition:border linear .2s;transition:border linear .2s}.ui-btn-up-b{border:1px solid #16a085;background:#16a085;font-weight:700;color:#fff}.ui-btn-up-b:visited,.ui-btn-up-b a.ui-link-inherit{color:#fff}.ui-btn-hover-b{border:1px solid #1abc9c;background:#1abc9c;font-weight:700;color:#fff}.ui-btn-hover-b:visited,.ui-btn-hover-b:hover,.ui-btn-hover-b a.ui-link-inherit{color:#fff}.ui-btn-down-b{border:1px solid #1abc9c;background:#1abc9c;font-weight:700;color:#fff}.ui-btn-down-b:visited,.ui-btn-down-b:hover,.ui-btn-down-b a.ui-link-inherit{color:#fff}.ui-btn-up-b,.ui-btn-hover-b,.ui-btn-down-b{font-family:Lato,sans-serif;text-decoration:none}.ui-bar-b .ui-btn-up-a,.ui-bar-b .ui-btn-down-a,.ui-bar-b .ui-btn-hover-a{background-color:#16a085;border:1px solid #16a085}.ui-bar-c{border:1px solid #f2f2f2;background:#f2f2f2;color:#000;font-weight:700;font-family:Lato,sans-serif}.ui-bar-c .ui-link-inherit{color:#3e3e3e}.ui-bar-c a.ui-link{color:#7cc4e7;font-weight:700}.ui-bar-c a.ui-link:visited{color:#2489ce}.ui-bar-c a.ui-link:hover{color:#2489ce}.ui-bar-c a.ui-link:active{color:#2489ce}.ui-bar-c input,.ui-bar-c select,.ui-bar-c textarea,.ui-bar-c button{font-family:Lato,sans-serif}.ui-body-c,.ui-overlay-c{border:2px solid #f2f2f2;color:#34495e;background:#fff;background-image:none}.ui-body-c{font-family:Lato,sans-serif}.ui-body-c input,.ui-body-c select,.ui-body-c textarea,.ui-body-c button{font-family:Lato,sans-serif}.ui-body-c .ui-link-inherit{color:#333}.ui-body-c .ui-link{color:#2c3e50;font-weight:700}.ui-body-c .ui-link:visited,.ui-body-c .ui-link:hover,.ui-body-c .ui-link:active{color:#eee}.ui-body-c.ui-input-text{border:2px solid #eee}.ui-body-c.ui-input-text.ui-focus{border:2px solid #eee;-webkit-transition:border linear .2s;-moz-transition:border linear .2s;-o-transition:border linear .2s;transition:border linear .2s}.ui-btn-up-c{border:1px solid #f2f2f2;background:#f2f2f2;font-weight:700;color:#000}.ui-btn-up-c:visited,.ui-btn-up-c a.ui-link-inherit{color:#000}.ui-btn-hover-c{border:1px solid #eee;background:#eee;font-weight:700;color:#000}.ui-btn-hover-c:visited,.ui-btn-hover-c:hover,.ui-btn-hover-c a.ui-link-inherit{color:#000}.ui-btn-down-c{border:1px solid #eee;background:#dedede;font-weight:700;color:#000}.ui-btn-down-c:visited,.ui-btn-down-c:hover,.ui-btn-down-c a.ui-link-inherit{color:#000}.ui-btn-up-c,.ui-btn-hover-c,.ui-btn-down-c{font-family:Lato,sans-serif;text-decoration:none;border: 1px solid #dedede;}.ui-bar-c .ui-btn-up-a,.ui-bar-c .ui-btn-down-a,.ui-bar-c .ui-btn-hover-a{background-color:#f2f2f2;border:1px solid #f2f2f2}.ui-bar-d{border:1px solid #c1392b;background:#c1392b;color:#fff;font-weight:700;font-family:Lato,sans-serif}.ui-bar-d .ui-link-inherit{color:#3e3e3e}.ui-bar-d a.ui-link{color:#7cc4e7;font-weight:700}.ui-bar-d a.ui-link:visited{color:#2489ce}.ui-bar-d a.ui-link:hover{color:#2489ce}.ui-bar-d a.ui-link:active{color:#2489ce}.ui-bar-d input,.ui-bar-d select,.ui-bar-d textarea,.ui-bar-d button{font-family:Lato,sans-serif}.ui-body-d,.ui-overlay-d{border:2px solid #c1392b;color:#34495e;background:#fff;background-image:none}.ui-body-d{font-family:Lato,sans-serif}.ui-body-d input,.ui-body-d select,.ui-body-d textarea,.ui-body-d button{font-family:Lato,sans-serif}.ui-body-d .ui-link-inherit{color:#333}.ui-body-d .ui-link{color:#c0392b;font-weight:700}.ui-body-d .ui-link:visited,.ui-body-d .ui-link:hover,.ui-body-d .ui-link:active{color:#e84c3d}.ui-body-d.ui-input-text{border:2px solid #eee}.ui-body-d.ui-input-text.ui-focus{border:2px solid #e84c3d;-webkit-transition:border linear .2s;-moz-transition:border linear .2s;-o-transition:border linear .2s;transition:border linear .2s}.ui-btn-up-d{border:1px solid #c1392b;background:#c1392b;font-weight:700;color:#fff}.ui-btn-up-d:visited,.ui-btn-up-d a.ui-link-inherit{color:#fff}.ui-btn-hover-d{border:1px solid #e84c3d;background:#e84c3d;font-weight:700;color:#fff}.ui-btn-hover-d:visited,.ui-btn-hover-d:hover,.ui-btn-hover-d a.ui-link-inherit{color:#fff}.ui-btn-down-d{border:1px solid #e84c3d;background:#e84c3d;font-weight:700;color:#fff}.ui-btn-down-d:visited,.ui-btn-down-d:hover,.ui-btn-down-d a.ui-link-inherit{color:#fff}.ui-btn-up-d,.ui-btn-hover-d,.ui-btn-down-d{font-family:Lato,sans-serif;text-decoration:none}.ui-bar-d .ui-btn-up-a,.ui-bar-d .ui-btn-down-a,.ui-bar-d .ui-btn-hover-a{background-color:#c1392b;border:1px solid #c1392b}.ui-bar-e{border:1px solid #f1c40f;background:#f1c40f;color:#fff;font-weight:700;font-family:Lato,sans-serif}.ui-bar-e .ui-link-inherit{color:#3e3e3e}.ui-bar-e a.ui-link{color:#7cc4e7;font-weight:700}.ui-bar-e a.ui-link:visited{color:#2489ce}.ui-bar-e a.ui-link:hover{color:#2489ce}.ui-bar-e a.ui-link:active{color:#2489ce}.ui-bar-e input,.ui-bar-e select,.ui-bar-e textarea,.ui-bar-e button{font-family:Lato,sans-serif}.ui-body-e,.ui-overlay-e{border:2px solid #f1c40f;color:#34495e;background:#fff;background-image:none}.ui-body-e{font-family:Lato,sans-serif}.ui-body-e input,.ui-body-e select,.ui-body-e textarea,.ui-body-e button{font-family:Lato,sans-serif}.ui-body-e .ui-link-inherit{color:#333}.ui-body-e .ui-link{color:#f1c40f;font-weight:700}.ui-body-e .ui-link:visited,.ui-body-e .ui-link:hover,.ui-body-e .ui-link:active{color:#f4d03f}.ui-body-e.ui-input-text{border:2px solid #eee}.ui-body-e.ui-input-text.ui-focus{border:2px solid #f4d03f;-webkit-transition:border linear .2s;-moz-transition:border linear .2s;-o-transition:border linear .2s;transition:border linear .2s}.ui-btn-up-e{border:1px solid #f1c40f;background:#f1c40f;font-weight:700;color:#fff}.ui-btn-up-e:visited,.ui-btn-up-e a.ui-link-inherit{color:#fff}.ui-btn-hover-e{border:1px solid #f4d03f;background:#f4d03f;font-weight:700;color:#fff}.ui-btn-hover-e:visited,.ui-btn-hover-e:hover,.ui-btn-hover-e a.ui-link-inherit{color:#fff}.ui-btn-down-e{border:1px solid #f4d03f;background:#f4d03f;font-weight:700;color:#fff}.ui-btn-down-e:visited,.ui-btn-down-e:hover,.ui-btn-down-e a.ui-link-inherit{color:#fff}.ui-btn-up-e,.ui-btn-hover-e,.ui-btn-down-e{font-family:Lato,sans-serif;text-decoration:none}.ui-bar-e .ui-btn-up-a,.ui-bar-e .ui-btn-down-a,.ui-bar-e .ui-btn-hover-a{background-color:#f1c40f;border:1px solid #f1c40f}.ui-bar-f{border:1px solid #3498db;background:#3498db;color:#fff;font-weight:700;font-family:Lato,sans-serif}.ui-bar-f .ui-link-inherit{color:#3e3e3e}.ui-bar-f a.ui-link{color:#7cc4e7;font-weight:700}.ui-bar-f a.ui-link:visited{color:#2489ce}.ui-bar-f a.ui-link:hover{color:#2489ce}.ui-bar-f a.ui-link:active{color:#2489ce}.ui-bar-f input,.ui-bar-f select,.ui-bar-f textarea,.ui-bar-f button{font-family:Lato,sans-serif}.ui-body-f,.ui-overlay-f{border:2px solid #3498db;color:#34495e;background:#fff;background-image:none}.ui-body-f{font-family:Lato,sans-serif}.ui-body-f input,.ui-body-f select,.ui-body-f textarea,.ui-body-f button{font-family:Lato,sans-serif}.ui-body-f .ui-link-inherit{color:#333}.ui-body-f .ui-link{color:#3498db;font-weight:700}.ui-body-f .ui-link:visited,.ui-body-f .ui-link:hover,.ui-body-f .ui-link:active{color:#5dade2}.ui-body-f.ui-input-text{border:2px solid #eee}.ui-body-f.ui-input-text.ui-focus{border:2px solid #5dade2;-webkit-transition:border linear .2s;-moz-transition:border linear .2s;-o-transition:border linear .2s;transition:border linear .2s}.ui-btn-up-f{border:1px solid #3498db;background:#3498db;font-weight:700;color:#fff}.ui-btn-up-f:visited,.ui-btn-up-f a.ui-link-inherit{color:#fff}.ui-btn-hover-f{border:1px solid #5dade2;background:#5dade2;font-weight:700;color:#fff}.ui-btn-hover-f:visited,.ui-btn-hover-f:hover,.ui-btn-hover-f a.ui-link-inherit{color:#fff}.ui-btn-down-f{border:1px solid #5dade2;background:#5dade2;font-weight:700;color:#fff}.ui-btn-down-f:visited,.ui-btn-down-f:hover,.ui-btn-down-f a.ui-link-inherit{color:#fff}.ui-btn-up-f,.ui-btn-hover-f,.ui-btn-down-f{font-family:Lato,sans-serif;text-decoration:none}.ui-bar-f .ui-btn-up-a,.ui-bar-f .ui-btn-down-a,.ui-bar-f .ui-btn-hover-a{background-color:#3498db;border:1px solid #3498db}.ui-bar-g{border:1px solid #2ecc71;background:#2ecc71;color:#fff;font-weight:700;font-family:Lato,sans-serif}.ui-bar-g .ui-link-inherit{color:#3e3e3e}.ui-bar-g a.ui-link{color:#7cc4e7;font-weight:700}.ui-bar-g a.ui-link:visited{color:#2489ce}.ui-bar-g a.ui-link:hover{color:#2489ce}.ui-bar-g a.ui-link:active{color:#2489ce}.ui-bar-g input,.ui-bar-g select,.ui-bar-g textarea,.ui-bar-g button{font-family:Lato,sans-serif}.ui-body-g,.ui-overlay-g{border:2px solid #2ecc71;color:#34495e;background:#fff;background-image:none}.ui-body-g{font-family:Lato,sans-serif}.ui-body-g input,.ui-body-g select,.ui-body-g textarea,.ui-body-g button{font-family:Lato,sans-serif}.ui-body-g .ui-link-inherit{color:#333}.ui-body-g .ui-link{color:#2ecc71;font-weight:700}.ui-body-g .ui-link:visited,.ui-body-g .ui-link:hover,.ui-body-g .ui-link:active{color:#55d98d}.ui-body-g.ui-input-text{border:2px solid #eee}.ui-body-g.ui-input-text.ui-focus{border:2px solid #55d98d;-webkit-transition:border linear .2s;-moz-transition:border linear .2s;-o-transition:border linear .2s;transition:border linear .2s}.ui-btn-up-g{border:1px solid #2ecc71;background:#2ecc71;font-weight:700;color:#fff}.ui-btn-up-g:visited,.ui-btn-up-g a.ui-link-inherit{color:#fff}.ui-btn-hover-g{border:1px solid #55d98d;background:#55d98d;font-weight:700;color:#fff}.ui-btn-hover-g:visited,.ui-btn-hover-g:hover,.ui-btn-hover-g a.ui-link-inherit{color:#fff}.ui-btn-down-g{border:1px solid #55d98d;background:#55d98d;font-weight:700;color:#fff}.ui-btn-down-g:visited,.ui-btn-down-g:hover,.ui-btn-down-g a.ui-link-inherit{color:#fff}.ui-btn-up-g,.ui-btn-hover-g,.ui-btn-down-g{font-family:Lato,sans-serif;text-decoration:none}.ui-bar-g .ui-btn-up-a,.ui-bar-g .ui-btn-down-a,.ui-bar-g .ui-btn-hover-a{background-color:#2ecc71;border:1px solid #2ecc71}.ui-btn-active{border:1px solid #1abc9c;background:#1abc9c;font-weight:700;color:#fff;cursor:pointer;text-decoration:none;font-family:Lato,sans-serif}.ui-btn-active:visited,.ui-btn-active:hover,.ui-btn-active a.ui-link-inherit{color:#fff}.ui-btn-active.ui-slider-bg{background:#1abc9c}.ui-slider-handle{background:#16a085;border:1px solid #16a085}.ui-slider-label.ui-btn-corner-all,.ui-slider-switch.ui-btn-corner-all{border-radius:1em;-webkit-border-radius:1em}.ui-slider-handle.ui-btn-corner-all{border-radius:50%;-webkit-border-radius:50%}input.ui-input-text.ui-slider-input{border:2px solid #eee!important}.ui-corner-all{-webkit-border-radius:6px;border-radius:6px}.ui-br{border-color:#828282;border-color:rgba(130,130,130,.3);border-style:solid}.ui-disabled{filter:Alpha(Opacity=30);opacity:.3;zoom:1}.ui-disabled,.ui-disabled a{cursor:default!important;pointer-events:none}.ui-icon,.ui-icon-searchfield:after{background-repeat:no-repeat;width:20px;height:20px;-moz-border-radius:10px;-webkit-border-radius:10px;border-radius:10px;line-height:16px;color:#fff}.ui-btn-icon-notext .ui-btn-inner .ui-icon:before{margin-left:1px}.ui-li-link-alt .ui-btn-inner .ui-icon{margin:-10px -10px auto auto!important}.ui-icon-plus,.ui-icon-minus,.ui-icon-delete,.ui-icon-arrow-r,.ui-icon-arrow-l,.ui-icon-arrow-u,.ui-icon-arrow-d,.ui-icon-check,.ui-icon-gear,.ui-icon-refresh,.ui-icon-forward,.ui-icon-back,.ui-icon-grid,.ui-icon-star,.ui-icon-alert,.ui-icon-info,.ui-icon-home,.ui-icon-search,.ui-icon-searchfield:after,.ui-icon-checkbox-off,.ui-icon-checkbox-on,.ui-icon-radio-off,.ui-icon-radio-on,.ui-icon-email,.ui-icon-page,.ui-icon-question,.ui-icon-foursquare,.ui-icon-dollar,.ui-icon-euro,.ui-icon-pound,.ui-icon-apple,.ui-icon-chat,.ui-icon-trash,.ui-icon-mappin,.ui-icon-direction,.ui-icon-heart,.ui-icon-wrench,.ui-icon-play,.ui-icon-pause,.ui-icon-stop,.ui-icon-person,.ui-icon-music,.ui-icon-wifi,.ui-icon-phone,.ui-icon-power,.ui-icon-lightning,.ui-icon-drink,.ui-icon-android,.ui-icon-bars,.ui-icon-edit{background-color:#666;background-color:rgba(0,0,0,.4);background-image:url(../img/icons-18-white.png)}.ui-icon-alt .ui-icon,.ui-icon-alt .ui-icon-searchfield:after{background-color:#fff;background-color:rgba(255,255,255,.3);background-image:url(../img/icons-18-black.png);background-repeat:no-repeat}.ui-icon-nodisc .ui-icon,.ui-icon-nodisc .ui-icon-searchfield:after,.ui-icon-nodisc .ui-icon-alt .ui-icon,.ui-icon-nodisc .ui-icon-alt .ui-icon-searchfield:after{background-color:transparent}.ui-icon-plus{background-position:-1px -1px}.ui-icon-minus{background-position:-37px -1px}.ui-icon-delete{background-position:-73px -1px}.ui-icon-arrow-r{background-position:-108px -1px}.ui-icon-arrow-l{background-position:-144px -1px}.ui-icon-arrow-u{background-position:-180px -1px}.ui-icon-arrow-d{background-position:-216px -1px}.ui-icon-check{background-position:-252px -1px}.ui-icon-gear{background-position:-288px -1px}.ui-icon-refresh{background-position:-323px -1px}.ui-icon-forward{background-position:-360px -1px}.ui-icon-back{background-position:-396px -1px}.ui-icon-grid{background-position:-432px -1px}.ui-icon-star{background-position:-467px -1px}.ui-icon-alert{background-position:-503px -1px}.ui-icon-info{background-position:-539px -1px}.ui-icon-home{background-position:-575px -1px}.ui-icon-search,.ui-icon-searchfield:after{background-position:-611px -1px}.ui-icon-checkbox-on{background-position:-647px -1px}.ui-icon-checkbox-off{background-position:-683px -1px}.ui-icon-radio-on{background-position:-718px -1px}.ui-icon-radio-off{background-position:-754px -1px}.ui-icon-bars{background-position:-788px -1px}.ui-icon-edit{background-position:-824px -1px}@media only screen and (-webkit-min-device-pixel-ratio:1.3),only screen and (min--moz-device-pixel-ratio:1.3),only screen and (min-resolution:200dpi){.ui-icon-plus,.ui-icon-minus,.ui-icon-delete,.ui-icon-arrow-r,.ui-icon-arrow-l,.ui-icon-arrow-u,.ui-icon-arrow-d,.ui-icon-check,.ui-icon-gear,.ui-icon-refresh,.ui-icon-forward,.ui-icon-back,.ui-icon-grid,.ui-icon-star,.ui-icon-alert,.ui-icon-info,.ui-icon-home,.ui-icon-bars,.ui-icon-edit,.ui-icon-search,.ui-icon-searchfield:after,.ui-icon-checkbox-off,.ui-icon-checkbox-on,.ui-icon-radio-off,.ui-icon-radio-on{background-image:url(../img/icons-36-white.png);-moz-background-size:864px 18px;-o-background-size:864px 18px;-webkit-background-size:864px 18px;background-size:864px 18px}.ui-icon-alt .ui-icon{background-image:url(../img/icons-36-black.png)}.ui-icon-plus{background-position:0 50%}.ui-icon-minus{background-position:-36px 50%}.ui-icon-delete{background-position:-72px 50%}.ui-icon-arrow-r{background-position:-108px 50%}.ui-icon-arrow-l{background-position:-144px 50%}.ui-icon-arrow-u{background-position:-179px 50%}.ui-icon-arrow-d{background-position:-215px 50%}.ui-icon-check{background-position:-252px 50%}.ui-icon-gear{background-position:-287px 50%}.ui-icon-refresh{background-position:-323px 50%}.ui-icon-forward{background-position:-360px 50%}.ui-icon-back{background-position:-395px 50%}.ui-icon-grid{background-position:-431px 50%}.ui-icon-star{background-position:-467px 50%}.ui-icon-alert{background-position:-503px 50%}.ui-icon-info{background-position:-538px 50%}.ui-icon-home{background-position:-575px 50%}.ui-icon-search,.ui-icon-searchfield:after{background-position:-611px 50%}.ui-icon-checkbox-on{background-position:-647px 50%}.ui-icon-checkbox-off{background-position:-683px 50%}.ui-icon-radio-on{background-position:-718px 50%}.ui-icon-radio-off{background-position:-754px 50%}.ui-icon-bars{background-position:-788px 50%}.ui-icon-edit{background-position:-824px 50%}}.ui-checkbox .ui-icon,.ui-selectmenu-list .ui-icon{-webkit-border-radius:3px;border-radius:3px}.ui-icon-checkbox-off,.ui-icon-radio-off{background-color:transparent}.ui-checkbox-on .ui-icon,.ui-radio-on .ui-icon{}.ui-icon-loading{background:url(../img/ajax-loader.gif);background-size:46px 46px}.ui-btn-corner-all{-webkit-border-radius:6px;border-radius:6px}.ui-btn-icon-notext.ui-btn-corner-all{-webkit-border-radius:1em;border-radius:1em}.ui-corner-all,.ui-btn-corner-all{}.ui-overlay{background:#666;filter:Alpha(Opacity=50);opacity:.5;position:absolute;width:100%;height:100%}.ui-btn:focus,.ui-link-inherit:focus{outline:0}.ui-btn.ui-focus{z-index:1}.ui-mobile-nosupport-boxshadow *{-moz-box-shadow:none!important;-webkit-box-shadow:none!important;box-shadow:none!important}.ui-mobile-nosupport-boxshadow .ui-focus,.ui-mobile-nosupport-boxshadow .ui-btn:focus,.ui-mobile-nosupport-boxshadow .ui-link-inherit:focus{outline-width:1px;outline-style:auto}.ui-mobile,.ui-mobile body{height:99.9%}.ui-mobile fieldset,.ui-page{padding:0;margin:0}.ui-mobile a img,.ui-mobile fieldset{border-width:0}.ui-mobile-viewport{margin:0;overflow-x:visible;-webkit-text-size-adjust:100%;-ms-text-size-adjust:none;-webkit-tap-highlight-color:rgba(0,0,0,0)}body.ui-mobile-viewport,div.ui-mobile-viewport{overflow-x:hidden}.ui-mobile [data-role=page],.ui-mobile [data-role=dialog],.ui-page{top:0;left:0;width:100%;min-height:100%;position:absolute;display:none;border:0}.ui-mobile .ui-page-active{display:block;overflow:visible}.ui-page{outline:0}@media screen and (orientation:portrait){.ui-mobile .ui-page{min-height:420px}}@media screen and (orientation:landscape){.ui-mobile .ui-page{min-height:300px}}.ui-loading .ui-loader{display:block}.ui-loader{display:none;z-index:9999999;position:fixed;top:50%;left:50%;border:0}.ui-loader-default{background:0;filter:Alpha(Opacity=18);opacity:.18;width:46px;height:46px;margin-left:-23px;margin-top:-23px}.ui-loader-verbose{width:200px;filter:Alpha(Opacity=88);opacity:.88;box-shadow:0 1px 1px -1px #fff;height:auto;margin-left:-110px;margin-top:-43px;padding:10px}.ui-loader-default h1{font-size:0;width:0;height:0;overflow:hidden}.ui-loader-verbose h1{font-size:16px;margin:0;text-align:center}.ui-loader .ui-icon{background-color:#000;display:block;margin:0;width:44px;height:44px;padding:1px;-webkit-border-radius:36px;border-radius:36px}.ui-loader-verbose .ui-icon{margin:0 auto 10px;filter:Alpha(Opacity=75);opacity:.75}.ui-loader-textonly{padding:15px;margin-left:-115px}.ui-loader-textonly .ui-icon{display:none}.ui-loader-fakefix{position:absolute}.ui-mobile-rendering>*{visibility:hidden}.ui-bar,.ui-body{position:relative;padding:.4em 15px;overflow:hidden;display:block;clear:both}.ui-bar{font-size:16px;margin:0}.ui-bar h1,.ui-bar h2,.ui-bar h3,.ui-bar h4,.ui-bar h5,.ui-bar h6{margin:0;padding:0;font-size:16px;display:inline-block}.ui-header,.ui-footer{position:relative;zoom:1}.ui-mobile .ui-header,.ui-mobile .ui-footer{border-left-width:0;border-right-width:0}.ui-header .ui-btn-left,.ui-header .ui-btn-right,.ui-footer .ui-btn-left,.ui-footer .ui-btn-right,.ui-header-fixed.ui-fixed-hidden .ui-btn-left,.ui-header-fixed.ui-fixed-hidden .ui-btn-right{position:absolute;top:3px}.ui-header-fixed .ui-btn-left,.ui-header-fixed .ui-btn-right{top:4px}.ui-header .ui-btn-left,.ui-footer .ui-btn-left{left:5px}.ui-header .ui-btn-right,.ui-footer .ui-btn-right{right:5px}.ui-footer>.ui-btn-icon-notext,.ui-header>.ui-btn-icon-notext,.ui-header-fixed.ui-fixed-hidden>.ui-btn-icon-notext{top:6px}.ui-header-fixed>.ui-btn-icon-notext{top:7px}.ui-header .ui-title,.ui-footer .ui-title{min-height:1.1em;text-align:center;font-size:16px;display:block;margin:.6em 30% .8em;padding:0;text-overflow:ellipsis;overflow:hidden;white-space:nowrap;outline:0!important}.ui-footer .ui-title{margin:.6em 15px .8em}.ui-content{border-width:0;overflow:visible;overflow-x:hidden;padding:15px}.ui-corner-all>.ui-header:first-child,.ui-corner-all>.ui-content:first-child,.ui-corner-all>.ui-footer:first-child{-webkit-border-top-left-radius:inherit;border-top-left-radius:inherit;-webkit-border-top-right-radius:inherit;border-top-right-radius:inherit}.ui-corner-all>.ui-header:last-child,.ui-corner-all>.ui-content:last-child,.ui-corner-all>.ui-footer:last-child{-webkit-border-bottom-left-radius:inherit;border-bottom-left-radius:inherit;-webkit-border-bottom-right-radius:inherit;border-bottom-right-radius:inherit}.ui-icon{width:18px;height:18px}.ui-nojs{position:absolute;left:-9999px}.ui-hide-label label.ui-input-text,.ui-hide-label label.ui-select,.ui-hide-label label.ui-slider,.ui-hide-label label.ui-submit,.ui-hide-label .ui-controlgroup-label,.ui-hidden-accessible{position:absolute!important;left:-9999px;clip:rect(1px 1px 1px 1px);clip:rect(1px,1px,1px,1px)}.ui-mobile-viewport-transitioning,.ui-mobile-viewport-transitioning .ui-page{width:100%;height:100%;overflow:hidden;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.ui-page-pre-in{opacity:0}.in{-webkit-animation-timing-function:ease-out;-webkit-animation-duration:350ms;-moz-animation-timing-function:ease-out;-moz-animation-duration:350ms;animation-timing-function:ease-out;animation-duration:350ms}.out{-webkit-animation-timing-function:ease-in;-webkit-animation-duration:225ms;-moz-animation-timing-function:ease-in;-moz-animation-duration:225ms;animation-timing-function:ease-in;animation-duration:225ms}@-webkit-keyframes fadein{from{opacity:0}to{opacity:1}}@-moz-keyframes fadein{from{opacity:0}to{opacity:1}}@keyframes fadein{from{opacity:0}to{opacity:1}}@-webkit-keyframes fadeout{from{opacity:1}to{opacity:0}}@-moz-keyframes fadeout{from{opacity:1}to{opacity:0}}@keyframes fadeout{from{opacity:1}to{opacity:0}}.fade.out{opacity:0;-webkit-animation-duration:125ms;-webkit-animation-name:fadeout;-moz-animation-duration:125ms;-moz-animation-name:fadeout;animation-duration:125ms;animation-name:fadeout}.fade.in{opacity:1;-webkit-animation-duration:225ms;-webkit-animation-name:fadein;-moz-animation-duration:225ms;-moz-animation-name:fadein;animation-duration:225ms;animation-name:fadein}.pop{-webkit-transform-origin:50% 50%;-moz-transform-origin:50% 50%;transform-origin:50% 50%}.pop.in{-webkit-transform:scale(1);-webkit-animation-name:popin;-webkit-animation-duration:350ms;-moz-transform:scale(1);-moz-animation-name:popin;-moz-animation-duration:350ms;transform:scale(1);animation-name:popin;animation-duration:350ms;opacity:1}.pop.out{-webkit-animation-name:fadeout;-webkit-animation-duration:100ms;-moz-animation-name:fadeout;-moz-animation-duration:100ms;animation-name:fadeout;animation-duration:100ms;opacity:0}.pop.in.reverse{-webkit-animation-name:fadein;-moz-animation-name:fadein;animation-name:fadein}.pop.out.reverse{-webkit-transform:scale(.8);-webkit-animation-name:popout;-moz-transform:scale(.8);-moz-animation-name:popout;transform:scale(.8);animation-name:popout}@-webkit-keyframes popin{from{-webkit-transform:scale(.8);opacity:0}to{-webkit-transform:scale(1);opacity:1}}@-moz-keyframes popin{from{-moz-transform:scale(.8);opacity:0}to{-moz-transform:scale(1);opacity:1}}@keyframes popin{from{transform:scale(.8);opacity:0}to{transform:scale(1);opacity:1}}@-webkit-keyframes popout{from{-webkit-transform:scale(1);opacity:1}to{-webkit-transform:scale(.8);opacity:0}}@-moz-keyframes popout{from{-moz-transform:scale(1);opacity:1}to{-moz-transform:scale(.8);opacity:0}}@keyframes popout{from{transform:scale(1);opacity:1}to{transform:scale(.8);opacity:0}}@-webkit-keyframes slideinfromright{from{-webkit-transform:translate3d(100%,0,0)}to{-webkit-transform:translate3d(0,0,0)}}@-moz-keyframes slideinfromright{from{-moz-transform:translateX(100%)}to{-moz-transform:translateX(0)}}@keyframes slideinfromright{from{transform:translateX(100%)}to{transform:translateX(0)}}@-webkit-keyframes slideinfromleft{from{-webkit-transform:translate3d(-100%,0,0)}to{-webkit-transform:translate3d(0,0,0)}}@-moz-keyframes slideinfromleft{from{-moz-transform:translateX(-100%)}to{-moz-transform:translateX(0)}}@keyframes slideinfromleft{from{transform:translateX(-100%)}to{transform:translateX(0)}}@-webkit-keyframes slideouttoleft{from{-webkit-transform:translate3d(0,0,0)}to{-webkit-transform:translate3d(-100%,0,0)}}@-moz-keyframes slideouttoleft{from{-moz-transform:translateX(0)}to{-moz-transform:translateX(-100%)}}@keyframes slideouttoleft{from{transform:translateX(0)}to{transform:translateX(-100%)}}@-webkit-keyframes slideouttoright{from{-webkit-transform:translate3d(0,0,0)}to{-webkit-transform:translate3d(100%,0,0)}}@-moz-keyframes slideouttoright{from{-moz-transform:translateX(0)}to{-moz-transform:translateX(100%)}}@keyframes slideouttoright{from{transform:translateX(0)}to{transform:translateX(100%)}}.slide.out,.slide.in{-webkit-animation-timing-function:ease-out;-webkit-animation-duration:350ms;-moz-animation-timing-function:ease-out;-moz-animation-duration:350ms;animation-timing-function:ease-out;animation-duration:350ms}.slide.out{-webkit-transform:translate3d(-100%,0,0);-webkit-animation-name:slideouttoleft;-moz-transform:translateX(-100%);-moz-animation-name:slideouttoleft;transform:translateX(-100%);animation-name:slideouttoleft}.slide.in{-webkit-transform:translate3d(0,0,0);-webkit-animation-name:slideinfromright;-moz-transform:translateX(0);-moz-animation-name:slideinfromright;transform:translateX(0);animation-name:slideinfromright}.slide.out.reverse{-webkit-transform:translate3d(100%,0,0);-webkit-animation-name:slideouttoright;-moz-transform:translateX(100%);-moz-animation-name:slideouttoright;transform:translateX(100%);animation-name:slideouttoright}.slide.in.reverse{-webkit-transform:translate3d(0,0,0);-webkit-animation-name:slideinfromleft;-moz-transform:translateX(0);-moz-animation-name:slideinfromleft;transform:translateX(0);animation-name:slideinfromleft}.slidefade.out{-webkit-transform:translateX(-100%);-webkit-animation-name:slideouttoleft;-webkit-animation-duration:225ms;-moz-transform:translateX(-100%);-moz-animation-name:slideouttoleft;-moz-animation-duration:225ms;transform:translateX(-100%);animation-name:slideouttoleft;animation-duration:225ms}.slidefade.in{-webkit-transform:translateX(0);-webkit-animation-name:fadein;-webkit-animation-duration:200ms;-moz-transform:translateX(0);-moz-animation-name:fadein;-moz-animation-duration:200ms;transform:translateX(0);animation-name:fadein;animation-duration:200ms}.slidefade.out.reverse{-webkit-transform:translateX(100%);-webkit-animation-name:slideouttoright;-webkit-animation-duration:200ms;-moz-transform:translateX(100%);-moz-animation-name:slideouttoright;-moz-animation-duration:200ms;transform:translateX(100%);animation-name:slideouttoright;animation-duration:200ms}.slidefade.in.reverse{-webkit-transform:translateX(0);-webkit-animation-name:fadein;-webkit-animation-duration:200ms;-moz-transform:translateX(0);-moz-animation-name:fadein;-moz-animation-duration:200ms;transform:translateX(0);animation-name:fadein;animation-duration:200ms}.slidedown.out{-webkit-animation-name:fadeout;-webkit-animation-duration:100ms;-moz-animation-name:fadeout;-moz-animation-duration:100ms;animation-name:fadeout;animation-duration:100ms}.slidedown.in{-webkit-transform:translateY(0);-webkit-animation-name:slideinfromtop;-webkit-animation-duration:250ms;-moz-transform:translateY(0);-moz-animation-name:slideinfromtop;-moz-animation-duration:250ms;transform:translateY(0);animation-name:slideinfromtop;animation-duration:250ms}.slidedown.in.reverse{-webkit-animation-name:fadein;-webkit-animation-duration:150ms;-moz-animation-name:fadein;-moz-animation-duration:150ms;animation-name:fadein;animation-duration:150ms}.slidedown.out.reverse{-webkit-transform:translateY(-100%);-webkit-animation-name:slideouttotop;-webkit-animation-duration:200ms;-moz-transform:translateY(-100%);-moz-animation-name:slideouttotop;-moz-animation-duration:200ms;transform:translateY(-100%);animation-name:slideouttotop;animation-duration:200ms}@-webkit-keyframes slideinfromtop{from{-webkit-transform:translateY(-100%)}to{-webkit-transform:translateY(0)}}@-moz-keyframes slideinfromtop{from{-moz-transform:translateY(-100%)}to{-moz-transform:translateY(0)}}@keyframes slideinfromtop{from{transform:translateY(-100%)}to{transform:translateY(0)}}@-webkit-keyframes slideouttotop{from{-webkit-transform:translateY(0)}to{-webkit-transform:translateY(-100%)}}@-moz-keyframes slideouttotop{from{-moz-transform:translateY(0)}to{-moz-transform:translateY(-100%)}}@keyframes slideouttotop{from{transform:translateY(0)}to{transform:translateY(-100%)}}.slideup.out{-webkit-animation-name:fadeout;-webkit-animation-duration:100ms;-moz-animation-name:fadeout;-moz-animation-duration:100ms;animation-name:fadeout;animation-duration:100ms}.slideup.in{-webkit-transform:translateY(0);-webkit-animation-name:slideinfrombottom;-webkit-animation-duration:250ms;-moz-transform:translateY(0);-moz-animation-name:slideinfrombottom;-moz-animation-duration:250ms;transform:translateY(0);animation-name:slideinfrombottom;animation-duration:250ms}.slideup.in.reverse{-webkit-animation-name:fadein;-webkit-animation-duration:150ms;-moz-animation-name:fadein;-moz-animation-duration:150ms;animation-name:fadein;animation-duration:150ms}.slideup.out.reverse{-webkit-transform:translateY(100%);-webkit-animation-name:slideouttobottom;-webkit-animation-duration:200ms;-moz-transform:translateY(100%);-moz-animation-name:slideouttobottom;-moz-animation-duration:200ms;transform:translateY(100%);animation-name:slideouttobottom;animation-duration:200ms}@-webkit-keyframes slideinfrombottom{from{-webkit-transform:translateY(100%)}to{-webkit-transform:translateY(0)}}@-moz-keyframes slideinfrombottom{from{-moz-transform:translateY(100%)}to{-moz-transform:translateY(0)}}@keyframes slideinfrombottom{from{transform:translateY(100%)}to{transform:translateY(0)}}@-webkit-keyframes slideouttobottom{from{-webkit-transform:translateY(0)}to{-webkit-transform:translateY(100%)}}@-moz-keyframes slideouttobottom{from{-moz-transform:translateY(0)}to{-moz-transform:translateY(100%)}}@keyframes slideouttobottom{from{transform:translateY(0)}to{transform:translateY(100%)}}.viewport-flip{-webkit-perspective:1000;-moz-perspective:1000;perspective:1000;position:absolute}.flip{-webkit-backface-visibility:hidden;-webkit-transform:translateX(0);-moz-backface-visibility:hidden;-moz-transform:translateX(0);backface-visibility:hidden;transform:translateX(0)}.flip.out{-webkit-transform:rotateY(-90deg) scale(.9);-webkit-animation-name:flipouttoleft;-webkit-animation-duration:175ms;-moz-transform:rotateY(-90deg) scale(.9);-moz-animation-name:flipouttoleft;-moz-animation-duration:175ms;transform:rotateY(-90deg) scale(.9);animation-name:flipouttoleft;animation-duration:175ms}.flip.in{-webkit-animation-name:flipintoright;-webkit-animation-duration:225ms;-moz-animation-name:flipintoright;-moz-animation-duration:225ms;animation-name:flipintoright;animation-duration:225ms}.flip.out.reverse{-webkit-transform:rotateY(90deg) scale(.9);-webkit-animation-name:flipouttoright;-moz-transform:rotateY(90deg) scale(.9);-moz-animation-name:flipouttoright;transform:rotateY(90deg) scale(.9);animation-name:flipouttoright}.flip.in.reverse{-webkit-animation-name:flipintoleft;-moz-animation-name:flipintoleft;animation-name:flipintoleft}@-webkit-keyframes flipouttoleft{from{-webkit-transform:rotateY(0)}to{-webkit-transform:rotateY(-90deg) scale(.9)}}@-moz-keyframes flipouttoleft{from{-moz-transform:rotateY(0)}to{-moz-transform:rotateY(-90deg) scale(.9)}}@keyframes flipouttoleft{from{transform:rotateY(0)}to{transform:rotateY(-90deg) scale(.9)}}@-webkit-keyframes flipouttoright{from{-webkit-transform:rotateY(0)}to{-webkit-transform:rotateY(90deg) scale(.9)}}@-moz-keyframes flipouttoright{from{-moz-transform:rotateY(0)}to{-moz-transform:rotateY(90deg) scale(.9)}}@keyframes flipouttoright{from{transform:rotateY(0)}to{transform:rotateY(90deg) scale(.9)}}@-webkit-keyframes flipintoleft{from{-webkit-transform:rotateY(-90deg) scale(.9)}to{-webkit-transform:rotateY(0)}}@-moz-keyframes flipintoleft{from{-moz-transform:rotateY(-90deg) scale(.9)}to{-moz-transform:rotateY(0)}}@keyframes flipintoleft{from{transform:rotateY(-90deg) scale(.9)}to{transform:rotateY(0)}}@-webkit-keyframes flipintoright{from{-webkit-transform:rotateY(90deg) scale(.9)}to{-webkit-transform:rotateY(0)}}@-moz-keyframes flipintoright{from{-moz-transform:rotateY(90deg) scale(.9)}to{-moz-transform:rotateY(0)}}@keyframes flipintoright{from{transform:rotateY(90deg) scale(.9)}to{transform:rotateY(0)}}.viewport-turn{-webkit-perspective:200px;-moz-perspective:200px;-ms-perspective:200px;perspective:200px;position:absolute}.turn{-webkit-backface-visibility:hidden;-webkit-transform:translateX(0);-webkit-transform-origin:0;-moz-backface-visibility:hidden;-moz-transform:translateX(0);-moz-transform-origin:0;backface-visibility:hidden;transform:translateX(0);transform-origin:0}.turn.out{-webkit-transform:rotateY(-90deg) scale(.9);-webkit-animation-name:flipouttoleft;-webkit-animation-duration:125ms;-moz-transform:rotateY(-90deg) scale(.9);-moz-animation-name:flipouttoleft;-moz-animation-duration:125ms;transform:rotateY(-90deg) scale(.9);animation-name:flipouttoleft;animation-duration:125ms}.turn.in{-webkit-animation-name:flipintoright;-webkit-animation-duration:250ms;-moz-animation-name:flipintoright;-moz-animation-duration:250ms;animation-name:flipintoright;animation-duration:250ms}.turn.out.reverse{-webkit-transform:rotateY(90deg) scale(.9);-webkit-animation-name:flipouttoright;-moz-transform:rotateY(90deg) scale(.9);-moz-animation-name:flipouttoright;transform:rotateY(90deg) scale(.9);animation-name:flipouttoright}.turn.in.reverse{-webkit-animation-name:flipintoleft;-moz-animation-name:flipintoleft;animation-name:flipintoleft}@-webkit-keyframes flipouttoleft{from{-webkit-transform:rotateY(0)}to{-webkit-transform:rotateY(-90deg) scale(.9)}}@-moz-keyframes flipouttoleft{from{-moz-transform:rotateY(0)}to{-moz-transform:rotateY(-90deg) scale(.9)}}@keyframes flipouttoleft{from{transform:rotateY(0)}to{transform:rotateY(-90deg) scale(.9)}}@-webkit-keyframes flipouttoright{from{-webkit-transform:rotateY(0)}to{-webkit-transform:rotateY(90deg) scale(.9)}}@-moz-keyframes flipouttoright{from{-moz-transform:rotateY(0)}to{-moz-transform:rotateY(90deg) scale(.9)}}@keyframes flipouttoright{from{transform:rotateY(0)}to{transform:rotateY(90deg) scale(.9)}}@-webkit-keyframes flipintoleft{from{-webkit-transform:rotateY(-90deg) scale(.9)}to{-webkit-transform:rotateY(0)}}@-moz-keyframes flipintoleft{from{-moz-transform:rotateY(-90deg) scale(.9)}to{-moz-transform:rotateY(0)}}@keyframes flipintoleft{from{transform:rotateY(-90deg) scale(.9)}to{transform:rotateY(0)}}@-webkit-keyframes flipintoright{from{-webkit-transform:rotateY(90deg) scale(.9)}to{-webkit-transform:rotateY(0)}}@-moz-keyframes flipintoright{from{-moz-transform:rotateY(90deg) scale(.9)}to{-moz-transform:rotateY(0)}}@keyframes flipintoright{from{transform:rotateY(90deg) scale(.9)}to{transform:rotateY(0)}}.flow{-webkit-transform-origin:50% 30%;-webkit-box-shadow:0 0 20px rgba(0,0,0,.4);-moz-transform-origin:50% 30%;-moz-box-shadow:0 0 20px rgba(0,0,0,.4);transform-origin:50% 30%;box-shadow:0 0 20px rgba(0,0,0,.4)}.ui-dialog.flow{-webkit-transform-origin:none;-webkit-box-shadow:none;-moz-transform-origin:none;-moz-box-shadow:none;transform-origin:none;box-shadow:none}.flow.out{-webkit-transform:translateX(-100%) scale(.7);-webkit-animation-name:flowouttoleft;-webkit-animation-timing-function:ease;-webkit-animation-duration:350ms;-moz-transform:translateX(-100%) scale(.7);-moz-animation-name:flowouttoleft;-moz-animation-timing-function:ease;-moz-animation-duration:350ms;transform:translateX(-100%) scale(.7);animation-name:flowouttoleft;animation-timing-function:ease;animation-duration:350ms}.flow.in{-webkit-transform:translateX(0) scale(1);-webkit-animation-name:flowinfromright;-webkit-animation-timing-function:ease;-webkit-animation-duration:350ms;-moz-transform:translateX(0) scale(1);-moz-animation-name:flowinfromright;-moz-animation-timing-function:ease;-moz-animation-duration:350ms;transform:translateX(0) scale(1);animation-name:flowinfromright;animation-timing-function:ease;animation-duration:350ms}.flow.out.reverse{-webkit-transform:translateX(100%);-webkit-animation-name:flowouttoright;-moz-transform:translateX(100%);-moz-animation-name:flowouttoright;transform:translateX(100%);animation-name:flowouttoright}.flow.in.reverse{-webkit-animation-name:flowinfromleft;-moz-animation-name:flowinfromleft;animation-name:flowinfromleft}@-webkit-keyframes flowouttoleft{0%{-webkit-transform:translateX(0) scale(1)}60%,70%{-webkit-transform:translateX(0) scale(.7)}100%{-webkit-transform:translateX(-100%) scale(.7)}}@-moz-keyframes flowouttoleft{0%{-moz-transform:translateX(0) scale(1)}60%,70%{-moz-transform:translateX(0) scale(.7)}100%{-moz-transform:translateX(-100%) scale(.7)}}@keyframes flowouttoleft{0%{transform:translateX(0) scale(1)}60%,70%{transform:translateX(0) scale(.7)}100%{transform:translateX(-100%) scale(.7)}}@-webkit-keyframes flowouttoright{0%{-webkit-transform:translateX(0) scale(1)}60%,70%{-webkit-transform:translateX(0) scale(.7)}100%{-webkit-transform:translateX(100%) scale(.7)}}@-moz-keyframes flowouttoright{0%{-moz-transform:translateX(0) scale(1)}60%,70%{-moz-transform:translateX(0) scale(.7)}100%{-moz-transform:translateX(100%) scale(.7)}}@keyframes flowouttoright{0%{transform:translateX(0) scale(1)}60%,70%{transform:translateX(0) scale(.7)}100%{transform:translateX(100%) scale(.7)}}@-webkit-keyframes flowinfromleft{0%{-webkit-transform:translateX(-100%) scale(.7)}30%,40%{-webkit-transform:translateX(0) scale(.7)}100%{-webkit-transform:translateX(0) scale(1)}}@-moz-keyframes flowinfromleft{0%{-moz-transform:translateX(-100%) scale(.7)}30%,40%{-moz-transform:translateX(0) scale(.7)}100%{-moz-transform:translateX(0) scale(1)}}@keyframes flowinfromleft{0%{transform:translateX(-100%) scale(.7)}30%,40%{transform:translateX(0) scale(.7)}100%{transform:translateX(0) scale(1)}}@-webkit-keyframes flowinfromright{0%{-webkit-transform:translateX(100%) scale(.7)}30%,40%{-webkit-transform:translateX(0) scale(.7)}100%{-webkit-transform:translateX(0) scale(1)}}@-moz-keyframes flowinfromright{0%{-moz-transform:translateX(100%) scale(.7)}30%,40%{-moz-transform:translateX(0) scale(.7)}100%{-moz-transform:translateX(0) scale(1)}}@keyframes flowinfromright{0%{transform:translateX(100%) scale(.7)}30%,40%{transform:translateX(0) scale(.7)}100%{transform:translateX(0) scale(1)}}.ui-grid-a,.ui-grid-b,.ui-grid-c,.ui-grid-d{overflow:hidden}.ui-block-a,.ui-block-b,.ui-block-c,.ui-block-d,.ui-block-e{margin:0;padding:0;border:0;float:left;min-height:1px;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;-ms-box-sizing:border-box;box-sizing:border-box}.ui-grid-solo .ui-block-a{display:block;float:none}.ui-grid-a .ui-block-a,.ui-grid-a .ui-block-b{width:49.95%}.ui-grid-a>:nth-child(n){width:50%;margin-right:-.5px}.ui-grid-a .ui-block-a{clear:left}.ui-grid-b .ui-block-a,.ui-grid-b .ui-block-b,.ui-grid-b .ui-block-c{width:33.25%}.ui-grid-b>:nth-child(n){width:33.333%;margin-right:-.5px}.ui-grid-b .ui-block-a{clear:left}.ui-grid-c .ui-block-a,.ui-grid-c .ui-block-b,.ui-grid-c .ui-block-c,.ui-grid-c .ui-block-d{width:24.925%}.ui-grid-c>:nth-child(n){width:25%;margin-right:-.5px}.ui-grid-c .ui-block-a{clear:left}.ui-grid-d .ui-block-a,.ui-grid-d .ui-block-b,.ui-grid-d .ui-block-c,.ui-grid-d .ui-block-d,.ui-grid-d .ui-block-e{width:19.925%}.ui-grid-d>:nth-child(n){width:20%}.ui-grid-d .ui-block-a{clear:left}@media all and (max-width:35em){.ui-responsive .ui-block-a,.ui-responsive .ui-block-b,.ui-responsive .ui-block-c,.ui-responsive .ui-block-d,.ui-responsive .ui-block-e{width:100%;float:none}}.ui-header-fixed,.ui-footer-fixed{left:0;right:0;width:100%;position:fixed;z-index:1000}.ui-header-fixed{top:-1px;padding-top:1px}.ui-header-fixed.ui-fixed-hidden{top:0;padding-top:0}.ui-footer-fixed{bottom:-1px;padding-bottom:1px}.ui-footer-fixed.ui-fixed-hidden{bottom:0;padding-bottom:0}.ui-header-fullscreen,.ui-footer-fullscreen{filter:Alpha(Opacity=90);opacity:.9}.ui-page-header-fixed{padding-top:2.6875em}.ui-page-footer-fixed{padding-bottom:2.6875em}.ui-page-header-fullscreen>.ui-content,.ui-page-footer-fullscreen>.ui-content{padding:0}.ui-fixed-hidden{position:absolute}.ui-page-header-fullscreen .ui-fixed-hidden,.ui-page-footer-fullscreen .ui-fixed-hidden{left:-9999px}.ui-header-fixed .ui-btn,.ui-footer-fixed .ui-btn{z-index:10}.ui-android-2x-fixed .ui-li-has-thumb{-webkit-transform:translate3d(0,0,0)}.ui-navbar{max-width:100%}.ui-navbar.ui-mini{margin:0}.ui-navbar ul:before,.ui-navbar ul:after{content:" ";display:table}.ui-navbar ul:after{clear:both}.ui-navbar ul{list-style:none;margin:0;padding:0;position:relative;display:block;border:0;max-width:100%;overflow:visible;zoom:1}.ui-navbar li .ui-btn{display:block;text-align:center;margin:0 -1px 0 0;border-right-width:0}.ui-navbar li .ui-btn-icon-right .ui-icon{right:6px}.ui-navbar li:last-child .ui-btn,.ui-navbar .ui-grid-duo .ui-block-b .ui-btn{margin-right:0;border-right-width:1px}.ui-header .ui-navbar li:last-child .ui-btn,.ui-footer .ui-navbar li:last-child .ui-btn,.ui-header .ui-navbar .ui-grid-duo .ui-block-b .ui-btn,.ui-footer .ui-navbar .ui-grid-duo .ui-block-b .ui-btn{margin-right:-1px;border-right-width:0}.ui-navbar .ui-grid-duo li.ui-block-a:last-child .ui-btn{margin-right:-1px;border-right-width:1px}.ui-header .ui-navbar li .ui-btn,.ui-footer .ui-navbar li .ui-btn{border-top-width:0;border-bottom-width:0}.ui-header .ui-navbar .ui-grid-b li.ui-block-c .ui-btn,.ui-footer .ui-navbar .ui-grid-b li.ui-block-c .ui-btn{margin-right:-5px}.ui-header .ui-navbar .ui-grid-c li.ui-block-d .ui-btn,.ui-footer .ui-navbar .ui-grid-c li.ui-block-d .ui-btn,.ui-header .ui-navbar .ui-grid-d li.ui-block-e .ui-btn,.ui-footer .ui-navbar .ui-grid-d li.ui-block-e .ui-btn{margin-right:-4px}.ui-header .ui-navbar .ui-grid-b li.ui-block-c .ui-btn-icon-right .ui-icon,.ui-footer .ui-navbar .ui-grid-b li.ui-block-c .ui-btn-icon-right .ui-icon,.ui-header .ui-navbar .ui-grid-c li.ui-block-d .ui-btn-icon-right .ui-icon,.ui-footer .ui-navbar .ui-grid-c li.ui-block-d .ui-btn-icon-right .ui-icon,.ui-header .ui-navbar .ui-grid-d li.ui-block-e .ui-btn-icon-right .ui-icon,.ui-footer .ui-navbar .ui-grid-d li.ui-block-e .ui-btn-icon-right .ui-icon{right:8px}.ui-navbar li .ui-btn .ui-btn-inner{padding-top:.7em;padding-bottom:.8em}.ui-navbar li .ui-btn-icon-top .ui-btn-inner{padding-top:30px}.ui-navbar li .ui-btn-icon-bottom .ui-btn-inner{padding-bottom:30px}.ui-btn{display:block;text-align:center;cursor:pointer;position:relative;margin:.5em 0;padding:0}.ui-mini{margin-top:.25em;margin-bottom:.25em}.ui-btn-left,.ui-btn-right,.ui-input-clear,.ui-btn-inline,.ui-grid-a .ui-btn,.ui-grid-b .ui-btn,.ui-grid-c .ui-btn,.ui-grid-d .ui-btn,.ui-grid-e .ui-btn,.ui-grid-solo .ui-btn{margin-right:5px;margin-left:5px}.ui-btn-inner{font-size:16px;padding:.6em 20px;min-width:.75em;display:block;position:relative;text-overflow:ellipsis;overflow:hidden;white-space:nowrap;zoom:1}.ui-btn input,.ui-btn button{z-index:2}.ui-btn-left,.ui-btn-right,.ui-btn-inline{display:inline-block;vertical-align:middle}.ui-mobile .ui-btn-left,.ui-mobile .ui-btn-right,.ui-btn-left>.ui-btn,.ui-btn-right>.ui-btn{margin:0}.ui-btn-block{display:block}.ui-header>.ui-btn,.ui-footer>.ui-btn{display:inline-block;margin:0}.ui-header .ui-btn-block,.ui-footer .ui-btn-block{display:block}.ui-header .ui-btn-inner,.ui-footer .ui-btn-inner,.ui-mini .ui-btn-inner{font-size:12.5px;padding:.55em 11px .5em}.ui-fullsize .ui-btn-inner,.ui-fullsize .ui-btn-inner{font-size:16px;padding:.6em 20px}.ui-btn-icon-notext{width:24px;height:24px}.ui-btn-icon-notext .ui-btn-inner{padding:0;height:100%}.ui-btn-icon-notext .ui-btn-inner .ui-icon{margin:2px 1px 2px 3px;float:left}.ui-btn-text{position:relative;z-index:1;width:100%;-moz-user-select:none;-webkit-user-select:none;-ms-user-select:none}div.ui-btn-text{width:auto}.ui-btn-icon-notext .ui-btn-text{position:absolute;left:-9999px}.ui-btn-icon-left .ui-btn-inner{padding-left:40px}.ui-btn-icon-right .ui-btn-inner{padding-right:40px}.ui-btn-icon-top .ui-btn-inner{padding-top:40px}.ui-btn-icon-bottom .ui-btn-inner{padding-bottom:40px}.ui-header .ui-btn-icon-left .ui-btn-inner,.ui-footer .ui-btn-icon-left .ui-btn-inner,.ui-mini.ui-btn-icon-left .ui-btn-inner,.ui-mini .ui-btn-icon-left .ui-btn-inner{padding-left:30px}.ui-header .ui-btn-icon-right .ui-btn-inner,.ui-footer .ui-btn-icon-right .ui-btn-inner,.ui-mini.ui-btn-icon-right .ui-btn-inner,.ui-mini .ui-btn-icon-right .ui-btn-inner{padding-right:30px}.ui-header .ui-btn-icon-top .ui-btn-inner,.ui-footer .ui-btn-icon-top .ui-btn-inner{padding:30px 3px .5em}.ui-mini.ui-btn-icon-top .ui-btn-inner,.ui-mini .ui-btn-icon-top .ui-btn-inner{padding-top:30px}.ui-header .ui-btn-icon-bottom .ui-btn-inner,.ui-footer .ui-btn-icon-bottom .ui-btn-inner{padding:.55em 3px 30px}.ui-mini.ui-btn-icon-bottom .ui-btn-inner,.ui-mini .ui-btn-icon-bottom .ui-btn-inner{padding-bottom:30px}.ui-btn-inner{-webkit-border-radius:inherit;border-radius:inherit}.ui-btn-icon-notext .ui-icon{display:block;z-index:0}.ui-btn-icon-left>.ui-btn-inner>.ui-icon,.ui-btn-icon-right>.ui-btn-inner>.ui-icon{position:absolute;top:50%;margin-top:-9px}.ui-btn-icon-top .ui-btn-inner .ui-icon,.ui-btn-icon-bottom .ui-btn-inner .ui-icon{position:absolute;left:50%;margin-left:-9px}.ui-btn-icon-left .ui-icon{left:10px}.ui-btn-icon-right .ui-icon{right:10px}.ui-btn-icon-top .ui-icon{top:10px}.ui-btn-icon-bottom .ui-icon{top:auto;bottom:10px}.ui-header .ui-btn-icon-left .ui-icon,.ui-footer .ui-btn-icon-left .ui-icon,.ui-mini.ui-btn-icon-left .ui-icon,.ui-mini .ui-btn-icon-left .ui-icon{left:5px}.ui-header .ui-btn-icon-right .ui-icon,.ui-footer .ui-btn-icon-right .ui-icon,.ui-mini.ui-btn-icon-right .ui-icon,.ui-mini .ui-btn-icon-right .ui-icon{right:5px}.ui-header .ui-btn-icon-top .ui-icon,.ui-footer .ui-btn-icon-top .ui-icon,.ui-mini.ui-btn-icon-top .ui-icon,.ui-mini .ui-btn-icon-top .ui-icon{top:5px}.ui-header .ui-btn-icon-bottom .ui-icon,.ui-footer .ui-btn-icon-bottom .ui-icon,.ui-mini.ui-btn-icon-bottom .ui-icon,.ui-mini .ui-btn-icon-bottom .ui-icon{bottom:5px}.ui-btn-hidden{position:absolute;top:0;left:0;width:100%;height:100%;-webkit-appearance:none;cursor:pointer;background:#fff;background:rgba(255,255,255,0);filter:Alpha(Opacity=0);opacity:.1;font-size:1px;border:0;text-indent:-9999px}.ui-disabled .ui-btn-hidden{display:none}.ui-disabled{z-index:1}.ui-field-contain .ui-btn.ui-submit{margin:0}label.ui-submit{font-size:16px;line-height:1.4;font-weight:400;margin:0 0 .3em;display:block}@media all and (min-width:28em){.ui-field-contain label.ui-submit{vertical-align:top;display:inline-block;width:20%;margin:0 2% 0 0}.ui-field-contain .ui-btn.ui-submit{width:78%;display:inline-block;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;-ms-box-sizing:border-box;box-sizing:border-box}.ui-hide-label .ui-btn.ui-submit{width:auto;display:block}}.ui-collapsible-inset{margin:.5em 0}.ui-collapsible-heading{font-size:16px;display:block;margin:0 -15px;padding:0;position:relative}.ui-collapsible-inset .ui-collapsible-heading{margin:0}.ui-collapsible-heading .ui-btn{text-align:left;margin:0;border-left-width:0;border-right-width:0}.ui-collapsible-inset .ui-collapsible-heading .ui-btn{border-right-width:1px;border-left-width:1px}.ui-collapsible-collapsed+.ui-collapsible:not(.ui-collapsible-inset) .ui-collapsible-heading .ui-btn{border-top-width:0}.ui-collapsible-set .ui-collapsible:not(.ui-collapsible-inset) .ui-collapsible-heading .ui-btn{border-top-width:1px}.ui-collapsible-heading .ui-btn-inner{padding-left:12px;padding-right:12px}.ui-collapsible-heading .ui-btn-icon-left .ui-btn-inner{padding-left:40px}.ui-collapsible-heading .ui-btn-icon-right .ui-btn-inner{padding-right:40px}.ui-collapsible-heading .ui-btn-icon-top .ui-btn-inner,.ui-collapsible-heading .ui-btn-icon-bottom .ui-btn-inner{text-align:center}.ui-collapsible-heading .ui-btn-icon-left.ui-mini .ui-btn-inner{padding-left:30px}.ui-collapsible-heading .ui-btn-icon-right.ui-mini .ui-btn-inner{padding-right:30px}.ui-collapsible-heading .ui-btn span.ui-btn{position:absolute;left:6px;top:50%;margin:-12px 0 0 0;width:20px;height:20px;padding:1px 0 1px 2px;text-indent:-9999px}.ui-collapsible-heading .ui-btn span.ui-btn .ui-btn-inner{padding:10px 0}.ui-collapsible-heading .ui-btn span.ui-btn .ui-icon{left:0;margin-top:-10px}.ui-collapsible-heading-status{position:absolute;top:-9999px;left:0}.ui-collapsible-content{display:block;margin:0 -15px;padding:10px 15px;border-left-width:0;border-right-width:0;border-top:0;background-image:none}.ui-collapsible-inset .ui-collapsible-content{margin:0;border-right-width:1px;border-left-width:1px}.ui-collapsible-content-collapsed{display:none}.ui-collapsible-set>.ui-collapsible.ui-corner-all{-webkit-border-radius:0;border-radius:0}.ui-collapsible-heading,.ui-collapsible-heading>.ui-btn{-webkit-border-radius:inherit;border-radius:inherit}.ui-collapsible-set .ui-collapsible.ui-first-child{-webkit-border-top-right-radius:inherit;border-top-right-radius:inherit;-webkit-border-top-left-radius:inherit;border-top-left-radius:inherit}.ui-collapsible-content,.ui-collapsible-set .ui-collapsible.ui-last-child{-webkit-border-bottom-right-radius:inherit;border-bottom-right-radius:inherit;-webkit-border-bottom-left-radius:inherit;border-bottom-left-radius:inherit}.ui-collapsible-themed-content:not(.ui-collapsible-collapsed)>.ui-collapsible-heading{-webkit-border-bottom-right-radius:0;border-bottom-right-radius:0;-webkit-border-bottom-left-radius:0;border-bottom-left-radius:0}.ui-collapsible-set{margin:.5em 0}.ui-collapsible-set .ui-collapsible{margin:-1px 0 0}.ui-collapsible-set .ui-collapsible.ui-first-child{margin-top:0}.ui-controlgroup,fieldset.ui-controlgroup{padding:0;margin:.5em 0;zoom:1}.ui-controlgroup.ui-mini,fieldset.ui-controlgroup.ui-mini{margin:.25em 0}.ui-field-contain .ui-controlgroup,.ui-field-contain fieldset.ui-controlgroup{margin:0}.ui-bar .ui-controlgroup{margin:0 5px}.ui-controlgroup-label{font-size:16px;line-height:1.4;font-weight:400;margin:0 0 .4em}.ui-controlgroup-controls label.ui-select,.ui-controlgroup-controls label.ui-submit{position:absolute;left:-9999px}.ui-controlgroup li{list-style:none}.ui-controlgroup .ui-btn{margin:0}.ui-controlgroup .ui-btn-icon-notext{width:auto;height:auto;top:auto}.ui-controlgroup .ui-btn-icon-notext .ui-btn-inner{height:20px;padding:.6em 20px}.ui-controlgroup-horizontal .ui-btn-icon-notext .ui-btn-inner{width:18px}.ui-controlgroup.ui-mini .ui-btn-icon-notext .ui-btn-inner,.ui-header .ui-controlgroup .ui-btn-icon-notext .ui-btn-inner,.ui-footer .ui-controlgroup .ui-btn-icon-notext .ui-btn-inner{height:16px;padding:.55em 11px .5em}.ui-controlgroup .ui-btn-icon-notext .ui-btn-inner .ui-icon{position:absolute;top:50%;right:50%;margin:-9px -9px 0 0}.ui-controlgroup-horizontal .ui-btn-inner{text-align:center}.ui-controlgroup-horizontal.ui-mini .ui-btn-inner{height:16px;line-height:16px}.ui-controlgroup .ui-checkbox label,.ui-controlgroup .ui-radio label{font-size:16px}.ui-controlgroup-horizontal .ui-controlgroup-controls:before,.ui-controlgroup-horizontal .ui-controlgroup-controls:after{content:"";display:table}.ui-controlgroup-horizontal .ui-controlgroup-controls:after{clear:both}.ui-controlgroup-horizontal .ui-controlgroup-controls{display:inline-block;vertical-align:middle;zoom:1}.ui-controlgroup-horizontal .ui-controlgroup-controls>.ui-btn,.ui-controlgroup-horizontal .ui-controlgroup-controls li>.ui-btn,.ui-controlgroup-horizontal .ui-checkbox,.ui-controlgroup-horizontal .ui-radio,.ui-controlgroup-horizontal .ui-select{float:left;clear:none;margin:0}.ui-controlgroup-horizontal .ui-select .ui-btn-text{width:auto}.ui-controlgroup-vertical .ui-btn{border-bottom-width:0}.ui-controlgroup-vertical .ui-btn.ui-last-child{border-bottom-width:1px}.ui-controlgroup-horizontal .ui-btn{border-right-width:0}.ui-controlgroup-horizontal .ui-btn.ui-last-child{border-right-width:1px}.ui-controlgroup .ui-btn-corner-all{-webkit-border-radius:0;border-radius:0}.ui-controlgroup .ui-controlgroup-controls,.ui-controlgroup .ui-radio,.ui-controlgroup .ui-checkbox,.ui-controlgroup .ui-select,.ui-controlgroup li{-webkit-border-radius:inherit;border-radius:inherit}.ui-controlgroup-vertical .ui-btn.ui-first-child{-webkit-border-top-left-radius:inherit;border-top-left-radius:inherit;-webkit-border-top-right-radius:inherit;border-top-right-radius:inherit}.ui-controlgroup-vertical .ui-btn.ui-last-child{-webkit-border-bottom-left-radius:inherit;border-bottom-left-radius:inherit;-webkit-border-bottom-right-radius:inherit;border-bottom-right-radius:inherit}.ui-controlgroup-horizontal .ui-btn.ui-first-child{-webkit-border-top-left-radius:inherit;border-top-left-radius:inherit;-webkit-border-bottom-left-radius:inherit;border-bottom-left-radius:inherit}.ui-controlgroup-horizontal .ui-btn.ui-last-child{-webkit-border-top-right-radius:inherit;border-top-right-radius:inherit;-webkit-border-bottom-right-radius:inherit;border-bottom-right-radius:inherit}.ui-controlgroup .ui-shadow:not(.ui-focus){-moz-box-shadow:none;-webkit-box-shadow:none;box-shadow:none}@media all and (min-width:28em){.ui-field-contain .ui-controlgroup-label{vertical-align:top;display:inline-block;width:20%;margin:0 2% 0 0}.ui-field-contain .ui-controlgroup-controls{width:78%;display:inline-block}.ui-field-contain .ui-controlgroup .ui-select{width:100%;display:block}.ui-field-contain .ui-controlgroup-horizontal .ui-select{width:auto}.ui-hide-label .ui-controlgroup-controls{width:100%}}.ui-dialog{background:none!important}.ui-dialog-contain{width:92.5%;max-width:500px;margin:10% auto 15px;padding:0;position:relative;top:-15px}.ui-dialog-contain>.ui-header,.ui-dialog-contain>.ui-content,.ui-dialog-contain>.ui-footer{display:block;position:relative;width:auto;margin:0}.ui-dialog-contain>.ui-header{border:0;overflow:hidden;z-index:10;padding:0}.ui-dialog-contain>.ui-content{padding:15px}.ui-dialog-contain>.ui-footer{z-index:10;padding:0 15px}.ui-popup-open .ui-header-fixed,.ui-popup-open .ui-footer-fixed{position:absolute!important}.ui-popup-screen{background-image:url(data:image/gif;base64,R0lGODlhAQABAID/AMDAwAAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==);top:0;left:0;right:0;bottom:1px;position:absolute;filter:Alpha(Opacity=0);opacity:0;z-index:1099}.ui-popup-screen.in{opacity:.5;filter:Alpha(Opacity=50)}.ui-popup-screen.out{opacity:0;filter:Alpha(Opacity=0)}.ui-popup-container{z-index:1100;display:inline-block;position:absolute;padding:0;outline:0}.ui-popup{position:relative}.ui-popup.ui-content,.ui-popup .ui-content{overflow:visible}.ui-popup>p,.ui-popup>h1,.ui-popup>h2,.ui-popup>h3,.ui-popup>h4,.ui-popup>h5,.ui-popup>h6{margin:.5em 7px}.ui-popup>span{display:block;margin:.5em 7px}.ui-popup .ui-title{font-size:16px;font-weight:700;margin-top:.5em;margin-bottom:.5em}.ui-popup-container .ui-content>p,.ui-popup-container .ui-content>h1,.ui-popup-container .ui-content>h2,.ui-popup-container .ui-content>h3,.ui-popup-container .ui-content>h4,.ui-popup-container .ui-content>h5,.ui-popup-container .ui-content>h6{margin:.5em 0}.ui-popup-container .ui-content>span{margin:0}.ui-popup-container .ui-content>p:first-child,.ui-popup-container .ui-content>h1:first-child,.ui-popup-container .ui-content>h2:first-child,.ui-popup-container .ui-content>h3:first-child,.ui-popup-container .ui-content>h4:first-child,.ui-popup-container .ui-content>h5:first-child,.ui-popup-container .ui-content>h6:first-child{margin-top:0}.ui-popup-container .ui-content>p:last-child,.ui-popup-container .ui-content>h1:last-child,.ui-popup-container .ui-content>h2:last-child,.ui-popup-container .ui-content>h3:last-child,.ui-popup-container .ui-content>h4:last-child,.ui-popup-container .ui-content>h5:last-child,.ui-popup-container .ui-content>h6:last-child{margin-bottom:0}.ui-popup>img{width:auto;height:auto;max-width:100%;max-height:100%;vertical-align:middle}.ui-popup:not(.ui-content)>img:only-child,.ui-popup:not(.ui-content)>.ui-btn-left:first-child+img:last-child,.ui-popup:not(.ui-content)>.ui-btn-right:first-child+img:last-child{-webkit-border-radius:inherit;border-radius:inherit}.ui-popup iframe{vertical-align:middle}@media all and (min-width:28em){.ui-popup .ui-field-contain label.ui-submit,.ui-popup .ui-field-contain .ui-controlgroup-label,.ui-popup .ui-field-contain label.ui-select,.ui-popup .ui-field-contain label.ui-input-text{font-size:16px;line-height:1.4;display:block;font-weight:400;margin:0 0 .3em}.ui-popup .ui-field-contain .ui-btn.ui-submit,.ui-popup .ui-field-contain .ui-controlgroup-controls,.ui-popup .ui-field-contain .ui-select,.ui-popup .ui-field-contain input.ui-input-text,.ui-popup .ui-field-contain textarea.ui-input-text,.ui-popup .ui-field-contain .ui-input-search{width:100%;display:block}}.ui-popup>.ui-btn-left,.ui-popup>.ui-btn-right{position:absolute;top:-9px;margin:0;z-index:1101}.ui-popup>.ui-btn-left{left:-9px}.ui-popup>.ui-btn-right{right:-9px}.ui-popup-hidden{top:-99999px;left:-9999px}.ui-checkbox,.ui-radio{position:relative;clear:both;margin:0;z-index:1}.ui-checkbox .ui-btn,.ui-radio .ui-btn{text-align:left;z-index:2}.ui-controlgroup .ui-checkbox .ui-btn,.ui-controlgroup .ui-radio .ui-btn{margin:0}.ui-checkbox .ui-btn-inner,.ui-radio .ui-btn-inner{white-space:normal}.ui-checkbox .ui-btn-icon-left .ui-btn-inner,.ui-radio .ui-btn-icon-left .ui-btn-inner{padding-left:45px}.ui-checkbox .ui-mini.ui-btn-icon-left .ui-btn-inner,.ui-radio .ui-mini.ui-btn-icon-left .ui-btn-inner{padding-left:36px}.ui-checkbox .ui-btn-icon-right .ui-btn-inner,.ui-radio .ui-btn-icon-right .ui-btn-inner{padding-right:45px}.ui-checkbox .ui-mini.ui-btn-icon-right .ui-btn-inner,.ui-radio .ui-mini.ui-btn-icon-right .ui-btn-inner{padding-right:36px}.ui-checkbox .ui-btn-icon-top .ui-btn-inner,.ui-radio .ui-btn-icon-top .ui-btn-inner{padding-right:0;padding-left:0;text-align:center}.ui-checkbox .ui-btn-icon-bottom .ui-btn-inner,.ui-radio .ui-btn-icon-bottom .ui-btn-inner{padding-right:0;padding-left:0;text-align:center}.ui-checkbox .ui-icon,.ui-radio .ui-icon{top:1.1em}.ui-checkbox .ui-btn-icon-left .ui-icon,.ui-radio .ui-btn-icon-left .ui-icon{left:15px}.ui-checkbox .ui-mini.ui-btn-icon-left .ui-icon,.ui-radio .ui-mini.ui-btn-icon-left .ui-icon{left:9px}.ui-checkbox .ui-btn-icon-right .ui-icon,.ui-radio .ui-btn-icon-right .ui-icon{right:15px}.ui-checkbox .ui-mini.ui-btn-icon-right .ui-icon,.ui-radio .ui-mini.ui-btn-icon-right .ui-icon{right:9px}.ui-checkbox .ui-btn-icon-top .ui-icon,.ui-radio .ui-btn-icon-top .ui-icon{top:10px}.ui-checkbox .ui-btn-icon-bottom .ui-icon,.ui-radio .ui-btn-icon-bottom .ui-icon{top:auto;bottom:10px}.ui-checkbox .ui-btn-icon-right .ui-icon,.ui-radio .ui-btn-icon-right .ui-icon{right:15px}.ui-checkbox .ui-mini.ui-btn-icon-right .ui-icon,.ui-radio .ui-mini.ui-btn-icon-right .ui-icon{right:9px}.ui-controlgroup-horizontal .ui-checkbox .ui-icon,.ui-controlgroup-horizontal .ui-radio .ui-icon{display:none}.ui-controlgroup-horizontal .ui-checkbox .ui-btn-inner,.ui-controlgroup-horizontal .ui-radio .ui-btn-inner{padding:.6em 20px}.ui-controlgroup-horizontal .ui-checkbox .ui-mini .ui-btn-inner,.ui-controlgroup-horizontal .ui-radio .ui-mini .ui-btn-inner{padding:.55em 11px .5em}.ui-checkbox input,.ui-radio input{position:absolute;left:20px;top:50%;width:10px;height:10px;margin:-5px 0 0 0;outline:0!important;z-index:1}.ui-field-contain,fieldset.ui-field-contain{padding:.8em 0;margin:0;border-width:0 0 1px;overflow:visible}.ui-field-contain:last-child{border-bottom-width:0}.ui-field-contain{max-width:100%}@media all and (min-width:28em){.ui-field-contain,.ui-mobile fieldset.ui-field-contain{border-width:0;padding:0;margin:1em 0}}.ui-select{display:block;position:relative}.ui-select select{position:absolute;left:-9999px;top:-9999px}.ui-select .ui-btn{opacity:1}.ui-field-contain .ui-select .ui-btn{margin:0}.ui-select .ui-btn select{cursor:pointer;-webkit-appearance:none;left:0;top:0;width:100%;min-height:1.5em;min-height:100%;height:3em;max-height:100%;filter:Alpha(Opacity=0);opacity:0;z-index:2}.ui-select .ui-disabled{opacity:.3}.ui-select .ui-disabled select{display:none}@-moz-document url-prefix(){.ui-select .ui-btn select{opacity:.0001}}.ui-select .ui-btn.ui-select-nativeonly{border-radius:0;border:0}.ui-select .ui-btn.ui-select-nativeonly select{opacity:1;text-indent:0;display:block}.ui-select .ui-disabled.ui-select-nativeonly .ui-btn-inner{opacity:0}.ui-select .ui-btn-icon-right .ui-btn-inner,.ui-select .ui-li-has-count .ui-btn-inner{padding-right:45px}.ui-select .ui-mini.ui-btn-icon-right .ui-btn-inner{padding-right:32px}.ui-select .ui-btn-icon-right.ui-li-has-count .ui-btn-inner{padding-right:80px}.ui-select .ui-mini.ui-btn-icon-right.ui-li-has-count .ui-btn-inner{padding-right:67px}.ui-select .ui-btn-icon-right .ui-icon{right:15px}.ui-select .ui-mini.ui-btn-icon-right .ui-icon{right:7px}.ui-select .ui-btn-icon-right.ui-li-has-count .ui-li-count{right:45px}.ui-select .ui-mini.ui-btn-icon-right.ui-li-has-count .ui-li-count{right:32px}label.ui-select{font-size:16px;line-height:1.4;font-weight:400;margin:0 0 .3em;display:block}.ui-select .ui-btn-text,.ui-selectmenu .ui-btn-text{display:block;min-height:1em;overflow:hidden!important}.ui-select .ui-btn-text{text-overflow:ellipsis}.ui-selectmenu{padding:6px;min-width:160px}.ui-selectmenu .ui-listview{margin:0}.ui-selectmenu .ui-btn.ui-li-divider{cursor:default}.ui-screen-hidden,.ui-selectmenu-list .ui-li .ui-icon{display:none}.ui-selectmenu-list .ui-li .ui-icon{display:block}.ui-li.ui-selectmenu-placeholder{display:none}.ui-selectmenu .ui-header{margin:0;padding:0}.ui-selectmenu.ui-popup .ui-header{-webkit-border-top-left-radius:0;border-top-left-radius:0;-webkit-border-top-right-radius:0;border-top-right-radius:0}.ui-selectmenu .ui-header .ui-title{margin:.6em 46px .8em}@media all and (min-width:28em){.ui-field-contain label.ui-select{vertical-align:top;display:inline-block;width:20%;margin:0 2% 0 0}.ui-field-contain .ui-select{width:78%;display:inline-block}.ui-hide-label .ui-select{width:100%}}.ui-selectmenu .ui-header h1:after{content:'.';visibility:hidden}label.ui-input-text{font-size:16px;line-height:1.4;display:block;font-weight:400;margin:0 0 .3em}input.ui-input-text,textarea.ui-input-text{background-image:none;padding:.4em;margin:.5em 0;min-height:1.4em;line-height:1.4em;font-size:16px;display:block;width:100%;outline:0}input.ui-mini,.ui-mini input,textarea.ui-mini{font-size:14px}div.ui-input-text input.ui-input-text,div.ui-input-text textarea.ui-input-text,.ui-input-search input.ui-input-text{border:0;width:100%;padding:.4em 0;margin:0;display:block;background:transparent none;outline:0!important}.ui-input-search,div.ui-input-text{margin:.5em 0;background-image:none;position:relative}.ui-input-search{padding:0 30px}div.ui-input-text{padding:0 .4em}div.ui-input-has-clear{padding:0 30px 0 .4em}input.ui-input-text.ui-mini,textarea.ui-input-text.ui-mini,.ui-input-search.ui-mini,div.ui-input-text.ui-mini{margin:.25em 0}.ui-field-contain input.ui-input-text,.ui-field-contain textarea.ui-input-text,.ui-field-contain .ui-input-search,.ui-field-contain div.ui-input-text{margin:0}textarea.ui-input-text{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;-ms-box-sizing:border-box;box-sizing:border-box}input.ui-input-text{-webkit-appearance:none}textarea.ui-input-text{height:50px;-webkit-transition:height 200ms linear;-moz-transition:height 200ms linear;-o-transition:height 200ms linear;transition:height 200ms linear}textarea.ui-mini{height:45px}.ui-icon-searchfield:after{position:absolute;left:7px;top:50%;margin-top:-9px;content:"";width:18px;height:18px;opacity:.5}.ui-input-search .ui-input-clear,.ui-input-text .ui-input-clear{position:absolute;right:0;top:50%;margin-top:-13px}.ui-mini .ui-input-clear{right:-3px}.ui-input-search .ui-input-clear-hidden,.ui-input-text .ui-input-clear-hidden{display:none}input::-moz-placeholder,textarea::-moz-placeholder{color:#aaa}input[type=number]::-webkit-outer-spin-button{margin:0}@media all and (min-width:28em){.ui-field-contain label.ui-input-text{vertical-align:top;display:inline-block;width:20%;margin:0 2% 0 0}.ui-field-contain input.ui-input-text,.ui-field-contain textarea.ui-input-text,.ui-field-contain .ui-input-search,.ui-field-contain div.ui-input-text{width:78%;display:inline-block}.ui-field-contain .ui-input-search,.ui-field-contain div.ui-input-text{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;-ms-box-sizing:border-box;box-sizing:border-box}.ui-hide-label input.ui-input-text,.ui-hide-label textarea.ui-input-text,.ui-hide-label .ui-input-search,.ui-hide-label div.ui-input-text,.ui-input-search input.ui-input-text,div.ui-input-text input.ui-input-text{width:100%}}.ui-rangeslider{zoom:1;margin:0}.ui-rangeslider:before,.ui-rangeslider:after{content:"";display:table}.ui-rangeslider:after{clear:both}.ui-rangeslider input.ui-input-text.ui-slider-input{margin:.57143em 0}.ui-rangeslider.ui-mini input.ui-slider-input{margin:.28571em 0}.ui-rangeslider input.ui-slider-input.ui-rangeslider-last{float:right}.ui-rangeslider .ui-rangeslider-sliders{position:relative;overflow:visible;height:30px;margin:.5em 68px}.ui-rangeslider.ui-mini .ui-rangeslider-sliders{margin:.25em 68px}.ui-field-contain .ui-rangeslider input.ui-slider-input,.ui-field-contain .ui-rangeslider.ui-mini input.ui-slider-input,.ui-field-contain .ui-rangeslider .ui-rangeslider-sliders,.ui-field-contain .ui-rangeslider.ui-mini .ui-rangeslider-sliders{margin-top:0;margin-bottom:0}.ui-rangeslider .ui-rangeslider-sliders .ui-slider-track{position:absolute;top:6px;right:0;left:0;margin:0}.ui-rangeslider.ui-mini .ui-rangeslider-sliders .ui-slider-track{top:8px}.ui-rangeslider .ui-slider-track:first-child .ui-slider-bg{display:none}.ui-rangeslider .ui-rangeslider-sliders .ui-slider-track:first-child{background-color:transparent;background:0;border-width:0;height:0}html >body .ui-rangeslider .ui-rangeslider-sliders .ui-slider-track:first-child{height:15px;border-width:1px}html >body .ui-rangeslider.ui-mini .ui-rangeslider-sliders .ui-slider-track:first-child{height:12px}@media all and (min-width:28em){.ui-field-contain .ui-rangeslider label.ui-slider{float:left}.ui-field-contain .ui-rangeslider input.ui-slider-input{position:relative;z-index:1}.ui-field-contain .ui-rangeslider input.ui-slider-input.ui-rangeslider-first,.ui-field-contain .ui-rangeslider.ui-mini input.ui-slider-input.ui-rangeslider-first{margin-right:17px}.ui-field-contain .ui-rangeslider .ui-rangeslider-sliders,.ui-field-contain .ui-rangeslider.ui-mini .ui-rangeslider-sliders{float:left;width:78%;margin:0 -68px}.ui-field-contain .ui-rangeslider .ui-slider-track,.ui-field-contain .ui-rangeslider.ui-mini .ui-slider-track{right:68px;left:68px}.ui-field-contain.ui-hide-label .ui-rangeslider input.ui-slider-input.ui-rangeslider-first{margin:0}.ui-field-contain.ui-hide-label .ui-rangeslider .ui-rangeslider-sliders,.ui-field-contain.ui-hide-label .ui-rangeslider.ui-mini .ui-rangeslider-sliders{width:auto;float:none;margin:0 68px}.ui-field-contain.ui-hide-label .ui-rangeslider .ui-slider-track,.ui-field-contain.ui-hide-label .ui-rangeslider.ui-mini .ui-slider-track{right:0;left:0}}.ui-listview{margin:0}ol.ui-listview,ol.ui-listview .ui-li-divider{counter-reset:listnumbering}.ui-content .ui-listview,.ui-panel-inner>.ui-listview{margin:-15px}.ui-collapsible-content>.ui-listview{margin:-10px -15px}.ui-content .ui-listview-inset,.ui-panel-inner .ui-listview-inset{margin:1em 0}.ui-collapsible-content .ui-listview-inset{margin:.5em 0}.ui-listview,.ui-li{list-style:none;padding:0}.ui-li,.ui-li.ui-field-contain{display:block;margin:0;position:relative;overflow:visible;text-align:left;border-width:0;border-top-width:1px}.ui-li.ui-btn,.ui-li.ui-field-contain,.ui-li-divider,.ui-li-static{margin:0}.ui-listview-inset .ui-li{border-right-width:1px;border-left-width:1px}.ui-li.ui-last-child,.ui-li.ui-field-contain.ui-last-child{border-bottom-width:1px}.ui-collapsible-content>.ui-listview:not(.ui-listview-inset)>.ui-li.ui-first-child{border-top-width:0}.ui-collapsible-themed-content .ui-listview:not(.ui-listview-inset)>.ui-li.ui-last-child{border-bottom-width:0}.ui-li .ui-btn-text a.ui-link-inherit{text-overflow:ellipsis;overflow:hidden;white-space:nowrap}.ui-li-static{background-image:none}.ui-li-divider{padding:.5em 15px;font-size:14px;font-weight:700}ol.ui-listview .ui-link-inherit:before,ol.ui-listview .ui-li-static:before,.ui-li-dec{font-size:.8em;display:inline-block;padding-right:.3em;font-weight:400;counter-increment:listnumbering;content:counter(listnumbering) ". "}ol.ui-listview .ui-li-jsnumbering:before{content:""!important}.ui-listview .ui-li>.ui-btn-text{-webkit-border-radius:inherit;border-radius:inherit}.ui-listview>.ui-li.ui-first-child,.ui-listview .ui-btn.ui-first-child>.ui-li>.ui-btn-text>.ui-link-inherit{-webkit-border-top-right-radius:inherit;border-top-right-radius:inherit;-webkit-border-top-left-radius:inherit;border-top-left-radius:inherit}.ui-listview>.ui-li.ui-last-child,.ui-listview .ui-btn.ui-last-child>.ui-li>.ui-btn-text>.ui-link-inherit,.ui-collapsible-content>.ui-listview:not(.ui-listview-inset),.ui-collapsible-content>.ui-listview:not(.ui-listview-inset) .ui-li.ui-last-child{-webkit-border-bottom-right-radius:inherit;border-bottom-right-radius:inherit;-webkit-border-bottom-left-radius:inherit;border-bottom-left-radius:inherit}.ui-listview>.ui-li.ui-first-child .ui-li-link-alt{-webkit-border-top-right-radius:inherit;border-top-right-radius:inherit}.ui-listview>.ui-li.ui-last-child .ui-li-link-alt{-webkit-border-bottom-right-radius:inherit;border-bottom-right-radius:inherit}.ui-listview>.ui-li.ui-first-child .ui-li-thumb:not(.ui-li-icon){-webkit-border-top-left-radius:inherit;border-top-left-radius:inherit}.ui-listview>.ui-li.ui-last-child .ui-li-thumb:not(.ui-li-icon){-webkit-border-bottom-left-radius:inherit;border-bottom-left-radius:inherit}.ui-li>.ui-btn-inner{display:block;position:relative;padding:0}.ui-li .ui-btn-inner a.ui-link-inherit,.ui-li-static.ui-li{padding:.7em 15px;display:block}.ui-li-has-thumb .ui-btn-inner a.ui-link-inherit,.ui-li-static.ui-li-has-thumb{min-height:59px;padding-left:100px}.ui-li-has-icon .ui-btn-inner a.ui-link-inherit,.ui-li-static.ui-li-has-icon{min-height:20px;padding-left:40px}.ui-li-has-count .ui-btn-inner a.ui-link-inherit,.ui-li-static.ui-li-has-count,.ui-li-divider.ui-li-has-count{padding-right:45px}.ui-li-has-arrow .ui-btn-inner a.ui-link-inherit,.ui-li-static.ui-li-has-arrow{padding-right:40px}.ui-li-has-arrow.ui-li-has-count .ui-btn-inner a.ui-link-inherit,.ui-li-static.ui-li-has-arrow.ui-li-has-count{padding-right:75px}.ui-li-heading{font-size:16px;font-weight:700;display:block;margin:.6em 0;text-overflow:ellipsis;overflow:hidden;white-space:nowrap}.ui-li-desc{font-size:12px;font-weight:400;display:block;margin:-.5em 0 .6em;text-overflow:ellipsis;overflow:hidden;white-space:nowrap}ol.ui-listview>.ui-li .ui-li-heading{display:inline-block;width:100%;margin-left:-1.3em;text-indent:1.3em;vertical-align:middle}ol.ui-listview>.ui-li .ui-li-desc:not(.ui-li-aside){text-indent:1.55em}.ui-li-thumb,.ui-listview .ui-li-icon{position:absolute;left:1px;top:0;max-height:80px;max-width:80px}.ui-listview .ui-li-icon{max-height:16px;max-width:16px;left:10px;top:.9em}.ui-li-thumb,.ui-listview .ui-li-icon,.ui-li-content{float:left;margin-right:10px}.ui-li-aside{float:right;width:50%;text-align:right;margin:.3em 0}@media all and (min-width:480px){.ui-li-aside{width:45%}}.ui-li-divider{cursor:default}.ui-li-has-alt .ui-btn-inner a.ui-link-inherit,.ui-li-static.ui-li-has-alt{padding-right:53px}.ui-li-has-alt.ui-li-has-count .ui-btn-inner a.ui-link-inherit,.ui-li-static.ui-li-has-alt.ui-li-has-count{padding-right:88px}.ui-li-has-count .ui-li-count{position:absolute;font-size:11px;font-weight:700;padding:.2em .5em;top:50%;margin-top:-.9em;right:10px}.ui-li-has-count.ui-li-divider .ui-li-count,.ui-li-has-count .ui-link-inherit .ui-li-count{margin-top:-.95em}.ui-li-has-arrow.ui-li-has-count .ui-li-count{right:40px}.ui-li-has-alt.ui-li-has-count .ui-li-count{right:53px}.ui-li-link-alt{position:absolute;width:40px;height:100%;border-width:0;border-left-width:1px;top:0;right:0;margin:0;padding:0;z-index:2}.ui-li-link-alt .ui-btn{overflow:hidden;position:absolute;right:8px;top:50%;margin:-13px 0 0 0;border-bottom-width:1px;z-index:-1}.ui-li-link-alt .ui-btn-inner{padding:0;height:100%;position:absolute;width:100%;top:0;left:0}.ui-li-link-alt .ui-btn .ui-icon{right:50%;margin-right:-9px}.ui-li-link-alt .ui-btn-icon-notext .ui-btn-inner .ui-icon{position:absolute;top:50%;margin-top:-9px}.ui-listview * .ui-btn-inner>.ui-btn>.ui-btn-inner{border-top:0}.ui-listview-filter{border-width:0;overflow:hidden;margin:-15px -15px 15px -15px}.ui-collapsible-content .ui-listview-filter{margin:-10px -15px 10px -15px;border-bottom:inherit}.ui-listview-filter-inset{margin:-15px -5px;background:transparent}.ui-collapsible-content .ui-listview-filter-inset{margin:-5px;border-bottom-width:0}.ui-listview-filter .ui-input-search{margin:5px;width:auto;display:block}.ui-li.ui-screen-hidden{display:none}@media only screen and (min-device-width:768px) and (max-device-width:1024px){.ui-li .ui-btn-text{overflow:visible}}label.ui-slider{font-size:16px;line-height:1.4;font-weight:400;margin:0;display:block}.ui-field-contain label.ui-slider{margin-bottom:.4em}div.ui-slider{height:30px;margin:.5em 0;zoom:1}div.ui-slider:before,div.ui-slider:after{content:"";display:table}div.ui-slider:after{clear:both}input.ui-input-text.ui-slider-input{display:block;float:left;margin:0;padding:4px;width:40px;height:22px;line-height:22px;font-size:14px;border-width:0;background-image:none;font-weight:700;text-align:center;vertical-align:text-bottom;outline:0;-webkit-box-sizing:content-box;-moz-box-sizing:content-box;-ms-box-sizing:content-box;box-sizing:content-box}.ui-slider-input::-webkit-outer-spin-button,.ui-slider-input::-webkit-inner-spin-button{-webkit-appearance:none;margin:0}.ui-slider-track,.ui-slider-switch{position:relative;overflow:visible;height:15px;margin:0 15px 0 68px;top:6px}.ui-slider-track.ui-mini{height:12px;top:8px}.ui-slider-bg{border:0;height:100%}.ui-slider-track .ui-btn.ui-slider-handle,.ui-slider-switch .ui-btn.ui-slider-handle{position:absolute;z-index:1;top:50%;width:28px;height:28px;margin:-15px 0 0 -15px;outline:0}.ui-slider-track.ui-mini .ui-slider-handle{height:14px;width:14px;margin:-8px 0 0 -7px}.ui-slider-handle .ui-btn-inner{padding:0;height:100%}.ui-slider-track.ui-mini .ui-slider-handle .ui-btn-inner{height:30px;width:30px;padding:0;margin:-9px 0 0 -9px;border-top:0}select.ui-slider-switch{display:none}div.ui-slider-switch{display:inline-block;height:32px;width:5.8em;margin:.5em 0;top:0}div.ui-slider-switch:before,div.ui-slider-switch:after{display:none;clear:none}div.ui-slider-switch.ui-mini{width:5em;height:29px;margin:.25em 0;top:0}.ui-field-contain .ui-slider-switch,.ui-field-contain .ui-slider-switch.ui-mini{margin:0}.ui-slider-inneroffset{margin:0 16px;position:relative;z-index:1}.ui-slider-switch.ui-mini .ui-slider-inneroffset{margin:0 15px 0 14px}.ui-slider-switch .ui-btn.ui-slider-handle{margin:1px 0 0 -15px}.ui-slider-switch.ui-mini .ui-slider-handle{width:25px;height:25px;margin:1px 0 0 -13px;padding:0}.ui-slider-handle-snapping{-webkit-transition:left 70ms linear;-moz-transition:left 70ms linear}.ui-slider-switch.ui-mini .ui-slider-handle .ui-btn-inner{height:30px;width:30px;padding:0;margin:0;border-top:0}.ui-slider-switch .ui-slider-label{position:absolute;text-align:center;width:100%;overflow:hidden;font-size:16px;top:0;line-height:2;min-height:100%;border-width:0;white-space:nowrap;cursor:pointer}.ui-slider-switch.ui-mini .ui-slider-label{font-size:14px}.ui-slider-switch .ui-slider-label-a{z-index:1;left:0;text-indent:-1.5em}.ui-slider-switch .ui-slider-label-b{z-index:0;right:0;text-indent:1.5em}@media all and (min-width:28em){.ui-field-contain label.ui-slider{vertical-align:top;display:inline-block;width:20%;margin:0 2% 0 0}.ui-field-contain div.ui-slider{display:inline-block;width:78%}.ui-field-contain.ui-hide-label div.ui-slider{display:block;width:auto}.ui-field-contain div.ui-slider-switch,.ui-field-contain.ui-hide-label div.ui-slider-switch{display:inline-block;width:5.8em}.ui-field-contain div.ui-slider-switch.ui-mini{width:5em}}.ui-table{border:0;border-collapse:collapse;padding:0;width:100%}.ui-table th,.ui-table td{line-height:1.5em;text-align:left;padding:.4em .5em;vertical-align:top}.ui-table th .ui-btn,.ui-table td .ui-btn{line-height:normal}.ui-table th{font-weight:700}.ui-table caption{text-align:left;margin-bottom:1.4em;opacity:.5}.table-stroke thead th{border-bottom:1px solid #d6d6d6;border-bottom:1px solid rgba(0,0,0,.1)}.table-stroke tbody th,.table-stroke tbody td{border-bottom:1px solid #e6e6e6;border-bottom:1px solid rgba(0,0,0,.05)}.table-stripe tbody tr:nth-child(odd) td,.table-stripe tbody tr:nth-child(odd) th{background-color:#eee;background-color:rgba(0,0,0,.04)}.table-stripe thead th,.table-stripe tbody tr:last-child{border-bottom:1px solid #d6d6d6;border-bottom:1px solid rgba(0,0,0,.1)}.ui-table-columntoggle-btn{float:right;margin-bottom:.8em}.ui-table-columntoggle-popup fieldset{margin:0}@media only all{th.ui-table-priority-6,td.ui-table-priority-6,th.ui-table-priority-5,td.ui-table-priority-5,th.ui-table-priority-4,td.ui-table-priority-4,th.ui-table-priority-3,td.ui-table-priority-3,th.ui-table-priority-2,td.ui-table-priority-2,th.ui-table-priority-1,td.ui-table-priority-1{display:none}}@media screen and (min-width:20em){.ui-table-columntoggle.ui-responsive th.ui-table-priority-1,.ui-table-columntoggle.ui-responsive td.ui-table-priority-1{display:table-cell}}@media screen and (min-width:30em){.ui-table-columntoggle.ui-responsive th.ui-table-priority-2,.ui-table-columntoggle.ui-responsive td.ui-table-priority-2{display:table-cell}}@media screen and (min-width:40em){.ui-table-columntoggle.ui-responsive th.ui-table-priority-3,.ui-table-columntoggle.ui-responsive td.ui-table-priority-3{display:table-cell}}@media screen and (min-width:50em){.ui-table-columntoggle.ui-responsive th.ui-table-priority-4,.ui-table-columntoggle.ui-responsive td.ui-table-priority-4{display:table-cell}}@media screen and (min-width:60em){.ui-table-columntoggle.ui-responsive th.ui-table-priority-5,.ui-table-columntoggle.ui-responsive td.ui-table-priority-5{display:table-cell}}@media screen and (min-width:70em){.ui-table-columntoggle.ui-responsive th.ui-table-priority-6,.ui-table-columntoggle.ui-responsive td.ui-table-priority-6{display:table-cell}}.ui-table-columntoggle th.ui-table-cell-hidden,.ui-table-columntoggle td.ui-table-cell-hidden,.ui-table-columntoggle.ui-responsive th.ui-table-cell-hidden,.ui-table-columntoggle.ui-responsive td.ui-table-cell-hidden{display:none}.ui-table-columntoggle th.ui-table-cell-visible,.ui-table-columntoggle td.ui-table-cell-visible,.ui-table-columntoggle.ui-responsive th.ui-table-cell-visible,.ui-table-columntoggle.ui-responsive td.ui-table-cell-visible{display:table-cell}.ui-table-reflow td .ui-table-cell-label,.ui-table-reflow th .ui-table-cell-label{display:none}@media only all{.ui-table-reflow thead td,.ui-table-reflow thead th{display:none}.ui-table-reflow td,.ui-table-reflow th{text-align:left;display:block}.ui-table-reflow tbody th{margin-top:3em}.ui-table-reflow td .ui-table-cell-label,.ui-table-reflow th .ui-table-cell-label{display:block;padding:.4em;min-width:30%;display:inline-block;margin:-.4em 1em -.4em -.4em}.ui-table-reflow th .ui-table-cell-label-top,.ui-table-reflow td .ui-table-cell-label-top{display:block;padding:.4em 0;margin:.4em 0;text-transform:uppercase;font-size:.9em;font-weight:400}}@media (min-width:35em){.ui-table-reflow.ui-responsive{display:table-row-group}.ui-table-reflow.ui-responsive td,.ui-table-reflow.ui-responsive th,.ui-table-reflow.ui-responsive tbody th,.ui-table-reflow.ui-responsive tbody td,.ui-table-reflow.ui-responsive thead td,.ui-table-reflow.ui-responsive thead th{display:table-cell;margin:0}.ui-table-reflow.ui-responsive td .ui-table-cell-label,.ui-table-reflow.ui-responsive th .ui-table-cell-label{display:none}}@media (max-width:35em){.ui-table-reflow.ui-responsive td,.ui-table-reflow.ui-responsive th{width:100%;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;float:left;clear:left}}.ui-panel{width:17em;min-height:100%;max-height:none;border-width:0;position:absolute;top:0;display:block}.ui-panel-closed{width:0;max-height:100%;overflow:hidden;visibility:hidden}.ui-panel-fixed{position:fixed;bottom:-1px;padding-bottom:1px}.ui-panel-display-overlay{z-index:1001}.ui-panel-display-reveal{z-index:0}.ui-panel-display-push{z-index:999}.ui-panel-inner{padding:15px}.ui-panel-content-wrap{position:relative;left:0;min-height:inherit;border:0;z-index:999}.ui-panel-content-wrap-display-overlay,.ui-panel-animate.ui-panel-content-wrap>.ui-header,.ui-panel-content-wrap-closed{position:static}.ui-panel-dismiss{position:absolute;top:0;left:0;height:100%;width:100%;z-index:1002;display:none}.ui-panel-dismiss-open{display:block}.ui-panel-animate{-webkit-transition:-webkit-transform 350ms ease;-moz-transition:-moz-transform 350ms ease;transition:transform 350ms ease}.ui-panel-animate.ui-panel:not(.ui-panel-display-reveal),.ui-panel-animate.ui-panel:not(.ui-panel-display-reveal)>div,.ui-panel-animate.ui-panel-closed.ui-panel-display-reveal>div,.ui-panel-animate.ui-panel-content-wrap,.ui-panel-animate.ui-panel-content-fixed-toolbar{-webkit-backface-visibility:hidden;-webkit-transform:translate3d(0,0,0)}.ui-panel-position-left{left:-17em}.ui-panel-animate.ui-panel-position-left.ui-panel-display-overlay,.ui-panel-animate.ui-panel-position-left.ui-panel-display-push{left:0;-webkit-transform:translate3d(-17em,0,0);-moz-transform:translate3d(-17em,0,0);transform:translate3d(-17em,0,0)}.ui-panel-position-left.ui-panel-display-reveal,.ui-panel-position-left.ui-panel-open{left:0}.ui-panel-animate.ui-panel-position-left.ui-panel-open.ui-panel-display-overlay,.ui-panel-animate.ui-panel-position-left.ui-panel-open.ui-panel-display-push{-webkit-transform:translate3d(0,0,0);transform:translate3d(0,0,0);-moz-transform:none}.ui-panel-position-right{right:-17em}.ui-panel-animate.ui-panel-position-right.ui-panel-display-overlay,.ui-panel-animate.ui-panel-position-right.ui-panel-display-push{right:0;-webkit-transform:translate3d(17em,0,0);-moz-transform:translate3d(17em,0,0);transform:translate3d(17em,0,0)}.ui-panel-position-right.ui-panel-display-reveal,.ui-panel-position-right.ui-panel-open{right:0}.ui-panel-animate.ui-panel-position-right.ui-panel-open.ui-panel-display-overlay,.ui-panel-animate.ui-panel-position-right.ui-panel-open.ui-panel-display-push{-webkit-transform:translate3d(0,0,0);transform:translate3d(0,0,0);-moz-transform:none}.ui-panel-content-fixed-toolbar-position-left.ui-panel-content-fixed-toolbar-open,.ui-panel-content-wrap-position-left.ui-panel-content-wrap-open,.ui-panel-dismiss-position-left.ui-panel-dismiss-open{left:17em;right:-17em}.ui-panel-animate.ui-panel-content-fixed-toolbar-position-left.ui-panel-content-fixed-toolbar-open.ui-panel-content-fixed-toolbar-display-reveal,.ui-panel-animate.ui-panel-content-fixed-toolbar-position-left.ui-panel-content-fixed-toolbar-open.ui-panel-content-fixed-toolbar-display-push,.ui-panel-animate.ui-panel-content-wrap-position-left.ui-panel-content-wrap-open.ui-panel-content-wrap-display-reveal,.ui-panel-animate.ui-panel-content-wrap-position-left.ui-panel-content-wrap-open.ui-panel-content-wrap-display-push{left:0;right:0;-webkit-transform:translate3d(17em,0,0);-moz-transform:translate3d(17em,0,0);transform:translate3d(17em,0,0)}.ui-panel-content-fixed-toolbar-position-right.ui-panel-content-fixed-toolbar-open,.ui-panel-content-wrap-position-right.ui-panel-content-wrap-open,.ui-panel-dismiss-position-right.ui-panel-dismiss-open{left:-17em;right:17em}.ui-panel-animate.ui-panel-content-fixed-toolbar-position-right.ui-panel-content-fixed-toolbar-open.ui-panel-content-fixed-toolbar-display-reveal,.ui-panel-animate.ui-panel-content-fixed-toolbar-position-right.ui-panel-content-fixed-toolbar-open.ui-panel-content-fixed-toolbar-display-push,.ui-panel-animate.ui-panel-content-wrap-position-right.ui-panel-content-wrap-open.ui-panel-content-wrap-display-reveal,.ui-panel-animate.ui-panel-content-wrap-position-right.ui-panel-content-wrap-open.ui-panel-content-wrap-display-push{left:0;right:0;-webkit-transform:translate3d(-17em,0,0);-moz-transform:translate3d(-17em,0,0);transform:translate3d(-17em,0,0)}.ui-panel-content-fixed-toolbar-open.ui-panel-content-fixed-toolbar-display-overlay,.ui-panel-content-wrap-open.ui-panel-content-wrap-display-overlay{left:0}.ui-page-active.ui-page-panel{overflow-x:hidden}.ui-panel-display-reveal{-webkit-box-shadow:inset -5px 0 5px rgba(0,0,0,.15);-moz-box-shadow:inset -5px 0 5px rgba(0,0,0,.15);box-shadow:inset -5px 0 5px rgba(0,0,0,.15)}.ui-panel-position-right.ui-panel-display-reveal{-webkit-box-shadow:inset 5px 0 5px rgba(0,0,0,.15);-moz-box-shadow:inset 5px 0 5px rgba(0,0,0,.15);box-shadow:inset 5px 0 5px rgba(0,0,0,.15)}.ui-panel-display-overlay{-webkit-box-shadow:5px 0 5px rgba(0,0,0,.15);-moz-box-shadow:5px 0 5px rgba(0,0,0,.15);box-shadow:5px 0 5px rgba(0,0,0,.15)}.ui-panel-position-right.ui-panel-display-overlay{-webkit-box-shadow:-5px 0 5px rgba(0,0,0,.15);-moz-box-shadow:-5px 0 5px rgba(0,0,0,.15);box-shadow:-5px 0 5px rgba(0,0,0,.15)}.ui-panel-display-push.ui-panel-open.ui-panel-position-left{border-right-width:1px;margin-right:-1px}.ui-panel-animate.ui-panel-content-fixed-toolbar-position-left.ui-panel-content-fixed-toolbar-open.ui-panel-content-fixed-toolbar-display-push{margin-left:1px}.ui-panel-display-push.ui-panel-open.ui-panel-position-right{border-left-width:1px;margin-left:-1px}.ui-panel-animate.ui-panel-content-fixed-toolbar-position-right.ui-panel-content-fixed-toolbar-open.ui-panel-content-fixed-toolbar-display-push{margin-right:1px}@media (min-width:55em){.ui-responsive-panel.ui-page-panel-open .ui-panel-content-fixed-toolbar-display-push.ui-panel-content-fixed-toolbar-position-left,.ui-responsive-panel.ui-page-panel-open .ui-panel-content-fixed-toolbar-display-reveal.ui-panel-content-fixed-toolbar-position-left,.ui-responsive-panel.ui-page-panel-open .ui-panel-content-wrap-display-push.ui-panel-content-wrap-position-left,.ui-responsive-panel.ui-page-panel-open .ui-panel-content-wrap-display-reveal.ui-panel-content-wrap-position-left{margin-right:17em}.ui-responsive-panel.ui-page-panel-open .ui-panel-content-fixed-toolbar-display-push.ui-panel-content-fixed-toolbar-position-right,.ui-responsive-panel.ui-page-panel-open .ui-panel-content-fixed-toolbar-display-reveal.ui-panel-content-fixed-toolbar-position-right,.ui-responsive-panel.ui-page-panel-open .ui-panel-content-wrap-display-push.ui-panel-content-wrap-position-right,.ui-responsive-panel.ui-page-panel-open .ui-panel-content-wrap-display-reveal.ui-panel-content-wrap-position-right{margin-left:17em}.ui-responsive-panel.ui-page-panel-open .ui-panel-content-fixed-toolbar-display-push,.ui-responsive-panel.ui-page-panel-open .ui-panel-content-fixed-toolbar-display-reveal{width:auto}.ui-responsive-panel .ui-panel-dismiss-display-push{display:none}}.ui-collapsible-inset .ui-collapsible-content{margin:0;border-right-width:2px;border-left-width:2px} \ No newline at end of file diff --git a/css/main.css b/css/main.css index f84a5327a..afaf2f11a 100644 --- a/css/main.css +++ b/css/main.css @@ -4,6 +4,11 @@ a { text-decoration: none; } +.btn-no-border { + border: none; + background: none !important; + height: 25px; +} #versions { text-align: center; margin: 0; @@ -21,13 +26,17 @@ a { } .mini-load { zoom: 0.5; + height: 2.875em; + width: 2.875em; + margin:0 auto !important; + opacity:0.18; } #weather-list .ui-li-divider { padding: 0.5em 0; text-align: center; } #weather-list { - display: none; + display:none; width:20%; float:left; margin-right:10px; @@ -40,14 +49,21 @@ a { #program-control-list { clear:both; } +.custom-count-pos{ + font-size: 11px; + font-weight: bold; + padding: 0.2em 0.5em; + float: right; +} .nobr { white-space:nowrap } -#footer-running { +#footer-running, #showupdate { + font-weight: normal; display: none; padding: 2px 0; font-size: medium; - margin: 0 -15px 0 -15px; + margin: 0 -16px 0 -16px; position: relative; } #running-icon { @@ -57,43 +73,39 @@ a { max-height:100%; max-width:100%; padding-left:4px; -} + } #running-text { margin:0; text-shadow: none; color: #ffffff; } #footer-running.green #running-text { - padding-left: 20px; + padding-left: 20px; } .rain-desc { word-wrap:normal; - white-space:normal; - overflow:visible; + white-space:normal !important; + overflow:visible !important; text-align:center; } #preview_header .ui-input-text { display: inline-block; width:75%; + vertical-align: text-top; } #preview_header { - margin: 0 -13px 0 -13px; width:100%; white-space:nowrap; text-align:center } #preview_header a { - padding:10px; - } - .use_master .ui-btn-inner { - border-top: 0; + padding-top: 10px; + display: inline-block; + vertical-align: text-top; } .use_master { width: 5%; -} -.use_master .ui-checkbox { - width: 60%; - margin: 0 auto; + text-align: center; } .timeline-event-content a { text-decoration: none; @@ -102,7 +114,10 @@ a { -webkit-touch-callout: none; -webkit-user-select: none; } -#manual ul { +#raindelay, #sure, #addnew { + width: 300px; +} +#manual ul, #forecast ul { max-width: 800px; margin: 16px auto; } @@ -110,13 +125,9 @@ a { background-color: transparent; box-shadow: none; } -#programs_list, #newprogram { - margin-top: 28px; -} #addprogram .ui-input-text, #programs .ui-input-text { margin: 0.1em !important; } - @media (max-width: 480px) { #weather-list { width:80px; @@ -124,9 +135,8 @@ a { #weather-list li:not(.ui-li-divider) { height: auto; } - #weather .location { - font-size:8px; - font-weight: none; + #raindelay, #sure, #addnew { + width: 250px; } div.timeline-frame { counter-reset: station; @@ -136,29 +146,39 @@ a { overflow: hidden; text-overflow: clip; } - div.timeline-groups-text:not(.skip-numbering):before { - content: "S" counter(station) " "; + div.timeline-groups-text:before { + content: attr(data-shortname) " "; white-space:pre; - counter-increment: station; } - div.skip-numbering:before { - content: "M "; - white-space:pre; - } + .ui-mini { + font-size: 12px; + } } @media (max-width: 940px) { + #weather .location { + font-size:8px; + font-weight: none; + white-space: normal !important; + } .wicon { zoom: .5; -moz-transform: scale(0.5); -o-transform: scale(0.5); + display: block !important; + } +} +@media (max-width: 940px) and (min-width: 480px) { + .wicon { + margin: 0 auto !important; } } -div.ui-slider-switch { + +div.ui-flipswitch { position: absolute; right: 5px; top: 5px; - width: 44%; } + .master { background-color: #DEAD5D !important; } @@ -177,27 +197,29 @@ div.ui-slider-switch { background-color: #C96161 !important; text-decoration: line-through; } -.rem { - margin-bottom: 0; -} .red { - background-color: #C96161; - background: #C96161; - color: #FFFFFF; + background-color: #C96161 !important; + background: #C96161 !important; + color: #FFFFFF !important; font-weight: normal; - text-shadow: none; - font-size: larger; + text-shadow: none !important; } .green { - background-color: #16a085; - background: #16a085; + background-color: #16a085 !important; + background: #16a085 !important; color: #FFFFFF !important; font-weight: normal; - text-shadow: none; - font-size: larger; + text-shadow: none !important; +} +.sname { + margin: -.4em 0 !important; +} +.rem { + margin-bottom: 0 !important; + font-size: 0.71em !important; } .ui-header .ui-title { margin-left: 1em; margin-right: 1em; } -div[class*='ui-block-'] { +div[class*='ui-block-'], #log_options, .center { text-align: center } .panelhelp { @@ -206,40 +228,24 @@ div[class*='ui-block-'] { body{ margin: 0; } -div.timeline-frame{border:1px solid #bebebe;overflow:hidden}div.timeline-axis{border-color:#bebebe;border-width:1px;border-top-style:solid}div.timeline-axis-grid{border-left-style:solid;border-width:1px}div.timeline-axis-grid-minor{border-color:#e5e5e5}div.timeline-axis-grid-major{border-color:#bfbfbf}div.timeline-axis-text{color:#4d4d4d;padding:3px;white-space:nowrap}div.timeline-event{color:#1a1a1a;border-color:#97b0f8;background-color:#d5ddf6;display:inline-block}div.timeline-event-selected{border-color:#ffc200;background-color:#fff785;z-index:999}div.timeline-event-cluster div.timeline-event-dot{border-color:#d5ddf6}div.timeline-event-box{text-align:center;border-style:solid;border-width:1px;border-radius:5px;-moz-border-radius:5px}div.timeline-event-dot{border-style:solid;border-width:5px;border-radius:5px;-moz-border-radius:5px}div.timeline-event-range{border-style:solid;border-width:1px;border-radius:2px;-moz-border-radius:2px}div.timeline-event-range-drag-left{cursor:w-resize;z-index:1000}div.timeline-event-range-drag-right{cursor:e-resize;z-index:1000}div.timeline-event-line{border-left-width:1px;border-left-style:solid}div.timeline-event-content{margin:5px;white-space:nowrap;overflow:hidden}div.timeline-groups-axis{border-color:#bebebe;border-width:1px}div.timeline-groups-text{color:#4d4d4d;padding-left:10px;padding-right:10px}div.timeline-currenttime{background-color:#ff7f6e;width:2px}div.timeline-customtime{background-color:#6e94ff;width:2px;cursor:move} -div.timeline-navigation-zoom-in, div.timeline-navigation-zoom-out, -div.timeline-navigation-move-left, div.timeline-navigation-move-right { - cursor: pointer; - padding: 10px 10px; - float: left; - text-decoration: none; - - width: 16px; - height: 16px; -} -div.timeline-navigation-zoom-in { - background: url('../img/zoomin.png') no-repeat center; -} -div.timeline-navigation-zoom-out { - background: url('../img/zoomout.png') no-repeat center; -} -div.timeline-navigation-move-left { - background: url('../img/moveleft.png') no-repeat center; -} -div.timeline-navigation-move-right { - background: url('../img/moveright.png') no-repeat center; +#timeline-navigation { + text-align: center; + display: none; } +div.timeline-frame{border:1px solid #bebebe;overflow:hidden}div.timeline-axis{border-color:#bebebe;border-width:1px;border-top-style:solid}div.timeline-axis-grid{border-left-style:solid;border-width:1px}div.timeline-axis-grid-minor{border-color:#e5e5e5}div.timeline-axis-grid-major{border-color:#bfbfbf}div.timeline-axis-text{color:#4d4d4d;padding:3px;white-space:nowrap}div.timeline-event{color:#1a1a1a;border-color:#97b0f8;background-color:#d5ddf6;display:inline-block}div.timeline-event-selected{border-color:#ffc200;background-color:#fff785;z-index:999}div.timeline-event-cluster div.timeline-event-dot{border-color:#d5ddf6}div.timeline-event-box{text-align:center;border-style:solid;border-width:1px;border-radius:5px;-moz-border-radius:5px}div.timeline-event-dot{border-style:solid;border-width:5px;border-radius:5px;-moz-border-radius:5px}div.timeline-event-range{border-style:solid;border-width:1px;border-radius:2px;-moz-border-radius:2px}div.timeline-event-range-drag-left{cursor:w-resize;z-index:1000}div.timeline-event-range-drag-right{cursor:e-resize;z-index:1000}div.timeline-event-line{border-left-width:1px;border-left-style:solid}div.timeline-event-content{margin:5px;white-space:nowrap;overflow:hidden}div.timeline-groups-axis{border-color:#bebebe;border-width:1px}div.timeline-groups-text{color:#4d4d4d;padding-left:10px;padding-right:10px}div.timeline-currenttime{background-color:#ff7f6e;width:2px}div.timeline-customtime{background-color:#6e94ff;width:2px;cursor:move} div.timeline-frame { - border-color: #16a085; + border-color: #5D99C3; border-radius: 5px; -moz-border-radius: 5px; /* For Firefox 3.6 and older */ } div.timeline-axis { - border-color: #16a085; - background-color: #16a085; + border-color: #5D99C3; + background-color: #5D99C3; +} +div.timeline-axis-grid { } div.timeline-groups-axis { - border-color: #16a085; + border-color: #5D99C3; } div.timeline-axis-text { color: white; @@ -264,61 +270,87 @@ div.timeline-event-content { .wicon { vertical-align: middle; display: inline-block; - margin: -40px -10px -25px -25px; width: 150px; height: 150px; + margin: -35px -10px -25px -30px; background: url(../img/weather-icons-sprite.png); } + +#forecast .wicon { + margin: 0 auto !important; +} + /* Weather Icon Sprites * http://www.alistapart.com/articles/sprites * http://developer.yahoo.com/weather/#codes */ -.wicon.cond0 { background-position: -150px -150px; } /* 0 tornado */ -.wicon.cond1 { background-position: -150px -150px; } /* 1 tropical storm */ -.wicon.cond2 { background-position: -150px -150px; } /* 2 hurricane */ -.wicon.cond3 { background-position: -300px -150px; } /* 3 severe thunderstorms */ -.wicon.cond4 { background-position: -300px -150px; } /* 4 thunderstorms */ -.wicon.cond5 { background-position: 0px -450px; } /* 5 mixed rain and snow */ -.wicon.cond6 { background-position: -150px -450px; } /* 6 mixed rain and sleet */ -.wicon.cond7 { background-position: 0px -600px; } /* 7 mixed snow and sleet */ -.wicon.cond8 { background-position: 0px -600px; } /* 8 freezing drizzle */ -.wicon.cond9 { background-position: -150px -300px; } /* 9 drizzle */ -.wicon.cond10 { background-position: 0px -450px; } /* 10 freezing rain */ -.wicon.cond11 { background-position: 0px 0px; } /* 11 showers */ -.wicon.cond12 { background-position: 0px 0px; } /* 12 showers */ -.wicon.cond13 { background-position: -450px -150px; } /* 13 snow flurries */ -.wicon.cond14 { background-position: -300px -300px; } /* 14 light snow showers */ -.wicon.cond15 { background-position: 0px -150px; } /* 15 blowing snow */ -.wicon.cond16 { background-position: -450px -150px; } /* 16 snow */ -.wicon.cond17 { background-position: -300px -450px; } /* 17 hail */ -.wicon.cond18 { background-position: -150px -450px; } /* 18 sleet */ -.wicon.cond19 { background-position: -150px -600px; } /* 19 dust */ -.wicon.cond20 { background-position: -150px -600px; } /* 20 foggy */ -.wicon.cond21 { background-position: -150px -600px; } /* 21 haze */ -.wicon.cond22 { background-position: -150px -600px; } /* 22 smoky */ -.wicon.cond23 { background-position: -450px -300px; } /* 23 blustery */ -.wicon.cond24 { background-position: -450px -300px; } /* 24 windy */ -.wicon.cond25 { background-position: 0px -150px; } /* 25 cold */ -.wicon.cond26 { background-position: -300px 0px; } /* 26 cloudy */ -.wicon.cond27 { background-position: -300px -600px; } /* 27 mostly cloudy (night) */ -.wicon.cond28 { background-position: 0px -300px; } /* 28 mostly cloudy (day) */ -.wicon.cond29 { background-position: -450px -600px; } /* 29 partly cloudy (night) */ -.wicon.cond30 { background-position: -150px 0px; } /* 30 partly cloudy (day) */ -.wicon.cond31 { background-position: -450px -450px; } /* 31 clear (night) */ -.wicon.cond32 { background-position: -450px 0px; } /* 32 sunny */ -.wicon.cond33 { background-position: -450px -450px; } /* 33 fair (night) */ -.wicon.cond34 { background-position: -450px 0px; } /* 34 fair (day) */ -.wicon.cond35 { background-position: -300px -450px; } /* 35 mixed rain and hail */ -.wicon.cond36 { background-position: -450px 0px; } /* 36 hot */ -.wicon.cond37 { background-position: -300px -150px; } /* 37 isolated thunderstorms */ -.wicon.cond38 { background-position: -300px -150px; } /* 38 scattered thunderstorms */ -.wicon.cond39 { background-position: -300px -150px; } /* 39 scattered thunderstorms */ -.wicon.cond40 { background-position: 0px 0px; } /* 40 scattered showers */ -.wicon.cond41 { background-position: -450px -150px; } /* 41 heavy snow */ -.wicon.cond42 { background-position: 0px -450px; } /* 42 scattered snow showers */ -.wicon.cond43 { background-position: -450px -150px; } /* 43 heavy snow */ -.wicon.cond44 { background-position: -150px 0px; } /* 44 partly cloudy */ -.wicon.cond45 { background-position: -300px -150px; } /* 45 thundershowers */ -.wicon.cond46 { background-position: 0px -450px; } /* 46 snow showers */ -.wicon.cond47 { background-position: -300px -150px; } /* 47 isolated thundershowers */ -.wicon.cond3200 { background: none; display: none; } /* 3200 not available */ \ No newline at end of file +.wicon.cond0 { background-position: -150px -150px; } /* 0 tornado */ +.wicon.cond1 { background-position: -150px -150px; } /* 1 tropical storm */ +.wicon.cond2 { background-position: -150px -150px; } /* 2 hurricane */ +.wicon.cond3, .wicon.condchancetstorms, +.wicon.condnt_chancetstorms { background-position: -300px -150px; } /* 3 severe thunderstorms */ +.wicon.cond4, .wicon.condtstorms, +.wicon.condnt_tstorms { background-position: -300px -150px; } /* 4 thunderstorms */ +.wicon.cond5 { background-position: 0px -450px; } /* 5 mixed rain and snow */ +.wicon.cond6, .wicon.condchancesleet, +.wicon.condnt_chancesleet { background-position: -150px -450px; } /* 6 mixed rain and sleet */ +.wicon.cond7 { background-position: 0px -600px; } /* 7 mixed snow and sleet */ +.wicon.cond8 { background-position: 0px -600px; } /* 8 freezing drizzle */ +.wicon.cond9, .wicon.condchancerain, +.wicon.condnt_chancerain { background-position: -150px -300px; } /* 9 drizzle */ +.wicon.cond10, .wicon.condsleet, +.wicon.condnt_sleet { background-position: 0px -450px; } /* 10 freezing rain */ +.wicon.cond11, .wicon.condrain, +.wicon.condnt_rain { background-position: 0px 0px; } /* 11 showers */ +.wicon.cond12 { background-position: 0px 0px; } /* 12 showers */ +.wicon.cond13, .wicon.condflurries, .wicon.condnt_flurries, .wicon.condchanceflurries, +.wicon.condnt_chanceflurries { background-position: -450px -150px; } /* 13 snow flurries */ +.wicon.cond14, .wicon.condchancesnow, +.wicon.condnt_chancesnow { background-position: -300px -300px; } /* 14 light snow showers */ +.wicon.cond15 { background-position: 0px -150px; } /* 15 blowing snow */ +.wicon.cond16, .wicon.condsnow, +.wicon.condnt_snow { background-position: -450px -150px; } /* 16 snow */ +.wicon.cond17 { background-position: -300px -450px; } /* 17 hail */ +.wicon.cond18, .wicon.condsleet, +.wicon.condnt_sleet { background-position: -150px -450px; } /* 18 sleet */ +.wicon.cond19 { background-position: -150px -600px; } /* 19 dust */ +.wicon.cond20, .wicon.condfog, +.wicon.condnt_fog { background-position: -150px -600px; } /* 20 foggy */ +.wicon.cond21, .wicon.condhazy, +.wicon.condnt_hazy { background-position: -150px -600px; } /* 21 haze */ +.wicon.cond22 { background-position: -150px -600px; } /* 22 smoky */ +.wicon.cond23 { background-position: -450px -300px; } /* 23 blustery */ +.wicon.cond24 { background-position: -450px -300px; } /* 24 windy */ +.wicon.cond25 { background-position: 0px -150px; } /* 25 cold */ +.wicon.cond26, .wicon.condcloudy, +.wicon.condnt_cloudy { background-position: -300px 0px; } /* 26 cloudy */ +.wicon.cond27, .wicon.condnt_mostlycloudy, +.wicon.condnt_partlysunny { background-position: -300px -600px; } /* 27 mostly cloudy (night) */ +.wicon.cond28, .wicon.condmostlycloudy, +.wicon.condpartlysunny { background-position: 0px -300px; } /* 28 mostly cloudy (day) */ +.wicon.cond29, .wicon.condnt_partlycloudy, +.wicon.condnt_mostlysunny { background-position: -450px -600px; } /* 29 partly cloudy (night) */ +.wicon.cond30 , .wicon.condpartlycloudy, +.wicon.condmostlysunny { background-position: -150px 0px; } /* 30 partly cloudy (day) */ +.wicon.cond31, +.wicon.condnt_sunny { background-position: -450px -450px; } /* 31 clear (night) */ +.wicon.cond32, .wicon.condclear, +.wicon.condsunny { background-position: -450px 0px; } /* 32 sunny */ +.wicon.cond33, +.wicon.condnt_clear { background-position: -450px -450px; } /* 33 fair (night) */ +.wicon.cond34 { background-position: -450px 0px; } /* 34 fair (day) */ +.wicon.cond35 { background-position: -300px -450px; } /* 35 mixed rain and hail */ +.wicon.cond36 { background-position: -450px 0px; } /* 36 hot */ +.wicon.cond37 { background-position: -300px -150px; } /* 37 isolated thunderstorms */ +.wicon.cond38 { background-position: -300px -150px; } /* 38 scattered thunderstorms */ +.wicon.cond39 { background-position: -300px -150px; } /* 39 scattered thunderstorms */ +.wicon.cond40 { background-position: 0px 0px; } /* 40 scattered showers */ +.wicon.cond41 { background-position: -450px -150px; } /* 41 heavy snow */ +.wicon.cond42 { background-position: 0px -450px; } /* 42 scattered snow showers */ +.wicon.cond43 { background-position: -450px -150px; } /* 43 heavy snow */ +.wicon.cond44 { background-position: -150px 0px; } /* 44 partly cloudy */ +.wicon.cond45 { background-position: -300px -150px; } /* 45 thundershowers */ +.wicon.cond46 { background-position: 0px -450px; } /* 46 snow showers */ +.wicon.cond47 { background-position: -300px -150px; } /* 47 isolated thundershowers */ +.wicon.cond3200, .wicon.condunknown, +.wicon.condnt_unknown { background: none; display: none; } /* 3200 not available */ diff --git a/index.htm b/index.htm new file mode 100644 index 000000000..615838a8c --- /dev/null +++ b/index.htm @@ -0,0 +1,323 @@ + + + + Sprinkler System + + + + + + + + + + + + +
+ +
+
+

New Device

+
+
+
+

Note: The name is used to identify the OpenSprinkler within the web app. This is used for multisite support. OpenSprinkler IP can be either an IP or hostname. You can also specify a port by using IP:Port

+
+ + + + + + + +
+
+
+
+ +
+
+ + Settings +

+
+
+ +
+

Update Available

+
+ + + +
+
+ +
+
+ + +
+
+ +
+
+

Forecast

+ Back + Refresh +
+
+ +
+
+ +
+
+

Current Status

+ Back + Refresh +
+
+

+ + +
+
+ +
+
+

Manual Control

+ Back +
+
+

With manual mode turned on, tap a station to toggle it.

+ + +
+
+ +
+
+

Run-Once Program

+ Back + Submit +
+
+
+
+ +
+
+

Programs

+ Back + Add +
+
+
+
+ +
+
+

Add Program

+ Back + Submit +
+
+
+
+ +
+
+

Settings

+ Back +
+
+ + +
+
+
+
+ +
+
+

OS Settings

+ Back + Submit +
+
+ +
+
+ +
+
+

Weather Settings

+ Back +
+
+ +
+
+ +
+
+

Edit Stations

+ Back + Submit +
+
+ +
+
+ +
+
+

Program Preview

+ Back +
+
+
+ + + +
+
+
+ + + + +
+
+
+ +
+
+
+
+ +
+
+

Manage Sites

+ Back + Add +
+
+
+
+ +
+
+

About

+ Back +
+
+
+
+

Background

+

I, Samer Albahra, am a medical school graduate, currently doing a pathology residency at UTHSCSA. I enjoy making mobile applications in my spare time and was excited when I first discovered the OpenSprinkler, an open-source Internet based sprinkler system, which lacked a truly mobile interface.

+

I decided to add a mobile front-end using jQuery Mobile. There were a few things I wanted to accomplish:

+
  • Large on/off buttons in manual mode
  • Easy slider inputs for any duration input
  • Compatibility between many/all devices
  • Easy feedback of current status
  • Easy program input/modification
+

Fortunately, I had a lot of feedback on Ray's forums and now have an application that has been tested across many devices and installed in many unique environments.

+

I fully support every feature of the OpenSprinkler and also the OpenSprinkler Pi (using the interval program).

+

Changelog can be viewed on Github.

+
+
+

Donate

+

This web app has been developed by Samer Albahra. If you enjoy it please donate by clicking the button below.

+
+ + + + +
+
+
+

+

+
+
+ + + + + + + diff --git a/index.php b/index.php deleted file mode 100644 index 5fe6e0d1e..000000000 --- a/index.php +++ /dev/null @@ -1,375 +0,0 @@ - - - - - - Sprinkler System - - - - - - - - - - - - - - -
- -
-
- - Settings -

-
-
- - - - -
-
- -
-
- -
-
-

Current Status

- Back - Refresh -
-
-

- - -
-
- -
-
-

Manual Control

- Back -
-
-

With manual mode turned on, tap a station to toggle it.

- - -
-
- -
-
-

Run-Once Program

- Back - Submit -
-
-
-
- -
-
-

Programs

- Back - Add -
-
-
-
- -
-
-

Add Program

- Back - Submit -
-
-
-
- -
-
-

Rain Delay

- Back -
-
-

Rain delay allows you to disable all programs for a set duration.

- -
-
- -
-
-

Settings

- Back -
-
- - -
-
- -
-
-

OS Settings

- Back - Submit -
-
- -
-
- -
-
-

Edit Stations

- Back - Submit -
-
- -
-
- -
-
-

Program Preview

- Back -
-
-
- - - -
-
- -
-
- -
-
-

About

- Back -
-
-
-
-

Background

-

I, Samer Albahra, am a medical school graduate, currently doing a pathology residency at UTHSCSA. I enjoy making mobile applications in my spare time and was excited when I first discovered the OpenSprinkler, an open-source Internet based sprinkler system, which lacked a truly mobile interface.

-

I decided to add a mobile front-end using jQuery Mobile. There were a few things I wanted to accomplish:

-
  • Large on/off buttons in manual mode
  • Easy slider inputs for any duration input
  • Compatibility between many/all devices
  • Easy feedback of current status
  • Easy program input/modification
-

Fortunately, I had a lot of feedback on Ray's forums and now have an application that has been tested across many devices and installed in many unique environments.

-

I fully support every feature of the OpenSprinkler and also the OpenSprinkler Pi (using the interval program).

-

This copy of the web application is unique because it requires no install and only requires access to the OpenSprinkler by opening a port on your home router.

-
-
-

Version History

-

Change log now mantained on Github

-

Version 2.01

  • Added ability to change themes between the old one and newer, flat theme
  • Fixed bug loading Preview on IE8 and below
  • Fixed bug with timers after leaving the current status page which sent the user back to the current status page
-

Version 2.00

  • Redesigned theme
  • Fixed bug with run-once quick program location
  • Added highlight to sliders in settings page
  • Fixed program preview next/previous icons
-

Version 1.23

  • Fixed bug with comma in station name
  • Fixed problem handling unicode encoding from interval program
  • Minified settings and edit stations pages
  • Removed settings and edit station redudant headers
  • Added shortcut to reset sliders on runonce page from dropdown by picking Quick Programs
  • Fixed dropdown on runonce page not refreshing after the first page load
  • Fixed bug with program preview where master station was 1 minute short
  • Programs are now selectable within run-once programs to launch an ad-hoc program
  • Minified edit program page
-

Version 1.22

  • Fixed broken timers when status page is opened during station delay
  • Added live clock to status page
  • Fixed bug with manual mode timer on status page
  • Added running program information to status page including remaining time
-

Version 1.21

  • Show station delay notification on status page
  • Some more imporvments to status page layout
  • Slight adjustment of staus icon/padding
  • Unhighlight stations when switching manual off
  • Show multiple station information in status bar
  • Running timers for status page
  • Increased AJAX timer
-

Version 1.20

  • Change runonce button order
  • Reflowed status page to emphasize station status
  • Status bar improvements
  • Detect device standby and refresh timer appropriately
  • Center weather header
-

Version 1.19

  • Stricter check for OpenSprinkler IP
  • Fix bug with status bar on Firefox
  • Updated favicon
  • Fixed problem with status bar not moving with side panel
  • New animation for weather box
  • Highlight program if disabled in the edit program selection
  • Rememeber runonce values
-

Version 1.18

  • Fixed a bug with wrongly cached location when changing device
  • Now shows loader when weather and current status are being polled
  • Fixed weather container not hiding on failed weather poll
  • Check program status inbetween stations by polling against the station delay
  • Relocated current status notification
  • Relocated weather information
  • Added favicon
  • Updated splash screens
  • Changed page header to show logo
  • Changed app icon to logo
-

Version 1.17

  • Added home screen notification of currently running program and station
  • Reordered main menu
  • Added confirmation for stop all stations
-

Version 1.16

  • Fixed a bug with the next/previous buttons in the preview programs page
  • Changed maximum extension boards to 5
  • Consolidated all settings and options into one page
  • Redesigned the rain delay into a page with descriptions
  • Moved preivew navigation below the timeline
  • Added mouseover text for weather icon
-

Version 1.15

  • Fixed a bug generating preview date on single digit days
  • Added previous/next day shortcut on preview page
  • Fixed bug importing location
  • Backup and restore master operation bits
  • Reduce HTTP get requests to OpenSprinkler
  • Added the ability to toggle master activation per station if a master is set
  • Updated current status to show which program is running or scheduled to run a station
  • Displays the remaining time for running/scheduled stations on status page
  • Fix bug getting WOEID using location with commas
  • Added navigation options on preview timeline since Android couldn't navigate otherwise
  • Fixed program selection on the preview page for iOS
  • Added timeout to frontend with error message if server takes too long to reply
  • Added timeout on server side to prevent lockouts
  • Remove weather icon location if no status found
-

Version 1.14

  • Scroll to page top on program deletion
  • Style programs and master station uniquely
  • Show master station in the program preview
  • Properly show disabled programs in preview when rain delay is set
  • Moved date selector from header to content on preview page
  • Allow programs to be selected in preview for edit
  • Hide error message when no weather is found (when no location is set)
  • Removed Safari callout and copy/paste for mobile
-

Version 1.13

  • Replaced tips with local weather conditions
  • Moved settings option to the top-right of the main page header
-

Version 1.12

  • Added description to manual mode page
  • Removed icon next to stations on manual mode page and centered text
  • Moved settings out of side panel and reorganized home menu
  • Removed swipe gesture for side panel
  • Fixed rendering of cancel button on change OS IP/password page
-

Version 1.11

  • Added custom confirmation dialogs instead of using javascript's native confirm's
  • Made side panel static code to simplify future modifications
  • Minified timeline resources
  • Removed javascript psuedo protocol calls and added href calls for C-grade browsers
  • Merged program generation functions, reducing code base
  • Removed page transitions
-

Version 1.10

  • Added a visual preview to replace the text based version
  • Fixed a bug where the UTC date was used for the intial preview date
  • Fixed a bug setting the interval time by changing maximum to 1439 minutes
-

Version 1.09

  • Fixed bug when importing programs
  • Delete all programs before import
  • Properly scoped all local variables
  • Fixed a problem importing data
  • Change document title to add webtitle prefix to each page
-

Version 1.08

  • Fixed sequential program preview on the OpenSprinkler Pi
  • Added about page
  • Moved donation button to the about page
-

Version 1.07

  • Fixed all the glitches I could find in the page height being set incorrectly when the keyboard came up
  • Removed the hack on program/add program pages that triggered a scroll
  • Added a cancel button to the change IP/Password page
  • Auto fill in known information on change IP/Password page
  • Updated to jQuery 1.3.1
-

Version 1.06

  • Changed how the timezone was displayed in status page and should work correctly on all versions
  • Added option to empty local storage to delete the IP and password saved in the browser (in case a user logs in using a public browser)
-

Version 1.05

  • Fixed a bug when you first type your IP/Password the enable/manual mode toggles don't update
-

Version 1.04

  • Fixed a bug in timezone display on status page
  • Fixed a bug displaying hashes as page changes
  • Fixed a bug with some flickering on load
  • Added the ability to change OS IP/PW via the panel
  • Fixed the panel not showing on slide gesture
-

Version 1.03

  • Visual bug fixes
-

Version 1.02

  • Switched from storing data centrally to using local storage
-

Version 1.01

  • First public release
-
-
-

Donate

-

This web app has been developed by Samer Albahra. If you find it useful please donate to him by clicking the button below.

-
- - - - -
-
-
-

- Hosted Version: -

-
-
- -
-
-

-

- Yes - No -
-
- -
-
-
-
- -
-
-

Manage Sites

- Back - Add -
-
-
-
- -
-
-

New Device

- Submit -
-
-
-

Note: The name is used to identify the OpenSprinkler within the web app. This is used for multisite support. OpenSprinkler IP can be either an IP or hostname. You can also specify a port by using IP:Port

-
    -
  • OpenSprinkler Configuration
  • -
  • -
    - - - - - - -
    -
  • -
- -
-
-
- - - - - - \ No newline at end of file diff --git a/js/main.js b/js/main.js index ca94eaae6..859695d92 100644 --- a/js/main.js +++ b/js/main.js @@ -1,86 +1,69 @@ -//Insert the startup images for iOS -(function(){ - var p, l, r = window.devicePixelRatio, h = window.screen.height; - if (navigator.platform === "iPad") { - p = r === 2 ? "img/startup-tablet-portrait-retina.png" : "img/startup-tablet-portrait.png"; - l = r === 2 ? "img/startup-tablet-landscape-retina.png" : "img/startup-tablet-landscape.png"; - document.write(''); - } else { - p = r === 2 ? (h === 568 ? "img/startup-iphone5-retina.png" : "img/startup-retina.png") : "img/startup.png"; - document.write(''); - } -})() - //After jQuery mobile is loaded set intial configuration $(document).one("mobileinit", function(e){ - var theme = localStorage.getItem("theme"); - if (theme === null) { - theme = "flat"; - localStorage.setItem("theme","flat") - } - $("#theme").attr("href",getThemeUrl(theme)); - $("#s-theme-select").val(theme); $.mobile.defaultPageTransition = 'fade'; - $.mobile.defaultDialogTransition = 'fade'; $.mobile.hashListeningEnabled = false; }); -//Set AJAX timeout -$.ajaxSetup({ - timeout: 10000 -}); - -//Handle timeout -$(document).ajaxError(function(x,t,m) { - if(t.statusText==="timeout") { - if (m.url.search("action=get_weather")) { - $("#weather-list").animate({ - "margin-left": "-1000px" - },1000,function(){ - $(this).hide(); - }) - } else { - showerror("Connection timed-out. Please try again.") - } - } +//When the start page is intialized show the body (this prevents the flicker as jQuery mobile loads to process the page) +$("#start").one("pagecreate",function(e){ + $("#addnew").enhanceWithin().popup(); + $("body").show(); }); //On intial load check if a valid token exists, for auto login -$("#start").one("pageinit",function(e){ - $("body").show() +$("#start").one("pageshow",function(){ if (!check_configured()) { - $.mobile.changePage($("#addnew"),{transition:"none"}); + $("#addnew").popup("open"); } if (window.curr_ip !== undefined) newload(); - var date = new Date(); - var y = date.getFullYear(); - var m = String(date.getMonth()+1); - if (m.length == 1) m = "0"+m; - var d = String(date.getDate()); - if (d.length == 1) d = "0"+d; - $("#preview_date").val(y+"-"+m+"-"+d); - $.getJSON("https://api.github.com/repos/salbahra/OpenSprinkler-Hosted-Controller/git/refs/heads/master").done(function(data){ - var newest = data.object.sha; - $("#versions").append(newest.slice(0,10)); - }) }); -$(document).on("pageshow",function(e,data){ - var newpage = e.target.id; +//Define option names based on ID +window.keyNames = {"tz":1,"ntp":2,"hp0":12,"hp1":13,"ar":14,"ext":15,"seq":16,"sdt":17,"mas":18,"mton":19,"mtof":20,"urs":21,"rso":22,"wl":23,"ipas":25}; - if (newpage == "preview") { - get_preview(); +//Insert the startup images for iOS +(function(){ + var p, l, r = window.devicePixelRatio, h = window.screen.height; + if (navigator.platform === "iPad") { + p = r === 2 ? "img/startup-tablet-portrait-retina.png" : "img/startup-tablet-portrait.png"; + l = r === 2 ? "img/startup-tablet-landscape-retina.png" : "img/startup-tablet-landscape.png"; + document.write(''); + } else { + p = r === 2 ? (h === 568 ? "img/startup-iphone5-retina.png" : "img/startup-retina.png") : "img/startup.png"; + document.write(''); } -}); +})() function newload() { - $.get("index.php","os_ip="+window.curr_ip+"&os_pw="+window.curr_pw+"&action=send_en_mm",function(data){ - data = JSON.parse(data) - if (data.en == "1") $("#en").val("on") - if (data.mm == "1") $("#mm,#mmm").val("on") - $.mobile.changePage($("#sprinklers"),{transition:"none"}) - }) + //Create object which will store device data + window.device = new Object; + update_device(function(){ + if (window.device.settings.en == "1") $("#en").prop("checked",true); + if (window.device.settings.mm == "1") $("#mm,#mmm").prop("checked",true); + update_weather(); + changePage("#sprinklers"); + }); +} + +function update_device(callback) { + $.when( + $.getJSON("http://"+window.curr_ip+"/jp",function(programs){ + window.device.programs = programs; + }), + $.getJSON("http://"+window.curr_ip+"/jn",function(stations){ + window.device.stations = stations; + }), + $.getJSON("http://"+window.curr_ip+"/jo",function(options){ + window.device.options = options; + }), + $.getJSON("http://"+window.curr_ip+"/js",function(status){ + window.device.status = status.sn; + }), + $.getJSON("http://"+window.curr_ip+"/jc",function(settings){ + window.device.settings = settings; + }) + ).then(callback); } function check_configured() { @@ -135,7 +118,7 @@ function site_select(names) { list.html(newlist); if (list.hasClass("ui-listview")) list.listview("refresh"); - $.mobile.changePage("#site-select"); + changePage("#site-select"); } function update_site_list(names) { @@ -169,87 +152,130 @@ function getsites() { // show error message function showerror(msg) { - $.mobile.loading("show",{ + $.mobile.loading( 'show', { text: msg, textVisible: true, textonly: true, - theme: 'c' - }); + theme: 'b' + }); // hide after delay setTimeout( function(){$.mobile.loading('hide')}, 1500); } -function refreshPage() { - $.mobile.changePage(window.location.href,{ - allowSamePageTransition : true, - transition : 'none', - showLoadMsg : false, - reloadPage : true - }); +function pad(number) { + var r = String(number); + if ( r.length === 1 ) { + r = '0' + r; + } + return r; } +if (!Date.prototype.toISOString) { + (function() { + Date.prototype.toISOString = function() { + return this.getUTCFullYear() + + '-' + pad(this.getUTCMonth() + 1) + + '-' + pad(this.getUTCDate()) + + 'T' + pad(this.getUTCHours()) + + ':' + pad(this.getUTCMinutes()) + + ':' + pad(this.getUTCSeconds()) + + '.' + String((this.getUTCMilliseconds()/1000).toFixed(3)).slice(2,5) + + 'Z'; + }; + }()); +} + +Array.prototype.getUnique = function(){ + var u = {}, a = []; + for(var i = 0, l = this.length; i < l; ++i){ + if(u.hasOwnProperty(this[i])) { + continue; + } + a.push(this[i]); + u[this[i]] = 1; + } + return a; +} + +//Set AJAX timeout +$.ajaxSetup({ + timeout: 3000 +}); + +//Handle timeout +$(document).ajaxError(function(x,t,m) { + if(t.status==401) { + location.reload(); + } + if(t.statusText==="timeout") { + if (m.url.search("yahooapis.com")) { + $("#weather-list").animate({ + "margin-left": "-1000px" + },1000,function(){ + $(this).hide(); + }) + } else { + showerror("Connection timed-out. Please try again.") + } + } +}); + +//After main page is processed, hide loading message and change to the page +$(document).one("pagecreate","#sprinklers", function(){ + //Use the user's local time for preview + var now = new Date(); + $("#preview_date").val(now.toISOString().slice(0,10)); + + //Open the main page + $("body").pagecontainer("change","#sprinklers",{transition:"none"}); + + //Indicate loading is complete + $.mobile.loading("hide"); +}); + +//Update the preview page on date change $("#preview_date").change(function(){ var id = $(".ui-page-active").attr("id"); if (id == "preview") get_preview() }); +//Update site based on selector $("#site-selector").change(function(){ update_site($(this).val()); - refreshPage(); + location.reload(); }); //Bind changes to the flip switches -$("select[data-role='slider']").change(function(){ +$("input[data-role='flipswitch']").change(function(){ var slide = $(this); var type = this.name; - var pageid = slide.closest(".ui-page-active").attr("id"); + var pageid = $("body").pagecontainer("getActivePage").attr("id"); + //Find out what the switch was changed to - var changedTo = slide.val(); - if (type == "theme-select") { - localStorage.setItem("theme",changedTo); - $("#theme").attr("href",getThemeUrl(changedTo)); - return; - } - if (changedTo=="on") { + var changedTo = slide.is(":checked"); + + //If changed to on + if (changedTo) { + //OpenSprinkler Operation if (type === "en") { - $.get("index.php","os_ip="+window.curr_ip+"&os_pw="+window.curr_pw+"&action=en_on",function(result){ - //If switch failed then change the switch back and show error - if (result == 0) { - comm_error() - $("#en").val("off").slider("refresh") - } - }); + $.get("http://"+window.curr_ip+"/cv?pw="+window.curr_pw+"&en=1"); } + //Manual mode, manual mode and settings page if (type === "mm" || type === "mmm") { - $.get("index.php","os_ip="+window.curr_ip+"&os_pw="+window.curr_pw+"&action=mm_on",function(result){ - if (result == 0) { - comm_error() - $("#mm,#mmm").val("off").slider("refresh") - } - }); + $.get("http://"+window.curr_ip+"/cv?pw="+window.curr_pw+"&mm=1"); //If switched to off, unhighlight all of the zones highlighted in green since all will be disabled automatically $("#manual a.green").removeClass("green"); - $("#mm,#mmm").val("on").slider("refresh"); + $("#mm,#mmm").prop("checked",true).flipswitch("refresh"); } } else { if (type === "en") { - $.get("index.php","os_ip="+window.curr_ip+"&os_pw="+window.curr_pw+"&action=en_off",function(result){ - if (result == 0) { - comm_error() - $("#en").val("on").slider("refresh") - } - }); + $.get("http://"+window.curr_ip+"/cv?pw="+window.curr_pw+"&en=0"); } if (type === "mm" || type === "mmm") { - $.get("index.php","os_ip="+window.curr_ip+"&os_pw="+window.curr_pw+"&action=mm_off",function(result){ - if (result == 0) { - comm_error() - $("#mm,#mmm").val("on").slider("refresh") - } - }); + $.get("http://"+window.curr_ip+"/cv?pw="+window.curr_pw+"&mm=0"); //If switched to off, unhighlight all of the manual zones highlighted in green since all will be disabled automatically $("#manual a.green").removeClass("green"); - $("#mm,#mmm").val("off").slider("refresh"); + $("#mm,#mmm").prop("checked",false).flipswitch("refresh") } } }); @@ -258,38 +284,210 @@ function comm_error() { showerror("Error communicating with OpenSprinkler. Please check your password is correct.") } +$(document).on("pageshow",function(e,data){ + var newpage = "#"+e.target.id; + + if (newpage == "#preview") { + get_preview(); + } + + bind_links(newpage); +}); + +$(document).on("pagebeforeshow",function(e,data){ + var newpage = e.target.id; + + //Remove lingering tooltip from preview page + $("#tooltip").remove(); + + //Remove any status timers that may be running + if (window.interval_id !== undefined) clearInterval(window.interval_id); + if (window.timeout_id !== undefined) clearTimeout(window.timeout_id); + + if (newpage == "sprinklers") { + //Reset status bar to loading while an update is done + $("#footer-running").html("

"); + setTimeout(function(){ + update_device(check_status) + },500); + } else { + var title = document.title; + document.title = "OpenSprinkler: "+title; + } +}) + +//Converts data-onclick attributes on page to vclick bound functions. This removes the 300ms lag on mobile devices (iOS/Android) +function bind_links(page) { + var currpage = $(page); + + currpage.find("a[href='#"+currpage.attr('id')+"-settings']").unbind("vclick").on('vclick', function (e) { + e.preventDefault(); e.stopImmediatePropagation(); + highlight(this); + $(".ui-page-active [id$=settings]").panel("open"); + }); + currpage.find("a[data-onclick]").unbind("vclick").on('vclick', function (e) { + e.preventDefault(); e.stopImmediatePropagation(); + var func = $(this).data("onclick"); + highlight(this); + eval(func); + }); +} + +function read_program(program) { + var days0 = program[1], + days1 = program[2], + even = false, + odd = false, + interval = false, + days = "", + stations = "", + newdata = new Object; + + newdata.en = program[0]; + newdata.start = program[3]; + newdata.end = program[4]; + newdata.interval = program[5]; + newdata.duration = program[6]; + + for (var n=0; n < window.device.programs.nboards; n++) { + var bits = program[7+n]; + for (var s=0; s < 8; s++) { + stations += (bits&(1<1)){ + //This is an interval program + days=[days1,days0&0x7f]; + interval = true; + } else { + //This is a weekly program + for(var d=0;d<7;d++) { + if (days0&(1< 1) update_timer(seconds,sdelay); + footer.removeClass().addClass(color).html(line).slideDown(); +} + function check_status() { - //Check if a program is running - $.get("index.php","os_ip="+window.curr_ip+"&os_pw="+window.curr_pw+"&action=current_status",function(data){ - var footer = $("#footer-running") - if (data === "") { - footer.slideUp(); - return; + if (!window.device.settings.en) { + change_status(0,window.device.options.sdt,"red","

System Disabled

"); + return; + } + + if (window.device.settings.rd) { + change_status(0,window.device.options.sdt,"red","

Rain delay until "+(new Date(window.device.settings.rdst*1000).toUTCString().slice(0,-4))+"

"); + return; + } + + if (window.device.settings.urs && window.device.settings.rs) { + change_status(0,window.device.options.sdt,"red","

Rain detected

"); + return; + } + + var open = new Object; + $.each(window.device.status, function (i, stn) { + if (stn) open[i] = stn; + }); + + if (window.device.settings.mas) { + open.splice(window.device.settings.mas-1,1); + } + + if (Object.keys(open).length >= 2) { + var ptotal = 0; + $.each(open,function (key, status){ + var tmp = window.device.settings.ps[key][1]; + if (tmp > ptotal) ptotal = tmp; + }); + + var sample = open[0], + pid = window.device.settings.ps[sample][0], + pname = pidname(pid), + line = "

"; + + line += pname+" is running on "+Object.keys(open).length+" stations "; + if (pid!=255&&pid!=99) line += "("+sec2hms(ptotal)+" remaining)"; + line += "

"; + change_status(ptotal,window.device.options.sdt,"green",line); + return; + } + + var match = false, + i = 0; + $.each(window.device.stations.snames,function (station,name){ + var info = ""; + if (window.device.settings.ps[i][0] && window.device.status[i] && window.device.settings.mas != i+1) { + match = true + var pid = window.device.settings.ps[i][0], + pname = pidname(pid), + line = "

"; + line += pname+" is running on station "+name+" "; + if (pid!=255&&pid!=99) line += "("+sec2hms(window.device.settings.ps[i][1])+" remaining)"; + line += "

"; + change_status(window.device.settings.ps[i][1],window.device.options.sdt,"green",line); + return false; } - data = JSON.parse(data); - if (window.interval_id !== undefined) clearInterval(window.interval_id); - if (window.timeout_id !== undefined) clearTimeout(window.timeout_id); - if (data.seconds != 0) update_timer(data.seconds,data.sdelay); - footer.removeClass().addClass(data.color).html(data.line).slideDown(); - }) + i++; + }); + + if (match) return; + + if (window.device.settings.mm) { + change_status(0,window.device.options.sdt,"red","

Manual mode enabled

"); + return; + } + + $("#footer-running").slideUp(); +} + +function pidname(pid) { + pname = "Program "+pid; + if(pid==255||pid==99) pname="Manual program"; + if(pid==254||pid==98) pname="Run-once program"; + return pname; } function update_timer(total,sdelay) { window.lastCheck = new Date().getTime(); - window.interval_id = setInterval(function(){ + window.interval_id = setInterval(function(){ var now = new Date().getTime(); var diff = now - window.lastCheck; if (diff > 3000) { clearInterval(window.interval_id); - $("#footer-running").html("

"); - check_status(); + $("#footer-running").html("

"); + update_device(check_status); } window.lastCheck = now; + if (total <= 0) { clearInterval(window.interval_id); - $("#footer-running").slideUp().html("

"); + $("#footer-running").slideUp().html("

"); if (window.timeout_id !== undefined) clearTimeout(window.timeout_id); - window.timeout_id = setTimeout(check_status,(sdelay*1000)); + window.timeout_id = setTimeout(function(){ + update_device(check_status); + },(sdelay*1000)); } else --total; @@ -336,44 +534,10 @@ function sec2hms(diff) { var hours = parseInt( diff / 3600 ) % 24; var minutes = parseInt( diff / 60 ) % 60; var seconds = diff % 60; - if (hours) str += (hours < 10 ? "0"+hours : hours)+":"; - return str+(minutes < 10 ? "0"+minutes : minutes)+":"+(seconds < 10 ? "0"+seconds : seconds); + if (hours) str += pad(hours)+":"; + return str+pad(minutes)+":"+pad(seconds); } -$(document).on("pagebeforeshow",function(e,data){ - var newpage = e.target.id; - - if (window.interval_id !== undefined) clearInterval(window.interval_id); - if (window.timeout_id !== undefined) clearTimeout(window.timeout_id); - - if (newpage == "sprinklers") { - update_weather(); - $("#footer-running").html("

"); - setTimeout(check_status,1000); - } else { - var title = document.title; - document.title = "OpenSprinkler: "+title; - } -}); - -//This bind intercepts most links to remove the 300ms delay iOS adds -$(document).on('pageinit', function (e, data) { - var newpage = e.target.id; - var currpage = $(e.target); - - currpage.find("a[href='#"+currpage.attr('id')+"-settings']").on('vclick', function (e) { - e.preventDefault(); e.stopImmediatePropagation(); - highlight(this); - $(".ui-page-active [id$=settings]").panel("open"); - }); - currpage.find("a[data-onclick]").on('vclick', function (e) { - e.preventDefault(); e.stopImmediatePropagation(); - var func = $(this).data("onclick"); - highlight(this); - eval(func); - }); -}); - function highlight(button) { $(button).addClass("ui-btn-active").delay(150).queue(function(next){ $(this).removeClass("ui-btn-active"); @@ -383,18 +547,31 @@ function highlight(button) { function update_weather() { var $weather = $("#weather"); - $weather.html("

"); - $.get("index.php","os_ip="+window.curr_ip+"&os_pw="+window.curr_pw+"&action=get_weather",function(result){ - var weather = JSON.parse(result); - if (weather["code"] == null) { + $("#weather").unbind("click"); + $weather.html("

"); + + $.getJSON("http://query.yahooapis.com/v1/public/yql?q=select%20item%20from%20weather.forecast%20where%20location%3D%22"+escape(window.device.settings.loc)+"%22&format=json&callback=?",function(data){ + if (data.query.results.channel.item.title == "City not found") { $("#weather-list").animate({ "margin-left": "-1000px" },1000,function(){ $(this).hide(); }) - return; + return; } - $weather.html("

"+weather["temp"]+"
"+weather["location"]+""); + var now = data.query.results.channel.item.condition, + text = now.text, + code = now.code, + temp = now.temp, + date = now.date; + + var title = data.query.results.channel.item.title, + loc = /Conditions for (.*) at \d+:\d+ [a|p]m .*/.exec(title); + + temp = temp+"°F"; + + $weather.html("
"+temp+"
"+loc[1]+""); + $("#weather").bind("click",get_forecast); $("#weather-list").animate({ "margin-left": "0" },1000).show() @@ -402,98 +579,323 @@ function update_weather() { } function gohome() { - $.mobile.changePage($('#sprinklers'), {reverse: true}); + $("body").pagecontainer("change","#sprinklers",{reverse: true}); +} + +function changePage(toPage) { + var curr = "#"+$("body").pagecontainer("getActivePage").attr("id"); + if (curr === toPage) { + bind_links(curr); + } else { + $("body").pagecontainer("change",toPage); + } +} + +function changeFromPanel(func) { + var $panel = $("#sprinklers-settings"); + $panel.one("panelclose", func); + $panel.panel("close"); +} + +function show_about() { + changePage("#about"); +} + +function open_popup(id) { + var popup = $(id); + + popup.on("popupafteropen", function(){ + $(this).popup("reposition", { + "positionTo": "window" + }); + }).popup().enhanceWithin().popup("open"); } function show_settings() { - $.mobile.showPageLoadingMsg(); - $.get("index.php","os_ip="+window.curr_ip+"&os_pw="+window.curr_pw+"&action=make_settings_list",function(items){ - var list = $("#os-settings-list"); - list.html(items).trigger("create"); - if (list.hasClass("ui-listview")) list.listview("refresh"); - $.mobile.hidePageLoadingMsg(); - $.mobile.changePage($("#os-settings")); - }) + $.mobile.loading("show"); + + var list = new Object + list.start = "
  • "; + + $.each(window.device.options,function(key,data) { + switch (key) { + case "tz": + var timezones = ["-12:00","-11:30","-11:00","-10:00","-09:30","-09:00","-08:30","-08:00","-07:00","-06:00","-05:00","-04:30","-04:00","-03:30","-03:00","-02:30","-02:00","+00:00","+01:00","+02:00","+03:00","+03:30","+04:00","+04:30","+05:00","+05:30","+05:45","+06:00","+06:30","+07:00","+08:00","+08:45","+09:00","+09:30","+10:00","+10:30","+11:00","+11:30","+12:00","+12:45","+13:00","+13:45","+14:00"]; + var tz = data-48; + tz = ((tz>=0)?"+":"-")+pad((Math.abs(tz)/4>>0))+":"+((Math.abs(tz)%4)*15/10>>0)+((Math.abs(tz)%4)*15%10); + list.tz = ""; + return true; + case "ntp": + list.ntp = ""; + return true; + case "hp0": +// var http = window.device.options.hp1*256+data; +// list.http = ""; + return true; + case "ar": + list.ar = ""; + return true; + case "ext": + list.ext = ""; + return true; + case "seq": + list.seq = ""; + return true; + case "sdt": + list.sdt = ""; + return true; + case "mas": + list.mas = ""; + return true; + case "mtof": + list.mtof = ""; + return true; + case "urs": + list.urs = ""; + return true; + case "rso": + list.rso = ""; + return true; + case "wl": + list.wl = ""; + return true; + case "ipas": + list.ipas = ""; + return true; + } + }); + list.loc = ""; + list.end = "
  • "; + + str = list.start + list.tz + list.mas + list.loc + list.ext + list.sdt + list.mton + list.mtof + list.wl + list.ntp + list.ar + list.seq + list.urs + list.rso + list.ipas + list.end; + var settings = $("#os-settings-list"); + settings.html(str).enhanceWithin(); + if (settings.hasClass("ui-listview")) settings.listview("refresh"); + $.mobile.loading("hide"); + changePage("#os-settings"); } function show_stations() { - $.mobile.showPageLoadingMsg(); - $.get("index.php","os_ip="+window.curr_ip+"&os_pw="+window.curr_pw+"&action=make_stations_list",function(items){ - var list = $("#os-stations-list"); - list.html(items).trigger("create"); + + $.mobile.loading("show"); + + var list = "
  • ", + isMaster = window.device.settings.mas; + if (isMaster) list += ""; + $i = 0; + $.each(window.device.stations.snames,function(i, station) { + if (isMaster) list += ""; + } else { + list += ""; + } + } + i++; + }); + if (isMaster) list += "
    Station NameActivate Master?
    "; + list += ""; + if (isMaster) { + if (window.device.settings.mas == i+1) { + list += "

    (Master)

    "; + list += "
  • "; + + var stations = $("#os-stations-list"); + stations.html(list).enhanceWithin(); + if (stations.hasClass("ui-listview")) stations.listview("refresh"); + $.mobile.loading("hide"); + changePage("#os-stations"); +} + +function get_forecast() { +/* + $.mobile.loading("show"); + $.get("",function(items){ + var list = $("#forecast_list"); + list.html(items).enhanceWithin(); if (list.hasClass("ui-listview")) list.listview("refresh"); - $.mobile.hidePageLoadingMsg(); - $.mobile.changePage($("#os-stations")); + $.mobile.loading("hide"); + changePage("#forecast"); }) +*/ } function get_status() { - $.mobile.showPageLoadingMsg(); - $.get("index.php","os_ip="+window.curr_ip+"&os_pw="+window.curr_pw+"&action=make_list_status",function(items){ - var list = $("#status_list"); - items = JSON.parse(items) - list.html(items.list); - $("#status_header").html(items.header); - $("#status_footer").html(items.footer); - if (list.hasClass("ui-listview")) list.listview("refresh"); - window.totals = JSON.parse(items.totals); - if (window.interval_id !== undefined) clearInterval(window.interval_id); - if (window.timeout_id !== undefined) clearTimeout(window.timeout_id); - $.mobile.hidePageLoadingMsg(); - $.mobile.changePage($("#status")); - if (window.totals["d"] !== undefined) { - delete window.totals["p"]; - setTimeout(get_status,window.totals["d"]*1000); + var runningTotal = new Object, + allPnames = new Array; + + var list = "", + tz = window.device.options.tz-48; + + tz = ((tz>=0)?"+":"-")+pad((Math.abs(tz)/4>>0))+":"+((Math.abs(tz)%4)*15/10>>0)+((Math.abs(tz)%4)*15%10); + + var header = ""+(new Date(window.device.settings.devt*1000).toUTCString().slice(0,-4))+" GMT "+tz; + + runningTotal.c = window.device.settings.devt; + + var master = window.device.settings.mas, + i = 0, + ptotal = 0; + + var open = new Object; + $.each(window.device.status, function (i, stn) { + if (stn) open[i] = stn; + }); + open = Object.keys(open).length; + + if (master && window.device.status[master-1]) open--; + + $.each(window.device.stations.snames,function(i, station) { + var info = ""; + if (master == i+1) { + station += " (Master)"; + } else if (window.device.settings.ps[i][0]) { + var rem=window.device.settings.ps[i][1]; + if (open > 1) { + if (rem > ptotal) ptotal = rem; + } else { + ptotal+=rem; + } + remm=rem/60>>0; + rems=rem%60; + var pid = window.device.settings.ps[i][0], + pname = pidname(pid); + if (window.device.status[i] && (pid!=255&&pid!=99)) runningTotal[i] = rem; + allPnames[i] = pname; + info = "

    "+((window.device.status[i]) ? "Running" : "Scheduled")+" "+pname; + if (pid!=255&&pid!=99) info += " ("+(remm/10>>0)+(remm%10)+":"+(rems/10>>0)+(rems%10)+" remaining)"; + info += "

    "; } - update_timers(items.sdelay); + if (window.device.status[i]) { + var color = "green"; + } else { + var color = "red"; + } + list += "
  • "+station+"

    "+info+"
  • "; + i++; }) + + var footer = ""; + var lrdur = window.device.settings.lrun[2]; + + if (lrdur != 0) { + var lrpid = window.device.settings.lrun[1]; + var pname= pidname(lrpid); + + footer = '

    '+pname+' last ran station '+window.device.stations.snames[window.device.settings.lrun[0]]+' for '+(lrdur/60>>0)+'m '+(lrdur%60)+'s on '+(new Date(window.device.settings.lrun[3]*1000).toUTCString().slice(0,-4))+'

    '; + } + + if (ptotal) { + scheduled = allPnames.length; + if (!open && scheduled) runningTotal.d = window.device.options["sdt"]; + if (open == 1) ptotal += (scheduled-1)*window.device.options["sdt"]; + allPnames = allPnames.getUnique(); + numProg = allPnames.length; + allPnames = allPnames.join(" and "); + var pinfo = allPnames+" "+((numProg > 1) ? "are" : "is")+" running "; + pinfo += "
    ("+sec2hms(ptotal)+" remaining)"; + runningTotal.p = ptotal; + header += "
    "+pinfo; + } + + var status = $("#status_list"); + status.html(list); + $("#status_header").html(header); + $("#status_footer").html(footer); + if (status.hasClass("ui-listview")) status.listview("refresh"); + window.totals = runningTotal; + if (window.interval_id !== undefined) clearInterval(window.interval_id); + if (window.timeout_id !== undefined) clearTimeout(window.timeout_id); + + changePage("#status"); + if (window.totals.d !== undefined) { + delete window.totals.p; + setTimeout(get_status,window.totals.d*1000); + } + update_timers(window.device.options["sdt"]); } function get_manual() { - $.mobile.showPageLoadingMsg(); - $.get("index.php","os_ip="+window.curr_ip+"&os_pw="+window.curr_pw+"&action=make_list_manual",function(items){ - var list = $("#mm_list"); - list.html(items); - if (list.hasClass("ui-listview")) list.listview("refresh"); - $.mobile.hidePageLoadingMsg(); - $.mobile.changePage($("#manual")); + $.mobile.loading("show"); + + var list = "
  • Sprinkler Stations
  • ", + i = 0; + + $.each(window.device.stations.snames,function(i,station) { + list += '
  • '+station+'
  • '; + i++; }) + var mm = $("#mm_list"); + mm.html(list); + if (mm.hasClass("ui-listview")) mm.listview("refresh"); + $.mobile.loading("hide"); + changePage("#manual"); } function get_runonce() { - $.mobile.showPageLoadingMsg(); - $.getJSON("index.php","os_ip="+window.curr_ip+"&os_pw="+window.curr_pw+"&action=make_runonce",function(items){ - window.rprogs = items.progs; - var list = $("#runonce_list"), i=0; - list.html(items.page); - - var progs = ""; - $("#runonce_list p").after(progs); - $("#rprog").change(function(){ - var prog = $(this).val(); - if (prog == "s") { - reset_runonce() - return; - } if (window.rprogs[prog] == undefined) return; - fill_runonce(list,window.rprogs[prog]); + var list = "

    Value is in minutes. Zero means the station will be excluded from the run-once program.

    ", + n = 0; + $.each(window.device.stations.snames,function(i, station) { + list += ""; + n++; + }) + list += "
    SubmitReset"; + var progs = new Array(); + if (window.device.programs.pd.length) { + $.each(window.device.programs.pd,function(i, program) { + program = read_program(program); + var prog = new Array, + set_stations = program.stations.split(""); + for (var i=0;iProgram "+(i+1)+""; + }; + quickPick += ""; + $("#runonce_list p").after(quickPick); + $("#rprog").change(function(){ + var prog = $(this).val(); + if (prog == "s") { + reset_runonce() + return; + } + if (window.rprogs[prog] == undefined) return; + fill_runonce(runonce,window.rprogs[prog]); }) + + runonce.enhanceWithin(); + changePage("#runonce"); } function fill_runonce(list,data){ @@ -510,58 +912,181 @@ function get_preview() { var date = $("#preview_date").val(); if (date === "") return; date = date.split("-"); - $.mobile.showPageLoadingMsg(); - $.get("index.php","os_ip="+window.curr_ip+"&os_pw="+window.curr_pw+"&action=get_preview&d="+date[2]+"&m="+date[1]+"&y="+date[0],function(items){ - var empty = true; - if (items == "") { - $("#timeline").html("

    No stations set to run on this day.

    ") - } else { - empty = false - var data = eval("["+items.substring(0, items.length - 1)+"]"); - $.each(data, function(){ - this.start = new Date(date[0],date[1]-1,date[2],0,0,this.start); - this.end = new Date(date[0],date[1]-1,date[2],0,0,this.end); - }) - var options = { - 'width': '100%', - 'editable': false, - 'axisOnTop': true, - 'eventMargin': 10, - 'eventMarginAxis': 0, - 'min': new Date(date[0],date[1]-1,date[2],0), - 'max': new Date(date[0],date[1]-1,date[2],24), - 'selectable': true, - 'showMajorLabels': false, - 'zoomMax': 1000 * 60 * 60 * 24, - 'zoomMin': 1000 * 60 * 60, - 'groupsChangeable': false, - 'showNavigation': false - }; - window.timeline = new links.Timeline(document.getElementById('timeline')); - links.events.addListener(timeline, "select", function(){ - var row = undefined; - var sel = timeline.getSelection(); - if (sel.length) { - if (sel[0].row != undefined) { - row = sel[0].row; - } + + process_programs(date[1],date[2],date[0]); + + var empty = true; + if (window.preview_data == "") { + $("#timeline").html("

    No stations set to run on this day.

    ") + } else { + empty = false; + var data = eval("["+window.preview_data.substring(0, window.preview_data.length - 1)+"]"); + var shortnames = []; + $.each(data, function(){ + this.start = new Date(date[0],date[1]-1,date[2],0,0,this.start); + this.end = new Date(date[0],date[1]-1,date[2],0,0,this.end); + shortnames[this.group] = this.shortname; + }); + var options = { + 'width': '100%', + 'editable': false, + 'axisOnTop': true, + 'eventMargin': 10, + 'eventMarginAxis': 0, + 'min': new Date(date[0],date[1]-1,date[2],0), + 'max': new Date(date[0],date[1]-1,date[2],24), + 'selectable': true, + 'showMajorLabels': false, + 'zoomMax': 1000 * 60 * 60 * 24, + 'zoomMin': 1000 * 60 * 60, + 'groupsChangeable': false, + 'showNavigation': false + }; + + window.timeline = new links.Timeline(document.getElementById('timeline')); + links.events.addListener(timeline, "select", function(){ + var row = undefined; + var sel = timeline.getSelection(); + if (sel.length) { + if (sel[0].row != undefined) { + row = sel[0].row; } - if (row === undefined) return; - var content = $(".timeline-event-content")[row]; - var pid = parseInt($(content).html().substr(1)) - 1; - get_programs(pid); - }); - $(window).on("resize",timeline_redraw); - timeline.draw(data, options); - if ($(window).width() <= 480) { - var currRange = timeline.getVisibleChartRange(); - if ((currRange.end.getTime() - currRange.start.getTime()) > 6000000) timeline.setVisibleChartRange(currRange.start,new Date(currRange.start.getTime()+6000000)) } - $("#timeline .timeline-groups-text:contains('Master')").addClass("skip-numbering") - $("#timeline-navigation").show() + if (row === undefined) return; + var content = $(".timeline-event-content")[row]; + var pid = parseInt($(content).html().substr(1)) - 1; + get_programs(pid); + }); + $(window).on("resize",timeline_redraw); + timeline.draw(data, options); + if ($(window).width() <= 480) { + var currRange = timeline.getVisibleChartRange(); + if ((currRange.end.getTime() - currRange.start.getTime()) > 6000000) timeline.setVisibleChartRange(currRange.start,new Date(currRange.start.getTime()+6000000)) } - $.mobile.hidePageLoadingMsg(); - }) + $("#timeline .timeline-groups-text").each(function(a,b){ + var stn = $(b); + var name = shortnames[stn.text()]; + stn.attr("data-shortname",name); + }) + $("#timeline-navigation").show() + } +} + +function process_programs(month,day,year) { + window.preview_data = ""; + var newdata = new Object, + devdateobj = new Date(window.device.settings.devt*1000), + devday = Math.floor(window.device.settings.devt/(60*60*24)), + devmin = (devdateobj.getUTCHours()*60)+devdateobj.getUTCMinutes(), + simminutes = 0, + simt = Date.UTC(year,month-1,day,0,0,0,0), + simday = (simt/3600/24)>>0, + match = [0,0], + st_array = new Array(window.device.settings.nbrd*8), + pid_array = new Array(window.device.settings.nbrd*8); + et_array = new Array(window.device.settings.nbrd*8); + + for(var sid=0;sid>3;var s=sid%8; + if(window.device.options.mas==(sid+1)) continue; // skip master station + if(prog[7+bid]&(1<>0;pid_array[sid]=pid+1; + match_found=1; + } + } + } + } + if(match_found) { + var acctime=simminutes*60; + if(window.device.options.seq) { + for(sid=0;sid>0; + if(window.device.options.seq&&simminutes!=endminutes) simminutes=endminutes; + else simminutes++; + for(sid=0;sid1)) { + var dn=prog[2], + drem=prog[1]&0x7f; + if((simday%dn)!=((devday+drem)%dn)) return 0; + } else { + var date = new Date(simt); + var wd=(date.getUTCDay()+6)%7; + if((prog[1]&(1<prog[4]) return 0; + if(prog[5]==0) return 0; + if(((simminutes-prog[3])/prog[5]>>0)*prog[5] == (simminutes-prog[3])) { + return 1; + } + return 0; +} + +function run_sched(simseconds,st_array,pid_array,et_array,simt) { + var endtime=simseconds; + for(var sid=0;sid0)&&(window.device.options.mas!=sid+1)&&(window.device.stations.masop[sid>>3]&(1<<(sid%8)))) + window.preview_data += "{'start': "+(st_array[sid]+window.device.options.mton)+",'end': "+(et_array[sid]+window.device.options.mtoff)+",'content':'','className':'master','shortname':'M','group':'Master'},"; + endtime=et_array[sid]; + } else { + time_to_text(sid,simseconds,pid_array[sid],et_array[sid],simt); + if((window.device.options.mas>0)&&(window.device.options.mas!=sid+1)&&(window.device.stations.masop[sid>>3]&(1<<(sid%8)))) + endtime=(endtime>et_array[sid])?endtime:et_array[sid]; + } + } + } + if(window.device.options.seq==0&&window.device.options.mas>0) window.preview_data += "{'start': "+simseconds+",'end': "+endtime+",'content':'','className':'master','shortname':'M','group':'Master'},"; + return endtime; +} + +function time_to_text(sid,start,pid,end,simt) { + var className = "program-"+((pid+3)%4); + if ((window.device.settings.rd!=0)&&(simt+start+(window.device.options.tz-48)*900<=window.device.settings.rdst)) className="delayed"; + window.preview_data += "{'start': "+start+",'end': "+end+",'className':'"+className+"','content':'P"+pid+"','shortname':'S"+(sid+1)+"','group':'"+window.device.stations.snames[sid]+"'},"; } function timeline_redraw() { @@ -575,58 +1100,63 @@ function changeday(dir) { date = date.split("-"); var nDate = new Date(date[0],date[1]-1,date[2]); nDate.setDate(nDate.getDate() + dir); - var m = String(nDate.getMonth()+1); - if (m.length == 1) m = "0"+m; - var d = String(nDate.getDate()); - if (d.length == 1) d = "0"+d; + var m = pad(nDate.getMonth()+1); + var d = pad(nDate.getDate()); inputBox.val(nDate.getFullYear() + "-" + m + "-" + d); get_preview(); } function get_programs(pid) { - $.mobile.showPageLoadingMsg(); - $.get("index.php","os_ip="+window.curr_ip+"&os_pw="+window.curr_pw+"&action=make_all_programs",function(items){ - var list = $("#programs_list"); - list.html(items); - if (typeof pid !== 'undefined') { - if (pid === false) { - $.mobile.silentScroll(0) - } else { - $("#programs fieldset[data-collapsed='false']").attr("data-collapsed","true"); - $("#program-"+pid).attr("data-collapsed","false") - } + var list = $("#programs_list"); + list.html(make_all_programs()); + if (typeof pid === "number" || typeof pid === "boolean") { + if (pid === false) { + $.mobile.silentScroll(0) + } else { + $("#programs fieldset[data-collapsed='false']").attr("data-collapsed","true"); + $("#program-"+pid).attr("data-collapsed","false") } - $("#programs input[name^='rad_days']").change(function(){ - var progid = $(this).attr('id').split("-")[1], type = $(this).val().split("-")[0], old; - type = type.split("_")[1]; - if (type == "n") { - old = "week" - } else { - old = "n" - } - $("#input_days_"+type+"-"+progid).show() - $("#input_days_"+old+"-"+progid).hide() - }) + } + $("#programs input[name^='rad_days']").change(function(){ + var progid = $(this).attr('id').split("-")[1], type = $(this).val().split("-")[0], old; + type = type.split("_")[1]; + if (type == "n") { + old = "week" + } else { + old = "n" + } + $("#input_days_"+type+"-"+progid).show() + $("#input_days_"+old+"-"+progid).hide() + }) - $("#programs [id^='submit-']").click(function(){ - submit_program($(this).attr("id").split("-")[1]); - }) - $("#programs [id^='s_checkall-']").click(function(){ - var id = $(this).attr("id").split("-")[1] - $("[id^='station_'][id$='-"+id+"']").prop("checked",true).checkboxradio("refresh"); - }) - $("#programs [id^='s_uncheckall-']").click(function(){ - var id = $(this).attr("id").split("-")[1] - $("[id^='station_'][id$='-"+id+"']").prop("checked",false).checkboxradio("refresh"); - }) - $("#programs [id^='delete-']").click(function(){ - delete_program($(this).attr("id").split("-")[1]); - }) - $.mobile.hidePageLoadingMsg(); - $("#programs").trigger("create"); - update_program_header(); - $.mobile.changePage($("#programs")); + $("#programs [id^='submit-']").click(function(){ + submit_program($(this).attr("id").split("-")[1]); + }) + $("#programs [id^='s_checkall-']").click(function(){ + var id = $(this).attr("id").split("-")[1] + $("[id^='station_'][id$='-"+id+"']").prop("checked",true).checkboxradio("refresh"); }) + $("#programs [id^='s_uncheckall-']").click(function(){ + var id = $(this).attr("id").split("-")[1] + $("[id^='station_'][id$='-"+id+"']").prop("checked",false).checkboxradio("refresh"); + }) + $("#programs [id^='delete-']").click(function(){ + delete_program($(this).attr("id").split("-")[1]); + }) + $("#programs [id^='run-']").click(function(){ + var id = $(this).attr("id").split("-")[1]; + var durr = parseInt($("#duration-"+id).val()); + var stations = $("[id^='station_'][id$='-"+id+"']"); + var runonce = []; + $.each(stations,function(a,b){ + if ($(b).is(":checked")) runonce.push(durr*60); + }); + runonce.push(0); + submit_runonce(runonce); + }) + changePage("#programs"); + $("#programs").enhanceWithin(); + update_program_header(); } function update_program_header() { @@ -642,49 +1172,138 @@ function update_program_header() { }) } +//Make the list of all programs +function make_all_programs() { + if (window.device.programs.nprogs == 0) { + return "

    You have no programs currently added. Tap the Add button on the top right corner to get started.

    "; + } + var n = 0; + var list = "

    Click any program below to expand/edit. Be sure to save changes by hitting submit below.

    "; + $.each(window.device.programs.pd,function (i,program) { + list += make_program(n,window.device.programs.nprogs,program); + n++; + }); + return list+"
    "; +} + +//Generate a new program view +function fresh_program() { + return make_program("new",1); +} + +function make_program(n,total,program) { + if (typeof program !== "undefined") { + program = read_program(program) + } else { + program = {"en":0,"is_interval":0,"is_even":0,"is_odd":0,"duration":0,"interval":0,"start":0,"end":0}; + } + var week = ["M","T","W","R","F","Sa","Su"], + days; + + if (typeof program.days !== "undefined") { + days = program.days.split(""); + for(var i=days.length;i--;) days[i] = days[i]|0; + } else { + days = [0,0,0,0,0,0,0]; + } + if (typeof program.stations !== "undefined") { + var set_stations = program.stations.split(""); + for(var i=set_stations.length;i--;) set_stations[i] = set_stations[i]|0; + } + var list = "
    "; + if (n !== "new") list += "Program "+(n + 1)+""; + list += ""; + list += "
    "; + list += ""; + list += ""; + list += "
    "; + + list += "

    Restrictions

    "; + list += ""; + list += ""; + list += ""; + list += "
    "; + + list += "

    Days of the Week

    "; + var j = 0; + $.each(week,function (i,day) { + list += ""; + j++; + }) + list += "
    "; + + list += "
    "; + list += "
    "; + list += "
    "; + list += "
    "; + + list += "
    Stations:"; + j = 0; + $.each(window.device.stations.snames,function (i,station) { + list += ""; + j++; + }) + list += "
    "; + + list += "
    "; + list += ""; + list += ""; + list += "
    "; + + list += "
    "; + list += "
    "; + list += "
    "; + list += "
    "; + + list += ""; + list += "
    "; + if (n === "new") { + list += "
    "; + } else { + list += ""; + list += ""; + list += ""; + } + return list; +} + function add_program() { - $.mobile.showPageLoadingMsg(); - $.get("index.php","os_ip="+window.curr_ip+"&os_pw="+window.curr_pw+"&action=fresh_program",function(items){ - var list = $("#newprogram"); - list.html(items); - $("#addprogram input[name^='rad_days']").change(function(){ - var progid = "new", type = $(this).val().split("-")[0], old; - type = type.split("_")[1]; - if (type == "n") { - old = "week" - } else { - old = "n" - } - $("#input_days_"+type+"-"+progid).show() - $("#input_days_"+old+"-"+progid).hide() - }) - $("#addprogram [id^='s_checkall-']").click(function(){ - $("[id^='station_'][id$='-new']").prop("checked",true).checkboxradio("refresh"); - }) - $("#addprogram [id^='s_uncheckall-']").click(function(){ - $("[id^='station_'][id$='-new']").prop("checked",false).checkboxradio("refresh"); - }) - $("#addprogram [id^='submit-']").click(function(){ - submit_program("new"); - }) - $.mobile.hidePageLoadingMsg(); - $("#addprogram").trigger("create"); - $.mobile.changePage($("#addprogram")); - }) + var list = $("#newprogram"); + list.html(fresh_program()); + $("#addprogram input[name^='rad_days']").change(function(){ + var progid = "new", type = $(this).val().split("-")[0], old; + type = type.split("_")[1]; + if (type == "n") { + old = "week" + } else { + old = "n" + } + $("#input_days_"+type+"-"+progid).show() + $("#input_days_"+old+"-"+progid).hide() + }) + $("#addprogram [id^='s_checkall-']").click(function(){ + $("[id^='station_'][id$='-new']").prop("checked",true).checkboxradio("refresh"); + }) + $("#addprogram [id^='s_uncheckall-']").click(function(){ + $("[id^='station_'][id$='-new']").prop("checked",false).checkboxradio("refresh"); + }) + $("#addprogram [id^='submit-']").click(function(){ + submit_program("new"); + }) + changePage("#addprogram"); + $("#addprogram").enhanceWithin(); } function delete_program(id) { areYouSure("Are you sure you want to delete program "+(parseInt(id)+1)+"?", "", function() { - $.mobile.showPageLoadingMsg(); - $.get("index.php","os_ip="+window.curr_ip+"&os_pw="+window.curr_pw+"&action=delete_program&pid="+id,function(result){ - $.mobile.hidePageLoadingMsg(); - if (result == 0) { - comm_error() - } else { - get_programs(false) - } - }) - },get_programs) + $.mobile.loading("show"); + $.get("http://"+window.curr_ip+"/dp?pw="+window.curr_pw+"&pid="+id,function(){ + $.mobile.loading("hide"); + update_device(function(){ + get_programs(false); + }); + }).error(comm_error); + }) } function reset_runonce() { @@ -724,7 +1343,7 @@ function submit_program(id) { var nboards = total / 8 - var stations=[0],station_selected=0,bid,sid; + var stations=[0],station_selected=0,bid, sid; for(bid=0;bid

    "); + update_device(check_status); + showerror("Rain delay has been successfully set"); + }).error(comm_error); + $.mobile.loading("hide"); +} + +function clear_config() { + areYouSure("Are you sure you want to delete all settings and return to the default settings (this will delete the configuration file)?", "", function() { + localStorage.removeItem("sites"); + localStorage.removeItem("current_site"); + showerror("Configuration has been deleted. Please wait while you are redirected to the installer."); + setTimeout(function(){location.reload()},2500); + }); } function rbt() { areYouSure("Are you sure you want to reboot OpenSprinkler?", "", function() { - $.mobile.showPageLoadingMsg() - $.get("index.php","os_ip="+window.curr_ip+"&os_pw="+window.curr_pw+"&action=rbt",function(result){ - $.mobile.hidePageLoadingMsg() - gohome(); - if (result == 0) { - comm_error() - } else { - showerror("OpenSprinkler is rebooting now") - } - }); - },gohome); + $.mobile.loading("show"); + $.get("http://"+window.curr_ip+"/cv?pw="+window.curr_pw+"&rbt=1",function(){ + $.mobile.loading("hide"); + showerror("OpenSprinkler is rebooting now"); + }).error(comm_error); + }); } function rsn() { areYouSure("Are you sure you want to stop all stations?", "", function() { - $.mobile.showPageLoadingMsg() - $.get("index.php","os_ip="+window.curr_ip+"&os_pw="+window.curr_pw+"&action=rsn",function(result){ - $.mobile.hidePageLoadingMsg() - gohome(); - if (result == 0) { - comm_error() - } else { - showerror("All stations have been stopped") - } - }); - },gohome); + $.mobile.loading("show"); + $.get("http://"+window.curr_ip+"/cv?pw="+window.curr_pw+"&rsn=1",function(){ + $.mobile.loading("hide"); + update_device(check_status); + showerror("All stations have been stopped"); + }).error(comm_error); + }); } -function export_config() { - $.mobile.showPageLoadingMsg(); - $.get("index.php","os_ip="+window.curr_ip+"&os_pw="+window.curr_pw+"&action=export_config",function(data){ - $.mobile.hidePageLoadingMsg(); - $("#sprinklers-settings").panel("close") - if (data === "") { - comm_error() - } else { - localStorage.setItem("backup", data); - showerror("Backup saved to your device"); +function export_config(toFile) { + var newdata = new Object; + + newdata.programs = window.device.programs.pd; + newdata.options = new Object; + newdata.options.loc = window.device.settings.loc; + $.each(window.device.options,function(opt,val){ + if (opt in window.keyNames) { + newdata.options[window.keyNames[opt]] = {"en":"0","val":val}; } }) -} + newdata.stations = window.device.stations.snames; + newdata.masop = window.device.stations.masop; -function import_config() { - var data = localStorage.getItem("backup"); - if (data === null) { - showerror("No backup available on this device"); + if (toFile) { + if (!navigator.userAgent.match(/(iPad|iPhone|iPod)/g)) { + document.location = 'data:Application/octet-stream,' + encodeURIComponent(JSON.stringify(newdata)); + } else { + showerror("File API is not supported by your browser") + } return; + } else { + localStorage.setItem("backup", JSON.stringify(newdata)); + showerror("Backup saved to your device"); + } +} + +function import_config(data) { + if (typeof data === "undefined") { + var data = localStorage.getItem("backup"); + if (data === null) { + showerror("No backup available on this device"); + return; + } } + data = JSON.parse(data); areYouSure("Are you sure you want to restore the configuration?", "", function() { - $.mobile.showPageLoadingMsg(); - $.get("index.php","os_ip="+window.curr_ip+"&os_pw="+window.curr_pw+"&action=import_config&data="+data,function(reply){ - $.mobile.hidePageLoadingMsg(); - gohome(); - if (reply == 0) { - comm_error() - } else { - showerror("Backup restored to your device"); + $.mobile.loading("show"); + + var cs = "/cs?pw="+window.curr_pw, + co = "/co?pw="+window.curr_pw, + cp_start = "/cp?pw="+window.curr_pw, + i = 0; + + $.each(data.options,function (key,value) { + if (typeof value === "object") { + if ($.inArray(key, [2,14,16,21,22,25]) && value.val == 0) return true; + co += "&o"+key+"="+value.val; + } else if (key == "loc") { + co += "&"+key+"="+encodeURIComponent(value); } }) - },gohome); + $.each(data.stations,function (i,station) { + cs += "&s"+i+"="+encodeURIComponent(station); + i++; + }) + $i = 0; + $.each(data.masop,function (i,bit) { + cs += "&m"+i+"="+encodeURIComponent(bit); + i++; + }) + $.when( + $.get("http://"+window.curr_ip+co).error(comm_error), + $.get("http://"+window.curr_ip+cs).error(comm_error), + $.get("http://"+window.curr_ip+"/dp?pw="+window.curr_pw+"&pid=-1").error(comm_error), + $.each(data.programs,function (i,prog) { + $.get("http://"+window.curr_ip+cp_start+"&pid=-1&v="+((typeof prog === "object") ? JSON.stringify(prog) : prog)).error(comm_error); + }) + ).then(function(){ + $.mobile.loading("hide"); + showerror("Backup restored to your device"); + }); + }); } -function areYouSure(text1, text2, callback, callback2) { - $("#sure .sure-1").text(text1); - $("#sure .sure-2").text(text2); - $("#sure .sure-do").unbind("click.sure").on("click.sure", function() { +function getConfigFile() { + if (navigator.userAgent.match(/(iPad|iPhone|iPod)/g) || !window.FileReader) { + showerror("File API is not supported by your browser"); + return; + } + $('#configInput').click(); +} + +function handleConfig(files) { + var config = files[0]; + var reader = new FileReader(); + reader.onload = function(e){ + try{ + var obj=JSON.parse($.trim(e.target.result)); + import_config(JSON.stringify(obj)); + }catch(e){ + showerror("Unable to read the configuration file. Please check the file and try again."); + } + }; + reader.readAsText(config); +} + +function areYouSure(text1, text2, callback) { + var popup = $('\ +
    \ +

    '+text1+'

    \ +

    '+text2+'

    \ + Yes\ + No\ +
    '); + + $(".ui-page-active").append(popup); + + $("#sure").on("popupafterclose", function(){ + $(this).remove(); + }).on("popupafteropen", function(){ + $(this).popup("reposition", { + "positionTo": "window" + }); + }).popup().enhanceWithin().popup("open"); + + //Bind buttons + $("#sure .sure-do").on("click.sure", function() { + $("#sure").popup("close"); callback(); }); - $("#sure .sure-dont").unbind("click.sure").on("click.sure", function() { - callback2(); + $("#sure .sure-dont").on("click.sure", function() { + $("#sure").popup("close"); }); - $.mobile.changePage("#sure"); } function submit_newuser() { document.activeElement.blur(); - $.mobile.showPageLoadingMsg() + $.mobile.loading("show"); var sites = getsites(); //Submit form data to the server - $.get("index.php","os_ip="+$("#os_ip").val()+"&os_pw="+$("#os_pw").val()+"&action=test_ip",function(data){ - $.mobile.hidePageLoadingMsg() - if (data == 1) { + $.getJSON("http://"+$("#os_ip").val()+"/jc",function(data){ + $.mobile.loading("hide"); + if (data.en !== undefined) { var name = $("#os_name").val(); sites[name] = window.curr_name = new Object(); sites[name]["os_ip"] = window.curr_ip = $("#os_ip").val() @@ -1004,12 +1682,12 @@ function show_sites() { list += ""; list += ""; list += "Save Changes to "+a+""; - list += "Delete "+a+""; + list += "Delete "+a+""; list += ""; }) $("#site-control-list").html(list+"").trigger("create"); - $.mobile.changePage("#site-control"); + changePage("#site-control"); } function delete_site(site) { @@ -1019,7 +1697,8 @@ function delete_site(site) { update_site_list(Object.keys(sites)); show_sites(); if ($.isEmptyObject(sites)) { - $.mobile.changePage($("#addnew")); + changePage("#start"); + $("#addnew").popup("open"); return; } if (site === localStorage.getItem("current_site")) site_select(Object.keys(sites)); @@ -1041,15 +1720,3 @@ function change_site(site) { newload(); } } - -function getThemeUrl(theme) { - switch (theme) { - case "flat": - var url = "css/jquery.mobile.flatui.min.css"; - break; - default: - var url = "//cdnjs.cloudflare.com/ajax/libs/jquery-mobile/1.3.2/jquery.mobile.min.css"; - break; - } - return url; -} diff --git a/js/timeline.js b/js/timeline.js index 77cdc7f35..c41050371 100644 --- a/js/timeline.js +++ b/js/timeline.js @@ -1 +1,35 @@ -if(typeof links==="undefined"){links={}}if(typeof google==="undefined"){google=undefined}if(!Array.prototype.indexOf){Array.prototype.indexOf=function(b){for(var a=0;a0){d.addRows(g)}var f=links.Timeline.mapColumnIds(d);for(a in j){if(j.hasOwnProperty(a)){var b=f[a];if(b==undefined){var h=j[a];var c="string";if(typeof(h)=="number"){c="number"}else{if(typeof(h)=="boolean"){c="boolean"}else{if(h instanceof Date){c="datetime"}}}b=d.addColumn(c,a)}d.setValue(e,b,j[a])}}}else{if(links.Timeline.isArray(d)){var k=d[e];if(k==undefined){k={};d[e]=k}for(a in j){if(j.hasOwnProperty(a)){k[a]=j[a]}}}else{throw"Cannot update data, unknown type of data"}}};links.Timeline.prototype.getItemIndex=function(f){var g=f,j=this.dom,h=j.items.frame,b=this.items,c=undefined;while(g.parentNode&&g.parentNode!==h){g=g.parentNode}if(g.parentNode===h){for(var d=0,a=b.length;da.valueOf()){b=new Date(a.valueOf())}this.applyRange(f,b);if(e==undefined||e==true){this.render({animate:false})}else{this.recalcConversion()}};links.Timeline.prototype.setVisibleChartRangeAuto=function(){var a=this.getDataRange(true);this.setVisibleChartRange(a.min,a.max)};links.Timeline.prototype.setVisibleChartRangeNow=function(){var a=new Date();var b=(this.end.valueOf()-this.start.valueOf());var d=new Date(a.valueOf()-b/2);var c=new Date(d.valueOf()+b);this.setVisibleChartRange(d,c)};links.Timeline.prototype.getVisibleChartRange=function(){return{start:new Date(this.start.valueOf()),end:new Date(this.end.valueOf())}};links.Timeline.prototype.getDataRange=function(b){var g=this.items,d=undefined,h=undefined;if(g){for(var f=0,e=g.length;f0){this.render({animate:j?j.animate:undefined,renderTimesLeft:(c-1)})}}};links.Timeline.prototype.repaint=function(){var b=this.repaintFrame();var a=this.repaintAxis();var d=this.repaintGroups();var c=this.repaintItems();this.repaintCurrentTime();this.repaintCustomTime();return(b||a||d||c)};links.Timeline.prototype.reflowFrame=function(){var f=this.dom,d=this.options,e=this.size,b=false;var a=f.frame?f.frame.offsetWidth:0,c=f.frame?f.frame.clientHeight:0;b=b||(e.frameWidth!==a);b=b||(e.frameHeight!==c);e.frameWidth=a;e.frameHeight=c;return b};links.Timeline.prototype.repaintFrame=function(){var b=false,d=this.dom,j=this.options,h=this.size;if(!d.frame){d.frame=document.createElement("DIV");d.frame.className="timeline-frame";d.frame.style.position="relative";d.frame.style.overflow="hidden";d.container.appendChild(d.frame);b=true}var g=j.autoHeight?(h.actualHeight+"px"):(j.height||"100%");var a=j.width||"100%";b=b||(d.frame.style.height!=g);b=b||(d.frame.style.width!=a);d.frame.style.height=g;d.frame.style.width=a;if(!d.content){d.content=document.createElement("DIV");d.content.style.position="relative";d.content.style.overflow="hidden";d.frame.appendChild(d.content);var e=document.createElement("DIV");e.style.position="absolute";e.style.left="0px";e.style.top="0px";e.style.height="100%";e.style.width="0px";d.content.appendChild(e);d.contentTimelines=e;var c=this.eventParams,f=this;if(!c.onMouseDown){c.onMouseDown=function(k){f.onMouseDown(k)};links.Timeline.addEventListener(d.content,"mousedown",c.onMouseDown)}if(!c.onTouchStart){c.onTouchStart=function(k){f.onTouchStart(k)};links.Timeline.addEventListener(d.content,"touchstart",c.onTouchStart)}if(!c.onMouseWheel){c.onMouseWheel=function(k){f.onMouseWheel(k)};links.Timeline.addEventListener(d.content,"mousewheel",c.onMouseWheel)}if(!c.onDblClick){c.onDblClick=function(k){f.onDblClick(k)};links.Timeline.addEventListener(d.content,"dblclick",c.onDblClick)}b=true}d.content.style.left=h.contentLeft+"px";d.content.style.top="0px";d.content.style.width=h.contentWidth+"px";d.content.style.height=h.frameHeight+"px";this.repaintNavigation();return b};links.Timeline.prototype.reflowAxis=function(){var h=false,g=this.dom,n=this.options,m=this.size,k=g.axis;var j=(k&&k.characterMinor)?k.characterMinor.clientWidth:0,f=(k&&k.characterMinor)?k.characterMinor.clientHeight:0,b=(k&&k.characterMajor)?k.characterMajor.clientWidth:0,e=(k&&k.characterMajor)?k.characterMajor.clientHeight:0,d=(n.showMinorLabels?f:0)+(n.showMajorLabels?e:0);var a=n.axisOnTop?0:m.frameHeight-d,c=n.axisOnTop?d:a;h=h||(m.axis.top!==a);h=h||(m.axis.line!==c);h=h||(m.axis.height!==d);m.axis.top=a;m.axis.line=c;m.axis.height=d;m.axis.labelMajorTop=n.axisOnTop?0:c+(n.showMinorLabels?f:0);m.axis.labelMinorTop=n.axisOnTop?(n.showMajorLabels?e:0):c;m.axis.lineMinorTop=n.axisOnTop?m.axis.labelMinorTop:0;m.axis.lineMinorHeight=n.showMajorLabels?m.frameHeight-e:m.frameHeight;if(k&&k.minorLines&&k.minorLines.length){m.axis.lineMinorWidth=k.minorLines[0].offsetWidth}else{m.axis.lineMinorWidth=1}if(k&&k.majorLines&&k.majorLines.length){m.axis.lineMajorWidth=k.majorLines[0].offsetWidth}else{m.axis.lineMajorWidth=1}h=h||(m.axis.characterMinorWidth!==j);h=h||(m.axis.characterMinorHeight!==f);h=h||(m.axis.characterMajorWidth!==b);h=h||(m.axis.characterMajorHeight!==e);m.axis.characterMinorWidth=j;m.axis.characterMinorHeight=f;m.axis.characterMajorWidth=b;m.axis.characterMajorHeight=e;var l=Math.max(m.frameHeight-d,0);m.contentLeft=n.groupsOnRight?0:m.groupsWidth;m.contentWidth=Math.max(m.frameWidth-m.groupsWidth,0);m.contentHeight=l;return h};links.Timeline.prototype.repaintAxis=function(){var f=false,j=this.dom,r=this.options,q=this.size,e=this.step;var g=j.axis;if(!g){g={};j.axis=g}if(!q.axis.properties){q.axis.properties={}}if(!g.minorTexts){g.minorTexts=[]}if(!g.minorLines){g.minorLines=[]}if(!g.majorTexts){g.majorTexts=[]}if(!g.majorLines){g.majorLines=[]}if(!g.frame){g.frame=document.createElement("DIV");g.frame.style.position="absolute";g.frame.style.left="0px";g.frame.style.top="0px";j.content.appendChild(g.frame)}j.content.removeChild(g.frame);g.frame.style.width=(q.contentWidth)+"px";g.frame.style.height=(q.axis.height)+"px";var d=this.screenToTime(0);var h=this.screenToTime(q.contentWidth);if(q.axis.characterMinorWidth){this.minimumStep=this.screenToTime(q.axis.characterMinorWidth*6)-this.screenToTime(0);e.setRange(d,h,this.minimumStep)}var o=this.repaintAxisCharacters();f=f||o;this.repaintAxisStartOverwriting();e.start();var a=undefined;var l=0;while(!e.end()&&l<1000){l++;var p=e.getCurrent(),n=this.timeToScreen(p),k=e.isMajor();if(r.showMinorLabels){this.repaintAxisMinorText(n,e.getLabelMinor(r))}if(k&&r.showMajorLabels){if(n>0){if(a==undefined){a=n}this.repaintAxisMajorText(n,e.getLabelMajor(r))}this.repaintAxisMajorLine(n)}else{this.repaintAxisMinorLine(n)}e.next()}if(r.showMajorLabels){var c=this.screenToTime(0),m=this.step.getLabelMajor(r,c),b=m.length*q.axis.characterMajorWidth+10;if(a==undefined||be){var c=l[e];a.removeChild(c);l.splice(e,1)}var d=b.axis.minorLines;e=j.minorLineNum;while(d.length>e){var f=d[e];a.removeChild(f);d.splice(e,1)}var m=b.axis.majorTexts;e=j.majorTextNum;while(m.length>e){var h=m[e];a.removeChild(h);m.splice(e,1)}var g=b.axis.majorLines;e=j.majorLineNum;while(g.length>e){var k=g[e];a.removeChild(k);g.splice(e,1)}};links.Timeline.prototype.repaintAxisHorizontal=function(){var e=this.dom.axis,d=this.size,c=this.options;var a=(c.showMinorLabels||c.showMajorLabels);if(a){if(!e.backgroundLine){var f=document.createElement("DIV");f.className="timeline-axis";f.style.position="absolute";f.style.left="0px";f.style.width="100%";f.style.border="none";e.frame.insertBefore(f,e.frame.firstChild);e.backgroundLine=f}if(e.backgroundLine){e.backgroundLine.style.top=d.axis.top+"px";e.backgroundLine.style.height=d.axis.height+"px"}}else{if(e.backgroundLine){e.frame.removeChild(e.backgroundLine);delete e.backgroundLine}}if(a){if(e.line){var b=e.frame.removeChild(e.line);e.frame.appendChild(b)}else{var b=document.createElement("DIV");b.className="timeline-axis";b.style.position="absolute";b.style.left="0px";b.style.width="100%";b.style.height="0px";e.frame.appendChild(b);e.line=b}e.line.style.top=d.axis.line+"px"}else{if(e.line&&e.line.parentElement){e.frame.removeChild(e.line);delete e.line}}};links.Timeline.prototype.repaintAxisMinorText=function(h,j){var k=this.size,b=this.dom,e=k.axis.properties,a=b.axis.frame,g=b.axis.minorTexts,c=e.minorTextNum,f;if(c0)||(j.update.length>0)||(j.hide.length>0);while(n=j.show.shift()){n.showDOM(a);n.getImageUrls(c);b.push(n)}while(n=j.update.shift()){n.updateDOM(a);n.getImageUrls(c);k=this.renderedItems.indexOf(n);if(k==-1){b.push(n)}}while(n=j.hide.shift()){n.hideDOM(a);k=this.renderedItems.indexOf(n);if(k!=-1){b.splice(k,1)}}b.forEach(function(p){p.updatePosition(m)});this.repaintDeleteButton();this.repaintDragAreas();f.content.appendChild(a);if(c.length){var l=function(){m.render()};var e=false;links.imageloader.loadAll(c,l,e)}return d};links.Timeline.prototype.reflowGroups=function(){var f=false,m=this.options,l=this.size,d=this.dom;var j=0;var b=this.groups;var g=this.dom.groups?this.dom.groups.labels:[];for(var e=0,c=b.length;e-k.contentWidth&&h<2*k.contentWidth);e.currentTime.style.display=d?"":"none";e.currentTime.style.left=h+"px";e.currentTime.title="Current time: "+f;if(this.currentTimeTimer!=undefined){clearTimeout(this.currentTimeTimer);delete this.currentTimeTimer}var j=this;var g=function(){j.repaintCurrentTime()};var c=1/this.conversion.factor/2;if(c<30){c=30}this.currentTimeTimer=setTimeout(g,c)};links.Timeline.prototype.repaintCustomTime=function(){var c=this.options,g=this.dom,d=this.size;if(!c.showCustomTime){if(g.customTime){g.contentTimelines.removeChild(g.customTime);delete g.customTime}return}if(!g.customTime){var b=document.createElement("DIV");b.className="timeline-customtime";b.style.position="absolute";b.style.top="0px";b.style.height="100%";var e=document.createElement("DIV");e.style.position="relative";e.style.top="0px";e.style.left="-10px";e.style.height="100%";e.style.width="20px";b.appendChild(e);g.contentTimelines.appendChild(b);g.customTime=b;this.customTime=new Date()}var a=this.timeToScreen(this.customTime),f=(a>-d.contentWidth&&a<2*d.contentWidth);g.customTime.style.display=f?"":"none";g.customTime.style.left=a+"px";g.customTime.title="Time: "+this.customTime};links.Timeline.prototype.repaintDeleteButton=function(){var d=this,g=this.dom,f=g.items.frame;var h=g.items.deleteButton;if(!h){h=document.createElement("DIV");h.className="timeline-navigation-delete";h.style.position="absolute";f.appendChild(h);g.items.deleteButton=h}var a=this.selection?this.selection.index:-1,c=this.selection?this.items[a]:undefined;if(c&&c.rendered&&this.isEditable(c)){var b=c.getRight(this),e=c.top;h.style.left=b+"px";h.style.top=e+"px";h.style.display="";f.removeChild(h);f.appendChild(h)}else{h.style.display="none"}};links.Timeline.prototype.repaintDragAreas=function(){var k=this,m=this.options,d=this.dom,a=this.dom.items.frame;var c=d.items.dragLeft;if(!c){c=document.createElement("DIV");c.className="timeline-event-range-drag-left";c.style.position="absolute";a.appendChild(c);d.items.dragLeft=c}var e=d.items.dragRight;if(!e){e=document.createElement("DIV");e.className="timeline-event-range-drag-right";e.style.position="absolute";a.appendChild(e);d.items.dragRight=e}var f=this.selection?this.selection.index:-1,l=this.selection?this.items[f]:undefined;if(l&&l.rendered&&this.isEditable(l)&&(l instanceof links.Timeline.ItemRange)){var b=this.timeToScreen(l.start),h=this.timeToScreen(l.end),g=l.top,j=l.height;c.style.left=b+"px";c.style.top=g+"px";c.style.width=m.dragAreaWidth+"px";c.style.height=j+"px";c.style.display="";a.removeChild(c);a.appendChild(c);e.style.left=(h-m.dragAreaWidth)+"px";e.style.top=g+"px";e.style.width=m.dragAreaWidth+"px";e.style.height=j+"px";e.style.display="";a.removeChild(e);a.appendChild(e)}else{c.style.display="none";e.style.display="none"}};links.Timeline.prototype.repaintNavigation=function(){var l=this,m=this.options,g=this.dom,e=g.frame,f=g.navBar;if(!f){var a=m.showButtonNew&&m.editable;var d=m.showNavigation&&(m.zoomable||m.moveable);if(d||a){f=document.createElement("DIV");f.style.position="absolute";f.className="timeline-navigation";if(m.groupsOnRight){f.style.left="10px"}else{f.style.right="10px"}if(m.axisOnTop){f.style.bottom="10px"}else{f.style.top="10px"}g.navBar=f;e.appendChild(f)}if(a){f.addButton=document.createElement("DIV");f.addButton.className="timeline-navigation-new";f.addButton.title=m.CREATE_NEW_EVENT;var j=function(o){links.Timeline.preventDefault(o);links.Timeline.stopPropagation(o);var t=l.size.contentWidth;var s=t/2;var v=l.screenToTime(s-t/10);var n=l.screenToTime(s+t/10);if(m.snapEvents){l.step.snap(v);l.step.snap(n)}var q=m.NEW;var u=l.groups.length?l.groups[0].content:undefined;var r=true;l.addItem({start:v,end:n,content:q,group:u},r);var p=(l.items.length-1);l.selectItem(p);l.applyAdd=true;l.trigger("add");if(l.applyAdd){l.render({animate:false});l.selectItem(p)}else{l.deleteItem(p)}};links.Timeline.addEventListener(f.addButton,"mousedown",j);f.appendChild(f.addButton)}if(a&&d){f.addButton.style.borderRightWidth="1px";f.addButton.style.borderRightStyle="solid"}if(d){if(m.zoomable){f.zoomInButton=document.createElement("DIV");f.zoomInButton.className="timeline-navigation-zoom-in";f.zoomInButton.title=this.options.ZOOM_IN;var c=function(n){links.Timeline.preventDefault(n);links.Timeline.stopPropagation(n);l.zoom(0.4);l.trigger("rangechange");l.trigger("rangechanged")};links.Timeline.addEventListener(f.zoomInButton,"mousedown",c);f.appendChild(f.zoomInButton);f.zoomOutButton=document.createElement("DIV");f.zoomOutButton.className="timeline-navigation-zoom-out";f.zoomOutButton.title=this.options.ZOOM_OUT;var h=function(n){links.Timeline.preventDefault(n);links.Timeline.stopPropagation(n);l.zoom(-0.4);l.trigger("rangechange");l.trigger("rangechanged")};links.Timeline.addEventListener(f.zoomOutButton,"mousedown",h);f.appendChild(f.zoomOutButton)}if(m.moveable){f.moveLeftButton=document.createElement("DIV");f.moveLeftButton.className="timeline-navigation-move-left";f.moveLeftButton.title=this.options.MOVE_LEFT;var k=function(n){links.Timeline.preventDefault(n);links.Timeline.stopPropagation(n);l.move(-0.2);l.trigger("rangechange");l.trigger("rangechanged")};links.Timeline.addEventListener(f.moveLeftButton,"mousedown",k);f.appendChild(f.moveLeftButton);f.moveRightButton=document.createElement("DIV");f.moveRightButton.className="timeline-navigation-move-right";f.moveRightButton.title=this.options.MOVE_RIGHT;var b=function(n){links.Timeline.preventDefault(n);links.Timeline.stopPropagation(n);l.move(0.2);l.trigger("rangechange");l.trigger("rangechanged")};links.Timeline.addEventListener(f.moveRightButton,"mousedown",b);f.appendChild(f.moveRightButton)}}}};links.Timeline.prototype.setCurrentTime=function(b){var a=new Date();this.clientTimeOffset=(b.valueOf()-a.valueOf());this.repaintCurrentTime()};links.Timeline.prototype.getCurrentTime=function(){var a=new Date();return new Date(a.valueOf()+this.clientTimeOffset)};links.Timeline.prototype.setCustomTime=function(a){this.customTime=new Date(a.valueOf());this.repaintCustomTime()};links.Timeline.prototype.getCustomTime=function(){return new Date(this.customTime.valueOf())};links.Timeline.prototype.setScale=function(b,a){this.step.setScale(b,a);this.render()};links.Timeline.prototype.setAutoScale=function(a){this.step.setAutoScale(a);this.render()};links.Timeline.prototype.redraw=function(){this.setData(this.data)};links.Timeline.prototype.checkResize=function(){this.render()};links.Timeline.prototype.isEditable=function(a){if(a){if(a.editable!=undefined){return a.editable}else{return this.options.editable}}return false};links.Timeline.prototype.recalcConversion=function(){this.conversion.offset=this.start.valueOf();this.conversion.factor=this.size.contentWidth/(this.end.valueOf()-this.start.valueOf())};links.Timeline.prototype.screenToTime=function(a){var b=this.conversion;return new Date(a/b.factor+b.offset)};links.Timeline.prototype.timeToScreen=function(b){var a=this.conversion;return(b.valueOf()-a.offset)*a.factor};links.Timeline.prototype.onTouchStart=function(c){var e=this.eventParams,b=this;if(e.touchDown){return}e.touchDown=true;e.zoomed=false;this.onMouseDown(c);if(!e.onTouchMove){e.onTouchMove=function(f){b.onTouchMove(f)};links.Timeline.addEventListener(document,"touchmove",e.onTouchMove)}if(!e.onTouchEnd){e.onTouchEnd=function(f){b.onTouchEnd(f)};links.Timeline.addEventListener(document,"touchend",e.onTouchEnd)}var d=links.Timeline.getTarget(c);var a=this.getItemIndex(d);e.doubleTapStartPrev=e.doubleTapStart;e.doubleTapStart=(new Date()).valueOf();e.doubleTapItemPrev=e.doubleTapItem;e.doubleTapItem=a;links.Timeline.preventDefault(c)};links.Timeline.prototype.onTouchMove=function(d){var g=this.eventParams;if(d.scale&&d.scale!==1){g.zoomed=true}if(!g.zoomed){this.onMouseMove(d)}else{if(this.options.zoomable){g.zoomed=true;var f=d.scale,b=(g.end.valueOf()-g.start.valueOf()),c=b/f,e=c-b,h=new Date(parseInt(g.start.valueOf()-e/2)),a=new Date(parseInt(g.end.valueOf()+e/2));this.setVisibleChartRange(h,a);this.trigger("rangechange")}}links.Timeline.preventDefault(d)};links.Timeline.prototype.onTouchEnd=function(d){var f=this.eventParams;var c=this;f.touchDown=false;if(f.zoomed){this.trigger("rangechanged")}if(f.onTouchMove){links.Timeline.removeEventListener(document,"touchmove",f.onTouchMove);delete f.onTouchMove}if(f.onTouchEnd){links.Timeline.removeEventListener(document,"touchend",f.onTouchEnd);delete f.onTouchEnd}this.onMouseUp(d);var g=500;var a=(new Date()).valueOf();var e=links.Timeline.getTarget(d);var b=this.getItemIndex(e);if(f.doubleTapStartPrev&&(a-f.doubleTapStartPrev)=1){D.moved=true}if(D.customTime){var o=this.timeToScreen(D.customTime);var q=o+t;this.customTime=this.screenToTime(q);this.repaintCustomTime();this.trigger("timechange")}else{if(D.editItem){var B=this.items[D.itemIndex],f,C;if(D.itemDragLeft){f=D.itemLeft+t;C=D.itemRight;B.start=this.screenToTime(f);if(e.snapEvents){this.step.snap(B.start);f=this.timeToScreen(B.start)}if(f>C){f=C;B.start=this.screenToTime(f)}}else{if(D.itemDragRight){f=D.itemLeft;C=D.itemRight+t;B.end=this.screenToTime(C);if(e.snapEvents){this.step.snap(B.end);C=this.timeToScreen(B.end)}if(C=1){g=0.9}if(g<=-1){g=-0.9}if(g<0){g=g/(1+g)}var e=(this.start.valueOf()-h);var d=(this.end.valueOf()-h);var a=new Date(this.start.valueOf()-e*g);var f=new Date(this.end.valueOf()-d*g);var c=(f.valueOf()-a.valueOf());var b=Number(this.options.zoomMin)||10;if(b<10){b=10}if(c>=b){this.applyRange(a,f,h);this.render({animate:this.options.animate&&this.options.animateZoom})}};links.Timeline.prototype.move=function(b){var d=(this.end.valueOf()-this.start.valueOf());var a=new Date(this.start.valueOf()+d*b);var c=new Date(this.end.valueOf()+d*b);this.applyRange(a,c);this.render()};links.Timeline.prototype.applyRange=function(b,e,a){var c=b.valueOf();var n=e.valueOf();var d=(n-c);var q=this.options;var k=1000*60*60*24*365;var h=Number(q.zoomMin)||10;if(h<10){h=10}var p=Number(q.zoomMax)||10000*k;if(p>10000*k){p=10000*k}if(p=m){var l=1000*60*60*24;m=g+l}if(p>(m-g)){p=(m-g)}if(h>(m-g)){h=(m-g)}}if(c>=n){n+=1000*60*60*24}if(dp){var o=(d-p);var j=a?(a.valueOf()-c)/d:0.5;c+=Math.round(o*j);n-=Math.round(o*(1-j))}if(g!=undefined){var o=(c-g);if(o<0){c-=o;n-=o}}if(m!=undefined){var o=(m-n);if(o<0){c+=o;n+=o}}this.start=new Date(c);this.end=new Date(n)};links.Timeline.prototype.confirmDeleteItem=function(a){this.applyDelete=true;if(!this.isSelected(a)){this.selectItem(a)}this.trigger("delete");if(this.applyDelete){this.deleteItem(a)}delete this.applyDelete};links.Timeline.prototype.deleteItem=function(a,c){if(a>=this.items.length){throw"Cannot delete row, index out of range"}if(this.selection){if(this.selection.index==a){this.unselectItem()}else{if(this.selection.index>a){this.selection.index--}}}var b=this.items.splice(a,1)[0];this.renderQueue.hide.push(b);if(this.data){if(google&&google.visualization&&this.data instanceof google.visualization.DataTable){this.data.removeRow(a)}else{if(links.Timeline.isArray(this.data)){this.data.splice(a,1)}else{throw"Cannot delete row from data, unknown data type"}}}if(this.options.cluster){this.clusterGenerator.updateData()}if(!c){this.render()}};links.Timeline.prototype.deleteAllItems=function(){this.unselectItem();this.clearItems();this.deleteGroups();if(this.data){if(google&&google.visualization&&this.data instanceof google.visualization.DataTable){this.data.removeRows(0,this.data.getNumberOfRows())}else{if(links.Timeline.isArray(this.data)){this.data.splice(0,this.data.length)}else{throw"Cannot delete row from data, unknown data type"}}}if(this.options.cluster){this.clusterGenerator.updateData()}this.render()};links.Timeline.prototype.getGroupFromHeight=function(b){var c,d,a=this.groups;if(a.length){if(this.options.axisOnTop){for(c=a.length-1;c>=0;c--){d=a[c];if(b>d.top){return d}}}else{for(c=0;cd.top){return d}}}return d}return undefined};links.Timeline.Item=function(c,a){if(c){this.start=c.start;this.end=c.end;this.content=c.content;this.className=c.className;this.editable=c.editable;this.group=c.group}this.top=0;this.left=0;this.width=0;this.height=0;this.lineWidth=0;this.dotWidth=0;this.dotHeight=0;this.rendered=false;if(a){for(var b in a){if(a.hasOwnProperty(b)){this[b]=a[b]}}}};links.Timeline.Item.prototype.reflow=function(){return false};links.Timeline.Item.prototype.getImageUrls=function(a){if(this.dom){links.imageloader.filterImageUrls(this.dom,a)}};links.Timeline.Item.prototype.select=function(){};links.Timeline.Item.prototype.unselect=function(){};links.Timeline.Item.prototype.createDOM=function(){};links.Timeline.Item.prototype.showDOM=function(a){};links.Timeline.Item.prototype.hideDOM=function(a){};links.Timeline.Item.prototype.updateDOM=function(){};links.Timeline.Item.prototype.updatePosition=function(a){};links.Timeline.Item.prototype.isRendered=function(){return this.rendered};links.Timeline.Item.prototype.isVisible=function(b,a){return false};links.Timeline.Item.prototype.setPosition=function(b,a){};links.Timeline.Item.prototype.getRight=function(a){return 0};links.Timeline.Item.prototype.getWidth=function(a){return this.width||0};links.Timeline.ItemBox=function(b,a){links.Timeline.Item.call(this,b,a)};links.Timeline.ItemBox.prototype=new links.Timeline.Item();links.Timeline.ItemBox.prototype.reflow=function(){var e=this.dom,c=e.dot.offsetHeight,d=e.dot.offsetWidth,a=e.line.offsetWidth,b=((this.dotHeight!=c)||(this.dotWidth!=d)||(this.lineWidth!=a));this.dotHeight=c;this.dotWidth=d;this.lineWidth=a;return b};links.Timeline.ItemBox.prototype.select=function(){var a=this.dom;links.Timeline.addClassName(a,"timeline-event-selected");links.Timeline.addClassName(a.line,"timeline-event-selected");links.Timeline.addClassName(a.dot,"timeline-event-selected")};links.Timeline.ItemBox.prototype.unselect=function(){var a=this.dom;links.Timeline.removeClassName(a,"timeline-event-selected");links.Timeline.removeClassName(a.line,"timeline-event-selected");links.Timeline.removeClassName(a.dot,"timeline-event-selected")};links.Timeline.ItemBox.prototype.createDOM=function(){var c=document.createElement("DIV");c.style.position="absolute";c.style.left=this.left+"px";c.style.top=this.top+"px";var b=document.createElement("DIV");b.className="timeline-event-content";b.innerHTML=this.content;c.appendChild(b);var d=document.createElement("DIV");d.style.position="absolute";d.style.width="0px";c.line=d;var a=document.createElement("DIV");a.style.position="absolute";a.style.width="0px";a.style.height="0px";c.dot=a;this.dom=c;this.updateDOM();return c};links.Timeline.ItemBox.prototype.showDOM=function(a){var b=this.dom;if(!b){b=this.createDOM()}if(b.parentNode!=a){if(b.parentNode){this.hideDOM()}a.appendChild(b);a.insertBefore(b.line,a.firstChild);a.appendChild(b.dot);this.rendered=true}};links.Timeline.ItemBox.prototype.hideDOM=function(){var a=this.dom;if(a){if(a.parentNode){a.parentNode.removeChild(a)}if(a.line&&a.line.parentNode){a.line.parentNode.removeChild(a.line)}if(a.dot&&a.dot.parentNode){a.dot.parentNode.removeChild(a.dot)}this.rendered=false}};links.Timeline.ItemBox.prototype.updateDOM=function(){var b=this.dom;if(b){var c=b.line;var a=b.dot;b.firstChild.innerHTML=this.content;b.className="timeline-event timeline-event-box";c.className="timeline-event timeline-event-line";a.className="timeline-event timeline-event-dot";if(this.isCluster){links.Timeline.addClassName(b,"timeline-event-cluster");links.Timeline.addClassName(c,"timeline-event-cluster");links.Timeline.addClassName(a,"timeline-event-cluster")}if(this.className){links.Timeline.addClassName(b,this.className);links.Timeline.addClassName(c,this.className);links.Timeline.addClassName(a,this.className)}}};links.Timeline.ItemBox.prototype.updatePosition=function(g){var e=this.dom;if(e){var c=g.timeToScreen(this.start),f=g.options.axisOnTop,a=g.size.axis.top,d=g.size.axis.height,h=(g.options.box&&g.options.box.align)?g.options.box.align:undefined;e.style.top=this.top+"px";if(h=="right"){e.style.left=(c-this.width)+"px"}else{if(h=="left"){e.style.left=(c)+"px"}else{e.style.left=(c-this.width/2)+"px"}}var j=e.line;var b=e.dot;j.style.left=(c-this.lineWidth/2)+"px";b.style.left=(c-this.dotWidth/2)+"px";if(f){j.style.top=d+"px";j.style.height=Math.max(this.top-d,0)+"px";b.style.top=(d-this.dotHeight/2)+"px"}else{j.style.top=(this.top+this.height)+"px";j.style.height=Math.max(a-this.top-this.height,0)+"px";b.style.top=(a-this.dotHeight/2)+"px"}}};links.Timeline.ItemBox.prototype.isVisible=function(b,a){if(this.cluster){return false}return(this.start>b)&&(this.start2*a){b=2*a}e.style.top=this.top+"px";e.style.left=d+"px";e.style.width=Math.max(b-d,1)+"px"}};links.Timeline.ItemRange.prototype.isVisible=function(b,a){if(this.cluster){return false}return(this.end>b)&&(this.startb)&&(this.start=this.items.length){throw"Cannot get item, index out of range"}var c=this.items[a];var b={};b.start=new Date(c.start.valueOf());if(c.end){b.end=new Date(c.end.valueOf())}b.content=c.content;if(c.group){b.group=this.getGroupName(c.group)}if("className" in c){b.className=this.getGroupName(c.className)}if(c.hasOwnProperty("editable")&&(typeof c.editable!="undefined")){b.editable=c.editable}return b};links.Timeline.prototype.addItem=function(a,b){var c=[a];this.addItems(c,b)};links.Timeline.prototype.addItems=function(d,c){var b=this,a=this.items;d.forEach(function(e){var f=a.length;a.push(b.createItem(e));b.updateData(f,e)});if(this.options.cluster){this.clusterGenerator.updateData()}if(!c){this.render({animate:false})}};links.Timeline.prototype.createItem=function(a){var c=a.end?"range":this.options.style;var e={start:a.start,end:a.end,content:a.content,className:a.className,editable:a.editable,group:this.getGroup(a.group)};var d,b=this.options;if(b.axisOnTop){d=this.size.axis.height+b.eventMarginAxis+b.eventMargin/2}else{d=this.size.contentHeight-b.eventMarginAxis-b.eventMargin/2}if(c in this.itemTypes){return new this.itemTypes[c](e,{top:d})}console.log('ERROR: Unknown event style "'+c+'"');return new links.Timeline.Item(e,{top:d})};links.Timeline.prototype.changeItem=function(b,a,d){var e=this.items[b];if(!e){throw"Cannot change item, index out of range"}var c=this.createItem({start:a.hasOwnProperty("start")?a.start:e.start,end:a.hasOwnProperty("end")?a.end:e.end,content:a.hasOwnProperty("content")?a.content:e.content,group:a.hasOwnProperty("group")?a.group:this.getGroupName(e.group),className:a.hasOwnProperty("className")?a.className:e.className,editable:a.hasOwnProperty("editable")?a.editable:e.editable});this.items[b]=c;this.renderQueue.hide.push(e);this.renderQueue.show.push(c);this.updateData(b,a);if(this.options.cluster){this.clusterGenerator.updateData()}if(!d){this.render({animate:false});c.select()}};links.Timeline.prototype.deleteGroups=function(){this.groups=[];this.groupIndexes={}};links.Timeline.prototype.getGroup=function(g){var b=this.groups,c=this.groupIndexes,e=undefined;var f=c[g];if(f==undefined&&g!=undefined){e={content:g,labelTop:0,lineTop:0};b.push(e);for(var d=0,a=b.length;d0){if(g[0].row!=undefined){var e=g[0].row;if(this.items[e]){var h=this.items[e];this.selectItem(e);var a=h.start;var c=h.end;var j;if(c!=undefined){j=(c.valueOf()+a.valueOf())/2}else{j=a.valueOf()}var f=(this.end.valueOf()-this.start.valueOf()),d=new Date(j-f/2),b=new Date(j+f/2);this.setVisibleChartRange(d,b);return true}}}else{this.unselectItem()}return false};links.Timeline.prototype.getSelection=function(){var a=[];if(this.selection){a.push({row:this.selection.index})}return a};links.Timeline.prototype.selectItem=function(a){this.unselectItem();this.selection=undefined;if(this.items[a]!=undefined){var c=this.items[a],b=c.dom;this.selection={index:a};if(c&&c.dom){if(this.isEditable(c)){c.dom.style.cursor="move"}c.select()}this.repaintDeleteButton();this.repaintDragAreas()}};links.Timeline.prototype.isSelected=function(a){return(this.selection&&this.selection.index==a)};links.Timeline.prototype.unselectItem=function(){if(this.selection){var b=this.items[this.selection.index];if(b&&b.dom){var a=b.dom;a.style.cursor="";b.unselect()}this.selection=undefined;this.repaintDeleteButton();this.repaintDragAreas()}};links.Timeline.prototype.stackItems=function(b){if(this.groups.length>0){return}if(b==undefined){b=false}var a=this.stack;if(!a){a={};this.stack=a}a.sortedItems=this.stackOrder(this.renderedItems);a.finalItems=this.stackCalculateFinal(a.sortedItems);if(b||a.timer){var d=this;var c=function(){var e=d.stackMoveOneStep(a.sortedItems,a.finalItems);d.repaint();if(!e){a.timer=setTimeout(c,30)}else{delete a.timer}};if(!a.timer){a.timer=setTimeout(c,30)}}else{this.stackMoveToFinal(a.sortedItems,a.finalItems)}};links.Timeline.prototype.stackCancelAnimation=function(){if(this.stack&&this.stack.timer){clearTimeout(this.stack.timer);delete this.stack.timer}};links.Timeline.prototype.stackOrder=function(a){var c=a.concat([]);var b=this.options.customStackOrder&&(typeof this.options.customStackOrder==="function")?this.options.customStackOrder:function(e,d){if((e instanceof links.Timeline.ItemRange)&&!(d instanceof links.Timeline.ItemRange)){return -1}if(!(e instanceof links.Timeline.ItemRange)&&(d instanceof links.Timeline.ItemRange)){return 1}return(e.left-d.left)};c.sort(b);return c};links.Timeline.prototype.stackCalculateFinal=function(l){var p,o,j=this.size,d=j.axis.top,g=j.axis.height,a=this.options,t=a.axisOnTop,c=a.eventMargin,n=a.eventMarginAxis,f=[];for(p=0,o=l.length;ph)?1:-1);if(Math.abs(g)>4){a=g/4}var b=parseInt(h+a);if(b!=f){c=false}k.top=b;k.bottom=k.top+k.height}else{k.top=d.top;k.bottom=d.bottom}k.left=d.left;k.right=d.right}return c};links.Timeline.prototype.stackMoveToFinal=function(a,b){for(i=0,iMax=b.length;i=g;c--){var d=h[c];if(j(e,d,b)){if(c!=a){return d}}}return undefined};links.Timeline.prototype.collision=function(b,a,c){if(c==undefined){c=0}return(b.left-ca.left&&b.top-ca.top)};links.Timeline.prototype.trigger=function(b){var a=null;switch(b){case"rangechange":case"rangechanged":a={start:new Date(this.start.valueOf()),end:new Date(this.end.valueOf())};break;case"timechange":case"timechanged":a={time:new Date(this.customTime.valueOf())};break}links.events.trigger(this,b,a);if(google&&google.visualization){google.visualization.events.trigger(this,b,a)}};links.Timeline.prototype.clusterItems=function(){if(!this.options.cluster){return}var b=this.clusterGenerator.getClusters(this.conversion.factor);if(this.clusters!=b){var a=this.renderQueue;if(this.clusters){this.clusters.forEach(function(c){a.hide.push(c);c.items.forEach(function(d){d.cluster=undefined})})}b.forEach(function(c){c.items.forEach(function(d){d.cluster=c})});this.clusters=b}};links.Timeline.prototype.filterItems=function(){var a=this.renderQueue,d=(this.end-this.start),e=new Date(this.start.valueOf()-d),b=new Date(this.end.valueOf()+d);function c(f){f.forEach(function(g){var j=g.rendered;var h=g.isVisible(e,b);if(j!=h){if(j){a.hide.push(g)}if(h&&(a.show.indexOf(g)==-1)){a.show.push(g)}}})}c(this.items);if(this.clusters){c(this.clusters)}};links.Timeline.ClusterGenerator=function(a){this.timeline=a;this.clear()};links.Timeline.ClusterGenerator.prototype.clear=function(){this.items=[];this.groups={};this.clearCache()};links.Timeline.ClusterGenerator.prototype.clearCache=function(){this.cache={};this.cacheLevel=-1;this.cache[this.cacheLevel]=[]};links.Timeline.ClusterGenerator.prototype.setData=function(a,b){this.items=a||[];this.dataChanged=true;this.applyOnChangedLevel=true;if(b&&b.applyOnChangedLevel){this.applyOnChangedLevel=b.applyOnChangedLevel}};links.Timeline.ClusterGenerator.prototype.updateData=function(){this.dataChanged=true;this.applyOnChangedLevel=false};links.Timeline.ClusterGenerator.prototype.filterData=function(){var b=this.items||[];var a={};this.groups=a;b.forEach(function(d){var f=d.group?d.group.content:"";var e=a[f];if(!e){e=[];a[f]=e}e.push(d);if(d.start){if(d.end){d.center=(d.start.valueOf()+d.end.valueOf())/2}else{d.center=d.start.valueOf()}}});for(var c in a){if(a.hasOwnProperty(c)){a[c].sort(function(e,d){return(e.center-d.center)})}}this.dataChanged=false};links.Timeline.ClusterGenerator.prototype.getClusters=function(K){var a=-1,b=2,x=0,H=5;if(K>0){a=Math.round(Math.log(100/K)/Math.log(b));x=Math.pow(b,a);if(this.timeline.groups&&this.timeline.groups.length){x*=4}}if(this.dataChanged){var w=(a!=this.cacheLevel);var D=this.applyOnChangedLevel?w:true;if(D){this.clearCache();this.filterData()}}this.cacheLevel=a;var h=this.cache[a];if(!h){h=[];for(var q in this.groups){if(this.groups.hasOwnProperty(q)){var r=this.groups[q];var z=r.length;var G=0;while(G=0&&(J.center-r[E].center)=0&&(J.center-h[A].center)H){var n=v-H+1;var d=[];var t=undefined;var y=undefined;var F=undefined;var f=false;var g=0;var u=G;while(d.length'+g+" events";var o=J.group?J.group.content:undefined;if(f){I=this.timeline.createItem({start:new Date(y),end:new Date(F),content:B,group:o})}else{I=this.timeline.createItem({start:new Date(t),content:B,group:o})}I.isCluster=true;I.items=d;I.items.forEach(function(j){j.cluster=I});h.push(I);G+=n}else{delete J.cluster;G+=1}}}}this.cache[a]=h}return h};links.events=links.events||{listeners:[],indexOf:function(b){var d=this.listeners;for(var c=0,a=this.listeners.length;cthis._end.valueOf())};links.Timeline.StepDate.prototype.next=function(){var b=this.current.valueOf();if(this.current.getMonth()<6){switch(this.scale){case links.Timeline.StepDate.SCALE.MILLISECOND:this.current=new Date(this.current.valueOf()+this.step);break;case links.Timeline.StepDate.SCALE.SECOND:this.current=new Date(this.current.valueOf()+this.step*1000);break;case links.Timeline.StepDate.SCALE.MINUTE:this.current=new Date(this.current.valueOf()+this.step*1000*60);break;case links.Timeline.StepDate.SCALE.HOUR:this.current=new Date(this.current.valueOf()+this.step*1000*60*60);var a=this.current.getHours();this.current.setHours(a-(a%this.step));break;case links.Timeline.StepDate.SCALE.WEEKDAY:case links.Timeline.StepDate.SCALE.DAY:this.current.setDate(this.current.getDate()+this.step);break;case links.Timeline.StepDate.SCALE.MONTH:this.current.setMonth(this.current.getMonth()+this.step);break;case links.Timeline.StepDate.SCALE.YEAR:this.current.setFullYear(this.current.getFullYear()+this.step);break;default:break}}else{switch(this.scale){case links.Timeline.StepDate.SCALE.MILLISECOND:this.current=new Date(this.current.valueOf()+this.step);break;case links.Timeline.StepDate.SCALE.SECOND:this.current.setSeconds(this.current.getSeconds()+this.step);break;case links.Timeline.StepDate.SCALE.MINUTE:this.current.setMinutes(this.current.getMinutes()+this.step);break;case links.Timeline.StepDate.SCALE.HOUR:this.current.setHours(this.current.getHours()+this.step);break;case links.Timeline.StepDate.SCALE.WEEKDAY:case links.Timeline.StepDate.SCALE.DAY:this.current.setDate(this.current.getDate()+this.step);break;case links.Timeline.StepDate.SCALE.MONTH:this.current.setMonth(this.current.getMonth()+this.step);break;case links.Timeline.StepDate.SCALE.YEAR:this.current.setFullYear(this.current.getFullYear()+this.step);break;default:break}}if(this.step!=1){switch(this.scale){case links.Timeline.StepDate.SCALE.MILLISECOND:if(this.current.getMilliseconds()0){this.step=a}this.autoScale=false};links.Timeline.StepDate.prototype.setAutoScale=function(a){this.autoScale=a};links.Timeline.StepDate.prototype.setMinimumStep=function(f){if(f==undefined){return}var b=(1000*60*60*24*30*12);var a=(1000*60*60*24*30);var e=(1000*60*60*24);var g=(1000*60*60);var d=(1000*60);var h=(1000);var c=(1);if(b*1000>f){this.scale=links.Timeline.StepDate.SCALE.YEAR;this.step=1000}if(b*500>f){this.scale=links.Timeline.StepDate.SCALE.YEAR;this.step=500}if(b*100>f){this.scale=links.Timeline.StepDate.SCALE.YEAR;this.step=100}if(b*50>f){this.scale=links.Timeline.StepDate.SCALE.YEAR;this.step=50}if(b*10>f){this.scale=links.Timeline.StepDate.SCALE.YEAR;this.step=10}if(b*5>f){this.scale=links.Timeline.StepDate.SCALE.YEAR;this.step=5}if(b>f){this.scale=links.Timeline.StepDate.SCALE.YEAR;this.step=1}if(a*3>f){this.scale=links.Timeline.StepDate.SCALE.MONTH;this.step=3}if(a>f){this.scale=links.Timeline.StepDate.SCALE.MONTH;this.step=1}if(e*5>f){this.scale=links.Timeline.StepDate.SCALE.DAY;this.step=5}if(e*2>f){this.scale=links.Timeline.StepDate.SCALE.DAY;this.step=2}if(e>f){this.scale=links.Timeline.StepDate.SCALE.DAY;this.step=1}if(e/2>f){this.scale=links.Timeline.StepDate.SCALE.WEEKDAY;this.step=1}if(g*4>f){this.scale=links.Timeline.StepDate.SCALE.HOUR;this.step=4}if(g>f){this.scale=links.Timeline.StepDate.SCALE.HOUR;this.step=1}if(d*15>f){this.scale=links.Timeline.StepDate.SCALE.MINUTE;this.step=15}if(d*10>f){this.scale=links.Timeline.StepDate.SCALE.MINUTE;this.step=10}if(d*5>f){this.scale=links.Timeline.StepDate.SCALE.MINUTE;this.step=5}if(d>f){this.scale=links.Timeline.StepDate.SCALE.MINUTE;this.step=1}if(h*15>f){this.scale=links.Timeline.StepDate.SCALE.SECOND;this.step=15}if(h*10>f){this.scale=links.Timeline.StepDate.SCALE.SECOND;this.step=10}if(h*5>f){this.scale=links.Timeline.StepDate.SCALE.SECOND;this.step=5}if(h>f){this.scale=links.Timeline.StepDate.SCALE.SECOND;this.step=1}if(c*200>f){this.scale=links.Timeline.StepDate.SCALE.MILLISECOND;this.step=200}if(c*100>f){this.scale=links.Timeline.StepDate.SCALE.MILLISECOND;this.step=100}if(c*50>f){this.scale=links.Timeline.StepDate.SCALE.MILLISECOND;this.step=50}if(c*10>f){this.scale=links.Timeline.StepDate.SCALE.MILLISECOND;this.step=10}if(c*5>f){this.scale=links.Timeline.StepDate.SCALE.MILLISECOND;this.step=5}if(c>f){this.scale=links.Timeline.StepDate.SCALE.MILLISECOND;this.step=1}};links.Timeline.StepDate.prototype.snap=function(a){if(this.scale==links.Timeline.StepDate.SCALE.YEAR){var b=a.getFullYear()+Math.round(a.getMonth()/12);a.setFullYear(Math.round(b/this.step)*this.step);a.setMonth(0);a.setDate(0);a.setHours(0);a.setMinutes(0);a.setSeconds(0);a.setMilliseconds(0)}else{if(this.scale==links.Timeline.StepDate.SCALE.MONTH){if(a.getDate()>15){a.setDate(1);a.setMonth(a.getMonth()+1)}else{a.setDate(1)}a.setHours(0);a.setMinutes(0);a.setSeconds(0);a.setMilliseconds(0)}else{if(this.scale==links.Timeline.StepDate.SCALE.DAY||this.scale==links.Timeline.StepDate.SCALE.WEEKDAY){switch(this.step){case 5:case 2:a.setHours(Math.round(a.getHours()/24)*24);break;default:a.setHours(Math.round(a.getHours()/12)*12);break}a.setMinutes(0);a.setSeconds(0);a.setMilliseconds(0)}else{if(this.scale==links.Timeline.StepDate.SCALE.HOUR){switch(this.step){case 4:a.setMinutes(Math.round(a.getMinutes()/60)*60);break;default:a.setMinutes(Math.round(a.getMinutes()/30)*30);break}a.setSeconds(0);a.setMilliseconds(0)}else{if(this.scale==links.Timeline.StepDate.SCALE.MINUTE){switch(this.step){case 15:case 10:a.setMinutes(Math.round(a.getMinutes()/5)*5);a.setSeconds(0);break;case 5:a.setSeconds(Math.round(a.getSeconds()/60)*60);break;default:a.setSeconds(Math.round(a.getSeconds()/30)*30);break}a.setMilliseconds(0)}else{if(this.scale==links.Timeline.StepDate.SCALE.SECOND){switch(this.step){case 15:case 10:a.setSeconds(Math.round(a.getSeconds()/5)*5);a.setMilliseconds(0);break;case 5:a.setMilliseconds(Math.round(a.getMilliseconds()/1000)*1000);break;default:a.setMilliseconds(Math.round(a.getMilliseconds()/500)*500);break}}else{if(this.scale==links.Timeline.StepDate.SCALE.MILLISECOND){var c=this.step>5?this.step/2:1;a.setMilliseconds(Math.round(a.getMilliseconds()/c)*c)}}}}}}}};links.Timeline.StepDate.prototype.isMajor=function(){switch(this.scale){case links.Timeline.StepDate.SCALE.MILLISECOND:return(this.current.getMilliseconds()==0);case links.Timeline.StepDate.SCALE.SECOND:return(this.current.getSeconds()==0);case links.Timeline.StepDate.SCALE.MINUTE:return(this.current.getHours()==0)&&(this.current.getMinutes()==0);case links.Timeline.StepDate.SCALE.HOUR:return(this.current.getHours()==0);case links.Timeline.StepDate.SCALE.WEEKDAY:case links.Timeline.StepDate.SCALE.DAY:return(this.current.getDate()==1);case links.Timeline.StepDate.SCALE.MONTH:return(this.current.getMonth()==0);case links.Timeline.StepDate.SCALE.YEAR:return false;default:return false}};links.Timeline.StepDate.prototype.getLabelMinor=function(b,a){if(a==undefined){a=this.current}switch(this.scale){case links.Timeline.StepDate.SCALE.MILLISECOND:return String(a.getMilliseconds());case links.Timeline.StepDate.SCALE.SECOND:return String(a.getSeconds());case links.Timeline.StepDate.SCALE.MINUTE:return this.addZeros(a.getHours(),2)+":"+this.addZeros(a.getMinutes(),2);case links.Timeline.StepDate.SCALE.HOUR:return this.addZeros(a.getHours(),2)+":"+this.addZeros(a.getMinutes(),2);case links.Timeline.StepDate.SCALE.WEEKDAY:return b.DAYS_SHORT[a.getDay()]+" "+a.getDate();case links.Timeline.StepDate.SCALE.DAY:return String(a.getDate());case links.Timeline.StepDate.SCALE.MONTH:return b.MONTHS_SHORT[a.getMonth()];case links.Timeline.StepDate.SCALE.YEAR:return String(a.getFullYear());default:return""}};links.Timeline.StepDate.prototype.getLabelMajor=function(b,a){if(a==undefined){a=this.current}switch(this.scale){case links.Timeline.StepDate.SCALE.MILLISECOND:return this.addZeros(a.getHours(),2)+":"+this.addZeros(a.getMinutes(),2)+":"+this.addZeros(a.getSeconds(),2);case links.Timeline.StepDate.SCALE.SECOND:return a.getDate()+" "+b.MONTHS[a.getMonth()]+" "+this.addZeros(a.getHours(),2)+":"+this.addZeros(a.getMinutes(),2);case links.Timeline.StepDate.SCALE.MINUTE:return b.DAYS[a.getDay()]+" "+a.getDate()+" "+b.MONTHS[a.getMonth()]+" "+a.getFullYear();case links.Timeline.StepDate.SCALE.HOUR:return b.DAYS[a.getDay()]+" "+a.getDate()+" "+b.MONTHS[a.getMonth()]+" "+a.getFullYear();case links.Timeline.StepDate.SCALE.WEEKDAY:case links.Timeline.StepDate.SCALE.DAY:return b.MONTHS[a.getMonth()]+" "+a.getFullYear();case links.Timeline.StepDate.SCALE.MONTH:return String(a.getFullYear());default:return""}};links.Timeline.StepDate.prototype.addZeros=function(b,a){var c=""+b;while(c.length=0){d="DOMMouseScroll"}b.addEventListener(d,c,a)}else{b.attachEvent("on"+d,c)}};links.Timeline.removeEventListener=function(b,d,c,a){if(b.removeEventListener){if(a===undefined){a=false}if(d==="mousewheel"&&navigator.userAgent.indexOf("Firefox")>=0){d="DOMMouseScroll"}b.removeEventListener(d,c,a)}else{b.detachEvent("on"+d,c)}};links.Timeline.getTarget=function(a){if(!a){a=window.event}var b;if(a.target){b=a.target}else{if(a.srcElement){b=a.srcElement}}if(b.nodeType!=undefined&&b.nodeType==3){b=b.parentNode}return b};links.Timeline.stopPropagation=function(a){if(!a){a=window.event}if(a.stopPropagation){a.stopPropagation()}else{a.cancelBubble=true}};links.Timeline.preventDefault=function(a){if(!a){a=window.event}if(a.preventDefault){a.preventDefault()}else{a.returnValue=false}};links.Timeline.getAbsoluteLeft=function(b){var f=document.documentElement;var a=document.body;var d=b.offsetLeft;var c=b.offsetParent;while(c!=null&&c!=a&&c!=f){d+=c.offsetLeft;d-=c.scrollLeft;c=c.offsetParent}return d};links.Timeline.getAbsoluteTop=function(b){var f=document.documentElement;var a=document.body;var d=b.offsetTop;var c=b.offsetParent;while(c!=null&&c!=a&&c!=f){d+=c.offsetTop;d-=c.scrollTop;c=c.offsetParent}return d};links.Timeline.getPageY=function(c){if("pageY" in c){return c.pageY}else{var b;if(("targetTouches" in c)&&c.targetTouches.length){b=c.targetTouches[0].clientY}else{b=c.clientY}var d=document.documentElement;var a=document.body;return b+(d&&d.scrollTop||a&&a.scrollTop||0)-(d&&d.clientTop||a&&a.clientTop||0)}};links.Timeline.getPageX=function(c){if("pageY" in c){return c.pageX}else{var b;if(("targetTouches" in c)&&c.targetTouches.length){b=c.targetTouches[0].clientX}else{b=c.clientX}var d=document.documentElement;var a=document.body;return b+(d&&d.scrollLeft||a&&a.scrollLeft||0)-(d&&d.clientLeft||a&&a.clientLeft||0)}};links.Timeline.addClassName=function(c,b){var a=c.className.split(" ");if(a.indexOf(b)==-1){a.push(b);c.className=a.join(" ")}};links.Timeline.removeClassName=function(d,c){var b=d.className.split(" ");var a=b.indexOf(c);if(a!=-1){b.splice(a,1);d.className=b.join(" ")}};links.Timeline.isArray=function(a){if(a instanceof Array){return true}return(Object.prototype.toString.call(a)==="[object Array]")};links.Timeline.parseJSONDate=function(b){if(b==undefined){return undefined}if(b instanceof Date){return b}var a=b.match(/\/Date\((-?\d+)([-\+]?\d{2})?(\d{2})?\)\//i);if(a){var c=a[2]?(3600000*a[2])+(60000*a[3]*(a[2]/Math.abs(a[2]))):0;return new Date((1*a[1])+c)}return Date.parse(b)}; \ No newline at end of file +/** + * @file timeline.js + * + * @brief + * The Timeline is an interactive visualization chart to visualize events in + * time, having a start and end date. + * You can freely move and zoom in the timeline by dragging + * and scrolling in the Timeline. Items are optionally dragable. The time + * scale on the axis is adjusted automatically, and supports scales ranging + * from milliseconds to years. + * + * Timeline is part of the CHAP Links library. + * + * Timeline is tested on Firefox 3.6, Safari 5.0, Chrome 6.0, Opera 10.6, and + * Internet Explorer 6+. + * + * @license + * Licensed under the Apache License, Version 2.0 (the "License"); you may not + * use this file except in compliance with the License. You may obtain a copy + * of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations under + * the License. + * + * Copyright (c) 2011-2013 Almende B.V. + * + * @author Jos de Jong, + * @date 2013-04-18 + * @version 2.4.2 + */if(typeof links==="undefined"){links={}}if(typeof google==="undefined"){google=undefined}if(!Array.prototype.indexOf){Array.prototype.indexOf=function(b){for(var a=0;a0){d.addRows(g)}var f=links.Timeline.mapColumnIds(d);for(a in j){if(j.hasOwnProperty(a)){var b=f[a];if(b==undefined){var h=j[a];var c="string";if(typeof(h)=="number"){c="number"}else{if(typeof(h)=="boolean"){c="boolean"}else{if(h instanceof Date){c="datetime"}}}b=d.addColumn(c,a)}d.setValue(e,b,j[a])}}}else{if(links.Timeline.isArray(d)){var k=d[e];if(k==undefined){k={};d[e]=k}for(a in j){if(j.hasOwnProperty(a)){k[a]=j[a]}}}else{throw"Cannot update data, unknown type of data"}}};links.Timeline.prototype.getItemIndex=function(f){var g=f,j=this.dom,h=j.items.frame,b=this.items,c=undefined;while(g.parentNode&&g.parentNode!==h){g=g.parentNode}if(g.parentNode===h){for(var d=0,a=b.length;da.valueOf()){b=new Date(a.valueOf())}this.applyRange(f,b);if(e==undefined||e==true){this.render({animate:false})}else{this.recalcConversion()}};links.Timeline.prototype.setVisibleChartRangeAuto=function(){var a=this.getDataRange(true);this.setVisibleChartRange(a.min,a.max)};links.Timeline.prototype.setVisibleChartRangeNow=function(){var a=new Date();var b=(this.end.valueOf()-this.start.valueOf());var d=new Date(a.valueOf()-b/2);var c=new Date(d.valueOf()+b);this.setVisibleChartRange(d,c)};links.Timeline.prototype.getVisibleChartRange=function(){return{start:new Date(this.start.valueOf()),end:new Date(this.end.valueOf())}};links.Timeline.prototype.getDataRange=function(b){var g=this.items,d=undefined,h=undefined;if(g){for(var f=0,e=g.length;f0){this.render({animate:j?j.animate:undefined,renderTimesLeft:(c-1)})}}};links.Timeline.prototype.repaint=function(){var b=this.repaintFrame();var a=this.repaintAxis();var d=this.repaintGroups();var c=this.repaintItems();this.repaintCurrentTime();this.repaintCustomTime();return(b||a||d||c)};links.Timeline.prototype.reflowFrame=function(){var f=this.dom,d=this.options,e=this.size,b=false;var a=f.frame?f.frame.offsetWidth:0,c=f.frame?f.frame.clientHeight:0;b=b||(e.frameWidth!==a);b=b||(e.frameHeight!==c);e.frameWidth=a;e.frameHeight=c;return b};links.Timeline.prototype.repaintFrame=function(){var b=false,d=this.dom,j=this.options,h=this.size;if(!d.frame){d.frame=document.createElement("DIV");d.frame.className="timeline-frame";d.frame.style.position="relative";d.frame.style.overflow="hidden";d.container.appendChild(d.frame);b=true}var g=j.autoHeight?(h.actualHeight+"px"):(j.height||"100%");var a=j.width||"100%";b=b||(d.frame.style.height!=g);b=b||(d.frame.style.width!=a);d.frame.style.height=g;d.frame.style.width=a;if(!d.content){d.content=document.createElement("DIV");d.content.style.position="relative";d.content.style.overflow="hidden";d.frame.appendChild(d.content);var e=document.createElement("DIV");e.style.position="absolute";e.style.left="0px";e.style.top="0px";e.style.height="100%";e.style.width="0px";d.content.appendChild(e);d.contentTimelines=e;var c=this.eventParams,f=this;if(!c.onMouseDown){c.onMouseDown=function(k){f.onMouseDown(k)};links.Timeline.addEventListener(d.content,"mousedown",c.onMouseDown)}if(!c.onTouchStart){c.onTouchStart=function(k){f.onTouchStart(k)};links.Timeline.addEventListener(d.content,"touchstart",c.onTouchStart)}if(!c.onMouseWheel){c.onMouseWheel=function(k){f.onMouseWheel(k)};links.Timeline.addEventListener(d.content,"mousewheel",c.onMouseWheel)}if(!c.onDblClick){c.onDblClick=function(k){f.onDblClick(k)};links.Timeline.addEventListener(d.content,"dblclick",c.onDblClick)}b=true}d.content.style.left=h.contentLeft+"px";d.content.style.top="0px";d.content.style.width=h.contentWidth+"px";d.content.style.height=h.frameHeight+"px";this.repaintNavigation();return b};links.Timeline.prototype.reflowAxis=function(){var h=false,g=this.dom,n=this.options,m=this.size,k=g.axis;var j=(k&&k.characterMinor)?k.characterMinor.clientWidth:0,f=(k&&k.characterMinor)?k.characterMinor.clientHeight:0,b=(k&&k.characterMajor)?k.characterMajor.clientWidth:0,e=(k&&k.characterMajor)?k.characterMajor.clientHeight:0,d=(n.showMinorLabels?f:0)+(n.showMajorLabels?e:0);var a=n.axisOnTop?0:m.frameHeight-d,c=n.axisOnTop?d:a;h=h||(m.axis.top!==a);h=h||(m.axis.line!==c);h=h||(m.axis.height!==d);m.axis.top=a;m.axis.line=c;m.axis.height=d;m.axis.labelMajorTop=n.axisOnTop?0:c+(n.showMinorLabels?f:0);m.axis.labelMinorTop=n.axisOnTop?(n.showMajorLabels?e:0):c;m.axis.lineMinorTop=n.axisOnTop?m.axis.labelMinorTop:0;m.axis.lineMinorHeight=n.showMajorLabels?m.frameHeight-e:m.frameHeight;if(k&&k.minorLines&&k.minorLines.length){m.axis.lineMinorWidth=k.minorLines[0].offsetWidth}else{m.axis.lineMinorWidth=1}if(k&&k.majorLines&&k.majorLines.length){m.axis.lineMajorWidth=k.majorLines[0].offsetWidth}else{m.axis.lineMajorWidth=1}h=h||(m.axis.characterMinorWidth!==j);h=h||(m.axis.characterMinorHeight!==f);h=h||(m.axis.characterMajorWidth!==b);h=h||(m.axis.characterMajorHeight!==e);m.axis.characterMinorWidth=j;m.axis.characterMinorHeight=f;m.axis.characterMajorWidth=b;m.axis.characterMajorHeight=e;var l=Math.max(m.frameHeight-d,0);m.contentLeft=n.groupsOnRight?0:m.groupsWidth;m.contentWidth=Math.max(m.frameWidth-m.groupsWidth,0);m.contentHeight=l;return h};links.Timeline.prototype.repaintAxis=function(){var f=false,j=this.dom,r=this.options,q=this.size,e=this.step;var g=j.axis;if(!g){g={};j.axis=g}if(!q.axis.properties){q.axis.properties={}}if(!g.minorTexts){g.minorTexts=[]}if(!g.minorLines){g.minorLines=[]}if(!g.majorTexts){g.majorTexts=[]}if(!g.majorLines){g.majorLines=[]}if(!g.frame){g.frame=document.createElement("DIV");g.frame.style.position="absolute";g.frame.style.left="0px";g.frame.style.top="0px";j.content.appendChild(g.frame)}j.content.removeChild(g.frame);g.frame.style.width=(q.contentWidth)+"px";g.frame.style.height=(q.axis.height)+"px";var d=this.screenToTime(0);var h=this.screenToTime(q.contentWidth);if(q.axis.characterMinorWidth){this.minimumStep=this.screenToTime(q.axis.characterMinorWidth*6)-this.screenToTime(0);e.setRange(d,h,this.minimumStep)}var o=this.repaintAxisCharacters();f=f||o;this.repaintAxisStartOverwriting();e.start();var a=undefined;var l=0;while(!e.end()&&l<1000){l++;var p=e.getCurrent(),n=this.timeToScreen(p),k=e.isMajor();if(r.showMinorLabels){this.repaintAxisMinorText(n,e.getLabelMinor(r))}if(k&&r.showMajorLabels){if(n>0){if(a==undefined){a=n}this.repaintAxisMajorText(n,e.getLabelMajor(r))}this.repaintAxisMajorLine(n)}else{this.repaintAxisMinorLine(n)}e.next()}if(r.showMajorLabels){var c=this.screenToTime(0),m=this.step.getLabelMajor(r,c),b=m.length*q.axis.characterMajorWidth+10;if(a==undefined||be){var c=l[e];a.removeChild(c);l.splice(e,1)}var d=b.axis.minorLines;e=j.minorLineNum;while(d.length>e){var f=d[e];a.removeChild(f);d.splice(e,1)}var m=b.axis.majorTexts;e=j.majorTextNum;while(m.length>e){var h=m[e];a.removeChild(h);m.splice(e,1)}var g=b.axis.majorLines;e=j.majorLineNum;while(g.length>e){var k=g[e];a.removeChild(k);g.splice(e,1)}};links.Timeline.prototype.repaintAxisHorizontal=function(){var e=this.dom.axis,d=this.size,c=this.options;var a=(c.showMinorLabels||c.showMajorLabels);if(a){if(!e.backgroundLine){var f=document.createElement("DIV");f.className="timeline-axis";f.style.position="absolute";f.style.left="0px";f.style.width="100%";f.style.border="none";e.frame.insertBefore(f,e.frame.firstChild);e.backgroundLine=f}if(e.backgroundLine){e.backgroundLine.style.top=d.axis.top+"px";e.backgroundLine.style.height=d.axis.height+"px"}}else{if(e.backgroundLine){e.frame.removeChild(e.backgroundLine);delete e.backgroundLine}}if(a){if(e.line){var b=e.frame.removeChild(e.line);e.frame.appendChild(b)}else{var b=document.createElement("DIV");b.className="timeline-axis";b.style.position="absolute";b.style.left="0px";b.style.width="100%";b.style.height="0px";e.frame.appendChild(b);e.line=b}e.line.style.top=d.axis.line+"px"}else{if(e.line&&e.line.parentElement){e.frame.removeChild(e.line);delete e.line}}};links.Timeline.prototype.repaintAxisMinorText=function(h,j){var k=this.size,b=this.dom,e=k.axis.properties,a=b.axis.frame,g=b.axis.minorTexts,c=e.minorTextNum,f;if(c0)||(j.update.length>0)||(j.hide.length>0);while(n=j.show.shift()){n.showDOM(a);n.getImageUrls(c);b.push(n)}while(n=j.update.shift()){n.updateDOM(a);n.getImageUrls(c);k=this.renderedItems.indexOf(n);if(k==-1){b.push(n)}}while(n=j.hide.shift()){n.hideDOM(a);k=this.renderedItems.indexOf(n);if(k!=-1){b.splice(k,1)}}b.forEach(function(p){p.updatePosition(m)});this.repaintDeleteButton();this.repaintDragAreas();f.content.appendChild(a);if(c.length){var l=function(){m.render()};var e=false;links.imageloader.loadAll(c,l,e)}return d};links.Timeline.prototype.reflowGroups=function(){var f=false,m=this.options,l=this.size,d=this.dom;var j=0;var b=this.groups;var g=this.dom.groups?this.dom.groups.labels:[];for(var e=0,c=b.length;e-k.contentWidth&&h<2*k.contentWidth);e.currentTime.style.display=d?"":"none";e.currentTime.style.left=h+"px";e.currentTime.title="Current time: "+f;if(this.currentTimeTimer!=undefined){clearTimeout(this.currentTimeTimer);delete this.currentTimeTimer}var j=this;var g=function(){j.repaintCurrentTime()};var c=1/this.conversion.factor/2;if(c<30){c=30}this.currentTimeTimer=setTimeout(g,c)};links.Timeline.prototype.repaintCustomTime=function(){var c=this.options,g=this.dom,d=this.size;if(!c.showCustomTime){if(g.customTime){g.contentTimelines.removeChild(g.customTime);delete g.customTime}return}if(!g.customTime){var b=document.createElement("DIV");b.className="timeline-customtime";b.style.position="absolute";b.style.top="0px";b.style.height="100%";var e=document.createElement("DIV");e.style.position="relative";e.style.top="0px";e.style.left="-10px";e.style.height="100%";e.style.width="20px";b.appendChild(e);g.contentTimelines.appendChild(b);g.customTime=b;this.customTime=new Date()}var a=this.timeToScreen(this.customTime),f=(a>-d.contentWidth&&a<2*d.contentWidth);g.customTime.style.display=f?"":"none";g.customTime.style.left=a+"px";g.customTime.title="Time: "+this.customTime};links.Timeline.prototype.repaintDeleteButton=function(){var d=this,g=this.dom,f=g.items.frame;var h=g.items.deleteButton;if(!h){h=document.createElement("DIV");h.className="timeline-navigation-delete";h.style.position="absolute";f.appendChild(h);g.items.deleteButton=h}var a=this.selection?this.selection.index:-1,c=this.selection?this.items[a]:undefined;if(c&&c.rendered&&this.isEditable(c)){var b=c.getRight(this),e=c.top;h.style.left=b+"px";h.style.top=e+"px";h.style.display="";f.removeChild(h);f.appendChild(h)}else{h.style.display="none"}};links.Timeline.prototype.repaintDragAreas=function(){var k=this,m=this.options,d=this.dom,a=this.dom.items.frame;var c=d.items.dragLeft;if(!c){c=document.createElement("DIV");c.className="timeline-event-range-drag-left";c.style.position="absolute";a.appendChild(c);d.items.dragLeft=c}var e=d.items.dragRight;if(!e){e=document.createElement("DIV");e.className="timeline-event-range-drag-right";e.style.position="absolute";a.appendChild(e);d.items.dragRight=e}var f=this.selection?this.selection.index:-1,l=this.selection?this.items[f]:undefined;if(l&&l.rendered&&this.isEditable(l)&&(l instanceof links.Timeline.ItemRange)){var b=this.timeToScreen(l.start),h=this.timeToScreen(l.end),g=l.top,j=l.height;c.style.left=b+"px";c.style.top=g+"px";c.style.width=m.dragAreaWidth+"px";c.style.height=j+"px";c.style.display="";a.removeChild(c);a.appendChild(c);e.style.left=(h-m.dragAreaWidth)+"px";e.style.top=g+"px";e.style.width=m.dragAreaWidth+"px";e.style.height=j+"px";e.style.display="";a.removeChild(e);a.appendChild(e)}else{c.style.display="none";e.style.display="none"}};links.Timeline.prototype.repaintNavigation=function(){var l=this,m=this.options,g=this.dom,e=g.frame,f=g.navBar;if(!f){var a=m.showButtonNew&&m.editable;var d=m.showNavigation&&(m.zoomable||m.moveable);if(d||a){f=document.createElement("DIV");f.style.position="absolute";f.className="timeline-navigation";if(m.groupsOnRight){f.style.left="10px"}else{f.style.right="10px"}if(m.axisOnTop){f.style.bottom="10px"}else{f.style.top="10px"}g.navBar=f;e.appendChild(f)}if(a){f.addButton=document.createElement("DIV");f.addButton.className="timeline-navigation-new";f.addButton.title=m.CREATE_NEW_EVENT;var j=function(o){links.Timeline.preventDefault(o);links.Timeline.stopPropagation(o);var t=l.size.contentWidth;var s=t/2;var v=l.screenToTime(s-t/10);var n=l.screenToTime(s+t/10);if(m.snapEvents){l.step.snap(v);l.step.snap(n)}var q=m.NEW;var u=l.groups.length?l.groups[0].content:undefined;var r=true;l.addItem({start:v,end:n,content:q,group:u},r);var p=(l.items.length-1);l.selectItem(p);l.applyAdd=true;l.trigger("add");if(l.applyAdd){l.render({animate:false});l.selectItem(p)}else{l.deleteItem(p)}};links.Timeline.addEventListener(f.addButton,"mousedown",j);f.appendChild(f.addButton)}if(a&&d){f.addButton.style.borderRightWidth="1px";f.addButton.style.borderRightStyle="solid"}if(d){if(m.zoomable){f.zoomInButton=document.createElement("DIV");f.zoomInButton.className="timeline-navigation-zoom-in";f.zoomInButton.title=this.options.ZOOM_IN;var c=function(n){links.Timeline.preventDefault(n);links.Timeline.stopPropagation(n);l.zoom(0.4);l.trigger("rangechange");l.trigger("rangechanged")};links.Timeline.addEventListener(f.zoomInButton,"mousedown",c);f.appendChild(f.zoomInButton);f.zoomOutButton=document.createElement("DIV");f.zoomOutButton.className="timeline-navigation-zoom-out";f.zoomOutButton.title=this.options.ZOOM_OUT;var h=function(n){links.Timeline.preventDefault(n);links.Timeline.stopPropagation(n);l.zoom(-0.4);l.trigger("rangechange");l.trigger("rangechanged")};links.Timeline.addEventListener(f.zoomOutButton,"mousedown",h);f.appendChild(f.zoomOutButton)}if(m.moveable){f.moveLeftButton=document.createElement("DIV");f.moveLeftButton.className="timeline-navigation-move-left";f.moveLeftButton.title=this.options.MOVE_LEFT;var k=function(n){links.Timeline.preventDefault(n);links.Timeline.stopPropagation(n);l.move(-0.2);l.trigger("rangechange");l.trigger("rangechanged")};links.Timeline.addEventListener(f.moveLeftButton,"mousedown",k);f.appendChild(f.moveLeftButton);f.moveRightButton=document.createElement("DIV");f.moveRightButton.className="timeline-navigation-move-right";f.moveRightButton.title=this.options.MOVE_RIGHT;var b=function(n){links.Timeline.preventDefault(n);links.Timeline.stopPropagation(n);l.move(0.2);l.trigger("rangechange");l.trigger("rangechanged")};links.Timeline.addEventListener(f.moveRightButton,"mousedown",b);f.appendChild(f.moveRightButton)}}}};links.Timeline.prototype.setCurrentTime=function(b){var a=new Date();this.clientTimeOffset=(b.valueOf()-a.valueOf());this.repaintCurrentTime()};links.Timeline.prototype.getCurrentTime=function(){var a=new Date();return new Date(a.valueOf()+this.clientTimeOffset)};links.Timeline.prototype.setCustomTime=function(a){this.customTime=new Date(a.valueOf());this.repaintCustomTime()};links.Timeline.prototype.getCustomTime=function(){return new Date(this.customTime.valueOf())};links.Timeline.prototype.setScale=function(b,a){this.step.setScale(b,a);this.render()};links.Timeline.prototype.setAutoScale=function(a){this.step.setAutoScale(a);this.render()};links.Timeline.prototype.redraw=function(){this.setData(this.data)};links.Timeline.prototype.checkResize=function(){this.render()};links.Timeline.prototype.isEditable=function(a){if(a){if(a.editable!=undefined){return a.editable}else{return this.options.editable}}return false};links.Timeline.prototype.recalcConversion=function(){this.conversion.offset=this.start.valueOf();this.conversion.factor=this.size.contentWidth/(this.end.valueOf()-this.start.valueOf())};links.Timeline.prototype.screenToTime=function(a){var b=this.conversion;return new Date(a/b.factor+b.offset)};links.Timeline.prototype.timeToScreen=function(b){var a=this.conversion;return(b.valueOf()-a.offset)*a.factor};links.Timeline.prototype.onTouchStart=function(c){var e=this.eventParams,b=this;if(e.touchDown){return}e.touchDown=true;e.zoomed=false;this.onMouseDown(c);if(!e.onTouchMove){e.onTouchMove=function(f){b.onTouchMove(f)};links.Timeline.addEventListener(document,"touchmove",e.onTouchMove)}if(!e.onTouchEnd){e.onTouchEnd=function(f){b.onTouchEnd(f)};links.Timeline.addEventListener(document,"touchend",e.onTouchEnd)}var d=links.Timeline.getTarget(c);var a=this.getItemIndex(d);e.doubleTapStartPrev=e.doubleTapStart;e.doubleTapStart=(new Date()).valueOf();e.doubleTapItemPrev=e.doubleTapItem;e.doubleTapItem=a;links.Timeline.preventDefault(c)};links.Timeline.prototype.onTouchMove=function(d){var g=this.eventParams;if(d.scale&&d.scale!==1){g.zoomed=true}if(!g.zoomed){this.onMouseMove(d)}else{if(this.options.zoomable){g.zoomed=true;var f=d.scale,b=(g.end.valueOf()-g.start.valueOf()),c=b/f,e=c-b,h=new Date(parseInt(g.start.valueOf()-e/2)),a=new Date(parseInt(g.end.valueOf()+e/2));this.setVisibleChartRange(h,a);this.trigger("rangechange")}}links.Timeline.preventDefault(d)};links.Timeline.prototype.onTouchEnd=function(d){var f=this.eventParams;var c=this;f.touchDown=false;if(f.zoomed){this.trigger("rangechanged")}if(f.onTouchMove){links.Timeline.removeEventListener(document,"touchmove",f.onTouchMove);delete f.onTouchMove}if(f.onTouchEnd){links.Timeline.removeEventListener(document,"touchend",f.onTouchEnd);delete f.onTouchEnd}this.onMouseUp(d);var g=500;var a=(new Date()).valueOf();var e=links.Timeline.getTarget(d);var b=this.getItemIndex(e);if(f.doubleTapStartPrev&&(a-f.doubleTapStartPrev)=1){D.moved=true}if(D.customTime){var o=this.timeToScreen(D.customTime);var q=o+t;this.customTime=this.screenToTime(q);this.repaintCustomTime();this.trigger("timechange")}else{if(D.editItem){var B=this.items[D.itemIndex],f,C;if(D.itemDragLeft){f=D.itemLeft+t;C=D.itemRight;B.start=this.screenToTime(f);if(e.snapEvents){this.step.snap(B.start);f=this.timeToScreen(B.start)}if(f>C){f=C;B.start=this.screenToTime(f)}}else{if(D.itemDragRight){f=D.itemLeft;C=D.itemRight+t;B.end=this.screenToTime(C);if(e.snapEvents){this.step.snap(B.end);C=this.timeToScreen(B.end)}if(C=1){g=0.9}if(g<=-1){g=-0.9}if(g<0){g=g/(1+g)}var e=(this.start.valueOf()-h);var d=(this.end.valueOf()-h);var a=new Date(this.start.valueOf()-e*g);var f=new Date(this.end.valueOf()-d*g);var c=(f.valueOf()-a.valueOf());var b=Number(this.options.zoomMin)||10;if(b<10){b=10}if(c>=b){this.applyRange(a,f,h);this.render({animate:this.options.animate&&this.options.animateZoom})}};links.Timeline.prototype.move=function(b){var d=(this.end.valueOf()-this.start.valueOf());var a=new Date(this.start.valueOf()+d*b);var c=new Date(this.end.valueOf()+d*b);this.applyRange(a,c);this.render()};links.Timeline.prototype.applyRange=function(b,e,a){var c=b.valueOf();var n=e.valueOf();var d=(n-c);var q=this.options;var k=1000*60*60*24*365;var h=Number(q.zoomMin)||10;if(h<10){h=10}var p=Number(q.zoomMax)||10000*k;if(p>10000*k){p=10000*k}if(p=m){var l=1000*60*60*24;m=g+l}if(p>(m-g)){p=(m-g)}if(h>(m-g)){h=(m-g)}}if(c>=n){n+=1000*60*60*24}if(dp){var o=(d-p);var j=a?(a.valueOf()-c)/d:0.5;c+=Math.round(o*j);n-=Math.round(o*(1-j))}if(g!=undefined){var o=(c-g);if(o<0){c-=o;n-=o}}if(m!=undefined){var o=(m-n);if(o<0){c+=o;n+=o}}this.start=new Date(c);this.end=new Date(n)};links.Timeline.prototype.confirmDeleteItem=function(a){this.applyDelete=true;if(!this.isSelected(a)){this.selectItem(a)}this.trigger("delete");if(this.applyDelete){this.deleteItem(a)}delete this.applyDelete};links.Timeline.prototype.deleteItem=function(a,c){if(a>=this.items.length){throw"Cannot delete row, index out of range"}if(this.selection){if(this.selection.index==a){this.unselectItem()}else{if(this.selection.index>a){this.selection.index--}}}var b=this.items.splice(a,1)[0];this.renderQueue.hide.push(b);if(this.data){if(google&&google.visualization&&this.data instanceof google.visualization.DataTable){this.data.removeRow(a)}else{if(links.Timeline.isArray(this.data)){this.data.splice(a,1)}else{throw"Cannot delete row from data, unknown data type"}}}if(this.options.cluster){this.clusterGenerator.updateData()}if(!c){this.render()}};links.Timeline.prototype.deleteAllItems=function(){this.unselectItem();this.clearItems();this.deleteGroups();if(this.data){if(google&&google.visualization&&this.data instanceof google.visualization.DataTable){this.data.removeRows(0,this.data.getNumberOfRows())}else{if(links.Timeline.isArray(this.data)){this.data.splice(0,this.data.length)}else{throw"Cannot delete row from data, unknown data type"}}}if(this.options.cluster){this.clusterGenerator.updateData()}this.render()};links.Timeline.prototype.getGroupFromHeight=function(b){var c,d,a=this.groups;if(a.length){if(this.options.axisOnTop){for(c=a.length-1;c>=0;c--){d=a[c];if(b>d.top){return d}}}else{for(c=0;cd.top){return d}}}return d}return undefined};links.Timeline.Item=function(c,a){if(c){this.start=c.start;this.end=c.end;this.content=c.content;this.className=c.className;this.editable=c.editable;this.group=c.group}this.top=0;this.left=0;this.width=0;this.height=0;this.lineWidth=0;this.dotWidth=0;this.dotHeight=0;this.rendered=false;if(a){for(var b in a){if(a.hasOwnProperty(b)){this[b]=a[b]}}}};links.Timeline.Item.prototype.reflow=function(){return false};links.Timeline.Item.prototype.getImageUrls=function(a){if(this.dom){links.imageloader.filterImageUrls(this.dom,a)}};links.Timeline.Item.prototype.select=function(){};links.Timeline.Item.prototype.unselect=function(){};links.Timeline.Item.prototype.createDOM=function(){};links.Timeline.Item.prototype.showDOM=function(a){};links.Timeline.Item.prototype.hideDOM=function(a){};links.Timeline.Item.prototype.updateDOM=function(){};links.Timeline.Item.prototype.updatePosition=function(a){};links.Timeline.Item.prototype.isRendered=function(){return this.rendered};links.Timeline.Item.prototype.isVisible=function(b,a){return false};links.Timeline.Item.prototype.setPosition=function(b,a){};links.Timeline.Item.prototype.getRight=function(a){return 0};links.Timeline.Item.prototype.getWidth=function(a){return this.width||0};links.Timeline.ItemBox=function(b,a){links.Timeline.Item.call(this,b,a)};links.Timeline.ItemBox.prototype=new links.Timeline.Item();links.Timeline.ItemBox.prototype.reflow=function(){var e=this.dom,c=e.dot.offsetHeight,d=e.dot.offsetWidth,a=e.line.offsetWidth,b=((this.dotHeight!=c)||(this.dotWidth!=d)||(this.lineWidth!=a));this.dotHeight=c;this.dotWidth=d;this.lineWidth=a;return b};links.Timeline.ItemBox.prototype.select=function(){var a=this.dom;links.Timeline.addClassName(a,"timeline-event-selected");links.Timeline.addClassName(a.line,"timeline-event-selected");links.Timeline.addClassName(a.dot,"timeline-event-selected")};links.Timeline.ItemBox.prototype.unselect=function(){var a=this.dom;links.Timeline.removeClassName(a,"timeline-event-selected");links.Timeline.removeClassName(a.line,"timeline-event-selected");links.Timeline.removeClassName(a.dot,"timeline-event-selected")};links.Timeline.ItemBox.prototype.createDOM=function(){var c=document.createElement("DIV");c.style.position="absolute";c.style.left=this.left+"px";c.style.top=this.top+"px";var b=document.createElement("DIV");b.className="timeline-event-content";b.innerHTML=this.content;c.appendChild(b);var d=document.createElement("DIV");d.style.position="absolute";d.style.width="0px";c.line=d;var a=document.createElement("DIV");a.style.position="absolute";a.style.width="0px";a.style.height="0px";c.dot=a;this.dom=c;this.updateDOM();return c};links.Timeline.ItemBox.prototype.showDOM=function(a){var b=this.dom;if(!b){b=this.createDOM()}if(b.parentNode!=a){if(b.parentNode){this.hideDOM()}a.appendChild(b);a.insertBefore(b.line,a.firstChild);a.appendChild(b.dot);this.rendered=true}};links.Timeline.ItemBox.prototype.hideDOM=function(){var a=this.dom;if(a){if(a.parentNode){a.parentNode.removeChild(a)}if(a.line&&a.line.parentNode){a.line.parentNode.removeChild(a.line)}if(a.dot&&a.dot.parentNode){a.dot.parentNode.removeChild(a.dot)}this.rendered=false}};links.Timeline.ItemBox.prototype.updateDOM=function(){var b=this.dom;if(b){var c=b.line;var a=b.dot;b.firstChild.innerHTML=this.content;b.className="timeline-event timeline-event-box";c.className="timeline-event timeline-event-line";a.className="timeline-event timeline-event-dot";if(this.isCluster){links.Timeline.addClassName(b,"timeline-event-cluster");links.Timeline.addClassName(c,"timeline-event-cluster");links.Timeline.addClassName(a,"timeline-event-cluster")}if(this.className){links.Timeline.addClassName(b,this.className);links.Timeline.addClassName(c,this.className);links.Timeline.addClassName(a,this.className)}}};links.Timeline.ItemBox.prototype.updatePosition=function(g){var e=this.dom;if(e){var c=g.timeToScreen(this.start),f=g.options.axisOnTop,a=g.size.axis.top,d=g.size.axis.height,h=(g.options.box&&g.options.box.align)?g.options.box.align:undefined;e.style.top=this.top+"px";if(h=="right"){e.style.left=(c-this.width)+"px"}else{if(h=="left"){e.style.left=(c)+"px"}else{e.style.left=(c-this.width/2)+"px"}}var j=e.line;var b=e.dot;j.style.left=(c-this.lineWidth/2)+"px";b.style.left=(c-this.dotWidth/2)+"px";if(f){j.style.top=d+"px";j.style.height=Math.max(this.top-d,0)+"px";b.style.top=(d-this.dotHeight/2)+"px"}else{j.style.top=(this.top+this.height)+"px";j.style.height=Math.max(a-this.top-this.height,0)+"px";b.style.top=(a-this.dotHeight/2)+"px"}}};links.Timeline.ItemBox.prototype.isVisible=function(b,a){if(this.cluster){return false}return(this.start>b)&&(this.start2*a){b=2*a}e.style.top=this.top+"px";e.style.left=d+"px";e.style.width=Math.max(b-d,1)+"px"}};links.Timeline.ItemRange.prototype.isVisible=function(b,a){if(this.cluster){return false}return(this.end>b)&&(this.startb)&&(this.start=this.items.length){throw"Cannot get item, index out of range"}var c=this.items[a];var b={};b.start=new Date(c.start.valueOf());if(c.end){b.end=new Date(c.end.valueOf())}b.content=c.content;if(c.group){b.group=this.getGroupName(c.group)}if("className" in c){b.className=this.getGroupName(c.className)}if(c.hasOwnProperty("editable")&&(typeof c.editable!="undefined")){b.editable=c.editable}return b};links.Timeline.prototype.addItem=function(a,b){var c=[a];this.addItems(c,b)};links.Timeline.prototype.addItems=function(d,c){var b=this,a=this.items;d.forEach(function(e){var f=a.length;a.push(b.createItem(e));b.updateData(f,e)});if(this.options.cluster){this.clusterGenerator.updateData()}if(!c){this.render({animate:false})}};links.Timeline.prototype.createItem=function(a){var c=a.end?"range":this.options.style;var e={start:a.start,end:a.end,content:a.content,className:a.className,editable:a.editable,group:this.getGroup(a.group)};var d,b=this.options;if(b.axisOnTop){d=this.size.axis.height+b.eventMarginAxis+b.eventMargin/2}else{d=this.size.contentHeight-b.eventMarginAxis-b.eventMargin/2}if(c in this.itemTypes){return new this.itemTypes[c](e,{top:d})}console.log('ERROR: Unknown event style "'+c+'"');return new links.Timeline.Item(e,{top:d})};links.Timeline.prototype.changeItem=function(b,a,d){var e=this.items[b];if(!e){throw"Cannot change item, index out of range"}var c=this.createItem({start:a.hasOwnProperty("start")?a.start:e.start,end:a.hasOwnProperty("end")?a.end:e.end,content:a.hasOwnProperty("content")?a.content:e.content,group:a.hasOwnProperty("group")?a.group:this.getGroupName(e.group),className:a.hasOwnProperty("className")?a.className:e.className,editable:a.hasOwnProperty("editable")?a.editable:e.editable});this.items[b]=c;this.renderQueue.hide.push(e);this.renderQueue.show.push(c);this.updateData(b,a);if(this.options.cluster){this.clusterGenerator.updateData()}if(!d){this.render({animate:false});c.select()}};links.Timeline.prototype.deleteGroups=function(){this.groups=[];this.groupIndexes={}};links.Timeline.prototype.getGroup=function(g){var b=this.groups,c=this.groupIndexes,e=undefined;var f=c[g];if(f==undefined&&g!=undefined){e={content:g,labelTop:0,lineTop:0};b.push(e);for(var d=0,a=b.length;d0){if(g[0].row!=undefined){var e=g[0].row;if(this.items[e]){var h=this.items[e];this.selectItem(e);var a=h.start;var c=h.end;var j;if(c!=undefined){j=(c.valueOf()+a.valueOf())/2}else{j=a.valueOf()}var f=(this.end.valueOf()-this.start.valueOf()),d=new Date(j-f/2),b=new Date(j+f/2);this.setVisibleChartRange(d,b);return true}}}else{this.unselectItem()}return false};links.Timeline.prototype.getSelection=function(){var a=[];if(this.selection){a.push({row:this.selection.index})}return a};links.Timeline.prototype.selectItem=function(a){this.unselectItem();this.selection=undefined;if(this.items[a]!=undefined){var c=this.items[a],b=c.dom;this.selection={index:a};if(c&&c.dom){if(this.isEditable(c)){c.dom.style.cursor="move"}c.select()}this.repaintDeleteButton();this.repaintDragAreas()}};links.Timeline.prototype.isSelected=function(a){return(this.selection&&this.selection.index==a)};links.Timeline.prototype.unselectItem=function(){if(this.selection){var b=this.items[this.selection.index];if(b&&b.dom){var a=b.dom;a.style.cursor="";b.unselect()}this.selection=undefined;this.repaintDeleteButton();this.repaintDragAreas()}};links.Timeline.prototype.stackItems=function(b){if(this.groups.length>0){return}if(b==undefined){b=false}var a=this.stack;if(!a){a={};this.stack=a}a.sortedItems=this.stackOrder(this.renderedItems);a.finalItems=this.stackCalculateFinal(a.sortedItems);if(b||a.timer){var d=this;var c=function(){var e=d.stackMoveOneStep(a.sortedItems,a.finalItems);d.repaint();if(!e){a.timer=setTimeout(c,30)}else{delete a.timer}};if(!a.timer){a.timer=setTimeout(c,30)}}else{this.stackMoveToFinal(a.sortedItems,a.finalItems)}};links.Timeline.prototype.stackCancelAnimation=function(){if(this.stack&&this.stack.timer){clearTimeout(this.stack.timer);delete this.stack.timer}};links.Timeline.prototype.stackOrder=function(a){var c=a.concat([]);var b=this.options.customStackOrder&&(typeof this.options.customStackOrder==="function")?this.options.customStackOrder:function(e,d){if((e instanceof links.Timeline.ItemRange)&&!(d instanceof links.Timeline.ItemRange)){return -1}if(!(e instanceof links.Timeline.ItemRange)&&(d instanceof links.Timeline.ItemRange)){return 1}return(e.left-d.left)};c.sort(b);return c};links.Timeline.prototype.stackCalculateFinal=function(l){var p,o,j=this.size,d=j.axis.top,g=j.axis.height,a=this.options,t=a.axisOnTop,c=a.eventMargin,n=a.eventMarginAxis,f=[];for(p=0,o=l.length;ph)?1:-1);if(Math.abs(g)>4){a=g/4}var b=parseInt(h+a);if(b!=f){c=false}k.top=b;k.bottom=k.top+k.height}else{k.top=d.top;k.bottom=d.bottom}k.left=d.left;k.right=d.right}return c};links.Timeline.prototype.stackMoveToFinal=function(a,b){for(i=0,iMax=b.length;i=g;c--){var d=h[c];if(j(e,d,b)){if(c!=a){return d}}}return undefined};links.Timeline.prototype.collision=function(b,a,c){if(c==undefined){c=0}return(b.left-ca.left&&b.top-ca.top)};links.Timeline.prototype.trigger=function(b){var a=null;switch(b){case"rangechange":case"rangechanged":a={start:new Date(this.start.valueOf()),end:new Date(this.end.valueOf())};break;case"timechange":case"timechanged":a={time:new Date(this.customTime.valueOf())};break}links.events.trigger(this,b,a);if(google&&google.visualization){google.visualization.events.trigger(this,b,a)}};links.Timeline.prototype.clusterItems=function(){if(!this.options.cluster){return}var b=this.clusterGenerator.getClusters(this.conversion.factor);if(this.clusters!=b){var a=this.renderQueue;if(this.clusters){this.clusters.forEach(function(c){a.hide.push(c);c.items.forEach(function(d){d.cluster=undefined})})}b.forEach(function(c){c.items.forEach(function(d){d.cluster=c})});this.clusters=b}};links.Timeline.prototype.filterItems=function(){var a=this.renderQueue,d=(this.end-this.start),e=new Date(this.start.valueOf()-d),b=new Date(this.end.valueOf()+d);function c(f){f.forEach(function(g){var j=g.rendered;var h=g.isVisible(e,b);if(j!=h){if(j){a.hide.push(g)}if(h&&(a.show.indexOf(g)==-1)){a.show.push(g)}}})}c(this.items);if(this.clusters){c(this.clusters)}};links.Timeline.ClusterGenerator=function(a){this.timeline=a;this.clear()};links.Timeline.ClusterGenerator.prototype.clear=function(){this.items=[];this.groups={};this.clearCache()};links.Timeline.ClusterGenerator.prototype.clearCache=function(){this.cache={};this.cacheLevel=-1;this.cache[this.cacheLevel]=[]};links.Timeline.ClusterGenerator.prototype.setData=function(a,b){this.items=a||[];this.dataChanged=true;this.applyOnChangedLevel=true;if(b&&b.applyOnChangedLevel){this.applyOnChangedLevel=b.applyOnChangedLevel}};links.Timeline.ClusterGenerator.prototype.updateData=function(){this.dataChanged=true;this.applyOnChangedLevel=false};links.Timeline.ClusterGenerator.prototype.filterData=function(){var b=this.items||[];var a={};this.groups=a;b.forEach(function(d){var f=d.group?d.group.content:"";var e=a[f];if(!e){e=[];a[f]=e}e.push(d);if(d.start){if(d.end){d.center=(d.start.valueOf()+d.end.valueOf())/2}else{d.center=d.start.valueOf()}}});for(var c in a){if(a.hasOwnProperty(c)){a[c].sort(function(e,d){return(e.center-d.center)})}}this.dataChanged=false};links.Timeline.ClusterGenerator.prototype.getClusters=function(K){var a=-1,b=2,x=0,H=5;if(K>0){a=Math.round(Math.log(100/K)/Math.log(b));x=Math.pow(b,a);if(this.timeline.groups&&this.timeline.groups.length){x*=4}}if(this.dataChanged){var w=(a!=this.cacheLevel);var D=this.applyOnChangedLevel?w:true;if(D){this.clearCache();this.filterData()}}this.cacheLevel=a;var h=this.cache[a];if(!h){h=[];for(var q in this.groups){if(this.groups.hasOwnProperty(q)){var r=this.groups[q];var z=r.length;var G=0;while(G=0&&(J.center-r[E].center)=0&&(J.center-h[A].center)H){var n=v-H+1;var d=[];var t=undefined;var y=undefined;var F=undefined;var f=false;var g=0;var u=G;while(d.length'+g+" events";var o=J.group?J.group.content:undefined;if(f){I=this.timeline.createItem({start:new Date(y),end:new Date(F),content:B,group:o})}else{I=this.timeline.createItem({start:new Date(t),content:B,group:o})}I.isCluster=true;I.items=d;I.items.forEach(function(j){j.cluster=I});h.push(I);G+=n}else{delete J.cluster;G+=1}}}}this.cache[a]=h}return h};links.events=links.events||{listeners:[],indexOf:function(b){var d=this.listeners;for(var c=0,a=this.listeners.length;cthis._end.valueOf())};links.Timeline.StepDate.prototype.next=function(){var b=this.current.valueOf();if(this.current.getMonth()<6){switch(this.scale){case links.Timeline.StepDate.SCALE.MILLISECOND:this.current=new Date(this.current.valueOf()+this.step);break;case links.Timeline.StepDate.SCALE.SECOND:this.current=new Date(this.current.valueOf()+this.step*1000);break;case links.Timeline.StepDate.SCALE.MINUTE:this.current=new Date(this.current.valueOf()+this.step*1000*60);break;case links.Timeline.StepDate.SCALE.HOUR:this.current=new Date(this.current.valueOf()+this.step*1000*60*60);var a=this.current.getHours();this.current.setHours(a-(a%this.step));break;case links.Timeline.StepDate.SCALE.WEEKDAY:case links.Timeline.StepDate.SCALE.DAY:this.current.setDate(this.current.getDate()+this.step);break;case links.Timeline.StepDate.SCALE.MONTH:this.current.setMonth(this.current.getMonth()+this.step);break;case links.Timeline.StepDate.SCALE.YEAR:this.current.setFullYear(this.current.getFullYear()+this.step);break;default:break}}else{switch(this.scale){case links.Timeline.StepDate.SCALE.MILLISECOND:this.current=new Date(this.current.valueOf()+this.step);break;case links.Timeline.StepDate.SCALE.SECOND:this.current.setSeconds(this.current.getSeconds()+this.step);break;case links.Timeline.StepDate.SCALE.MINUTE:this.current.setMinutes(this.current.getMinutes()+this.step);break;case links.Timeline.StepDate.SCALE.HOUR:this.current.setHours(this.current.getHours()+this.step);break;case links.Timeline.StepDate.SCALE.WEEKDAY:case links.Timeline.StepDate.SCALE.DAY:this.current.setDate(this.current.getDate()+this.step);break;case links.Timeline.StepDate.SCALE.MONTH:this.current.setMonth(this.current.getMonth()+this.step);break;case links.Timeline.StepDate.SCALE.YEAR:this.current.setFullYear(this.current.getFullYear()+this.step);break;default:break}}if(this.step!=1){switch(this.scale){case links.Timeline.StepDate.SCALE.MILLISECOND:if(this.current.getMilliseconds()0){this.step=a}this.autoScale=false};links.Timeline.StepDate.prototype.setAutoScale=function(a){this.autoScale=a};links.Timeline.StepDate.prototype.setMinimumStep=function(f){if(f==undefined){return}var b=(1000*60*60*24*30*12);var a=(1000*60*60*24*30);var e=(1000*60*60*24);var g=(1000*60*60);var d=(1000*60);var h=(1000);var c=(1);if(b*1000>f){this.scale=links.Timeline.StepDate.SCALE.YEAR;this.step=1000}if(b*500>f){this.scale=links.Timeline.StepDate.SCALE.YEAR;this.step=500}if(b*100>f){this.scale=links.Timeline.StepDate.SCALE.YEAR;this.step=100}if(b*50>f){this.scale=links.Timeline.StepDate.SCALE.YEAR;this.step=50}if(b*10>f){this.scale=links.Timeline.StepDate.SCALE.YEAR;this.step=10}if(b*5>f){this.scale=links.Timeline.StepDate.SCALE.YEAR;this.step=5}if(b>f){this.scale=links.Timeline.StepDate.SCALE.YEAR;this.step=1}if(a*3>f){this.scale=links.Timeline.StepDate.SCALE.MONTH;this.step=3}if(a>f){this.scale=links.Timeline.StepDate.SCALE.MONTH;this.step=1}if(e*5>f){this.scale=links.Timeline.StepDate.SCALE.DAY;this.step=5}if(e*2>f){this.scale=links.Timeline.StepDate.SCALE.DAY;this.step=2}if(e>f){this.scale=links.Timeline.StepDate.SCALE.DAY;this.step=1}if(e/2>f){this.scale=links.Timeline.StepDate.SCALE.WEEKDAY;this.step=1}if(g*4>f){this.scale=links.Timeline.StepDate.SCALE.HOUR;this.step=4}if(g>f){this.scale=links.Timeline.StepDate.SCALE.HOUR;this.step=1}if(d*15>f){this.scale=links.Timeline.StepDate.SCALE.MINUTE;this.step=15}if(d*10>f){this.scale=links.Timeline.StepDate.SCALE.MINUTE;this.step=10}if(d*5>f){this.scale=links.Timeline.StepDate.SCALE.MINUTE;this.step=5}if(d>f){this.scale=links.Timeline.StepDate.SCALE.MINUTE;this.step=1}if(h*15>f){this.scale=links.Timeline.StepDate.SCALE.SECOND;this.step=15}if(h*10>f){this.scale=links.Timeline.StepDate.SCALE.SECOND;this.step=10}if(h*5>f){this.scale=links.Timeline.StepDate.SCALE.SECOND;this.step=5}if(h>f){this.scale=links.Timeline.StepDate.SCALE.SECOND;this.step=1}if(c*200>f){this.scale=links.Timeline.StepDate.SCALE.MILLISECOND;this.step=200}if(c*100>f){this.scale=links.Timeline.StepDate.SCALE.MILLISECOND;this.step=100}if(c*50>f){this.scale=links.Timeline.StepDate.SCALE.MILLISECOND;this.step=50}if(c*10>f){this.scale=links.Timeline.StepDate.SCALE.MILLISECOND;this.step=10}if(c*5>f){this.scale=links.Timeline.StepDate.SCALE.MILLISECOND;this.step=5}if(c>f){this.scale=links.Timeline.StepDate.SCALE.MILLISECOND;this.step=1}};links.Timeline.StepDate.prototype.snap=function(a){if(this.scale==links.Timeline.StepDate.SCALE.YEAR){var b=a.getFullYear()+Math.round(a.getMonth()/12);a.setFullYear(Math.round(b/this.step)*this.step);a.setMonth(0);a.setDate(0);a.setHours(0);a.setMinutes(0);a.setSeconds(0);a.setMilliseconds(0)}else{if(this.scale==links.Timeline.StepDate.SCALE.MONTH){if(a.getDate()>15){a.setDate(1);a.setMonth(a.getMonth()+1)}else{a.setDate(1)}a.setHours(0);a.setMinutes(0);a.setSeconds(0);a.setMilliseconds(0)}else{if(this.scale==links.Timeline.StepDate.SCALE.DAY||this.scale==links.Timeline.StepDate.SCALE.WEEKDAY){switch(this.step){case 5:case 2:a.setHours(Math.round(a.getHours()/24)*24);break;default:a.setHours(Math.round(a.getHours()/12)*12);break}a.setMinutes(0);a.setSeconds(0);a.setMilliseconds(0)}else{if(this.scale==links.Timeline.StepDate.SCALE.HOUR){switch(this.step){case 4:a.setMinutes(Math.round(a.getMinutes()/60)*60);break;default:a.setMinutes(Math.round(a.getMinutes()/30)*30);break}a.setSeconds(0);a.setMilliseconds(0)}else{if(this.scale==links.Timeline.StepDate.SCALE.MINUTE){switch(this.step){case 15:case 10:a.setMinutes(Math.round(a.getMinutes()/5)*5);a.setSeconds(0);break;case 5:a.setSeconds(Math.round(a.getSeconds()/60)*60);break;default:a.setSeconds(Math.round(a.getSeconds()/30)*30);break}a.setMilliseconds(0)}else{if(this.scale==links.Timeline.StepDate.SCALE.SECOND){switch(this.step){case 15:case 10:a.setSeconds(Math.round(a.getSeconds()/5)*5);a.setMilliseconds(0);break;case 5:a.setMilliseconds(Math.round(a.getMilliseconds()/1000)*1000);break;default:a.setMilliseconds(Math.round(a.getMilliseconds()/500)*500);break}}else{if(this.scale==links.Timeline.StepDate.SCALE.MILLISECOND){var c=this.step>5?this.step/2:1;a.setMilliseconds(Math.round(a.getMilliseconds()/c)*c)}}}}}}}};links.Timeline.StepDate.prototype.isMajor=function(){switch(this.scale){case links.Timeline.StepDate.SCALE.MILLISECOND:return(this.current.getMilliseconds()==0);case links.Timeline.StepDate.SCALE.SECOND:return(this.current.getSeconds()==0);case links.Timeline.StepDate.SCALE.MINUTE:return(this.current.getHours()==0)&&(this.current.getMinutes()==0);case links.Timeline.StepDate.SCALE.HOUR:return(this.current.getHours()==0);case links.Timeline.StepDate.SCALE.WEEKDAY:case links.Timeline.StepDate.SCALE.DAY:return(this.current.getDate()==1);case links.Timeline.StepDate.SCALE.MONTH:return(this.current.getMonth()==0);case links.Timeline.StepDate.SCALE.YEAR:return false;default:return false}};links.Timeline.StepDate.prototype.getLabelMinor=function(b,a){if(a==undefined){a=this.current}switch(this.scale){case links.Timeline.StepDate.SCALE.MILLISECOND:return String(a.getMilliseconds());case links.Timeline.StepDate.SCALE.SECOND:return String(a.getSeconds());case links.Timeline.StepDate.SCALE.MINUTE:return this.addZeros(a.getHours(),2)+":"+this.addZeros(a.getMinutes(),2);case links.Timeline.StepDate.SCALE.HOUR:return this.addZeros(a.getHours(),2)+":"+this.addZeros(a.getMinutes(),2);case links.Timeline.StepDate.SCALE.WEEKDAY:return b.DAYS_SHORT[a.getDay()]+" "+a.getDate();case links.Timeline.StepDate.SCALE.DAY:return String(a.getDate());case links.Timeline.StepDate.SCALE.MONTH:return b.MONTHS_SHORT[a.getMonth()];case links.Timeline.StepDate.SCALE.YEAR:return String(a.getFullYear());default:return""}};links.Timeline.StepDate.prototype.getLabelMajor=function(b,a){if(a==undefined){a=this.current}switch(this.scale){case links.Timeline.StepDate.SCALE.MILLISECOND:return this.addZeros(a.getHours(),2)+":"+this.addZeros(a.getMinutes(),2)+":"+this.addZeros(a.getSeconds(),2);case links.Timeline.StepDate.SCALE.SECOND:return a.getDate()+" "+b.MONTHS[a.getMonth()]+" "+this.addZeros(a.getHours(),2)+":"+this.addZeros(a.getMinutes(),2);case links.Timeline.StepDate.SCALE.MINUTE:return b.DAYS[a.getDay()]+" "+a.getDate()+" "+b.MONTHS[a.getMonth()]+" "+a.getFullYear();case links.Timeline.StepDate.SCALE.HOUR:return b.DAYS[a.getDay()]+" "+a.getDate()+" "+b.MONTHS[a.getMonth()]+" "+a.getFullYear();case links.Timeline.StepDate.SCALE.WEEKDAY:case links.Timeline.StepDate.SCALE.DAY:return b.MONTHS[a.getMonth()]+" "+a.getFullYear();case links.Timeline.StepDate.SCALE.MONTH:return String(a.getFullYear());default:return""}};links.Timeline.StepDate.prototype.addZeros=function(b,a){var c=""+b;while(c.length=0){d="DOMMouseScroll"}b.addEventListener(d,c,a)}else{b.attachEvent("on"+d,c)}};links.Timeline.removeEventListener=function(b,d,c,a){if(b.removeEventListener){if(a===undefined){a=false}if(d==="mousewheel"&&navigator.userAgent.indexOf("Firefox")>=0){d="DOMMouseScroll"}b.removeEventListener(d,c,a)}else{b.detachEvent("on"+d,c)}};links.Timeline.getTarget=function(a){if(!a){a=window.event}var b;if(a.target){b=a.target}else{if(a.srcElement){b=a.srcElement}}if(b.nodeType!=undefined&&b.nodeType==3){b=b.parentNode}return b};links.Timeline.stopPropagation=function(a){if(!a){a=window.event}if(a.stopPropagation){a.stopPropagation()}else{a.cancelBubble=true}};links.Timeline.preventDefault=function(a){if(!a){a=window.event}if(a.preventDefault){a.preventDefault()}else{a.returnValue=false}};links.Timeline.getAbsoluteLeft=function(b){var f=document.documentElement;var a=document.body;var d=b.offsetLeft;var c=b.offsetParent;while(c!=null&&c!=a&&c!=f){d+=c.offsetLeft;d-=c.scrollLeft;c=c.offsetParent}return d};links.Timeline.getAbsoluteTop=function(b){var f=document.documentElement;var a=document.body;var d=b.offsetTop;var c=b.offsetParent;while(c!=null&&c!=a&&c!=f){d+=c.offsetTop;d-=c.scrollTop;c=c.offsetParent}return d};links.Timeline.getPageY=function(c){if("pageY" in c){return c.pageY}else{var b;if(("targetTouches" in c)&&c.targetTouches.length){b=c.targetTouches[0].clientY}else{b=c.clientY}var d=document.documentElement;var a=document.body;return b+(d&&d.scrollTop||a&&a.scrollTop||0)-(d&&d.clientTop||a&&a.clientTop||0)}};links.Timeline.getPageX=function(c){if("pageY" in c){return c.pageX}else{var b;if(("targetTouches" in c)&&c.targetTouches.length){b=c.targetTouches[0].clientX}else{b=c.clientX}var d=document.documentElement;var a=document.body;return b+(d&&d.scrollLeft||a&&a.scrollLeft||0)-(d&&d.clientLeft||a&&a.clientLeft||0)}};links.Timeline.addClassName=function(c,b){var a=c.className.split(" ");if(a.indexOf(b)==-1){a.push(b);c.className=a.join(" ")}};links.Timeline.removeClassName=function(d,c){var b=d.className.split(" ");var a=b.indexOf(c);if(a!=-1){b.splice(a,1);d.className=b.join(" ")}};links.Timeline.isArray=function(a){if(a instanceof Array){return true}return(Object.prototype.toString.call(a)==="[object Array]")};links.Timeline.parseJSONDate=function(b){if(b==undefined){return undefined}if(b instanceof Date){return b}var a=b.match(/\/Date\((-?\d+)([-\+]?\d{2})?(\d{2})?\)\//i);if(a){var c=a[2]?(3600000*a[2])+(60000*a[3]*(a[2]/Math.abs(a[2]))):0;return new Date((1*a[1])+c)}return Date.parse(b)}; \ No newline at end of file diff --git a/main.php b/main.php deleted file mode 100644 index 86ef4b835..000000000 --- a/main.php +++ /dev/null @@ -1,951 +0,0 @@ - "otz",2 => "ntp",12 => "ohtp",13 => "ohtp2",14 => "ar",15 => "onbrd",16 => "oseq",17 => "osdt",18 => "omas",19 => "omton",20 => "omtoff",21 => "ours",22 => "orst",23 => "owl",25 => "oipas"); - -#Call action if requested and allowed -if (isset($_REQUEST['action'])) { - if (is_callable($_REQUEST['action'])) { - if (in_array($_REQUEST["action"], array("current_status","submit_stations","make_stations_list","get_weather","runonce","send_en_mm","test_ip","make_settings_list","make_list_status","make_list_manual","fresh_program","make_all_programs","make_runonce","spoff","spon","mm_off","mm_on","en_on","en_off","rbt","rsn","raindelay","submit_options","delete_program","update_program","get_preview","import_config","export_config"))) { - call_user_func($_REQUEST['action']); - } - exit(); - } else { - exit(); - } -} - -#Weather functions - -#Resolve location to WOEID -function get_woeid() { - $options = get_options(); - $data = file_get_contents("http://query.yahooapis.com/v1/public/yql?q=select%20woeid%20from%20geo.placefinder%20where%20text=%22".urlencode($options["loc"])."%22"); - preg_match("/(\d+)<\/woeid>/", $data, $woeid); - return intval($woeid[1]); -} - -#Get the current weather code and temp -function get_weather_data() { - $data = file_get_contents("http://weather.yahooapis.com/forecastrss?w=".$_SESSION["woeid"]); - if ($data === false) return array(); - preg_match("/Yahoo! Weather - (.*)<\/title>/",$data,$loc); - preg_match("//",$data,$region); - $region = $region[1]; - if ($region == "United States" || $region == "Bermuda" || $region == "Palau") { - $temp = $newdata[3]."°F"; - } else { - $temp = intval(($newdata[3]-32)*(5/9))."°C"; - } - return array("text"=>$newdata[1],"code"=>$newdata[2],"temp"=>$temp,"date"=>$newdata[4],"location"=>$loc[1]); -} - -function get_weather() { - echo json_encode(get_weather_data()); -} - -#Export/Import -function export_config() { - $data = get_from_os("/gp?d=0"); - - preg_match("/pd=\[\];(.*);/", $data, $progs); - $progs = explode(";", $progs[1]); - - $i = 0; - foreach ($progs as $prog) { - $tmp = explode("=", $prog); - $newdata["programs"][$i] = $tmp[1]; - $i++; - } - $newdata["options"] = get_options(); - - $vs = get_stations(); - $newdata["stations"] = $vs["stations"]; - $newdata["masop"] = $vs["masop"]; - - echo json_encode($newdata); -} - -function import_config() { - global $keyNames; - - if (!isset($_REQUEST["data"])) echo 0; - $data = json_decode($_REQUEST["data"],true); - if (is_null($data)) echo 0; - $cs = "/cs?pw="; $co = "/co?pw="; $cp_start = "/cp?pw="; $i = 0; - foreach ($data["options"] as $key => $value) { - if (is_array($value)) { - if (in_array($key, array(2,14,16,21,22,25)) && $value["val"] == 0) continue; - $co .= "&".(($_SESSION["OSPi"]) ? $keyNames[$key] : "o".$key)."=".$value["val"]; - } else if ($key == "loc") { - $co .= "&".(($_SESSION["OSPi"]) ? "o".$key : $key)."=".urlencode($value); - } - } - send_to_os($co); - foreach ($data["stations"] as $station) { - $cs .= "&s".$i."=".urlencode($station); - $i++; - } - $i = 0; - foreach ($data["masop"] as $bit) { - $cs .= "&m".$i."=".urlencode($bit); - $i++; - } - send_to_os($cs); - send_to_os("/dp?pw=&pid=-1"); - foreach ($data["programs"] as $prog) { - send_to_os($cp_start."&pid=-1&v=".$prog); - } -} - -#OpenSprinkler functions - -#Get station names -function get_stations() { - $data = get_from_os("/vs"); - preg_match("/snames=\[(.*)\];/", $data, $matches); - $rawstations = str_getcsv($matches[1],",","'"); - preg_match("/(?:nboards|nbrd)\s?[=|:]\s?(\d+)/", $data, $matches); - $total = $matches[1] * 8; $current = 1; - foreach ($rawstations as $station) { - if ($current > $total) break; - $station = preg_replace("/\\\u([0-9a-eA-E]{4})/", "&#x\\1;", $station); - $stations[] = $station; - $current++; - } - - preg_match("/(?:masop|mo)\s?[=|:]\s?\[(.*?)\]/", $data, $masop); - $masop = explode(",",$masop[1]); - - return array("stations" => $stations,"masop" => $masop); -} - -#Get program information -function get_programs() { - $data = get_from_os("/gp?d=0"); - - preg_match_all("/(nprogs|nboards|ipas|mnp)=[\w|\d|.\"]+/", $data, $opts); - - foreach ($opts[0] as $variable) { - if ($variable === "") continue; - $tmp = str_replace('"','',explode("=", $variable)); - $newdata[$tmp[0]] = $tmp[1]; - } - - preg_match("/pd=\[\];(.*);/", $data, $progs); - if (empty($progs)) return $progs; - $progs = explode(";", $progs[1]); - - $i = 0; - foreach ($progs as $prog) { - $tmp = explode("=", $prog); - $tmp2 = str_replace("[", "", $tmp[1]); - $tmp2 = str_replace("]", "", $tmp2); - $program = explode(",", $tmp2); - - #Reset variables - $days0 = $program[1]; $days1 = $program[2]; $even = false; $odd = false; $interval = false; $days = ""; $stations = ""; - - $newdata["programs"][$i]["en"] = $program[0]; - $newdata["programs"][$i]["start"] = $program[3]; - $newdata["programs"][$i]["end"] = $program[4]; - $newdata["programs"][$i]["interval"] = $program[5]; - $newdata["programs"][$i]["duration"] = $program[6]; - - for ($n=0; $n < $newdata["nboards"]; $n++) { - $bits = $program[7+$n]; - for ($s=0; $s < 8; $s++) { - $stations .= ($bits&(1<<$s)) ? "1" : "0"; - } - } - $newdata["programs"][$i]["stations"] = $stations; - - if(($days0&0x80)&&($days1>1)){ - #This is an interval program - $days=array($days1,$days0&0x7f); - $interval = true; - } else { - #This is a weekly program - for($d=0;$d<7;$d++) { - if ($days0&(1<<$d)) { - $days .= "1"; - } else { - $days .= "0"; - } - } - if(($days0&0x80)&&($days1==0)) {$even = true;} - if(($days0&0x80)&&($days1==1)) {$odd = true;} - } - - $newdata["programs"][$i]["days"] = $days; - $newdata["programs"][$i]["is_even"] = $even; - $newdata["programs"][$i]["is_odd"] = $odd; - $newdata["programs"][$i]["is_interval"] = $interval; - $i++; - } - return $newdata; -} - -function get_preview() { - process_programs($_REQUEST["m"],$_REQUEST["d"],$_REQUEST["y"]); -} - -function process_programs($month,$day,$year) { - $newdata = array(); - - $newdata["settings"] = get_settings(); - $vs = get_stations(); - $newdata["stations"] = $vs["stations"]; - - $data = get_from_os("/gp?d=".$day."&m=".$month."&y=".$year); - preg_match_all("/(seq|mas|wl|sdt|mton|mtoff|devday|devmin|dd|mm|yy|nprogs|nboards|ipas|mnp)\s?[=|:]\s?([\w|\d|.\"]+)/", $data, $opts); - $i = 0; - - foreach ($opts[1] as $variable) { - if ($variable === "") continue; - $newdata[$variable] = $opts[2][$i]; - $i++; - } - - preg_match("/(?:masop|mo)\s?[=|:]\s?\[(.*?)\]/", $data, $masop); - $newdata["masop"] = explode(",",$masop[1]); - - preg_match("/pd=\[\];(.*);/", $data, $progs); - $progs = explode(";", $progs[1]); - - $i = 0; - foreach ($progs as $prog) { - $tmp = explode("=", $prog); - $tmp2 = str_replace("[", "", $tmp[1]); - $tmp2 = str_replace("]", "", $tmp2); - $newdata["programs"][$i] = explode(",",$tmp2); - $i++; - } - - $simminutes=0; - $simt=strtotime($newdata["mm"]."/".$newdata["dd"]."/".$newdata["yy"]); - $simdate=date(DATE_RSS,$simt); - $simday = ($simt/3600/24)>>0; - $match=array(0,0); - $st_array=array($newdata["nboards"]*8); - $pid_array=array($newdata["nboards"]*8); - $et_array=array($newdata["nboards"]*8); - for($sid=0;$sid<$newdata["nboards"]*8;$sid++) { - $st_array[$sid]=0;$pid_array[$sid]=0;$et_array[$sid]=0; - } - do { - $busy=0; - $match_found=0; - for($pid=0;$pid<$newdata["nprogs"];$pid++) { - $prog=$newdata["programs"][$pid]; - if(check_match($prog,$simminutes,$simdate,$simday,$newdata)) { - for($sid=0;$sid<$newdata["nboards"]*8;$sid++) { - $bid=$sid>>3;$s=$sid%8; - if($newdata["mas"]==($sid+1)) continue; // skip master station - if($prog[7+$bid]&(1<<$s)) { - $et_array[$sid]=$prog[6]*$newdata["wl"]/100>>0;$pid_array[$sid]=$pid+1; - $match_found=1; - } - } - } - } - if($match_found) { - $acctime=$simminutes*60; - if($newdata["seq"]) { - for($sid=0;$sid<$newdata["nboards"]*8;$sid++) { - if($et_array[$sid]) { - $st_array[$sid]=$acctime;$acctime+=$et_array[$sid]; - $et_array[$sid]=$acctime;$acctime+=$newdata["sdt"]; - $busy=1; - } - } - } else { - for($sid=0;$sid<$newdata["nboards"]*8;$sid++) { - if($et_array[$sid]) { - $st_array[$sid]=$simminutes*60; - $et_array[$sid]=$simminutes*60+$et_array[$sid]; - $busy=1; - } - } - } - } - if ($busy) { - $endminutes=run_sched($simminutes*60,$st_array,$pid_array,$et_array,$newdata,$simt)/60>>0; - if($newdata["seq"]&&$simminutes!=$endminutes) $simminutes=$endminutes; - else $simminutes++; - for($sid=0;$sid<$newdata["nboards"]*8;$sid++) {$st_array[$sid]=0;$pid_array[$sid]=0;$et_array[$sid]=0;} - } else { - $simminutes++; - } - } while($simminutes<24*60); -} - -function check_match($prog,$simminutes,$simdate,$simday,$data) { - if($prog[0]==0) return 0; - if (($prog[1]&0x80)&&($prog[2]>1)) { - $dn=$prog[2];$drem=$prog[1]&0x7f; - if(($simday%$dn)!=(($data["devday"]+$drem)%$dn)) return 0; - } else { - $wd=(date("w",strtotime($simdate))+6)%7; - if(($prog[1]&(1<<$wd))==0) return 0; - $dt=date("j",strtotime($simdate)); - if(($prog[1]&0x80)&&($prog[2]==0)) {if(($dt%2)!=0) return 0;} - if(($prog[1]&0x80)&&($prog[2]==1)) { - if($dt==31) return 0; - else if ($dt==29 && date("n",strtotime($simdate))==2) return 0; - else if (($dt%2)!=1) return 0; - } - } - if($simminutes<$prog[3] || $simminutes>$prog[4]) return 0; - if($prog[5]==0) return 0; - if((($simminutes-$prog[3])/$prog[5]>>0)*$prog[5] == ($simminutes-$prog[3])) { - return 1; - } - return 0; -} - -function run_sched($simseconds,$st_array,$pid_array,$et_array,$data,$simt) { - $endtime=$simseconds; - for($sid=0;$sid<$data["nboards"]*8;$sid++) { - if($pid_array[$sid]) { - if($data["seq"]==1) { - time_to_text($sid,$st_array[$sid],$pid_array[$sid],$et_array[$sid],$data,$simt); - if(($data["mas"]>0)&&($data["mas"]!=$sid+1)&&($data["masop"][$sid>>3]&(1<<($sid%8)))) - echo "{'start': ".($st_array[$sid]+$data["mton"]).",'end': ".($et_array[$sid]+$data["mtoff"]).",'content':'','className':'master','group':'Master'},"; - $endtime=$et_array[$sid]; - } else { - time_to_text($sid,$simseconds,$pid_array[$sid],$et_array[$sid],$data,$simt); - if(($data["mas"]>0)&&($data["mas"]!=$sid+1)&&($data["masop"][$sid>>3]&(1<<($sid%8)))) - $endtime=($endtime>$et_array[$sid])?$endtime:$et_array[$sid]; - } - } - } - if($data["seq"]==0&&$data["mas"]>0) echo "{'start': ".$simseconds.",'end': ".$endtime.",'content':'','className':'master','group':'Master'},"; - return $endtime; -} - -function time_to_text($sid,$start,$pid,$end,$data,$simt) { - $class = "program-".(($pid+3)%4); - if (($data["settings"]["rd"]!=0)&&($simt+$start+($data["settings"]["tz"]-48)*900<=$data["settings"]["rdst"])) $class="delayed"; - echo "{'start': ".$start.",'end': ".$end.",'className':'".$class."','content':'P".$pid."','group':'".$data["stations"][$sid]."'},"; -} - -#Get OpenSprinkler options -function get_options() { - global $keyNames; - - $data = get_from_os("/vo"); - preg_match("/var opts=\[(.*)\];/", $data,$opts); - preg_match("/loc\s?[=|:]\s?[\"|'](.*)[\"|']/",$data,$loc); - - $newdata["loc"] = $loc[1]; - - if (empty($opts)) { - $_SESSION["OSPi"] = true; - preg_match_all("/(tz|htp|htp2|nbrd|seq|sdt|mas|mton|mtoff|urs|rst|wl|ipas)\s?[=|:]\s?([\w|\d|.\"]+)/", $data, $opts); - $i = 0; - foreach ($opts[1] as $var) { - if ($var === "") continue; - $o = array_search("o".$var, $keyNames); - $val = ($var == "nbrd") ? $opts[2][$i] - 1 : $opts[2][$i]; - $newdata[$o] = array("en" => 1,"val" => $val,"var" => $var); - $i++; - } - } else { - $data = explode(",", $opts[1]); - for ($i=3; $i <= count($data); $i=$i+4) { - $o = intval($data[$i]); - if (in_array($o, array(1,2,12,13,14,15,16,17,18,19,20,21,22,23,25))) { - $newdata[$o] = array("en" => $data[$i-2],"val" => $data[$i-1],"var" => $keyNames[$o]); - } - } - } - - $newdata = move_keys(array(15,17,19,20,23),$newdata); - $newdata = move_keys(array(2,14,16,21,22,25),$newdata); - return $newdata; -} - -#Get OpenSprinkler settings -function get_settings() { - $data = get_from_os(""); - preg_match_all("/(ver|devt|nbrd|tz|en|rd|rs|mm|rdst|mas|urs|wl|ipas)\s?[=|:]\s?([\w|\d|.\"]+)/", $data, $matches); - preg_match("/loc(\s)?[=|:](\s)?[\"|'](.*)[\"|']/",$data,$loc); - preg_match("/lrun=\[(.*)\]/", $data, $lrun); - preg_match("/ps=\[(.*)\];/",$data,$ps); - $ps = explode("],[",$ps[1]); - $i = 0; - foreach ($ps as $p) { - $ps[$i] = explode(",",str_replace(array("[","]"), "", $ps[$i])); - $i++; - } - $newdata = array("ps" => $ps, "lrun" => explode(",", $lrun[1]), "loc" => $loc[1]); - $i = 0; - foreach ($matches[1] as $variable) { - if ($variable === "") continue; - $newdata[$variable] = $matches[2][$i]; - $i++; - } - return $newdata; -} - -function get_station_status() { - preg_match("/\d+/", get_from_os("/sn0"), $data); - return str_split($data[0]); -} - -function send_en_mm() { - $settings = get_settings(); - echo json_encode(array("en" => $settings["en"], "mm" => $settings["mm"])); -} - -#Send command to OpenSprinkler -function send_to_os($url) { - $url = str_replace("pw=", "pw=".$_REQUEST["os_pw"], $url); - $result = file_get_contents("http://".$_REQUEST["os_ip"].$url); - if ($result === false) { echo 0; exit(); } - echo 1; -} - -#Get data from OpenSprinkler -function get_from_os($url) { - $url = str_replace("pw=", "pw=".$_REQUEST["os_pw"], $url); - return file_get_contents("http://".$_REQUEST["os_ip"].$url); -} - -#Updates a program -function update_program() { - send_to_os("/cp?pw=&pid=".$_REQUEST["pid"]."&v=".$_REQUEST["data"]); -} - -#Deletes a program -function delete_program() { - send_to_os("/dp?pw=&pid=".$_REQUEST["pid"]); -} - -#Submit updated options -function submit_options() { - global $keyNames; - - if (isset($_SESSION["OSPi"])) { - foreach (json_decode($_REQUEST["options"]) as $key => $value) { - if ($key !== "loc") { - $key = filter_var($key, FILTER_SANITIZE_NUMBER_INT); - $data[$keyNames[$key]] = $value; - } else { - $key = "o".$key; - $data[$key] = $value; - } - } - send_to_os("/co?pw=&".http_build_query($data)); - } else { - send_to_os("/co?pw=&".http_build_query(json_decode($_REQUEST["options"]))); - } - $_SESSION["woeid"] = get_woeid(); -} - -#Submit updated stations -function submit_stations() { - $masop = (isset($_REQUEST["masop"])) ? "&".http_build_query(json_decode($_REQUEST["masop"])) : ""; - send_to_os("/cs?pw=&".http_build_query(json_decode($_REQUEST["names"])).$masop); -} - -#Submit run-once program -function runonce() { - send_to_os("/cr?pw=&t=".$_REQUEST["data"]); -} - -#Submit rain delay -function raindelay() { - send_to_os("/cv?pw=&rd=".$_REQUEST["delay"]); -} - -#Reset all stations (turn-off) -function rsn() { - send_to_os("/cv?pw=&rsn=1"); -} - -#Reboot OpenSprinkler -function rbt() { - send_to_os("/cv?pw=&rbt=1"); -} - -#Change operation to on -function en_on() { - send_to_os("/cv?pw=&en=1"); -} - -#Change operation to off -function en_off() { - send_to_os("/cv?pw=&en=0"); -} - -#Switch manual mode on -function mm_on() { - send_to_os("/cv?pw=&mm=1"); -} - -#Switch manual mode off -function mm_off() { - send_to_os("/cv?pw=&mm=0"); -} - -#Turn specific station on -function spon() { - send_to_os("/sn".$_REQUEST["zone"]."=1&t=0"); -} - -#Turn specific station off -function spoff() { - send_to_os("/sn".$_REQUEST["zone"]."=0"); -} - - -#Content generation functions - -#Make run-once list -function make_runonce() { - $list = "

    Value is in minutes. Zero means the station will be excluded from the run-once program.

    "; - $n = 0; - $data = get_programs(); - $vs = get_stations(); - $stations = $vs["stations"]; - foreach ($stations as $station) { - $list .= ""; - $n++; - } - $list .= "
    SubmitReset"; - $progs = array(); - if (count($data["programs"])) { - foreach ($data["programs"] as $program) { - $prog = array(); - $set_stations = str_split($program["stations"]); - for ($i=0;$i$list,"progs"=>$progs)); -} - -#Make the list of all programs -function make_all_programs() { - $data = get_programs(); - $total = count($data["programs"]); - if ($total == 0) { - echo "

    You have no programs currently added. Tap the Add button on the top right corner to get started.

    "; - return; - } - $vs = get_stations(); - $stations = $vs["stations"]; - $n = 0; - $list = "

    Click any program below to expand/edit. Be sure to save changes by hitting submit below.

    "; - foreach ($data["programs"] as $program) { - $list .= make_program($n,$total,$stations,$program); - $n++; - } - echo $list."
    "; -} - -#Generate a new program view -function fresh_program() { - $vs = get_stations(); - $stations = $vs["stations"]; - echo make_program("new",1,$stations); -} - -function make_program($n,$total,$stations,$program=array("en"=>0,"is_interval"=>0,"is_even"=>0,"is_odd"=>0,"duration"=>0,"interval"=>0,"start"=>0,"end"=>0)) { - $week = array("M", "T", "W", "R", "F", "Sa", "Su"); - if (isset($program["days"])) { - if (is_array($program["days"])) { - $days = $program["days"]; - } else { - $days = str_split($program["days"]); - } - } else { - $days = array(0,0,0,0,0,0,0); - } - if (isset($program["stations"])) $set_stations = str_split($program["stations"]); - $list = "
    "; - if ($n !== "new") $list .= "Program ".($n + 1).""; - $list .= ""; - $list .= "
    "; - $list .= ""; - $list .= ""; - $list .= "
    "; - - $list .= "

    Restrictions

    "; - $list .= ""; - $list .= ""; - $list .= ""; - $list .= "
    "; - - $list .= "

    Days of the Week

    "; - $j = 0; - foreach ($week as $day) { - $list .= ""; - $j++; - } - $list .= "
    "; - - $list .= "
    "; - $list .= "
    "; - $list .= "
    "; - $list .= "
    "; - - $list .= "
    Stations:"; - $j = 0; - foreach ($stations as $station) { - $list .= ""; - $j++; - } - $list .= "
    "; - - $list .= "
    "; - $list .= ""; - $list .= ""; - $list .= "
    "; - - $list .= "
    "; - $list .= "
    "; - $list .= "
    "; - $list .= "
    "; - - $list .= ""; - $list .= "
    "; - if ($n === "new") { - $list .= "
    "; - } else { - $list .= ""; - $list .= ""; - } - return $list; -} - -#Make the manual list -function make_list_manual() { - $list = '
  • Sprinkler Stations
  • '; - $vs = get_stations(); - $stations = $vs["stations"]; - $status = get_station_status(); - $i = 0; - - foreach ($stations as $station) { - $list .= '
  • '.$station.'
  • '; - $i++; - } - echo $list; -} - -function current_status() { - $settings = get_settings(); - $vs = get_stations(); - $stations = $vs["stations"]; - $status = get_station_status(); - $options = get_options(); - - if (!$settings["en"]) { - $line = "

    System Disabled

    "; - echo json_encode(array("color" => "red","line" => $line,"seconds" => 0,"sdelay" => $options[17]["val"])); return; - } - - if ($settings["rd"]) { - $line = "

    Rain delay until ".gmdate("D, d M Y H:i:s",$settings["rdst"])."

    "; - echo json_encode(array("color" => "red","line" => $line,"seconds" => 0,"sdelay" => $options[17]["val"])); return; - } - - if ($settings["urs"] && $settings["rs"]) { - $line = "

    Rain detected

    "; - echo json_encode(array("color" => "red","line" => $line,"seconds" => 0,"sdelay" => $options[17]["val"])); return; - } - - $open = array_keys($status,true); - if (count($open) >= 2) { - $ptotal = 0; - foreach ($open as $key => $value) { - $tmp = $settings["ps"][$value][1]; - if ($tmp > $ptotal) $ptotal = $tmp; - } - $sample = $open[0]; - $pname = pidname($settings["ps"][$sample][0]); - $line = "

    "; - $line .= $pname." is running on ".count($open)." stations "; - if ($pname != "Manual program") $line .= "(".sec2hms($ptotal)." remaining)"; - $line .= "

    "; - echo json_encode(array("color" => "green","line" => $line,"seconds" => $ptotal,"sdelay" => $options[17]["val"])); - return; - } - - $i = 0; - foreach ($stations as $station) { - $info = ""; - if ($settings["ps"][$i][0] && $status[$i]) { - $pname = pidname($settings["ps"][$i][0]); - $line = "

    "; - $line .= $pname." is running on station ".$station." "; - if ($pname != "Manual program") $line .= "(".sec2hms($settings["ps"][$i][1])." remaining)"; - $line .= "

    "; - echo json_encode(array("color" => "green","line" => $line,"seconds" => $settings["ps"][$i][1],"sdelay" => $options[17]["val"])); - return; - } - $i++; - } - - if ($settings["mm"]) { - $line = "

    Manual mode enabled

    "; - echo json_encode(array("color" => "red","line" => $line,"seconds" => 0,"sdelay" => $options[17]["val"])); return; - } -} - -#Generate status page -function make_list_status() { - $settings = get_settings(); - $vs = get_stations(); - $stations = $vs["stations"]; - $status = get_station_status(); - $options = get_options(); - - $runningTotal = array(); - $allPnames = array(); - - $list = "";$tz = $settings['tz']-48; - $tz = (($tz>=0) ? "+" : "-").(abs($tz)/4>>0).":".((abs($tz)%4)*15/10>>0).((abs($tz)%4)*15%10); - - $header = "".gmdate("D, d M Y H:i:s",$settings["devt"])." GMT ".$tz; - $runningTotal["c"] = $settings["devt"]; - - $i = 0; - foreach ($stations as $station) { - $info = ""; - if ($settings["ps"][$i][0]) { - $rem=$settings["ps"][$i][1]; - $remm=$rem/60>>0; - $rems=$rem%60; - $pname = pidname($settings["ps"][$i][0]); - if ($status[$i] && $pname != "Manual program") $runningTotal[$i] = $rem; - $allPnames[$i] = $pname; - $info = "

    ".(($status[$i]) ? "Running" : "Scheduled" )." ".$pname; - if ($pname != "Manual program") $info .= " (".($remm/10>>0).($remm%10).":".($rems/10>>0).($rems%10)." remaining)"; - $info .= "

    "; - } - if ($settings["mas"] == $i+1) $station .= " (Master)"; - if ($status[$i]) { - $color = "green"; - } else { - $color = "red"; - } - $list .= "
  • ".$station."

    ".$info."
  • "; - $i++; - } - - $footer = ""; - $lrdur = $settings["lrun"][2]; - - if ($lrdur != 0) { - $lrpid = $settings["lrun"][1]; - $pname=pidname($lrpid); - - $footer = '

    '.$pname.' last ran station '.$stations[$settings["lrun"][0]].' for '.($lrdur/60>>0).'m '.($lrdur%60).'s on '.gmdate("D, d M Y H:i:s",$settings["lrun"][3]).'

    '; - } - - $open = count(array_keys($status,true)); - - $ptotal = 0; - foreach ($settings["ps"] as $valve) { - if ($valve[0]) { - if ($open > 1) { - $tmp = $valve[1]; - if ($tmp > $ptotal) $ptotal = $tmp; - } else { - $ptotal += $valve[1]; - } - } - } - - if ($ptotal) { - $scheduled = count($allPnames); - if (!$open && $scheduled) $runningTotal["d"] = $options[17]["val"]; - if ($open == 1) $ptotal += ($scheduled-1)*$options[17]["val"]; - $allPnames = array_unique($allPnames); - $numProg = count($allPnames); - $allPnames = strrev(preg_replace(strrev("/, /"),strrev(" and "),strrev(implode(", ", $allPnames)),1)); - $pinfo = $allPnames.(($numProg > 1) ? " are" : " is" )." running "; - $pinfo .= "(".sec2hms($ptotal)." remaining)"; - $runningTotal["p"] = $ptotal; - $header .= "
    ".$pinfo; - } - - echo json_encode(array("list" => $list,"header" => $header,"footer" => $footer, "sdelay" => $options[17]["val"], "totals" => json_encode($runningTotal))); -} - -#Generate settings page -function make_settings_list() { - $options = get_options(); - $settings = get_settings(); - $vs = get_stations(); - $stations = $vs["stations"]; - $list = "
  • "; - foreach ($options as $key => $data) { - if (!is_int($key)) continue; - switch ($key) { - case 1: - $timezones = array("-12:00","-11:30","-11:00","-10:00","-09:30","-09:00","-08:30","-08:00","-07:00","-06:00","-05:00","-04:30","-04:00","-03:30","-03:00","-02:30","-02:00","+00:00","+01:00","+02:00","+03:00","+03:30","+04:00","+04:30","+05:00","+05:30","+05:45","+06:00","+06:30","+07:00","+08:00","+08:45","+09:00","+09:30","+10:00","+10:30","+11:00","+11:30","+12:00","+12:45","+13:00","+13:45","+14:00"); - $tz = $data["val"]-48; - $tz = (($tz>=0) ? "+" : "-").sprintf("%02d", strval(abs($tz)/4)).":".strval(((abs($tz)%4)*15/10).((abs($tz)%4)*15%10)); - $list .= ""; - continue 2; - case 2: - $list .= ""; - continue 2; - case 12: -# $http = $options[13]["val"]*256+$data["val"]; -# $list .= ""; - continue 2; - case 14: - $list .= ""; - continue 2; - case 15: - $list .= ""; - continue 2; - case 16: - $list .= ""; - continue 2; - case 17: - $list .= ""; - continue 2; - case 18: - $list .= ""; - continue 2; - case 19: - $list .= ""; - continue 2; - case 20: - $list .= ""; - continue 2; - case 21: - $list .= ""; - continue 2; - case 22: - $list .= ""; - continue 2; - case 23: - $list .= ""; - continue 2; - case 25: - $list .= ""; - continue 2; - } - } - $list .= "
  • "; - echo $list; -} - -function make_stations_list() { - $settings = get_settings(); - $vs = get_stations(); - $stations = $vs["stations"]; - $masop = $vs["masop"]; - $list = "
  • "; - if ($settings["mas"]) $list .= ""; - $i = 0; - foreach ($stations as $station) { - if ($settings["mas"]) $list .= ""; - } else { - $list .= ""; - } - } - $i++; - } - if ($settings["mas"]) $list .= "
    Station NameActivate Master?
    "; - $list .= ""; - if ($settings["mas"]) { - if ($settings["mas"] == $i+1) { - $list .= "

    (Master)

    "; - echo $list."
  • "; -} - -#Supplemental functions - -#Convert program ID to name -function pidname($pid) { - $pname = "Program ".$pid; - if($pid==255||$pid==99) $pname="Manual program"; - if($pid==254||$pid==98) $pname="Run-once program"; - return $pname; -} - -#Rearrange array by move the keys in $keys array to the end of $array -function move_keys($keys,$array) { - foreach ($keys as $key) { - if (!isset($array[$key])) continue; - $t = $array[$key]; - unset($array[$key]); - $array[$key] = $t; - } - return $array; -} - -function test_ip() { - if (isValidUrl("http://".$_REQUEST["os_ip"])) { - if(isset($_SESSION)) session_destroy(); - session_start(); - echo 1; - exit(); - } - echo 0; -} - -#Check if URL is valid by grabbing headers and verifying reply is: 200 OK -function isValidUrl($url) { - $data = file_get_contents($url."/vs"); - if ($data === false) return false; - - preg_match("/