Changeset 1087931
- Timestamp:
- 02/12/2015 08:37:12 AM (11 years ago)
- Location:
- travel-search/trunk
- Files:
-
- 20 edited
- 1 copied
-
. (modified) (1 prop)
-
admin/admin-editor-buttons-script.dev.js (modified) (11 diffs)
-
admin/admin-editor-buttons-script.min.js (modified) (1 diff)
-
admin/admin-tinymce-buttons-script.dev.js (modified) (10 diffs)
-
admin/admin-tinymce-buttons-script.min.js (modified) (1 diff)
-
classes/searchboxesSettingsFormRenderer.class.php (modified) (3 diffs)
-
classes/tgSearchboxesRenderer.class.php (modified) (6 diffs)
-
css/tg_searchboxes.dev.css (modified) (2 diffs)
-
css/tg_searchboxes.min.css (modified) (1 diff)
-
images/tg_searchboxes/tab-shade.png (modified) (previous)
-
js/autosuggestion.dev.js (modified) (3 diffs)
-
js/autosuggestion.min.js (modified) (1 diff)
-
js/jquery-ui-datepicker.dev.js (copied) (copied from travel-search/trunk/js/jquery-ui-datepicker.min.js) (1 diff)
-
js/tg_searchboxes_ajax.dev.js (modified) (3 diffs)
-
js/tg_searchboxes_ajax.min.js (modified) (1 diff)
-
js/tg_searchboxes_settings.dev.js (modified) (2 diffs)
-
js/tg_searchboxes_settings.min.js (modified) (2 diffs)
-
js/tg_searchboxes_shortcodes.dev.js (modified) (11 diffs)
-
js/tg_searchboxes_shortcodes.min.js (modified) (1 diff)
-
readme.txt (modified) (2 diffs)
-
travel-search.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
travel-search/trunk
-
Property
svn:global-ignores
set to
.idea
-
Property
svn:global-ignores
set to
-
travel-search/trunk/admin/admin-editor-buttons-script.dev.js
r1044744 r1087931 5 5 if(typeof(serializedFieldsArray) == 'undefined' || serializedFieldsArray.length == 0) 6 6 return ''; 7 returnValue = '';7 var returnValue = ''; 8 8 jQuery.each(serializedFieldsArray, function(i, field){ 9 9 // checking for the "from" field and it's value in the serialized array … … 24 24 if(typeof(serializedFieldsArray) == 'undefined' || serializedFieldsArray.length == 0) 25 25 return ''; 26 returnValue = '';26 var returnValue = ''; 27 27 jQuery.each(serializedFieldsArray, function(i, field){ 28 28 // checking for the "to" field and it's value in the serialized array 29 if( field.name == 'tgsbToAir') {29 if(!returnValue && field.name == 'tgsbToAir' && jQuery(field.obj).parents('form.hotels').length==0) { 30 30 // if the "to" field was found 31 31 if(field.value != TG_Searchboxes_Variables.tgsbDefaultSettings.to_air) { … … 37 37 }); 38 38 return returnValue; 39 }; 39 } 40 function tgsbHotelCity(serializedFieldsArray) { 41 // if the serialized array is not defined or it's length is 0 the return an empty string 42 if(typeof(serializedFieldsArray) == 'undefined' || serializedFieldsArray.length == 0) 43 return ''; 44 var returnValue = ''; 45 jQuery.each(serializedFieldsArray, function(i, field){ 46 // checking for the "to" field and it's value in the serialized array 47 if(!returnValue && field.name == 'tgsbToAir' && jQuery(field.obj).parents('form.hotels').length>0 ) { 48 // if the "to" field was found 49 if(field.value != TG_Searchboxes_Variables.tgsbDefaultSettings.hotel_city) { 50 // if it's value it's not equal to the default value set it as a return value 51 returnValue = '"hotel_city":"'+field.value+'"'; 52 return; 53 } 54 } 55 }); 56 return returnValue; 57 } 58 59 40 60 // getting the "departure date" field form the serialized array 41 61 function tgsbDepartureDate(serializedFieldsArray) { … … 43 63 if(typeof(serializedFieldsArray) == 'undefined' || serializedFieldsArray.length == 0) 44 64 return ''; 45 returnValue = '';65 var returnValue = ''; 46 66 jQuery.each(serializedFieldsArray, function(i, field){ 47 67 // checking for the "departure date" field and it's value in the serialized array 48 if( field.name == 'tgsbDepartureDate') {68 if(!returnValue && field.name == 'tgsbDepartureDate') { 49 69 // if the "departure date" field was found 50 70 if(field.value != TG_Searchboxes_Variables.tgsbDefaultSettings.departure_date) { … … 62 82 if(typeof(serializedFieldsArray) == 'undefined' || serializedFieldsArray.length == 0) 63 83 return ''; 64 returnValue = '';84 var returnValue = ''; 65 85 jQuery.each(serializedFieldsArray, function(i, field){ 66 86 // checking for the "return date" field and it's value in the serialized array 67 if( field.name == 'tgsbReturnDate') {87 if(!returnValue && field.name == 'tgsbReturnDate') { 68 88 if(field.value != TG_Searchboxes_Variables.tgsbDefaultSettings.return_date) { 69 89 // if it's value it's not equal to the default value set it as a return value … … 80 100 if(typeof(serializedFieldsArray) == 'undefined' || serializedFieldsArray.length == 0) 81 101 return ''; 82 returnValue = '';102 var returnValue = ''; 83 103 jQuery.each(serializedFieldsArray, function(i, field){ 84 104 // checking for the "adults" field and it's value in the serialized array 85 if( field.name == 'tgsbAdults') {105 if(!returnValue && field.name == 'tgsbAdults') { 86 106 if(field.value != TG_Searchboxes_Variables.tgsbDefaultSettings.adults) { 87 107 // if it's value it's not equal to the default value set it as a return value … … 99 119 if(typeof(serializedFieldsArray) == 'undefined' || serializedFieldsArray.length == 0) 100 120 return ''; 101 returnValue = '';121 var returnValue = ''; 102 122 jQuery.each(serializedFieldsArray, function(i, field){ 103 123 // checking for the "kids" field and it's value in the serialized array 104 if( field.name == 'tgsbKids') {124 if(!returnValue && field.name == 'tgsbKids') { 105 125 if(field.value != TG_Searchboxes_Variables.tgsbDefaultSettings.kids) { 106 126 // if it's value it's not equal to the default value set it as a return value … … 118 138 if(typeof(serializedFieldsArray) == 'undefined' || serializedFieldsArray.length == 0) 119 139 return ''; 120 returnValue = '';140 var returnValue = ''; 121 141 jQuery.each(serializedFieldsArray, function(i, field){ 122 142 // checking for the "seniors" field and it's value in the serialized array 123 if( field.name == 'tgsbSeniors') {143 if(!returnValue && field.name == 'tgsbSeniors') { 124 144 if(field.value != TG_Searchboxes_Variables.tgsbDefaultSettings.seniors) { 125 145 // if it's value it's not equal to the default value set it as a return value … … 137 157 if(typeof(serializedFieldsArray) == 'undefined' || serializedFieldsArray.length == 0) 138 158 return ''; 139 returnValue = '';159 var returnValue = ''; 140 160 jQuery.each(serializedFieldsArray, function(i, field){ 141 161 // checking for the "rooms" field and it's value in the serialized array 142 if( field.name == 'tgsbRooms') {162 if(!returnValue && field.name == 'tgsbRooms') { 143 163 if(field.value != TG_Searchboxes_Variables.tgsbDefaultSettings.rooms) { 144 164 // if it's value it's not equal to the default value set it as a return value … … 156 176 if(typeof(serializedFieldsArray) == 'undefined' || serializedFieldsArray.length == 0) 157 177 return ''; 158 returnValue = '';178 var returnValue = ''; 159 179 jQuery.each(serializedFieldsArray, function(i, field){ 160 180 // checking for the "rooms" field and it's value in the serialized array 161 if( field.name == 'oneway') {181 if(!returnValue && field.name == 'oneway') { 162 182 field.value = (field.value == 'on') ? true : false; 163 183 if(field.value != TG_Searchboxes_Variables.tgsbDefaultSettings.rtow) { … … 232 252 tgSearchboxMeasures = (tgSearchboxMeasures.length == 0) ? '300x250' : tgSearchboxMeasures; 233 253 var selectedTab = jQuery('.sb'+tgSearchboxMeasures+' .tg_searchbox .tg_container').find('form.sel').attr('class').match(/^(flights|hotels|cars|packages|cruises)/); 234 var fields = jQuery('.sb'+tgSearchboxMeasures+' .tg_searchbox .tg_container form').serializeArray(); 254 var fields = []; 255 jQuery('.sb'+tgSearchboxMeasures+' .tg_searchbox .tg_container form').find("input, select, textarea").each(function(){ 256 fields.push({ 257 name: this.name, 258 value: this.value, 259 obj: this 260 }); 261 }); 235 262 // marks if searchbox should be loaded with JS file or not | Tibi | 2013.04.23 236 263 var loadFromJS = jQuery('#travelSearchUseJavaScript').attr('checked'); 237 264 var optionsString = ''; 238 265 // getting the "from" value 239 tgsb_fromAir = tgsbFromAir(fields);266 var tgsb_fromAir = tgsbFromAir(fields); 240 267 // adding the "from" value to the options string 241 optionsString += (tgsb_fromAir.length) ? tgsb_fromAir+',' : tgsb_fromAir; 242 // getting the "to" value 243 tgsb_toAir = tgsbToAir(fields); 244 // adding the "to" value to the options string 245 optionsString += (tgsb_toAir.length) ? tgsb_toAir+',' : tgsb_toAir; 268 optionsString += (tgsb_fromAir.length) ? tgsb_fromAir+',' : ''; 269 // getting the "to" value 270 var tgsb_toAir = tgsbToAir(fields); 271 // adding the "to" value to the options string 272 optionsString += (tgsb_toAir.length) ? tgsb_toAir+',' : ''; 273 // getting the "to" value 274 var tgsb_hotelCity = tgsbHotelCity(fields); 275 // adding the "to" value to the options string 276 optionsString += (tgsb_hotelCity.length) ? tgsb_hotelCity+',' : ''; 246 277 // getting the "departure date" value 247 tgsb_departureDate = tgsbDepartureDate(fields);278 var tgsb_departureDate = tgsbDepartureDate(fields); 248 279 // adding the "departure date" value to the options string 249 optionsString += (tgsb_departureDate.length) ? tgsb_departureDate+',' : tgsb_departureDate;280 optionsString += (tgsb_departureDate.length) ? tgsb_departureDate+',' : ''; 250 281 // getting the "return date" value 251 tgsb_returnDate = tgsbReturnDate(fields);282 var tgsb_returnDate = tgsbReturnDate(fields); 252 283 // adding the "return date" value to the options string 253 optionsString += (tgsb_returnDate.length) ? tgsb_returnDate+',' : tgsb_returnDate;284 optionsString += (tgsb_returnDate.length) ? tgsb_returnDate+',' : ''; 254 285 // getting the "adults" value 255 tgsb_adults = tgsbAdults(fields);286 var tgsb_adults = tgsbAdults(fields); 256 287 // adding the "adults" value to the options string 257 optionsString += (tgsb_adults.length) ? tgsb_adults+',' : tgsb_adults;288 optionsString += (tgsb_adults.length) ? tgsb_adults+',' : ''; 258 289 // getting the "kids" value 259 tgsb_kids = tgsbKids(fields);290 var tgsb_kids = tgsbKids(fields); 260 291 // adding the "kids" value to the options string 261 optionsString += (tgsb_kids.length) ? tgsb_kids+',' : tgsb_kids;292 optionsString += (tgsb_kids.length) ? tgsb_kids+',' : ''; 262 293 // getting the "seniors" value 263 tgsb_seniors = tgsbSeniors(fields);294 var tgsb_seniors = tgsbSeniors(fields); 264 295 // adding the "seniors" value to the options string 265 optionsString += (tgsb_seniors.length) ? tgsb_seniors+',' : tgsb_seniors;296 optionsString += (tgsb_seniors.length) ? tgsb_seniors+',' : ''; 266 297 // getting the "rooms" value 267 tgsb_rooms = tgsbRooms(fields);298 var tgsb_rooms = tgsbRooms(fields); 268 299 // adding the "seniors" value to the options string 269 optionsString += (tgsb_rooms.length) ? tgsb_rooms+',' : tgsb_rooms;300 optionsString += (tgsb_rooms.length) ? tgsb_rooms+',' : ''; 270 301 // getting the "roundtrip/oneway" value 271 tgsb_rtow = tgsbRTOW(fields);302 var tgsb_rtow = tgsbRTOW(fields); 272 303 // adding the "roundtrip/oneway" value to the options string 273 optionsString += (tgsb_rtow.length) ? tgsb_rtow+',' : tgsb_rtow;304 optionsString += (tgsb_rtow.length) ? tgsb_rtow+',' : ''; 274 305 // adding the cruises parameters to the options string 275 306 optionsString += tgsbCruises(fields); -
travel-search/trunk/admin/admin-editor-buttons-script.min.js
r1044744 r1087931 1 function tgsbFromAir(a){if("undefined"==typeof a||0==a.length)return"";returnValue="";jQuery.each(a,function(a,b){"tgsbFromAir"==b.name&&b.value!=TG_Searchboxes_Variables.tgsbDefaultSettings.from_air&&(returnValue='"from_air":"'+b.value+'"')});return returnValue} 2 function tgsbToAir(a){if("undefined"==typeof a||0==a.length)return"";returnValue="";jQuery.each(a,function(a,b){"tgsbToAir"==b.name&&b.value!=TG_Searchboxes_Variables.tgsbDefaultSettings.to_air&&(returnValue='"to_air":"'+b.value+'"')});return returnValue} 3 function tgsbDepartureDate(a){if("undefined"==typeof a||0==a.length)return"";returnValue="";jQuery.each(a,function(a,b){"tgsbDepartureDate"==b.name&&b.value!=TG_Searchboxes_Variables.tgsbDefaultSettings.departure_date&&(returnValue='"departure_date":"'+b.value+'"')});return returnValue} 4 function tgsbReturnDate(a){if("undefined"==typeof a||0==a.length)return"";returnValue="";jQuery.each(a,function(a,b){"tgsbReturnDate"==b.name&&b.value!=TG_Searchboxes_Variables.tgsbDefaultSettings.return_date&&(returnValue='"return_date":"'+b.value+'"')});return returnValue} 5 function tgsbAdults(a){if("undefined"==typeof a||0==a.length)return"";returnValue="";jQuery.each(a,function(a,b){"tgsbAdults"==b.name&&b.value!=TG_Searchboxes_Variables.tgsbDefaultSettings.adults&&(returnValue='"adults":"'+b.value+'"')});return returnValue} 6 function tgsbKids(a){if("undefined"==typeof a||0==a.length)return"";returnValue="";jQuery.each(a,function(a,b){"tgsbKids"==b.name&&b.value!=TG_Searchboxes_Variables.tgsbDefaultSettings.kids&&(returnValue='"kids":"'+b.value+'"')});return returnValue} 7 function tgsbSeniors(a){if("undefined"==typeof a||0==a.length)return"";returnValue="";jQuery.each(a,function(a,b){"tgsbSeniors"==b.name&&b.value!=TG_Searchboxes_Variables.tgsbDefaultSettings.seniors&&(returnValue='"seniors":"'+b.value+'"')});return returnValue} 8 function tgsbRooms(a){if("undefined"==typeof a||0==a.length)return"";returnValue="";jQuery.each(a,function(a,b){"tgsbRooms"==b.name&&b.value!=TG_Searchboxes_Variables.tgsbDefaultSettings.rooms&&(returnValue='"rooms":"'+b.value+'"')});return returnValue} 9 function tgsbRTOW(a){if("undefined"==typeof a||0==a.length)return"";returnValue="";jQuery.each(a,function(a,b){"oneway"==b.name&&(b.value="on"==b.value?!0:!1,b.value!=TG_Searchboxes_Variables.tgsbDefaultSettings.rtow&&(returnValue='"rtow":"'+b.value+'"'))});return returnValue} 10 function tgsbCruises(a){var e="";jQuery.each(a,function(a,d){!d.value||d.value==TG_Searchboxes_Variables.tgsbDefaultSettings[d.name]||"cruiseline"!=d.name&&"length_of_stay"!=d.name&&"destination"!=d.name&&"month_year"!=d.name||(e+='"'+d.name+'":"'+d.value+'",')});return e}function setAlignment(){var a="alignnone",e=jQuery("#TB_ajaxContent").find("input[name=img_align]");for(i in e)if(1==e[i].checked){a=e[i].value;break}return a} 11 jQuery(document).ready(function(a){function e(){var b=TG_Searchboxes_Editor_Button.str_EditorButtonAjaxURL.replace(/\&\;/ig,"&");tb_show("Travelgrove Searchboxes",b,!1);a("#TB_ajaxContent").width("auto").height("94.5%").click(function(b){b=a(b.target);if(b.is("a.send_searchbox_to_editor")||b.is("input.send_searchbox_to_editor")){b=a("ul.measuresChooser li a.current").text();b=0==b.length?"300x250":b;var d=a(".sb"+b+" .tg_searchbox .tg_container").find("form.sel").attr("class").match(/^(flights|hotels|cars|packages|cruises)/), 12 f=a(".sb"+b+" .tg_searchbox .tg_container form").serializeArray(),e=a("#travelSearchUseJavaScript").attr("checked"),c="";tgsb_fromAir=tgsbFromAir(f);c+=tgsb_fromAir.length?tgsb_fromAir+",":tgsb_fromAir;tgsb_toAir=tgsbToAir(f);c+=tgsb_toAir.length?tgsb_toAir+",":tgsb_toAir;tgsb_departureDate=tgsbDepartureDate(f);c+=tgsb_departureDate.length?tgsb_departureDate+",":tgsb_departureDate;tgsb_returnDate=tgsbReturnDate(f);c+=tgsb_returnDate.length?tgsb_returnDate+",":tgsb_returnDate;tgsb_adults=tgsbAdults(f); 13 c+=tgsb_adults.length?tgsb_adults+",":tgsb_adults;tgsb_kids=tgsbKids(f);c+=tgsb_kids.length?tgsb_kids+",":tgsb_kids;tgsb_seniors=tgsbSeniors(f);c+=tgsb_seniors.length?tgsb_seniors+",":tgsb_seniors;tgsb_rooms=tgsbRooms(f);c+=tgsb_rooms.length?tgsb_rooms+",":tgsb_rooms;tgsb_rtow=tgsbRTOW(f);c+=tgsb_rtow.length?tgsb_rtow+",":tgsb_rtow;c+=tgsbCruises(f);c=c+(e?'"usejavascript":"on",':"")+("300x250"==b?"":'"size":"'+b+'",');c+=null==d?'"selectedTab":"flights"':"flights"==d[1]?"":'"selectedTab":"'+d[1]+ 14 '"';alignment=setAlignment();c+="alignnone"==alignment?"":'"alignment":"'+alignment+'"';c.match(/\,$/)&&(c=c.replace(/\,$/,""));send_to_editor("[tg_searchboxes"+(c.length?" options='{"+c+"}']":"]"))}return!1});return!1}var b=a("#ed_toolbar");if(b){var d=document.createElement("input");d.type="button";d.value=TG_Searchboxes_Editor_Button.str_EditorButtonCaption;d.className="ed_button";d.title=TG_Searchboxes_Editor_Button.str_EditorButtonCaption;d.id="ed_button_tg_searchboxes";b.append(d);a("#ed_button_tg_searchboxes").click(e)}}); 1 function tgsbFromAir(b){if("undefined"==typeof b||0==b.length)return"";var c="";jQuery.each(b,function(b,a){"tgsbFromAir"==a.name&&a.value!=TG_Searchboxes_Variables.tgsbDefaultSettings.from_air&&(c='"from_air":"'+a.value+'"')});return c} 2 function tgsbToAir(b){if("undefined"==typeof b||0==b.length)return"";var c="";jQuery.each(b,function(b,a){c||"tgsbToAir"!=a.name||0!=jQuery(a.obj).parents("form.hotels").length||a.value==TG_Searchboxes_Variables.tgsbDefaultSettings.to_air||(c='"to_air":"'+a.value+'"')});return c} 3 function tgsbHotelCity(b){if("undefined"==typeof b||0==b.length)return"";var c="";jQuery.each(b,function(b,a){!c&&"tgsbToAir"==a.name&&0<jQuery(a.obj).parents("form.hotels").length&&a.value!=TG_Searchboxes_Variables.tgsbDefaultSettings.hotel_city&&(c='"hotel_city":"'+a.value+'"')});return c} 4 function tgsbDepartureDate(b){if("undefined"==typeof b||0==b.length)return"";var c="";jQuery.each(b,function(b,a){c||"tgsbDepartureDate"!=a.name||a.value==TG_Searchboxes_Variables.tgsbDefaultSettings.departure_date||(c='"departure_date":"'+a.value+'"')});return c} 5 function tgsbReturnDate(b){if("undefined"==typeof b||0==b.length)return"";var c="";jQuery.each(b,function(b,a){c||"tgsbReturnDate"!=a.name||a.value==TG_Searchboxes_Variables.tgsbDefaultSettings.return_date||(c='"return_date":"'+a.value+'"')});return c}function tgsbAdults(b){if("undefined"==typeof b||0==b.length)return"";var c="";jQuery.each(b,function(b,a){c||"tgsbAdults"!=a.name||a.value==TG_Searchboxes_Variables.tgsbDefaultSettings.adults||(c='"adults":"'+a.value+'"')});return c} 6 function tgsbKids(b){if("undefined"==typeof b||0==b.length)return"";var c="";jQuery.each(b,function(b,a){c||"tgsbKids"!=a.name||a.value==TG_Searchboxes_Variables.tgsbDefaultSettings.kids||(c='"kids":"'+a.value+'"')});return c}function tgsbSeniors(b){if("undefined"==typeof b||0==b.length)return"";var c="";jQuery.each(b,function(b,a){c||"tgsbSeniors"!=a.name||a.value==TG_Searchboxes_Variables.tgsbDefaultSettings.seniors||(c='"seniors":"'+a.value+'"')});return c} 7 function tgsbRooms(b){if("undefined"==typeof b||0==b.length)return"";var c="";jQuery.each(b,function(b,a){c||"tgsbRooms"!=a.name||a.value==TG_Searchboxes_Variables.tgsbDefaultSettings.rooms||(c='"rooms":"'+a.value+'"')});return c}function tgsbRTOW(b){if("undefined"==typeof b||0==b.length)return"";var c="";jQuery.each(b,function(b,a){c||"oneway"!=a.name||(a.value="on"==a.value?!0:!1,a.value!=TG_Searchboxes_Variables.tgsbDefaultSettings.rtow&&(c='"rtow":"'+a.value+'"'))});return c} 8 function tgsbCruises(b){var c="";jQuery.each(b,function(b,a){!a.value||a.value==TG_Searchboxes_Variables.tgsbDefaultSettings[a.name]||"cruiseline"!=a.name&&"length_of_stay"!=a.name&&"destination"!=a.name&&"month_year"!=a.name||(c+='"'+a.name+'":"'+a.value+'",')});return c}function setAlignment(){var b="alignnone",c=jQuery("#TB_ajaxContent").find("input[name=img_align]");for(i in c)if(1==c[i].checked){b=c[i].value;break}return b} 9 jQuery(document).ready(function(b){function c(){var a=TG_Searchboxes_Editor_Button.str_EditorButtonAjaxURL.replace(/\&\;/ig,"&");tb_show("Travelgrove Searchboxes",a,!1);b("#TB_ajaxContent").width("auto").height("94.5%").click(function(a){a=b(a.target);if(a.is("a.send_searchbox_to_editor")||a.is("input.send_searchbox_to_editor")){a=b("ul.measuresChooser li a.current").text();a=0==a.length?"300x250":a;var c=b(".sb"+a+" .tg_searchbox .tg_container").find("form.sel").attr("class").match(/^(flights|hotels|cars|packages|cruises)/), 10 f=[];b(".sb"+a+" .tg_searchbox .tg_container form").find("input, select, textarea").each(function(){f.push({name:this.name,value:this.value,obj:this})});var g=b("#travelSearchUseJavaScript").attr("checked"),d="",e=tgsbFromAir(f),d=d+(e.length?e+",":""),e=tgsbToAir(f),d=d+(e.length?e+",":""),e=tgsbHotelCity(f),d=d+(e.length?e+",":""),e=tgsbDepartureDate(f),d=d+(e.length?e+",":""),e=tgsbReturnDate(f),d=d+(e.length?e+",":""),e=tgsbAdults(f),d=d+(e.length?e+",":""),e=tgsbKids(f),d=d+(e.length?e+",":""), 11 e=tgsbSeniors(f),d=d+(e.length?e+",":""),e=tgsbRooms(f),d=d+(e.length?e+",":""),e=tgsbRTOW(f),d=d+(e.length?e+",":""),d=d+tgsbCruises(f),d=d+(g?'"usejavascript":"on",':"")+("300x250"==a?"":'"size":"'+a+'",'),d=d+(null==c?'"selectedTab":"flights"':"flights"==c[1]?"":'"selectedTab":"'+c[1]+'"');alignment=setAlignment();d+="alignnone"==alignment?"":'"alignment":"'+alignment+'"';d.match(/\,$/)&&(d=d.replace(/\,$/,""));send_to_editor("[tg_searchboxes"+(d.length?" options='{"+d+"}']":"]"))}return!1});return!1} 12 var g=b("#ed_toolbar");if(g){var a=document.createElement("input");a.type="button";a.value=TG_Searchboxes_Editor_Button.str_EditorButtonCaption;a.className="ed_button";a.title=TG_Searchboxes_Editor_Button.str_EditorButtonCaption;a.id="ed_button_tg_searchboxes";g.append(a);b("#ed_button_tg_searchboxes").click(c)}}); -
travel-search/trunk/admin/admin-tinymce-buttons-script.dev.js
r1044744 r1087931 15 15 if(typeof(serializedFieldsArray) == 'undefined' || serializedFieldsArray.length == 0) 16 16 return ''; 17 returnValue = '';17 var returnValue = ''; 18 18 jQuery.each(serializedFieldsArray, function(i, field){ 19 19 // checking for the "from" field and it's value in the serialized array 20 if( field.name == 'tgsbFromAir') {20 if(!returnValue && field.name == 'tgsbFromAir') { 21 21 // if the "from" field was found 22 22 if(field.value != TG_Searchboxes_Variables.tgsbDefaultSettings.from_air) { … … 31 31 // getting the "to" field form the serialized array 32 32 function tgsbToAir(serializedFieldsArray) { 33 // if the serialized array is not defined or it's length is 0 the return an empty string 34 if(typeof(serializedFieldsArray) == 'undefined' || serializedFieldsArray.length == 0) 35 return ''; 36 returnValue = ''; 37 jQuery.each(serializedFieldsArray, function(i, field){ 38 // checking for the "to" field and it's value in the serialized array 39 if(field.name == 'tgsbToAir') { 40 // if the "to" field was found 41 if(field.value != TG_Searchboxes_Variables.tgsbDefaultSettings.to_air) { 42 // if it's value it's not equal to the default value set it as a return value 43 returnValue = '"to_air":"'+field.value+'"'; 44 return; 45 }; 46 }; 47 }); 48 return returnValue; 49 }; 33 // if the serialized array is not defined or it's length is 0 the return an empty string 34 if(typeof(serializedFieldsArray) == 'undefined' || serializedFieldsArray.length == 0) 35 return ''; 36 var returnValue = ''; 37 jQuery.each(serializedFieldsArray, function(i, field){ 38 // checking for the "to" field and it's value in the serialized array 39 if(!returnValue && field.name == 'tgsbToAir' && jQuery(field.obj).parents('form.hotels').length==0) { 40 // if the "to" field was found 41 if(field.value != TG_Searchboxes_Variables.tgsbDefaultSettings.to_air) { 42 // if it's value it's not equal to the default value set it as a return value 43 returnValue = '"to_air":"'+field.value+'"'; 44 return; 45 }; 46 }; 47 }); 48 return returnValue; 49 } 50 function tgsbHotelCity(serializedFieldsArray) { 51 // if the serialized array is not defined or it's length is 0 the return an empty string 52 if(typeof(serializedFieldsArray) == 'undefined' || serializedFieldsArray.length == 0) 53 return ''; 54 var returnValue = ''; 55 jQuery.each(serializedFieldsArray, function(i, field){ 56 // checking for the "to" field and it's value in the serialized array 57 if(!returnValue && field.name == 'tgsbToAir' && jQuery(field.obj).parents('form.hotels').length>0 ) { 58 // if the "to" field was found 59 if(field.value != TG_Searchboxes_Variables.tgsbDefaultSettings.hotel_city) { 60 // if it's value it's not equal to the default value set it as a return value 61 returnValue = '"hotel_city":"'+field.value+'"'; 62 return; 63 } 64 } 65 }); 66 console.log(returnValue); 67 return returnValue; 68 } 50 69 // getting the "departure date" field form the serialized array 51 70 function tgsbDepartureDate(serializedFieldsArray) { … … 53 72 if(typeof(serializedFieldsArray) == 'undefined' || serializedFieldsArray.length == 0) 54 73 return ''; 55 returnValue = '';74 var returnValue = ''; 56 75 jQuery.each(serializedFieldsArray, function(i, field){ 57 76 // checking for the "departure date" field and it's value in the serialized array 58 if( field.name == 'tgsbDepartureDate') {77 if(!returnValue && field.name == 'tgsbDepartureDate') { 59 78 // if the "departure date" field was found 60 79 if(field.value != TG_Searchboxes_Variables.tgsbDefaultSettings.departure_date) { … … 72 91 if(typeof(serializedFieldsArray) == 'undefined' || serializedFieldsArray.length == 0) 73 92 return ''; 74 returnValue = '';93 var returnValue = ''; 75 94 jQuery.each(serializedFieldsArray, function(i, field){ 76 95 // checking for the "return date" field and it's value in the serialized array 77 if( field.name == 'tgsbReturnDate') {96 if(!returnValue && field.name == 'tgsbReturnDate') { 78 97 if(field.value != TG_Searchboxes_Variables.tgsbDefaultSettings.return_date) { 79 98 // if it's value it's not equal to the default value set it as a return value … … 90 109 if(typeof(serializedFieldsArray) == 'undefined' || serializedFieldsArray.length == 0) 91 110 return ''; 92 returnValue = '';111 var returnValue = ''; 93 112 jQuery.each(serializedFieldsArray, function(i, field){ 94 113 // checking for the "adults" field and it's value in the serialized array 95 if( field.name == 'tgsbAdults') {114 if(!returnValue && field.name == 'tgsbAdults') { 96 115 if(field.value != TG_Searchboxes_Variables.tgsbDefaultSettings.adults) { 97 116 // if it's value it's not equal to the default value set it as a return value … … 109 128 if(typeof(serializedFieldsArray) == 'undefined' || serializedFieldsArray.length == 0) 110 129 return ''; 111 returnValue = '';130 var returnValue = ''; 112 131 jQuery.each(serializedFieldsArray, function(i, field){ 113 132 // checking for the "kids" field and it's value in the serialized array 114 if( field.name == 'tgsbKids') {133 if(!returnValue && field.name == 'tgsbKids') { 115 134 if(field.value != TG_Searchboxes_Variables.tgsbDefaultSettings.kids) { 116 135 // if it's value it's not equal to the default value set it as a return value … … 128 147 if(typeof(serializedFieldsArray) == 'undefined' || serializedFieldsArray.length == 0) 129 148 return ''; 130 returnValue = '';149 var returnValue = ''; 131 150 jQuery.each(serializedFieldsArray, function(i, field){ 132 151 // checking for the "seniors" field and it's value in the serialized array 133 if( field.name == 'tgsbSeniors') {152 if(!returnValue && field.name == 'tgsbSeniors') { 134 153 if(field.value != TG_Searchboxes_Variables.tgsbDefaultSettings.seniors) { 135 154 // if it's value it's not equal to the default value set it as a return value … … 147 166 if(typeof(serializedFieldsArray) == 'undefined' || serializedFieldsArray.length == 0) 148 167 return ''; 149 returnValue = '';168 var returnValue = ''; 150 169 jQuery.each(serializedFieldsArray, function(i, field){ 151 170 // checking for the "rooms" field and it's value in the serialized array 152 if( field.name == 'tgsbRooms') {171 if(!returnValue && field.name == 'tgsbRooms') { 153 172 if(field.value != TG_Searchboxes_Variables.tgsbDefaultSettings.rooms) { 154 173 // if it's value it's not equal to the default value set it as a return value … … 166 185 if(typeof(serializedFieldsArray) == 'undefined' || serializedFieldsArray.length == 0) 167 186 return ''; 168 returnValue = '';187 var returnValue = ''; 169 188 jQuery.each(serializedFieldsArray, function(i, field){ 170 189 // checking for the "rooms" field and it's value in the serialized array 171 if( field.name == 'oneway') {190 if(!returnValue && field.name == 'oneway') { 172 191 field.value = (field.value == 'on') ? true : false; 173 192 if(field.value != TG_Searchboxes_Variables.tgsbDefaultSettings.rtow) { … … 405 424 tgSearchboxMeasures = (tgSearchboxMeasures.length == 0) ? '300x250' : tgSearchboxMeasures; 406 425 var selectedTab = jQuery('.sb'+tgSearchboxMeasures+' .tg_searchbox .tg_container').find('form.sel').attr('class').match(/^(flights|hotels|cars|packages|cruises)/); 407 408 var fields = jQuery('.sb'+tgSearchboxMeasures+' .tg_searchbox .tg_container form').serializeArray(); 426 var fields = []; 427 jQuery('.sb'+tgSearchboxMeasures+' .tg_searchbox .tg_container form').find("input, select, textarea").each(function(){ 428 fields.push({ 429 name: this.name, 430 value: this.value, 431 obj: this 432 }); 433 }); 409 434 // marks if searchbox should be loaded with JS file or not | Tibi | 2013.04.23 410 435 var loadFromJS = jQuery('#travelSearchUseJavaScript').attr('checked'); 411 436 var optionsString = ''; 412 437 // getting the "from" value 413 tgsb_fromAir = tgsbFromAir(fields);438 var tgsb_fromAir = tgsbFromAir(fields); 414 439 // adding the "from" value to the options string 415 optionsString += (tgsb_fromAir.length) ? tgsb_fromAir+',' : tgsb_fromAir; 416 // getting the "to" value 417 tgsb_toAir = tgsbToAir(fields); 418 // adding the "to" value to the options string 419 optionsString += (tgsb_toAir.length) ? tgsb_toAir+',' : tgsb_toAir; 440 optionsString += (tgsb_fromAir.length) ? tgsb_fromAir+',' : ''; 441 // getting the "to" value 442 var tgsb_toAir = tgsbToAir(fields); 443 // adding the "to" value to the options string 444 optionsString += (tgsb_toAir.length) ? tgsb_toAir+',' : ''; 445 // getting the "to" value 446 var tgsb_hotelCity = tgsbHotelCity(fields); 447 // adding the "to" value to the options string 448 optionsString += (tgsb_hotelCity.length) ? tgsb_hotelCity+',' : ''; 420 449 // getting the "departure date" value 421 tgsb_departureDate = tgsbDepartureDate(fields);450 var tgsb_departureDate = tgsbDepartureDate(fields); 422 451 // adding the "departure date" value to the options string 423 optionsString += (tgsb_departureDate.length) ? tgsb_departureDate+',' : tgsb_departureDate;452 optionsString += (tgsb_departureDate.length) ? tgsb_departureDate+',' : ''; 424 453 // getting the "return date" value 425 tgsb_returnDate = tgsbReturnDate(fields);454 var tgsb_returnDate = tgsbReturnDate(fields); 426 455 // adding the "return date" value to the options string 427 optionsString += (tgsb_returnDate.length) ? tgsb_returnDate+',' : tgsb_returnDate;456 optionsString += (tgsb_returnDate.length) ? tgsb_returnDate+',' : ''; 428 457 // getting the "adults" value 429 tgsb_adults = tgsbAdults(fields);458 var tgsb_adults = tgsbAdults(fields); 430 459 // adding the "adults" value to the options string 431 optionsString += (tgsb_adults.length) ? tgsb_adults+',' : tgsb_adults;460 optionsString += (tgsb_adults.length) ? tgsb_adults+',' : ''; 432 461 // getting the "kids" value 433 tgsb_kids = tgsbKids(fields);462 var tgsb_kids = tgsbKids(fields); 434 463 // adding the "kids" value to the options string 435 optionsString += (tgsb_kids.length) ? tgsb_kids+',' : tgsb_kids;464 optionsString += (tgsb_kids.length) ? tgsb_kids+',' : ''; 436 465 // getting the "seniors" value 437 tgsb_seniors = tgsbSeniors(fields);466 var tgsb_seniors = tgsbSeniors(fields); 438 467 // adding the "seniors" value to the options string 439 optionsString += (tgsb_seniors.length) ? tgsb_seniors+',' : tgsb_seniors;468 optionsString += (tgsb_seniors.length) ? tgsb_seniors+',' : ''; 440 469 // getting the "rooms" value 441 tgsb_rooms = tgsbRooms(fields);470 var tgsb_rooms = tgsbRooms(fields); 442 471 // adding the "seniors" value to the options string 443 optionsString += (tgsb_rooms.length) ? tgsb_rooms+',' : tgsb_rooms;472 optionsString += (tgsb_rooms.length) ? tgsb_rooms+',' : ''; 444 473 // getting the "roundtrip/oneway" value 445 tgsb_rtow = tgsbRTOW(fields);474 var tgsb_rtow = tgsbRTOW(fields); 446 475 // adding the "roundtrip/oneway" value to the options string 447 optionsString += (tgsb_rtow.length) ? tgsb_rtow+',' : tgsb_rtow;476 optionsString += (tgsb_rtow.length) ? tgsb_rtow+',' : ''; 448 477 // adding the cruises parameters to the options string 449 478 optionsString += tgsbCruises(fields); -
travel-search/trunk/admin/admin-tinymce-buttons-script.min.js
r1044744 r1087931 1 1 var tgsb_selBoxParam=!1,tgsb_images={"160x600":{url:TG_Searchboxes_Editor_Button.str_tgsb160x600,width:160,height:600,alignment:"alignnone"},"300x250":{url:TG_Searchboxes_Editor_Button.str_tgsb300x250,width:300,height:250,alignment:"alignnone"},"300x533":{url:TG_Searchboxes_Editor_Button.str_tgsb300x533,width:300,height:533,alignment:"alignnone"},"728x90":{url:TG_Searchboxes_Editor_Button.str_tgsb728x90,width:728,height:90,alignment:"alignnone"},dynamic:{url:TG_Searchboxes_Editor_Button.str_tgsbdynamic, 2 width:628,height:250,alignment:"alignnone"}};function tgsbFromAir(a){if("undefined"==typeof a||0==a.length)return"";returnValue="";jQuery.each(a,function(a,b){"tgsbFromAir"==b.name&&b.value!=TG_Searchboxes_Variables.tgsbDefaultSettings.from_air&&(returnValue='"from_air":"'+b.value+'"')});return returnValue} 3 function tgsbToAir(a){if("undefined"==typeof a||0==a.length)return"";returnValue="";jQuery.each(a,function(a,b){"tgsbToAir"==b.name&&b.value!=TG_Searchboxes_Variables.tgsbDefaultSettings.to_air&&(returnValue='"to_air":"'+b.value+'"')});return returnValue} 4 function tgsbDepartureDate(a){if("undefined"==typeof a||0==a.length)return"";returnValue="";jQuery.each(a,function(a,b){"tgsbDepartureDate"==b.name&&b.value!=TG_Searchboxes_Variables.tgsbDefaultSettings.departure_date&&(returnValue='"departure_date":"'+b.value+'"')});return returnValue} 5 function tgsbReturnDate(a){if("undefined"==typeof a||0==a.length)return"";returnValue="";jQuery.each(a,function(a,b){"tgsbReturnDate"==b.name&&b.value!=TG_Searchboxes_Variables.tgsbDefaultSettings.return_date&&(returnValue='"return_date":"'+b.value+'"')});return returnValue} 6 function tgsbAdults(a){if("undefined"==typeof a||0==a.length)return"";returnValue="";jQuery.each(a,function(a,b){"tgsbAdults"==b.name&&b.value!=TG_Searchboxes_Variables.tgsbDefaultSettings.adults&&(returnValue='"adults":"'+b.value+'"')});return returnValue} 7 function tgsbKids(a){if("undefined"==typeof a||0==a.length)return"";returnValue="";jQuery.each(a,function(a,b){"tgsbKids"==b.name&&b.value!=TG_Searchboxes_Variables.tgsbDefaultSettings.kids&&(returnValue='"kids":"'+b.value+'"')});return returnValue} 8 function tgsbSeniors(a){if("undefined"==typeof a||0==a.length)return"";returnValue="";jQuery.each(a,function(a,b){"tgsbSeniors"==b.name&&b.value!=TG_Searchboxes_Variables.tgsbDefaultSettings.seniors&&(returnValue='"seniors":"'+b.value+'"')});return returnValue} 9 function tgsbRooms(a){if("undefined"==typeof a||0==a.length)return"";returnValue="";jQuery.each(a,function(a,b){"tgsbRooms"==b.name&&b.value!=TG_Searchboxes_Variables.tgsbDefaultSettings.rooms&&(returnValue='"rooms":"'+b.value+'"')});return returnValue} 10 function tgsbRTOW(a){if("undefined"==typeof a||0==a.length)return"";returnValue="";jQuery.each(a,function(a,b){"oneway"==b.name&&(b.value="on"==b.value?!0:!1,b.value!=TG_Searchboxes_Variables.tgsbDefaultSettings.rtow&&(returnValue='"rtow":"'+b.value+'"'))});return returnValue} 11 function tgsbCruises(a){var d="";jQuery.each(a,function(b,a){!a.value||a.value==TG_Searchboxes_Variables.tgsbDefaultSettings[a.name]||"cruiseline"!=a.name&&"length_of_stay"!=a.name&&"destination"!=a.name&&"month_year"!=a.name||(d+='"'+a.name+'":"'+a.value+'",')});return d}function setAlignment(){var a="alignnone",d=jQuery("#TB_ajaxContent").find("input[name=img_align]");for(i in d)if(1==d[i].checked){a=d[i].value;break}return a} 12 var tgsb_popupInitOpt={init:function(a,d){var b=this;b.url=d;b._createButtons();a.addCommand("mceTGSearchboxesInsert",function(){tg_searchboxes_tinymce_button_click(b)});a.addButton("TGSearchboxes",{title:TG_Searchboxes_Editor_Button.str_EditorButtonTitle,cmd:"mceTGSearchboxesInsert",image:d+"/../images/tg20x20.gif"});a.onNodeChange.add(function(b,a,d){a.setActive("TGSearchboxes","IMG"==d.nodeName)});a.onMouseDown.add(function(a,e){if(e.target&&"IMG"==e.target.nodeName&&a.dom.hasClass(e.target,"TGSearchboxes")|| 13 e.target&&e.target.firstChild&&"IMG"==e.target.firstChild.nodeName&&a.dom.hasClass(e.target.firstChild,"TGSearchboxes")){tgsb_selBoxParam=b.getAttr(e.target.title,"options");try{tgsb_selBoxParam=eval("("+tgsb_selBoxParam+")")}catch(d){tgsb_selBoxParam={size:"300x250",selectedTab:"flights"}}a.plugins.wordpress._showButtons(e.target,"wp_gallerybtns")}else tgsb_selBoxParam=!1});a.onBeforeSetContent.add(function(a,e){e.content=b._do_tg_searchboxes(e.content)});a.onPostProcess.add(function(a,e){e.get&& 14 (e.content=b._get_tg_searchboxes(e.content),"undefined"!=typeof tgsb_selBoxParam&&tgsb_selBoxParam&&(tgsb_selBoxParam=!1))})},getAttr:function(a,d){var b=(new RegExp(d+'="([^"]+)"',"g")).exec(a);return b?tinymce.DOM.decode(b[1]):(b=(new RegExp(d+"='([^']+)'","g")).exec(a))?tinymce.DOM.decode(b[1]):""},_get_tg_searchboxes:function(a){return a.replace(/(?:<p[^>]*>)*(<img[^>]+>)(?:<\/p>)*/g,function(a,b){return-1!=tgsb_popupInitOpt.getAttr(b,"class").indexOf("TGSearchboxes")?"<p>["+tinymce.trim(tgsb_popupInitOpt.getAttr(b, 15 "title"))+"]</p>":a})},_do_tg_searchboxes:function(a){return a.replace(/\[tg_searchboxes([^\]]*)\]/g,function(a,b){var f=tgsb_popupInitOpt.getAttr(a,"options"),e="300x250",g="",c=300,h=250;if(f.length){try{f=eval("("+f+")")}catch(k){f=""}"undefined"!=typeof f.size&&(e=f.size)}g=tgsb_images[e].url;c=tgsb_images[e].width;h=tgsb_images[e].height;tgsbImageAlign="undefined"==typeof f.alignment?tgsb_images[e].alignment:f.alignment;return'<img src="'+tinymce.baseURL+'/plugins/wpgallery/img/t.gif" class="TGSearchboxes mceItem '+ 16 tgsbImageAlign+'" style="background-image:url('+g+");background-repeat:no-repeat;width:"+c+"px;height:"+h+'px;padding:0" title="tg_searchboxes'+tinymce.DOM.encode(b)+'"/>'})},_createButtons:function(){var a=tinymce.DOM,d;a.remove("wp_gallerybtns");a.add(document.body,"div",{id:"wp_gallerybtns",style:"display:none;"});d=a.add("wp_gallerybtns","img",{src:this.url+"/img/edit.png",id:"wp_editgallery",width:"24",height:"24",title:"Edit Searchbox"});(tinymce.dom.Event.bind?tinymce.dom.Event.bind:tinymce.dom.Event.add)(d, 17 "mousedown",function(a){a=tinyMCE.activeEditor;var d=a.selection.getNode();"IMG"==d.nodeName&&a.dom.hasClass(d,"TGSearchboxes")&&(a.windowManager.bookmark=a.selection.getBookmark("simple"),a.execCommand("mceTGSearchboxesInsert"))});a=a.add("wp_gallerybtns","img",{src:this.url+"/img/delete.png",id:"wp_delgallery",width:"24",height:"24",title:"Delete Searchbox"});(tinymce.dom.Event.bind?tinymce.dom.Event.bind:tinymce.dom.Event.add)(a,"mousedown",function(a){a=tinyMCE.activeEditor;var d=a.selection.getNode(); 18 if("IMG"==d.nodeName&&a.dom.hasClass(d,"TGSearchboxes"))return a.dom.remove(d),a.execCommand("mceRepaint"),!1})},createControl:function(a,d){return null},getInfo:function(){return{longname:"Travelgrove Searchboxes",author:"Travelgrove.com",authorurl:"http://www.travelgrove.com/",infourl:"http://www.travelgrove.com/",version:"1.0"}}}; 19 function tg_searchboxes_tinymce_button_click(a){var d=TG_Searchboxes_Editor_Button.str_EditorButtonAjaxURL.replace(/\&\;/ig,"&");tb_show("Travelgrove Searchboxes",d,!1);jQuery("#TB_ajaxContent").width("auto").height("94.5%").click(function(b){b=jQuery(b.target);if(b.is("a.send_searchbox_to_editor")||b.is("input.send_searchbox_to_editor")){b=jQuery("ul.measuresChooser li a.current").text();b=0==b.length?"300x250":b;var d=jQuery(".sb"+b+" .tg_searchbox .tg_container").find("form.sel").attr("class").match(/^(flights|hotels|cars|packages|cruises)/), 20 e=jQuery(".sb"+b+" .tg_searchbox .tg_container form").serializeArray(),g=jQuery("#travelSearchUseJavaScript").attr("checked"),c="";tgsb_fromAir=tgsbFromAir(e);c+=tgsb_fromAir.length?tgsb_fromAir+",":tgsb_fromAir;tgsb_toAir=tgsbToAir(e);c+=tgsb_toAir.length?tgsb_toAir+",":tgsb_toAir;tgsb_departureDate=tgsbDepartureDate(e);c+=tgsb_departureDate.length?tgsb_departureDate+",":tgsb_departureDate;tgsb_returnDate=tgsbReturnDate(e);c+=tgsb_returnDate.length?tgsb_returnDate+",":tgsb_returnDate;tgsb_adults= 21 tgsbAdults(e);c+=tgsb_adults.length?tgsb_adults+",":tgsb_adults;tgsb_kids=tgsbKids(e);c+=tgsb_kids.length?tgsb_kids+",":tgsb_kids;tgsb_seniors=tgsbSeniors(e);c+=tgsb_seniors.length?tgsb_seniors+",":tgsb_seniors;tgsb_rooms=tgsbRooms(e);c+=tgsb_rooms.length?tgsb_rooms+",":tgsb_rooms;tgsb_rtow=tgsbRTOW(e);c+=tgsb_rtow.length?tgsb_rtow+",":tgsb_rtow;c+=tgsbCruises(e);c=c+(g?'"usejavascript":"on",':"")+("300x250"==b?"":'"size":"'+b+'",');c+=null==d?'"selectedTab":"flights",':"flights"==d[1]?"":'"selectedTab":"'+ 22 d[1]+'",';alignment=setAlignment();c+="alignnone"==alignment?"":'"alignment":"'+alignment+'"';c.match(/\,$/)&&(c=c.replace(/\,$/,""));b="[tg_searchboxes"+(c.length?" options='{"+c+"}']":"]");b=a._do_tg_searchboxes(b);tinyMCE.execCommand("mceInsertContent",0,b);"undefined"!=typeof tgsb_selBoxParam&&tgsb_selBoxParam&&(tgsb_selBoxParam=!1);tb_remove()}return!1});return!1} 23 jQuery(document).ready(function(a){tinymce.create("tinymce.plugins.TGSearchboxes",tgsb_popupInitOpt);tinymce.PluginManager.add("TGSearchboxes",tinymce.plugins.TGSearchboxes)}); 2 width:628,height:250,alignment:"alignnone"}};function tgsbFromAir(a){if("undefined"==typeof a||0==a.length)return"";var b="";jQuery.each(a,function(a,c){b||"tgsbFromAir"!=c.name||c.value==TG_Searchboxes_Variables.tgsbDefaultSettings.from_air||(b='"from_air":"'+c.value+'"')});return b} 3 function tgsbToAir(a){if("undefined"==typeof a||0==a.length)return"";var b="";jQuery.each(a,function(a,c){b||"tgsbToAir"!=c.name||0!=jQuery(c.obj).parents("form.hotels").length||c.value==TG_Searchboxes_Variables.tgsbDefaultSettings.to_air||(b='"to_air":"'+c.value+'"')});return b} 4 function tgsbHotelCity(a){if("undefined"==typeof a||0==a.length)return"";var b="";jQuery.each(a,function(a,c){!b&&"tgsbToAir"==c.name&&0<jQuery(c.obj).parents("form.hotels").length&&c.value!=TG_Searchboxes_Variables.tgsbDefaultSettings.hotel_city&&(b='"hotel_city":"'+c.value+'"')});console.log(b);return b} 5 function tgsbDepartureDate(a){if("undefined"==typeof a||0==a.length)return"";var b="";jQuery.each(a,function(a,c){b||"tgsbDepartureDate"!=c.name||c.value==TG_Searchboxes_Variables.tgsbDefaultSettings.departure_date||(b='"departure_date":"'+c.value+'"')});return b} 6 function tgsbReturnDate(a){if("undefined"==typeof a||0==a.length)return"";var b="";jQuery.each(a,function(a,c){b||"tgsbReturnDate"!=c.name||c.value==TG_Searchboxes_Variables.tgsbDefaultSettings.return_date||(b='"return_date":"'+c.value+'"')});return b}function tgsbAdults(a){if("undefined"==typeof a||0==a.length)return"";var b="";jQuery.each(a,function(a,c){b||"tgsbAdults"!=c.name||c.value==TG_Searchboxes_Variables.tgsbDefaultSettings.adults||(b='"adults":"'+c.value+'"')});return b} 7 function tgsbKids(a){if("undefined"==typeof a||0==a.length)return"";var b="";jQuery.each(a,function(a,c){b||"tgsbKids"!=c.name||c.value==TG_Searchboxes_Variables.tgsbDefaultSettings.kids||(b='"kids":"'+c.value+'"')});return b}function tgsbSeniors(a){if("undefined"==typeof a||0==a.length)return"";var b="";jQuery.each(a,function(a,c){b||"tgsbSeniors"!=c.name||c.value==TG_Searchboxes_Variables.tgsbDefaultSettings.seniors||(b='"seniors":"'+c.value+'"')});return b} 8 function tgsbRooms(a){if("undefined"==typeof a||0==a.length)return"";var b="";jQuery.each(a,function(a,c){b||"tgsbRooms"!=c.name||c.value==TG_Searchboxes_Variables.tgsbDefaultSettings.rooms||(b='"rooms":"'+c.value+'"')});return b}function tgsbRTOW(a){if("undefined"==typeof a||0==a.length)return"";var b="";jQuery.each(a,function(a,c){b||"oneway"!=c.name||(c.value="on"==c.value?!0:!1,c.value!=TG_Searchboxes_Variables.tgsbDefaultSettings.rtow&&(b='"rtow":"'+c.value+'"'))});return b} 9 function tgsbCruises(a){var b="";jQuery.each(a,function(a,c){!c.value||c.value==TG_Searchboxes_Variables.tgsbDefaultSettings[c.name]||"cruiseline"!=c.name&&"length_of_stay"!=c.name&&"destination"!=c.name&&"month_year"!=c.name||(b+='"'+c.name+'":"'+c.value+'",')});return b}function setAlignment(){var a="alignnone",b=jQuery("#TB_ajaxContent").find("input[name=img_align]");for(i in b)if(1==b[i].checked){a=b[i].value;break}return a} 10 var tgsb_popupInitOpt={init:function(a,b){var f=this;f.url=b;f._createButtons();a.addCommand("mceTGSearchboxesInsert",function(){tg_searchboxes_tinymce_button_click(f)});a.addButton("TGSearchboxes",{title:TG_Searchboxes_Editor_Button.str_EditorButtonTitle,cmd:"mceTGSearchboxesInsert",image:b+"/../images/tg20x20.gif"});a.onNodeChange.add(function(a,b,f){b.setActive("TGSearchboxes","IMG"==f.nodeName)});a.onMouseDown.add(function(a,b){if(b.target&&"IMG"==b.target.nodeName&&a.dom.hasClass(b.target,"TGSearchboxes")|| 11 b.target&&b.target.firstChild&&"IMG"==b.target.firstChild.nodeName&&a.dom.hasClass(b.target.firstChild,"TGSearchboxes")){tgsb_selBoxParam=f.getAttr(b.target.title,"options");try{tgsb_selBoxParam=eval("("+tgsb_selBoxParam+")")}catch(h){tgsb_selBoxParam={size:"300x250",selectedTab:"flights"}}a.plugins.wordpress._showButtons(b.target,"wp_gallerybtns")}else tgsb_selBoxParam=!1});a.onBeforeSetContent.add(function(a,b){b.content=f._do_tg_searchboxes(b.content)});a.onPostProcess.add(function(a,b){b.get&& 12 (b.content=f._get_tg_searchboxes(b.content),"undefined"!=typeof tgsb_selBoxParam&&tgsb_selBoxParam&&(tgsb_selBoxParam=!1))})},getAttr:function(a,b){var f=(new RegExp(b+'="([^"]+)"',"g")).exec(a);return f?tinymce.DOM.decode(f[1]):(f=(new RegExp(b+"='([^']+)'","g")).exec(a))?tinymce.DOM.decode(f[1]):""},_get_tg_searchboxes:function(a){return a.replace(/(?:<p[^>]*>)*(<img[^>]+>)(?:<\/p>)*/g,function(a,f){return-1!=tgsb_popupInitOpt.getAttr(f,"class").indexOf("TGSearchboxes")?"<p>["+tinymce.trim(tgsb_popupInitOpt.getAttr(f, 13 "title"))+"]</p>":a})},_do_tg_searchboxes:function(a){return a.replace(/\[tg_searchboxes([^\]]*)\]/g,function(a,f){var c=tgsb_popupInitOpt.getAttr(a,"options"),g="300x250",h="",d=300,e=250;if(c.length){try{c=eval("("+c+")")}catch(k){c=""}"undefined"!=typeof c.size&&(g=c.size)}h=tgsb_images[g].url;d=tgsb_images[g].width;e=tgsb_images[g].height;tgsbImageAlign="undefined"==typeof c.alignment?tgsb_images[g].alignment:c.alignment;return'<img src="'+tinymce.baseURL+'/plugins/wpgallery/img/t.gif" class="TGSearchboxes mceItem '+ 14 tgsbImageAlign+'" style="background-image:url('+h+");background-repeat:no-repeat;width:"+d+"px;height:"+e+'px;padding:0" title="tg_searchboxes'+tinymce.DOM.encode(f)+'"/>'})},_createButtons:function(){var a=tinymce.DOM,b;a.remove("wp_gallerybtns");a.add(document.body,"div",{id:"wp_gallerybtns",style:"display:none;"});b=a.add("wp_gallerybtns","img",{src:this.url+"/img/edit.png",id:"wp_editgallery",width:"24",height:"24",title:"Edit Searchbox"});(tinymce.dom.Event.bind?tinymce.dom.Event.bind:tinymce.dom.Event.add)(b, 15 "mousedown",function(a){a=tinyMCE.activeEditor;var b=a.selection.getNode();"IMG"==b.nodeName&&a.dom.hasClass(b,"TGSearchboxes")&&(a.windowManager.bookmark=a.selection.getBookmark("simple"),a.execCommand("mceTGSearchboxesInsert"))});a=a.add("wp_gallerybtns","img",{src:this.url+"/img/delete.png",id:"wp_delgallery",width:"24",height:"24",title:"Delete Searchbox"});(tinymce.dom.Event.bind?tinymce.dom.Event.bind:tinymce.dom.Event.add)(a,"mousedown",function(a){a=tinyMCE.activeEditor;var b=a.selection.getNode(); 16 if("IMG"==b.nodeName&&a.dom.hasClass(b,"TGSearchboxes"))return a.dom.remove(b),a.execCommand("mceRepaint"),!1})},createControl:function(a,b){return null},getInfo:function(){return{longname:"Travelgrove Searchboxes",author:"Travelgrove.com",authorurl:"http://www.travelgrove.com/",infourl:"http://www.travelgrove.com/",version:"1.0"}}}; 17 function tg_searchboxes_tinymce_button_click(a){var b=TG_Searchboxes_Editor_Button.str_EditorButtonAjaxURL.replace(/\&\;/ig,"&");tb_show("Travelgrove Searchboxes",b,!1);jQuery("#TB_ajaxContent").width("auto").height("94.5%").click(function(b){b=jQuery(b.target);if(b.is("a.send_searchbox_to_editor")||b.is("input.send_searchbox_to_editor")){b=jQuery("ul.measuresChooser li a.current").text();b=0==b.length?"300x250":b;var c=jQuery(".sb"+b+" .tg_searchbox .tg_container").find("form.sel").attr("class").match(/^(flights|hotels|cars|packages|cruises)/), 18 g=[];jQuery(".sb"+b+" .tg_searchbox .tg_container form").find("input, select, textarea").each(function(){g.push({name:this.name,value:this.value,obj:this})});var h=jQuery("#travelSearchUseJavaScript").attr("checked"),d="",e=tgsbFromAir(g),d=d+(e.length?e+",":""),e=tgsbToAir(g),d=d+(e.length?e+",":""),e=tgsbHotelCity(g),d=d+(e.length?e+",":""),e=tgsbDepartureDate(g),d=d+(e.length?e+",":""),e=tgsbReturnDate(g),d=d+(e.length?e+",":""),e=tgsbAdults(g),d=d+(e.length?e+",":""),e=tgsbKids(g),d=d+(e.length? 19 e+",":""),e=tgsbSeniors(g),d=d+(e.length?e+",":""),e=tgsbRooms(g),d=d+(e.length?e+",":""),e=tgsbRTOW(g),d=d+(e.length?e+",":""),d=d+tgsbCruises(g),d=d+(h?'"usejavascript":"on",':"")+("300x250"==b?"":'"size":"'+b+'",'),d=d+(null==c?'"selectedTab":"flights",':"flights"==c[1]?"":'"selectedTab":"'+c[1]+'",');alignment=setAlignment();d+="alignnone"==alignment?"":'"alignment":"'+alignment+'"';d.match(/\,$/)&&(d=d.replace(/\,$/,""));b="[tg_searchboxes"+(d.length?" options='{"+d+"}']":"]");b=a._do_tg_searchboxes(b); 20 tinyMCE.execCommand("mceInsertContent",0,b);"undefined"!=typeof tgsb_selBoxParam&&tgsb_selBoxParam&&(tgsb_selBoxParam=!1);tb_remove()}return!1});return!1}jQuery(document).ready(function(a){tinymce.create("tinymce.plugins.TGSearchboxes",tgsb_popupInitOpt);tinymce.PluginManager.add("TGSearchboxes",tinymce.plugins.TGSearchboxes)}); -
travel-search/trunk/classes/searchboxesSettingsFormRenderer.class.php
r1044744 r1087931 122 122 //checking if the toAir value matches the pattern 123 123 if(!empty($toAir) && !preg_match('/^(.*) \((...)\)$/', $toAir)) { 124 add_settings_error( 'tg_searchboxes_options_to_air', 'tg_searchboxes_options_ ro_air_error','Please select a location from the drop-down list. <'.$toAir.'> was not recognized as a valid location!','error');124 add_settings_error( 'tg_searchboxes_options_to_air', 'tg_searchboxes_options_to_air_error','Please select a location from the drop-down list. <'.$toAir.'> was not recognized as a valid location!','error'); 125 125 } else { 126 126 // adding the toAir value to the array containing the valid values … … 129 129 // unseting the $toAir variable 130 130 unset($toAir); 131 132 133 $hotelCity = $this->getHotelCity($input); 134 //checking if the hotelCity value matches the pattern 135 if(!empty($hotelCity) && !preg_match('/^(.*) \((.*)\)$/', $hotelCity) && !preg_match('/^(.*), (..)$/', $hotelCity)) { 136 add_settings_error( 'tg_searchboxes_options_hotel_city', 'tg_searchboxes_options_hotel_city_error','Please select a location from the drop-down list. <'.$hotelCity.'> was not recognized as a valid location!','error'); 137 } else { 138 // adding the toAir value to the array containing the valid values 139 $valid['hotel_city'] = $hotelCity; 140 } 141 // unseting the $hotelCity variable 142 unset($hotelCity); 143 131 144 132 145 // setting the departure date … … 358 371 return ''; 359 372 } 373 private function getHotelCity($input) { 374 if(empty($input)) 375 return ''; 376 if(!empty($input['hotels_to_air'])) 377 return $input['hotels_to_air']; 378 return $this->getToAir($input); 379 } 360 380 361 381 /* -
travel-search/trunk/classes/tgSearchboxesRenderer.class.php
r1044744 r1087931 254 254 } 255 255 } 256 $this->valuesToBeSet = array( 257 'from_air' => (empty($this->atts['from_air']) ? 258 $this->controller->options['from_air'] : 259 $this->atts['from_air'] 260 ), 261 'to_air' => (empty($this->atts['to_air']) ? 262 $this->controller->options['to_air'] : 263 $this->atts['to_air'] 264 ), 265 'departure_date'=> $departureDate, 266 'return_date' => $returnDate, 267 'adults' => (empty($this->atts['adults']) ? 268 $this->controller->options['adults'] : 269 $this->atts['adults'] 270 ), 271 'kids' => (!isset($this->atts['kids']) ? 272 $this->controller->options['kids'] : 273 $this->atts['kids'] 274 ), 275 'seniors' => (!isset($this->atts['seniors']) ? 276 $this->controller->options['seniors'] : 277 $this->atts['seniors'] 278 ), 279 'rooms' => (empty($this->atts['rooms']) ? 280 $this->controller->options['rooms'] : 281 $this->atts['rooms'] 282 ), 283 'rtow' => (!isset($this->atts['rtow']) ? 284 $this->controller->options['rtow'] : 285 $this->atts['rtow'] 286 ), 287 'cruiseline' => (!isset($this->atts['cruiseline']) ? 288 $this->controller->options['cruiseline'] : 289 $this->atts['cruiseline'] 290 ), 291 'destination' => (!isset($this->atts['destination']) ? 292 $this->controller->options['destination'] : 293 $this->atts['destination'] 294 ), 295 'length_of_stay' => (!isset($this->atts['length_of_stay']) ? 296 $this->controller->options['length_of_stay'] : 297 $this->atts['length_of_stay'] 298 ), 299 'month_year' => (!isset($this->atts['month_year']) ? 300 $this->controller->options['month_year'] : 301 $this->atts['month_year'] 302 ), 303 ); 256 $this->valuesToBeSet = array(); 257 $this->valuesToBeSet['from_air'] = empty($this->atts['from_air']) 258 ? $this->controller->options['from_air'] 259 : $this->atts['from_air']; 260 $this->valuesToBeSet['to_air'] = empty($this->atts['to_air']) 261 ? $this->controller->options['to_air'] 262 : $this->atts['to_air']; 263 $this->valuesToBeSet['hotel_city'] = empty($this->atts['hotel_city']) 264 ? (empty($this->controller->options['hotel_city']) ? $this->valuesToBeSet['to_air'] : $this->controller->options['hotel_city']) 265 : $this->atts['hotel_city']; 266 $this->valuesToBeSet['departure_date'] = $departureDate; 267 $this->valuesToBeSet['return_date'] = $returnDate; 268 $this->valuesToBeSet['adults'] = empty($this->atts['adults']) 269 ? $this->controller->options['adults'] 270 : $this->atts['adults']; 271 $this->valuesToBeSet['kids'] = !isset($this->atts['kids']) 272 ? $this->controller->options['kids'] 273 : $this->atts['kids']; 274 $this->valuesToBeSet['seniors'] = !isset($this->atts['seniors']) 275 ? $this->controller->options['seniors'] 276 : $this->atts['seniors']; 277 $this->valuesToBeSet['rooms'] = empty($this->atts['rooms']) 278 ? $this->controller->options['rooms'] 279 : $this->atts['rooms']; 280 $this->valuesToBeSet['rtow'] = !isset($this->atts['rtow']) 281 ? $this->controller->options['rtow'] 282 : $this->atts['rtow']; 283 $this->valuesToBeSet['cruiseline'] = !isset($this->atts['cruiseline']) 284 ? $this->controller->options['cruiseline'] 285 : $this->atts['cruiseline']; 286 $this->valuesToBeSet['destination'] = !isset($this->atts['destination']) 287 ? $this->controller->options['destination'] 288 : $this->atts['destination']; 289 $this->valuesToBeSet['length_of_stay'] = !isset($this->atts['length_of_stay']) 290 ? $this->controller->options['length_of_stay'] 291 : $this->atts['length_of_stay']; 292 $this->valuesToBeSet['month_year'] = !isset($this->atts['month_year']) 293 ? $this->controller->options['month_year'] 294 : $this->atts['month_year']; 304 295 305 296 if (!isset($output)) { … … 668 659 $output = 669 660 '<label for="tgsb_'.self::$nrOfBoxes.'_city_h">City:</label> 670 <input type="text" name="'.(($this->atts['defaultSettings']) ? 'tg_searchboxes_options[hotels_to_air]' : (($this->atts['ajaxSettings']) ? 'tgsbToAir' : 'airport')).'" id="tgsb_'.self::$nrOfBoxes.'_city_h" value="'.esc_attr($this->valuesToBeSet[' to_air']).'" class="tgsb_addASH asTo" />661 <input type="text" name="'.(($this->atts['defaultSettings']) ? 'tg_searchboxes_options[hotels_to_air]' : (($this->atts['ajaxSettings']) ? 'tgsbToAir' : 'airport')).'" id="tgsb_'.self::$nrOfBoxes.'_city_h" value="'.esc_attr($this->valuesToBeSet['hotel_city']).'" class="tgsb_addASH asTo" /> 671 662 <label for="tgsb_'.self::$nrOfBoxes.'_dep_cal_h">Check-In:</label>'; 672 663 $output .= (($this->atts['defaultSettings']) ? $this->date_input('hotels_departure_date', 'tgsb_'.self::$nrOfBoxes.'_dep_cal_h') : … … 699 690 $output .='<span> 700 691 <label for="tgsb_'.self::$nrOfBoxes.'_city_h">City:</label> 701 <input type="text" name="'.(($this->atts['defaultSettings']) ? 'tg_searchboxes_options[hotels_to_air]' : (($this->atts['ajaxSettings']) ? 'tgsbToAir' : 'airport')).'" id="tgsb_'.self::$nrOfBoxes.'_city_h" value="'.esc_attr($this->valuesToBeSet[' to_air']).'" class="tgsb_addASH asTo" />692 <input type="text" name="'.(($this->atts['defaultSettings']) ? 'tg_searchboxes_options[hotels_to_air]' : (($this->atts['ajaxSettings']) ? 'tgsbToAir' : 'airport')).'" id="tgsb_'.self::$nrOfBoxes.'_city_h" value="'.esc_attr($this->valuesToBeSet['hotel_city']).'" class="tgsb_addASH asTo" /> 702 693 </span> 703 694 <span> … … 737 728 '<span> 738 729 <label for="tgsb_'.self::$nrOfBoxes.'_city_h">City:</label> 739 <input type="text" name="'.(($this->atts['defaultSettings']) ? 'tg_searchboxes_options[hotels_to_air]' : (($this->atts['ajaxSettings']) ? 'tgsbToAir' : 'airport')).'" id="tgsb_'.self::$nrOfBoxes.'_city_h" value="'.esc_attr($this->valuesToBeSet[' to_air']).'" class="tgsb_addASH asTo" />730 <input type="text" name="'.(($this->atts['defaultSettings']) ? 'tg_searchboxes_options[hotels_to_air]' : (($this->atts['ajaxSettings']) ? 'tgsbToAir' : 'airport')).'" id="tgsb_'.self::$nrOfBoxes.'_city_h" value="'.esc_attr($this->valuesToBeSet['hotel_city']).'" class="tgsb_addASH asTo" /> 740 731 </span> 741 732 <span> … … 779 770 $output .= '<div> 780 771 <label for="tgsb_'.self::$nrOfBoxes.'_city_h">City:</label> 781 <input type="text" name="'.(($this->atts['defaultSettings']) ? 'tg_searchboxes_options[hotels_to_air]' : (($this->atts['ajaxSettings']) ? 'tgsbToAir' : 'airport')).'" id="tgsb_'.self::$nrOfBoxes.'_city_h" value="'.esc_attr($this->valuesToBeSet[' to_air']).'" class="tgsb_addASH asTo" /><br />772 <input type="text" name="'.(($this->atts['defaultSettings']) ? 'tg_searchboxes_options[hotels_to_air]' : (($this->atts['ajaxSettings']) ? 'tgsbToAir' : 'airport')).'" id="tgsb_'.self::$nrOfBoxes.'_city_h" value="'.esc_attr($this->valuesToBeSet['hotel_city']).'" class="tgsb_addASH asTo" /><br /> 782 773 <span> 783 774 <label for="tgsb_'.self::$nrOfBoxes.'_dep_cal_h">Check-In:</label>'; … … 822 813 $output .=' 823 814 <label for="tgsb_'.self::$nrOfBoxes.'_city_h">City:</label> 824 <input type="text" name="'.(($this->atts['defaultSettings']) ? 'tg_searchboxes_options[hotels_to_air]' : (($this->atts['ajaxSettings']) ? 'tgsbToAir' : 'airport')).'" id="tgsb_'.self::$nrOfBoxes.'_city_h" value="'.esc_attr($this->valuesToBeSet[' to_air']).'" class="tgsb_addASH asTo" />815 <input type="text" name="'.(($this->atts['defaultSettings']) ? 'tg_searchboxes_options[hotels_to_air]' : (($this->atts['ajaxSettings']) ? 'tgsbToAir' : 'airport')).'" id="tgsb_'.self::$nrOfBoxes.'_city_h" value="'.esc_attr($this->valuesToBeSet['hotel_city']).'" class="tgsb_addASH asTo" /> 825 816 <span> 826 817 <label for="tgsb_'.self::$nrOfBoxes.'_dep_cal_h">Check-In:</label>'; -
travel-search/trunk/css/tg_searchboxes.dev.css
r1044744 r1087931 10 10 .tg_searchbox .tg_tabs li:before{content:""} 11 11 .tg_searchbox .tg_tabs li {padding:0 !important;display:block;float:left} 12 .tg_searchbox .tg_tabs li span{text-decoration:underline;cursor:pointer }12 .tg_searchbox .tg_tabs li span{text-decoration:underline;cursor:pointer;} 13 13 .tg_searchbox .tg_tabs li span.sel, .tg_searchbox .tg_tabs li span:hover{text-decoration:none} 14 14 .tg_searchbox .tg_container form{display:none;padding:0 13px;text-align:left} … … 45 45 .tg_searchbox .tg_container form div.mrcList a.tgBackToSearchbox{display:block;position:absolute;bottom:0} 46 46 .tg_searchbox .ppupHandlerCont iframe {background: transparent;} 47 .tg_searchbox *, .tg_searchbox *:before, .tg_searchbox *:after {box-sizing:content-box;} 47 48 48 49 /* CSS rules for the 160x600 searchbox */ -
travel-search/trunk/css/tg_searchboxes.min.css
r1044744 r1087931 1 .tg_searchbox{font-size:12px;font-family:Tahoma;line-height:normal}.tg_searchbox .tg_container{border-width:1px;border-style:solid;position:relative}.tg_searchbox .tg_tabs{list-style-position:inside;margin:0!important;padding:0!important;text-indent:0}.tg_searchbox .tg_tabs li:before{content:""}.tg_searchbox .tg_tabs li{padding:0!important;display:block;float:left}.tg_searchbox .tg_tabs li span{text-decoration:underline;cursor:pointer}.tg_searchbox .tg_tabs li span.sel,.tg_searchbox .tg_tabs li span:hover{text-decoration:none}.tg_searchbox .tg_container form{display:none;padding:0 13px;text-align:left}.tg_searchbox .tg_container form.sel{display:block}.tg_searchbox .tg_container form label{display:block!important;margin-right:3px}.tg_searchbox .tg_container form label.radio{display:inline-block!important;font-size:10px}.tg_searchbox .tg_container form input{font-family:Tahoma}.tg_searchbox .tg_container form input.tgsb_submit_button{background-color:#fec344;background-image:url(../images/tg_searchboxes/buttonbkg.png);background-repeat:repeat-x;border-top:none;border-left:none;border-right:1px solid #ce8513;border-bottom:1px solid #ce8513;height:29px;line-height:29px;width:auto;text-align:center;font-size:13px!important;color:#000;font-weight:700;cursor:pointer;padding:1px 6px}.tg_searchbox .tg_container form input.tgsb_submit_button_cmp{width:127px}.tg_searchbox .tg_container form input[type=radio]{vertical-align:middle;margin:0 3px}.tg_searchbox .tg_container form select{border:1px solid #a7b4b3;border-radius:0 0 0 0;padding:2px!important;height:23px!important;width:37px}.tg_searchbox .tg_container select.cruises{width:90%}.tg_searchbox .tg_container form input.tgsb_addAS,.tg_searchbox .tg_container form input.tgsb_addASH{border:1px solid #a7b4b3;margin:0;border-radius:0 0 0 0;padding:3px!important;font-size:12px!important}.tg_searchbox .tg_container form input.tgsb_addDP{height:auto;width:97px!important;border:1px solid #a7b4b3;padding:3px!important;font-size:12px!important;display:inline-block}.tg_searchbox .tg_container form img{margin:0!important;padding:0!important;border:0!important;background-color:transparent!important;vertical-align:top;cursor:pointer;display:inline-block}.tg_searchbox .tg_container form img.trackingPixel{position:absolute;cursor:default}.tg_searchbox .tg_container form div.hr{background:#ebf3db;border-bottom:1px solid #dde5d0;margin-top:5px;padding:0}.tg_searchbox .tg_container form span{display:inline-block!important;vertical-align:top!important}.tg_searchbox .tg_container form span.s select{margin:0}.tg_searchbox .tg_container div.pwr{font-size:10px;color:#6c7266;line-height:1.2em!important}.tg_searchbox .tg_container div.pwr a{text-decoration:underline;color:#6c7266}.tg_searchbox .tg_container div.pwr a.wdg{font-style:italic}.tg_searchbox .tg_container form input[type=text]{-moz-box-sizing:content-box;border-radius:0 0 0 0;line-height:12px!important}.tg_searchbox .tg_container form input{margin:0}.spcr{clear:both;float:none;font-size:0;height:0;line-height:0;width:auto}.nod{display:none}.tg_searchbox .tg_container form div.mrcList{padding:10px 0 5px}.tg_searchbox .tg_container form div.alCnt{text-align:center}.tg_searchbox .tg_container form div.alCnt img{margin-top:20px}.tg_searchbox .tg_container form div.mrcList span{background:#fff url(../images/tg_searchboxes/checkboxes.png) no-repeat!important;height:23px!important;border:1px solid #e7e7e7!important;padding-left:25px!important;display:inline-block!important;width:103px!important;margin-bottom:5px!important;cursor:pointer!important}.tg_searchbox .tg_container form div.mrcList span img{padding:1px 0 1px 5px !important;border:none!important}.tg_searchbox .tg_container form div.mrcList span.mSel{background-position:0 -24px!important;border:1px solid #000!important}.tg_searchbox .tg_container form div.mrcList a.tgBackToSearchbox{display:block;position:absolute;bottom:0}.tg_searchbox .ppupHandlerCont iframe{background:transparent}. m160x600{width:160px;height:600px}.m160x600 .tg_container{height:568px}.m160x600 .tg_tabs{height:30px!important}.m160x600 .tg_tabs li{margin:0 2px 0 0 !important;vertical-align:bottom;line-height:28px!important}.m160x600 .tg_tabs li span{display:inline-block!important;line-height:28px;height:27px;border-left:1px solid #d9d9d9;border-right:1px solid #d9d9d9;border-top:1px solid #d9d9d9;padding:0 12px!important;position:relative;top:1px;z-index:11;font-weight:500!important;text-transform:none!important;font-size:12px!important;border-bottom:0!important}.m160x600 .tg_tabs li span.sel,.m160x600 .tg_tabs li span:hover{height:29px;line-height:29px;background-image:url(../images/tg_searchboxes/tab-shade.png)!important;background-repeat:repeat-x}.m160x600 .tg_container form{margin:5px auto 0}.m160x600 .tg_container form label{line-height:25px;margin-right:0!important}.m160x600 .tg_container form label.radio{font-size:9px}.m160x600 .tg_container form span{width:138px;margin-bottom:4px;border:0!important;background:transparent!important;text-transform:none!important;padding:0!important;font-weight:500!important;font-size:12px!important}.m160x600 .tg_container form span.r{width:128px!important;float:none!important}.m160x600 .tg_container form span.s{width:50px;margin-bottom:0;vertical-align:bottom}.m160x600 .tg_container form span.rm{width:42px}.m160x600 .tg_container form input.tgsb_addASH{width:125px!important}.m160x600 .tg_container form input.tgsb_addAS{width:125px!important}.m160x600 .tg_container form input.tgsb_addDP{width:101px!important}.m160x600 .tg_container form input[type=radio]{margin:0!important;padding:0!important}.m160x600 .tg_container form input[type=submit]{display:block;margin:auto}.m160x600 .tg_container div.pwr{position:absolute;bottom:4px;text-align:center;width:100%}.m160x600 .tg_container form.flights input.oneway{margin:0 0 0 5px !important}.m160x600 .tg_container form.flights div.mrcList{height:210px}.m160x600 .tg_container form.flights div.help{background:url(../images/tg_searchboxes/compare-160x600.png) no-repeat 0 10px;width:126px;height:225px}.m160x600 .tg_container form.hotels div.mrcList{height:291px}.m160x600 .tg_container form.hotels div.help{background:url(../images/tg_searchboxes/compare-160x600.png) no-repeat 0 50px;width:126px;height:304px}.m160x600 .tg_container form.cars div.mrcList{height:290px}.m160x600 .tg_container form.cars div.help{background:url(../images/tg_searchboxes/compare-160x600.png) no-repeat 0 51px;width:126px;height:305px}.m300x250{width:300px;height:250px}.m300x250 .tg_container{height:218px}.m300x250 .tg_tabs{height:30px!important}.m300x250 .tg_tabs li{margin:0 2px 0 0 !important;vertical-align:bottom;line-height:28px!important}.m300x250 .tg_tabs li span{display:inline-block!important;line-height:28px;height:27px;border-left:1px solid #d9d9d9;border-right:1px solid #d9d9d9;border-top:1px solid #d9d9d9;padding:0 10px!important;position:relative;top:1px;z-index:11;font-weight:500!important;text-transform:none!important;font-size:12px!important;border-bottom:0!important}.m300x250 .tg_tabs li span.sel,.m300x250 .tg_tabs li span:hover{height:29px;line-height:29px;background-image:url(../images/tg_searchboxes/tab-shade.png)!important;background-repeat:repeat-x}.m300x250 .tg_container form{margin:5px auto 0;position:relative}.m300x250 .tg_container form div.formContent{height:184px}.m300x250 .tg_container form div.mrcList{height:174px;padding:10px 0 0}.m300x250 .tg_container form label{line-height:25px}.m300x250 .tg_container form span{width:142px;margin-bottom:4px;border:0!important;background:transparent!important;text-transform:none!important;padding:0!important;font-weight:500!important;font-size:12px!important}.m300x250 .tg_container form span.r{width:128px!important;float:none!important}.m300x250 .tg_container form span.s{width:55px;margin-bottom:0;vertical-align:bottom}.m300x250 .tg_container form input.tgsb_addAS{width:120px!important}.m300x250 .tg_container form.hotels input.tgsb_addASH{width:262px!important}.m300x250 .tg_container form input[type=submit]{display:block;vertical-align:bottom;position:absolute;bottom:0;right:15px}.m300x250 .tg_container form .ppupHandlerCont{position:absolute!important;bottom:0;right:15px}.m300x250 .tg_container form .ppupHandlerCont input[type=submit]{position:static}.m300x250 .tg_container div.pwr{position:absolute;bottom:4px;right:13px}.m300x250 .tg_container form div.mrcList span.mrr{margin-right:10px!important}.m300x250 .tg_container form div.mrcList a.tgBackToSearchbox{left:15px}.m300x533{width:300px;height:533px}.m300x533 .tg_container{height:501px}.m300x533 .tg_tabs{height:30px!important}.m300x533 .tg_tabs li{margin:0 2px 0 0 !important;vertical-align:bottom;line-height:28px!important}.m300x533 .tg_tabs li span{display:inline-block!important;line-height:28px;height:27px;border-left:1px solid #d9d9d9;border-right:1px solid #d9d9d9;border-top:1px solid #d9d9d9;padding:0 10px!important;position:relative;top:1px;z-index:11;font-weight:500!important;text-transform:none!important;font-size:12px!important;border-bottom:0!important}.m300x533 .tg_tabs li span.sel,.m300x533 .tg_tabs li span:hover{height:29px;line-height:29px;background-image:url(../images/tg_searchboxes/tab-shade.png)!important;background-repeat:repeat-x}.m300x533 .tg_container form{margin:5px auto 0}.m300x533 .tg_container form label{line-height:25px}.m300x533 .tg_container form span{width:142px;margin-bottom:4px;border:0!important;background:transparent!important;text-transform:none!important;padding:0!important;font-weight:500!important;font-size:12px!important}.m300x533 .tg_container form span.r{width:128px!important;float:none!important}.m300x533 .tg_container form span.s{width:55px;margin-bottom:0;vertical-align:bottom}.m300x533 .tg_container form input.tgsb_addAS{width:120px!important}.m300x533 .tg_container form.hotels input.tgsb_addASH{width:262px!important}.m300x533 .tg_container form input[type=submit]{display:block;margin:auto;vertical-align:bottom}.m300x533 .tg_container div.pwr{position:absolute;bottom:4px;right:13px}.m300x533 .tg_container form div.mrcList span.mrr{margin-right:10px!important}.m300x533 .tg_container form.flights div.mrcList{height:245px}.m300x533 .tg_container form.flights div.help{background:url(../images/tg_searchboxes/compare-brands.gif) no-repeat 0 27px;width:269px;height:260px}.m300x533 .tg_container form.hotels div.mrcList,.m300x533 .tg_container form.packages div.mrcList{height:276px}.m300x533 .tg_container form.hotels div.help,.m300x533 .tg_container form.packages div.help{background:url(../images/tg_searchboxes/compare-brands.gif) no-repeat 0 47px;width:269px;height:291px}.m300x533 .tg_container form.cars div.mrcList{height:325px}.m300x533 .tg_container form.cars div.help{background:url(../images/tg_searchboxes/compare-brands.gif) no-repeat 0 67px;width:269px;height:340px}.m728x90{width:728px;height:88px}.m728x90 .tg_container{float:right;width:668px;height:88px}.m728x90 .tg_tabs{float:left;width:58px}.m728x90 .tg_tabs li{margin:0 0 1px;line-height:19px;margin-bottom:1px!important}.m728x90 .tg_tabs li span{display:inline-block;line-height:19px;height:19px;border-left:1px solid #b7c791;border-bottom:1px solid #b7c791;border-top:1px solid #b7c791;padding-left:3px;cursor:pointer;z-index:11;width:54px;position:relative;font-size:10px;text-transform:none!important}.m728x90 .tg_tabs li span.sel,.m728x90 .tg_tabs li span:hover{line-height:20px;background-image:url(../images/tg_searchboxes/vertical-shade.png)!important;background-repeat:repeat-y!important;left:1px}.m728x90 .tg_container form{margin:0 auto;position:relative}.m728x90 .tg_container form div.formContent,.m728x90 .tg_container form div.mrcList{float:left}.m728x90 .tg_container form div.mrcList{width:425px;height:75px;position:relative;padding:10px 0 0}.m728x90 .tg_container form label{margin-bottom:0;line-height:16px}.m728x90 .tg_container form span{width:165px;text-transform:none!important}.m728x90 .tg_container form span.s{width:70px;vertical-align:top}.m728x90 .tg_container form span.s select.tt{width:auto}.m728x90 .tg_container form span.akstt{width:210px;display:inline-block;vertical-align:top}.m728x90 .tg_container form input.tgsb_addAS{height:auto;width:145px}.m728x90 .tg_container div.pwr{position:absolute;right:13px;bottom:5px}.m728x90 .tg_container form input[type=submit]{display:block;position:absolute;right:15px;top:30px}.m728x90 .tg_container form .ppupHandlerCont{position:absolute!important;right:15px;top:30px}.m728x90 .tg_container form .ppupHandlerCont input{position:static}.m728x90 .tg_container form input.tgsb_addASH{width:291px}.m728x90 .tg_container form.hotels div{float:left}.m728x90 .tg_container form.cars span{width:210px}.m728x90 .tg_container form.cars input[type=text]{width:190px}.m728x90 .tg_container form div.mrcList span{margin-right:10px!important}.m728x90 .tg_container form div.mrcList a.tgBackToSearchbox{left:139px}.m728x90 .tg_container form input.tgsb_addDP{width:103px!important}.mdynamic{min-width:300px;width:auto}.mdynamic .tg_container{min-height:218px}.mdynamic .tg_tabs{height:30px!important}.mdynamic .tg_tabs li{margin:0 2px 0 0 !important;vertical-align:bottom;line-height:28px!important}.mdynamic .tg_tabs li span{display:inline-block!important;line-height:28px;height:27px;border-left:1px solid #d9d9d9;border-right:1px solid #d9d9d9;border-top:1px solid #d9d9d9;padding:0 14px!important;position:relative;top:1px;z-index:11;font-weight:500!important;text-transform:none!important;font-size:12px!important;border-bottom:0!important}.mdynamic .tg_tabs li span.sel,.mdynamic .tg_tabs li span:hover{height:29px;line-height:29px;background-image:url(../images/tg_searchboxes/tab-shade.png)!important;background-repeat:repeat-x}.mdynamic .tg_container form{margin:5px auto 20px;position:relative;padding:0 0 0 13px;min-height:140px}.mdynamic .tg_container form div.hr{width:97.8%}.mdynamic .tg_container form div.mrcList{padding:10px 0 30px}.mdynamic .tg_container form.flights div.mrcList{padding:5px 0}.mdynamic .tg_container form label{line-height:25px}.mdynamic .tg_container form span{width:52%;margin-bottom:4px;border:0!important;background:transparent!important;text-transform:none!important;padding:0!important;font-weight:500!important;font-size:12px!important}.mdynamic .tg_container form span.r{width:47%!important;float:none!important}.mdynamic .tg_container form span.s{width:18%;margin-bottom:0;vertical-align:bottom}.mdynamic .tg_container form.flights span.s{margin-bottom:5px}.mdynamic .tg_container form span.s select.tt{width:auto}.mdynamic .tg_container form span.rm{width:42px}.mdynamic .tg_container form input.tgsb_addAS{width:84%!important}.mdynamic .tg_container form input.asTo{width:86%!important}.mdynamic .tg_container form input.tgsb_addDP{width:68%!important}.mdynamic .tg_container form.hotels input.tgsb_addASH{width:96%!important}.mdynamic .tg_container form input[type=submit]{display:block;vertical-align:bottom;position:absolute;bottom:0;right:15px}.mdynamic .tg_container form .ppupHandlerCont{position:absolute!important;bottom:0;right:15px}.mdynamic .tg_container form .ppupHandlerCont input{position:static}.mdynamic .tg_container form.flights input[type=submit]{position:static;float:right;margin:0 15px 0 0}.mdynamic .tg_container form.flights .ppupHandlerCont{position:relative!important;right:0!important;float:right}.mdynamic .tg_container div.pwr{position:absolute;bottom:4px;right:13px}.mdynamic .tg_container form.packages span.s{width:16%}.mdynamic .tg_container form div.mrcList span{margin-right:10px!important}ul.tgsb_as{display:none;position:absolute;margin:0;padding:2px;border:1px solid #fedf49;background:#fff;z-index:8424;font-size:12px;list-style-type:none;text-align:left}ul.tgsb_as li{color:#000;padding:0 0 0 27px;margin:0;background-position:5px center;background-repeat:no-repeat;cursor:pointer;overflow:hidden;border-top:1px dotted transparent;border-bottom:1px dotted transparent;height:25px;line-height:25px}ul.tgsb_as li em{height:20px;line-height:23px;font-style:normal;display:block;padding:0 5px;white-space:nowrap}ul.tgsb_as .even{border-color:#c1c1c1;background-color:#f0f0f0}ul.tgsb_as li.as_hl{background-color:#FDBE6E;border-color:#FDBE6E}.tgsb_as li b{font-weight:700}input.tgsb_as_load{background-image:url(../images/tg_searchboxes/ajax-loader.gif);background-repeat:no-repeat;background-position:98% center}.tg_searchbox .tg_container form input[type=text].err,.tg_searchbox .tg_container form input[type=text][readonly=readonly].err{border:1px solid red;background-color:#ffe5e5}1 .tg_searchbox{font-size:12px;font-family:Tahoma;line-height:normal}.tg_searchbox .tg_container{border-width:1px;border-style:solid;position:relative}.tg_searchbox .tg_tabs{list-style-position:inside;margin:0!important;padding:0!important;text-indent:0}.tg_searchbox .tg_tabs li:before{content:""}.tg_searchbox .tg_tabs li{padding:0!important;display:block;float:left}.tg_searchbox .tg_tabs li span{text-decoration:underline;cursor:pointer}.tg_searchbox .tg_tabs li span.sel,.tg_searchbox .tg_tabs li span:hover{text-decoration:none}.tg_searchbox .tg_container form{display:none;padding:0 13px;text-align:left}.tg_searchbox .tg_container form.sel{display:block}.tg_searchbox .tg_container form label{display:block!important;margin-right:3px}.tg_searchbox .tg_container form label.radio{display:inline-block!important;font-size:10px}.tg_searchbox .tg_container form input{font-family:Tahoma}.tg_searchbox .tg_container form input.tgsb_submit_button{background-color:#fec344;background-image:url(../images/tg_searchboxes/buttonbkg.png);background-repeat:repeat-x;border-top:none;border-left:none;border-right:1px solid #ce8513;border-bottom:1px solid #ce8513;height:29px;line-height:29px;width:auto;text-align:center;font-size:13px!important;color:#000;font-weight:700;cursor:pointer;padding:1px 6px}.tg_searchbox .tg_container form input.tgsb_submit_button_cmp{width:127px}.tg_searchbox .tg_container form input[type=radio]{vertical-align:middle;margin:0 3px}.tg_searchbox .tg_container form select{border:1px solid #a7b4b3;border-radius:0 0 0 0;padding:2px!important;height:23px!important;width:37px}.tg_searchbox .tg_container select.cruises{width:90%}.tg_searchbox .tg_container form input.tgsb_addAS,.tg_searchbox .tg_container form input.tgsb_addASH{border:1px solid #a7b4b3;margin:0;border-radius:0 0 0 0;padding:3px!important;font-size:12px!important}.tg_searchbox .tg_container form input.tgsb_addDP{height:auto;width:97px!important;border:1px solid #a7b4b3;padding:3px!important;font-size:12px!important;display:inline-block}.tg_searchbox .tg_container form img{margin:0!important;padding:0!important;border:0!important;background-color:transparent!important;vertical-align:top;cursor:pointer;display:inline-block}.tg_searchbox .tg_container form img.trackingPixel{position:absolute;cursor:default}.tg_searchbox .tg_container form div.hr{background:#ebf3db;border-bottom:1px solid #dde5d0;margin-top:5px;padding:0}.tg_searchbox .tg_container form span{display:inline-block!important;vertical-align:top!important}.tg_searchbox .tg_container form span.s select{margin:0}.tg_searchbox .tg_container div.pwr{font-size:10px;color:#6c7266;line-height:1.2em!important}.tg_searchbox .tg_container div.pwr a{text-decoration:underline;color:#6c7266}.tg_searchbox .tg_container div.pwr a.wdg{font-style:italic}.tg_searchbox .tg_container form input[type=text]{-moz-box-sizing:content-box;border-radius:0 0 0 0;line-height:12px!important}.tg_searchbox .tg_container form input{margin:0}.spcr{clear:both;float:none;font-size:0;height:0;line-height:0;width:auto}.nod{display:none}.tg_searchbox .tg_container form div.mrcList{padding:10px 0 5px}.tg_searchbox .tg_container form div.alCnt{text-align:center}.tg_searchbox .tg_container form div.alCnt img{margin-top:20px}.tg_searchbox .tg_container form div.mrcList span{background:#fff url(../images/tg_searchboxes/checkboxes.png) no-repeat!important;height:23px!important;border:1px solid #e7e7e7!important;padding-left:25px!important;display:inline-block!important;width:103px!important;margin-bottom:5px!important;cursor:pointer!important}.tg_searchbox .tg_container form div.mrcList span img{padding:1px 0 1px 5px !important;border:none!important}.tg_searchbox .tg_container form div.mrcList span.mSel{background-position:0 -24px!important;border:1px solid #000!important}.tg_searchbox .tg_container form div.mrcList a.tgBackToSearchbox{display:block;position:absolute;bottom:0}.tg_searchbox .ppupHandlerCont iframe{background:transparent}.tg_searchbox *,.tg_searchbox :before,.tg_searchbox :after{box-sizing:content-box}.m160x600{width:160px;height:600px}.m160x600 .tg_container{height:568px}.m160x600 .tg_tabs{height:30px!important}.m160x600 .tg_tabs li{margin:0 2px 0 0 !important;vertical-align:bottom;line-height:28px!important}.m160x600 .tg_tabs li span{display:inline-block!important;line-height:28px;height:27px;border-left:1px solid #d9d9d9;border-right:1px solid #d9d9d9;border-top:1px solid #d9d9d9;padding:0 12px!important;position:relative;top:1px;z-index:11;font-weight:500!important;text-transform:none!important;font-size:12px!important;border-bottom:0!important}.m160x600 .tg_tabs li span.sel,.m160x600 .tg_tabs li span:hover{height:29px;line-height:29px;background-image:url(../images/tg_searchboxes/tab-shade.png)!important;background-repeat:repeat-x}.m160x600 .tg_container form{margin:5px auto 0}.m160x600 .tg_container form label{line-height:25px;margin-right:0!important}.m160x600 .tg_container form label.radio{font-size:9px}.m160x600 .tg_container form span{width:138px;margin-bottom:4px;border:0!important;background:transparent!important;text-transform:none!important;padding:0!important;font-weight:500!important;font-size:12px!important}.m160x600 .tg_container form span.r{width:128px!important;float:none!important}.m160x600 .tg_container form span.s{width:50px;margin-bottom:0;vertical-align:bottom}.m160x600 .tg_container form span.rm{width:42px}.m160x600 .tg_container form input.tgsb_addASH{width:125px!important}.m160x600 .tg_container form input.tgsb_addAS{width:125px!important}.m160x600 .tg_container form input.tgsb_addDP{width:101px!important}.m160x600 .tg_container form input[type=radio]{margin:0!important;padding:0!important}.m160x600 .tg_container form input[type=submit]{display:block;margin:auto}.m160x600 .tg_container div.pwr{position:absolute;bottom:4px;text-align:center;width:100%}.m160x600 .tg_container form.flights input.oneway{margin:0 0 0 5px !important}.m160x600 .tg_container form.flights div.mrcList{height:210px}.m160x600 .tg_container form.flights div.help{background:url(../images/tg_searchboxes/compare-160x600.png) no-repeat 0 10px;width:126px;height:225px}.m160x600 .tg_container form.hotels div.mrcList{height:291px}.m160x600 .tg_container form.hotels div.help{background:url(../images/tg_searchboxes/compare-160x600.png) no-repeat 0 50px;width:126px;height:304px}.m160x600 .tg_container form.cars div.mrcList{height:290px}.m160x600 .tg_container form.cars div.help{background:url(../images/tg_searchboxes/compare-160x600.png) no-repeat 0 51px;width:126px;height:305px}.m300x250{width:300px;height:250px}.m300x250 .tg_container{height:218px}.m300x250 .tg_tabs{height:30px!important}.m300x250 .tg_tabs li{margin:0 2px 0 0 !important;vertical-align:bottom;line-height:28px!important}.m300x250 .tg_tabs li span{display:inline-block!important;line-height:28px;height:27px;border-left:1px solid #d9d9d9;border-right:1px solid #d9d9d9;border-top:1px solid #d9d9d9;padding:0 10px!important;position:relative;top:1px;z-index:11;font-weight:500!important;text-transform:none!important;font-size:12px!important;border-bottom:0!important}.m300x250 .tg_tabs li span.sel,.m300x250 .tg_tabs li span:hover{height:29px;line-height:29px;background-image:url(../images/tg_searchboxes/tab-shade.png)!important;background-repeat:repeat-x}.m300x250 .tg_container form{margin:5px auto 0;position:relative}.m300x250 .tg_container form div.formContent{height:184px}.m300x250 .tg_container form div.mrcList{height:174px;padding:10px 0 0}.m300x250 .tg_container form label{line-height:25px}.m300x250 .tg_container form span{width:142px;margin-bottom:4px;border:0!important;background:transparent!important;text-transform:none!important;padding:0!important;font-weight:500!important;font-size:12px!important}.m300x250 .tg_container form span.r{width:128px!important;float:none!important}.m300x250 .tg_container form span.s{width:55px;margin-bottom:0;vertical-align:bottom}.m300x250 .tg_container form input.tgsb_addAS{width:120px!important}.m300x250 .tg_container form.hotels input.tgsb_addASH{width:262px!important}.m300x250 .tg_container form input[type=submit]{display:block;vertical-align:bottom;position:absolute;bottom:0;right:15px}.m300x250 .tg_container form .ppupHandlerCont{position:absolute!important;bottom:0;right:15px}.m300x250 .tg_container form .ppupHandlerCont input[type=submit]{position:static}.m300x250 .tg_container div.pwr{position:absolute;bottom:4px;right:13px}.m300x250 .tg_container form div.mrcList span.mrr{margin-right:10px!important}.m300x250 .tg_container form div.mrcList a.tgBackToSearchbox{left:15px}.m300x533{width:300px;height:533px}.m300x533 .tg_container{height:501px}.m300x533 .tg_tabs{height:30px!important}.m300x533 .tg_tabs li{margin:0 2px 0 0 !important;vertical-align:bottom;line-height:28px!important}.m300x533 .tg_tabs li span{display:inline-block!important;line-height:28px;height:27px;border-left:1px solid #d9d9d9;border-right:1px solid #d9d9d9;border-top:1px solid #d9d9d9;padding:0 10px!important;position:relative;top:1px;z-index:11;font-weight:500!important;text-transform:none!important;font-size:12px!important;border-bottom:0!important}.m300x533 .tg_tabs li span.sel,.m300x533 .tg_tabs li span:hover{height:29px;line-height:29px;background-image:url(../images/tg_searchboxes/tab-shade.png)!important;background-repeat:repeat-x}.m300x533 .tg_container form{margin:5px auto 0}.m300x533 .tg_container form label{line-height:25px}.m300x533 .tg_container form span{width:142px;margin-bottom:4px;border:0!important;background:transparent!important;text-transform:none!important;padding:0!important;font-weight:500!important;font-size:12px!important}.m300x533 .tg_container form span.r{width:128px!important;float:none!important}.m300x533 .tg_container form span.s{width:55px;margin-bottom:0;vertical-align:bottom}.m300x533 .tg_container form input.tgsb_addAS{width:120px!important}.m300x533 .tg_container form.hotels input.tgsb_addASH{width:262px!important}.m300x533 .tg_container form input[type=submit]{display:block;margin:auto;vertical-align:bottom}.m300x533 .tg_container div.pwr{position:absolute;bottom:4px;right:13px}.m300x533 .tg_container form div.mrcList span.mrr{margin-right:10px!important}.m300x533 .tg_container form.flights div.mrcList{height:245px}.m300x533 .tg_container form.flights div.help{background:url(../images/tg_searchboxes/compare-brands.gif) no-repeat 0 27px;width:269px;height:260px}.m300x533 .tg_container form.hotels div.mrcList,.m300x533 .tg_container form.packages div.mrcList{height:276px}.m300x533 .tg_container form.hotels div.help,.m300x533 .tg_container form.packages div.help{background:url(../images/tg_searchboxes/compare-brands.gif) no-repeat 0 47px;width:269px;height:291px}.m300x533 .tg_container form.cars div.mrcList{height:325px}.m300x533 .tg_container form.cars div.help{background:url(../images/tg_searchboxes/compare-brands.gif) no-repeat 0 67px;width:269px;height:340px}.m728x90{width:728px;height:88px}.m728x90 .tg_container{float:right;width:668px;height:88px}.m728x90 .tg_tabs{float:left;width:58px}.m728x90 .tg_tabs li{margin:0 0 1px;line-height:19px;margin-bottom:1px!important}.m728x90 .tg_tabs li span{display:inline-block;line-height:19px;height:19px;border-left:1px solid #b7c791;border-bottom:1px solid #b7c791;border-top:1px solid #b7c791;padding-left:3px;cursor:pointer;z-index:11;width:54px;position:relative;font-size:10px;text-transform:none!important}.m728x90 .tg_tabs li span.sel,.m728x90 .tg_tabs li span:hover{line-height:20px;background-image:url(../images/tg_searchboxes/vertical-shade.png)!important;background-repeat:repeat-y!important;left:1px}.m728x90 .tg_container form{margin:0 auto;position:relative}.m728x90 .tg_container form div.formContent,.m728x90 .tg_container form div.mrcList{float:left}.m728x90 .tg_container form div.mrcList{width:425px;height:75px;position:relative;padding:10px 0 0}.m728x90 .tg_container form label{margin-bottom:0;line-height:16px}.m728x90 .tg_container form span{width:165px;text-transform:none!important}.m728x90 .tg_container form span.s{width:70px;vertical-align:top}.m728x90 .tg_container form span.s select.tt{width:auto}.m728x90 .tg_container form span.akstt{width:210px;display:inline-block;vertical-align:top}.m728x90 .tg_container form input.tgsb_addAS{height:auto;width:145px}.m728x90 .tg_container div.pwr{position:absolute;right:13px;bottom:5px}.m728x90 .tg_container form input[type=submit]{display:block;position:absolute;right:15px;top:30px}.m728x90 .tg_container form .ppupHandlerCont{position:absolute!important;right:15px;top:30px}.m728x90 .tg_container form .ppupHandlerCont input{position:static}.m728x90 .tg_container form input.tgsb_addASH{width:291px}.m728x90 .tg_container form.hotels div{float:left}.m728x90 .tg_container form.cars span{width:210px}.m728x90 .tg_container form.cars input[type=text]{width:190px}.m728x90 .tg_container form div.mrcList span{margin-right:10px!important}.m728x90 .tg_container form div.mrcList a.tgBackToSearchbox{left:139px}.m728x90 .tg_container form input.tgsb_addDP{width:103px!important}.mdynamic{min-width:300px;width:auto}.mdynamic .tg_container{min-height:218px}.mdynamic .tg_tabs{height:30px!important}.mdynamic .tg_tabs li{margin:0 2px 0 0 !important;vertical-align:bottom;line-height:28px!important}.mdynamic .tg_tabs li span{display:inline-block!important;line-height:28px;height:27px;border-left:1px solid #d9d9d9;border-right:1px solid #d9d9d9;border-top:1px solid #d9d9d9;padding:0 14px!important;position:relative;top:1px;z-index:11;font-weight:500!important;text-transform:none!important;font-size:12px!important;border-bottom:0!important}.mdynamic .tg_tabs li span.sel,.mdynamic .tg_tabs li span:hover{height:29px;line-height:29px;background-image:url(../images/tg_searchboxes/tab-shade.png)!important;background-repeat:repeat-x}.mdynamic .tg_container form{margin:5px auto 20px;position:relative;padding:0 0 0 13px;min-height:140px}.mdynamic .tg_container form div.hr{width:97.8%}.mdynamic .tg_container form div.mrcList{padding:10px 0 30px}.mdynamic .tg_container form.flights div.mrcList{padding:5px 0}.mdynamic .tg_container form label{line-height:25px}.mdynamic .tg_container form span{width:52%;margin-bottom:4px;border:0!important;background:transparent!important;text-transform:none!important;padding:0!important;font-weight:500!important;font-size:12px!important}.mdynamic .tg_container form span.r{width:47%!important;float:none!important}.mdynamic .tg_container form span.s{width:18%;margin-bottom:0;vertical-align:bottom}.mdynamic .tg_container form.flights span.s{margin-bottom:5px}.mdynamic .tg_container form span.s select.tt{width:auto}.mdynamic .tg_container form span.rm{width:42px}.mdynamic .tg_container form input.tgsb_addAS{width:84%!important}.mdynamic .tg_container form input.asTo{width:86%!important}.mdynamic .tg_container form input.tgsb_addDP{width:68%!important}.mdynamic .tg_container form.hotels input.tgsb_addASH{width:96%!important}.mdynamic .tg_container form input[type=submit]{display:block;vertical-align:bottom;position:absolute;bottom:0;right:15px}.mdynamic .tg_container form .ppupHandlerCont{position:absolute!important;bottom:0;right:15px}.mdynamic .tg_container form .ppupHandlerCont input{position:static}.mdynamic .tg_container form.flights input[type=submit]{position:static;float:right;margin:0 15px 0 0}.mdynamic .tg_container form.flights .ppupHandlerCont{position:relative!important;right:0!important;float:right}.mdynamic .tg_container div.pwr{position:absolute;bottom:4px;right:13px}.mdynamic .tg_container form.packages span.s{width:16%}.mdynamic .tg_container form div.mrcList span{margin-right:10px!important}ul.tgsb_as{display:none;position:absolute;margin:0;padding:2px;border:1px solid #fedf49;background:#fff;z-index:8424;font-size:12px;list-style-type:none;text-align:left}ul.tgsb_as li{color:#000;padding:0 0 0 27px;margin:0;background-position:5px center;background-repeat:no-repeat;cursor:pointer;overflow:hidden;border-top:1px dotted transparent;border-bottom:1px dotted transparent;height:25px;line-height:25px}ul.tgsb_as li em{height:20px;line-height:23px;font-style:normal;display:block;padding:0 5px;white-space:nowrap}ul.tgsb_as .even{border-color:#c1c1c1;background-color:#f0f0f0}ul.tgsb_as li.as_hl{background-color:#FDBE6E;border-color:#FDBE6E}.tgsb_as li b{font-weight:700}input.tgsb_as_load{background-image:url(../images/tg_searchboxes/ajax-loader.gif);background-repeat:no-repeat;background-position:98% center}.tg_searchbox .tg_container form input[type=text].err,.tg_searchbox .tg_container form input[type=text][readonly=readonly].err{border:1px solid red;background-color:#ffe5e5} -
travel-search/trunk/js/autosuggestion.dev.js
r561025 r1087931 332 332 var argName = jsondata.argumentList[j]; 333 333 var argValue = jsondata.results[i][argName]; 334 rsp += ' '+argName+'="' +argValue+'"';334 rsp += ' '+argName+'="' + this.escapeHtml(argValue) + '"'; 335 335 } 336 336 rsp += '>'+jsondata.results[i].txt+'</li>'; … … 339 339 } else { //XML 340 340 rsp = req.substr(40); 341 } ;341 } 342 342 jQuery(this.fld).removeClass(this.opt.loadingClass); 343 343 if (this.isFocused) { … … 347 347 if(this.opt.autoSelect) { 348 348 this.autoSelect(rsp, jsondata); 349 }; 350 }; 349 } 350 } 351 }; 352 353 parentObject.AutoSuggest.prototype.escapeHtml = function(text) { 354 return text 355 .replace(/&/g, "&") 356 .replace(/</g, "<") 357 .replace(/>/g, ">") 358 .replace(/"/g, """) 359 .replace(/'/g, "'"); 351 360 }; 352 361 -
travel-search/trunk/js/autosuggestion.min.js
r561025 r1087931 1 /*deleteCache-description:AutoSuggestion used inside the WP Plugin; jQUery compatible.*/ 2 /*deleteCache-minimizeJS:true*/ 3 window.undefined=window.undefined;function loading(){};var parentObject=this;function cloneObject(src){var dest=new Object;for(i in src){if(typeof src[i]=='object'){dest[i]=cloneObject(src[i])}else dest[i]=src[i]}return dest};parentObject.getPos=function(e){var o=jQuery(e).offset();return{'x':o.left,'y':o.top}};var defaultParams={script:"ajax/suggestions/airports.php",minchars:3,className:"as",delay:500,timeout:2500,cache:true,loadingClass:"aLoad",offsety:2,showNoResults:false,maxheight:250,noResults:"No results!",meth:"POST",json:false,frameForIE:true,autoSelect:true,ajaxParams:{action:"test",json:this.json},setAjaxParams:function(asObj){var idx=0,aPrms='';for(key in this.ajaxParams){if(idx==0)aPrms+=key+'='+asObj.fld.value;else aPrms+='&'+key+'='+this.ajaxParams[key];idx++}asObj.ajaxObject.data=aPrms;return true},setAjaxParams:function(asObj){var idx=0,aPrms='';for(key in this.ajaxParams){if(idx==0)aPrms+=key+'='+asObj.fld.value;else aPrms+='&'+key+'='+this.ajaxParams[key];idx++}asObj.ajaxObject.data=aPrms;return true},format:function(liObj){return liObj.innerHTML.replace(/<\/?[a-z]+>/gi,'')},errorHandler:function(asObj){return}};if(parentObject.AutoSuggest==undefined){parentObject.AutoSuggest={}};parentObject.AutoSuggest=function(fldID,pObj){if(!(this.fld=jQuery('#'+fldID)[0]))return false;this.fld.setAttribute("autocomplete","off");this.sInput="";this.nInputChars=0;this.aSuggestions={};this.defText=this.fld.value;this.highlighted=null;this.opt=pObj?cloneObject(pObj):{};for(k in defaultParams){if(typeof(this.opt[k])!=typeof(defaultParams[k])){this.opt[k]=defaultParams[k]}};var pointer=this;this.ajaxObject={url:this.opt.script,global:false,type:this.opt.meth,dataType:'text',data:this.opt.ajaxParams,error:function(req,errmsg,exc){},success:function(rsp){pointer.generateList(rsp)},errorFlag:0,complete:function(reqObj,tos){}};this.coords=getPos(this.fld);this.coords.y+=this.fld.offsetHeight+this.opt.offsety;if(this.opt.frameForIE&&jQuery.browser.msie&&parseInt(jQuery.browser.version)<7){this.iframe=jQuery('<iframe src="about:blank" frameborder="0" marginheight="0" marginwidth="0" scrolling="no" style="position:absolute;background:#fff;z-index:399;">')}else{this.opt.frameForIE=false};this.blurTimer=0;var pointer=this;this.isFocused=true;this.fld.onkeypress=function(ev){return pointer.onKeyPress(ev)};this.fld.onkeyup=function(ev){return pointer.onKeyUp(ev)};this.fld.onblur=function(ev){pointer.isFocused=false;if(!pointer.fld.value)return;pointer.blurTimer=setTimeout(function(){if(pointer.ajaxObject.errorFlag)pointer.opt.errorHandler(this);if(pointer.opt.autoSelect)pointer.setHighlightedValue();else pointer.clearSuggestions(ev);pointer.highlighted=null},pointer.opt.delay/2)};this.fld.onfocus=function(ev){pointer.highlighted=null;pointer.isFocused=true};this.req={};this.fld.autoSuggest=this};parentObject.AutoSuggest.prototype.onKeyUp=function(ev){var key=(window.event)?window.event.keyCode:ev.keyCode;var bubble=true;switch(key){case 38:this.changeHighlight(key);bubble=false;break;case 40:this.changeHighlight(key);bubble=false;break;case 13:break;default:this.getSuggestions()}return bubble};parentObject.AutoSuggest.prototype.onKeyPress=function(ev){var key=(window.event)?window.event.keyCode:ev.keyCode;var bubble=true;this.isFocused=true;switch(key){case 13:this.setHighlightedValue();bubble=false;break;case 27:this.setHighlightedValue();break;case 9:break}return bubble};parentObject.AutoSuggest.prototype.getSuggestions=function(){var val=this.fld.value.toLowerCase();if(val==this.sInput)return false;if(val.length<this.opt.minchars){this.clearSuggestions();this.sInput="";return false}this.makeReq=true;if(val.length>this.nInputChars&&this.aSuggestions.length&&this.opt.cache&&this.aSuggestions[0]&&this.aSuggestions[0].childNodes){val=val.replace(/[^a-zA-Z????]/g,' ');with(this.aSuggestions[0]){for(var i=0;i<childNodes.length;i++){if(childNodes[i].nodeType!=1){continue};var txt=childNodes[i].innerHTML.replace(/<\/?[^>]+>/gi,'');if(!txt.toLowerCase().match(val)){removeChild(childNodes[i--])}else{childNodes[i].innerHTML=this.highlightText(childNodes[i].innerHTML,val)}}};if(!this.aSuggestions[0].childNodes.length){this.clearSuggestions();this.doAjaxRequest(this.ajaxObject);return false};this.makeReq=false;if(this.opt.frameForIE)this.updateIframe(this.coords);this.sInput=val;this.nInputChars=val.length;if(!this.aSuggestions[0].parentNode){document.body.appendChild(this.aSuggestions[0]);if(this.opt.frameForIE){document.body.appendChild(this.iframe[0])}};if(this.highlighted){this.clearHighlight()};return false}else{this.sInput=val;this.nInputChars=val.length;var pointer=this;clearTimeout(this.ajID);this.ajID=setTimeout(function(){pointer.doAjaxRequest(pointer.ajaxObject)},this.opt.delay);return false}};parentObject.AutoSuggest.prototype.doAjaxRequest=function(){if(this.fld.value.length<this.opt.minchars){return};jQuery(this.fld).addClass(this.opt.loadingClass);this.opt.setAjaxParams(this);this.req=jQuery.ajax(this.ajaxObject);this.ajaxObject.errorFlag=0};parentObject.AutoSuggest.prototype.generateList=function(req){this.coords=getPos(this.fld);this.coords.y+=this.fld.offsetHeight+this.opt.offsety;this.makeReq=false;if(this.aSuggestions[0]&&this.aSuggestions[0].parentNode){this.aSuggestions.remove()};var jsondata,rsp;if(this.opt.json){try{jsondata=eval('('+req+')')}catch(e){return e}rsp='<ul>';n=jsondata.argumentList?jsondata.argumentList.length:0;for(i=0;i<jsondata.results.length;i++){rsp+='<li';for(j=0;j<n;j++){var argName=jsondata.argumentList[j];var argValue=jsondata.results[i][argName];rsp+=' '+argName+'="'+argValue+'"'}rsp+='>'+jsondata.results[i].txt+'</li>'}rsp+='</ul>'}else{rsp=req.substr(40)};jQuery(this.fld).removeClass(this.opt.loadingClass);if(this.isFocused){this.createList(rsp,jsondata)}else{if(this.opt.autoSelect){this.autoSelect(rsp,jsondata)}}};parentObject.AutoSuggest.prototype.autoSelect=function(rsp,jsonObj){if(!jsonObj.results||!jsonObj.results.length){this.opt.errorHandler(this);this.ajaxObject.errorFlag=1;clearTimeout(this.blurTimer);return false}firstElement='<li';n=jsonObj.argumentList?jsonObj.argumentList.length:0;for(j=0;j<n;j++){var argName=jsonObj.argumentList[j];var argValue=jsonObj.results[0][argName];firstElement+=' '+argName+'="'+argValue+'"'}firstElement+='>'+jsonObj.results[0].txt+'</li>';this.highlighted=jQuery(firstElement).get(0);this.setHighlightedValue();return true};parentObject.AutoSuggest.prototype.createList=function(rsp,jsonObj){if(!jsonObj.results||!jsonObj.results.length){this.ajaxObject.errorFlag=1;return false}var pointer=this;pointer.aSuggestions=jQuery(rsp).attr({"class":pointer.opt.className,"id":"as"+pointer.fld.id}).css({left:pointer.coords.x,top:pointer.coords.y}).appendTo('body').css({display:'block'});pointer.aSuggestions.hide();pointer.aSuggestions.show();internal_cnt=0;pointer.aSuggestions.find('li').each(function(){internal_cnt++;jQuery(this).addClass(internal_cnt%2==0?'even':'odd')});if(this.opt.frameForIE)this.updateIframe(this.coords).appendTo('body');pointer.aSuggestions.children("li").each(function(idx){this.innerHTML=pointer.highlightText(this.innerHTML,pointer.fld.value);jQuery(this).mousedown(function(){pointer.setHighlightedValue();pointer.fld.focus()});jQuery(this).mouseover(function(){pointer.setHighlight(this)})});if(!this.isFocused){this.setHighlightedValue();return}pointer.highlighted=null;if(pointer.aSuggestions[0].childNodes.length==0){if(pointer.opt.showNoResults){pointer.aSuggestions.append('<li>'+pointer.opt.noResults+'</li>')}else{pointer.clearSuggestions()}};return};parentObject.AutoSuggest.prototype.changeHighlight=function(key){if(!this.aSuggestions[0]){return false};if(this.highlighted==null){return this.setHighlight(this.highlighted=this.aSuggestions[0].firstChild)};if(key==38){if(this.highlighted==this.aSuggestions[0].firstChild){return this.setHighlight(this.aSuggestions[0].lastChild)};return(this.highlighted.previousSibling.nodeType==1)?this.setHighlight(this.highlighted.previousSibling):this.setHighlight(this.highlighted.previousSibling.previousSibling)}else{if(this.highlighted==this.aSuggestions[0].lastChild){return this.setHighlight(this.aSuggestions[0].firstChild)};return((this.highlighted.nextSibling.nodeType==1)?this.setHighlight(this.highlighted.nextSibling):this.setHighlight(this.highlighted.nextSibling.nextSibling))}};parentObject.AutoSuggest.prototype.setHighlight=function(liObj){if(this.highlighted!=null){this.clearHighlight()};this.highlighted=liObj;jQuery(this.highlighted).addClass('as_hl');return true};parentObject.AutoSuggest.prototype.clearHighlight=function(){jQuery(this.highlighted).removeClass('as_hl');this.highlighted=null};parentObject.AutoSuggest.prototype.setHighlightedValue=function(){if(this.ajaxObject.errorFlag){return};clearTimeout(this.blurTimer);if(!this.fld.value){return};if(!this.highlighted){try{var t=this.aSuggestions&&this.aSuggestions.children&&this.aSuggestions.children('li:eq(0)').get(0)}catch(err){};if(!t){this.clearSuggestions();return false}this.setHighlight(t)}if(this.highlighted&&!this.makeReq){this.sInput=this.fld.value=this.opt.format(this.highlighted)};if(typeof(this.opt.callback)=="function"){this.opt.callback(this.highlighted,this)};this.clearSuggestions();return true};parentObject.AutoSuggest.prototype.clearSuggestions=function(){if(this.aSuggestions[0]){jQuery(this.aSuggestions[0]).remove()};this.aSuggestions[0]=null;if(this.opt.frameForIE){jQuery(this.iframe[0]).remove()};this.highlighted=null};parentObject.AutoSuggest.prototype.updateIframe=function(objCoords){return this.iframe.css({left:objCoords.x,top:objCoords.y,width:(this.aSuggestions[0].clientWidth),height:(this.aSuggestions[0].clientHeight)})};parentObject.AutoSuggest.prototype.highlightText=function(sourceTxt,highlightTxt){sourceTxt=sourceTxt.replace(/<b>(.+)<\/b>/i,'$1');var strippedTxt=sourceTxt.replace(/<i>.+<\/i>/i,'');strippedTxt=strippedTxt.replace(/<\/?[^>]+>/gi,'');var rExp=new RegExp("("+highlightTxt+")",'i');highlighedTxt=strippedTxt.replace(rExp,"<b>$1</b>");return sourceTxt.replace(strippedTxt,highlighedTxt)};parentObject.AS=parentObject.AutoSuggest; 1 window.undefined=window.undefined;function loading(){}var parentObject=this;function cloneObject(a){var c={};for(i in a)c[i]="object"==typeof a[i]?cloneObject(a[i]):a[i];return c}parentObject.getPos=function(a){a=jQuery(a).offset();return{x:a.left,y:a.top}}; 2 var defaultParams={script:"ajax/suggestions/airports.php",minchars:3,className:"as",delay:500,timeout:2500,cache:!0,loadingClass:"aLoad",offsety:2,showNoResults:!1,maxheight:250,noResults:"No results!",meth:"POST",json:!1,frameForIE:!0,autoSelect:!0,ajaxParams:{action:"test",json:this.json},setAjaxParams:function(a){var c=0,b="";for(key in this.ajaxParams)b=0==c?b+(key+"="+a.fld.value):b+("&"+key+"="+this.ajaxParams[key]),c++;a.ajaxObject.data=b;return!0},setAjaxParams:function(a){var c=0,b="";for(key in this.ajaxParams)b= 3 0==c?b+(key+"="+a.fld.value):b+("&"+key+"="+this.ajaxParams[key]),c++;a.ajaxObject.data=b;return!0},format:function(a){return a.innerHTML.replace(/<\/?[a-z]+>/gi,"")},errorHandler:function(a){}};void 0==parentObject.AutoSuggest&&(parentObject.AutoSuggest={}); 4 parentObject.AutoSuggest=function(a,c){if(!(this.fld=jQuery("#"+a)[0]))return!1;this.fld.setAttribute("autocomplete","off");this.sInput="";this.nInputChars=0;this.aSuggestions={};this.defText=this.fld.value;this.highlighted=null;this.opt=c?cloneObject(c):{};for(k in defaultParams)typeof this.opt[k]!=typeof defaultParams[k]&&(this.opt[k]=defaultParams[k]);var b=this;this.ajaxObject={url:this.opt.script,global:!1,type:this.opt.meth,dataType:"text",data:this.opt.ajaxParams,error:function(a,b,c){},success:function(a){b.generateList(a)}, 5 errorFlag:0,complete:function(a,b){}};this.coords=getPos(this.fld);this.coords.y+=this.fld.offsetHeight+this.opt.offsety;this.opt.frameForIE&&jQuery.browser.msie&&7>parseInt(jQuery.browser.version)?this.iframe=jQuery('<iframe src="about:blank" frameborder="0" marginheight="0" marginwidth="0" scrolling="no" style="position:absolute;background:#fff;z-index:399;">'):this.opt.frameForIE=!1;this.blurTimer=0;b=this;this.isFocused=!0;this.fld.onkeypress=function(a){return b.onKeyPress(a)};this.fld.onkeyup= 6 function(a){return b.onKeyUp(a)};this.fld.onblur=function(a){b.isFocused=!1;b.fld.value&&(b.blurTimer=setTimeout(function(){b.ajaxObject.errorFlag&&b.opt.errorHandler(this);b.opt.autoSelect?b.setHighlightedValue():b.clearSuggestions(a);b.highlighted=null},b.opt.delay/2))};this.fld.onfocus=function(a){b.highlighted=null;b.isFocused=!0};this.req={};this.fld.autoSuggest=this}; 7 parentObject.AutoSuggest.prototype.onKeyUp=function(a){a=window.event?window.event.keyCode:a.keyCode;var c=!0;switch(a){case 38:this.changeHighlight(a);c=!1;break;case 40:this.changeHighlight(a);c=!1;break;case 13:break;default:this.getSuggestions()}return c};parentObject.AutoSuggest.prototype.onKeyPress=function(a){a=window.event?window.event.keyCode:a.keyCode;var c=!0;this.isFocused=!0;switch(a){case 13:this.setHighlightedValue();c=!1;break;case 27:this.setHighlightedValue()}return c}; 8 parentObject.AutoSuggest.prototype.getSuggestions=function(){var a=this.fld.value.toLowerCase();if(a==this.sInput)return!1;if(a.length<this.opt.minchars)return this.clearSuggestions(),this.sInput="",!1;this.makeReq=!0;if(a.length>this.nInputChars&&this.aSuggestions.length&&this.opt.cache&&this.aSuggestions[0]&&this.aSuggestions[0].childNodes){a=a.replace(/[^a-zA-Z????]/g," ");with(this.aSuggestions[0])for(var c=0;c<childNodes.length;c++)1==childNodes[c].nodeType&&(childNodes[c].innerHTML.replace(/<\/?[^>]+>/gi, 9 "").toLowerCase().match(a)?childNodes[c].innerHTML=this.highlightText(childNodes[c].innerHTML,a):removeChild(childNodes[c--]));if(!this.aSuggestions[0].childNodes.length)return this.clearSuggestions(),this.doAjaxRequest(this.ajaxObject),!1;this.makeReq=!1;this.opt.frameForIE&&this.updateIframe(this.coords);this.sInput=a;this.nInputChars=a.length;this.aSuggestions[0].parentNode||(document.body.appendChild(this.aSuggestions[0]),this.opt.frameForIE&&document.body.appendChild(this.iframe[0]));this.highlighted&& 10 this.clearHighlight()}else{this.sInput=a;this.nInputChars=a.length;var b=this;clearTimeout(this.ajID);this.ajID=setTimeout(function(){b.doAjaxRequest(b.ajaxObject)},this.opt.delay)}return!1};parentObject.AutoSuggest.prototype.doAjaxRequest=function(){this.fld.value.length<this.opt.minchars||(jQuery(this.fld).addClass(this.opt.loadingClass),this.opt.setAjaxParams(this),this.req=jQuery.ajax(this.ajaxObject),this.ajaxObject.errorFlag=0)}; 11 parentObject.AutoSuggest.prototype.generateList=function(a){this.coords=getPos(this.fld);this.coords.y+=this.fld.offsetHeight+this.opt.offsety;this.makeReq=!1;this.aSuggestions[0]&&this.aSuggestions[0].parentNode&&this.aSuggestions.remove();var c;if(this.opt.json){try{c=eval("("+a+")")}catch(b){return b}a="<ul>";n=c.argumentList?c.argumentList.length:0;for(i=0;i<c.results.length;i++){a+="<li";for(j=0;j<n;j++){var d=c.argumentList[j];a+=" "+d+'="'+this.escapeHtml(c.results[i][d])+'"'}a+=">"+c.results[i].txt+ 12 "</li>"}a+="</ul>"}else a=a.substr(40);jQuery(this.fld).removeClass(this.opt.loadingClass);this.isFocused?this.createList(a,c):this.opt.autoSelect&&this.autoSelect(a,c)};parentObject.AutoSuggest.prototype.escapeHtml=function(a){return a.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}; 13 parentObject.AutoSuggest.prototype.autoSelect=function(a,c){if(!c.results||!c.results.length)return this.opt.errorHandler(this),this.ajaxObject.errorFlag=1,clearTimeout(this.blurTimer),!1;firstElement="<li";n=c.argumentList?c.argumentList.length:0;for(j=0;j<n;j++){var b=c.argumentList[j];firstElement+=" "+b+'="'+c.results[0][b]+'"'}firstElement+=">"+c.results[0].txt+"</li>";this.highlighted=jQuery(firstElement).get(0);this.setHighlightedValue();return!0}; 14 parentObject.AutoSuggest.prototype.createList=function(a,c){if(!c.results||!c.results.length)return this.ajaxObject.errorFlag=1,!1;var b=this;b.aSuggestions=jQuery(a).attr({"class":b.opt.className,id:"as"+b.fld.id}).css({left:b.coords.x,top:b.coords.y}).appendTo("body").css({display:"block"});b.aSuggestions.hide();b.aSuggestions.show();internal_cnt=0;b.aSuggestions.find("li").each(function(){internal_cnt++;jQuery(this).addClass(0==internal_cnt%2?"even":"odd")});this.opt.frameForIE&&this.updateIframe(this.coords).appendTo("body"); 15 b.aSuggestions.children("li").each(function(a){this.innerHTML=b.highlightText(this.innerHTML,b.fld.value);jQuery(this).mousedown(function(){b.setHighlightedValue();b.fld.focus()});jQuery(this).mouseover(function(){b.setHighlight(this)})});this.isFocused?(b.highlighted=null,0==b.aSuggestions[0].childNodes.length&&(b.opt.showNoResults?b.aSuggestions.append("<li>"+b.opt.noResults+"</li>"):b.clearSuggestions())):this.setHighlightedValue()}; 16 parentObject.AutoSuggest.prototype.changeHighlight=function(a){return this.aSuggestions[0]?null==this.highlighted?this.setHighlight(this.highlighted=this.aSuggestions[0].firstChild):38==a?this.highlighted==this.aSuggestions[0].firstChild?this.setHighlight(this.aSuggestions[0].lastChild):1==this.highlighted.previousSibling.nodeType?this.setHighlight(this.highlighted.previousSibling):this.setHighlight(this.highlighted.previousSibling.previousSibling):this.highlighted==this.aSuggestions[0].lastChild? 17 this.setHighlight(this.aSuggestions[0].firstChild):1==this.highlighted.nextSibling.nodeType?this.setHighlight(this.highlighted.nextSibling):this.setHighlight(this.highlighted.nextSibling.nextSibling):!1};parentObject.AutoSuggest.prototype.setHighlight=function(a){null!=this.highlighted&&this.clearHighlight();this.highlighted=a;jQuery(this.highlighted).addClass("as_hl");return!0}; 18 parentObject.AutoSuggest.prototype.clearHighlight=function(){jQuery(this.highlighted).removeClass("as_hl");this.highlighted=null}; 19 parentObject.AutoSuggest.prototype.setHighlightedValue=function(){if(!this.ajaxObject.errorFlag&&(clearTimeout(this.blurTimer),this.fld.value)){if(!this.highlighted){try{var a=this.aSuggestions&&this.aSuggestions.children&&this.aSuggestions.children("li:eq(0)").get(0)}catch(c){}if(!a)return this.clearSuggestions(),!1;this.setHighlight(a)}this.highlighted&&!this.makeReq&&(this.sInput=this.fld.value=this.opt.format(this.highlighted));"function"==typeof this.opt.callback&&this.opt.callback(this.highlighted, 20 this);this.clearSuggestions();return!0}};parentObject.AutoSuggest.prototype.clearSuggestions=function(){this.aSuggestions[0]&&jQuery(this.aSuggestions[0]).remove();this.aSuggestions[0]=null;this.opt.frameForIE&&jQuery(this.iframe[0]).remove();this.highlighted=null};parentObject.AutoSuggest.prototype.updateIframe=function(a){return this.iframe.css({left:a.x,top:a.y,width:this.aSuggestions[0].clientWidth,height:this.aSuggestions[0].clientHeight})}; 21 parentObject.AutoSuggest.prototype.highlightText=function(a,c){a=a.replace(/<b>(.+)<\/b>/i,"$1");var b=a.replace(/<i>.+<\/i>/i,""),b=b.replace(/<\/?[^>]+>/gi,"");highlighedTxt=b.replace(new RegExp("("+c+")","i"),"<b>$1</b>");return a.replace(b,highlighedTxt)};parentObject.AS=parentObject.AutoSuggest; -
travel-search/trunk/js/jquery-ui-datepicker.dev.js
r1087099 r1087931 15 15 => needed to make sure no conflicts will show up w/ older datepicker versions 16 16 - minimum z-index for datepicker div was changed to 12, since our tabs in the plugin have a z-index of 11 and the datepicker div would show up under them w/ lower z-index 17 */(function($,undefined){function isArray(a){return a&&($.browser.safari&&typeof a=="object"&&a.length||a.constructor&&a.constructor.toString().match(/\Array\(\)/))}function extendRemove(a,b){$.extend(a,b);for(var c in b)if(b[c]==null||b[c]==undefined)a[c]=b[c];return a}function bindHover(a){var b="button, .ui-datepicker-prev, .ui-datepicker-next, .ui-datepicker-calendar td a";return a.bind("mouseout",function(a){var c=$(a.target).closest(b);!c.length||c.removeClass("ui-state-hover ui-datepicker-prev-hover ui-datepicker-next-hover")}).bind("mouseover",function(c){var d=$(c.target).closest(b);!$.datepicker._isDisabledDatepicker(instActive.inline?a.parent()[0]:instActive.input[0])&&!!d.length&&(d.parents(".ui-datepicker-calendar").find("a").removeClass("ui-state-hover"),d.addClass("ui-state-hover"),d.hasClass("ui-datepicker-prev")&&d.addClass("ui-datepicker-prev-hover"),d.hasClass("ui-datepicker-next")&&d.addClass("ui-datepicker-next-hover"))})}function Datepicker(){this.debug=!1,this._curInst=null,this._keyEvent=!1,this._disabledInputs=[],this._datepickerShowing=!1,this._inDialog=!1,this._mainDivId="tgsb-ui-datepicker-div",this._inlineClass="ui-datepicker-inline",this._appendClass="ui-datepicker-append",this._triggerClass="ui-datepicker-trigger",this._dialogClass="ui-datepicker-dialog",this._disableClass="ui-datepicker-disabled",this._unselectableClass="ui-datepicker-unselectable",this._currentClass="ui-datepicker-current-day",this._dayOverClass="ui-datepicker-days-cell-over",this.regional=[],this.regional[""]={closeText:"Done",prevText:"Prev",nextText:"Next",currentText:"Today",monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthNamesShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],weekHeader:"Wk",dateFormat:"mm/dd/yy",firstDay:0,isRTL:!1,showMonthAfterYear:!1,yearSuffix:""},this._defaults={showOn:"focus",showAnim:"fadeIn",showOptions:{},defaultDate:null,appendText:"",buttonText:"...",buttonImage:"",buttonImageOnly:!1,hideIfNoPrevNext:!1,navigationAsDateFormat:!1,gotoCurrent:!1,changeMonth:!1,changeYear:!1,yearRange:"c-10:c+10",showOtherMonths:!1,selectOtherMonths:!1,showWeek:!1,calculateWeek:this.iso8601Week,shortYearCutoff:"+10",minDate:null,maxDate:null,duration:"fast",beforeShowDay:null,beforeShow:null,onSelect:null,onChangeMonthYear:null,onClose:null,numberOfMonths:1,showCurrentAtPos:0,stepMonths:1,stepBigMonths:12,altField:"",altFormat:"",constrainInput:!0,showButtonPanel:!1,autoSize:!1,disabled:!1},$.extend(this._defaults,this.regional[""]),this.dpDiv=bindHover($('<div id="'+this._mainDivId+'" class="ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all"></div>'))}$.extend($.ui,{datepicker:{version:"1.8.17"}});var PROP_NAME="datepicker",dpuuid=(new Date).getTime(),instActive;$.extend(Datepicker.prototype,{markerClassName:"hasDatepicker",maxRows:4,log:function(){this.debug&&console.log.apply("",arguments)},_widgetDatepicker:function(){return this.dpDiv},setDefaults:function(a){extendRemove(this._defaults,a||{});return this},_attachDatepicker:function(target,settings){var inlineSettings=null;for(var attrName in this._defaults){var attrValue=target.getAttribute("date:"+attrName);if(attrValue){inlineSettings=inlineSettings||{};try{inlineSettings[attrName]=eval(attrValue)}catch(err){inlineSettings[attrName]=attrValue}}}var nodeName=target.nodeName.toLowerCase(),inline=nodeName=="div"||nodeName=="span";target.id||(this.uuid+=1,target.id="dp"+this.uuid);var inst=this._newInst($(target),inline);inst.settings=$.extend({},settings||{},inlineSettings||{}),nodeName=="input"?this._connectDatepicker(target,inst):inline&&this._inlineDatepicker(target,inst)},_newInst:function(a,b){var c=a[0].id.replace(/([^A-Za-z0-9_-])/g,"\\\\$1");return{id:c,input:a,selectedDay:0,selectedMonth:0,selectedYear:0,drawMonth:0,drawYear:0,inline:b,dpDiv:b?bindHover($('<div class="'+this._inlineClass+' ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all"></div>')):this.dpDiv}},_connectDatepicker:function(a,b){var c=$(a);b.append=$([]),b.trigger=$([]);c.hasClass(this.markerClassName)||(this._attachments(c,b),c.addClass(this.markerClassName).keydown(this._doKeyDown).keypress(this._doKeyPress).keyup(this._doKeyUp).bind("setData.datepicker",function(a,c,d){b.settings[c]=d}).bind("getData.datepicker",function(a,c){return this._get(b,c)}),this._autoSize(b),$.data(a,PROP_NAME,b),b.settings.disabled&&this._disableDatepicker(a))},_attachments:function(a,b){var c=this._get(b,"appendText"),d=this._get(b,"isRTL");b.append&&b.append.remove(),c&&(b.append=$('<span class="'+this._appendClass+'">'+c+"</span>"),a[d?"before":"after"](b.append)),a.unbind("focus",this._showDatepicker),b.trigger&&b.trigger.remove();var e=this._get(b,"showOn");(e=="focus"||e=="both")&&a.focus(this._showDatepicker);if(e=="button"||e=="both"){var f=this._get(b,"buttonText"),g=this._get(b,"buttonImage");b.trigger=$(this._get(b,"buttonImageOnly")?$("<img/>").addClass(this._triggerClass).attr({src:g,alt:f,title:f}):$('<button type="button"></button>').addClass(this._triggerClass).html(g==""?f:$("<img/>").attr({src:g,alt:f,title:f}))),a[d?"before":"after"](b.trigger),b.trigger.click(function(){$.datepicker._datepickerShowing&&$.datepicker._lastInput==a[0]?$.datepicker._hideDatepicker():$.datepicker._showDatepicker(a[0]);return!1})}},_autoSize:function(a){if(this._get(a,"autoSize")&&!a.inline){var b=new Date(2009,11,20),c=this._get(a,"dateFormat");if(c.match(/[DM]/)){var d=function(a){var b=0,c=0;for(var d=0;d<a.length;d++)a[d].length>b&&(b=a[d].length,c=d);return c};b.setMonth(d(this._get(a,c.match(/MM/)?"monthNames":"monthNamesShort"))),b.setDate(d(this._get(a,c.match(/DD/)?"dayNames":"dayNamesShort"))+20-b.getDay())}a.input.attr("size",this._formatDate(a,b).length)}},_inlineDatepicker:function(a,b){var c=$(a);c.hasClass(this.markerClassName)||(c.addClass(this.markerClassName).append(b.dpDiv).bind("setData.datepicker",function(a,c,d){b.settings[c]=d}).bind("getData.datepicker",function(a,c){return this._get(b,c)}),$.data(a,PROP_NAME,b),this._setDate(b,this._getDefaultDate(b),!0),this._updateDatepicker(b),this._updateAlternate(b),b.settings.disabled&&this._disableDatepicker(a),b.dpDiv.css("display","block"))},_dialogDatepicker:function(a,b,c,d,e){var f=this._dialogInst;if(!f){this.uuid+=1;var g="dp"+this.uuid;this._dialogInput=$('<input type="text" id="'+g+'" style="position: absolute; top: -100px; width: 0px; z-index: -10;"/>'),this._dialogInput.keydown(this._doKeyDown),$("body").append(this._dialogInput),f=this._dialogInst=this._newInst(this._dialogInput,!1),f.settings={},$.data(this._dialogInput[0],PROP_NAME,f)}extendRemove(f.settings,d||{}),b=b&&b.constructor==Date?this._formatDate(f,b):b,this._dialogInput.val(b),this._pos=e?e.length?e:[e.pageX,e.pageY]:null;if(!this._pos){var h=document.documentElement.clientWidth,i=document.documentElement.clientHeight,j=document.documentElement.scrollLeft||document.body.scrollLeft,k=document.documentElement.scrollTop||document.body.scrollTop;this._pos=[h/2-100+j,i/2-150+k]}this._dialogInput.css("left",this._pos[0]+20+"px").css("top",this._pos[1]+"px"),f.settings.onSelect=c,this._inDialog=!0,this.dpDiv.addClass(this._dialogClass),this._showDatepicker(this._dialogInput[0]),$.blockUI&&$.blockUI(this.dpDiv),$.data(this._dialogInput[0],PROP_NAME,f);return this},_destroyDatepicker:function(a){var b=$(a),c=$.data(a,PROP_NAME);if(!!b.hasClass(this.markerClassName)){var d=a.nodeName.toLowerCase();$.removeData(a,PROP_NAME),d=="input"?(c.append.remove(),c.trigger.remove(),b.removeClass(this.markerClassName).unbind("focus",this._showDatepicker).unbind("keydown",this._doKeyDown).unbind("keypress",this._doKeyPress).unbind("keyup",this._doKeyUp)):(d=="div"||d=="span")&&b.removeClass(this.markerClassName).empty()}},_enableDatepicker:function(a){var b=$(a),c=$.data(a,PROP_NAME);if(!!b.hasClass(this.markerClassName)){var d=a.nodeName.toLowerCase();if(d=="input")a.disabled=!1,c.trigger.filter("button").each(function(){this.disabled=!1}).end().filter("img").css({opacity:"1.0",cursor:""});else if(d=="div"||d=="span"){var e=b.children("."+this._inlineClass);e.children().removeClass("ui-state-disabled"),e.find("select.ui-datepicker-month, select.ui-datepicker-year").removeAttr("disabled")}this._disabledInputs=$.map(this._disabledInputs,function(b){return b==a?null:b})}},_disableDatepicker:function(a){var b=$(a),c=$.data(a,PROP_NAME);if(!!b.hasClass(this.markerClassName)){var d=a.nodeName.toLowerCase();if(d=="input")a.disabled=!0,c.trigger.filter("button").each(function(){this.disabled=!0}).end().filter("img").css({opacity:"0.5",cursor:"default"});else if(d=="div"||d=="span"){var e=b.children("."+this._inlineClass);e.children().addClass("ui-state-disabled"),e.find("select.ui-datepicker-month, select.ui-datepicker-year").attr("disabled","disabled")}this._disabledInputs=$.map(this._disabledInputs,function(b){return b==a?null:b}),this._disabledInputs[this._disabledInputs.length]=a}},_isDisabledDatepicker:function(a){if(!a)return!1;for(var b=0;b<this._disabledInputs.length;b++)if(this._disabledInputs[b]==a)return!0;return!1},_getInst:function(a){try{return $.data(a,PROP_NAME)}catch(b){throw"Missing instance data for this datepicker"}},_optionDatepicker:function(a,b,c){var d=this._getInst(a);if(arguments.length==2&&typeof b=="string")return b=="defaults"?$.extend({},$.datepicker._defaults):d?b=="all"?$.extend({},d.settings):this._get(d,b):null;var e=b||{};typeof b=="string"&&(e={},e[b]=c);if(d){this._curInst==d&&this._hideDatepicker();var f=this._getDateDatepicker(a,!0),g=this._getMinMaxDate(d,"min"),h=this._getMinMaxDate(d,"max");extendRemove(d.settings,e),g!==null&&e.dateFormat!==undefined&&e.minDate===undefined&&(d.settings.minDate=this._formatDate(d,g)),h!==null&&e.dateFormat!==undefined&&e.maxDate===undefined&&(d.settings.maxDate=this._formatDate(d,h)),this._attachments($(a),d),this._autoSize(d),this._setDate(d,f),this._updateAlternate(d),this._updateDatepicker(d)}},_changeDatepicker:function(a,b,c){this._optionDatepicker(a,b,c)},_refreshDatepicker:function(a){var b=this._getInst(a);b&&this._updateDatepicker(b)},_setDateDatepicker:function(a,b){var c=this._getInst(a);c&&(this._setDate(c,b),this._updateDatepicker(c),this._updateAlternate(c))},_getDateDatepicker:function(a,b){var c=this._getInst(a);c&&!c.inline&&this._setDateFromField(c,b);return c?this._getDate(c):null},_doKeyDown:function(a){var b=$.datepicker._getInst(a.target),c=!0,d=b.dpDiv.is(".ui-datepicker-rtl");b._keyEvent=!0;if($.datepicker._datepickerShowing)switch(a.keyCode){case 9:$.datepicker._hideDatepicker(),c=!1;break;case 13:var e=$("td."+$.datepicker._dayOverClass+":not(."+$.datepicker._currentClass+")",b.dpDiv);e[0]&&$.datepicker._selectDay(a.target,b.selectedMonth,b.selectedYear,e[0]);var f=$.datepicker._get(b,"onSelect");if(f){var g=$.datepicker._formatDate(b);f.apply(b.input?b.input[0]:null,[g,b])}else $.datepicker._hideDatepicker();return!1;case 27:$.datepicker._hideDatepicker();break;case 33:$.datepicker._adjustDate(a.target,a.ctrlKey?-$.datepicker._get(b,"stepBigMonths"):-$.datepicker._get(b,"stepMonths"),"M");break;case 34:$.datepicker._adjustDate(a.target,a.ctrlKey?+$.datepicker._get(b,"stepBigMonths"):+$.datepicker._get(b,"stepMonths"),"M");break;case 35:(a.ctrlKey||a.metaKey)&&$.datepicker._clearDate(a.target),c=a.ctrlKey||a.metaKey;break;case 36:(a.ctrlKey||a.metaKey)&&$.datepicker._gotoToday(a.target),c=a.ctrlKey||a.metaKey;break;case 37:(a.ctrlKey||a.metaKey)&&$.datepicker._adjustDate(a.target,d?1:-1,"D"),c=a.ctrlKey||a.metaKey,a.originalEvent.altKey&&$.datepicker._adjustDate(a.target,a.ctrlKey?-$.datepicker._get(b,"stepBigMonths"):-$.datepicker._get(b,"stepMonths"),"M");break;case 38:(a.ctrlKey||a.metaKey)&&$.datepicker._adjustDate(a.target,-7,"D"),c=a.ctrlKey||a.metaKey;break;case 39:(a.ctrlKey||a.metaKey)&&$.datepicker._adjustDate(a.target,d?-1:1,"D"),c=a.ctrlKey||a.metaKey,a.originalEvent.altKey&&$.datepicker._adjustDate(a.target,a.ctrlKey?+$.datepicker._get(b,"stepBigMonths"):+$.datepicker._get(b,"stepMonths"),"M");break;case 40:(a.ctrlKey||a.metaKey)&&$.datepicker._adjustDate(a.target,7,"D"),c=a.ctrlKey||a.metaKey;break;default:c=!1}else a.keyCode==36&&a.ctrlKey?$.datepicker._showDatepicker(this):c=!1;c&&(a.preventDefault(),a.stopPropagation())},_doKeyPress:function(a){var b=$.datepicker._getInst(a.target);if($.datepicker._get(b,"constrainInput")){var c=$.datepicker._possibleChars($.datepicker._get(b,"dateFormat")),d=String.fromCharCode(a.charCode==undefined?a.keyCode:a.charCode);return a.ctrlKey||a.metaKey||d<" "||!c||c.indexOf(d)>-1}},_doKeyUp:function(a){var b=$.datepicker._getInst(a.target);if(b.input.val()!=b.lastVal)try{var c=$.datepicker.parseDate($.datepicker._get(b,"dateFormat"),b.input?b.input.val():null,$.datepicker._getFormatConfig(b));c&&($.datepicker._setDateFromField(b),$.datepicker._updateAlternate(b),$.datepicker._updateDatepicker(b))}catch(a){$.datepicker.log(a)}return!0},_showDatepicker:function(a){a=a.target||a,a.nodeName.toLowerCase()!="input"&&(a=$("input",a.parentNode)[0]);if(!$.datepicker._isDisabledDatepicker(a)&&$.datepicker._lastInput!=a){var b=$.datepicker._getInst(a);$.datepicker._curInst&&$.datepicker._curInst!=b&&($.datepicker._curInst.dpDiv.stop(!0,!0),b&&$.datepicker._datepickerShowing&&$.datepicker._hideDatepicker($.datepicker._curInst.input[0]));var c=$.datepicker._get(b,"beforeShow"),d=c?c.apply(a,[a,b]):{};if(d===!1)return;extendRemove(b.settings,d),b.lastVal=null,$.datepicker._lastInput=a,$.datepicker._setDateFromField(b),$.datepicker._inDialog&&(a.value=""),$.datepicker._pos||($.datepicker._pos=$.datepicker._findPos(a),$.datepicker._pos[1]+=a.offsetHeight);var e=!1;$(a).parents().each(function(){e|=$(this).css("position")=="fixed";return!e}),e&&$.browser.opera&&($.datepicker._pos[0]-=document.documentElement.scrollLeft,$.datepicker._pos[1]-=document.documentElement.scrollTop);var f={left:$.datepicker._pos[0],top:$.datepicker._pos[1]};$.datepicker._pos=null,b.dpDiv.empty(),b.dpDiv.css({position:"absolute",display:"block",top:"-1000px"}),$.datepicker._updateDatepicker(b),f=$.datepicker._checkOffset(b,f,e),b.dpDiv.css({position:$.datepicker._inDialog&&$.blockUI?"static":e?"fixed":"absolute",display:"none",left:f.left+"px",top:f.top+"px"});if(!b.inline){var g=$.datepicker._get(b,"showAnim"),h=$.datepicker._get(b,"duration"),i=function(){var a=b.dpDiv.find("iframe.ui-datepicker-cover");if(!!a.length){var c=$.datepicker._getBorders(b.dpDiv);a.css({left:-c[0],top:-c[1],width:b.dpDiv.outerWidth(),height:b.dpDiv.outerHeight()})}};b.dpDiv.zIndex(Math.max($(a).zIndex()+1,12)),$.datepicker._datepickerShowing=!0,$.effects&&$.effects[g]?b.dpDiv.show(g,$.datepicker._get(b,"showOptions"),h,i):b.dpDiv[g||"show"](g?h:null,i),(!g||!h)&&i(),b.input.is(":visible")&&!b.input.is(":disabled")&&b.input.focus(),$.datepicker._curInst=b}}},_updateDatepicker:function(a){var b=this;b.maxRows=4;var c=$.datepicker._getBorders(a.dpDiv);instActive=a,a.dpDiv.empty().append(this._generateHTML(a));var d=a.dpDiv.find("iframe.ui-datepicker-cover");!d.length||d.css({left:-c[0],top:-c[1],width:a.dpDiv.outerWidth(),height:a.dpDiv.outerHeight()}),a.dpDiv.find("."+this._dayOverClass+" a").mouseover();var e=this._getNumberOfMonths(a),f=e[1],g=17;a.dpDiv.removeClass("ui-datepicker-multi-2 ui-datepicker-multi-3 ui-datepicker-multi-4").width(""),f>1&&a.dpDiv.addClass("ui-datepicker-multi-"+f).css("width",g*f+"em"),a.dpDiv[(e[0]!=1||e[1]!=1?"add":"remove")+"Class"]("ui-datepicker-multi"),a.dpDiv[(this._get(a,"isRTL")?"add":"remove")+"Class"]("ui-datepicker-rtl"),a==$.datepicker._curInst&&$.datepicker._datepickerShowing&&a.input&&a.input.is(":visible")&&!a.input.is(":disabled")&&a.input[0]!=document.activeElement&&a.input.focus();if(a.yearshtml){var h=a.yearshtml;setTimeout(function(){h===a.yearshtml&&a.yearshtml&&a.dpDiv.find("select.ui-datepicker-year:first").replaceWith(a.yearshtml),h=a.yearshtml=null},0)}},_getBorders:function(a){var b=function(a){return{thin:1,medium:2,thick:3}[a]||a};return[parseFloat(b(a.css("border-left-width"))),parseFloat(b(a.css("border-top-width")))]},_checkOffset:function(a,b,c){var d=a.dpDiv.outerWidth(),e=a.dpDiv.outerHeight(),f=a.input?a.input.outerWidth():0,g=a.input?a.input.outerHeight():0,h=document.documentElement.clientWidth+$(document).scrollLeft(),i=document.documentElement.clientHeight+$(document).scrollTop();b.left-=this._get(a,"isRTL")?d-f:0,b.left-=c&&b.left==a.input.offset().left?$(document).scrollLeft():0,b.top-=c&&b.top==a.input.offset().top+g?$(document).scrollTop():0,b.left-=Math.min(b.left,b.left+d>h&&h>d?Math.abs(b.left+d-h):0),b.top-=Math.min(b.top,b.top+e>i&&i>e?Math.abs(e+g):0);return b},_findPos:function(a){var b=this._getInst(a),c=this._get(b,"isRTL");while(a&&(a.type=="hidden"||a.nodeType!=1||$.expr.filters.hidden(a)))a=a[c?"previousSibling":"nextSibling"];var d=$(a).offset();return[d.left,d.top]},_hideDatepicker:function(a){var b=this._curInst;if(!(!b||a&&b!=$.data(a,PROP_NAME))&&this._datepickerShowing){var c=this._get(b,"showAnim"),d=this._get(b,"duration"),e=this,f=function(){$.datepicker._tidyDialog(b),e._curInst=null};$.effects&&$.effects[c]?b.dpDiv.hide(c,$.datepicker._get(b,"showOptions"),d,f):b.dpDiv[c=="slideDown"?"slideUp":c=="fadeIn"?"fadeOut":"hide"](c?d:null,f),c||f(),this._datepickerShowing=!1;var g=this._get(b,"onClose");g&&g.apply(b.input?b.input[0]:null,[b.input?b.input.val():"",b]),this._lastInput=null,this._inDialog&&(this._dialogInput.css({position:"absolute",left:"0",top:"-100px"}),$.blockUI&&($.unblockUI(),$("body").append(this.dpDiv))),this._inDialog=!1}},_tidyDialog:function(a){a.dpDiv.removeClass(this._dialogClass).unbind(".ui-datepicker-calendar")},_checkExternalClick:function(a){if(!!$.datepicker._curInst){var b=$(a.target),c=$.datepicker._getInst(b[0]);(b[0].id!=$.datepicker._mainDivId&&b.parents("#"+$.datepicker._mainDivId).length==0&&!b.hasClass($.datepicker.markerClassName)&&!b.hasClass($.datepicker._triggerClass)&&$.datepicker._datepickerShowing&&(!$.datepicker._inDialog||!$.blockUI)||b.hasClass($.datepicker.markerClassName)&&$.datepicker._curInst!=c)&&$.datepicker._hideDatepicker()}},_adjustDate:function(a,b,c){var d=$(a),e=this._getInst(d[0]);this._isDisabledDatepicker(d[0])||(this._adjustInstDate(e,b+(c=="M"?this._get(e,"showCurrentAtPos"):0),c),this._updateDatepicker(e))},_gotoToday:function(a){var b=$(a),c=this._getInst(b[0]);if(this._get(c,"gotoCurrent")&&c.currentDay)c.selectedDay=c.currentDay,c.drawMonth=c.selectedMonth=c.currentMonth,c.drawYear=c.selectedYear=c.currentYear;else{var d=new Date;c.selectedDay=d.getDate(),c.drawMonth=c.selectedMonth=d.getMonth(),c.drawYear=c.selectedYear=d.getFullYear()}this._notifyChange(c),this._adjustDate(b)},_selectMonthYear:function(a,b,c){var d=$(a),e=this._getInst(d[0]);e["selected"+(c=="M"?"Month":"Year")]=e["draw"+(c=="M"?"Month":"Year")]=parseInt(b.options[b.selectedIndex].value,10),this._notifyChange(e),this._adjustDate(d)},_selectDay:function(a,b,c,d){var e=$(a);if(!$(d).hasClass(this._unselectableClass)&&!this._isDisabledDatepicker(e[0])){var f=this._getInst(e[0]);f.selectedDay=f.currentDay=$("a",d).html(),f.selectedMonth=f.currentMonth=b,f.selectedYear=f.currentYear=c,this._selectDate(a,this._formatDate(f,f.currentDay,f.currentMonth,f.currentYear))}},_clearDate:function(a){var b=$(a),c=this._getInst(b[0]);this._selectDate(b,"")},_selectDate:function(a,b){var c=$(a),d=this._getInst(c[0]);b=b!=null?b:this._formatDate(d),d.input&&d.input.val(b),this._updateAlternate(d);var e=this._get(d,"onSelect");e?e.apply(d.input?d.input[0]:null,[b,d]):d.input&&d.input.trigger("change"),d.inline?this._updateDatepicker(d):(this._hideDatepicker(),this._lastInput=d.input[0],typeof d.input[0]!="object"&&d.input.focus(),this._lastInput=null)},_updateAlternate:function(a){var b=this._get(a,"altField");if(b){var c=this._get(a,"altFormat")||this._get(a,"dateFormat"),d=this._getDate(a),e=this.formatDate(c,d,this._getFormatConfig(a));$(b).each(function(){$(this).val(e)})}},noWeekends:function(a){var b=a.getDay();return[b>0&&b<6,""]},iso8601Week:function(a){var b=new Date(a.getTime());b.setDate(b.getDate()+4-(b.getDay()||7));var c=b.getTime();b.setMonth(0),b.setDate(1);return Math.floor(Math.round((c-b)/864e5)/7)+1},parseDate:function(a,b,c){if(a==null||b==null)throw"Invalid arguments";b=typeof b=="object"?b.toString():b+"";if(b=="")return null;var d=(c?c.shortYearCutoff:null)||this._defaults.shortYearCutoff;d=typeof d!="string"?d:(new Date).getFullYear()%100+parseInt(d,10);var e=(c?c.dayNamesShort:null)||this._defaults.dayNamesShort,f=(c?c.dayNames:null)||this._defaults.dayNames,g=(c?c.monthNamesShort:null)||this._defaults.monthNamesShort,h=(c?c.monthNames:null)||this._defaults.monthNames,i=-1,j=-1,k=-1,l=-1,m=!1,n=function(b){var c=s+1<a.length&&a.charAt(s+1)==b;c&&s++;return c},o=function(a){var c=n(a),d=a=="@"?14:a=="!"?20:a=="y"&&c?4:a=="o"?3:2,e=new RegExp("^\\d{1,"+d+"}"),f=b.substring(r).match(e);if(!f)throw"Missing number at position "+r;r+=f[0].length;return parseInt(f[0],10)},p=function(a,c,d){var e=$.map(n(a)?d:c,function(a,b){return[[b,a]]}).sort(function(a,b){return-(a[1].length-b[1].length)}),f=-1;$.each(e,function(a,c){var d=c[1];if(b.substr(r,d.length).toLowerCase()==d.toLowerCase()){f=c[0],r+=d.length;return!1}});if(f!=-1)return f+1;throw"Unknown name at position "+r},q=function(){if(b.charAt(r)!=a.charAt(s))throw"Unexpected literal at position "+r;r++},r=0;for(var s=0;s<a.length;s++)if(m)a.charAt(s)=="'"&&!n("'")?m=!1:q();else switch(a.charAt(s)){case"d":k=o("d");break;case"D":p("D",e,f);break;case"o":l=o("o");break;case"m":j=o("m");break;case"M":j=p("M",g,h);break;case"y":i=o("y");break;case"@":var t=new Date(o("@"));i=t.getFullYear(),j=t.getMonth()+1,k=t.getDate();break;case"!":var t=new Date((o("!")-this._ticksTo1970)/1e4);i=t.getFullYear(),j=t.getMonth()+1,k=t.getDate();break;case"'":n("'")?q():m=!0;break;default:q()}if(r<b.length)throw"Extra/unparsed characters found in date: "+b.substring(r);i==-1?i=(new Date).getFullYear():i<100&&(i+=(new Date).getFullYear()-(new Date).getFullYear()%100+(i<=d?0:-100));if(l>-1){j=1,k=l;for(;;){var u=this._getDaysInMonth(i,j-1);if(k<=u)break;j++,k-=u}}var t=this._daylightSavingAdjust(new Date(i,j-1,k));if(t.getFullYear()!=i||t.getMonth()+1!=j||t.getDate()!=k)throw"Invalid date";return t},ATOM:"yy-mm-dd",COOKIE:"D, dd M yy",ISO_8601:"yy-mm-dd",RFC_822:"D, d M y",RFC_850:"DD, dd-M-y",RFC_1036:"D, d M y",RFC_1123:"D, d M yy",RFC_2822:"D, d M yy",RSS:"D, d M y",TICKS:"!",TIMESTAMP:"@",W3C:"yy-mm-dd",_ticksTo1970:(718685+Math.floor(492.5)-Math.floor(19.7)+Math.floor(4.925))*24*60*60*1e7,formatDate:function(a,b,c){if(!b)return"";var d=(c?c.dayNamesShort:null)||this._defaults.dayNamesShort,e=(c?c.dayNames:null)||this._defaults.dayNames,f=(c?c.monthNamesShort:null)||this._defaults.monthNamesShort,g=(c?c.monthNames:null)||this._defaults.monthNames,h=function(b){var c=m+1<a.length&&a.charAt(m+1)==b;c&&m++;return c},i=function(a,b,c){var d=""+b;if(h(a))while(d.length<c)d="0"+d;return d},j=function(a,b,c,d){return h(a)?d[b]:c[b]},k="",l=!1;if(b)for(var m=0;m<a.length;m++)if(l)a.charAt(m)=="'"&&!h("'")?l=!1:k+=a.charAt(m);else switch(a.charAt(m)){case"d":k+=i("d",b.getDate(),2);break;case"D":k+=j("D",b.getDay(),d,e);break;case"o":k+=i("o",Math.round(((new Date(b.getFullYear(),b.getMonth(),b.getDate())).getTime()-(new Date(b.getFullYear(),0,0)).getTime())/864e5),3);break;case"m":k+=i("m",b.getMonth()+1,2);break;case"M":k+=j("M",b.getMonth(),f,g);break;case"y":k+=h("y")?b.getFullYear():(b.getYear()%100<10?"0":"")+b.getYear()%100;break;case"@":k+=b.getTime();break;case"!":k+=b.getTime()*1e4+this._ticksTo1970;break;case"'":h("'")?k+="'":l=!0;break;default:k+=a.charAt(m)}return k},_possibleChars:function(a){var b="",c=!1,d=function(b){var c=e+1<a.length&&a.charAt(e+1)==b;c&&e++;return c};for(var e=0;e<a.length;e++)if(c)a.charAt(e)=="'"&&!d("'")?c=!1:b+=a.charAt(e);else switch(a.charAt(e)){case"d":case"m":case"y":case"@":b+="0123456789";break;case"D":case"M":return null;case"'":d("'")?b+="'":c=!0;break;default:b+=a.charAt(e)}return b},_get:function(a,b){return a.settings[b]!==undefined?a.settings[b]:this._defaults[b]},_setDateFromField:function(a,b){if(a.input.val()!=a.lastVal){var c=this._get(a,"dateFormat"),d=a.lastVal=a.input?a.input.val():null,e,f;e=f=this._getDefaultDate(a);var g=this._getFormatConfig(a);try{e=this.parseDate(c,d,g)||f}catch(h){this.log(h),d=b?"":d}a.selectedDay=e.getDate(),a.drawMonth=a.selectedMonth=e.getMonth(),a.drawYear=a.selectedYear=e.getFullYear(),a.currentDay=d?e.getDate():0,a.currentMonth=d?e.getMonth():0,a.currentYear=d?e.getFullYear():0,this._adjustInstDate(a)}},_getDefaultDate:function(a){return this._restrictMinMax(a,this._determineDate(a,this._get(a,"defaultDate"),new Date))},_determineDate:function(a,b,c){var d=function(a){var b=new Date;b.setDate(b.getDate()+a);return b},e=function(b){try{return $.datepicker.parseDate($.datepicker._get(a,"dateFormat"),b,$.datepicker._getFormatConfig(a))}catch(c){}var d=(b.toLowerCase().match(/^c/)?$.datepicker._getDate(a):null)||new Date,e=d.getFullYear(),f=d.getMonth(),g=d.getDate(),h=/([+-]?[0-9]+)\s*(d|D|w|W|m|M|y|Y)?/g,i=h.exec(b);while(i){switch(i[2]||"d"){case"d":case"D":g+=parseInt(i[1],10);break;case"w":case"W":g+=parseInt(i[1],10)*7;break;case"m":case"M":f+=parseInt(i[1],10),g=Math.min(g,$.datepicker._getDaysInMonth(e,f));break;case"y":case"Y":e+=parseInt(i[1],10),g=Math.min(g,$.datepicker._getDaysInMonth(e,f))}i=h.exec(b)}return new Date(e,f,g)},f=b==null||b===""?c:typeof b=="string"?e(b):typeof b=="number"?isNaN(b)?c:d(b):new Date(b.getTime());f=f&&f.toString()=="Invalid Date"?c:f,f&&(f.setHours(0),f.setMinutes(0),f.setSeconds(0),f.setMilliseconds(0));return this._daylightSavingAdjust(f)},_daylightSavingAdjust:function(a){if(!a)return null;a.setHours(a.getHours()>12?a.getHours()+2:0);return a},_setDate:function(a,b,c){var d=!b,e=a.selectedMonth,f=a.selectedYear,g=this._restrictMinMax(a,this._determineDate(a,b,new Date));a.selectedDay=a.currentDay=g.getDate(),a.drawMonth=a.selectedMonth=a.currentMonth=g.getMonth(),a.drawYear=a.selectedYear=a.currentYear=g.getFullYear(),(e!=a.selectedMonth||f!=a.selectedYear)&&!c&&this._notifyChange(a),this._adjustInstDate(a),a.input&&a.input.val(d?"":this._formatDate(a))},_getDate:function(a){var b=!a.currentYear||a.input&&a.input.val()==""?null:this._daylightSavingAdjust(new Date(a.currentYear,a.currentMonth,a.currentDay));return b},_generateHTML:function(a){var b=new Date;b=this._daylightSavingAdjust(new Date(b.getFullYear(),b.getMonth(),b.getDate()));var c=this._get(a,"isRTL"),d=this._get(a,"showButtonPanel"),e=this._get(a,"hideIfNoPrevNext"),f=this._get(a,"navigationAsDateFormat"),g=this._getNumberOfMonths(a),h=this._get(a,"showCurrentAtPos"),i=this._get(a,"stepMonths"),j=g[0]!=1||g[1]!=1,k=this._daylightSavingAdjust(a.currentDay?new Date(a.currentYear,a.currentMonth,a.currentDay):new Date(9999,9,9)),l=this._getMinMaxDate(a,"min"),m=this._getMinMaxDate(a,"max"),n=a.drawMonth-h,o=a.drawYear;n<0&&(n+=12,o--);if(m){var p=this._daylightSavingAdjust(new Date(m.getFullYear(),m.getMonth()-g[0]*g[1]+1,m.getDate()));p=l&&p<l?l:p;while(this._daylightSavingAdjust(new Date(o,n,1))>p)n--,n<0&&(n=11,o--)}a.drawMonth=n,a.drawYear=o;var q=this._get(a,"prevText");q=f?this.formatDate(q,this._daylightSavingAdjust(new Date(o,n-i,1)),this._getFormatConfig(a)):q;var r=this._canAdjustMonth(a,-1,o,n)?'<a class="ui-datepicker-prev ui-corner-all" onclick="DP_jQuery_'+dpuuid+".datepicker._adjustDate('#"+a.id+"', -"+i+", 'M');\""+' title="'+q+'"><span class="ui-icon ui-icon-circle-triangle-'+(c?"e":"w")+'">'+q+"</span></a>":e?"":'<a class="ui-datepicker-prev ui-corner-all ui-state-disabled" title="'+q+'"><span class="ui-icon ui-icon-circle-triangle-'+(c?"e":"w")+'">'+q+"</span></a>",s=this._get(a,"nextText");s=f?this.formatDate(s,this._daylightSavingAdjust(new Date(o,n+i,1)),this._getFormatConfig(a)):s;var t=this._canAdjustMonth(a,1,o,n)?'<a class="ui-datepicker-next ui-corner-all" onclick="DP_jQuery_'+dpuuid+".datepicker._adjustDate('#"+a.id+"', +"+i+", 'M');\""+' title="'+s+'"><span class="ui-icon ui-icon-circle-triangle-'+(c?"w":"e")+'">'+s+"</span></a>":e?"":'<a class="ui-datepicker-next ui-corner-all ui-state-disabled" title="'+s+'"><span class="ui-icon ui-icon-circle-triangle-'+(c?"w":"e")+'">'+s+"</span></a>",u=this._get(a,"currentText"),v=this._get(a,"gotoCurrent")&&a.currentDay?k:b;u=f?this.formatDate(u,v,this._getFormatConfig(a)):u;var w=a.inline?"":'<button type="button" class="ui-datepicker-close ui-state-default ui-priority-primary ui-corner-all" onclick="DP_jQuery_'+dpuuid+'.datepicker._hideDatepicker();">'+this._get(a,"closeText")+"</button>",x=d?'<div class="ui-datepicker-buttonpane ui-widget-content">'+(c?w:"")+(this._isInRange(a,v)?'<button type="button" class="ui-datepicker-current ui-state-default ui-priority-secondary ui-corner-all" onclick="DP_jQuery_'+dpuuid+".datepicker._gotoToday('#"+a.id+"');\""+">"+u+"</button>":"")+(c?"":w)+"</div>":"",y=parseInt(this._get(a,"firstDay"),10);y=isNaN(y)?0:y;var z=this._get(a,"showWeek"),A=this._get(a,"dayNames"),B=this._get(a,"dayNamesShort"),C=this._get(a,"dayNamesMin"),D=this._get(a,"monthNames"),E=this._get(a,"monthNamesShort"),F=this._get(a,"beforeShowDay"),G=this._get(a,"showOtherMonths"),H=this._get(a,"selectOtherMonths"),I=this._get(a,"calculateWeek")||this.iso8601Week,J=this._getDefaultDate(a),K="";for(var L=0;L<g[0];L++){var M="";this.maxRows=4;for(var N=0;N<g[1];N++){var O=this._daylightSavingAdjust(new Date(o,n,a.selectedDay)),P=" ui-corner-all",Q="";if(j){Q+='<div class="ui-datepicker-group';if(g[1]>1)switch(N){case 0:Q+=" ui-datepicker-group-first",P=" ui-corner-"+(c?"right":"left");break;case g[1]-1:Q+=" ui-datepicker-group-last",P=" ui-corner-"+(c?"left":"right");break;default:Q+=" ui-datepicker-group-middle",P=""}Q+='">'}Q+='<div class="ui-datepicker-header ui-widget-header ui-helper-clearfix'+P+'">'+(/all|left/.test(P)&&L==0?c?t:r:"")+(/all|right/.test(P)&&L==0?c?r:t:"")+this._generateMonthYearHeader(a,n,o,l,m,L>0||N>0,D,E)+'</div><table class="ui-datepicker-calendar"><thead>'+"<tr>";var R=z?'<th class="ui-datepicker-week-col">'+this._get(a,"weekHeader")+"</th>":"";for(var S=0;S<7;S++){var T=(S+y)%7;R+="<th"+((S+y+6)%7>=5?' class="ui-datepicker-week-end"':"")+">"+'<span title="'+A[T]+'">'+C[T]+"</span></th>"}Q+=R+"</tr></thead><tbody>";var U=this._getDaysInMonth(o,n);o==a.selectedYear&&n==a.selectedMonth&&(a.selectedDay=Math.min(a.selectedDay,U));var V=(this._getFirstDayOfMonth(o,n)-y+7)%7,W=Math.ceil((V+U)/7),X=j?this.maxRows>W?this.maxRows:W:W;this.maxRows=X;var Y=this._daylightSavingAdjust(new Date(o,n,1-V));for(var Z=0;Z<X;Z++){Q+="<tr>";var _=z?'<td class="ui-datepicker-week-col">'+this._get(a,"calculateWeek")(Y)+"</td>":"";for(var S=0;S<7;S++){var ba=F?F.apply(a.input?a.input[0]:null,[Y]):[!0,""],bb=Y.getMonth()!=n,bc=bb&&!H||!ba[0]||l&&Y<l||m&&Y>m;_+='<td class="'+((S+y+6)%7>=5?" ui-datepicker-week-end":"")+(bb?" ui-datepicker-other-month":"")+(Y.getTime()==O.getTime()&&n==a.selectedMonth&&a._keyEvent||J.getTime()==Y.getTime()&&J.getTime()==O.getTime()?" "+this._dayOverClass:"")+(bc?" "+this._unselectableClass+" ui-state-disabled":"")+(bb&&!G?"":" "+ba[1]+(Y.getTime()==k.getTime()?" "+this._currentClass:"")+(Y.getTime()==b.getTime()?" ui-datepicker-today":""))+'"'+((!bb||G)&&ba[2]?' title="'+ba[2]+'"':"")+(bc?"":' onclick="DP_jQuery_'+dpuuid+".datepicker._selectDay('#"+a.id+"',"+Y.getMonth()+","+Y.getFullYear()+', this);return false;"')+">"+(bb&&!G?" ":bc?'<span class="ui-state-default">'+Y.getDate()+"</span>":'<a class="ui-state-default'+(Y.getTime()==b.getTime()?" ui-state-highlight":"")+(Y.getTime()==k.getTime()?" ui-state-active":"")+(bb?" ui-priority-secondary":"")+'" href="#">'+Y.getDate()+"</a>")+"</td>",Y.setDate(Y.getDate()+1),Y=this._daylightSavingAdjust(Y)}Q+=_+"</tr>"}n++,n>11&&(n=0,o++),Q+="</tbody></table>"+(j?"</div>"+(g[0]>0&&N==g[1]-1?'<div class="ui-datepicker-row-break"></div>':""):""),M+=Q}K+=M}K+=x+($.browser.msie&&parseInt($.browser.version,10)<7&&!a.inline?'<iframe src="javascript:false;" class="ui-datepicker-cover" frameborder="0"></iframe>':""),a._keyEvent=!1;return K},_generateMonthYearHeader:function(a,b,c,d,e,f,g,h){var i=this._get(a,"changeMonth"),j=this._get(a,"changeYear"),k=this 18 ._get(a,"showMonthAfterYear"),l='<div class="ui-datepicker-title">',m="";if(f||!i)m+='<span class="ui-datepicker-month">'+g[b]+"</span>";else{var n=d&&d.getFullYear()==c,o=e&&e.getFullYear()==c;m+='<select class="ui-datepicker-month" onchange="DP_jQuery_'+dpuuid+".datepicker._selectMonthYear('#"+a.id+"', this, 'M');\" "+">";for(var p=0;p<12;p++)(!n||p>=d.getMonth())&&(!o||p<=e.getMonth())&&(m+='<option value="'+p+'"'+(p==b?' selected="selected"':"")+">"+h[p]+"</option>");m+="</select>"}k||(l+=m+(f||!i||!j?" ":""));if(!a.yearshtml){a.yearshtml="";if(f||!j)l+='<span class="ui-datepicker-year">'+c+"</span>";else{var q=this._get(a,"yearRange").split(":"),r=(new Date).getFullYear(),s=function(a){var b=a.match(/c[+-].*/)?c+parseInt(a.substring(1),10):a.match(/[+-].*/)?r+parseInt(a,10):parseInt(a,10);return isNaN(b)?r:b},t=s(q[0]),u=Math.max(t,s(q[1]||""));t=d?Math.max(t,d.getFullYear()):t,u=e?Math.min(u,e.getFullYear()):u,a.yearshtml+='<select class="ui-datepicker-year" onchange="DP_jQuery_'+dpuuid+".datepicker._selectMonthYear('#"+a.id+"', this, 'Y');\" "+">";for(;t<=u;t++)a.yearshtml+='<option value="'+t+'"'+(t==c?' selected="selected"':"")+">"+t+"</option>";a.yearshtml+="</select>",l+=a.yearshtml,a.yearshtml=null}}l+=this._get(a,"yearSuffix"),k&&(l+=(f||!i||!j?" ":"")+m),l+="</div>";return l},_adjustInstDate:function(a,b,c){var d=a.drawYear+(c=="Y"?b:0),e=a.drawMonth+(c=="M"?b:0),f=Math.min(a.selectedDay,this._getDaysInMonth(d,e))+(c=="D"?b:0),g=this._restrictMinMax(a,this._daylightSavingAdjust(new Date(d,e,f)));a.selectedDay=g.getDate(),a.drawMonth=a.selectedMonth=g.getMonth(),a.drawYear=a.selectedYear=g.getFullYear(),(c=="M"||c=="Y")&&this._notifyChange(a)},_restrictMinMax:function(a,b){var c=this._getMinMaxDate(a,"min"),d=this._getMinMaxDate(a,"max"),e=c&&b<c?c:b;e=d&&e>d?d:e;return e},_notifyChange:function(a){var b=this._get(a,"onChangeMonthYear");b&&b.apply(a.input?a.input[0]:null,[a.selectedYear,a.selectedMonth+1,a])},_getNumberOfMonths:function(a){var b=this._get(a,"numberOfMonths");return b==null?[1,1]:typeof b=="number"?[1,b]:b},_getMinMaxDate:function(a,b){return this._determineDate(a,this._get(a,b+"Date"),null)},_getDaysInMonth:function(a,b){return 32-this._daylightSavingAdjust(new Date(a,b,32)).getDate()},_getFirstDayOfMonth:function(a,b){return(new Date(a,b,1)).getDay()},_canAdjustMonth:function(a,b,c,d){var e=this._getNumberOfMonths(a),f=this._daylightSavingAdjust(new Date(c,d+(b<0?b:e[0]*e[1]),1));b<0&&f.setDate(this._getDaysInMonth(f.getFullYear(),f.getMonth()));return this._isInRange(a,f)},_isInRange:function(a,b){var c=this._getMinMaxDate(a,"min"),d=this._getMinMaxDate(a,"max");return(!c||b.getTime()>=c.getTime())&&(!d||b.getTime()<=d.getTime())},_getFormatConfig:function(a){var b=this._get(a,"shortYearCutoff");b=typeof b!="string"?b:(new Date).getFullYear()%100+parseInt(b,10);return{shortYearCutoff:b,dayNamesShort:this._get(a,"dayNamesShort"),dayNames:this._get(a,"dayNames"),monthNamesShort:this._get(a,"monthNamesShort"),monthNames:this._get(a,"monthNames")}},_formatDate:function(a,b,c,d){b||(a.currentDay=a.selectedDay,a.currentMonth=a.selectedMonth,a.currentYear=a.selectedYear);var e=b?typeof b=="object"?b:this._daylightSavingAdjust(new Date(d,c,b)):this._daylightSavingAdjust(new Date(a.currentYear,a.currentMonth,a.currentDay));return this.formatDate(this._get(a,"dateFormat"),e,this._getFormatConfig(a))}}),$.fn.datepicker=function(a){if(!this.length)return this;$.datepicker.initialized||($(document).mousedown($.datepicker._checkExternalClick).find("body").append($.datepicker.dpDiv),$.datepicker.initialized=!0);var b=Array.prototype.slice.call(arguments,1);if(typeof a=="string"&&(a=="isDisabled"||a=="getDate"||a=="widget"))return $.datepicker["_"+a+"Datepicker"].apply($.datepicker,[this[0]].concat(b));if(a=="option"&&arguments.length==2&&typeof arguments[1]=="string")return $.datepicker["_"+a+"Datepicker"].apply($.datepicker,[this[0]].concat(b));return this.each(function(){typeof a=="string"?$.datepicker["_"+a+"Datepicker"].apply($.datepicker,[this].concat(b)):$.datepicker._attachDatepicker(this,a)})},$.datepicker=new Datepicker,$.datepicker.initialized=!1,$.datepicker.uuid=(new Date).getTime(),$.datepicker.version="1.8.17",window["DP_jQuery_"+dpuuid]=$})(jQuery); tgsb_myjquery = jQuery; 17 */ 18 (function($, undefined) { 19 function isArray(a) { 20 return a && ($.browser.safari && typeof a == "object" && a.length || a.constructor && a.constructor.toString().match(/\Array\(\)/)) 21 } 22 23 function extendRemove(a, b) { 24 $.extend(a, b); 25 for (var c in b) 26 if (b[c] == null || b[c] == undefined) a[c] = b[c]; 27 return a 28 } 29 30 function bindHover(a) { 31 var b = "button, .ui-datepicker-prev, .ui-datepicker-next, .ui-datepicker-calendar td a"; 32 return a.bind("mouseout", function(a) { 33 var c = $(a.target).closest(b); 34 !c.length || c.removeClass("ui-state-hover ui-datepicker-prev-hover ui-datepicker-next-hover") 35 }).bind("mouseover", function(c) { 36 var d = $(c.target).closest(b); 37 !$.datepicker._isDisabledDatepicker(instActive.inline ? a.parent()[0] : instActive.input[0]) && !!d.length && (d.parents(".ui-datepicker-calendar").find("a").removeClass("ui-state-hover"), d.addClass("ui-state-hover"), d.hasClass("ui-datepicker-prev") && d.addClass("ui-datepicker-prev-hover"), d.hasClass("ui-datepicker-next") && d.addClass("ui-datepicker-next-hover")) 38 }) 39 } 40 41 function Datepicker() { 42 this.debug = !1, this._curInst = null, this._keyEvent = !1, this._disabledInputs = [], this._datepickerShowing = !1, this._inDialog = !1, this._mainDivId = "tgsb-ui-datepicker-div", this._inlineClass = "ui-datepicker-inline", this._appendClass = "ui-datepicker-append", this._triggerClass = "ui-datepicker-trigger", this._dialogClass = "ui-datepicker-dialog", this._disableClass = "ui-datepicker-disabled", this._unselectableClass = "ui-datepicker-unselectable", this._currentClass = "ui-datepicker-current-day", this._dayOverClass = "ui-datepicker-days-cell-over", this.regional = [], this.regional[""] = { 43 closeText: "Done", 44 prevText: "Prev", 45 nextText: "Next", 46 currentText: "Today", 47 monthNames: ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"], 48 monthNamesShort: ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"], 49 dayNames: ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"], 50 dayNamesShort: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"], 51 dayNamesMin: ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"], 52 weekHeader: "Wk", 53 dateFormat: "mm/dd/yy", 54 firstDay: 0, 55 isRTL: !1, 56 showMonthAfterYear: !1, 57 yearSuffix: "" 58 }, this._defaults = { 59 showOn: "focus", 60 showAnim: "fadeIn", 61 showOptions: {}, 62 defaultDate: null, 63 appendText: "", 64 buttonText: "...", 65 buttonImage: "", 66 buttonImageOnly: !1, 67 hideIfNoPrevNext: !1, 68 navigationAsDateFormat: !1, 69 gotoCurrent: !1, 70 changeMonth: !1, 71 changeYear: !1, 72 yearRange: "c-10:c+10", 73 showOtherMonths: !1, 74 selectOtherMonths: !1, 75 showWeek: !1, 76 calculateWeek: this.iso8601Week, 77 shortYearCutoff: "+10", 78 minDate: null, 79 maxDate: null, 80 duration: "fast", 81 beforeShowDay: null, 82 beforeShow: null, 83 onSelect: null, 84 onChangeMonthYear: null, 85 onClose: null, 86 numberOfMonths: 1, 87 showCurrentAtPos: 0, 88 stepMonths: 1, 89 stepBigMonths: 12, 90 altField: "", 91 altFormat: "", 92 constrainInput: !0, 93 showButtonPanel: !1, 94 autoSize: !1, 95 disabled: !1 96 }, $.extend(this._defaults, this.regional[""]), this.dpDiv = bindHover($('<div id="' + this._mainDivId + '" class="ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all"></div>')) 97 } 98 $.extend($.ui, { 99 datepicker: { 100 version: "1.8.17" 101 } 102 }); 103 var PROP_NAME = "datepicker", 104 dpuuid = (new Date).getTime(), 105 instActive; 106 $.extend(Datepicker.prototype, { 107 markerClassName: "hasDatepicker", 108 maxRows: 4, 109 log: function() { 110 this.debug && console.log.apply("", arguments) 111 }, 112 _widgetDatepicker: function() { 113 return this.dpDiv 114 }, 115 setDefaults: function(a) { 116 extendRemove(this._defaults, a || {}); 117 return this 118 }, 119 _attachDatepicker: function(target, settings) { 120 var inlineSettings = null; 121 for (var attrName in this._defaults) { 122 var attrValue = target.getAttribute("date:" + attrName); 123 if (attrValue) { 124 inlineSettings = inlineSettings || {}; 125 try { 126 inlineSettings[attrName] = eval(attrValue) 127 } catch (err) { 128 inlineSettings[attrName] = attrValue 129 } 130 } 131 } 132 var nodeName = target.nodeName.toLowerCase(), 133 inline = nodeName == "div" || nodeName == "span"; 134 target.id || (this.uuid += 1, target.id = "dp" + this.uuid); 135 var inst = this._newInst($(target), inline); 136 inst.settings = $.extend({}, settings || {}, inlineSettings || {}), nodeName == "input" ? this._connectDatepicker(target, inst) : inline && this._inlineDatepicker(target, inst) 137 }, 138 _newInst: function(a, b) { 139 var c = a[0].id.replace(/([^A-Za-z0-9_-])/g, "\\\\$1"); 140 return { 141 id: c, 142 input: a, 143 selectedDay: 0, 144 selectedMonth: 0, 145 selectedYear: 0, 146 drawMonth: 0, 147 drawYear: 0, 148 inline: b, 149 dpDiv: b ? bindHover($('<div class="' + this._inlineClass + ' ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all"></div>')) : this.dpDiv 150 } 151 }, 152 _connectDatepicker: function(a, b) { 153 var c = $(a); 154 b.append = $([]), b.trigger = $([]); 155 c.hasClass(this.markerClassName) || (this._attachments(c, b), c.addClass(this.markerClassName).keydown(this._doKeyDown).keypress(this._doKeyPress).keyup(this._doKeyUp).bind("setData.datepicker", function(a, c, d) { 156 b.settings[c] = d 157 }).bind("getData.datepicker", function(a, c) { 158 return this._get(b, c) 159 }), this._autoSize(b), $.data(a, PROP_NAME, b), b.settings.disabled && this._disableDatepicker(a)) 160 }, 161 _attachments: function(a, b) { 162 var c = this._get(b, "appendText"), 163 d = this._get(b, "isRTL"); 164 b.append && b.append.remove(), c && (b.append = $('<span class="' + this._appendClass + '">' + c + "</span>"), a[d ? "before" : "after"](b.append)), a.unbind("focus", this._showDatepicker), b.trigger && b.trigger.remove(); 165 var e = this._get(b, "showOn"); 166 (e == "focus" || e == "both") && a.focus(this._showDatepicker); 167 if (e == "button" || e == "both") { 168 var f = this._get(b, "buttonText"), 169 g = this._get(b, "buttonImage"); 170 b.trigger = $(this._get(b, "buttonImageOnly") ? $("<img/>").addClass(this._triggerClass).attr({ 171 src: g, 172 alt: f, 173 title: f 174 }) : $('<button type="button"></button>').addClass(this._triggerClass).html(g == "" ? f : $("<img/>").attr({ 175 src: g, 176 alt: f, 177 title: f 178 }))), a[d ? "before" : "after"](b.trigger), b.trigger.click(function() { 179 $.datepicker._datepickerShowing && $.datepicker._lastInput == a[0] ? $.datepicker._hideDatepicker() : $.datepicker._showDatepicker(a[0]); 180 return !1 181 }) 182 } 183 }, 184 _autoSize: function(a) { 185 if (this._get(a, "autoSize") && !a.inline) { 186 var b = new Date(2009, 11, 20), 187 c = this._get(a, "dateFormat"); 188 if (c.match(/[DM]/)) { 189 var d = function(a) { 190 var b = 0, 191 c = 0; 192 for (var d = 0; d < a.length; d++) a[d].length > b && (b = a[d].length, c = d); 193 return c 194 }; 195 b.setMonth(d(this._get(a, c.match(/MM/) ? "monthNames" : "monthNamesShort"))), b.setDate(d(this._get(a, c.match(/DD/) ? "dayNames" : "dayNamesShort")) + 20 - b.getDay()) 196 } 197 a.input.attr("size", this._formatDate(a, b).length) 198 } 199 }, 200 _inlineDatepicker: function(a, b) { 201 var c = $(a); 202 c.hasClass(this.markerClassName) || (c.addClass(this.markerClassName).append(b.dpDiv).bind("setData.datepicker", function(a, c, d) { 203 b.settings[c] = d 204 }).bind("getData.datepicker", function(a, c) { 205 return this._get(b, c) 206 }), $.data(a, PROP_NAME, b), this._setDate(b, this._getDefaultDate(b), !0), this._updateDatepicker(b), this._updateAlternate(b), b.settings.disabled && this._disableDatepicker(a), b.dpDiv.css("display", "block")) 207 }, 208 _dialogDatepicker: function(a, b, c, d, e) { 209 var f = this._dialogInst; 210 if (!f) { 211 this.uuid += 1; 212 var g = "dp" + this.uuid; 213 this._dialogInput = $('<input type="text" id="' + g + '" style="position: absolute; top: -100px; width: 0px; z-index: -10;"/>'), this._dialogInput.keydown(this._doKeyDown), $("body").append(this._dialogInput), f = this._dialogInst = this._newInst(this._dialogInput, !1), f.settings = {}, $.data(this._dialogInput[0], PROP_NAME, f) 214 } 215 extendRemove(f.settings, d || {}), b = b && b.constructor == Date ? this._formatDate(f, b) : b, this._dialogInput.val(b), this._pos = e ? e.length ? e : [e.pageX, e.pageY] : null; 216 if (!this._pos) { 217 var h = document.documentElement.clientWidth, 218 i = document.documentElement.clientHeight, 219 j = document.documentElement.scrollLeft || document.body.scrollLeft, 220 k = document.documentElement.scrollTop || document.body.scrollTop; 221 this._pos = [h / 2 - 100 + j, i / 2 - 150 + k] 222 } 223 this._dialogInput.css("left", this._pos[0] + 20 + "px").css("top", this._pos[1] + "px"), f.settings.onSelect = c, this._inDialog = !0, this.dpDiv.addClass(this._dialogClass), this._showDatepicker(this._dialogInput[0]), $.blockUI && $.blockUI(this.dpDiv), $.data(this._dialogInput[0], PROP_NAME, f); 224 return this 225 }, 226 _destroyDatepicker: function(a) { 227 var b = $(a), 228 c = $.data(a, PROP_NAME); 229 if (!!b.hasClass(this.markerClassName)) { 230 var d = a.nodeName.toLowerCase(); 231 $.removeData(a, PROP_NAME), d == "input" ? (c.append.remove(), c.trigger.remove(), b.removeClass(this.markerClassName).unbind("focus", this._showDatepicker).unbind("keydown", this._doKeyDown).unbind("keypress", this._doKeyPress).unbind("keyup", this._doKeyUp)) : (d == "div" || d == "span") && b.removeClass(this.markerClassName).empty() 232 } 233 }, 234 _enableDatepicker: function(a) { 235 var b = $(a), 236 c = $.data(a, PROP_NAME); 237 if (!!b.hasClass(this.markerClassName)) { 238 var d = a.nodeName.toLowerCase(); 239 if (d == "input") a.disabled = !1, c.trigger.filter("button").each(function() { 240 this.disabled = !1 241 }).end().filter("img").css({ 242 opacity: "1.0", 243 cursor: "" 244 }); 245 else if (d == "div" || d == "span") { 246 var e = b.children("." + this._inlineClass); 247 e.children().removeClass("ui-state-disabled"), e.find("select.ui-datepicker-month, select.ui-datepicker-year").removeAttr("disabled") 248 } 249 this._disabledInputs = $.map(this._disabledInputs, function(b) { 250 return b == a ? null : b 251 }) 252 } 253 }, 254 _disableDatepicker: function(a) { 255 var b = $(a), 256 c = $.data(a, PROP_NAME); 257 if (!!b.hasClass(this.markerClassName)) { 258 var d = a.nodeName.toLowerCase(); 259 if (d == "input") a.disabled = !0, c.trigger.filter("button").each(function() { 260 this.disabled = !0 261 }).end().filter("img").css({ 262 opacity: "0.5", 263 cursor: "default" 264 }); 265 else if (d == "div" || d == "span") { 266 var e = b.children("." + this._inlineClass); 267 e.children().addClass("ui-state-disabled"), e.find("select.ui-datepicker-month, select.ui-datepicker-year").attr("disabled", "disabled") 268 } 269 this._disabledInputs = $.map(this._disabledInputs, function(b) { 270 return b == a ? null : b 271 }), this._disabledInputs[this._disabledInputs.length] = a 272 } 273 }, 274 _isDisabledDatepicker: function(a) { 275 if (!a) return !1; 276 for (var b = 0; b < this._disabledInputs.length; b++) 277 if (this._disabledInputs[b] == a) return !0; 278 return !1 279 }, 280 _getInst: function(a) { 281 try { 282 return $.data(a, PROP_NAME) 283 } catch (b) { 284 throw "Missing instance data for this datepicker" 285 } 286 }, 287 _optionDatepicker: function(a, b, c) { 288 var d = this._getInst(a); 289 if (arguments.length == 2 && typeof b == "string") return b == "defaults" ? $.extend({}, $.datepicker._defaults) : d ? b == "all" ? $.extend({}, d.settings) : this._get(d, b) : null; 290 var e = b || {}; 291 typeof b == "string" && (e = {}, e[b] = c); 292 if (d) { 293 this._curInst == d && this._hideDatepicker(); 294 var f = this._getDateDatepicker(a, !0), 295 g = this._getMinMaxDate(d, "min"), 296 h = this._getMinMaxDate(d, "max"); 297 extendRemove(d.settings, e), g !== null && e.dateFormat !== undefined && e.minDate === undefined && (d.settings.minDate = this._formatDate(d, g)), h !== null && e.dateFormat !== undefined && e.maxDate === undefined && (d.settings.maxDate = this._formatDate(d, h)), this._attachments($(a), d), this._autoSize(d), this._setDate(d, f), this._updateAlternate(d), this._updateDatepicker(d) 298 } 299 }, 300 _changeDatepicker: function(a, b, c) { 301 this._optionDatepicker(a, b, c) 302 }, 303 _refreshDatepicker: function(a) { 304 var b = this._getInst(a); 305 b && this._updateDatepicker(b) 306 }, 307 _setDateDatepicker: function(a, b) { 308 var c = this._getInst(a); 309 c && (this._setDate(c, b), this._updateDatepicker(c), this._updateAlternate(c)) 310 }, 311 _getDateDatepicker: function(a, b) { 312 var c = this._getInst(a); 313 c && !c.inline && this._setDateFromField(c, b); 314 return c ? this._getDate(c) : null 315 }, 316 _doKeyDown: function(a) { 317 var b = $.datepicker._getInst(a.target), 318 c = !0, 319 d = b.dpDiv.is(".ui-datepicker-rtl"); 320 b._keyEvent = !0; 321 if ($.datepicker._datepickerShowing) switch (a.keyCode) { 322 case 9: 323 $.datepicker._hideDatepicker(), c = !1; 324 break; 325 case 13: 326 var e = $("td." + $.datepicker._dayOverClass + ":not(." + $.datepicker._currentClass + ")", b.dpDiv); 327 e[0] && $.datepicker._selectDay(a.target, b.selectedMonth, b.selectedYear, e[0]); 328 var f = $.datepicker._get(b, "onSelect"); 329 if (f) { 330 var g = $.datepicker._formatDate(b); 331 f.apply(b.input ? b.input[0] : null, [g, b]) 332 } else $.datepicker._hideDatepicker(); 333 return !1; 334 case 27: 335 $.datepicker._hideDatepicker(); 336 break; 337 case 33: 338 $.datepicker._adjustDate(a.target, a.ctrlKey ? -$.datepicker._get(b, "stepBigMonths") : -$.datepicker._get(b, "stepMonths"), "M"); 339 break; 340 case 34: 341 $.datepicker._adjustDate(a.target, a.ctrlKey ? +$.datepicker._get(b, "stepBigMonths") : +$.datepicker._get(b, "stepMonths"), "M"); 342 break; 343 case 35: 344 (a.ctrlKey || a.metaKey) && $.datepicker._clearDate(a.target), c = a.ctrlKey || a.metaKey; 345 break; 346 case 36: 347 (a.ctrlKey || a.metaKey) && $.datepicker._gotoToday(a.target), c = a.ctrlKey || a.metaKey; 348 break; 349 case 37: 350 (a.ctrlKey || a.metaKey) && $.datepicker._adjustDate(a.target, d ? 1 : -1, "D"), c = a.ctrlKey || a.metaKey, a.originalEvent.altKey && $.datepicker._adjustDate(a.target, a.ctrlKey ? -$.datepicker._get(b, "stepBigMonths") : -$.datepicker._get(b, "stepMonths"), "M"); 351 break; 352 case 38: 353 (a.ctrlKey || a.metaKey) && $.datepicker._adjustDate(a.target, -7, "D"), c = a.ctrlKey || a.metaKey; 354 break; 355 case 39: 356 (a.ctrlKey || a.metaKey) && $.datepicker._adjustDate(a.target, d ? -1 : 1, "D"), c = a.ctrlKey || a.metaKey, a.originalEvent.altKey && $.datepicker._adjustDate(a.target, a.ctrlKey ? +$.datepicker._get(b, "stepBigMonths") : +$.datepicker._get(b, "stepMonths"), "M"); 357 break; 358 case 40: 359 (a.ctrlKey || a.metaKey) && $.datepicker._adjustDate(a.target, 7, "D"), c = a.ctrlKey || a.metaKey; 360 break; 361 default: 362 c = !1 363 } else a.keyCode == 36 && a.ctrlKey ? $.datepicker._showDatepicker(this) : c = !1; 364 c && (a.preventDefault(), a.stopPropagation()) 365 }, 366 _doKeyPress: function(a) { 367 var b = $.datepicker._getInst(a.target); 368 if ($.datepicker._get(b, "constrainInput")) { 369 var c = $.datepicker._possibleChars($.datepicker._get(b, "dateFormat")), 370 d = String.fromCharCode(a.charCode == undefined ? a.keyCode : a.charCode); 371 return a.ctrlKey || a.metaKey || d < " " || !c || c.indexOf(d) > -1 372 } 373 }, 374 _doKeyUp: function(a) { 375 var b = $.datepicker._getInst(a.target); 376 if (b.input.val() != b.lastVal) try { 377 var c = $.datepicker.parseDate($.datepicker._get(b, "dateFormat"), b.input ? b.input.val() : null, $.datepicker._getFormatConfig(b)); 378 c && ($.datepicker._setDateFromField(b), $.datepicker._updateAlternate(b), $.datepicker._updateDatepicker(b)) 379 } catch (a) { 380 $.datepicker.log(a) 381 } 382 return !0 383 }, 384 _showDatepicker: function(a) { 385 a = a.target || a, a.nodeName.toLowerCase() != "input" && (a = $("input", a.parentNode)[0]); 386 if (!$.datepicker._isDisabledDatepicker(a) && $.datepicker._lastInput != a) { 387 var b = $.datepicker._getInst(a); 388 $.datepicker._curInst && $.datepicker._curInst != b && ($.datepicker._curInst.dpDiv.stop(!0, !0), b && $.datepicker._datepickerShowing && $.datepicker._hideDatepicker($.datepicker._curInst.input[0])); 389 var c = $.datepicker._get(b, "beforeShow"), 390 d = c ? c.apply(a, [a, b]) : {}; 391 if (d === !1) return; 392 extendRemove(b.settings, d), b.lastVal = null, $.datepicker._lastInput = a, $.datepicker._setDateFromField(b), $.datepicker._inDialog && (a.value = ""), $.datepicker._pos || ($.datepicker._pos = $.datepicker._findPos(a), $.datepicker._pos[1] += a.offsetHeight); 393 var e = !1; 394 $(a).parents().each(function() { 395 e |= $(this).css("position") == "fixed"; 396 return !e 397 }), e && $.browser.opera && ($.datepicker._pos[0] -= document.documentElement.scrollLeft, $.datepicker._pos[1] -= document.documentElement.scrollTop); 398 var f = { 399 left: $.datepicker._pos[0], 400 top: $.datepicker._pos[1] 401 }; 402 $.datepicker._pos = null, b.dpDiv.empty(), b.dpDiv.css({ 403 position: "absolute", 404 display: "block", 405 top: "-1000px" 406 }), $.datepicker._updateDatepicker(b), f = $.datepicker._checkOffset(b, f, e), b.dpDiv.css({ 407 position: $.datepicker._inDialog && $.blockUI ? "static" : e ? "fixed" : "absolute", 408 display: "none", 409 left: f.left + "px", 410 top: f.top + "px" 411 }); 412 if (!b.inline) { 413 var g = $.datepicker._get(b, "showAnim"), 414 h = $.datepicker._get(b, "duration"), 415 i = function() { 416 var a = b.dpDiv.find("iframe.ui-datepicker-cover"); 417 if (!!a.length) { 418 var c = $.datepicker._getBorders(b.dpDiv); 419 a.css({ 420 left: -c[0], 421 top: -c[1], 422 width: b.dpDiv.outerWidth(), 423 height: b.dpDiv.outerHeight() 424 }) 425 } 426 }; 427 b.dpDiv.zIndex(Math.max($(a).zIndex() + 1, 12)), $.datepicker._datepickerShowing = !0, $.effects && $.effects[g] ? b.dpDiv.show(g, $.datepicker._get(b, "showOptions"), h, i) : b.dpDiv[g || "show"](g ? h : null, i), (!g || !h) && i(), b.input.is(":visible") && !b.input.is(":disabled") && b.input.focus(), $.datepicker._curInst = b 428 } 429 } 430 }, 431 _updateDatepicker: function(a) { 432 var b = this; 433 b.maxRows = 4; 434 var c = $.datepicker._getBorders(a.dpDiv); 435 instActive = a, a.dpDiv.empty().append(this._generateHTML(a)); 436 var d = a.dpDiv.find("iframe.ui-datepicker-cover"); 437 !d.length || d.css({ 438 left: -c[0], 439 top: -c[1], 440 width: a.dpDiv.outerWidth(), 441 height: a.dpDiv.outerHeight() 442 }), a.dpDiv.find("." + this._dayOverClass + " a").mouseover(); 443 var e = this._getNumberOfMonths(a), 444 f = e[1], 445 g = 17; 446 a.dpDiv.removeClass("ui-datepicker-multi-2 ui-datepicker-multi-3 ui-datepicker-multi-4").width(""), f > 1 && a.dpDiv.addClass("ui-datepicker-multi-" + f).css("width", g * f + "em"), a.dpDiv[(e[0] != 1 || e[1] != 1 ? "add" : "remove") + "Class"]("ui-datepicker-multi"), a.dpDiv[(this._get(a, "isRTL") ? "add" : "remove") + "Class"]("ui-datepicker-rtl"), a == $.datepicker._curInst && $.datepicker._datepickerShowing && a.input && a.input.is(":visible") && !a.input.is(":disabled") && a.input[0] != document.activeElement && a.input.focus(); 447 if (a.yearshtml) { 448 var h = a.yearshtml; 449 setTimeout(function() { 450 h === a.yearshtml && a.yearshtml && a.dpDiv.find("select.ui-datepicker-year:first").replaceWith(a.yearshtml), h = a.yearshtml = null 451 }, 0) 452 } 453 }, 454 _getBorders: function(a) { 455 var b = function(a) { 456 return { 457 thin: 1, 458 medium: 2, 459 thick: 3 460 }[a] || a 461 }; 462 return [parseFloat(b(a.css("border-left-width"))), parseFloat(b(a.css("border-top-width")))] 463 }, 464 _checkOffset: function(a, b, c) { 465 var d = a.dpDiv.outerWidth(), 466 e = a.dpDiv.outerHeight(), 467 f = a.input ? a.input.outerWidth() : 0, 468 g = a.input ? a.input.outerHeight() : 0, 469 h = document.documentElement.clientWidth + $(document).scrollLeft(), 470 i = document.documentElement.clientHeight + $(document).scrollTop(); 471 b.left -= this._get(a, "isRTL") ? d - f : 0, b.left -= c && b.left == a.input.offset().left ? $(document).scrollLeft() : 0, b.top -= c && b.top == a.input.offset().top + g ? $(document).scrollTop() : 0, b.left -= Math.min(b.left, b.left + d > h && h > d ? Math.abs(b.left + d - h) : 0), b.top -= Math.min(b.top, b.top + e > i && i > e ? Math.abs(e + g) : 0); 472 return b 473 }, 474 _findPos: function(a) { 475 var b = this._getInst(a), 476 c = this._get(b, "isRTL"); 477 while (a && (a.type == "hidden" || a.nodeType != 1 || $.expr.filters.hidden(a))) a = a[c ? "previousSibling" : "nextSibling"]; 478 var d = $(a).offset(); 479 return [d.left, d.top] 480 }, 481 _hideDatepicker: function(a) { 482 var b = this._curInst; 483 if (!(!b || a && b != $.data(a, PROP_NAME)) && this._datepickerShowing) { 484 var c = this._get(b, "showAnim"), 485 d = this._get(b, "duration"), 486 e = this, 487 f = function() { 488 $.datepicker._tidyDialog(b), e._curInst = null 489 }; 490 $.effects && $.effects[c] ? b.dpDiv.hide(c, $.datepicker._get(b, "showOptions"), d, f) : b.dpDiv[c == "slideDown" ? "slideUp" : c == "fadeIn" ? "fadeOut" : "hide"](c ? d : null, f), c || f(), this._datepickerShowing = !1; 491 var g = this._get(b, "onClose"); 492 g && g.apply(b.input ? b.input[0] : null, [b.input ? b.input.val() : "", b]), this._lastInput = null, this._inDialog && (this._dialogInput.css({ 493 position: "absolute", 494 left: "0", 495 top: "-100px" 496 }), $.blockUI && ($.unblockUI(), $("body").append(this.dpDiv))), this._inDialog = !1 497 } 498 }, 499 _tidyDialog: function(a) { 500 a.dpDiv.removeClass(this._dialogClass).unbind(".ui-datepicker-calendar") 501 }, 502 _checkExternalClick: function(a) { 503 if (!!$.datepicker._curInst) { 504 var b = $(a.target), 505 c = $.datepicker._getInst(b[0]); 506 (b[0].id != $.datepicker._mainDivId && b.parents("#" + $.datepicker._mainDivId).length == 0 && !b.hasClass($.datepicker.markerClassName) && !b.hasClass($.datepicker._triggerClass) && $.datepicker._datepickerShowing && (!$.datepicker._inDialog || !$.blockUI) || b.hasClass($.datepicker.markerClassName) && $.datepicker._curInst != c) && $.datepicker._hideDatepicker() 507 } 508 }, 509 _adjustDate: function(a, b, c) { 510 var d = $(a), 511 e = this._getInst(d[0]); 512 this._isDisabledDatepicker(d[0]) || (this._adjustInstDate(e, b + (c == "M" ? this._get(e, "showCurrentAtPos") : 0), c), this._updateDatepicker(e)) 513 }, 514 _gotoToday: function(a) { 515 var b = $(a), 516 c = this._getInst(b[0]); 517 if (this._get(c, "gotoCurrent") && c.currentDay) c.selectedDay = c.currentDay, c.drawMonth = c.selectedMonth = c.currentMonth, c.drawYear = c.selectedYear = c.currentYear; 518 else { 519 var d = new Date; 520 c.selectedDay = d.getDate(), c.drawMonth = c.selectedMonth = d.getMonth(), c.drawYear = c.selectedYear = d.getFullYear() 521 } 522 this._notifyChange(c), this._adjustDate(b) 523 }, 524 _selectMonthYear: function(a, b, c) { 525 var d = $(a), 526 e = this._getInst(d[0]); 527 e["selected" + (c == "M" ? "Month" : "Year")] = e["draw" + (c == "M" ? "Month" : "Year")] = parseInt(b.options[b.selectedIndex].value, 10), this._notifyChange(e), this._adjustDate(d) 528 }, 529 _selectDay: function(a, b, c, d) { 530 var e = $(a); 531 if (!$(d).hasClass(this._unselectableClass) && !this._isDisabledDatepicker(e[0])) { 532 var f = this._getInst(e[0]); 533 f.selectedDay = f.currentDay = $("a", d).html(), f.selectedMonth = f.currentMonth = b, f.selectedYear = f.currentYear = c, this._selectDate(a, this._formatDate(f, f.currentDay, f.currentMonth, f.currentYear)) 534 } 535 }, 536 _clearDate: function(a) { 537 var b = $(a), 538 c = this._getInst(b[0]); 539 this._selectDate(b, "") 540 }, 541 _selectDate: function(a, b) { 542 var c = $(a), 543 d = this._getInst(c[0]); 544 b = b != null ? b : this._formatDate(d), d.input && d.input.val(b), this._updateAlternate(d); 545 var e = this._get(d, "onSelect"); 546 e ? e.apply(d.input ? d.input[0] : null, [b, d]) : d.input && d.input.trigger("change"), d.inline ? this._updateDatepicker(d) : (this._hideDatepicker(), this._lastInput = d.input[0], typeof d.input[0] != "object" && d.input.focus(), this._lastInput = null) 547 }, 548 _updateAlternate: function(a) { 549 var b = this._get(a, "altField"); 550 if (b) { 551 var c = this._get(a, "altFormat") || this._get(a, "dateFormat"), 552 d = this._getDate(a), 553 e = this.formatDate(c, d, this._getFormatConfig(a)); 554 $(b).each(function() { 555 $(this).val(e) 556 }) 557 } 558 }, 559 noWeekends: function(a) { 560 var b = a.getDay(); 561 return [b > 0 && b < 6, ""] 562 }, 563 iso8601Week: function(a) { 564 var b = new Date(a.getTime()); 565 b.setDate(b.getDate() + 4 - (b.getDay() || 7)); 566 var c = b.getTime(); 567 b.setMonth(0), b.setDate(1); 568 return Math.floor(Math.round((c - b) / 864e5) / 7) + 1 569 }, 570 parseDate: function(a, b, c) { 571 if (a == null || b == null) throw "Invalid arguments"; 572 b = typeof b == "object" ? b.toString() : b + ""; 573 if (b == "") return null; 574 var d = (c ? c.shortYearCutoff : null) || this._defaults.shortYearCutoff; 575 d = typeof d != "string" ? d : (new Date).getFullYear() % 100 + parseInt(d, 10); 576 var e = (c ? c.dayNamesShort : null) || this._defaults.dayNamesShort, 577 f = (c ? c.dayNames : null) || this._defaults.dayNames, 578 g = (c ? c.monthNamesShort : null) || this._defaults.monthNamesShort, 579 h = (c ? c.monthNames : null) || this._defaults.monthNames, 580 i = -1, 581 j = -1, 582 k = -1, 583 l = -1, 584 m = !1, 585 n = function(b) { 586 var c = s + 1 < a.length && a.charAt(s + 1) == b; 587 c && s++; 588 return c 589 }, 590 o = function(a) { 591 var c = n(a), 592 d = a == "@" ? 14 : a == "!" ? 20 : a == "y" && c ? 4 : a == "o" ? 3 : 2, 593 e = new RegExp("^\\d{1," + d + "}"), 594 f = b.substring(r).match(e); 595 if (!f) throw "Missing number at position " + r; 596 r += f[0].length; 597 return parseInt(f[0], 10) 598 }, 599 p = function(a, c, d) { 600 var e = $.map(n(a) ? d : c, function(a, b) { 601 return [ 602 [b, a] 603 ] 604 }).sort(function(a, b) { 605 return -(a[1].length - b[1].length) 606 }), 607 f = -1; 608 $.each(e, function(a, c) { 609 var d = c[1]; 610 if (b.substr(r, d.length).toLowerCase() == d.toLowerCase()) { 611 f = c[0], r += d.length; 612 return !1 613 } 614 }); 615 if (f != -1) return f + 1; 616 throw "Unknown name at position " + r 617 }, 618 q = function() { 619 if (b.charAt(r) != a.charAt(s)) throw "Unexpected literal at position " + r; 620 r++ 621 }, 622 r = 0; 623 for (var s = 0; s < a.length; s++) 624 if (m) a.charAt(s) == "'" && !n("'") ? m = !1 : q(); 625 else switch (a.charAt(s)) { 626 case "d": 627 k = o("d"); 628 break; 629 case "D": 630 p("D", e, f); 631 break; 632 case "o": 633 l = o("o"); 634 break; 635 case "m": 636 j = o("m"); 637 break; 638 case "M": 639 j = p("M", g, h); 640 break; 641 case "y": 642 i = o("y"); 643 break; 644 case "@": 645 var t = new Date(o("@")); 646 i = t.getFullYear(), j = t.getMonth() + 1, k = t.getDate(); 647 break; 648 case "!": 649 var t = new Date((o("!") - this._ticksTo1970) / 1e4); 650 i = t.getFullYear(), j = t.getMonth() + 1, k = t.getDate(); 651 break; 652 case "'": 653 n("'") ? q() : m = !0; 654 break; 655 default: 656 q() 657 } 658 if (r < b.length) throw "Extra/unparsed characters found in date: " + b.substring(r); 659 i == -1 ? i = (new Date).getFullYear() : i < 100 && (i += (new Date).getFullYear() - (new Date).getFullYear() % 100 + (i <= d ? 0 : -100)); 660 if (l > -1) { 661 j = 1, k = l; 662 for (;;) { 663 var u = this._getDaysInMonth(i, j - 1); 664 if (k <= u) break; 665 j++, k -= u 666 } 667 } 668 var t = this._daylightSavingAdjust(new Date(i, j - 1, k)); 669 if (t.getFullYear() != i || t.getMonth() + 1 != j || t.getDate() != k) throw "Invalid date"; 670 return t 671 }, 672 ATOM: "yy-mm-dd", 673 COOKIE: "D, dd M yy", 674 ISO_8601: "yy-mm-dd", 675 RFC_822: "D, d M y", 676 RFC_850: "DD, dd-M-y", 677 RFC_1036: "D, d M y", 678 RFC_1123: "D, d M yy", 679 RFC_2822: "D, d M yy", 680 RSS: "D, d M y", 681 TICKS: "!", 682 TIMESTAMP: "@", 683 W3C: "yy-mm-dd", 684 _ticksTo1970: (718685 + Math.floor(492.5) - Math.floor(19.7) + Math.floor(4.925)) * 24 * 60 * 60 * 1e7, 685 formatDate: function(a, b, c) { 686 if (!b) return ""; 687 var d = (c ? c.dayNamesShort : null) || this._defaults.dayNamesShort, 688 e = (c ? c.dayNames : null) || this._defaults.dayNames, 689 f = (c ? c.monthNamesShort : null) || this._defaults.monthNamesShort, 690 g = (c ? c.monthNames : null) || this._defaults.monthNames, 691 h = function(b) { 692 var c = m + 1 < a.length && a.charAt(m + 1) == b; 693 c && m++; 694 return c 695 }, 696 i = function(a, b, c) { 697 var d = "" + b; 698 if (h(a)) 699 while (d.length < c) d = "0" + d; 700 return d 701 }, 702 j = function(a, b, c, d) { 703 return h(a) ? d[b] : c[b] 704 }, 705 k = "", 706 l = !1; 707 if (b) 708 for (var m = 0; m < a.length; m++) 709 if (l) a.charAt(m) == "'" && !h("'") ? l = !1 : k += a.charAt(m); 710 else switch (a.charAt(m)) { 711 case "d": 712 k += i("d", b.getDate(), 2); 713 break; 714 case "D": 715 k += j("D", b.getDay(), d, e); 716 break; 717 case "o": 718 k += i("o", Math.round(((new Date(b.getFullYear(), b.getMonth(), b.getDate())).getTime() - (new Date(b.getFullYear(), 0, 0)).getTime()) / 864e5), 3); 719 break; 720 case "m": 721 k += i("m", b.getMonth() + 1, 2); 722 break; 723 case "M": 724 k += j("M", b.getMonth(), f, g); 725 break; 726 case "y": 727 k += h("y") ? b.getFullYear() : (b.getYear() % 100 < 10 ? "0" : "") + b.getYear() % 100; 728 break; 729 case "@": 730 k += b.getTime(); 731 break; 732 case "!": 733 k += b.getTime() * 1e4 + this._ticksTo1970; 734 break; 735 case "'": 736 h("'") ? k += "'" : l = !0; 737 break; 738 default: 739 k += a.charAt(m) 740 } 741 return k 742 }, 743 _possibleChars: function(a) { 744 var b = "", 745 c = !1, 746 d = function(b) { 747 var c = e + 1 < a.length && a.charAt(e + 1) == b; 748 c && e++; 749 return c 750 }; 751 for (var e = 0; e < a.length; e++) 752 if (c) a.charAt(e) == "'" && !d("'") ? c = !1 : b += a.charAt(e); 753 else switch (a.charAt(e)) { 754 case "d": 755 case "m": 756 case "y": 757 case "@": 758 b += "0123456789"; 759 break; 760 case "D": 761 case "M": 762 return null; 763 case "'": 764 d("'") ? b += "'" : c = !0; 765 break; 766 default: 767 b += a.charAt(e) 768 } 769 return b 770 }, 771 _get: function(a, b) { 772 return a.settings[b] !== undefined ? a.settings[b] : this._defaults[b] 773 }, 774 _setDateFromField: function(a, b) { 775 if (a.input.val() != a.lastVal) { 776 var c = this._get(a, "dateFormat"), 777 d = a.lastVal = a.input ? a.input.val() : null, 778 e, f; 779 e = f = this._getDefaultDate(a); 780 var g = this._getFormatConfig(a); 781 try { 782 e = this.parseDate(c, d, g) || f 783 } catch (h) { 784 this.log(h), d = b ? "" : d 785 } 786 a.selectedDay = e.getDate(), a.drawMonth = a.selectedMonth = e.getMonth(), a.drawYear = a.selectedYear = e.getFullYear(), a.currentDay = d ? e.getDate() : 0, a.currentMonth = d ? e.getMonth() : 0, a.currentYear = d ? e.getFullYear() : 0, this._adjustInstDate(a) 787 } 788 }, 789 _getDefaultDate: function(a) { 790 return this._restrictMinMax(a, this._determineDate(a, this._get(a, "defaultDate"), new Date)) 791 }, 792 _determineDate: function(a, b, c) { 793 var d = function(a) { 794 var b = new Date; 795 b.setDate(b.getDate() + a); 796 return b 797 }, 798 e = function(b) { 799 try { 800 return $.datepicker.parseDate($.datepicker._get(a, "dateFormat"), b, $.datepicker._getFormatConfig(a)) 801 } catch (c) {} 802 var d = (b.toLowerCase().match(/^c/) ? $.datepicker._getDate(a) : null) || new Date, 803 e = d.getFullYear(), 804 f = d.getMonth(), 805 g = d.getDate(), 806 h = /([+-]?[0-9]+)\s*(d|D|w|W|m|M|y|Y)?/g, 807 i = h.exec(b); 808 while (i) { 809 switch (i[2] || "d") { 810 case "d": 811 case "D": 812 g += parseInt(i[1], 10); 813 break; 814 case "w": 815 case "W": 816 g += parseInt(i[1], 10) * 7; 817 break; 818 case "m": 819 case "M": 820 f += parseInt(i[1], 10), g = Math.min(g, $.datepicker._getDaysInMonth(e, f)); 821 break; 822 case "y": 823 case "Y": 824 e += parseInt(i[1], 10), g = Math.min(g, $.datepicker._getDaysInMonth(e, f)) 825 } 826 i = h.exec(b) 827 } 828 return new Date(e, f, g) 829 }, 830 f = b == null || b === "" ? c : typeof b == "string" ? e(b) : typeof b == "number" ? isNaN(b) ? c : d(b) : new Date(b.getTime()); 831 f = f && f.toString() == "Invalid Date" ? c : f, f && (f.setHours(0), f.setMinutes(0), f.setSeconds(0), f.setMilliseconds(0)); 832 return this._daylightSavingAdjust(f) 833 }, 834 _daylightSavingAdjust: function(a) { 835 if (!a) return null; 836 a.setHours(a.getHours() > 12 ? a.getHours() + 2 : 0); 837 return a 838 }, 839 _setDate: function(a, b, c) { 840 var d = !b, 841 e = a.selectedMonth, 842 f = a.selectedYear, 843 g = this._restrictMinMax(a, this._determineDate(a, b, new Date)); 844 a.selectedDay = a.currentDay = g.getDate(), a.drawMonth = a.selectedMonth = a.currentMonth = g.getMonth(), a.drawYear = a.selectedYear = a.currentYear = g.getFullYear(), (e != a.selectedMonth || f != a.selectedYear) && !c && this._notifyChange(a), this._adjustInstDate(a), a.input && a.input.val(d ? "" : this._formatDate(a)) 845 }, 846 _getDate: function(a) { 847 var b = !a.currentYear || a.input && a.input.val() == "" ? null : this._daylightSavingAdjust(new Date(a.currentYear, a.currentMonth, a.currentDay)); 848 return b 849 }, 850 _generateHTML: function(a) { 851 var b = new Date; 852 b = this._daylightSavingAdjust(new Date(b.getFullYear(), b.getMonth(), b.getDate())); 853 var c = this._get(a, "isRTL"), 854 d = this._get(a, "showButtonPanel"), 855 e = this._get(a, "hideIfNoPrevNext"), 856 f = this._get(a, "navigationAsDateFormat"), 857 g = this._getNumberOfMonths(a), 858 h = this._get(a, "showCurrentAtPos"), 859 i = this._get(a, "stepMonths"), 860 j = g[0] != 1 || g[1] != 1, 861 k = this._daylightSavingAdjust(a.currentDay ? new Date(a.currentYear, a.currentMonth, a.currentDay) : new Date(9999, 9, 9)), 862 l = this._getMinMaxDate(a, "min"), 863 m = this._getMinMaxDate(a, "max"), 864 n = a.drawMonth - h, 865 o = a.drawYear; 866 n < 0 && (n += 12, o--); 867 if (m) { 868 var p = this._daylightSavingAdjust(new Date(m.getFullYear(), m.getMonth() - g[0] * g[1] + 1, m.getDate())); 869 p = l && p < l ? l : p; 870 while (this._daylightSavingAdjust(new Date(o, n, 1)) > p) n--, n < 0 && (n = 11, o--) 871 } 872 a.drawMonth = n, a.drawYear = o; 873 var q = this._get(a, "prevText"); 874 q = f ? this.formatDate(q, this._daylightSavingAdjust(new Date(o, n - i, 1)), this._getFormatConfig(a)) : q; 875 var r = this._canAdjustMonth(a, -1, o, n) ? '<a class="ui-datepicker-prev ui-corner-all" onclick="DP_jQuery_' + dpuuid + ".datepicker._adjustDate('#" + a.id + "', -" + i + ", 'M');\"" + ' title="' + q + '"><span class="ui-icon ui-icon-circle-triangle-' + (c ? "e" : "w") + '">' + q + "</span></a>" : e ? "" : '<a class="ui-datepicker-prev ui-corner-all ui-state-disabled" title="' + q + '"><span class="ui-icon ui-icon-circle-triangle-' + (c ? "e" : "w") + '">' + q + "</span></a>", 876 s = this._get(a, "nextText"); 877 s = f ? this.formatDate(s, this._daylightSavingAdjust(new Date(o, n + i, 1)), this._getFormatConfig(a)) : s; 878 var t = this._canAdjustMonth(a, 1, o, n) ? '<a class="ui-datepicker-next ui-corner-all" onclick="DP_jQuery_' + dpuuid + ".datepicker._adjustDate('#" + a.id + "', +" + i + ", 'M');\"" + ' title="' + s + '"><span class="ui-icon ui-icon-circle-triangle-' + (c ? "w" : "e") + '">' + s + "</span></a>" : e ? "" : '<a class="ui-datepicker-next ui-corner-all ui-state-disabled" title="' + s + '"><span class="ui-icon ui-icon-circle-triangle-' + (c ? "w" : "e") + '">' + s + "</span></a>", 879 u = this._get(a, "currentText"), 880 v = this._get(a, "gotoCurrent") && a.currentDay ? k : b; 881 u = f ? this.formatDate(u, v, this._getFormatConfig(a)) : u; 882 var w = a.inline ? "" : '<button type="button" class="ui-datepicker-close ui-state-default ui-priority-primary ui-corner-all" onclick="DP_jQuery_' + dpuuid + '.datepicker._hideDatepicker();">' + this._get(a, "closeText") + "</button>", 883 x = d ? '<div class="ui-datepicker-buttonpane ui-widget-content">' + (c ? w : "") + (this._isInRange(a, v) ? '<button type="button" class="ui-datepicker-current ui-state-default ui-priority-secondary ui-corner-all" onclick="DP_jQuery_' + dpuuid + ".datepicker._gotoToday('#" + a.id + "');\"" + ">" + u + "</button>" : "") + (c ? "" : w) + "</div>" : "", 884 y = parseInt(this._get(a, "firstDay"), 10); 885 y = isNaN(y) ? 0 : y; 886 var z = this._get(a, "showWeek"), 887 A = this._get(a, "dayNames"), 888 B = this._get(a, "dayNamesShort"), 889 C = this._get(a, "dayNamesMin"), 890 D = this._get(a, "monthNames"), 891 E = this._get(a, "monthNamesShort"), 892 F = this._get(a, "beforeShowDay"), 893 G = this._get(a, "showOtherMonths"), 894 H = this._get(a, "selectOtherMonths"), 895 I = this._get(a, "calculateWeek") || this.iso8601Week, 896 J = this._getDefaultDate(a), 897 K = ""; 898 for (var L = 0; L < g[0]; L++) { 899 var M = ""; 900 this.maxRows = 4; 901 for (var N = 0; N < g[1]; N++) { 902 var O = this._daylightSavingAdjust(new Date(o, n, a.selectedDay)), 903 P = " ui-corner-all", 904 Q = ""; 905 if (j) { 906 Q += '<div class="ui-datepicker-group'; 907 if (g[1] > 1) switch (N) { 908 case 0: 909 Q += " ui-datepicker-group-first", P = " ui-corner-" + (c ? "right" : "left"); 910 break; 911 case g[1] - 1: 912 Q += " ui-datepicker-group-last", P = " ui-corner-" + (c ? "left" : "right"); 913 break; 914 default: 915 Q += " ui-datepicker-group-middle", P = "" 916 } 917 Q += '">' 918 } 919 Q += '<div class="ui-datepicker-header ui-widget-header ui-helper-clearfix' + P + '">' + (/all|left/.test(P) && L == 0 ? c ? t : r : "") + (/all|right/.test(P) && L == 0 ? c ? r : t : "") + this._generateMonthYearHeader(a, n, o, l, m, L > 0 || N > 0, D, E) + '</div><table class="ui-datepicker-calendar"><thead>' + "<tr>"; 920 var R = z ? '<th class="ui-datepicker-week-col">' + this._get(a, "weekHeader") + "</th>" : ""; 921 for (var S = 0; S < 7; S++) { 922 var T = (S + y) % 7; 923 R += "<th" + ((S + y + 6) % 7 >= 5 ? ' class="ui-datepicker-week-end"' : "") + ">" + '<span title="' + A[T] + '">' + C[T] + "</span></th>" 924 } 925 Q += R + "</tr></thead><tbody>"; 926 var U = this._getDaysInMonth(o, n); 927 o == a.selectedYear && n == a.selectedMonth && (a.selectedDay = Math.min(a.selectedDay, U)); 928 var V = (this._getFirstDayOfMonth(o, n) - y + 7) % 7, 929 W = Math.ceil((V + U) / 7), 930 X = j ? this.maxRows > W ? this.maxRows : W : W; 931 this.maxRows = X; 932 var Y = this._daylightSavingAdjust(new Date(o, n, 1 - V)); 933 for (var Z = 0; Z < X; Z++) { 934 Q += "<tr>"; 935 var _ = z ? '<td class="ui-datepicker-week-col">' + this._get(a, "calculateWeek")(Y) + "</td>" : ""; 936 for (var S = 0; S < 7; S++) { 937 var ba = F ? F.apply(a.input ? a.input[0] : null, [Y]) : [!0, ""], 938 bb = Y.getMonth() != n, 939 bc = bb && !H || !ba[0] || l && Y < l || m && Y > m; 940 _ += '<td class="' + ((S + y + 6) % 7 >= 5 ? " ui-datepicker-week-end" : "") + (bb ? " ui-datepicker-other-month" : "") + (Y.getTime() == O.getTime() && n == a.selectedMonth && a._keyEvent || J.getTime() == Y.getTime() && J.getTime() == O.getTime() ? " " + this._dayOverClass : "") + (bc ? " " + this._unselectableClass + " ui-state-disabled" : "") + (bb && !G ? "" : " " + ba[1] + (Y.getTime() == k.getTime() ? " " + this._currentClass : "") + (Y.getTime() == b.getTime() ? " ui-datepicker-today" : "")) + '"' + ((!bb || G) && ba[2] ? ' title="' + ba[2] + '"' : "") + (bc ? "" : ' onclick="DP_jQuery_' + dpuuid + ".datepicker._selectDay('#" + a.id + "'," + Y.getMonth() + "," + Y.getFullYear() + ', this);return false;"') + ">" + (bb && !G ? " " : bc ? '<span class="ui-state-default">' + Y.getDate() + "</span>" : '<a class="ui-state-default' + (Y.getTime() == b.getTime() ? " ui-state-highlight" : "") + (Y.getTime() == k.getTime() ? " ui-state-active" : "") + (bb ? " ui-priority-secondary" : "") + '" href="#">' + Y.getDate() + "</a>") + "</td>", Y.setDate(Y.getDate() + 1), Y = this._daylightSavingAdjust(Y) 941 } 942 Q += _ + "</tr>" 943 } 944 n++, n > 11 && (n = 0, o++), Q += "</tbody></table>" + (j ? "</div>" + (g[0] > 0 && N == g[1] - 1 ? '<div class="ui-datepicker-row-break"></div>' : "") : ""), M += Q 945 } 946 K += M 947 } 948 K += x + ($.browser.msie && parseInt($.browser.version, 10) < 7 && !a.inline ? '<iframe src="javascript:false;" class="ui-datepicker-cover" frameborder="0"></iframe>' : ""), a._keyEvent = !1; 949 return K 950 }, 951 _generateMonthYearHeader: function(a, b, c, d, e, f, g, h) { 952 var i = this._get(a, "changeMonth"), 953 j = this._get(a, "changeYear"), 954 k = this 955 ._get(a, "showMonthAfterYear"), 956 l = '<div class="ui-datepicker-title">', 957 m = ""; 958 if (f || !i) m += '<span class="ui-datepicker-month">' + g[b] + "</span>"; 959 else { 960 var n = d && d.getFullYear() == c, 961 o = e && e.getFullYear() == c; 962 m += '<select class="ui-datepicker-month" onchange="DP_jQuery_' + dpuuid + ".datepicker._selectMonthYear('#" + a.id + "', this, 'M');\" " + ">"; 963 for (var p = 0; p < 12; p++)(!n || p >= d.getMonth()) && (!o || p <= e.getMonth()) && (m += '<option value="' + p + '"' + (p == b ? ' selected="selected"' : "") + ">" + h[p] + "</option>"); 964 m += "</select>" 965 } 966 k || (l += m + (f || !i || !j ? " " : "")); 967 if (!a.yearshtml) { 968 a.yearshtml = ""; 969 if (f || !j) l += '<span class="ui-datepicker-year">' + c + "</span>"; 970 else { 971 var q = this._get(a, "yearRange").split(":"), 972 r = (new Date).getFullYear(), 973 s = function(a) { 974 var b = a.match(/c[+-].*/) ? c + parseInt(a.substring(1), 10) : a.match(/[+-].*/) ? r + parseInt(a, 10) : parseInt(a, 10); 975 return isNaN(b) ? r : b 976 }, 977 t = s(q[0]), 978 u = Math.max(t, s(q[1] || "")); 979 t = d ? Math.max(t, d.getFullYear()) : t, u = e ? Math.min(u, e.getFullYear()) : u, a.yearshtml += '<select class="ui-datepicker-year" onchange="DP_jQuery_' + dpuuid + ".datepicker._selectMonthYear('#" + a.id + "', this, 'Y');\" " + ">"; 980 for (; t <= u; t++) a.yearshtml += '<option value="' + t + '"' + (t == c ? ' selected="selected"' : "") + ">" + t + "</option>"; 981 a.yearshtml += "</select>", l += a.yearshtml, a.yearshtml = null 982 } 983 } 984 l += this._get(a, "yearSuffix"), k && (l += (f || !i || !j ? " " : "") + m), l += "</div>"; 985 return l 986 }, 987 _adjustInstDate: function(a, b, c) { 988 var d = a.drawYear + (c == "Y" ? b : 0), 989 e = a.drawMonth + (c == "M" ? b : 0), 990 f = Math.min(a.selectedDay, this._getDaysInMonth(d, e)) + (c == "D" ? b : 0), 991 g = this._restrictMinMax(a, this._daylightSavingAdjust(new Date(d, e, f))); 992 a.selectedDay = g.getDate(), a.drawMonth = a.selectedMonth = g.getMonth(), a.drawYear = a.selectedYear = g.getFullYear(), (c == "M" || c == "Y") && this._notifyChange(a) 993 }, 994 _restrictMinMax: function(a, b) { 995 var c = this._getMinMaxDate(a, "min"), 996 d = this._getMinMaxDate(a, "max"), 997 e = c && b < c ? c : b; 998 e = d && e > d ? d : e; 999 return e 1000 }, 1001 _notifyChange: function(a) { 1002 var b = this._get(a, "onChangeMonthYear"); 1003 b && b.apply(a.input ? a.input[0] : null, [a.selectedYear, a.selectedMonth + 1, a]) 1004 }, 1005 _getNumberOfMonths: function(a) { 1006 var b = this._get(a, "numberOfMonths"); 1007 return b == null ? [1, 1] : typeof b == "number" ? [1, b] : b 1008 }, 1009 _getMinMaxDate: function(a, b) { 1010 return this._determineDate(a, this._get(a, b + "Date"), null) 1011 }, 1012 _getDaysInMonth: function(a, b) { 1013 return 32 - this._daylightSavingAdjust(new Date(a, b, 32)).getDate() 1014 }, 1015 _getFirstDayOfMonth: function(a, b) { 1016 return (new Date(a, b, 1)).getDay() 1017 }, 1018 _canAdjustMonth: function(a, b, c, d) { 1019 var e = this._getNumberOfMonths(a), 1020 f = this._daylightSavingAdjust(new Date(c, d + (b < 0 ? b : e[0] * e[1]), 1)); 1021 b < 0 && f.setDate(this._getDaysInMonth(f.getFullYear(), f.getMonth())); 1022 return this._isInRange(a, f) 1023 }, 1024 _isInRange: function(a, b) { 1025 var c = this._getMinMaxDate(a, "min"), 1026 d = this._getMinMaxDate(a, "max"); 1027 return (!c || b.getTime() >= c.getTime()) && (!d || b.getTime() <= d.getTime()) 1028 }, 1029 _getFormatConfig: function(a) { 1030 var b = this._get(a, "shortYearCutoff"); 1031 b = typeof b != "string" ? b : (new Date).getFullYear() % 100 + parseInt(b, 10); 1032 return { 1033 shortYearCutoff: b, 1034 dayNamesShort: this._get(a, "dayNamesShort"), 1035 dayNames: this._get(a, "dayNames"), 1036 monthNamesShort: this._get(a, "monthNamesShort"), 1037 monthNames: this._get(a, "monthNames") 1038 } 1039 }, 1040 _formatDate: function(a, b, c, d) { 1041 b || (a.currentDay = a.selectedDay, a.currentMonth = a.selectedMonth, a.currentYear = a.selectedYear); 1042 var e = b ? typeof b == "object" ? b : this._daylightSavingAdjust(new Date(d, c, b)) : this._daylightSavingAdjust(new Date(a.currentYear, a.currentMonth, a.currentDay)); 1043 return this.formatDate(this._get(a, "dateFormat"), e, this._getFormatConfig(a)) 1044 } 1045 }), $.fn.datepicker = function(a) { 1046 if (!this.length) return this; 1047 $.datepicker.initialized || ($(document).mousedown($.datepicker._checkExternalClick).find("body").append($.datepicker.dpDiv), $.datepicker.initialized = !0); 1048 var b = Array.prototype.slice.call(arguments, 1); 1049 if (typeof a == "string" && (a == "isDisabled" || a == "getDate" || a == "widget")) return $.datepicker["_" + a + "Datepicker"].apply($.datepicker, [this[0]].concat(b)); 1050 if (a == "option" && arguments.length == 2 && typeof arguments[1] == "string") return $.datepicker["_" + a + "Datepicker"].apply($.datepicker, [this[0]].concat(b)); 1051 return this.each(function() { 1052 typeof a == "string" ? $.datepicker["_" + a + "Datepicker"].apply($.datepicker, [this].concat(b)) : $.datepicker._attachDatepicker(this, a) 1053 }) 1054 }, $.datepicker = new Datepicker, $.datepicker.initialized = !1, $.datepicker.uuid = (new Date).getTime(), $.datepicker.version = "1.8.17", window["DP_jQuery_" + dpuuid] = $ 1055 })(jQuery); 1056 tgsb_myjquery = jQuery; -
travel-search/trunk/js/tg_searchboxes_ajax.dev.js
r1044744 r1087931 79 79 // find the input with the class asFrom and set it's value to obj.to_air 80 80 currentForm.find('input.asFrom').val(obj.to_air); 81 }; 81 } 82 if(typeof(obj.hotel_city) != 'undefined' && obj.hotel_city && currentForm.hasClass('hotels')) { 83 // find the input with the class asFrom and set it's value to obj.to_air 84 currentForm.find('input.asTo').val(obj.hotel_city); 85 } 82 86 // if on the object we got the departure_date variable is set 83 87 if(typeof(obj.departure_date) != 'undefined' && obj.departure_date) … … 189 193 jQuery(".asFrom").val(inp.val()); 190 194 inp.parents('#TB_ajaxContent').find('.tg_container > form.cars').find('.asFrom').val(''); 191 } ;195 } 192 196 193 197 if(inp.hasClass("asTo")) { 194 198 jQuery(".asTo").val(inp.val()); 195 199 inp.parents('#TB_ajaxContent').find('.tg_container > form.cars').find('.asFrom').val(inp.val()); 196 } ;200 } 197 201 } 198 202 }; 203 var hotelASoptions = { 204 delay: 175, 205 timeout: 5000, 206 script: TG_Searchboxes_Variables.str_ASAjaxURL, 207 loadingClass: 'tgsb_as_load', 208 className: 'tgsb_as tgsb_asMargin', 209 json: true, 210 frameForIE: true, 211 ajaxParams: { 212 action: '', 213 json: true, 214 lng: 'def', 215 dsgn: 'flg', 216 addtag: 'em', 217 citytype: 'cities', 218 maxResults: 10, 219 domainPrefix: true, 220 nearestAirport: true 221 222 }, 223 autoSelect:true, 224 offsety:0, 225 format: function(selLiObj) { 226 return selLiObj.innerHTML.replace(/<\/?[^>]+>/gi,'').replace(/(.*),(.*) \((.*)\)/,'$1,$2'); 227 }, 228 callback:function(asElem,asObj){ 229 var inp = jQuery(asObj.fld); 230 if(inp.hasClass("asTo")) { 231 var airport = inp.val(); 232 for(var i=0; i<asElem.attributes.length; i++) { 233 if (asElem.attributes[i].nodeName == 'airport') { 234 var val = asElem.attributes[i].value ? asElem.attributes[i].value : asElem.attributes[i].nodeValue; 235 if (val) { 236 try { 237 var arp = eval('(' + val + ')'); 238 if (arp && arp.city && arp.iata) { 239 airport = arp.city + ' (' + arp.iata + ')'; 240 } 241 } catch(e) {} 242 } 243 } 244 } 245 jQuery(".asTo").not(inp).val(airport); 246 inp.parents('#TB_ajaxContent').find('.tg_container > form.cars').find('.asFrom').val(airport); 247 } 248 } 249 }; 250 199 251 200 252 function inputFocus(ev){ … … 285 337 try { 286 338 287 jQuery(".tgsb_addAS , .tgsb_addASH").each(function(){339 jQuery(".tgsb_addAS").each(function(){ 288 340 jQuery(this).focus(inputFocus).blur(inputBlur); 289 341 new AS(this.id,ASoptions); 342 }); 343 jQuery(".tgsb_addASH").each(function(){ 344 jQuery(this).focus(inputFocus).blur(inputBlur); 345 new AS(this.id,hotelASoptions); 290 346 }); 291 347 -
travel-search/trunk/js/tg_searchboxes_ajax.min.js
r1044744 r1087931 1 function setParamsToBoxes(a){"undefined"!=typeof a.size&&a.size||(a.size="300x250");"undefined"!=typeof a.selectedTab&&a.selectedTab||(a.selectedTab="flights");"undefined"!=typeof a.alignment&&a.alignment||(a.alignment="alignnone");for(var b=jQuery("#TB_ajaxContent").find("input[name=img_align]"),c=0;c<b.length;c++)if(b[c].value==a.alignment){b[c].checked=!0;break}b=jQuery("#TB_ajaxContent").find("ul.measuresChooser");c="300x250";c=b.find("a.current").html();b.find("a.current").removeClass("current"); 2 b.find("a."+a.size).addClass("current");jQuery("#TB_ajaxContent").find("div.tgsb.sb"+c).removeClass("crnt");b=jQuery("#TB_ajaxContent").find("div.tgsb.sb"+a.size);b.addClass("crnt");c=b.find("ul.tg_tabs");c.find("span.sel").removeClass("sel");c.find("span."+a.selectedTab).addClass("sel");b=b.find("div.tg_container");b.find("form.sel").removeClass("sel");b.find("form."+a.selectedTab).addClass("sel");b=jQuery("#TB_ajaxContent").find("form");jQuery("#TB_ajaxContent").find("a.send_searchbox_to_editor").html("Update"); 3 jQuery("#TB_ajaxContent").find("input.send_searchbox_to_editor").val("Update Box");a.usejavascript&&jQuery("#TB_ajaxContent").find("#travelSearchUseJavaScript").attr("checked",!0);b.each(function(){var b=jQuery(this);"undefined"!=typeof a.from_air&&a.from_air&&!b.hasClass("cars")&&b.find("input.asFrom").val(a.from_air);"undefined"!=typeof a.to_air&&a.to_air&&(b.find("input.asTo").val(a.to_air),b.hasClass("cars")&&b.find("input.asFrom").val(a.to_air));"undefined"!=typeof a.departure_date&&a.departure_date&& 4 b.find("input.depDate").val(a.departure_date);"undefined"!=typeof a.return_date&&a.return_date&&b.find("input.retDate").val(a.return_date);"undefined"!=typeof a.adults&&a.adults&&b.find("select.adults").val(a.adults);"undefined"!=typeof a.kids&&a.kids&&b.find("select.kids").val(a.kids);"undefined"!=typeof a.seniors&&a.seniors&&b.find("select.seniors").val(a.seniors);"undefined"!=typeof a.rooms&&a.rooms&&b.find("select.rooms").val(a.rooms);if("undefined"!=typeof a.rtow){var c=b.hasClass("flights")? 5 b.find("input[name=oneway], select[name=oneway], label.radio"):!1,f=0==a.rtow?"":"on";if(1==c.length){var d=c.get(0).id;jQuery("#"+d).val(f)}2==c.length&&(d=c.get(0).id,c=c.get(1).id,"on"==f?jQuery("#"+c).get(0).checked=!0:jQuery("#"+d).get(0).checked=!0)}"undefined"!=typeof a.cruiseline&&a.cruiseline&&b.find('select[name="cruiseline"]').val(a.cruiseline);"undefined"!=typeof a.destination&&a.destination&&b.find('select[name="destination"]').val(a.destination);"undefined"!=typeof a.length_of_stay&& 6 a.length_of_stay&&b.find('select[name="length_of_stay"]').val(a.length_of_stay);"undefined"!=typeof a.month_year&&a.month_year&&b.find('select[name="month_year"]').val(a.month_year)})}"undefined"!=typeof tgsb_selBoxParam&&tgsb_selBoxParam&&setParamsToBoxes(tgsb_selBoxParam);jQuery("input[name=img_align], #basic .align .field label, #travelSearchUseJavaScript, label[for=travelSearchUseJavaScript]").click(function(a){a.stopPropagation();return!0}); 7 jQuery("ul.measuresChooser li a").click(function(){measureChoosed=jQuery(this).text();jQuery("ul.measuresChooser li a").removeClass("current");jQuery(this).addClass("current");jQuery("div.tgsb").removeClass("crnt");jQuery("div.sb"+measureChoosed).addClass("crnt")}); 8 var ASoptions={delay:175,timeout:5E3,script:TG_Searchboxes_Variables.str_ASAjaxURL,loadingClass:"tgsb_as_load",className:"tgsb_as tgsb_asMargin",json:!0,frameForIE:!0,ajaxParams:{action:"",json:!0,lng:"def",dsgn:"flg",addtag:"em",citytype:"airports",maxResults:10,domainPrefix:!0},autoSelect:!0,offsety:0,format:function(a){return a.innerHTML.replace(/<\/?[a-z]+>/gi,"").replace(/(.*),(.*)\((.*)\)/,"$1 ($3)")},callback:function(a,b){var c=jQuery(b.fld);c.hasClass("asFrom")&&(jQuery(".asFrom").val(c.val()), 9 c.parents("#TB_ajaxContent").find(".tg_container > form.cars").find(".asFrom").val(""));c.hasClass("asTo")&&(jQuery(".asTo").val(c.val()),c.parents("#TB_ajaxContent").find(".tg_container > form.cars").find(".asFrom").val(c.val()))}};function inputFocus(a){this.value==this.defaultValue?this.value="":this.select()}function inputBlur(a){""==this.value&&(this.value=this.defaultValue)} 10 function createDatepicker(a,b,c){jQuery("#"+a+", #"+b).each(function(){var c=jQuery(this),d="undefined"!=typeof TG_Searchboxes_Variables?TG_Searchboxes_Variables:{};c.datepicker({minDate:0,maxDate:"2y",showOn:"both",buttonImage:d.str_CalendarURL,buttonImageOnly:!0,dateFormat:d.str_dateFormat,onSelect:function(c,f){d1=jQuery(this).datepicker("getDate");if(this.id==a&&d.str_dateFormat&&(d2=jQuery.datepicker.parseDate(d.str_dateFormat,jQuery("#"+b).val()),jQuery("#"+b).datepicker("option","minDate", 11 d1),d2&&d1>d2)){d2.setTime(d1.getTime()+432E6);var e=jQuery.datepicker.formatDate(d.str_dateFormat,d2);jQuery("#"+b).val(e);var g=jQuery("#"+b).parents("div.tg_searchbox:eq(0)");g.find("input.retDate").val(e)}inputName=this.name;g=jQuery(this).parents("div.tg_searchbox:eq(0)");g.find('input[name="'+inputName+'"]').val(c)}})});if("object"==typeof c&&0<c.length){var e=c.get(0).id,h=c.get(1).id;c.click(function(a){a.stopPropagation();this.id==h&&this.checked&&jQuery("#"+b).attr("disabled",!0);this.id== 12 e&&this.checked&&jQuery("#"+b).attr("disabled",!1)})}}jQuery("select.adults").change(function(){var a=jQuery(this);a.parents(".tg_searchbox").find(".tg_container > form").find(".adults").val(a.val())});jQuery("select.kids").change(function(){var a=jQuery(this);a.parents(".tg_searchbox").find(".tg_container > form").find(".kids").val(a.val())});jQuery("select.seniors").change(function(){var a=jQuery(this);a.parents(".tg_searchbox").find(".tg_container > form").find(".seniors").val(a.val())}); 1 function setParamsToBoxes(a){"undefined"!=typeof a.size&&a.size||(a.size="300x250");"undefined"!=typeof a.selectedTab&&a.selectedTab||(a.selectedTab="flights");"undefined"!=typeof a.alignment&&a.alignment||(a.alignment="alignnone");for(var c=jQuery("#TB_ajaxContent").find("input[name=img_align]"),b=0;b<c.length;b++)if(c[b].value==a.alignment){c[b].checked=!0;break}c=jQuery("#TB_ajaxContent").find("ul.measuresChooser");b="300x250";b=c.find("a.current").html();c.find("a.current").removeClass("current"); 2 c.find("a."+a.size).addClass("current");jQuery("#TB_ajaxContent").find("div.tgsb.sb"+b).removeClass("crnt");c=jQuery("#TB_ajaxContent").find("div.tgsb.sb"+a.size);c.addClass("crnt");b=c.find("ul.tg_tabs");b.find("span.sel").removeClass("sel");b.find("span."+a.selectedTab).addClass("sel");c=c.find("div.tg_container");c.find("form.sel").removeClass("sel");c.find("form."+a.selectedTab).addClass("sel");c=jQuery("#TB_ajaxContent").find("form");jQuery("#TB_ajaxContent").find("a.send_searchbox_to_editor").html("Update"); 3 jQuery("#TB_ajaxContent").find("input.send_searchbox_to_editor").val("Update Box");a.usejavascript&&jQuery("#TB_ajaxContent").find("#travelSearchUseJavaScript").attr("checked",!0);c.each(function(){var b=jQuery(this);"undefined"!=typeof a.from_air&&a.from_air&&!b.hasClass("cars")&&b.find("input.asFrom").val(a.from_air);"undefined"!=typeof a.to_air&&a.to_air&&(b.find("input.asTo").val(a.to_air),b.hasClass("cars")&&b.find("input.asFrom").val(a.to_air));"undefined"!=typeof a.hotel_city&&a.hotel_city&& 4 b.hasClass("hotels")&&b.find("input.asTo").val(a.hotel_city);"undefined"!=typeof a.departure_date&&a.departure_date&&b.find("input.depDate").val(a.departure_date);"undefined"!=typeof a.return_date&&a.return_date&&b.find("input.retDate").val(a.return_date);"undefined"!=typeof a.adults&&a.adults&&b.find("select.adults").val(a.adults);"undefined"!=typeof a.kids&&a.kids&&b.find("select.kids").val(a.kids);"undefined"!=typeof a.seniors&&a.seniors&&b.find("select.seniors").val(a.seniors);"undefined"!=typeof a.rooms&& 5 a.rooms&&b.find("select.rooms").val(a.rooms);if("undefined"!=typeof a.rtow){var c=b.hasClass("flights")?b.find("input[name=oneway], select[name=oneway], label.radio"):!1,g=0==a.rtow?"":"on";if(1==c.length){var d=c.get(0).id;jQuery("#"+d).val(g)}2==c.length&&(d=c.get(0).id,c=c.get(1).id,"on"==g?jQuery("#"+c).get(0).checked=!0:jQuery("#"+d).get(0).checked=!0)}"undefined"!=typeof a.cruiseline&&a.cruiseline&&b.find('select[name="cruiseline"]').val(a.cruiseline);"undefined"!=typeof a.destination&&a.destination&& 6 b.find('select[name="destination"]').val(a.destination);"undefined"!=typeof a.length_of_stay&&a.length_of_stay&&b.find('select[name="length_of_stay"]').val(a.length_of_stay);"undefined"!=typeof a.month_year&&a.month_year&&b.find('select[name="month_year"]').val(a.month_year)})}"undefined"!=typeof tgsb_selBoxParam&&tgsb_selBoxParam&&setParamsToBoxes(tgsb_selBoxParam); 7 jQuery("input[name=img_align], #basic .align .field label, #travelSearchUseJavaScript, label[for=travelSearchUseJavaScript]").click(function(a){a.stopPropagation();return!0});jQuery("ul.measuresChooser li a").click(function(){measureChoosed=jQuery(this).text();jQuery("ul.measuresChooser li a").removeClass("current");jQuery(this).addClass("current");jQuery("div.tgsb").removeClass("crnt");jQuery("div.sb"+measureChoosed).addClass("crnt")}); 8 var ASoptions={delay:175,timeout:5E3,script:TG_Searchboxes_Variables.str_ASAjaxURL,loadingClass:"tgsb_as_load",className:"tgsb_as tgsb_asMargin",json:!0,frameForIE:!0,ajaxParams:{action:"",json:!0,lng:"def",dsgn:"flg",addtag:"em",citytype:"airports",maxResults:10,domainPrefix:!0},autoSelect:!0,offsety:0,format:function(a){return a.innerHTML.replace(/<\/?[a-z]+>/gi,"").replace(/(.*),(.*)\((.*)\)/,"$1 ($3)")},callback:function(a,c){var b=jQuery(c.fld);b.hasClass("asFrom")&&(jQuery(".asFrom").val(b.val()), 9 b.parents("#TB_ajaxContent").find(".tg_container > form.cars").find(".asFrom").val(""));b.hasClass("asTo")&&(jQuery(".asTo").val(b.val()),b.parents("#TB_ajaxContent").find(".tg_container > form.cars").find(".asFrom").val(b.val()))}},hotelASoptions={delay:175,timeout:5E3,script:TG_Searchboxes_Variables.str_ASAjaxURL,loadingClass:"tgsb_as_load",className:"tgsb_as tgsb_asMargin",json:!0,frameForIE:!0,ajaxParams:{action:"",json:!0,lng:"def",dsgn:"flg",addtag:"em",citytype:"cities",maxResults:10,domainPrefix:!0, 10 nearestAirport:!0},autoSelect:!0,offsety:0,format:function(a){return a.innerHTML.replace(/<\/?[^>]+>/gi,"").replace(/(.*),(.*) \((.*)\)/,"$1,$2")},callback:function(a,c){var b=jQuery(c.fld);if(b.hasClass("asTo")){for(var e=b.val(),f=0;f<a.attributes.length;f++)if("airport"==a.attributes[f].nodeName){var g=a.attributes[f].value?a.attributes[f].value:a.attributes[f].nodeValue;if(g)try{var d=eval("("+g+")");d&&d.city&&d.iata&&(e=d.city+" ("+d.iata+")")}catch(h){}}jQuery(".asTo").not(b).val(e);b.parents("#TB_ajaxContent").find(".tg_container > form.cars").find(".asFrom").val(e)}}}; 11 function inputFocus(a){this.value==this.defaultValue?this.value="":this.select()}function inputBlur(a){""==this.value&&(this.value=this.defaultValue)} 12 function createDatepicker(a,c,b){jQuery("#"+a+", #"+c).each(function(){var b=jQuery(this),d="undefined"!=typeof TG_Searchboxes_Variables?TG_Searchboxes_Variables:{};b.datepicker({minDate:0,maxDate:"2y",showOn:"both",buttonImage:d.str_CalendarURL,buttonImageOnly:!0,dateFormat:d.str_dateFormat,onSelect:function(b,f){d1=jQuery(this).datepicker("getDate");if(this.id==a&&d.str_dateFormat&&(d2=jQuery.datepicker.parseDate(d.str_dateFormat,jQuery("#"+c).val()),jQuery("#"+c).datepicker("option","minDate", 13 d1),d2&&d1>d2)){d2.setTime(d1.getTime()+432E6);var e=jQuery.datepicker.formatDate(d.str_dateFormat,d2);jQuery("#"+c).val(e);var g=jQuery("#"+c).parents("div.tg_searchbox:eq(0)");g.find("input.retDate").val(e)}inputName=this.name;g=jQuery(this).parents("div.tg_searchbox:eq(0)");g.find('input[name="'+inputName+'"]').val(b)}})});if("object"==typeof b&&0<b.length){var e=b.get(0).id,f=b.get(1).id;b.click(function(a){a.stopPropagation();this.id==f&&this.checked&&jQuery("#"+c).attr("disabled",!0);this.id== 14 e&&this.checked&&jQuery("#"+c).attr("disabled",!1)})}}jQuery("select.adults").change(function(){var a=jQuery(this);a.parents(".tg_searchbox").find(".tg_container > form").find(".adults").val(a.val())});jQuery("select.kids").change(function(){var a=jQuery(this);a.parents(".tg_searchbox").find(".tg_container > form").find(".kids").val(a.val())});jQuery("select.seniors").change(function(){var a=jQuery(this);a.parents(".tg_searchbox").find(".tg_container > form").find(".seniors").val(a.val())}); 13 15 jQuery("select.rooms").change(function(){var a=jQuery(this);a.parents(".tg_searchbox").find(".tg_container > form").find(".rooms").val(a.val())}); 14 try{jQuery(".tgsb_addAS , .tgsb_addASH").each(function(){jQuery(this).focus(inputFocus).blur(inputBlur);new AS(this.id,ASoptions)}),jQuery("div.tg_searchbox ul.tg_tabs li span").click(function(){selectedTab=jQuery(this).attr("class").match(/^[a-z]+/);var a=jQuery(this).parents("div.tg_searchbox:eq(0)");a.find("ul.tg_tabs li span").removeClass("sel");a.find("ul.tg_tabs li span."+selectedTab).addClass("sel");a.find("div.tg_container form").removeClass("sel");a.find("div.tg_container form."+selectedTab).addClass("sel")}),15 jQuery("input.tgsb_submit_button").click(function(){alert("Here you can set up how the box should appear inside your post.\nTo see this box in action hit Insert and update your post,\nor visit the demo page of this plugin at:\n"+TG_Searchboxes_Variables.demoPage);return!1}),jQuery(".tg_searchbox form").each(function(){try{var a=jQuery(this).find(".tgsb_addDP");if(1<a.length){var b=a.get(0).id,c=a.get(1).id,a=!1,a=jQuery(this).hasClass("flights")?jQuery(this).find("input[name=oneway], label.radio"): 16 !1;createDatepicker(b,c,a)}}catch(e){"undefined"!=typeof console&&console.log&&console.log("ERROR IN DATEPICKER: "+e.toString())}})}catch(e$$5){"undefined"!=typeof console&&console.log&&console.log("ERROR IN DATEPICKER: "+e$$5.toString())};16 try{jQuery(".tgsb_addAS").each(function(){jQuery(this).focus(inputFocus).blur(inputBlur);new AS(this.id,ASoptions)}),jQuery(".tgsb_addASH").each(function(){jQuery(this).focus(inputFocus).blur(inputBlur);new AS(this.id,hotelASoptions)}),jQuery("div.tg_searchbox ul.tg_tabs li span").click(function(){selectedTab=jQuery(this).attr("class").match(/^[a-z]+/);var a=jQuery(this).parents("div.tg_searchbox:eq(0)");a.find("ul.tg_tabs li span").removeClass("sel");a.find("ul.tg_tabs li span."+selectedTab).addClass("sel"); 17 a.find("div.tg_container form").removeClass("sel");a.find("div.tg_container form."+selectedTab).addClass("sel")}),jQuery("input.tgsb_submit_button").click(function(){alert("Here you can set up how the box should appear inside your post.\nTo see this box in action hit Insert and update your post,\nor visit the demo page of this plugin at:\n"+TG_Searchboxes_Variables.demoPage);return!1}),jQuery(".tg_searchbox form").each(function(){try{var a=jQuery(this).find(".tgsb_addDP");if(1<a.length){var c=a.get(0).id, 18 b=a.get(1).id,a=!1,a=jQuery(this).hasClass("flights")?jQuery(this).find("input[name=oneway], label.radio"):!1;createDatepicker(c,b,a)}}catch(e){"undefined"!=typeof console&&console.log&&console.log("ERROR IN DATEPICKER: "+e.toString())}})}catch(e$$6){"undefined"!=typeof console&&console.log&&console.log("ERROR IN DATEPICKER: "+e$$6.toString())}; -
travel-search/trunk/js/tg_searchboxes_settings.dev.js
r1044744 r1087931 7 7 8 8 var ASoptions = { 9 delay: 175, 10 timeout: 5000, 11 script: TG_Searchboxes_Settings.str_ASAjaxURL, 12 loadingClass: 'tgsb_as_load', 13 className: 'tgsb_as tgsb_asMargin', 14 json: true, 15 frameForIE: true, 16 ajaxParams: { 17 action: '', 18 json: true, 19 lng: 'def', 20 dsgn: 'flg', 21 addtag: 'em', 22 citytype: 'airports', 23 domainPrefix: true 24 }, 25 autoSelect:true, 26 offsety:0, 27 format: function(selLiObj) { 28 return selLiObj.innerHTML.replace(/<\/?[a-z]+>/gi,'').replace(/(.*),(.*)\((.*)\)/,'$1 ($3)'); 29 }, 30 callback:function(asElem,asObj){ 31 var inp = jQuery(asObj.fld); 32 if(inp.hasClass("asFrom")) { 33 inp.parents('.tg_searchbox').find('.tg_container > div:not(.cars)').find('.asFrom').val(inp.val()); 34 }; 35 36 if(inp.hasClass("asTo")) { 37 jQuery(".asTo").val(inp.val()); 38 inp.parents('.tg_searchbox').find('.tg_container > div.cars').find('.asFrom').val(inp.val()); 39 }; 40 } 9 delay: 175, 10 timeout: 5000, 11 script: TG_Searchboxes_Settings.str_ASAjaxURL, 12 loadingClass: 'tgsb_as_load', 13 className: 'tgsb_as tgsb_asMargin', 14 json: true, 15 frameForIE: true, 16 ajaxParams: { 17 action: '', 18 json: true, 19 lng: 'def', 20 dsgn: 'flg', 21 addtag: 'em', 22 citytype: 'airports', 23 domainPrefix: true 24 }, 25 autoSelect:true, 26 offsety:0, 27 format: function(selLiObj) { 28 return selLiObj.innerHTML.replace(/<\/?[a-z]+>/gi,'').replace(/(.*),(.*)\((.*)\)/,'$1 ($3)'); 29 }, 30 callback:function(asElem,asObj){ 31 var inp = jQuery(asObj.fld); 32 if(inp.hasClass("asFrom")) { 33 inp.parents('.tg_searchbox').find('.tg_container > div:not(.cars)').find('.asFrom').val(inp.val()); 34 }; 35 36 if(inp.hasClass("asTo")) { 37 jQuery(".asTo").val(inp.val()); 38 inp.parents('.tg_searchbox').find('.tg_container > div.cars').find('.asFrom').val(inp.val()); 39 }; 40 } 41 42 }; 43 44 var hotelASoptions = { 45 delay: 175, 46 timeout: 5000, 47 script: TG_Searchboxes_Settings.str_ASAjaxURL, 48 loadingClass: 'tgsb_as_load', 49 className: 'tgsb_as tgsb_asMargin', 50 json: true, 51 frameForIE: true, 52 ajaxParams: { 53 action: '', 54 json: true, 55 lng: 'def', 56 dsgn: 'flg', 57 addtag: 'em', 58 citytype: 'cities', 59 domainPrefix: true, 60 nearestAirport: true 61 }, 62 autoSelect:true, 63 offsety:0, 64 format: function(selLiObj) { 65 return selLiObj.innerHTML.replace(/<\/?[^>]+>/gi,'').replace(/(.*),(.*) \((.*)\)/,'$1,$2'); 66 }, 67 callback:function(asElem,asObj){ 68 var inp = jQuery(asObj.fld); 69 if(inp.hasClass("asTo")) { 70 var airport = inp.val(); 71 for(var i=0; i<asElem.attributes.length; i++) { 72 if (asElem.attributes[i].nodeName == 'airport') { 73 var val = asElem.attributes[i].value ? asElem.attributes[i].value : asElem.attributes[i].nodeValue; 74 if (val) { 75 try { 76 var arp = eval('(' + val + ')'); 77 if (arp && arp.city && arp.iata) { 78 airport = arp.city + ' (' + arp.iata + ')'; 79 } 80 } catch(e) {} 81 } 82 } 83 } 84 jQuery(".asTo").not(inp).val(airport); 85 inp.parents('#TB_ajaxContent').find('.tg_container > form.cars').find('.asFrom').val(airport); 86 } 87 } 41 88 42 89 }; … … 248 295 249 296 jQuery(jQuery('#id_referral').get(0)).focus(inputFocus).blur(inputBlur); 250 jQuery(".tgsb_addAS, .tgsb_addASH").each(function(){297 jQuery(".tgsb_addAS").each(function(){ 251 298 // jQuery(this).focus(inputFocus).blur(inputBlur); 252 new AS(this.id,ASoptions); 253 }); 299 new AS(this.id,ASoptions); 300 }); 301 jQuery(".tgsb_addASH").each(function(){ 302 // jQuery(this).focus(inputFocus).blur(inputBlur); 303 new AS(this.id,hotelASoptions); 304 }); 254 305 255 306 jQuery('div.tg_searchbox ul.tg_tabs li span').click(function(){ -
travel-search/trunk/js/tg_searchboxes_settings.min.js
r1044744 r1087931 1 1 var tgsb_departureDate=!1,tgsb_returnDate=!1,ASoptions={delay:175,timeout:5E3,script:TG_Searchboxes_Settings.str_ASAjaxURL,loadingClass:"tgsb_as_load",className:"tgsb_as tgsb_asMargin",json:!0,frameForIE:!0,ajaxParams:{action:"",json:!0,lng:"def",dsgn:"flg",addtag:"em",citytype:"airports",domainPrefix:!0},autoSelect:!0,offsety:0,format:function(a){return a.innerHTML.replace(/<\/?[a-z]+>/gi,"").replace(/(.*),(.*)\((.*)\)/,"$1 ($3)")},callback:function(a,b){var c=jQuery(b.fld);c.hasClass("asFrom")&& 2 c.parents(".tg_searchbox").find(".tg_container > div:not(.cars)").find(".asFrom").val(c.val());c.hasClass("asTo")&&(jQuery(".asTo").val(c.val()),c.parents(".tg_searchbox").find(".tg_container > div.cars").find(".asFrom").val(c.val()))}};function inputFocus(a){this.value==this.defaultValue?this.value="":this.select()}function inputBlur(a){""==this.value&&(this.value=this.defaultValue)} 2 c.parents(".tg_searchbox").find(".tg_container > div:not(.cars)").find(".asFrom").val(c.val());c.hasClass("asTo")&&(jQuery(".asTo").val(c.val()),c.parents(".tg_searchbox").find(".tg_container > div.cars").find(".asFrom").val(c.val()))}},hotelASoptions={delay:175,timeout:5E3,script:TG_Searchboxes_Settings.str_ASAjaxURL,loadingClass:"tgsb_as_load",className:"tgsb_as tgsb_asMargin",json:!0,frameForIE:!0,ajaxParams:{action:"",json:!0,lng:"def",dsgn:"flg",addtag:"em",citytype:"cities",domainPrefix:!0, 3 nearestAirport:!0},autoSelect:!0,offsety:0,format:function(a){return a.innerHTML.replace(/<\/?[^>]+>/gi,"").replace(/(.*),(.*) \((.*)\)/,"$1,$2")},callback:function(a,b){var c=jQuery(b.fld);if(c.hasClass("asTo")){for(var d=c.val(),e=0;e<a.attributes.length;e++)if("airport"==a.attributes[e].nodeName){var h=a.attributes[e].value?a.attributes[e].value:a.attributes[e].nodeValue;if(h)try{var f=eval("("+h+")");f&&f.city&&f.iata&&(d=f.city+" ("+f.iata+")")}catch(g){}}jQuery(".asTo").not(c).val(d);c.parents("#TB_ajaxContent").find(".tg_container > form.cars").find(".asFrom").val(d)}}}; 4 function inputFocus(a){this.value==this.defaultValue?this.value="":this.select()}function inputBlur(a){""==this.value&&(this.value=this.defaultValue)} 3 5 function createDatepicker(a,b,c,d){"function"!=typeof d&&(d=function(){});jQuery("#"+a+", #"+b).each(function(){jQuery(this).datepicker({minDate:0,maxDate:"2y",showOn:"both",buttonImage:TG_Searchboxes_Settings.str_CalendarURL,buttonImageOnly:!0,dateFormat:TG_Searchboxes_Settings.str_dateFormat,onSelect:function(c,e){d1=jQuery(this).datepicker("getDate");if(this.id==a&&(d2=jQuery.datepicker.parseDate(TG_Searchboxes_Settings.str_dateFormat,jQuery("#"+b).val()),jQuery("#"+b).datepicker("option","minDate", 4 d1),d2&&d1>d2)){d2.setTime(d1.getTime()+432E6);jQuery("#"+b).val(jQuery.datepicker.formatDate(TG_Searchboxes_Settings.str_dateFormat,d2));var f=jQuery("#"+b).parents("div.tg_searchbox:eq(0)");f.find("input.retDate").val(jQuery.datepicker.formatDate(TG_Searchboxes_Settings.str_dateFormat,d2))}var g=this.name,f=jQuery(this).parents("div.tg_searchbox:eq(0)");f.find('input[name="'+g+'"]').val(c);d()}})});if("object"==typeof c&&0<c.length){var e=c.get(0).id;c=c.get(1).id;jQuery("#"+c).change(function(){this.checked&&6 d1),d2&&d1>d2)){d2.setTime(d1.getTime()+432E6);jQuery("#"+b).val(jQuery.datepicker.formatDate(TG_Searchboxes_Settings.str_dateFormat,d2));var g=jQuery("#"+b).parents("div.tg_searchbox:eq(0)");g.find("input.retDate").val(jQuery.datepicker.formatDate(TG_Searchboxes_Settings.str_dateFormat,d2))}var k=this.name,g=jQuery(this).parents("div.tg_searchbox:eq(0)");g.find('input[name="'+k+'"]').val(c);d()}})});if("object"==typeof c&&0<c.length){var e=c.get(0).id;c=c.get(1).id;jQuery("#"+c).change(function(){this.checked&& 5 7 (jQuery("#"+b).attr("disabled",!0),d())});jQuery("#"+e).change(function(){this.checked&&(jQuery("#"+b).attr("disabled",!1),d())})}} 6 8 function setTgSBDates(a,b,c,d){if("undefined"==typeof a||!a)return!1;"undefined"==typeof b&&(b=!1);"undefined"==typeof c&&(c=!1);"undefined"==typeof d&&(d=!1);if(!b&&!c&&!d)return!1;if(b)return b=parseInt(b).toString(),"NaN"!=b?new Date(a.getTime()+864E5*parseInt(b)):!1;if(c)return c=parseInt(c).toString(),"NaN"!=c?new Date(a.setMonth(a.getMonth()+parseInt(c))):!1;if(d)return d=parseInt(d).toString(),"NaN"!=d?new Date(a.setFullYear(a.getFullYear()+parseInt(d))):!1} … … 10 12 6));"+1 week"==a&&(tgsb_returnDate=setTgSBDates(tgsb_departureDate,7));"+2 weeks"==a&&(tgsb_returnDate=setTgSBDates(tgsb_departureDate,14));"+3 weeks"==a&&(tgsb_returnDate=setTgSBDates(tgsb_departureDate,21));"+4 weeks"==a&&(tgsb_returnDate=setTgSBDates(tgsb_departureDate,28));"+1 month"==a&&(tgsb_returnDate=setTgSBDates(tgsb_departureDate,!1,1));"+2 months"==a&&(tgsb_returnDate=setTgSBDates(tgsb_departureDate,!1,2));"+3 months"==a&&(tgsb_returnDate=setTgSBDates(tgsb_departureDate,!1,3));"+1 year"== 11 13 a&&(tgsb_returnDate=setTgSBDates(tgsb_departureDate,!1,!1,1));tgsb_returnDate&&jQuery(".tg_searchbox").find("input.retDate").val(jQuery.datepicker.formatDate(TG_Searchboxes_Settings.str_dateFormat,tgsb_returnDate))} 12 jQuery(function(){jQuery(jQuery("#id_referral").get(0)).focus(inputFocus).blur(inputBlur);jQuery(".tgsb_addAS , .tgsb_addASH").each(function(){new AS(this.id,ASoptions)});jQuery("div.tg_searchbox ul.tg_tabs li span").click(function(){selectedTab=jQuery(this).attr("class").match(/^[a-z]+/);var a=jQuery(this).parents("div.tg_searchbox:eq(0)");a.find("ul.tg_tabs li span").removeClass("sel");a.find("ul.tg_tabs li span").attr("style","background-color:"+jQuery("#tbscolor").val()+" !important");a.find("ul.tg_tabs li span."+13 selectedTab).addClass("sel");a.find("ul.tg_tabs li span.sel").attr("style","background-color:"+jQuery("#bgdcolor").val()+" !important");a.find("div.tg_container div").removeClass("sel");a.find("div.tg_container div."+selectedTab).addClass("sel")});jQuery("select.depDate").change(function(){var a=jQuery(this);a.parents(".tg_searchbox").find(".tg_container > div").find(".depDate").val(a.val())});jQuery("select.retDate").change(function(){var a=jQuery(this);a.parents(".tg_searchbox").find(".tg_container > div").find(".retDate").val(a.val())}); 14 jQuery( "select.adults").change(function(){var a=jQuery(this);a.parents(".tg_searchbox").find(".tg_container > div").find(".adults").val(a.val())});jQuery("select.kids").change(function(){var a=jQuery(this);a.parents(".tg_searchbox").find(".tg_container > div").find(".kids").val(a.val())});jQuery("select.seniors").change(function(){var a=jQuery(this);a.parents(".tg_searchbox").find(".tg_container > div").find(".seniors").val(a.val())});jQuery("select.rooms").change(function(){var a=jQuery(this);a.parents(".tg_searchbox").find(".tg_container > div").find(".rooms").val(a.val())});15 jQuery(" img.compareImage").click(function(){alert("Here you can set up the default values the searchboxes will be filled in with.\nTo test how the boxes work add them to your pages or visit the demo page.");return!1});jQuery(".tg_searchbox .tg_container > div").each(function(){var a=jQuery(this);if(!a.hasClass("pwr")){var b=a.find(".tgsb_addDP");if(1<b.length){var c=b.get(0).id,b=b.get(1).id,d=!1,d=a.hasClass("flights")?jQuery(this).find('input[name="tg_searchboxes_options[flights_oneway]"]'):!1;16 createDatepicker(c,b,d)}}});jQuery(".colorSettings span, .colorSettings input").click(function(a){var b=this.className.match(/(i1|i2|i3|i4|i5|i6)$/);if(null==b)return!1;var c=jQuery(this).parents(".colorSettings"),d=c.find("div."+b),e="SPAN"==this.tagName?c.find("input."+b):this;d.css("top","SPAN"==this.tagName?this.offsetTop:c.find("span."+b).get(0).offsetTop);d.css("left","SPAN"==this.tagName?this.offsetLeft:c.find("span."+b).get(0).offsetLeft);jQuery(e).blur(function(){var a=jQuery(e).val();jQuery(e).css("background-color",17 a);setSearchboxColor(e,a);d.addClass("nod")});jQuery.farbtastic(d,function(a){setSearchboxColor(e,a);jQuery(e).val(a);jQuery(e).css("background-color",a)});d.removeClass("nod");a.preventDefault();jQuery(document).mousedown(function(){d.addClass("nod")})});setDepartureDateToForm();setReturnDateToForm();jQuery("#tgsb_departure_date").change(function(){setDepartureDateToForm(this.value);setReturnDateToForm()});jQuery("#tgsb_return_date").change(function(){setDepartureDateToForm();setReturnDateToForm(this.value)});18 jQuery("ul.tgsb_settings li a, a.tgsb_shortcodeGenerator, input.tgsb_shortcodeGenerator").click(function(){var a=this.className.match(/^[a-zA-Z_]+/);jQuery("ul.tgsb_settings li a, ul.tgsb_settings li").removeClass("current");jQuery("ul.tgsb_settings li a."+a).addClass("current");jQuery("ul.tgsb_settings li a."+a).parents("li").addClass("current");jQuery("#tgsb_settings").addClass("nod");jQuery("#tgsb_shortcodeGenerator").addClass("nod");jQuery("#"+a).removeClass("nod");scrollTo(0,0);return!1});jQuery("a.showTravelSearchLink").click(function(){jQuery("div.travelSearchLink").slideToggle("slow");19 return!1})});20 function setSearchboxColor(a,b){jQuery(a).hasClass("i1")&&jQuery(".tg_searchbox .tg_container, .tg_searchbox .tg_tabs li span.sel").each(function(){if(jQuery(this).attr("style")){var a=jQuery(this).attr("style"),a=a.match("border-color:")?a.replace(/border-color:[^\;]+/gi,"border-color: "+b+" !important"):a+(";border-color: "+b+" !important"),a=a.replace(/^;/,"").replace(/;;/,";");jQuery(this).attr("style",a)}else jQuery(this).attr("style","border-color: "+b+" !important")});jQuery(a).hasClass("i2")&& jQuery(".tg_searchbox .tg_container, .tg_searchbox .tg_tabs li span.sel, .tg_searchbox .tg_container label").css("color",21 b);jQuery(a).hasClass("i3")&&jQuery(".tg_searchbox .tg_container, .tg_searchbox .tg_tabs li span.sel").each(function(){if(jQuery(this).attr("style")){var a=jQuery(this).attr("style"),a=a.match("background-color:")?a.replace(/background-color:[^\;]+/gi,"background-color: "+b+" !important"):a+(";background-color: "+b+" !important"),a=a.replace(/^;/,"").replace(/;;/,";");jQuery(this).attr("style",a)}else jQuery(this).attr("style","background-color: "+b+" !important")});if(jQuery(a).hasClass("i4")){var c= 22 jQuery(".tg_searchbox .tg_tabs li span").not(".sel");if("undefined"==typeof c.attr("style"))c.attr("style","background-color: "+b+" !important");else{var d=c.attr("style"),d=d.match("background-color:")?d.replace(/background-color:[^\;]+/gi,"background-color: "+b+" !important"):d+(";background-color: "+b+" !important"),d=d.replace(/^;/,"").replace(/;;/,";");c.attr("style",d)}}jQuery(a).hasClass("i5")&&jQuery(".tg_searchbox .tg_tabs li span").not(".sel").css("color",b);jQuery(a).hasClass("i6")&&(c= 23 jQuery(".tg_searchbox .tg_tabs li span").not(".sel") ,"undefined"==typeof c.attr("style")?c.attr("style","border-color: "+b+" !important"):(d=c.attr("style"),d=d.match("border-color:")?d.replace(/border-color:[^\;]+/gi,"border-color: "+b+" !important"):d+(";border-color: "+b+" !important"),d=d.replace(/^;/,"").replace(/;;/,";"),c.attr("style",d)))};14 jQuery(function(){jQuery(jQuery("#id_referral").get(0)).focus(inputFocus).blur(inputBlur);jQuery(".tgsb_addAS").each(function(){new AS(this.id,ASoptions)});jQuery(".tgsb_addASH").each(function(){new AS(this.id,hotelASoptions)});jQuery("div.tg_searchbox ul.tg_tabs li span").click(function(){selectedTab=jQuery(this).attr("class").match(/^[a-z]+/);var a=jQuery(this).parents("div.tg_searchbox:eq(0)");a.find("ul.tg_tabs li span").removeClass("sel");a.find("ul.tg_tabs li span").attr("style","background-color:"+ 15 jQuery("#tbscolor").val()+" !important");a.find("ul.tg_tabs li span."+selectedTab).addClass("sel");a.find("ul.tg_tabs li span.sel").attr("style","background-color:"+jQuery("#bgdcolor").val()+" !important");a.find("div.tg_container div").removeClass("sel");a.find("div.tg_container div."+selectedTab).addClass("sel")});jQuery("select.depDate").change(function(){var a=jQuery(this);a.parents(".tg_searchbox").find(".tg_container > div").find(".depDate").val(a.val())});jQuery("select.retDate").change(function(){var a= 16 jQuery(this);a.parents(".tg_searchbox").find(".tg_container > div").find(".retDate").val(a.val())});jQuery("select.adults").change(function(){var a=jQuery(this);a.parents(".tg_searchbox").find(".tg_container > div").find(".adults").val(a.val())});jQuery("select.kids").change(function(){var a=jQuery(this);a.parents(".tg_searchbox").find(".tg_container > div").find(".kids").val(a.val())});jQuery("select.seniors").change(function(){var a=jQuery(this);a.parents(".tg_searchbox").find(".tg_container > div").find(".seniors").val(a.val())}); 17 jQuery("select.rooms").change(function(){var a=jQuery(this);a.parents(".tg_searchbox").find(".tg_container > div").find(".rooms").val(a.val())});jQuery("img.compareImage").click(function(){alert("Here you can set up the default values the searchboxes will be filled in with.\nTo test how the boxes work add them to your pages or visit the demo page.");return!1});jQuery(".tg_searchbox .tg_container > div").each(function(){var a=jQuery(this);if(!a.hasClass("pwr")){var b=a.find(".tgsb_addDP");if(1<b.length){var c= 18 b.get(0).id,b=b.get(1).id,d=!1,d=a.hasClass("flights")?jQuery(this).find('input[name="tg_searchboxes_options[flights_oneway]"]'):!1;createDatepicker(c,b,d)}}});jQuery(".colorSettings span, .colorSettings input").click(function(a){var b=this.className.match(/(i1|i2|i3|i4|i5|i6)$/);if(null==b)return!1;var c=jQuery(this).parents(".colorSettings"),d=c.find("div."+b),e="SPAN"==this.tagName?c.find("input."+b):this;d.css("top","SPAN"==this.tagName?this.offsetTop:c.find("span."+b).get(0).offsetTop);d.css("left", 19 "SPAN"==this.tagName?this.offsetLeft:c.find("span."+b).get(0).offsetLeft);jQuery(e).blur(function(){var a=jQuery(e).val();jQuery(e).css("background-color",a);setSearchboxColor(e,a);d.addClass("nod")});jQuery.farbtastic(d,function(a){setSearchboxColor(e,a);jQuery(e).val(a);jQuery(e).css("background-color",a)});d.removeClass("nod");a.preventDefault();jQuery(document).mousedown(function(){d.addClass("nod")})});setDepartureDateToForm();setReturnDateToForm();jQuery("#tgsb_departure_date").change(function(){setDepartureDateToForm(this.value); 20 setReturnDateToForm()});jQuery("#tgsb_return_date").change(function(){setDepartureDateToForm();setReturnDateToForm(this.value)});jQuery("ul.tgsb_settings li a, a.tgsb_shortcodeGenerator, input.tgsb_shortcodeGenerator").click(function(){var a=this.className.match(/^[a-zA-Z_]+/);jQuery("ul.tgsb_settings li a, ul.tgsb_settings li").removeClass("current");jQuery("ul.tgsb_settings li a."+a).addClass("current");jQuery("ul.tgsb_settings li a."+a).parents("li").addClass("current");jQuery("#tgsb_settings").addClass("nod"); 21 jQuery("#tgsb_shortcodeGenerator").addClass("nod");jQuery("#"+a).removeClass("nod");scrollTo(0,0);return!1});jQuery("a.showTravelSearchLink").click(function(){jQuery("div.travelSearchLink").slideToggle("slow");return!1})}); 22 function setSearchboxColor(a,b){jQuery(a).hasClass("i1")&&jQuery(".tg_searchbox .tg_container, .tg_searchbox .tg_tabs li span.sel").each(function(){if(jQuery(this).attr("style")){var a=jQuery(this).attr("style"),a=a.match("border-color:")?a.replace(/border-color:[^\;]+/gi,"border-color: "+b+" !important"):a+(";border-color: "+b+" !important"),a=a.replace(/^;/,"").replace(/;;/,";");jQuery(this).attr("style",a)}else jQuery(this).attr("style","border-color: "+b+" !important")});jQuery(a).hasClass("i2")&& 23 jQuery(".tg_searchbox .tg_container, .tg_searchbox .tg_tabs li span.sel, .tg_searchbox .tg_container label").css("color",b);jQuery(a).hasClass("i3")&&jQuery(".tg_searchbox .tg_container, .tg_searchbox .tg_tabs li span.sel").each(function(){if(jQuery(this).attr("style")){var a=jQuery(this).attr("style"),a=a.match("background-color:")?a.replace(/background-color:[^\;]+/gi,"background-color: "+b+" !important"):a+(";background-color: "+b+" !important"),a=a.replace(/^;/,"").replace(/;;/,";");jQuery(this).attr("style", 24 a)}else jQuery(this).attr("style","background-color: "+b+" !important")});if(jQuery(a).hasClass("i4")){var c=jQuery(".tg_searchbox .tg_tabs li span").not(".sel");if("undefined"==typeof c.attr("style"))c.attr("style","background-color: "+b+" !important");else{var d=c.attr("style"),d=d.match("background-color:")?d.replace(/background-color:[^\;]+/gi,"background-color: "+b+" !important"):d+(";background-color: "+b+" !important"),d=d.replace(/^;/,"").replace(/;;/,";");c.attr("style",d)}}jQuery(a).hasClass("i5")&& 25 jQuery(".tg_searchbox .tg_tabs li span").not(".sel").css("color",b);jQuery(a).hasClass("i6")&&(c=jQuery(".tg_searchbox .tg_tabs li span").not(".sel"),"undefined"==typeof c.attr("style")?c.attr("style","border-color: "+b+" !important"):(d=c.attr("style"),d=d.match("border-color:")?d.replace(/border-color:[^\;]+/gi,"border-color: "+b+" !important"):d+(";border-color: "+b+" !important"),d=d.replace(/^;/,"").replace(/;;/,";"),c.attr("style",d)))}; -
travel-search/trunk/js/tg_searchboxes_shortcodes.dev.js
r1044744 r1087931 12 12 if(typeof(serializedFieldsArray) == 'undefined' || serializedFieldsArray.length == 0) 13 13 return ''; 14 returnValue = '';14 var returnValue = ''; 15 15 jQuery.each(serializedFieldsArray, function(i, field){ 16 16 // checking for the "from" field and it's value in the serialized array … … 31 31 if(typeof(serializedFieldsArray) == 'undefined' || serializedFieldsArray.length == 0) 32 32 return ''; 33 returnValue = '';33 var returnValue = ''; 34 34 jQuery.each(serializedFieldsArray, function(i, field){ 35 35 // checking for the "to" field and it's value in the serialized array … … 45 45 return returnValue; 46 46 }; 47 48 function tgsbHotelCity(serializedFieldsArray) { 49 // if the serialized array is not defined or it's length is 0 the return an empty string 50 if(typeof(serializedFieldsArray) == 'undefined' || serializedFieldsArray.length == 0) 51 return ''; 52 var returnValue = ''; 53 jQuery.each(serializedFieldsArray, function(i, field){ 54 // checking for the "to" field and it's value in the serialized array 55 if(field.name == 'tgsbToAir' && jQuery(field).parents('form.hotels').length>0) { 56 // if the "to" field was found 57 if(field.value != TG_Searchboxes_Variables.tgsbDefaultSettings.hotel_city) { 58 // if it's value it's not equal to the default value set it as a return value 59 returnValue = '"hotel_city":"'+field.value+'"'; 60 return; 61 } 62 } 63 }); 64 return returnValue; 65 } 66 47 67 // getting the "departure date" field form the serialized array 48 68 function tgsbDepartureDate(serializedFieldsArray) { … … 50 70 if(typeof(serializedFieldsArray) == 'undefined' || serializedFieldsArray.length == 0) 51 71 return ''; 52 returnValue = '';72 var returnValue = ''; 53 73 jQuery.each(serializedFieldsArray, function(i, field){ 54 74 // checking for the "departure date" field and it's value in the serialized array … … 69 89 if(typeof(serializedFieldsArray) == 'undefined' || serializedFieldsArray.length == 0) 70 90 return ''; 71 returnValue = '';91 var returnValue = ''; 72 92 jQuery.each(serializedFieldsArray, function(i, field){ 73 93 // checking for the "return date" field and it's value in the serialized array … … 87 107 if(typeof(serializedFieldsArray) == 'undefined' || serializedFieldsArray.length == 0) 88 108 return ''; 89 returnValue = '';109 var returnValue = ''; 90 110 jQuery.each(serializedFieldsArray, function(i, field){ 91 111 // checking for the "adults" field and it's value in the serialized array … … 106 126 if(typeof(serializedFieldsArray) == 'undefined' || serializedFieldsArray.length == 0) 107 127 return ''; 108 returnValue = '';128 var returnValue = ''; 109 129 jQuery.each(serializedFieldsArray, function(i, field){ 110 130 // checking for the "kids" field and it's value in the serialized array … … 125 145 if(typeof(serializedFieldsArray) == 'undefined' || serializedFieldsArray.length == 0) 126 146 return ''; 127 returnValue = '';147 var returnValue = ''; 128 148 jQuery.each(serializedFieldsArray, function(i, field){ 129 149 // checking for the "seniors" field and it's value in the serialized array … … 144 164 if(typeof(serializedFieldsArray) == 'undefined' || serializedFieldsArray.length == 0) 145 165 return ''; 146 returnValue = '';166 var returnValue = ''; 147 167 jQuery.each(serializedFieldsArray, function(i, field){ 148 168 // checking for the "rooms" field and it's value in the serialized array … … 163 183 if(typeof(serializedFieldsArray) == 'undefined' || serializedFieldsArray.length == 0) 164 184 return ''; 165 returnValue = '';185 var returnValue = ''; 166 186 jQuery.each(serializedFieldsArray, function(i, field){ 167 187 // checking for the "rooms" field and it's value in the serialized array … … 203 223 tgSearchboxMeasures = (tgSearchboxMeasures.length == 0) ? '300x250' : tgSearchboxMeasures; 204 224 var selectedTab = jQuery('#tgsb_shortcodeGenerator .sb'+tgSearchboxMeasures+' .tg_searchbox .tg_container').find('form.sel').attr('class').match(/^(flights|hotels|cars|packages|cruises)/); 205 var fields = jQuery('#tgsb_shortcodeGenerator .sb'+tgSearchboxMeasures+' .tg_searchbox .tg_container form').serializeArray(); 225 var fields = []; 226 jQuery('.sb'+tgSearchboxMeasures+' .tg_searchbox .tg_container form').find("input, select, textarea").each(function(){ 227 fields.push({ 228 name: this.name, 229 value: this.value, 230 obj: this 231 }); 232 }); 206 233 // Tibi | 2013.04.23 | checking if we have to set the flag that marks that we have to use JS load for the JS 207 234 var loadFromJS = jQuery('#tgsb_shortcodeGenerator #travelSearchShortcodeUseJavaScript').attr('checked'); 208 235 var optionsString = ''; 209 236 // getting the "from" value 210 tgsb_fromAir = tgsbFromAir(fields);237 var tgsb_fromAir = tgsbFromAir(fields); 211 238 // adding the "from" value to the options string 212 optionsString += (tgsb_fromAir.length) ? tgsb_fromAir+',' : tgsb_fromAir;239 optionsString += (tgsb_fromAir.length) ? tgsb_fromAir+',' : ''; 213 240 // getting the "to" value 214 tgsb_toAir = tgsbToAir(fields);241 var tgsb_toAir = tgsbToAir(fields); 215 242 // adding the "to" value to the options string 216 optionsString += (tgsb_toAir.length) ? tgsb_toAir+',' : tgsb_toAir; 243 optionsString += (tgsb_toAir.length) ? tgsb_toAir+',' : ''; 244 // getting the "to" value 245 var tgsb_hotelCity = tgsbHotelCity(fields); 246 // adding the "to" value to the options string 247 optionsString += (tgsb_hotelCity.length) ? tgsb_hotelCity+',' : ''; 217 248 // getting the "departure date" value 218 tgsb_departureDate = tgsbDepartureDate(fields);249 var tgsb_departureDate = tgsbDepartureDate(fields); 219 250 // adding the "departure date" value to the options string 220 optionsString += (tgsb_departureDate.length) ? tgsb_departureDate+',' : tgsb_departureDate;251 optionsString += (tgsb_departureDate.length) ? tgsb_departureDate+',' : ''; 221 252 // getting the "return date" value 222 tgsb_returnDate = tgsbReturnDate(fields);253 var tgsb_returnDate = tgsbReturnDate(fields); 223 254 // adding the "return date" value to the options string 224 optionsString += (tgsb_returnDate.length) ? tgsb_returnDate+',' : tgsb_returnDate;255 optionsString += (tgsb_returnDate.length) ? tgsb_returnDate+',' : ''; 225 256 // getting the "adults" value 226 tgsb_adults = tgsbAdults(fields);257 var tgsb_adults = tgsbAdults(fields); 227 258 // adding the "adults" value to the options string 228 optionsString += (tgsb_adults.length) ? tgsb_adults+',' : tgsb_adults;259 optionsString += (tgsb_adults.length) ? tgsb_adults+',' : ''; 229 260 // getting the "kids" value 230 tgsb_kids = tgsbKids(fields);261 var tgsb_kids = tgsbKids(fields); 231 262 // adding the "kids" value to the options string 232 optionsString += (tgsb_kids.length) ? tgsb_kids+',' : tgsb_kids;263 optionsString += (tgsb_kids.length) ? tgsb_kids+',' : ''; 233 264 // getting the "seniors" value 234 tgsb_seniors = tgsbSeniors(fields);265 var tgsb_seniors = tgsbSeniors(fields); 235 266 // adding the "seniors" value to the options string 236 optionsString += (tgsb_seniors.length) ? tgsb_seniors+',' : tgsb_seniors;267 optionsString += (tgsb_seniors.length) ? tgsb_seniors+',' : ''; 237 268 // getting the "rooms" value 238 tgsb_rooms = tgsbRooms(fields);269 var tgsb_rooms = tgsbRooms(fields); 239 270 // adding the "seniors" value to the options string 240 optionsString += (tgsb_rooms.length) ? tgsb_rooms+',' : tgsb_rooms;271 optionsString += (tgsb_rooms.length) ? tgsb_rooms+',' : ''; 241 272 // getting the "roundtrip/oneway" value 242 tgsb_rtow = tgsbRTOW(fields);273 var tgsb_rtow = tgsbRTOW(fields); 243 274 // adding the "roundtrip/oneway" value to the options string 244 optionsString += (tgsb_rtow.length) ? tgsb_rtow+',' : tgsb_rtow;275 optionsString += (tgsb_rtow.length) ? tgsb_rtow+',' : ''; 245 276 // adding the cruises parameters to the options string 246 277 optionsString += tgsbCruises(fields); -
travel-search/trunk/js/tg_searchboxes_shortcodes.min.js
r1044744 r1087931 1 1 "undefined"!=typeof TG_Searchboxes_Variables&&"undefined"!=typeof TG_Searchboxes_Variables.tgsbDefaultSettings&&(TG_Searchboxes_Variables.tgsbDefaultSettings.match(/^\{\"\;/)&&(TG_Searchboxes_Variables.tgsbDefaultSettings=TG_Searchboxes_Variables.tgsbDefaultSettings.replace(/\"\;/ig,'"')),TG_Searchboxes_Variables.tgsbDefaultSettings=eval("("+TG_Searchboxes_Variables.tgsbDefaultSettings+")")); 2 function tgsbFromAir(a){if("undefined"==typeof a||0==a.length)return"";returnValue="";jQuery.each(a,function(a,b){"tgsbFromAir"==b.name&&b.value!=TG_Searchboxes_Variables.tgsbDefaultSettings.from_air&&(returnValue='"from_air":"'+b.value+'"')});return returnValue} 3 function tgsbToAir(a){if("undefined"==typeof a||0==a.length)return"";returnValue="";jQuery.each(a,function(a,b){"tgsbToAir"==b.name&&b.value!=TG_Searchboxes_Variables.tgsbDefaultSettings.to_air&&(returnValue='"to_air":"'+b.value+'"')});return returnValue} 4 function tgsbDepartureDate(a){if("undefined"==typeof a||0==a.length)return"";returnValue="";jQuery.each(a,function(a,b){"tgsbDepartureDate"==b.name&&b.value!=TG_Searchboxes_Variables.tgsbDefaultSettings.departure_date&&(returnValue='"departure_date":"'+b.value+'"')});return returnValue} 5 function tgsbReturnDate(a){if("undefined"==typeof a||0==a.length)return"";returnValue="";jQuery.each(a,function(a,b){"tgsbReturnDate"==b.name&&b.value!=TG_Searchboxes_Variables.tgsbDefaultSettings.return_date&&(returnValue='"return_date":"'+b.value+'"')});return returnValue} 6 function tgsbAdults(a){if("undefined"==typeof a||0==a.length)return"";returnValue="";jQuery.each(a,function(a,b){"tgsbAdults"==b.name&&b.value!=TG_Searchboxes_Variables.tgsbDefaultSettings.adults&&(returnValue='"adults":"'+b.value+'"')});return returnValue} 7 function tgsbKids(a){if("undefined"==typeof a||0==a.length)return"";returnValue="";jQuery.each(a,function(a,b){"tgsbKids"==b.name&&b.value!=TG_Searchboxes_Variables.tgsbDefaultSettings.kids&&(returnValue='"kids":"'+b.value+'"')});return returnValue} 8 function tgsbSeniors(a){if("undefined"==typeof a||0==a.length)return"";returnValue="";jQuery.each(a,function(a,b){"tgsbSeniors"==b.name&&b.value!=TG_Searchboxes_Variables.tgsbDefaultSettings.seniors&&(returnValue='"seniors":"'+b.value+'"')});return returnValue} 9 function tgsbRooms(a){if("undefined"==typeof a||0==a.length)return"";returnValue="";jQuery.each(a,function(a,b){"tgsbRooms"==b.name&&b.value!=TG_Searchboxes_Variables.tgsbDefaultSettings.rooms&&(returnValue='"rooms":"'+b.value+'"')});return returnValue} 10 function tgsbRTOW(a){if("undefined"==typeof a||0==a.length)return"";returnValue="";jQuery.each(a,function(a,b){"oneway"==b.name&&(b.value="on"==b.value?!0:!1,b.value!=TG_Searchboxes_Variables.tgsbDefaultSettings.rtow&&(returnValue='"rtow":"'+b.value+'"'))});return returnValue} 11 function tgsbCruises(a){var d="";jQuery.each(a,function(a,e){!e.value||e.value==TG_Searchboxes_Variables.tgsbDefaultSettings[e.name]||"cruiseline"!=e.name&&"length_of_stay"!=e.name&&"destination"!=e.name&&"month_year"!=e.name||(d+='"'+e.name+'":"'+e.value+'",')});return d} 12 function generateShortcode(){var a=jQuery("#tgsb_shortcodeGenerator ul.measuresChooser li a.current").text(),a=0==a.length?"300x250":a,d=jQuery("#tgsb_shortcodeGenerator .sb"+a+" .tg_searchbox .tg_container").find("form.sel").attr("class").match(/^(flights|hotels|cars|packages|cruises)/),b=jQuery("#tgsb_shortcodeGenerator .sb"+a+" .tg_searchbox .tg_container form").serializeArray(),e=jQuery("#tgsb_shortcodeGenerator #travelSearchShortcodeUseJavaScript").attr("checked"),c="";tgsb_fromAir=tgsbFromAir(b); 13 c+=tgsb_fromAir.length?tgsb_fromAir+",":tgsb_fromAir;tgsb_toAir=tgsbToAir(b);c+=tgsb_toAir.length?tgsb_toAir+",":tgsb_toAir;tgsb_departureDate=tgsbDepartureDate(b);c+=tgsb_departureDate.length?tgsb_departureDate+",":tgsb_departureDate;tgsb_returnDate=tgsbReturnDate(b);c+=tgsb_returnDate.length?tgsb_returnDate+",":tgsb_returnDate;tgsb_adults=tgsbAdults(b);c+=tgsb_adults.length?tgsb_adults+",":tgsb_adults;tgsb_kids=tgsbKids(b);c+=tgsb_kids.length?tgsb_kids+",":tgsb_kids;tgsb_seniors=tgsbSeniors(b); 14 c+=tgsb_seniors.length?tgsb_seniors+",":tgsb_seniors;tgsb_rooms=tgsbRooms(b);c+=tgsb_rooms.length?tgsb_rooms+",":tgsb_rooms;tgsb_rtow=tgsbRTOW(b);c+=tgsb_rtow.length?tgsb_rtow+",":tgsb_rtow;c+=tgsbCruises(b);c=c+(e?'"usejavascript":"on",':"")+("300x250"==a?"":'"size":"'+a+'",');c+=null==d?'"selectedTab":"flights"':"flights"==d[1]?"":'"selectedTab":"'+d[1]+'"';c.match(/\,$/)&&(c=c.replace(/\,$/,""));a="[tg_searchboxes"+(c.length?" options='{"+c+"}']":"]");"undefined"!=typeof a&&a.length&&(jQuery("#tgsb_shortcodeGenerator #tgsb_shortcode").val(a), 15 jQuery("#tgsb_shortcodeGenerator #tgsb_shortcode_php").val("<?php echo do_shortcode('"+a.replace(/\'/g,"\\'")+"'); ?>"));return!0} 16 var ASoptionsShortcodes={delay:175,timeout:5E3,script:TG_Searchboxes_Variables.str_ASAjaxURL,loadingClass:"tgsb_as_load",className:"tgsb_as tgsb_asMargin",json:!0,frameForIE:!0,ajaxParams:{action:"",json:!0,lng:"def",dsgn:"flg",addtag:"em",citytype:"airports",maxResults:10,domainPrefix:!0},autoSelect:!0,offsety:0,format:function(a){return a.innerHTML.replace(/<\/?[a-z]+>/gi,"").replace(/(.*),(.*)\((.*)\)/,"$1 ($3)")},callback:function(a,d){var b=jQuery(d.fld);b.hasClass("asFrom")&&(jQuery("#tgsb_shortcodeGenerator .asFrom").val(b.val()), 17 b.parents("#tgsb_shortcodeGenerator").find(".tg_container > form.cars").find(".asFrom").val(""));b.hasClass("asTo")&&(jQuery("#tgsb_shortcodeGenerator .asTo").val(b.val()),b.parents("#tgsb_shortcodeGenerator").find(".tg_container > form.cars").find(".asFrom").val(b.val()));generateShortcode()}}; 2 function tgsbFromAir(a){if("undefined"==typeof a||0==a.length)return"";var c="";jQuery.each(a,function(a,b){"tgsbFromAir"==b.name&&b.value!=TG_Searchboxes_Variables.tgsbDefaultSettings.from_air&&(c='"from_air":"'+b.value+'"')});return c}function tgsbToAir(a){if("undefined"==typeof a||0==a.length)return"";var c="";jQuery.each(a,function(a,b){"tgsbToAir"==b.name&&b.value!=TG_Searchboxes_Variables.tgsbDefaultSettings.to_air&&(c='"to_air":"'+b.value+'"')});return c} 3 function tgsbHotelCity(a){if("undefined"==typeof a||0==a.length)return"";var c="";jQuery.each(a,function(a,b){"tgsbToAir"==b.name&&0<jQuery(b).parents("form.hotels").length&&b.value!=TG_Searchboxes_Variables.tgsbDefaultSettings.hotel_city&&(c='"hotel_city":"'+b.value+'"')});return c} 4 function tgsbDepartureDate(a){if("undefined"==typeof a||0==a.length)return"";var c="";jQuery.each(a,function(a,b){"tgsbDepartureDate"==b.name&&b.value!=TG_Searchboxes_Variables.tgsbDefaultSettings.departure_date&&(c='"departure_date":"'+b.value+'"')});return c} 5 function tgsbReturnDate(a){if("undefined"==typeof a||0==a.length)return"";var c="";jQuery.each(a,function(a,b){"tgsbReturnDate"==b.name&&b.value!=TG_Searchboxes_Variables.tgsbDefaultSettings.return_date&&(c='"return_date":"'+b.value+'"')});return c}function tgsbAdults(a){if("undefined"==typeof a||0==a.length)return"";var c="";jQuery.each(a,function(a,b){"tgsbAdults"==b.name&&b.value!=TG_Searchboxes_Variables.tgsbDefaultSettings.adults&&(c='"adults":"'+b.value+'"')});return c} 6 function tgsbKids(a){if("undefined"==typeof a||0==a.length)return"";var c="";jQuery.each(a,function(a,b){"tgsbKids"==b.name&&b.value!=TG_Searchboxes_Variables.tgsbDefaultSettings.kids&&(c='"kids":"'+b.value+'"')});return c}function tgsbSeniors(a){if("undefined"==typeof a||0==a.length)return"";var c="";jQuery.each(a,function(a,b){"tgsbSeniors"==b.name&&b.value!=TG_Searchboxes_Variables.tgsbDefaultSettings.seniors&&(c='"seniors":"'+b.value+'"')});return c} 7 function tgsbRooms(a){if("undefined"==typeof a||0==a.length)return"";var c="";jQuery.each(a,function(a,b){"tgsbRooms"==b.name&&b.value!=TG_Searchboxes_Variables.tgsbDefaultSettings.rooms&&(c='"rooms":"'+b.value+'"')});return c}function tgsbRTOW(a){if("undefined"==typeof a||0==a.length)return"";var c="";jQuery.each(a,function(a,b){"oneway"==b.name&&(b.value="on"==b.value?!0:!1,b.value!=TG_Searchboxes_Variables.tgsbDefaultSettings.rtow&&(c='"rtow":"'+b.value+'"'))});return c} 8 function tgsbCruises(a){var c="";jQuery.each(a,function(a,b){!b.value||b.value==TG_Searchboxes_Variables.tgsbDefaultSettings[b.name]||"cruiseline"!=b.name&&"length_of_stay"!=b.name&&"destination"!=b.name&&"month_year"!=b.name||(c+='"'+b.name+'":"'+b.value+'",')});return c} 9 function generateShortcode(){var a=jQuery("#tgsb_shortcodeGenerator ul.measuresChooser li a.current").text(),a=0==a.length?"300x250":a,c=jQuery("#tgsb_shortcodeGenerator .sb"+a+" .tg_searchbox .tg_container").find("form.sel").attr("class").match(/^(flights|hotels|cars|packages|cruises)/),f=[];jQuery(".sb"+a+" .tg_searchbox .tg_container form").find("input, select, textarea").each(function(){f.push({name:this.name,value:this.value,obj:this})});var b=jQuery("#tgsb_shortcodeGenerator #travelSearchShortcodeUseJavaScript").attr("checked"), 10 d="",e=tgsbFromAir(f),d=d+(e.length?e+",":""),e=tgsbToAir(f),d=d+(e.length?e+",":""),e=tgsbHotelCity(f),d=d+(e.length?e+",":""),e=tgsbDepartureDate(f),d=d+(e.length?e+",":""),e=tgsbReturnDate(f),d=d+(e.length?e+",":""),e=tgsbAdults(f),d=d+(e.length?e+",":""),e=tgsbKids(f),d=d+(e.length?e+",":""),e=tgsbSeniors(f),d=d+(e.length?e+",":""),e=tgsbRooms(f),d=d+(e.length?e+",":""),e=tgsbRTOW(f),d=d+(e.length?e+",":""),d=d+tgsbCruises(f),d=d+(b?'"usejavascript":"on",':"")+("300x250"==a?"":'"size":"'+a+'",'), 11 d=d+(null==c?'"selectedTab":"flights"':"flights"==c[1]?"":'"selectedTab":"'+c[1]+'"');d.match(/\,$/)&&(d=d.replace(/\,$/,""));a="[tg_searchboxes"+(d.length?" options='{"+d+"}']":"]");"undefined"!=typeof a&&a.length&&(jQuery("#tgsb_shortcodeGenerator #tgsb_shortcode").val(a),jQuery("#tgsb_shortcodeGenerator #tgsb_shortcode_php").val("<?php echo do_shortcode('"+a.replace(/\'/g,"\\'")+"'); ?>"));return!0} 12 var ASoptionsShortcodes={delay:175,timeout:5E3,script:TG_Searchboxes_Variables.str_ASAjaxURL,loadingClass:"tgsb_as_load",className:"tgsb_as tgsb_asMargin",json:!0,frameForIE:!0,ajaxParams:{action:"",json:!0,lng:"def",dsgn:"flg",addtag:"em",citytype:"airports",maxResults:10,domainPrefix:!0},autoSelect:!0,offsety:0,format:function(a){return a.innerHTML.replace(/<\/?[a-z]+>/gi,"").replace(/(.*),(.*)\((.*)\)/,"$1 ($3)")},callback:function(a,c){var f=jQuery(c.fld);f.hasClass("asFrom")&&(jQuery("#tgsb_shortcodeGenerator .asFrom").val(f.val()), 13 f.parents("#tgsb_shortcodeGenerator").find(".tg_container > form.cars").find(".asFrom").val(""));f.hasClass("asTo")&&(jQuery("#tgsb_shortcodeGenerator .asTo").val(f.val()),f.parents("#tgsb_shortcodeGenerator").find(".tg_container > form.cars").find(".asFrom").val(f.val()));generateShortcode()}}; 18 14 jQuery(function(){jQuery("#tgsb_shortcodeGenerator ul.measuresChooser li a").click(function(){measureChoosed=jQuery(this).text();jQuery("#tgsb_shortcodeGenerator ul.measuresChooser li a").removeClass("current");jQuery(this).addClass("current");jQuery("div.tgsb").removeClass("crnt");jQuery("div.sb"+measureChoosed).addClass("crnt");generateShortcode();return!1});jQuery("#tgsb_shortcodeGenerator div.tg_searchbox ul.tg_tabs li span").click(function(){selectedTab=jQuery(this).attr("class").match(/^[a-z]+/); 19 15 var a=jQuery(this).parents("div.tg_searchbox:eq(0)");a.find("ul.tg_tabs li span").removeClass("sel");a.find("ul.tg_tabs li span."+selectedTab).addClass("sel");a.find("div.tg_container form").removeClass("sel");a.find("div.tg_container form."+selectedTab).addClass("sel");generateShortcode();return!1});jQuery("#tgsb_shortcodeGenerator input.tgsb_submit_button").click(function(){alert("Here you can set up how the box should appear inside your post.\nTo see this box in action hit Insert and update your post,\nor visit the demo page of this plugin at:\n"+ 20 16 TG_Searchboxes_Variables.demoPage);return!1});jQuery("#tgsb_shortcodeGenerator select.adults").change(function(){var a=jQuery(this);a.parents(".tg_searchbox").find(".tg_container > form").find(".adults").val(a.val());generateShortcode()});jQuery("#tgsb_shortcodeGenerator select.kids").change(function(){var a=jQuery(this);a.parents(".tg_searchbox").find(".tg_container > form").find(".kids").val(a.val());generateShortcode()});jQuery("#tgsb_shortcodeGenerator select.seniors").change(function(){var a= 21 17 jQuery(this);a.parents(".tg_searchbox").find(".tg_container > form").find(".seniors").val(a.val());generateShortcode()});jQuery("#tgsb_shortcodeGenerator select.rooms").change(function(){var a=jQuery(this);a.parents(".tg_searchbox").find(".tg_container > form").find(".rooms").val(a.val());generateShortcode()});jQuery("#tgsb_shortcodeGenerator .tgsb_addAS, #tgsb_shortcodeGenerator .tgsb_addASH").each(function(){jQuery(this).focus(inputFocus).blur(inputBlur);new AS(this.id,ASoptionsShortcodes)});jQuery("#tgsb_shortcodeGenerator .tg_searchbox form").each(function(){var a= 22 jQuery(this).find(".tgsb_addDP");if(1<a.length){var d=a.get(0).id,a=a.get(1).id,b=!1,b=jQuery(this).hasClass("flights")?jQuery(this).find("input[name=oneway]"):!1;createDatepicker(d,a,b,generateShortcode)}});jQuery("#tgsb_shortcodeGenerator select.cruises").change(function(){generateShortcode()});jQuery("#travelSearchShortcodeUseJavaScript").click(generateShortcode)});18 jQuery(this).find(".tgsb_addDP");if(1<a.length){var c=a.get(0).id,a=a.get(1).id,f=!1,f=jQuery(this).hasClass("flights")?jQuery(this).find("input[name=oneway]"):!1;createDatepicker(c,a,f,generateShortcode)}});jQuery("#tgsb_shortcodeGenerator select.cruises").change(function(){generateShortcode()});jQuery("#travelSearchShortcodeUseJavaScript").click(generateShortcode)}); -
travel-search/trunk/readme.txt
r1071694 r1087931 4 4 Tags: travel, search, flights, airfares, hotel, hotel rooms, car rentals, vacations, holiday, vacation packages, deals, airfare tickets, plugin, affiliate, travel widget 5 5 Requires at least: 3.1 6 Tested up to: 4. 0.16 Tested up to: 4.1 7 7 Stable tag: 1.4.1 8 8 … … 109 109 == Changelog == 110 110 111 = 1.4.2 = 112 * Hotel searchbox can get as default value other than cities with airport as well 113 111 114 = 1.4.1 = 112 115 * Some Notice-level errors were fixed -
travel-search/trunk/travel-search.php
r1044744 r1087931 4 4 Plugin URI: http://labs.travelgrove.com/plugins/travel-search/ 5 5 Description: Travel Search Plugin by Travelgrove allows you to add Flights, Hotels, Vacations and Car Rentals searchboxes to any of your page and posts. 6 Version: 1.4 6 Version: 1.4.2 7 7 Author: Travelgrove Labs 8 8 Author URI: http://www.travelgrove.com/
Note: See TracChangeset
for help on using the changeset viewer.