1$(document).ready(function ($) { 2 $('#example1').sliderPro({ 3 autoScaleReference: -1, 4 forceSize: 'fullWindow', 5 // width: 960, 6 // height: 500, 7 arrows: true, 8 buttons: false, 9 waitForLayers: true, 10 thumbnailWidth: 200, 11 thumbnailHeight: 100, 12 thumbnailPointer: true, 13 autoplay: false, 14 autoScaleLayers: false, 15 breakpoints: { 16 500: { 17 thumbnailWidth: 120, 18 thumbnailHeight: 50 19 } 20 } 21 }); 22 }); 23/****************************** 24Changelog: Added External link 25Last update:4/10/2019 26*******************************/ 27 28/************** DYNAMIC MOBILE MENU *****************/ 29if(!$('.module-15, .module-76, .module-34, .module-43,.module-76, #ry-section-header, .module-46, .module-header.style-11').length == 0){ //check if ry-section-header is set 30 31 $('.ry-menu>ul').children().addClass('primary'); 32 33 34 var menuItems = {}; 35 $('.ry-menu li.primary').each(function(indx){ //starts loop for each li.primary menu 36 var link = $(this).find('a').attr('href'), 37 txt = $(this).children('a').text(), 38 cName = $(this).attr('class').replace(/ /g,""), 39 externalLink = ($(this).hasClass("ry-open-link")) ? true : false; 40 41 $(this).find('a').click(function(){ 42 var href = $(this).attr('href'); 43 //window.location.href= href; 44 }); 45 46 if(!(cName.match(/dropdown/g))){ //check if theres a dropdown 47 menuItems[indx] = { 48 link:link, 49 txt:txt, 50 externalLink:externalLink 51 } 52 }else{ 53 var dropdownItems = {}; 54 var dropdown = {}; 55 56 /** Collect all of the dropdown and assigning it to dropdownItems{} **/ 57 58 $(this).find('.dropdown-menu li').each(function(indx){ // if dropdown class found 59 var link = $(this).find('a').attr('href'), 60 txt = $(this).find('a').text(), 61 dropdownClass = $(this).attr('class'), 62 res = dropdownClass.split(" "), 63 externalLink = ($(this).hasClass("ry-open-link")) ? true : false; 64 65 66 if(dropdownClass.match(/third-level/g) || dropdownClass.match(/fourth-level/g)){ // if it contains third level assign it to dropdownItems{} 67 var fourthLevelcat = (dropdownClass.match(/fourth-level-container/g)) ? res[3]: ""; 68 var hasFourthLevel = (dropdownClass.match(/fourth-level-container/g)) ? "third-level-parent" : ""; 69 var type = dropdownClass.match(/third-level-container/g) ? "parent" : "sub"; 70 71 dropdownItems[indx] = { 72 type:type, 73 link:link, 74 txt:txt, 75 category:res[1], 76 hasFourthLevel:hasFourthLevel, 77 fourtLevelCat:fourthLevelcat, 78 externalLink:externalLink 79 80 } 81 }else{ 82 83 dropdownItems[indx] = { 84 link:link, 85 txt:txt, 86 externalLink:externalLink 87 } 88 89 } 90 91 }); 92 93 /** END COLLECTION OF DROPDOWN **/ 94 95 // console.log(dropdownItems,'dropdownInt'); 96 97 /** after collecting the dropdown restructure the dropdown menu by iterating each dropdownItems{} and assign it to new {} dropdown **/ 98 $.each(dropdownItems , function(key,val){ 99 100 if(dropdownItems[key].type == "parent" && dropdownItems[key].type != undefined){ // check if this is parent and type not undefined 101 var thirdLevel = [] ; // ready array for third level menu collection 102 /*THIRD LEVEL STRUCTURE*/ 103 for(var i = 0; i <= Object.keys(dropdownItems).length -1; i++){ // iterate on existing dropdownItems to collect third level for the parent dropdown 104 105 if(dropdownItems[i].type == "sub" && dropdownItems[key].category == dropdownItems[i].category){ // check if the iterated dropdown is a sub and category is equal to parent category 106 107 /*************Construct Fourth Level*************/ 108 var fourthlevel = [] ; 109 if(dropdownItems[i].hasFourthLevel == "third-level-parent"){//if has fourthlevel collect each items 110 //iterate through each fourth Level Items 111 for(var x = 0; x <= Object.keys(dropdownItems).length -1; x++){ 112 113 //console.log(dropdownItems[i].fourthLevelcat , dropdownItems[x].category ) 114 if(dropdownItems[i].fourtLevelCat == dropdownItems[x].category){ 115 fourthlevel.push({ 116 link:dropdownItems[x].link, 117 txt:dropdownItems[x].txt, 118 externalLink:dropdownItems[x].externalLink 119 }); // then push it to fourth Level array 120 //console.log("fourth level: "+ dropdownItems[x].txt + " parent: " + dropdownItems[i].txt ) 121 } 122 } 123 } 124 /***************************/ 125 thirdLevel.push({ 126 link:dropdownItems[i].link, 127 txt:dropdownItems[i].txt, 128 fourthLevel:fourthlevel, 129 externalLink:dropdownItems[i].externalLink 130 }); // then push it to thirdLevel array 131 132 } 133 134 } 135 /**** THIRD LEVEL STRUCTURE END *****/ 136 137 /* After thirdLevel is createad for the parent dropdown add it to new {} dropdown*/ 138 dropdown[key] = { 139 link:dropdownItems[key].link, 140 txt:dropdownItems[key].txt, 141 thirdLevel:thirdLevel 142 } 143 144 }else{ 145 if(dropdownItems[key].type != "sub" && dropdownItems[key].type == undefined ){ /* secure that dropdown sub will not be added to dropdown {}*/ 146 dropdown[key] = { 147 link:dropdownItems[key].link, 148 txt:dropdownItems[key].txt, 149 externalLink:dropdownItems[key].externalLink 150 } 151 } 152 153 } 154 }); 155 /* END RESTRUCTURE OF DROPDOWN*/ 156 157 // console.log(dropdown,'dropdownobj'); 158 159 160 //finally add it to menuItems {} 161 menuItems[indx] = { 162 link:link, 163 txt:txt, 164 type:"dropdown", 165 dropdown:dropdown, 166 externalLink:externalLink 167 } 168 } 169 170 }); 171 172 //console.log(menuItems,'menuobj'); 173 174 var li = ""; 175 176 li += '<li class="mob-menu mm-listitem lbl"><a>Menu</a></li>'; 177 178 /* BUILDING THE HTML STRUCTURE */ 179 $.each(menuItems, function(key, value) { 180 181 var target = menuItems[key].externalLink ? "_blank" : "_self", 182 addClass = menuItems[key].type != undefined ? "dropdown" : "single"; 183 184 li += '<li class=mob-menu>'; 185 186 li += '<a class='+ addClass +' href='+menuItems[key].link+' target='+ target +'>'+menuItems[key].txt+'</a>' ; 187 188 if(!(menuItems[key].type == undefined)){ 189 190 var dropdown = menuItems[key].dropdown; 191 192 li += '<ul class=mob-dropdown>'; 193 194 $.each(dropdown, function(key, value) { 195 196 var target = dropdown[key].externalLink ? "_blank" : "_self"; //check primary level external link 197 198 if(dropdown[key].type == undefined){ 199 li += '<li class=mob-menu>'; 200 li += '<a href='+dropdown[key].link+' target='+ target +'>'+dropdown[key].txt+'</a>'; 201 202 if(dropdown[key].thirdLevel != undefined && dropdown[key].thirdLevel.length > 0){ 203 li +='<ul class=mob-dropdown>'; 204 205 for(var i = 0 ; i <= dropdown[key].thirdLevel.length -1; i++){ 206 207 var target = dropdown[key].thirdLevel[i].externalLink ? "_blank" : "_self"; //check third level external link 208 209 li += '<li class=mob-menu>'; 210 li += '<a href='+dropdown[key].thirdLevel[i].link+' target='+ target +'>'+dropdown[key].thirdLevel[i].txt+'</a>'; 211 if(dropdown[key].thirdLevel[i].fourthLevel.length > 0){ 212 213 li +='<ul class=mob-dropdown>'; 214 for(var x = 0 ; x <= dropdown[key].thirdLevel[i].fourthLevel.length -1 ; x++){ 215 216 var target = dropdown[key].thirdLevel[i].fourthLevel[x].externalLink ? "_blank" : "_self"; //check fourth level external link 217 218 li += '<li class=mob-menu>'; 219 li += '<a href='+ dropdown[key].thirdLevel[i].fourthLevel[x].link+' target='+ target +'>'+ dropdown[key].thirdLevel[i].fourthLevel[x].txt+'</a>'; 220 li +="</li>" 221 } 222 li +='</ul>' 223 } 224 li += '</li>' 225 } 226 li +='</ul>' 227 228 } 229 230 li += '</li>'; 231 } 232 233 234 }); 235 li +='</ul>'; 236 } 237 238 li += '</li>'; 239 240 }); 241 242 /*********** ADD SOCIAL LINKS FROM CUSTOM FIELDS ************/ 243 /* 244 var links = { 245 'facebook':{"link":"#","fa":"fab fa-facebook-square"}, 246 'twitter':{"link":"#","fa":"fab fa-twitter-square"}, 247 'linkedin':{"link":"#","fa":"fab fa-linkedin"}, 248 'google':{"link":"#","fa":"fab fa-google-plus-square"}, 249 'instagram':{"link":"#","fa":"fab fa-instagram"}, 250 'Yelp':{"link":"#","fa":"fab fa-yelp"}, 251 'rss':{"link":"","fa":"fas fa-rss-square"}, 252 'pinterest':{"link":"","fa":"fab fa-pinterest-square"}, 253 'youtube':{"link":"","fa":"fab fa-youtube-square"} 254 } 255 256 if( Object.keys(links).length > 0 ){ 257 258 li += '<li class="mob-menu mm-listitem lbl"><a>Share</a></li>'; 259 260 $.each(links, function(key, value) { 261 262 if( links[key].link != ""){ 263 li +='<li class=mob-menu>'; 264 li += "<a href="+links[key].link+">"+ "<i class=\""+ links[key].fa +"\"></i>"+key+"</a>"; 265 li += '</li>'; 266 } 267 268 }); 269 270 } 271 */ 272 /*********** END ADDING OF SOCIAL LINKS ************/ 273 274 $('.mobile_menu ul').append(li); 275 //console.log(li); 276 277 /**------- END OF HTML STRUCTURE FOR MOBILE MENU ----------**/ 278 /********------- END OF DYNAMIC MOBILE MENU ----------*********/ 279 280 281}
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.