1$j = jQuery.noConflict(); 2 3$j(function() { 4 5 var isTouch = navigator.userAgent.toLowerCase().match(/(i#phone|ipod|ipad|android)/); 6 7 Wpml_change_flag(); 8 9 CustomizeMenu(); 10 11 RollUpMenu(); 12 13 ApplyColorbox(); 14 15 ApplyFancyboxVideo(); 16 17 InitMisc(); 18 19 HoverZoomInit(); 20 21 OpenCloseShortcode(); 22 23 DatePickers(); 24 25 SmallRoomViewerDescription(); 26 27 RoomThumb(); 28 29 HomeRoomViewerActivateForm(); 30 31 notificationClose(); 32 33 transformSelect(); 34 35 //hideCFinputs(); 36 37}); 38 39function hideCFinputs(){ 40 $j('.wpcf7 form p').each(function(){ 41 $j(this).find('input').focus(function(){ 42 $j(this).parent().parent().find('label').fadeOut('slow'); 43 }); 44 $j(this).find('input').focusout(function(){ 45 $j(this).parent().parent().find('label').fadeIn('slow'); 46 }); 47 48 $j(this).find('textarea').focus(function(){ 49 $j(this).parent().parent().find('label').fadeOut('slow'); 50 }); 51 $j(this).find('textarea').focusout(function(){ 52 $j(this).parent().parent().find('label').fadeIn('slow'); 53 }); 54 }); 55} 56 57function HomeRoomViewerActivateForm(){ 58 if($j("#showRoomSearchByDefault").text() == "false"){ 59 $j("#subpage-room-options-container-left").css({'display':'none'}); 60 $j("#showHideHousing").removeClass('show'); 61 } else { 62 $j("#room-controls-1").find("img").addClass("active"); 63 $j(".reservation-form").css({"display":"block"}); 64 } 65} 66 67function SmallRoomViewerDescription(){ 68 $j("#showHideHousing").click(function(){ 69 if( $j(this).hasClass('show') == true ) 70 { 71 //$j("#subpage-room-options-container-left").hide('slow'); 72 $j("#subpage-room-options-container-left").hide("slide",{direction: "left"},'fast'); 73 $j(this).removeClass('show'); 74 $j(this).addClass('hide'); 75 } 76 else 77 { 78 //$j("#subpage-room-options-container-left").show('slow'); 79 $j("#subpage-room-options-container-left").show("slide",{direction: "left"},'fast'); 80 $j(this).removeClass('hide'); 81 $j(this).addClass('show'); 82 } 83 }); 84} 85 86function RoomThumb(){ 87 $j("#roomThumb").attr({'src':$j("#roomThumbCont").val()}); 88} 89 90function PopulateForm(form){ 91 var sendFormLink = $j("#"+form).find("#formLink").val(); 92 var room = $j("#"+form).find('#room :selected').text(); 93 var roomVal = $j("#"+form).find('#room :selected').val(); 94 var roomThumb = $j("#"+form).find('#room :selected').val(); 95 96 var dateFrom = 0; 97 var dateFromDefaultText = ""; 98 var dateTo = 0; 99 var dateToDefaultText = ""; 100 101 var inputs = []; 102 $j("#formEnabledInputs").children().each(function(){ 103 inputs.push($j(this).text()); 104 }); 105 var count = inputs.length + 1; //4 106 107 if($j.inArray("From",inputs) != -1){ 108 dateFrom = $j("#"+form).find("#datePicker1").val(); 109 dateFromDefaultText = $j("#inputName1").text(); 110 } 111 112 if($j.inArray("To",inputs) != -1){ 113 dateTo = $j("#"+form).find("#datePicker2").val(); 114 dateToDefaultText = $j("#inputName2").text(); 115 } 116 117 if(roomVal != "NULL"){count--;} 118 if(dateFrom != dateFromDefaultText && dateFrom != 0){count--;} 119 if(dateTo != dateToDefaultText && dateTo != 0){count--;} 120 121 if(sendFormLink != ""){ 122 if(count == 0){ 123 //console.log(window.location.href); 124 if(sendFormLink.indexOf("?") != -1) 125 { 126 $j(window.location).attr('href', sendFormLink+'&roomname='+room+'&from='+dateFrom+'&to='+dateTo+'&roomthumb='+roomThumb); 127 } 128 else 129 { 130 $j(window.location).attr('href', sendFormLink+'?roomname='+room+'&from='+dateFrom+'&to='+dateTo+'&roomthumb='+roomThumb); 131 } 132 } 133 else{ 134 // alert or something :-) 135 alert('Please fill in the form to proceed'); 136 } 137 } else { 138 alert("Set the form properly in the admin"); 139 } 140} 141 142function DatePickers(){ 143 var dateFormatVar = $j("#datepickerFormat").text(); 144 145 $j( ".datePicker" ).datepicker({dateFormat : dateFormatVar}); 146 //$j( "#datePicker2" ).datepicker({dateFormat : dateFormatVar}); 147} 148 149function Wpml_change_flag() 150{ 151 $j('.wpml.icon').hover(function() { 152 $j('#language-bubble').stop(true,true).fadeIn(); 153 }, function() { 154 $j('#language-bubble').stop(true,true).fadeOut(); 155 }); 156} 157 158function CustomizeMenu(){ 159 $j(".mainmenu > ul > li").each(function(){ 160 if($j(this).has('ul').length){ 161 $j(this).addClass("parent"); 162 } 163 }); 164} 165 166function RollUpMenu(){ 167 168 var time = parseInt($j('#mainmenu-dropdown-duration').text()); 169 var easing = $j('#mainmenu-dropdown-easing').text(); 170 171 var isiPad = navigator.userAgent.match(/iPad/i) != null; 172 173 click = 0;
174 // For use within iPad developer UIWebView 175 // Thanks to Andrew Hedges! 176 var ua = navigator.userAgent; 177 var isiPad = /iPad/i.test(ua) || /iPhone OS 5/i.test(ua) || /iPhone OS 5_1/i.test(ua); 178 179 $j(".mainmenu ul").find('ul').each(function(){ 180 $j(this).css({'display':'block', 'visibility':'none'}); 181 }); 182 183 $j(".mainmenu").find('ul').children('li').each(function(){ 184 if($j(this).has('ul').length){ 185 var submenu = $j(this).children('ul'); 186 var submenuHeight = submenu.height(); 187 var ieFix = '270px'; 188 $j(this).hover(function(){ 189 submenu.css({'display':'block', 'height':'0'}).animate({height: submenuHeight}, time, easing); 190 }, function(){ 191 submenu.css({'display':'none','height':submenuHeight}); 192 }); 193 submenu.css({'width':ieFix}); 194 } 195 }); 196 197 $j(".mainmenu ul").find('ul').each(function(){ 198 $j(this).css({'display':'none', 'visibility':'visible'}); 199 }); 200} 201 202function ApplyColorbox(){ 203 // Apply fancybox on all images 204 $j(".menu-thumb").colorbox({rel: 'group', maxHeight:"95%"}); 205 $j("a[href$='gif']").colorbox({rel: 'group', maxHeight:"95%"}); 206 $j("a[href$='jpg']").colorbox({rel: 'group', maxHeight:"95%"}); 207 $j("a[href$='png']").colorbox({rel: 'group', maxHeight:"95%"}); 208} 209 210function ApplyFancyboxVideo(){ 211 // AIT-Portfolio videos 212 $j(".ait-portfolio a.video-type").click(function() { 213 214 var address = this.href 215 if(address.indexOf("youtube") != -1){ 216 // Youtube Video 217 $j.fancybox({ 218 'padding' : 0, 219 'autoScale' : false, 220 'transitionIn' : 'elastic', 221 'transitionOut' : 'elastic', 222 'title' : this.title, 223 'width' : 680, 224 'height' : 495, 225 'href' : this.href.replace(new RegExp("watch\\?v=", "i"), 'v/'), 226 'type' : 'swf', 227 'swf' : { 228 'wmode' : 'transparent', 229 'allowfullscreen' : 'true' 230 } 231 }); 232 } else if (address.indexOf("vimeo") != -1){ 233 // Vimeo Video 234 // parse vimeo ID 235 var regExp = /http:\/\/(www\.)?vimeo.com\/(\d+)($|\/)/; 236 var match = this.href.match(regExp); 237 238 if (match){ 239 $j.fancybox({ 240 'padding' : 0, 241 'autoScale' : false, 242 'transitionIn' : 'elastic', 243 'transitionOut' : 'elastic', 244 'title' : this.title, 245 'width' : 680, 246 'height' : 495, 247 'href' : "http://player.vimeo.com/video/"+match[2]+"?title=0&byline=0&portrait=0&color=ffffff", 248 'type' : 'iframe' 249 }); 250 } else { 251 alert("not a vimeo url"); 252 } 253 } 254 return false; 255 }); 256 257 // Images shortcode 258 $j("a.sc-image-link.video-type").click(function() { 259 260 var address = this.href 261 if(address.indexOf("youtube") != -1){ 262 // Youtube Video 263 $j.fancybox({ 264 'padding' : 0, 265 'autoScale' : false, 266 'transitionIn' : 'elastic', 267 'transitionOut' : 'elastic', 268 'title' : this.title, 269 'width' : 680, 270 'height' : 495, 271 'href' : this.href.replace(new RegExp("watch\\?v=", "i"), 'v/'), 272 'type' : 'swf', 273 'swf' : { 274 'wmode' : 'transparent', 275 'allowfullscreen' : 'true' 276 } 277 }); 278 } else if (address.indexOf("vimeo") != -1){ 279 // Vimeo Video 280 // parse vimeo ID 281 var regExp = /http:\/\/(www\.)?vimeo.com\/(\d+)($|\/)/; 282 var match = this.href.match(regExp); 283 284 if (match){ 285 $j.fancybox({ 286 'padding' : 0, 287 'autoScale' : false, 288 'transitionIn' : 'elastic', 289 'transitionOut' : 'elastic', 290 'title' : this.title, 291 'width' : 680, 292 'height' : 495, 293 'href' : "http://player.vimeo.com/video/"+match[2]+"?title=0&byline=0&portrait=0&color=ffffff", 294 'type' : 'iframe' 295 }); 296 } else { 297 alert("not a vimeo url"); 298 } 299 } 300 return false; 301 }); 302} 303 304 305function InitMisc() { 306 $j('#content input, #content textarea').each(function(index) { 307 var id = $j(this).attr('id'); 308 var name = $j(this).attr('name'); 309 if(id != undefined && name != undefined){ 310 if (id.length == 0 && name.length != 0) { 311 $j(this).attr('id', name); 312 } 313 } 314 }); 315 316 $j('#content form').find('label').inFieldLabels(); 317 318 $j('.rule span').click(function() { 319 $j.scrollTo(0, 1000, {axis:'y'}); 320 return false; 321 }); 322 323} 324 325 326function HoverZoomInit() { 327 //// Post images
328 //$j('#content .entry-thumbnail a').hoverZoom({overlayColor:'#333333',overlayOpacity: 0.8}); 329 330 // default wordpress gallery 331 $j('#content .gallery-item a').hoverZoom({overlayColor:'#333333',overlayOpacity: 0.8,zoom:0}); 332 333 // ait-portfolio 334 $j('#content .ait-portfolio a').hoverZoom({overlayColor:'#333333',overlayOpacity: 0.8,zoom:0}); 335 336 // schortcodes 337 $j('#content a.sc-image-link').hoverZoom({overlayColor:'#333333',overlayOpacity: 0.8,zoom:0}); 338 339} 340 341 342function OpenCloseShortcode(){ 343 344 //$j('#content .frame .frame-close.closed').parent().find('.frame-wrap').hide(); 345 $j('#content .frame .frame-close.closed .close.text').hide(); 346 $j('#content .frame .frame-close.closed .open.text').show(); 347 348 $j('#content .frame .frame-close').click(function(){ 349 if($j(this).hasClass('closed')){ 350 var $butt = $j(this); 351 $j(this).parent().find('.frame-wrap').slideDown('slow',function(){ 352 $butt.removeClass('closed'); 353 $butt.find('.close.text').show(); 354 $butt.find('.open.text').hide(); 355 }); 356 } else { 357 var $butt = $j(this); 358 $j(this).parent().find('.frame-wrap').slideUp('slow',function(){ 359 $butt.addClass('closed'); 360 $butt.find('.close.text').hide(); 361 $butt.find('.open.text').show(); 362 }); 363 364 } 365 366 }); 367} 368 369function notificationClose() { 370 $j('.sc-notification').children('a.close').click( function(event) { 371 event.preventDefault(); 372 $j(this).parent().fadeOut('slow'); 373 }); 374} 375 376function transformSelect() { 377 $j('.widget_reservation form').jqTransform(); 378}
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.