PageSourceSearch

https://weownthistown.net/wp-content/themes/wottlinear/javascript/app.js?ver=1729698677

js weownthistown.net collected 2026-10-02 15:00:37 UTC 11,119 bytes, 313 lines download raw bytes

1var player;
2
3if (typeof wottjs == "undefined") {
4  var wottjs = {
5    config: {
6      header: {},
7      stickyYpos: 0,
8    },
9  };
10  jQuery.extend(wottjs, {
11    init: function () {
12      wottjs.gallerypopup.init();
13      wottjs.stickyheader.init();
14      if (jQuery("input.search-primary").length) {
15        jQuery("input.search-primary").focus();
16      }
17      wottjs.tracklistcontainer.init();
18    },
19    stickyheader: {
20      init: function () {
21        // Get the navbar
22        wottjs.config.header = document.getElementById("header");
23        // Get the offset position of the navbar
24        wottjs.config.stickyYpos =
25          jQuery("#header").outerHeight() + wottjs.config.header.offsetTop;
26        // When the user scrolls the page, execute myFunction
27        window.onscroll = function () {
28          wottjs.stickyheader.checkNavScroll();
29        };
30      },
31      checkNavScroll: function () {
32        if (window.pageYOffset >= wottjs.config.stickyYpos) {
33          wottjs.config.header.classList.add("fixed");
34          document.body.classList.add("fixed-menu-set");
35        } else {
36          wottjs.config.header.classList.remove("fixed");
37          document.body.classList.remove("fixed-menu-set");
38        }
39      },
40    },
41    gallerypopup: {
42      init: function () {
43        if (jQuery("[data-gallery-popup]").length > 0) {
44          // should
45          jQuery("[data-gallery-popup] .block-gallery a").each(function (ev) {
46            ev.preventDefault;
47            var img = jQuery(this).find("img").attr("src");
48            jQuery(this).css("background-image", "url('" + img + "')");
49          });
50          // using "Featherlight" plugin to do the heavy lifting here
51          jQuery("[data-gallery-popup] .block-gallery a").featherlightGallery({
52            previousIcon: "‹",
53            nextIcon: "›",
54            galleryFadeIn: 0,
55            openSpeed: 0,
56            closeSpeed: 0,
57            afterContent: function (ev) {
58              wottjs.gallerypopup.showCaption(
59                jQuery(this)[0].$currentTarget.attr("alt"),
60              );
61            },
62            beforeClose: function (ev) {
63              wottjs.gallerypopup.hideCaption();
64            },
65          });
66        }
67      },
68      showCaption: function (txt) {
69        if (jQuery(".featherlight-content .modal-credit").length < 1) {
70          jQuery(".featherlight-content").prepend(
71            "<div class='modal-credit is-hidden'></div>",
72          );
73        }
74        jQuery(".featherlight-content .modal-credit")
75          .html(txt)
76          .removeClass("is-hidden");
77      },
78      hideCaption: function () {
79        jQuery(".featherlight-content .modal-credit")
80          .html("")
81          .addClass("is-hidden");
82      },
83    },
84    tracklistcontainer: {
85      init: function () {
86        // very redundant code for two slightly different scenarios of HTML markup
87        jQuery(".tracklisting-container").not(".modern-container").each(function (ind) {
88          var linktarg = jQuery(this)
89            .find(".artwork-container a:eq(0)")
90            .attr("href");
91          var a = jQuery("<a/>").attr("href", linktarg);
92          jQuery(this).find(".artist-container").wrap(a);
93        });
94        // you wrote some bad HTML, now you must fix it with "modern-container"
95        jQuery(".tracklisting-container.modern-container").each(function (ind) {
96
97          jQuery(".artwork-container").each(function (indd) {
98            var linktarg = jQuery(this)
99              .find("a.image-container:eq(0)")
100              .attr("href");
101            var a = jQuery("<a/>").attr("href", linktarg);
102            jQuery(this).find(".artist-container").wrap(a);
103          });
104
105        }); // end .modern-container
106      },
107    },
108  });
109}
110
111/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
112
113
114- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -  */
115
116jQuery(document).ready(function ($) {
117  // $() will work as an alias for jQuery() inside of this function
118  // what does this even do?!
119  //$(document).foundation();
120  wottjs.init();
121  // populate mobile menu with navigation
122  $("[data-mobile-menu-options] a").each(function (ind) {
123    $("[data-mobile-menu-options-destination]").append($(this)[0].outerHTML);
124  });
125  $("#control-nav").change(function () {
126    if ($(this).is(":checked")) {
127      $("body").addClass("menu-open");
128    } else {
129      $("body").removeClass("menu-open");
130    }
131  });
132
133  if (window.console) {
134    sayHello();
135  }
136  // YouTube video embeds
137  // featured youtube?
138  if ($("[data-youtube-id]").length > 0) {
139    // load youtube API
140    var tag = document.createElement("script");
141    tag.src = "https://www.youtube.com/iframe_api";
142    tag.async = true;
143    var firstScriptTag = document.getElementsByTagName("script")[0];
144    firstScriptTag.parentNode.insertBefore(tag, firstScriptTag);
145  }
146
147  // rewrite links to app for WOTT b/c you used the wrong one in the archives
148  $("a[href*='https://pcr.apple.com/id1136092302']").attr(
149    "href",
150    "https://itunes.apple.com/us/podcast/we-own-this-town-music/id136605426?mt=2",
151  );
152  // responsiveslides.com
153  $(".rslides").responsiveSlides({
154    auto: true, // Boolean: Animate automatically, true or false
155    speed: 800, // Integer: Speed of the transition, in milliseconds
156    timeout: 4000, // Integer: Time between slide transitions, in milliseconds
157    pager: true, // Boolean: Show pager, true or false
158    nav: true, // Boolean: Show navigation, true or false
159    random: false, // Boolean: Randomize the order of the slides, true or false
160    pause: true, // Boolean: Pause on hover, true or false
161    pauseControls: true, // Boolean: Pause when hovering controls, true or false
162    prevText: "<span class='fa fa-chevron-left'></span>", // String: Text for the "previous" button
163    nextText: "<span class='fa fa-chevron-right'></span>", // String: Text for the "next" button
164    maxwidth: "", // Integer: Max-width of the slideshow, in pixels
165    navContainer: "", // Selector: Where controls should be appended to, default is after the 'ul'
166    manualControls: "", // Selector: Declare custom pager navigation
167    namespace: "rslides", // String: Change the default namespace used
168    before: function () {}, // Function: Before callback
169    after: function () {}, // Function: After callback
170  });
171
172  // spruce up our bandcamp embeds
173  if ($("body").hasClass("category-reviews")) {
174    $("iframe[src*='bandcamp']").each(function (ev) {
175      var bandsrc = $(this).attr("src");
176      var srcparams = bandsrc.substr(bandsrc.indexOf("EmbeddedPlayer/") + 15);
177      var srcpieces = srcparams.split("/");
178      var newsrc = "https://bandcamp.com/EmbeddedPlayer";
179      for (var i = 0, len = srcpieces.length - 1; i < len; i++) {
180        var param = srcpieces[i].split("=");
181        if (param[0] == "linkcol") {
182          newsrc += "/linkcol=ffa200";
183        } else if (param[0] == "size") {
184          newsrc += "/size=large";
185        } else {
186          newsrc += "/" + param[0] + "=" + param[1];
187        }
188      }
189
190      $(this).attr("src", newsrc);
191      $(this).parent(".bandcamp.embed").addClass("square");
192      $(this).attr("frameborder", "none");
193      $(this).attr("style", "");
194      // small <iframe src="http://bandcamp.com/EmbeddedPlayer/size=medium/bgcol=ffffff/linkcol=0687f5/notracklist=true/transparent=true/album=72999368/" allowtransparency="true" frameborder="0"></iframe>
195      // large <iframe src="https://bandcamp.com/EmbeddedPlayer/album=72999368/size=large/bgcol=ffffff/linkcol=0687f5/tracklist=false/transparent=true/" seamless><a href="http://billyanderson1.bandcamp.com/album/billy-again-lately">Billy Again Lately by Billy Anderson</a></iframe>
196    });
197  }
198  // make clickable things clickable
199  $(".is-clickable").click(function (ev) {
200    ev.preventDefault();
201    var targ = $(this).find("a[rel='permalink']").attr("href");
202    window.location.href = targ;
203  });
204
205  // find video iframes inside .img containers
206  $(".img iframe").each(function (ind) {
207    if (
208      $(this)
209        .attr("src")
210        .match(/youtu|vimeo/)
211    ) {
212      $(this).parent(".img").addClass("embed");
213    }
214  });
215
216  if ($("[data-equalizer]").length > 0) {
217    $("[data-equalizer]").each(function (ind) {
218      var maxHeight = 0;
219      $(this)
220        .find("[data-equalizer-column]")
221        .each(function (ind) {
222          if ($(this).outerHeight() > maxHeight) {
223            maxHeight = $(this).outerHeight();
224          }
225        })
226        .height(maxHeight);
227    });
228  }
229
230  // fix that stupid powerpress subscribe Widget
231  if ($(".pp-sub-widget").length > 0) {
232    $(".pp-sub-widget").addClass("pp-sub-widget-wott");
233    // make the headline just say "Subscribe"
234    $(".pp-sub-widget .pp-sub-h").html("Subscribe");
235    $(".pp-sub-btn").each(function (ind) {
236      $(this).addClass("pp-sub-btn-wott");
237      $(this).find(".pp-sub-ic").remove();
238      var dest = $(this).html();
239      $(this).html(dest.replace("on ", ""));
240    });
241  }
242});
243
244/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
245
246
247- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -  */
248
249function onYouTubeIframeAPIReady() {
250  jQuery("[data-youtube-id]").each(function (index) {
251    var this_youtube_id = jQuery(this).data("youtube-id");
252    window["player" + index] = new YT.Player("featured-youtube-" + index, {
253      height: "390",
254      width: "640",
255      videoId: this_youtube_id,
256      controls: 0,
257      loop: 1,
258      modestbranding: 1,
259      playsinline: 1,
260      events: {
261        onReady: onPlayerReady,
262        onStateChange: onPlayerStateChange,
263      },
264    });
265  });
266  // var youtube_id = jQuery("[data-youtube-id]")
267  //   .first()
268  //   .data("youtube-id");
269  //
270  // player = new YT.Player("featured-youtube", {
271  //   height: "390",
272  //   width: "640",
273  //   videoId: youtube_id,
274  //   controls: 0,
275  //   loop: 1,
276  //   modestbranding: 1,
277  //   playsinline: 1,
278  //   events: {
279  //     onReady: onPlayerReady,
280  //     onStateChange: onPlayerStateChange
281  //   }
282  // });
283}
284
285// 4. The API will call this function when the video player is ready.
286function onPlayerReady(event) {
287  event.target.setVolume(0);
288  event.target.playVideo();
289}
290
291// 5. The API calls this function when the player's state changes.
292//    The function indicates that when playing a video (state=1),
293//    the player should play for six seconds and then stop.
294var done = false;
295function onPlayerStateChange(event) {
296  if (event.data === YT.PlayerState.ENDED) {
297    event.target.playVideo();
298  }
299}
300function stopVideo() {
301  //player.stopVideo();
302}
303function sayHello() {
304  console.log("**************************************");
305  console.log("**   W E  O W N  T H I S  T O W N   **");
306  console.log("**************************************");
307  console.log("**   W E  O W N  T H I S  T O W N   **");
308  console.log("**************************************");
309  console.log("**   W E  O W N  T H I S  T O W N   **");
310  console.log("**************************************");
311
312  console.log("          that means you too");
313}

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.