Created
September 12, 2017 17:34
-
-
Save jonyrock/b2a2310dd5ddfabe7857a3e653f8678f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var _updateBundleTag = 4073, | |
MemberSettings, __extends, sb; | |
(function(n) { | |
var t = function() { | |
function n() {} | |
return n.getDayName = function(n) { | |
var t = this.getDayName2(n); | |
return t.charAt(0) == "S" ? "<b>" + t + "<\/b>" : t | |
}, n.getDayName2 = function(n) { | |
return n instanceof Date || (n = new Date(n)), ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"][n.getDay() % 7] | |
}, n.getMonthName = function(n) { | |
return n instanceof Date || (n = new Date(n)), ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"][n.getMonth() % 12] | |
}, n.getLongMonthName = function(n) { | |
return n instanceof Date || (n = new Date(n)), ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"][n.getMonth() % 12] | |
}, n.formatTime = function(n) { | |
var t = n.getHours(), | |
i = n.getMinutes(); | |
return (t % 12 == 0 ? 12 : t % 12) + ":" + (i < 10 ? "0" : "") + i.toString() + " " + (t < 12 ? "am" : "pm") | |
}, n.getHourText = function(n) { | |
n instanceof Date || (n = new Date(n)); | |
var t = n.getHours(); | |
return t === 0 ? "12am" : t === 12 ? "12pm" : t % 12 + (t < 12 ? "am" : "pm") | |
}, n.getDateText = function(n) { | |
var t = new Date(n).getDate(); | |
return t % 10 == 1 && t != 11 ? t + "st" : t % 10 == 2 && t != 12 ? t + "nd" : t % 10 == 3 && t != 13 ? t + "rd" : t + "th" | |
}, n.getDateFromYMD = function(n) { | |
return new Date(n.substr(0, 4) + "-" + n.substr(4, 2) + "-" + n.substr(6, 2) + "T00:00") | |
}, n | |
}(); | |
n.Dates = t | |
})(sb || (sb = {})), | |
function(n) { | |
var t = function() { | |
function n() {} | |
return n.isHires = function() { | |
var n = window.devicePixelRatio || window.screen.deviceXDPI / window.screen.logicalXDPI || 1; | |
return n > 1 | |
}, n | |
}(); | |
n.Graphics = t | |
}(sb || (sb = {})), | |
function(n) { | |
var t = function() { | |
function t() {} | |
return t.getCdn = function(n) { | |
return "//res" + n + ".seabreeze.com.au" | |
}, t.getApi = function(t) { | |
return n.apiUrl + "/" + t + ".ashx?apiKey=" + n.apiKey | |
}, t.go = function(n) { | |
location.href = n | |
}, t.redirect = function(n) { | |
this.go(n) | |
}, t.goBack = function() { | |
history.back() | |
}, t.stripQuery = function(n) { | |
var t = n.indexOf("?"); | |
return t > 0 ? n = n.substr(0, t) : n | |
}, t.getParam = function(n) { | |
var r = window.location.href, | |
i, t; | |
return (n = n.replace(/[\[\]]/g, "\\$&"), i = new RegExp("[?&]" + n + "(=([^&#]*)|&|#|$)"), t = i.exec(r), !t) ? "" : t[2] ? decodeURIComponent(t[2].replace(/\+/g, " ")) : "" | |
}, t.getPathSegmentAfter = function(n) { | |
for (var i = window.location.pathname.split("/"), t = 0; t < i.length; t++) | |
if (i[t].toLowerCase() == n.toLowerCase()) return i[t]; | |
throw new Error("AfterPathNotFound"); | |
}, t.getLastPathSegment = function() { | |
var n = window.location.pathname.split("/"); | |
if (n.length > 0) return n[n.length - 1]; | |
throw new Error("LastPathNotFound"); | |
}, t.encodeHtml = function(n) { | |
return $("<div/>").text(n).html() | |
}, t | |
}(); | |
n.Network = t | |
}(sb || (sb = {})), | |
function(n) { | |
var t = function() { | |
function n() {} | |
return n.isSize = function(n) { | |
return $("#" + n).is(":visible") | |
}, n.getSize = function() { | |
return n.isSize("xs") ? "xs" : n.isSize("sm") ? "sm" : n.isSize("md") ? "md" : "lg" | |
}, n | |
}(); | |
n.Responsive = t | |
}(sb || (sb = {})), | |
function(n) { | |
var t = function() { | |
function n() {} | |
return n.reloadOnWake = function() { | |
var t = 1e4, | |
n = (new Date).getTime(); | |
setInterval(function() { | |
var i = (new Date).getTime(); | |
i > n + t + 2e3 ? (n = i, location.reload(!0)) : n = i | |
}, t) | |
}, n.showWait = function() { | |
$(".wait-overlay").show(); | |
$("body").addClass("wait") | |
}, n.hideWait = function() { | |
$(".wait-overlay").hide(); | |
$("body").removeClass("wait") | |
}, n.showWaitCursor = function() { | |
$("body").addClass("wait") | |
}, n.hideWaitCursor = function() { | |
$("body").removeClass("wait") | |
}, n.notify = function(n, t) { | |
t === void 0 && (t = 0); | |
$().toast("info", { | |
text: n, | |
sticky: t == 0 | |
}) | |
}, n.successMsg = function(n, t) { | |
t === void 0 && (t = 0); | |
$().toast("success", { | |
text: n, | |
sticky: t == 0 | |
}) | |
}, n.errorMsg = function(n, t) { | |
t === void 0 && (t = 0); | |
$().toast("error", { | |
text: n, | |
sticky: t == 0 | |
}) | |
}, n.get = function(n) { | |
var f = $(n), | |
e, s, i, r, o; | |
if (f.length === 0) return ""; | |
var t = f[0], | |
u = t.type, | |
c = t.tagName.toLowerCase(); | |
if (u === "reset" || u === "button" || (u === "checkbox" || u === "radio") && !t.checked || (u === "submit" || u === "image") && t.form && t.form.clk != t || c === "select" && t.selectedIndex === -1) return null; | |
if (n.indexOf("input[name") > 0) { | |
for (e = [], i = 0; i < f.length; i++) f[i].attr("checked") && e.push(f[i].val()); | |
return e | |
} | |
if (c === "select") { | |
if (s = t.selectedIndex, s < 0) return null; | |
var e = [], | |
l = t.options, | |
h = u === "select-one", | |
a = h ? s + 1 : l.length; | |
for (i = h ? s : 0; i < a; i++) | |
if (r = l[i], r.selected) { | |
if (o = r.value, o || (o = r.attributes && r.attributes.value && !r.attributes.value.specified ? r.text : r.value), h) return o; | |
e.push(o) | |
} | |
return e | |
} | |
return $(t).val() | |
}, n.set = function(n, t) { | |
var h = $(n), | |
s, r, i, f, u; | |
if (h.length === 0) return t; | |
var e = h[0], | |
o = e.type, | |
c = e.tagName.toLowerCase(); | |
if (o === "reset" || o === "button" || o === "submit" || o === "image") return t; | |
if (n.indexOf("input[name") >= 0) | |
for (s = t.split(","), r = 0; r < h.length; r++) { | |
var l = $(h[r]), | |
p = l.val().toLowerCase(), | |
a = !1; | |
for (u = 0; u < s.length; u++) | |
if (p === s[u].toLowerCase()) { | |
a = !0; | |
break | |
} | |
l.prop("checked", a) | |
} | |
if (c === "select") { | |
var v = e.options, | |
y = o === "select-one", | |
s = t; | |
for (y || (s = t.split(",")), r = 0; r < v.length; r++) | |
if (i = v[r], f = i.value, f || (f = i.attributes && i.attributes.value && !i.attributes.value.specified ? i.text : i.value), y) { | |
if (f && f.toLowerCase() === t.toLowerCase()) return i.selected = !0, t | |
} else | |
for (u = 0; u < s.length; u++) f && f.toLowerCase() === t[u].toLowerCase() && (i.selected = !0); | |
return t | |
} | |
return c === "label" || c == "div" || c == "span" ? ($(e).html(t), t) : ($(e).val(t), t) | |
}, n.removeKids = function(n) { | |
$(n).children().remove() | |
}, n.hasTouch = function() { | |
return window.screen.width < 1025 && "ontouchstart" in window | |
}, n.isHandheld = function() { | |
var n = navigator.userAgent, | |
t; | |
return n.indexOf("Firefox") > 0 && (n += "|" + navigator.appVersion), t = n, /android.+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|meego.+mobile|midp|mmp|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino/i.test(t) || /1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(di|rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(t.substr(0, 4)) ? !0 : !1 | |
}, n.isLandscape = function() { | |
return window.innerWidth > window.innerHeight | |
}, n.isPortrait = function() { | |
return !this.isLandscape() | |
}, n | |
}(); | |
n.UI = t | |
}(sb || (sb = {})), | |
function(n) { | |
var t = function() { | |
function n() {} | |
return n.toImperialLength = function(n) { | |
return Math.floor(n) + "' " + Math.floor((n - Math.floor(n)) * 12) + """ | |
}, n | |
}(); | |
t.feetPerMetre = 3.2808399; | |
t.msPerHour = 36e5; | |
n.Units = t | |
}(sb || (sb = {})), | |
function(n) { | |
var t = function() { | |
function n() {} | |
return n.htmlEncode = function(n) { | |
return $("<div/>").text(n).html() | |
}, n.getParam = function(t) { | |
return n.getParamByUrl(t, null) | |
}, n.getParamByUrl = function(n, t) { | |
t || (t = window.location.href); | |
n = n.replace(/[\[\]]/g, "\\$&"); | |
var r = new RegExp("[?&]" + n + "(=([^&#]*)|&|#|$)"), | |
i = r.exec(t); | |
return i ? i[2] ? decodeURIComponent(i[2].replace(/\+/g, " ")) : "" : "" | |
}, n.haveStorage = function() { | |
var n = null; | |
try { | |
n = window.localStorage; | |
n.setItem("_", "_"); | |
n.removeItem("_") | |
} catch (t) { | |
n = null | |
} | |
return n != null | |
}, n.toPrecision = function(n, t) { | |
var i = n.toString(), | |
r = i.indexOf("."); | |
return r > 0 && t === 0 ? i.substr(0, r) : i.length - t >= r + t ? i.substr(0, r + t + 1) : i | |
}, n | |
}(); | |
n.Utils = t | |
}(sb || (sb = {})), | |
function(n) { | |
var t = function() { | |
function n() {} | |
return n | |
}(); | |
n.Member = t | |
}(sb || (sb = {})), | |
function(n) { | |
var r = function() { | |
function n() {} | |
return n | |
}(), | |
t, i; | |
n.Location = r; | |
t = function() { | |
function n() {} | |
return n | |
}(); | |
n.State = t; | |
i = function() { | |
function n() {} | |
return n | |
}(); | |
n.Region = i | |
}(sb || (sb = {})), | |
function(n) { | |
var t = function() { | |
function t() {} | |
return t.instance = function() { | |
return n.context = n.context || new n.Context, n.context | |
}, t.prototype.getCategory = function() { | |
var t = location.pathname.toLowerCase(), | |
n, i; | |
return t == "/" ? "home" : (n = "weather", i = ["news", "articles", "events", "forums", "media", "photos", "videos", "classifieds"], $.each(i, function(i, r) { | |
t.indexOf("/" + r) == 0 && (n = r) | |
}), n) | |
}, t.prototype.getSportChannel = function() { | |
var t = location.pathname.toLowerCase(), | |
n = ""; | |
return $.each(["general", "kitesurfing", "stand-up-paddle", "windsurfing", "surfing", "sailing", "boating", "diving", "fishing", "land-yacht-sailing"], function(i, r) { | |
t.indexOf("/" + r) >= 0 && (n = r.replace(/-/gi, " ")) | |
}), n | |
}, t | |
}(); | |
n.Context = t | |
}(sb || (sb = {})), | |
function() {}(sb || (sb = {})), | |
function(n) { | |
var t = function() { | |
function t() {} | |
return t.bindToTopOfPage = function() { | |
var i = 300, | |
t = ".toTopOfPage"; | |
$(window).scroll(function() { | |
var r = !1; | |
$(window).scrollTop() > i && (r = n.Zoom.getZoom() < 1.7); | |
r ? $(t).fadeIn("slow") : $(t).fadeOut("slow") | |
}); | |
$(t).click(function() { | |
return $("html, body").animate({ | |
scrollTop: 0 | |
}, 150), !1 | |
}) | |
}, t.centreRosBanner = function() { | |
if ($(".masthead .spono-ros").is(":visible")) { | |
var n = 10, | |
t = $(".masthead .logo").width() + n, | |
i = $(window).width() - n, | |
r = Math.min(i - t, 728), | |
u = (i - t) / 2 - r / 2 + t - n; | |
$(".masthead .spono-ros").width(r).css("left", u) | |
} | |
}, t.merge = function(n) { | |
for (var i = "", t = 0; t < n.length; t++) i += n[t]; | |
return i | |
}, t.deliverTelemetry = function() { | |
var t = this, | |
i = (new Date).getTime(); | |
setTimeout(function() { | |
$.post(n.Network.getApi(t.merge(["t", "ele", "met", "ry"])), { | |
createdUtc: n.createdUtc.getTime(), | |
domTicks: i - n.startUtc.getTime(), | |
d1: $(t.adId).length, | |
d2: $(t.adId).filter(":visible").length, | |
d3: $(t.adId2).length, | |
d4: $(t.adId2).filter(":visible").length | |
}) | |
}, 2e3) | |
}, t.onReady = function() { | |
this.adId = this.merge([".", "ad", "sby", "go", "ogl", "e"]); | |
this.adId2 = this.merge([".", "spono", "-", "spot"]); | |
$(window).resize(function() { | |
t.centreRosBanner() | |
}); | |
this.bindToTopOfPage(); | |
t.centreRosBanner(); | |
this.deliverTelemetry() | |
}, t | |
}(); | |
n.Global = t | |
}(sb || (sb = {})), | |
function(n) { | |
var i, t; | |
(function(n) { | |
n[n.Leaderboard = 72890] = "Leaderboard"; | |
n[n.MediumRect = 300250] = "MediumRect"; | |
n[n.Smartphone = 32050] = "Smartphone" | |
})(i = n.BannerSize || (n.BannerSize = {})); | |
t = function() { | |
function t() {} | |
return t.onReady = function(i) { | |
n.config.adServer == "s" ? (t.serviceUrl = i, t.refreshSlots()) : t.initDfp() | |
}, t.getNextMainAdUnit = function() { | |
return n.config.adServer == "s" ? "sb-runofsite-lb" : "sb-main-" + this.nextMainBannerIndex++ | |
}, t.getNextSideAdUnit = function() { | |
return n.config.adServer == "s" ? "sb-runofsite-mr" : "sb-side-" + this.nextSideBannerIndex++ | |
}, t.initDfp = function() { | |
var i = this; | |
googletag.cmd.push(function() { | |
n.debug && console.log("AdBanners: Defining slots & sizes"); | |
var e = googletag.sizeMapping().addSize([1200, 90], [ | |
[970, 90], | |
[728, 90] | |
]).addSize([992, 90], [728, 90]).addSize([0, 0], []).build(), | |
r = googletag.sizeMapping().addSize([768, 90], [728, 90]).addSize([0, 0], [ | |
[320, 100], | |
[320, 50] | |
]).build(), | |
f = googletag.sizeMapping().addSize([768, 100], [ | |
[300, 250], | |
[300, 600] | |
]).addSize([0, 0], [300, 250]).build(), | |
u = googletag.sizeMapping().addSize([768, 100], [ | |
[300, 250], | |
[300, 600] | |
]).addSize([0, 0], [300, 250]).build(), | |
o = googletag.sizeMapping().addSize([0, 0], [1, 1]).build(); | |
n.debug && $(".spono-spot").each(function(n, t) { | |
console.log("AdBanners: div#" + t.id + " contains adUnit " + $(t).data("slot")) | |
}); | |
i.addSlot("sb-main-ros", [ | |
[970, 90], | |
[728, 90], | |
[320, 50], | |
[320, 100] | |
], e); | |
i.addSlot("sb-main-1", [ | |
[728, 90], | |
[320, 100], | |
[320, 50] | |
], r); | |
i.addSlot("sb-main-2", [ | |
[728, 90], | |
[320, 100], | |
[320, 50] | |
], r); | |
i.addSlot("sb-main-3", [ | |
[728, 90], | |
[320, 100], | |
[320, 50] | |
], r); | |
i.addSlot("sb-main-4", [ | |
[728, 90], | |
[320, 100], | |
[320, 50] | |
], r); | |
i.addSlot("sb-main-5", [ | |
[728, 90], | |
[320, 100], | |
[320, 50] | |
], r); | |
i.addSlot("sb-main-6", [ | |
[728, 90], | |
[320, 100], | |
[320, 50] | |
], r); | |
i.addSlot("sb-main-7", [ | |
[728, 90], | |
[320, 100], | |
[320, 50] | |
], r); | |
i.addSlot("sb-side-1", [300, 250], f); | |
i.addSlot("sb-side-2", [300, 250], f); | |
i.addSlot("sb-side-3", [300, 250], u); | |
i.addSlot("sb-side-4", [300, 250], u); | |
i.addSlot("sb-side-5", [300, 250], u); | |
i.addSlot("sb-footer", [1, 1], o); | |
t.prepTargetting(googletag.pubads()); | |
googletag.pubads().enableSingleRequest(); | |
googletag.pubads().collapseEmptyDivs(); | |
googletag.enableServices() | |
}); | |
$(".spono-spot").each(function(t, i) { | |
n.debug && console.log("AdBanners: Advising Dfp of #" + $(i).attr("id")); | |
googletag.cmd.push(function() { | |
googletag.display(i.id) | |
}) | |
}) | |
}, t.addSlot = function(t, i, r) { | |
var f = $(".spono-spot").map(function(n, t) { | |
return t.id | |
}).get(), | |
u = "div-" + t; | |
if (f.indexOf(u) < 0) { | |
n.debug && console.log(u + " ignored, as no references in page: [" + f + "]"); | |
return | |
} | |
n.debug && console.log(u + " defined, sizeMap of [" + r + "], sizes of [" + i + "]"); | |
n.adSlots[u] = googletag.defineSlot("/4174145/" + t, i, u).defineSizeMapping(r).addService(googletag.pubads()) | |
}, t.prepTargetting = function(t) { | |
var i = n.Context.instance().location; | |
i && (t.setTargeting("location", i.name), t.setTargeting("state", i.state.name), t.setTargeting("region", i.region.name), n.debug); | |
t.setTargeting("category", n.Context.instance().getCategory()); | |
t.setTargeting("sportchannel", n.Context.instance().getSportChannel()); | |
n.member && t.setTargeting("interests", n.member.interests); | |
n.debug | |
}, t.getHtml = function(i, r, u) { | |
if (n.config.adServer == "g") { | |
var f = "div-" + r; | |
return "<div id='" + f + "' class='" + t.cssClass + " " + u + "' data-size='" + i + "' data-slot='" + r + "'<\/div>" | |
} | |
return "<div class='" + t.cssClass + " " + u + "' data-size='" + i + "' data-slot='" + r + "' data-src='name'><\/div>" | |
}, t.refreshSlots = function(i) { | |
if ((i === void 0 && (i = null), n.config.adServer != "g") && (n.debug && console.log("AdBanners: refreshing"), this.serviceUrl)) { | |
i == null && (i = "." + this.cssClass); | |
var r = []; | |
$.each($(i), function(n, i) { | |
var u = $(i), | |
f; | |
u.is(":visible") && (f = t.idName + t.idIndex++, u.attr("id", f), r.push({ | |
id: f, | |
size: $(i).data("size"), | |
slot: $(i).data("slot"), | |
ref: document.URL, | |
width: u.width() | |
})) | |
}); | |
r.length > 0 && $.post(this.serviceUrl, JSON.stringify(r), function(n) { | |
$.each(n, function(n, t) { | |
$("#" + t.id).html(t.html) | |
}) | |
}) | |
} | |
}, t | |
}(); | |
t.serviceUrl = null; | |
t.cssClass = "spono-spot"; | |
t.idName = "_spono_slot_"; | |
t.idIndex = 1; | |
t.nextMainBannerIndex = 3; | |
t.nextSideBannerIndex = 3; | |
n.AdBanners = t | |
}(sb || (sb = {})), | |
function(n) { | |
var t = function() { | |
function t() {} | |
return t.send = function(t) { | |
var u = this, | |
i = $(this.selector), | |
f = window.grecaptcha, | |
e, r; | |
$("#pm-from").val(n.Members.getMemberName()); | |
$("#pm-to").val(t); | |
$("#pm-to").prop("disabled", t != ""); | |
r = n.Members.isAuthenticated(); | |
$(".visible-auth").show(r); | |
$(".visible-unauth").show(!r); | |
i.on("shown.bs.modal", function() { | |
var n = t == "" ? "#pm-to" : "#pm-from"; | |
$(n).focus(); | |
e = f.render("recaptcha", { | |
sitekey: "6LdsbicTAAAAANklCehBfBTRoa_DvC3QCR-Tyv6U" | |
}) | |
}); | |
$(this.selector).modal("show"); | |
$("#pm-send").click(function() { | |
var t = { | |
a: "sendMsg", | |
toName: n.UI.get("#pm-to"), | |
fromEmail: n.UI.get("#pm-from-email"), | |
subject: n.UI.get("#pm-subject"), | |
message: n.UI.get("#pm-message"), | |
recaptcha: f.getResponse(e) | |
}; | |
n.UI.showWait(); | |
$.post(n.Network.getApi("Members"), t).done(function(t) { | |
t.success == 0 ? u.err(t.resultText) : (i.modal("hide"), n.UI.notify(t.message)) | |
}).fail(function() { | |
u.err("There was an error sending your message - try again?") | |
}) | |
}); | |
$("#pm-cancel").click(function() { | |
i.modal("hide") | |
}) | |
}, t.err = function(t) { | |
n.UI.set("#pm-err", t); | |
$(this.selector + " .alert").removeClass("hidden") | |
}, t | |
}(); | |
t.selector = "#sendMessageModal"; | |
n.Message = t | |
}(sb || (sb = {})), | |
function(n) { | |
n[n.Undefined = 0] = "Undefined" | |
}(MemberSettings || (MemberSettings = {})), | |
function(n) { | |
var t = function() { | |
function t() {} | |
return t.isAuthenticated = function() { | |
var n = this.getMemberName(); | |
return n && n.length > 0 | |
}, t.getMemberName = function() { | |
var n = /Name=(.*?)&/.exec(Cookies.get("Snitz00User")); | |
return n == null ? null : n[1] | |
}, t.getPasswordToken = function() { | |
var n = /PWord=(.*?)&/.exec(Cookies.get("Snitz00User")); | |
return n == null ? null : n[1] | |
}, t.saveSetting = function(t, i) { | |
this.isAuthenticated() && n.member != null && (n.member.settings[t] = i, $.post(n.Network.getApi("Members"), { | |
a: "saveSetting", | |
id: t, | |
value: i | |
})) | |
}, t.getSetting = function(t, i) { | |
if (i === void 0 && (i = ""), this.isAuthenticated() && n.member != null) { | |
var r = n.member.settings[t]; | |
return r == undefined ? i : r | |
} | |
return i | |
}, t.loginOnReady = function() { | |
$("#memberName").focus() | |
}, t.recoverOnReady = function() { | |
$("#memberName").focus() | |
}, t.registerOnReady = function() { | |
$("#memberName").focus() | |
}, t | |
}(); | |
n.Members = t | |
}(sb || (sb = {})), | |
function(n) { | |
var t = function() { | |
function t() {} | |
return t.browseOnReady = function() { | |
$("#action-clear").click(function() { | |
$("#action").val("clear"); | |
$("form").submit() | |
}); | |
$("#createAdvert").click(function() { | |
n.Network.redirect($("#createAdvert").data("url")) | |
}) | |
}, t.itemOnReady = function(t) { | |
$(".photos .item").mouseenter(function(n) { | |
$(".primary").attr("src", $(n.currentTarget).data("url")); | |
$(n.currentTarget).addClass("current") | |
}); | |
$(".photos .item").mouseleave(function(n) { | |
$(n.currentTarget).removeClass("current") | |
}); | |
$("#sendMsg").click(function(t) { | |
n.Message.send($(t.currentTarget).data("name")) | |
}); | |
$.each(t.images, function(n, t) { | |
(new Image).src = t | |
}) | |
}, t.homeOnReady = function() { | |
$(".featured").slick({ | |
dots: !0, | |
infinite: !1, | |
speed: 300, | |
slidesToShow: 4, | |
slidesToScroll: 4, | |
responsive: [{ | |
breakpoint: 1024, | |
settings: { | |
slidesToShow: 3, | |
slidesToScroll: 3, | |
infinite: !0, | |
dots: !0 | |
} | |
}, { | |
breakpoint: 600, | |
settings: { | |
slidesToShow: 2, | |
slidesToScroll: 2 | |
} | |
}, { | |
breakpoint: 480, | |
settings: { | |
slidesToShow: 1, | |
slidesToScroll: 1 | |
} | |
}] | |
}) | |
}, t.searchOnReady = function(n) { | |
var i = this; | |
this.makes = n; | |
$(".selectState").click(function(n) { | |
n.preventDefault(); | |
$(".selectState-dropdown").slideToggle() | |
}); | |
$(".selectState-dropdown li").click(function(n) { | |
i.selectedState = $(n.currentTarget).text(); | |
$(".selectState-dropdown").slideUp() | |
}); | |
$(".searchBtn").click(function() { | |
var n = $(".searchBox").val().trim(); | |
if (n == "") return $(".searchBox").attr("placeholder", "Enter something to search for..."), !1 | |
}); | |
$(".searchBox").keypress(function(n) { | |
n.keyCode == 13 && $(".searchBtn").click() | |
}); | |
$(".advert-home .search .advanceSearch a").click(function(n) { | |
n.preventDefault(); | |
$(".advert-home .advancedSearch").slideToggle(); | |
$("html,body").animate({ | |
scrollTop: $(".advert-home .advancedSearch").offset().top | |
}, "slow") | |
}); | |
$(".advert-home .advancedSearch #close button").click(function() { | |
$(".advert-home .advancedSearch").slideToggle(); | |
$("html,body").animate({ | |
scrollTop: $(".advert-home .search .advanceSearch a").offset().top - 100 | |
}, "slow") | |
}); | |
$(".advancedSearch #categoryId").change(function() { | |
return t.fillMakes(), !1 | |
}); | |
this.fillMakes() | |
}, t.fillMakes = function() { | |
var n, t, i = $("#categoryId").val(), | |
r, u, f; | |
for (i = i >= 320 && i <= 399 ? 320 : Math.floor(i / 100) * 100, r = $("#make"), r.empty(), r.append("<option value='-1'>All Makes<\/option>"), u = -1, f = "", n = 0; n < this.makes.length; n++) | |
if (this.makes[n][0] == i) { | |
for (u = n, t = this.makes[u], n = 1; n < t.length; n++) r.append("<option value='" + t[n] + "' " + (t[n] == f ? "selected" : "") + ">" + t[n] + "<\/option>"); | |
break | |
} | |
}, t.toggleWatch = function(t) { | |
var i = "/images/icons/fave2.gif", | |
r = "/images/icons/fave1.gif"; | |
n.UI.showWaitCursor(); | |
$.ajax({ | |
url: "/Members/Classifieds/Service.ashx?a=watch&id=" + t, | |
dataType: "xml", | |
type: "post", | |
success: function(n) { | |
var u = $(n).find("watched").text(); | |
u == "-1" ? alert("You'll need to login to watch adverts...visit the Members menu to login/join... :-)") : $("#watch" + t).attr("src", u == "1" ? i : r) | |
} | |
}).always(function() { | |
n.UI.hideWaitCursor() | |
}) | |
}, t.openFrame = function(n) { | |
$(".msgHolder").show(); | |
$(".msgFrame").hide(); | |
$(".loading").show(); | |
$(".msgFrame").attr({ | |
src: n | |
}) | |
}, t.advertControlOnReady = function() { | |
$(".clsWatchItem").click(function(t) { | |
n.Classifieds.toggleWatch($(t.target).data("id")) | |
}); | |
$(".clsImageSlides").slick({ | |
infinite: !0, | |
slidesToShow: 1, | |
slidesToScroll: 1, | |
speed: 1, | |
touchThreshold: 10 | |
}); | |
$(".clsItemThumbs img").click(function() { | |
$(".clsImageSlides").slick("slickGoTo", $(this).data("index")) | |
}); | |
$(".clsItemThumbs img").mouseenter(function() { | |
$(".clsImageSlides").slick("slickGoTo", $(this).data("index")) | |
}); | |
$(".msgHolder").prependTo($("body")); | |
$(".showPopup").click(function(n) { | |
var i = $(n.currentTarget).attr("href"); | |
return t.openFrame(i), n.stopPropagation(), !1 | |
}); | |
$(".msgFrame").on("load", function() { | |
var n = $(".msgFrame").attr("src"); | |
n == "" ? ($(".msgFrame").hide(), $(".msgHolder").hide(), $(".showPopup").focus(), document.activeElement.blur()) : ($(".loading").hide(), $(".msgFrame").show(), $(window).scrollTop(3)) | |
}) | |
}, t | |
}(); | |
t.makes = null; | |
t.selectedCategory = ""; | |
t.selectedState = ""; | |
n.Classifieds = t | |
}(sb || (sb = {})), | |
function(n) { | |
var t = function() { | |
function t() {} | |
return t.onReady = function() { | |
this.bindEvents(); | |
this.getAdvert(n.Network.getLastPathSegment()) | |
}, t.getAdvert = function(t) { | |
var i = this, | |
r = { | |
xdomain: n.xDomain, | |
id: t, | |
a: "getAdvert", | |
lookups: 1 | |
}; | |
n.UI.showWait(); | |
$.post(n.Network.getApi("Classifieds"), r).always(function() { | |
n.UI.hideWait() | |
}).done(function(n) { | |
i.data = n; | |
i.advert = n.adverts[0]; | |
i.bindData() | |
}).fail(function() { | |
n.UI.notify("Failed to save. Retry?") | |
}) | |
}, t.bindEvents = function() { | |
var n = this; | |
$("#save").click(function() { | |
return n.saveForm() | |
}); | |
$("input[name=lengthType]").change(function(i) { | |
n.advert.lengthType = $(i.target).val(); | |
t.bindMeasurements() | |
}); | |
$("#toTop").click(function() { | |
return n.saveForm() | |
}); | |
$("#resurrect").click(function() { | |
return n.saveForm() | |
}) | |
}, t.bindData = function() { | |
var t = this.advert; | |
n.UI.set("#categoryName", t.categoryName); | |
n.UI.set("#model", t.model); | |
n.UI.set("#year", t.year); | |
n.UI.set("#size", t.size); | |
n.UI.set("#sizeUnits", t.sizeUnit); | |
n.UI.set("#description", t.description); | |
n.UI.set("#stockId", t.stockId); | |
n.UI.set("#price", t.price); | |
n.UI.set("#contactName", t.contactName); | |
n.UI.set("#phone1", t.phone1); | |
n.UI.set("#email", t.email); | |
n.UI.set("#stateId", t.stateId); | |
n.UI.set("#suburb", t.suburb); | |
n.UI.set("#deliveryOption", t.deliveryOption); | |
n.UI.set("input[name='paymentOptions']", t.paymentOptions); | |
$(".stockRow").toggle(this.data.options.memberLevel >= 100); | |
$("#makeId").hide(); | |
$("#make").hide(); | |
this.data.lookups.makeType == "List" ? ($.each(this.data.lookups.makes, function(n, t) { | |
$("#makeId").append($("<option><\/option>").attr("value", t.id).text(t.text)) | |
}), $("#makeId").show(), n.UI.set("#makeId", t.makeId)) : this.data.lookups.makeType == "Text" && (n.UI.set("#make", t.make), $("#make").show()); | |
$("#make").prop("disabled", this.data.options.canEditMake == 0); | |
$("#makeId").prop("disabled", this.data.options.canEditMake == 0); | |
$("#model").prop("disabled", this.data.options.canEditModel == 0); | |
n.UI.set("#paidLabel", "Premium Listing - $" + this.data.lookups.category.price); | |
this.bindMeasurements() | |
}, t.bindMeasurements = function() { | |
var t = this.advert, | |
u = this.data.lookups.category, | |
i, r; | |
$(".lengthRow").toggle(u.showLength != 0); | |
u.showLength != 0 && (i = t.lengthType == "metric", $("#metricInput").toggle(i), $("#imperialInput").toggle(!i), $("#lengthMetric").prop("checked", i), $("#lengthImperial").prop("checked", !i), i ? (n.UI.set("#metric", t.lengthValue), n.UI.set("#metricUnits", u.metricLengthUnit)) : (n.UI.set("#feet", Math.floor(t.lengthValue)), r = t.lengthValue, r = r.indexOf(".") > 0 ? r.substr(r.indexOf(".") + 1).substr(0, 2) : "0", n.UI.set("#inches", r))); | |
$(".sizeRow").toggle(u.showSize != 0); | |
u.showSize != 0 && (n.UI.set("#sizeTitle", t.sizeTitle), n.UI.set("#sizeUnits", t.sizeUnits), n.UI.set("#size", Math.abs(t.size) < .001 ? "" : t.size.ToString())) | |
}, t.saveForm = function() { | |
var t = { | |
a: "postAdvert", | |
apiKey: "2FC32786-3166-404E-89F5-1815879C3BF3", | |
advertId: this.advert.advertId, | |
categoryId: this.advert.categoryId, | |
makeId: n.UI.get("#makeId"), | |
make: n.UI.get("#make"), | |
model: n.UI.get("#model"), | |
year: n.UI.get("#year"), | |
lengthType: n.UI.get("input[name='lengthType']:checked"), | |
description: n.UI.get("#description"), | |
stockID: n.UI.get("#stockId"), | |
price: n.UI.get("#price"), | |
contactName: n.UI.get("#contactName"), | |
phone1: n.UI.get("#phone1"), | |
stateId: n.UI.get("#stateId"), | |
suburb: n.UI.get("#suburb"), | |
paymentOptions: n.UI.get("input[name='paymentOptions']:checked"), | |
deliveryOption: n.UI.get("#deliveryOption"), | |
levelId: n.UI.get("input[name='levelId']:checked") | |
}, | |
r = this.data.lookups.category, | |
f, i, u; | |
r.showLength != 0 && (t.lengthType == "metric" ? (t.length = n.UI.get("#metric"), t.lengthUnits = r.metricLengthUnit) : (f = parseFloat(n.UI.get("#feet")), i = parseFloat(n.UI.get("#inches")), (i < 0 || i > 11) && (i = 0), u = f + "." + i, i == 10 && (u += "1"), t.length = u, t.lengthUnits = r.imperialLengthUnit)); | |
n.UI.showWait(); | |
$.post(n.Network.getApi("Classifieds"), t).always(function() { | |
n.UI.hideWait() | |
}).done(function(t) { | |
console.log(t); | |
n.UI.notify("Success!") | |
}).fail(function(t, i, r) { | |
n.UI.notify("Retry? Error returned " + i + ", " + r) | |
}) | |
}, t.imageHandler = function() {}, t | |
}(); | |
n.ClassifiedsItemEdit = t | |
}(sb || (sb = {})), | |
function(n) { | |
var t = function() { | |
function n() {} | |
return n.headlinesOnReady = function() {}, n | |
}(); | |
n.Content = t | |
}(sb || (sb = {})), | |
function(n) { | |
var t = function() { | |
function n() {} | |
return n.applyFilters = function() { | |
if (this.sportFilter == "All" && this.stateFilter == "All") $(".eventRow").show(); | |
else { | |
$(".eventRow").hide(); | |
var n = this.sportFilter == "All" ? $(".eventRow") : $(".sportCol:contains('" + this.sportFilter + "')").parent(), | |
t = this.stateFilter == "All" ? $(".eventRow") : $(".stateCol:contains('" + this.stateFilter + "')").parent(); | |
$(n).filter(t).show() | |
} | |
$(".sportFilter").removeClass("active"); | |
$(".sportFilter:contains('" + this.sportFilter + "')").addClass("active"); | |
$(".stateFilter").removeClass("active"); | |
$(".stateFilter:contains('" + this.stateFilter + "')").addClass("active"); | |
this.setFilters(this.sportFilter, this.stateFilter) | |
}, n.setFilters = function(n, t) { | |
var i, r; | |
t == "Australia" && (t = "All"); | |
Cookies.set(".sportFilter", n, { | |
path: "/Events" | |
}); | |
Cookies.set(".stateFilter", t, { | |
path: "/Events" | |
}); | |
i = "/Events"; | |
t != "" && n != "" && (t != "" && (i += "/" + t), n != "" && (i += "/" + n)); | |
i != location.href && (r = n + " events in " + (t == "All" ? "Australia" : t), window.history.pushState({}, r, i), document.title = r) | |
}, n.headlinesOnReady = function() { | |
this.sportFilter = Cookies.get(".sportFilter"); | |
this.stateFilter = Cookies.get(".stateFilter"); | |
this.sportFilter || (this.sportFilter = "All"); | |
this.stateFilter || (this.stateFilter = "All"); | |
$(".sportFilter").click(function(t) { | |
return n.sportFilter = $(t.target).html(), n.applyFilters(), !1 | |
}); | |
$(".stateFilter").click(function(t) { | |
return n.stateFilter = $(t.target).html(), n.applyFilters(), !1 | |
}); | |
this.applyFilters() | |
}, n | |
}(); | |
n.Events = t | |
}(sb || (sb = {})), | |
function(n) { | |
var t = function() { | |
function t() { | |
this.confirmDelete = !0; | |
this.editor = null; | |
this.postbackUrl = null | |
} | |
return t.subscribeToTopic = function(t, i) { | |
if (!n.Members.isAuthenticated()) { | |
n.UI.errorMsg("<a rel='nofollow' href='/Login?ReturnUrl=" + encodeURIComponent(location.pathname) + "'>Please login first...<\/a>", 500); | |
return | |
} | |
var r = $(t.target).data("id"); | |
n.UI.showWaitCursor(); | |
$.post("/forums/Subscribe/" + r, {}, function(t) { | |
var r = t == "1"; | |
r ? n.UI.successMsg("You are now subscribed to this topic.", 500) : n.UI.successMsg("You are no longer subscribed to this topic.", 500); | |
i && i(r) | |
}).always(function() { | |
n.UI.hideWaitCursor() | |
}) | |
}, t.categoryForumsOnReady = function() { | |
var n = this; | |
$(".forum-action-expand").click(function(t) { | |
n.showExtras(t.target, n.toggleShowExtras()) | |
}); | |
this.showExtras($(".forum-action-expand")[0], this.getShowExtras()) | |
}, t.topicPostsOnReady = function(t) { | |
var o = this, | |
f = new n.Forums, | |
u, r, e, i; | |
f.confirmDelete = t.confirmDelete; | |
$(".ratePanel").click(function(n) { | |
$(n.target).next().children().first().click() | |
}); | |
$(".action-subscribe").click(function(n) { | |
o.subscribeToTopic(n, function(t) { | |
$(n.target).html(t ? "Unsubscribe" : "Subscribe") | |
}) | |
}); | |
$(".action-quote").click(function(t) { | |
var i = $(t.target).parent(), | |
r = i.data("id"), | |
u = i.data("type"); | |
n.ForumPost.quotePost(r, u) | |
}); | |
$(".action-reply").click(function() { | |
if (!n.Members.isAuthenticated()) { | |
n.Network.go("/Login?ReturnUrl=" + encodeURIComponent(location.href)); | |
return | |
} | |
n.ForumPost.doShowEditor() | |
}); | |
$(".action-login").attr("href", "/Login?ReturnUrl=" + encodeURIComponent(location.href)); | |
$(".action-like").click(function(t) { | |
function u(n, t) { | |
$(i).html(t); | |
$(i).fadeIn(353); | |
setTimeout(function() { | |
$(i).fadeOut(1e3) | |
}, 2353) | |
} | |
var r = $(t.target).parent().data("id"), | |
f = $(t.target).parent().data("type") === "t" ? 1 : 2, | |
e = "/Members/Profile/Rate.aspx?s=" + f + "&id=" + r + "&r=1", | |
i = "#thumbAnswer" + r; | |
n.UI.showWaitCursor(); | |
u(i, "Voting..."); | |
$.getJSON(e, {}).done(function(n) { | |
u(i, n.msg); | |
$("#rateGraph" + r).animate({ | |
width: n.percent + "%" | |
}, 1e3) | |
}).fail(function(n, t, r) { | |
u(i, "Oops - our error."); | |
console.error(t + ":" + r) | |
}).always(function() { | |
n.UI.hideWaitCursor() | |
}) | |
}); | |
$(".action-edit").click(function(t) { | |
var i = $(t.target).parent().data("id"), | |
r; | |
r = $(t.target).parent().data("type") === "t" ? "/forums/EditTopic/" + i : "/forums/EditReply/" + i; | |
n.Network.redirect(r) | |
}); | |
$(".action-delete").click(function(n) { | |
var i = !0, | |
t, r; | |
return f.confirmDelete && (i = confirm("Delete - are you sure?")), i && (t = $(n.target).parent().data("id"), r = $(n.target).parent().data("type") === "t" ? "/forums/DeleteTopic/" + t : "/forums/DeleteReply/" + t, $("[data-id=p-" + t + "]").load(r)), !1 | |
}); | |
$(".action-cancel").click(function() { | |
n.ForumPost.doHideEditor() | |
}); | |
$(".action-email").click(function(t) { | |
var i = $(t.currentTarget), | |
r = i.data("url") + "?member=" + i.data("memberto"); | |
return n.Forums.openFrame(r), t.stopPropagation(), !1 | |
}); | |
$(".action-postLink").click(function(t) { | |
var r = $(t.currentTarget), | |
u, i; | |
return (t.stopPropagation(), u = $(".actioned-postLink").length > 0, $(".actioned-postLink").remove(), u) ? !1 : (i = n.Utils.htmlEncode(location.protocol + "//" + location.host + ("/Forums/Link/" + r.data("id"))), $(r).parent().append($("<div class='actioned-postLink'>Use this address to link directly to this post.<br /><input type='text' value='" + i + "'/><br/>" + ("Or, <a id='share_facebook' href='http://www.facebook.com/sharer.php?u=" + i + "' target='_blank' rel='noopener nofollow'><u>share on facebook<\/u><\/a><\/div>"))), $(".actioned-postLink input").focus(), $(".actioned-postLink input").select(), !1) | |
}); | |
$(".offsite-link").mousedown(function(n) { | |
if (n.button === 2) { | |
var t = n.target.href.indexOf("url="); | |
t > 0 && (n.target.href = decodeURIComponent(n.target.href.substr(t + 4))) | |
} | |
}); | |
$(".QuoteBoxExpand").click(function(n) { | |
$(n.currentTarget).hide(); | |
$(n.currentTarget).parent().css({ | |
"max-height": "none" | |
}) | |
}); | |
$(".msgHolder").prependTo($("body")); | |
$(".msgFrame").on("load", function() { | |
var n = $(".msgFrame").attr("src"); | |
n == "" ? ($(".msgFrame").hide(), $(".msgHolder").hide(), $(".btn-success").focus(), document.activeElement.blur()) : ($(".loading").hide(), $(".msgFrame").show(), $(window).scrollTop(3)) | |
}); | |
$(".msgModal").on("click", function() { | |
window.closeFrame() | |
}); | |
try { | |
if (u = window.location.hash, u.length > 1) | |
if (u == "#lastpost") i = $("#lastpost"), $(".forum-row-read").text("Last post in this topic"), $("html, body").animate({ | |
scrollTop: i.offset().top | |
}), $(".forum-row-read").appendTo(i), $(".forum-row-read").removeClass("hidden"); | |
else | |
for (r = parseInt(u.substr(1)), e = r > 5e3; r > 0;) { | |
if (i = $("#" + r), i.length > 0) { | |
$("html, body").animate({ | |
scrollTop: i.offset().top | |
}); | |
$(".forum-row-read").appendTo(i); | |
e && $(".forum-row-read").text("[ Direct Link Post ]"); | |
$(".forum-row-read").removeClass("hidden"); | |
$(".forum-row-read").parent().css("text-decoration", "none"); | |
break | |
} | |
r-- | |
} | |
} catch (s) { | |
console.error("HashFail:" + s) | |
} | |
n.ForumBookmarks.save(t.topicID, t.nextPage, t.nextIndex, t.Url); | |
n.ForumPost.doPrepareEditor(""); | |
Cookies.set("topic", t.topicID, { | |
path: "/forums" | |
}); | |
this.insertSponos() | |
}, t.insertSponos = function() { | |
n.debug && console.log("Forums: insert sponos"); | |
var r = screen.height, | |
f = r * 3, | |
e = 8, | |
u = 0, | |
t = r * 2, | |
i = 0; | |
$(".forum-row").each(function(r, o) { | |
var s = $(o).offset().top; | |
t += s - u; | |
i++; | |
u = s; | |
(t > f || i >= e) && ($('<div class="row forum-row-sponoouter"><div class="col-xs-12 col-md-8 col-md-push-2">' + n.AdBanners.getHtml(n.BannerSize.Leaderboard, n.AdBanners.getNextMainAdUnit(), "forum-row-spono") + "<\/div><\/div>").insertAfter(o), t = 0, i = 0) | |
}) | |
}, t.openFrame = function(n) { | |
$(".msgHolder").show(); | |
$(".msgFrame").hide(); | |
$(".loading").show(); | |
$(".msgFrame").attr({ | |
src: n | |
}) | |
}, t.postOnReady = function() { | |
$(".action-cancel").click(function() { | |
n.Network.goBack() | |
}); | |
n.ForumPost.doPrepareEditor($("#initialRichText").attr("value")); | |
$("#subject").length > 0 ? $("#subject").focus() : n.ForumPost.focusEditor() | |
}, t.forumTopicsOnReady = function() { | |
this.onTopicListReady() | |
}, t.activeTopicsOnReady = function() { | |
this.onTopicListReady(); | |
$("#minutes").change(function() { | |
location.href = "/forums/ActiveTopics?minutes=" + $("#minutes").val() | |
}); | |
var t = n.Network.getParam("minutes"); | |
t !== "" && $("#minutes").val(t); | |
$(".filters").change(function() { | |
var t = ""; | |
$(".filterBox input:checked").each(function(n, i) { | |
t += i.value + "," | |
}); | |
Cookies.set("ActiveCats", t, { | |
path: "/forums", | |
expires: 1e4 | |
}); | |
n.Network.go("/forums/ActiveTopics?minutes=" + n.Network.getParam("minutes")) | |
}) | |
}, t.searchOnReady = function() { | |
this.onTopicListReady() | |
}, t.onTopicListReady = function() { | |
var n = this; | |
$(".forum-action-expand").click(function(t) { | |
n.showExtras(t.target, n.toggleShowExtras()) | |
}); | |
this.buildPaging(); | |
this.showExtras($(".forum-action-expand")[0], this.getShowExtras()); | |
$(".action-login").attr("href", "/Login?ReturnUrl=" + encodeURIComponent(location.href)); | |
$(".action-subscribe").click(function(t) { | |
n.subscribeToTopic(t, function() { | |
$(t.target).fadeOut(300) | |
}) | |
}); | |
$("#topic" + Cookies.get("topic")).parent().parent().addClass("just-read") | |
}, t.toggleShowExtras = function() { | |
return this.setShowExtras(!this.getShowExtras()) | |
}, t.getShowExtras = function() { | |
var n = Cookies.get("showExtras"); | |
return n === "1" || n === undefined | |
}, t.setShowExtras = function(n) { | |
return Cookies.set("showExtras", n ? "1" : 0, { | |
path: "/forums", | |
expires: 5e3 | |
}), n | |
}, t.showExtras = function(n, t) { | |
t == "1" ? $(".extras").removeClass("hidden") : $(".extras").addClass("hidden"); | |
$(n).html(t == "1" ? "Detailed" : "Compact"); | |
this.setShowExtras(t) | |
}, t.buildPaging = function() { | |
var n = $(".extras-paging"); | |
n.each(function(n, t) { | |
var r = $(t).data("pages"); | |
if (r > 1) { | |
for (var e = $(t).data("url"), o = (e.indexOf("?") > 0 ? "&" : "?") + "page=", f = "<img src='/Assets/icons/pageHollow.png' /> ", i = void 0, s = 3, u = 3, i = 1; i <= Math.min(s, r); i++) f += '<a href="' + e + o + i + '">' + (i == r ? "last" : i) + "<\/a>"; | |
if (r >= s) | |
for (r - u > u && (f += " ... "), i = r - u > u ? r - u + 1 : u + 1; i <= r; i++) f += '<a href="' + e + o + i + '">' + (i == r ? "last" : i) + "<\/a>"; | |
$(t).html(f) | |
} | |
}) | |
}, t | |
}(); | |
n.Forums = t | |
}(sb || (sb = {})), | |
function(n) { | |
var t = function() { | |
function t() {} | |
return t.saveBookmarksToCloud = function() { | |
var i = this, | |
t; | |
n.Utils.haveStorage() && (t = [], $.each(localStorage, function(n, r) { | |
r.indexOf(i.bookmarkKey) >= 0 && t.push({ | |
topicID: r, | |
bookmark: JSON.parse(localStorage.getItem(r)) | |
}) | |
}), $.post(n.Network.getApi("Members"), { | |
a: "saveForumBookmarks", | |
m: n.Members.getMemberName(), | |
p: n.Members.getPasswordToken(), | |
bookmarks: t | |
})) | |
}, t.loadBookmarksFromCloud = function() { | |
n.Utils.haveStorage() && $.getJSON(n.Network.getApi("Members"), { | |
a: "getBookmarks", | |
m: n.Members.getMemberName(), | |
p: n.Members.getPasswordToken() | |
}).done(function(n) { | |
$.each(n.bookmarks, function(n, t) { | |
var i = JSON.parse(t); | |
localStorage.setItem(i.topicID, JSON.stringify(t.bookmark)) | |
}) | |
}) | |
}, t.expire = function() { | |
var r, t, i, u, f; | |
if (n.Utils.haveStorage()) | |
for (r = new Date, t = localStorage.length - 1; t >= 0; t--) i = localStorage.key(t), i.indexOf(this.bookmarkKey) >= 0 && (u = JSON.parse(localStorage.getItem(i)), f = (r.getTime() - u.lastUse) / 864e5, f > this.retainBookmarksInDays && localStorage.removeItem(i)) | |
}, t.save = function(t, i, r) { | |
var f; | |
if (n.Utils.haveStorage()) { | |
var e = this.bookmarkKey + t, | |
o = (new Date).getTime(), | |
u = localStorage.getItem(e); | |
u == undefined ? u = JSON.stringify({ | |
page: i, | |
index: r, | |
lastUse: o | |
}) : (f = JSON.parse(u), f.page = i, f.index = r, f.lastUse = o, u = JSON.stringify(f)); | |
localStorage.setItem(e, u) | |
} | |
}, t.load = function(t) { | |
var r, u, f; | |
if (n.Utils.haveStorage()) { | |
for (r = 0; r < t.length; r++) | |
if (u = t[r], f = localStorage.getItem(this.bookmarkKey + u), f != undefined) { | |
n.debug; | |
var e = JSON.parse(f), | |
o = $("#topic" + u), | |
i = "" + o.attr("href"); | |
i += i.lastIndexOf("?") > 0 ? "&" : "?"; | |
i += "page=" + e.page; | |
e.index > 3 && (i += "#" + e.index); | |
o.attr("href", i) | |
} | |
this.expire() | |
} | |
}, t | |
}(); | |
t.bookmarkKey = "forumTopicBookmark:"; | |
t.retainBookmarksInDays = 14; | |
n.ForumBookmarks = t | |
}(sb || (sb = {})), | |
function(n) { | |
var t = function() { | |
function t() {} | |
return t.ltrim = function(n) { | |
return n.replace(/^\s*/, "") | |
}, t.rtrim = function(n) { | |
return n.replace(/\s*$/, "") | |
}, t.trim = function(n) { | |
return t.rtrim(t.ltrim(n)) | |
}, t.putCursorAtEnd = function(n) { | |
return n.each(function(n) { | |
if ($(n).focus(), n.setSelectionRange) { | |
var t = $(n).val().length * 2; | |
n.setSelectionRange(t, t) | |
} else $(n).val($(n).val()); | |
n.scrollTop = 999999 | |
}) | |
}, t.clearTextEditor = function() { | |
t.isPlainTextEditor() ? t.getPostTopicControl().value = "" : t.tinymce.activeEditor.setContent("") | |
}, t.addTextToEditor = function(n) { | |
var i, r, f, u; | |
if (!t.isPlainTextEditor()) { | |
t.tinymce.activeEditor.execCommand("mceInsertContent", !1, n); | |
t.doResize(); | |
return | |
} | |
i = t.getPostTopicControl(); | |
typeof i.selectionStart != "undefined" ? (r = i.selectionStart, f = i.selectionEnd, i.value = i.value.substr(0, i.selectionStart) + n + i.value.substr(i.selectionEnd), i.focus(), i.selectionStart = r - f == 0 ? r + n.length : r, i.selectionEnd = r + n.length) : i.createTextRange && i.caretPos ? (u = i.caretPos, u.text = u.text.charAt(u.text.length - 1) == " " ? n + " " : n, i.focus(u)) : i.value += n | |
}, t.getEditorText = function() { | |
return t.isPlainTextEditor() ? t.trim(t.getPostTopicControl().value) : t.trim(t.tinymce.activeEditor.getContent()).replace(/ /g, " ") | |
}, t.setEditorFromRichText = function(i) { | |
t.isPlainTextEditor() ? (n.UI.showWaitCursor(), $.post("/forums/ConvertToPlain", { | |
message: n.Network.encodeHtml(i) | |
}, function(n) { | |
t.selectEditor(!0); | |
t.clearTextEditor(); | |
t.addTextToEditor(n + "\n\n\n"); | |
t.doCursorToEnd() | |
}, "text").always(function() { | |
n.UI.hideWaitCursor() | |
}), t.clearTextEditor(), t.addTextToEditor(i)) : (t.clearTextEditor(), t.addTextToEditor(i)) | |
}, t.setEditorFromPlainText = function(i) { | |
n.UI.showWaitCursor(); | |
$.post("/forums/ConvertToHtml", { | |
message: n.Network.encodeHtml(i) | |
}, function(n) { | |
t.selectEditor(!1); | |
t.clearTextEditor(); | |
t.addTextToEditor(n + "<br/>\n\n"); | |
t.doCursorToEnd() | |
}, "text").always(function() { | |
n.UI.hideWaitCursor() | |
}) | |
}, t.isPlainTextEditor = function() { | |
return Cookies.get("qr") == "N" | |
}, t.isRichTextEditor = function() { | |
return !t.isPlainTextEditor() | |
}, t.selectEditor = function(n) { | |
n ? (Cookies.set("qr", "N"), t.updateEditorVisibility()) : (Cookies.set("qr", "Y"), t.updateEditorVisibility()) | |
}, t.getPostTopicControl = function() { | |
return $("#plainTextEditor")[0] | |
}, t.isOkToDiscardReply = function() { | |
return t.getEditorText() == "" ? !0 : confirm("Discard your reply?") | |
}, t.validateQuickReply = function() { | |
return !0 | |
}, t.wrapMceText = function(n) { | |
t.tinymce.activeEditor.formatter.toggle(n) | |
}, t.focusEditor = function() { | |
t.isPlainTextEditor() ? $("#postTextEditor").focus() : t.tinymce.activeEditor && t.tinymce.activeEditor.focus() | |
}, t.doScrollToEditor = function() { | |
if ($(".forum-post-editor").length > 0) { | |
var n = $(".forum-post-editor").offset(); | |
$("html, body").animate({ | |
scrollTop: n.top, | |
scrollLeft: n.left | |
}) | |
} | |
}, t.doResizeCallback = function() { | |
t.isPlainTextEditor() || t.tinymce.activeEditor == null || t.tinymce.activeEditor.execCommand("mceAutoResize"); | |
t.doScrollToEditor() | |
}, t.doResize = function() { | |
setTimeout(function() { | |
t.doResizeCallback() | |
}, 100) | |
}, t.doCursorToEnd = function() { | |
if (t.isPlainTextEditor()) t.putCursorAtEnd($("#postTextEditor")); | |
else { | |
var n = t.tinymce.activeEditor; | |
n.selection.select(n.getBody(), !0); | |
n.selection.collapse(!1) | |
} | |
t.doScrollToEditor(); | |
t.focusEditor() | |
}, t.doShowEditor = function() { | |
$(".forum-post-editor").show("slow"); | |
$(".proceedPanel").hide("slow"); | |
t.doScrollToEditor(); | |
t.doResize(); | |
t.doCursorToEnd(); | |
t.focusEditor() | |
}, t.doHideEditor = function() { | |
t.clearTextEditor(); | |
$(".forum-post-editor").hide("slow"); | |
$(".proceedPanel").show("slow") | |
}, t.quotePost = function(i, r) { | |
var u = t.isPlainTextEditor() ? "/forums/QuotePostPlain" : "/forums/QuotePostHtml"; | |
return n.UI.showWaitCursor(), $.post(u, { | |
id: i, | |
type: r | |
}, function(n) { | |
t.doShowEditor(); | |
t.addTextToEditor(n); | |
t.doScrollToEditor(); | |
t.doCursorToEnd() | |
}, "text").always(function() { | |
return n.UI.hideWaitCursor() | |
}), !1 | |
}, t.closeImgModal = function() { | |
return $(".imgFrame").attr({ | |
src: "" | |
}), this.doCursorToEnd(), !1 | |
}, t.insertImages = function(n) { | |
var u, r, i; | |
if (n == null || n.length == 0) return alert("Nothing selected?"), !1; | |
for (t.closeImgModal(), u = t.isRichTextEditor(), r = 0; r < n.length; r++) i = n[r], i.indexOf("youtube") > 0 ? t.addTextToEditor(i.replace(/http:\/\/www.youtube.com\/embed\//g, "http://youtu.be/")) : u ? this.addTextToEditor("<br/>\r\n<img src='" + i + "' /><br/>\r\n") : t.addTextToEditor("\r\n" + i + "\r\n"); | |
return u ? t.addTextToEditor("<br/>\r\n<br/>\r\n") : t.addTextToEditor("\r\n\r\n"), t.doCursorToEnd(), !0 | |
}, t.updateEditorVisibility = function() { | |
t.isPlainTextEditor() ? ($(".mce-container").hide(), $("#richTextEditor").hide(), $(".richEditSelect").removeClass("tabSelected"), $("#plainTextEditor").show(), $(".plainEditSelect").addClass("tabSelected")) : ($(".mce-container").show(), $(".richEditSelect").addClass("tabSelected"), $("#plainTextEditor").hide(), $(".plainEditSelect").removeClass("tabSelected")) | |
}, t.doBeforeSubmit = function() { | |
$("#PostTopic #Message").attr("value", n.Network.encodeHtml(t.getEditorText())); | |
$("#richTextEditor").prop("disabled", !0); | |
$("#plainTextEditor").prop("disabled", !0) | |
}, t.doPrepareEditor = function(n) { | |
var i = this; | |
$(".forumEmoticonButton").click(function(n) { | |
t.isPlainTextEditor() ? t.addTextToEditor($(n.target).children().attr("alt")) : t.tinymce.activeEditor.execCommand("mceInsertContent", !1, t.tinymce.activeEditor.dom.createHTML("img", { | |
src: $(n.target).children().attr("src"), | |
"class": "forumEmoticon" | |
})) | |
}); | |
$(".forum-emoji .forum-emoticon-input").click(function(n) { | |
t.isPlainTextEditor() ? t.addTextToEditor($(n.target).attr("alt")) : t.tinymce.activeEditor.execCommand("mceInsertContent", !1, "<img src='" + $(n.target).attr("src") + "'/>") | |
}); | |
$(".plainEditSelect").click(function() { | |
var n = t.getEditorText(); | |
return t.selectEditor(!0), t.setEditorFromRichText(n), !1 | |
}); | |
$(".richEditSelect").click(function() { | |
var n = t.getEditorText(); | |
return t.selectEditor(!1), t.setEditorFromPlainText(n), !1 | |
}); | |
$("#PostTopic").submit(function() { | |
i.doBeforeSubmit() | |
}); | |
this.initEditor(n) | |
}, t.initEditor = function(n) { | |
if (t.tinymce = window.tinymce, typeof t.tinymce == "undefined") { | |
console.error("Didn't find editor?!"); | |
return | |
} | |
t.tinymce.init({ | |
baseURL: "/js/tinymce/4.5.3/", | |
selector: "#richTextEditor", | |
body_class: "topic-post", | |
language: "en", | |
plugins: "autoresize,paste", | |
relative_urls: !1, | |
convert_urls: !1, | |
inline_styles: !1, | |
forced_root_block: !1, | |
gecko_spellcheck: !0, | |
valid_elements: "img[!src|align|border|class],-b/strong,-i/em,-u,-strike/del,-div[class],br,section", | |
menubar: "", | |
toolbar: "undo redo | bold italic underline strikethrough", | |
statusbar: !1, | |
autoresize_min_height: 0, | |
paste_auto_cleanup_on_paste: !0, | |
plugin_preview_width: "700", | |
plugin_preview_height: "500", | |
formats: { | |
bold: { | |
inline: "b" | |
}, | |
italic: { | |
inline: "i" | |
}, | |
underline: { | |
inline: "u" | |
}, | |
strikethrough: { | |
inline: "del" | |
} | |
}, | |
setup: function(i) { | |
i.on("init", function() { | |
$("#richTextEditor_ifr").contents().find("head").append($("link[rel=stylesheet]").clone()); | |
n != undefined && n != "" && t.setEditorFromRichText(n); | |
$("#richTextEditor").prop("disabled", !1); | |
$("#plaintTextEditor").prop("disabled", !1); | |
t.updateEditorVisibility() | |
}) | |
} | |
}) | |
}, t.onReady = function() { | |
$(".imgModal").prependTo($("body")); | |
$(".showImageModal").click(function(n) { | |
var t = $(n.target).data("href"); | |
return $(".imgFrame").attr("src", t), $("#imgModal").modal("show"), n.stopPropagation(), !1 | |
}); | |
$(".imgFrame").on("load", function() { | |
var n = $(".imgFrame").attr("src"); | |
n == "" ? ($(".imgFrame").hide(), $("#imgModal").modal("hide"), $(".btn-success").focus(), document.activeElement.blur()) : ($(".imgLoading").hide(), $(".imgFrame").show(), $(window).scrollTop(3)) | |
}) | |
}, t | |
}(); | |
n.ForumPost = t | |
}(sb || (sb = {})), | |
function(n) { | |
var t = function() { | |
function t() {} | |
return t.menuOnReady = function() {}, t.camerasOnReady = function() { | |
var i, t, r; | |
n.UI.reloadOnWake(); | |
i = "page"; | |
t = "active btn-primary"; | |
$(".sel-cams").click(function() { | |
$("#swell").hide(); | |
$("#cameras").show(); | |
$(".sel-swell").removeClass(t); | |
$(".sel-cams").addClass(t); | |
Cookies.set(i, "cams", { | |
expires: 1, | |
path: "/weather/surf-camera" | |
}) | |
}); | |
$(".sel-swell").click(function() { | |
$("#cameras").hide(); | |
$("#swell").show(); | |
$(".sel-cams").removeClass(t); | |
$(".sel-swell").addClass(t); | |
Cookies.set(i, "swell", { | |
expires: 9999, | |
path: "/weather/surf-camera" | |
}) | |
}); | |
r = Cookies.get(i); | |
r == "swell" ? $(".sel-swell").click() : $(".sel-cams").click() | |
}, t.graphsOnReady = function() { | |
n.UI.reloadOnWake() | |
}, t.renderGraphs = function(t) { | |
var i = t.global.renderMode === 0 ? new n.DrawBitmap : new n.DrawJavascript; | |
n.debug && console.log("Weather: Begin render"); | |
i.createGraphs(t, $("#graphs").first()); | |
$(".loading").hide(); | |
n.AdBanners.refreshSlots("." + i.getBannerClassName()) | |
}, t.tidesOnReady = function(t) { | |
var i = new n.DrawJavascript; | |
i.createGraphs(t, $("#graphs").first()); | |
$(".loading").hide(); | |
n.AdBanners.refreshSlots("." + i.getBannerClassName()) | |
}, t.loadGraphData = function(i, r) { | |
var u = { | |
apiKey: n.apiKey, | |
xDomain: n.xDomain, | |
t: r, | |
u: i, | |
screenDimensions: screen.width + "x" + screen.height | |
}, | |
f = n.Utils.getParam("renderMode"); | |
f != null && (u.renderMode = f); | |
$.post(n.Network.getApi("Graphs"), u).done(function(n) { | |
t.renderGraphs(n) | |
}).fail(function(t, i, r) { | |
n.UI.notify(i + ", " + r) | |
}) | |
}, t.locationOnReady = function(n, t) { | |
this.loadGraphData(n, t); | |
$(window).keypress(function(n) { | |
n.which === 114 && (location.reload(), n.preventDefault()) | |
}) | |
}, t | |
}(); | |
n.Weather = t | |
}(sb || (sb = {})); | |
! function(n) { | |
var t = function() { | |
function t() {} | |
return t.h = function(n) { | |
var r = n.split(","), | |
i = {}; | |
return i.i = t.j(r), i.points = t.k(i, r), i | |
}, t.j = function(n) { | |
var t = 0, | |
i = { | |
type: n[t++], | |
version: this.l(n[t++]), | |
id: n[t++], | |
m: n[t++], | |
o: n[t++], | |
p: n[t++], | |
q: n[t++], | |
s: n[t++], | |
t: n[t++], | |
title: n[t++], | |
u: this.l(n[t++]), | |
v: this.l(n[t++]), | |
A: this.B(n[t]), | |
C: this.B(n[t++].slice(0, 8) + "0000"), | |
D: this.B(n[t++]), | |
F: n[t++], | |
G: n[t++], | |
H: t | |
}; | |
return i.F = this.I(i.F, i.C), i.G = this.I(i.G, i.C), i | |
}, t.k = function(n, t) { | |
try { | |
switch (n.i.type) { | |
case "F": | |
return this.J(n, t); | |
case "E": | |
return this.K(n, t); | |
case "S": | |
return this.L(n, t); | |
case "P": | |
return this.M(n, t); | |
case "W": | |
return this.O(n, t); | |
case "T": | |
return this.P(n, t) | |
} | |
} catch (i) { | |
console.log("parseError: " + i) | |
} | |
return [] | |
}, t.J = function(n, t) { | |
for (var r, f = [], u = n.i.H, e = this.l(t[u++]), o = this.l(t[u++]) - 1, s = u + 5 + o * e, i = s; i < t.length; i += n.i.u) r = {}, r.time = this.I(t[i], n.i.A), r.windSpeed = this.l(t[i + 1]), r.R = t[i + 2], r.waveHeight = isNaN(parseFloat(t[i + 3])) ? 0 : parseFloat(t[i + 3]), f.push(r); | |
return f | |
}, t.K = function(t, i) { | |
for (var u, f, e = [], o = t.i.H, r = o; r < i.length; r += t.i.u) u = {}, u.time = this.I(i[r], t.i.A), u.T = isNaN(parseFloat(i[r + 1])) ? 0 : parseFloat(i[r + 1]), u.U = i[r + 2], f = isNaN(parseFloat(i[r + 3])) ? 0 : parseFloat(i[r + 3]), u.waveHeight = f, u.waveHeightFeet = Math.round(f * n.Units.feetPerMetre * 10) / 10, e.push(u); | |
return e | |
}, t.L = function(t, i) { | |
var f = [], | |
o, r; | |
f.V = []; | |
for (var u = t.i.H, e = this.l(i[u++]), s = u + e, r = 0; e > r; r++) o = NaN !== parseFloat(i[u + r]) ? parseFloat(i[u + r]) : 0, f.V.push({ | |
X: this.l(i[s + r]), | |
filename: n.Z.Y(o), | |
text: null | |
}); | |
for (u += 2 * e, r = u; r < i.length; r += t.i.u) f.push({ | |
time: this.I(i[r], t.i.A), | |
tide: isNaN(parseFloat(i[r + 1])) ? 0 : parseFloat(i[r + 1]) | |
}); | |
return f | |
}, t.M = function(n, t) { | |
var r = [], | |
u = new Date(n.i.A), | |
i; | |
for (u.setHours(0, 0, 0, 0), i = n.i.H; i < t.length; i += n.i.u) r.push({ | |
time: this.I(t[i], u), | |
temperature: parseFloat(t[i + 1]), | |
pressure: parseFloat(t[i + 2]) | |
}); | |
return r | |
}, t.O = function(n, t) { | |
var r = [], | |
f = n.i.H, | |
u = new Date(n.i.A), | |
i; | |
for (u.setHours(0, 0, 0, 0), i = f; i < t.length; i += n.i.u) r.push({ | |
time: this.I(t[i], u), | |
windSpeed: this.l(t[i + 1]), | |
windGust: this.l(t[i + 2]), | |
R: t[i + 3] | |
}); | |
return r | |
}, t.P = function(n, t) { | |
for (var r, u, f = [], e = n.i.H, o = n.i.A.getTime() - 18e5, s = n.i.D.getTime() + 18e5, i = e; i < t.length; i += n.i.u) r = { | |
time: this.I(t[i], n.i.C), | |
tide: NaN !== parseFloat(t[i + 1]) ? parseFloat(t[i + 1]) : 0 | |
}, u = r.time.getTime(), u > o && s > u && f.push(r); | |
return f | |
}, t.I = function(n, t) { | |
var i = parseInt(n), | |
r, u; | |
return isNaN(i) ? t : (r = Math.round(i / 100 * 60), u = this._(t, r), u) | |
}, t.B = function(n) { | |
var t = this.l(n.slice(0, 4)), | |
i = this.aa(n.slice(4, 6)), | |
r = this.aa(n.slice(6, 8)), | |
u = this.aa(n.slice(8, 10)), | |
f = this.aa(n.slice(10, 12)); | |
return new Date(t, i - 1, r, u, f) | |
}, t._ = function(n, t) { | |
try { | |
return n instanceof Date ? new Date(n.getTime() + 6e4 * t) : new Date(n + 6e4 * t) | |
} catch (i) { | |
return console.error(i), n | |
} | |
}, t.l = function(n) { | |
var t = parseInt(n); | |
return isNaN(t) ? 0 : t | |
}, t.aa = function(n) { | |
for (; n.length > 1 && "0" === n.substr(0, 1);) n = n.substr(1, n.length - 1); | |
var t = parseInt(n); | |
return isNaN(t) ? 0 : t | |
}, t | |
}(); | |
n.ba = t | |
}(sb || (sb = {})); | |
! function(n) { | |
var t = function() { | |
function t() { | |
this.json = null; | |
this.container = null; | |
this.ca = !1; | |
this.da = !1; | |
this.ea = window.screen.width < 1025 && "ontouchstart" in window; | |
this.fa = new n.ga(this); | |
this.ha = "No data arrived from the server!?<br/><br/>Please try refreshing the page..." | |
} | |
return t.prototype.getBannerClassName = function() { | |
return "weather-banner" | |
}, t.prototype.ia = function(n) { | |
var t = n[0]; | |
return "W" == t ? "Live Wind" : "F" == t ? "7 Day Wind & Wave Forecast" : "E" == t ? "7 Day Wave Direction & Period Forecast" : "S" == t ? "7 Day Tide Forecast" : "P" == t ? "Temperature & Pressure" : "T" == t ? "Live Tide" : "" | |
}, t.prototype.ja = function(n) { | |
$(document.createElement("div")).addClass("GraphsForecastSubtext").html(" <div class='GraphsForecastHelp'><a href='#' id='uxReverse'><span class='Quiet'>Reverse Graph Colours<\/span><\/a><\/div> <div class='GraphsForecastSun'>Sunrise: " + this.json.global.sunriseText + " Sunset: " + this.json.global.sunsetText + "<\/div>").appendTo(n); | |
$(document.createElement("div")).attr({ | |
"class": "clearfix" | |
}).appendTo(n); | |
$(document.createElement("div")).attr({ | |
"class": "GraphsForecastTimes" | |
}).html(this.json.global.forecastInfoText).appendTo(n); | |
$(document.createElement("div")).attr({ | |
"class": "clearfix" | |
}).appendTo(n) | |
}, t.prototype.ka = function() { | |
for (var t, i = 0, r = !1, n = 0; n < this.json.layout.length; n++) t = "F" === this.json.layout[n].type, t && !r && i++, r = t; | |
return this.da = i > 1, this.da || $("#regionLinks").hide(), this.da | |
}, t.prototype.la = function(n) { | |
if ("F" == n.type && this.da) { | |
this.container.append($(document.createElement("a")).attr({ | |
name: n.id | |
})); | |
var t = $("#regionLinks"); | |
t.children().length > 0 && (t.append(" | "), t.show()); | |
t.append($(document.createElement("a")).attr({ | |
href: "#" + n.id | |
}).text(n.title)) | |
} | |
}, t.prototype.ma = function() { | |
this.json.layout.length > 0 && ("A" != this.json.layout[0].type && this.json.layout.splice(0, 0, { | |
type: "A", | |
id: this.json.global.bannerId | |
}), this.json.layout.length > 3 && "A" != this.json.layout[this.json.layout.length - 1].type && this.json.layout.push({ | |
type: "A", | |
id: this.json.global.bannerId | |
})) | |
}, t.prototype.na = function(n, t) { | |
null !== t && void 0 !== t && t.length > 0 && n.append($(t)) | |
}, t.prototype.oa = function(n, t) { | |
var i, u = n + "=", | |
e = u.length, | |
s = Cookies.get("prefs") || "", | |
r = s.split("&"), | |
f, o; | |
if (void 0 === t) { | |
for (i = 0; i < r.length; i++) | |
if (r[i].substr(0, e) == u) return r[i].substr(e) | |
} else { | |
if (f = [], r.length > 0) | |
for (i = 0; i < r.length; i++) o = r[i].substr(0, e), o != u && f.push(r[i]); | |
f.push(u + t); | |
Cookies.set("prefs", f.join("&"), { | |
path: "/", | |
expires: 9999 | |
}) | |
} | |
return "" | |
}, t.prototype.pa = function() { | |
return this.json | |
}, t.prototype.qa = function(n) { | |
n = n.replace(/[\[]/, "\\[").replace(/[\]]/, "\\]"); | |
var i = new RegExp("[\\?&]" + n + "=([^&#]*)"), | |
t = i.exec(location.search); | |
return null == t ? "" : decodeURIComponent(t[1].replace(/\+/g, " ")) | |
}, t.prototype.loadFailure = function(t) { | |
n.UI.notify(t) | |
}, t.prototype.ra = function(n, t, i, r) { | |
var u, e, o, f, s; | |
return i = i.toLowerCase(), u = location.href.replace("localhost", "www.seabreeze.com.au"), e = u.indexOf("#"), e > 0 && (u = u.substr(0, e)), u += "#" + i, o = t, r = r + " " + this.ia(i) + " Graph", f = 2, ("fx" == n && (n = "f", u = o, f = 0), "f" == n) ? (_gaq && _gaq.push(["_trackEvent", "Social", "Share", "Facebook"]), s = "7 Day Wind, Wave, Tide Forecasts & Live Wind reports", 0 == f ? window.open("https://www.facebook.com/sharer/sharer.php?u=" + encodeURIComponent(t) + "&t=" + r, "facebook-share-dialog", "width=626,height=436") : 1 == f || 2 == f && window.open("https://www.facebook.com/sharer/sharer.php?s=100&p[url]=" + encodeURIComponent(u) + "&p[images][0]=" + encodeURIComponent(o) + "&p[title]=" + encodeURIComponent(r) + "&p[summary]=" + encodeURIComponent(s), "facebook-share-dialog", "width=626,height=436")) : "t" == n && (_gaq && _gaq.push(["_trackEvent", "Social", "Share", "Twitter"]), window.open("https://www.twitter.com/home?status=" + encodeURIComponent("@seabreeze.com.au " + r + " ... " + u), "twitter-share-dialog", "width=626,height=436")), !1 | |
}, t.prototype.sa = function() { | |
var n = this; | |
this.fa.ta(); | |
$("#uxReverse").click(function() { | |
var t = Cookies.get("rev"); | |
return Cookies.set("rev", "1" === t ? "0" : "1", { | |
path: "/", | |
expires: 5e3 | |
}), Cookies.get("rev") === t && alert("It appears your browser might have cookies disabled - if the arrows don't reverse, try turning Cookies on via your browser Settings"), n.recreateGraphs(), !1 | |
}); | |
$("#regionLinks>a").click(function(t) { | |
var i = location.href, | |
r = i.indexOf("#"); | |
r > 0 && (i = i.substr(0, r)); | |
i += $(t.target).attr("href"); | |
n.oa("w", i) | |
}) | |
}, t.prototype.ua = function() { | |
this.container.append("<div id='complete'><\/div>") | |
}, t | |
}(); | |
n.va = t | |
}(sb || (sb = {})); | |
__extends = this && this.__extends || function(n, t) { | |
function r() { | |
this.constructor = n | |
} | |
for (var i in t) t.hasOwnProperty(i) && (n[i] = t[i]); | |
n.prototype = null === t ? Object.create(t) : (r.prototype = t.prototype, new r) | |
}; | |
! function(n) { | |
var t = function(t) { | |
function i() { | |
var n = null !== t && t.apply(this, arguments) || this; | |
return n.wa = 0, n.xa = 0, n | |
} | |
return __extends(i, t), i.prototype.recreateGraphs = function() { | |
$("#uxGraphs").empty(); | |
this.createGraphs(this.json, this.container) | |
}, i.prototype.createGraphs = function(t, i) { | |
var tt = this, | |
e, l, p, w; | |
if (this.json = t, this.container = i, this.container.empty(), !t || void 0 === t || void 0 === t.layout || void 0 === t.data) return void(t.isCustomLayout || this.loadFailure(this.ha)); | |
if (0 === t.layout.length || 0 === t.data.length) return void(t.global.isCustomLayout ? $(".no-faves").removeClass("hidden") : this.loadFailure(this.ha)); | |
if (this.json.global.error) return void this.loadFailure(t.global.error); | |
if (0 == this.json.layout.length) { | |
if (this.json.global.isCustomLayout) return i.append($(".GraphsOptions")), void $(".no-faves").removeClass("hidden"); | |
throw "No layout - please try re-choosing a location from the menu..."; | |
} | |
this.ca = !this.ea; | |
var s, b = 0, | |
h = !1, | |
k = !1, | |
d = !1, | |
a = !1, | |
it = this.ea ? "GraphImage GraphImageNoTouch" : "GraphImage", | |
rt = this.json.global.forecastInfoUid, | |
ut = this.json.global.liveInfoUid; | |
this.ma(); | |
var o = location.href.toLowerCase().indexOf("yesterday") > 0, | |
c = !o, | |
ft = "1" === Cookies.get("rev") || "1" === this.qa("rev"), | |
et = c, | |
g = c, | |
ot = this.json.global.isCustomLayout; | |
for (this.ka(), o && $(".graphs-container").addClass("graphs-yesterday-container").removeClass("graphs-container"), s = 0; s < this.json.layout.length; s++) { | |
var r = this.json.layout[s], | |
f = r.type, | |
v = "FES".indexOf(f) >= 0, | |
y = "WPT".indexOf(f) >= 0, | |
st = "A" == f; | |
if (this.la(r), o) { | |
if (!y) continue; | |
r.imageUrl = r.imageUrl.replace("/live/", "/history/").replace(".a.png", ".h.png"); | |
r.imageUrlRev = r.imageUrlRev.replace("/live/", "/history/").replace(".a.png", ".h.png") | |
} | |
if (("F" != f || a || (i.append($(document.createElement("div")).attr({ | |
"class": "GraphsForecastTitle" | |
}).html(r.title + " Weather Forecast").append($(document.createElement("div")).attr({ | |
"class": "GraphsBar" | |
}))), k = !0, h = !1), !h && y) && (!o && $(document).width() < 767 && (e = parseInt(Cookies.get("mba")), isNaN(e) && (e = 0), e++ < 0 && (i.append($(document.createElement("div")).html('<script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"><\/script> <ins class="adsbygoogle" style="display:inline-block;width:320px;height:100px" data-ad-client="ca-pub-3813700160659174" data-ad-slot="8947518649"><\/ins> <script> (adsbygoogle = window.adsbygoogle || []).push({}); <\/script>')), e = 0), Cookies.set("mba", e, { | |
path: "/weather", | |
expires: 9999 | |
})), i.append($(document.createElement("div")).attr({ | |
"class": "GraphsLiveTitle" | |
}).html(o ? "Yesterdays Weather" : r.title + " Weather Now").append($(document.createElement("div")).attr({ | |
"class": "GraphsBar" | |
}))), et && i.append($(document.createElement("div")).attr({ | |
"class": "GraphsLiveTimes" | |
}).html(this.json.global.liveInfoText)), h = !0), !h && !k || d || (i.append($(".GraphsOptions")), this.na(i, this.json.global.stateMessage), d = !0), v || y) { | |
var ht = ft ? r.imageUrl : r.imageUrlRev, | |
u = $(document.createElement("div")).attr({ | |
"class": "GraphsHolder", | |
ya: r.id | |
}), | |
nt = ht; | |
if (this.ca && this.za(u, nt, r.id, r.title), g && (this.fa.Aa(b, g, ot, r.id).appendTo(u), b++), "undefined" != typeof r.preMessage && u.append($(document.createElement("div")).html(r.preMessage)), "undefined" != typeof r.messages) | |
for (l = 0; l < r.messages.length; l++) p = r.messages[l], p.flags.indexOf("B") >= 0 && this.container.append($(document.createElement("div")).html(p.html)); | |
w = $(document.createElement("img")).attr({ | |
id: r.id, | |
"class": it, | |
alt: r.title + " " + this.ia(r.id) + " Graph", | |
src: nt + "?uid=" + (v ? rt : ut) | |
}).data("id", r.id); | |
this.ea && w.on("contextmenu", function() { | |
return !1 | |
}); | |
u.append(w); | |
"undefined" != typeof r.postMessage && u.append($(document.createElement("div")).html(r.postMessage)); | |
"W" == f && u.prepend($(document.createElement("a")).attr({ | |
id: "wind-" + r.title.toLowerCase().replace(/ /g, "-"), | |
title: r.title | |
})); | |
"S" == f && n.Ca.Ba(u, r.title, r.tides.split(","), new Date); | |
i.append(u) | |
} else st && this.container.append(n.AdBanners.getHtml(n.BannerSize.Leaderboard, "g" == n.config.adServer ? r.adUnit : r.id, this.getBannerClassName())); | |
"F" != f || a || this.ja(i); | |
a = v | |
} | |
c || $("#uxGraphs").addClass("GraphsHistoryBox"); | |
c && $(".GraphImage").click(function(n) { | |
tt.Da(n) | |
}); | |
this.Ea(this.json, this.ea); | |
this.sa(); | |
this.ua() | |
}, i.prototype.Ea = function(t, r) { | |
var u = new n.Fa; | |
u.init(t, r); | |
i.Ga = u | |
}, i.prototype.za = function() {}, i.prototype.Da = function(t) { | |
var i = $(t.target).parent(), | |
r = $(t.target).data("id"); | |
n.Ca.Ha({ | |
id: r, | |
Ia: i, | |
json: this.json, | |
ea: this.ea | |
}) | |
}, i | |
}(n.va); | |
n.DrawBitmap = t | |
}(sb || (sb = {})); | |
! function(n) { | |
var t = function() { | |
function t() {} | |
return t.Ha = function(n) { | |
var t = n.id[0]; | |
"F" == t ? this.Ja(n) : "S" == t ? this.Ka(n) : "W" == t && this.La(n) | |
}, t.Ja = function(n) { | |
var t = $(".forecast-extras"), | |
i = n.json.global; | |
t.appendTo($(n.Ia)); | |
$(".prognosis").attr("src", i.prognosisImageUrl).load(function() { | |
$(".extras-loading").hide() | |
}); | |
$(".synopsis").attr("src", i.synopticImageUrl).load(function() { | |
return $(".extras-loading").hide() | |
}); | |
t.slideToggle(); | |
$(".prognosis").click(function() { | |
$(".synopsis").fadeIn(100); | |
$(".prognosis").fadeOut(100) | |
}); | |
$(".synopsis").click(function() { | |
$(".prognosis").fadeIn(100); | |
$(".synopsis").fadeOut(100) | |
}) | |
}, t.Ka = function(n) { | |
var t = this.Ma(n), | |
i; | |
null != t.tides && (i = t.tides.split(","), this.Na(n.Ia, t.title, i)) | |
}, t.Ba = function(t, i, r, u) { | |
var f, e; | |
if (!$(".tide-table", t).is(":visible")) { | |
u = u || new Date; | |
var s = n.Dates.getDayName2(u), | |
o = "<div class='tide-title'>" + i + " Tide Times for " + s + ", " + n.Dates.getDateText(u) + " " + n.Dates.getLongMonthName(u) + "<\/div>", | |
h = !1; | |
for (o += "<div class='row'>", f = 1; f < r.length; f += parseInt(r[0])) | |
if (r[f] === s) o += "<span class='tide-today tide-extreme-" + ("H" === r[f + 3] ? "high" : "low") + "'>" + r[f + 1] + " : " + r[f + 2] + " " + r[f + 3] + "<\/span>", h = !0; | |
else if (h) break; | |
o += "<\/div><div class='row tide-table-hint'><div class='col-xs-12'>Tap graph to toggle 7 day tide times table<\/div><\/div>"; | |
e = $(".tide-forecast-hint", t); | |
0 == e.length && (e = $("<div class='tide-forecast-hint'><\/div>").appendTo(t)); | |
e.is(":visible") ? e.html(o) : e.hide().html(o).clearQueue().delay(250).slideDown(200) | |
} | |
}, t.Na = function(n, t, i) { | |
if (!$(".tide-table", n).length) { | |
for (var f = "", o = 0, u = "<div class='tide-table' style='display:none'>" + ("<div class='tide-header'>7 Day " + t + " Tide Times<\/div>"), r = 1; r < i.length; r += parseInt(i[0])) { | |
if (i[r] !== f) { | |
if (7 == o++) break; | |
"" !== f && (u += "<\/div>"); | |
u += "<div class='tide-item tide-day-" + i[r] + "'><div class='tide-day'>" + i[r] + "<\/div>"; | |
f = i[r] | |
} | |
var s = i[r + 1], | |
h = i[r + 2], | |
e = i[r + 3]; | |
u += "<div class='tide-extreme-" + ("H" === e ? "high" : "low") + "'>" + s + " : " + h + " " + e + "<\/div>" | |
} | |
u += "<\/div><\/div><div class='clearfix'><\/div>"; | |
$(n).append(u) | |
} | |
$(".tide-forecast-hint", n).slideUp(200); | |
$(".tide-table", n).slideToggle(300) | |
}, t.La = function() {}, t.Oa = function(n, t, i) { | |
var r = $("#" + n); | |
r = 0 == r.length ? $("<div id='" + n + "' style='display:none;margin-top:15px' class='clearfix'><\/div>") : r; | |
$(r).html(t); | |
r.appendTo(i.Ia); | |
r.slideToggle() | |
}, t.Ma = function(n) { | |
for (var i = n.json.layout, t = 0; t < i.length; t++) | |
if (i[t].id == n.id) return i[t]; | |
return null | |
}, t.getData = function(n, t) { | |
for (var u, r = n.json.data, i = 0; i < r.length; i++) | |
if (u = r[i].length > 8 ? r[i].substr(4, 4) : "_", r[i][0] == t && n.id.substr(2, 4) == u) return r[i].split(","); | |
return null | |
}, t | |
}(); | |
n.Ca = t | |
}(sb || (sb = {})); | |
! function(n) { | |
var t = function() { | |
function t(n) { | |
this.Pa = null; | |
this.Qa = n | |
} | |
return t.prototype.Aa = function(n, t, i, r) { | |
var u = $(document.createElement("div")).attr({ | |
"class": "GraphsFaveBox" | |
}), | |
f, e; | |
return i && (n > 0 && u.append($(document.createElement("img")).attr({ | |
"class": "GraphsFaveMoveUp", | |
src: "/images/icons/faveup.gif", | |
alt: "Moves this weather graph UP one position" | |
}).data("id", r)), u.append($(document.createElement("img")).attr({ | |
"class": "GraphsFaveMoveDown", | |
src: "/images/icons/favedown.gif", | |
alt: "Moves this weather graph DOWN one position" | |
}).data("id", r))), f = "4", e = this.Ra(), null != e && (f = $.inArray(r, e) < 0 ? "4" : "5"), u.append($(document.createElement("img")).attr({ | |
"class": "GraphsFaveIcon", | |
src: "/images/icons/fave" + f + ".gif", | |
alt: "Adds/Removes this graph to your custom layout" | |
}).data("id", r)) | |
}, t.prototype.Sa = function(n, t) { | |
var e = $(n).data("id"), | |
r = this.Ra(), | |
i, u, f; | |
if (null == r || (i = $.inArray(e, r), 0 > i)) return !0; | |
for (0 > t && i > 1 && (u = r[i - 1], r[i - 1] = r[i], r[i] = u), t > 0 && i < r.length && (u = r[i + 1], r[i + 1] = r[i], r[i] = u), f = "b;", i = 0; i < r.length; i++) null !== r[i] && 6 == r[i].length && (f += r[i] + ";"); | |
return this.Ta(f), this.Qa.recreateGraphs(), !1 | |
}, t.prototype.Ua = function(t) { | |
var f = $(t).data("id"), | |
i = this.Ra(), | |
e = i ? $.inArray(f, i) : -1, | |
o = e >= 0, | |
u = "b;", | |
r; | |
if (i) | |
for (r = 0; r < i.length; r++) null !== i[r] && 6 == i[r].length && r != e && (u += i[r] + ";"); | |
return o ? ($(t).attr("src", "/images/icons/fave4.gif"), n.UI.successMsg("Removed from Favourites.", 500)) : (u += f + ";", $(t).attr("src", "/images/icons/fave5.gif"), n.UI.successMsg("Favourite Added!<br/><br/>Use the <a href='/weather/my-weather'>Weather/<em>My Favourites<\/em><\/a> menu to view your faves.", 500)), this.Ta(u), !1 | |
}, t.prototype.ta = function() { | |
var n = this; | |
$(".GraphsFaveIcon").click(function(t) { | |
return n.Ua(t.target) | |
}); | |
$(".GraphsFaveMoveUp").click(function(t) { | |
return n.Sa(t.target, -1) | |
}); | |
$(".GraphsFaveMoveDown").click(function(t) { | |
return n.Sa(t.target, 1) | |
}) | |
}, t.prototype.Ra = function() { | |
return null == this.Pa && Cookies.get("MW") && (this.Pa = (Cookies.get("MW") + "").split(";")), this.Pa | |
}, t.prototype.Ta = function(n) { | |
var u, t; | |
if (this.Pa = null, u = Cookies.get("MW"), Cookies.set("MW", n, { | |
path: "/graphs" | |
}), Cookies.set("MW", n, { | |
path: "/", | |
expires: 9999 | |
}), n != u && Cookies.get("MW") != n) return alert("Sorry; you'll need to enable cookies to use the Favourites feature."), !1; | |
for (var f = this.Ra(), e = [], i = this.Qa.pa(), r = 0; r < f.length; r++) | |
for (t = 0; t < i.layout.length; t++) | |
if (f[r] === i.layout[t].id) { | |
e.push(i.layout[t]); | |
break | |
} | |
return this.Qa.pa().layout = e, !0 | |
}, t | |
}(); | |
n.ga = t | |
}(sb || (sb = {})); | |
__extends = this && this.__extends || function(n, t) { | |
function r() { | |
this.constructor = n | |
} | |
for (var i in t) t.hasOwnProperty(i) && (n[i] = t[i]); | |
n.prototype = null === t ? Object.create(t) : (r.prototype = t.prototype, new r) | |
}; | |
! function(n) { | |
var t = function(t) { | |
function i() { | |
return null !== t && t.apply(this, arguments) || this | |
} | |
return __extends(i, t), i.prototype.recreateGraphs = function() { | |
this.container && this.json && this.createGraphs(this.json, this.container) | |
}, i.prototype.createGraphs = function(t, i) { | |
var h, g, a, c, o, v, y, p, f, u, s, nt; | |
if (this.json = t, this.container = i, this.container.empty(), !t || void 0 === t || void 0 === t.layout || void 0 === t.data) return void(t.isCustomLayout || this.loadFailure(this.ha)); | |
if (0 === t.layout.length || 0 === t.data.length) return void(t.global.isCustomLayout ? $(".no-faves").removeClass("hidden") : this.loadFailure(this.ha)); | |
if (t.global.error) return void this.loadFailure(t.global.error); | |
var it = 0, | |
w = location.href.toLowerCase().indexOf("yesterday") > 0, | |
ot = !w, | |
b = this.json.global.isCustomLayout, | |
st = "1" === Cookies.get("rev") || "1" === n.Utils.getParam("rev"), | |
l = !1, | |
rt = !1, | |
ut = !1, | |
k = !1, | |
ft = ot, | |
ht = b; | |
for (this.ka(), this.ma(), h = 0; h < t.layout.length; h++) { | |
var r = t.layout[h], | |
e = r.type.toString(), | |
et = "FES".indexOf(e) >= 0, | |
d = "WPT".indexOf(e) >= 0, | |
ct = "A" === e; | |
if (!w || d) { | |
if ((this.la(r), "F" !== e || k || (this.container.append(this.Va((b ? "" : r.title) + " Weather Forecast")), rt = !0, l = !1), !l && !rt || ut || (i.append($(".GraphsOptions")), this.na(i, this.json.global.stateMessage), ut = !0), !l && d) && (g = void 0, g = b ? "Live Weather Now" : r.title + " Weather " + (w ? "Yesterday" : "Now"), this.container.append(this.Va(g)), !0 && this.container.append($(document.createElement("div")).attr({ | |
"class": "GraphsLiveTimes" | |
}).html(t.global.liveInfoText)), l = !0), et || d) { | |
if ("undefined" != typeof r.preMessage && this.container.append($(document.createElement("div")).html(r.preMessage)), "undefined" != typeof r.messages) | |
for (a = 0; a < r.messages.length; a++) c = r.messages[a], c.flags.indexOf("J") >= 0 && (o = !1, v = window.navigator.userAgent.toLowerCase(), o = o || c.flags.indexOf("E") >= 0 && (v.indexOf("trident") > 0 || v.indexOf("msie") > 0), o = o || c.flags.indexOf("F") >= 0 && v.indexOf("firefox") > 0, o && this.container.append($(document.createElement("div")).html(c.html))); | |
for (y = null, u = 0; u < t.data.length; u++) | |
if (p = t.data[u], p.substr(0, 1) === r.type && p.substr(4, 4) === r.id.substr(2, 4)) { | |
y = p; | |
break | |
} | |
if (null != y) try { | |
if (f = n.ba.h(y), f.title = r.title.toUpperCase(), f.type = r.type, f.global = t.global, f.forecasts = null, "F" == e) | |
for (u = 0; u < t.forecasts.length; u++) t.forecasts[u].id == r.id && (f.forecasts = t.forecasts[u]); | |
void 0 !== r.tides && (f.global.tides = r.tides); | |
s = $(document.createElement("div")).attr({ | |
"class": "GraphsHolder", | |
id: "g" + h, | |
ya: r.id | |
}); | |
this.container.append(s); | |
nt = n.Xa.Wa(s, f, st, r.aspectRatio); | |
nt && (nt.Ya(s), ft && (s.append(this.fa.Aa(it, ft, ht, r.id)), it++), "W" == e && s.prepend($(document.createElement("a")).attr({ | |
id: "wind-" + r.title.toLowerCase().replace(/ /g, "-"), | |
title: r.title | |
}))) | |
} catch (tt) { | |
console.error(tt); | |
tt.stack && console.log(tt.stack) | |
} | |
} else ct && this.container.append(n.AdBanners.getHtml(n.BannerSize.Leaderboard, "g" == n.config.adServer ? r.adUnit : r.id, this.getBannerClassName())); | |
"F" !== e || k || this.ja(i); | |
k = et | |
} | |
} | |
this.sa(); | |
this.ua() | |
}, i.prototype.Va = function(n) { | |
return $("<div class='titleContainer' style='margin-top:25px;margin-bottom:25px'><h1 class='titleLink' style='text-align:center !important'>" + n + "<\/h1><div class='titleEffect1'><\/div><div class='titleEffect2'><\/div><\/div>") | |
}, i | |
}(n.va); | |
n.DrawJavascript = t | |
}(sb || (sb = {})); | |
! function(n) { | |
function i() { | |
return n.Dates.getHourText(this.value) | |
} | |
function r() { | |
return n.Dates.getDayName(this.value) + "<br/>" + n.Dates.getDateText(this.value) | |
} | |
n.Za = "g"; | |
n.$a = "a"; | |
n._a = "p"; | |
n.ab = "s"; | |
var t = function() { | |
function t() { | |
this.data = null; | |
this.bb = 61; | |
this.cb = 36e5; | |
this.eb = 30; | |
this.fb = 6; | |
this.gb = 70; | |
this.hb = 10; | |
this.ib = ""; | |
this.fontFamily = "Helvetica"; | |
this.jb = { | |
isSmall: !0, | |
widthPlus: 0, | |
heightPlus: 53, | |
font: { | |
title: "12px", | |
kb: "10px", | |
lb: "8px", | |
mb: "10px", | |
nb: "8px", | |
ob: "10px", | |
credits: "11px" | |
}, | |
margin: { | |
top: 45, | |
left: 25, | |
right: 25, | |
bottom: 25 | |
}, | |
yAxis: { | |
title: { | |
x: 8 | |
}, | |
labels: { | |
x: 15 | |
} | |
}, | |
xAxis: { | |
labels: { | |
xPlus: 24 | |
} | |
} | |
}; | |
this.pb = { | |
isSmall: !1, | |
widthPlus: 0, | |
heightPlus: 0, | |
font: { | |
title: "18px", | |
kb: "13px", | |
lb: "11.4px", | |
mb: "12px", | |
nb: "11.4px", | |
ob: "12px", | |
credits: "11px" | |
}, | |
margin: { | |
top: 45, | |
left: 40, | |
right: 40, | |
bottom: 25 | |
}, | |
yAxis: { | |
title: { | |
x: 20 | |
}, | |
labels: { | |
x: 20 | |
} | |
} | |
}; | |
this.width = 0; | |
this.height = 0; | |
this.domain = "seabreeze.com.au"; | |
this.qb = "/images/static/a/weather/"; | |
this.rb = "/images/static/a/moons/"; | |
this.sb = "#000"; | |
this.tickColor = "#444"; | |
this.gridLineColor = "#AAAAAA"; | |
this.tb = "w"; | |
this.ub = "#00ffff"; | |
this.vb = .5; | |
this.wb = "#A4D5FD"; | |
this.xb = Modernizr.rgba ? "rgba(0,0,0,0.49)" : "#555"; | |
this.yb = "#ff0000"; | |
this.zb = 12; | |
this.Ab = "#ffff00"; | |
this.Bb = 18; | |
this.Cb = "#00ff00"; | |
this.Db = 35; | |
this.Eb = "#b16d1d"; | |
this.Fb = "#f3f3f3"; | |
this.Gb = "#ccc"; | |
this.Hb = "#2a8efe"; | |
this.Ib = "#555"; | |
this.Jb = !1; | |
Highcharts.setOptions({ | |
global: { | |
useUTC: !1 | |
}, | |
credits: { | |
enabled: !1 | |
} | |
}); | |
t.Kb() | |
} | |
return t.prototype.Ya = function(n) { | |
this.container = n; | |
this.Lb = this.width < t.Mb ? this.jb : this.pb; | |
var i = 30; | |
return this.Nb = this.container.width() / 724 * (37 - i) + i, this.Ob = this.Nb, this.Pb = Math.floor(this.Ob / 3 * 100) / 100, this.Qb(n), this.chart = $(n).highcharts(), n | |
}, t.prototype.Qb = function() {}, t.prototype.format = function() {}, t.prototype.Rb = function() { | |
return { | |
chart: { | |
width: this.width + this.Lb.widthPlus, | |
height: this.height + this.Lb.heightPlus, | |
marginTop: this.Lb.margin.top, | |
marginLeft: this.Lb.margin.left, | |
marginRight: this.Lb.margin.right, | |
marginBottom: this.Lb.margin.bottom, | |
alignTicks: !1, | |
backgroundColor: "white" | |
}, | |
series: [], | |
tooltip: { | |
enabled: !1 | |
}, | |
legend: { | |
enabled: !1 | |
}, | |
plotOptions: { | |
area: { | |
animation: !1, | |
color: "#a4ffff", | |
fillOpacity: .4, | |
lineColor: "#bbcaff", | |
marker: { | |
enabled: !1, | |
states: { | |
hover: { | |
enabled: !1 | |
} | |
} | |
} | |
}, | |
line: { | |
animation: !1, | |
lineWidth: 1, | |
dashStyle: "Solid", | |
marker: { | |
enabled: !0, | |
states: { | |
hover: { | |
enabled: !0, | |
lineColor: "#0cc", | |
lineWidth: 1 | |
} | |
} | |
} | |
}, | |
series: {} | |
} | |
} | |
}, t.prototype.Sb = function(n) { | |
var t = "nowLine", | |
i = new Date(this.data.global.localTime), | |
r = i.getTime() + i.getTimezoneOffset() * 6e4; | |
n.xAxis[0].removePlotLine(t); | |
n.xAxis[0].addPlotLine({ | |
value: r, | |
color: "#ccf", | |
dashStyle: "ShortDash", | |
width: 1, | |
id: t, | |
Tb: 999 | |
}) | |
}, t.prototype.Ub = function(n, t) { | |
var i = 24 * this.cb; | |
this.Vb(n, t.i.G.getTime() - i, t.i.F.getTime()); | |
this.Vb(n, t.i.G.getTime(), t.i.F.getTime() + i) | |
}, t.prototype.Vb = function(n, t, i) { | |
var r = n.yAxis[0].max, | |
u = .5 * this.cb, | |
f = [ | |
[0, Modernizr.rgba ? "rgba(255,255,255,0.05)" : "#eee"], | |
[1, Modernizr.rgba ? "rgba(0,0,0,0.06)" : "#ddd"] | |
]; | |
n.series.push({ | |
animation: !1, | |
lineWidth: 0, | |
type: "area", | |
data: [ | |
[t - u, r], | |
[t + u, r] | |
], | |
fillColor: { | |
linearGradient: { | |
x1: 0, | |
y1: 0, | |
x2: 1, | |
y2: 0 | |
}, | |
stops: f | |
} | |
}); | |
n.series.push({ | |
animation: !1, | |
lineWidth: 0, | |
type: "area", | |
data: [ | |
[t + u, r], | |
[i - u, r] | |
], | |
fillColor: f[1][1] | |
}); | |
n.series.push({ | |
animation: !1, | |
lineWidth: 0, | |
type: "area", | |
data: [ | |
[i - u, r], | |
[i + u, r] | |
], | |
fillColor: { | |
linearGradient: { | |
x1: 1, | |
y1: 0, | |
x2: 0, | |
y2: 0 | |
}, | |
stops: f | |
} | |
}) | |
}, t.prototype.Wb = function(n, t) { | |
var i = { | |
id: this.tb, | |
type: "area", | |
data: t, | |
dashStyle: "Solid", | |
lineWidth: 1, | |
lineColor: this.wb, | |
color: this.ub, | |
fillOpacity: this.vb, | |
shadow: !1 | |
}; | |
return n.series.push(i), i | |
}, t.prototype.Xb = function(n, i, r) { | |
var u = { | |
id: i, | |
type: "line", | |
data: r, | |
lineColor: "#ccc", | |
marker: { | |
symbol: "arrow", | |
enabled: !0, | |
lineWidth: 1, | |
lineColor: "#555", | |
radius: this.width / this.bb, | |
states: { | |
hover: { | |
lineWidth: 1 | |
} | |
} | |
} | |
}; | |
return n.series.push(u), t.Yb() && n.series.push(u), u | |
}, t.prototype.getArrowMarker = function(n, t) { | |
return this.getArrowStyle(n, t, { | |
symbol: "arrow", | |
enabled: !0, | |
radius: this.width / this.bb, | |
states: { | |
hover: { | |
enabled: !0, | |
fillColor: "#fff", | |
Zb: 2, | |
radius: this.width / this.bb | |
} | |
} | |
}) | |
}, t.prototype.updateArrowDirs = function(n) { | |
$.each(n.data, function(n, t) { | |
var i = this.graphic, | |
r, u; | |
i && (r = i.attr("x") + i.attr("width") / 2, u = i.attr("y") + i.attr("height") / 2, i.attr({ | |
transform: "rotate(" + t.dir + " " + r + " " + u + ") " | |
})) | |
}) | |
}, t.prototype.$b = function(t) { | |
var i = n.Responsive.isSize("xs") ? "url(#shadow-xs)" : "url(#shadow)"; | |
$.each(t.data, function() { | |
var n = this.graphic; | |
n && n.attr({ | |
filter: i | |
}) | |
}) | |
}, t.prototype._b = function(n, i) { | |
for (var r = -1, u = 0; u < n.series.length; u++) | |
if (n.series[u].options.id === i) { | |
r = u; | |
break | |
} | |
r >= 0 && (t.Yb() ? (this.updateArrowDirs(n.series[r + 1]), this.$b(n.series[r])) : this.updateArrowDirs(n.series[r])) | |
}, t.prototype.getArrowStyle = function(t, i, r) { | |
var u, f; | |
return t === n.$a ? (u = this.xb, f = i < this.zb ? this.Jb ? this.Cb : this.yb : i < this.Bb ? this.Ab : i < this.Db ? this.Jb ? this.yb : this.Cb : this.Eb) : t === n.Za ? (f = this.Fb, u = this.Gb) : (f = this.Hb, u = this.Ib), r.lineColor = r.states.hover.lineColor = u, r.fillColor = r.states.hover.fillColor = f, r | |
}, t.prototype.ac = function(n) { | |
var t = { | |
align: "center", | |
style: { | |
color: this.sb, | |
fontSize: this.Lb.font.lb, | |
fontFamily: this.fontFamily | |
}, | |
formatter: "", | |
useHTML: !1 | |
}; | |
return "function" == typeof n && (t.formatter = n, t.useHTML = !0), t | |
}, t.prototype.bc = function(n, t, i) { | |
return { | |
gridLineDashStyle: "ShortDot", | |
gridLineColor: this.gridLineColor, | |
gridLineWidth: 1, | |
type: "datetime", | |
lineColor: "#000", | |
lineWidth: 1, | |
tickInterval: n, | |
tickColor: this.tickColor, | |
tickWidth: 1, | |
tickLength: 6, | |
maxPadding: 0, | |
minPadding: 0, | |
minorGridLineWidth: 0, | |
minorTickInterval: t, | |
minorTickColor: this.tickColor, | |
minorTickWidth: 1, | |
minorTickLength: 3, | |
startOnTick: !0, | |
endOnTick: !0, | |
showFirstLabel: !0, | |
showLastLabel: !1, | |
crosshair: { | |
color: "#333", | |
dashStyle: "ShortDot", | |
width: 1 | |
}, | |
labels: { | |
formatter: i, | |
rotation: 0, | |
style: { | |
fontSize: this.Lb.font.lb, | |
fontFamily: this.fontFamily, | |
color: this.sb, | |
rotation: 0, | |
textOverflow: "none" | |
} | |
}, | |
style: { | |
fontFamily: this.fontFamily | |
}, | |
options: { | |
labels: { | |
style: { | |
textOverflow: !1 | |
} | |
} | |
} | |
} | |
}, t.prototype.cc = function(n, t, i, r, u) { | |
return { | |
min: 0, | |
max: u, | |
offset: 0, | |
opposite: "right" === i, | |
gridLineDashStyle: "ShortDot", | |
gridLineColor: this.gridLineColor, | |
gridLineWidth: 1, | |
lineColor: this.sb, | |
lineWidth: 1, | |
tickColor: this.tickColor, | |
tickWidth: 1, | |
tickLength: 5, | |
tickInterval: n, | |
minorGridLineWidth: 0, | |
minorTickInterval: 1, | |
minorTickColor: this.tickColor, | |
minorTickWidth: 1, | |
minorTickLength: 3, | |
ordinal: !1, | |
title: { | |
text: t, | |
style: { | |
color: this.sb, | |
fontFamily: this.fontFamily, | |
fontSize: this.Lb.font.ob, | |
fontWeight: "bold", | |
margin: 0, | |
padding: 0 | |
}, | |
x: ("right" === i ? 1 : -1) * this.Lb.yAxis.title.x | |
}, | |
labels: { | |
align: i, | |
formatter: r, | |
x: ("right" === i ? 1 : -1) * this.Lb.yAxis.labels.x, | |
y: 4, | |
style: { | |
color: this.sb, | |
fontSize: this.Lb.font.nb, | |
fontFamily: this.fontFamily | |
} | |
} | |
} | |
}, t.prototype.dc = function(n) { | |
return { | |
enabled: !0, | |
position: { | |
align: "right", | |
x: -n.marginRight - 6, | |
y: -n.marginBottom - 7, | |
verticalAlign: "bottom" | |
}, | |
href: null, | |
text: this.domain, | |
style: { | |
cursor: "pointer", | |
color: "#808080", | |
fontSize: this.Lb.font.credits, | |
fontFamily: this.fontFamily | |
} | |
} | |
}, t.prototype.ec = function(n) { | |
return { | |
text: n, | |
margin: 10, | |
y: 10, | |
align: "center", | |
style: { | |
color: this.sb, | |
fontFamily: this.fontFamily, | |
fontSize: this.Lb.font.title, | |
fontWeight: "600" | |
} | |
} | |
}, t.prototype.fc = function(n, t) { | |
if (t > this.eb) { | |
var i = n.chart.height - n.chart.marginTop - n.chart.marginBottom, | |
r = i / t, | |
u = (t - this.eb) * r, | |
f = 2 * u; | |
return n.chart.height += f, !0 | |
} | |
return !1 | |
}, t.prototype.gc = function(n, t) { | |
var i = n.toString(), | |
r = i.indexOf("."); | |
return r > 0 && 0 === t ? i.substr(0, r) : i.length - t >= r + t ? i.substr(0, r + t + 1) : i | |
}, t.prototype.hc = function(n) { | |
var f, r; | |
if (this.data.points.length <= 1) return null; | |
for (var u = 1e20, i = null, t = 0; t < this.data.points.length; t++) f = this.data.points[t].time.getTime(), r = Math.abs(f - n), u > r && (u = r, i = this.data.points[t], i.index = t); | |
return i | |
}, t.Yb = function() { | |
return /iPhone|iPad/i.test(navigator.userAgent) ? window.devicePixelRatio > 1 : !/Android|webOS|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent) | |
}, t.getAngle = function(n) { | |
return (this.ic[n] + t.jc) % 360 | |
}, t.Kb = function() { | |
Highcharts.SVGRenderer.prototype.symbols.arrow = function(n, t, i, r) { | |
var u = n + .5 * i, | |
f = t + .5 * r, | |
s = .6, | |
h = .5 * s * i, | |
e = .25 * s * i, | |
o = .5 * r; | |
return ["M", u, f - h, "L", u + o, f, u, f + h, u, f + e, u - o, f + e, u - o, f - e, u, f - e, "Z"] | |
} | |
}, t.Wa = function(t, i, r, u) { | |
var f; | |
switch (i.i.type) { | |
case "F": | |
f = new n.kc; | |
break; | |
case "E": | |
f = new n.lc; | |
break; | |
case "S": | |
f = new n.Z; | |
break; | |
case "P": | |
f = new n.mc; | |
break; | |
case "W": | |
f = new n.nc; | |
break; | |
case "T": | |
f = new n.oc; | |
break; | |
default: | |
return null | |
} | |
return f.data = i, f.width = $(t).width(), f.height = Math.floor(f.width * u), f.Jb = r, f | |
}, t | |
}(); | |
t.pc = 0; | |
t.qc = 1; | |
t.rc = 320; | |
t.Mb = 467; | |
t.jc = -90; | |
t.ic = { | |
S: 0, | |
SSW: 22.5, | |
SW: 45, | |
WSW: 67.5, | |
W: 90, | |
WNW: 112.5, | |
NW: 135, | |
NNW: 157.5, | |
N: 180, | |
NNE: 202.5, | |
NE: 225, | |
ENE: 247.5, | |
E: 270, | |
ESE: 292.5, | |
SE: 315, | |
SSE: 337.5, | |
"-": 0, | |
sc: 0 | |
}; | |
n.Xa = t; | |
n.tc = i; | |
n.uc = r | |
}(sb || (sb = {})); | |
! function(n) { | |
var t = function() { | |
function t() { | |
this.vc = "undefined"; | |
this.data = null; | |
this.wc = -1; | |
this.xc = 50; | |
this.ea = !1; | |
this.yc = !1; | |
this.zc = null; | |
this.Ac = null; | |
this.Bc = null; | |
this.Cc = this.wc; | |
this.Dc = this.wc; | |
this.Ec = 1; | |
this.Fc = null; | |
this.Gc = !1; | |
this.Hc = !1; | |
this.Ic = 0 | |
} | |
return t.prototype.init = function(n, t) { | |
var i = this; | |
this.ea = t; | |
this.data = n; | |
this.Jc = n.data; | |
$(".GraphImage").on("touchstart", function(n) { | |
i.Hc = !1; | |
i.Ic = (new Date).getTime(); | |
i.Kc(); | |
i.Lc(n.originalEvent) | |
}); | |
$(".GraphImage").on("touchmove", function(n) { | |
i.Kc(); | |
i.Mc(n.originalEvent) | |
}); | |
$(".GraphImage").on("touchend", function(n) { | |
i.Hc = !1; | |
i.Kc(); | |
i.Nc(n.originalEvent) | |
}); | |
$(document).scroll(function() { | |
i.Gc = !0 | |
}); | |
this.ea ? $(".GraphImage").addClass("GraphsImageNoTouch") : ($(document).on("mousemove", function(n) { | |
return i.Mc(n) | |
}), $(document).on("mouseleave", function(n) { | |
return i.Nc(n) | |
}), $(document).on("mouseenter", function(n) { | |
return i.Lc(n) | |
}), $(document).on("mousedown", function(n) { | |
return i.Lc(n) | |
})); | |
$("body").append($(document.createElement("div")).attr({ | |
id: "uxInfoBox", | |
"class": "GraphsInfoBox", | |
style: "display:none" | |
})); | |
$("body").append($(document.createElement("img")).attr({ | |
id: "uxInfoIndicator", | |
src: "/images/indicator.gif", | |
style: "display:none" | |
})); | |
$("body").append($(document.createElement("div")).attr({ | |
id: "uxInfoLine", | |
"class": "GraphsInfoLine", | |
style: "display:none;pointer-events:none" | |
})) | |
}, t.prototype.Mc = function(t) { | |
var v = this, | |
r, c, i, nt, tt, it, k, h, a, u, rt, ut; | |
if (this.Hc || this.ea && (null == t.touches || typeof t.touches === this.vc || t.touches.length > 1) || (r = t.target.id, c = $(t.target), "ctl00" == r.substr(0, 5) && (r = r.substr(16)), i = r.substring(0, 1), "W" != i && "P" != i && "S" != i && "T" != i && "F" != i && "E" != i)) return !0; | |
"W" != i && "P" != i && (this.Ec = 1); | |
r != this.zc && (this.zc = r); | |
var f = this.Oc(t), | |
y = this.Pc(t), | |
l = c.offset(), | |
d = f - l.left, | |
g = t.target.offsetLeft + d, | |
p = this.getData(r), | |
w = this.Qc(t, r, d, p); | |
this.Ac = $("#uxInfoBox"); | |
this.Bc = $("#uxInfoLine"); | |
var o = this.Ac.width(), | |
b = this.Ac.height(), | |
e = 25, | |
s = 27; | |
if ("F" === i && (e = 53, s = 24), "E" === i && (e = 27, s = 22), "P" === i && (s = 15), "S" === i && (e = 42, s = 23), this.ea) { | |
if (this.Cc == this.wc) return this.Cc = f, this.Dc = y, setTimeout(function() { | |
v.Gc || (v.Cc = f + 5, v.Mc(t)) | |
}, this.xc), !0; | |
if (nt = Math.abs(f - this.Cc), tt = Math.abs(y - this.Dc), this.Cc = f, this.Dc = y, it = (new Date).getTime() - this.Ic, it < this.xc) return this.Hc = !0, !0; | |
if (tt > nt) return !0; | |
t.preventDefault(); | |
k = 15; | |
u = g; | |
u = Math.max(o / 2 - k, u); | |
u = Math.min(u, $(window).width() - o / 2 - k); | |
u -= o / 2; | |
h = 1 / n.Zoom.getZoom(); | |
a = 0; | |
n.UI.isLandscape() && (a -= 23, h *= .83); | |
a += b * h - e; | |
this.Ac.css({ | |
top: -a + "px", | |
left: u + "px", | |
"transform-origin": "50% 0%", | |
transform: "scale(" + h + ", " + h + ")" | |
}); | |
this.Ac.appendTo($(t.target).parent()[0]) | |
} else u = l.left - (o + 10), 0 > u ? (this.Ac.css("top", l.top - b + 30 + "px"), this.Ac.css("left", f - o / 2 + "px")) : (this.Ac.css("top", l.top + $(t.target).height() / 2 - b / 2 + "px"), this.Ac.css("left", u + "px")); | |
return rt = c.parent(), (this.Bc.appendTo(rt).css({ | |
left: g - 1 + "px", | |
top: e + "px", | |
height: c.height() - e - s | |
}), 0 > w) ? (this.Ac.fadeOut(), this.Bc.fadeOut(50)) : (ut = this.Rc(r, w, p), this.Ac.html(ut), this.Ac.fadeIn(100), this.Bc.fadeIn(100)), "S" == i && this.Sc(t, p, r, w), !1 | |
}, t.prototype.Tc = function(t, i) { | |
var r = Math.floor(i / 100), | |
u = Math.round(i % 100 / 100 * 60), | |
f = 60 * r + u, | |
e = 6e4 * f, | |
o = n.Dates.getDateFromYMD(t[12]); | |
return new Date(o.getTime() + e) | |
}, t.prototype.Sc = function(t, i, r, u) { | |
var e = this.Tc(i, u), | |
f = n.Ca.Ma({ | |
id: r, | |
json: this.data | |
}); | |
n.Ca.Ba($(t.target).parent(), f.title, f.tides.split(","), e) | |
}, t.prototype.Lc = function(n) { | |
if (this.ea && n.touches.length > 1) return !0; | |
this.Gc = !1; | |
this.Cc = this.wc; | |
var t = n.target.id.substring(0, 1); | |
return this.ea || "W" != t && "P" != t || (this.Ec = 1 == this.Ec ? 0 : 1), this.Mc(n), !0 | |
}, t.prototype.Nc = function() { | |
return $("#uxInfoBox").fadeOut(), $("#uxInfoLine").fadeOut(), this.Gc = !0, this.zc = null, this.Ac = null, !0 | |
}, t.prototype.Uc = function(n, t) { | |
var i = null, | |
r = t.getUTCDate(); | |
return $.each(this.data.forecasts, function(t, u) { | |
u.id === n && $.each(u.forecast, function(n, t) { | |
r === new Date(t.localDate).getDate() && (i = t) | |
}) | |
}), i | |
}, t.prototype.Vc = function(n, t) { | |
var i = this.Uc(n, t), | |
r; | |
return null == i ? "" : (r = i.shortDesc, i.probabilityPrecip > 0 && (r += "<div class='rain'>" + i.probabilityPrecip + "% chance of rain", r += "<\/div>"), r) | |
}, t.prototype.getData = function(n) { | |
for (var r = n.substr(0, 1), u = n.substr(2, 4), i = -1, t = 0; t < this.Jc.length; t++) | |
if (this.Jc[t].substr(0, 1) == r && this.Jc[t].substr(4, 4) == u) { | |
i = t; | |
break | |
} | |
return -1 == i ? [] : this.Jc[i].split(",") | |
}, t.prototype.Wc = function(n) { | |
this.Fc = this.Fc || document.createElement("img"); | |
this.Fc.src = n.src; | |
return 0 === this.Fc.width || this.Fc.width === Number.POSITIVE_INFINITY ? 1 : n.width / this.Fc.width | |
}, t.prototype.Qc = function(n, t, i, r) { | |
var u = this.Wc(n.target), | |
f = parseInt(r[3], 10) * u, | |
o = parseInt(r[4], 10) * u, | |
s = parseInt(r[6], 10), | |
h = parseInt(r[7], 10), | |
e = o - f; | |
return i -= f, 0 > i || i > e ? -1 : Math.floor(h + i / e * s) | |
}, t.prototype.Rc = function(t, i, r) { | |
var f, e, c, o = t.substr(0, 1), | |
gt = parseInt(r[5], 10), | |
ni = parseInt(r[6], 10), | |
l = r[9], | |
vt = parseInt(r[10], 10), | |
yt = parseInt(r[11], 10), | |
a = "", | |
v = "", | |
y = "", | |
w = "", | |
ut = "", | |
ft = "", | |
et = "", | |
pt = "", | |
ot = 1, | |
st = 3, | |
ht = 2, | |
d = 3, | |
s = "", | |
b, it, wt, ct, bt, k, rt, lt, at, kt, dt; | |
"W" == o ? (y = "Average", v = "Gust", ft = "Ave", et = "Gust", pt = "Dir", s = "(knots)" + (this.ea ? "" : "<br/>Click graph for mode")) : "P" == o ? (y = "<br/>ºC", v = "<br/>hPa", ft = "ºC", et = "hPa", w = "º", s = this.ea ? "" : "<br/>Click graph for mode") : "T" == o || "S" == o ? (y = "<div style='margin-top:5px;margin-bottom:5px'>Tide<\/div>", v = "", w = " m", "S" == o && (s = this.ea ? "Tap graph for tide table" : "Click graph for tide table")) : "F" == o ? (y = "Wind", v = "Waves", w = " kn", ut = "", s = "", ot = 1, st = 2, ht = 3, d = -1, s = this.ea ? "Tap graph for synoptics" : "Click graph for synoptics") : "E" == o && (y = "Period", w = "s", v = "Height", ut = "", s = "", ot = 1, st = 2, ht = 3, d = -1); | |
var h, p, g = 0, | |
u = -1, | |
nt = 9999, | |
tt = []; | |
if (1 === this.Ec) | |
for (f = yt; f < r.length; f += vt) h = parseInt(r[f], 10), p = Math.abs(h - i), nt > p && (nt = p, u = f); | |
else | |
for (f = yt; f < r.length; f += vt) h = parseInt(r[f], 10), p = Math.abs(h - i), nt > p && (nt = p, u = g), e = Math.round(h % 100 / 100 * 60), c = Math.floor(h / 100 % 24), tt.push("<tr><td class='ibList'> " + (c % 12 == 0 ? "12" : c % 12) + ":" + (10 > e ? "0" + e : e) + " " + (c > 11 ? "pm" : "am") + "<\/td><td class='ibList'>" + r[f + 1] + "<\/td><td class='ibList'>" + r[f + 2] + "<\/td><td class='ibList'>" + r[f + 3] + "<\/td><\/tr>"), g++; | |
if (0 > u || 0 > i) a = "<div class='text-center' style='margin:50px 12px 0px 12px'>Apologies.<br/><br/>Data currently unavailable<\/div>"; | |
else if (l.length > 10 && (l = l.substring(0, 11) + "..."), 1 == this.Ec) | |
if (h = parseInt(r[u], 10), c = Math.floor(h / 100), b = c % 12, it = "", ni > 2400 && (wt = ["Sun", "Mon", "Tues", "Wednes", "Thurs", "Fri", "Satur"], it = wt[(Math.floor(h / 2400) + gt) % 7] + "day<br/>"), e = Math.round(h % 100 / 100 * 60), ct = l.indexOf(" ("), ct > 0 && (l = l.substr(0, ct)), "" !== v) { | |
if (bt = r[u + ot], k = r[u + ht], ("E" == o || "F" == o) && (rt = 3.2808399 * parseFloat(k), k = this.gc(k, 1) + " m<br/>" + Math.floor(rt) + "' " + Math.floor(12 * (rt - Math.floor(rt))) + '"'), lt = "", "F" == o) { | |
var ti = 60 * c + e, | |
ii = 6e4 * ti, | |
ri = n.Dates.getDateFromYMD(r[12]), | |
ui = new Date(ri.getTime() + ii); | |
lt = "<tr><td colspan='2' class='ibDesc'>" + this.Vc(t, ui) + "<\/td>" | |
} | |
a = "<table class='ibTable'><tr><td class='ibTitle' colspan='2'>" + l + "<\/td><\/tr><tr><td class='ibTime' colspan='2'>" + it + (0 === b ? 12 : b) + ":" + (10 > e ? "0" + e : e) + " " + (c % 24 > 11 ? "pm" : "am") + "<\/td><\/tr>" + lt + "<tr><td class='ibTitle' width='50%'>" + y + "<\/td><td class='ibTitle' width='50%'>" + v + "<\/td><tr><td class='ibBigText'>" + bt + w + "<br/>" + r[u + st] + "<\/td><td class='ibBigText'>" + k + ut + "<br/>" + (d > 0 ? r[u + d] : "") + "<\/td><\/tr>" + ("" === s ? "" : "<tr><td class='ibFooter' colspan=2>" + s + "<\/td><\/tr>") + "<\/table>" | |
} else at = parseFloat(r[u + 1]), kt = "<tr><td class='ibBigText''>" + n.Utils.toPrecision(at, 2) + " m<br/>" + n.Units.toImperialLength(at * n.Units.feetPerMetre) + "<\/td><\/tr>", a = "<table class='ibTable'><tr><td class='ibTitle'>" + l + "<\/td><\/tr><tr><td class='ibTime'>" + it + (0 === b ? 12 : b) + ":" + (10 > e ? "0" + e : e) + " " + (c % 24 > 11 ? "pm" : "am") + "<\/td><\/tr><tr><td class='ibTideTitle'>" + y + "<\/td><\/tr>" + kt + ("" === s ? "" : "<tr><td class='ibFooter'>" + s + "<\/td><\/tr>") + "<\/table>"; | |
else { | |
for (g > u && (tt[u] = tt[u].replace("<tr>", "<tr nowrap style='background-color:#E4EDF8;'>")), a = "<table border='0' cellpadding='0' cellspacing='0' class='ibTable'><tr><td class='ibTitle' colspan='4'>" + l + "<\/td><\/tr><tr><td class='ibListTitle' width='25%'>Time<\/td><td class='ibListTitle' width='25%'>" + ft + "<\/td><td class='ibListTitle' width='25%'>" + et + "<\/td><td class='ibListTitle' width='25%'>" + pt + "<\/td><\/tr>", dt = Math.min(u + 15, g), u > 4 ? u -= 4 : u = 0, f = u; dt > f; f++) a += tt[f]; | |
a += "<\/table>" | |
} | |
return a | |
}, t.prototype.gc = function(n, t) { | |
var i = n.indexOf("."); | |
return i > 0 && 0 === t ? n.substr(0, i) : n.length - t >= i + t ? n.substr(0, i + t + 1) : n | |
}, t.prototype.Oc = function(n) { | |
return (null != n.touches && void 0 != n.touches ? n.touches[0].pageX : n.pageX) + (t.Xc() ? window.scrollX : 0) | |
}, t.prototype.Pc = function(n) { | |
return (null != n.touches && void 0 != n.touches ? n.touches[0].pageY : n.pageY) + (t.Xc() ? window.scrollY : 0) | |
}, t.prototype.Kc = function() { | |
this.yc || (this.yc = !0, $(document).off("mousemove mouseenter mouseleave mousedown")) | |
}, t.Xc = function() { | |
if (null == this.Yc) try { | |
var t = window.chrome, | |
n = window.navigator, | |
i = n.vendor, | |
r = n.userAgent.indexOf("OPR") > -1, | |
u = n.userAgent.indexOf("Edge") > -1; | |
this.Yc = null !== t && void 0 !== t && "Google Inc." === i && 0 == r && 0 == u ? n.userAgent.indexOf("SAMSUNG") < 0 : !1 | |
} catch (f) { | |
console.error(f) | |
} | |
return this.Yc | |
}, t | |
}(); | |
t.Yc = null; | |
n.Fa = t | |
}(sb || (sb = {})); | |
! function(n) { | |
var t = function() { | |
function n() { | |
this.container = null; | |
this.Zc = null; | |
this.chart = null; | |
this.$c = null; | |
this.yAxis = 0; | |
this._c = null; | |
this.ad = "X"; | |
this.Ec = 1; | |
this.yc = !1; | |
this.bd = !1; | |
this.dd = n.ed; | |
this.fd = 0; | |
this.gd = null; | |
this.hd = !1; | |
this.jd = 200; | |
this.kd = .56 | |
} | |
return n.prototype.update = function(t) { | |
var a = document.documentElement.clientWidth, | |
g = null != t.originalEvent.touches ? t.originalEvent.touches[0].pageX : t.pageX, | |
e = g - $(t.target).offset().left, | |
u = this.chart.xAxis[0].toValue(e, !1), | |
c = this.chart.xAxis[0].getExtremes(), | |
i, h, k, d, l; | |
if (!(u < c.min || u > c.max) && (i = this.$c.hc(u), i)) { | |
this.ld = u; | |
this.md = c; | |
var f = this.Zc.width(), | |
o = this.Zc.height(), | |
s = Math.floor(this.chart.yAxis[this.yAxis].toPixels(i[this._c], !1)), | |
r = Math.floor(this.chart.xAxis[0].toPixels(u, !1)); | |
if (i.index > 1 && i.index < this.$c.data.points.length - 1) { | |
var v = this.$c.data.points[i.index], | |
y = this.$c.data.points[i.index + 1], | |
p = v.time.getTime(), | |
nt = y.time.getTime(), | |
tt = (u - p) / (nt - p), | |
w = this.chart.yAxis[this.yAxis].toPixels(v[this._c], !1), | |
b = this.chart.yAxis[this.yAxis].toPixels(y[this._c], !1), | |
it = Math.abs(b - w), | |
rt = Math.floor(it * tt) * (w > b ? -1 : 1); | |
s += rt | |
} | |
h = Math.min(1, Math.floor(a / this.getZoom() * this.kd / f * 100) / 100); | |
.95 > h && 450 > a ? (this.Zc.css({ | |
transform: "translate(-" + this.nd(f, e) + "px, -" + o + "px) scale(" + h + "," + h + ")" | |
}), this.Zc.css({ | |
"transform-origin": this.nd(f, e) + "px " + o + "px" | |
})) : (this.Zc.css({ | |
transform: "initial" | |
}), this.Zc.css({ | |
"transform-origin": "initial" | |
}), this.dd == n.od) ? (s -= o, r -= this.nd(f, e)) : (s = $(t.target).height() - o - 30, r = -f / 2 - 69, k = $(t.target), d = k.offset().left + r, 5 > d && (r = Math.max(0, e - f / 2), s = -o / 2, l = $(document.body).width() - f - 15, r > l && (r = Math.min(r, l)))); | |
var ut = this.dd == n.ed ? " info-box-static" : "", | |
ft = this.dd == n.ed ? "" : this.pd(e), | |
et = "<div class='info-box-content" + ut + "'>" + (null == i.time ? "" : this.$c.format(i)) + "<\/div>"; | |
this.Zc.html(ft + et).css({ | |
top: Math.floor(s), | |
left: Math.floor(r) | |
}); | |
this.show(t); | |
this.chart.xAxis[0].removePlotLine(this.ad); | |
this.chart.xAxis[0].addPlotLine({ | |
value: u, | |
color: "#038", | |
dashStyle: "ShortDot", | |
width: 1, | |
id: this.ad, | |
Tb: 999 | |
}) | |
} | |
}, n.prototype.show = function() { | |
this.bd || (this.Zc.fadeIn(100), this.bd = !0) | |
}, n.prototype.hide = function() { | |
this.bd && (this.Zc.fadeOut(), this.bd = !1, this.chart.xAxis[0].removePlotLine(this.ad), this.$c.qd && this.$c.qd()) | |
}, n.prototype.Nc = function(n) { | |
this.hide(n) | |
}, n.prototype.Lc = function(n) { | |
this.update(n) | |
}, n.prototype.Mc = function(n) { | |
this.update(n) | |
}, n.prototype.getZoom = function() { | |
return 1 | |
}, n.prototype.rd = function() { | |
return this.getZoom() > 1.1 | |
}, n.prototype.sd = function(n) { | |
this.fd = n.timeStamp; | |
this.hd = !1; | |
this.hide(n); | |
clearTimeout(this.gd) | |
}, n.prototype.td = function(n) { | |
var t = this; | |
this.sd(n); | |
this.yc || (this.yc = !0, $(n.target).unbind("mousemove"), $(n.target).unbind("mouseenter"), $(n.target).unbind("mouseleave"), $(n.target).unbind("mousedown")); | |
n.ud = !0; | |
this.gd = setTimeout(function() { | |
t.vd(n) | |
}, this.jd + 1) | |
}, n.prototype.vd = function(n) { | |
if (!(n.originalEvent.touches.length > 1 || this.hd)) | |
if (this.rd()) { | |
var t = n.timeStamp - this.fd; | |
t >= this.jd || n.ud === !0 ? (this.update(n), this.show(n), n.ud || n.preventDefault()) : this.hd = !0 | |
} else this.update(n), this.show(n) | |
}, n.prototype.wd = function(n) { | |
this.sd(n) | |
}, n.prototype.xd = function() { | |
var t = this, | |
r, i, n; | |
this.chart = $(this.container).highcharts(); | |
r = $("<div style='position: relative'><\/div>"); | |
i = $("<div class='touchCapture' style='position:absolute;top:0;left:0;height:100%;width:100%;z-index:1;-webkit-user-select: none;-webkit-touch-callout: none'>"); | |
$(this.container).children().first().wrapAll(r); | |
$(this.container).children().prepend(i); | |
this.Zc = $(document.createElement("div")).attr({ | |
"class": "info-box " + this.$c.ib, | |
style: "display:none" | |
}); | |
$(this.container).children().append(this.Zc); | |
n = i; | |
$(n).mouseenter(function(n) { | |
t.Lc(n) | |
}); | |
$(n).mousedown(function(n) { | |
t.Lc(n) | |
}); | |
$(n).mousemove(function(n) { | |
t.Mc(n) | |
}); | |
$(n).mouseleave(function(n) { | |
t.Nc(n) | |
}); | |
$(n).bind("touchstart", function(n) { | |
t.td(n) | |
}); | |
$(n).bind("touchmove", function(n) { | |
t.vd(n) | |
}); | |
$(n).bind("touchend", function(n) { | |
t.wd(n) | |
}); | |
$(n).bind("touchcancel", function(n) { | |
t.wd(n) | |
}) | |
}, n.prototype.yd = function(n) { | |
var t = 30, | |
i = t, | |
r = n - t - this.zd(), | |
u = r - i, | |
f = (this.ld - this.md.min) / (this.md.max - this.md.min); | |
return u * f + i | |
}, n.prototype.Ad = function(n, t) { | |
return this.yd(n, t) + this.zd() | |
}, n.prototype.nd = function(n, t) { | |
var i = this.yd(n, t) - 7, | |
r = this.Ad(n, t) - 2, | |
u = r - i, | |
f = (this.ld - this.md.min) / (this.md.max - this.md.min); | |
return u * f + i | |
}, n.prototype.zd = function() { | |
return 20 | |
}, n.prototype.Bd = function() { | |
return 30 | |
}, n.prototype.pd = function(t) { | |
var o = this.Zc.width(), | |
c = this.Zc.height(), | |
s = 1, | |
h = 1, | |
a = this.nd(o, t), | |
l = c - h, | |
v = this.Bd(), | |
y = this.yd(o, t), | |
p = this.Ad(o, t), | |
w = l - v - h, | |
r = 0, | |
e = o - s - s - 10, | |
u = 0, | |
f = w, | |
i = 5; | |
return this.dd == n.ed ? "<svg width='" + o + "px' height='" + c + "px' style='position:absolute;top:0;left:0px'> <g stroke='#888' fill='#fcfcfc' transform='translate(" + s + "," + h + ")'> <path d='M " + (r + i) + " " + u + " L " + (e - i) + " " + u + " A 5 5 135 0 1 " + e + " " + (u + i) + " L " + e + " " + (f - i) + " A 5 5 225 0 1 " + (e - i) + " " + f + " L " + p + " " + f + " L " + a + " " + l + " L " + y + " " + f + " L " + (r + i) + " " + f + " A 5 5 315 0 1 " + r + " " + (f - i) + " L " + r + " " + (u + i) + " A 5 5 45 0 1 " + (r + i) + " " + u + " z '> <\/g> <\/svg>" : "<svg width='" + o + "px' height='" + c + "px' style='position:absolute;top:0;left:0px' filter='url(#ib)' > <g stroke='#888' fill='#fcfcfc' transform='translate(" + s + "," + h + ")'> <path d='M " + (r + i) + " " + u + " L " + (e - i) + " " + u + " A 5 5 135 0 1 " + e + " " + (u + i) + " L " + e + " " + (f - i) + " A 5 5 225 0 1 " + (e - i) + " " + f + " L " + (r + i) + " " + f + " A 5 5 315 0 1 " + r + " " + (f - i) + " L " + r + " " + (u + i) + " A 5 5 45 0 1 " + (r + i) + " " + u + " z '> <\/g> <\/svg>" | |
}, n.Cd = function(t, i, r, u) { | |
var f = new n; | |
return f.$c = t, f.container = i, f.yAxis = r, f._c = u, f.xd(), i.Ga = f, f | |
}, n | |
}(); | |
t.od = 0; | |
t.ed = 1; | |
t.Dd = 1; | |
n.Ed = t | |
}(sb || (sb = {})); | |
__extends = this && this.__extends || function(n, t) { | |
function r() { | |
this.constructor = n | |
} | |
for (var i in t) t.hasOwnProperty(i) && (n[i] = t[i]); | |
n.prototype = null === t ? Object.create(t) : (r.prototype = t.prototype, new r) | |
}; | |
! function(n) { | |
var t = function(t) { | |
function i() { | |
var n = null !== t && t.apply(this, arguments) || this; | |
return n.ib = "info-box-livet", n | |
} | |
return __extends(i, t), i.prototype.Qb = function(i) { | |
var o; | |
t.prototype.Qb.call(this, i); | |
var u = .2, | |
f = $.map(this.data.points, function(n) { | |
return { | |
x: n.time.getTime(), | |
y: n.tide | |
} | |
}), | |
e = Math.floor(10 * (f.reduce(function(n, t) { | |
return Math.max(t.y, n) | |
}, 0) + u)) / 10, | |
r = this.Rb(this.data); | |
return r.title = this.ec("Live Tide at " + this.data.title), r.credits = this.dc(r.chart), r.xAxis = this.bc(this.cb, this.cb / 6, n.tc), r.xAxis.min = this.data.i.A.getTime(), r.xAxis.max = this.data.i.D.getTime(), r.xAxis.startOnTick = !1, r.xAxis.endOnTick = !1, r.xAxis.showLastLabel = !0, r.xAxis.gridLineWidth = 0, r.yAxis = [this.cc(1, "Tide Height - Feet", "left", function() { | |
return this.value | |
}, e * n.Units.feetPerMetre), this.cc(u, "Tide Height - Metres", "right", function() { | |
return this.value | |
}, e)], r.yAxis[0].gridLineWidth = 0, r.yAxis[0].endOnTick = !1, r.yAxis[0].minorTickInterval = .5, r.yAxis[1].minorTickInterval = .1, this.Ub(r, this.data), this.Wb(r, f).yAxis = 1, o = $(i).highcharts(r).highcharts(), n.Ed.Cd(this, i, 0, "tide"), this.Sb(o), $(i).append("<div class='tide-live-hint'> <\/div>"), this.Fd(n.Dates.getDayName2(this.data.i.A.getTime())), !0 | |
}, i.prototype.format = function(t) { | |
return "<table class='info-tide-live'><tr><td class='title'>" + this.data.i.title + "<\/td><\/tr><tr><td class='time'>" + n.Dates.getDayName(t.time) + "<br/>" + n.Dates.formatTime(t.time) + "<\/td><\/tr><tr><td class='data-title'>Tide Height<\/td>" + ("<tr><td class='data'>" + n.Utils.toPrecision(t.tide, 2) + " m<br/>" + n.Units.toImperialLength(t.tide * n.Units.feetPerMetre) + "<td><\/tr>") + "<\/table>" | |
}, i.prototype.Fd = function(n) { | |
if (this.data.global.tides) { | |
for (var t = this.data.global.tides.split(","), r = "<div class='row'>", u = !1, i = 1; i < t.length; i += parseInt(t[0])) | |
if (t[i] === n) { | |
var e = t[i + 1], | |
o = t[i + 2], | |
f = t[i + 3]; | |
r += "<span class='tide-today tide-extreme-" + ("H" === f ? "high" : "low") + "'>" + e + " : " + o + " " + f + "<\/span>"; | |
u = !0 | |
} else if (u) break; | |
r += "<\/div>"; | |
$(".tide-live-hint").html(r) | |
} | |
}, i | |
}(n.Xa); | |
n.oc = t | |
}(sb || (sb = {})); | |
__extends = this && this.__extends || function(n, t) { | |
function r() { | |
this.constructor = n | |
} | |
for (var i in t) t.hasOwnProperty(i) && (n[i] = t[i]); | |
n.prototype = null === t ? Object.create(t) : (r.prototype = t.prototype, new r) | |
}; | |
! function(n) { | |
var t = function(t) { | |
function i() { | |
var n = null !== t && t.apply(this, arguments) || this; | |
return n.ib = "info-box-livew", n | |
} | |
return __extends(i, t), i.prototype.Qb = function(r) { | |
var f, s; | |
t.prototype.Qb.call(this, r); | |
for (var h = [], c = [], l = this.data.points, e = this.eb, o = l.length - 1; o >= 0; o--) f = l[o], h.push({ | |
x: f.time.getTime(), | |
y: f.windSpeed, | |
dir: n.Xa.getAngle(f.R), | |
marker: this.getArrowMarker(n.$a, f.windSpeed) | |
}), c.push({ | |
x: f.time.getTime(), | |
y: f.windGust, | |
dir: n.Xa.getAngle(f.R), | |
marker: this.getArrowMarker(n.Za, f.windGust) | |
}), e = Math.max(e, f.windGust); | |
e > this.eb && (e = 5 * Math.floor((e + 5) / 5)); | |
var u = this.Rb(this.data); | |
return this.fc(u, e), u.title = this.ec(this.data.title + " Live Wind Report"), u.credits = this.dc(u.chart), u.xAxis = this.bc(this.cb, this.cb / 6, n.tc), u.xAxis.min = this.data.i.A.getTime(), u.xAxis.max = this.data.i.D.getTime(), u.xAxis.gridLineWidth = 0, u.xAxis.endOnTick = !1, u.xAxis.startOnTick = !1, u.xAxis.showLastLabel = !0, u.yAxis = [this.cc(5, "Knots", "right", null, e), this.cc(10, "km/h", "left", null, e * 1.852)], u.yAxis[1].minorTickInterval = 2.5, u.yAxis[1].endOnTick = !1, u.yAxis[1].gridLineWidth = 0, u.series = [], this.Ub(u, this.data), this.Xb(u, n.Za, c), this.Xb(u, n.$a, h), $(r).highcharts(u), s = $(r).highcharts(), this._b(s, n.Za), this._b(s, n.$a), n.Ed.Cd(this, r, 0, "windSpeed"), $(r).click(function(n) { | |
i.Gd = !i.Gd; | |
r.Ga.update(n) | |
}), !0 | |
}, i.prototype.format = function(t) { | |
return i.Gd ? this.Hd(t) : "<table class='info-wind-live'><tr><td class='title' colspan='2'>" + this.data.i.title + "<\/td><\/tr><tr><td class='time' colspan='2'>" + n.Dates.getDayName(t.time) + "<br/>" + n.Dates.formatTime(t.time) + "<\/td><\/tr><tr><td class='data-title' width='50%'>Average<\/td><td class='data-title' width='50%'>Gust<\/td><tr><td class='data'>" + t.windSpeed + " kn<br/>" + t.R + "<\/td><td class='data'>" + t.windGust + " kn<br/>" + t.R + "<\/td><\/tr><tr><td class='footer' colspan='2'>Click to toggle list/latest<\/td><\/tr><\/table>" | |
}, i.prototype.Hd = function(t) { | |
for (var s = t.time.getTime(), o, f, e, r, u, i = 0; i < this.data.points.length && !(this.data.points[i].time.getTime() > s); i++); | |
if (0 === i) return "No data"; | |
for (o = i, i = Math.min(i + 3, this.data.points.length - 1), f = "<table>\n" + (" <tr><td class='title' colspan='4'>" + this.data.i.title + "<\/td><\/tr>\n") + " <tr><td class='list-title' width='30%'>Time<\/td><td class='list-title' width='22%'>Ave<\/td><td class='list-title' width='22%'>Gust<\/td><td class='list-title' width='26%'>Dir<\/td><\/tr>\n", e = 0; i >= Math.max(i - 15, 0) && 8 > e; i--, e++) r = this.data.points[i], u = i === o ? "list highlight" : "list", f += " <tr><td class='" + u + "'>" + n.Dates.formatTime(r.time) + "<\/td><td class='" + u + "'>" + r.windSpeed + "<\/td><td class='" + u + "'>" + r.windGust + "<\/td><td class='" + u + "'>" + r.R + "<\/td><\/tr>\n"; | |
return f + "<\/table>\n" | |
}, i | |
}(n.Xa); | |
t.Gd = !1; | |
n.nc = t | |
}(sb || (sb = {})); | |
__extends = this && this.__extends || function(n, t) { | |
function r() { | |
this.constructor = n | |
} | |
for (var i in t) t.hasOwnProperty(i) && (n[i] = t[i]); | |
n.prototype = null === t ? Object.create(t) : (r.prototype = t.prototype, new r) | |
}; | |
! function(n) { | |
var t = function(t) { | |
function i() { | |
var n = null !== t && t.apply(this, arguments) || this; | |
return n.ib = "info-box-peakf", n | |
} | |
return __extends(i, t), i.prototype.Qb = function(i) { | |
var u, a; | |
t.prototype.Qb.call(this, i); | |
for (var f = this.data.points, s = $.map(f, function(n) { | |
return { | |
x: n.time.getTime(), | |
y: n.waveHeightFeet, | |
dir: n.U | |
} | |
}), e = [], o = f.length - 1; o >= 0; o--) u = f[o], e.push({ | |
x: u.time.getTime(), | |
y: u.T, | |
dir: n.Xa.getAngle(u.U), | |
marker: this.getArrowMarker(n._a, u.waveHeightFeet) | |
}); | |
var h = s.reduce(function(n, t) { | |
return Math.max(t.y, n) | |
}, 0), | |
v = e.reduce(function(n, t) { | |
return Math.max(t.y, n) | |
}, 0), | |
c = 2, | |
l = 2, | |
r = this.Rb(this.data); | |
return r.chart.marginBottom += 10, r.title = this.ec("7 Day Wave Direction & Period Forecast for " + this.data.title), r.credits = this.dc(r.chart), r.xAxis = this.bc(24 * this.cb, 6 * this.cb, n.uc), r.xAxis.min = this.data.i.A.getTime(), r.xAxis.max = this.data.i.D.getTime(), r.xAxis.labels.x = 40, r.yAxis = [this.cc(c, "Wave Height - Feet", "left", null, h > this.fb * n.Units.feetPerMetre ? h * n.Units.feetPerMetre + c : this.fb * n.Units.feetPerMetre), this.cc(l, "Wave Period - Second", "right", null, v + l)], r.yAxis[0].gridLineWidth = 0, r.yAxis[0].minorTickInterval = r.yAxis[1].minorTickInterval = .5, this.Wb(r, s).yAxis = 0, this.Xb(r, n._a, e).yAxis = 1, $(i).highcharts(r), a = $(i).highcharts(), this._b(a, n._a), n.Ed.Cd(this, i, 0, "waveHeightFeet"), !0 | |
}, i.prototype.format = function(t) { | |
return "<table class='info-peak-fc'><tr><td class='title' colspan='2'>" + this.data.i.title + "<\/td><\/tr>" + ("<tr><td class='time' colspan='2'>" + n.Dates.getDayName(t.time) + "<br/>" + n.Dates.formatTime(t.time) + "<\/td><\/tr>") + "<tr><td class='data-title' width='50%'>Period<\/td><td class='data-title' width='50%'>Height<\/td><\/tr>" + ("<tr><td class='data'>" + t.T + " secs<br/>" + t.U + "<\/td><td class='data'>" + this.gc(t.waveHeight, 1) + " m<br/>" + n.Units.toImperialLength(t.waveHeightFeet) + "<\/td><\/tr>") + "<\/table>" | |
}, i | |
}(n.Xa); | |
n.lc = t | |
}(sb || (sb = {})); | |
__extends = this && this.__extends || function(n, t) { | |
function r() { | |
this.constructor = n | |
} | |
for (var i in t) t.hasOwnProperty(i) && (n[i] = t[i]); | |
n.prototype = null === t ? Object.create(t) : (r.prototype = t.prototype, new r) | |
}; | |
! function(n) { | |
var t = function(t) { | |
function i() { | |
return null !== t && t.apply(this, arguments) || this | |
} | |
return __extends(i, t), i.prototype.Qb = function(i) { | |
t.prototype.Qb.call(this, i); | |
var u = $.map(this.data.points, function(n) { | |
return { | |
x: n.time.getTime(), | |
y: n.temperature | |
} | |
}), | |
f = $.map(this.data.points, function(n) { | |
return { | |
x: n.time.getTime(), | |
y: n.pressure | |
} | |
}), | |
h = u.reduce(function(n, t) { | |
return Math.max(t.y, n) | |
}, 0), | |
e = f.reduce(function(n, t) { | |
return Math.max(t.y, n) | |
}, 0), | |
c = u.reduce(function(n, t) { | |
return Math.min(t.y, n) | |
}, 100), | |
o = f.reduce(function(n, t) { | |
return Math.min(t.y, n) | |
}, 1e5), | |
s = 2, | |
r = this.Rb(this.data); | |
return r.title = this.ec("Average Temp/Air Pressure at " + this.data.title), r.credits = this.dc(r.chart), r.xAxis = this.bc(this.cb, this.cb / 6, n.tc), r.xAxis.min = this.data.i.A.getTime(), r.xAxis.max = this.data.i.D.getTime(), r.xAxis.startOnTick = !1, r.xAxis.endOnTick = !1, r.xAxis.gridLineWidth = 0, r.xAxis.showLastLabel = !0, r.yAxis = [this.cc(5, "hPa", "left", null, e), this.cc(s, "'C", "right", null, h)], r.yAxis[0].endOnTick = !1, r.yAxis[0].gridLineWidth = 0, r.yAxis[0].max = Math.max(e, e + 10), r.yAxis[0].min = Math.min(o, o - 10), r.yAxis[0].labels.x = -33, r.yAxis[0].title.x = -20, r.yAxis[0].title.style.color = "#00c", r.yAxis[1].min = c - s, r.yAxis[1].title.style.color = "#008000", this.Ub(r, this.data), r.series.push({ | |
name: "Air Pressure", | |
lineWidth: 2, | |
type: "spline", | |
color: "#0000ff", | |
data: f, | |
yAxis: 0, | |
marker: { | |
enabled: !1 | |
} | |
}), r.series.push({ | |
name: "Temperature", | |
lineWidth: 2, | |
type: "spline", | |
color: "#008000", | |
data: u, | |
yAxis: 1, | |
marker: { | |
enabled: !1 | |
} | |
}), $(i).highcharts(r), n.Ed.Cd(this, i, 1, "temperature"), !0 | |
}, i.prototype.format = function(t) { | |
return "<table class='info-pt-live'><tr><td class='title' colspan='2'>" + this.data.i.title + "<\/td><\/tr><tr><td class='time' colspan='2'>" + n.Dates.getDayName(t.time) + "<br/>" + n.Dates.formatTime(t.time) + "<\/td><\/tr><tr><td class='data-title' width='50%'>ºC<\/td><td class='data-title' width='50%'>hPa<\/td><tr><td class='data'>" + t.temperature + "º<\/td><td class='data'>" + t.pressure + "<\/td><\/tr><\/table>" | |
}, i | |
}(n.Xa); | |
n.mc = t | |
}(sb || (sb = {})); | |
__extends = this && this.__extends || function(n, t) { | |
function r() { | |
this.constructor = n | |
} | |
for (var i in t) t.hasOwnProperty(i) && (n[i] = t[i]); | |
n.prototype = null === t ? Object.create(t) : (r.prototype = t.prototype, new r) | |
}; | |
! function(n) { | |
var t = function(t) { | |
function i() { | |
var n = null !== t && t.apply(this, arguments) || this; | |
return n.ib = "info-box-tidef", n | |
} | |
return __extends(i, t), i.prototype.Qb = function(i) { | |
var u = this, | |
s; | |
t.prototype.Qb.call(this, i); | |
var f = .5, | |
e = $.map(this.data.points, function(n) { | |
return { | |
x: n.time.getTime(), | |
y: n.tide | |
} | |
}), | |
o = Math.floor(10 * (e.reduce(function(n, t) { | |
return Math.max(t.y, n) | |
}, 0) + f)) / 10, | |
r = this.Rb(this.data); | |
return r.chart.marginTop += this.Ob, r.chart.marginBottom += this.Pb, r.title = this.ec("7 Day Tide Forecast for " + this.data.title), r.credits = this.dc(r.chart), r.xAxis = this.bc(24 * this.cb, 6 * this.cb, n.uc), r.xAxis.min = this.data.i.A.getTime(), r.xAxis.max = this.data.i.D.getTime(), r.xAxis.labels.x = 40, r.yAxis = [this.cc(1, "Tide Height - Feet", "left", function() { | |
return this.value | |
}, o * n.Units.feetPerMetre), this.cc(f, "Tide Height - Metres", "right", function() { | |
return this.value | |
}, o)], r.yAxis[0].gridLineWidth = 0, r.yAxis[0].endOnTick = !1, r.yAxis[0].minorTickInterval = .5, r.yAxis[1].minorTickInterval = .1, this.Wb(r, e).yAxis = 1, $(i).highcharts(r), s = $(i).highcharts(), this.Id(s), n.Ed.Cd(this, i, 1, "tide"), this.Jd = this.data.global.tides.split(","), n.Ca.Ba(this.container, this.data.title, this.Jd, new Date), $(i).click(function() { | |
n.Ca.Na(i, u.data.i.title, u.Jd) | |
}), !0 | |
}, i.prototype.Id = function(t) { | |
var e = this, | |
i = this.data.points.V; | |
if (!(i.length < 1)) { | |
var r = this.Ob, | |
u = 4, | |
f = 36, | |
o = f + u, | |
s = f, | |
h = this.Ob + u + 4; | |
t.renderer.rect(t.plotLeft, s, t.plotWidth, h, 0).attr({ | |
"stroke-width": 1, | |
stroke: "#000", | |
fill: "#000", | |
zIndex: 0 | |
}).add(); | |
$.each(i, function(u, f) { | |
var s = t.plotWidth / i.length, | |
h = t.plotLeft + s * u + (s / 2 - r / 2); | |
t.renderer.image("" + n.Network.getCdn(2) + e.rb + f.filename + ".jpg", h, o, r, r).attr({ | |
zIndex: 2 | |
}).add() | |
}) | |
} | |
}, i.prototype.format = function(t) { | |
var i = n.Dates.getDayName2(t.time); | |
return $(".tide-table .tide-item").removeClass("tide-day-highlight"), $(".tide-table .tide-day-" + i).addClass("tide-day-highlight"), n.Ca.Ba(this.container, this.data.title, this.Jd, new Date(t.time)), "<table class='info-tide-fc'>" + ("<tr><td class='title'>" + this.data.i.title + "<\/td><\/tr>") + ("<tr><td class='time'>" + i + "<br/>" + n.Dates.formatTime(t.time) + "<\/td><\/tr>") + "<tr><td class='data-title'>Tide Height<\/td>" + ("<tr><td class='data'>" + n.Utils.toPrecision(t.tide, 2) + " m<br/>" + n.Units.toImperialLength(t.tide * n.Units.feetPerMetre) + "<td><\/tr>") + "<tr><td class='footer'>Tap to view table<\/td><\/tr><\/table>" | |
}, i.prototype.qd = function() {}, i.Y = function(n) { | |
var i = 24, | |
r = 2 * Math.PI, | |
u = r / i, | |
t = Math.round((n - u / 2) / r * i); | |
return t = (t + i) % i, 10 > t ? "0" + t : t.toString() | |
}, i | |
}(n.Xa); | |
n.Z = t | |
}(sb || (sb = {})); | |
__extends = this && this.__extends || function(n, t) { | |
function r() { | |
this.constructor = n | |
} | |
for (var i in t) t.hasOwnProperty(i) && (n[i] = t[i]); | |
n.prototype = null === t ? Object.create(t) : (r.prototype = t.prototype, new r) | |
}; | |
! function(n) { | |
var t = function(t) { | |
function i() { | |
var n = null !== t && t.apply(this, arguments) || this; | |
return n.ib = "info-box-wwf", n | |
} | |
return __extends(i, t), i.prototype.Qb = function(i) { | |
var y = this, | |
f, s; | |
t.prototype.Qb.call(this, i); | |
for (var h = [], c = [], l = this.data.points, u = this.eb, e = this.fb, o = l.length - 1; o >= 0; o--) f = l[o], h.push({ | |
x: f.time.getTime(), | |
y: f.windSpeed, | |
dir: n.Xa.getAngle(f.R), | |
marker: this.getArrowMarker(n.$a, f.windSpeed) | |
}), c.push({ | |
x: f.time.getTime(), | |
y: f.waveHeight | |
}), u = Math.max(u, f.windSpeed), e = Math.max(e, f.waveHeight); | |
u > this.eb && (u = Math.min(5 * Math.floor((u + 5) / 5), this.gb)); | |
e > this.fb && (e = Math.min(Math.floor(e + 1), this.hb)); | |
var a = 5, | |
v = 1, | |
r = this.Rb(this.data); | |
return r.chart.marginTop += this.Pb + 0 + this.Ob + 5, r.chart.marginBottom += this.Pb, r.title = this.ec("7 Day Wind & Wave Forecast for " + this.data.title), r.credits = this.dc(r.chart), r.xAxis = this.bc(24 * this.cb, 6 * this.cb, n.uc), r.xAxis.min = this.data.i.A.getTime() + 3456e4, r.xAxis.max = this.data.i.D.getTime(), r.xAxis.labels.x = i.width() / 14, r.yAxis = [this.cc(v, "Wave Height - Metres", "left", function() { | |
return this.value | |
}, e > this.fb ? e + v : this.fb), this.cc(a, "Wind Speed - Knots", "right", function() { | |
return this.value | |
}, u > this.eb ? u + a : this.eb)], r.yAxis[0].gridLineWidth = 0, r.yAxis[0].minorTickInterval = .25, this.fc(r, u) && e < this.fb && (r.yAxis[0].max = this.fb * (u / this.eb)), this.Wb(r, c).yAxis = 0, this.Xb(r, n.$a, h).yAxis = 1, $(i).highcharts(r), s = $(i).highcharts(), this._b(s, n.$a), this.Id(s), n.Ed.Cd(this, i, 1, "windSpeed"), $(i).click(function() { | |
y.Kd(i) | |
}), !0 | |
}, i.prototype.Id = function(t) { | |
var i = this, | |
r = this.data.forecasts.forecast; | |
if (!(null == r || r.length < 1)) { | |
var u = this.Ob, | |
o = u, | |
f = 45, | |
s = f + 5, | |
e = t.plotWidth / this.data.forecasts.forecastDays; | |
$.each(r, function(r, h) { | |
var l = t.plotLeft + e * r, | |
c = l + (e / 2 - o / 2), | |
a = ("fc_" + h.weatherIcon + ".png").toLowerCase(), | |
v = (h.minTemp < 9e3 ? h.minTemp : "? ") + " - " + h.maxTemp + "°"; | |
t.renderer.text('<span style="z-index:1;font-size: ' + i.Lb.font.kb + "; font-family: " + i.fontFamily + '">' + v + "<\/span>", c - 2, f).add(); | |
t.renderer.image("" + n.Network.getCdn(3) + i.qb + a, c, s, u, u).attr({ | |
zIndex: 2 | |
}).add() | |
}) | |
} | |
}, i.prototype.format = function(t) { | |
var i = null, | |
r; | |
return ($.each(this.data.forecasts.forecast, function(n, r) { | |
t.time.getDate() === new Date(r.localDate).getDate() && (i = r) | |
}), null == i) ? "<br/><br/>No data<br/>for this point?!<br/><br/> " : (r = i.shortDesc, i.probabilityPrecip > 0 && (r += "<div class='rain'>" + i.probabilityPrecip + "% chance of rain", r += "<\/div>"), "<table class='info-windwave-fc'><tr>" + ("<td class='title' colspan='2'>" + this.data.i.title + "<\/td><\/tr>") + ("<tr><td class='time' colspan='2'>" + n.Dates.getDayName(t.time) + "<br/>" + n.Dates.formatTime(t.time) + "<\/td><\/tr>") + ("<tr><td class='shortDesc' colspan='2'>" + r + "<\/td><\/tr>") + "<tr><td class='data-title' width='50%'>Wind<\/td><td class='data-title' width='50%'>Waves<\/td><\/tr>" + ("<tr><td class='data'>" + t.windSpeed + " kn<br/>" + t.R + "<\/td><td class='data'>" + this.gc(t.waveHeight, 1) + " m<br/>" + n.Units.toImperialLength(t.waveHeight * n.Units.feetPerMetre) + "<\/td><\/tr>") + "<\/table>") | |
}, i.prototype.Kd = function(n) { | |
var t = $(".forecast-extras"); | |
$(n).find(".forecast-extras").length || (n.append(t), $(".prognosis").attr("src", this.data.global.prognosisImageUrl).load(function() { | |
$(".extras-loading").hide() | |
}), $(".synopsis").attr("src", this.data.global.synopticImageUrl).load(function() { | |
$(".extras-loading").hide() | |
}), $(".prognosis").click(function() { | |
return $(".synopsis").fadeIn(100), $(".prognosis").fadeOut(100), !1 | |
}), $(".synopsis").click(function() { | |
return $(".prognosis").fadeIn(100), $(".synopsis").fadeOut(100), !1 | |
})); | |
t.slideToggle() | |
}, i | |
}(n.Xa); | |
n.kc = t | |
}(sb || (sb = {})); | |
! function(n) { | |
var t = function() { | |
function n() {} | |
return n.getZoom = function() { | |
return n.Ld().zoom | |
}, n.Md = function() { | |
return n.Ld().Nd | |
}, n.devicePixelRatio = function() { | |
return window.devicePixelRatio || 1 | |
}, n.fallback = function() { | |
return { | |
zoom: 1, | |
Nd: 1 | |
} | |
}, n.Od = function() { | |
var t = Math.round(screen.deviceXDPI / screen.logicalXDPI * 100) / 100; | |
return { | |
zoom: t, | |
Nd: t * n.devicePixelRatio() | |
} | |
}, n.Pd = function() { | |
var t = Math.round(document.documentElement.offsetHeight / window.innerHeight * 100) / 100; | |
return { | |
zoom: t, | |
Nd: t * n.devicePixelRatio() | |
} | |
}, n.chrome = function() { | |
var t = Math.round(window.outerWidth / window.innerWidth * 100) / 100; | |
return { | |
zoom: t, | |
Nd: t * n.devicePixelRatio() | |
} | |
}, n.safari = function() { | |
var t = Math.round(document.documentElement.clientWidth / window.innerWidth * 100) / 100; | |
return { | |
zoom: t, | |
Nd: t * n.devicePixelRatio() | |
} | |
}, n.Qd = function() { | |
var i = 90 == Math.abs(window.orientation) ? screen.height : screen.width, | |
t = i / window.innerWidth; | |
return { | |
zoom: t, | |
Nd: t * n.devicePixelRatio() | |
} | |
}, n.Rd = function(n) { | |
return n.replace(/;/g, " !important;") | |
}, n.Sd = function() { | |
var r = document.createElement("div"), | |
t, i; | |
return r.innerHTML = "1<br>2<br>3<br>4<br>5<br>6<br>7<br>8<br>9<br>0", r.setAttribute("style", this.Rd("font: 100px/1em sans-serif; -webkit-text-size-adjust: none; text-size-adjust: none; height: auto; width: 1em; padding: 0; overflow: visible;")), t = document.createElement("div"), t.setAttribute("style", n.Rd("width:0; height:0; overflow:hidden; visibility:hidden; position: absolute;")), t.appendChild(r), document.body.appendChild(t), i = 1e3 / r.clientHeight, i = Math.round(100 * i) / 100, document.body.removeChild(t), { | |
zoom: i, | |
Nd: i * n.devicePixelRatio() | |
} | |
}, n.Td = function() { | |
var t = n.Ud("min--moz-device-pixel-ratio", "", 0, 10, 20, .0001); | |
return t = Math.round(100 * t) / 100, { | |
zoom: t, | |
Nd: t | |
} | |
}, n.Vd = function() { | |
return { | |
zoom: n.Td().zoom, | |
Nd: n.devicePixelRatio() | |
} | |
}, n.Wd = function() { | |
var t = window.top.outerWidth / window.top.innerWidth; | |
return t = Math.round(100 * t) / 100, { | |
zoom: t, | |
Nd: t * n.devicePixelRatio() | |
} | |
}, n.Ud = function(n, t, i, r, u, f) { | |
function s(i, r, u) { | |
var e = (i + r) / 2, | |
o; | |
return 0 >= u || f > r - i ? e : (o = "(" + n + ":" + e + t + ")", h(o).matches ? s(e, r, u - 1) : s(i, e, u - 1)) | |
} | |
var h, c, o, e, l; | |
return window.matchMedia ? h = window.matchMedia : (c = document.getElementsByTagName("head")[0], o = document.createElement("style"), c.appendChild(o), e = document.createElement("div"), e.className = "mediaQueryBinarySearch", e.style.display = "none", document.body.appendChild(e), h = function(n) { | |
o.sheet.insertRule("@media " + n + "{.mediaQueryBinarySearch {text-decoration: underline} }", 0); | |
var t = "underline" == getComputedStyle(e, null).textDecoration; | |
return o.sheet.deleteRule(0), { | |
matches: t | |
} | |
}), l = s(i, r, u), e && (c.removeChild(o), document.body.removeChild(e)), l | |
}, n.Ld = function() { | |
var t = n.fallback; | |
return isNaN(screen.logicalXDPI) || isNaN(screen.systemXDPI) ? window.navigator.msMaxTouchPoints ? t = n.Pd : window.chrome && !(window.opera || navigator.userAgent.indexOf(" Opera") >= 0) ? t = n.chrome : Object.prototype.toString.call(window.HTMLElement).indexOf("Constructor") > 0 ? t = n.safari : "orientation" in window && "webkitRequestAnimationFrame" in window ? t = n.Qd : "webkitRequestAnimationFrame" in window ? t = n.Sd : navigator.userAgent.indexOf("Opera") >= 0 ? t = n.Wd : window.devicePixelRatio ? t = n.Vd : n.Td().zoom > .001 && (t = n.Td) : t = n.Od, t() | |
}, n | |
}(); | |
n.Zoom = t | |
}(sb || (sb = {})) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment