1// Parallax. 2function wds_parallax(wds, slide_id) { 3 var current_key = jQuery("#wds_current_image_key_" + wds).val(); 4 var slide_id = window["wds_data_" + wds][current_key]["id"]; 5 var layers_cont = ".wds_slideshow_image_" + wds + ">[id^='wds_" + wds + "_slide" + slide_id + "_layer']"; 6 7 var slide_width = jQuery(".wds_slideshow_image_" + wds + "[image_id='" + slide_id + "']").outerWidth(); 8 var slide_height = jQuery(".wds_slideshow_image_" + wds + "[image_id='" + slide_id + "']").outerHeight(); 9 10 var zIndex_arr = []; 11 var hor = []; 12 var ver = []; 13 14 jQuery(layers_cont).each(function() { 15 jQuery(this).css({ 16 'transform': 'matrix3d(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, -0.002, 0, 0, 0, 1)', 17 '-ms-transform': 'matrix3d(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, -0.002, 0, 0, 0, 1)', 18 '-webkit-transform': 'matrix3d(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, -0.002, 0, 0, 0, 1)', 19 'transform-origin': '50% 50% 0px', 20 '-ms-transform-origin': '50% 50% 0px', 21 '-webkit-transform-origin': '50% 50% 0px' 22 }); 23 var cur_zIndex = parseInt(jQuery(this).css("z-index")); 24 hor[cur_zIndex] = 0; 25 ver[cur_zIndex] = 0; 26 zIndex_arr.push(cur_zIndex); 27 }); 28 29 // Arithmetic average for layer movement direction. 30 var average = (zIndex_arr[0] + zIndex_arr[zIndex_arr.length - 1]) / 2; 31 32 zIndex_arr.sort(); 33 34 var last_position = {}; 35 jQuery("#wds_container1_" + wds).off("mousemove touchmove"); 36 jQuery("#wds_container1_" + wds).off("mouseleave touchcancel"); 37 38 jQuery("#wds_container1_" + wds).on("mousemove touchmove", function (event) { 39 // Check to make sure there is data to compare against. 40 if (typeof(last_position.x) != 'undefined') { 41 // Get the change from last position to this position. 42 var deltaX = last_position.x - event.clientX, 43 deltaY = last_position.y - event.clientY; 44 45 jQuery(layers_cont).each(function() { 46 var cur_zIndex = jQuery(this).css('z-index'); 47 var layer_left = parseFloat(jQuery(this).css("left")); 48 var layer_top = parseFloat(jQuery(this).css("top")); 49 var layer_width = jQuery(this).outerWidth(); 50 var layer_height = jQuery(this).outerHeight(); 51 for (var j in zIndex_arr) { 52 if (zIndex_arr[j] == cur_zIndex) { 53 j = parseFloat(j); 54 var step = (j + 1) / 10; 55 // Check which direction had the highest amplitude and then figure out direction by checking if the value is greater or less than zero. 56 if (Math.abs(deltaX) > Math.abs(deltaY) && deltaX > 0) { 57 // Left. 58 hor[cur_zIndex] = hor[cur_zIndex] + step; 59 } else if (Math.abs(deltaX) > Math.abs(deltaY) && deltaX < 0) { 60 // Right. 61 hor[cur_zIndex] = hor[cur_zIndex] - step; 62 } else if (Math.abs(deltaY) > Math.abs(deltaX) && deltaY > 0) { 63 // Up. 64 ver[cur_zIndex] = ver[cur_zIndex] + step; 65 } else if (Math.abs(deltaY) > Math.abs(deltaX) && deltaY < 0) { 66 // Down. 67 ver[cur_zIndex] = ver[cur_zIndex] - step; 68 } 69 // Layer movement direction. 70 var dir = (average >= cur_zIndex ? -1 : 1); 71 72 if (layer_left + dir * hor[cur_zIndex] < 0) { 73 hor[cur_zIndex] += dir * step; 74 } 75 if (layer_left + layer_width + dir * hor[cur_zIndex] > slide_width) { 76 hor[cur_zIndex] -= dir * step; 77 } 78 if (layer_top + dir * ver[cur_zIndex] < 0) { 79 ver[cur_zIndex] += dir * step; 80 } 81 if (layer_top + layer_height + dir * ver[cur_zIndex] > slide_height) { 82 ver[cur_zIndex] -= dir * step; 83 } 84 jQuery(this).stop(); 85 jQuery(this).css({ 86 marginTop: (ver[cur_zIndex] * dir).toFixed(2) + 'px', 87 marginLeft: (hor[cur_zIndex] * dir).toFixed(2) + 'px' 88 }); 89 } 90 } 91 }); 92 } 93 // Set the new last position to the current for next time. 94 last_position = { 95 x : event.clientX, 96 y : event.clientY 97 }; 98 99 }); 100 // Reset layer positions on mouse out. 101 jQuery("#wds_container1_" + wds).on("mouseleave touchcancel", function (event) { 102 jQuery(layers_cont).each(function() { 103 jQuery(this).animate({ 104 marginTop: 0, 105 marginLeft: 0 106 }, 107 500); 108 var cur_zIndex = jQuery(this).css('z-index'); 109 hor[cur_zIndex] = 0; 110 ver[cur_zIndex] = 0; 111 }); 112 }); 113} 114 115function wds_embed_slide_autoplay(slide_id, wds){ 116 jQuery(slide_id).find("iframe:not([class^='wds_video_layer_frame'])").each(function () { 117 if (typeof jQuery(this)[0].contentWindow != "undefined") { 118 if (jQuery(this).attr('type') == 'youtube') { 119 player = window["youtube_iframes_ids_" + wds].indexOf(this.id
119); 120 window["youtube_iframes_" + wds][player].playVideo(); 121 } 122 else if (jQuery(this).attr('type') == 'vimeo') { 123 jQuery(this)[0].contentWindow.postMessage('{"method": "play"}', "*"); 124 } 125 else { 126 jQuery(this)[0].contentWindow.postMessage('play', '*'); 127 } 128 } 129 }); 130} 131 132// Uploaded video. 133function wds_video_dimenstion(wds, current_key) { 134 var slide_id = window["wds_data_" + wds][current_key]["id"]; 135 var is_video = window["wds_data_" + wds][current_key]["is_video"]; 136 var autoplay = window["wds_data_" + wds][current_key]["target_attr_slide"]; 137 var bg_fit = window["wds_data_" + wds][current_key]["bg_fit"]; 138 var att_width = window["wds_data_" + wds][current_key]["width"]; 139 var att_height = window["wds_data_" + wds][current_key]["height"]; 140 if (is_video == 'video') { 141 if (bg_fit == 'cover') { 142 var video_slide_width = jQuery("#wds_slide_container_" + wds + "").width(); 143 var video_slide_height = jQuery("#wds_slide_container_" + wds + "").height(); 144 var video_width = att_width; 145 var video_height = att_height; 146 var ratio = video_width / video_height; 147 if ((video_slide_width / video_slide_height) <= (video_width / video_height)) { 148 jQuery("#wds_slide_" + wds + '_' + slide_id).attr("height", video_slide_height); 149 video_width = jQuery("#wds_slide_" + wds + '_' + slide_id).height() * ratio ; 150 video_width = (video_width - video_slide_width) / 2; 151 jQuery("#wds_slide_" + wds + '_' + slide_id).css({'position': 'relative', 'left': -video_width}); 152 } 153 else { 154 jQuery("#wds_slide_" + wds + '_' + slide_id).attr("width", video_slide_width); 155 video_height = jQuery("#wds_slide_" + wds + '_' + slide_id).width() / ratio ; 156 video_height = (video_height - video_slide_height) / 2; 157 jQuery("#wds_slide_" + wds + '_' + slide_id).css({'position': 'relative', 'top': -video_height}); 158 } 159 } 160 else { 161 jQuery("#wds_slide_" + wds + '_' + slide_id).attr("height", "100%"); 162 } 163 if (autoplay == 1) { 164 jQuery("#wds_slide_" + wds + '_' + slide_id).get(0).load(); 165 jQuery("#wds_slide_" + wds + '_' + slide_id).get(0).play(); 166 } 167 } 168} 169 170function wds_upvideo_layer_dimenstion(wds, key, j) { 171 var slide_id = window["wds_data_" + wds][key]["id"]; 172 var data = window["wds_data_" + wds][key]; 173 var autoplay = window["wds_data_" + wds][key]["layer_" + j + "_video_autoplay"]; 174 var width = window["wds_data_" + wds][key]["layer_" + j + "_attr_width"]; 175 var height = window["wds_data_" + wds][key]["layer_" + j + "_attr_height"]; 176 177 if (data["layer_" + j + "_type"] == "upvideo") { 178 var video_layer_width = jQuery('#wds_' + wds + '_slide' + slide_id + '_layer' + data["layer_" + j + "_id"]).width(); 179 var video_layer_height = jQuery('#wds_' + wds + '_slide' + slide_id + '_layer' +data["layer_" + j + "_id"]).height(); 180 var video_width = width; 181 var video_height = height; 182 183 if ((video_layer_width / video_layer_height) <= (video_width / video_height)) { 184 jQuery("#wds_slide_" + wds + "_" + slide_id + "_layer_" + data['layer_' + j + '_id']).attr("height", video_layer_height); 185 video_width = jQuery("#wds_slide_" + wds + "_" + slide_id + "_layer_" + data['layer_' + j + '_id']).width(); 186 video_width = (video_width - video_layer_width) / 2; 187 jQuery("#wds_slide_" + wds + "_" + slide_id + "_layer_" + data['layer_' + j + '_id']).css({'position': 'relative', 'left': -video_width}); 188 } 189 else { 190 jQuery("#wds_slide_" + wds + "_" + slide_id + "_layer_" + data['layer_' + j + '_id']).attr("width", video_layer_width); 191 video_height = jQuery("#wds_slide_" + wds + "_" + slide_id + "_layer_" + data['layer_' + j + '_id']).height(); 192 video_height = (video_height - video_layer_height) / 2; 193 jQuery("#wds_slide_" + wds + "_" + slide_id + "_layer_" + data['layer_' + j + '_id']).css({'position': 'relative', 'top': -video_height}); 194 } 195 if (autoplay == 'on') { 196 jQuery("#wds_slide_" + wds + "_" + slide_id + '_layer_' + data["layer_" + j + "_id"]).get(0).load(); 197 jQuery("#wds_slide_" + wds + "_" + slide_id + '_layer_' + data["layer_" + j + "_id"]).get(0).play(); 198 } 199 } 200} 201 202function wds_video_play_pause(id, wds) { 203 if (jQuery(id).get(0).paused) { 204 jQuery(id).get(0).play(); 205 jQuery('.wds_bigplay_' + wds).hide(); 206 } 207 else { 208 jQuery(id).get(0).pause(); 209 jQuery('.wds_bigplay_' + wds).show(); 210 } 211} 212 213function wds_video_play_pause_layer(wds,slide_id,layer_id) {
214 if (jQuery('#wds_slide_' + wds + '_' + slide_id + '_layer_' + layer_id).get(0).paused) { 215 jQuery('#wds_slide_' + wds + '_' + slide_id + '_layer_' + layer_id).get(0).play(); 216 jQuery('#wds_bigplay_layer_' + wds + '_' + slide_id + '_layer_' + layer_id).hide(); 217 } 218 else { 219 jQuery('#wds_slide_' + wds + '_' + slide_id + '_layer_' + layer_id).get(0).pause(); 220 jQuery('#wds_bigplay_layer_' + wds + '_' + slide_id + '_layer_' + layer_id).show(); 221 } 222} 223 224function wds_show_thumb(key, wds) { 225 var data = window["wds_data_" + wds][key]; 226 var bg_fit = window["wds_data_" + wds][key]["bg_fit"]; 227 var full_width = window["wds_data_" + wds][key]["full_width"]; 228 var bull_position = window["wds_data_" + wds][key]["bull_position"]; 229 var image_url = data["image_url"]; 230 var dot_conteiner_width = jQuery('.wds_slideshow_dots_container_' + wds).width() / 2; 231 var dot_conteiner_height = jQuery('.wds_slideshow_dots_container_' + wds).height(); 232 var wds_bulframe_width = jQuery('.wds_bulframe_' + wds).width() / 2; 233 var dot_position = jQuery('#wds_dots_' + key + '_' + wds ).position(); 234 var dot_width = jQuery('#wds_dots_' + key + '_' + wds ).width() / 2; 235 dot_position = dot_position.left; 236 var childPos = jQuery('#wds_dots_' + key + '_' + wds ).offset(); 237 var parentPos = jQuery('.wds_slideshow_dots_thumbnails_' + wds).parent().offset(); 238 var childOffset = childPos.left - parentPos.left; 239 var right_offset = 0; 240 var rt = (dot_conteiner_width * 2) - childOffset; 241 if (wds_bulframe_width >= rt && rt > 0 ){ 242 right_offset = wds_bulframe_width - rt ; 243 dot_width = 0; 244 } 245 if (full_width == '1') { 246 if (wds_bulframe_width >= childOffset) { 247 wds_bulframe_width = childOffset - parentPos.left ; 248 dot_width = 0; 249 } 250 } 251 else { 252 if (wds_bulframe_width >= childOffset) { 253 wds_bulframe_width = childOffset ; 254 dot_width = 0; 255 } 256 } 257 dot_position = childOffset - wds_bulframe_width + dot_width - right_offset ; 258 jQuery('.wds_bulframe_' + wds ).css({ 259 'position' : 'absolute', 260 'z-index' : '9999', 261 'left': dot_position, 262 'background-image' :'url("' + image_url + '")', 263 'background-size' : bg_fit, 264 'background-repeat' : 'no-repeat', 265 'background-position' : 'center center'}); 266 jQuery('.wds_bulframe_' + wds ).css(bull_position, dot_conteiner_height); 267 jQuery('.wds_bulframe_' + wds ).fadeIn(); 268} 269 270function wds_hide_thumb(wds) { 271 jQuery('.wds_bulframe_' + wds ).css({'background-image':''}); 272 jQuery('.wds_bulframe_' + wds ).fadeOut(); 273} 274 275function wds_get_overall_parent(obj) { 276 if (obj.parent().width()) { 277 obj.width(obj.parent().width()); 278 return obj.parent().width(); 279 } 280 else { 281 return wds_get_overall_parent(obj.parent()); 282 } 283} 284 285function wds_set_text_dots_cont(wds) { 286 var wds_bull_width = 0; 287 jQuery(".wds_slideshow_dots_" + wds).each(function(){ 288 wds_bull_width += jQuery(this).outerWidth() + 2 * parseInt(jQuery(this).css("margin-left")); 289 }); 290 jQuery(".wds_slideshow_dots_thumbnails_" + wds).css({width: wds_bull_width}); 291}
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.