diff --git a/deployed/mod_bt_googlemaps/modules/mod_bt_googlemaps/admin/css/bt.css b/deployed/mod_bt_googlemaps/modules/mod_bt_googlemaps/admin/css/bt.css new file mode 100644 index 00000000..df188e06 --- /dev/null +++ b/deployed/mod_bt_googlemaps/modules/mod_bt_googlemaps/admin/css/bt.css @@ -0,0 +1,559 @@ +.pane-sliders .panel { + border: none !important; + font-family:arial; +} +.pane-sliders .panel > h3 { + background:url(../images/header-bg.gif) repeat-x!important; + height:37px; + line-height:37px; + padding:0; +} +.pane-sliders .panel h3 span{ + text-transform:uppercase; + color:#c16306; +} + +.pane-toggler-down { + border-bottom:none!important; +} +.pane-toggler-down span { + background: url("../images/arrow-down.gif") no-repeat scroll 8px 50% transparent!important; + padding-left: 26px!important; +} +.pane-toggler span { + background: url("../images/arrow-up.gif") no-repeat scroll 10px 50% transparent!important; + padding-left: 26px!important; +} +.pane-sliders .panel{ + border:1px solid #cacaca!important; + border-top:1px solid #da710a!important; + border-radius:5px 5px 5px 5px; + padding:0 1px; + +} +fieldset.panelform{ + padding:10px!important; +} +fieldset.panelform li > label, fieldset.panelform div.paramrow label, fieldset.panelform span.faux-label { + max-width: 30% !important; + min-width: 21% !important; +} +fieldset.panelform .spacer h3{ + padding-top:5px; + margin:0px; + background:#fff!important; +} +#jform_params_about-lbl{ + display:none; +} +.panel fieldset.panelform > ul > li > label { + color: #505050; + font-size: 11px; + font-weight: bold; + max-width: 30% !important; + min-width: 30% !important; + text-align: left; +} +#module-sliders fieldset > ul > li > label { + color: #505050; + font-size: 11px; + font-weight: bold; + line-height: 18px; + max-width: 30% !important; + min-width: 30% !important; + text-align: left; +} +.fltrt ul.adminformlist li { + border-bottom: 1px dotted #c4c4c4; + min-height:35px; + padding:0px; + margin:5px; +} + +/* Fix chosen*/ +.chzn-container ul.chzn-results{ + min-width:95%; +} + +.fltrt ul.adminformlist li li{ + border-bottom: none; + min-height:0; + + padding: 7px 7px 8px; + margin: 0; + list-style: none; +} + +fieldset.adminform fieldset.radio, fieldset.panelform fieldset.radio, fieldset.adminform-legacy fieldset.radio { + border: 0 none; + float: left; + margin: 0 0 5px; + max-width: 68% !important; + min-width: 68% !important; + padding: 0; +} +fieldset.panelform input[type=text],fieldset.panelform textarea { + background:-moz-linear-gradient(center bottom , white 85%, #EEEEEE 99%) repeat scroll 0 0 transparent; + border: 1px solid #AAAAAA; + font-family: sans-serif; + font-size:11px; + margin: 1px 0; + outline: 0 none; + padding: 6px 20px 6px 5px; + border-radius: 4px 4px 4px 4px; +} +#module-sliders input[type="text"], #module-sliders textarea { + background: -moz-linear-gradient(center bottom , white 85%, #EEEEEE 99%) repeat scroll 0 0 transparent; + border: 1px solid #AAAAAA; + border-radius: 4px 4px 4px 4px; + font-family: sans-serif; + font-size: 11px; + margin: 1px 0; + outline: 0 none; + padding: 6px 20px 6px 5px; +} +.bt-desc{ + line-height:200%; +} +.bt-desc img{ + margin-right:10px; +} +.bt-license{ + border-top: 1px dotted #c4c4c4; + padding:10px 0px; +} +.bt-desc p a{ + display: inline-block; + height: 28px; + margin-right: 7px; + text-indent: -999px; + width: 28px; + text-decoration:none; + margin-top:10px; +} +.social-f { + background: url("../images/icon_f.png") no-repeat scroll left top transparent; +} +.social-f:hover { + background: url("../images/icon_f_hover.png") no-repeat scroll left top transparent; +} +.social-t { + background: url("../images/icon_t.png") no-repeat scroll left top transparent; +} +.social-t:hover { + background: url("../images/icon_t_hover.png") no-repeat scroll left top transparent; +} +.social-rss { + background: url("../images/icon_rss.png") no-repeat scroll left top transparent; +} +.social-rss:hover { + background: url("../images/icon_rss_hover.png") no-repeat scroll left top transparent; +} +.social-g { + background: url("../images/icon_group.png") no-repeat scroll left top transparent; +} +.social-g:hover { + background: url("../images/icon_group_hover.png") no-repeat scroll left top transparent; +} + +.switcher-yes,.switcher-no { + background: url("../images/switcher-yesno.png") no-repeat scroll 0 0 transparent; + cursor: pointer; + float: left; + height: 20px; + margin-top: 4px; + width: 64px; +} +.switcher-no { + background-position: 0 -20px; +} +.switcher-on,.switcher-off { + background: url("../images/switcher-onoff.png") no-repeat scroll 0 0 transparent; + cursor: pointer; + float: left; + height: 20px; + margin-top: 4px; + width: 64px; +} +.switcher-off { + background-position: 0 -20px; +} + +/* marker style */ + +/*Chinhpv style*/ +.marker-title-label-hide{ +display: none; +} +#bt-makers > li {list-style: none;} +#btg-dialog #btg-form-marker .btg-dialog-container > li, #btg-main-button, +#btg-style-main-button, #btg-style-dialog #btg-form-style .btg-style-dialog-container > li{ + min-height: 35px; + list-style: none; +} +#btg-dialog .btg-dialog-container > li,#btg-style-dialog .btg-style-dialog-container > li{ + padding: 3px 7px; + min-height:30px!important; +} + +#btg-submit-btn{ +padding-left: 29%; +} +#marker-form{ +width:100%; +} +#btg-dialog,#btg-style-dialog{ + padding: 10px 0 10px 0px; + border: 1px solid #E4E4E4; + border-radius: 5px; + margin-bottom: 10px; + width: 100%; + background:#F5F5F5; +} +ul.btg-dialog-container ul.btg-style-dialog-container{ + padding:0 15px; + list-style: none; +} +ul.btg-dialog-container > li ,ul.btg-style-dialog-container > li { + min-height: 35px; +} +.btg-icon-marker{ + width:100%!important; +} +ul.btg-dialog-container li label,ul.btg-style-dialog-container li label{ + color: #505050; + font-size: 11px; + font-weight: bold; + width: 120px; + display: block; + text-align: left; + float: left; +} +.img-marker{ + max-height: 25px; + max-width: 100px; + +} +.marker-icon .img-marker{ + margin-left: 68px; +} + +ul.btg-dialog-container li select{ + width: 180px; +} +#btg-message{ + padding: 0 15px; +} +#btg-messages .error{ + color: #f20000; + background: url(../images/error.png) left center no-repeat; +} +#btg-messages .success{ + background: url(../images/success.png) left center no-repeat; + color: #69a101; + +} +#btg-messages .bt-message{ + line-height: 20px; + font-size: 11px; + padding: 2px 12px; + margin: 2px; + +} +ul.btg-dialog-container input.error{ + border-color: #f20000; + +} + +.adminformlist .marker-display,.style-display{ + margin:0; + padding:0; +} + + +#btnCreateMarker, #btnUpdateMarker, #btnCancel, #btnAddMarker,#btnDeleteAll, +#btnCreateStyle, #btnUpdateStyle, #btnCancelStyle, #btnAddStyle,#btnDeleteAllStyle{ + background: url(../images/button.png) center center no-repeat; + background-size:100% 100%; + width: 100px; + height: 30px; + line-height: 30px; + text-align: center; + border: none; + color: #ffffff; + margin-top: 0px !important; + float: left; + cursor:pointer; + font-size:13px; +} + +.btg-head, .btg-style-head{ + background: #f5f5f5; + border: 1px solid #e5e5e5; + font-size: 12px; + color: #969696; + text-align: center; + text-transform: uppercase; + height: 30px; + line-height: 28px; + font-weight: bold; + +} +.btpreview_edit, .btpreview_remove{ + width: 25px; height: 25px; + float: right; + margin-left: 3px; +} +.btpreview_edit{ + background: url(../images/btpreview_edit.png) no-repeat; +} +.btpreview_edit:hover{ + background: url(../images/btpreview_edit_hovered.png) no-repeat; +} +.btpreview_remove{ + background: url(../images/btpreview_remove.png) no-repeat; +} +.btpreview_remove:hover{ + background: url(../images/btpreview_remove_hovered.png) no-repeat; +} +#btg-warning li{ + color: #fc0000; + line-height: 20px; + font-size: 12px; + font-weight: bold; +} +.marker-icon{ + min-height: 35px; + line-height: 35px; +} +.marker-infowindow{ + min-height: 20px; +} + + +/* end Chinhpv style*/ +.marker-display .title,.option-display .title{padding:0!important;cursor:text;} +.marker-title-label, .option-title-label, .style-title-label { + font-weight: normal; + line-height: 20px; + +} +.marker-display, .option-display, .style-display{ + background: url("../images/bg-li-infor-bttab.png") repeat-x left bottom #fff; + border: 1px solid #e4e4e4 !important; + margin: 10px 0 !important; + position:relative; +} + +.marker-title-label span.label,.option-title-label span.label ,.style-title-label span.label,.option-title-label span.label { + color: #C36305; + font-size: 12px; + font-weight: bold; + float: left; + margin-right: 5px; + text-shadow:none; +} + +.marker-title-label span.value,.option-title-label span.value,.style-title-label span.value,.option-title-label span.value { + color: #000; + font-size: 11px; +} +.marker-title-label span.value +{ +color: #C36305; +font-size: 13px; +font-weight: bold; + +} + +#bt-addMarker, #bt-delallMarker,#bt-addOption, #bt-delall { + font-size: 12px; + font-weight: bold; + text-transform: uppercase; +} +.bt-button,.bt-button:hover{ + background: url("../images/button.png") no-repeat scroll 0 0 transparent; + border: medium none; + color: #FFFFFF; + height: 35px; + line-height: 33px; + margin-top: 0 !important; + text-align: center; + width: 110px; +} + +.option-display .edit-remove-link { + position: absolute; + right: 10px; + top:20px; +} + .style-display .edit-remove-link{ + position: absolute; + right: 10px; + top:15px; +} +.marker-display .edit-remove-link{ + position: absolute; + right: 10px; + top:5px; +} +.marker-display .edit-remove-link a{ + float: left; + margin-right: 5px; +} +.edit-remove-link a { + display: block; + height: 25px; + text-indent: -9999px; + width: 26px; + float:left; + margin-right: 5px; +} +.edit-remove-link a.edit { + background: url("../images/bg-li-tab-a-edit.png") no-repeat scroll left -32px transparent; + margin-bottom: 10px; +} + +.edit-remove-link a.edit:hover { + background: url("../images/bg-li-tab-a-edit.png") no-repeat scroll left top transparent; +} +.edit-remove-link a.remove { + background: url("../images/bg-li-tab-a-delete.png") no-repeat scroll left -32px transparent; +} + +.edit-remove-link a.remove:hover { + background: url("../images/bg-li-tab-a-delete.png") no-repeat scroll left top transparent; +} +.bt-button:hover{ + + border: none; + +} +.marker-display .image img{ + float:none; + margin:0; + width:70px; +} +.hasEmptyImg{ + display:none; +} + +.btg-infowindow{ + min-height: 80px!important; +} +#btg-infowindow{ + width: 270px; + height: 80px; + margin-right: 10px; +} +/* style for Custom Styles */ +.style-stylers-label{ + color: #C36305; + font-size: 12px; + font-weight: bold; + display:none; +} + +.style-stylers{ + background: none repeat scroll 0 0 #FFFFFF; + color: #FFFFFF; + height: 80px; + margin-right: 40px; + padding: 10px; + border: 1px solid #FFFFFF; + border-radius: 10px; + display: none; +} +.style-stylers span.label{ + font-size: 11px; +} +.style-stylers span.value{ + font-size: 10px; + +} +.style-styler > span{ + width: 300px; +} +.style-stylers-element{ + float:left; + width: 150px; +} +/*end style for Custom Styles*/ + +/* =================for Joomla 3.0 =================*/ + + /*for marker*/ +#options-markers-manager > div > div.controls{ + margin-left: 0!important; + display: inline-block; + min-width: 380px; +} +#options-markers-manager > div > div.controls ul > li{ + list-style: none; + margin-bottom: 10px; +} +#options-markers-manager > div > div.controls #btg-main-button { + text-align: center; +} +#options-markers-manager > div > div.controls #btg-main-button button{ + float:none; +} +#options-markers-manager > div > div.controls #btg-markers-container{ + margin: 0; +} +#options-markers-manager > div > div.controls #btg-markers-container li{ + min-height: 20px; + padding:10px; +} +.btg-icon-marker .fltlft , .btg-shadow-marker .fltlft{ + float: left; +} + +#btg-icon_preview_empty{ + display:none!important; +} +/*end for marker*/ + +/* for style*/ +.controls #btg-style li{ + list-style: none; +} +.controls #btg-style li{ + margin-bottom: 10px; +} +.controls #btg-style-main-button{ + text-align: center; +} +.controls #btg-style-main-button button{ + float:none; +} +.controls #btg-styles-container{ + margin: 0; +} +.controls #btg-styles-container li{ + padding: 10px; +} +.controls #btg-styles-container li .label{ + background: none; + float: none; +} + + +/* end for style*/ +/*=======================End for Joomla 3.0=============================*/ + +/* fix amm component */ +.assignment-options li{ + height:auto!important;border:none!important;min-height:auto!important;line-height:120%!important; +} +#permissions-sliders h3{ + height:auto; + line-height:100%; + padding:2px; + background:none!important; +} +#style-form,#marker-form{ + padding-top:0; + padding-bottom:0; + width:auto; +} \ No newline at end of file diff --git a/deployed/mod_bt_googlemaps/modules/mod_bt_googlemaps/admin/css/chosen.css b/deployed/mod_bt_googlemaps/modules/mod_bt_googlemaps/admin/css/chosen.css new file mode 100644 index 00000000..12db9db6 --- /dev/null +++ b/deployed/mod_bt_googlemaps/modules/mod_bt_googlemaps/admin/css/chosen.css @@ -0,0 +1,339 @@ +/* @group Base */ +select.chzn-select { + visibility: hidden; + height: 28px !important; + min-height: 28px !important; +} +.chzn-container { + font-size: 11px; + position: relative; + display: inline-block; + zoom: 1; + *display: inline; +} +.chzn-container .chzn-drop { + background: #fff; + border: 1px solid #aaa; + border-top: 0; + position: absolute; + top: 29px; + left: 0; + -webkit-box-shadow: 0 4px 5px rgba(0,0,0,.15); + -moz-box-shadow : 0 4px 5px rgba(0,0,0,.15); + -o-box-shadow : 0 4px 5px rgba(0,0,0,.15); + box-shadow : 0 4px 5px rgba(0,0,0,.15); + z-index: 999; +} +/* @end */ + +/* @group Single Chosen */ +.chzn-container-single .chzn-single { + background-color: #fff; + background-image: -webkit-gradient(linear, left bottom, left top, color-stop(0, #eeeeee), color-stop(0.5, white)); + background-image: -webkit-linear-gradient(center bottom, #eeeeee 0%, white 50%); + background-image: -moz-linear-gradient(center bottom, #eeeeee 0%, white 50%); + background-image: -o-linear-gradient(top, #eeeeee 0%,#ffffff 50%); + background-image: -ms-linear-gradient(top, #eeeeee 0%,#ffffff 50%); + filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#eeeeee', endColorstr='#ffffff',GradientType=0 ); + background-image: linear-gradient(top, #eeeeee 0%,#ffffff 50%); + -webkit-border-radius: 4px; + -moz-border-radius : 4px; + border-radius : 4px; + -moz-background-clip : padding; + -webkit-background-clip: padding-box; + background-clip : padding-box; + border: 1px solid #aaa; + display: block; + overflow: hidden; + white-space: nowrap; + position: relative; + height: 26px; + line-height: 26px; + padding: 0 0 0 8px; + color: #444; + text-decoration: none; +} +.chzn-container-single .chzn-single span { + margin-right: 26px; + display: block; + overflow: hidden; + white-space: nowrap; + -o-text-overflow: ellipsis; + -ms-text-overflow: ellipsis; + text-overflow: ellipsis; +} +.chzn-container-single .chzn-single div { + -webkit-border-radius: 0 4px 4px 0; + -moz-border-radius : 0 4px 4px 0; + border-radius : 0 4px 4px 0; + -moz-background-clip : padding; + -webkit-background-clip: padding-box; + background-clip : padding-box; + background: #ccc; + background-image: -webkit-gradient(linear, left bottom, left top, color-stop(0, #ccc), color-stop(0.6, #eee)); + background-image: -webkit-linear-gradient(center bottom, #ccc 0%, #eee 60%); + background-image: -moz-linear-gradient(center bottom, #ccc 0%, #eee 60%); + background-image: -o-linear-gradient(bottom, #ccc 0%, #eee 60%); + background-image: -ms-linear-gradient(top, #cccccc 0%,#eeeeee 60%); + filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#cccccc', endColorstr='#eeeeee',GradientType=0 ); + background-image: linear-gradient(top, #cccccc 0%,#eeeeee 60%); + border-left: 1px solid #aaa; + position: absolute; + right: 0; + top: 0; + display: block; + height: 100%!important; + width: 18px; +} +.chzn-container-single .chzn-single div b { + background: url('../images/chosen-sprite.png') no-repeat 0 1px; + display: block; + width: 100%; + height: 100%; +} +.chzn-container-single .chzn-search { + padding: 3px 4px; + margin: 0; + white-space: nowrap; +} +.chzn-container-single .chzn-search input { + background: #fff url('../images/chosen-sprite.png') no-repeat 100% -20px; + background: url('../images/chosen-sprite.png') no-repeat 100% -20px, -webkit-gradient(linear, left bottom, left top, color-stop(0.85, white), color-stop(0.99, #eeeeee)); + background: url('../images/chosen-sprite.png') no-repeat 100% -20px, -webkit-linear-gradient(center bottom, white 85%, #eeeeee 99%); + background: url('../images/chosen-sprite.png') no-repeat 100% -20px, -moz-linear-gradient(center bottom, white 85%, #eeeeee 99%); + background: url('../images/chosen-sprite.png') no-repeat 100% -20px, -o-linear-gradient(bottom, white 85%, #eeeeee 99%); + background: url('../images/chosen-sprite.png') no-repeat 100% -20px, -ms-linear-gradient(top, #ffffff 85%,#eeeeee 99%); + background: url('../images/chosen-sprite.png') no-repeat 100% -20px, -ms-linear-gradient(top, #ffffff 85%,#eeeeee 99%); + background: url('../images/chosen-sprite.png') no-repeat 100% -20px, linear-gradient(top, #ffffff 85%,#eeeeee 99%); + margin: 1px 0; + padding: 4px 20px 4px 5px; + outline: 0; + border: 1px solid #aaa; + font-family: sans-serif; + font-size: 1em; +} +.chzn-container-single .chzn-drop { + -webkit-border-radius: 0 0 4px 4px; + -moz-border-radius : 0 0 4px 4px; + border-radius : 0 0 4px 4px; + -moz-background-clip : padding; + -webkit-background-clip: padding-box; + background-clip : padding-box; +} +/* @end */ + +/* @group Multi Chosen */ +.chzn-container-multi .chzn-choices { + background-color: #fff; + background-image: -webkit-gradient(linear, left bottom, left top, color-stop(0.85, white), color-stop(0.99, #eeeeee)); + background-image: -webkit-linear-gradient(center bottom, white 85%, #eeeeee 99%); + background-image: -moz-linear-gradient(center bottom, white 85%, #eeeeee 99%); + background-image: -o-linear-gradient(bottom, white 85%, #eeeeee 99%); + background-image: -ms-linear-gradient(top, #ffffff 85%,#eeeeee 99%); + filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#ffffff', endColorstr='#eeeeee',GradientType=0 ); + background-image: linear-gradient(top, #ffffff 85%,#eeeeee 99%); + border: 1px solid #aaa; + margin: 0; + padding: 0; + cursor: text; + overflow: hidden; + height: auto !important; + height: 1%; + position: relative; +} +.chzn-container-multi .chzn-choices li { + float: left; + list-style: none; +} +.chzn-container-multi .chzn-choices .search-field { + white-space: nowrap; + margin: 0; + padding: 0; +} +.chzn-container-multi .chzn-choices .search-field input { + color: #666; + background: transparent !important; + border: 0 !important; + padding: 5px; + margin: 1px 0; + outline: 0; + -webkit-box-shadow: none; + -moz-box-shadow : none; + -o-box-shadow : none; + box-shadow : none; +} +.chzn-container-multi .chzn-choices .search-field .default { + color: #999; +} +.chzn-container-multi .chzn-choices .search-choice { + -webkit-border-radius: 3px; + -moz-border-radius : 3px; + border-radius : 3px; + -moz-background-clip : padding; + -webkit-background-clip: padding-box; + background-clip : padding-box; + background-color: #e4e4e4; + background-image: -webkit-gradient(linear, left bottom, left top, color-stop(0, #e4e4e4), color-stop(0.7, #eeeeee)); + background-image: -webkit-linear-gradient(center bottom, #e4e4e4 0%, #eeeeee 70%); + background-image: -moz-linear-gradient(center bottom, #e4e4e4 0%, #eeeeee 70%); + background-image: -o-linear-gradient(bottom, #e4e4e4 0%, #eeeeee 70%); + background-image: -ms-linear-gradient(top, #e4e4e4 0%,#eeeeee 70%); + filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#e4e4e4', endColorstr='#eeeeee',GradientType=0 ); + background-image: linear-gradient(top, #e4e4e4 0%,#eeeeee 70%); + color: #333; + border: 1px solid #b4b4b4; + line-height: 13px; + padding: 3px 19px 3px 6px; + margin: 3px 0 3px 5px; + position: relative; +} +.chzn-container-multi .chzn-choices .search-choice span { + cursor: default; +} +.chzn-container-multi .chzn-choices .search-choice-focus { + background: #d4d4d4; +} +.chzn-container-multi .chzn-choices .search-choice .search-choice-close { + display: block; + position: absolute; + right: 5px; + top: 6px; + width: 8px; + height: 9px; + font-size: 1px; + background: url(../images/chosen-sprite.png) right top no-repeat; +} +.chzn-container-multi .chzn-choices .search-choice .search-choice-close:hover { + background-position: right -9px; +} +.chzn-container-multi .chzn-choices .search-choice-focus .search-choice-close { + background-position: right -9px; +} +/* @end */ + +/* @group Results */ +.chzn-container .chzn-results { + margin: 0 4px 4px 0; + max-height: 190px; + padding: 0 0 0 4px; + position: relative; + overflow-x: hidden; + overflow-y: auto; +} +.chzn-container-multi .chzn-results { + margin: -1px 0 0; + padding: 0; +} +.chzn-container .chzn-results li { + line-height: 80%; + padding: 7px 7px 8px; + margin: 0; + list-style: none; +} +.chzn-container .chzn-results .active-result { + cursor: pointer; +} +.chzn-container .chzn-results .highlighted { + background: #3875d7; + color: #fff; +} +.chzn-container .chzn-results li em { + background: #feffde; + font-style: normal; +} +.chzn-container .chzn-results .highlighted em { + background: transparent; +} +.chzn-container .chzn-results .no-results { + background: #f4f4f4; +} +.chzn-container .chzn-results .group-result { + cursor: default; + color: #999; + font-weight: bold; +} +.chzn-container .chzn-results .group-option { + padding-left: 20px; +} +.chzn-container-multi .chzn-drop .result-selected { + display: none; +} +/* @end */ + +/* @group Active */ +.chzn-container-active .chzn-single { + -webkit-box-shadow: 0 0 5px rgba(0,0,0,.3); + -moz-box-shadow : 0 0 5px rgba(0,0,0,.3); + -o-box-shadow : 0 0 5px rgba(0,0,0,.3); + box-shadow : 0 0 5px rgba(0,0,0,.3); + border: 1px solid #5897fb; +} +.chzn-container-active .chzn-single-with-drop { + border: 1px solid #aaa; + -webkit-box-shadow: 0 1px 0 #fff inset; + -moz-box-shadow : 0 1px 0 #fff inset; + -o-box-shadow : 0 1px 0 #fff inset; + box-shadow : 0 1px 0 #fff inset; + background-color: #eee; + background-image: -webkit-gradient(linear, left bottom, left top, color-stop(0, white), color-stop(0.5, #eeeeee)); + background-image: -webkit-linear-gradient(center bottom, white 0%, #eeeeee 50%); + background-image: -moz-linear-gradient(center bottom, white 0%, #eeeeee 50%); + background-image: -o-linear-gradient(bottom, white 0%, #eeeeee 50%); + background-image: -ms-linear-gradient(top, #ffffff 0%,#eeeeee 50%); + filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#ffffff', endColorstr='#eeeeee',GradientType=0 ); + background-image: linear-gradient(top, #ffffff 0%,#eeeeee 50%); + -webkit-border-bottom-left-radius : 0; + -webkit-border-bottom-right-radius: 0; + -moz-border-radius-bottomleft : 0; + -moz-border-radius-bottomright: 0; + border-bottom-left-radius : 0; + border-bottom-right-radius: 0; +} +.chzn-container-active .chzn-single-with-drop div { + background: transparent; + border-left: none; +} +.chzn-container-active .chzn-single-with-drop div b { + background-position: -18px 1px; +} +.chzn-container-active .chzn-choices { + -webkit-box-shadow: 0 0 5px rgba(0,0,0,.3); + -moz-box-shadow : 0 0 5px rgba(0,0,0,.3); + -o-box-shadow : 0 0 5px rgba(0,0,0,.3); + box-shadow : 0 0 5px rgba(0,0,0,.3); + border: 1px solid #5897fb; +} +.chzn-container-active .chzn-choices .search-field input { + color: #111 !important; +} +/* @end */ + +/* @group Right to Left */ +.chzn-rtl { direction:rtl;text-align: right; } +.chzn-rtl .chzn-single { padding-left: 0; padding-right: 8px; } +.chzn-rtl .chzn-single span { margin-left: 26px; margin-right: 0; } +.chzn-rtl .chzn-single div { + left: 0; right: auto; + border-left: none; border-right: 1px solid #aaaaaa; + -webkit-border-radius: 4px 0 0 4px; + -moz-border-radius : 4px 0 0 4px; + border-radius : 4px 0 0 4px; +} +.chzn-rtl .chzn-choices li { float: right; } +.chzn-rtl .chzn-choices .search-choice { padding: 3px 6px 3px 19px; margin: 3px 5px 3px 0; } +.chzn-rtl .chzn-choices .search-choice .search-choice-close { left: 5px; right: auto; background-position: right top;} +.chzn-rtl.chzn-container-single .chzn-results { margin-left: 4px; margin-right: 0; padding-left: 0; padding-right: 4px; } +.chzn-rtl .chzn-results .group-option { padding-left: 0; padding-right: 20px; } +.chzn-rtl.chzn-container-active .chzn-single-with-drop div { border-right: none; } +.chzn-rtl .chzn-search input { + background: url('../images/chosen-sprite.png') no-repeat -38px -20px, #ffffff; + background: url('../images/chosen-sprite.png') no-repeat -38px -20px, -webkit-gradient(linear, left bottom, left top, color-stop(0.85, white), color-stop(0.99, #eeeeee)); + background: url('../images/chosen-sprite.png') no-repeat -38px -20px, -webkit-linear-gradient(center bottom, white 85%, #eeeeee 99%); + background: url('../images/chosen-sprite.png') no-repeat -38px -20px, -moz-linear-gradient(center bottom, white 85%, #eeeeee 99%); + background: url('../images/chosen-sprite.png') no-repeat -38px -20px, -o-linear-gradient(bottom, white 85%, #eeeeee 99%); + background: url('../images/chosen-sprite.png') no-repeat -38px -20px, -ms-linear-gradient(top, #ffffff 85%,#eeeeee 99%); + background: url('../images/chosen-sprite.png') no-repeat -38px -20px, -ms-linear-gradient(top, #ffffff 85%,#eeeeee 99%); + background: url('../images/chosen-sprite.png') no-repeat -38px -20px, linear-gradient(top, #ffffff 85%,#eeeeee 99%); + padding: 4px 5px 4px 20px; +} +/* @end */ \ No newline at end of file diff --git a/deployed/mod_bt_googlemaps/modules/mod_bt_googlemaps/admin/css/index.html b/deployed/mod_bt_googlemaps/modules/mod_bt_googlemaps/admin/css/index.html new file mode 100644 index 00000000..fa6d84e8 --- /dev/null +++ b/deployed/mod_bt_googlemaps/modules/mod_bt_googlemaps/admin/css/index.html @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/deployed/mod_bt_googlemaps/modules/mod_bt_googlemaps/admin/formfield/asset.php b/deployed/mod_bt_googlemaps/modules/mod_bt_googlemaps/admin/formfield/asset.php new file mode 100644 index 00000000..d2b57c65 --- /dev/null +++ b/deployed/mod_bt_googlemaps/modules/mod_bt_googlemaps/admin/formfield/asset.php @@ -0,0 +1,62 @@ +getHeadData(); + foreach($header['scripts'] as $scriptName => $scriptData) + { + if(substr_count($scriptName,'/jquery')){ + $checkJqueryLoaded = true; + } + } + + //Add js + if(!$checkJqueryLoaded) + $document->addScript(JURI::root().$this->element['path'].'js/jquery.min.js'); + + $document->addScript(JURI::root().$this->element['path'].'js/colorpicker/colorpicker.js'); + $document->addScript(JURI::root().$this->element['path'].'js/btbase64.min.js'); + $document->addScript(JURI::root().$this->element['path'].'js/btstyles.js'); + $document->addScript(JURI::root().$this->element['path'].'js/btmakers.js'); + + if(version_compare(JVERSION, '3.0', 'ge')){ + $document->addScript(JURI::root().$this->element['path'].'js/bt30.js'); + }else{ + $document->addScript(JURI::root().$this->element['path'].'js/chosen.jquery.min.js'); + $document->addScript(JURI::root().$this->element['path'].'js/bt.js'); + $document->addStyleSheet(JURI::root().$this->element['path'].'css/chosen.css'); + } + + //Add css + $document->addStyleSheet(JURI::root().$this->element['path'].'css/bt.css'); + $document->addStyleSheet(JURI::root().$this->element['path'].'js/colorpicker/colorpicker.css'); + + + return null; + } +} +?> \ No newline at end of file diff --git a/deployed/mod_bt_googlemaps/modules/mod_bt_googlemaps/admin/formfield/button.php b/deployed/mod_bt_googlemaps/modules/mod_bt_googlemaps/admin/formfield/button.php new file mode 100644 index 00000000..5d0757e6 --- /dev/null +++ b/deployed/mod_bt_googlemaps/modules/mod_bt_googlemaps/admin/formfield/button.php @@ -0,0 +1,37 @@ +element['name']; + $text = $this->element['text']; + $html = ''; + + return $html; + + + } +} + +?> diff --git a/deployed/mod_bt_googlemaps/modules/mod_bt_googlemaps/admin/formfield/index.html b/deployed/mod_bt_googlemaps/modules/mod_bt_googlemaps/admin/formfield/index.html new file mode 100644 index 00000000..fa6d84e8 --- /dev/null +++ b/deployed/mod_bt_googlemaps/modules/mod_bt_googlemaps/admin/formfield/index.html @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/deployed/mod_bt_googlemaps/modules/mod_bt_googlemaps/admin/formfield/markers.php b/deployed/mod_bt_googlemaps/modules/mod_bt_googlemaps/admin/formfield/markers.php new file mode 100644 index 00000000..0995b816 --- /dev/null +++ b/deployed/mod_bt_googlemaps/modules/mod_bt_googlemaps/admin/formfield/markers.php @@ -0,0 +1,336 @@ +getHeadData(); + foreach ($header['scripts'] as $scriptName => $scriptData) { + if (substr_count($scriptName, '/jquery')) { + $checkJqueryLoaded = true; + } + } + + if(version_compare(JVERSION, '3.0', 'ge')){ + $document->addStyleDeclaration( + '.btg-icon-marker .button2-left{float: left; margin: 0 5px;} '. + '#btg-submit-btn{padding: 0px !important; margin-top: 10px;}'. + '#btg-markers-container{ margin-left: 0px !important; } '. + '#btg-markers-container li {padding: 7px 7px 8px !important; list-style: none;} ' + ); + } + + $moduleID = $this->form->getValue('id'); + if ($moduleID == '') + $moduleID = 0; + // for maker field + $html = + '
' + . ' ' + . ''; + + /** + * for media field + * + */ + # create script + $assetField = $this->element['asset_field'] ? (string) $this->element['asset_field'] : 'asset_id'; + $authorField = $this->element['created_by_field'] ? (string) $this->element['created_by_field'] : 'created_by'; + $asset = $this->form->getValue($assetField) ? $this->form->getValue($assetField) : (string) $this->element['asset_id']; + if ($asset == '') + { + $asset = JRequest::getCmd('option'); + } + + if (!self::$initialisedMedia) + { + + // Load the modal behavior script. + JHtml::_('behavior.modal'); + + // Build the script. + $script = array(); + $script[] = ' function jInsertFieldValue(value, id) {'; + $script[] = ' var old_value = document.id(id).value;'; + $script[] = ' if (old_value != value) {'; + $script[] = ' var elem = document.id(id);'; + $script[] = ' elem.value = value;'; + $script[] = ' elem.fireEvent("change");'; + $script[] = ' if (typeof(elem.onchange) === "function") {'; + $script[] = ' elem.onchange();'; + $script[] = ' }'; + $script[] = ' jMediaRefreshPreview(id);'; + $script[] = ' }'; + $script[] = ' }'; + + $script[] = ' function jMediaRefreshPreview(id) {'; + $script[] = ' var value = document.id(id).value;'; + $script[] = ' var img = document.id(id + "_preview");'; + $script[] = ' if (img) {'; + $script[] = ' if (value) {'; + $script[] = ' img.src = "' . JURI::root() . '" + value;'; + $script[] = ' document.id(id + "_preview_empty").setStyle("display", "none");'; + $script[] = ' document.id(id + "_preview_img").setStyle("display", "");'; + $script[] = ' } else { '; + $script[] = ' img.src = ""'; + $script[] = ' document.id(id + "_preview_empty").setStyle("display", "");'; + $script[] = ' document.id(id + "_preview_img").setStyle("display", "none");'; + $script[] = ' } '; + $script[] = ' } '; + $script[] = ' }'; + + $script[] = ' function jMediaRefreshPreviewTip(tip)'; + $script[] = ' {'; + $script[] = ' tip.setStyle("display", "block");'; + $script[] = ' var img = tip.getElement("img.media-preview");'; + $script[] = ' var id = img.getProperty("id");'; + $script[] = ' id = id.substring(0, id.length - "_preview".length);'; + $script[] = ' jMediaRefreshPreview(id);'; + $script[] = ' }'; + + // Add the script to the document head. + JFactory::getDocument()->addScriptDeclaration(implode("\n", $script)); + + self::$initialisedMedia = true; + } + $htmlMediaCode = array('icon'=>''); + foreach ($htmlMediaCode as $key => $value){ + #create media html code + // Initialize variables. + $htmlMedia = array(); + $attr = ''; + + // Initialize some field attributes. + $attr .= 'class="media-marker"'; + //$attr .= $this->element['size'] ? ' size="' . (int) $this->element['size'] . '"' : ''; + + // Initialize JavaScript field attributes. + $attr .= $this->element['onchange'] ? ' onchange="' . (string) $this->element['onchange'] . '"' : ''; + + // The text field. + $htmlMedia[]= ''; + $htmlMedia[] = '
'; + $htmlMedia[] = ' '; + $htmlMedia[] = '
'; + + // The button. + $htmlMedia[] = '
'; + $htmlMedia[] = '
'; + $htmlMedia[] = ' '; + $htmlMedia[] = JText::_('JLIB_FORM_BUTTON_SELECT') . ''; + $htmlMedia[] = '
'; + $htmlMedia[] = '
'; + + $htmlMedia[] = '
'; + $htmlMedia[] = '
'; + $htmlMedia[] = ' '; + $htmlMedia[] = JText::_('JLIB_FORM_BUTTON_CLEAR') . ''; + $htmlMedia[] = '
'; + $htmlMedia[] = '
'; + + $preview = ''; + $showPreview = true; + $showAsTooltip = false; + switch ($preview) + { + case 'false': + case 'none': + $showPreview = false; + break; + case 'true': + case 'show': + break; + case 'tooltip': + default: + $showAsTooltip = true; + $options = array( + 'onShow' => 'jMediaRefreshPreviewTip', + ); + JHtml::_('behavior.tooltip', '.hasTipPreview', $options); + break; + } + + if ($showPreview) + { + $src = ''; + $attr = array( + 'id' => 'btg-'.$key . '_preview', + 'class' => 'media-preview', + 'style' => 'max-width:200px; max-height:30px;' + ); + $img = JHtml::image($src, JText::_('JLIB_FORM_MEDIA_PREVIEW_ALT'), $attr); + $previewImg = ''; + $previewImgEmpty = ''; + + $htmlMedia[] = '
'; + + $htmlMedia[] = ' ' . $previewImgEmpty; + $htmlMedia[] = ' ' . $previewImg; + + $htmlMedia[] = '
'; + } + + $htmlMediaCode[$key] = implode("'\n+'", $htmlMedia); + } + #end setup to create media field + ?> + + ' + . ' ' + . ''; + $moduleID = $this->form->getValue('id'); + if ($moduleID == '') + $moduleID = 0; + + ?> + + + \ No newline at end of file diff --git a/deployed/mod_bt_googlemaps/modules/mod_bt_googlemaps/admin/images/logo.png b/deployed/mod_bt_googlemaps/modules/mod_bt_googlemaps/admin/images/logo.png new file mode 100644 index 00000000..337f05d3 Binary files /dev/null and b/deployed/mod_bt_googlemaps/modules/mod_bt_googlemaps/admin/images/logo.png differ diff --git a/deployed/mod_bt_googlemaps/modules/mod_bt_googlemaps/admin/images/mod_bt_googlemaps.png b/deployed/mod_bt_googlemaps/modules/mod_bt_googlemaps/admin/images/mod_bt_googlemaps.png new file mode 100644 index 00000000..bea64f42 Binary files /dev/null and b/deployed/mod_bt_googlemaps/modules/mod_bt_googlemaps/admin/images/mod_bt_googlemaps.png differ diff --git a/deployed/mod_bt_googlemaps/modules/mod_bt_googlemaps/admin/images/switcher-onoff.png b/deployed/mod_bt_googlemaps/modules/mod_bt_googlemaps/admin/images/switcher-onoff.png new file mode 100644 index 00000000..229c14bd Binary files /dev/null and b/deployed/mod_bt_googlemaps/modules/mod_bt_googlemaps/admin/images/switcher-onoff.png differ diff --git a/deployed/mod_bt_googlemaps/modules/mod_bt_googlemaps/admin/images/switcher-yesno.png b/deployed/mod_bt_googlemaps/modules/mod_bt_googlemaps/admin/images/switcher-yesno.png new file mode 100644 index 00000000..948e5a6b Binary files /dev/null and b/deployed/mod_bt_googlemaps/modules/mod_bt_googlemaps/admin/images/switcher-yesno.png differ diff --git a/deployed/mod_bt_googlemaps/modules/mod_bt_googlemaps/admin/images/tick.png b/deployed/mod_bt_googlemaps/modules/mod_bt_googlemaps/admin/images/tick.png new file mode 100644 index 00000000..fa9d3b60 Binary files /dev/null and b/deployed/mod_bt_googlemaps/modules/mod_bt_googlemaps/admin/images/tick.png differ diff --git a/deployed/mod_bt_googlemaps/modules/mod_bt_googlemaps/admin/index.html b/deployed/mod_bt_googlemaps/modules/mod_bt_googlemaps/admin/index.html new file mode 100644 index 00000000..fa6d84e8 --- /dev/null +++ b/deployed/mod_bt_googlemaps/modules/mod_bt_googlemaps/admin/index.html @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/deployed/mod_bt_googlemaps/modules/mod_bt_googlemaps/admin/js/bt.js b/deployed/mod_bt_googlemaps/modules/mod_bt_googlemaps/admin/js/bt.js new file mode 100644 index 00000000..04ab88d6 --- /dev/null +++ b/deployed/mod_bt_googlemaps/modules/mod_bt_googlemaps/admin/js/bt.js @@ -0,0 +1,176 @@ +jQuery.noConflict(); + +//var optionObject = []; +//var idEdit = -1; + +window.addEvent("domready",function(){ + $$("#jform_params_asset-lbl").getParent().destroy(); + + jQuery('#module-sliders li > .btn-group').each(function(){ + if(jQuery(this).find('input').length != 2 ) return; + if(this.id.indexOf('advancedparams') ==0) return; + el = jQuery(this).find('input:checked').val(); + if( el != '0' && el != '1' && el != 'false' && el != 'true' && el != 'no' && el != 'yes' ){ + return; + } + jQuery(this).hide(); + var group = this; + + + var el = jQuery(group).find('input:checked'); + var switchClass =''; + + if(el.val()=='' || el.val()=='0' || el.val()=='no' || el.val()=='false'){ + switchClass = 'no'; + }else{ + switchClass = 'yes'; + } + var switcher = new Element('div',{'class' : 'switcher-'+switchClass}); + switcher.inject(group, 'after'); + switcher.addEvent("click", function(){ + var el = jQuery(group).find('input:checked'); + if(el.val()=='' || el.val()=='0' || el.val()=='no' || el.val()=='false'){ + switcher.setProperty('class','switcher-yes'); + }else { + switcher.setProperty('class','switcher-no'); + } + jQuery(group).find('input:not(:checked)').attr('checked',true).trigger('click'); + }); + }) + jQuery('#jform_params_boxcss').parent().css("overflow","hidden"); + + jQuery('.bt_color').ColorPicker({ + color: '#0000ff', + onShow: function (colpkr) { + jQuery(colpkr).fadeIn(500); + return false; + }, + onHide: function (colpkr) { + jQuery(colpkr).fadeOut(500); + return false; + }, + onSubmit: function(hsb, hex, rgb, el) { + jQuery(el).val("#"+hex); + //jQuery(el).css('background',jQuery(el).val()) + jQuery(el).ColorPickerHide(); + }, + onBeforeShow: function () { + jQuery(this).ColorPickerSetColor(this.value); + } + }) + .bind('keyup', function(){ + jQuery(this).ColorPickerSetColor(this.value); + }); + jQuery(".pane-sliders select").each(function(){ + if(this.id.indexOf('advancedparams') ==0) return; + if(jQuery(this).is(":visible")) { + jQuery(this).css("width",parseInt(jQuery(this).outerWidth(true))+50); + jQuery(this).chosen() + }; + }) + jQuery(".chzn-container").click(function(){ + jQuery(".panel .pane-slider,.panel .panelform").css("overflow","visible"); + }) + jQuery(".panel .title").click(function(){ + jQuery(".panel .pane-slider,.panel .panelform").css("overflow","hidden"); + }) + + // show/hide weather option + if(jQuery('input[name="jform[params][weather]"]:checked').val() == 1){ + jQuery('#jform_params_temperatureUnit').parent().show(); + jQuery('#jform_params_replace_marker_icon').parent().show(); + jQuery('#jform_params_display_weather_info').parent().show(); + jQuery('#jform_params_owm_api').parent().show(); + }else{ + jQuery('#jform_params_temperatureUnit').parent().hide(); + jQuery('#jform_params_replace_marker_icon').parent().hide(); + jQuery('#jform_params_display_weather_info').parent().hide(); + jQuery('#jform_params_owm_api').parent().hide(); + } + jQuery("input[name='jform[params][weather]']").click(function(){ + if(jQuery('input[name="jform[params][weather]"]:checked').val() == 1){ + jQuery('#jform_params_temperatureUnit').parent().show(); + jQuery('#jform_params_replace_marker_icon').parent().show(); + jQuery('#jform_params_display_weather_info').parent().show(); + jQuery('#jform_params_owm_api').parent().show(); + }else{ + jQuery('#jform_params_temperatureUnit').parent().hide(); + jQuery('#jform_params_replace_marker_icon').parent().hide(); + jQuery('#jform_params_display_weather_info').parent().hide(); + jQuery('#jform_params_owm_api').parent().hide(); + } + }); + + jQuery("input[name='jform[params][enable_map_api]']").click(function(){ + if(jQuery('input[name="jform[params][enable_map_api]"]:checked').val() == 1){ + jQuery('#jform_params_map_api').parent().show(); + }else{ + jQuery('#jform_params_map_api').parent().hide(); + } + }); + if(jQuery('input[name="jform[params][enable_map_api]"]:checked').val() == 1){ + jQuery('#jform_params_map_api').parent().show(); + }else{ + jQuery('#jform_params_map_api').parent().hide(); + } + + // show/hide input of map address. + if(jQuery('input[name="jform[params][mapCenterType]"]:checked').val() == "address"){ + jQuery('#jform_params_mapCenterAddress').parent().show(); + jQuery('#jform_params_mapCenterCoordinate').parent().hide(); + }else{ + jQuery('#jform_params_mapCenterCoordinate').parent().show(); + jQuery('#jform_params_mapCenterAddress').parent().hide(); + } + jQuery("input[name='jform[params][mapCenterType]']").click(function(){ + if(jQuery('input[name="jform[params][mapCenterType]"]:checked').val() == "address"){ + jQuery('#jform_params_mapCenterAddress').parent().show(); + jQuery('#jform_params_mapCenterCoordinate').parent().hide(); + }else{ + jQuery('#jform_params_mapCenterCoordinate').parent().show(); + jQuery('#jform_params_mapCenterAddress').parent().hide(); + } + }); + + // show/hide option of style map + if(jQuery('input[name="jform[params][enable-style]"]:checked').val() == 0){ + jQuery("#jform_params_style_title").parent().hide(); + jQuery("#jform_params_createNewOrApplyDefaultStyle").parent().hide(); + jQuery("#btg-style-message").parent().hide(); + }else{ + jQuery("#jform_params_style_title").parent().show(); + jQuery("#jform_params_createNewOrApplyDefaultStyle").parent().show(); + jQuery("#btg-style-message").parent().show(); + } + jQuery("input[name='jform[params][enable-style]']").click(function(){ + if(jQuery('input[name="jform[params][enable-style]"]:checked').val() == 0){ + jQuery("#jform_params_style_title").parent().hide(); + jQuery("#jform_params_createNewOrApplyDefaultStyle").parent().hide(); + jQuery("#btg-style-message").parent().hide(); + }else{ + jQuery("#jform_params_style_title").parent().show(); + jQuery("#jform_params_createNewOrApplyDefaultStyle").parent().show(); + jQuery("#btg-style-message").parent().show(); + } + }); + + + // show/hide option of custom infowindow + if(jQuery('input[name="jform[params][enable-custom-infobox]"]:checked').val() == 1){ + jQuery('.option-custom-infobox').parent().show(); + jQuery('#jform_params_closeBoxURL').parent().parent().show(); + }else{ + jQuery('.option-custom-infobox').parent().hide(); + jQuery('#jform_params_closeBoxURL').parent().parent().hide(); + } + jQuery("input[name='jform[params][enable-custom-infobox]']").click(function(){ + if(jQuery('input[name="jform[params][enable-custom-infobox]"]:checked').val() == 1){ + jQuery('.option-custom-infobox').parent().show(); + jQuery('#jform_params_closeBoxURL').parent().parent().show(); + }else{ + jQuery('.option-custom-infobox').parent().hide(); + jQuery('#jform_params_closeBoxURL').parent().parent().hide(); + } + }); +}) + diff --git a/deployed/mod_bt_googlemaps/modules/mod_bt_googlemaps/admin/js/bt30.js b/deployed/mod_bt_googlemaps/modules/mod_bt_googlemaps/admin/js/bt30.js new file mode 100644 index 00000000..f0b085e1 --- /dev/null +++ b/deployed/mod_bt_googlemaps/modules/mod_bt_googlemaps/admin/js/bt30.js @@ -0,0 +1,178 @@ +jQuery.noConflict(); + +//var optionObject = []; +//var idEdit = -1; + +window.addEvent("domready",function(){ + $$("#jform_params_asset-lbl").getParent().destroy(); + + $$('.bt_switch').each(function(el) + { + + var options = el.getElements('option'); + if(options.length==2){ + + el.setStyle('display','none'); + var value = new Array(); + value[0] = options[0].value; + value[1] = options[1].value; + + var text = new Array(); + text[0] = options[0].text.replace(" ","-").toLowerCase().trim(); + text[1] = options[1].text.replace(" ","-").toLowerCase().trim(); + + var switchClass = (el.value == value[0]) ? text[0] : text[1]; + + var switcher = new Element('div',{'class' : 'switcher-'+switchClass}); + + switcher.inject(el, 'after'); + switcher.addEvent("click", function(){ + if(el.value == value[1]){ + switcher.setProperty('class','switcher-'+text[0]); + el.value = value[0]; + } else { + switcher.setProperty('class','switcher-'+text[1]); + el.value = value[1]; + } + jQuery(el).trigger('change'); + }); + } + }); + jQuery('.adminformlist textarea').parent().css("overflow","hidden"); + + jQuery('.bt_color').ColorPicker({ + color: '#0000ff', + onShow: function (colpkr) { + jQuery(colpkr).fadeIn(500); + return false; + }, + onHide: function (colpkr) { + jQuery(colpkr).fadeOut(500); + return false; + }, + onSubmit: function(hsb, hex, rgb, el) { + jQuery(el).val("#"+hex); + //jQuery(el).css('background',jQuery(el).val()) + jQuery(el).ColorPickerHide(); + }, + onBeforeShow: function () { + jQuery(this).ColorPickerSetColor(this.value); + } + }) + .bind('keyup', function(){ + jQuery(this).ColorPickerSetColor(this.value); + }); + jQuery(".pane-sliders select").each(function(){ + + if(jQuery(this).is(":visible")) { + jQuery(this).css("width",parseInt(jQuery(this).width())+20); + jQuery(this).chosen() + }; + }) + jQuery(".chzn-container").click(function(){ + jQuery(".panel .pane-slider,.panel .panelform").css("overflow","visible"); + }) + + // show/hide weather option + // show/hide weather option + if(jQuery('input[name="jform[params][weather]"]:checked').val() == 1){ + jQuery('#jform_params_temperatureUnit').parent().parent().show(); + jQuery('#jform_params_replace_marker_icon').parent().parent().show(); + jQuery('#jform_params_display_weather_info').parent().parent().show(); + jQuery('#jform_params_owm_api').parent().parent().show(); + }else{ + jQuery('#jform_params_temperatureUnit').parent().parent().hide(); + jQuery('#jform_params_replace_marker_icon').parent().parent().hide(); + jQuery('#jform_params_display_weather_info').parent().parent().hide(); + jQuery('#jform_params_owm_api').parent().parent().hide(); + } + jQuery("input[name='jform[params][weather]']").click(function(){ + if(jQuery('input[name="jform[params][weather]"]:checked').val() == 1){ + jQuery('#jform_params_temperatureUnit').parent().parent().show(); + jQuery('#jform_params_replace_marker_icon').parent().parent().show(); + jQuery('#jform_params_display_weather_info').parent().parent().show(); + jQuery('#jform_params_owm_api').parent().parent().show(); + }else{ + jQuery('#jform_params_temperatureUnit').parent().parent().hide(); + jQuery('#jform_params_replace_marker_icon').parent().parent().hide(); + jQuery('#jform_params_display_weather_info').parent().parent().hide(); + jQuery('#jform_params_owm_api').parent().parent().hide(); + } + }); + + // show/hide input of map address. + if(jQuery('input[name="jform[params][mapCenterType]"]:checked').val() == "address"){ + jQuery('#jform_params_mapCenterAddress').parent().parent().show(); + jQuery('#jform_params_mapCenterCoordinate').parent().parent().hide(); + }else{ + jQuery('#jform_params_mapCenterCoordinate').parent().parent().show(); + jQuery('#jform_params_mapCenterAddress').parent().parent().hide(); + } + jQuery("input[name='jform[params][mapCenterType]']").click(function(){ + if(jQuery('input[name="jform[params][mapCenterType]"]:checked').val() == "address"){ + jQuery('#jform_params_mapCenterAddress').parent().parent().show(); + jQuery('#jform_params_mapCenterCoordinate').parent().parent().hide(); + }else{ + jQuery('#jform_params_mapCenterCoordinate').parent().parent().show(); + jQuery('#jform_params_mapCenterAddress').parent().parent().hide(); + } + }); + + // show/hide option of style map + if(jQuery('input[name="jform[params][enable-style]"]:checked').val() == 0){ + jQuery("#jform_params_style_title").parent().parent().hide(); + jQuery("#jform_params_createNewOrApplyDefaultStyle").parent().parent().hide(); + jQuery("#btg-style-message").parent().parent().hide(); + }else{ + jQuery("#jform_params_style_title").parent().parent().show(); + jQuery("#jform_params_createNewOrApplyDefaultStyle").parent().parent().show(); + jQuery("#btg-style-message").parent().parent().show(); + } + jQuery("input[name='jform[params][enable-style]']").click(function(){ + if(jQuery('input[name="jform[params][enable-style]"]:checked').val() == 0){ + jQuery("#jform_params_style_title").parent().parent().hide(); + jQuery("#jform_params_createNewOrApplyDefaultStyle").parent().parent().hide(); + jQuery("#btg-style-message").parent().parent().hide(); + }else{ + jQuery("#jform_params_style_title").parent().parent().show(); + jQuery("#jform_params_createNewOrApplyDefaultStyle").parent().parent().show(); + jQuery("#btg-style-message").parent().parent().show(); + } + }); + + jQuery("input[name='jform[params][enable_map_api]']").click(function(){ + if(jQuery('input[name="jform[params][enable_map_api]"]:checked').val() == 1){ + jQuery('#jform_params_map_api').parent().parent().show(); + }else{ + jQuery('#jform_params_map_api').parent().parent().hide(); + } + }); + if(jQuery('input[name="jform[params][enable_map_api]"]:checked').val() == 1){ + jQuery('#jform_params_map_api').parent().parent().show(); + }else{ + jQuery('#jform_params_map_api').parent().parent().hide(); + } + + // show/hide option of custom infowindow + if(jQuery('input[name="jform[params][enable-custom-infobox]"]:checked').val() == 1){ + jQuery('.option-custom-infobox').parent().parent().show(); + jQuery('#jform_params_closeBoxURL').parent().parent().parent().show(); + }else{ + jQuery('.option-custom-infobox').parent().parent().hide(); + jQuery('#jform_params_closeBoxURL').parent().parent().parent().hide(); + } + jQuery("input[name='jform[params][enable-custom-infobox]']").click(function(){ + if(jQuery('input[name="jform[params][enable-custom-infobox]"]:checked').val() == 1){ + jQuery('.option-custom-infobox').parent().parent().show(); + jQuery('#jform_params_closeBoxURL').parent().parent().parent().show(); + }else{ + jQuery('.option-custom-infobox').parent().parent().hide(); + jQuery('#jform_params_closeBoxURL').parent().parent().parent().hide(); + } + }); + jQuery('#btg-main-button > label').remove(); + jQuery('#btg-style-main-button > label').remove(); + jQuery('#btg-style-message').parent().css('margin',"0").css('display','inline-block').css('min-width','400px'); + jQuery('#btg-message').parent().css('margin',"0").css('display','inline-block').css('min-width','400px'); +}) + diff --git a/deployed/mod_bt_googlemaps/modules/mod_bt_googlemaps/admin/js/btbase64.min.js b/deployed/mod_bt_googlemaps/modules/mod_bt_googlemaps/admin/js/btbase64.min.js new file mode 100644 index 00000000..1dc25e00 --- /dev/null +++ b/deployed/mod_bt_googlemaps/modules/mod_bt_googlemaps/admin/js/btbase64.min.js @@ -0,0 +1,106 @@ +var BT = BT || {}; +(function() { + BT.Base64 = + { + + keyString : "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=", + UTF8Encode : function(b) { + b = b.replace(/\x0d\x0a/g, "\x0a"); + var a = ""; + for ( var e = 0; e < b.length; e++) { + var d = b.charCodeAt(e); + if (d < 128) { + a += String.fromCharCode(d) + } else { + if ((d > 127) && (d < 2048)) { + a += String.fromCharCode((d >> 6) | 192); + a += String.fromCharCode((d & 63) | 128) + } else { + a += String.fromCharCode((d >> 12) | 224); + a += String.fromCharCode(((d >> 6) & 63) | 128); + a += String.fromCharCode((d & 63) | 128) + } + } + } + return a + }, + UTF8Decode : function(a) { + var b = ""; + var d = 0; + var e = c1 = c2 = 0; + while (d < a.length) { + e = a.charCodeAt(d); + if (e < 128) { + b += String.fromCharCode(e); + d++ + } else { + if ((e > 191) && (e < 224)) { + c2 = a.charCodeAt(d + 1); + b += String.fromCharCode(((e & 31) << 6) + | (c2 & 63)); + d += 2 + } else { + c2 = a.charCodeAt(d + 1); + c3 = a.charCodeAt(d + 2); + b += String.fromCharCode(((e & 15) << 12) + | ((c2 & 63) << 6) | (c3 & 63)); + d += 3 + } + } + } + return b + }, + base64Encode : function(c) { + var a = ""; + var k, h, f, j, g, e, d; + var b = 0; + c = this.UTF8Encode(c); + while (b < c.length) { + k = c.charCodeAt(b++); + h = c.charCodeAt(b++); + f = c.charCodeAt(b++); + j = k >> 2; + g = ((k & 3) << 4) | (h >> 4); + e = ((h & 15) << 2) | (f >> 6); + d = f & 63; + if (isNaN(h)) { + e = d = 64 + } else { + if (isNaN(f)) { + d = 64 + } + } + a = a + this.keyString.charAt(j) + + this.keyString.charAt(g) + + this.keyString.charAt(e) + + this.keyString.charAt(d) + } + return a + }, + base64Decode : function(c) { + var a = ""; + var k, h, f; + var j, g, e, d; + var b = 0; + c = c.replace(/[^A-Za-z0-9\+\/\=]/g, ""); + while (b < c.length) { + j = this.keyString.indexOf(c.charAt(b++)); + g = this.keyString.indexOf(c.charAt(b++)); + e = this.keyString.indexOf(c.charAt(b++)); + d = this.keyString.indexOf(c.charAt(b++)); + k = (j << 2) | (g >> 4); + h = ((g & 15) << 4) | (e >> 2); + f = ((e & 3) << 6) | d; + a = a + String.fromCharCode(k); + if (e != 64) { + a = a + String.fromCharCode(h) + } + if (d != 64) { + a = a + String.fromCharCode(f) + } + } + a = this.UTF8Decode(a); + return a + } + } +})(); \ No newline at end of file diff --git a/deployed/mod_bt_googlemaps/modules/mod_bt_googlemaps/admin/js/btmakers.js b/deployed/mod_bt_googlemaps/modules/mod_bt_googlemaps/admin/js/btmakers.js new file mode 100644 index 00000000..9fd93983 --- /dev/null +++ b/deployed/mod_bt_googlemaps/modules/mod_bt_googlemaps/admin/js/btmakers.js @@ -0,0 +1,375 @@ +jQ = jQuery.noConflict(); +var BT=BT||{}; +(function(){ + BT.MarkerList = new Class({ + Implements:[Options,Events], + options:{}, + initialize:function(options){ + + this.setOptions(options); + var markers =JSON.decode(BT.Base64.base64Decode(this.options.encodedItems)); + var self=this; + this.sortables=new Sortables(this.options.container,{ + clone:true, + revert:true, + opacity:0.3, + onStart:function(element, clone){ + clone.setStyle("z-index",999) + } + }); + if(markers!=null){ + markers.each(function(marker){ + self.add(marker) + }) + } + var submit =null; + if(typeof document.adminForm.onsubmit=="function"){ + submit = document.adminForm.onsubmit + } + document.adminForm.onsubmit=function(){ + var markers=[]; + var i=0; + $$("#btg-markers-container li").each(function(li){ + var marker=li.retrieve("data"); + if(marker!=null){ + markers[i]=marker; + i++ + } + }); + $("btg-hidden").set("value",BT.Base64.base64Encode(JSON.encode(markers))); + if(submit!=null){ + submit() + } + } + }, + /** + * This method will show form to create marker or update marker + * + * */ + + openDialog: function(edit, li, marker){ + var self = this; + var dialog = new Element('
', { + id: "btg-dialog", + html: this.options.dialogTemplate + }) + if(jQ("#btg-dialog").length >0){ + jQ('#btg-dialog').remove(); + } + jQ("#marker-form").append(dialog); + // this code will setup show/ hide form, bind event when create/update marker + jQ('#btg-marker-type').chosen(); + jQ('.btg-optional').hide(); + jQ("#btg-marker-type").change(function(){ + jQ('.btg-optional').hide(); + jQ('.btg-optional.' + jQ(this).val().toLowerCase().replace(' ', '_')).show(); + + }); + + //bind event for cancel + jQ(self.options.btnCancelID).bind('click', function(){ + jQ('#btg-dialog').remove(); + jQ("#btnAddMarker").removeAttr("disabled"); + jQ("#btnAddmarker").removeClass("disable-btn"); + return false; + }); + + if(!edit){ + if( parseInt(jQ("#btnAddMarker").attr('versionjl'),10) == 3){ + jQ("#btnAddMarker").attr("disabled","disabled"); + jQ("#btnAddMarker").addClass("disable-btn"); + } + jQ('.btg-optional.' + jQ("#btg-marker-type").val().toLowerCase().replace(' ', '_')).show(); + jQ(self.options.btnCreateID).show(); + jQ(self.options.btnUpdateID).hide(); + jQ(self.options.btnCreateID).unbind('click').bind('click', function(){ + jQ('#btg-messages').html(''); + + //create marker + var msg = ''; + var type = jQ("#btg-marker-type").val().toLowerCase().replace(' ', '_'); + var marker = new Object(); + marker.markerTitle = jQ('#btg-marker-title').val(); + marker.markerType = jQ('#btg-marker-type').val(); + marker.markerValue = jQ('#btg-marker-' + type).val(); + marker.markerIcon = jQ('#btg-icon').val(); + marker.markerShowInfoWindow = jQ('#btg-marker-showInfoOnload').val(); + marker.markerInfoWindow = jQ('#btg-infowindow').val(); + + if(marker.markerTitle == ''){ + msg= 'Please enter title of marker'; + } + if(marker.markerValue == ''){ + msg= 'Please enter value of marker'; + } + if(msg != ''){ + alert(msg); + return false; + } + self.add(marker); + //khoi tao lai form + jQ('#btg-messages').html('').append(jQ('
').addClass('bt-message success').html(self.options.warningText.addMarkerSuccess)); + + jQ('#btg-dialog').remove(); + jQ("#btnAddMarker").removeAttr("disabled"); + jQ("#btnAddMarker").removeClass("disable-btn"); + + return false; + }); + }else{ + + if(parseInt(jQ("#btnAddMarker").attr('versionjl'),10) == 3){ + jQ("#btnAddMarker").attr("disabled","disabled"); + jQ("#btnAddMarker").addClass("disable-btn"); + } + + if(marker == null){ + jQ("#btnAddMarker").removeAttr("disabled"); + jQ("#btnAddMarker").removeClass("disable-btn"); + return false + } + + // scrolltoTop = jQ("#btnAddMarker").offset().top ; + // jQ('html,body').animate({scrollTop: scrolltoTop},'fast'); + + jQ(self.options.btnUpdateID).show(); + jQ(self.options.btnCreateID).hide(); + jQ(self.options.btnUpdateID).unbind('click'); + jQ('#btg-marker-type').val(marker.markerType).trigger('liszt:updated'); + + jQ('.btg-optional').hide(); + jQ('.btg-optional.' + marker.markerType).show(); + + jQ('#btg-marker-title').val(marker.markerTitle); + jQ('.btg-optional.' + marker.markerType.toLowerCase().replace(' ', '_')).show(); + jQ('#btg-marker-' + marker.markerType.toLowerCase()).val(marker.markerValue).trigger('liszt:updated'); + if(!marker.markerIcon == ''){ + jQ('#btg-icon').val(marker.markerIcon); + jQ('#btg-icon_preview').attr('src','../'+marker.markerIcon); + jQ('#btg-icon_preview_empty').hide(); + jQ('#btg-icon_preview_img').show(); + } + jQ('#btg-marker-showInfoOnload').val(marker.markerShowInfoWindow) + jQ('#btg-infowindow').val(marker.markerInfoWindow); + + + + jQ(self.options.btnUpdateID).click(function(){ + self.update(li, marker); + return false; + }); + } + $$('#marker-form .bt_switch').each(function(el) + { + var options = el.getElements('option'); + if(options.length==2){ + + el.setStyle('display','none'); + var value = new Array(); + value[0] = options[0].value; + value[1] = options[1].value; + + var text = new Array(); + text[0] = options[0].text.replace(" ","-").toLowerCase().trim(); + text[1] = options[1].text.replace(" ","-").toLowerCase().trim(); + + var switchClass = (el.value == value[0]) ? text[0] : text[1]; + + var switcher = new Element('div',{ + 'class' : 'switcher-'+switchClass + }); + + switcher.inject(el, 'after'); + switcher.addEvent("click", function(){ + if(el.value == value[1]){ + switcher.setProperty('class','switcher-'+text[0]); + el.value = value[0]; + + } else { + switcher.setProperty('class','switcher-'+text[1]); + el.value = value[1]; + } + }); + } + }); + //End code show/hid, bind event, + return false; + }, + add:function(marker){ + var liHTML = '
' + + '
' + + ''+marker.markerTitle+'' + + '
' + + '
' + + 'Type of marker : ' + + ''+marker.markerType +'' + + '
' + + '
' + + 'Marker Position : ' + + ''+ marker.markerValue +'' + + '
' + + '
' + + 'Icon : ' + + '' + + '' + + '
' + + '
' + + 'Show Infowindow : ' + + ''+this.htmlEntities(marker.markerShowInfoWindow)+'' + + '
' + + '
' + + 'Infowindow : ' + + ''+this.htmlEntities(marker.markerInfoWindow)+'' + + '
' + + ''; + + + + + var li = new Element("li",{ + 'class' : 'marker-display', + html: liHTML + }); + var self=this; + li.getElement(".edit").addEvent("click",function(){ + self.edit(li) + }); + li.getElement(".remove").addEvent("click",function(){ + self.remove(li) + }); + + li.store("data",marker); + var container=$(this.options.container); + li.set("opacity",0); + container.grab(li); + li.fade("in"); + this.sortables.addItems(li); + }, + edit:function(li){ + var marker = li.retrieve("data"); + if(marker!= null){ + this.openDialog(true, li, marker); + + } + }, + update: function(li, marker){ + var msg = ''; + var title = jQ('#btg-marker-title').val(); + var type = jQ("#btg-marker-type").val(); + if(type=='address'){ + var value = jQ('#btg-marker-address').val(); + }else{ + value = jQ('#btg-marker-coordinate').val(); + } + icon = jQ('#btg-icon').val(); + infowindow = jQ('#btg-infowindow').val(); + showInfoWindow = jQ('#btg-marker-showInfoOnload').val(); + + if(title == ''){ + msg = "Please enter title of marker"; + }else if(value==''){ + msg = 'Please enter position of marker'; + } + + if(msg != ''){ + alert(msg); + return false; + } + //updateMarker + marker.markerTitle = title; + marker.markerType = type; + marker.markerValue = value; + marker.markerIcon = icon; + marker.markerShowInfoWindow = showInfoWindow; + marker.markerInfoWindow = infowindow; + li.store('data', marker); + //update li + jQ(li).find('.marker_title .value').html(title); + jQ(li).find('.marker_type .value').html(type); + jQ(li).find('.marker_value .value').html(value); + jQ(li).find('.marker-icon .value').html(icon); + jQ(li).find('.marker-icon img').attr('src',icon); + jQ(li).find('.marker-show-infowindow .value').html(showInfoWindow); + jQ(li).find('.marker-infowindow .value').html(this.htmlEntities(infowindow)); + + jQ('#btg-messages').html('').append(jQ('
').addClass('bt-message success').html(this.options.warningText.updateMarkerSuccess)); + + jQ('#btg-dialog').remove(); + jQ("#btnAddMarker").removeAttr("disabled"); + jQ("#btnAddMarker").removeClass("disable-btn"); + + return false; + + }, + remove:function(li){ + if(confirm(this.options.warningText.confirmDelete)){ + var b=new Fx.Morph(li); + b.start({ + height:0, + opacity:0 + }).chain(function(){ + li.dispose() + }); + } + //this.showMessage("btt-messages","Delete marker successful") + }, + removeAll: function(){ + if(confirm(this.options.warningText.confirmDeleteAll)){ + var a = $(this.options.container); + var b = a.getElements("li"); + b.each(function(c){ + var d=new Fx.Morph(c); + d.start({ + width:0, + height:0, + opacity:0 + }).chain(function(){ + c.dispose() + }); + }); + jQ('#btg-optional-container').show(); + //this.showMessage(this.options.warningText.deleteAllSuccess); + setTimeout(function(){ + jQ('#btg-optional-container').slideUp(500) + }, 1500); + } + return false; + }, + showMessage:function(messageText){ + + var messageContainer = $(this.options.messageContainer); + var message = new Element("div", { + 'class': 'bt-message' + }); + message.set("html",messageText); + message.set("opacity",0); + messageContainer.grab(message,"top"); + var b=new Fx.Morph(message,{ + link:"chain" + }); + b.start({ + opacity:1, + visibility:'visible' + }); + this.removeLog(); + }, + removeLog:function(){ + $(this.options.messageContainer).getElements("div.bt-message").each(function(d,b,c){ + setTimeout(function(){ + var e=new Fx.Morph(d,{ + link:"chain" + }); + e.start({ + height:0, + opacity:0 + }).chain(function(){ + d.dispose() + }) + },1000) + }) + }, + htmlEntities: function(str) { + return String(str).replace(/&/g, '&').replace(//g, '>').replace(/"/g, '"'); + } + }) +})(); \ No newline at end of file diff --git a/deployed/mod_bt_googlemaps/modules/mod_bt_googlemaps/admin/js/btstyles.js b/deployed/mod_bt_googlemaps/modules/mod_bt_googlemaps/admin/js/btstyles.js new file mode 100644 index 00000000..b3f3f59a --- /dev/null +++ b/deployed/mod_bt_googlemaps/modules/mod_bt_googlemaps/admin/js/btstyles.js @@ -0,0 +1,411 @@ +jQ = jQuery.noConflict(); +var BT=BT||{}; +(function(){ + BT.StyleList = new Class({ + Implements:[Options,Events], + options:{}, + initialize:function(options){ + + this.setOptions(options); + var styles =JSON.decode(BT.Base64.base64Decode(this.options.encodedItems)); + var self=this; + this.sortables=new Sortables(this.options.container,{ + clone:true, + revert:true, + opacity:0.3, + onStart:function(element, clone){ + clone.setStyle("z-index",999) + } + }); + if(styles!=null){ + styles.each(function(style){ + self.add(style) + }) + } + var submit =null; + if(typeof document.adminForm.onsubmit=="function"){ + submit = document.adminForm.onsubmit + } + document.adminForm.onsubmit=function(){ + var styles=[]; + var i=0; + $$("#btg-styles-container li").each(function(li){ + var style=li.retrieve("data"); + if(style!=null){ + styles[i]=style; + i++ + } + }); + $("btg-style-hidden").set("value",BT.Base64.base64Encode(JSON.encode(styles))); + if(submit!=null){ + submit() + } + } + }, + /** + * This method will show form to create style or update style + * + * */ + + openDialog: function(edit, li, style){ + var self = this; + var dialog = new Element('
', { + id: "btg-style-dialog", + html: this.options.dialogTemplate + }) + if(jQ("#btg-style-dialog").length >0){ + jQ('#btg-style-dialog').remove(); + } + jQ("#style-form").append(dialog); + + // this code will setup show/ hide form, bind event when create/update style + jQ('#btg-feature-type, #btg-style-element-type,#btg-style-visibility').chosen(); + // call color picker + jQ('.bt_color').ColorPicker({ + color: '#0000ff', + onShow: function (colpkr) { + jQ(colpkr).fadeIn(500); + return false; + }, + onHide: function (colpkr) { + jQ(colpkr).fadeOut(500); + return false; + }, + onSubmit: function(hsb, hex, rgb, el) { + jQ(el).val("#"+hex); + jQ(el).css('background',jQuery(el).val()) + jQ(el).ColorPickerHide(); + }, + onBeforeShow: function () { + jQ(this).ColorPickerSetColor(this.value); + } + }) + .bind('keyup', function(){ + jQ(this).ColorPickerSetColor(this.value); + }); + + //bind event for cancel + jQ(self.options.btnCancelID).bind('click', function(){ + jQ('#btg-style-dialog').remove(); + jQ("#btnAddStyle").removeAttr("disabled"); + jQ("#btnAddStyle").removeClass("disable-btn"); + return false; + }); + + if(!edit){ + if( parseInt(jQ("#btnAddStyle").attr('versionjl'),10) == 3){ + jQ("#btnAddStyle").attr("disabled","disabled"); + jQ("#btnAddStyle").addClass("disable-btn"); + } + jQ(self.options.btnCreateID).show(); + jQ(self.options.btnUpdateID).hide(); + jQ(self.options.btnCreateID).unbind('click').bind('click', function(){ + jQ('#btg-style-messages').html(''); + + //create style + var msg = ''; + var style = new Object(); + style.featureType = jQ('#btg-feature-type').val(); + style.elementType = jQ('#btg-style-element-type').val(); + style.visibility = jQ('#btg-style-visibility').val(); + style.invertLightness = jQ('#btg-style-invert-lightness').val(); + style.mapColor = jQ('#btg-style-map-color').val(); + style.weight = jQ('#btg-style-weight').val(); + style.hue = jQ('#btg-style-hue').val(); + style.saturation = jQ('#btg-style-saturation').val(); + style.lightness = jQ('#btg-style-lightness').val(); + style.gamma = jQ('#btg-style-gamma').val(); + + /* valid value of style element : + weight (0.1->8.0), + saturation(-100,100), + lightness(-100,100), + gamma(9.91,0.01) + */ + var weightRegExp = /^[0-8]\.\d$/; + var gammaRegExp = /^[0-9]\.[0-9][0-9]$/; + if(!style.weight==''&& !weightRegExp.test(style.weight)){ + msg= 'Weight of style not valid! \nPlease check it and try again!'; + } + if(!style.saturation=='' && parseInt(style.saturation)<= -100 && parseInt(style.saturation)>= 100){ + msg= 'Saturation of style not valid! \nPlease check it and try again!'; + } + if(!style.lightness == '' && parseInt(style.lightness)<= -100 && parseInt(style.lightness)>= 100){ + msg= 'Lightness of style not valid! \nPlease check it and try again!'; + } + if(!style.gamma == '' && !gammaRegExp.test(style.gamma) && parseFloat(style.gamma)<= 0.01 && parseFloat(style.gamma)>= 9.91){ + msg= 'Gamma of style not valid! \nPlease check it and try again!'; + } + + if(msg != ''){ + alert(msg); + return false; + } + + self.add(style); + //khoi tao lai form + jQ('#btg-style-messages').html('').append(jQ('
').addClass('bt-message success').html(self.options.warningText.addStyleSuccess)); + + jQ('#btg-style-dialog').remove(); + jQ("#btnAddStyle").removeAttr("disabled"); + jQ("#btnAddStyle").removeClass("disable-btn"); + + return false; + }); + }else{ + + if(parseInt(jQ("#btnAddStyle").attr('versionjl'),10) == 3){ + jQ("#btnAddStyle").attr("disabled","disabled"); + jQ("#btnAddStyle").addClass("disable-btn"); + } + + if(style == null){ + jQ("#btnAddStyle").removeAttr("disabled"); + jQ("#btnAddStyle").removeClass("disable-btn"); + return false + } + + // scrolltoTop = jQ("#btnAddStyle").offset().top ; + //jQ('html,body').animate({scrollTop: scrolltoTop},'fast'); + + jQ(self.options.btnUpdateID).show(); + jQ(self.options.btnCreateID).hide(); + jQ(self.options.btnUpdateID).unbind('click'); + + jQ('#btg-feature-type').val(style.featureType).trigger('liszt:updated'); + jQ('#btg-style-element-type').val(style.elementType).trigger('liszt:updated'); + jQ('#btg-style-visibility').val(style.visibility).trigger('liszt:updated'); + jQ('#btg-style-invert-lightness').val(style.invertLightness); + jQ('#btg-style-map-color').val(style.mapColor); + jQ('#btg-style-weight').val(style.weight); + jQ('#btg-style-hue').val(style.hue); + jQ('#btg-style-saturation').val(style.saturation); + jQ('#btg-style-lightness').val(style.lightness); + jQ('#btg-style-gamma').val(style.gamma); + + jQ(self.options.btnUpdateID).click(function(){ + self.update(li, style); + return false; + }); + } + $$('#btg-form-style .bt_switch').each(function(el) + { + var options = el.getElements('option'); + if(options.length==2){ + + el.setStyle('display','none'); + var value = new Array(); + value[0] = options[0].value; + value[1] = options[1].value; + + var text = new Array(); + text[0] = options[0].text.replace(" ","-").toLowerCase().trim(); + text[1] = options[1].text.replace(" ","-").toLowerCase().trim(); + + var switchClass = (el.value == value[0]) ? text[0] : text[1]; + + var switcher = new Element('div',{ + 'class' : 'switcher-'+switchClass + }); + + switcher.inject(el, 'after'); + switcher.addEvent("click", function(){ + if(el.value == value[1]){ + switcher.setProperty('class','switcher-'+text[0]); + el.value = value[0]; + + } else { + switcher.setProperty('class','switcher-'+text[1]); + el.value = value[1]; + } + }); + } + }); + //End code show/hid, bind event, + return false; + }, + add:function(style){ + var liHTML ='
' + + '
Feature Type : '+style.featureType+'
' + + '
Element Type : '+style.elementType+'
' + + '
Stylers :
' + + '
' + + '
Visibility : '+style.visibility+'
' + + '
Invert Lightness : '+ style.invertLightness +'
' + + '
Color : '+style.mapColor+'
' + + '
Weight : '+style.weight+'
' + + '
Hue : '+style.hue+'
' + + '
Saturation : '+style.saturation+'
' + + '
Lightness : '+style.lightness+'
' + + '
Gamma : '+style.gamma+'
' + + '
' + + ' ' + + '
'; + + + + + var li = new Element("li",{ + 'class' : 'style-display', + html: liHTML + }); + var self=this; + li.getElement(".edit").addEvent("click",function(){ + self.edit(li) + }); + li.getElement(".remove").addEvent("click",function(){ + self.remove(li) + }); + + li.store("data",style); + var container=$(this.options.container); + li.set("opacity",0); + container.grab(li); + li.fade("in"); + this.sortables.addItems(li); + }, + edit:function(li){ + var style = li.retrieve("data"); + if(style!= null){ + this.openDialog(true, li, style); + + } + }, + update: function(li, style){ + var msg = ''; + + var featureType = jQ('#btg-feature-type').val(); + var elementType = jQ('#btg-style-element-type').val(); + var visibility = jQ('#btg-style-visibility').val(); + var invertLightness = jQ('#btg-style-invert-lightness').val(); + var mapColor = jQ('#btg-style-map-color').val(); + var weight = jQ('#btg-style-weight').val(); + var hue = jQ('#btg-style-hue').val(); + var saturation = jQ('#btg-style-saturation').val(); + var lightness = jQ('#btg-style-lightness').val(); + var gamma = jQ('#btg-style-gamma').val(); + + var weightRegExp = /^[0-8]\.\d$/; + var gammaRegExp = /^[0-9]\.?[0-9]?[0-9]?$/; + if(!weight==''&& !weightRegExp.test(weight)){ + msg= 'Weight of style not valid! \n Please check it and try again!' + weight; + } + if(!saturation=='' &&( parseInt(saturation)<= -100 || parseInt(saturation)>= 100) || isNaN(saturation)){ + msg= 'Saturation of style not valid! \n Please check it and try again!'; + } + if(!lightness=='' && (parseInt(lightness)<= -100 || parseInt(lightness)>= 100) || isNaN(lightness)){ + msg= 'Lightness of style not valid! \n Please check it and try again!'; + } + if(!gamma == '' && !gammaRegExp.test(gamma)|| parseFloat(gamma)<= 0.01 || parseFloat(gamma)>= 9.91){ + msg= 'Gamma of style not valid! \n Please check it and try again!'; + } + + if(msg != ''){ + alert(msg); + return false; + } + //updateMarker + style.featureType = featureType; + style.elementType = elementType; + style.visibility = visibility; + style.invertLightness = invertLightness; + style.mapColor = mapColor; + style.weight = weight; + style.hue = hue; + style.saturation = saturation; + style.lightness = lightness; + style.gamma = gamma; + li.store('data', style); + //update li + jQ(li).find('.style-feature-type .value').html(featureType); + jQ(li).find('.style-element-type .value').html(elementType); + jQ(li).find('.visibility .value').html(visibility); + jQ(li).find('.invert-lightness .value').html(invertLightness); + jQ(li).find('.color .value').html(mapColor); + jQ(li).find('.weight .value').html(weight); + jQ(li).find('.hue .value').html(hue); + jQ(li).find('.saturation .value').html(saturation); + jQ(li).find('.lightness .value').html(lightness); + jQ(li).find('.gamma .value').html(gamma); + + jQ('#btg-style-messages').html('').append(jQ('
').addClass('bt-message success').html(this.options.warningText.updateMarkerSuccess)); + + jQ('#btg-style-dialog').remove(); + jQ("#btnAddStyle").removeAttr("disabled"); + jQ("#btnAddStyle").removeClass("disable-btn"); + + return false; + + }, + remove:function(li){ + if(confirm(this.options.warningText.confirmDelete)){ + var b=new Fx.Morph(li); + b.start({ + height:0, + opacity:0 + }).chain(function(){ + li.dispose() + }); + } + //this.showMessage("btt-messages","Delete style successful") + }, + removeAll: function(){ + if(confirm(this.options.warningText.confirmDeleteAll)){ + var a = $(this.options.container); + var b = a.getElements("li"); + b.each(function(c){ + var d=new Fx.Morph(c); + d.start({ + width:0, + height:0, + opacity:0 + }).chain(function(){ + c.dispose() + }); + }); + jQ('#btg-styles-container').show(); + //this.showMessage(this.options.warningText.deleteAllSuccess); + setTimeout(function(){ + jQ('#btg-styles-container').slideUp(500) + }, 1500); + } + return false; + }, + showMessage:function(messageText){ + + var messageContainer = $(this.options.messageContainer); + var message = new Element("div", { + 'class': 'bt-message' + }); + message.set("html",messageText); + message.set("opacity",0); + messageContainer.grab(message,"top"); + var b=new Fx.Morph(message,{ + link:"chain" + }); + b.start({ + opacity:1, + visibility:'visible' + }); + this.removeLog(); + }, + removeLog:function(){ + $(this.options.messageContainer).getElements("div.bt-message").each(function(d,b,c){ + setTimeout(function(){ + var e=new Fx.Morph(d,{ + link:"chain" + }); + e.start({ + height:0, + opacity:0 + }).chain(function(){ + d.dispose() + }) + },1000) + }) + }, + htmlEntities: function(str) { + return String(str).replace(/&/g, '&').replace(//g, '>').replace(/"/g, '"'); + } + }) +})(); \ No newline at end of file diff --git a/deployed/mod_bt_googlemaps/modules/mod_bt_googlemaps/admin/js/chosen.jquery.min.js b/deployed/mod_bt_googlemaps/modules/mod_bt_googlemaps/admin/js/chosen.jquery.min.js new file mode 100644 index 00000000..db09d636 --- /dev/null +++ b/deployed/mod_bt_googlemaps/modules/mod_bt_googlemaps/admin/js/chosen.jquery.min.js @@ -0,0 +1,899 @@ +// Chosen, a Select Box Enhancer for jQuery and Protoype +// by Patrick Filler for Harvest, http://getharvest.com +// +// Version 0.9.5 +// Full source at https://github.com/harvesthq/chosen +// Copyright (c) 2011 Harvest http://getharvest.com + +// MIT License, https://github.com/harvesthq/chosen/blob/master/LICENSE.md +// This file is generated by `cake build`, do not edit it by hand. +(function() { + var SelectParser; + SelectParser = (function() { + function SelectParser() { + this.options_index = 0; + this.parsed = []; + } + SelectParser.prototype.add_node = function(child) { + if (child.nodeName === "OPTGROUP") { + return this.add_group(child); + } else { + return this.add_option(child); + } + }; + SelectParser.prototype.add_group = function(group) { + var group_position, option, _i, _len, _ref, _results; + group_position = this.parsed.length; + this.parsed.push({ + array_index: group_position, + group: true, + label: group.label, + children: 0, + disabled: group.disabled + }); + _ref = group.childNodes; + _results = []; + for (_i = 0, _len = _ref.length; _i < _len; _i++) { + option = _ref[_i]; + _results.push(this.add_option(option, group_position, group.disabled)); + } + return _results; + }; + SelectParser.prototype.add_option = function(option, group_position, group_disabled) { + if (option.nodeName === "OPTION") { + if (option.text !== "") { + if (group_position != null) { + this.parsed[group_position].children += 1; + } + this.parsed.push({ + array_index: this.parsed.length, + options_index: this.options_index, + value: option.value, + text: option.text, + html: option.innerHTML, + selected: option.selected, + disabled: group_disabled === true ? group_disabled : option.disabled, + group_array_index: group_position, + classes: option.className, + style: option.style.cssText + }); + } else { + this.parsed.push({ + array_index: this.parsed.length, + options_index: this.options_index, + empty: true + }); + } + return this.options_index += 1; + } + }; + return SelectParser; + })(); + SelectParser.select_to_array = function(select) { + var child, parser, _i, _len, _ref; + parser = new SelectParser(); + _ref = select.childNodes; + for (_i = 0, _len = _ref.length; _i < _len; _i++) { + child = _ref[_i]; + parser.add_node(child); + } + return parser.parsed; + }; + this.SelectParser = SelectParser; +}).call(this); +(function() { + /* + Chosen source: generate output using 'cake build' + Copyright (c) 2011 by Harvest + */ + var AbstractChosen, root; + var __bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; }; + root = this; + AbstractChosen = (function() { + function AbstractChosen(form_field, options) { + this.form_field = form_field; + this.options = options != null ? options : {}; + this.set_default_values(); + this.is_multiple = this.form_field.multiple; + this.default_text_default = this.is_multiple ? "Select Some Options" : "Select an Option"; + this.setup(); + this.set_up_html(); + this.register_observers(); + this.finish_setup(); + } + AbstractChosen.prototype.set_default_values = function() { + this.click_test_action = __bind(function(evt) { + return this.test_active_click(evt); + }, this); + this.activate_action = __bind(function(evt) { + return this.activate_field(evt); + }, this); + this.active_field = false; + this.mouse_on_container = false; + this.results_showing = false; + this.result_highlighted = null; + this.result_single_selected = null; + this.allow_single_deselect = (this.options.allow_single_deselect != null) && this.form_field.options[0].text === "" ? this.options.allow_single_deselect : false; + this.disable_search_threshold = this.options.disable_search_threshold || 0; + this.choices = 0; + return this.results_none_found = this.options.no_results_text || "No results match"; + }; + AbstractChosen.prototype.mouse_enter = function() { + return this.mouse_on_container = true; + }; + AbstractChosen.prototype.mouse_leave = function() { + return this.mouse_on_container = false; + }; + AbstractChosen.prototype.input_focus = function(evt) { + if (!this.active_field) { + return setTimeout((__bind(function() { + return this.container_mousedown(); + }, this)), 50); + } + }; + AbstractChosen.prototype.input_blur = function(evt) { + if (!this.mouse_on_container) { + this.active_field = false; + return setTimeout((__bind(function() { + return this.blur_test(); + }, this)), 100); + } + }; + AbstractChosen.prototype.result_add_option = function(option) { + var classes, style; + if (!option.disabled) { + option.dom_id = this.container_id + "_o_" + option.array_index; + classes = option.selected && this.is_multiple ? [] : ["active-result"]; + if (option.selected) { + classes.push("result-selected"); + } + if (option.group_array_index != null) { + classes.push("group-option"); + } + if (option.classes !== "") { + classes.push(option.classes); + } + style = option.style.cssText !== "" ? " style=\"" + option.style + "\"" : ""; + return '
  • ' + option.html + '
  • '; + } else { + return ""; + } + }; + AbstractChosen.prototype.results_update_field = function() { + this.result_clear_highlight(); + this.result_single_selected = null; + return this.results_build(); + }; + AbstractChosen.prototype.results_toggle = function() { + if (this.results_showing) { + return this.results_hide(); + } else { + return this.results_show(); + } + }; + AbstractChosen.prototype.results_search = function(evt) { + if (this.results_showing) { + return this.winnow_results(); + } else { + return this.results_show(); + } + }; + AbstractChosen.prototype.keyup_checker = function(evt) { + var stroke, _ref; + stroke = (_ref = evt.which) != null ? _ref : evt.keyCode; + this.search_field_scale(); + switch (stroke) { + case 8: + if (this.is_multiple && this.backstroke_length < 1 && this.choices > 0) { + return this.keydown_backstroke(); + } else if (!this.pending_backstroke) { + this.result_clear_highlight(); + return this.results_search(); + } + break; + case 13: + evt.preventDefault(); + if (this.results_showing) { + return this.result_select(evt); + } + break; + case 27: + if (this.results_showing) { + return this.results_hide(); + } + break; + case 9: + case 38: + case 40: + case 16: + case 91: + case 17: + break; + default: + return this.results_search(); + } + }; + AbstractChosen.prototype.generate_field_id = function() { + var new_id; + new_id = this.generate_random_id(); + this.form_field.id = new_id; + return new_id; + }; + AbstractChosen.prototype.generate_random_char = function() { + var chars, newchar, rand; + chars = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXTZ"; + rand = Math.floor(Math.random() * chars.length); + return newchar = chars.substring(rand, rand + 1); + }; + return AbstractChosen; + })(); + root.AbstractChosen = AbstractChosen; +}).call(this); +(function() { + /* + Chosen source: generate output using 'cake build' + Copyright (c) 2011 by Harvest + */ + var $, Chosen, get_side_border_padding, root; + var __hasProp = Object.prototype.hasOwnProperty, __extends = function(child, parent) { + for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } + function ctor() { this.constructor = child; } + ctor.prototype = parent.prototype; + child.prototype = new ctor; + child.__super__ = parent.prototype; + return child; + }, __bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; }; + root = this; + $ = jQuery; + $.fn.extend({ + chosen: function(options) { + if ($.browser.msie && ($.browser.version === "6.0" || $.browser.version === "7.0")) { + return this; + } + return $(this).each(function(input_field) { + if (!($(this)).hasClass("chzn-done")) { + return new Chosen(this, options); + } + }); + } + }); + Chosen = (function() { + __extends(Chosen, AbstractChosen); + function Chosen() { + Chosen.__super__.constructor.apply(this, arguments); + } + Chosen.prototype.setup = function() { + this.form_field_jq = $(this.form_field); + return this.is_rtl = this.form_field_jq.hasClass("chzn-rtl"); + }; + Chosen.prototype.finish_setup = function() { + return this.form_field_jq.addClass("chzn-done"); + }; + Chosen.prototype.set_up_html = function() { + var container_div, dd_top, dd_width, sf_width; + this.container_id = this.form_field.id.length ? this.form_field.id.replace(/(:|\.)/g, '_') : this.generate_field_id(); + this.container_id += "_chzn"; + this.f_width = this.form_field_jq.outerWidth(); + this.default_text = this.form_field_jq.data('placeholder') ? this.form_field_jq.data('placeholder') : this.default_text_default; + container_div = $("
    ", { + id: this.container_id, + "class": "chzn-container" + (this.is_rtl ? ' chzn-rtl' : ''), + style: 'width: ' + this.f_width + 'px;' + }); + if (this.is_multiple) { + container_div.html('
      '); + } else { + container_div.html('' + this.default_text + '
        '); + } + this.form_field_jq.hide().after(container_div); + this.container = $('#' + this.container_id); + this.container.addClass("chzn-container-" + (this.is_multiple ? "multi" : "single")); + if (!this.is_multiple && this.form_field.options.length <= this.disable_search_threshold) { + this.container.addClass("chzn-container-single-nosearch"); + } + this.dropdown = this.container.find('div.chzn-drop').first(); + dd_top = this.container.height(); + dd_width = this.f_width - get_side_border_padding(this.dropdown); + this.dropdown.css({ + "width": dd_width + "px", + "top": dd_top + "px" + }); + this.search_field = this.container.find('input').first(); + this.search_results = this.container.find('ul.chzn-results').first(); + this.search_field_scale(); + this.search_no_results = this.container.find('li.no-results').first(); + if (this.is_multiple) { + this.search_choices = this.container.find('ul.chzn-choices').first(); + this.search_container = this.container.find('li.search-field').first(); + } else { + this.search_container = this.container.find('div.chzn-search').first(); + this.selected_item = this.container.find('.chzn-single').first(); + sf_width = dd_width - get_side_border_padding(this.search_container) - get_side_border_padding(this.search_field); + this.search_field.css({ + "width": sf_width + "px" + }); + } + this.results_build(); + this.set_tab_index(); + return this.form_field_jq.trigger("liszt:ready", { + chosen: this + }); + }; + Chosen.prototype.register_observers = function() { + this.container.mousedown(__bind(function(evt) { + return this.container_mousedown(evt); + }, this)); + this.container.mouseup(__bind(function(evt) { + return this.container_mouseup(evt); + }, this)); + this.container.mouseenter(__bind(function(evt) { + return this.mouse_enter(evt); + }, this)); + this.container.mouseleave(__bind(function(evt) { + return this.mouse_leave(evt); + }, this)); + this.search_results.mouseup(__bind(function(evt) { + return this.search_results_mouseup(evt); + }, this)); + this.search_results.mouseover(__bind(function(evt) { + return this.search_results_mouseover(evt); + }, this)); + this.search_results.mouseout(__bind(function(evt) { + return this.search_results_mouseout(evt); + }, this)); + this.form_field_jq.bind("liszt:updated", __bind(function(evt) { + return this.results_update_field(evt); + }, this)); + this.search_field.blur(__bind(function(evt) { + return this.input_blur(evt); + }, this)); + this.search_field.keyup(__bind(function(evt) { + return this.keyup_checker(evt); + }, this)); + this.search_field.keydown(__bind(function(evt) { + return this.keydown_checker(evt); + }, this)); + if (this.is_multiple) { + this.search_choices.click(__bind(function(evt) { + return this.choices_click(evt); + }, this)); + return this.search_field.focus(__bind(function(evt) { + return this.input_focus(evt); + }, this)); + } + }; + Chosen.prototype.search_field_disabled = function() { + this.is_disabled = this.form_field_jq.attr('disabled'); + if (this.is_disabled) { + this.container.addClass('chzn-disabled'); + this.search_field.attr('disabled', true); + if (!this.is_multiple) { + this.selected_item.unbind("focus", this.activate_action); + } + return this.close_field(); + } else { + this.container.removeClass('chzn-disabled'); + this.search_field.attr('disabled', false); + if (!this.is_multiple) { + return this.selected_item.bind("focus", this.activate_action); + } + } + }; + Chosen.prototype.container_mousedown = function(evt) { + var target_closelink; + if (!this.is_disabled) { + target_closelink = evt != null ? ($(evt.target)).hasClass("search-choice-close") : false; + if (evt && evt.type === "mousedown") { + evt.stopPropagation(); + } + if (!this.pending_destroy_click && !target_closelink) { + if (!this.active_field) { + if (this.is_multiple) { + this.search_field.val(""); + } + $(document).click(this.click_test_action); + this.results_show(); + } else if (!this.is_multiple && evt && ($(evt.target) === this.selected_item || $(evt.target).parents("a.chzn-single").length)) { + evt.preventDefault(); + this.results_toggle(); + } + return this.activate_field(); + } else { + return this.pending_destroy_click = false; + } + } + }; + Chosen.prototype.container_mouseup = function(evt) { + if (evt.target.nodeName === "ABBR") { + return this.results_reset(evt); + } + }; + Chosen.prototype.blur_test = function(evt) { + if (!this.active_field && this.container.hasClass("chzn-container-active")) { + return this.close_field(); + } + }; + Chosen.prototype.close_field = function() { + $(document).unbind("click", this.click_test_action); + if (!this.is_multiple) { + this.selected_item.attr("tabindex", this.search_field.attr("tabindex")); + this.search_field.attr("tabindex", -1); + } + this.active_field = false; + this.results_hide(); + this.container.removeClass("chzn-container-active"); + this.winnow_results_clear(); + this.clear_backstroke(); + this.show_search_field_default(); + return this.search_field_scale(); + }; + Chosen.prototype.activate_field = function() { + if (!this.is_multiple && !this.active_field) { + this.search_field.attr("tabindex", this.selected_item.attr("tabindex")); + this.selected_item.attr("tabindex", -1); + } + this.container.addClass("chzn-container-active"); + this.active_field = true; + this.search_field.val(this.search_field.val()); + return this.search_field.focus(); + }; + Chosen.prototype.test_active_click = function(evt) { + if ($(evt.target).parents('#' + this.container_id).length) { + return this.active_field = true; + } else { + return this.close_field(); + } + }; + Chosen.prototype.results_build = function() { + var content, data, startTime, _i, _len, _ref; + startTime = new Date(); + this.parsing = true; + this.results_data = root.SelectParser.select_to_array(this.form_field); + if (this.is_multiple && this.choices > 0) { + this.search_choices.find("li.search-choice").remove(); + this.choices = 0; + } else if (!this.is_multiple) { + this.selected_item.find("span").text(this.default_text); + } + content = ''; + _ref = this.results_data; + for (_i = 0, _len = _ref.length; _i < _len; _i++) { + data = _ref[_i]; + if (data.group) { + content += this.result_add_group(data); + } else if (!data.empty) { + content += this.result_add_option(data); + if (data.selected && this.is_multiple) { + this.choice_build(data); + } else if (data.selected && !this.is_multiple) { + this.selected_item.find("span").text(data.text); + if (this.allow_single_deselect) { + this.single_deselect_control_build(); + } + } + } + } + this.search_field_disabled(); + this.show_search_field_default(); + this.search_field_scale(); + this.search_results.html(content); + return this.parsing = false; + }; + Chosen.prototype.result_add_group = function(group) { + if (!group.disabled) { + group.dom_id = this.container_id + "_g_" + group.array_index; + return '
      • ' + $("
        ").text(group.label).html() + '
      • '; + } else { + return ""; + } + }; + Chosen.prototype.result_do_highlight = function(el) { + var high_bottom, high_top, maxHeight, visible_bottom, visible_top; + if (el.length) { + this.result_clear_highlight(); + this.result_highlight = el; + this.result_highlight.addClass("highlighted"); + maxHeight = parseInt(this.search_results.css("maxHeight"), 10); + visible_top = this.search_results.scrollTop(); + visible_bottom = maxHeight + visible_top; + high_top = this.result_highlight.position().top + this.search_results.scrollTop(); + high_bottom = high_top + this.result_highlight.outerHeight(); + if (high_bottom >= visible_bottom) { + return this.search_results.scrollTop((high_bottom - maxHeight) > 0 ? high_bottom - maxHeight : 0); + } else if (high_top < visible_top) { + return this.search_results.scrollTop(high_top); + } + } + }; + Chosen.prototype.result_clear_highlight = function() { + if (this.result_highlight) { + this.result_highlight.removeClass("highlighted"); + } + return this.result_highlight = null; + }; + Chosen.prototype.results_show = function() { + var dd_top; + if (!this.is_multiple) { + this.selected_item.addClass("chzn-single-with-drop"); + if (this.result_single_selected) { + this.result_do_highlight(this.result_single_selected); + } + } + dd_top = this.is_multiple ? this.container.height() : this.container.height() - 1; + this.dropdown.css({ + "top": dd_top + "px", + "left": 0 + }); + this.results_showing = true; + this.search_field.focus(); + this.search_field.val(this.search_field.val()); + return this.winnow_results(); + }; + Chosen.prototype.results_hide = function() { + if (!this.is_multiple) { + this.selected_item.removeClass("chzn-single-with-drop"); + } + this.result_clear_highlight(); + this.dropdown.css({ + "left": "-9000px" + }); + return this.results_showing = false; + }; + Chosen.prototype.set_tab_index = function(el) { + var ti; + if (this.form_field_jq.attr("tabindex")) { + ti = this.form_field_jq.attr("tabindex"); + this.form_field_jq.attr("tabindex", -1); + if (this.is_multiple) { + return this.search_field.attr("tabindex", ti); + } else { + this.selected_item.attr("tabindex", ti); + return this.search_field.attr("tabindex", -1); + } + } + }; + Chosen.prototype.show_search_field_default = function() { + if (this.is_multiple && this.choices < 1 && !this.active_field) { + this.search_field.val(this.default_text); + return this.search_field.addClass("default"); + } else { + this.search_field.val(""); + return this.search_field.removeClass("default"); + } + }; + Chosen.prototype.search_results_mouseup = function(evt) { + var target; + target = $(evt.target).hasClass("active-result") ? $(evt.target) : $(evt.target).parents(".active-result").first(); + if (target.length) { + this.result_highlight = target; + return this.result_select(evt); + } + }; + Chosen.prototype.search_results_mouseover = function(evt) { + var target; + target = $(evt.target).hasClass("active-result") ? $(evt.target) : $(evt.target).parents(".active-result").first(); + if (target) { + return this.result_do_highlight(target); + } + }; + Chosen.prototype.search_results_mouseout = function(evt) { + if ($(evt.target).hasClass("active-result" || $(evt.target).parents('.active-result').first())) { + return this.result_clear_highlight(); + } + }; + Chosen.prototype.choices_click = function(evt) { + evt.preventDefault(); + if (this.active_field && !($(evt.target).hasClass("search-choice" || $(evt.target).parents('.search-choice').first)) && !this.results_showing) { + return this.results_show(); + } + }; + Chosen.prototype.choice_build = function(item) { + var choice_id, link; + choice_id = this.container_id + "_c_" + item.array_index; + this.choices += 1; + this.search_container.before('
      • ' + item.html + '
      • '); + link = $('#' + choice_id).find("a").first(); + return link.click(__bind(function(evt) { + return this.choice_destroy_link_click(evt); + }, this)); + }; + Chosen.prototype.choice_destroy_link_click = function(evt) { + evt.preventDefault(); + if (!this.is_disabled) { + this.pending_destroy_click = true; + return this.choice_destroy($(evt.target)); + } else { + return evt.stopPropagation; + } + }; + Chosen.prototype.choice_destroy = function(link) { + this.choices -= 1; + this.show_search_field_default(); + if (this.is_multiple && this.choices > 0 && this.search_field.val().length < 1) { + this.results_hide(); + } + this.result_deselect(link.attr("rel")); + return link.parents('li').first().remove(); + }; + Chosen.prototype.results_reset = function(evt) { + this.form_field.options[0].selected = true; + this.selected_item.find("span").text(this.default_text); + this.show_search_field_default(); + $(evt.target).remove(); + this.form_field_jq.trigger("change"); + if (this.active_field) { + return this.results_hide(); + } + }; + Chosen.prototype.result_select = function(evt) { + var high, high_id, item, position; + if (this.result_highlight) { + high = this.result_highlight; + high_id = high.attr("id"); + this.result_clear_highlight(); + if (this.is_multiple) { + this.result_deactivate(high); + } else { + this.search_results.find(".result-selected").removeClass("result-selected"); + this.result_single_selected = high; + } + high.addClass("result-selected"); + position = high_id.substr(high_id.lastIndexOf("_") + 1); + item = this.results_data[position]; + item.selected = true; + this.form_field.options[item.options_index].selected = true; + if (this.is_multiple) { + this.choice_build(item); + } else { + this.selected_item.find("span").first().text(item.text); + if (this.allow_single_deselect) { + this.single_deselect_control_build(); + } + } + if (!(evt.metaKey && this.is_multiple)) { + this.results_hide(); + } + this.search_field.val(""); + this.form_field_jq.trigger("change"); + return this.search_field_scale(); + } + }; + Chosen.prototype.result_activate = function(el) { + return el.addClass("active-result"); + }; + Chosen.prototype.result_deactivate = function(el) { + return el.removeClass("active-result"); + }; + Chosen.prototype.result_deselect = function(pos) { + var result, result_data; + result_data = this.results_data[pos]; + result_data.selected = false; + this.form_field.options[result_data.options_index].selected = false; + result = $("#" + this.container_id + "_o_" + pos); + result.removeClass("result-selected").addClass("active-result").show(); + this.result_clear_highlight(); + this.winnow_results(); + this.form_field_jq.trigger("change"); + return this.search_field_scale(); + }; + Chosen.prototype.single_deselect_control_build = function() { + if (this.allow_single_deselect && this.selected_item.find("abbr").length < 1) { + return this.selected_item.find("span").first().after(""); + } + }; + Chosen.prototype.winnow_results = function() { + var found, option, part, parts, regex, result_id, results, searchText, startTime, startpos, text, zregex, _i, _j, _len, _len2, _ref; + startTime = new Date(); + this.no_results_clear(); + results = 0; + searchText = this.search_field.val() === this.default_text ? "" : $('
        ').text($.trim(this.search_field.val())).html(); + regex = new RegExp('^' + searchText.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&"), 'i'); + zregex = new RegExp(searchText.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&"), 'i'); + _ref = this.results_data; + for (_i = 0, _len = _ref.length; _i < _len; _i++) { + option = _ref[_i]; + if (!option.disabled && !option.empty) { + if (option.group) { + $('#' + option.dom_id).hide(); + } else if (!(this.is_multiple && option.selected)) { + found = false; + result_id = option.dom_id; + if (regex.test(option.html)) { + found = true; + results += 1; + } else if (option.html.indexOf(" ") >= 0 || option.html.indexOf("[") === 0) { + parts = option.html.replace(/\[|\]/g, "").split(" "); + if (parts.length) { + for (_j = 0, _len2 = parts.length; _j < _len2; _j++) { + part = parts[_j]; + if (regex.test(part)) { + found = true; + results += 1; + } + } + } + } + if (found) { + if (searchText.length) { + startpos = option.html.search(zregex); + text = option.html.substr(0, startpos + searchText.length) + '' + option.html.substr(startpos + searchText.length); + text = text.substr(0, startpos) + '' + text.substr(startpos); + } else { + text = option.html; + } + if ($("#" + result_id).html !== text) { + $("#" + result_id).html(text); + } + this.result_activate($("#" + result_id)); + if (option.group_array_index != null) { + $("#" + this.results_data[option.group_array_index].dom_id).show(); + } + } else { + if (this.result_highlight && result_id === this.result_highlight.attr('id')) { + this.result_clear_highlight(); + } + this.result_deactivate($("#" + result_id)); + } + } + } + } + if (results < 1 && searchText.length) { + return this.no_results(searchText); + } else { + return this.winnow_results_set_highlight(); + } + }; + Chosen.prototype.winnow_results_clear = function() { + var li, lis, _i, _len, _results; + this.search_field.val(""); + lis = this.search_results.find("li"); + _results = []; + for (_i = 0, _len = lis.length; _i < _len; _i++) { + li = lis[_i]; + li = $(li); + _results.push(li.hasClass("group-result") ? li.show() : !this.is_multiple || !li.hasClass("result-selected") ? this.result_activate(li) : void 0); + } + return _results; + }; + Chosen.prototype.winnow_results_set_highlight = function() { + var do_high, selected_results; + if (!this.result_highlight) { + selected_results = !this.is_multiple ? this.search_results.find(".result-selected.active-result") : []; + do_high = selected_results.length ? selected_results.first() : this.search_results.find(".active-result").first(); + if (do_high != null) { + return this.result_do_highlight(do_high); + } + } + }; + Chosen.prototype.no_results = function(terms) { + var no_results_html; + no_results_html = $('
      • ' + this.results_none_found + ' ""
      • '); + no_results_html.find("span").first().html(terms); + return this.search_results.append(no_results_html); + }; + Chosen.prototype.no_results_clear = function() { + return this.search_results.find(".no-results").remove(); + }; + Chosen.prototype.keydown_arrow = function() { + var first_active, next_sib; + if (!this.result_highlight) { + first_active = this.search_results.find("li.active-result").first(); + if (first_active) { + this.result_do_highlight($(first_active)); + } + } else if (this.results_showing) { + next_sib = this.result_highlight.nextAll("li.active-result").first(); + if (next_sib) { + this.result_do_highlight(next_sib); + } + } + if (!this.results_showing) { + return this.results_show(); + } + }; + Chosen.prototype.keyup_arrow = function() { + var prev_sibs; + if (!this.results_showing && !this.is_multiple) { + return this.results_show(); + } else if (this.result_highlight) { + prev_sibs = this.result_highlight.prevAll("li.active-result"); + if (prev_sibs.length) { + return this.result_do_highlight(prev_sibs.first()); + } else { + if (this.choices > 0) { + this.results_hide(); + } + return this.result_clear_highlight(); + } + } + }; + Chosen.prototype.keydown_backstroke = function() { + if (this.pending_backstroke) { + this.choice_destroy(this.pending_backstroke.find("a").first()); + return this.clear_backstroke(); + } else { + this.pending_backstroke = this.search_container.siblings("li.search-choice").last(); + return this.pending_backstroke.addClass("search-choice-focus"); + } + }; + Chosen.prototype.clear_backstroke = function() { + if (this.pending_backstroke) { + this.pending_backstroke.removeClass("search-choice-focus"); + } + return this.pending_backstroke = null; + }; + Chosen.prototype.keydown_checker = function(evt) { + var stroke, _ref; + stroke = (_ref = evt.which) != null ? _ref : evt.keyCode; + this.search_field_scale(); + if (stroke !== 8 && this.pending_backstroke) { + this.clear_backstroke(); + } + switch (stroke) { + case 8: + this.backstroke_length = this.search_field.val().length; + break; + case 9: + if (this.results_showing && !this.is_multiple) { + this.result_select(evt); + } + this.mouse_on_container = false; + break; + case 13: + evt.preventDefault(); + break; + case 38: + evt.preventDefault(); + this.keyup_arrow(); + break; + case 40: + this.keydown_arrow(); + break; + } + }; + Chosen.prototype.search_field_scale = function() { + var dd_top, div, h, style, style_block, styles, w, _i, _len; + if (this.is_multiple) { + h = 0; + w = 0; + style_block = "position:absolute; left: -1000px; top: -1000px; display:none;"; + styles = ['font-size', 'font-style', 'font-weight', 'font-family', 'line-height', 'text-transform', 'letter-spacing']; + for (_i = 0, _len = styles.length; _i < _len; _i++) { + style = styles[_i]; + style_block += style + ":" + this.search_field.css(style) + ";"; + } + div = $('
        ', { + 'style': style_block + }); + div.text(this.search_field.val()); + $('body').append(div); + w = div.width() + 25; + div.remove(); + if (w > this.f_width - 10) { + w = this.f_width - 10; + } + this.search_field.css({ + 'width': w + 'px' + }); + dd_top = this.container.height(); + return this.dropdown.css({ + "top": dd_top + "px" + }); + } + }; + Chosen.prototype.generate_random_id = function() { + var string; + string = "sel" + this.generate_random_char() + this.generate_random_char() + this.generate_random_char(); + while ($("#" + string).length > 0) { + string += this.generate_random_char(); + } + return string; + }; + return Chosen; + })(); + get_side_border_padding = function(elmt) { + var side_border_padding; + return side_border_padding = elmt.outerWidth() - elmt.width(); + }; + root.get_side_border_padding = get_side_border_padding; +}).call(this); diff --git a/deployed/mod_bt_googlemaps/modules/mod_bt_googlemaps/admin/js/colorpicker/blank.gif b/deployed/mod_bt_googlemaps/modules/mod_bt_googlemaps/admin/js/colorpicker/blank.gif new file mode 100644 index 00000000..75b945d2 Binary files /dev/null and b/deployed/mod_bt_googlemaps/modules/mod_bt_googlemaps/admin/js/colorpicker/blank.gif differ diff --git a/deployed/mod_bt_googlemaps/modules/mod_bt_googlemaps/admin/js/colorpicker/colorpicker.css b/deployed/mod_bt_googlemaps/modules/mod_bt_googlemaps/admin/js/colorpicker/colorpicker.css new file mode 100644 index 00000000..371ac63b --- /dev/null +++ b/deployed/mod_bt_googlemaps/modules/mod_bt_googlemaps/admin/js/colorpicker/colorpicker.css @@ -0,0 +1,162 @@ +.colorpicker { + width: 356px; + height: 176px; + overflow: hidden; + position: absolute; + background: url(colorpicker_background.png); + font-family: Arial, Helvetica, sans-serif; + display: none; +} +.colorpicker_color { + width: 150px; + height: 150px; + left: 14px; + top: 13px; + position: absolute; + background: #f00; + overflow: hidden; + cursor: crosshair; +} +.colorpicker_color div { + position: absolute; + top: 0; + left: 0; + width: 150px; + height: 150px; + background: url(colorpicker_overlay.png); +} +.colorpicker_color div div { + position: absolute; + top: 0; + left: 0; + width: 11px; + height: 11px; + overflow: hidden; + background: url(colorpicker_select.gif); + margin: -5px 0 0 -5px; +} +.colorpicker_hue { + position: absolute; + top: 13px; + left: 171px; + width: 35px; + height: 150px; + cursor: n-resize; +} +.colorpicker_hue div { + position: absolute; + width: 35px; + height: 9px; + overflow: hidden; + background: url(colorpicker_indic.gif) left top; + margin: -4px 0 0 0; + left: 0px; +} +.colorpicker_new_color { + position: absolute; + width: 60px; + height: 30px; + left: 213px; + top: 13px; + background: #f00; +} +.colorpicker_current_color { + position: absolute; + width: 60px; + height: 30px; + left: 283px; + top: 13px; + background: #f00; +} +.colorpicker input { + background-color: transparent; + border: 1px solid transparent; + position: absolute; + font-size: 10px; + font-family: Arial, Helvetica, sans-serif; + color: #898989; + top: 4px; + right: 11px; + text-align: right; + margin: 0; + padding: 0!important; + height: 11px!important; + width: 30px!important; +} +.colorpicker_hex { + position: absolute; + width: 72px; + height: 22px; + background: url(colorpicker_hex.png) top; + left: 212px; + top: 142px; +} +.colorpicker_hex input { + right: 6px; +} +.colorpicker_field { + height: 22px; + width: 62px; + background-position: top; + position: absolute; +} +.colorpicker_field span { + position: absolute; + width: 12px; + height: 22px; + overflow: hidden; + top: 0; + right: 0; + cursor: n-resize; +} +.colorpicker_rgb_r { + background-image: url(colorpicker_rgb_r.png); + top: 52px; + left: 212px; +} +.colorpicker_rgb_g { + background-image: url(colorpicker_rgb_g.png); + top: 82px; + left: 212px; +} +.colorpicker_rgb_b { + background-image: url(colorpicker_rgb_b.png); + top: 112px; + left: 212px; +} +.colorpicker_hsb_h { + background-image: url(colorpicker_hsb_h.png); + top: 52px; + left: 282px; +} +.colorpicker_hsb_s { + background-image: url(colorpicker_hsb_s.png); + top: 82px; + left: 282px; +} +.colorpicker_hsb_b { + background-image: url(colorpicker_hsb_b.png); + top: 112px; + left: 282px; +} +.colorpicker_submit { + position: absolute; + width: 22px; + height: 22px; + background: url(colorpicker_submit.png) top; + left: 322px; + top: 142px; + overflow: hidden; +} +.colorpicker_focus { + background-position: center; +} +.colorpicker_hex.colorpicker_focus { + background-position: bottom; +} +.colorpicker_submit.colorpicker_focus { + background-position: bottom; +} +.colorpicker_slider { + background-position: bottom; +} diff --git a/deployed/mod_bt_googlemaps/modules/mod_bt_googlemaps/admin/js/colorpicker/colorpicker.js b/deployed/mod_bt_googlemaps/modules/mod_bt_googlemaps/admin/js/colorpicker/colorpicker.js new file mode 100644 index 00000000..45f56ced --- /dev/null +++ b/deployed/mod_bt_googlemaps/modules/mod_bt_googlemaps/admin/js/colorpicker/colorpicker.js @@ -0,0 +1,484 @@ +/** + * + * Color picker + * Author: Stefan Petre www.eyecon.ro + * + * Dual licensed under the MIT and GPL licenses + * + */ +(function ($) { + var ColorPicker = function () { + var + ids = {}, + inAction, + charMin = 65, + visible, + tpl = '
        ', + defaults = { + eventName: 'click', + onShow: function () {}, + onBeforeShow: function(){}, + onHide: function () {}, + onChange: function () {}, + onSubmit: function () {}, + color: 'ff0000', + livePreview: true, + flat: false + }, + fillRGBFields = function (hsb, cal) { + var rgb = HSBToRGB(hsb); + $(cal).data('colorpicker').fields + .eq(1).val(rgb.r).end() + .eq(2).val(rgb.g).end() + .eq(3).val(rgb.b).end(); + }, + fillHSBFields = function (hsb, cal) { + $(cal).data('colorpicker').fields + .eq(4).val(hsb.h).end() + .eq(5).val(hsb.s).end() + .eq(6).val(hsb.b).end(); + }, + fillHexFields = function (hsb, cal) { + $(cal).data('colorpicker').fields + .eq(0).val(HSBToHex(hsb)).end(); + }, + setSelector = function (hsb, cal) { + $(cal).data('colorpicker').selector.css('backgroundColor', '#' + HSBToHex({h: hsb.h, s: 100, b: 100})); + $(cal).data('colorpicker').selectorIndic.css({ + left: parseInt(150 * hsb.s/100, 10), + top: parseInt(150 * (100-hsb.b)/100, 10) + }); + }, + setHue = function (hsb, cal) { + $(cal).data('colorpicker').hue.css('top', parseInt(150 - 150 * hsb.h/360, 10)); + }, + setCurrentColor = function (hsb, cal) { + $(cal).data('colorpicker').currentColor.css('backgroundColor', '#' + HSBToHex(hsb)); + }, + setNewColor = function (hsb, cal) { + $(cal).data('colorpicker').newColor.css('backgroundColor', '#' + HSBToHex(hsb)); + }, + keyDown = function (ev) { + var pressedKey = ev.charCode || ev.keyCode || -1; + if ((pressedKey > charMin && pressedKey <= 90) || pressedKey == 32) { + return false; + } + var cal = $(this).parent().parent(); + if (cal.data('colorpicker').livePreview === true) { + change.apply(this); + } + }, + change = function (ev) { + var cal = $(this).parent().parent(), col; + if (this.parentNode.className.indexOf('_hex') > 0) { + cal.data('colorpicker').color = col = HexToHSB(fixHex(this.value)); + } else if (this.parentNode.className.indexOf('_hsb') > 0) { + cal.data('colorpicker').color = col = fixHSB({ + h: parseInt(cal.data('colorpicker').fields.eq(4).val(), 10), + s: parseInt(cal.data('colorpicker').fields.eq(5).val(), 10), + b: parseInt(cal.data('colorpicker').fields.eq(6).val(), 10) + }); + } else { + cal.data('colorpicker').color = col = RGBToHSB(fixRGB({ + r: parseInt(cal.data('colorpicker').fields.eq(1).val(), 10), + g: parseInt(cal.data('colorpicker').fields.eq(2).val(), 10), + b: parseInt(cal.data('colorpicker').fields.eq(3).val(), 10) + })); + } + if (ev) { + fillRGBFields(col, cal.get(0)); + fillHexFields(col, cal.get(0)); + fillHSBFields(col, cal.get(0)); + } + setSelector(col, cal.get(0)); + setHue(col, cal.get(0)); + setNewColor(col, cal.get(0)); + cal.data('colorpicker').onChange.apply(cal, [col, HSBToHex(col), HSBToRGB(col)]); + }, + blur = function (ev) { + var cal = $(this).parent().parent(); + cal.data('colorpicker').fields.parent().removeClass('colorpicker_focus'); + }, + focus = function () { + charMin = this.parentNode.className.indexOf('_hex') > 0 ? 70 : 65; + $(this).parent().parent().data('colorpicker').fields.parent().removeClass('colorpicker_focus'); + $(this).parent().addClass('colorpicker_focus'); + }, + downIncrement = function (ev) { + var field = $(this).parent().find('input').focus(); + var current = { + el: $(this).parent().addClass('colorpicker_slider'), + max: this.parentNode.className.indexOf('_hsb_h') > 0 ? 360 : (this.parentNode.className.indexOf('_hsb') > 0 ? 100 : 255), + y: ev.pageY, + field: field, + val: parseInt(field.val(), 10), + preview: $(this).parent().parent().data('colorpicker').livePreview + }; + $(document).bind('mouseup', current, upIncrement); + $(document).bind('mousemove', current, moveIncrement); + }, + moveIncrement = function (ev) { + ev.data.field.val(Math.max(0, Math.min(ev.data.max, parseInt(ev.data.val + ev.pageY - ev.data.y, 10)))); + if (ev.data.preview) { + change.apply(ev.data.field.get(0), [true]); + } + return false; + }, + upIncrement = function (ev) { + change.apply(ev.data.field.get(0), [true]); + ev.data.el.removeClass('colorpicker_slider').find('input').focus(); + $(document).unbind('mouseup', upIncrement); + $(document).unbind('mousemove', moveIncrement); + return false; + }, + downHue = function (ev) { + var current = { + cal: $(this).parent(), + y: $(this).offset().top + }; + current.preview = current.cal.data('colorpicker').livePreview; + $(document).bind('mouseup', current, upHue); + $(document).bind('mousemove', current, moveHue); + }, + moveHue = function (ev) { + change.apply( + ev.data.cal.data('colorpicker') + .fields + .eq(4) + .val(parseInt(360*(150 - Math.max(0,Math.min(150,(ev.pageY - ev.data.y))))/150, 10)) + .get(0), + [ev.data.preview] + ); + return false; + }, + upHue = function (ev) { + fillRGBFields(ev.data.cal.data('colorpicker').color, ev.data.cal.get(0)); + fillHexFields(ev.data.cal.data('colorpicker').color, ev.data.cal.get(0)); + $(document).unbind('mouseup', upHue); + $(document).unbind('mousemove', moveHue); + return false; + }, + downSelector = function (ev) { + var current = { + cal: $(this).parent(), + pos: $(this).offset() + }; + current.preview = current.cal.data('colorpicker').livePreview; + $(document).bind('mouseup', current, upSelector); + $(document).bind('mousemove', current, moveSelector); + }, + moveSelector = function (ev) { + change.apply( + ev.data.cal.data('colorpicker') + .fields + .eq(6) + .val(parseInt(100*(150 - Math.max(0,Math.min(150,(ev.pageY - ev.data.pos.top))))/150, 10)) + .end() + .eq(5) + .val(parseInt(100*(Math.max(0,Math.min(150,(ev.pageX - ev.data.pos.left))))/150, 10)) + .get(0), + [ev.data.preview] + ); + return false; + }, + upSelector = function (ev) { + fillRGBFields(ev.data.cal.data('colorpicker').color, ev.data.cal.get(0)); + fillHexFields(ev.data.cal.data('colorpicker').color, ev.data.cal.get(0)); + $(document).unbind('mouseup', upSelector); + $(document).unbind('mousemove', moveSelector); + return false; + }, + enterSubmit = function (ev) { + $(this).addClass('colorpicker_focus'); + }, + leaveSubmit = function (ev) { + $(this).removeClass('colorpicker_focus'); + }, + clickSubmit = function (ev) { + var cal = $(this).parent(); + var col = cal.data('colorpicker').color; + cal.data('colorpicker').origColor = col; + setCurrentColor(col, cal.get(0)); + cal.data('colorpicker').onSubmit(col, HSBToHex(col), HSBToRGB(col), cal.data('colorpicker').el); + }, + show = function (ev) { + var cal = $('#' + $(this).data('colorpickerId')); + cal.data('colorpicker').onBeforeShow.apply(this, [cal.get(0)]); + var pos = $(this).offset(); + var viewPort = getViewport(); + var top = pos.top + this.offsetHeight; + var left = pos.left; + if (top + 176 > viewPort.t + viewPort.h) { + top -= this.offsetHeight + 176; + } + if (left + 356 > viewPort.l + viewPort.w) { + left -= 356; + } + cal.css({left: left + 'px', top: top + 'px'}); + if (cal.data('colorpicker').onShow.apply(this, [cal.get(0)]) != false) { + cal.show(); + } + $(document).bind('mousedown', {cal: cal}, hide); + return false; + }, + hide = function (ev) { + if (!isChildOf(ev.data.cal.get(0), ev.target, ev.data.cal.get(0))) { + if (ev.data.cal.data('colorpicker').onHide.apply(this, [ev.data.cal.get(0)]) != false) { + ev.data.cal.hide(); + } + $(document).unbind('mousedown', hide); + } + }, + isChildOf = function(parentEl, el, container) { + if (parentEl == el) { + return true; + } + if (parentEl.contains) { + return parentEl.contains(el); + } + if ( parentEl.compareDocumentPosition ) { + return !!(parentEl.compareDocumentPosition(el) & 16); + } + var prEl = el.parentNode; + while(prEl && prEl != container) { + if (prEl == parentEl) + return true; + prEl = prEl.parentNode; + } + return false; + }, + getViewport = function () { + var m = document.compatMode == 'CSS1Compat'; + return { + l : window.pageXOffset || (m ? document.documentElement.scrollLeft : document.body.scrollLeft), + t : window.pageYOffset || (m ? document.documentElement.scrollTop : document.body.scrollTop), + w : window.innerWidth || (m ? document.documentElement.clientWidth : document.body.clientWidth), + h : window.innerHeight || (m ? document.documentElement.clientHeight : document.body.clientHeight) + }; + }, + fixHSB = function (hsb) { + return { + h: Math.min(360, Math.max(0, hsb.h)), + s: Math.min(100, Math.max(0, hsb.s)), + b: Math.min(100, Math.max(0, hsb.b)) + }; + }, + fixRGB = function (rgb) { + return { + r: Math.min(255, Math.max(0, rgb.r)), + g: Math.min(255, Math.max(0, rgb.g)), + b: Math.min(255, Math.max(0, rgb.b)) + }; + }, + fixHex = function (hex) { + var len = 6 - hex.length; + if (len > 0) { + var o = []; + for (var i=0; i -1) ? hex.substring(1) : hex), 16); + return {r: hex >> 16, g: (hex & 0x00FF00) >> 8, b: (hex & 0x0000FF)}; + }, + HexToHSB = function (hex) { + return RGBToHSB(HexToRGB(hex)); + }, + RGBToHSB = function (rgb) { + var hsb = { + h: 0, + s: 0, + b: 0 + }; + var min = Math.min(rgb.r, rgb.g, rgb.b); + var max = Math.max(rgb.r, rgb.g, rgb.b); + var delta = max - min; + hsb.b = max; + if (max != 0) { + + } + hsb.s = max != 0 ? 255 * delta / max : 0; + if (hsb.s != 0) { + if (rgb.r == max) { + hsb.h = (rgb.g - rgb.b) / delta; + } else if (rgb.g == max) { + hsb.h = 2 + (rgb.b - rgb.r) / delta; + } else { + hsb.h = 4 + (rgb.r - rgb.g) / delta; + } + } else { + hsb.h = -1; + } + hsb.h *= 60; + if (hsb.h < 0) { + hsb.h += 360; + } + hsb.s *= 100/255; + hsb.b *= 100/255; + return hsb; + }, + HSBToRGB = function (hsb) { + var rgb = {}; + var h = Math.round(hsb.h); + var s = Math.round(hsb.s*255/100); + var v = Math.round(hsb.b*255/100); + if(s == 0) { + rgb.r = rgb.g = rgb.b = v; + } else { + var t1 = v; + var t2 = (255-s)*v/255; + var t3 = (t1-t2)*(h%60)/60; + if(h==360) h = 0; + if(h<60) {rgb.r=t1; rgb.b=t2; rgb.g=t2+t3} + else if(h<120) {rgb.g=t1; rgb.b=t2; rgb.r=t1-t3} + else if(h<180) {rgb.g=t1; rgb.r=t2; rgb.b=t2+t3} + else if(h<240) {rgb.b=t1; rgb.r=t2; rgb.g=t1-t3} + else if(h<300) {rgb.b=t1; rgb.g=t2; rgb.r=t2+t3} + else if(h<360) {rgb.r=t1; rgb.g=t2; rgb.b=t1-t3} + else {rgb.r=0; rgb.g=0; rgb.b=0} + } + return {r:Math.round(rgb.r), g:Math.round(rgb.g), b:Math.round(rgb.b)}; + }, + RGBToHex = function (rgb) { + var hex = [ + rgb.r.toString(16), + rgb.g.toString(16), + rgb.b.toString(16) + ]; + $.each(hex, function (nr, val) { + if (val.length == 1) { + hex[nr] = '0' + val; + } + }); + return hex.join(''); + }, + HSBToHex = function (hsb) { + return RGBToHex(HSBToRGB(hsb)); + }, + restoreOriginal = function () { + var cal = $(this).parent(); + var col = cal.data('colorpicker').origColor; + cal.data('colorpicker').color = col; + fillRGBFields(col, cal.get(0)); + fillHexFields(col, cal.get(0)); + fillHSBFields(col, cal.get(0)); + setSelector(col, cal.get(0)); + setHue(col, cal.get(0)); + setNewColor(col, cal.get(0)); + }; + return { + init: function (opt) { + opt = $.extend({}, defaults, opt||{}); + if (typeof opt.color == 'string') { + opt.color = HexToHSB(opt.color); + } else if (opt.color.r != undefined && opt.color.g != undefined && opt.color.b != undefined) { + opt.color = RGBToHSB(opt.color); + } else if (opt.color.h != undefined && opt.color.s != undefined && opt.color.b != undefined) { + opt.color = fixHSB(opt.color); + } else { + return this; + } + return this.each(function () { + if (!$(this).data('colorpickerId')) { + var options = $.extend({}, opt); + options.origColor = opt.color; + var id = 'collorpicker_' + parseInt(Math.random() * 1000); + $(this).data('colorpickerId', id); + var cal = $(tpl).attr('id', id); + if (options.flat) { + cal.appendTo(this).show(); + } else { + cal.appendTo(document.body); + } + options.fields = cal + .find('input') + .bind('keyup', keyDown) + .bind('change', change) + .bind('blur', blur) + .bind('focus', focus); + cal + .find('span').bind('mousedown', downIncrement).end() + .find('>div.colorpicker_current_color').bind('click', restoreOriginal); + options.selector = cal.find('div.colorpicker_color').bind('mousedown', downSelector); + options.selectorIndic = options.selector.find('div div'); + options.el = this; + options.hue = cal.find('div.colorpicker_hue div'); + cal.find('div.colorpicker_hue').bind('mousedown', downHue); + options.newColor = cal.find('div.colorpicker_new_color'); + options.currentColor = cal.find('div.colorpicker_current_color'); + cal.data('colorpicker', options); + cal.find('div.colorpicker_submit') + .bind('mouseenter', enterSubmit) + .bind('mouseleave', leaveSubmit) + .bind('click', clickSubmit); + fillRGBFields(options.color, cal.get(0)); + fillHSBFields(options.color, cal.get(0)); + fillHexFields(options.color, cal.get(0)); + setHue(options.color, cal.get(0)); + setSelector(options.color, cal.get(0)); + setCurrentColor(options.color, cal.get(0)); + setNewColor(options.color, cal.get(0)); + if (options.flat) { + cal.css({ + position: 'relative', + display: 'block' + }); + } else { + $(this).bind(options.eventName, show); + } + } + }); + }, + showPicker: function() { + return this.each( function () { + if ($(this).data('colorpickerId')) { + show.apply(this); + } + }); + }, + hidePicker: function() { + return this.each( function () { + if ($(this).data('colorpickerId')) { + $('#' + $(this).data('colorpickerId')).hide(); + } + }); + }, + setColor: function(col) { + if (typeof col == 'string') { + col = HexToHSB(col); + } else if (col.r != undefined && col.g != undefined && col.b != undefined) { + col = RGBToHSB(col); + } else if (col.h != undefined && col.s != undefined && col.b != undefined) { + col = fixHSB(col); + } else { + return this; + } + return this.each(function(){ + if ($(this).data('colorpickerId')) { + var cal = $('#' + $(this).data('colorpickerId')); + cal.data('colorpicker').color = col; + cal.data('colorpicker').origColor = col; + fillRGBFields(col, cal.get(0)); + fillHSBFields(col, cal.get(0)); + fillHexFields(col, cal.get(0)); + setHue(col, cal.get(0)); + setSelector(col, cal.get(0)); + setCurrentColor(col, cal.get(0)); + setNewColor(col, cal.get(0)); + } + }); + } + }; + }(); + $.fn.extend({ + ColorPicker: ColorPicker.init, + ColorPickerHide: ColorPicker.hidePicker, + ColorPickerShow: ColorPicker.showPicker, + ColorPickerSetColor: ColorPicker.setColor + }); +})(jQuery) \ No newline at end of file diff --git a/deployed/mod_bt_googlemaps/modules/mod_bt_googlemaps/admin/js/colorpicker/colorpicker_background.png b/deployed/mod_bt_googlemaps/modules/mod_bt_googlemaps/admin/js/colorpicker/colorpicker_background.png new file mode 100644 index 00000000..8401572f Binary files /dev/null and b/deployed/mod_bt_googlemaps/modules/mod_bt_googlemaps/admin/js/colorpicker/colorpicker_background.png differ diff --git a/deployed/mod_bt_googlemaps/modules/mod_bt_googlemaps/admin/js/colorpicker/colorpicker_hex.png b/deployed/mod_bt_googlemaps/modules/mod_bt_googlemaps/admin/js/colorpicker/colorpicker_hex.png new file mode 100644 index 00000000..4e532d7c Binary files /dev/null and b/deployed/mod_bt_googlemaps/modules/mod_bt_googlemaps/admin/js/colorpicker/colorpicker_hex.png differ diff --git a/deployed/mod_bt_googlemaps/modules/mod_bt_googlemaps/admin/js/colorpicker/colorpicker_hsb_b.png b/deployed/mod_bt_googlemaps/modules/mod_bt_googlemaps/admin/js/colorpicker/colorpicker_hsb_b.png new file mode 100644 index 00000000..dfac595d Binary files /dev/null and b/deployed/mod_bt_googlemaps/modules/mod_bt_googlemaps/admin/js/colorpicker/colorpicker_hsb_b.png differ diff --git a/deployed/mod_bt_googlemaps/modules/mod_bt_googlemaps/admin/js/colorpicker/colorpicker_hsb_h.png b/deployed/mod_bt_googlemaps/modules/mod_bt_googlemaps/admin/js/colorpicker/colorpicker_hsb_h.png new file mode 100644 index 00000000..3977ed9f Binary files /dev/null and b/deployed/mod_bt_googlemaps/modules/mod_bt_googlemaps/admin/js/colorpicker/colorpicker_hsb_h.png differ diff --git a/deployed/mod_bt_googlemaps/modules/mod_bt_googlemaps/admin/js/colorpicker/colorpicker_hsb_s.png b/deployed/mod_bt_googlemaps/modules/mod_bt_googlemaps/admin/js/colorpicker/colorpicker_hsb_s.png new file mode 100644 index 00000000..a2a69973 Binary files /dev/null and b/deployed/mod_bt_googlemaps/modules/mod_bt_googlemaps/admin/js/colorpicker/colorpicker_hsb_s.png differ diff --git a/deployed/mod_bt_googlemaps/modules/mod_bt_googlemaps/admin/js/colorpicker/colorpicker_indic.gif b/deployed/mod_bt_googlemaps/modules/mod_bt_googlemaps/admin/js/colorpicker/colorpicker_indic.gif new file mode 100644 index 00000000..f9fa95e2 Binary files /dev/null and b/deployed/mod_bt_googlemaps/modules/mod_bt_googlemaps/admin/js/colorpicker/colorpicker_indic.gif differ diff --git a/deployed/mod_bt_googlemaps/modules/mod_bt_googlemaps/admin/js/colorpicker/colorpicker_overlay.png b/deployed/mod_bt_googlemaps/modules/mod_bt_googlemaps/admin/js/colorpicker/colorpicker_overlay.png new file mode 100644 index 00000000..561cdd9c Binary files /dev/null and b/deployed/mod_bt_googlemaps/modules/mod_bt_googlemaps/admin/js/colorpicker/colorpicker_overlay.png differ diff --git a/deployed/mod_bt_googlemaps/modules/mod_bt_googlemaps/admin/js/colorpicker/colorpicker_rgb_b.png b/deployed/mod_bt_googlemaps/modules/mod_bt_googlemaps/admin/js/colorpicker/colorpicker_rgb_b.png new file mode 100644 index 00000000..dfac595d Binary files /dev/null and b/deployed/mod_bt_googlemaps/modules/mod_bt_googlemaps/admin/js/colorpicker/colorpicker_rgb_b.png differ diff --git a/deployed/mod_bt_googlemaps/modules/mod_bt_googlemaps/admin/js/colorpicker/colorpicker_rgb_g.png b/deployed/mod_bt_googlemaps/modules/mod_bt_googlemaps/admin/js/colorpicker/colorpicker_rgb_g.png new file mode 100644 index 00000000..72b32760 Binary files /dev/null and b/deployed/mod_bt_googlemaps/modules/mod_bt_googlemaps/admin/js/colorpicker/colorpicker_rgb_g.png differ diff --git a/deployed/mod_bt_googlemaps/modules/mod_bt_googlemaps/admin/js/colorpicker/colorpicker_rgb_r.png b/deployed/mod_bt_googlemaps/modules/mod_bt_googlemaps/admin/js/colorpicker/colorpicker_rgb_r.png new file mode 100644 index 00000000..4855fe03 Binary files /dev/null and b/deployed/mod_bt_googlemaps/modules/mod_bt_googlemaps/admin/js/colorpicker/colorpicker_rgb_r.png differ diff --git a/deployed/mod_bt_googlemaps/modules/mod_bt_googlemaps/admin/js/colorpicker/colorpicker_select.gif b/deployed/mod_bt_googlemaps/modules/mod_bt_googlemaps/admin/js/colorpicker/colorpicker_select.gif new file mode 100644 index 00000000..599f7f13 Binary files /dev/null and b/deployed/mod_bt_googlemaps/modules/mod_bt_googlemaps/admin/js/colorpicker/colorpicker_select.gif differ diff --git a/deployed/mod_bt_googlemaps/modules/mod_bt_googlemaps/admin/js/colorpicker/colorpicker_submit.png b/deployed/mod_bt_googlemaps/modules/mod_bt_googlemaps/admin/js/colorpicker/colorpicker_submit.png new file mode 100644 index 00000000..7f4c0825 Binary files /dev/null and b/deployed/mod_bt_googlemaps/modules/mod_bt_googlemaps/admin/js/colorpicker/colorpicker_submit.png differ diff --git a/deployed/mod_bt_googlemaps/modules/mod_bt_googlemaps/admin/js/colorpicker/custom_background.png b/deployed/mod_bt_googlemaps/modules/mod_bt_googlemaps/admin/js/colorpicker/custom_background.png new file mode 100644 index 00000000..cf55ffdd Binary files /dev/null and b/deployed/mod_bt_googlemaps/modules/mod_bt_googlemaps/admin/js/colorpicker/custom_background.png differ diff --git a/deployed/mod_bt_googlemaps/modules/mod_bt_googlemaps/admin/js/colorpicker/custom_hex.png b/deployed/mod_bt_googlemaps/modules/mod_bt_googlemaps/admin/js/colorpicker/custom_hex.png new file mode 100644 index 00000000..888f4444 Binary files /dev/null and b/deployed/mod_bt_googlemaps/modules/mod_bt_googlemaps/admin/js/colorpicker/custom_hex.png differ diff --git a/deployed/mod_bt_googlemaps/modules/mod_bt_googlemaps/admin/js/colorpicker/custom_hsb_b.png b/deployed/mod_bt_googlemaps/modules/mod_bt_googlemaps/admin/js/colorpicker/custom_hsb_b.png new file mode 100644 index 00000000..2f99dae8 Binary files /dev/null and b/deployed/mod_bt_googlemaps/modules/mod_bt_googlemaps/admin/js/colorpicker/custom_hsb_b.png differ diff --git a/deployed/mod_bt_googlemaps/modules/mod_bt_googlemaps/admin/js/colorpicker/custom_hsb_h.png b/deployed/mod_bt_googlemaps/modules/mod_bt_googlemaps/admin/js/colorpicker/custom_hsb_h.png new file mode 100644 index 00000000..a217e921 Binary files /dev/null and b/deployed/mod_bt_googlemaps/modules/mod_bt_googlemaps/admin/js/colorpicker/custom_hsb_h.png differ diff --git a/deployed/mod_bt_googlemaps/modules/mod_bt_googlemaps/admin/js/colorpicker/custom_hsb_s.png b/deployed/mod_bt_googlemaps/modules/mod_bt_googlemaps/admin/js/colorpicker/custom_hsb_s.png new file mode 100644 index 00000000..7826b415 Binary files /dev/null and b/deployed/mod_bt_googlemaps/modules/mod_bt_googlemaps/admin/js/colorpicker/custom_hsb_s.png differ diff --git a/deployed/mod_bt_googlemaps/modules/mod_bt_googlemaps/admin/js/colorpicker/custom_indic.gif b/deployed/mod_bt_googlemaps/modules/mod_bt_googlemaps/admin/js/colorpicker/custom_indic.gif new file mode 100644 index 00000000..222fb94c Binary files /dev/null and b/deployed/mod_bt_googlemaps/modules/mod_bt_googlemaps/admin/js/colorpicker/custom_indic.gif differ diff --git a/deployed/mod_bt_googlemaps/modules/mod_bt_googlemaps/admin/js/colorpicker/custom_rgb_b.png b/deployed/mod_bt_googlemaps/modules/mod_bt_googlemaps/admin/js/colorpicker/custom_rgb_b.png new file mode 100644 index 00000000..80764e5d Binary files /dev/null and b/deployed/mod_bt_googlemaps/modules/mod_bt_googlemaps/admin/js/colorpicker/custom_rgb_b.png differ diff --git a/deployed/mod_bt_googlemaps/modules/mod_bt_googlemaps/admin/js/colorpicker/custom_rgb_g.png b/deployed/mod_bt_googlemaps/modules/mod_bt_googlemaps/admin/js/colorpicker/custom_rgb_g.png new file mode 100644 index 00000000..fc9778be Binary files /dev/null and b/deployed/mod_bt_googlemaps/modules/mod_bt_googlemaps/admin/js/colorpicker/custom_rgb_g.png differ diff --git a/deployed/mod_bt_googlemaps/modules/mod_bt_googlemaps/admin/js/colorpicker/custom_rgb_r.png b/deployed/mod_bt_googlemaps/modules/mod_bt_googlemaps/admin/js/colorpicker/custom_rgb_r.png new file mode 100644 index 00000000..91b0cd4c Binary files /dev/null and b/deployed/mod_bt_googlemaps/modules/mod_bt_googlemaps/admin/js/colorpicker/custom_rgb_r.png differ diff --git a/deployed/mod_bt_googlemaps/modules/mod_bt_googlemaps/admin/js/colorpicker/custom_submit.png b/deployed/mod_bt_googlemaps/modules/mod_bt_googlemaps/admin/js/colorpicker/custom_submit.png new file mode 100644 index 00000000..cd202cd9 Binary files /dev/null and b/deployed/mod_bt_googlemaps/modules/mod_bt_googlemaps/admin/js/colorpicker/custom_submit.png differ diff --git a/deployed/mod_bt_googlemaps/modules/mod_bt_googlemaps/admin/js/colorpicker/index.html b/deployed/mod_bt_googlemaps/modules/mod_bt_googlemaps/admin/js/colorpicker/index.html new file mode 100644 index 00000000..fa6d84e8 --- /dev/null +++ b/deployed/mod_bt_googlemaps/modules/mod_bt_googlemaps/admin/js/colorpicker/index.html @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/deployed/mod_bt_googlemaps/modules/mod_bt_googlemaps/admin/js/colorpicker/select.png b/deployed/mod_bt_googlemaps/modules/mod_bt_googlemaps/admin/js/colorpicker/select.png new file mode 100644 index 00000000..21213bfd Binary files /dev/null and b/deployed/mod_bt_googlemaps/modules/mod_bt_googlemaps/admin/js/colorpicker/select.png differ diff --git a/deployed/mod_bt_googlemaps/modules/mod_bt_googlemaps/admin/js/colorpicker/select2.png b/deployed/mod_bt_googlemaps/modules/mod_bt_googlemaps/admin/js/colorpicker/select2.png new file mode 100644 index 00000000..2cd2cabe Binary files /dev/null and b/deployed/mod_bt_googlemaps/modules/mod_bt_googlemaps/admin/js/colorpicker/select2.png differ diff --git a/deployed/mod_bt_googlemaps/modules/mod_bt_googlemaps/admin/js/colorpicker/slider.png b/deployed/mod_bt_googlemaps/modules/mod_bt_googlemaps/admin/js/colorpicker/slider.png new file mode 100644 index 00000000..8b03da96 Binary files /dev/null and b/deployed/mod_bt_googlemaps/modules/mod_bt_googlemaps/admin/js/colorpicker/slider.png differ diff --git a/deployed/mod_bt_googlemaps/modules/mod_bt_googlemaps/admin/js/index.html b/deployed/mod_bt_googlemaps/modules/mod_bt_googlemaps/admin/js/index.html new file mode 100644 index 00000000..fa6d84e8 --- /dev/null +++ b/deployed/mod_bt_googlemaps/modules/mod_bt_googlemaps/admin/js/index.html @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/deployed/mod_bt_googlemaps/modules/mod_bt_googlemaps/admin/js/jquery.min.js b/deployed/mod_bt_googlemaps/modules/mod_bt_googlemaps/admin/js/jquery.min.js new file mode 100644 index 00000000..3684c36b --- /dev/null +++ b/deployed/mod_bt_googlemaps/modules/mod_bt_googlemaps/admin/js/jquery.min.js @@ -0,0 +1,4 @@ +/*! jQuery v1.6.4 http://jquery.com/ | http://jquery.org/license */ +(function(a,b){function cu(a){return f.isWindow(a)?a:a.nodeType===9?a.defaultView||a.parentWindow:!1}function cr(a){if(!cg[a]){var b=c.body,d=f("<"+a+">").appendTo(b),e=d.css("display");d.remove();if(e==="none"||e===""){ch||(ch=c.createElement("iframe"),ch.frameBorder=ch.width=ch.height=0),b.appendChild(ch);if(!ci||!ch.createElement)ci=(ch.contentWindow||ch.contentDocument).document,ci.write((c.compatMode==="CSS1Compat"?"":"")+""),ci.close();d=ci.createElement(a),ci.body.appendChild(d),e=f.css(d,"display"),b.removeChild(ch)}cg[a]=e}return cg[a]}function cq(a,b){var c={};f.each(cm.concat.apply([],cm.slice(0,b)),function(){c[this]=a});return c}function cp(){cn=b}function co(){setTimeout(cp,0);return cn=f.now()}function cf(){try{return new a.ActiveXObject("Microsoft.XMLHTTP")}catch(b){}}function ce(){try{return new a.XMLHttpRequest}catch(b){}}function b$(a,c){a.dataFilter&&(c=a.dataFilter(c,a.dataType));var d=a.dataTypes,e={},g,h,i=d.length,j,k=d[0],l,m,n,o,p;for(g=1;g0){c!=="border"&&f.each(e,function(){c||(d-=parseFloat(f.css(a,"padding"+this))||0),c==="margin"?d+=parseFloat(f.css(a,c+this))||0:d-=parseFloat(f.css(a,"border"+this+"Width"))||0});return d+"px"}d=bv(a,b,b);if(d<0||d==null)d=a.style[b]||0;d=parseFloat(d)||0,c&&f.each(e,function(){d+=parseFloat(f.css(a,"padding"+this))||0,c!=="padding"&&(d+=parseFloat(f.css(a,"border"+this+"Width"))||0),c==="margin"&&(d+=parseFloat(f.css(a,c+this))||0)});return d+"px"}function bl(a,b){b.src?f.ajax({url:b.src,async:!1,dataType:"script"}):f.globalEval((b.text||b.textContent||b.innerHTML||"").replace(bd,"/*$0*/")),b.parentNode&&b.parentNode.removeChild(b)}function bk(a){f.nodeName(a,"input")?bj(a):"getElementsByTagName"in a&&f.grep(a.getElementsByTagName("input"),bj)}function bj(a){if(a.type==="checkbox"||a.type==="radio")a.defaultChecked=a.checked}function bi(a){return"getElementsByTagName"in a?a.getElementsByTagName("*"):"querySelectorAll"in a?a.querySelectorAll("*"):[]}function bh(a,b){var c;if(b.nodeType===1){b.clearAttributes&&b.clearAttributes(),b.mergeAttributes&&b.mergeAttributes(a),c=b.nodeName.toLowerCase();if(c==="object")b.outerHTML=a.outerHTML;else if(c!=="input"||a.type!=="checkbox"&&a.type!=="radio"){if(c==="option")b.selected=a.defaultSelected;else if(c==="input"||c==="textarea")b.defaultValue=a.defaultValue}else a.checked&&(b.defaultChecked=b.checked=a.checked),b.value!==a.value&&(b.value=a.value);b.removeAttribute(f.expando)}}function bg(a,b){if(b.nodeType===1&&!!f.hasData(a)){var c=f.expando,d=f.data(a),e=f.data(b,d);if(d=d[c]){var g=d.events;e=e[c]=f.extend({},d);if(g){delete e.handle,e.events={};for(var h in g)for(var i=0,j=g[h].length;i=0===c})}function U(a){return!a||!a.parentNode||a.parentNode.nodeType===11}function M(a,b){return(a&&a!=="*"?a+".":"")+b.replace(y,"`").replace(z,"&")}function L(a){var b,c,d,e,g,h,i,j,k,l,m,n,o,p=[],q=[],r=f._data(this,"events");if(!(a.liveFired===this||!r||!r.live||a.target.disabled||a.button&&a.type==="click")){a.namespace&&(n=new RegExp("(^|\\.)"+a.namespace.split(".").join("\\.(?:.*\\.)?")+"(\\.|$)")),a.liveFired=this;var s=r.live.slice(0);for(i=0;ic)break;a.currentTarget=e.elem,a.data=e.handleObj.data,a.handleObj=e.handleObj,o=e.handleObj.origHandler.apply(e.elem,arguments);if(o===!1||a.isPropagationStopped()){c=e.level,o===!1&&(b=!1);if(a.isImmediatePropagationStopped())break}}return b}}function J(a,c,d){var e=f.extend({},d[0]);e.type=a,e.originalEvent={},e.liveFired=b,f.event.handle.call(c,e),e.isDefaultPrevented()&&d[0].preventDefault()}function D(){return!0}function C(){return!1}function m(a,c,d){var e=c+"defer",g=c+"queue",h=c+"mark",i=f.data(a,e,b,!0);i&&(d==="queue"||!f.data(a,g,b,!0))&&(d==="mark"||!f.data(a,h,b,!0))&&setTimeout(function(){!f.data(a,g,b,!0)&&!f.data(a,h,b,!0)&&(f.removeData(a,e,!0),i.resolve())},0)}function l(a){for(var b in a)if(b!=="toJSON")return!1;return!0}function k(a,c,d){if(d===b&&a.nodeType===1){var e="data-"+c.replace(j,"-$1").toLowerCase();d=a.getAttribute(e);if(typeof d=="string"){try{d=d==="true"?!0:d==="false"?!1:d==="null"?null:f.isNaN(d)?i.test(d)?f.parseJSON(d):d:parseFloat(d)}catch(g){}f.data(a,c,d)}else d=b}return d}var c=a.document,d=a.navigator,e=a.location,f=function(){function K(){if(!e.isReady){try{c.documentElement.doScroll("left")}catch(a){setTimeout(K,1);return}e.ready()}}var e=function(a,b){return new e.fn.init(a,b,h)},f=a.jQuery,g=a.$,h,i=/^(?:[^#<]*(<[\w\W]+>)[^>]*$|#([\w\-]*)$)/,j=/\S/,k=/^\s+/,l=/\s+$/,m=/\d/,n=/^<(\w+)\s*\/?>(?:<\/\1>)?$/,o=/^[\],:{}\s]*$/,p=/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,q=/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,r=/(?:^|:|,)(?:\s*\[)+/g,s=/(webkit)[ \/]([\w.]+)/,t=/(opera)(?:.*version)?[ \/]([\w.]+)/,u=/(msie) ([\w.]+)/,v=/(mozilla)(?:.*? rv:([\w.]+))?/,w=/-([a-z]|[0-9])/ig,x=/^-ms-/,y=function(a,b){return(b+"").toUpperCase()},z=d.userAgent,A,B,C,D=Object.prototype.toString,E=Object.prototype.hasOwnProperty,F=Array.prototype.push,G=Array.prototype.slice,H=String.prototype.trim,I=Array.prototype.indexOf,J={};e.fn=e.prototype={constructor:e,init:function(a,d,f){var g,h,j,k;if(!a)return this;if(a.nodeType){this.context=this[0]=a,this.length=1;return this}if(a==="body"&&!d&&c.body){this.context=c,this[0]=c.body,this.selector=a,this.length=1;return this}if(typeof a=="string"){a.charAt(0)!=="<"||a.charAt(a.length-1)!==">"||a.length<3?g=i.exec(a):g=[null,a,null];if(g&&(g[1]||!d)){if(g[1]){d=d instanceof e?d[0]:d,k=d?d.ownerDocument||d:c,j=n.exec(a),j?e.isPlainObject(d)?(a=[c.createElement(j[1])],e.fn.attr.call(a,d,!0)):a=[k.createElement(j[1])]:(j=e.buildFragment([g[1]],[k]),a=(j.cacheable?e.clone(j.fragment):j.fragment).childNodes);return e.merge(this,a)}h=c.getElementById(g[2]);if(h&&h.parentNode){if(h.id!==g[2])return f.find(a);this.length=1,this[0]=h}this.context=c,this.selector=a;return this}return!d||d.jquery?(d||f).find(a):this.constructor(d).find(a)}if(e.isFunction(a))return f.ready(a);a.selector!==b&&(this.selector=a.selector,this.context=a.context);return e.makeArray(a,this)},selector:"",jquery:"1.6.4",length:0,size:function(){return this.length},toArray:function(){return G.call(this,0)},get:function(a){return a==null?this.toArray():a<0?this[this.length+a]:this[a]},pushStack:function(a,b,c){var d=this.constructor();e.isArray(a)?F.apply(d,a):e.merge(d,a),d.prevObject=this,d.context=this.context,b==="find"?d.selector=this.selector+(this.selector?" ":"")+c:b&&(d.selector=this.selector+"."+b+"("+c+")");return d},each:function(a,b){return e.each(this,a,b)},ready:function(a){e.bindReady(),B.done(a);return this},eq:function(a){return a===-1?this.slice(a):this.slice(a,+a+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},slice:function(){return this.pushStack(G.apply(this,arguments),"slice",G.call(arguments).join(","))},map:function(a){return this.pushStack(e.map(this,function(b,c){return a.call(b,c,b)}))},end:function(){return this.prevObject||this.constructor(null)},push:F,sort:[].sort,splice:[].splice},e.fn.init.prototype=e.fn,e.extend=e.fn.extend=function(){var a,c,d,f,g,h,i=arguments[0]||{},j=1,k=arguments.length,l=!1;typeof i=="boolean"&&(l=i,i=arguments[1]||{},j=2),typeof i!="object"&&!e.isFunction(i)&&(i={}),k===j&&(i=this,--j);for(;j0)return;B.resolveWith(c,[e]),e.fn.trigger&&e(c).trigger("ready").unbind("ready")}},bindReady:function(){if(!B){B=e._Deferred();if(c.readyState==="complete")return setTimeout(e.ready,1);if(c.addEventListener)c.addEventListener("DOMContentLoaded",C,!1),a.addEventListener("load",e.ready,!1);else if(c.attachEvent){c.attachEvent("onreadystatechange",C),a.attachEvent("onload",e.ready);var b=!1;try{b=a.frameElement==null}catch(d){}c.documentElement.doScroll&&b&&K()}}},isFunction:function(a){return e.type(a)==="function"},isArray:Array.isArray||function(a){return e.type(a)==="array"},isWindow:function(a){return a&&typeof a=="object"&&"setInterval"in a},isNaN:function(a){return a==null||!m.test(a)||isNaN(a)},type:function(a){return a==null?String(a):J[D.call(a)]||"object"},isPlainObject:function(a){if(!a||e.type(a)!=="object"||a.nodeType||e.isWindow(a))return!1;try{if(a.constructor&&!E.call(a,"constructor")&&!E.call(a.constructor.prototype,"isPrototypeOf"))return!1}catch(c){return!1}var d;for(d in a);return d===b||E.call(a,d)},isEmptyObject:function(a){for(var b in a)return!1;return!0},error:function(a){throw a},parseJSON:function(b){if(typeof b!="string"||!b)return null;b=e.trim(b);if(a.JSON&&a.JSON.parse)return a.JSON.parse(b);if(o.test(b.replace(p,"@").replace(q,"]").replace(r,"")))return(new Function("return "+b))();e.error("Invalid JSON: "+b)},parseXML:function(c){var d,f;try{a.DOMParser?(f=new DOMParser,d=f.parseFromString(c,"text/xml")):(d=new ActiveXObject("Microsoft.XMLDOM"),d.async="false",d.loadXML(c))}catch(g){d=b}(!d||!d.documentElement||d.getElementsByTagName("parsererror").length)&&e.error("Invalid XML: "+c);return d},noop:function(){},globalEval:function(b){b&&j.test(b)&&(a.execScript||function(b){a.eval.call(a,b)})(b)},camelCase:function(a){return a.replace(x,"ms-").replace(w,y)},nodeName:function(a,b){return a.nodeName&&a.nodeName.toUpperCase()===b.toUpperCase()},each:function(a,c,d){var f,g=0,h=a.length,i=h===b||e.isFunction(a);if(d){if(i){for(f in a)if(c.apply(a[f],d)===!1)break}else for(;g0&&a[0]&&a[j-1]||j===0||e.isArray(a));if(k)for(;i1?h.call(arguments,0):c,--e||g.resolveWith(g,h.call(b,0))}}var b=arguments,c=0,d=b.length,e=d,g=d<=1&&a&&f.isFunction(a.promise)?a:f.Deferred();if(d>1){for(;c
        a",d=a.getElementsByTagName("*"),e=a.getElementsByTagName("a")[0];if(!d||!d.length||!e)return{};g=c.createElement("select"),h=g.appendChild(c.createElement("option")),i=a.getElementsByTagName("input")[0],k={leadingWhitespace:a.firstChild.nodeType===3,tbody:!a.getElementsByTagName("tbody").length,htmlSerialize:!!a.getElementsByTagName("link").length,style:/top/.test(e.getAttribute("style")),hrefNormalized:e.getAttribute("href")==="/a",opacity:/^0.55$/.test(e.style.opacity),cssFloat:!!e.style.cssFloat,checkOn:i.value==="on",optSelected:h.selected,getSetAttribute:a.className!=="t",submitBubbles:!0,changeBubbles:!0,focusinBubbles:!1,deleteExpando:!0,noCloneEvent:!0,inlineBlockNeedsLayout:!1,shrinkWrapBlocks:!1,reliableMarginRight:!0},i.checked=!0,k.noCloneChecked=i.cloneNode(!0).checked,g.disabled=!0,k.optDisabled=!h.disabled;try{delete a.test}catch(v){k.deleteExpando=!1}!a.addEventListener&&a.attachEvent&&a.fireEvent&&(a.attachEvent("onclick",function(){k.noCloneEvent=!1}),a.cloneNode(!0).fireEvent("onclick")),i=c.createElement("input"),i.value="t",i.setAttribute("type","radio"),k.radioValue=i.value==="t",i.setAttribute("checked","checked"),a.appendChild(i),l=c.createDocumentFragment(),l.appendChild(a.firstChild),k.checkClone=l.cloneNode(!0).cloneNode(!0).lastChild.checked,a.innerHTML="",a.style.width=a.style.paddingLeft="1px",m=c.getElementsByTagName("body")[0],o=c.createElement(m?"div":"body"),p={visibility:"hidden",width:0,height:0,border:0,margin:0,background:"none"},m&&f.extend(p,{position:"absolute",left:"-1000px",top:"-1000px"});for(t in p)o.style[t]=p[t];o.appendChild(a),n=m||b,n.insertBefore(o,n.firstChild),k.appendChecked=i.checked,k.boxModel=a.offsetWidth===2,"zoom"in a.style&&(a.style.display="inline",a.style.zoom=1,k.inlineBlockNeedsLayout=a.offsetWidth===2,a.style.display="",a.innerHTML="
        ",k.shrinkWrapBlocks=a.offsetWidth!==2),a.innerHTML="
        t
        ",q=a.getElementsByTagName("td"),u=q[0].offsetHeight===0,q[0].style.display="",q[1].style.display="none",k.reliableHiddenOffsets=u&&q[0].offsetHeight===0,a.innerHTML="",c.defaultView&&c.defaultView.getComputedStyle&&(j=c.createElement("div"),j.style.width="0",j.style.marginRight="0",a.appendChild(j),k.reliableMarginRight=(parseInt((c.defaultView.getComputedStyle(j,null)||{marginRight:0}).marginRight,10)||0)===0),o.innerHTML="",n.removeChild(o);if(a.attachEvent)for(t in{submit:1,change:1,focusin:1})s="on"+t,u=s in a,u||(a.setAttribute(s,"return;"),u=typeof a[s]=="function"),k[t+"Bubbles"]=u;o=l=g=h=m=j=a=i=null;return k}(),f.boxModel=f.support.boxModel;var i=/^(?:\{.*\}|\[.*\])$/,j=/([A-Z])/g;f.extend({cache:{},uuid:0,expando:"jQuery"+(f.fn.jquery+Math.random()).replace(/\D/g,""),noData:{embed:!0,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",applet:!0},hasData:function(a){a=a.nodeType?f.cache[a[f.expando]]:a[f.expando];return!!a&&!l(a)},data:function(a,c,d,e){if(!!f.acceptData(a)){var g,h,i=f.expando,j=typeof c=="string",k=a.nodeType,l=k?f.cache:a,m=k?a[f.expando]:a[f.expando]&&f.expando;if((!m||e&&m&&l[m]&&!l[m][i])&&j&&d===b)return;m||(k?a[f.expando]=m=++f.uuid:m=f.expando),l[m]||(l[m]={},k||(l[m].toJSON=f.noop));if(typeof c=="object"||typeof c=="function")e?l[m][i]=f.extend(l[m][i],c):l[m]=f.extend(l[m],c);g=l[m],e&&(g[i]||(g[i]={}),g=g[i]),d!==b&&(g[f.camelCase(c)]=d);if(c==="events"&&!g[c])return g[i]&&g[i].events;j?(h=g[c],h==null&&(h=g[f.camelCase(c)])):h=g;return h}},removeData:function(a,b,c){if(!!f.acceptData(a)){var d,e=f.expando,g=a.nodeType,h=g?f.cache:a,i=g?a[f.expando]:f.expando;if(!h[i])return;if(b){d=c?h[i][e]:h[i];if(d){d[b]||(b=f.camelCase(b)),delete d[b];if(!l(d))return}}if(c){delete h[i][e];if(!l(h[i]))return}var j=h[i][e];f.support.deleteExpando||!h.setInterval?delete h[i]:h[i]=null,j?(h[i]={},g||(h[i].toJSON=f.noop),h[i][e]=j):g&&(f.support.deleteExpando?delete a[f.expando]:a.removeAttribute?a.removeAttribute(f.expando):a[f.expando]=null)}},_data:function(a,b,c){return f.data(a,b,c,!0)},acceptData:function(a){if(a.nodeName){var b=f.noData[a.nodeName.toLowerCase()];if(b)return b!==!0&&a.getAttribute("classid")===b}return!0}}),f.fn.extend({data:function(a,c){var d=null;if(typeof a=="undefined"){if(this.length){d=f.data(this[0]);if(this[0].nodeType===1){var e=this[0].attributes,g;for(var h=0,i=e.length;h-1)return!0;return!1},val:function(a){var c,d,e=this[0];if(!arguments.length){if(e){c=f.valHooks[e.nodeName.toLowerCase()]||f.valHooks[e.type];if(c&&"get"in c&&(d=c.get(e,"value"))!==b)return d;d=e.value;return typeof d=="string"?d.replace(p,""):d==null?"":d}return b}var g=f.isFunction(a);return this.each(function(d){var e=f(this),h;if(this.nodeType===1){g?h=a.call(this,d,e.val()):h=a,h==null?h="":typeof h=="number"?h+="":f.isArray(h)&&(h=f.map(h,function(a){return a==null?"":a+""})),c=f.valHooks[this.nodeName.toLowerCase()]||f.valHooks[this.type];if(!c||!("set"in c)||c.set(this,h,"value")===b)this.value=h}})}}),f.extend({valHooks:{option:{get:function(a){var b=a.attributes.value;return!b||b.specified?a.value:a.text}},select:{get:function(a){var b,c=a.selectedIndex,d=[],e=a.options,g=a.type==="select-one";if(c<0)return null;for(var h=g?c:0,i=g?c+1:e.length;h=0}),c.length||(a.selectedIndex=-1);return c}}},attrFn:{val:!0,css:!0,html:!0,text:!0,data:!0,width:!0,height:!0,offset:!0},attrFix:{tabindex:"tabIndex"},attr:function(a,c,d,e){var g=a.nodeType;if(!a||g===3||g===8||g===2)return b;if(e&&c in f.attrFn)return f(a)[c](d);if(!("getAttribute"in a))return f.prop(a,c,d);var h,i,j=g!==1||!f.isXMLDoc(a);j&&(c=f.attrFix[c]||c,i=f.attrHooks[c],i||(t.test(c)?i=v:u&&(i=u)));if(d!==b){if(d===null){f.removeAttr(a,c);return b}if(i&&"set"in i&&j&&(h=i.set(a,d,c))!==b)return h;a.setAttribute(c,""+d);return d}if(i&&"get"in i&&j&&(h=i.get(a,c))!==null)return h;h=a.getAttribute(c);return h===null?b:h},removeAttr:function(a,b){var c;a.nodeType===1&&(b=f.attrFix[b]||b,f.attr(a,b,""),a.removeAttribute(b),t.test(b)&&(c=f.propFix[b]||b)in a&&(a[c]=!1))},attrHooks:{type:{set:function(a,b){if(q.test(a.nodeName)&&a.parentNode)f.error("type property can't be changed");else if(!f.support.radioValue&&b==="radio"&&f.nodeName(a,"input")){var c=a.value;a.setAttribute("type",b),c&&(a.value=c);return b}}},value:{get:function(a,b){if(u&&f.nodeName(a,"button"))return u.get(a,b);return b in a?a.value:null},set:function(a,b,c){if(u&&f.nodeName(a,"button"))return u.set(a,b,c);a.value=b}}},propFix:{tabindex:"tabIndex",readonly:"readOnly","for":"htmlFor","class":"className",maxlength:"maxLength",cellspacing:"cellSpacing",cellpadding:"cellPadding",rowspan:"rowSpan",colspan:"colSpan",usemap:"useMap",frameborder:"frameBorder",contenteditable:"contentEditable"},prop:function(a,c,d){var e=a.nodeType;if(!a||e===3||e===8||e===2)return b;var g,h,i=e!==1||!f.isXMLDoc(a);i&&(c=f.propFix[c]||c,h=f.propHooks[c]);return d!==b?h&&"set"in h&&(g=h.set(a,d,c))!==b?g:a[c]=d:h&&"get"in h&&(g=h.get(a,c))!==null?g:a[c]},propHooks:{tabIndex:{get:function(a){var c=a.getAttributeNode("tabindex");return c&&c.specified?parseInt(c.value,10):r.test(a.nodeName)||s.test(a.nodeName)&&a.href?0:b}}}}),f.attrHooks.tabIndex=f.propHooks.tabIndex,v={get:function(a,c){var d;return f.prop(a,c)===!0||(d=a.getAttributeNode(c))&&d.nodeValue!==!1?c.toLowerCase():b},set:function(a,b,c){var d;b===!1?f.removeAttr(a,c):(d=f.propFix[c]||c,d in a&&(a[d]=!0),a.setAttribute(c,c.toLowerCase()));return c}},f.support.getSetAttribute||(u=f.valHooks.button={get:function(a,c){var d;d=a.getAttributeNode(c);return d&&d.nodeValue!==""?d.nodeValue:b},set:function(a,b,d){var e=a.getAttributeNode(d);e||(e=c.createAttribute(d),a.setAttributeNode(e));return e.nodeValue=b+""}},f.each(["width","height"],function(a,b){f.attrHooks[b]=f.extend(f.attrHooks[b],{set:function(a,c){if(c===""){a.setAttribute(b,"auto");return c}}})})),f.support.hrefNormalized||f.each(["href","src","width","height"],function(a,c){f.attrHooks[c]=f.extend(f.attrHooks[c],{get:function(a){var d=a.getAttribute(c,2);return d===null?b:d}})}),f.support.style||(f.attrHooks.style={get:function(a){return a.style.cssText.toLowerCase()||b},set:function(a,b){return a.style.cssText=""+b}}),f.support.optSelected||(f.propHooks.selected=f.extend(f.propHooks.selected,{get:function(a){var b=a.parentNode;b&&(b.selectedIndex,b.parentNode&&b.parentNode.selectedIndex);return null}})),f.support.checkOn||f.each(["radio","checkbox"],function(){f.valHooks[this]={get:function(a){return a.getAttribute("value")===null?"on":a.value}}}),f.each(["radio","checkbox"],function(){f.valHooks[this]=f.extend(f.valHooks[this],{set:function(a,b){if(f.isArray(b))return a.checked=f.inArray(f(a).val(),b)>=0}})});var w=/\.(.*)$/,x=/^(?:textarea|input|select)$/i,y=/\./g,z=/ /g,A=/[^\w\s.|`]/g,B=function(a){return a.replace(A,"\\$&")};f.event={add:function(a,c,d,e){if(a.nodeType!==3&&a.nodeType!==8){if(d===!1)d=C;else if(!d)return;var g,h;d.handler&&(g=d,d=g.handler),d.guid||(d.guid=f.guid++);var i=f._data(a);if(!i)return;var j=i.events,k=i.handle;j||(i.events=j={}),k||(i.handle=k=function(a){return typeof f!="undefined"&&(!a||f.event.triggered!==a.type)?f.event.handle.apply(k.elem,arguments):b}),k.elem=a,c=c.split(" ");var l,m=0,n;while(l=c[m++]){h=g?f.extend({},g):{handler:d,data:e},l.indexOf(".")>-1?(n=l.split("."),l=n.shift(),h.namespace=n.slice(0).sort().join(".")):(n=[],h.namespace=""),h.type=l,h.guid||(h.guid=d.guid);var o=j[l],p=f.event.special[l]||{};if(!o){o=j[l]=[];if(!p.setup||p.setup.call(a,e,n,k)===!1)a.addEventListener?a.addEventListener(l,k,!1):a.attachEvent&&a.attachEvent("on"+l,k)}p.add&&(p.add.call(a,h),h.handler.guid||(h.handler.guid=d.guid)),o.push(h),f.event.global[l]=!0}a=null}},global:{},remove:function(a,c,d,e){if(a.nodeType!==3&&a.nodeType!==8){d===!1&&(d=C);var g,h,i,j,k=0,l,m,n,o,p,q,r,s=f.hasData(a)&&f._data(a),t=s&&s.events;if(!s||!t)return;c&&c.type&&(d=c.handler,c=c.type);if(!c||typeof c=="string"&&c.charAt(0)==="."){c=c||"";for(h in t)f.event.remove(a,h+c);return}c=c.split(" ");while(h=c[k++]){r=h,q=null,l=h.indexOf(".")<0,m=[],l||(m=h.split("."),h=m.shift(),n=new RegExp("(^|\\.)"+f.map(m.slice(0).sort(),B).join("\\.(?:.*\\.)?")+"(\\.|$)")),p=t[h];if(!p)continue;if(!d){for(j=0;j=0&&(h=h.slice(0,-1),j=!0),h.indexOf(".")>=0&&(i=h.split("."),h=i.shift(),i.sort());if(!!e&&!f.event.customEvent[h]||!!f.event.global[h]){c=typeof c=="object"?c[f.expando]?c:new f.Event(h,c):new f.Event(h),c.type=h,c.exclusive=j,c.namespace=i.join("."),c.namespace_re=new RegExp("(^|\\.)"+i.join("\\.(?:.*\\.)?")+"(\\.|$)");if(g||!e)c.preventDefault(),c.stopPropagation();if(!e){f.each(f.cache,function(){var a=f.expando,b=this[a];b&&b.events&&b.events[h]&&f.event.trigger(c,d,b.handle.elem)});return}if(e.nodeType===3||e.nodeType===8)return;c.result=b,c.target=e,d=d!=null?f.makeArray(d):[],d.unshift(c);var k=e,l=h.indexOf(":")<0?"on"+h:"";do{var m=f._data(k,"handle");c.currentTarget=k,m&&m.apply(k,d),l&&f.acceptData(k)&&k[l]&&k[l].apply(k,d)===!1&&(c.result=!1,c.preventDefault()),k=k.parentNode||k.ownerDocument||k===c.target.ownerDocument&&a}while(k&&!c.isPropagationStopped());if(!c.isDefaultPrevented()){var n,o=f.event.special[h]||{};if((!o._default||o._default.call(e.ownerDocument,c)===!1)&&(h!=="click"||!f.nodeName(e,"a"))&&f.acceptData(e)){try{l&&e[h]&&(n=e[l],n&&(e[l]=null),f.event.triggered=h,e[h]())}catch(p){}n&&(e[l]=n),f.event.triggered=b}}return c.result}},handle:function(c){c=f.event.fix(c||a.event);var d=((f._data(this,"events")||{})[c.type]||[]).slice(0),e=!c.exclusive&&!c.namespace,g=Array.prototype.slice.call(arguments,0);g[0]=c,c.currentTarget=this;for(var h=0,i=d.length;h-1?f.map(a.options,function(a){return a.selected}).join("-"):"":f.nodeName(a,"select")&&(c=a.selectedIndex);return c},I=function(c){var d=c.target,e,g;if(!!x.test(d.nodeName)&&!d.readOnly){e=f._data(d,"_change_data"),g=H(d),(c.type!=="focusout"||d.type!=="radio")&&f._data(d,"_change_data",g);if(e===b||g===e)return;if(e!=null||g)c.type="change",c.liveFired=b,f.event.trigger(c,arguments[1],d)}};f.event.special.change={filters:{focusout:I,beforedeactivate:I,click:function(a){var b=a.target,c=f.nodeName(b,"input")?b.type:"";(c==="radio"||c==="checkbox"||f.nodeName(b,"select"))&&I.call(this,a)},keydown:function(a){var b=a.target,c=f.nodeName(b,"input")?b.type:"";(a.keyCode===13&&!f.nodeName(b,"textarea")||a.keyCode===32&&(c==="checkbox"||c==="radio")||c==="select-multiple")&&I.call(this,a)},beforeactivate:function(a){var b=a.target;f._data(b,"_change_data",H(b))}},setup:function(a,b){if(this.type==="file")return!1;for(var c in G)f.event.add(this,c+".specialChange",G[c]);return x.test(this.nodeName)},teardown:function(a){f.event.remove(this,".specialChange");return x.test(this.nodeName)}},G=f.event.special.change.filters,G.focus=G.beforeactivate}f.support.focusinBubbles||f.each({focus:"focusin",blur:"focusout"},function(a,b){function e(a){var c=f.event.fix(a);c.type=b,c.originalEvent={},f.event.trigger(c,null,c.target),c.isDefaultPrevented()&&a.preventDefault()}var d=0;f.event.special[b]={setup:function(){d++===0&&c.addEventListener(a,e,!0)},teardown:function(){--d===0&&c.removeEventListener(a,e,!0)}}}),f.each(["bind","one"],function(a,c){f.fn[c]=function(a,d,e){var g;if(typeof a=="object"){for(var h in a)this[c](h,d,a[h],e);return this}if(arguments.length===2||d===!1)e=d,d=b;c==="one"?(g=function(a){f(this).unbind(a,g);return e.apply(this,arguments)},g.guid=e.guid||f.guid++):g=e;if(a==="unload"&&c!=="one")this.one(a,d,e);else for(var i=0,j=this.length;i0?this.bind(b,a,c):this.trigger(b)},f.attrFn&&(f.attrFn[b]=!0)}),function(){function u(a,b,c,d,e,f){for(var g=0,h=d.length;g0){j=i;break}}i=i[a]}d[g]=j}}}function t(a,b,c,d,e,f){for(var g=0,h=d.length;g+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,d=0,e=Object.prototype.toString,g=!1,h=!0,i=/\\/g,j=/\W/;[0,0].sort(function(){h=!1;return 0});var k=function(b,d,f,g){f=f||[],d=d||c;var h=d;if(d.nodeType!==1&&d.nodeType!==9)return[];if(!b||typeof b!="string")return f;var i,j,n,o,q,r,s,t,u=!0,w=k.isXML(d),x=[],y=b;do{a.exec(""),i=a.exec(y);if(i){y=i[3],x.push(i[1]);if(i[2]){o=i[3];break}}}while(i);if(x.length>1&&m.exec(b))if(x.length===2&&l.relative[x[0]])j=v(x[0]+x[1],d);else{j=l.relative[x[0]]?[d]:k(x.shift(),d);while(x.length)b=x.shift(),l.relative[b]&&(b+=x.shift()),j=v(b,j)}else{!g&&x.length>1&&d.nodeType===9&&!w&&l.match.ID.test(x[0])&&!l.match.ID.test(x[x.length-1])&&(q=k.find(x.shift(),d,w),d=q.expr?k.filter(q.expr,q.set)[0]:q.set[0]);if(d){q=g?{expr:x.pop(),set:p(g)}:k.find(x.pop(),x.length===1&&(x[0]==="~"||x[0]==="+")&&d.parentNode?d.parentNode:d,w),j=q.expr?k.filter(q.expr,q.set):q.set,x.length>0?n=p(j):u=!1;while(x.length)r=x.pop(),s=r,l.relative[r]?s=x.pop():r="",s==null&&(s=d),l.relative[r](n,s,w)}else n=x=[]}n||(n=j),n||k.error(r||b);if(e.call(n)==="[object Array]")if(!u)f.push.apply(f,n);else if(d&&d.nodeType===1)for(t=0;n[t]!=null;t++)n[t]&&(n[t]===!0||n[t].nodeType===1&&k.contains(d,n[t]))&&f.push(j[t]);else for(t=0;n[t]!=null;t++)n[t]&&n[t].nodeType===1&&f.push(j[t]);else p(n,f);o&&(k(o,h,f,g),k.uniqueSort(f));return f};k.uniqueSort=function(a){if(r){g=h,a.sort(r);if(g)for(var b=1;b0},k.find=function(a,b,c){var d;if(!a)return[];for(var e=0,f=l.order.length;e":function(a,b){var c,d=typeof b=="string",e=0,f=a.length;if(d&&!j.test(b)){b=b.toLowerCase();for(;e=0)?c||d.push(h):c&&(b[g]=!1));return!1},ID:function(a){return a[1].replace(i,"")},TAG:function(a,b){return a[1].replace(i,"").toLowerCase()},CHILD:function(a){if(a[1]==="nth"){a[2]||k.error(a[0]),a[2]=a[2].replace(/^\+|\s*/g,"");var b=/(-?)(\d*)(?:n([+\-]?\d*))?/.exec(a[2]==="even"&&"2n"||a[2]==="odd"&&"2n+1"||!/\D/.test(a[2])&&"0n+"+a[2]||a[2]);a[2]=b[1]+(b[2]||1)-0,a[3]=b[3]-0}else a[2]&&k.error(a[0]);a[0]=d++;return a},ATTR:function(a,b,c,d,e,f){var g=a[1]=a[1].replace(i,"");!f&&l.attrMap[g]&&(a[1]=l.attrMap[g]),a[4]=(a[4]||a[5]||"").replace(i,""),a[2]==="~="&&(a[4]=" "+a[4]+" ");return a},PSEUDO:function(b,c,d,e,f){if(b[1]==="not")if((a.exec(b[3])||"").length>1||/^\w/.test(b[3]))b[3]=k(b[3],null,null,c);else{var g=k.filter(b[3],c,d,!0^f);d||e.push.apply(e,g);return!1}else if(l.match.POS.test(b[0])||l.match.CHILD.test(b[0]))return!0;return b},POS:function(a){a.unshift(!0);return a}},filters:{enabled:function(a){return a.disabled===!1&&a.type!=="hidden"},disabled:function(a){return a.disabled===!0},checked:function(a){return a.checked===!0},selected:function(a){a.parentNode&&a.parentNode.selectedIndex;return a.selected===!0},parent:function(a){return!!a.firstChild},empty:function(a){return!a.firstChild},has:function(a,b,c){return!!k(c[3],a).length},header:function(a){return/h\d/i.test(a.nodeName)},text:function(a){var b=a.getAttribute("type"),c=a.type;return a.nodeName.toLowerCase()==="input"&&"text"===c&&(b===c||b===null)},radio:function(a){return a.nodeName.toLowerCase()==="input"&&"radio"===a.type},checkbox:function(a){return a.nodeName.toLowerCase()==="input"&&"checkbox"===a.type},file:function(a){return a.nodeName.toLowerCase()==="input"&&"file"===a.type},password:function(a){return a.nodeName.toLowerCase()==="input"&&"password"===a.type},submit:function(a){var b=a.nodeName.toLowerCase();return(b==="input"||b==="button")&&"submit"===a.type},image:function(a){return a.nodeName.toLowerCase()==="input"&&"image"===a.type},reset:function(a){var b=a.nodeName.toLowerCase();return(b==="input"||b==="button")&&"reset"===a.type},button:function(a){var b=a.nodeName.toLowerCase();return b==="input"&&"button"===a.type||b==="button"},input:function(a){return/input|select|textarea|button/i.test(a.nodeName)},focus:function(a){return a===a.ownerDocument.activeElement}},setFilters:{first:function(a,b){return b===0},last:function(a,b,c,d){return b===d.length-1},even:function(a,b){return b%2===0},odd:function(a,b){return b%2===1},lt:function(a,b,c){return bc[3]-0},nth:function(a,b,c){return c[3]-0===b},eq:function(a,b,c){return c[3]-0===b}},filter:{PSEUDO:function(a,b,c,d){var e=b[1],f=l.filters[e];if(f)return f(a,c,b,d);if(e==="contains")return(a.textContent||a.innerText||k.getText([a])||"").indexOf(b[3])>=0;if(e==="not"){var g=b[3];for(var h=0,i=g.length;h=0}},ID:function(a,b){return a.nodeType===1&&a.getAttribute("id")===b},TAG:function(a,b){return b==="*"&&a.nodeType===1||a.nodeName.toLowerCase()===b},CLASS:function(a,b){return(" "+(a.className||a.getAttribute("class"))+" ").indexOf(b)>-1},ATTR:function(a,b){var c=b[1],d=l.attrHandle[c]?l.attrHandle[c](a):a[c]!=null?a[c]:a.getAttribute(c),e=d+"",f=b[2],g=b[4];return d==null?f==="!=":f==="="?e===g:f==="*="?e.indexOf(g)>=0:f==="~="?(" "+e+" ").indexOf(g)>=0:g?f==="!="?e!==g:f==="^="?e.indexOf(g)===0:f==="$="?e.substr(e.length-g.length)===g:f==="|="?e===g||e.substr(0,g.length+1)===g+"-":!1:e&&d!==!1},POS:function(a,b,c,d){var e=b[2],f=l.setFilters[e];if(f)return f(a,c,b,d)}}},m=l.match.POS,n=function(a,b){return"\\"+(b-0+1)};for(var o in l.match)l.match[o]=new RegExp(l.match[o].source+/(?![^\[]*\])(?![^\(]*\))/.source),l.leftMatch[o]=new RegExp(/(^(?:.|\r|\n)*?)/.source+l.match[o].source.replace(/\\(\d+)/g,n));var p=function(a,b){a=Array.prototype.slice.call(a,0);if(b){b.push.apply(b,a);return b}return a};try{Array.prototype.slice.call(c.documentElement.childNodes,0)[0].nodeType}catch(q){p=function(a,b){var c=0,d=b||[];if(e.call(a)==="[object Array]")Array.prototype.push.apply(d,a);else if(typeof a.length=="number")for(var f=a.length;c",e.insertBefore(a,e.firstChild),c.getElementById(d)&&(l.find.ID=function(a,c,d){if(typeof c.getElementById!="undefined"&&!d){var e=c.getElementById(a[1]);return e?e.id===a[1]||typeof e.getAttributeNode!="undefined"&&e.getAttributeNode("id").nodeValue===a[1]?[e]:b:[]}},l.filter.ID=function(a,b){var c=typeof a.getAttributeNode!="undefined"&&a.getAttributeNode("id");return a.nodeType===1&&c&&c.nodeValue===b}),e.removeChild(a),e=a=null}(),function(){var a=c.createElement("div");a.appendChild(c.createComment("")),a.getElementsByTagName("*").length>0&&(l.find.TAG=function(a,b){var c=b.getElementsByTagName(a[1]);if(a[1]==="*"){var d=[];for(var e=0;c[e];e++)c[e].nodeType===1&&d.push(c[e]);c=d}return c}),a.innerHTML="",a.firstChild&&typeof a.firstChild.getAttribute!="undefined"&&a.firstChild.getAttribute("href")!=="#"&&(l.attrHandle.href=function(a){return a.getAttribute("href",2)}),a=null}(),c.querySelectorAll&&function(){var a=k,b=c.createElement("div"),d="__sizzle__";b.innerHTML="

        ";if(!b.querySelectorAll||b.querySelectorAll(".TEST").length!==0){k=function(b,e,f,g){e=e||c;if(!g&&!k.isXML(e)){var h=/^(\w+$)|^\.([\w\-]+$)|^#([\w\-]+$)/.exec(b);if(h&&(e.nodeType===1||e.nodeType===9)){if(h[1])return p(e.getElementsByTagName(b),f);if(h[2]&&l.find.CLASS&&e.getElementsByClassName)return p(e.getElementsByClassName(h[2]),f)}if(e.nodeType===9){if(b==="body"&&e.body)return p([e.body],f);if(h&&h[3]){var i=e.getElementById(h[3]);if(!i||!i.parentNode)return p([],f);if(i.id===h[3])return p([i],f)}try{return p(e.querySelectorAll(b),f)}catch(j){}}else if(e.nodeType===1&&e.nodeName.toLowerCase()!=="object"){var m=e,n=e.getAttribute("id"),o=n||d,q=e.parentNode,r=/^\s*[+~]/.test(b);n?o=o.replace(/'/g,"\\$&"):e.setAttribute("id",o),r&&q&&(e=e.parentNode);try{if(!r||q)return p(e.querySelectorAll("[id='"+o+"'] "+b),f)}catch(s){}finally{n||m.removeAttribute("id")}}}return a(b,e,f,g)};for(var e in a)k[e]=a[e];b=null}}(),function(){var a=c.documentElement,b=a.matchesSelector||a.mozMatchesSelector||a.webkitMatchesSelector||a.msMatchesSelector;if(b){var d=!b.call(c.createElement("div"),"div"),e=!1;try{b.call(c.documentElement,"[test!='']:sizzle")}catch(f){e=!0}k.matchesSelector=function(a,c){c=c.replace(/\=\s*([^'"\]]*)\s*\]/g,"='$1']");if(!k.isXML(a))try{if(e||!l.match.PSEUDO.test(c)&&!/!=/.test(c)){var f=b.call(a,c);if(f||!d||a.document&&a.document.nodeType!==11)return f}}catch(g){}return k(c,null,null,[a]).length>0}}}(),function(){var a=c.createElement("div");a.innerHTML="
        ";if(!!a.getElementsByClassName&&a.getElementsByClassName("e").length!==0){a.lastChild.className="e";if(a.getElementsByClassName("e").length===1)return;l.order.splice(1,0,"CLASS"),l.find.CLASS=function(a,b,c){if(typeof b.getElementsByClassName!="undefined"&&!c)return b.getElementsByClassName(a[1])},a=null}}(),c.documentElement.contains?k.contains=function(a,b){return a!==b&&(a.contains?a.contains(b):!0)}:c.documentElement.compareDocumentPosition?k.contains=function(a,b){return!!(a.compareDocumentPosition(b)&16)}:k.contains=function(){return!1},k.isXML=function(a){var b=(a?a.ownerDocument||a:0).documentElement;return b?b.nodeName!=="HTML":!1};var v=function(a,b){var c,d=[],e="",f=b.nodeType?[b]:b;while(c=l.match.PSEUDO.exec(a))e+=c[0],a=a.replace(l.match.PSEUDO,"");a=l.relative[a]?a+"*":a;for(var g=0,h=f.length;g0)for(h=g;h0:this.filter(a).length>0)},closest:function(a,b){var c=[],d,e,g=this[0];if(f.isArray(a)){var h,i,j={},k=1;if(g&&a.length){for(d=0,e=a.length;d-1:f(g).is(h))&&c.push({selector:i,elem:g,level:k});g=g.parentNode,k++}}return c}var l=S.test(a)||typeof a!="string"?f(a,b||this.context):0;for(d=0,e=this.length;d-1:f.find.matchesSelector(g,a)){c.push(g);break}g=g.parentNode;if(!g||!g.ownerDocument||g===b||g.nodeType===11)break}}c=c.length>1?f.unique(c):c;return this.pushStack(c,"closest",a)},index:function(a){if(!a)return this[0]&&this[0].parentNode?this.prevAll().length:-1;if(typeof a=="string")return f.inArray(this[0],f(a));return f.inArray(a.jquery?a[0]:a,this)},add:function(a,b){var c=typeof a=="string"?f(a,b):f.makeArray(a&&a.nodeType?[a]:a),d=f.merge(this.get(),c);return this.pushStack(U(c[0])||U(d[0])?d:f.unique(d))},andSelf:function(){return this.add(this.prevObject)}}),f.each({parent:function(a){var b=a.parentNode;return b&&b.nodeType!==11?b:null},parents:function(a){return f.dir(a,"parentNode")},parentsUntil:function(a,b,c){return f.dir(a,"parentNode",c)},next:function(a){return f.nth(a,2,"nextSibling")},prev:function(a){return f.nth(a,2,"previousSibling")},nextAll:function(a){return f.dir(a,"nextSibling")},prevAll:function(a){return f.dir(a,"previousSibling")},nextUntil:function(a,b,c){return f.dir(a,"nextSibling",c)},prevUntil:function(a,b,c){return f.dir(a,"previousSibling",c)},siblings:function(a){return f.sibling(a.parentNode.firstChild,a)},children:function(a){return f.sibling(a.firstChild)},contents:function(a){return f.nodeName(a,"iframe")?a.contentDocument||a.contentWindow.document:f.makeArray(a.childNodes)}},function(a,b){f.fn[a]=function(c,d){var e=f.map(this,b,c),g=R.call(arguments);N.test(a)||(d=c),d&&typeof d=="string"&&(e=f.filter(d,e)),e=this.length>1&&!T[a]?f.unique(e):e,(this.length>1||P.test(d))&&O.test(a)&&(e=e.reverse());return this.pushStack(e,a,g.join(","))}}),f.extend({filter:function(a,b,c){c&&(a=":not("+a+")");return b.length===1?f.find.matchesSelector(b[0],a)?[b[0]]:[]:f.find.matches(a,b)},dir:function(a,c,d){var e=[],g=a[c];while(g&&g.nodeType!==9&&(d===b||g.nodeType!==1||!f(g).is(d)))g.nodeType===1&&e.push(g),g=g[c];return e},nth:function(a,b,c,d){b=b||1;var e=0;for(;a;a=a[c])if(a.nodeType===1&&++e===b)break;return a},sibling:function(a,b){var c=[];for(;a;a=a.nextSibling)a.nodeType===1&&a!==b&&c.push(a);return c}});var W=/ jQuery\d+="(?:\d+|null)"/g,X=/^\s+/,Y=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/ig,Z=/<([\w:]+)/,$=/",""],legend:[1,"
        ","
        "],thead:[1,"","
        "],tr:[2,"","
        "],td:[3,"","
        "],col:[2,"","
        "],area:[1,"",""],_default:[0,"",""]};be.optgroup=be.option,be.tbody=be.tfoot=be.colgroup=be.caption=be.thead,be.th=be.td,f.support.htmlSerialize||(be._default=[1,"div
        ","
        "]),f.fn.extend({text:function(a){if(f.isFunction(a))return this.each(function(b){var c=f(this);c.text(a.call(this,b,c.text()))});if(typeof a!="object"&&a!==b)return this.empty().append((this[0]&&this[0].ownerDocument||c).createTextNode(a));return f.text(this)},wrapAll:function(a){if(f.isFunction(a))return this.each(function(b){f(this).wrapAll(a.call(this,b))});if(this[0]){var b=f(a,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&b.insertBefore(this[0]),b.map(function(){var a=this;while(a.firstChild&&a.firstChild.nodeType===1)a=a.firstChild;return a}).append(this)}return this},wrapInner:function(a){if(f.isFunction(a))return this.each(function(b){f(this).wrapInner(a.call(this,b))});return this.each(function(){var b=f(this),c=b.contents();c.length?c.wrapAll(a):b.append(a)})},wrap:function(a){return this.each(function(){f(this).wrapAll(a)})},unwrap:function(){return this.parent().each(function(){f.nodeName(this,"body")||f(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,!0,function(a){this.nodeType===1&&this.appendChild(a)})},prepend:function(){return this.domManip(arguments,!0,function(a){this.nodeType===1&&this.insertBefore(a,this.firstChild)})},before:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this)});if(arguments.length){var a=f(arguments[0]);a.push.apply(a,this.toArray());return this.pushStack(a,"before",arguments)}},after:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this.nextSibling)});if(arguments.length){var a=this.pushStack(this,"after",arguments);a.push.apply(a,f(arguments[0]).toArray());return a}},remove:function(a,b){for(var c=0,d;(d=this[c])!=null;c++)if(!a||f.filter(a,[d]).length)!b&&d.nodeType===1&&(f.cleanData(d.getElementsByTagName("*")),f.cleanData([d])),d.parentNode&&d.parentNode.removeChild(d);return this},empty:function(){for(var a=0,b;(b=this[a])!=null;a++){b.nodeType===1&&f.cleanData(b.getElementsByTagName("*"));while(b.firstChild)b.removeChild(b.firstChild)}return this},clone:function(a,b){a=a==null?!1:a,b=b==null?a:b;return this.map(function(){return f.clone(this,a,b)})},html:function(a){if(a===b)return this[0]&&this[0].nodeType===1?this[0].innerHTML.replace(W,""):null;if(typeof a=="string"&&!ba.test(a)&&(f.support.leadingWhitespace||!X.test(a))&&!be[(Z.exec(a)||["",""])[1].toLowerCase()]){a=a.replace(Y,"<$1>");try{for(var c=0,d=this.length;c1&&l0?this.clone(!0):this).get();f(e[h])[b](j),d=d.concat(j)}return this.pushStack(d,a,e.selector)}}),f.extend({clone:function(a,b,c){var d=a.cloneNode(!0),e,g,h;if((!f.support.noCloneEvent||!f.support.noCloneChecked)&&(a.nodeType===1||a.nodeType===11)&&!f.isXMLDoc(a)){bh(a,d),e=bi(a),g=bi(d);for(h=0;e[h];++h)g[h]&&bh(e[h],g[h])}if(b){bg(a,d);if(c){e=bi(a),g=bi(d);for(h=0;e[h];++h)bg(e[h],g[h])}}e=g=null;return d},clean:function(a,b,d,e){var g;b=b||c,typeof b.createElement=="undefined"&&(b=b.ownerDocument||b[0]&&b[0].ownerDocument||c);var h=[],i;for(var j=0,k;(k=a[j])!=null;j++){typeof k=="number"&&(k+="");if(!k)continue;if(typeof k=="string")if(!_.test(k))k=b.createTextNode(k);else{k=k.replace(Y,"<$1>");var l=(Z.exec(k)||["",""])[1].toLowerCase(),m=be[l]||be._default,n=m[0],o=b.createElement("div");o.innerHTML=m[1]+k+m[2];while(n--)o=o.lastChild;if(!f.support.tbody){var p=$.test(k),q=l==="table"&&!p?o.firstChild&&o.firstChild.childNodes:m[1]===""&&!p?o.childNodes:[];for(i=q.length-1;i>=0;--i)f.nodeName(q[i],"tbody")&&!q[i].childNodes.length&&q[i].parentNode.removeChild(q[i])}!f.support.leadingWhitespace&&X.test(k)&&o.insertBefore(b.createTextNode(X.exec(k)[0]),o.firstChild),k=o.childNodes}var r;if(!f.support.appendChecked)if(k[0]&&typeof (r=k.length)=="number")for(i=0;i=0)return b+"px"}}}),f.support.opacity||(f.cssHooks.opacity={get:function(a,b){return bn.test((b&&a.currentStyle?a.currentStyle.filter:a.style.filter)||"")?parseFloat(RegExp.$1)/100+"":b?"1":""},set:function(a,b){var c=a.style,d=a.currentStyle,e=f.isNaN(b)?"":"alpha(opacity="+b*100+")",g=d&&d.filter||c.filter||"";c.zoom=1;if(b>=1&&f.trim(g.replace(bm,""))===""){c.removeAttribute("filter");if(d&&!d.filter)return}c.filter=bm.test(g)?g.replace(bm,e):g+" "+e}}),f(function(){f.support.reliableMarginRight||(f.cssHooks.marginRight={get:function(a,b){var c;f.swap(a,{display:"inline-block"},function(){b?c=bv(a,"margin-right","marginRight"):c=a.style.marginRight});return c}})}),c.defaultView&&c.defaultView.getComputedStyle&&(bw=function(a,c){var d,e,g;c=c.replace(bo,"-$1").toLowerCase();if(!(e=a.ownerDocument.defaultView))return b;if(g=e.getComputedStyle(a,null))d=g.getPropertyValue(c),d===""&&!f.contains(a.ownerDocument.documentElement,a)&&(d=f.style(a,c));return d}),c.documentElement.currentStyle&&(bx=function(a,b){var c,d=a.currentStyle&&a.currentStyle[b],e=a.runtimeStyle&&a.runtimeStyle[b],f=a.style;!bp.test(d)&&bq.test(d)&&(c=f.left,e&&(a.runtimeStyle.left=a.currentStyle.left),f.left=b==="fontSize"?"1em":d||0,d=f.pixelLeft+"px",f.left=c,e&&(a.runtimeStyle.left=e));return d===""?"auto":d}),bv=bw||bx,f.expr&&f.expr.filters&&(f.expr.filters.hidden=function(a){var b=a.offsetWidth,c=a.offsetHeight;return b===0&&c===0||!f.support.reliableHiddenOffsets&&(a.style.display||f.css(a,"display"))==="none"},f.expr.filters.visible=function(a){return!f.expr.filters.hidden(a)});var bz=/%20/g,bA=/\[\]$/,bB=/\r?\n/g,bC=/#.*$/,bD=/^(.*?):[ \t]*([^\r\n]*)\r?$/mg,bE=/^(?:color|date|datetime|datetime-local|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,bF=/^(?:about|app|app\-storage|.+\-extension|file|res|widget):$/,bG=/^(?:GET|HEAD)$/,bH=/^\/\//,bI=/\?/,bJ=/)<[^<]*)*<\/script>/gi,bK=/^(?:select|textarea)/i,bL=/\s+/,bM=/([?&])_=[^&]*/,bN=/^([\w\+\.\-]+:)(?:\/\/([^\/?#:]*)(?::(\d+))?)?/,bO=f.fn.load,bP={},bQ={},bR,bS,bT=["*/"]+["*"];try{bR=e.href}catch(bU){bR=c.createElement("a"),bR.href="",bR=bR.href}bS=bN.exec(bR.toLowerCase())||[],f.fn.extend({load:function(a,c,d){if(typeof a!="string"&&bO)return bO.apply(this,arguments);if(!this.length)return this;var e=a.indexOf(" ");if(e>=0){var g=a.slice(e,a.length);a=a.slice(0,e)}var h="GET";c&&(f.isFunction(c)?(d=c,c=b):typeof c=="object"&&(c=f.param(c,f.ajaxSettings.traditional),h="POST"));var i=this;f.ajax({url:a,type:h,dataType:"html",data:c,complete:function(a,b,c){c=a.responseText,a.isResolved()&&(a.done(function(a){c=a}),i.html(g?f("
        ").append(c.replace(bJ,"")).find(g):c)),d&&i.each(d,[c,b,a])}});return this},serialize:function(){return f.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?f.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||bK.test(this.nodeName)||bE.test(this.type))}).map(function(a,b){var c=f(this).val();return c==null?null:f.isArray(c)?f.map(c,function(a,c){return{name:b.name,value:a.replace(bB,"\r\n")}}):{name:b.name,value:c.replace(bB,"\r\n")}}).get()}}),f.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "),function(a,b){f.fn[b]=function(a){return this.bind(b,a)}}),f.each(["get","post"],function(a,c){f[c]=function(a,d,e,g){f.isFunction(d)&&(g=g||e,e=d,d=b);return f.ajax({type:c,url:a,data:d,success:e,dataType:g})}}),f.extend({getScript:function(a,c){return f.get(a,b,c,"script")},getJSON:function(a,b,c){return f.get(a,b,c,"json")},ajaxSetup:function(a,b){b?bX(a,f.ajaxSettings):(b=a,a=f.ajaxSettings),bX(a,b);return a},ajaxSettings:{url:bR,isLocal:bF.test(bS[1]),global:!0,type:"GET",contentType:"application/x-www-form-urlencoded",processData:!0,async:!0,accepts:{xml:"application/xml, text/xml",html:"text/html",text:"text/plain",json:"application/json, text/javascript","*":bT},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText"},converters:{"* text":a.String,"text html":!0,"text json":f.parseJSON,"text xml":f.parseXML},flatOptions:{context:!0,url:!0}},ajaxPrefilter:bV(bP),ajaxTransport:bV(bQ),ajax:function(a,c){function w(a,c,l,m){if(s!==2){s=2,q&&clearTimeout(q),p=b,n=m||"",v.readyState=a>0?4:0;var o,r,u,w=c,x=l?bZ(d,v,l):b,y,z;if(a>=200&&a<300||a===304){if(d.ifModified){if(y=v.getResponseHeader("Last-Modified"))f.lastModified[k]=y;if(z=v.getResponseHeader("Etag"))f.etag[k]=z}if(a===304)w="notmodified",o=!0;else try{r=b$(d,x),w="success",o=!0}catch(A){w="parsererror",u=A}}else{u=w;if(!w||a)w="error",a<0&&(a=0)}v.status=a,v.statusText=""+(c||w),o?h.resolveWith(e,[r,w,v]):h.rejectWith(e,[v,w,u]),v.statusCode(j),j=b,t&&g.trigger("ajax"+(o?"Success":"Error"),[v,d,o?r:u]),i.resolveWith(e,[v,w]),t&&(g.trigger("ajaxComplete",[v,d]),--f.active||f.event.trigger("ajaxStop"))}}typeof a=="object"&&(c=a,a=b),c=c||{};var d=f.ajaxSetup({},c),e=d.context||d,g=e!==d&&(e.nodeType||e instanceof f)?f(e):f.event,h=f.Deferred(),i=f._Deferred(),j=d.statusCode||{},k,l={},m={},n,o,p,q,r,s=0,t,u,v={readyState:0,setRequestHeader:function(a,b){if(!s){var c=a.toLowerCase();a=m[c]=m[c]||a,l[a]=b}return this},getAllResponseHeaders:function(){return s===2?n:null},getResponseHeader:function(a){var c;if(s===2){if(!o){o={};while(c=bD.exec(n))o[c[1].toLowerCase()]=c[2]}c=o[a.toLowerCase()]}return c===b?null:c},overrideMimeType:function(a){s||(d.mimeType=a);return this},abort:function(a){a=a||"abort",p&&p.abort(a),w(0,a);return this}};h.promise(v),v.success=v.done,v.error=v.fail,v.complete=i.done,v.statusCode=function(a){if(a){var b;if(s<2)for(b in a)j[b]=[j[b],a[b]];else b=a[v.status],v.then(b,b)}return this},d.url=((a||d.url)+"").replace(bC,"").replace(bH,bS[1]+"//"),d.dataTypes=f.trim(d.dataType||"*").toLowerCase().split(bL),d.crossDomain==null&&(r=bN.exec(d.url.toLowerCase()),d.crossDomain=!(!r||r[1]==bS[1]&&r[2]==bS[2]&&(r[3]||(r[1]==="http:"?80:443))==(bS[3]||(bS[1]==="http:"?80:443)))),d.data&&d.processData&&typeof d.data!="string"&&(d.data=f.param(d.data,d.traditional)),bW(bP,d,c,v);if(s===2)return!1;t=d.global,d.type=d.type.toUpperCase(),d.hasContent=!bG.test(d.type),t&&f.active++===0&&f.event.trigger("ajaxStart");if(!d.hasContent){d.data&&(d.url+=(bI.test(d.url)?"&":"?")+d.data,delete d.data),k=d.url;if(d.cache===!1){var x=f.now(),y=d.url.replace(bM,"$1_="+x);d.url=y+(y===d.url?(bI.test(d.url)?"&":"?")+"_="+x:"")}}(d.data&&d.hasContent&&d.contentType!==!1||c.contentType)&&v.setRequestHeader("Content-Type",d.contentType),d.ifModified&&(k=k||d.url,f.lastModified[k]&&v.setRequestHeader("If-Modified-Since",f.lastModified[k]),f.etag[k]&&v.setRequestHeader("If-None-Match",f.etag[k])),v.setRequestHeader("Accept",d.dataTypes[0]&&d.accepts[d.dataTypes[0]]?d.accepts[d.dataTypes[0]]+(d.dataTypes[0]!=="*"?", "+bT+"; q=0.01":""):d.accepts["*"]);for(u in d.headers)v.setRequestHeader(u,d.headers[u]);if(d.beforeSend&&(d.beforeSend.call(e,v,d)===!1||s===2)){v.abort();return!1}for(u in{success:1,error:1,complete:1})v[u](d[u]);p=bW(bQ,d,c,v);if(!p)w(-1,"No Transport");else{v.readyState=1,t&&g.trigger("ajaxSend",[v,d]),d.async&&d.timeout>0&&(q=setTimeout(function(){v.abort("timeout")},d.timeout));try{s=1,p.send(l,w)}catch(z){s<2?w(-1,z):f.error(z)}}return v},param:function(a,c){var d=[],e=function(a,b){b=f.isFunction(b)?b():b,d[d.length]=encodeURIComponent(a)+"="+encodeURIComponent(b)};c===b&&(c=f.ajaxSettings.traditional);if(f.isArray(a)||a.jquery&&!f.isPlainObject(a))f.each(a,function(){e(this.name,this.value)});else for(var g in a)bY(g,a[g],c,e);return d.join("&").replace(bz,"+")}}),f.extend({active:0,lastModified:{},etag:{}});var b_=f.now(),ca=/(\=)\?(&|$)|\?\?/i;f.ajaxSetup({jsonp:"callback",jsonpCallback:function(){return f.expando+"_"+b_++}}),f.ajaxPrefilter("json jsonp",function(b,c,d){var e=b.contentType==="application/x-www-form-urlencoded"&&typeof b.data=="string";if(b.dataTypes[0]==="jsonp"||b.jsonp!==!1&&(ca.test(b.url)||e&&ca.test(b.data))){var g,h=b.jsonpCallback=f.isFunction(b.jsonpCallback)?b.jsonpCallback():b.jsonpCallback,i=a[h],j=b.url,k=b.data,l="$1"+h+"$2";b.jsonp!==!1&&(j=j.replace(ca,l),b.url===j&&(e&&(k=k.replace(ca,l)),b.data===k&&(j+=(/\?/.test(j)?"&":"?")+b.jsonp+"="+h))),b.url=j,b.data=k,a[h]=function(a){g=[a]},d.always(function(){a[h]=i,g&&f.isFunction(i)&&a[h](g[0])}),b.converters["script json"]=function(){g||f.error(h+" was not called");return g[0]},b.dataTypes[0]="json";return"script"}}),f.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/javascript|ecmascript/},converters:{"text script":function(a){f.globalEval(a);return a}}}),f.ajaxPrefilter("script",function(a){a.cache===b&&(a.cache=!1),a.crossDomain&&(a.type="GET",a.global=!1)}),f.ajaxTransport("script",function(a){if(a.crossDomain){var d,e=c.head||c.getElementsByTagName("head")[0]||c.documentElement;return{send:function(f,g){d=c.createElement("script"),d.async="async",a.scriptCharset&&(d.charset=a.scriptCharset),d.src=a.url,d.onload=d.onreadystatechange=function(a,c){if(c||!d.readyState||/loaded|complete/.test(d.readyState))d.onload=d.onreadystatechange=null,e&&d.parentNode&&e.removeChild(d),d=b,c||g(200,"success")},e.insertBefore(d,e.firstChild)},abort:function(){d&&d.onload(0,1)}}}});var cb=a.ActiveXObject?function(){for(var a in cd)cd[a](0,1)}:!1,cc=0,cd;f.ajaxSettings.xhr=a.ActiveXObject?function(){return!this.isLocal&&ce()||cf()}:ce,function(a){f.extend(f.support,{ajax:!!a,cors:!!a&&"withCredentials"in a})}(f.ajaxSettings.xhr()),f.support.ajax&&f.ajaxTransport(function(c){if(!c.crossDomain||f.support.cors){var d;return{send:function(e,g){var h=c.xhr(),i,j;c.username?h.open(c.type,c.url,c.async,c.username,c.password):h.open(c.type,c.url,c.async);if(c.xhrFields)for(j in c.xhrFields)h[j]=c.xhrFields[j];c.mimeType&&h.overrideMimeType&&h.overrideMimeType(c.mimeType),!c.crossDomain&&!e["X-Requested-With"]&&(e["X-Requested-With"]="XMLHttpRequest");try{for(j in e)h.setRequestHeader(j,e[j])}catch(k){}h.send(c.hasContent&&c.data||null),d=function(a,e){var j,k,l,m,n;try{if(d&&(e||h.readyState===4)){d=b,i&&(h.onreadystatechange=f.noop,cb&&delete cd[i]);if(e)h.readyState!==4&&h.abort();else{j=h.status,l=h.getAllResponseHeaders(),m={},n=h.responseXML,n&&n.documentElement&&(m.xml=n),m.text=h.responseText;try{k=h.statusText}catch(o){k=""}!j&&c.isLocal&&!c.crossDomain?j=m.text?200:404:j===1223&&(j=204)}}}catch(p){e||g(-1,p)}m&&g(j,k,m,l)},!c.async||h.readyState===4?d():(i=++cc,cb&&(cd||(cd={},f(a).unload(cb)),cd[i]=d),h.onreadystatechange=d)},abort:function(){d&&d(0,1)}}}});var cg={},ch,ci,cj=/^(?:toggle|show|hide)$/,ck=/^([+\-]=)?([\d+.\-]+)([a-z%]*)$/i,cl,cm=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]],cn;f.fn.extend({show:function(a,b,c){var d,e;if(a||a===0)return this.animate(cq("show",3),a,b,c);for(var g=0,h=this.length;g=e.duration+this.startTime){this.now=this.end,this.pos=this.state=1,this.update(),e.animatedProperties[this.prop]=!0;for(g in e.animatedProperties)e.animatedProperties[g]!==!0&&(c=!1);if(c){e.overflow!=null&&!f.support.shrinkWrapBlocks&&f.each(["","X","Y"],function(a,b){d.style["overflow"+b]=e.overflow[a]}),e.hide&&f(d).hide();if(e.hide||e.show)for(var i in e.animatedProperties)f.style(d,i,e.orig[i]);e.complete.call(d)}return!1}e.duration==Infinity?this.now=b:(h=b-this.startTime,this.state=h/e.duration,this.pos=f.easing[e.animatedProperties[this.prop]](this.state,h,0,1,e.duration),this.now=this.start+(this.end-this.start)*this.pos),this.update();return!0}},f.extend(f.fx,{tick:function(){for(var a=f.timers,b=0;b
        ";f.extend(b.style,{position:"absolute",top:0,left:0,margin:0,border:0,width:"1px",height:"1px",visibility:"hidden"}),b.innerHTML=j,a.insertBefore(b,a.firstChild),d=b.firstChild,e=d.firstChild,h=d.nextSibling.firstChild.firstChild,this.doesNotAddBorder=e.offsetTop!==5,this.doesAddBorderForTableAndCells=h.offsetTop===5,e.style.position="fixed",e.style.top="20px",this.supportsFixedPosition=e.offsetTop===20||e.offsetTop===15,e.style.position=e.style.top="",d.style.overflow="hidden",d.style.position="relative",this.subtractsBorderForOverflowNotVisible=e.offsetTop===-5,this.doesNotIncludeMarginInBodyOffset=a.offsetTop!==i,a.removeChild(b),f.offset.initialize=f.noop},bodyOffset:function(a){var b=a.offsetTop,c=a.offsetLeft;f.offset.initialize(),f.offset.doesNotIncludeMarginInBodyOffset&&(b+=parseFloat(f.css(a,"marginTop"))||0,c+=parseFloat(f.css(a,"marginLeft"))||0);return{top:b,left:c}},setOffset:function(a,b,c){var d=f.css(a,"position");d==="static"&&(a.style.position="relative");var e=f(a),g=e.offset(),h=f.css(a,"top"),i=f.css(a,"left"),j=(d==="absolute"||d==="fixed")&&f.inArray("auto",[h,i])>-1,k={},l={},m,n;j?(l=e.position(),m=l.top,n=l.left):(m=parseFloat(h)||0,n=parseFloat(i)||0),f.isFunction(b)&&(b=b.call(a,c,g)),b.top!=null&&(k.top=b.top-g.top+m),b.left!=null&&(k.left=b.left-g.left+n),"using"in b?b.using.call(a,k):e.css(k)}},f.fn.extend({position:function(){if(!this[0])return null;var a=this[0],b=this.offsetParent(),c=this.offset(),d=ct.test(b[0].nodeName)?{top:0,left:0}:b.offset();c.top-=parseFloat(f.css(a,"marginTop"))||0,c.left-=parseFloat(f.css(a,"marginLeft"))||0,d.top+=parseFloat(f.css(b[0],"borderTopWidth"))||0,d.left+=parseFloat(f.css(b[0],"borderLeftWidth"))||0;return{top:c.top-d.top,left:c.left-d.left}},offsetParent:function(){return this.map(function(){var a=this.offsetParent||c.body;while(a&&!ct.test(a.nodeName)&&f.css(a,"position")==="static")a=a.offsetParent;return a})}}),f.each(["Left","Top"],function(a,c){var d="scroll"+c;f.fn[d]=function(c){var e,g;if(c===b){e=this[0];if(!e)return null;g=cu(e);return g?"pageXOffset"in g?g[a?"pageYOffset":"pageXOffset"]:f.support.boxModel&&g.document.documentElement[d]||g.document.body[d]:e[d]}return this.each(function(){g=cu(this),g?g.scrollTo(a?f(g).scrollLeft():c,a?c:f(g).scrollTop()):this[d]=c})}}),f.each(["Height","Width"],function(a,c){var d=c.toLowerCase();f.fn["inner"+c]=function(){var a=this[0];return a&&a.style?parseFloat(f.css(a,d,"padding")):null},f.fn["outer"+c]=function(a){var b=this[0];return b&&b.style?parseFloat(f.css(b,d,a?"margin":"border")):null},f.fn[d]=function(a){var e=this[0];if(!e)return a==null?null:this;if(f.isFunction(a))return this.each(function(b){var c=f(this);c[d](a.call(this,b,c[d]()))});if(f.isWindow(e)){var g=e.document.documentElement["client"+c],h=e.document.body;return e.document.compatMode==="CSS1Compat"&&g||h&&h["client"+c]||g}if(e.nodeType===9)return Math.max(e.documentElement["client"+c],e.body["scroll"+c],e.documentElement["scroll"+c],e.body["offset"+c],e.documentElement["offset"+c]);if(a===b){var i=f.css(e,d),j=parseFloat(i);return f.isNaN(j)?i:j}return this.css(d,typeof a=="string"?a:a+"px")}}),a.jQuery=a.$=f})(window); \ No newline at end of file diff --git a/deployed/mod_bt_googlemaps/modules/mod_bt_googlemaps/helper.php b/deployed/mod_bt_googlemaps/modules/mod_bt_googlemaps/helper.php new file mode 100644 index 00000000..9dccd92d --- /dev/null +++ b/deployed/mod_bt_googlemaps/modules/mod_bt_googlemaps/helper.php @@ -0,0 +1,56 @@ +getTemplate(); + + $language = JFactory::getLanguage(); + if($params->get('enable_map_api',1)){ + $mapApi= '//maps.google.com/maps/api/js?language='.$language->getTag(); + if($params->get('map_api')){ + $mapApi .= '&key='.$params->get('map_api'); + } + $document->addScript($mapApi); + } + + $document->addScript(JURI::root().'modules/mod_bt_googlemaps/tmpl/js/btbase64.min.js'); + if($params->get('enable-custom-infobox')){ + $document->addScript(JURI::root().'modules/mod_bt_googlemaps/tmpl/js/infobox.js'); + } + if(file_exists(JPATH_BASE.'/templates/'.$template.'/html/mod_bt_googlemaps/js/default.js')) + { + $document->addScript(JURI::root().'templates/'.$template.'/html/mod_bt_googlemaps/js/default.js'); + } + else{ + $document->addScript(JURI::root().'modules/mod_bt_googlemaps/tmpl/js/default.js'); + } + if(file_exists(JPATH_BASE.'/templates/'.$template.'/html/mod_bt_googlemaps/css/styles.css')) + { + $document->addStyleSheet(JURI::root().'templates/'.$template.'/html/mod_bt_googlemaps/css/style.css'); + } + else{ + $document->addStyleSheet(JURI::root().'modules/mod_bt_googlemaps/tmpl/css/style.css'); + } + + } +} \ No newline at end of file diff --git a/deployed/mod_bt_googlemaps/modules/mod_bt_googlemaps/index.html b/deployed/mod_bt_googlemaps/modules/mod_bt_googlemaps/index.html new file mode 100644 index 00000000..fa6d84e8 --- /dev/null +++ b/deployed/mod_bt_googlemaps/modules/mod_bt_googlemaps/index.html @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/deployed/mod_bt_googlemaps/modules/mod_bt_googlemaps/mod_bt_googlemaps.php b/deployed/mod_bt_googlemaps/modules/mod_bt_googlemaps/mod_bt_googlemaps.php new file mode 100644 index 00000000..781b8b6e --- /dev/null +++ b/deployed/mod_bt_googlemaps/modules/mod_bt_googlemaps/mod_bt_googlemaps.php @@ -0,0 +1,26 @@ + + diff --git a/deployed/mod_bt_googlemaps/modules/mod_bt_googlemaps/mod_bt_googlemaps.xml b/deployed/mod_bt_googlemaps/modules/mod_bt_googlemaps/mod_bt_googlemaps.xml new file mode 100644 index 00000000..886426ac --- /dev/null +++ b/deployed/mod_bt_googlemaps/modules/mod_bt_googlemaps/mod_bt_googlemaps.xml @@ -0,0 +1,326 @@ + + + BT Google Maps + BowThemes + Jun 2012 + Copyright (C) 2016 Bowthemes. All rights reserved. + http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL + support@bowthemes.com + http://www.bowthemes.com + 2.1.0 + + +

        BT Google Maps Module Version 2.1.0

        + +

        Bring google maps to your website by the simplest & easiest way. Using Google Maps version 3 services, BT Google Maps support you input both Address and Coordinate, create your custom marker with title, images, description... +

        +
        +

        Features

        +
          +
        • Google Maps Version 3 (Latest)
        • +
        • Support both input types: Address and Coordinate
        • +
        • Retrieving lat/long of location using Geocoder
        • +
        • Auto-Detect Language
        • +
        • Streetview, MapOverview, ZoomControl, PanControl, ScaleControl, MapTypeControl
        • +
        • Support Multiple Marker( Easy customize title, icon, description popup)
        • +
        • Weather & cloud layers
        • +
        • Support custom map style
        • +
        • Support custom inforwindow style
        • +
        • Multiple module instances
        • +
        • The configuration is very easy and simple
        • +
        • Compatibility with Joomla 1.6, 1.7, 2.5 & Joomla 3.x
        • +
        • Cross Browser Support: IE7+, Firefox 2+, Safari 3+, Chrome 8+, Opera 9+
        • +
        +

        Upgrade versions

        +

        + Your current versions is 2.1.0. Find our latest versions now +

        +

        Userful links

        + +

        About bow themes & copyright

        +

        + Bow Themes is Professional Joomla template provider. We are focused on creating unique, attractive and clean templates without loosing flexibility and simplicity of customization +

        + Copyright (C) 2016 BowThemes + +
        + + ]]> + + + mod_bt_googlemaps.php + helper.php + index.html + tmpl + admin + + + en-GB.mod_bt_googlemaps.ini + + + +
        + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
        +
        + +
        +
        + + + + + + + + + + + + + + + + + + +
        +
        + + + + + + + + + + +
        +
        + + + + + + + + +
        +
        + + + + + + + +
        + +
        +
        + diff --git a/deployed/mod_bt_googlemaps/modules/mod_bt_googlemaps/tmpl/css/style.css b/deployed/mod_bt_googlemaps/modules/mod_bt_googlemaps/tmpl/css/style.css new file mode 100644 index 00000000..16849d85 --- /dev/null +++ b/deployed/mod_bt_googlemaps/modules/mod_bt_googlemaps/tmpl/css/style.css @@ -0,0 +1,4 @@ +@CHARSET "ISO-8859-1"; +.bt-googlemaps img{ + max-width: none!important; +} \ No newline at end of file diff --git a/deployed/mod_bt_googlemaps/modules/mod_bt_googlemaps/tmpl/default.php b/deployed/mod_bt_googlemaps/modules/mod_bt_googlemaps/tmpl/default.php new file mode 100644 index 00000000..b4b8255e --- /dev/null +++ b/deployed/mod_bt_googlemaps/modules/mod_bt_googlemaps/tmpl/default.php @@ -0,0 +1,86 @@ + +
        +get('mapType').'\','; +$script .= 'width :\''.$params->get('width').'\','; +$script .= 'height :\''.$params->get('height').'\','; +$script .= 'cavas_id :"cavas_id'.$module->id.'", '; +$script .= 'zoom :'.$params->get('zoom').','; +$script .= 'zoomControl :'.$params->get('zoomControl','true').','; +$script .= 'scaleControl :'.$params->get('scaleControl','true').','; +$script .= 'panControl :'.$params->get('panControl','true').','; +$script .= 'mapTypeControl :'.$params->get('mapTypeControl','true').','; +$script .= 'streetViewControl :'.$params->get('streetViewControl','true').','; +$script .= 'overviewMapControl :'.$params->get('overviewMapControl','true').','; +$script .= 'draggable :'.$params->get('draggable','true').','; +$script .= 'disableDoubleClickZoom :'.$params->get('disableDoubleClickZoom','false').','; +$script .= 'scrollwheel :'.$params->get('scrollwheel','true').','; +$script .= 'weather :'.$params->get('weather','true').','; +$script .= 'temperatureUnit :\''.$params->get('temperatureUnit','f').'\','; +$script .= 'replaceMarkerIcon :' . $params->get('replace_marker_icon', 'true') . ','; +$script .= 'displayWeatherInfo :'.$params->get('display_weather_info','true').','; +$script .= 'owm_api: "' . $params->get('owm_api', '') . '", '; +# for map address(map center) +$script .= 'mapCenterType :"'.$params->get('mapCenterType').'",'; +$script .= 'mapCenterAddress :"'.$params->get('mapCenterAddress').'",'; +$script .= 'mapCenterCoordinate :"'.$params->get('mapCenterCoordinate').'",'; + +# for control custom style +$script .= 'enableStyle :"'.$params->get('enable-style').'",'; +$script .= 'styleTitle :"'.$params->get('style-title').'",'; +$script .= 'createNewOrDefault :"'.$params->get('createNewOrApplyDefaultStyle').'",'; + +# for custom infobox +$script .= 'enableCustomInfoBox :"'.$params->get('enable-custom-infobox').'",'; +$script .= 'boxPosition :"'.$params->get('pixelOffset').'",'; +$script .= 'closeBoxMargin :"'.$params->get('closeBoxMargin').'",'; +$script .= 'closeBoxImage :"'.$params->get('closeBoxURL').'",'; + +# for site url +$script .= 'url:"'.JURI::root().'"'; +$script .= '};'; + +# create box style object +$boxcss = $params->get('boxcss'); +$boxcss = preg_replace("/[\n\r]/","",$boxcss); +$boxcssArr = explode(',' ,$boxcss); +$boxCssRender = array(); +$script .= 'var boxStyles = {'; +for ( $i=0; $i< count($boxcssArr); $i++){ + $boxcssArr[$i] = trim($boxcssArr[$i]); + if($boxcssArr[$i]){ + $style = explode(':',$boxcssArr[$i]); + $style[0] = str_replace(array(' ','-'),'',$style[0]); + if($style[0]){ + $boxCssRender[]='"'.$style[0].'":"'.$style[1].'"'; + } + } +} + +$script .= implode($boxCssRender,','); +$script .= '};'; +$script .= 'var markersCode ="'.$params->get('markes').'"; '; +$script .= 'var stylesCode ="'.$params->get('styles').'"; '; +$script .= 'initializeMap(config, markersCode, stylesCode, boxStyles);'; + +echo ''; + +?> diff --git a/deployed/mod_bt_googlemaps/modules/mod_bt_googlemaps/tmpl/images/close.gif b/deployed/mod_bt_googlemaps/modules/mod_bt_googlemaps/tmpl/images/close.gif new file mode 100644 index 00000000..bee7ab79 Binary files /dev/null and b/deployed/mod_bt_googlemaps/modules/mod_bt_googlemaps/tmpl/images/close.gif differ diff --git a/deployed/mod_bt_googlemaps/modules/mod_bt_googlemaps/tmpl/images/close.png b/deployed/mod_bt_googlemaps/modules/mod_bt_googlemaps/tmpl/images/close.png new file mode 100644 index 00000000..4d227857 Binary files /dev/null and b/deployed/mod_bt_googlemaps/modules/mod_bt_googlemaps/tmpl/images/close.png differ diff --git a/deployed/mod_bt_googlemaps/modules/mod_bt_googlemaps/tmpl/images/index.html b/deployed/mod_bt_googlemaps/modules/mod_bt_googlemaps/tmpl/images/index.html new file mode 100644 index 00000000..fa6d84e8 --- /dev/null +++ b/deployed/mod_bt_googlemaps/modules/mod_bt_googlemaps/tmpl/images/index.html @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/deployed/mod_bt_googlemaps/modules/mod_bt_googlemaps/tmpl/images/marker.png b/deployed/mod_bt_googlemaps/modules/mod_bt_googlemaps/tmpl/images/marker.png new file mode 100644 index 00000000..d34c9e26 Binary files /dev/null and b/deployed/mod_bt_googlemaps/modules/mod_bt_googlemaps/tmpl/images/marker.png differ diff --git a/deployed/mod_bt_googlemaps/modules/mod_bt_googlemaps/tmpl/images/shadow.png b/deployed/mod_bt_googlemaps/modules/mod_bt_googlemaps/tmpl/images/shadow.png new file mode 100644 index 00000000..cb706319 Binary files /dev/null and b/deployed/mod_bt_googlemaps/modules/mod_bt_googlemaps/tmpl/images/shadow.png differ diff --git a/deployed/mod_bt_googlemaps/modules/mod_bt_googlemaps/tmpl/index.html b/deployed/mod_bt_googlemaps/modules/mod_bt_googlemaps/tmpl/index.html new file mode 100644 index 00000000..fa6d84e8 --- /dev/null +++ b/deployed/mod_bt_googlemaps/modules/mod_bt_googlemaps/tmpl/index.html @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/deployed/mod_bt_googlemaps/modules/mod_bt_googlemaps/tmpl/js/btbase64.min.js b/deployed/mod_bt_googlemaps/modules/mod_bt_googlemaps/tmpl/js/btbase64.min.js new file mode 100644 index 00000000..d0540f60 --- /dev/null +++ b/deployed/mod_bt_googlemaps/modules/mod_bt_googlemaps/tmpl/js/btbase64.min.js @@ -0,0 +1,105 @@ +var BT = BT || {}; +(function() { + BT.Base64 = + { + keyString : "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=", + UTF8Encode : function(b) { + b = b.replace(/\x0d\x0a/g, "\x0a"); + var a = ""; + for ( var e = 0; e < b.length; e++) { + var d = b.charCodeAt(e); + if (d < 128) { + a += String.fromCharCode(d) + } else { + if ((d > 127) && (d < 2048)) { + a += String.fromCharCode((d >> 6) | 192); + a += String.fromCharCode((d & 63) | 128) + } else { + a += String.fromCharCode((d >> 12) | 224); + a += String.fromCharCode(((d >> 6) & 63) | 128); + a += String.fromCharCode((d & 63) | 128) + } + } + } + return a + }, + UTF8Decode : function(a) { + var b = ""; + var d = 0; + var e = c1 = c2 = 0; + while (d < a.length) { + e = a.charCodeAt(d); + if (e < 128) { + b += String.fromCharCode(e); + d++ + } else { + if ((e > 191) && (e < 224)) { + c2 = a.charCodeAt(d + 1); + b += String.fromCharCode(((e & 31) << 6) + | (c2 & 63)); + d += 2 + } else { + c2 = a.charCodeAt(d + 1); + c3 = a.charCodeAt(d + 2); + b += String.fromCharCode(((e & 15) << 12) + | ((c2 & 63) << 6) | (c3 & 63)); + d += 3 + } + } + } + return b + }, + base64Encode : function(c) { + var a = ""; + var k, h, f, j, g, e, d; + var b = 0; + c = this.UTF8Encode(c); + while (b < c.length) { + k = c.charCodeAt(b++); + h = c.charCodeAt(b++); + f = c.charCodeAt(b++); + j = k >> 2; + g = ((k & 3) << 4) | (h >> 4); + e = ((h & 15) << 2) | (f >> 6); + d = f & 63; + if (isNaN(h)) { + e = d = 64 + } else { + if (isNaN(f)) { + d = 64 + } + } + a = a + this.keyString.charAt(j) + + this.keyString.charAt(g) + + this.keyString.charAt(e) + + this.keyString.charAt(d) + } + return a + }, + base64Decode : function(c) { + var a = ""; + var k, h, f; + var j, g, e, d; + var b = 0; + c = c.replace(/[^A-Za-z0-9\+\/\=]/g, ""); + while (b < c.length) { + j = this.keyString.indexOf(c.charAt(b++)); + g = this.keyString.indexOf(c.charAt(b++)); + e = this.keyString.indexOf(c.charAt(b++)); + d = this.keyString.indexOf(c.charAt(b++)); + k = (j << 2) | (g >> 4); + h = ((g & 15) << 4) | (e >> 2); + f = ((e & 3) << 6) | d; + a = a + String.fromCharCode(k); + if (e != 64) { + a = a + String.fromCharCode(h) + } + if (d != 64) { + a = a + String.fromCharCode(f) + } + } + a = this.UTF8Decode(a); + return a + } + } +})(); \ No newline at end of file diff --git a/deployed/mod_bt_googlemaps/modules/mod_bt_googlemaps/tmpl/js/default.js b/deployed/mod_bt_googlemaps/modules/mod_bt_googlemaps/tmpl/js/default.js new file mode 100644 index 00000000..d1ba151e --- /dev/null +++ b/deployed/mod_bt_googlemaps/modules/mod_bt_googlemaps/tmpl/js/default.js @@ -0,0 +1,358 @@ +var currentMapCenter; +function initializeMap(configs, markersCode, stylesCode, boxStyles){ + var myLatlng; + + configs.width = configs.width =='auto' || configs.width =='100%' ? "100%":configs.width + 'px'; + configs.height = configs.height =='auto' || configs.height =='100%' ? "100%":configs.height + 'px'; + + document.getElementById(configs.cavas_id).style.width=configs.width; + document.getElementById(configs.cavas_id).style.height=configs.height; + + if(configs.owm_api == ''){ + configs.weather = false; + } + var markersJson = BT.Base64.base64Decode(markersCode); + var markers = JSON.parse(markersJson); + var max = markers.length; + var stylesJson = BT.Base64.base64Decode(stylesCode); + var styles = JSON.parse(stylesJson); + var infowindowData = Array(); + + /** create map */ + createMapCenter(configs, markers ,styles, boxStyles); + /** + * Create Map center + * @param configs + * @param markers + * @returns {Latitude,Longitude} + */ + function createMapCenter(configs,markers,styles, boxStyles){ + if(configs.mapCenterType == 'address' && configs.mapCenterAddress == '' || configs.mapCenterType == 'coordinate' && configs.mapCenterCoordinate == '' ){ + if(markers.length == 0){ + var geocoder = new google.maps.Geocoder(); + geocoder.geocode( { 'address': 'A2DN3 Nguyen Khanh Toan, Cau Giay, Ha Noi' }, function(results, status) { + if (status == google.maps.GeocoderStatus.OK){ + mapCenter = results[0].geometry.location; + return createMap(configs,styles,markers, mapCenter,boxStyles); + }else{ + alert("Geocode map center was not successful for the following reason: " + status); + } + }); + }else { + if(markers[0].markerType == 'address'){ + var geocoder = new google.maps.Geocoder(); + geocoder.geocode( { 'address': markers[0].markerValue }, function(results, status) { + if (status == google.maps.GeocoderStatus.OK){ + mapCenter = results[0].geometry.location; + return createMap(configs,styles,markers, mapCenter,boxStyles); + }else{ + alert("Geocode was not successful for the following reason: " + status + '! Map address: ' + markers[0].markerValue); + } + }) + }else{ + mapCenterCoordinate = markers[0].markerValue.split(','); + mapCenter = new google.maps.LatLng(mapCenterCoordinate[0],mapCenterCoordinate[1]); + return createMap(configs,styles,markers, mapCenter,boxStyles); + } + } + }else{ + if(configs.mapCenterType == 'address'){ + var geocoder = new google.maps.Geocoder(); + geocoder.geocode( { 'address': configs.mapCenterAddress }, function(results, status) { + if (status == google.maps.GeocoderStatus.OK){ + mapCenter = results[0].geometry.location; + return createMap(configs,styles,markers, mapCenter,boxStyles); + }else{ + alert("Geocode was not successful for the following reason: " + status + '! Map address: ' + configs.mapCenterAddress); + } + }) + }else{ + mapCenterCoordinate = configs.mapCenterCoordinate.split(','); + mapCenter = new google.maps.LatLng(mapCenterCoordinate[0],mapCenterCoordinate[1]); + return createMap(configs,styles,markers, mapCenter,boxStyles); + } + } + } + /** + * Create Map + * @param Object configs + * @param Array Object styles + * @param Array Object markers + * @returns {google.maps.Map} + */ + + function createMap(configs,styles,markers, mapCenter,boxStyles){ + + if(configs.enableStyle == 1 ||configs.enableStyle == '1'){ + var stylesArr = []; + for(var j = 0; j < styles.length; j++) + { + var style = {}; + style.stylers = []; + if(styles[j].featureType!='all'){ + style.featureType = styles[j].featureType; + + } + if(styles[j].elementType!='all'){ + style.elementType = styles[j].elementType; + } + if(styles[j].invertLightness == 'true'){ + style.stylers.push({"invert_lightness":true}); + } + if(styles[j].visibility){ + style.stylers.push({"visibility":styles[j].visibility}); + } + if(styles[j].mapColor){ + style.stylers.push({"color":styles[j].mapColor}); + } + if(styles[j].weight){ + style.stylers.push({"weight":styles[j].weight}); + } + if(styles[j].hue){ + style.stylers.push({"hue":styles[j].hue}); + } + if(styles[j].saturation){ + style.stylers.push({"saturation":styles[j].saturation}); + } + if(styles[j].lightness){ + style.stylers.push({"lightness":styles[j].lightness}); + } + if(styles[j].gamma){ + style.stylers.push({"gamma":styles[j].gamma}); + } + + stylesArr.push(style); + } + + if(configs.createNewOrDefault == "applyDefault"){ + if(stylesArr.length != 0){ + var mapOptions = { + zoom : configs.zoom, + zoomControl : configs.zoomControl, + scaleControl : configs.scaleControl, + mapTypeControl : configs.mapTypeControl, + panControl : configs.panControl, + streetViewControl : configs.streetViewControl, + overviewMapControl : configs.overviewMapControl, + draggable : configs.draggable, + disableDoubleClickZoom : configs.disableDoubleClickZoom, + scrollwheel : configs.scrollwheel, + center : mapCenter, + mapTypeId : configs.mapType, + styles : stylesArr + } + }else{ + var mapOptions = { + zoom : configs.zoom, + zoomControl : configs.zoomControl, + scaleControl : configs.scaleControl, + mapTypeControl : configs.mapTypeControl, + panControl : configs.panControl, + streetViewControl : configs.streetViewControl, + overviewMapControl : configs.overviewMapControl, + draggable : configs.draggable, + disableDoubleClickZoom : configs.disableDoubleClickZoom, + scrollwheel : configs.scrollwheel, + center : mapCenter, + mapTypeId : configs.mapType + } + } + }else{ + var mapOptions = { + zoom : configs.zoom, + zoomControl : configs.zoomControl, + scaleControl : configs.scaleControl, + mapTypeControl : configs.mapTypeControl, + panControl : configs.panControl, + streetViewControl : configs.streetViewControl, + overviewMapControl : configs.overviewMapControl, + draggable : configs.draggable, + disableDoubleClickZoom : configs.disableDoubleClickZoom, + scrollwheel : configs.scrollwheel, + center : mapCenter, + mapTypeControlOptions : {mapTypeIds: [configs.mapType, 'map_style']} + } + var styledMap = new google.maps.StyledMapType(stylesArr,{name: configs.styleTitle}); + } + }else{ + var mapOptions = { + zoom : configs.zoom, + zoomControl : configs.zoomControl, + scaleControl : configs.scaleControl, + mapTypeControl : configs.mapTypeControl, + panControl : configs.panControl, + streetViewControl : configs.streetViewControl, + overviewMapControl : configs.overviewMapControl, + draggable : configs.draggable, + disableDoubleClickZoom : configs.disableDoubleClickZoom, + + scrollwheel : configs.scrollwheel, + center : mapCenter, + mapTypeId : configs.mapType + } + } + var map = new google.maps.Map(document.getElementById(configs.cavas_id), mapOptions); + + // set style for map + if((configs.enableStyle == 1 ||configs.enableStyle == '1') && configs.createNewOrDefault == "createNew" ){ + //Associate the styled map with the MapTypeId and set it to display. + map.mapTypes.set('map_style', styledMap); + map.setMapTypeId('map_style'); + } + + /** create marker in map*/ + for (i = 0; i < markers.length; i++) { + getMarker(configs,markers[i],map ,boxStyles, i); + } + currentMapCenter = map.getCenter(); + google.maps.event.addDomListener(map, 'idle', function() { + currentMapCenter = map.getCenter(); + }); + google.maps.event.addDomListener(window, 'resize', function() { + map.setCenter(currentMapCenter); + }); + } + + /** + * Get Coordinate of maker and create marker + * @param markerSource + */ + function getMarker(configs,markerSource, map,boxStyles, i){ + if(markerSource.markerType == 'coordinate'){ + coordinate = markerSource.markerValue.split(','); + var pos = new google.maps.LatLng(coordinate[0], coordinate[1]); + if(configs.weather){ + createMakerWithWeather(configs, markerSource, map, pos,boxStyles, i); + }else{ + createMarker(configs, markerSource, map, pos,boxStyles, i); + } + + }else{ + var geocoder = new google.maps.Geocoder(); + geocoder.geocode({ 'address': markerSource.markerValue}, function(results, status) { + if (status == google.maps.GeocoderStatus.OK) { + var pos = results[0].geometry.location; + if(configs.weather){ + createMakerWithWeather(configs, markerSource, map, pos,boxStyles, i); + }else{ + createMarker(configs, markerSource, map, pos,boxStyles, i); + } + }else{ + alert("Geocode was not successful for the following reason: " + status + '! Map address: ' + markerSource.markerValue); + } + }) + } + } + + /** + * function create marker for map + * @param ObjectJS marker + * @param {google.maps.Map} + * @param pos: Coordinate of marker + */ + function createMarker(configs,markerSource,map, pos,boxStyles, i){ + /** set option of marker */ + var marker, image; + if(configs.weather && markerSource.weatherInfo && configs.replaceMarkerIcon ){ + image = new google.maps.MarkerImage('http://openweathermap.org/img/w/' + markerSource.weatherInfo.weather[0].icon + '.png'); + }else { + if (markerSource.markerIcon == '') { + image = ''; + } else { + markerSource.markerIcon = configs.url + markerSource.markerIcon; + image = { + //size: new google.maps.Size(21, 32), // size + //origin: new google.maps.Point(0,0), // origin + //anchor: new google.maps.Point(10, 32), // anchor + url: markerSource.markerIcon // url + }; + } + } + + if(configs.weather && markerSource.weatherInfo){ + marker = new google.maps.Marker({ + position: pos, + map: map, + icon: image, + title: markerSource.markerTitle , + zIndex: i * 10 + }); + }else{ + marker = new google.maps.Marker({ + position: pos, + map: map, + icon: image, + title: markerSource.markerTitle , + zIndex: i * 10 + }); + } + + /** create infoWindow */ + if(configs.weather && configs.displayWeatherInfo && markerSource.weatherInfo){ + markerSource.markerInfoWindow += '

        ' + + '
        ' + + markerSource.weatherInfo.main.temp + '°' + (configs.temperatureUnit == 'c' ? 'C' : 'F') + '
        ' + + markerSource.weatherInfo.weather[0].main + + '

        '; + } + + if(markerSource.markerInfoWindow){ + if(configs.enableCustomInfoBox == 1 ||configs.enableCustomInfoBox == '1'){ + var pixelOffset = configs.boxPosition.split(','); + if(configs.closeBoxImage == ''){ configs.closeBoxImage = 'modules/mod_bt_googlemaps/tmpl/images/close.gif';} + var infoBoxOption = { + content: markerSource.markerInfoWindow, + disableAutoPan: false, + maxWidth: 0, + pixelOffset: new google.maps.Size(Number(pixelOffset[0]),Number(pixelOffset[1])), + zIndex: i * 10, + boxStyle: boxStyles , + closeBoxMargin: configs.closeBoxMargin, + closeBoxURL: configs.url + '/'+ configs.closeBoxImage, + infoBoxClearance: new google.maps.Size(1, 1), + isHidden: false, + pane: "floatPane", + enableEventPropagation: false + } + + var infowindow = new InfoBox(infoBoxOption); + }else{ + var infowindow = new google.maps.InfoWindow({ + content: markerSource.markerInfoWindow + }); + } + infowindowData.push(infowindow); + if(markerSource.markerShowInfoWindow == 1){ + infowindow.open(map,marker); + } + google.maps.event.addListener(marker, 'click', function() { + for(var i = 0; i < infowindowData.length; i++){ + infowindowData[i].close(); + } + infowindow.open(map,marker); + }); + } + } + + + function createMakerWithWeather(configs, markerSource, map, pos, boxStyles, i) { + var requestString = "http://api.openweathermap.org/data/2.5/weather?lat=" + pos.lat() + '&lon=' + pos.lng() + + "&cluster=yes&format=json" + + (configs.temperatureUnit == 'c' ? '&units=metric' : '') + + "&APPID=" + configs.owm_api; + + var request = new XMLHttpRequest(); + request.onload = function() { + var results = JSON.parse(this.responseText); + if (results.cod == 200) { + markerSource.weatherInfo = results; + }else{ + markerSource.weatherInfo = false; + } + createMarker(configs,markerSource,map,pos,boxStyles , i); + + }; + request.open("get", requestString, true); + request.send(); + } +} \ No newline at end of file diff --git a/deployed/mod_bt_googlemaps/modules/mod_bt_googlemaps/tmpl/js/index.html b/deployed/mod_bt_googlemaps/modules/mod_bt_googlemaps/tmpl/js/index.html new file mode 100644 index 00000000..fa6d84e8 --- /dev/null +++ b/deployed/mod_bt_googlemaps/modules/mod_bt_googlemaps/tmpl/js/index.html @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/deployed/mod_bt_googlemaps/modules/mod_bt_googlemaps/tmpl/js/infobox.js b/deployed/mod_bt_googlemaps/modules/mod_bt_googlemaps/tmpl/js/infobox.js new file mode 100644 index 00000000..cdfbd4ed --- /dev/null +++ b/deployed/mod_bt_googlemaps/modules/mod_bt_googlemaps/tmpl/js/infobox.js @@ -0,0 +1,694 @@ +/** + * @name InfoBox + * @version 1.0 [January 17, 2010] + * @author Gary Little (inspired by proof-of-concept code from Pamela Fox of Google) + * @copyright Copyright 2010 Gary Little [gary at luxcentral.com] + * @fileoverview InfoBox extends the Google Maps API v3 OverlayView class. + *

        + * An InfoBox behaves like a google.maps.InfoWindow, but it supports several + * additional properties for advanced styling. An InfoBox can also be used as a map label. + *

        + * An InfoBox also fires the same events as a google.maps.InfoWindow. + *

        + * Browsers tested: + *

        + * Mac -- Safari (4.0.4), Firefox (3.6), Opera (10.10), Chrome (4.0.249.43), OmniWeb (5.10.1) + *
        + * Win -- Safari, Firefox, Opera, Chrome (3.0.195.38), Internet Explorer (8.0.6001.18702) + *
        + * iPod Touch/iPhone -- Safari (3.1.2) + */ + +/*! + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*jslint browser:true */ +/*global google */ + +/** + * @name InfoBoxOptions + * @class This class represents the optional parameter passed to the {@link InfoBox} constructor. + * @property {string|Node} content The content to display in the InfoBox (plain text or HTML). + * @property {boolean} disableAutoPan Disable auto-pan on open (default is false). + * @property {number} maxWidth The maximum width (in pixels) of the InfoBox. Set to 0 if no maximum. + * @property {Size} pixelOffset The offset (in pixels) from the top left corner of the InfoBox + * to the map pixel corresponding to position. + * @property {LatLng} position The geographic location at which to display the InfoBox. + * @property {number} zIndex The CSS z-index style value for the InfoBox. + * Note: This value overrides a zIndex setting specified in the boxStyle property. + * @property {Object} boxStyle An object literal with CSS style settings for the InfoBox container. + * Note: Border widths must be specified in px units because of an MSIE limitation. + * @property {string} closeBoxMargin The CSS margin style value for the close box. + * The default is "2px" (a 2-pixel margin on all sides). + * @property {string} closeBoxURL The URL of the image representing the close box. + * Note: The default is the URL for Google's standard close box. + * Set this property to "" if no close box is required. + * @property {Size} infoBoxClearance Minimum offset (in pixels) from the InfoBox to the + * map edge after an auto-pan. + * @property {boolean} isHidden Hide the InfoBox on open (default is false). + * @property {string} pane The pane where the InfoBox is to appear (default is "floatPane"). + * Set the pane to "mapPane" if the InfoBox is being used as a map label. + * Valid pane names are the property names for the google.maps.MapPanes object. + * @property {boolean} enableEventPropagation Propagate mousedown, click, dblclick, + * and contextmenu events in the InfoBox (default is false to mimic the behavior + * of a google.maps.InfoWindow). Set this property to true if the InfoBox + * is being used as a map label. iPhone note: This property setting has no effect. Events are + * always propagated for an InfoBox in the "mapPane" pane and they are not propagated + * for an InfoBox in the "floatPane" pane. + */ + +/** + * Creates an InfoBox with the options specified in {@link InfoBoxOptions}. + * Call InfoBox.open to add the box to the map. + * @constructor + * @param {InfoBoxOptions} [opt_opts] + */ +function InfoBox(opt_opts) { + + opt_opts = opt_opts || {}; + + google.maps.OverlayView.apply(this, arguments); + + // Standard options (in common with google.maps.InfoWindow): + // + this.content_ = opt_opts.content || ""; + this.disableAutoPan_ = opt_opts.disableAutoPan || false; + this.maxWidth_ = opt_opts.maxWidth || 0; + this.pixelOffset_ = opt_opts.pixelOffset || new google.maps.Size(0, 0); + this.position_ = opt_opts.position || new google.maps.LatLng(0, 0); + this.zIndex_ = opt_opts.zIndex || null; + + // Additional options (unique to InfoBox): + // + this.boxStyle_ = opt_opts.boxStyle || {}; + this.closeBoxMargin_ = opt_opts.closeBoxMargin || "2px"; + this.closeBoxURL_ = opt_opts.closeBoxURL || "http://www.google.com/intl/en_us/mapfiles/close.gif"; + if (opt_opts.closeBoxURL === "") { + this.closeBoxURL_ = ""; + } + this.infoBoxClearance_ = opt_opts.infoBoxClearance || new google.maps.Size(1, 1); + this.isHidden_ = opt_opts.isHidden || false; + this.pane_ = opt_opts.pane || "floatPane"; + this.enableEventPropagation_ = opt_opts.enableEventPropagation || false; + + this.div_ = null; + this.closeListener_ = null; + this.eventListener1_ = null; + this.eventListener2_ = null; + this.eventListener3_ = null; + this.contextListener_ = null; + this.fixedWidthSet_ = null; +} + +/* InfoBox extends OverlayView in the Google Maps API v3. + */ +InfoBox.prototype = new google.maps.OverlayView(); + +/** + * Creates the DIV representing the InfoBox. + * @private + */ +InfoBox.prototype.createInfoBoxDiv_ = function () { + + var bw; + var me = this; + + // This handler prevents an event in the InfoBox from being passed on to the map. + // + var cancelHandler = function (e) { + e.cancelBubble = true; + + if (e.stopPropagation) { + + e.stopPropagation(); + } + }; + + // This handler ignores the current event in the InfoBox and conditionally prevents + // the event from being passed on to the map. It is used for the contextmenu event. + // + var ignoreHandler = function (e) { + + e.returnValue = false; + + if (e.preventDefault) { + + e.preventDefault(); + } + + if (!me.enableEventPropagation_) { + + e.cancelBubble = true; + + if (e.stopPropagation) { + + e.stopPropagation(); + } + } + }; + + if (!this.div_) { + + this.div_ = document.createElement("div"); + + this.setBoxStyle_(); + + // Apply required styles: + // + this.div_.style.position = "absolute"; + this.div_.style.visibility = 'hidden'; + if (this.zIndex_ !== null) { + + this.div_.style.zIndex = this.zIndex_; + } + + this.div_.innerHTML = this.getCloseBoxImg_() + this.content_; + + // Add the InfoBox DIV to the DOM + this.getPanes()[this.pane_].appendChild(this.div_); + + this.addClickHandler_(); + + if (this.div_.style.width) { + + this.fixedWidthSet_ = true; + + } else { + + if (this.maxWidth_ !== 0 && this.div_.offsetWidth > this.maxWidth_) { + + this.div_.style.width = this.maxWidth_; + this.div_.style.overflow = "auto"; + this.fixedWidthSet_ = true; + + } else { // The following code is needed to overcome problems with MSIE + + bw = this.getBoxWidths_(); + + this.div_.style.width = (this.div_.offsetWidth - bw.left - bw.right) + "px"; + this.fixedWidthSet_ = false; + } + } + + this.panBox_(this.disableAutoPan_); + + if (!this.enableEventPropagation_) { + + // Cancel event propagation. + // + this.eventListener1_ = google.maps.event.addDomListener(this.div_, "mousedown", cancelHandler); + this.eventListener2_ = google.maps.event.addDomListener(this.div_, "click", cancelHandler); + this.eventListener3_ = google.maps.event.addDomListener(this.div_, "dblclick", cancelHandler); + } + + this.contextListener_ = google.maps.event.addDomListener(this.div_, "contextmenu", ignoreHandler); + + /** + * This event is fired when the DIV containing the InfoBox's content is attached to the DOM. + * @name InfoBox#domready + * @event + */ + google.maps.event.trigger(this, "domready"); + } +}; + +/** + * Returns the HTML tag for the close box. + * @private + */ +InfoBox.prototype.getCloseBoxImg_ = function () { + + var img = ""; + + if (this.closeBoxURL_ !== "") { + + img = " mapEastLng ? mapEastLng - iwEastLng : 0); + var shiftLat = + (iwNorthLat > mapNorthLat ? mapNorthLat - iwNorthLat : 0) + + (iwSouthLat < mapSouthLat ? mapSouthLat - iwSouthLat : 0); + + if (!(shiftLat === 0 && shiftLng === 0)) { + + // Move the map to the new shifted center. + // + var c = map.getCenter(); + map.setCenter(new google.maps.LatLng(c.lat() - shiftLat, c.lng() - shiftLng)); + } + } +}; + +/** + * Sets the style of the InfoBox. + * @private + */ +InfoBox.prototype.setBoxStyle_ = function () { + + var i; + + var boxStyle = this.boxStyle_; + + for (i in boxStyle) { + + if (boxStyle.hasOwnProperty(i)) { + + this.div_.style[i] = boxStyle[i]; + } + } + + // Fix up opacity style for benefit of MSIE: + // + if (typeof this.div_.style.opacity !== "undefined") { + + this.div_.style.filter = "alpha(opacity=" + (this.div_.style.opacity * 100) + ")"; + } +}; + +/** + * Get the widths of the borders of the InfoBox. + * @private + * @return {Object} widths object (top, bottom left, right) + */ +InfoBox.prototype.getBoxWidths_ = function () { + + var computedStyle; + var bw = {top: 0, bottom: 0, left: 0, right: 0}; + var box = this.div_; + + if (document.defaultView && document.defaultView.getComputedStyle) { + + computedStyle = box.ownerDocument.defaultView.getComputedStyle(box, ""); + + if (computedStyle) { + + // The computed styles are always in pixel units (good!) + bw.top = parseInt(computedStyle.borderTopWidth, 10) || 0; + bw.bottom = parseInt(computedStyle.borderBottomWidth, 10) || 0; + bw.left = parseInt(computedStyle.borderLeftWidth, 10) || 0; + bw.right = parseInt(computedStyle.borderRightWidth, 10) || 0; + } + + } else if (document.documentElement.currentStyle) { // MSIE + + if (box.currentStyle) { + + // The current styles may not be in pixel units, but assume they are (bad!) + bw.top = parseInt(box.currentStyle.borderTopWidth, 10) || 0; + bw.bottom = parseInt(box.currentStyle.borderBottomWidth, 10) || 0; + bw.left = parseInt(box.currentStyle.borderLeftWidth, 10) || 0; + bw.right = parseInt(box.currentStyle.borderRightWidth, 10) || 0; + } + } + + return bw; +}; + +/** + * Invoked when close is called. Do not call it directly. + */ +InfoBox.prototype.onRemove = function () { + + if (this.div_) { + + this.div_.parentNode.removeChild(this.div_); + this.div_ = null; + } +}; + +/** + * Draws the InfoBox based on the current map projection and zoom level. + */ +InfoBox.prototype.draw = function () { + + this.createInfoBoxDiv_(); + + var pixPosition = this.getProjection().fromLatLngToDivPixel(this.position_); + + this.div_.style.left = (pixPosition.x + this.pixelOffset_.width) + "px"; + this.div_.style.top = (pixPosition.y + this.pixelOffset_.height) + "px"; + + if (this.isHidden_) { + + this.div_.style.visibility = 'hidden'; + + } else { + + this.div_.style.visibility = "visible"; + } +}; + +/** + * Sets the options for the InfoBox. Note that changes to the maxWidth, + * closeBoxMargin, closeBoxURL, and enableEventPropagation + * properties have no affect until the current InfoBox is closed and a new one + * is opened. + * @param {InfoBoxOptions} opt_opts + */ +InfoBox.prototype.setOptions = function (opt_opts) { + + if (typeof opt_opts.boxStyle !== "undefined") { // Must be first + + this.boxStyle_ = opt_opts.boxStyle; + this.setBoxStyle_(); + } + if (typeof opt_opts.content !== "undefined") { + + this.setContent(opt_opts.content); + } + if (typeof opt_opts.disableAutoPan !== "undefined") { + + this.disableAutoPan_ = opt_opts.disableAutoPan; + } + if (typeof opt_opts.maxWidth !== "undefined") { + + this.maxWidth_ = opt_opts.maxWidth; + } + if (typeof opt_opts.pixelOffset !== "undefined") { + + this.pixelOffset_ = opt_opts.pixelOffset; + } + if (typeof opt_opts.position !== "undefined") { + + this.setPosition(opt_opts.position); + } + if (typeof opt_opts.zIndex !== "undefined") { + + this.setZIndex(opt_opts.zIndex); + } + if (typeof opt_opts.closeBoxMargin !== "undefined") { + + this.closeBoxMargin_ = opt_opts.closeBoxMargin; + } + if (typeof opt_opts.closeBoxURL !== "undefined") { + + this.closeBoxURL_ = opt_opts.closeBoxURL; + } + if (typeof opt_opts.infoBoxClearance !== "undefined") { + + this.infoBoxClearance_ = opt_opts.infoBoxClearance; + } + if (typeof opt_opts.isHidden !== "undefined") { + + this.isHidden_ = opt_opts.isHidden; + } + + if (typeof opt_opts.enableEventPropagation !== "undefined") { + + this.enableEventPropagation_ = opt_opts.enableEventPropagation; + } + + if (this.div_) { + + this.draw(); + } +}; + +/** + * Sets the content of the InfoBox. + * The content can be plain text or HTML. + * @param {string} content + */ +InfoBox.prototype.setContent = function (content) { + + this.content_ = content; + + if (this.div_) { + + if (this.closeListener_) { + + google.maps.event.removeListener(this.closeListener_); + this.closeListener_ = null; + } + + // Odd code required to make things work with MSIE. + // + if (!this.fixedWidthSet_) { + + this.div_.style.width = ""; + } + + this.div_.innerHTML = this.getCloseBoxImg_() + content; + + // Perverse code required to make things work with MSIE. + // (Ensures the close box does, in fact, float to the right.) + // + if (!this.fixedWidthSet_) { + + this.div_.style.width = this.div_.offsetWidth + "px"; + this.div_.innerHTML = this.getCloseBoxImg_() + content; + } + + this.addClickHandler_(); + } + + /** + * This event is fired when the content of the InfoBox changes. + * @name InfoBox#content_changed + * @event + */ + google.maps.event.trigger(this, "content_changed"); +}; + +/** + * Sets the geographic location of the InfoBox. + * @param {LatLng} latlng + */ +InfoBox.prototype.setPosition = function (latlng) { + + this.position_ = latlng; + + if (this.div_) { + + this.draw(); + } + + /** + * This event is fired when the position of the InfoBox changes. + * @name InfoBox#position_changed + * @event + */ + google.maps.event.trigger(this, "position_changed"); +}; + +/** + * Sets the zIndex style for the InfoBox. + * @param {number} index + */ +InfoBox.prototype.setZIndex = function (index) { + + this.zIndex_ = index; + + if (this.div_) { + + this.div_.style.zIndex = index; + } + + /** + * This event is fired when the zIndex of the InfoBox changes. + * @name InfoBox#zindex_changed + * @event + */ + google.maps.event.trigger(this, "zindex_changed"); +}; + +/** + * Returns the content of the InfoBox. + * @returns {string} + */ +InfoBox.prototype.getContent = function () { + + return this.content_; +}; + +/** + * Returns the geographic location of the InfoBox. + * @returns {LatLng} + */ +InfoBox.prototype.getPosition = function () { + + return this.position_; +}; + +/** + * Returns the zIndex for the InfoBox. + * @returns {number} + */ +InfoBox.prototype.getZIndex = function () { + + return this.zIndex_; +}; + +/** + * Shows the InfoBox. + */ +InfoBox.prototype.show = function () { + + this.isHidden_ = false; + this.div_.style.visibility = "visible"; +}; + +/** + * Hides the InfoBox. + */ +InfoBox.prototype.hide = function () { + + this.isHidden_ = true; + this.div_.style.visibility = "hidden"; +}; + +/** + * Adds the InfoBox to the specified map. If anchor + * (usually a google.maps.Marker) is specified, the position + * of the InfoBox is set to the position of the anchor. + * @param {Map} map + * @param {MVCObject} [anchor] + */ +InfoBox.prototype.open = function (map, anchor) { + + if (anchor) { + + this.position_ = anchor.getPosition(); + } + + this.setMap(map); + + if (this.div_) { + + this.panBox_(); + } +}; + +/** + * Removes the InfoBox from the map. + */ +InfoBox.prototype.close = function () { + + if (this.closeListener_) { + + google.maps.event.removeListener(this.closeListener_); + this.closeListener_ = null; + } + + if (this.eventListener1_) { + + google.maps.event.removeListener(this.eventListener1_); + google.maps.event.removeListener(this.eventListener2_); + google.maps.event.removeListener(this.eventListener3_); + this.eventListener1_ = null; + this.eventListener2_ = null; + this.eventListener3_ = null; + } + + if (this.contextListener_) { + + google.maps.event.removeListener(this.contextListener_); + this.contextListener_ = null; + } + + this.setMap(null); +};