1riot.tag('paginator', '<ol> <li class="{disabled: current==1}" onclick="{prev}"><a href="">Previous</a></li> <li each="{num in range}" class="{active: parent.current==num}" onclick="{parent.page}"><a href="">{num}</a></li> <li class="{disabled: current==total}" onclick="{next}"><a href="">Next</a></li> </ol>', '', '', function(opts) { 2 this.init = function(o) { 3 this.total = o.total 4 this.current = 1 5 this.nblocks = o.nblocks 6 this.pages = [] 7 for (i = 1; i <= this.total; i++) this.pages.push(i) 8 this.setRange() 9 }.bind(this) 10 11 this.setRange = function() { 12 var start = this.current <= this.nblocks ? 13 1 : (this.total - this.current) >= this.nblocks ? 14 this.current : this.total - this.nblocks + 1 15 16 this.range = this.pages.slice(start - 1, start + this.nblocks - 1) 17 this.update && this.update() 18 this.trigger('pageChange', { 19 'page': this.current 20 }) 21 }.bind(this) 22 23 this.page = function(e) { 24 self.current = parseInt(e.target.innerHTML) 25 self.setRange() 26 }.bind(this) 27 28 this.next = function() { 29 if (this.current == this.total) return; 30 this.current = Math.min(this.total, this.current + 1) 31 this.setRange() 32 }.bind(this) 33 34 this.prev = function() { 35 if (this.current == 1) return; 36 this.current = Math.max(1, this.current - 1) 37 this.setRange() 38 }.bind(this) 39 40 this.init(opts) 41 42 this.on('setPage', function(p) { 43 if (p.page == this.current) return 44 this.current = p.page 45 this.setRange() 46 }) 47 48}); 49riot.tag('store-locator-results', '<p if="{data.locations && data.locations.length == 0}">We\'re sorry, but that search query didn\'t return any results. Please try another.</p> <div each="{v in data.locations}"> <div class="store-block"> <div class="store-info"> <p if="{v.status == \'soon\'}" class="soon">{v.opening_soon_messaging}</p> <p class="store-address"> <raw content="{v[\'address_formatted\']}"></raw> </p> <p class="store-details"> <span if="{parent.websiteComplete(v.slug)}"> <a itemprop="url" href="{parent.opts.baseurl}{v.slug}" class="store-url">{parent.domainOnly(parent.opts.baseurl)}{v.slug}</a> <a href="{parent.opts.baseurl}{v.slug}" aria-label="Visit Website for {v.name}" class="dbutton dbutton-sm home-url">Visit Website</a> <a href="{parent.opts.baseurl}{v.slug}/complimentary-fit-evaluation" aria-label="Schedule complimentary fit evaluation for {v.name}" class="dbutton dbutton-sm">schedule complimentary fit evaluation</a> </span> </p> </div> </div> </div>', '', '', function(opts) { 50 this.data = null; 51 52 this.set = function(data) { 53 this.data = data; 54 this.update(); 55 }; 56 57 this.on('mount', function() { 58 this.set(opts); 59 }); 60 61 this.formatHours = function(hours) { 62 63 var lines = []; 64 jQuery.each(hours, function(k, v) { 65 lines.push(k + ' : ' + v); 66 }); 67 68 return lines.join('<br />'); 69 }; 70 71 this.domainOnly = function(v) { 72 return v.replace('https://', '').replace('http://', ''); 73 }; 74 75 this.integersOnly = function(v) { 76 return v.replace(/[^\d]/g, ''); 77 }; 78 79 this.websiteComplete = function(v) { 80 if (!v.match(/^[0-9a-f]{32}$/gi)) 81 return true; 82 return false; 83 }; 84 85 this.print = function(e) { 86 window.print(); 87 }; 88 89}); 90 91riot.tag('search-results-description', '<p if="{data.locations}" class="search-results-description"> <span if="{data.regionQuery}">We found {data.locationCount} {pluralize(data.locationCount, \'studio\', \'studios\')} in "{data.q}"</span> <span if="{data.q && !data.regionQuery}">We found {data.locationCount} {pluralize(data.locationCount, \'studio\', \'studios\')} near your search. "{data.q}"</span> <span if="{!data.q && !data.soon}">We found {data.locationCount} {pluralize(data.locationCount, \'studio\', \'studios\')} near your current location.</span> <span if="{data.soon}">We found {data.locationCount} {pluralize(data.locationCount, \'studio\', \'studios\')} Opening Soon.</span> </p>', '', '', function(opts) { 92 this.data = null; 93 94 this.set = function(data) { 95 this.data = data; 96 this.update(); 97 }; 98 99 this.on('mount', function() { 100 this.set(opts); 101 }); 102 103 this.pluralize = function(number, singular, plural) { 104 if (number === 1) 105 return singular; 106 else 107 return (typeof plural === 'string' ? plural : singular + 's'); 108 }; 109}); 110 111riot.tag('raw', '<span></span>', '', '', function(opts) { 112
113 this.root.innerHTML = opts.content 114});
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.