Interactive interface for browsing global, full-resolution satellite imagery
Product Picker Redesign
Tilak Joshi76e8ca99950f
diff --git a/css/bank.css b/css/bank.cssindex 6b411cb23..7cac5c0a2 100644--- a/css/bank.css+++ b/css/bank.css@@ -4,20 +4,51 @@ a.accordionToggler { float:left; display:inline-block; width:28px; height:36px;a.atcollapse {background-image: url("../images/expandIn.png"); }a.atexpand {background-image: url("../images/expandOut.png");}-.bank { display:inline-block; float:left; width: 210px; min-height:190px; padding-bottom:20px; /*box-shadow: 0 0 4px 1px #bbb;*/ background: rgba(38,43,49,0.65); font: 10px/12px "Gill Sans","helvetica",sans-serif; color: #141b4c; border-radius: 0 10px 10px 0; text-shadow:none;overflow:auto;}-.bank h1,h2,h3,h4 {margin:0px; padding:0px;}-.bank h2 {display:inline-block; float: left; color:#ffffff; font-size: 14px; font-weight:100; border:none; padding:6px 0;}-.bank h3 {display:inline-block; float: left; color:#333333; font-size: 12px; font-weight:100; border:none; text-decoration:none; }+.bank { display:inline-block; float:left; width: 210px; min-height:190px; padding-bottom:20px; /*box-shadow: 0 0 4px 1px #bbb;*/ font: 10px/12px "Gill Sans","helvetica",sans-serif; color: #fff; text-shadow:none;}+.bank h1,h2,h3,h4 {margin:0px; padding:0px; color:#fffbe7;}+.bank h2 {font:14px "gill sans", sans-serif; display:inline-block; float: left; color:#ffffff; font-size: 14px; font-weight:100; border:none; padding:9px 30px 9px 30px;+background: -moz-linear-gradient(top, rgba(255,255,255,0.7) 0%, rgba(11,95,160,0.7) 23%, rgba(0,88,156,0.7) 24%, rgba(0,81,144,0.7) 99%, rgba(0,81,144,0.7) 100%); /* FF3.6+ */+background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,rgba(255,255,255,0.7)), color-stop(23%,rgba(11,95,160,0.7)), color-stop(24%,rgba(0,88,156,0.7)), color-stop(99%,rgba(0,81,144,0.7)), color-stop(100%,rgba(0,81,144,0.7))); /* Chrome,Safari4+ */+background: -webkit-linear-gradient(top, rgba(255,255,255,0.7) 0%,rgba(11,95,160,0.7) 23%,rgba(0,88,156,0.7) 24%,rgba(0,81,144,0.7) 99%,rgba(0,81,144,0.7) 100%); /* Chrome10+,Safari5.1+ */+background: -o-linear-gradient(top, rgba(255,255,255,0.7) 0%,rgba(11,95,160,0.7) 23%,rgba(0,88,156,0.7) 24%,rgba(0,81,144,0.7) 99%,rgba(0,81,144,0.7) 100%); /* Opera 11.10+ */+background: -ms-linear-gradient(top, rgba(255,255,255,0.7) 0%,rgba(11,95,160,0.7) 23%,rgba(0,88,156,0.7) 24%,rgba(0,81,144,0.7) 99%,rgba(0,81,144,0.7) 100%); /* IE10+ */+background: linear-gradient(to bottom, rgba(255,255,255,0.7) 0%,rgba(11,95,160,0.7) 23%,rgba(0,88,156,0.7) 24%,rgba(0,81,144,0.7) 99%,rgba(0,81,144,0.7) 100%); /* W3C */+filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#b3ffffff', endColorstr='#b3005190',GradientType=0 ); /* IE6-9 */++}++.bank .tabContainer {border-bottom: 2px #005190 solid; }+.bank h3 {display:inline-block; float: left; color:#ffffff; font-size: 12px; font-weight:100; border:none; text-decoration:none; width:204px;}#callSelectorLink {display: inline-block; width:32px; height:32px; background: transparent url("../images/addLayers.png"); margin-left: 50px;float:right;}-.bank div,.bank ul {display:block; overflow:auto; width:190px; margin:0 auto; padding:5px; max-height:250px; }-.bank ul h3 {}-.bank li.item {padding:0; display:block; background:#fff; width:180px; border-radius:5px; padding:5px; margin-top:10px; }-.bank li.item a {float:right; position:relative; top:-8px; right:-8px;}-.bank li.item h4 {font-size:9px; font-weight:bold; }-.bank li.item span.palette {display:block; width:185px; overflow:hidden; margin-top:5px;}+.bank div,.bank ul {display:block;width:100%; margin:0 auto;}+.bank ul {max-height:90px;}+.bank h3 {background: rgba(120,120,120,.7); margin-top:2px; padding: 1px 3px; font-size:10px !important;}+.bank li.item {padding:0; display:block; width:198px; padding:8px 9px 8px 3px;+background: -moz-linear-gradient(top, rgba(0,0,0,0.54) 0%, rgba(2,2,2,0.54) 1%, rgba(78,78,78,0.54) 50%, rgba(0,0,0,0.54) 100%); /* FF3.6+ */+background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,rgba(0,0,0,0.24)), color-stop(1%,rgba(2,2,2,0.24)), color-stop(50%,rgba(78,78,78,0.24)), color-stop(100%,rgba(0,0,0,0.24))); /* Chrome,Safari4+ */+background: -webkit-linear-gradient(top, rgba(0,0,0,0.24) 0%,rgba(2,2,2,0.24) 1%,rgba(78,78,78,0.24) 50%,rgba(0,0,0,0.24) 100%); /* Chrome10+,Safari5.1+ */+background: -o-linear-gradient(top, rgba(0,0,0,0.24) 0%,rgba(2,2,2,0.24) 1%,rgba(78,78,78,0.24) 50%,rgba(0,0,0,0.24) 100%); /* Opera 11.10+ */+background: -ms-linear-gradient(top, rgba(0,0,0,0.24) 0%,rgba(2,2,2,0.24) 1%,rgba(78,78,78,0.24) 50%,rgba(0,0,0,0.24) 100%); /* IE10+ */+background: linear-gradient(to bottom, rgba(0,0,0,0.24) 0%,rgba(2,2,2,0.24) 1%,rgba(78,78,78,0.24) 50%,rgba(0,0,0,0.24) 100%); /* W3C */+filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#3d000000', endColorstr='#3d000000',GradientType=0 ); /* IE6-9 */+++}++.mCustomScrollBox > .mCSB_scrollTools {right: -6px;}+++.bank li.item a {float:right; color:#fff; margin-right:5px; margin-top:3px;}+.bank li.item a.hdanchor {margin-top:0px;}+.bank li.item h4 {font-size:9px; font-weight:bold; padding:0 3px;}+.bank li.item p {padding:0 3px; color:#fffbe7; }+.bank li.item span.palette {display:block; overflow:hidden; margin-top:5px; margin-left:5px;}.bank li.item ul.palette li {float:left;}-.bank ul.category { min-height:50px; background: rgba(255,255,255,.7); border-radius:5px; margin-top:10px; }+.bank ul.category { /*background: rgba(255,255,255,.7); border-radius:5px; */}.bank ul.category li h3 {display:block; clear:both; float:none;}span.p-min {float:left;}span.p-max {float:left;}span.p-units {float:left;}+++.ui-tabs-hide {display:none !important;}diff --git a/css/dateSpan.css b/css/dateSpan.cssindex 08d92c628..749f2fa20 100644--- a/css/dateSpan.css+++ b/css/dateSpan.css@@ -24,6 +24,7 @@ a.ecbutton { display:block; width:24px; height:24px; float:left; position:relatia.collapse {background-image: url("../images/collapseDown.png"); background-repeat:no-repeat;}a.expand {background-image: url("../images/expandUp.png"); background-repeat:no-repeat;}.dateSpanSlider {display:none !important;}+input.ui-slider-input {width:0px; margin:0px;}div.slider {/*background: rgba(45,50,55,.75);*/ margin-bottom:0px; /*box-shadow: 0px 0px 4px 1px #bbb;*/background: -moz-linear-gradient(top, rgba(35,40,45,0.65) 0%, rgba(0,5,10,0.65) 50%, rgba(35,40,45,0.65) 100%); /* FF3.6+ */diff --git a/css/ext/jquery.mCustomScrollbar/jquery.mCustomScrollbar.css b/css/ext/jquery.mCustomScrollbar/jquery.mCustomScrollbar.cssnew file mode 100644index 000000000..e318b29c0--- /dev/null+++ b/css/ext/jquery.mCustomScrollbar/jquery.mCustomScrollbar.css@@ -0,0 +1,474 @@+/* basic scrollbar styling */+/* vertical scrollbar */+.mCSB_container{+ width:auto;+ margin-right:30px;+ overflow:hidden;+}+.mCSB_container.mCS_no_scrollbar{+ margin-right:0;+}+.mCS_disabled>.mCustomScrollBox>.mCSB_container.mCS_no_scrollbar,+.mCS_destroyed>.mCustomScrollBox>.mCSB_container.mCS_no_scrollbar{+ margin-right:30px;+}+.mCustomScrollBox>.mCSB_scrollTools{+ width:16px;+ height:100%;+ top:0;+ right:0;+}+.mCSB_scrollTools .mCSB_draggerContainer{+ position:absolute;+ top:0;+ left:0;+ bottom:0;+ right:0;+ height:auto;+}+.mCSB_scrollTools a+.mCSB_draggerContainer{+ margin:20px 0;+}+.mCSB_scrollTools .mCSB_draggerRail{+ width:2px;+ height:100%;+ margin:0 auto;+ -webkit-border-radius:10px;+ -moz-border-radius:10px;+ border-radius:10px;+}+.mCSB_scrollTools .mCSB_dragger{+ cursor:pointer;+ width:100%;+ height:30px;+}+.mCSB_scrollTools .mCSB_dragger .mCSB_dragger_bar{+ width:4px;+ height:100%;+ margin:0 auto;+ -webkit-border-radius:10px;+ -moz-border-radius:10px;+ border-radius:10px;+ text-align:center;+}+.mCSB_scrollTools .mCSB_buttonUp,+.mCSB_scrollTools .mCSB_buttonDown{+ display:block;+ position:relative;+ height:20px;+ overflow:hidden;+ margin:0 auto;+ cursor:pointer;+}+.mCSB_scrollTools .mCSB_buttonDown{+ top:100%;+ margin-top:-40px;+}+/* horizontal scrollbar */+.mCSB_horizontal>.mCSB_container{+ height:auto;+ margin-right:0;+ margin-bottom:30px;+ overflow:hidden;+}+.mCSB_horizontal>.mCSB_container.mCS_no_scrollbar{+ margin-bottom:0;+}+.mCS_disabled>.mCSB_horizontal>.mCSB_container.mCS_no_scrollbar,+.mCS_destroyed>.mCSB_horizontal>.mCSB_container.mCS_no_scrollbar{+ margin-right:0;+ margin-bottom:30px;+}+.mCSB_horizontal.mCustomScrollBox>.mCSB_scrollTools{+ width:100%;+ height:16px;+ top:auto;+ right:auto;+ bottom:0;+ left:0;+ overflow:hidden;+}+.mCSB_horizontal>.mCSB_scrollTools a+.mCSB_draggerContainer{+ margin:0 20px;+}+.mCSB_horizontal>.mCSB_scrollTools .mCSB_draggerRail{+ width:100%;+ height:2px;+ margin:7px 0;+ -webkit-border-radius:10px;+ -moz-border-radius:10px;+ border-radius:10px;+}+.mCSB_horizontal>.mCSB_scrollTools .mCSB_dragger{+ width:30px;+ height:100%;+}+.mCSB_horizontal>.mCSB_scrollTools .mCSB_dragger .mCSB_dragger_bar{+ width:100%;+ height:4px;+ margin:6px auto;+ -webkit-border-radius:10px;+ -moz-border-radius:10px;+ border-radius:10px;+}+.mCSB_horizontal>.mCSB_scrollTools .mCSB_buttonLeft,+.mCSB_horizontal>.mCSB_scrollTools .mCSB_buttonRight{+ display:block;+ position:relative;+ width:20px;+ height:100%;+ overflow:hidden;+ margin:0 auto;+ cursor:pointer;+ float:left;+}+.mCSB_horizontal>.mCSB_scrollTools .mCSB_buttonRight{+ margin-left:-40px;+ float:right;+}+.mCustomScrollBox{+ -ms-touch-action:none; /*MSPointer events - direct all pointer events to js*/+}++/* default scrollbar colors and backgrounds (default theme) */+.mCustomScrollBox>.mCSB_scrollTools{+ opacity:0.75;+ filter:"alpha(opacity=75)"; -ms-filter:"alpha(opacity=75)"; /* old ie */+}+.mCustomScrollBox:hover>.mCSB_scrollTools{+ opacity:1;+ filter:"alpha(opacity=100)"; -ms-filter:"alpha(opacity=100)"; /* old ie */+}+.mCSB_scrollTools .mCSB_draggerRail{+ background:#000; /* rgba fallback */+ background:rgba(0,0,0,0.4);+ filter:"alpha(opacity=40)"; -ms-filter:"alpha(opacity=40)"; /* old ie */+}+.mCSB_scrollTools .mCSB_dragger .mCSB_dragger_bar{+ background:#fff; /* rgba fallback */+ background:rgba(255,255,255,0.75);+ filter:"alpha(opacity=75)"; -ms-filter:"alpha(opacity=75)"; /* old ie */+}+.mCSB_scrollTools .mCSB_dragger:hover .mCSB_dragger_bar{+ background:rgba(255,255,255,0.85);+ filter:"alpha(opacity=85)"; -ms-filter:"alpha(opacity=85)"; /* old ie */+}+.mCSB_scrollTools .mCSB_dragger:active .mCSB_dragger_bar,+.mCSB_scrollTools .mCSB_dragger.mCSB_dragger_onDrag .mCSB_dragger_bar{+ background:rgba(255,255,255,0.9);+ filter:"alpha(opacity=90)"; -ms-filter:"alpha(opacity=90)"; /* old ie */+}+.mCSB_scrollTools .mCSB_buttonUp,+.mCSB_scrollTools .mCSB_buttonDown,+.mCSB_scrollTools .mCSB_buttonLeft,+.mCSB_scrollTools .mCSB_buttonRight{+ background-image:url(mCSB_buttons.png);+ background-repeat:no-repeat;+ opacity:0.4;+ filter:"alpha(opacity=40)"; -ms-filter:"alpha(opacity=40)"; /* old ie */+}+.mCSB_scrollTools .mCSB_buttonUp{+ background-position:0 0;+ /*+ sprites locations are 0 0/-16px 0/-32px 0/-48px 0 (light) and -80px 0/-96px 0/-112px 0/-128px 0 (dark)+ */+}+.mCSB_scrollTools .mCSB_buttonDown{+ background-position:0 -20px;+ /*+ sprites locations are 0 -20px/-16px -20px/-32px -20px/-48px -20px (light) and -80px -20px/-96px -20px/-112px -20px/-128px -20px (dark)+ */+}+.mCSB_scrollTools .mCSB_buttonLeft{+ background-position:0 -40px;+ /*+ sprites locations are 0 -40px/-20px -40px/-40px -40px/-60px -40px (light) and -80px -40px/-100px -40px/-120px -40px/-140px -40px (dark)+ */+}+.mCSB_scrollTools .mCSB_buttonRight{+ background-position:0 -56px;+ /*+ sprites locations are 0 -56px/-20px -56px/-40px -56px/-60px -56px (light) and -80px -56px/-100px -56px/-120px -56px/-140px -56px (dark)+ */+}+.mCSB_scrollTools .mCSB_buttonUp:hover,+.mCSB_scrollTools .mCSB_buttonDown:hover,+.mCSB_scrollTools .mCSB_buttonLeft:hover,+.mCSB_scrollTools .mCSB_buttonRight:hover{+ opacity:0.75;+ filter:"alpha(opacity=75)"; -ms-filter:"alpha(opacity=75)"; /* old ie */+}+.mCSB_scrollTools .mCSB_buttonUp:active,+.mCSB_scrollTools .mCSB_buttonDown:active,+.mCSB_scrollTools .mCSB_buttonLeft:active,+.mCSB_scrollTools .mCSB_buttonRight:active{+ opacity:0.9;+ filter:"alpha(opacity=90)"; -ms-filter:"alpha(opacity=90)"; /* old ie */+}++/*scrollbar themes*/+/*dark (dark colored scrollbar)*/+.mCS-dark>.mCSB_scrollTools .mCSB_draggerRail{+ background:#000; /* rgba fallback */+ background:rgba(0,0,0,0.15);+}+.mCS-dark>.mCSB_scrollTools .mCSB_dragger .mCSB_dragger_bar{+ background:#000; /* rgba fallback */+ background:rgba(0,0,0,0.75);+}+.mCS-dark>.mCSB_scrollTools .mCSB_dragger:hover .mCSB_dragger_bar{+ background:rgba(0,0,0,0.85);+}+.mCS-dark>.mCSB_scrollTools .mCSB_dragger:active .mCSB_dragger_bar,+.mCS-dark>.mCSB_scrollTools .mCSB_dragger.mCSB_dragger_onDrag .mCSB_dragger_bar{+ background:rgba(0,0,0,0.9);+}+.mCS-dark>.mCSB_scrollTools .mCSB_buttonUp{+ background-position:-80px 0;+}+.mCS-dark>.mCSB_scrollTools .mCSB_buttonDown{+ background-position:-80px -20px;+}+.mCS-dark>.mCSB_scrollTools .mCSB_buttonLeft{+ background-position:-80px -40px;+}+.mCS-dark>.mCSB_scrollTools .mCSB_buttonRight{+ background-position:-80px -56px;+}+/*light-2*/+.mCS-light-2>.mCSB_scrollTools .mCSB_draggerRail{+ width:4px;+ background:#fff; /* rgba fallback */+ background:rgba(255,255,255,0.1);+ -webkit-border-radius:1px;+ -moz-border-radius:1px;+ border-radius:1px;+}+.mCS-light-2>.mCSB_scrollTools .mCSB_dragger .mCSB_dragger_bar{+ width:4px;+ background:#fff; /* rgba fallback */+ background:rgba(255,255,255,0.75);+ -webkit-border-radius:1px;+ -moz-border-radius:1px;+ border-radius:1px;+}+.mCS-light-2.mCSB_horizontal>.mCSB_scrollTools .mCSB_draggerRail{+ width:100%;+ height:4px;+ margin:6px 0;+}+.mCS-light-2.mCSB_horizontal>.mCSB_scrollTools .mCSB_dragger .mCSB_dragger_bar{+ width:100%;+ height:4px;+ margin:6px auto;+}+.mCS-light-2>.mCSB_scrollTools .mCSB_dragger:hover .mCSB_dragger_bar{+ background:rgba(255,255,255,0.85);+}+.mCS-light-2>.mCSB_scrollTools .mCSB_dragger:active .mCSB_dragger_bar,+.mCS-light-2>.mCSB_scrollTools .mCSB_dragger.mCSB_dragger_onDrag .mCSB_dragger_bar{+ background:rgba(255,255,255,0.9);+}+.mCS-light-2>.mCSB_scrollTools .mCSB_buttonUp{+ background-position:-32px 0;+}+.mCS-light-2>.mCSB_scrollTools .mCSB_buttonDown{+ background-position:-32px -20px;+}+.mCS-light-2>.mCSB_scrollTools .mCSB_buttonLeft{+ background-position:-40px -40px;+}+.mCS-light-2>.mCSB_scrollTools .mCSB_buttonRight{+ background-position:-40px -56px;+}+/*dark-2*/+.mCS-dark-2>.mCSB_scrollTools .mCSB_draggerRail{+ width:4px;+ background:#000; /* rgba fallback */+ background:rgba(0,0,0,0.1);+ -webkit-border-radius:1px;+ -moz-border-radius:1px;+ border-radius:1px;+}+.mCS-dark-2>.mCSB_scrollTools .mCSB_dragger .mCSB_dragger_bar{+ width:4px;+ background:#000; /* rgba fallback */+ background:rgba(0,0,0,0.75);+ -webkit-border-radius:1px;+ -moz-border-radius:1px;+ border-radius:1px;+}+.mCS-dark-2.mCSB_horizontal>.mCSB_scrollTools .mCSB_draggerRail{+ width:100%;+ height:4px;+ margin:6px 0;+}+.mCS-dark-2.mCSB_horizontal>.mCSB_scrollTools .mCSB_dragger .mCSB_dragger_bar{+ width:100%;+ height:4px;+ margin:6px auto;+}+.mCS-dark-2>.mCSB_scrollTools .mCSB_dragger:hover .mCSB_dragger_bar{+ background:rgba(0,0,0,0.85);+}+.mCS-dark-2>.mCSB_scrollTools .mCSB_dragger:active .mCSB_dragger_bar,+.mCS-dark-2>.mCSB_scrollTools .mCSB_dragger.mCSB_dragger_onDrag .mCSB_dragger_bar{+ background:rgba(0,0,0,0.9);+}+.mCS-dark-2>.mCSB_scrollTools .mCSB_buttonUp{+ background-position:-112px 0;+}+.mCS-dark-2>.mCSB_scrollTools .mCSB_buttonDown{+ background-position:-112px -20px;+}+.mCS-dark-2>.mCSB_scrollTools .mCSB_buttonLeft{+ background-position:-120px -40px;+}+.mCS-dark-2>.mCSB_scrollTools .mCSB_buttonRight{+ background-position:-120px -56px;+}+/*light-thick*/+.mCS-light-thick>.mCSB_scrollTools .mCSB_draggerRail{+ width:4px;+ background:#fff; /* rgba fallback */+ background:rgba(255,255,255,0.1);+ -webkit-border-radius:2px;+ -moz-border-radius:2px;+ border-radius:2px;+}+.mCS-light-thick>.mCSB_scrollTools .mCSB_dragger .mCSB_dragger_bar{+ width:6px;+ background:#fff; /* rgba fallback */+ background:rgba(255,255,255,0.75);+ -webkit-border-radius:2px;+ -moz-border-radius:2px;+ border-radius:2px;+}+.mCS-light-thick.mCSB_horizontal>.mCSB_scrollTools .mCSB_draggerRail{+ width:100%;+ height:4px;+ margin:6px 0;+}+.mCS-light-thick.mCSB_horizontal>.mCSB_scrollTools .mCSB_dragger .mCSB_dragger_bar{+ width:100%;+ height:6px;+ margin:5px auto;+}+.mCS-light-thick>.mCSB_scrollTools .mCSB_dragger:hover .mCSB_dragger_bar{+ background:rgba(255,255,255,0.85);+}+.mCS-light-thick>.mCSB_scrollTools .mCSB_dragger:active .mCSB_dragger_bar,+.mCS-light-thick>.mCSB_scrollTools .mCSB_dragger.mCSB_dragger_onDrag .mCSB_dragger_bar{+ background:rgba(255,255,255,0.9);+}+.mCS-light-thick>.mCSB_scrollTools .mCSB_buttonUp{+ background-position:-16px 0;+}+.mCS-light-thick>.mCSB_scrollTools .mCSB_buttonDown{+ background-position:-16px -20px;+}+.mCS-light-thick>.mCSB_scrollTools .mCSB_buttonLeft{+ background-position:-20px -40px;+}+.mCS-light-thick>.mCSB_scrollTools .mCSB_buttonRight{+ background-position:-20px -56px;+}+/*dark-thick*/+.mCS-dark-thick>.mCSB_scrollTools .mCSB_draggerRail{+ width:4px;+ background:#000; /* rgba fallback */+ background:rgba(0,0,0,0.1);+ -webkit-border-radius:2px;+ -moz-border-radius:2px;+ border-radius:2px;+}+.mCS-dark-thick>.mCSB_scrollTools .mCSB_dragger .mCSB_dragger_bar{+ width:6px;+ background:#000; /* rgba fallback */+ background:rgba(0,0,0,0.75);+ -webkit-border-radius:2px;+ -moz-border-radius:2px;+ border-radius:2px;+}+.mCS-dark-thick.mCSB_horizontal>.mCSB_scrollTools .mCSB_draggerRail{+ width:100%;+ height:4px;+ margin:6px 0;+}+.mCS-dark-thick.mCSB_horizontal>.mCSB_scrollTools .mCSB_dragger .mCSB_dragger_bar{+ width:100%;+ height:6px;+ margin:5px auto;+}+.mCS-dark-thick>.mCSB_scrollTools .mCSB_dragger:hover .mCSB_dragger_bar{+ background:rgba(0,0,0,0.85);+}+.mCS-dark-thick>.mCSB_scrollTools .mCSB_dragger:active .mCSB_dragger_bar,+.mCS-dark-thick>.mCSB_scrollTools .mCSB_dragger.mCSB_dragger_onDrag .mCSB_dragger_bar{+ background:rgba(0,0,0,0.9);+}+.mCS-dark-thick>.mCSB_scrollTools .mCSB_buttonUp{+ background-position:-96px 0;+}+.mCS-dark-thick>.mCSB_scrollTools .mCSB_buttonDown{+ background-position:-96px -20px;+}+.mCS-dark-thick>.mCSB_scrollTools .mCSB_buttonLeft{+ background-position:-100px -40px;+}+.mCS-dark-thick>.mCSB_scrollTools .mCSB_buttonRight{+ background-position:-100px -56px;+}+/*light-thin*/+.mCS-light-thin>.mCSB_scrollTools .mCSB_draggerRail{+ background:#fff; /* rgba fallback */+ background:rgba(255,255,255,0.1);+}+.mCS-light-thin>.mCSB_scrollTools .mCSB_dragger .mCSB_dragger_bar{+ width:2px;+}+.mCS-light-thin.mCSB_horizontal>.mCSB_scrollTools .mCSB_draggerRail{+ width:100%;+}+.mCS-light-thin.mCSB_horizontal>.mCSB_scrollTools .mCSB_dragger .mCSB_dragger_bar{+ width:100%;+ height:2px;+ margin:7px auto;+}+/*dark-thin*/+.mCS-dark-thin>.mCSB_scrollTools .mCSB_draggerRail{+ background:#000; /* rgba fallback */+ background:rgba(0,0,0,0.15);+}+.mCS-dark-thin>.mCSB_scrollTools .mCSB_dragger .mCSB_dragger_bar{+ width:2px;+ background:#000; /* rgba fallback */+ background:rgba(0,0,0,0.75);+}+.mCS-dark-thin.mCSB_horizontal>.mCSB_scrollTools .mCSB_draggerRail{+ width:100%;+}+.mCS-dark-thin.mCSB_horizontal>.mCSB_scrollTools .mCSB_dragger .mCSB_dragger_bar{+ width:100%;+ height:2px;+ margin:7px auto;+}+.mCS-dark-thin>.mCSB_scrollTools .mCSB_dragger:hover .mCSB_dragger_bar{+ background:rgba(0,0,0,0.85);+}+.mCS-dark-thin>.mCSB_scrollTools .mCSB_dragger:active .mCSB_dragger_bar,+.mCS-dark-thin>.mCSB_scrollTools .mCSB_dragger.mCSB_dragger_onDrag .mCSB_dragger_bar{+ background:rgba(0,0,0,0.9);+}+.mCS-dark-thin>.mCSB_scrollTools .mCSB_buttonUp{+ background-position:-80px 0;+}+.mCS-dark-thin>.mCSB_scrollTools .mCSB_buttonDown{+ background-position:-80px -20px;+}+.mCS-dark-thin>.mCSB_scrollTools .mCSB_buttonLeft{+ background-position:-80px -40px;+}+.mCS-dark-thin>.mCSB_scrollTools .mCSB_buttonRight{+ background-position:-80px -56px;+}\ No newline at end of filediff --git a/css/products.css b/css/products.cssnew file mode 100644index 000000000..6586dbb5b--- /dev/null+++ b/css/products.css@@ -0,0 +1,39 @@+#productsHolder {display:block; float:left; z-index:200; width:238px; height:300px; position:relative; top:10%;}++.products {display:block; float:left; width:210px; min-height:275px; max-height:300px; position:relative; overflow:hidden;+background: rgba(38,43,49,0.65); border-radius:0 10px 10px 0;+}++.ui-tabs-nav {clear:both; display:block; overflow:hidden; width:100%; border-radius:0; border-bottom: 3px #00457b solid;}+.ui-tabs-nav li a {/*border-radius: 10px 10px 0 0;*/ font:14px "gill sans", sans-serif; display:inline-block; float: left; color:#ffffff; font-size: 14px; font-weight:400; border:none; padding:6px 0px 6px 0px; width:50%;++text-align:center; text-decoration:none; text-shadow:none;+}++.ui-tabs-nav li.first.ui-state-active a {background: -moz-linear-gradient(top, rgba(255,255,255,0.7) 0%, rgba(11,95,160,0.7) 23%, rgba(0,88,156,0.7) 24%, rgba(0,81,144,0.7) 99%, rgba(0,81,144,0.7) 100%); /* FF3.6+ */+background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,rgba(255,255,255,0.7)), color-stop(23%,rgba(11,95,160,0.7)), color-stop(24%,rgba(0,88,156,0.7)), color-stop(99%,rgba(0,81,144,0.7)), color-stop(100%,rgba(0,81,144,0.7))); /* Chrome,Safari4+ */+background: -webkit-linear-gradient(top, rgba(255,255,255,0.7) 0%,rgba(11,95,160,0.7) 23%,rgba(0,88,156,0.7) 24%,rgba(0,81,144,0.7) 99%,rgba(0,81,144,0.7) 100%); /* Chrome10+,Safari5.1+ */+background: -o-linear-gradient(top, rgba(255,255,255,0.7) 0%,rgba(11,95,160,0.7) 23%,rgba(0,88,156,0.7) 24%,rgba(0,81,144,0.7) 99%,rgba(0,81,144,0.7) 100%); /* Opera 11.10+ */+background: -ms-linear-gradient(top, rgba(255,255,255,0.7) 0%,rgba(11,95,160,0.7) 23%,rgba(0,88,156,0.7) 24%,rgba(0,81,144,0.7) 99%,rgba(0,81,144,0.7) 100%); /* IE10+ */+background: linear-gradient(to bottom, rgba(255,255,255,0.7) 0%,rgba(11,95,160,0.7) 23%,rgba(0,88,156,0.7) 24%,rgba(0,81,144,0.7) 99%,rgba(0,81,144,0.7) 100%); /* W3C */+filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#b3ffffff', endColorstr='#b3005190',GradientType=0 ); /* IE6-9 */}++.ui-tabs-nav li.second.ui-state-active a {+ background: -moz-linear-gradient(top, rgba(255,255,255,0.7) 0%, rgba(160,121,11,0.7) 23%, rgba(156,115,0,0.7) 24%, rgba(144,106,0,0.7) 99%, rgba(144,106,0,0.7) 100%); /* FF3.6+ */+background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,rgba(255,255,255,0.7)), color-stop(23%,rgba(160,121,11,0.7)), color-stop(24%,rgba(156,115,0,0.7)), color-stop(99%,rgba(144,106,0,0.7)), color-stop(100%,rgba(144,106,0,0.7))); /* Chrome,Safari4+ */+background: -webkit-linear-gradient(top, rgba(255,255,255,0.7) 0%,rgba(160,121,11,0.7) 23%,rgba(156,115,0,0.7) 24%,rgba(144,106,0,0.7) 99%,rgba(144,106,0,0.7) 100%); /* Chrome10+,Safari5.1+ */+background: -o-linear-gradient(top, rgba(255,255,255,0.7) 0%,rgba(160,121,11,0.7) 23%,rgba(156,115,0,0.7) 24%,rgba(144,106,0,0.7) 99%,rgba(144,106,0,0.7) 100%); /* Opera 11.10+ */+background: -ms-linear-gradient(top, rgba(255,255,255,0.7) 0%,rgba(160,121,11,0.7) 23%,rgba(156,115,0,0.7) 24%,rgba(144,106,0,0.7) 99%,rgba(144,106,0,0.7) 100%); /* IE10+ */+background: linear-gradient(to bottom, rgba(255,255,255,0.7) 0%,rgba(160,121,11,0.7) 23%,rgba(156,115,0,0.7) 24%,rgba(144,106,0,0.7) 99%,rgba(144,106,0,0.7) 100%); /* W3C */+filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#b3ffffff', endColorstr='#b3906a00',GradientType=0 ); /* IE6-9 */+}++.firstselected {+ border-bottom: 3px #00457b solid;+}++.secondselected {+ border-bottom: 3px #906a00 solid;++}+diff --git a/css/selector.css b/css/selector.cssindex 96ec2ce78..30dcd9bb4 100644--- a/css/selector.css+++ b/css/selector.css@@ -1,16 +1,37 @@#selector {display:none;}-.selector { display:block; width: 100%; height:510px; padding-bottom:20px; font: 10px/12px "Gill Sans","helvetica",sans-serif !important; color: #141b4c; border-radius: 10px; text-shadow:none; overflow:auto;}+.selector { display:inline-block; float:left; width: 210px; height:245px; padding-bottom:20px; font: 10px/12px "Gill Sans","helvetica",sans-serif !important; color: #141b4c; text-shadow:none; overflow:auto; }++.selector h1,h2,h3,h4 {margin:0px; padding:0px;+}+.selector h2 {font:14px "gill sans", sans-serif; display:inline-block; float: right; color:#ffffff; font-size: 14px; font-weight:100; border:none; padding:9px 30px 9px 30px;+background: -moz-linear-gradient(top, rgba(255,255,255,0.7) 0%, rgba(160,121,11,0.7) 23%, rgba(156,115,0,0.7) 24%, rgba(144,106,0,0.7) 99%, rgba(144,106,0,0.7) 100%); /* FF3.6+ */+background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,rgba(255,255,255,0.7)), color-stop(23%,rgba(160,121,11,0.7)), color-stop(24%,rgba(156,115,0,0.7)), color-stop(99%,rgba(144,106,0,0.7)), color-stop(100%,rgba(144,106,0,0.7))); /* Chrome,Safari4+ */+background: -webkit-linear-gradient(top, rgba(255,255,255,0.7) 0%,rgba(160,121,11,0.7) 23%,rgba(156,115,0,0.7) 24%,rgba(144,106,0,0.7) 99%,rgba(144,106,0,0.7) 100%); /* Chrome10+,Safari5.1+ */+background: -o-linear-gradient(top, rgba(255,255,255,0.7) 0%,rgba(160,121,11,0.7) 23%,rgba(156,115,0,0.7) 24%,rgba(144,106,0,0.7) 99%,rgba(144,106,0,0.7) 100%); /* Opera 11.10+ */+background: -ms-linear-gradient(top, rgba(255,255,255,0.7) 0%,rgba(160,121,11,0.7) 23%,rgba(156,115,0,0.7) 24%,rgba(144,106,0,0.7) 99%,rgba(144,106,0,0.7) 100%); /* IE10+ */+background: linear-gradient(to bottom, rgba(255,255,255,0.7) 0%,rgba(160,121,11,0.7) 23%,rgba(156,115,0,0.7) 24%,rgba(144,106,0,0.7) 99%,rgba(144,106,0,0.7) 100%); /* W3C */+filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#b3ffffff', endColorstr='#b3906a00',GradientType=0 ); /* IE6-9 */++}+.selector .tabContainer {border-bottom: 2px #906a00 solid; }-.selector h1,h2,h3,h4 {margin:0px; padding:0px;}-.selector h2 {display:inline-block; float: left; color:#ffffff; font-size: 14px; font-weight:100; border:none; padding:6px 0;}.selector h3 {display:inline-block; float: left; color:#333333; font-size: 12px; font-weight:100; border:none; text-decoration:none; }-.selector div,.selector ul {display:block; overflow:hidden; width:98%; margin:0 auto; padding:5px;}-.selector li.selectorItem {padding:0; display:block; background:#fff; width:200px; height:38px;border-radius:5px; padding:5px; margin-top:10px; float:left; margin-left:5px; overflow:hidden;}+.selector div,.selector ul {display:block; overflow:hidden;margin:0 auto; width:100%;}+.selector li.selectorItem {padding:8px 9px 8px 3px; width:198px; display:block; float:left; overflow:hidden;+color:#fffbe7;+background: -moz-linear-gradient(top, rgba(0,0,0,0.24) 0%, rgba(2,2,2,0.24) 1%, rgba(78,78,78,0.24) 50%, rgba(0,0,0,0.24) 100%); /* FF3.6+ */+background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,rgba(0,0,0,0.24)), color-stop(1%,rgba(2,2,2,0.24)), color-stop(50%,rgba(78,78,78,0.24)), color-stop(100%,rgba(0,0,0,0.24))); /* Chrome,Safari4+ */+background: -webkit-linear-gradient(top, rgba(0,0,0,0.24) 0%,rgba(2,2,2,0.24) 1%,rgba(78,78,78,0.24) 50%,rgba(0,0,0,0.24) 100%); /* Chrome10+,Safari5.1+ */+background: -o-linear-gradient(top, rgba(0,0,0,0.24) 0%,rgba(2,2,2,0.24) 1%,rgba(78,78,78,0.24) 50%,rgba(0,0,0,0.24) 100%); /* Opera 11.10+ */+background: -ms-linear-gradient(top, rgba(0,0,0,0.24) 0%,rgba(2,2,2,0.24) 1%,rgba(78,78,78,0.24) 50%,rgba(0,0,0,0.24) 100%); /* IE10+ */+background: linear-gradient(to bottom, rgba(0,0,0,0.24) 0%,rgba(2,2,2,0.24) 1%,rgba(78,78,78,0.24) 50%,rgba(0,0,0,0.24) 100%); /* W3C */+filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#3d000000', endColorstr='#3d000000',GradientType=0 ); /* IE6-9 */}.selector li.selectorItem input {float:right;}-.selector li.selectorItem h4 {font-size:9px !important; font-weight:bold !important; color: #141b4c !important;}-.selector ul.category { min-height:170px; background: rgba(255,255,255,.7); border-radius:5px; margin-top:10px; max-height:190px; overflow:auto;}-.selector ul.category li h3 {display:block !important; clear:both; float:none !important; color:#333333 !important; margin-left:5px;}+.selector li.selectorItem h4 {font-size:9px !important; font-weight:bold !important; color:#fffbe7 !important;padding: 0 3px;}+.selector li.selectorItem p {padding: 0 3px; }+.selector ul.category { border-radius:5px; max-height:90px; float:left; }+.selector h3.head {display:block; float: left; color:#ffffff; font-size: 10px !important; width:204px; font-weight:100; border:none; text-decoration:none; background: rgba(120,120,120,.7); margin-top:2px; padding: 1px 3px !important;}.selector a.flowbutton {text-decoration:none; display:inline-block; float: left; color:#ffffff !important; font-size: 14px; font-weight:100; border:none; padding:6px 0; margin-top:20px; margin-left:5px;}.selector ul li div {padding:0 !important;}.selector ul.toplevel {padding:0px;}@@ -21,3 +42,26 @@#selector .hd {background: rgba(38, 43, 49, 0.65) !important;border-radius: 10px 10px 0 0; }#selector_c .yui-panel {border-radius:10px;}#selector_c .underlay {border-radius:10px;}++.search {display: inline-block; width:56%; height:16px; padding:2px 2%; margin:0px; line-height:12px; font-size:10px; position:relative; border:none; }+.select {display: inline-block; width:40%; height:16px; padding:2px 0; line-height:12px; font-size:10px; background:#ffffff; border:none; }++.facetedSearch {display:block; background:#fff; width:96% !important; margin: 5px auto !important; border-radius: 5px; }++input[type="checkbox"] {+ display:none;+}+input[type="checkbox"] {+ display:inline-block;+ width:19px;+ height:19px;+ margin:-1px 4px 0 0;+ vertical-align:middle;+ background:url("../images/checkboxes.png");+ cursor:pointer;+}++input[type="checkbox"]:checked {+ background:url("../images/checkboxes.png") -19px top no-repeat;+}+diff --git a/css/sote.css b/css/sote.cssindex 8cd14f76a..d1052809c 100644--- a/css/sote.css+++ b/css/sote.css@@ -3,6 +3,9 @@ body {/*min-width:600px;*/ width:100%;}div {display:block;}.yui-skin-sam .yui-panel {background: transparent; width:700px; font: 13px "Gill Sans", sans-serif; font-weight:100;}+#selector_c .yui-panel {background: transparent; width:210px; font: 13px "Gill Sans", sans-serif; font-weight:100;}+#selector_c .yui-panel .bd {padding:0 !important;}+.yui-skin-sam .yui-panel-container .hd{ background:rgba(38, 43, 49, 0.65); color:#ffffff; border-bottom: none; padding:0; padding-left: 10px;}.yui-skin-sam .yui-panel-container .bd{ background:rgba(18, 18, 18, 0.75); color:#d7d7d7;}.yui-skin-sam .yui-panel-container .ft{ background:rgba(18, 18, 18, 0.75); color:#d7d7d7;}@@ -50,7 +53,7 @@ div.horizontalContainer {width:100%; display:block; float:left; position:absolu.hidden {display:none;}-#products { z-index:200; display:block; float:left; position:absolute; left:0; top:15%;}+#products {display:block; float:left; position:relative; left:0; }#banner {display:block; z-index:291; float:left; position:relative; width:100%; height: 49px; background: transparent url("../images/toolbarbg.png");diff --git a/data/geographic_ap_products.php b/data/geographic_ap_products.phpindex 55e2a0eac..b0d782a68 100644--- a/data/geographic_ap_products.php+++ b/data/geographic_ap_products.php@@ -23,7 +23,7 @@"label" => "Land Surface Reflectance (True Color)","sublabel" => "Aqua / MODIS","value" => "MODIS_Aqua_SurfaceReflectance_Bands143",- "type" => "single", "category" => "baselayers"+ "type" => "single", "category" => "baselayers", "tags" => "hello"),array("label" => "Corrected Reflectance (7-2-1)",@@ -979,7 +979,7 @@"label" => "Corrected Reflectance (True Color)","sublabel" => "Terra / MODIS","value" => "MODIS_Terra_CorrectedReflectance_TrueColor",- "type" => "single", "category" => "baselayers"+ "type" => "single", "category" => "baselayers", "tags" => "hello"),array("label" => "Corrected Reflectance (True Color)",diff --git a/images/bank-item-bg.png b/images/bank-item-bg.pngnew file mode 100644index 000000000..0a54ef9a6Binary files /dev/null and b/images/bank-item-bg.png differdiff --git a/images/checkboxes.png b/images/checkboxes.pngnew file mode 100644index 000000000..f6f4dee4aBinary files /dev/null and b/images/checkboxes.png differdiff --git a/images/close.png b/images/close.pngindex 5d037cccc..a9868beb3 100644Binary files a/images/close.png and b/images/close.png differdiff --git a/images/invisible.png b/images/invisible.pngnew file mode 100644index 000000000..3733e296fBinary files /dev/null and b/images/invisible.png differdiff --git a/images/visible.png b/images/visible.pngnew file mode 100644index 000000000..ace5ef313Binary files /dev/null and b/images/visible.png differdiff --git a/index.html b/index.htmlindex 861a8112c..4321ba7fe 100755--- a/index.html+++ b/index.html@@ -35,6 +35,7 @@<!-- css.dev --> <link type="text/css" href="css/ext/joyride-2.0.3/joyride-2.0.3.css" rel="Stylesheet"/><!-- css.dev --> <link type="text/css" href="css/ext/jcrop-0.9.10-p1/jcrop.css" rel="Stylesheet" />+ <!-- css.dev --> <link type="text/css" href="css/ext/jquery.mCustomScrollbar/jquery.mCustomScrollbar.css" rel="Stylesheet" /><!-- css.dev --> <link type="text/css" href="css/map.css" rel="Stylesheet" /><!-- css.dev --> <link type="text/css" href="css/dateSpan.css" rel="Stylesheet" />@@ -45,6 +46,7 @@<!-- css.dev --> <link type="text/css" href="css/sote.css" rel="Stylesheet" /><!-- css.dev --> <link type="text/css" href="css/palette.css" rel="Stylesheet"/><!-- css.dev --> <link type="text/css" href="css/splash.css" rel="Stylesheet" />+ <!-- css.dev --> <link type="text/css" href="css/products.css" rel="Stylesheet" /><!-- JavaScript resources ============================================= --><!-- <script type="text/javascript" src="js/worldview-min.js?v=@BUILD_NONCE@&mobile"></script> -->@@ -54,6 +56,8 @@<!-- js.dev --> <script type="text/javascript" src="js/ext/jquery-1.6.4/jquery.js"></script><!-- js.dev --> <script type="text/javascript" src="js/ext/jqueryui-1.8.16/jquery-ui.min.js" ></script><!-- js.dev --> <script type="text/javascript" src="js/ext/jquery.mobile-1.0rc2/jquery.mobile.js"></script>+ <!-- js.dev --> <script type="text/javascript" src="js/ext/jquery.mCustomScrollbar/jquery.mCustomScrollbar.js"></script>+<!-- js.dev --> <script type="text/javascript" src="js/ext/yui-2.9.0/yahoo/yahoo.js"></script><!-- js.dev --> <script type="text/javascript" src="js/ext/yui-2.9.0/event/event.js"></script>@@ -86,6 +90,7 @@<!-- js.dev --> <script type="text/javascript" src="js/bank.js"></script><!-- js.dev --> <script type="text/javascript" src="js/switch.js"></script><!-- js.dev --> <script type="text/javascript" src="js/selector.js"></script>+ <!-- js.dev --> <script type="text/javascript" src="js/products.js"></script><!-- js.dev --> <script type="text/javascript" src="js/sote.js"></script><!-- js.dev --> <script type="text/javascript" src="js/Logging.js"></script>@@ -134,7 +139,7 @@<!--<div id="aboutus"><a id='aboutus_link' class='aboutus_link' href='javascript:showOverlay();'><img src='images/aboutIcon.png' /></a></div><div id="permalink"><a id='perma_link' class='aboutus_link' href='javascript:showPermalink();'><img src='images/permalinkIcon.png' /></a></div>--><div id="hazard"></div>- <div id="products" style="padding-right:15px;"></div>+ <div id="productsHolder"></div><div id="map"></div><div id="imagedownload"></div>diff --git a/js/Worldview/Palette/ColorBar.js b/js/Worldview/Palette/ColorBar.jsindex 632508fdb..c2bb81da1 100644--- a/js/Worldview/Palette/ColorBar.js+++ b/js/Worldview/Palette/ColorBar.js@@ -104,8 +104,11 @@ Worldview.Palette.ColorBar = function(spec) {// The canavs dimensions does not equal the element dimensions! Make// them the same or scaling will occur.- canvas.width = $canvas.width();- canvas.height = $canvas.height();++ // tj, 5/16/13, edit: the element client width and height will be 0 in the new+ // product picker design because the bank is not visible when colorbars are rendered+ /*canvas.width = $canvas.width();+ canvas.height = $canvas.height();*/} else {canvas = docuemnt.createElement("canvas");canvas.width = spec.width;diff --git a/js/bank.js b/js/bank.jsindex 5f73eb785..1c035becd 100644--- a/js/bank.js+++ b/js/bank.js@@ -64,6 +64,7 @@ SOTE.widget.Bank = function(containerId, config){this.selector = config.selector;this.meta = new Object;this.buildMetaDone = false;+ this.hidden = new Object;/*this.meta["MODIS_Terra_CorrectedReflectance_TrueColor"] = {label:"Corrected Reflectance (True Color)",sublabel:"Terra / MODIS"};this.meta["fires48"] = {label:"Fires (Past 48 Hours)",sublabel:"MODIS Fire and Thermal Anomalies"};this.meta["AIRS_Dust_Score"] = {label:"Dust Score",sublabel:"Aqua / AIRS"};@@ -95,7 +96,7 @@ SOTE.widget.Bank.handleMetaSuccess = function(data,status,xhr,args){for(var i in data){if(i != "palettes") {for(var j=0; j<data[i].length; j++){- self.meta[data[i][j].value] = {label:data[i][j].label,sublabel:data[i][j].sublabel};+ self.meta[data[i][j].value] = {label:data[i][j].label,sublabel:data[i][j].sublabel,type:data[i][j].type};}}}@@ -161,26 +162,30 @@ SOTE.widget.Bank.prototype.init = function(){SOTE.widget.Bank.prototype.render = function(){this.container.innerHTML = "";-- //$('#'+this.id).addClass('bank');++/* var tabs = document.createElement("ul");+ tabs.innerHTML = "<li><a href='#bank' class='activetab'>Active</a></li><li><a class='addlayerstab' href='#selectorbox'>Add Layers</a></li>";+ this.container.appendChild(tabs);+ */var container = document.createElement("div");+ container.setAttribute("id","bank");container.setAttribute("class","bank");- var titleContainer = document.createElement("div");- var title = document.createElement("h2");- title.innerHTML = this.title;- var ext = document.createElement("a");+ //var titleContainer = document.createElement("div");+ //titleContainer.setAttribute("class","tabContainer");+ //var title = document.createElement("h2");+ //title.innerHTML = "Active"; //this.title;+ /*var ext = document.createElement("a");ext.setAttribute("id","callSelectorLink");ext.setAttribute("class","callSelectorLink");ext.setAttribute("title","Show Product Listing");+ */+ //titleContainer.appendChild(title);+ //titleContainer.appendChild(ext);- titleContainer.appendChild(title);- titleContainer.appendChild(ext);+ //container.appendChild(titleContainer);- container.appendChild(titleContainer);-- $('#'+this.id).delegate('.callSelectorLink','click',{selector:this.selector},this.callback);-+ //$('#'+this.id).delegate('.callSelectorLink','click',{selector:this.selector},this.callback);for(var i=0; i<this.categories.length; i++){var formattedCategoryName = this.categories[i].replace(/\s/g, "");@@ -192,18 +197,25 @@ SOTE.widget.Bank.prototype.render = function(){categoryTitle.setAttribute("class","head");categoryTitle.innerHTML = this.categories[i];categoryTitleEl.appendChild(categoryTitle);- category.appendChild(categoryTitleEl);+ container.appendChild(categoryTitleEl);if(this.values !== null && this.values[formattedCategoryName.toLowerCase()]){for(var j=0; j<this.values[formattedCategoryName.toLowerCase()].length; j++){+ var myVal = this.values[formattedCategoryName.toLowerCase()][j].valuevar item = document.createElement("li");- item.setAttribute("id",formattedCategoryName.toLowerCase()+"-"+this.values[formattedCategoryName.toLowerCase()][j].value);+ item.setAttribute("id",formattedCategoryName.toLowerCase()+"-"+myVal);item.setAttribute("class",this.id+"item item");- item.innerHTML = "<a><img class='close' id='"+this.values[formattedCategoryName.toLowerCase()][j].value.replace(/:/g,"colon")+"' src='images/close.png' /></a>";- if(this.meta !== null && this.meta[this.values[formattedCategoryName.toLowerCase()][j].value]){- item.innerHTML += "<h4>"+this.meta[this.values[formattedCategoryName.toLowerCase()][j].value].label+"</h4>";- item.innerHTML += "<p>"+this.meta[this.values[formattedCategoryName.toLowerCase()][j].value].sublabel+"</p>";- var m = this.meta[this.values[formattedCategoryName.toLowerCase()][j].value];+ item.innerHTML = "<a><img class='close' id='close"+myVal.replace(/:/g,"colon")+"' src='images/close.png' /></a>";+ if(this.meta !== null && this.meta[myVal]){+ if(myVal in this.hidden){+ item.innerHTML += "<a class='hdanchor'><img class='hide hideReg' id='hide"+myVal.replace(/:/g,"colon")+"' src='images/invisible.png' /></a>";+ }+ else {+ item.innerHTML += "<a class='hdanchor'><img class='hide hideReg' id='hide"+myVal.replace(/:/g,"colon")+"' src='images/visible.png' /></a>";+ }+ item.innerHTML += "<h4>"+this.meta[myVal].label+"</h4>";+ item.innerHTML += "<p>"+this.meta[myVal].sublabel+"</p>";+ var m = this.meta[myVal];/*if(m.paletteString){item.innerHTML += m.paletteString;}@@ -224,11 +236,11 @@ SOTE.widget.Bank.prototype.render = function(){item.innerHTML += paletteString;}*/if(m.palette){- var paletteString = "<span class='palette'><span class='p-min' style='margin-right:10px;'>"+m.min+"</span>" ++ var paletteString = "<div><span class='palette'><span class='p-min' style='margin-right:10px;'>"+m.min+"</span>" +"<canvas class='colorBar' id='canvas"+this.values[formattedCategoryName.toLowerCase()][j].value+"' width=100px height=14px'></canvas>" +"<span class='p-max' style='margin-left:10px;'>"+m.max+"</span>";if(m.units && m.units != ""){- paletteString += "<span class='units' style='margin-left:3px;'>("+m.units+")</span></span>";+ paletteString += "<span class='units' style='margin-left:3px;'>("+m.units+")</span></span></div>";}item.innerHTML += paletteString;}@@ -244,17 +256,38 @@ SOTE.widget.Bank.prototype.render = function(){container.appendChild(category);}this.container.appendChild(container);+ /*+ var selectorbox = document.createElement("div");+ selectorbox.setAttribute("id","selectorbox");+ this.container.appendChild(selectorbox);*/+this.renderCanvases();- var accordionToggler = document.createElement("a");+ /*var accordionToggler = document.createElement("a");accordionToggler.setAttribute("class","accordionToggler atcollapse");accordionToggler.setAttribute("title","Hide Products");this.isCollapsed = false;this.container.appendChild(accordionToggler);- $('.accordionToggler').bind('click',{self:this},SOTE.widget.Bank.toggle);+ $('.accordionToggler').bind('click',{self:this},SOTE.widget.Bank.toggle);*/+ $("#"+this.id).undelegate(".close" ,'click');+ $("#"+this.id).undelegate(".hideReg" ,'click');+ $("#"+this.id).undelegate(".hideSingle" ,'click');$("#"+this.id).delegate(".close" ,'click',{self:this},SOTE.widget.Bank.removeValue);+ $("#"+this.id).delegate(".hideReg" ,'click',{self:this},SOTE.widget.Bank.toggleValue);+ $("#"+this.id).delegate(".hideSingle" ,'click',{self:this},SOTE.widget.Bank.toggleValue);$( "." + this.id + "category" ).sortable({items: "li:not(.head)"});+ $( "." + this.id + "category" ).mCustomScrollbar("destroy");+ $( "." + this.id + "category" ).mCustomScrollbar({horizontalScroll:false, advanced:{+ updateOnContentResize: true+ }});$( "." + this.id + "category li" ).disableSelection();$( "." + this.id + "category" ).bind('sortstop',{self:this},SOTE.widget.Bank.handleSort);++ //this.hideAllRadioExceptTop();++ /*$('#'+this.id).tabs();+ //this.b = new SOTE.widget.Bank("products",{paletteWidget: window.palettes, dataSourceUrl:"ap_products.php",title:"My Layers",selected:{antarctic:"baselayers,MODIS_Terra_CorrectedReflectance_TrueColor~overlays,antarctic_coastlines", arctic:"baselayers,MODIS_Terra_CorrectedReflectance_TrueColor~overlays,arctic_coastlines",geographic:"baselayers,MODIS_Terra_CorrectedReflectance_TrueColor~overlays,sedac_bound"},categories:["Base Layers","Overlays"],config:config});+ this.s = new SOTE.widget.Selector("selectorbox",{dataSourceUrl:"ap_products.php",categories:["Base Layers","Overlays"]}); */+// Mark the component as ready in the registry if called via init()if ((this.initRenderComplete === false) && REGISTRY) {this.initRenderComplete = true;@@ -345,6 +378,7 @@ SOTE.widget.Bank.handleSort = function(e,ui){SOTE.widget.Bank.removeValue = function(e){var self = e.data.self;var val = e.target.id.replace(/colon/g,":");+ val = val.replace(/close/g,"");for(var i=0; i<self.categories.length; i++){var formatted = self.categories[i].replace(/\s/g, "");formatted = formatted.toLowerCase();@@ -354,12 +388,106 @@ SOTE.widget.Bank.removeValue = function(e){}}}- var formattedVal = val.replace(/:/g,"colon");+ var formattedVal = "close"+val.replace(/:/g,"colon");//self.render();$("#"+self.id+" #"+formattedVal).parent().parent().remove();self.fire();};+SOTE.widget.Bank.toggleValue = function(e){+ var self = e.data.self;+ var val = e.target.id.replace(/colon/g,":");+ val = val.replace(/hide/g,"");+ for(var i=0; i<self.categories.length; i++){+ var formatted = self.categories[i].replace(/\s/g, "");+ formatted = formatted.toLowerCase();+ for(var j=0; j<self.values[formatted].length; j++){+ if(self.values[formatted][j].value == val){+ if(val in self.hidden){+ delete self.hidden[val];+ e.target.src = 'images/visible.png';+ }+ else {+ self.hidden[val] = 1;+ e.target.src = 'images/invisible.png';+ }+++ }+ }+ }+ //var formattedVal = val.replace(/:/g,"colon");+ //self.render();+ //$("#"+self.id+" #"+formattedVal).parent().parent().remove();+ self.fire();+};++SOTE.widget.Bank.prototype.hideAllRadioExceptTop = function(){+ for(var i=0; i<this.categories.length - 1; i++){+ var formatted = this.categories[i].replace(/\s/g, "");+ formatted = formatted.toLowerCase();+ for(var j=1; j<this.values[formatted].length; j++){++ this.hidden[this.values[formatted][j].value] = 1;+ $('#hide'+this.values[formatted][j].value).attr("src",'images/invisible.png');++ }+ }+};++SOTE.widget.Bank.radioToggleValue = function(e){+ var self = e.data.self;+ var val = e.target.id.replace(/colon/g,":");+ var cat = -1;+ var hidden = false;+ val = val.replace(/hide/g,"");++ for(var i=0; i<self.categories.length; i++){+ var formatted = self.categories[i].replace(/\s/g, "");+ formatted = formatted.toLowerCase();+ for(var j=0; j<self.values[formatted].length; j++){+ if(self.values[formatted][j].value == val){+ if(val in self.hidden){+ delete self.hidden[val];+ e.target.src = 'images/visible.png';+ for(var k=0; k<self.values[formatted].length; k++){+ if(self.values[formatted][k].value != val){+ self.hidden[self.values[formatted][k].value] = 1;+ $('#hide'+self.values[formatted][k].value).attr("src",'images/invisible.png');+ }+ }+ }+ else {+ self.hidden[val] = 1;+ e.target.src = 'images/invisible.png';+ if(j+1 < self.values[formatted].length){+ if(self.hidden[self.values[formatted][j+1].value]){+ delete self.hidden[self.values[formatted][j+1].value];+ $('#hide'+self.values[formatted][j+1].value).attr("src",'images/visible.png');+ }+ }+ else {+ if(self.hidden[self.values[formatted][0].value]){+ delete self.hidden[self.values[formatted][0].value];+ $('#hide'+self.values[formatted][0].value).attr("src",'images/visible.png');++ }+ }+ }++ }+ }+ }+++ //var formattedVal = val.replace(/:/g,"colon");+ //self.render();+ //$("#"+self.id+" #"+formattedVal).parent().parent().remove();+ self.fire();+};+++/*** Fires an event to the registry when the state of the component is changed*@@ -412,6 +540,12 @@ SOTE.widget.Bank.prototype.getValue = function(){return this.id + "=" + value;};+SOTE.widget.Bank.prototype.value = function(){++ var value = this.serialize(this.values);+ return value;+};+SOTE.widget.Bank.prototype.serialize = function(values){var serialized = "";for(var i=0; i<this.categories.length; i++){@@ -424,7 +558,11 @@ SOTE.widget.Bank.prototype.serialize = function(values){serialized += formatted;if(values[formatted]){for(var j=0; j<values[formatted].length; j++){- serialized += "," + values[formatted][j].value;+ if(!(values[formatted][j].value in this.hidden)){+ serialized += "," + values[formatted][j].value;+ }else {+ serialized += "," + "!" + values[formatted][j].value;+ }}}}@@ -433,15 +571,21 @@ SOTE.widget.Bank.prototype.serialize = function(values){SOTE.widget.Bank.prototype.unserialize = function(string){var unserialized = new Object;+ var hideIndicator = /^!/;var categories = string.split("~");for(var i=0; i<categories.length; i++){var items = categories[i].split(/[\.,]/);unserialized[items[0]] = new Array;for(var j=1; j<items.length; j++){- if ( this.meta && !this.meta[items[j]] ) {+ if ( this.meta && !this.meta[items[j]] && !hideIndicator.test(items[j]) ) {this.log.warn("No such product: " + items[j]);} else {+ if(hideIndicator.test(items[j])){+ items[j] = items[j].replace(/!/g, "");+ this.hidden[items[j]] = 1;+ }unserialized[items[0]].push({"value":items[j]});+}}diff --git a/js/ext/jquery.mCustomScrollbar/jquery.mCustomScrollbar.concat.min.js b/js/ext/jquery.mCustomScrollbar/jquery.mCustomScrollbar.concat.min.jsnew file mode 100644index 000000000..e42dcac43--- /dev/null+++ b/js/ext/jquery.mCustomScrollbar/jquery.mCustomScrollbar.concat.min.js@@ -0,0 +1,4 @@+/*mousewheel*/+(function(a){function d(b){var c=b||window.event,d=[].slice.call(arguments,1),e=0,f=!0,g=0,h=0;return b=a.event.fix(c),b.type="mousewheel",c.wheelDelta&&(e=c.wheelDelta/120),c.detail&&(e=-c.detail/3),h=e,c.axis!==undefined&&c.axis===c.HORIZONTAL_AXIS&&(h=0,g=-1*e),c.wheelDeltaY!==undefined&&(h=c.wheelDeltaY/120),c.wheelDeltaX!==undefined&&(g=-1*c.wheelDeltaX/120),d.unshift(b,e,g,h),(a.event.dispatch||a.event.handle).apply(this,d)}var b=["DOMMouseScroll","mousewheel"];if(a.event.fixHooks)for(var c=b.length;c;)a.event.fixHooks[b[--c]]=a.event.mouseHooks;a.event.special.mousewheel={setup:function(){if(this.addEventListener)for(var a=b.length;a;)this.addEventListener(b[--a],d,!1);else this.onmousewheel=d},teardown:function(){if(this.removeEventListener)for(var a=b.length;a;)this.removeEventListener(b[--a],d,!1);else this.onmousewheel=null}},a.fn.extend({mousewheel:function(a){return a?this.bind("mousewheel",a):this.trigger("mousewheel")},unmousewheel:function(a){return this.unbind("mousewheel",a)}})})(jQuery);+/*custom scrollbar*/+(function(c){var b={init:function(e){var f={set_width:false,set_height:false,horizontalScroll:false,scrollInertia:950,mouseWheel:true,mouseWheelPixels:"auto",autoDraggerLength:true,autoHideScrollbar:false,snapAmount:null,snapOffset:0,scrollButtons:{enable:false,scrollType:"continuous",scrollSpeed:"auto",scrollAmount:40},advanced:{updateOnBrowserResize:true,updateOnContentResize:false,autoExpandHorizontalScroll:false,autoScrollOnFocus:true,normalizeMouseWheelDelta:false},contentTouchScroll:true,callbacks:{onScrollStart:function(){},onScroll:function(){},onTotalScroll:function(){},onTotalScrollBack:function(){},onTotalScrollOffset:0,onTotalScrollBackOffset:0,whileScrolling:function(){}},theme:"light"},e=c.extend(true,f,e);return this.each(function(){var m=c(this);if(e.set_width){m.css("width",e.set_width)}if(e.set_height){m.css("height",e.set_height)}if(!c(document).data("mCustomScrollbar-index")){c(document).data("mCustomScrollbar-index","1")}else{var t=parseInt(c(document).data("mCustomScrollbar-index"));c(document).data("mCustomScrollbar-index",t+1)}m.wrapInner("<div class='mCustomScrollBox mCS-"+e.theme+"' id='mCSB_"+c(document).data("mCustomScrollbar-index")+"' style='position:relative; height:100%; overflow:hidden; max-width:100%;' />").addClass("mCustomScrollbar _mCS_"+c(document).data("mCustomScrollbar-index"));var g=m.children(".mCustomScrollBox");if(e.horizontalScroll){g.addClass("mCSB_horizontal").wrapInner("<div class='mCSB_h_wrapper' style='position:relative; left:0; width:999999px;' />");var k=g.children(".mCSB_h_wrapper");k.wrapInner("<div class='mCSB_container' style='position:absolute; left:0;' />").children(".mCSB_container").css({width:k.children().outerWidth(),position:"relative"}).unwrap()}else{g.wrapInner("<div class='mCSB_container' style='position:relative; top:0;' />")}var o=g.children(".mCSB_container");if(c.support.touch){o.addClass("mCS_touch")}o.after("<div class='mCSB_scrollTools' style='position:absolute;'><div class='mCSB_draggerContainer'><div class='mCSB_dragger' style='position:absolute;' oncontextmenu='return false;'><div class='mCSB_dragger_bar' style='position:relative;'></div></div><div class='mCSB_draggerRail'></div></div></div>");var l=g.children(".mCSB_scrollTools"),h=l.children(".mCSB_draggerContainer"),q=h.children(".mCSB_dragger");if(e.horizontalScroll){q.data("minDraggerWidth",q.width())}else{q.data("minDraggerHeight",q.height())}if(e.scrollButtons.enable){if(e.horizontalScroll){l.prepend("<a class='mCSB_buttonLeft' oncontextmenu='return false;'></a>").append("<a class='mCSB_buttonRight' oncontextmenu='return false;'></a>")}else{l.prepend("<a class='mCSB_buttonUp' oncontextmenu='return false;'></a>").append("<a class='mCSB_buttonDown' oncontextmenu='return false;'></a>")}}g.bind("scroll",function(){if(!m.is(".mCS_disabled")){g.scrollTop(0).scrollLeft(0)}});m.data({mCS_Init:true,mCustomScrollbarIndex:c(document).data("mCustomScrollbar-index"),horizontalScroll:e.horizontalScroll,scrollInertia:e.scrollInertia,scrollEasing:"mcsEaseOut",mouseWheel:e.mouseWheel,mouseWheelPixels:e.mouseWheelPixels,autoDraggerLength:e.autoDraggerLength,autoHideScrollbar:e.autoHideScrollbar,snapAmount:e.snapAmount,snapOffset:e.snapOffset,scrollButtons_enable:e.scrollButtons.enable,scrollButtons_scrollType:e.scrollButtons.scrollType,scrollButtons_scrollSpeed:e.scrollButtons.scrollSpeed,scrollButtons_scrollAmount:e.scrollButtons.scrollAmount,autoExpandHorizontalScroll:e.advanced.autoExpandHorizontalScroll,autoScrollOnFocus:e.advanced.autoScrollOnFocus,normalizeMouseWheelDelta:e.advanced.normalizeMouseWheelDelta,contentTouchScroll:e.contentTouchScroll,onScrollStart_Callback:e.callbacks.onScrollStart,onScroll_Callback:e.callbacks.onScroll,onTotalScroll_Callback:e.callbacks.onTotalScroll,onTotalScrollBack_Callback:e.callbacks.onTotalScrollBack,onTotalScroll_Offset:e.callbacks.onTotalScrollOffset,onTotalScrollBack_Offset:e.callbacks.onTotalScrollBackOffset,whileScrolling_Callback:e.callbacks.whileScrolling,bindEvent_scrollbar_drag:false,bindEvent_content_touch:false,bindEvent_scrollbar_click:false,bindEvent_mousewheel:false,bindEvent_buttonsContinuous_y:false,bindEvent_buttonsContinuous_x:false,bindEvent_buttonsPixels_y:false,bindEvent_buttonsPixels_x:false,bindEvent_focusin:false,bindEvent_autoHideScrollbar:false,mCSB_buttonScrollRight:false,mCSB_buttonScrollLeft:false,mCSB_buttonScrollDown:false,mCSB_buttonScrollUp:false});if(e.horizontalScroll){if(m.css("max-width")!=="none"){if(!e.advanced.updateOnContentResize){e.advanced.updateOnContentResize=true}}}else{if(m.css("max-height")!=="none"){var s=false,r=parseInt(m.css("max-height"));if(m.css("max-height").indexOf("%")>=0){s=r,r=m.parent().height()*s/100}m.css("overflow","hidden");g.css("max-height",r)}}m.mCustomScrollbar("update");if(e.advanced.updateOnBrowserResize){var i,j=c(window).width(),u=c(window).height();c(window).bind("resize."+m.data("mCustomScrollbarIndex"),function(){if(i){clearTimeout(i)}i=setTimeout(function(){if(!m.is(".mCS_disabled")&&!m.is(".mCS_destroyed")){var w=c(window).width(),v=c(window).height();if(j!==w||u!==v){if(m.css("max-height")!=="none"&&s){g.css("max-height",m.parent().height()*s/100)}m.mCustomScrollbar("update");j=w;u=v}}},150)})}if(e.advanced.updateOnContentResize){var p;if(e.horizontalScroll){var n=o.outerWidth()}else{var n=o.outerHeight()}p=setInterval(function(){if(e.horizontalScroll){if(e.advanced.autoExpandHorizontalScroll){o.css({position:"absolute",width:"auto"}).wrap("<div class='mCSB_h_wrapper' style='position:relative; left:0; width:999999px;' />").css({width:o.outerWidth(),position:"relative"}).unwrap()}var v=o.outerWidth()}else{var v=o.outerHeight()}if(v!=n){m.mCustomScrollbar("update");n=v}},300)}})},update:function(){var n=c(this),k=n.children(".mCustomScrollBox"),q=k.children(".mCSB_container");q.removeClass("mCS_no_scrollbar");n.removeClass("mCS_disabled mCS_destroyed");k.scrollTop(0).scrollLeft(0);var y=k.children(".mCSB_scrollTools"),o=y.children(".mCSB_draggerContainer"),m=o.children(".mCSB_dragger");if(n.data("horizontalScroll")){var A=y.children(".mCSB_buttonLeft"),t=y.children(".mCSB_buttonRight"),f=k.width();if(n.data("autoExpandHorizontalScroll")){q.css({position:"absolute",width:"auto"}).wrap("<div class='mCSB_h_wrapper' style='position:relative; left:0; width:999999px;' />").css({width:q.outerWidth(),position:"relative"}).unwrap()}var z=q.outerWidth()}else{var w=y.children(".mCSB_buttonUp"),g=y.children(".mCSB_buttonDown"),r=k.height(),i=q.outerHeight()}if(i>r&&!n.data("horizontalScroll")){y.css("display","block");var s=o.height();if(n.data("autoDraggerLength")){var u=Math.round(r/i*s),l=m.data("minDraggerHeight");if(u<=l){m.css({height:l})}else{if(u>=s-10){var p=s-10;m.css({height:p})}else{m.css({height:u})}}m.children(".mCSB_dragger_bar").css({"line-height":m.height()+"px"})}var B=m.height(),x=(i-r)/(s-B);n.data("scrollAmount",x).mCustomScrollbar("scrolling",k,q,o,m,w,g,A,t);var D=Math.abs(q.position().top);n.mCustomScrollbar("scrollTo",D,{scrollInertia:0,trigger:"internal"})}else{if(z>f&&n.data("horizontalScroll")){y.css("display","block");var h=o.width();if(n.data("autoDraggerLength")){var j=Math.round(f/z*h),C=m.data("minDraggerWidth");if(j<=C){m.css({width:C})}else{if(j>=h-10){var e=h-10;m.css({width:e})}else{m.css({width:j})}}}var v=m.width(),x=(z-f)/(h-v);n.data("scrollAmount",x).mCustomScrollbar("scrolling",k,q,o,m,w,g,A,t);var D=Math.abs(q.position().left);n.mCustomScrollbar("scrollTo",D,{scrollInertia:0,trigger:"internal"})}else{k.unbind("mousewheel focusin");if(n.data("horizontalScroll")){m.add(q).css("left",0)}else{m.add(q).css("top",0)}y.css("display","none");q.addClass("mCS_no_scrollbar");n.data({bindEvent_mousewheel:false,bindEvent_focusin:false})}}},scrolling:function(h,p,m,j,w,e,A,v){var k=c(this);if(!k.data("bindEvent_scrollbar_drag")){var n,o;if(c.support.msPointer){j.bind("MSPointerDown",function(H){H.preventDefault();k.data({on_drag:true});j.addClass("mCSB_dragger_onDrag");var G=c(this),J=G.offset(),F=H.originalEvent.pageX-J.left,I=H.originalEvent.pageY-J.top;if(F<G.width()&&F>0&&I<G.height()&&I>0){n=I;o=F}});c(document).bind("MSPointerMove."+k.data("mCustomScrollbarIndex"),function(H){H.preventDefault();if(k.data("on_drag")){var G=j,J=G.offset(),F=H.originalEvent.pageX-J.left,I=H.originalEvent.pageY-J.top;D(n,o,I,F)}}).bind("MSPointerUp."+k.data("mCustomScrollbarIndex"),function(x){k.data({on_drag:false});j.removeClass("mCSB_dragger_onDrag")})}else{j.bind("mousedown touchstart",function(H){H.preventDefault();H.stopImmediatePropagation();var G=c(this),K=G.offset(),F,J;if(H.type==="touchstart"){var I=H.originalEvent.touches[0]||H.originalEvent.changedTouches[0];F=I.pageX-K.left;J=I.pageY-K.top}else{k.data({on_drag:true});j.addClass("mCSB_dragger_onDrag");F=H.pageX-K.left;J=H.pageY-K.top}if(F<G.width()&&F>0&&J<G.height()&&J>0){n=J;o=F}}).bind("touchmove",function(H){H.preventDefault();H.stopImmediatePropagation();var K=H.originalEvent.touches[0]||H.originalEvent.changedTouches[0],G=c(this),J=G.offset(),F=K.pageX-J.left,I=K.pageY-J.top;D(n,o,I,F)});c(document).bind("mousemove."+k.data("mCustomScrollbarIndex"),function(H){if(k.data("on_drag")){var G=j,J=G.offset(),F=H.pageX-J.left,I=H.pageY-J.top;D(n,o,I,F)}}).bind("mouseup."+k.data("mCustomScrollbarIndex"),function(x){k.data({on_drag:false});j.removeClass("mCSB_dragger_onDrag")})}k.data({bindEvent_scrollbar_drag:true})}function D(G,H,I,F){if(k.data("horizontalScroll")){k.mCustomScrollbar("scrollTo",(j.position().left-(H))+F,{moveDragger:true,trigger:"internal"})}else{k.mCustomScrollbar("scrollTo",(j.position().top-(G))+I,{moveDragger:true,trigger:"internal"})}}if(c.support.touch&&k.data("contentTouchScroll")){if(!k.data("bindEvent_content_touch")){var l,B,r,s,u,C,E;p.bind("touchstart",function(x){x.stopImmediatePropagation();l=x.originalEvent.touches[0]||x.originalEvent.changedTouches[0];B=c(this);r=B.offset();u=l.pageX-r.left;s=l.pageY-r.top;C=s;E=u});p.bind("touchmove",function(x){x.preventDefault();x.stopImmediatePropagation();l=x.originalEvent.touches[0]||x.originalEvent.changedTouches[0];B=c(this).parent();r=B.offset();u=l.pageX-r.left;s=l.pageY-r.top;if(k.data("horizontalScroll")){k.mCustomScrollbar("scrollTo",E-u,{trigger:"internal"})}else{k.mCustomScrollbar("scrollTo",C-s,{trigger:"internal"})}})}}if(!k.data("bindEvent_scrollbar_click")){m.bind("click",function(F){var x=(F.pageY-m.offset().top)*k.data("scrollAmount"),y=c(F.target);if(k.data("horizontalScroll")){x=(F.pageX-m.offset().left)*k.data("scrollAmount")}if(y.hasClass("mCSB_draggerContainer")||y.hasClass("mCSB_draggerRail")){k.mCustomScrollbar("scrollTo",x,{trigger:"internal",scrollEasing:"draggerRailEase"})}});k.data({bindEvent_scrollbar_click:true})}if(k.data("mouseWheel")){if(!k.data("bindEvent_mousewheel")){h.bind("mousewheel",function(H,J){var G,F=k.data("mouseWheelPixels"),x=Math.abs(p.position().top),I=j.position().top,y=m.height()-j.height();if(k.data("normalizeMouseWheelDelta")){if(J<0){J=-1}else{J=1}}if(F==="auto"){F=100+Math.round(k.data("scrollAmount")/2)}if(k.data("horizontalScroll")){I=j.position().left;y=m.width()-j.width();x=Math.abs(p.position().left)}if((J>0&&I!==0)||(J<0&&I!==y)){H.preventDefault();H.stopImmediatePropagation()}G=x-(J*F);k.mCustomScrollbar("scrollTo",G,{trigger:"internal"})});k.data({bindEvent_mousewheel:true})}}if(k.data("scrollButtons_enable")){if(k.data("scrollButtons_scrollType")==="pixels"){if(k.data("horizontalScroll")){v.add(A).unbind("mousedown touchstart MSPointerDown mouseup MSPointerUp mouseout MSPointerOut touchend",i,g);k.data({bindEvent_buttonsContinuous_x:false});if(!k.data("bindEvent_buttonsPixels_x")){v.bind("click",function(x){x.preventDefault();q(Math.abs(p.position().left)+k.data("scrollButtons_scrollAmount"))});A.bind("click",function(x){x.preventDefault();q(Math.abs(p.position().left)-k.data("scrollButtons_scrollAmount"))});k.data({bindEvent_buttonsPixels_x:true})}}else{e.add(w).unbind("mousedown touchstart MSPointerDown mouseup MSPointerUp mouseout MSPointerOut touchend",i,g);k.data({bindEvent_buttonsContinuous_y:false});if(!k.data("bindEvent_buttonsPixels_y")){e.bind("click",function(x){x.preventDefault();q(Math.abs(p.position().top)+k.data("scrollButtons_scrollAmount"))});w.bind("click",function(x){x.preventDefault();q(Math.abs(p.position().top)-k.data("scrollButtons_scrollAmount"))});k.data({bindEvent_buttonsPixels_y:true})}}function q(x){if(!j.data("preventAction")){j.data("preventAction",true);k.mCustomScrollbar("scrollTo",x,{trigger:"internal"})}}}else{if(k.data("horizontalScroll")){v.add(A).unbind("click");k.data({bindEvent_buttonsPixels_x:false});if(!k.data("bindEvent_buttonsContinuous_x")){v.bind("mousedown touchstart MSPointerDown",function(y){y.preventDefault();var x=z();k.data({mCSB_buttonScrollRight:setInterval(function(){k.mCustomScrollbar("scrollTo",Math.abs(p.position().left)+x,{trigger:"internal",scrollEasing:"easeOutCirc"})},17)})});var i=function(x){x.preventDefault();clearInterval(k.data("mCSB_buttonScrollRight"))};v.bind("mouseup touchend MSPointerUp mouseout MSPointerOut",i);A.bind("mousedown touchstart MSPointerDown",function(y){y.preventDefault();var x=z();k.data({mCSB_buttonScrollLeft:setInterval(function(){k.mCustomScrollbar("scrollTo",Math.abs(p.position().left)-x,{trigger:"internal",scrollEasing:"easeOutCirc"})},17)})});var g=function(x){x.preventDefault();clearInterval(k.data("mCSB_buttonScrollLeft"))};A.bind("mouseup touchend MSPointerUp mouseout MSPointerOut",g);k.data({bindEvent_buttonsContinuous_x:true})}}else{e.add(w).unbind("click");k.data({bindEvent_buttonsPixels_y:false});if(!k.data("bindEvent_buttonsContinuous_y")){e.bind("mousedown touchstart MSPointerDown",function(y){y.preventDefault();var x=z();k.data({mCSB_buttonScrollDown:setInterval(function(){k.mCustomScrollbar("scrollTo",Math.abs(p.position().top)+x,{trigger:"internal",scrollEasing:"easeOutCirc"})},17)})});var t=function(x){x.preventDefault();clearInterval(k.data("mCSB_buttonScrollDown"))};e.bind("mouseup touchend MSPointerUp mouseout MSPointerOut",t);w.bind("mousedown touchstart MSPointerDown",function(y){y.preventDefault();var x=z();k.data({mCSB_buttonScrollUp:setInterval(function(){k.mCustomScrollbar("scrollTo",Math.abs(p.position().top)-x,{trigger:"internal",scrollEasing:"easeOutCirc"})},17)})});var f=function(x){x.preventDefault();clearInterval(k.data("mCSB_buttonScrollUp"))};w.bind("mouseup touchend MSPointerUp mouseout MSPointerOut",f);k.data({bindEvent_buttonsContinuous_y:true})}}function z(){var x=k.data("scrollButtons_scrollSpeed");if(k.data("scrollButtons_scrollSpeed")==="auto"){x=Math.round((k.data("scrollInertia")+100)/40)}return x}}}if(k.data("autoScrollOnFocus")){if(!k.data("bindEvent_focusin")){h.bind("focusin",function(){h.scrollTop(0).scrollLeft(0);var x=c(document.activeElement);if(x.is("input,textarea,select,button,a[tabindex],area,object")){var G=p.position().top,y=x.position().top,F=h.height()-x.outerHeight();if(k.data("horizontalScroll")){G=p.position().left;y=x.position().left;F=h.width()-x.outerWidth()}if(G+y<0||G+y>F){k.mCustomScrollbar("scrollTo",y,{trigger:"internal"})}}});k.data({bindEvent_focusin:true})}}if(k.data("autoHideScrollbar")){if(!k.data("bindEvent_autoHideScrollbar")){h.bind("mouseenter",function(x){h.addClass("mCS-mouse-over");d.showScrollbar.call(h.children(".mCSB_scrollTools"))}).bind("mouseleave touchend",function(x){h.removeClass("mCS-mouse-over");if(x.type==="mouseleave"){d.hideScrollbar.call(h.children(".mCSB_scrollTools"))}});k.data({bindEvent_autoHideScrollbar:true})}}},scrollTo:function(e,f){var i=c(this),o={moveDragger:false,trigger:"external",callbacks:true,scrollInertia:i.data("scrollInertia"),scrollEasing:i.data("scrollEasing")},f=c.extend(o,f),p,g=i.children(".mCustomScrollBox"),k=g.children(".mCSB_container"),r=g.children(".mCSB_scrollTools"),j=r.children(".mCSB_draggerContainer"),h=j.children(".mCSB_dragger"),t=draggerSpeed=f.scrollInertia,q,s,m,l;if(!k.hasClass("mCS_no_scrollbar")){i.data({mCS_trigger:f.trigger});if(i.data("mCS_Init")){f.callbacks=false}if(e||e===0){if(typeof(e)==="number"){if(f.moveDragger){p=e;if(i.data("horizontalScroll")){e=h.position().left*i.data("scrollAmount")}else{e=h.position().top*i.data("scrollAmount")}draggerSpeed=0}else{p=e/i.data("scrollAmount")}}else{if(typeof(e)==="string"){var v;if(e==="top"){v=0}else{if(e==="bottom"&&!i.data("horizontalScroll")){v=k.outerHeight()-g.height()}else{if(e==="left"){v=0}else{if(e==="right"&&i.data("horizontalScroll")){v=k.outerWidth()-g.width()}else{if(e==="first"){v=i.find(".mCSB_container").find(":first")}else{if(e==="last"){v=i.find(".mCSB_container").find(":last")}else{v=i.find(e)}}}}}}if(v.length===1){if(i.data("horizontalScroll")){e=v.position().left}else{e=v.position().top}p=e/i.data("scrollAmount")}else{p=e=v}}}if(i.data("horizontalScroll")){if(i.data("onTotalScrollBack_Offset")){s=-i.data("onTotalScrollBack_Offset")}if(i.data("onTotalScroll_Offset")){l=g.width()-k.outerWidth()+i.data("onTotalScroll_Offset")}if(p<0){p=e=0;clearInterval(i.data("mCSB_buttonScrollLeft"));if(!s){q=true}}else{if(p>=j.width()-h.width()){p=j.width()-h.width();e=g.width()-k.outerWidth();clearInterval(i.data("mCSB_buttonScrollRight"));if(!l){m=true}}else{e=-e}}var n=i.data("snapAmount");if(n){e=Math.round(e/n)*n-i.data("snapOffset")}d.mTweenAxis.call(this,h[0],"left",Math.round(p),draggerSpeed,f.scrollEasing);d.mTweenAxis.call(this,k[0],"left",Math.round(e),t,f.scrollEasing,{onStart:function(){if(f.callbacks&&!i.data("mCS_tweenRunning")){u("onScrollStart")}if(i.data("autoHideScrollbar")){d.showScrollbar.call(r)}},onUpdate:function(){if(f.callbacks){u("whileScrolling")}},onComplete:function(){if(f.callbacks){u("onScroll");if(q||(s&&k.position().left>=s)){u("onTotalScrollBack")}if(m||(l&&k.position().left<=l)){u("onTotalScroll")}}h.data("preventAction",false);i.data("mCS_tweenRunning",false);if(i.data("autoHideScrollbar")){if(!g.hasClass("mCS-mouse-over")){d.hideScrollbar.call(r)}}}})}else{if(i.data("onTotalScrollBack_Offset")){s=-i.data("onTotalScrollBack_Offset")}if(i.data("onTotalScroll_Offset")){l=g.height()-k.outerHeight()+i.data("onTotalScroll_Offset")}if(p<0){p=e=0;clearInterval(i.data("mCSB_buttonScrollUp"));if(!s){q=true}}else{if(p>=j.height()-h.height()){p=j.height()-h.height();e=g.height()-k.outerHeight();clearInterval(i.data("mCSB_buttonScrollDown"));if(!l){m=true}}else{e=-e}}var n=i.data("snapAmount");if(n){e=Math.round(e/n)*n-i.data("snapOffset")}d.mTweenAxis.call(this,h[0],"top",Math.round(p),draggerSpeed,f.scrollEasing);d.mTweenAxis.call(this,k[0],"top",Math.round(e),t,f.scrollEasing,{onStart:function(){if(f.callbacks&&!i.data("mCS_tweenRunning")){u("onScrollStart")}if(i.data("autoHideScrollbar")){d.showScrollbar.call(r)}},onUpdate:function(){if(f.callbacks){u("whileScrolling")}},onComplete:function(){if(f.callbacks){u("onScroll");if(q||(s&&k.position().top>=s)){u("onTotalScrollBack")}if(m||(l&&k.position().top<=l)){u("onTotalScroll")}}h.data("preventAction",false);i.data("mCS_tweenRunning",false);if(i.data("autoHideScrollbar")){if(!g.hasClass("mCS-mouse-over")){d.hideScrollbar.call(r)}}}})}if(i.data("mCS_Init")){i.data({mCS_Init:false})}}}function u(w){this.mcs={top:k.position().top,left:k.position().left,draggerTop:h.position().top,draggerLeft:h.position().left,topPct:Math.round((100*Math.abs(k.position().top))/Math.abs(k.outerHeight()-g.height())),leftPct:Math.round((100*Math.abs(k.position().left))/Math.abs(k.outerWidth()-g.width()))};switch(w){case"onScrollStart":i.data("mCS_tweenRunning",true).data("onScrollStart_Callback").call(i,this.mcs);break;case"whileScrolling":i.data("whileScrolling_Callback").call(i,this.mcs);break;case"onScroll":i.data("onScroll_Callback").call(i,this.mcs);break;case"onTotalScrollBack":i.data("onTotalScrollBack_Callback").call(i,this.mcs);break;case"onTotalScroll":i.data("onTotalScroll_Callback").call(i,this.mcs);break}}},stop:function(){var g=c(this),e=g.children().children(".mCSB_container"),f=g.children().children().children().children(".mCSB_dragger");d.mTweenAxisStop.call(this,e[0]);d.mTweenAxisStop.call(this,f[0])},disable:function(e){var j=c(this),f=j.children(".mCustomScrollBox"),h=f.children(".mCSB_container"),g=f.children(".mCSB_scrollTools"),i=g.children().children(".mCSB_dragger");f.unbind("mousewheel focusin mouseenter mouseleave touchend");h.unbind("touchstart touchmove");if(e){if(j.data("horizontalScroll")){i.add(h).css("left",0)}else{i.add(h).css("top",0)}}g.css("display","none");h.addClass("mCS_no_scrollbar");j.data({bindEvent_mousewheel:false,bindEvent_focusin:false,bindEvent_content_touch:false,bindEvent_autoHideScrollbar:false}).addClass("mCS_disabled")},destroy:function(){var e=c(this);e.removeClass("mCustomScrollbar _mCS_"+e.data("mCustomScrollbarIndex")).addClass("mCS_destroyed").children().children(".mCSB_container").unwrap().children().unwrap().siblings(".mCSB_scrollTools").remove();c(document).unbind("mousemove."+e.data("mCustomScrollbarIndex")+" mouseup."+e.data("mCustomScrollbarIndex")+" MSPointerMove."+e.data("mCustomScrollbarIndex")+" MSPointerUp."+e.data("mCustomScrollbarIndex"));c(window).unbind("resize."+e.data("mCustomScrollbarIndex"))}},d={showScrollbar:function(){this.stop().animate({opacity:1},"fast")},hideScrollbar:function(){this.stop().animate({opacity:0},"fast")},mTweenAxis:function(g,i,h,f,o,y){var y=y||{},v=y.onStart||function(){},p=y.onUpdate||function(){},w=y.onComplete||function(){};var n=t(),l,j=0,r=g.offsetTop,s=g.style;if(i==="left"){r=g.offsetLeft}var m=h-r;q();e();function t(){if(window.performance&&window.performance.now){return window.performance.now()}else{if(window.performance&&window.performance.webkitNow){return window.performance.webkitNow()}else{if(Date.now){return Date.now()}else{return new Date().getTime()}}}}function x(){if(!j){v.call()}j=t()-n;u();if(j>=g._time){g._time=(j>g._time)?j+l-(j-g._time):j+l-1;if(g._time<j+1){g._time=j+1}}if(g._time<f){g._id=_request(x)}else{w.call()}}function u(){if(f>0){g.currVal=k(g._time,r,m,f,o);s[i]=Math.round(g.currVal)+"px"}else{s[i]=h+"px"}p.call()}function e(){l=1000/60;g._time=j+l;_request=(!window.requestAnimationFrame)?function(z){u();return setTimeout(z,0.01)}:window.requestAnimationFrame;g._id=_request(x)}function q(){if(g._id==null){return}if(!window.requestAnimationFrame){clearTimeout(g._id)}else{window.cancelAnimationFrame(g._id)}g._id=null}function k(B,A,F,E,C){switch(C){case"linear":return F*B/E+A;break;case"easeOutQuad":B/=E;return -F*B*(B-2)+A;break;case"easeInOutQuad":B/=E/2;if(B<1){return F/2*B*B+A}B--;return -F/2*(B*(B-2)-1)+A;break;case"easeOutCubic":B/=E;B--;return F*(B*B*B+1)+A;break;case"easeOutQuart":B/=E;B--;return -F*(B*B*B*B-1)+A;break;case"easeOutQuint":B/=E;B--;return F*(B*B*B*B*B+1)+A;break;case"easeOutCirc":B/=E;B--;return F*Math.sqrt(1-B*B)+A;break;case"easeOutSine":return F*Math.sin(B/E*(Math.PI/2))+A;break;case"easeOutExpo":return F*(-Math.pow(2,-10*B/E)+1)+A;break;case"mcsEaseOut":var D=(B/=E)*B,z=D*B;return A+F*(0.499999999999997*z*D+-2.5*D*D+5.5*z+-6.5*D+4*B);break;case"draggerRailEase":B/=E/2;if(B<1){return F/2*B*B*B+A}B-=2;return F/2*(B*B*B+2)+A;break}}},mTweenAxisStop:function(e){if(e._id==null){return}if(!window.requestAnimationFrame){clearTimeout(e._id)}else{window.cancelAnimationFrame(e._id)}e._id=null},rafPolyfill:function(){var f=["ms","moz","webkit","o"],e=f.length;while(--e>-1&&!window.requestAnimationFrame){window.requestAnimationFrame=window[f[e]+"RequestAnimationFrame"];window.cancelAnimationFrame=window[f[e]+"CancelAnimationFrame"]||window[f[e]+"CancelRequestAnimationFrame"]}}};d.rafPolyfill.call();c.support.touch=!!("ontouchstart" in window);c.support.msPointer=window.navigator.msPointerEnabled;var a=("https:"==document.location.protocol)?"https:":"http:";c.event.special.mousewheel||document.write('<script src="'+a+'//cdnjs.cloudflare.com/ajax/libs/jquery-mousewheel/3.0.6/jquery.mousewheel.min.js"><\/script>');c.fn.mCustomScrollbar=function(e){if(b[e]){return b[e].apply(this,Array.prototype.slice.call(arguments,1))}else{if(typeof e==="object"||!e){return b.init.apply(this,arguments)}else{c.error("Method "+e+" does not exist")}}}})(jQuery);\ No newline at end of filediff --git a/js/ext/jquery.mCustomScrollbar/jquery.mCustomScrollbar.js b/js/ext/jquery.mCustomScrollbar/jquery.mCustomScrollbar.jsnew file mode 100644index 000000000..8aa85430a--- /dev/null+++ b/js/ext/jquery.mCustomScrollbar/jquery.mCustomScrollbar.js@@ -0,0 +1,946 @@+/*+== malihu jquery custom scrollbars plugin ==+version: 2.8.2+author: malihu (http://manos.malihu.gr)+plugin home: http://manos.malihu.gr/jquery-custom-content-scroller+*/++/*+Copyright 2010-2013 Manos Malihutsakis++This program is free software: you can redistribute it and/or modify+it under the terms of the GNU Lesser General Public License as published by+the Free Software Foundation, either version 3 of the License, or+any later version.++This program is distributed in the hope that it will be useful,+but WITHOUT ANY WARRANTY; without even the implied warranty of+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the+GNU Lesser General Public License for more details.++You should have received a copy of the GNU Lesser General Public License+along with this program. If not, see http://www.gnu.org/licenses/lgpl.html.+*/+(function($){+ /*plugin script*/+ var methods={+ init:function(options){+ var defaults={+ set_width:false, /*optional element width: boolean, pixels, percentage*/+ set_height:false, /*optional element height: boolean, pixels, percentage*/+ horizontalScroll:false, /*scroll horizontally: boolean*/+ scrollInertia:950, /*scrolling inertia: integer (milliseconds)*/+ mouseWheel:true, /*mousewheel support: boolean*/+ mouseWheelPixels:"auto", /*mousewheel pixels amount: integer, "auto"*/+ autoDraggerLength:true, /*auto-adjust scrollbar dragger length: boolean*/+ autoHideScrollbar:false, /*auto-hide scrollbar when idle*/+ snapAmount:null, /* optional element always snaps to a multiple of this number in pixels */+ snapOffset:0, /* when snapping, snap with this number in pixels as an offset */+ scrollButtons:{ /*scroll buttons*/+ enable:false, /*scroll buttons support: boolean*/+ scrollType:"continuous", /*scroll buttons scrolling type: "continuous", "pixels"*/+ scrollSpeed:"auto", /*scroll buttons continuous scrolling speed: integer, "auto"*/+ scrollAmount:40 /*scroll buttons pixels scroll amount: integer (pixels)*/+ },+ advanced:{+ updateOnBrowserResize:true, /*update scrollbars on browser resize (for layouts based on percentages): boolean*/+ updateOnContentResize:false, /*auto-update scrollbars on content resize (for dynamic content): boolean*/+ autoExpandHorizontalScroll:false, /*auto-expand width for horizontal scrolling: boolean*/+ autoScrollOnFocus:true, /*auto-scroll on focused elements: boolean*/+ normalizeMouseWheelDelta:false /*normalize mouse-wheel delta (-1/1)*/+ },+ contentTouchScroll:true, /*scrolling by touch-swipe content: boolean*/+ callbacks:{+ onScrollStart:function(){}, /*user custom callback function on scroll start event*/+ onScroll:function(){}, /*user custom callback function on scroll event*/+ onTotalScroll:function(){}, /*user custom callback function on scroll end reached event*/+ onTotalScrollBack:function(){}, /*user custom callback function on scroll begin reached event*/+ onTotalScrollOffset:0, /*scroll end reached offset: integer (pixels)*/+ onTotalScrollBackOffset:0, /*scroll begin reached offset: integer (pixels)*/+ whileScrolling:function(){} /*user custom callback function on scrolling event*/+ },+ theme:"light" /*"light", "dark", "light-2", "dark-2", "light-thick", "dark-thick", "light-thin", "dark-thin"*/+ },+ options=$.extend(true,defaults,options);+ return this.each(function(){+ var $this=$(this);+ /*set element width/height, create markup for custom scrollbars, add classes*/+ if(options.set_width){+ $this.css("width",options.set_width);+ }+ if(options.set_height){+ $this.css("height",options.set_height);+ }+ if(!$(document).data("mCustomScrollbar-index")){+ $(document).data("mCustomScrollbar-index","1");+ }else{+ var mCustomScrollbarIndex=parseInt($(document).data("mCustomScrollbar-index"));+ $(document).data("mCustomScrollbar-index",mCustomScrollbarIndex+1);+ }+ $this.wrapInner("<div class='mCustomScrollBox"+" mCS-"+options.theme+"' id='mCSB_"+$(document).data("mCustomScrollbar-index")+"' style='position:relative; height:100%; overflow:hidden; max-width:100%;' />").addClass("mCustomScrollbar _mCS_"+$(document).data("mCustomScrollbar-index"));+ var mCustomScrollBox=$this.children(".mCustomScrollBox");+ if(options.horizontalScroll){+ mCustomScrollBox.addClass("mCSB_horizontal").wrapInner("<div class='mCSB_h_wrapper' style='position:relative; left:0; width:999999px;' />");+ var mCSB_h_wrapper=mCustomScrollBox.children(".mCSB_h_wrapper");+ mCSB_h_wrapper.wrapInner("<div class='mCSB_container' style='position:absolute; left:0;' />").children(".mCSB_container").css({"width":mCSB_h_wrapper.children().outerWidth(),"position":"relative"}).unwrap();+ }else{+ mCustomScrollBox.wrapInner("<div class='mCSB_container' style='position:relative; top:0;' />");+ }+ var mCSB_container=mCustomScrollBox.children(".mCSB_container");+ if($.support.touch){+ mCSB_container.addClass("mCS_touch");+ }+ mCSB_container.after("<div class='mCSB_scrollTools' style='position:absolute;'><div class='mCSB_draggerContainer'><div class='mCSB_dragger' style='position:absolute;' oncontextmenu='return false;'><div class='mCSB_dragger_bar' style='position:relative;'></div></div><div class='mCSB_draggerRail'></div></div></div>");+ var mCSB_scrollTools=mCustomScrollBox.children(".mCSB_scrollTools"),+ mCSB_draggerContainer=mCSB_scrollTools.children(".mCSB_draggerContainer"),+ mCSB_dragger=mCSB_draggerContainer.children(".mCSB_dragger");+ if(options.horizontalScroll){+ mCSB_dragger.data("minDraggerWidth",mCSB_dragger.width());+ }else{+ mCSB_dragger.data("minDraggerHeight",mCSB_dragger.height());+ }+ if(options.scrollButtons.enable){+ if(options.horizontalScroll){+ mCSB_scrollTools.prepend("<a class='mCSB_buttonLeft' oncontextmenu='return false;'></a>").append("<a class='mCSB_buttonRight' oncontextmenu='return false;'></a>");+ }else{+ mCSB_scrollTools.prepend("<a class='mCSB_buttonUp' oncontextmenu='return false;'></a>").append("<a class='mCSB_buttonDown' oncontextmenu='return false;'></a>");+ }+ }+ /*mCustomScrollBox scrollTop and scrollLeft is always 0 to prevent browser focus scrolling*/+ mCustomScrollBox.bind("scroll",function(){+ if(!$this.is(".mCS_disabled")){ /*native focus scrolling for disabled scrollbars*/+ mCustomScrollBox.scrollTop(0).scrollLeft(0);+ }+ });+ /*store options, global vars/states, intervals*/+ $this.data({+ /*init state*/+ "mCS_Init":true,+ /*instance index*/+ "mCustomScrollbarIndex":$(document).data("mCustomScrollbar-index"),+ /*option parameters*/+ "horizontalScroll":options.horizontalScroll,+ "scrollInertia":options.scrollInertia,+ "scrollEasing":"mcsEaseOut",+ "mouseWheel":options.mouseWheel,+ "mouseWheelPixels":options.mouseWheelPixels,+ "autoDraggerLength":options.autoDraggerLength,+ "autoHideScrollbar":options.autoHideScrollbar,+ "snapAmount":options.snapAmount,+ "snapOffset":options.snapOffset,+ "scrollButtons_enable":options.scrollButtons.enable,+ "scrollButtons_scrollType":options.scrollButtons.scrollType,+ "scrollButtons_scrollSpeed":options.scrollButtons.scrollSpeed,+ "scrollButtons_scrollAmount":options.scrollButtons.scrollAmount,+ "autoExpandHorizontalScroll":options.advanced.autoExpandHorizontalScroll,+ "autoScrollOnFocus":options.advanced.autoScrollOnFocus,+ "normalizeMouseWheelDelta":options.advanced.normalizeMouseWheelDelta,+ "contentTouchScroll":options.contentTouchScroll,+ "onScrollStart_Callback":options.callbacks.onScrollStart,+ "onScroll_Callback":options.callbacks.onScroll,+ "onTotalScroll_Callback":options.callbacks.onTotalScroll,+ "onTotalScrollBack_Callback":options.callbacks.onTotalScrollBack,+ "onTotalScroll_Offset":options.callbacks.onTotalScrollOffset,+ "onTotalScrollBack_Offset":options.callbacks.onTotalScrollBackOffset,+ "whileScrolling_Callback":options.callbacks.whileScrolling,+ /*events binding state*/+ "bindEvent_scrollbar_drag":false,+ "bindEvent_content_touch":false,+ "bindEvent_scrollbar_click":false,+ "bindEvent_mousewheel":false,+ "bindEvent_buttonsContinuous_y":false,+ "bindEvent_buttonsContinuous_x":false,+ "bindEvent_buttonsPixels_y":false,+ "bindEvent_buttonsPixels_x":false,+ "bindEvent_focusin":false,+ "bindEvent_autoHideScrollbar":false,+ /*buttons intervals*/+ "mCSB_buttonScrollRight":false,+ "mCSB_buttonScrollLeft":false,+ "mCSB_buttonScrollDown":false,+ "mCSB_buttonScrollUp":false+ });+ /*max-width/max-height*/+ if(options.horizontalScroll){+ if($this.css("max-width")!=="none"){+ if(!options.advanced.updateOnContentResize){ /*needs updateOnContentResize*/+ options.advanced.updateOnContentResize=true;+ }+ }+ }else{+ if($this.css("max-height")!=="none"){+ var percentage=false,maxHeight=parseInt($this.css("max-height"));+ if($this.css("max-height").indexOf("%")>=0){+ percentage=maxHeight,+ maxHeight=$this.parent().height()*percentage/100;+ }+ $this.css("overflow","hidden");+ mCustomScrollBox.css("max-height",maxHeight);+ }+ }+ $this.mCustomScrollbar("update");+ /*window resize fn (for layouts based on percentages)*/+ if(options.advanced.updateOnBrowserResize){+ var mCSB_resizeTimeout,currWinWidth=$(window).width(),currWinHeight=$(window).height();+ $(window).bind("resize."+$this.data("mCustomScrollbarIndex"),function(){+ if(mCSB_resizeTimeout){+ clearTimeout(mCSB_resizeTimeout);+ }+ mCSB_resizeTimeout=setTimeout(function(){+ if(!$this.is(".mCS_disabled") && !$this.is(".mCS_destroyed")){+ var winWidth=$(window).width(),winHeight=$(window).height();+ if(currWinWidth!==winWidth || currWinHeight!==winHeight){ /*ie8 fix*/+ if($this.css("max-height")!=="none" && percentage){+ mCustomScrollBox.css("max-height",$this.parent().height()*percentage/100);+ }+ $this.mCustomScrollbar("update");+ currWinWidth=winWidth; currWinHeight=winHeight;+ }+ }+ },150);+ });+ }+ /*content resize fn (for dynamically generated content)*/+ if(options.advanced.updateOnContentResize){+ var mCSB_onContentResize;+ if(options.horizontalScroll){+ var mCSB_containerOldSize=mCSB_container.outerWidth();+ }else{+ var mCSB_containerOldSize=mCSB_container.outerHeight();+ }+ mCSB_onContentResize=setInterval(function(){+ if(options.horizontalScroll){+ if(options.advanced.autoExpandHorizontalScroll){+ mCSB_container.css({"position":"absolute","width":"auto"}).wrap("<div class='mCSB_h_wrapper' style='position:relative; left:0; width:999999px;' />").css({"width":mCSB_container.outerWidth(),"position":"relative"}).unwrap();+ }+ var mCSB_containerNewSize=mCSB_container.outerWidth();+ }else{+ var mCSB_containerNewSize=mCSB_container.outerHeight();+ }+ if(mCSB_containerNewSize!=mCSB_containerOldSize){+ $this.mCustomScrollbar("update");+ mCSB_containerOldSize=mCSB_containerNewSize;+ }+ },300);+ }+ });+ },+ update:function(){+ var $this=$(this),+ mCustomScrollBox=$this.children(".mCustomScrollBox"),+ mCSB_container=mCustomScrollBox.children(".mCSB_container");+ mCSB_container.removeClass("mCS_no_scrollbar");+ $this.removeClass("mCS_disabled mCS_destroyed");+ mCustomScrollBox.scrollTop(0).scrollLeft(0); /*reset scrollTop/scrollLeft to prevent browser focus scrolling*/+ var mCSB_scrollTools=mCustomScrollBox.children(".mCSB_scrollTools"),+ mCSB_draggerContainer=mCSB_scrollTools.children(".mCSB_draggerContainer"),+ mCSB_dragger=mCSB_draggerContainer.children(".mCSB_dragger");+ if($this.data("horizontalScroll")){+ var mCSB_buttonLeft=mCSB_scrollTools.children(".mCSB_buttonLeft"),+ mCSB_buttonRight=mCSB_scrollTools.children(".mCSB_buttonRight"),+ mCustomScrollBoxW=mCustomScrollBox.width();+ if($this.data("autoExpandHorizontalScroll")){+ mCSB_container.css({"position":"absolute","width":"auto"}).wrap("<div class='mCSB_h_wrapper' style='position:relative; left:0; width:999999px;' />").css({"width":mCSB_container.outerWidth(),"position":"relative"}).unwrap();+ }+ var mCSB_containerW=mCSB_container.outerWidth();+ }else{+ var mCSB_buttonUp=mCSB_scrollTools.children(".mCSB_buttonUp"),+ mCSB_buttonDown=mCSB_scrollTools.children(".mCSB_buttonDown"),+ mCustomScrollBoxH=mCustomScrollBox.height(),+ mCSB_containerH=mCSB_container.outerHeight();+ }+ if(mCSB_containerH>mCustomScrollBoxH && !$this.data("horizontalScroll")){ /*content needs vertical scrolling*/+ mCSB_scrollTools.css("display","block");+ var mCSB_draggerContainerH=mCSB_draggerContainer.height();+ /*auto adjust scrollbar dragger length analogous to content*/+ if($this.data("autoDraggerLength")){+ var draggerH=Math.round(mCustomScrollBoxH/mCSB_containerH*mCSB_draggerContainerH),+ minDraggerH=mCSB_dragger.data("minDraggerHeight");+ if(draggerH<=minDraggerH){ /*min dragger height*/+ mCSB_dragger.css({"height":minDraggerH});+ }else if(draggerH>=mCSB_draggerContainerH-10){ /*max dragger height*/+ var mCSB_draggerContainerMaxH=mCSB_draggerContainerH-10;+ mCSB_dragger.css({"height":mCSB_draggerContainerMaxH});+ }else{+ mCSB_dragger.css({"height":draggerH});+ }+ mCSB_dragger.children(".mCSB_dragger_bar").css({"line-height":mCSB_dragger.height()+"px"});+ }+ var mCSB_draggerH=mCSB_dragger.height(),+ /*calculate and store scroll amount, add scrolling*/+ scrollAmount=(mCSB_containerH-mCustomScrollBoxH)/(mCSB_draggerContainerH-mCSB_draggerH);+ $this.data("scrollAmount",scrollAmount).mCustomScrollbar("scrolling",mCustomScrollBox,mCSB_container,mCSB_draggerContainer,mCSB_dragger,mCSB_buttonUp,mCSB_buttonDown,mCSB_buttonLeft,mCSB_buttonRight);+ /*scroll*/+ var mCSB_containerP=Math.abs(mCSB_container.position().top);+ $this.mCustomScrollbar("scrollTo",mCSB_containerP,{scrollInertia:0,trigger:"internal"});+ }else if(mCSB_containerW>mCustomScrollBoxW && $this.data("horizontalScroll")){ /*content needs horizontal scrolling*/+ mCSB_scrollTools.css("display","block");+ var mCSB_draggerContainerW=mCSB_draggerContainer.width();+ /*auto adjust scrollbar dragger length analogous to content*/+ if($this.data("autoDraggerLength")){+ var draggerW=Math.round(mCustomScrollBoxW/mCSB_containerW*mCSB_draggerContainerW),+ minDraggerW=mCSB_dragger.data("minDraggerWidth");+ if(draggerW<=minDraggerW){ /*min dragger height*/+ mCSB_dragger.css({"width":minDraggerW});+ }else if(draggerW>=mCSB_draggerContainerW-10){ /*max dragger height*/+ var mCSB_draggerContainerMaxW=mCSB_draggerContainerW-10;+ mCSB_dragger.css({"width":mCSB_draggerContainerMaxW});+ }else{+ mCSB_dragger.css({"width":draggerW});+ }+ }+ var mCSB_draggerW=mCSB_dragger.width(),+ /*calculate and store scroll amount, add scrolling*/+ scrollAmount=(mCSB_containerW-mCustomScrollBoxW)/(mCSB_draggerContainerW-mCSB_draggerW);+ $this.data("scrollAmount",scrollAmount).mCustomScrollbar("scrolling",mCustomScrollBox,mCSB_container,mCSB_draggerContainer,mCSB_dragger,mCSB_buttonUp,mCSB_buttonDown,mCSB_buttonLeft,mCSB_buttonRight);+ /*scroll*/+ var mCSB_containerP=Math.abs(mCSB_container.position().left);+ $this.mCustomScrollbar("scrollTo",mCSB_containerP,{scrollInertia:0,trigger:"internal"});+ }else{ /*content does not need scrolling*/+ /*unbind events, reset content position, hide scrollbars, remove classes*/+ mCustomScrollBox.unbind("mousewheel focusin");+ if($this.data("horizontalScroll")){+ mCSB_dragger.add(mCSB_container).css("left",0);+ }else{+ mCSB_dragger.add(mCSB_container).css("top",0);+ }+ mCSB_scrollTools.css("display","none");+ mCSB_container.addClass("mCS_no_scrollbar");+ $this.data({"bindEvent_mousewheel":false,"bindEvent_focusin":false});+ }+ },+ scrolling:function(mCustomScrollBox,mCSB_container,mCSB_draggerContainer,mCSB_dragger,mCSB_buttonUp,mCSB_buttonDown,mCSB_buttonLeft,mCSB_buttonRight){+ var $this=$(this);+ /*scrollbar drag scrolling*/+ if(!$this.data("bindEvent_scrollbar_drag")){+ var mCSB_draggerDragY,mCSB_draggerDragX;+ if($.support.msPointer){ /*MSPointer*/+ mCSB_dragger.bind("MSPointerDown",function(e){+ e.preventDefault();+ $this.data({"on_drag":true}); mCSB_dragger.addClass("mCSB_dragger_onDrag");+ var elem=$(this),+ elemOffset=elem.offset(),+ x=e.originalEvent.pageX-elemOffset.left,+ y=e.originalEvent.pageY-elemOffset.top;+ if(x<elem.width() && x>0 && y<elem.height() && y>0){+ mCSB_draggerDragY=y;+ mCSB_draggerDragX=x;+ }+ });+ $(document).bind("MSPointerMove."+$this.data("mCustomScrollbarIndex"),function(e){+ e.preventDefault();+ if($this.data("on_drag")){+ var elem=mCSB_dragger,+ elemOffset=elem.offset(),+ x=e.originalEvent.pageX-elemOffset.left,+ y=e.originalEvent.pageY-elemOffset.top;+ scrollbarDrag(mCSB_draggerDragY,mCSB_draggerDragX,y,x);+ }+ }).bind("MSPointerUp."+$this.data("mCustomScrollbarIndex"),function(e){+ $this.data({"on_drag":false}); mCSB_dragger.removeClass("mCSB_dragger_onDrag");+ });+ }else{ /*mouse/touch*/+ mCSB_dragger.bind("mousedown touchstart",function(e){+ e.preventDefault(); e.stopImmediatePropagation();+ var elem=$(this),elemOffset=elem.offset(),x,y;+ if(e.type==="touchstart"){+ var touch=e.originalEvent.touches[0] || e.originalEvent.changedTouches[0];+ x=touch.pageX-elemOffset.left; y=touch.pageY-elemOffset.top;+ }else{+ $this.data({"on_drag":true}); mCSB_dragger.addClass("mCSB_dragger_onDrag");+ x=e.pageX-elemOffset.left; y=e.pageY-elemOffset.top;+ }+ if(x<elem.width() && x>0 && y<elem.height() && y>0){+ mCSB_draggerDragY=y; mCSB_draggerDragX=x;+ }+ }).bind("touchmove",function(e){+ e.preventDefault(); e.stopImmediatePropagation();+ var touch=e.originalEvent.touches[0] || e.originalEvent.changedTouches[0],+ elem=$(this),+ elemOffset=elem.offset(),+ x=touch.pageX-elemOffset.left,+ y=touch.pageY-elemOffset.top;+ scrollbarDrag(mCSB_draggerDragY,mCSB_draggerDragX,y,x);+ });+ $(document).bind("mousemove."+$this.data("mCustomScrollbarIndex"),function(e){+ if($this.data("on_drag")){+ var elem=mCSB_dragger,+ elemOffset=elem.offset(),+ x=e.pageX-elemOffset.left,+ y=e.pageY-elemOffset.top;+ scrollbarDrag(mCSB_draggerDragY,mCSB_draggerDragX,y,x);+ }+ }).bind("mouseup."+$this.data("mCustomScrollbarIndex"),function(e){+ $this.data({"on_drag":false}); mCSB_dragger.removeClass("mCSB_dragger_onDrag");+ });+ }+ $this.data({"bindEvent_scrollbar_drag":true});+ }+ function scrollbarDrag(mCSB_draggerDragY,mCSB_draggerDragX,y,x){+ if($this.data("horizontalScroll")){+ $this.mCustomScrollbar("scrollTo",(mCSB_dragger.position().left-(mCSB_draggerDragX))+x,{moveDragger:true,trigger:"internal"});+ }else{+ $this.mCustomScrollbar("scrollTo",(mCSB_dragger.position().top-(mCSB_draggerDragY))+y,{moveDragger:true,trigger:"internal"});+ }+ }+ /*content touch-drag*/+ if($.support.touch && $this.data("contentTouchScroll")){+ if(!$this.data("bindEvent_content_touch")){+ var touch,+ elem,elemOffset,y,x,mCSB_containerTouchY,mCSB_containerTouchX;+ mCSB_container.bind("touchstart",function(e){+ e.stopImmediatePropagation();+ touch=e.originalEvent.touches[0] || e.originalEvent.changedTouches[0];+ elem=$(this);+ elemOffset=elem.offset();+ x=touch.pageX-elemOffset.left;+ y=touch.pageY-elemOffset.top;+ mCSB_containerTouchY=y;+ mCSB_containerTouchX=x;+ });+ mCSB_container.bind("touchmove",function(e){+ e.preventDefault(); e.stopImmediatePropagation();+ touch=e.originalEvent.touches[0] || e.originalEvent.changedTouches[0];+ elem=$(this).parent();+ elemOffset=elem.offset();+ x=touch.pageX-elemOffset.left;+ y=touch.pageY-elemOffset.top;+ if($this.data("horizontalScroll")){+ $this.mCustomScrollbar("scrollTo",mCSB_containerTouchX-x,{trigger:"internal"});+ }else{+ $this.mCustomScrollbar("scrollTo",mCSB_containerTouchY-y,{trigger:"internal"});+ }+ });+ }+ }+ /*dragger rail click scrolling*/+ if(!$this.data("bindEvent_scrollbar_click")){+ mCSB_draggerContainer.bind("click",function(e){+ var scrollToPos=(e.pageY-mCSB_draggerContainer.offset().top)*$this.data("scrollAmount"),target=$(e.target);+ if($this.data("horizontalScroll")){+ scrollToPos=(e.pageX-mCSB_draggerContainer.offset().left)*$this.data("scrollAmount");+ }+ if(target.hasClass("mCSB_draggerContainer") || target.hasClass("mCSB_draggerRail")){+ $this.mCustomScrollbar("scrollTo",scrollToPos,{trigger:"internal",scrollEasing:"draggerRailEase"});+ }+ });+ $this.data({"bindEvent_scrollbar_click":true});+ }+ /*mousewheel scrolling*/+ if($this.data("mouseWheel")){+ if(!$this.data("bindEvent_mousewheel")){+ mCustomScrollBox.bind("mousewheel",function(e,delta){+ var scrollTo,mouseWheelPixels=$this.data("mouseWheelPixels"),absPos=Math.abs(mCSB_container.position().top),+ draggerPos=mCSB_dragger.position().top,limit=mCSB_draggerContainer.height()-mCSB_dragger.height();+ if($this.data("normalizeMouseWheelDelta")){+ if(delta<0){delta=-1;}else{delta=1;}+ }+ if(mouseWheelPixels==="auto"){+ mouseWheelPixels=100+Math.round($this.data("scrollAmount")/2);+ }+ if($this.data("horizontalScroll")){+ draggerPos=mCSB_dragger.position().left;+ limit=mCSB_draggerContainer.width()-mCSB_dragger.width();+ absPos=Math.abs(mCSB_container.position().left);+ }+ if((delta>0 && draggerPos!==0) || (delta<0 && draggerPos!==limit)){e.preventDefault(); e.stopImmediatePropagation();}+ scrollTo=absPos-(delta*mouseWheelPixels);+ $this.mCustomScrollbar("scrollTo",scrollTo,{trigger:"internal"});+ });+ $this.data({"bindEvent_mousewheel":true});+ }+ }+ /*buttons scrolling*/+ if($this.data("scrollButtons_enable")){+ if($this.data("scrollButtons_scrollType")==="pixels"){ /*scroll by pixels*/+ if($this.data("horizontalScroll")){+ mCSB_buttonRight.add(mCSB_buttonLeft).unbind("mousedown touchstart MSPointerDown mouseup MSPointerUp mouseout MSPointerOut touchend",mCSB_buttonRight_stop,mCSB_buttonLeft_stop);+ $this.data({"bindEvent_buttonsContinuous_x":false});+ if(!$this.data("bindEvent_buttonsPixels_x")){+ /*scroll right*/+ mCSB_buttonRight.bind("click",function(e){+ e.preventDefault();+ PixelsScrollTo(Math.abs(mCSB_container.position().left)+$this.data("scrollButtons_scrollAmount"));+ });+ /*scroll left*/+ mCSB_buttonLeft.bind("click",function(e){+ e.preventDefault();+ PixelsScrollTo(Math.abs(mCSB_container.position().left)-$this.data("scrollButtons_scrollAmount"));+ });+ $this.data({"bindEvent_buttonsPixels_x":true});+ }+ }else{+ mCSB_buttonDown.add(mCSB_buttonUp).unbind("mousedown touchstart MSPointerDown mouseup MSPointerUp mouseout MSPointerOut touchend",mCSB_buttonRight_stop,mCSB_buttonLeft_stop);+ $this.data({"bindEvent_buttonsContinuous_y":false});+ if(!$this.data("bindEvent_buttonsPixels_y")){+ /*scroll down*/+ mCSB_buttonDown.bind("click",function(e){+ e.preventDefault();+ PixelsScrollTo(Math.abs(mCSB_container.position().top)+$this.data("scrollButtons_scrollAmount"));+ });+ /*scroll up*/+ mCSB_buttonUp.bind("click",function(e){+ e.preventDefault();+ PixelsScrollTo(Math.abs(mCSB_container.position().top)-$this.data("scrollButtons_scrollAmount"));+ });+ $this.data({"bindEvent_buttonsPixels_y":true});+ }+ }+ function PixelsScrollTo(to){+ if(!mCSB_dragger.data("preventAction")){+ mCSB_dragger.data("preventAction",true);+ $this.mCustomScrollbar("scrollTo",to,{trigger:"internal"});+ }+ }+ }else{ /*continuous scrolling*/+ if($this.data("horizontalScroll")){+ mCSB_buttonRight.add(mCSB_buttonLeft).unbind("click");+ $this.data({"bindEvent_buttonsPixels_x":false});+ if(!$this.data("bindEvent_buttonsContinuous_x")){+ /*scroll right*/+ mCSB_buttonRight.bind("mousedown touchstart MSPointerDown",function(e){+ e.preventDefault();+ var scrollButtonsSpeed=ScrollButtonsSpeed();+ $this.data({"mCSB_buttonScrollRight":setInterval(function(){+ $this.mCustomScrollbar("scrollTo",Math.abs(mCSB_container.position().left)+scrollButtonsSpeed,{trigger:"internal",scrollEasing:"easeOutCirc"});+ },17)});+ });+ var mCSB_buttonRight_stop=function(e){+ e.preventDefault(); clearInterval($this.data("mCSB_buttonScrollRight"));+ }+ mCSB_buttonRight.bind("mouseup touchend MSPointerUp mouseout MSPointerOut",mCSB_buttonRight_stop);+ /*scroll left*/+ mCSB_buttonLeft.bind("mousedown touchstart MSPointerDown",function(e){+ e.preventDefault();+ var scrollButtonsSpeed=ScrollButtonsSpeed();+ $this.data({"mCSB_buttonScrollLeft":setInterval(function(){+ $this.mCustomScrollbar("scrollTo",Math.abs(mCSB_container.position().left)-scrollButtonsSpeed,{trigger:"internal",scrollEasing:"easeOutCirc"});+ },17)});+ });+ var mCSB_buttonLeft_stop=function(e){+ e.preventDefault(); clearInterval($this.data("mCSB_buttonScrollLeft"));+ }+ mCSB_buttonLeft.bind("mouseup touchend MSPointerUp mouseout MSPointerOut",mCSB_buttonLeft_stop);+ $this.data({"bindEvent_buttonsContinuous_x":true});+ }+ }else{+ mCSB_buttonDown.add(mCSB_buttonUp).unbind("click");+ $this.data({"bindEvent_buttonsPixels_y":false});+ if(!$this.data("bindEvent_buttonsContinuous_y")){+ /*scroll down*/+ mCSB_buttonDown.bind("mousedown touchstart MSPointerDown",function(e){+ e.preventDefault();+ var scrollButtonsSpeed=ScrollButtonsSpeed();+ $this.data({"mCSB_buttonScrollDown":setInterval(function(){+ $this.mCustomScrollbar("scrollTo",Math.abs(mCSB_container.position().top)+scrollButtonsSpeed,{trigger:"internal",scrollEasing:"easeOutCirc"});+ },17)});+ });+ var mCSB_buttonDown_stop=function(e){+ e.preventDefault(); clearInterval($this.data("mCSB_buttonScrollDown"));+ }+ mCSB_buttonDown.bind("mouseup touchend MSPointerUp mouseout MSPointerOut",mCSB_buttonDown_stop);+ /*scroll up*/+ mCSB_buttonUp.bind("mousedown touchstart MSPointerDown",function(e){+ e.preventDefault();+ var scrollButtonsSpeed=ScrollButtonsSpeed();+ $this.data({"mCSB_buttonScrollUp":setInterval(function(){+ $this.mCustomScrollbar("scrollTo",Math.abs(mCSB_container.position().top)-scrollButtonsSpeed,{trigger:"internal",scrollEasing:"easeOutCirc"});+ },17)});+ });+ var mCSB_buttonUp_stop=function(e){+ e.preventDefault(); clearInterval($this.data("mCSB_buttonScrollUp"));+ }+ mCSB_buttonUp.bind("mouseup touchend MSPointerUp mouseout MSPointerOut",mCSB_buttonUp_stop);+ $this.data({"bindEvent_buttonsContinuous_y":true});+ }+ }+ function ScrollButtonsSpeed(){+ var speed=$this.data("scrollButtons_scrollSpeed");+ if($this.data("scrollButtons_scrollSpeed")==="auto"){+ speed=Math.round(($this.data("scrollInertia")+100)/40);+ }+ return speed;+ }+ }+ }+ /*scrolling on element focus (e.g. via TAB key)*/+ if($this.data("autoScrollOnFocus")){+ if(!$this.data("bindEvent_focusin")){+ mCustomScrollBox.bind("focusin",function(){+ mCustomScrollBox.scrollTop(0).scrollLeft(0);+ var focusedElem=$(document.activeElement);+ if(focusedElem.is("input,textarea,select,button,a[tabindex],area,object")){+ var mCSB_containerPos=mCSB_container.position().top,+ focusedElemPos=focusedElem.position().top,+ visibleLimit=mCustomScrollBox.height()-focusedElem.outerHeight();+ if($this.data("horizontalScroll")){+ mCSB_containerPos=mCSB_container.position().left;+ focusedElemPos=focusedElem.position().left;+ visibleLimit=mCustomScrollBox.width()-focusedElem.outerWidth();+ }+ if(mCSB_containerPos+focusedElemPos<0 || mCSB_containerPos+focusedElemPos>visibleLimit){+ $this.mCustomScrollbar("scrollTo",focusedElemPos,{trigger:"internal"});+ }+ }+ });+ $this.data({"bindEvent_focusin":true});+ }+ }+ /*auto-hide scrollbar*/+ if($this.data("autoHideScrollbar")){+ if(!$this.data("bindEvent_autoHideScrollbar")){+ mCustomScrollBox.bind("mouseenter",function(e){+ mCustomScrollBox.addClass("mCS-mouse-over");+ functions.showScrollbar.call(mCustomScrollBox.children(".mCSB_scrollTools"));+ }).bind("mouseleave touchend",function(e){+ mCustomScrollBox.removeClass("mCS-mouse-over");+ if(e.type==="mouseleave"){functions.hideScrollbar.call(mCustomScrollBox.children(".mCSB_scrollTools"));}+ });+ $this.data({"bindEvent_autoHideScrollbar":true});+ }+ }+ },+ scrollTo:function(scrollTo,options){+ var $this=$(this),+ defaults={+ moveDragger:false,+ trigger:"external",+ callbacks:true,+ scrollInertia:$this.data("scrollInertia"),+ scrollEasing:$this.data("scrollEasing")+ },+ options=$.extend(defaults,options),+ draggerScrollTo,+ mCustomScrollBox=$this.children(".mCustomScrollBox"),+ mCSB_container=mCustomScrollBox.children(".mCSB_container"),+ mCSB_scrollTools=mCustomScrollBox.children(".mCSB_scrollTools"),+ mCSB_draggerContainer=mCSB_scrollTools.children(".mCSB_draggerContainer"),+ mCSB_dragger=mCSB_draggerContainer.children(".mCSB_dragger"),+ contentSpeed=draggerSpeed=options.scrollInertia,+ scrollBeginning,scrollBeginningOffset,totalScroll,totalScrollOffset;+ if(!mCSB_container.hasClass("mCS_no_scrollbar")){+ $this.data({"mCS_trigger":options.trigger});+ if($this.data("mCS_Init")){options.callbacks=false;}+ if(scrollTo || scrollTo===0){+ if(typeof(scrollTo)==="number"){ /*if integer, scroll by number of pixels*/+ if(options.moveDragger){ /*scroll dragger*/+ draggerScrollTo=scrollTo;+ if($this.data("horizontalScroll")){+ scrollTo=mCSB_dragger.position().left*$this.data("scrollAmount");+ }else{+ scrollTo=mCSB_dragger.position().top*$this.data("scrollAmount");+ }+ draggerSpeed=0;+ }else{ /*scroll content by default*/+ draggerScrollTo=scrollTo/$this.data("scrollAmount");+ }+ }else if(typeof(scrollTo)==="string"){ /*if string, scroll by element position*/+ var target;+ if(scrollTo==="top"){ /*scroll to top*/+ target=0;+ }else if(scrollTo==="bottom" && !$this.data("horizontalScroll")){ /*scroll to bottom*/+ target=mCSB_container.outerHeight()-mCustomScrollBox.height();+ }else if(scrollTo==="left"){ /*scroll to left*/+ target=0;+ }else if(scrollTo==="right" && $this.data("horizontalScroll")){ /*scroll to right*/+ target=mCSB_container.outerWidth()-mCustomScrollBox.width();+ }else if(scrollTo==="first"){ /*scroll to first element position*/+ target=$this.find(".mCSB_container").find(":first");+ }else if(scrollTo==="last"){ /*scroll to last element position*/+ target=$this.find(".mCSB_container").find(":last");+ }else{ /*scroll to element position*/+ target=$this.find(scrollTo);+ }+ if(target.length===1){ /*if such unique element exists, scroll to it*/+ if($this.data("horizontalScroll")){+ scrollTo=target.position().left;+ }else{+ scrollTo=target.position().top;+ }+ draggerScrollTo=scrollTo/$this.data("scrollAmount");+ }else{+ draggerScrollTo=scrollTo=target;+ }+ }+ /*scroll to*/+ if($this.data("horizontalScroll")){+ if($this.data("onTotalScrollBack_Offset")){ /*scroll beginning offset*/+ scrollBeginningOffset=-$this.data("onTotalScrollBack_Offset");+ }+ if($this.data("onTotalScroll_Offset")){ /*total scroll offset*/+ totalScrollOffset=mCustomScrollBox.width()-mCSB_container.outerWidth()+$this.data("onTotalScroll_Offset");+ }+ if(draggerScrollTo<0){ /*scroll start position*/+ draggerScrollTo=scrollTo=0; clearInterval($this.data("mCSB_buttonScrollLeft"));+ if(!scrollBeginningOffset){scrollBeginning=true;}+ }else if(draggerScrollTo>=mCSB_draggerContainer.width()-mCSB_dragger.width()){ /*scroll end position*/+ draggerScrollTo=mCSB_draggerContainer.width()-mCSB_dragger.width();+ scrollTo=mCustomScrollBox.width()-mCSB_container.outerWidth(); clearInterval($this.data("mCSB_buttonScrollRight"));+ if(!totalScrollOffset){totalScroll=true;}+ }else{scrollTo=-scrollTo;}+ var snapAmount = $this.data("snapAmount");+ if (snapAmount) {+ scrollTo = Math.round(scrollTo / snapAmount) * snapAmount - $this.data("snapOffset");+ }+ /*scrolling animation*/+ functions.mTweenAxis.call(this,mCSB_dragger[0],"left",Math.round(draggerScrollTo),draggerSpeed,options.scrollEasing);+ functions.mTweenAxis.call(this,mCSB_container[0],"left",Math.round(scrollTo),contentSpeed,options.scrollEasing,{+ onStart:function(){+ if(options.callbacks && !$this.data("mCS_tweenRunning")){callbacks("onScrollStart");}+ if($this.data("autoHideScrollbar")){functions.showScrollbar.call(mCSB_scrollTools);}+ },+ onUpdate:function(){+ if(options.callbacks){callbacks("whileScrolling");}+ },+ onComplete:function(){+ if(options.callbacks){+ callbacks("onScroll");+ if(scrollBeginning || (scrollBeginningOffset && mCSB_container.position().left>=scrollBeginningOffset)){callbacks("onTotalScrollBack");}+ if(totalScroll || (totalScrollOffset && mCSB_container.position().left<=totalScrollOffset)){callbacks("onTotalScroll");}+ }+ mCSB_dragger.data("preventAction",false); $this.data("mCS_tweenRunning",false);+ if($this.data("autoHideScrollbar")){if(!mCustomScrollBox.hasClass("mCS-mouse-over")){functions.hideScrollbar.call(mCSB_scrollTools);}}+ }+ });+ }else{+ if($this.data("onTotalScrollBack_Offset")){ /*scroll beginning offset*/+ scrollBeginningOffset=-$this.data("onTotalScrollBack_Offset");+ }+ if($this.data("onTotalScroll_Offset")){ /*total scroll offset*/+ totalScrollOffset=mCustomScrollBox.height()-mCSB_container.outerHeight()+$this.data("onTotalScroll_Offset");+ }+ if(draggerScrollTo<0){ /*scroll start position*/+ draggerScrollTo=scrollTo=0; clearInterval($this.data("mCSB_buttonScrollUp"));+ if(!scrollBeginningOffset){scrollBeginning=true;}+ }else if(draggerScrollTo>=mCSB_draggerContainer.height()-mCSB_dragger.height()){ /*scroll end position*/+ draggerScrollTo=mCSB_draggerContainer.height()-mCSB_dragger.height();+ scrollTo=mCustomScrollBox.height()-mCSB_container.outerHeight(); clearInterval($this.data("mCSB_buttonScrollDown"));+ if(!totalScrollOffset){totalScroll=true;}+ }else{scrollTo=-scrollTo;}+ var snapAmount = $this.data("snapAmount");+ if (snapAmount) {+ scrollTo = Math.round(scrollTo / snapAmount) * snapAmount - $this.data("snapOffset");+ }+ /*scrolling animation*/+ functions.mTweenAxis.call(this,mCSB_dragger[0],"top",Math.round(draggerScrollTo),draggerSpeed,options.scrollEasing);+ functions.mTweenAxis.call(this,mCSB_container[0],"top",Math.round(scrollTo),contentSpeed,options.scrollEasing,{+ onStart:function(){+ if(options.callbacks && !$this.data("mCS_tweenRunning")){callbacks("onScrollStart");}+ if($this.data("autoHideScrollbar")){functions.showScrollbar.call(mCSB_scrollTools);}+ },+ onUpdate:function(){+ if(options.callbacks){callbacks("whileScrolling");}+ },+ onComplete:function(){+ if(options.callbacks){+ callbacks("onScroll");+ if(scrollBeginning || (scrollBeginningOffset && mCSB_container.position().top>=scrollBeginningOffset)){callbacks("onTotalScrollBack");}+ if(totalScroll || (totalScrollOffset && mCSB_container.position().top<=totalScrollOffset)){callbacks("onTotalScroll");}+ }+ mCSB_dragger.data("preventAction",false); $this.data("mCS_tweenRunning",false);+ if($this.data("autoHideScrollbar")){if(!mCustomScrollBox.hasClass("mCS-mouse-over")){functions.hideScrollbar.call(mCSB_scrollTools);}}+ }+ });+ }+ if($this.data("mCS_Init")){$this.data({"mCS_Init":false});}+ }+ }+ /*callbacks*/+ function callbacks(cb){+ this.mcs={+ top:mCSB_container.position().top,left:mCSB_container.position().left,+ draggerTop:mCSB_dragger.position().top,draggerLeft:mCSB_dragger.position().left,+ topPct:Math.round((100*Math.abs(mCSB_container.position().top))/Math.abs(mCSB_container.outerHeight()-mCustomScrollBox.height())),+ leftPct:Math.round((100*Math.abs(mCSB_container.position().left))/Math.abs(mCSB_container.outerWidth()-mCustomScrollBox.width()))+ };+ switch(cb){+ /*start scrolling callback*/+ case "onScrollStart":+ $this.data("mCS_tweenRunning",true).data("onScrollStart_Callback").call($this,this.mcs);+ break;+ case "whileScrolling":+ $this.data("whileScrolling_Callback").call($this,this.mcs);+ break;+ case "onScroll":+ $this.data("onScroll_Callback").call($this,this.mcs);+ break;+ case "onTotalScrollBack":+ $this.data("onTotalScrollBack_Callback").call($this,this.mcs);+ break;+ case "onTotalScroll":+ $this.data("onTotalScroll_Callback").call($this,this.mcs);+ break;+ }+ }+ },+ stop:function(){+ var $this=$(this),+ mCSB_container=$this.children().children(".mCSB_container"),+ mCSB_dragger=$this.children().children().children().children(".mCSB_dragger");+ functions.mTweenAxisStop.call(this,mCSB_container[0]);+ functions.mTweenAxisStop.call(this,mCSB_dragger[0]);+ },+ disable:function(resetScroll){+ var $this=$(this),+ mCustomScrollBox=$this.children(".mCustomScrollBox"),+ mCSB_container=mCustomScrollBox.children(".mCSB_container"),+ mCSB_scrollTools=mCustomScrollBox.children(".mCSB_scrollTools"),+ mCSB_dragger=mCSB_scrollTools.children().children(".mCSB_dragger");+ mCustomScrollBox.unbind("mousewheel focusin mouseenter mouseleave touchend");+ mCSB_container.unbind("touchstart touchmove")+ if(resetScroll){+ if($this.data("horizontalScroll")){+ mCSB_dragger.add(mCSB_container).css("left",0);+ }else{+ mCSB_dragger.add(mCSB_container).css("top",0);+ }+ }+ mCSB_scrollTools.css("display","none");+ mCSB_container.addClass("mCS_no_scrollbar");+ $this.data({"bindEvent_mousewheel":false,"bindEvent_focusin":false,"bindEvent_content_touch":false,"bindEvent_autoHideScrollbar":false}).addClass("mCS_disabled");+ },+ destroy:function(){+ var $this=$(this);+ $this.removeClass("mCustomScrollbar _mCS_"+$this.data("mCustomScrollbarIndex")).addClass("mCS_destroyed").children().children(".mCSB_container").unwrap().children().unwrap().siblings(".mCSB_scrollTools").remove();+ $(document).unbind("mousemove."+$this.data("mCustomScrollbarIndex")+" mouseup."+$this.data("mCustomScrollbarIndex")+" MSPointerMove."+$this.data("mCustomScrollbarIndex")+" MSPointerUp."+$this.data("mCustomScrollbarIndex"));+ $(window).unbind("resize."+$this.data("mCustomScrollbarIndex"));+ }+ },+ functions={+ /*hide/show scrollbar*/+ showScrollbar:function(){+ this.stop().animate({opacity:1},"fast");+ },+ hideScrollbar:function(){+ this.stop().animate({opacity:0},"fast");+ },+ /*js animation tween*/+ mTweenAxis:function(el,prop,to,duration,easing,callbacks){+ var callbacks=callbacks || {},+ onStart=callbacks.onStart || function(){},onUpdate=callbacks.onUpdate || function(){},onComplete=callbacks.onComplete || function(){};+ var startTime=_getTime(),_delay,progress=0,from=el.offsetTop,elStyle=el.style;+ if(prop==="left"){from=el.offsetLeft;}+ var diff=to-from;+ _cancelTween();+ _startTween();+ function _getTime(){+ if(window.performance && window.performance.now){+ return window.performance.now();+ }else{+ if(window.performance && window.performance.webkitNow){+ return window.performance.webkitNow();+ }else{+ if(Date.now){return Date.now();}else{return new Date().getTime();}+ }+ }+ }+ function _step(){+ if(!progress){onStart.call();}+ progress=_getTime()-startTime;+ _tween();+ if(progress>=el._time){+ el._time=(progress>el._time) ? progress+_delay-(progress- el._time) : progress+_delay-1;+ if(el._time<progress+1){el._time=progress+1;}+ }+ if(el._time<duration){el._id=_request(_step);}else{onComplete.call();}+ }+ function _tween(){+ if(duration>0){+ el.currVal=_ease(el._time,from,diff,duration,easing);+ elStyle[prop]=Math.round(el.currVal)+"px";+ }else{+ elStyle[prop]=to+"px";+ }+ onUpdate.call();+ }+ function _startTween(){+ _delay=1000/60;+ el._time=progress+_delay;+ _request=(!window.requestAnimationFrame) ? function(f){_tween(); return setTimeout(f,0.01);} : window.requestAnimationFrame;+ el._id=_request(_step);+ }+ function _cancelTween(){+ if(el._id==null){return;}+ if(!window.requestAnimationFrame){clearTimeout(el._id);+ }else{window.cancelAnimationFrame(el._id);}+ el._id=null;+ }+ function _ease(t,b,c,d,type){+ switch(type){+ case "linear":+ return c*t/d + b;+ break;+ case "easeOutQuad":+ t /= d; return -c * t*(t-2) + b;+ break;+ case "easeInOutQuad":+ t /= d/2;+ if (t < 1) return c/2*t*t + b;+ t--;+ return -c/2 * (t*(t-2) - 1) + b;+ break;+ case "easeOutCubic":+ t /= d; t--; return c*(t*t*t + 1) + b;+ break;+ case "easeOutQuart":+ t /= d; t--; return -c * (t*t*t*t - 1) + b;+ break;+ case "easeOutQuint":+ t /= d; t--; return c*(t*t*t*t*t + 1) + b;+ break;+ case "easeOutCirc":+ t /= d; t--; return c * Math.sqrt(1 - t*t) + b;+ break;+ case "easeOutSine":+ return c * Math.sin(t/d * (Math.PI/2)) + b;+ break;+ case "easeOutExpo":+ return c * ( -Math.pow( 2, -10 * t/d ) + 1 ) + b;+ break;+ case "mcsEaseOut":+ var ts=(t/=d)*t,tc=ts*t;+ return b+c*(0.499999999999997*tc*ts + -2.5*ts*ts + 5.5*tc + -6.5*ts + 4*t);+ break;+ case "draggerRailEase":+ t /= d/2;+ if (t < 1) return c/2*t*t*t + b;+ t -= 2;+ return c/2*(t*t*t + 2) + b;+ break;+ }+ }+ },+ /*stop js animation tweens*/+ mTweenAxisStop:function(el){+ if(el._id==null){return;}+ if(!window.requestAnimationFrame){clearTimeout(el._id);+ }else{window.cancelAnimationFrame(el._id);}+ el._id=null;+ },+ /*detect requestAnimationFrame and polyfill*/+ rafPolyfill:function(){+ var pfx=["ms","moz","webkit","o"],i=pfx.length;+ while(--i > -1 && !window.requestAnimationFrame){+ window.requestAnimationFrame=window[pfx[i]+"RequestAnimationFrame"];+ window.cancelAnimationFrame=window[pfx[i]+"CancelAnimationFrame"] || window[pfx[i]+"CancelRequestAnimationFrame"];+ }+ }+ }+ /*detect features*/+ functions.rafPolyfill.call(); /*requestAnimationFrame*/+ $.support.touch=!!('ontouchstart' in window); /*touch*/+ $.support.msPointer=window.navigator.msPointerEnabled; /*MSPointer support*/+ /*plugin dependencies*/+ var _dlp=("https:"==document.location.protocol) ? "https:" : "http:";+ $.event.special.mousewheel || document.write('<script src="'+_dlp+'//cdnjs.cloudflare.com/ajax/libs/jquery-mousewheel/3.0.6/jquery.mousewheel.min.js"><\/script>');+ /*plugin fn*/+ $.fn.mCustomScrollbar=function(method){+ if(methods[method]){+ return methods[method].apply(this,Array.prototype.slice.call(arguments,1));+ }else if(typeof method==="object" || !method){+ return methods.init.apply(this,arguments);+ }else{+ $.error("Method "+method+" does not exist");+ }+ };+})(jQuery);\ No newline at end of filediff --git a/js/main.js b/js/main.jsindex 26f0f2e19..2480de26d 100644--- a/js/main.js+++ b/js/main.js@@ -33,21 +33,25 @@ $(function() {// Initialize "static" varsWorldview.BUILD_TIMESTAMP,max: 4});-- selector = new YAHOO.widget.Panel("selector", { zIndex:1019, visible:false } );++ //$('#products').tabs();++ /*selector = new YAHOO.widget.Panel("selector", { zIndex:1019, visible:false } );selector.setBody("<div id='selectorbox'></div>");selector.render(document.body);var sel_id = selector.id;selector.beforeHideEvent.subscribe(function(e){ $("#"+sel_id).css("display","none");})//selector.beforeHideEvent.subscribe(closeSelector);selector.beforeShowEvent.subscribe(function(e){$("#"+sel_id).css("display","block");})- //this.selector.subscribe("beforeHide", closeSelector);+ //this.selector.subscribe("beforeHide", closeSelector);*/// Create mapvar m = Worldview.Widget.WorldviewMap("map", config);- var palettes = Worldview.Widget.Palette("palettes", config, {alignTo: "#products"});+ window.config = config;+ window.palettes = Worldview.Widget.Palette("palettes", config, {alignTo: "#products"});var ss = new SOTE.widget.Switch("switch",{dataSourceUrl:"a",selected:"geographic"});- var a = new SOTE.widget.Bank("products",{paletteWidget: palettes, dataSourceUrl:"ap_products.php",title:"My Layers",selected:{antarctic:"baselayers,MODIS_Terra_CorrectedReflectance_TrueColor~overlays,antarctic_coastlines", arctic:"baselayers,MODIS_Terra_CorrectedReflectance_TrueColor~overlays,arctic_coastlines",geographic:"baselayers,MODIS_Terra_CorrectedReflectance_TrueColor~overlays,sedac_bound"},categories:["Base Layers","Overlays"],callback:showSelector,selector:selector,config:config});- var s = new SOTE.widget.Selector("selectorbox",{dataSourceUrl:"ap_products.php",categories:["Base Layers","Overlays"]});+ var p = new SOTE.widget.Products("productsHolder");+ //var a = new SOTE.widget.Bank("products",{paletteWidget: palettes, dataSourceUrl:"ap_products.php",title:"My Layers",selected:{antarctic:"baselayers,MODIS_Terra_CorrectedReflectance_TrueColor~overlays,antarctic_coastlines", arctic:"baselayers,MODIS_Terra_CorrectedReflectance_TrueColor~overlays,arctic_coastlines",geographic:"baselayers,MODIS_Terra_CorrectedReflectance_TrueColor~overlays,sedac_bound"},categories:["Base Layers","Overlays"],callback:showSelector,selector:selector,config:config});+ //var s = new SOTE.widget.Selector("selectorbox",{dataSourceUrl:"ap_products.php",categories:["Base Layers","Overlays"]});//var h = new SOTE.widget.MenuPicker("hazard",{dataSourceUrl:"data/mp_hazard.php"});//var tr = new SOTE.widget.MenuPicker("transition",{dataSourceUrl:"data/mp_transition.php"});var map = new SOTE.widget.DateSpan("time",{hasThumbnail:false});@@ -86,7 +90,7 @@ $(function() {// Initialize "static" varsvar queryString = Worldview.Permalink.decode(window.location.search.substring(1));var initOrder = [ss, // projection- a, // products+ p.b, // productsmap, // timem, // mappalettesdiff --git a/js/products.js b/js/products.jsnew file mode 100644index 000000000..a2922159e--- /dev/null+++ b/js/products.js@@ -0,0 +1,209 @@+SOTE.namespace("SOTE.widget.Products");++SOTE.widget.Products.prototype = new SOTE.widget.Component;++/**+ * Instantiate the Products+ *+ * @class A selection device classifying radio buttons/checkboxes into categories that are displayed in Accordion form.+ * Radio buttons allow single selection accross categories. Checkboxes allow multiple selections accross categories.+ * Radio selections cannot span multiple categories.+ * @constructor+ * @this {Products}+ * @param {String} containerId is the container id of the div in which to render the object+ * @param {Object} [config] is a hash allowing configuration of this component+ * @config {Object[]} [items] a JS Array of JS Objects: items.category[i..n].key, items.category[i..n].value+ * , items.category[i..n].action, items.type[i..n] representing the available options+ * @config {String} [selected] the key of the initially selected option(s)+ * @augments SOTE.widget.Component+ *+*/+SOTE.widget.Products = function(containerId, config){+ this.log = Logging.getLogger("Worldview.Widget.Products");+ //this.VALID_PROJECTIONS = ["geographic", "arctic", "antarctic"];++ //Get the ID of the container element+ this.container=document.getElementById(containerId);+ if (this.container==null){+ this.setStatus("Error: element '"+containerId+"' not found!",true);+ return;+ }+ this.id = containerId;+ //Store the container's ID+ this.containerId=containerId;++ //Define an object for holding configuration+ if (config===undefined){+ config={};+ }++ if(config.title === undefined){+ config.title = "My Products";+ }++ if(config.categories === undefined){+ config.categories = ["Category 1","Category 2"];+ }++ if(config.callback === undefined){+ config.callback = null;+ }++ if(config.state === undefined || config.state === ""){+ config.state = "geographic";+ }+++ this.state = config.state;+ this.selected = config.selected;+ this.isCollapsed = false;+ this.dataSourceUrl = config.dataSourceUrl;+ this.categories = config.categories;+ this.initRenderComplete = false;+ this.init();++}++/**+ * Displays all options in HTML in an Accordion format (see JQuery UI Accordion) with the selected states being indicated+ * by radio button and checkbox selection. All callbacks should be set. The component UI should be rendered+ * with controllers to call the events.+ *+ *+ * @this {Products}+ *+*/+SOTE.widget.Products.prototype.init = function(){++ this.render();+ if(REGISTRY){+ REGISTRY.register(this.id,this);+ }+ else{+ alert("No REGISTRY found! Cannot register Products!");+ }+++};++/**+ * Renders the UI accordion from this.items+ *+ *+ * @this {Products}+ *+*/+SOTE.widget.Products.prototype.render = function(){++ this.container.innerHTML = "";+ var productContainer = document.createElement("div");+ productContainer.setAttribute("id",this.id+"prods");+ productContainer.setAttribute("class","products");++ var tabs = document.createElement("ul");+ tabs.innerHTML = "<li class='first'><a href='#products' class='activetab tab'>Active</a></li><li class='second'><a class='addlayerstab tab' href='#selectorbox'>Add Layers +</a></li>";+ productContainer.appendChild(tabs);+ //$('#'+this.id).addClass('products');+ var container = document.createElement("div");+ container.setAttribute("id","products");+ productContainer.appendChild(container);++ var selectorbox = document.createElement("div");+ selectorbox.setAttribute("id","selectorbox");+ productContainer.appendChild(selectorbox);++++ this.container.appendChild(productContainer);+ $('#'+this.id+"prods").tabs({show: SOTE.widget.Products.change});+ this.b = new SOTE.widget.Bank("products",{paletteWidget: window.palettes, dataSourceUrl:"ap_products.php",title:"My Layers",selected:{antarctic:"baselayers,MODIS_Terra_CorrectedReflectance_TrueColor~overlays,antarctic_coastlines", arctic:"baselayers,MODIS_Terra_CorrectedReflectance_TrueColor~overlays,arctic_coastlines",geographic:"baselayers,MODIS_Terra_CorrectedReflectance_TrueColor~overlays,sedac_bound"},categories:["Base Layers","Overlays"],config:window.config});+ this.s = new SOTE.widget.Selector("selectorbox",{dataSourceUrl:"ap_products.php",categories:["Base Layers","Overlays"],selected:{antarctic:"baselayers,MODIS_Terra_CorrectedReflectance_TrueColor~overlays,antarctic_coastlines", arctic:"baselayers,MODIS_Terra_CorrectedReflectance_TrueColor~overlays,arctic_coastlines",geographic:"baselayers,MODIS_Terra_CorrectedReflectance_TrueColor~overlays,sedac_bound"}});++ //$('#'+this.id+"prods").on("tabsshow",SOTE.widget.Products.change);++ var accordionToggler = document.createElement("a");+ accordionToggler.setAttribute("class","accordionToggler atcollapse");+ accordionToggler.setAttribute("title","Hide Products");+ this.isCollapsed = false;+ this.container.appendChild(accordionToggler);+ $('.accordionToggler').bind('click',{self:this},SOTE.widget.Products.toggle);++ // Mark the component as ready in the registry if called via init()+ if ((this.initRenderComplete === false) && REGISTRY) {+ this.initRenderComplete = true;+ REGISTRY.markComponentReady(this.id);+ }++};++SOTE.widget.Products.stopLink = function(e){+ //e.stopPropagation();+};++SOTE.widget.Products.change = function(e,ui){+ if(ui.index){+ $('.ui-tabs-nav').addClass('secondselected').removeClass('firstselected');+ }+ else {+ $('.ui-tabs-nav').addClass('firstselected').removeClass('secondselected');+ }+ return false;+};++SOTE.widget.Products.toggle = function(e,ui){+ var self = e.data.self;+ if(self.isCollapsed){+ $('.accordionToggler').removeClass('atexpand').addClass('atcollapse');+ $('.accordionToggler').attr("title","Hide Products");+ $('.products').css('display','block');+ self.isCollapsed = false;+ }+ else{+ $('.accordionToggler').removeClass('atcollapse').addClass('atexpand');+ $('.accordionToggler').attr("title","Show Products");+ $('.products').css('display','none');+ self.isCollapsed = true;+ }+};++/**+ * Fires an event to the registry when the state of the component is changed+ *+ * @this {Products}+ *+*/+SOTE.widget.Products.prototype.fire = function(){++ if(REGISTRY){+ REGISTRY.fire(this);+ }+ else{+ alert("No REGISTRY found! Cannot fire to REGISTRY from Products!");+ }++};++/**+ * Gets the currently selected option(s) [containerId]=[options]+ *+ * @this {Products}+ * @returns {String} [container]=[options], options being a dot delimited string+ * representing the key(s) of the currently selected option(s)+ *+*/+SOTE.widget.Products.prototype.getValue = function(){+ return this.id + "=" + this.b.value();+};++/**+ * Change the component based on dependencies (i.e. Available Options, Selected)+ *+ * @this {Bank}+ * @param {String} querystring contains all values of dependencies (from registry)+ * @returns {boolean} true or false depending on if the selected value still validats with criteria change+ *+*/+SOTE.widget.Products.prototype.updateComponent = function(querystring){+ var qs = (querystring === undefined)? "":querystring;+ this.fire();+};\ No newline at end of filediff --git a/js/registry.js b/js/registry.jsindex 162d778f3..54c0d0f7a 100644--- a/js/registry.js+++ b/js/registry.js@@ -86,13 +86,14 @@ SOTE.util.Registry = function () {var recursive = "";for(var j=0;j<consumers.length;j++){//if(i==0){ alert("consumer "+j+": "+consumers[j]); }- if(consumers[j] == this.getComponentId(comp)){+ if(consumers[j] == this.getComponentId(comp)){recursive = consumers[j];+ //delete consumers[j];break;}}//alert("Registry: fire: producer: "+this.getComponentId(comp)+", evtObj: "+evtObjA[i].consumerId+", recursive: "+recursive+", no fire val: "+noFireVal);- if(evtObjA[i].consumerId != noFireVal.split("=")[1]){+ if(evtObjA[i].consumerId != noFireVal.split("=")[1] && evtObjA[i].consumerId != recursive){/*if(recursive.length > 0){evtObjA[i].componentUpdate.fire(comp.getValue()+"&norecurse="+recursive);}else{*/diff --git a/js/selector.js b/js/selector.jsindex 7d31172a6..a69072d06 100644--- a/js/selector.js+++ b/js/selector.js@@ -41,9 +41,12 @@ SOTE.widget.Selector = function(containerId, config){if(config.state === undefined){config.state = "geographic";}-- this.values = new Object;+this.state = config.state;++ this.selected = config.selected;+ this.values = this.unserialize(this.selected[this.state]);+this.meta = new Object;this.categories = config.categories;this.initRenderComplete = false;@@ -116,7 +119,7 @@ SOTE.widget.Selector.prototype.render = function(){titleContainer.appendChild(title);this.container.appendChild(titleContainer);var count = 0;- for(var i in this.data){+ /*for(var i in this.data){count++;if(i !== "All" && i !== "palettes"){var catItem = document.createElement("li");@@ -145,7 +148,9 @@ SOTE.widget.Selector.prototype.render = function(){subFront.innerHTML = "<b>skip this step</b> to see all available layers >>";this.container.appendChild(subFront);$("#"+this.id).undelegate("#" + "subfront",'click');- $("#"+this.id).delegate("#" + "subfront",'click',{self:this,category:"All"},SOTE.widget.Selector.loadCategory);+ $("#"+this.id).delegate("#" + "subfront",'click',{self:this,category:"All"},SOTE.widget.Selector.loadCategory);*/+ SOTE.widget.Selector.loadCategory({ data: {self:this,category:"All"}, back: false });+// Mark the component as ready in the registry if called via init()if ((this.initRenderComplete === false) && REGISTRY) {@@ -177,32 +182,66 @@ SOTE.widget.Selector.loadCategory = function(e){var self = e.data.self;var cat = e.data.category;self.openCat = cat;- var back = (e.back)? false:true;+ var back = false;var categories = new Object;//self.container.innerHTML = "";$("#"+self.id).empty();- var titleContainer = document.createElement("div");+ /*var titleContainer = document.createElement("div");+ titleContainer.setAttribute("class","tabContainer");var title = document.createElement("h2");- title.innerHTML = "Choose Your Layers: " + cat;+ title.innerHTML = "Add Layers +";titleContainer.appendChild(title);- self.container.appendChild(titleContainer);+ self.container.appendChild(titleContainer);*/++ var form = document.createElement("div");+ form.setAttribute("class","facetedSearch");++ var select = document.createElement("select");+ select.setAttribute("id",self.id+"select");+ select.setAttribute("class","select");+ for (var c in self.data){+ if(c != 'palettes'){+ var opt = document.createElement("option");+ opt.setAttribute("value",c);+ opt.text = c;+ select.add(opt);+ }+ }++ form.appendChild(select);- var form = document.createElement("form");++ var search = document.createElement("input");+ search.setAttribute("type","text");+ search.setAttribute("name","search");+ search.setAttribute("id",self.id+"search");+ search.setAttribute("class","search");+ search.setAttribute("placeholder","ex. modis, terra, fire");+ search.setAttribute("autocomplete","off");++ form.appendChild(search);++ var content = document.createElement("div");+ content.setAttribute("id",self.id+"content");++ var categoryTitles = [];for(var i=0; i<self.categories.length; i++){var formattedCategoryName = self.categories[i].replace(/\s/g, "");- categories[formattedCategoryName.toLowerCase()] = document.createElement("ul");- categories[formattedCategoryName.toLowerCase()].setAttribute("id",self.id + formattedCategoryName.toLowerCase());- categories[formattedCategoryName.toLowerCase()].setAttribute("class","category");- var categoryTitleEl = document.createElement("li");++var categoryTitle = document.createElement("h3");categoryTitle.setAttribute("class","head");categoryTitle.innerHTML = self.categories[i];- categoryTitleEl.appendChild(categoryTitle);- categories[formattedCategoryName.toLowerCase()].appendChild(categoryTitleEl);+ categoryTitles.push(categoryTitle);++ categories[formattedCategoryName.toLowerCase()] = document.createElement("ul");+ categories[formattedCategoryName.toLowerCase()].setAttribute("id",self.id + formattedCategoryName.toLowerCase());+ categories[formattedCategoryName.toLowerCase()].setAttribute("class","category");+}@@ -217,7 +256,7 @@ SOTE.widget.Selector.loadCategory = function(e){itemP.innerHTML = item.sublabel;var itemInput = document.createElement("input");if(item.type === "single"){- itemInput.setAttribute("type","radio");+ itemInput.setAttribute("type","checkbox");itemInput.setAttribute("name",cat);}else {@@ -254,10 +293,12 @@ SOTE.widget.Selector.loadCategory = function(e){for(var i=0; i<self.categories.length; i++){var formattedCategoryName = self.categories[i].replace(/\s/g, "").toLowerCase();- form.appendChild(categories[formattedCategoryName]);+ content.appendChild(categoryTitles[i]);+ content.appendChild(categories[formattedCategoryName]);}self.container.appendChild(form);+ self.container.appendChild(content);//self.renderCanvases(cat);if(back){var subBack = document.createElement("a");@@ -269,10 +310,111 @@ SOTE.widget.Selector.loadCategory = function(e){$("#"+self.id).undelegate("#" + "subback",'click');$("#"+self.id).delegate("#" + "subback",'click',{self:self},SOTE.widget.Selector.callRender);}++ //$("#"+self.id+"search").undelegate('keypress');+ $("#"+self.id+"select").on('change',{self:self,select:true},SOTE.widget.Selector.selectCat);+ $('#'+self.id+"select").val("All");++ $("#"+self.id+"search").on('keyup',{self:self,select:false},SOTE.widget.Selector.search);+ $("#"+self.id+"search").focus();++ $(".category" ).mCustomScrollbar({horizontalScroll:false, advanced:{+ updateOnContentResize: true+ }});+self.adjustSelected();};+SOTE.widget.Selector.selectCat = function(e){+ e.data.self.openCat = e.target.value;+ $("#"+e.data.self.id+"search").keyup();+};++SOTE.widget.Selector.search = function(e){+ var self = e.data.self;+ var cat = self.openCat;+ var val = e.target.value.toUpperCase();+ var valArr = val.split(/\s/);+ //var re = new RegExp(val);+ var content = document.getElementById(self.id+"content");+ content.innerHTML = "";++ var categories = new Object;++ var categoryTitles = [];++ for(var i=0; i<self.categories.length; i++){+ var formattedCategoryName = self.categories[i].replace(/\s/g, "");+++ var categoryTitle = document.createElement("h3");+ categoryTitle.setAttribute("class","head");+ categoryTitle.innerHTML = self.categories[i];+ categoryTitles.push(categoryTitle);++ categories[formattedCategoryName.toLowerCase()] = document.createElement("ul");+ categories[formattedCategoryName.toLowerCase()].setAttribute("id",self.id + formattedCategoryName.toLowerCase());+ categories[formattedCategoryName.toLowerCase()].setAttribute("class","category");++ }+++ for(var i=0; i< self.data[cat].length; i++){+ var item = self.data[cat][i];++ //var matched = false;+ var count = 0;+ for(var j=0; j<valArr.length; ++j){+ var myVal = new RegExp(valArr[j]);+ if(item.label.toUpperCase().match(myVal) || item.sublabel.toUpperCase().match(myVal) || item.tags && item.tags.toUpperCase().match(myVal)) {+ count++;+ }+ }++ if(count == valArr.length) { //item.label.toUpperCase().match(val) || item.sublabel.toUpperCase().match(val)){++ var subItem = document.createElement("li");+ subItem.setAttribute("class","selectorItem item");+ var itemHead = document.createElement("h4");+ var formatted = item.value.replace(/:/g,"colon");+ itemHead.innerHTML = item.label;+ var itemP = document.createElement("p");+ itemP.innerHTML = item.sublabel;+ var itemInput = document.createElement("input");+ if(item.type === "single"){+ itemInput.setAttribute("type","checkbox");+ itemInput.setAttribute("name",cat);+ }+ else {+ itemInput.setAttribute("type","checkbox");+ }+ itemInput.setAttribute("class","css-checkbox");+ itemInput.setAttribute("id",formatted);+ itemInput.setAttribute("value",item.value);+ subItem.appendChild(itemInput);+ subItem.appendChild(itemHead);+ subItem.appendChild(itemP);++ categories[item.category].appendChild(subItem);+ //ul.appendChild(subItem);+ $("#"+self.id).delegate("#" + formatted,'click',{self:self},SOTE.widget.Selector.toggleValue);+ }+ }++ for(var i=0; i<self.categories.length; i++){+ var formattedCategoryName = self.categories[i].replace(/\s/g, "").toLowerCase();+ content.appendChild(categoryTitles[i]);+ content.appendChild(categories[formattedCategoryName]);+ }++ $(".category" ).mCustomScrollbar({horizontalScroll:false, advanced:{+ updateOnContentResize: true+ }});+ //content.appendChild(ul);++};+SOTE.widget.Selector.prototype.renderCanvases = function(cat){for(var i=0; i< this.data[cat].length; i++){var item = this.data[cat][i];@@ -301,8 +443,9 @@ SOTE.widget.Selector.prototype.adjustSelected = function(){if(this.values[formatted]){for(var k=0; k < this.values[formatted].length; k++){var val = this.values[formatted][k].value.replace(/:/g,"colon");- if(document.getElementById(val))- document.getElementById(val).checked = "checked";+ var el = document.getElementById(val);+ if(el)+ el.checked = "checked";}}}@@ -311,14 +454,14 @@ SOTE.widget.Selector.prototype.adjustSelected = function(){SOTE.widget.Selector.toggleValue = function(e){var self = e.data.self;var targetEl = e.target;- var category = $("#"+targetEl.id).parent().parent().attr("id");+ var category = $("#"+targetEl.id).parent().parent().parent().parent().attr("id");category = category.replace(self.id,"");var value = $("#"+targetEl.id).attr("value");value = value.replace(/colon/,":");var checked = $("#"+targetEl.id).attr("checked");if($("#"+targetEl.id).attr("type") == "radio"){self.values[category] = new Array();- self.values[category].push({"value":value});+ self.values[category].unshift({"value":value});}else {if(!self.values[category]){@@ -326,7 +469,7 @@ SOTE.widget.Selector.toggleValue = function(e){}if(checked !== undefined && checked == "checked"){self.removeItem(category,value);- self.values[category].push({"value":value});+ self.values[category].unshift({"value":value});}else{self.removeItem(category,value);@@ -415,11 +558,15 @@ SOTE.widget.Selector.prototype.serialize = function(values){SOTE.widget.Selector.prototype.unserialize = function(string){var unserialized = new Object;+ var hideIndicator = /^!/;var categories = string.split("~");for(var i=0; i<categories.length; i++){var items = categories[i].split(/[\.,]/);unserialized[items[0]] = new Array;for(var j=1; j<items.length; j++){+ if(hideIndicator.test(items[j])){+ items[j] = items[j].replace(/!/g,"");+ }unserialized[items[0]].push({"value":items[j]});}