PageSourceSearch

https://www.hwunion.com/stylesheet/hw/dynamic.js?v=56

js hwunion.com collected 2026-10-02 08:09:16 UTC 8,359 bytes, 278 lines download raw bytes

1https://www.hwunion.com/elections/postsandcandidates/29/
2
3if (window.location.href === "https://www.hwunion.com/elections/postsandcandidates/28/") {
4    window.location.replace("/vote");
5}
6
7var d = new Date();
8var rn = new Date(d.getFullYear(),d.getMonth(),d.getDate(),d.getHours(),d.getMinutes());
9var intopen = new Date("2025-12-12 12:00");
10var intclose = new Date("2026-01-12 08:59:59")
11var nomsopen = new Date("2026-01-12 09:00:00");
12var nomsclose = new Date("2026-02-9 09:00:00");
13var candrelease = new Date("2026-02-27 09:00:00");
14var briefing = new Date("2026-02-11 16:00");
15var voteopen = new Date("2026-03-02 08:00:00");
16var voteclose = new Date("2026-03-06 14:00:00");
17var results = new Date("2026-03-02 19:00:00");
18var options = { hour: 'numeric', minute: 'numeric', weekday: 'long', year: 'numeric', month: 'long', day: 'numeric', hour12: false };
19var weekday = new Array(7);
20var votingtext = "Voting Currently Closed";
21weekday[0] =  "Sunday";
22weekday[1] = "Monday";
23weekday[2] = "Tuesday";
24weekday[3] = "Wednesday";
25weekday[4] = "Thursday";
26weekday[5] = "Friday";
27weekday[6] = "Saturday";
28var months = new Array(12);
29months[0] = "January";
30months[1] = "February";
31months[2] = "March";
32months[3] = "April";
33months[4] = "May";
34months[5] = "June";
35months[6] = "July";
36months[7] = "August";
37months[8] = "September";
38months[9] = "October";
39months[10] = "November";
40months[11] = "December";
41var timeline;
42var tTitle;
43var tDate;
44
45timeline = "pre";
46tTitle = "Nominations Open in:";
47tDate = nomsopen;
48
49if (rn >= intopen && rn < intclose) {timeline = "int";}
50if (rn >= nomsopen && rn < nomsclose) {timeline = "noms";}
51if (rn >= nomsclose && rn < candrelease) {timeline = "pause";}
52if (rn >= candrelease && rn < voteopen) {timeline = "campaign";}
53if (rn >= voteopen && rn < voteclose) {timeline = "voting";}
54if (rn >= voteclose && rn < results) {timeline = "post";}
55if (rn >= results) {timeline = "close";}
56timeline = "voting";
57
58switch (timeline) {
59    case "pre":
60        tTitle = "Applications Open in:";
61        tDate = nomsopen;
62        break;
63    case "int":
64        $('#intopen').addClass("timeline-active");
65        tTitle = "Register Your Interest!";
66        tDate = intclose;
67        break;
68    case "noms":
69        $('#nomsopen').addClass("timeline-active");
70        tTitle = "Applications Close in:";
71        tDate = nomsclose;
72        break;
73    case "pause":
74        $('#nomsclose').addClass("timeline-active");
75        tTitle = "Voting Opens in:";
76        tDate = candrelease;
77        break;
78    case "campaign":
79        $('#nomsclose').addClass("timeline-active");
80        tTitle = "Voting Opens in:";
81        tDate = voteopen;
82        break;
83    case "voting":
84        $('#voteopen').addClass("timeline-active");
85        tTitle = "Voting Closes in:";
86        tDate = voteclose;
87        votingtext = "VOTE NOW";
88        break;
89    case "post":
90        $('#voteclose').addClass("timeline-active");
91        tTitle = "Results LIVE in";
92        tDate = results;
93        break;
94    case "close":
95        $('#voteclose').addClass("timeline-active");
96        tTitle = "It's Over!";
97        tDate = rn;
98        break;
99}
100
101
102
103var tDiff;
104var tDiffDesc;
105
106
107var DateDiff = {
108
109    inMins: function(d1, d2) {
110        var t2 = d2.getTime();
111        var t1 = d1.getTime();
112
113        return parseInt((t2-t1)/(60000));
114    },
115    
116    inHours: function(d1, d2) {
117        var t2 = d2.getTime();
118        var t1 = d1.getTime();
119
120        return parseInt((t2-t1)/(3600*1000));
121    },
122    
123    inDays: function(d1, d2) {
124        var t2 = d2.getTime();
125        var t1 = d1.getTime();
126
127        return parseInt((t2-t1)/(24*3600*1000));
128    },
129
130    inWeeks: function(d1, d2) {
131        var t2 = d2.getTime();
132        var t1 = d1.getTime();
133
134        return parseInt((t2-t1)/(24*3600*1000*7));
135    },
136
137    inMonths: function(d1, d2) {
138        var d1Y = d1.getFullYear();
139        var d2Y = d2.getFullYear();
140        var d1M = d1.getMonth();
141        var d2M = d2.getMonth();
142
143        return (d2M+12*d2Y)-(d1M+12*d1Y);
144    },
145
146    inYears: function(d1, d2) {
147        return d2.getFullYear()-d1.getFullYear();
148    }
149};
150
151tDiff = DateDiff.inDays(rn,tDate);
152tDiffDesc = "Day" + plural(tDiff);
153//if (tDiff === 0) {
154    //tDiff = DateDiff.inHours(rn,tDate);
155    //tDiffDesc = "Hours";
156//}
157tDiffH = DateDiff.inHours(rn,tDate);
158tDiffDescH = "Hour" + plural(tDiffH);
159
160tDiffM = DateDiff.inMins(rn,tDate);
161tDiffDescM = "Minute" + plural(tDiffM);
162
163function dateFormat(date) {
164    yy = date.getFullYear();
165    mm = months[date.getMonth()];
166    dd = date.getDate();
167    hh = date.getHours();
168    nn = leadZeros(date.getMinutes());
169    ww = weekday[date.getDay()];
170    //return hh + ":" + nn + ", " + ww + " " + dd + " " + mm + " " + yy;
171    return ww + ", " + dd + " " + mm + " " + yy;
172}
173
174function timeFormat(date) {
175    yy = date.getFullYear();
176    mm = months[date.getMonth()];
177    dd = date.getDate();
178    hh = date.getHours();
179    nn = leadZeros(date.getMinutes());
180    ww = weekday[date.getDay()];
181    if (hh > 11) {
182        if (hh == 12) {
183            hh = hh;
184        } else {
185            hh=hh-12;
186        }
187        ampm = "pm";
188    } else {
189        hh = hh;
190        ampm = "am";
191    }
192    //return hh + ":" + nn + ", " + ww + " " + dd + " " + mm + " " + yy;
193    return hh + ":" + nn + "" + ampm;
194}
195
196function leadZeros(numb) {
197    //asString = numb.toString();
198    if (numb<10) {
199        return "0" + numb;
200    } else {
201        return numb;
202    }
203}
204function plural(numb) {
205    if (numb==1) {
206        return "";
207    } else {
208        return "s";
209    }
210}
211
212$( document ).ready(function() {
213    $('*[class^="disp-"]').each(function(){
214       //$(this).addClass('hide') ;
215    });
216    $('#intopen .date').html(dateFormat(intopen));
217    $('#intclose .date').html(dateFormat(intopen));
218    $('#nomsopen .date').html(dateFormat(nomsopen));
219    $('#nomsclose .date').html(dateFormat(nomsclose));
220    $('#candrelease .date').html(dateFormat(candrelease));
221    $('#voteopen .date').html(dateFormat(voteopen));
222    $('#voteclose .date').html(dateFormat(voteclose));
223    $('#intopen .time').html(timeFormat(intopen));
224    $('#intclose .time').html(timeFormat(intclose));
225    $('#nomsopen .time').html(timeFormat(nomsopen));
226    $('#nomsclose .time').html(timeFormat(nomsclose));
227    $('#candrelease .time').html(timeFormat(candrelease));
228    $('#voteopen .time').html(timeFormat(voteopen));
229    $('#voteclose .time').html(timeFormat(voteclose));
230    $('#voteopentime').html(timeFormat(voteopen));
231    if (briefing) {
232        $('#briefing .date').html(dateFormat(briefing));
233        $('#briefing .time').html(timeFormat(briefing));
234    }
235    var d = new Date();
236    if (typeof briefing !== 'undefined') {
237    if (dateFormat(briefing) != dateFormat(d)) {
238        $('#briefingdate').html("on " + dateFormat(briefing));
239    } else {
240        $('#briefingdate').html("today ");
241    }
242    $('#briefingtime').html(timeFormat(briefing));
243    } else {
244        $('#briefing-span').addClass("hide");
245    }
246    //var invcount = 0;
247    //$('.timeline').each(function() {
248        //if (invcount % 2 > 0) {
249            //$(this).addClass("timeline-inverted");
250            //$(this).removeClass("timeline");
251        //}
252        //invcount++;
253    //});
254    $('.countdown-title').html(tTitle);
255    $('.countdown-days .countdown-number').html(tDiff);
256    $('.countdown-days .countdown-desc').html(tDiffDesc);
257    if (tDiff === 0) {
258        $('.countdown-hours').addClass('active');
259        $('.countdown-days').remove();
260    }
261    $('.countdown-hours .countdown-number').html(tDiffH);
262    $('.countdown-hours .countdown-desc').html(tDiffDescH);
263    if (tDiffH === 0) {
264        $('.countdown-mins').addClass('active');
265        $('.countdown-hours').remove();
266    }
267    $('.countdown-mins .countdown-number').html(tDiffM);
268    $('.countdown-mins .countdown-desc').html(tDiffDescM);
269
270    $('.disp-' + timeline).each(function(){
271        //$(this).css('display', 'block');
272        $(this).removeClass('hide');
273        $(this).removeClass('disabled');
274    });
275    if (timeline == "voting") {
276        $("#disp-voting-text").html(votingtext);
277    }
278});

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.