feat(deployed): add mod_bt_googlemaps 2.1.0 (no-source, vetted live)
BT Google Maps module (BowThemes); registration-gated vendor -> deployed files. Signed-off-by: LÁZÁR Imre <imre@illusion.hu> Assisted-by: claude-code@claude-opus-4-8
@ -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;
|
||||||
|
}
|
||||||
@ -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 */
|
||||||
@ -0,0 +1 @@
|
|||||||
|
<html><body bgcolor="#FFFFFF"></body></html>
|
||||||
@ -0,0 +1,62 @@
|
|||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* @package formfield
|
||||||
|
* @version 2.0
|
||||||
|
* @created April 2012
|
||||||
|
|
||||||
|
* @author BowThemes
|
||||||
|
* @email support@bowthems.com
|
||||||
|
* @website http://bowthemes.com
|
||||||
|
* @support Forum - http://bowthemes.com/forum/
|
||||||
|
* @copyright Copyright (C) 2011 Bowthemes. All rights reserved.
|
||||||
|
* @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
// no direct access
|
||||||
|
defined('_JEXEC') or die('Restricted access');
|
||||||
|
|
||||||
|
jimport('joomla.form.formfield');
|
||||||
|
|
||||||
|
class JFormFieldAsset extends JFormField {
|
||||||
|
|
||||||
|
protected $type = 'Asset';
|
||||||
|
|
||||||
|
protected function getInput() {
|
||||||
|
|
||||||
|
$checkJqueryLoaded = false;
|
||||||
|
$document = JFactory::getDocument();
|
||||||
|
$header = $document->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;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
?>
|
||||||
@ -0,0 +1,37 @@
|
|||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* @package formfields
|
||||||
|
* @version 1.0.0
|
||||||
|
* @created Oct 2012
|
||||||
|
* @author BowThemes
|
||||||
|
* @email support@bowthems.com
|
||||||
|
* @website http://bowthemes.com
|
||||||
|
* @support Forum - http://bowthemes.com/forum/
|
||||||
|
* @copyright Copyright (C) 2012 Bowthemes. All rights reserved.
|
||||||
|
* @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
// no direct access
|
||||||
|
defined('_JEXEC') or die('Restricted access');
|
||||||
|
|
||||||
|
jimport('joomla.form.formfield');
|
||||||
|
|
||||||
|
class JFormFieldButton extends JFormField{
|
||||||
|
|
||||||
|
protected $type = 'button';
|
||||||
|
protected function getLabel() {
|
||||||
|
return '';
|
||||||
|
}
|
||||||
|
protected function getInput() {
|
||||||
|
|
||||||
|
$name = $this->element['name'];
|
||||||
|
$text = $this->element['text'];
|
||||||
|
$html = '<button id="bt-'.$name.'" class="bt-button">'.$text.'</button>';
|
||||||
|
|
||||||
|
return $html;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
?>
|
||||||
@ -0,0 +1 @@
|
|||||||
|
<html><body bgcolor="#FFFFFF"></body></html>
|
||||||
@ -0,0 +1,336 @@
|
|||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* @package formfields
|
||||||
|
* @version 1.0.0
|
||||||
|
* @created Oct 2011
|
||||||
|
* @author BowThemes
|
||||||
|
* @email support@bowthems.com
|
||||||
|
* @website http://bowthemes.com
|
||||||
|
* @support Forum - http://bowthemes.com/forum/
|
||||||
|
* @copyright Copyright (C) 2012 Bowthemes. All rights reserved.
|
||||||
|
* @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
// no direct access
|
||||||
|
defined('_JEXEC') or die('Restricted access');
|
||||||
|
|
||||||
|
jimport('joomla.form.formfield');
|
||||||
|
|
||||||
|
class JFormFieldMarkers extends JFormField{
|
||||||
|
protected $type = 'markers';
|
||||||
|
|
||||||
|
protected static $initialisedMedia = false;
|
||||||
|
|
||||||
|
protected function getLabel(){
|
||||||
|
return '';
|
||||||
|
|
||||||
|
}
|
||||||
|
protected function getInput() {
|
||||||
|
|
||||||
|
$checkJqueryLoaded = false;
|
||||||
|
$document = JFactory::getDocument();
|
||||||
|
$header = $document->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 =
|
||||||
|
' <div id="btg-message" class="clearfix" style="clear:both;"></div>'
|
||||||
|
. ' <ul id="btg-warning"></ul>'
|
||||||
|
. '<ul id="bt-makers">'
|
||||||
|
. ' <li id="btg-main-button">'
|
||||||
|
. ' <label> </label>'
|
||||||
|
. ' <span id="btnAddMarker" class="btt-green-btn" versionjl="'.JVERSION.'" baseurl=" '.JURI::root().'">' . JText::_('MOD_BT_GOOGLE_MAP_ADD_MARKER_LABEL') . '</span>'
|
||||||
|
. ' <span id="btnDeleteAll" class="btt-red-btn">' . JText::_('MOD_BT_GOOGLE_MAP_DELETE_ALL_MARKER_LABEL') . '</span>'
|
||||||
|
. ' </li>'
|
||||||
|
. ' <li id="marker-form"> </li>'
|
||||||
|
. ' <li >'
|
||||||
|
. ' <div class="btg-head">' . JText::_('MARKER_LIST') . '</div>'
|
||||||
|
. ' <input id="btg-hidden" type="hidden" name="' . $this->name . '" value="' . $this->value . '" />'
|
||||||
|
. ' <ul id="btg-markers-container" class="clearfix adminformlist"></ul>'
|
||||||
|
. ' </li>'
|
||||||
|
. '</ul>';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 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[]= '<label class="hasTip" title="'.JText::_('BT_GOOGLE_MAP_ICON_MARKER_DESC').'" for="btg-'.$key.'" aria-invalid="false">'.JText::_('BT_GOOGLE_MAP_ICON_MARKER_LABEL').'</label>';
|
||||||
|
$htmlMedia[] = '<div class="fltlft">';
|
||||||
|
$htmlMedia[] = ' <input type="text" name="media-google-map['.$key.']" id="btg-'.$key.'" value="" readonly="readonly" ' . $attr . ' />';
|
||||||
|
$htmlMedia[] = '</div>';
|
||||||
|
|
||||||
|
// The button.
|
||||||
|
$htmlMedia[] = '<div class="button2-left">';
|
||||||
|
$htmlMedia[] = ' <div class="blank">';
|
||||||
|
$htmlMedia[] = ' <a class="modal"'
|
||||||
|
.'title="' . JText::_('JLIB_FORM_BUTTON_SELECT') . '"'
|
||||||
|
. ' href="index.php?option=com_media&view=images&tmpl=component&asset=' . $asset . '&fieldid=btg-'.$key. '&folder=' . '"'
|
||||||
|
. ' rel="{handler: 'iframe', size: {x: 800, y: 500}}">';
|
||||||
|
$htmlMedia[] = JText::_('JLIB_FORM_BUTTON_SELECT') . '</a>';
|
||||||
|
$htmlMedia[] = ' </div>';
|
||||||
|
$htmlMedia[] = '</div>';
|
||||||
|
|
||||||
|
$htmlMedia[] = '<div class="button2-left">';
|
||||||
|
$htmlMedia[] = ' <div class="blank">';
|
||||||
|
$htmlMedia[] = ' <a title="' . JText::_('JLIB_FORM_BUTTON_CLEAR') . '"' . ' href="#" onclick="';
|
||||||
|
$htmlMedia[] = 'jInsertFieldValue('', 'btg-' . $key . '');';
|
||||||
|
$htmlMedia[] = 'return false;';
|
||||||
|
$htmlMedia[] = '">';
|
||||||
|
$htmlMedia[] = JText::_('JLIB_FORM_BUTTON_CLEAR') . '</a>';
|
||||||
|
$htmlMedia[] = ' </div>';
|
||||||
|
$htmlMedia[] = '</div>';
|
||||||
|
|
||||||
|
$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 = '<div id="btg-' . $key . '_preview_img"' . ($src ? '' : ' style="display:none"') . '>' . $img . '</div>';
|
||||||
|
$previewImgEmpty = '<div id="btg-' .$key . '_preview_empty"' . ($src ? ' style="display:none"' : '') . '>'
|
||||||
|
. JText::_('JLIB_FORM_MEDIA_PREVIEW_EMPTY') . '</div>';
|
||||||
|
|
||||||
|
$htmlMedia[] = '<div class="media-preview fltlft">';
|
||||||
|
|
||||||
|
$htmlMedia[] = ' ' . $previewImgEmpty;
|
||||||
|
$htmlMedia[] = ' ' . $previewImg;
|
||||||
|
|
||||||
|
$htmlMedia[] = '</div>';
|
||||||
|
}
|
||||||
|
|
||||||
|
$htmlMediaCode[$key] = implode("'\n+'", $htmlMedia);
|
||||||
|
}
|
||||||
|
#end setup to create media field
|
||||||
|
?>
|
||||||
|
<script type="text/javascript">
|
||||||
|
var dialogHtml = '<div id="btg-form-marker"><div class= "btg-messages" id="btg-messages" class="clearfix"></div>'
|
||||||
|
+ '<ul class="btg-dialog-container">'
|
||||||
|
+ ' <li class="marker-title">'
|
||||||
|
+ ' <label for="btg-marker-title" title="<?php echo JText::_('MOD_BT_GOOGLE_MAP_MARKER_TITLE_DESC') ?>"><?php echo JText::_('MOD_BT_GOOGLE_MAP_MARKER_TITLE_LABEL') ?></label>'
|
||||||
|
+ ' <input type="text" name="btg-marker-title" id="btg-marker-title"/>'
|
||||||
|
+ ' <div style="clear:both;"></div>'
|
||||||
|
+ ' </li>'
|
||||||
|
+ ' <li>'
|
||||||
|
+ ' <label for="btg-maker-type" class="hasTip" title="<?php echo JText::_('MOD_BT_GOOGLE_MAP_TYPE_MARKER_DESC') ?>"><?php echo JText::_('MOD_BT_GOOGLE_MAP_TYPE_MARKER_LABEL') ?></label>'
|
||||||
|
+ ' <select name="btg-marker-type" id="btg-marker-type">'
|
||||||
|
+ ' <option value="address">Address</option>'
|
||||||
|
+ ' <option value="coordinate">Coordinate</option>'
|
||||||
|
+ ' </select>'
|
||||||
|
+ ' <div style="clear:both;"></div>'
|
||||||
|
+ ' </li>'
|
||||||
|
+ ' <li class="btg-optional address">'
|
||||||
|
+ ' <label for="btg-marker-address" title ="<?php echo JText::_('MOD_BT_GOOGLE_MAP_ADDRESS_MARKER_DESC') ?>"><?php echo JText::_('MOD_BT_GOOGLE_MAP_ADDRESS_MARKER_LABEL') ?></label>'
|
||||||
|
+ ' <input type="text" name="btg-marker-address" id="btg-marker-address"/>'
|
||||||
|
+ ' <div style="clear:both;"></div>'
|
||||||
|
+ ' </li>'
|
||||||
|
+ ' <li class="btg-optional coordinate">'
|
||||||
|
+ ' <label for="btg-marker-coordinate" title ="<?php echo JText::_('MOD_BT_GOOGLE_MAP_COORDINATE_DESC') ?>"><?php echo JText::_('MOD_BT_GOOGLE_MAP_COORDINATE_LABEL') ?></label>'
|
||||||
|
+ ' <input type="text" name="btg-marker-coordinate" id="btg-marker-coordinate"/>'
|
||||||
|
+ ' <div style="clear:both;"></div>'
|
||||||
|
+ ' </li>'
|
||||||
|
+ ' <li class="btg-icon-marker">'
|
||||||
|
+ ' <?php echo $htmlMediaCode['icon'];?> '
|
||||||
|
+ ' <div style="clear:both;"></div>'
|
||||||
|
+ ' </li>'
|
||||||
|
+ ' <li>'
|
||||||
|
+ ' <label for="btg-maker-showInfoOnload" title="<?php echo JText::_('MOD_BT_GOOGLE_MAP_SHOWINFO_ONLOAD_DESC') ?>"><?php echo JText::_('MOD_BT_GOOGLE_MAP_SHOWINFO_ONLOAD_LABEL') ?></label>'
|
||||||
|
+ ' <select name="btg-marker-showInfoOnload" class="bt_switch" id="btg-marker-showInfoOnload">'
|
||||||
|
+ ' <option value="1">Yes</option>'
|
||||||
|
+ ' <option value="0">No</option>'
|
||||||
|
+ ' </select>'
|
||||||
|
+ ' <div style="clear:both;"></div>'
|
||||||
|
+ ' </li>'
|
||||||
|
+ ' <li class="btg-infowindow">'
|
||||||
|
+ ' <label for="btg-infowindow" title ="<?php echo JText::_('MOD_BT_GOOGLE_MAP_INFO_WINDOW_DESC') ?>"><?php echo JText::_('MOD_BT_GOOGLE_MAP_INFO_WINDOW_LABEL') ?></label>'
|
||||||
|
+ ' <textarea type="text" name="btg-infowindow" id="btg-infowindow"></textarea>'
|
||||||
|
+ ' <div style="clear:both;"></div>'
|
||||||
|
+ ' </li>'
|
||||||
|
+ ' <li id="btg-submit-btn">'
|
||||||
|
+ ' <span id="btnCreateMarker" class="btg-green-btn btg-panel-btn"><?php echo JText::_('MOD_BT_GOOGLE_MAP_BUTTON_CREATE_MARKER') ?></span>'
|
||||||
|
+ ' <span id="btnUpdateMarker" class="btg-green-btn btg-panel-btn"><?php echo JText::_('MOD_BT_GOOGLE_MAP_BUTTON_UPDATE_MARKER') ?></span>'
|
||||||
|
+ ' <span id="btnCancel" class="btg-red-btn btg-panel-btn"><?php echo JText::_('MOD_BT_GOOGLE_MAP_BUTTON_CANCEL') ?></span>'
|
||||||
|
+ ' </li>'
|
||||||
|
+ '</ul>'
|
||||||
|
+ '<div style="clear:both;"></div>'
|
||||||
|
+ '</div>'
|
||||||
|
+ '<script type="text/javascript">'
|
||||||
|
+ 'window.addEvent("domready", function() {'
|
||||||
|
+ ' SqueezeBox.initialize({});'
|
||||||
|
+ ' SqueezeBox.assign($$("a.modal"), {'
|
||||||
|
+ ' parse: "rel"'
|
||||||
|
+ ' });'
|
||||||
|
+ '});'
|
||||||
|
+ '<\/script>';
|
||||||
|
|
||||||
|
|
||||||
|
var jQ = jQuery.noConflict();
|
||||||
|
|
||||||
|
jQ(document).ready(function(){
|
||||||
|
|
||||||
|
//init form preview
|
||||||
|
var markerList = new BT.MarkerList({
|
||||||
|
liveURL : '<?php echo JURI::root() . 'modules/mod_bt_googlemaps' ?>',
|
||||||
|
warningText: {
|
||||||
|
tabTitleRequired: '<?php echo JText::_('MARKER_TITLE_REQUIRED') ?>',
|
||||||
|
tabValueRequired: '<?php echo JText::_('MARKER_POSITION_REQUIRED') ?>',
|
||||||
|
addMarkerSuccess: '<?php echo JText::_('ADD_MARKER_SUCCESS') ?>',
|
||||||
|
updateMarkerSuccess: '<?php echo JText::_('UPDATE_MARKER_SUCCESS') ?>',
|
||||||
|
confirmDeleteAll: '<?php echo JText::_('CONFIRM_DELETE_ALL') ?>',
|
||||||
|
confirmDelete: '<?php echo JText::_('CONFIRM_DELETE') ?>',
|
||||||
|
deleteAllSuccess: '<?php echo JText::_('DELETE_ALL_SUCCESS') ?>'
|
||||||
|
},
|
||||||
|
dialogTemplate: dialogHtml,
|
||||||
|
encodedItems : '<?php echo $this->value ?>',
|
||||||
|
moduleID: '<?php echo $moduleID ?>',
|
||||||
|
container: 'btg-markers-container',
|
||||||
|
messageContainer: 'btg-warning',
|
||||||
|
btnCreateID: '#btnCreateMarker',
|
||||||
|
btnUpdateID: '#btnUpdateMarker',
|
||||||
|
btnCancelID: '#btnCancel'
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Open marker options when click add marker
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
jQ("#btnAddMarker").click(function(){
|
||||||
|
markerList.openDialog();
|
||||||
|
|
||||||
|
return false;
|
||||||
|
});
|
||||||
|
/**
|
||||||
|
* Close all options when click cancel
|
||||||
|
*/
|
||||||
|
|
||||||
|
//remove all
|
||||||
|
jQ('#btnDeleteAll').click(function(){
|
||||||
|
if(jQ('#btg-markers-container li').length > 0 )
|
||||||
|
markerList.removeAll();
|
||||||
|
return false;
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
</script>
|
||||||
|
<?php
|
||||||
|
return $html;
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,201 @@
|
|||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* @package formfields
|
||||||
|
* @version 1.0.0
|
||||||
|
* @created Oct 2011
|
||||||
|
* @author BowThemes
|
||||||
|
* @email support@bowthems.com
|
||||||
|
* @website http://bowthemes.com
|
||||||
|
* @support Forum - http://bowthemes.com/forum/
|
||||||
|
* @copyright Copyright (C) 2012 Bowthemes. All rights reserved.
|
||||||
|
* @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
// no direct access
|
||||||
|
defined('_JEXEC') or die('Restricted access');
|
||||||
|
|
||||||
|
jimport('joomla.form.formfield');
|
||||||
|
|
||||||
|
class JFormFieldStyles extends JFormField{
|
||||||
|
protected $type = 'styles';
|
||||||
|
protected function getLabel(){
|
||||||
|
return '';
|
||||||
|
|
||||||
|
}
|
||||||
|
protected function getInput() {
|
||||||
|
|
||||||
|
$html = ' <div id="btg-style-message" class="clearfix" style="clear:both;"></div>'
|
||||||
|
. ' <ul id="btg-style-warning"></ul>'
|
||||||
|
. '<ul id="btg-style">'
|
||||||
|
. ' <li id="btg-style-main-button">'
|
||||||
|
. ' <label> </label>'
|
||||||
|
. ' <span id="btnAddStyle" class="btg-green-btn" versionjl="'.JVERSION.'" baseurl=" '.JURI::root().'">' . JText::_('MOD_BT_GOOGLE_MAP_ADD_STYLE_LABEL') . '</span>'
|
||||||
|
. ' <span id="btnDeleteAllStyle" class="btg-red-btn">' . JText::_('MOD_BT_GOOGLE_MAP_DELETE_ALL_STYLE_LABEL') . '</span>'
|
||||||
|
. ' </li>'
|
||||||
|
. ' <li id="style-form"> </li>'
|
||||||
|
. ' <li >'
|
||||||
|
. ' <div class="btg-style-head">' . JText::_('STYLE_LIST') . '</div>'
|
||||||
|
. ' <input id="btg-style-hidden" type="hidden" name="' . $this->name . '" value="' . $this->value . '" />'
|
||||||
|
. ' <ul id="btg-styles-container" class="clearfix adminformlist">'
|
||||||
|
. ' </ul>'
|
||||||
|
. ' </li>'
|
||||||
|
. '</ul>';
|
||||||
|
$moduleID = $this->form->getValue('id');
|
||||||
|
if ($moduleID == '')
|
||||||
|
$moduleID = 0;
|
||||||
|
|
||||||
|
?>
|
||||||
|
<script type="text/javascript">
|
||||||
|
// setup for manager Styles
|
||||||
|
var dialogStyleHtml = '<div id="btg-form-style"><div class= "btg-messages" id="btg-sylte-messages" class="clearfix"></div>'
|
||||||
|
+ '<ul class="btg-style-dialog-container">'
|
||||||
|
+ ' <li >'
|
||||||
|
+ ' <label for="btg-feature-type" title="<?php echo JText::_('MOD_BT_GOOGLE_MAP_FEATURE_TYPE_DESC') ?>"><?php echo JText::_('MOD_BT_GOOGLE_MAP_FEATURE_TYPE_LABEL') ?></label>'
|
||||||
|
+ ' <select id="btg-feature-type" name="btg-feature-type" >'
|
||||||
|
+ ' <option value="all">All</option>'
|
||||||
|
+ ' <option value="administrative">Administrative</option>'
|
||||||
|
+ ' <option value="administrative.country">Country</option>'
|
||||||
|
+ ' <option value="administrative.province">Province</option>'
|
||||||
|
+ ' <option value="administrative.locality">Locality</option>'
|
||||||
|
+ ' <option value="administrative.neighborhood">Neighborhood</option>'
|
||||||
|
+ ' <option value="administrative.land_parcel">Land Parcel</option>'
|
||||||
|
+ ' <option value="landscape">Land Scape</option>'
|
||||||
|
+ ' <option value="landscape.man_made">Man Made</option>'
|
||||||
|
+ ' <option value="landscape.natural">Natural</option>'
|
||||||
|
+ ' <option value="poi">Point of interest(Poi)</option>'
|
||||||
|
+ ' <option value="poi.attraction">Poi.Attractioin</option>'
|
||||||
|
+ ' <option value="poi.business">Poi.Business</option>'
|
||||||
|
+ ' <option value="poi.government">Poi.Goverment</option>'
|
||||||
|
+ ' <option value="poi.medical">Poi.Medical</option>'
|
||||||
|
+ ' <option value="poi.park">Poi.Park</option>'
|
||||||
|
+ ' <option value="poi.place_of_worship">Poi.Place of Worship</option>'
|
||||||
|
+ ' <option value="poi.school">Poi.School</option>'
|
||||||
|
+ ' <option value="poi.sports_complex">Poi.Sports Complex</option>'
|
||||||
|
+ ' <option value="road">Road</option>'
|
||||||
|
+ ' <option value="road.arterial">Road.Arterial</option>'
|
||||||
|
+ ' <option value="road.highway">Road.Highway</option>'
|
||||||
|
+ ' <option value="road.highway.controlled_access">Road.Highway.Controlled Access</option>'
|
||||||
|
+ ' <option value="road.local">Road.Local</option>'
|
||||||
|
+ ' <option value="transit">Transit</option>'
|
||||||
|
+ ' <option value="transit.line">Transit.Line</option>'
|
||||||
|
+ ' <option value="transit.station">Transit.Station</option>'
|
||||||
|
+ ' <option value="transit.station.airport">Transit.Station.Airport</option>'
|
||||||
|
+ ' <option value="transit.station.bus">Transit.Station.Bus</option>'
|
||||||
|
+ ' <option value="transit.station.rail">Transit.Station.Rail</option>'
|
||||||
|
+ ' <option value="water">Water</option>'
|
||||||
|
+ ' </select>'
|
||||||
|
+ ' </li>'
|
||||||
|
+ ' <li>'
|
||||||
|
+ ' <label for="btg-style-element-type" title="<?php echo JText::_('MOD_BT_GOOGLE_MAP_STYLE_ELEMENT_TYPE_DESC') ?>"><?php echo JText::_('MOD_BT_GOOGLE_MAP_STYLE_ELEMENT_TYPE_LABEL') ?></label>'
|
||||||
|
+ ' <select name="btg-style-element-type" id="btg-style-element-type">'
|
||||||
|
+ ' <option value="all">All</option>'
|
||||||
|
+ ' <option value="geometry">Geometry</option>'
|
||||||
|
+ ' <option value="geometry.fill">Geometry.Fill</option>'
|
||||||
|
+ ' <option value="geometry.stroke">Geometry.Stroke</option>'
|
||||||
|
+ ' <option value="labels">Labels</option>'
|
||||||
|
+ ' <option value="labels.icon">Labels.Icon</option>'
|
||||||
|
+ ' <option value="labels.text">Labels.Text</option>'
|
||||||
|
+ ' <option value="labels.text.fill">Labels.Text.Fill</option>'
|
||||||
|
+ ' <option value="labels.text.stroke">Labels.Text.Stroke</option>'
|
||||||
|
+ ' </select>'
|
||||||
|
+ ' </li>'
|
||||||
|
+ ' <li >'
|
||||||
|
+ ' <label for="btg-style-visibility" title ="<?php echo JText::_('MOD_BT_GOOGLE_MAP_STYLE_VISIBILITY_DESC') ?>"><?php echo JText::_('MOD_BT_GOOGLE_MAP_STYLE_VISIBILITY_LABEL') ?></label>'
|
||||||
|
+ ' <select id="btg-style-visibility" name="btg-style-visibility">'
|
||||||
|
+ ' <option value="">None</option>'
|
||||||
|
+ ' <option value="simply">Simply</option>'
|
||||||
|
+ ' <option value="on">On</option>'
|
||||||
|
+ ' <option value="off">Off</option>'
|
||||||
|
+ ' </select>'
|
||||||
|
+ ' </li>'
|
||||||
|
+ ' <li >'
|
||||||
|
+ ' <label for="btg-style-invert-lightness" title ="<?php echo JText::_('MOD_BT_GOOGLE_MAP_STYLE_INVERT_LIGHTNESS_DESC') ?>"><?php echo JText::_('MOD_BT_GOOGLE_MAP_STYLE_INVERT_LIGHTNESS_LABEL') ?></label>'
|
||||||
|
+ ' <select id="btg-style-invert-lightness" name="btg-style-invert-lightness" class="bt_switch">'
|
||||||
|
+ ' <option value="false">No</option>'
|
||||||
|
+ ' <option value="true">Yes</option>'
|
||||||
|
+ ' </select>'
|
||||||
|
+ ' </li>'
|
||||||
|
+ ' <li >'
|
||||||
|
+ ' <label for="btg-style-map-color" title="<?php echo JText::_('MOD_BT_GOOGLE_MAP_MAP_COLOR_DESC') ?>"><?php echo JText::_('MOD_BT_GOOGLE_MAP_MAP_COLOR_LABEL') ?></label>'
|
||||||
|
+ ' <input type="text" id="btg-style-map-color" name="btg-style-map-color" class="bt_color"/>'
|
||||||
|
+ ' </li>'
|
||||||
|
+ ' <li >'
|
||||||
|
+ ' <label for="btg-style-weight" title="<?php echo JText::_('MOD_BT_GOOGLE_MAP_STYLE_WEIGHT_DESC') ?>"><?php echo JText::_('MOD_BT_GOOGLE_MAP_STYLE_WEIGHT_LABEL') ?></label>'
|
||||||
|
+ ' <input type="text" id="btg-style-weight" name="btg-style-weight" />'
|
||||||
|
+ ' </li>'
|
||||||
|
+ ' <li >'
|
||||||
|
+ ' <label for="btg-style-hue" title="<?php echo JText::_('MOD_BT_GOOGLE_MAP_STYLE_HUE_DESC') ?>"><?php echo JText::_('MOD_BT_GOOGLE_MAP_STYLE_HUE_LABEL') ?></label>'
|
||||||
|
+ ' <input type="text" id="btg-style-hue" name="btg-style-hue" class="bt_color"/>'
|
||||||
|
+ ' </li>'
|
||||||
|
+ ' <li >'
|
||||||
|
+ ' <label for="btg-style-saturation" title="<?php echo JText::_('MOD_BT_GOOGLE_MAP_STYLE_SATURATION_DESC') ?>"><?php echo JText::_('MOD_BT_GOOGLE_MAP_STYLE_SATURATION_LABEL') ?></label>'
|
||||||
|
+ ' <input type="text" id="btg-style-saturation" name="btg-style-saturation" />'
|
||||||
|
+ ' </li>'
|
||||||
|
+ ' <li >'
|
||||||
|
+ ' <label for="btg-style-lightness" title="<?php echo JText::_('MOD_BT_GOOGLE_MAP_STYLE_LIGHTNESS_DESC') ?>"><?php echo JText::_('MOD_BT_GOOGLE_MAP_STYLE_LIGHTNESS_LABEL') ?></label>'
|
||||||
|
+ ' <input type="text" name="btg-style-lightness" id="btg-style-lightness"/>'
|
||||||
|
+ ' </li>'
|
||||||
|
+ ' <li >'
|
||||||
|
+ ' <label for="btg-style-gamma" title ="<?php echo JText::_('MOD_BT_GOOGLE_MAP_STYLE_GAMMA_DESC') ?>"><?php echo JText::_('MOD_BT_GOOGLE_MAP_STYLE_GAMMA_LABEL') ?></label>'
|
||||||
|
+ ' <input type="text" name="btg-style-gamma" id="btg-style-gamma"/>'
|
||||||
|
+ ' </li>'
|
||||||
|
+ ' <li id="btg-submit-btn">'
|
||||||
|
+ ' <span id="btnCreateStyle" class="btg-green-btn btg-panel-btn"><?php echo JText::_('MOD_BT_GOOGLE_MAP_BUTTON_CREATE_STYLE') ?></span>'
|
||||||
|
+ ' <span id="btnUpdateStyle" class="btg-green-btn btg-panel-btn"><?php echo JText::_('MOD_BT_GOOGLE_MAP_BUTTON_UPDATE_STYLE') ?></span>'
|
||||||
|
+ ' <span id="btnCancel" class="btg-red-btn btg-panel-btn"><?php echo JText::_('MOD_BT_GOOGLE_MAP_BUTTON_CANCEL') ?></span>'
|
||||||
|
+ ' </li>'
|
||||||
|
+ '</ul>'
|
||||||
|
+ '<div style="clear:both"></div>'
|
||||||
|
+ '</div>';
|
||||||
|
|
||||||
|
var jQ = jQuery.noConflict();
|
||||||
|
|
||||||
|
jQ(document).ready(function(){
|
||||||
|
//init form preview
|
||||||
|
var styleList = new BT.StyleList({
|
||||||
|
liveURL : '<?php echo JURI::root() . 'modules/mod_bt_googlemaps' ?>',
|
||||||
|
warningText: {
|
||||||
|
addStyleSuccess: '<?php echo JText::_('ADD_STYLE_SUCCESS') ?>',
|
||||||
|
updateStyleSuccess: '<?php echo JText::_('UPDATE_STYLE_SUCCESS') ?>',
|
||||||
|
confirmDeleteAll: '<?php echo JText::_('CONFIRM_DELETE_ALL') ?>',
|
||||||
|
confirmDelete: '<?php echo JText::_('CONFIRM_DELETE') ?>',
|
||||||
|
deleteAllSuccess: '<?php echo JText::_('DELETE_ALL_SUCCESS') ?>'
|
||||||
|
},
|
||||||
|
dialogTemplate: dialogStyleHtml,
|
||||||
|
encodedItems : '<?php echo $this->value ?>',
|
||||||
|
moduleID: '<?php echo $moduleID ?>',
|
||||||
|
container: 'btg-styles-container',
|
||||||
|
messageContainer: 'btg-warning',
|
||||||
|
btnCreateID: '#btnCreateStyle',
|
||||||
|
btnUpdateID: '#btnUpdateStyle',
|
||||||
|
btnCancelID: '#btnCancel'
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Open style options when click add style
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
jQ("#btnAddStyle").click(function(){
|
||||||
|
styleList.openDialog();
|
||||||
|
|
||||||
|
return false;
|
||||||
|
});
|
||||||
|
/**
|
||||||
|
* Close all options when click cancel
|
||||||
|
*/
|
||||||
|
|
||||||
|
//remove all
|
||||||
|
jQ('#btnDeleteAllStyle').click(function(){
|
||||||
|
if(jQ('#btg-styles-container li').length > 0 )
|
||||||
|
styleList.removeAll();
|
||||||
|
return false;
|
||||||
|
});
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<?php
|
||||||
|
|
||||||
|
return $html;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
After Width: | Height: | Size: 64 B |
|
After Width: | Height: | Size: 67 B |
|
After Width: | Height: | Size: 2.8 KiB |
|
After Width: | Height: | Size: 539 B |
|
After Width: | Height: | Size: 975 B |
|
After Width: | Height: | Size: 726 B |
|
After Width: | Height: | Size: 742 B |
|
After Width: | Height: | Size: 152 B |
@ -0,0 +1 @@
|
|||||||
|
<html><body bgcolor="#FFFFFF"></body></html>
|
||||||
|
After Width: | Height: | Size: 9.1 KiB |
|
After Width: | Height: | Size: 13 KiB |
|
After Width: | Height: | Size: 1.4 KiB |
|
After Width: | Height: | Size: 1.5 KiB |
|
After Width: | Height: | Size: 582 B |
@ -0,0 +1 @@
|
|||||||
|
<html><body bgcolor="#FFFFFF"></body></html>
|
||||||
@ -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();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
})
|
||||||
|
|
||||||
@ -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');
|
||||||
|
})
|
||||||
|
|
||||||
106
deployed/mod_bt_googlemaps/modules/mod_bt_googlemaps/admin/js/btbase64.min.js
vendored
Normal file
@ -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
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})();
|
||||||
@ -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('<div>', {
|
||||||
|
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('<div>').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 = '<div class="div-marker">'
|
||||||
|
+ '<div class="marker_title marker-title-label">'
|
||||||
|
+ '<span class="value">'+marker.markerTitle+'</span>'
|
||||||
|
+ '</div>'
|
||||||
|
+ '<div class="marker_type marker-title-label-hide">'
|
||||||
|
+ '<span class="label">Type of marker : </span>'
|
||||||
|
+ '<span class="value">'+marker.markerType +'</span>'
|
||||||
|
+ '</div>'
|
||||||
|
+ '<div class="marker_value marker-title-label-hide">'
|
||||||
|
+ '<span class="label">Marker Position : </span>'
|
||||||
|
+ '<span class="value">'+ marker.markerValue +'</span>'
|
||||||
|
+ '</div>'
|
||||||
|
+ '<div class="marker-icon marker-title-label-hide">'
|
||||||
|
+ '<span class="label">Icon : </span>'
|
||||||
|
+ '<span class="value" style="display:none">' + marker.markerIcon +'</span>'
|
||||||
|
+ '<img class="img-marker" src="../'+marker.markerIcon+'"/>'
|
||||||
|
+ '</div>'
|
||||||
|
+ '<div class="marker-show-infowindow marker-title-label-hide">'
|
||||||
|
+ '<span class="label">Show Infowindow : </span>'
|
||||||
|
+ '<span class="value">'+this.htmlEntities(marker.markerShowInfoWindow)+'</span>'
|
||||||
|
+ '</div>'
|
||||||
|
+ '<div class="marker-infowindow marker-title-label-hide">'
|
||||||
|
+ '<span class="label">Infowindow : </span>'
|
||||||
|
+ '<span class="value">'+this.htmlEntities(marker.markerInfoWindow)+'</span>'
|
||||||
|
+ '</div>'
|
||||||
|
+ '<div class="edit-remove-link"><a href="javascript:void(0)" class="edit">Edit</a><a href="javascript:void(0)" class="remove">Remove</a><div class="clear"></div></div>';
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
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('<div>').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","<b>Delete marker successful</b>")
|
||||||
|
},
|
||||||
|
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, '>').replace(/"/g, '"');
|
||||||
|
}
|
||||||
|
})
|
||||||
|
})();
|
||||||
@ -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('<div>', {
|
||||||
|
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('<div>').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 ='<div class="div-style">'
|
||||||
|
+ ' <div class="style-feature-type style-title-label"><span class="label">Feature Type : </span><span class="value">'+style.featureType+'</span></div>'
|
||||||
|
+ ' <div class="style-element-type style-title-label"><span class="label">Element Type : </span><span class="value">'+style.elementType+'</span></div>'
|
||||||
|
+ ' <div class="style-stylers-label style-title-label">Stylers :</div>'
|
||||||
|
+ ' <div class="style-stylers style-title-label">'
|
||||||
|
+ ' <div class="style-stylers-element visibility style-title-label"><span class="label">Visibility : </span><span class="value">'+style.visibility+'</span></div>'
|
||||||
|
+ ' <div class="style-stylers-element invert-lightness style-title-label"><span class="label">Invert Lightness : </span><span class="value">'+ style.invertLightness +'</span></div>'
|
||||||
|
+ ' <div class="style-stylers-element color style-title-label"><span class="label">Color : </span><span class="value">'+style.mapColor+'</span></div>'
|
||||||
|
+ ' <div class="style-stylers-element weight style-title-label"><span class="label">Weight : </span><span class="value">'+style.weight+'</span></div>'
|
||||||
|
+ ' <div class="style-stylers-element hue style-title-label"><span class="label">Hue : </span><span class="value">'+style.hue+'</span></div>'
|
||||||
|
+ ' <div class="style-stylers-element saturation style-title-label"><span class="label">Saturation : </span><span class="value">'+style.saturation+'</span></div>'
|
||||||
|
+ ' <div class="style-stylers-element lightness style-title-label"><span class="label">Lightness : </span><span class="value">'+style.lightness+'</span></div>'
|
||||||
|
+ ' <div class="style-stylers-element gamma style-title-label"><span class="label">Gamma : </span><span class="value">'+style.gamma+'</span></div>'
|
||||||
|
+ ' </div>'
|
||||||
|
+ ' <div class="edit-remove-link"><a href="javascript:void(0)" class="edit">Edit</a><a href="javascript:void(0)" class="remove">Remove</a><div class="clear"></div></div>'
|
||||||
|
+ ' </div>';
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
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('<div>').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","<b>Delete style successful</b>")
|
||||||
|
},
|
||||||
|
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, '>').replace(/"/g, '"');
|
||||||
|
}
|
||||||
|
})
|
||||||
|
})();
|
||||||
899
deployed/mod_bt_googlemaps/modules/mod_bt_googlemaps/admin/js/chosen.jquery.min.js
vendored
Normal file
@ -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 '<li id="' + option.dom_id + '" class="' + classes.join(' ') + '"' + style + '>' + option.html + '</li>';
|
||||||
|
} 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 = $("<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('<ul class="chzn-choices"><li class="search-field"><input type="text" value="' + this.default_text + '" class="default" autocomplete="off" style="width:25px;" /></li></ul><div class="chzn-drop" style="left:-9000px;"><ul class="chzn-results"></ul></div>');
|
||||||
|
} else {
|
||||||
|
container_div.html('<a href="javascript:void(0)" class="chzn-single"><span>' + this.default_text + '</span><div><b></b></div></a><div class="chzn-drop" style="left:-9000px;"><div class="chzn-search"><input type="text" autocomplete="off" /></div><ul class="chzn-results"></ul></div>');
|
||||||
|
}
|
||||||
|
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 '<li id="' + group.dom_id + '" class="group-result">' + $("<div />").text(group.label).html() + '</li>';
|
||||||
|
} 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('<li class="search-choice" id="' + choice_id + '"><span>' + item.html + '</span><a href="javascript:void(0)" class="search-choice-close" rel="' + item.array_index + '"></a></li>');
|
||||||
|
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("<abbr class=\"search-choice-close\"></abbr>");
|
||||||
|
}
|
||||||
|
};
|
||||||
|
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 ? "" : $('<div/>').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) + '</em>' + option.html.substr(startpos + searchText.length);
|
||||||
|
text = text.substr(0, startpos) + '<em>' + 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 = $('<li class="no-results">' + this.results_none_found + ' "<span></span>"</li>');
|
||||||
|
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 = $('<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);
|
||||||
|
After Width: | Height: | Size: 49 B |
@ -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;
|
||||||
|
}
|
||||||
@ -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 = '<div class="colorpicker"><div class="colorpicker_color"><div><div></div></div></div><div class="colorpicker_hue"><div></div></div><div class="colorpicker_new_color"></div><div class="colorpicker_current_color"></div><div class="colorpicker_hex"><input type="text" maxlength="6" size="6" /></div><div class="colorpicker_rgb_r colorpicker_field"><input type="text" maxlength="3" size="3" /><span></span></div><div class="colorpicker_rgb_g colorpicker_field"><input type="text" maxlength="3" size="3" /><span></span></div><div class="colorpicker_rgb_b colorpicker_field"><input type="text" maxlength="3" size="3" /><span></span></div><div class="colorpicker_hsb_h colorpicker_field"><input type="text" maxlength="3" size="3" /><span></span></div><div class="colorpicker_hsb_s colorpicker_field"><input type="text" maxlength="3" size="3" /><span></span></div><div class="colorpicker_hsb_b colorpicker_field"><input type="text" maxlength="3" size="3" /><span></span></div><div class="colorpicker_submit"></div></div>',
|
||||||
|
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<len; i++) {
|
||||||
|
o.push('0');
|
||||||
|
}
|
||||||
|
o.push(hex);
|
||||||
|
hex = o.join('');
|
||||||
|
}
|
||||||
|
return hex;
|
||||||
|
},
|
||||||
|
HexToRGB = function (hex) {
|
||||||
|
var hex = parseInt(((hex.indexOf('#') > -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)
|
||||||
|
After Width: | Height: | Size: 1.9 KiB |
|
After Width: | Height: | Size: 532 B |
|
After Width: | Height: | Size: 970 B |
|
After Width: | Height: | Size: 1012 B |
|
After Width: | Height: | Size: 1.1 KiB |
|
After Width: | Height: | Size: 86 B |
|
After Width: | Height: | Size: 10 KiB |
|
After Width: | Height: | Size: 970 B |
|
After Width: | Height: | Size: 1.0 KiB |
|
After Width: | Height: | Size: 1.0 KiB |
|
After Width: | Height: | Size: 78 B |
|
After Width: | Height: | Size: 984 B |
|
After Width: | Height: | Size: 1.9 KiB |
|
After Width: | Height: | Size: 562 B |
|
After Width: | Height: | Size: 1.1 KiB |
|
After Width: | Height: | Size: 970 B |
|
After Width: | Height: | Size: 1.1 KiB |
|
After Width: | Height: | Size: 86 B |
|
After Width: | Height: | Size: 1008 B |
|
After Width: | Height: | Size: 1.0 KiB |
|
After Width: | Height: | Size: 1018 B |
|
After Width: | Height: | Size: 997 B |
@ -0,0 +1 @@
|
|||||||
|
<html><body bgcolor="#FFFFFF"></body></html>
|
||||||
|
After Width: | Height: | Size: 506 B |
|
After Width: | Height: | Size: 518 B |
|
After Width: | Height: | Size: 315 B |
@ -0,0 +1 @@
|
|||||||
|
<html><body bgcolor="#FFFFFF"></body></html>
|
||||||
4
deployed/mod_bt_googlemaps/modules/mod_bt_googlemaps/admin/js/jquery.min.js
vendored
Normal file
@ -0,0 +1,56 @@
|
|||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* @package mod_bt_googlemaps - BT Google Maps
|
||||||
|
* @version 2.0.5
|
||||||
|
* @created Jun 2012
|
||||||
|
|
||||||
|
* @author BowThemes
|
||||||
|
* @email support@bowthems.com
|
||||||
|
* @website http://bowthemes.com
|
||||||
|
* @support Forum - http://bowthemes.com/forum/
|
||||||
|
* @copyright Copyright (C) 2012 Bowthemes. All rights reserved.
|
||||||
|
* @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
// no direct access
|
||||||
|
defined('_JEXEC') or die('Restricted access');
|
||||||
|
|
||||||
|
|
||||||
|
class modbt_googlemapsHelper
|
||||||
|
{
|
||||||
|
public static function fetchHead($params, $module){
|
||||||
|
$document = JFactory::getDocument();
|
||||||
|
$mainframe = JFactory::getApplication();
|
||||||
|
$template = $mainframe->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');
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1 @@
|
|||||||
|
<html><body bgcolor="#FFFFFF"></body></html>
|
||||||
@ -0,0 +1,26 @@
|
|||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* @package mod_bt_googlemaps - BT Google Maps
|
||||||
|
* @version 2.0.5
|
||||||
|
* @created Jun 2012
|
||||||
|
|
||||||
|
* @author BowThemes
|
||||||
|
* @email support@bowthems.com
|
||||||
|
* @website http://bowthemes.com
|
||||||
|
* @support Forum - http://bowthemes.com/forum/
|
||||||
|
* @copyright Copyright (C) 2012 Bowthemes. All rights reserved.
|
||||||
|
* @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
// no direct access
|
||||||
|
defined ( '_JEXEC' ) or die ( 'Restricted access' );
|
||||||
|
|
||||||
|
// Include the syndicate functions only once
|
||||||
|
require_once (dirname ( __FILE__ ) . '/helper.php');
|
||||||
|
modbt_googlemapsHelper::fetchHead ( $params, $module );
|
||||||
|
|
||||||
|
require (JModuleHelper::getLayoutPath ( 'mod_bt_googlemaps' ));
|
||||||
|
|
||||||
|
?>
|
||||||
|
|
||||||
@ -0,0 +1,326 @@
|
|||||||
|
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||||
|
<extension
|
||||||
|
type="module"
|
||||||
|
client="site"
|
||||||
|
method="upgrade">
|
||||||
|
<name>BT Google Maps</name>
|
||||||
|
<author>BowThemes</author>
|
||||||
|
<creationDate>Jun 2012</creationDate>
|
||||||
|
<copyright>Copyright (C) 2016 Bowthemes. All rights reserved.</copyright>
|
||||||
|
<license>http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL</license>
|
||||||
|
<authorEmail>support@bowthemes.com</authorEmail>
|
||||||
|
<authorUrl>http://www.bowthemes.com</authorUrl>
|
||||||
|
<version>2.1.0</version>
|
||||||
|
<description>
|
||||||
|
<![CDATA[
|
||||||
|
<div class="bt_description">
|
||||||
|
<h3>BT Google Maps Module Version 2.1.0</h3>
|
||||||
|
<a href="http://bowthemes.com" target="_blank"><img src="../modules/mod_bt_googlemaps/admin/images/mod_bt_googlemaps.png"></a>
|
||||||
|
<p>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...
|
||||||
|
</p>
|
||||||
|
<br clear="both" />
|
||||||
|
<h3>Features</h3>
|
||||||
|
<ul class="list-style">
|
||||||
|
<li>Google Maps Version 3 (Latest)</li>
|
||||||
|
<li>Support both input types: Address and Coordinate </li>
|
||||||
|
<li>Retrieving lat/long of location using Geocoder</li>
|
||||||
|
<li>Auto-Detect Language</li>
|
||||||
|
<li>Streetview, MapOverview, ZoomControl, PanControl, ScaleControl, MapTypeControl</li>
|
||||||
|
<li>Support Multiple Marker( Easy customize title, icon, description popup)</li>
|
||||||
|
<li>Weather & cloud layers</li>
|
||||||
|
<li>Support custom map style</li>
|
||||||
|
<li>Support custom inforwindow style</li>
|
||||||
|
<li>Multiple module instances</li>
|
||||||
|
<li>The configuration is very easy and simple</li>
|
||||||
|
<li>Compatibility with Joomla 1.6, 1.7, 2.5 & Joomla 3.x</li>
|
||||||
|
<li>Cross Browser Support: IE7+, Firefox 2+, Safari 3+, Chrome 8+, Opera 9+</li>
|
||||||
|
</ul>
|
||||||
|
<h3>Upgrade versions</h3>
|
||||||
|
<p>
|
||||||
|
Your current versions is 2.1.0. <a target="_blank" href="http://bowthemes.com/bt-google-map.html">Find our latest versions now</a>
|
||||||
|
</p>
|
||||||
|
<h3>Userful links</h3>
|
||||||
|
<ul>
|
||||||
|
<li><a target="_blank" href="http://bowthemes.com/bt-google-map.html">Video tutorials</a></li>
|
||||||
|
<li><a target="_blank" href="http://bowthemes.com/forums/27-bt-google-map-module/">Report bug</a></li>
|
||||||
|
<li><a target="_blank" href="http://bowthemes.com/forums/27-bt-google-map-module/">Forum support</a></li>
|
||||||
|
</ul>
|
||||||
|
<h3>About bow themes & copyright</h3>
|
||||||
|
<p>
|
||||||
|
Bow Themes is Professional Joomla template provider. We are focused on creating unique, attractive and clean templates without loosing flexibility and simplicity of customization
|
||||||
|
</p>
|
||||||
|
Copyright (C) 2016 BowThemes
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<style>
|
||||||
|
.bt_description{
|
||||||
|
text-align: left;
|
||||||
|
}
|
||||||
|
.bt_description h3{
|
||||||
|
text-transform: uppercase;
|
||||||
|
margin: 20px 0px 10px 0px;
|
||||||
|
}
|
||||||
|
.bt_description img{
|
||||||
|
float:left;
|
||||||
|
margin:5px 5px 5px 0px;
|
||||||
|
}
|
||||||
|
.bt_description p,.bt_description li{
|
||||||
|
list-style: none outside none;
|
||||||
|
padding: 5px 5px 5px 20px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.bt_description ul.list-style li{
|
||||||
|
background:url(../modules/mod_bt_googlemaps/admin/images/tick.png) 0px 6px no-repeat;
|
||||||
|
padding-left:30px;
|
||||||
|
line-height:15px;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
]]>
|
||||||
|
</description>
|
||||||
|
<files>
|
||||||
|
<filename module="mod_bt_googlemaps">mod_bt_googlemaps.php</filename>
|
||||||
|
<filename module="mod_bt_googlemaps">helper.php</filename>
|
||||||
|
<filename module="mod_bt_googlemaps">index.html</filename>
|
||||||
|
<folder module="mod_bt_googlemaps">tmpl</folder>
|
||||||
|
<folder module="mod_bt_googlemaps">admin</folder>
|
||||||
|
</files>
|
||||||
|
<languages>
|
||||||
|
<language tag="en-GB">en-GB.mod_bt_googlemaps.ini</language>
|
||||||
|
</languages>
|
||||||
|
<config>
|
||||||
|
<fields name="params">
|
||||||
|
<fieldset name="basic">
|
||||||
|
<field
|
||||||
|
name="mapType"
|
||||||
|
type="list"
|
||||||
|
default="roadmap"
|
||||||
|
label="MOD_BT_GOOGLEMAPS_MAP_TYPE" description="MOD_BT_GOOGLEMAPS_MAP_TYPE_DESC">
|
||||||
|
<option value="hybrid">Hybrid</option>
|
||||||
|
<option value="roadmap">Roadmap</option>
|
||||||
|
<option value="satellite">Satellite</option>
|
||||||
|
<option value="terrain">Terrain</option>
|
||||||
|
</field>
|
||||||
|
<field name="mapCenterType" type="radio" default="address" class="btn-group" label="MOD_BT_GOOGLEMAPS_MAPCENTER_TYPE_LABEL" description="MOD_BT_GOOGLEMAPS_MAPCENTER_TYPE_DESC">
|
||||||
|
<option value="address">Address</option>
|
||||||
|
<option value="coordinate">Coordinate</option>
|
||||||
|
</field>
|
||||||
|
<field name="mapCenterAddress" default="New York, United States" type="text" label="MOD_BT_GOOGLEMAPS_MAPCENTER_ADDRESS_LABEL" description="MOD_BT_GOOGLEMAPS_MAPCENTER_ADDRESS_DESC"></field>
|
||||||
|
<field name="mapCenterCoordinate" default="40.7143528, -74.0059731" type="text" label="MOD_BT_GOOGLEMAPS_MAPCENTER_COORDINATE_LABEL" description="MOD_BT_GOOGLEMAPS_MAPCENTER_COORDINATE_DESC"></field>
|
||||||
|
<field
|
||||||
|
name="width"
|
||||||
|
type="text"
|
||||||
|
default="auto"
|
||||||
|
label="MOD_BT_GOOGLEMAPS_WIDTH"
|
||||||
|
description="MOD_BT_GOOGLEMAPS_WIDTH_DESC">
|
||||||
|
</field>
|
||||||
|
<field
|
||||||
|
name="height"
|
||||||
|
type="text"
|
||||||
|
default="350"
|
||||||
|
label="MOD_BT_GOOGLEMAPS_HEIGHT"
|
||||||
|
description="MOD_BT_GOOGLEMAPS_HEIGHT_DESC">
|
||||||
|
</field>
|
||||||
|
<field
|
||||||
|
name="zoom"
|
||||||
|
type="text"
|
||||||
|
default="13"
|
||||||
|
label="MOD_BT_GOOGLEMAPS_ZOOM"
|
||||||
|
description="MOD_BT_GOOGLEMAPS_ZOOM_DESC">
|
||||||
|
</field>
|
||||||
|
<field
|
||||||
|
name="zoomControl"
|
||||||
|
type="radio"
|
||||||
|
class="btn-group"
|
||||||
|
default="true"
|
||||||
|
label="MOD_BT_GOOGLEMAPS_ZOOMCONTROL"
|
||||||
|
description="MOD_BT_GOOGLEMAPS_ZOOMCONTROL_DESC">
|
||||||
|
<option value="true">JYES</option>
|
||||||
|
<option value="false">JNO</option>
|
||||||
|
</field>
|
||||||
|
<field
|
||||||
|
name="panControl"
|
||||||
|
type="radio"
|
||||||
|
default="true"
|
||||||
|
class="btn-group"
|
||||||
|
label="MOD_BT_GOOGLEMAPS_PANCONTROL"
|
||||||
|
description="MOD_BT_GOOGLEMAPS_PANCONTROL_DESC">
|
||||||
|
<option value="true">JYES</option>
|
||||||
|
<option value="false">JNO</option>
|
||||||
|
</field>
|
||||||
|
<field
|
||||||
|
name="mapTypeControl"
|
||||||
|
type="radio"
|
||||||
|
default="true"
|
||||||
|
class="btn-group"
|
||||||
|
label="MOD_BT_GOOGLEMAPS_MAPTYPECONTROL"
|
||||||
|
description="MOD_BT_GOOGLEMAPS_MAPTYPECONTROL_DESC">
|
||||||
|
<option value="true">JYES</option>
|
||||||
|
<option value="false">JNO</option>
|
||||||
|
</field>
|
||||||
|
<field
|
||||||
|
name="scaleControl"
|
||||||
|
type="radio"
|
||||||
|
default="true"
|
||||||
|
class="btn-group"
|
||||||
|
label="MOD_BT_GOOGLEMAPS_SCALECONTROL"
|
||||||
|
description="MOD_BT_GOOGLEMAPS_SCALECONTROL_DESC">
|
||||||
|
<option value="true">JYES</option>
|
||||||
|
<option value="false">JNO</option>
|
||||||
|
</field>
|
||||||
|
<field
|
||||||
|
name="overviewMapControl"
|
||||||
|
type="radio"
|
||||||
|
default="true"
|
||||||
|
class="btn-group"
|
||||||
|
label="MOD_BT_GOOGLEMAPS_OVERVIEWCONTROL"
|
||||||
|
description="MOD_BT_GOOGLEMAPS_OVERVIEWCONTROL_DESC">
|
||||||
|
<option value="true">JYES</option>
|
||||||
|
<option value="false">JNO</option>
|
||||||
|
</field>
|
||||||
|
<field
|
||||||
|
name="streetViewControl"
|
||||||
|
type="radio"
|
||||||
|
default="true"
|
||||||
|
class="btn-group"
|
||||||
|
label="MOD_BT_GOOGLEMAPS_STREETVIEWCONTROL"
|
||||||
|
description="MOD_BT_GOOGLEMAPS_STREETVIEWCONTROL_DESC">
|
||||||
|
<option value="true">JYES</option>
|
||||||
|
<option value="false">JNO</option>
|
||||||
|
</field>
|
||||||
|
<field
|
||||||
|
name="draggable"
|
||||||
|
type="radio"
|
||||||
|
default="true"
|
||||||
|
class="btn-group"
|
||||||
|
label="MOD_BT_GOOGLEMAPS_DRAGGABLE"
|
||||||
|
description="MOD_BT_GOOGLEMAPS_DRAGGABLE_DESC">
|
||||||
|
<option value="true">JYES</option>
|
||||||
|
<option value="false">JNO</option>
|
||||||
|
</field>
|
||||||
|
<field
|
||||||
|
name="disableDoubleClickZoom"
|
||||||
|
type="radio"
|
||||||
|
default="false"
|
||||||
|
class="btn-group"
|
||||||
|
label="MOD_BT_GOOGLEMAPS_DISABLEDOUBLECLICKZOOM"
|
||||||
|
description="MOD_BT_GOOGLEMAPS_DISABLEDOUBLECLICKZOOM_DESC">
|
||||||
|
<option value="true">JYES</option>
|
||||||
|
<option value="false">JNO</option>
|
||||||
|
</field>
|
||||||
|
<field
|
||||||
|
name="scrollwheel"
|
||||||
|
type="radio"
|
||||||
|
default="true"
|
||||||
|
class="btn-group"
|
||||||
|
label="MOD_BT_GOOGLEMAPS_SCROLLWHEEL"
|
||||||
|
description="MOD_BT_GOOGLEMAPS_SCROLLWHEEL_DESC">
|
||||||
|
<option value="true">JYES</option>
|
||||||
|
<option value="false">JNO</option>
|
||||||
|
</field>
|
||||||
|
<field name="enable_map_api" default="1" type="radio" class="btn-group bt_group"
|
||||||
|
label="MOD_BT_GOOGLEMAPS_ENABLE_MAP_API"
|
||||||
|
description="MOD_BT_GOOGLEMAPS_ENABLE_MAP_API_DESC">
|
||||||
|
<option value="0">JNO</option>
|
||||||
|
<option value="1">JYES</option>
|
||||||
|
</field>
|
||||||
|
<field
|
||||||
|
name="map_api"
|
||||||
|
type="text"
|
||||||
|
class="enable_map_api"
|
||||||
|
default=""
|
||||||
|
label="MOD_BT_GOOGLEMAPS_API"
|
||||||
|
description="MOD_BT_GOOGLEMAPS_API_DESC">
|
||||||
|
</field>
|
||||||
|
</fieldset>
|
||||||
|
<fieldset name="markers-manager" label="MARKERS_MANAGER" addfieldpath="/modules/mod_bt_googlemaps/admin/formfield">
|
||||||
|
<field type="markers" name="markes" label="BTG_MARKERS_LABEL" description="BTG_MARKERS_DESC"/>
|
||||||
|
</fieldset>
|
||||||
|
<fieldset name="weather_cloud" label="MOD_BT_GOOGLEMAPS_WEATHER_CLOUD">
|
||||||
|
<field
|
||||||
|
name="weather"
|
||||||
|
type="radio"
|
||||||
|
default="0"
|
||||||
|
class="btn-group bt_group"
|
||||||
|
label="MOD_BT_GOOGLEMAPS_SHOW_WEATHER"
|
||||||
|
description="MOD_BT_GOOGLEMAPS_SHOW_WEATHER_DESC">
|
||||||
|
<option value="1">JYES</option>
|
||||||
|
<option value="0">JNO</option>
|
||||||
|
</field>
|
||||||
|
<field name="owm_api" type="text"
|
||||||
|
label="MOD_BT_GOOGLEMAPS_OPEN_WEATHER_MAP_API" description="MOD_BT_GOOGLEMAPS_OPEN_WEATHER_MAP_API_DESC"/>
|
||||||
|
<field
|
||||||
|
name="temperatureUnit"
|
||||||
|
type="radio"
|
||||||
|
default="f"
|
||||||
|
class="weather btn-group"
|
||||||
|
label="MOD_BT_GOOGLEMAPS_TEMPERATUREUNIT"
|
||||||
|
description="MOD_BT_GOOGLEMAPS_TEMPERATUREUNIT_DESC">
|
||||||
|
<option value="f">FAHRENHEIT</option>
|
||||||
|
<option value="c">CELSIUS</option>
|
||||||
|
</field>
|
||||||
|
<field name="replace_marker_icon" default="1" type="radio" class="weather btn-group"
|
||||||
|
label="MOD_BT_GOOGLEMAPS_REPLACE_MARKER_ICON"
|
||||||
|
description="MOD_BT_GOOGLEMAPS_REPLACE_MARKER_ICON_DESC">
|
||||||
|
<option value="0">JNO</option>
|
||||||
|
<option value="1">JYES</option>
|
||||||
|
</field>
|
||||||
|
<field name="display_weather_info" default="1" type="radio" class="weather btn-group"
|
||||||
|
label="MOD_BT_GOOGLEMAPS_DISPLAY_WEATHER_INFO"
|
||||||
|
description="MOD_BT_GOOGLEMAPS_DISPLAY_WEATHER_INFO_DESC">
|
||||||
|
<option value="0">JNO</option>
|
||||||
|
<option value="1">JYES</option>
|
||||||
|
</field>
|
||||||
|
|
||||||
|
</fieldset>
|
||||||
|
<fieldset name="styles-manager" label="STYLES_MANAGER" addfieldpath="/modules/mod_bt_googlemaps/admin/formfield">
|
||||||
|
<field name="enable-style" type="radio" default="0" class="btn-group" label="MOD_BT_GOOGLEMAPS_ENABLE_STYLE_LABEL" description="MOD_BT_GOOGLEMAPS_ENABLE_STYLE_DESC">
|
||||||
|
<option value="1">JYES</option>
|
||||||
|
<option value="0">JNO</option>
|
||||||
|
</field>
|
||||||
|
<field name="style-title" default="BT Map" type="text" label="MOD_BT_GOOGLEMAPS_STYLE_TITLE_LABEL" description="MOD_BT_GOOGLEMAPS_STYLE_TITLE_DESC"/>
|
||||||
|
<field name="createNewOrApplyDefaultStyle" type="radio" class="btn-group" default="createNew" label="MOD_BT_GOOGLEMAPS_CREATE_NEW_OR_DEFAULT_STYLE_LABEL" description="MOD_BT_GOOGLEMAPS_CREATE_NEW_OR_DEFAULT_STYLE_DESC">
|
||||||
|
<option value="createNew">MOD_BT_GOOGLEMAPS_CREATE_NEW</option>
|
||||||
|
<option value="applyDefault">MOD_BT_GOOGLEMAPS_APPLY_DEFAULT</option>
|
||||||
|
</field>
|
||||||
|
<field type="styles" name="styles" label="BTG_STYLES_LABEL" description="BTG_STYLES_DESC" />
|
||||||
|
</fieldset>
|
||||||
|
<fieldset name="custom-infobox" label="CUSTOM_INFOBOX">
|
||||||
|
<field name="enable-custom-infobox" type="radio" default="0" class="bt_group btn-group" label="BTG_ENABLE_CUSTOM_INFORBOX_LABEL" description="BTG_ENABLE_CUSTOM_INFORBOX_DESC">
|
||||||
|
<option value="1">JYES</option>
|
||||||
|
<option value="0">JNO</option>
|
||||||
|
</field>
|
||||||
|
<field type="textarea" rows="10" cols="30" class="option-custom-infobox" default="background :#ffffff, opacity : 0.85, width : 280px, height :100px, border : 1px solid grey, borderRadius:3px, padding : 10px, boxShadow:30px 10px 10px 1px grey" name="boxcss" label="BTG_BOXCSS_LABEL" description="BTG_BOXCSS_DESC" />
|
||||||
|
<field type="text" default="-150,-155" name="pixelOffset" class="option-custom-infobox" label="BTG_BOX_OFFSET_LABEL" description="BTG_BOX_OFFSET_DESC" />
|
||||||
|
<field type="text" default="-9px" name="closeBoxMargin" class="option-custom-infobox" label="closeButton Margin" description="closeButton Margin" />
|
||||||
|
<field type="media" name="closeBoxURL" default="" label="closeButton image" description="closeButton image" />
|
||||||
|
</fieldset>
|
||||||
|
<fieldset name="advanced">
|
||||||
|
<field
|
||||||
|
name="moduleclass_sfx"
|
||||||
|
type="text"
|
||||||
|
label="COM_MODULES_FIELD_MODULECLASS_SFX_LABEL"
|
||||||
|
description="COM_MODULES_FIELD_MODULECLASS_SFX_DESC" />
|
||||||
|
<field
|
||||||
|
name="cache"
|
||||||
|
type="list"
|
||||||
|
class="btn-group"
|
||||||
|
default="1"
|
||||||
|
label="COM_MODULES_FIELD_CACHING_LABEL"
|
||||||
|
description="COM_MODULES_FIELD_CACHING_DESC">
|
||||||
|
<option
|
||||||
|
value="1">JGLOBAL_USE_GLOBAL</option>
|
||||||
|
<option
|
||||||
|
value="0">COM_MODULES_FIELD_VALUE_NOCACHING</option>
|
||||||
|
</field>
|
||||||
|
<field
|
||||||
|
name="cache_time"
|
||||||
|
type="text"
|
||||||
|
default="900"
|
||||||
|
label="COM_MODULES_FIELD_CACHE_TIME_LABEL"
|
||||||
|
description="COM_MODULES_FIELD_CACHE_TIME_DESC" />
|
||||||
|
<field addfieldpath="/modules/mod_bt_googlemaps/admin/formfield" type="asset" name="asset" path="modules/mod_bt_googlemaps/admin/" />
|
||||||
|
</fieldset>
|
||||||
|
|
||||||
|
</fields>
|
||||||
|
</config>
|
||||||
|
</extension>
|
||||||
@ -0,0 +1,4 @@
|
|||||||
|
@CHARSET "ISO-8859-1";
|
||||||
|
.bt-googlemaps img{
|
||||||
|
max-width: none!important;
|
||||||
|
}
|
||||||
@ -0,0 +1,86 @@
|
|||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* @package mod_bt_googlemaps - BT Google Maps
|
||||||
|
* @version 2.0.5
|
||||||
|
* @created Jun 2012
|
||||||
|
|
||||||
|
* @author BowThemes
|
||||||
|
* @email support@bowthems.com
|
||||||
|
* @website http://bowthemes.com
|
||||||
|
* @support Forum - http://bowthemes.com/forum/
|
||||||
|
* @copyright Copyright (C) 2012 Bowthemes. All rights reserved.
|
||||||
|
* @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
// no direct access
|
||||||
|
defined('_JEXEC') or die('Restricted access');
|
||||||
|
?>
|
||||||
|
<div id="cavas_id<?php echo $module->id; ?>" class="bt-googlemaps"></div>
|
||||||
|
<?php
|
||||||
|
$script = '';
|
||||||
|
$script .= 'var config = {';
|
||||||
|
$script .= 'mapType :\''.$params->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 '<script type="text/javascript">'.$script.'</script>';
|
||||||
|
|
||||||
|
?>
|
||||||
|
After Width: | Height: | Size: 72 B |
|
After Width: | Height: | Size: 2.8 KiB |
@ -0,0 +1 @@
|
|||||||
|
<html><body bgcolor="#FFFFFF"></body></html>
|
||||||
|
After Width: | Height: | Size: 1.7 KiB |
|
After Width: | Height: | Size: 1.5 KiB |
@ -0,0 +1 @@
|
|||||||
|
<html><body bgcolor="#FFFFFF"></body></html>
|
||||||
105
deployed/mod_bt_googlemaps/modules/mod_bt_googlemaps/tmpl/js/btbase64.min.js
vendored
Normal file
@ -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
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})();
|
||||||
@ -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 += '<p class="weather-info">'
|
||||||
|
+ '<img src="' + 'http://openweathermap.org/img/w/' + markerSource.weatherInfo.weather[0].icon + '.png' + '" alt=""/><br/>'
|
||||||
|
+ markerSource.weatherInfo.main.temp + '°' + (configs.temperatureUnit == 'c' ? 'C' : 'F') + '<br/>'
|
||||||
|
+ markerSource.weatherInfo.weather[0].main
|
||||||
|
+ '</p>';
|
||||||
|
}
|
||||||
|
|
||||||
|
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();
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1 @@
|
|||||||
|
<html><body bgcolor="#FFFFFF"></body></html>
|
||||||
@ -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 <tt>OverlayView</tt> class.
|
||||||
|
* <p>
|
||||||
|
* An InfoBox behaves like a <tt>google.maps.InfoWindow</tt>, but it supports several
|
||||||
|
* additional properties for advanced styling. An InfoBox can also be used as a map label.
|
||||||
|
* <p>
|
||||||
|
* An InfoBox also fires the same events as a <tt>google.maps.InfoWindow</tt>.
|
||||||
|
* <p>
|
||||||
|
* Browsers tested:
|
||||||
|
* <p>
|
||||||
|
* Mac -- Safari (4.0.4), Firefox (3.6), Opera (10.10), Chrome (4.0.249.43), OmniWeb (5.10.1)
|
||||||
|
* <br>
|
||||||
|
* Win -- Safari, Firefox, Opera, Chrome (3.0.195.38), Internet Explorer (8.0.6001.18702)
|
||||||
|
* <br>
|
||||||
|
* 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 <tt>open</tt> (default is <tt>false</tt>).
|
||||||
|
* @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 <tt>position</tt>.
|
||||||
|
* @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 <tt>boxStyle</tt> 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 <tt>open</tt> (default is <tt>false</tt>).
|
||||||
|
* @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 <tt>google.maps.MapPanes</tt> object.
|
||||||
|
* @property {boolean} enableEventPropagation Propagate mousedown, click, dblclick,
|
||||||
|
* and contextmenu events in the InfoBox (default is <tt>false</tt> to mimic the behavior
|
||||||
|
* of a <tt>google.maps.InfoWindow</tt>). Set this property to <tt>true</tt> 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 <i>not</i> propagated
|
||||||
|
* for an InfoBox in the "floatPane" pane.
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Creates an InfoBox with the options specified in {@link InfoBoxOptions}.
|
||||||
|
* Call <tt>InfoBox.open</tt> 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 <IMG> tag for the close box.
|
||||||
|
* @private
|
||||||
|
*/
|
||||||
|
InfoBox.prototype.getCloseBoxImg_ = function () {
|
||||||
|
|
||||||
|
var img = "";
|
||||||
|
|
||||||
|
if (this.closeBoxURL_ !== "") {
|
||||||
|
|
||||||
|
img = "<img";
|
||||||
|
img += " src='" + this.closeBoxURL_ + "'";
|
||||||
|
img += " align=right"; // Do this because Opera chokes on style='float: right;'
|
||||||
|
img += " style='";
|
||||||
|
img += " position: relative;"; // Required by MSIE
|
||||||
|
img += " cursor: pointer;";
|
||||||
|
img += " margin: " + this.closeBoxMargin_ + ";";
|
||||||
|
img += "'>";
|
||||||
|
}
|
||||||
|
|
||||||
|
return img;
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Adds the click handler to the InfoBox close box.
|
||||||
|
* @private
|
||||||
|
*/
|
||||||
|
InfoBox.prototype.addClickHandler_ = function () {
|
||||||
|
|
||||||
|
var closeBox;
|
||||||
|
|
||||||
|
if (this.closeBoxURL_ !== "") {
|
||||||
|
|
||||||
|
closeBox = this.div_.firstChild;
|
||||||
|
this.closeListener_ = google.maps.event.addDomListener(closeBox, 'click', this.getCloseClickHandler_());
|
||||||
|
|
||||||
|
} else {
|
||||||
|
|
||||||
|
this.closeListener_ = null;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the function to call when the user clicks the close box of an InfoBox.
|
||||||
|
* @private
|
||||||
|
*/
|
||||||
|
InfoBox.prototype.getCloseClickHandler_ = function () {
|
||||||
|
|
||||||
|
var me = this;
|
||||||
|
|
||||||
|
return function () {
|
||||||
|
|
||||||
|
me.close();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This event is fired when the InfoBox's close box is clicked.
|
||||||
|
* @name InfoBox#closeclick
|
||||||
|
* @event
|
||||||
|
*/
|
||||||
|
google.maps.event.trigger(me, "closeclick");
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Pans the map so that the InfoBox appears entirely within the map's visible area.
|
||||||
|
* @private
|
||||||
|
*/
|
||||||
|
InfoBox.prototype.panBox_ = function (disablePan) {
|
||||||
|
|
||||||
|
if (!disablePan) {
|
||||||
|
|
||||||
|
var map = this.getMap();
|
||||||
|
var bounds = map.getBounds();
|
||||||
|
|
||||||
|
// The degrees per pixel
|
||||||
|
var mapDiv = map.getDiv();
|
||||||
|
var mapWidth = mapDiv.offsetWidth;
|
||||||
|
var mapHeight = mapDiv.offsetHeight;
|
||||||
|
var boundsSpan = bounds.toSpan();
|
||||||
|
var longSpan = boundsSpan.lng();
|
||||||
|
var latSpan = boundsSpan.lat();
|
||||||
|
var degPixelX = longSpan / mapWidth;
|
||||||
|
var degPixelY = latSpan / mapHeight;
|
||||||
|
|
||||||
|
// The bounds of the map
|
||||||
|
var mapWestLng = bounds.getSouthWest().lng();
|
||||||
|
var mapEastLng = bounds.getNorthEast().lng();
|
||||||
|
var mapNorthLat = bounds.getNorthEast().lat();
|
||||||
|
var mapSouthLat = bounds.getSouthWest().lat();
|
||||||
|
|
||||||
|
// The bounds of the box
|
||||||
|
var position = this.position_;
|
||||||
|
var iwOffsetX = this.pixelOffset_.width;
|
||||||
|
var iwOffsetY = this.pixelOffset_.height;
|
||||||
|
var padX = this.infoBoxClearance_.width;
|
||||||
|
var padY = this.infoBoxClearance_.height;
|
||||||
|
var iwWestLng = position.lng() + (iwOffsetX - padX) * degPixelX;
|
||||||
|
var iwEastLng = position.lng() + (iwOffsetX + this.div_.offsetWidth + padX) * degPixelX;
|
||||||
|
var iwNorthLat = position.lat() - (iwOffsetY - padY) * degPixelY;
|
||||||
|
var iwSouthLat = position.lat() - (iwOffsetY + this.div_.offsetHeight + padY) * degPixelY;
|
||||||
|
|
||||||
|
// Calculate center shift
|
||||||
|
var shiftLng =
|
||||||
|
(iwWestLng < mapWestLng ? mapWestLng - iwWestLng : 0) +
|
||||||
|
(iwEastLng > 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 <tt>close</tt> 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 <tt>maxWidth</tt>,
|
||||||
|
* <tt>closeBoxMargin</tt>, <tt>closeBoxURL</tt>, and <tt>enableEventPropagation</tt>
|
||||||
|
* properties have no affect until the current InfoBox is <tt>close</tt>d and a new one
|
||||||
|
* is <tt>open</tt>ed.
|
||||||
|
* @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 <tt>anchor</tt>
|
||||||
|
* (usually a <tt>google.maps.Marker</tt>) is specified, the position
|
||||||
|
* of the InfoBox is set to the position of the <tt>anchor</tt>.
|
||||||
|
* @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);
|
||||||
|
};
|
||||||