1var tfNav = {}; 2 3tfNav.init = function(){ 4 tfNav.buildSubMenus(); 5 //tfNav.buildMobileNavigation(); 6}; 7 8tfNav.subMenus = { 9 courses: { 10 guitar: { 11 'Blues': 'blues', 12 'Blues Rock': 'blues%20rock', 13 'Jazz': 'jazz', 14 'Jazz Blues': 'jazz%20blues', 15 'Rock': 'rock', 16 'Hard Rock/Metal': 'hard%20rock', 17 'Country': 'country', 18 'Acoustic': 'acoustic', 19 'Singer-Songwriter': 'Singer-Songwriter', 20 'Fingerstyle': 'fingerstyle', 21 'Classical': 'classical', 22 'Funk': 'funk', 23 'R&B/Soul': '../search/?q=r%20and%20b', 24 'Americana': 'americana', 25 'Rockabilly': 'rockabilly', 26 'Bluegrass': '../search?q=Bluegrass' 27 }, 28 other: { 29 'Bass': 'bass', 30 'Banjo': 'banjo', 31 'Ukulele': 'ukulele', 32 'Harmonica': 'harmonica', 33 'Other': 'other' 34 }, 35 learn: { 36 'Beginner': 'beginner', 37 'Late Beginner': 'late%20beginner', 38 'Songs': '../guitar-song-lessons' 39 }, 40 topics: { 41 'Rhythm': 'rhythm', 42 'Soloing': 'soloing', 43 'Applied Theory': '../search?q=applied%20theory', 44 'Essential Reference': '../search?q=essential%20reference', 45 'Style Studies': '../search?q=style%20studies', 46 'Technique': '../search?q=technique', 47 'Chords & Progressions': '../search?q=chords%20and%20progressions', 48 'Slide': 'slide', 49 'Scales & Modes': '../search?q=scales%20and%20modes', 50 'Pentatonic': 'pentatonic', 51 'Improvisation': 'improvisation', 52 'CAGED': 'caged', 53 'Chord Melody': 'chord%20melody', 54 'Songwriting': 'songwriting', 55 'Workouts & Exercises': '../search?q=workouts%20and%20exercises', 56 'Tone & Gear': '../search?q=tone%20and%20gear', 57 'Arpeggios': 'arpeggios', 58 'Alternate Tunings': 'alternate%20tunings' 59 }, 60 browse: { 61 'All Courses': '/search/?q=Courses',
62 'Most Popular': '/search/?q=Most%20Popular', 63 'On Sale': '/sales-promos/', 64 'Pre-Orders': '/pre-orders/', 65 'Recommendations': '/recommendations/', 66 // 'Soundsliced': '/courses/soundslice/', 67 'Free Lessons': '/free-guitar-lessons', 68 'Curated Collections': '/collections', 69 'JamPlay Courses': '/search?q=JamPlay', 70 }, 71 series: { 72 'Learn & Play Guitar': '../search?q=Learn%20Play%20Guitar', 73 'Masterclasses': '../search?q=masterclasses', 74 'Practice Sessions': '../search?q=practice%20sessions', 75 'Guitar Heroes & Legends': '../search/?q=Play%20Like%20Legends', 76 'Essentials': 'essentials', 77 'Licks You Must Know': 'licks%20you%20must%20know', 78 'Trading Solos': '../search/?q=Trading%20Solos', 79 'Focus On': 'focus%20on', 80 'Survival Guides': 'survival%20guide', 81 'Fakebooks': '../search?q=Fakebooks', 82 'Guitar Gym': 'guitar%20gym', 83 'Guitar Lab': 'guitar%20lab', 84 'Take 5': '../search?q=Take%205' 85 } 86 }, 87 jams: { 88 'About': 'jams', 89 'In The Jam': 'in-the-jam', 90 'Multi-Track Audio Jams': 'multi-track-audio-jams', 91 'Jam Packs': 'jam-packs', 92 'Free Jam Tracks': 'jam-tracks' 93 }, 94 learning_paths: { 95 'About Learning Paths': 'learning-paths', 96 'Blues': 'a13', 97 'Jazz': 'a3', 98 'Rock': 'a9', 99 'Acoustic': 'a12', 100 'Country': 'a10', 101 'Bass': 'a14', 102 }, 103 private_lessons: { 104 'Artist Channels': 'channels', 105 'About Private Lessons': 'private-lessons', 106 'Choose an Instructor': 'private-lessons/directory', 107 'Live 1-on-1 Lessons': 'private-lessons/live-1-on-1' 108 }, 109 sales: { 110 'All Access': 'all-access/', 111 'Fire Sales': 'sales-promos/', 112 'Pre-Orders': 'pre-orders/', 113 'Artist Bundles': 'bundles/', 114 '$5 Downloads': 'five-dollar-downloads/' 115 }, 116 songs: { 117 'About': 'song-lessons', 118 'All Song Lessons': 'song-directory', 119 // 'Blues': 'search/?q=Blues%20Song%20Lessons', 120 // 'Jazz': 'search/?q=Jazz%20Song%20Lessons', 121 // 'Rock': 'search/?q=Rock%20Song%20Lessons', 122 // 'Country': 'search/?q=Country%20Song%20Lessons' 123 }, 124 learning_tools: { 125 'Free Downloads': 'free-downloads', 126 'Live': 'live', 127 'JamPlay Live Archive': 'jamplay/live-archive', 128 'Apps': 'apps', 129 'Learning Tools': 'learning-tools', 130 'Blog': 'https://blog.truefire.com/', 131 'Refer a Friend': 'refer/', 132 'Gift Certificates': 'gift-certificates/', 133 'Community': 'community/' 134 } 135}; 136 137tfNav.buildSubMenus = function(){ 138 tfNav.navElements = {}; 139 $.each(tfNav.subMenus, function(menuTitle, menuItems){ 140 if(menuTitle == 'courses'){ 141 tfNav.navElements[menuTitle] = {}; 142 $.each(menuItems, function(groupLabel, items){ 143 tfNav.navElements.courses[groupLabel] = ''; 144 $.each(items, function(label, url){ 145 if(groupLabel != 'browse'){ 146 if(url.indexOf('../search') == -1) url = url.replace(/%20/g, '-'); 147 url = '/guitar-lessons/' + url; 148 } 149 tfNav.navElements.courses[groupLabel] += tfNav.mainNavDropdownLink(label, url); 150 }); 151 }); 152 } else { 153 tfNav.navElements[menuTitle] = ''; 154 $.each(menuItems, function(label, url){ 155 if(url.indexOf("http") > -1){ 156 tfNav.navElements[menuTitle] += tfNav.mainNavDropdownLink(label,url); 157 }else{ 158 tfNav.navElements[menuTitle] += tfNav.mainNavDropdownLink(label, '/' + url); 159 } 160 }); 161 } 162 }); 163 tfNav.buildMainNavSubmenus(); 164 tfNav.doNavigation(); 165 if(tfNav.isIpad){ 166 tfNav.doIpadNavigation(); 167 } 168 tfNav.doMobileNavigation(); 169}; 170 171tfNav.buildMainNavSubmenus = function(){ 172 $.each(tfNav.navElements, function(label, items){ 173 if(label == 'courses'){ 174 $.each(items, function(itemLabel, itemString){ 175 $('#tfCourseNav_' + itemLabel).html(itemString); 176 }); 177 } else { 178 $('#tfNav_' + label).html(items); 179 } 180 }); 181}; 182 183tfNav.doIpadNavigation = function(){ 184 //alert('do ipad'); 185 // $('meta[name="viewport"]').prop('content', 'width=760px'); 186 $('#tfNavigationBar .mainNavDropdown').each(function(){ 187 $(this).children('a').click(function(e){ 188 e.preventDefault(); 189 }); 190 }); 191}; 192 193tfNav.mainNavDropdownLink = function(label, url){ 194 const target = url.indexOf('http') > -1 ? 'target="_blank" rel="noopener"' : '' 195 var dropdownLink = '<li><a href="' + url + '" ' + target + '>' + label + '</a></li>'; 196 return dropdownLink; 197}; 198 199tfNav.doNavigation = function(){ 200 $('#tfNavigationBar .mainNavDropdown').each(function(){ 201 $(this).hover(function(){ 202 $(this).children('.tfNavigationDropdownMenu').show(); 203 }, function(){ 204 $(this).children('.tfNavigationDropdownMenu').hide(); 205 }); 206 }); 207}; 208 209tfNav.doMobileNavigation = function(){ 210 tfNav.mobileNavShowing = false;
211 $('#tfMobileNavToggleButton').click(function(){ 212 tfNav.showMobileNavigation($(this)); 213 }); 214 $('#tfMobileNavigationBg').click(function(){ 215 tfNav.hideMobileNavigation(); 216 }); 217 $('.mobileNavItemHasSub').each(function(){ 218 $(this).click(function(){ 219 var thisText = $(this).text().trim().toLowerCase(); 220 if(thisText.indexOf('promos') > -1){ 221 thisText = 'sales'; 222 } else if(thisText.indexOf('paths') > -1){ 223 thisText = 'learning_paths'; 224 } 225 thisText = thisText.replace(/ /g, '_'); 226 tfNav.showMobileSubNavigation(thisText); 227 }); 228 }); 229}; 230 231tfNav.showMobileNavigation = function(thisBtn){ 232 $('#tfMobileNavigationContainer').show(); 233 thisBtn.addClass('active'); 234 tfNav.mobileNavShowing = true; 235}; 236 237tfNav.hideMobileNavigation = function(){ 238 $('#tfMobileNavigationContainer').hide(0, function(){ 239 $('#tfMobileNavigationSubMenu').html(''); 240 $('#tfMobileNavigationMainMenu').css('margin-left', '0px'); 241 $('#tfMobileNavToggleButton').removeClass('active'); 242 }); 243 tfNav.mobileNavShowing = false; 244}; 245 246tfNav.showMobileSubNavigation = function(navTitle){ 247 var subNav = '<li class="tfMobileNavigationSubMenuItem" style="padding-top:5px;padding-bottom:5px;">\ 248 <button type="button" class="btn btn-primary btn-mini" id="tfMobileNavigationBackButton"><span class="fa fa-angle-left"></span> Back</button>\ 249 </li>'; 250 if(navTitle == 'courses'){ 251 $.each(tfNav.subMenus.courses, function(label, items){ 252 subNav += '<li class="tfMobileNavigationSubMenuItem" style="clear:both;padding-top:5px">\ 253 <span class="tfMobileNavigationSubMenuItemLink" style="color:#aaa;height:25px;line-height:25px;">' + tf.capitalize(label) + '</span>\ 254 </li>'; 255 $.each(items, function(itemLabel, itemLink){ 256 // mobile nav 257 var firstChar = itemLink.substring(0, 1); 258 // if(firstChar != '.' && firstChar != '/') itemLink = '/search?q=' + itemLink + '&nav=1'; 259 if(firstChar != '.' && firstChar != '/') itemLink = '/guitar-lessons/' + itemLink; 260 subNav += '<li class="tfMobileNavigationSubMenuItem pull-left" style="width:50%;">\ 261 <a href="' + itemLink + '" class="tfMobileNavigationSubMenuItemLink" style="height:25px;line-height:25px;text-overflow:ellipsis;white-space:nowrap;overflow:hidden;">' + itemLabel + '</a>\ 262 </li>'; 263 }); 264 }); 265 266 } 267 else if(navTitle == 'educators'){ 268 269 subNav += '<li class="tfMobileNavigationSubMenuItem"><a href="/educators" class="tfMobileNavigationSubMenuItemLink">View All 400+ Educators <i class="far fa-angle-right"></i></a></li>'; 270 subNav += '<li class="tfMobileNavigationSubMenuItem" style="clear:both;padding-top:5px">\ 271 <span class="tfMobileNavigationSubMenuItemLink" style="color:#aaa;height:25px;line-height:25px;">Featured:</span>\ 272 </li>'; 273 for(let educator of educatorsNavList){ 274 subNav += '<li class="tfMobileNavigationSubMenuItem pull-left" style="width:33.3%">\ 275 <a href="/e' + educator.id + '" class="tfMobileNavigationSubMenuItemLink" style="height:25px;line-height:25px;text-overflow:ellipsis;white-space:nowrap;overflow:hidden;">' + 276 educator.name + '</a>\ 277 </li>'; 278 } 279 280 } 281 else if(navTitle == 'more'){ 282 $.each(tfNav.subMenus.learning_tools, function(label, url){ 283 var isExternal = url.indexOf('http') === 0; 284 if(!isExternal) url = '/' + url; 285 var targetAttr = isExternal ? ' target="_blank" rel="noopener"' : ''; 286 subNav += '<li class="tfMobileNavigationSubMenuItem"><a href="' + url + '" class="tfMobileNavigationSubMenuItemLink"' + targetAttr + '>' + label + '</a></li>'; 287 }); 288 } else { 289 $.each(tfNav.subMenus[navTitle], function(label, url){ 290 subNav += '<li class="tfMobileNavigationSubMenuItem"><a href="/' + url + '" class="tfMobileNavigationSubMenuItemLink">' + label + '</a></li>'; 291 }); 292 } 293 var mainMenuWidth = $('#tfMobileNavigationMainMenu').width(); 294 $('#tfMobileNavigationMainMenu').css('margin-left', (mainMenuWidth * -1) + 'px'); 295 setTimeout(function(){ 296 $('#tfMobileNavigationSubMenu').html(subNav); 297 $('#tfMobileNavigationBackButton').off('click').on('click', function(){ 298 tfNav.backMobileSubNavigation(); 299 }); 300 }, 100); 301}; 302 303tfNav.backMobileSubNavigation = function(){ 304 $('#tfMobileNavigationMainMenu').css('margin-left', '0px'); 305 $('#tfMobileNavigationSubMenu').html(''); 306}; 307 308$(function(){ 309 tfNav.init(); 310});
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.