PageSourceSearch

https://heyhub.com/assets/js/app-3.3.js

js heyhub.com collected 2026-10-02 00:17:29 UTC 22,416 bytes, 350 lines download raw bytes

1/*
2 *  Document   : app.js
3 *  Author     : hubbub
4 */
5/**
6 * type is (null, 'info', 'danger', 'success')
7 */
8function growl(message, type) {
9    try {
10        $.bootstrapGrowl(message, {
11            ele: 'body', // which element to append to
12            type: type, // (null, 'info', 'danger', 'success')
13            offset: {from: 'top', amount: 20}, // 'top', or 'bottom'
14            align: 'right', // ('left', 'right', or 'center')
15            width: 300, // (integer, or 'auto')
16            delay: 4000, // Time while the message will be displayed. It's not equivalent to the *demo* timeOut!
17            allow_dismiss: true, // If true then will display a cross to close the popup.
18            stackup_spacing: 10 // spacing between consecutively stacked growls.
19        });
20    } catch (error) {
21        console.log(message + " growl error");
22    }
23}
24var App = function() {
25    /* start - added by:sudheeran jos - description: colours - date: 13/06/2022 - time: 12:55 - start */
26    var primaryColour = '#FFFFFF';
27    if ( $('#primary-colour').length > 0 ) {
28        primaryColour = $('#primary-colour').text();
29    }
30    var secondaryColour = '#FFFFFF';
31    if ( $('#secondary-colour').length > 0 ) {
32        secondaryColour = $('#secondary-colour').text();
33    }
34    var primaryTextColour = '#FFFFFF';
35    if ( $('#primary-text-colour').length > 0 ) {
36        primaryTextColour = $('#primary-text-colour').text();
37    }
38    var secondaryTextColour = '#FFFFFF';
39    if ( $('#secondary-text-colour').length > 0 ) {
40        secondaryTextColour = $('#secondary-text-colour').text();
41    }
42    /* end - added by:sudheeran jos - description: colours - date: 13/06/2022 - time: 12:55 - end */
43    var a, e, i, s, t, l, n, o, r = function() {
44            a = $("#page-container"), e = $("#page-content"), i = $("header"), s = $("#page-content + footer"), t = $("#sidebar"), l = $("#sidebar-scroll"), n = $("#sidebar-alt"), o = $("#sidebar-alt-scroll"), g("init"), h(), p(), m(), v(), b(), $(window).resize(function() {
45                b()
46            }), $(window).bind("orientationchange", b);
47            var r = $("#year-copy"),
48                d = new Date;
49            r.html(2014 === d.getFullYear() ? "2014" : "2014-" + d.getFullYear().toString().substr(2, 2)), f(), $('[data-toggle="tabs"] a, .enable-tabs a').click(function(a) {
50                a.preventDefault(), $(this).tab("show")
51            }), $('[data-toggle="tooltip"], .enable-tooltip').tooltip({
52                container: "body",
53                animation: 1
54            }), $('[data-toggle="popover"], .enable-popover').popover({
55                container: "body",
56                animation: !0
57            }), $('[data-toggle="lightbox-image"]').magnificPopup({
58                type: "image",
59                image: {
60                    titleSrc: "title"
61                }
62            }), $('[data-toggle="lightbox-gallery"]').each(function() {
63                $(this).magnificPopup({
64                    delegate: "a.gallery-link",
65                    type: "image",
66                    gallery: {
67                        enabled: !0,
68                        navigateByImgClick: !0,
69                        arrowMarkup: '<button type="button" class="mfp-arrow mfp-arrow-%dir%" title="%title%"></button>',
70                        tPrev: "Previous",
71                        tNext: "Next",
72                        tCounter: '<span class="mfp-counter">%curr% of %total%</span>'
73                    },
74                    image: {
75                        titleSrc: "title"
76                    }
77                })
78            });
79            var c = ["Afghanistan", "Albania", "Algeria", "American Samoa", "Andorra", "Angola", "Anguilla", "Antarctica", "Antigua and Barbuda", "Argentina", "Armenia", "Aruba", "Australia", "Austria", "Azerbaijan", "Bahrain", "Bangladesh", "Barbados", "Belarus", "Belgium", "Belize", "Benin", "Bermuda", "Bhutan", "Bolivia", "Bosnia and Herzegovina", "Botswana", "Bouvet Island", "Brazil", "British Indian Ocean Territory", "British Virgin Islands", "Brunei", "Bulgaria", "Burkina Faso", "Burundi", "CΓ΄te d'Ivoire", "Cambodia", "Cameroon", "Canada", "Cape Verde", "Cayman Islands", "Central African Republic", "Chad", "Chile", "China", "Christmas Island", "Cocos (Keeling) Islands", "Colombia", "Comoros", "Congo", "Cook Islands", "Costa Rica", "Croatia", "Cuba", "Cyprus", "Czech Republic", "Democratic Republic of the Congo", "Denmark", "Djibouti", "Dominica", "Dominican Republic", "East Timor", "Ecuador", "Egypt", "El Salvador", "Equatorial Guinea", "Eritrea", "Estonia", "Ethiopia", "Faeroe Islands", "Falkland Islands", "Fiji", "Finland", "Former Yugoslav Republic of Macedonia", "France", "French Guiana", "French Polynesia", "French Southern Territories", "Gabon", "Georgia", "Germany", "Ghana", "Gibraltar", "Greece", "Greenland", "Grenada", "Guadeloupe", "Guam", "Guatemala", "Guinea", "Guinea-Bissau", "Guyana", "Haiti", "Heard Island and McDonald Islands", "Honduras", "Hong Kong", "Hungary", "Iceland", "India", "Indonesia", "Iran", "Iraq", "Ireland", "Israel", "Italy", "Jamaica", "Japan", "Jordan", "Kazakhstan", "Kenya", "Kiribati", "Kuwait", "
79Kyrgyzstan", "Laos", "Latvia", "Lebanon", "Lesotho", "Liberia", "Libya", "Liechtenstein", "Lithuania", "Luxembourg", "Macau", "Madagascar", "Malawi", "Malaysia", "Maldives", "Mali", "Malta", "Marshall Islands", "Martinique", "Mauritania", "Mauritius", "Mayotte", "Mexico", "Micronesia", "Moldova", "Monaco", "Mongolia", "Montserrat", "Morocco", "Mozambique", "Myanmar", "Namibia", "Nauru", "Nepal", "Netherlands", "Netherlands Antilles", "New Caledonia", "New Zealand", "Nicaragua", "Niger", "Nigeria", "Niue", "Norfolk Island", "North Korea", "Northern Marianas", "Norway", "Oman", "Pakistan", "Palau", "Panama", "Papua New Guinea", "Paraguay", "Peru", "Philippines", "Pitcairn Islands", "Poland", "Portugal", "Puerto Rico", "Qatar", "RΓ©union", "Romania", "Russia", "Rwanda", "SΓ£o TomΓ© and PrΓ­ncipe", "Saint Helena", "Saint Kitts and Nevis", "Saint Lucia", "Saint Pierre and Miquelon", "Saint Vincent and the Grenadines", "Samoa", "San Marino", "Saudi Arabia", "Senegal", "Seychelles", "Sierra Leone", "Singapore", "Slovakia", "Slovenia", "Solomon Islands", "Somalia", "South Africa", "South Georgia and the South Sandwich Islands", "South Korea", "Spain", "Sri Lanka", "Sudan", "Suriname", "Svalbard and Jan Mayen", "Swaziland", "Sweden", "Switzerland", "Syria", "Taiwan", "Tajikistan", "Tanzania", "Thailand", "The Bahamas", "The Gambia", "Togo", "Tokelau", "Tonga", "Trinidad and Tobago", "Tunisia", "Turkey", "Turkmenistan", "Turks and Caicos Islands", "Tuvalu", "US Virgin Islands", "Uganda", "Ukraine", "United Arab Emirates", "United Kingdom", "United States", "United States Minor Outlying Islands", "Uruguay", "Uzbekistan", "Vanuatu", "Vatican City", "Venezuela", "Vietnam", "Wallis and Futuna", "Western Sahara", "Yemen", "Yugoslavia", "Zambia", "Zimbabwe"];
80            $(".input-typeahead").typeahead({
81                source: c
82            }), $(".select-chosen").chosen({
83                width: "100%"
84            }), $(".select-select2").select2(), $(".input-colorpicker").colorpicker({
85                format: "hex"
86            }), $(".input-colorpicker-rgba").colorpicker({
87                format: "rgba"
88            }), $(".input-slider").slider(),
89                $(".input-datepicker, .input-daterange").datepicker({
90                weekStart: 1
91            }), $(".input-datepicker-close").datepicker({
92                weekStart: 1
93            }).on("changeDate", function() {
94                $(this).datepicker("hide")
95            }), $(".input-timepicker").timepicker({
96                minuteStep: 1,
97                showSeconds: !0,
98                showMeridian: !0
99            }), $(".input-timepicker24").timepicker({
100                minuteStep: 1,
101                showSeconds: !0,
102                showMeridian: !1
103            }), $(".pie-chart").easyPieChart({
104                barColor: $(this).data("bar-color") ? $(this).data("bar-color") : "#777777",
105                trackColor: $(this).data("track-color") ? $(this).data("track-color") : "#eeeeee",
106                lineWidth: $(this).data("line-width") ? $(this).data("line-width") : 3,
107                size: $(this).data("size") ? $(this).data("size") : "80",
108                animate: 800,
109                scaleColor: !1
110            }), $("input, textarea").placeholder()
111        },
112        d = function() {
113            var a = $("#page-wrapper");
114            a.hasClass("page-loading")
115            //remove the preloader automatically?
116            // && a.removeClass("page-loading")
117            setTimeout(function () {
118                $('#page-wrapper').removeClass('page-loading');
119            }, 1010);
120            $(this).blur();
121            setTimeout(function () {
122                $('#preloader-img').removeClass('letsAnimateInRight');
123                $('#preloader-img').addClass('letsAnimateOutRight');
124            }, 10);
125        },
126        c = function() {
127            return window.innerWidth || document.documentElement.clientWidth || document.body.clientWidth
128        },
129        h = function() {
130            var e = 250,
131                i = 250,
132                s = $(".sidebar-nav-menu"),
133                t = $(".sidebar-nav-submenu");
134            s.click(function() {
135                var s = $(this);
136                return a.hasClass("sidebar-mini") && a.hasClass("sidebar-visible-lg-mini") && c() > 991 ? s.hasClass("open") ? s.removeClass("open") : ($(".sidebar-nav-menu.open").removeClass("open"), s.addClass("open")) : s.parent().hasClass("active") || (s.hasClass("open") ? (s.removeClass("open").next().slideUp(e, function() {
137                    u(s, 200, 300)
138                }), setTimeout(b, e)) : ($(".sidebar-nav-menu.open").removeClass("open").next().slideUp(e), s.addClass("open").next().slideDown(i, function() {
139                    u(s, 150, 600)
140                }), setTimeout(b, e > i ? e : i))), s.blur(), !1
141            }), t.click(function() {
142                var a = $(this);
143                return a.parent().hasClass("active") !== !0 && (a.hasClass("open") ? (a.removeClass("open").next().slideUp(e, function() {
144                    u(a, 200, 300)
145                }), setTimeout(b, e)) : (a.closest("ul").find(".sidebar-nav-submenu.open").removeClass("open").next().slideUp(e), a.addClass("open").next().slideDown(i, function() {
146                    u(a, 150, 600)
147                }), setTimeout(b, e > i ? e : i))), a.blur(), !1
148            })
149        },
150        u = function(e, s, t) {
151            if (!a.hasClass("disable-menu-autoscroll")) {
152                var l;
153                if (i.hasClass("navbar-fixed-top") || i.hasClass("navbar-fixed-bottom")) {
154                    var n = e.parents("#sidebar-scroll"),
155                        o = e.offset().top + Math.abs($("div:first", n).offset().top);
156                    l = o - s > 0 ? o - s : 0, n.animate({
157                        scrollTop: l
158                    }, t)
159                } else {
160                    var r = e.offset().top;
161                    l = r - s > 0 ? r - s : 0, $("html, body").animate({
162                        scrollTop: l
163                    }, t)
164                }
165            }
166        },
167        g = function(e, i) {
168            if ("init" === e){
169                g("sidebar-scroll"), g("sidebar-alt-scroll"), $(".sidebar-partial #sidebar").mou
169seenter(function() {
170                    g("close-sidebar-alt")
171                }), $(".sidebar-alt-partial #sidebar-alt").mouseenter(function() {
172                    g("close-sidebar")
173                });
174            } else if (a) { // added by: sudheeran jos - description: js error - date: 18/11/2022 - time: 16:50
175            //} else if (typeof a !== 'undefined' || a !== null) {
176                var networkAsset = $('#network_asset').val();
177                if( networkAsset == 1 ){
178                    return 1;
179                }
180                var s = c();
181                var sidebarMiniLength = $(".sidebar-mini").length;
182                if ("toggle-sidebar" === e) s > 991 ? (a.toggleClass("sidebar-visible-lg"), a.hasClass("sidebar-mini") && a.toggleClass("sidebar-visible-lg-mini"), a.hasClass("sidebar-visible-lg") && g("close-sidebar-alt"), "toggle-other" === i && (a.hasClass("sidebar-visible-lg") || g("open-sidebar-alt"))) : (a.toggleClass("sidebar-visible-xs"), a.hasClass("sidebar-visible-xs") && g("close-sidebar-alt")), g("sidebar-scroll");
183                else if ("toggle-sidebar-alt" === e) s > 991 ? (a.toggleClass("sidebar-alt-visible-lg"), a.hasClass("sidebar-alt-visible-lg") && g("close-sidebar"), "toggle-other" === i && (a.hasClass("sidebar-alt-visible-lg") || g("open-sidebar"))) : (a.toggleClass("sidebar-alt-visible-xs"), a.hasClass("sidebar-alt-visible-xs") && g("close-sidebar"));
184                else if ("open-sidebar" === e) s > 991 ? ( a.hasClass("sidebar-mini") && a.removeClass("sidebar-visible-lg-mini"), a.addClass("sidebar-visible-lg")) : a.addClass("sidebar-visible-xs"), g("close-sidebar-alt");
185                else if ("open-sidebar-alt" === e) a.addClass(s > 991 ? "sidebar-alt-visible-lg" : "sidebar-alt-visible-xs"), g("close-sidebar");
186                else if ("close-sidebar" === e) s > 991 ? (a.removeClass("sidebar-visible-lg"), a.hasClass("sidebar-mini") && a.addClass("sidebar-visible-lg-mini")) : a.removeClass("sidebar-visible-xs");
187                else if ("close-sidebar-alt" === e) a.removeClass(s > 991 ? "sidebar-alt-visible-lg" : "sidebar-alt-visible-xs");
188                else if ("sidebar-scroll" === e) {
189                    if (a.hasClass("sidebar-mini") && a.hasClass("sidebar-visible-lg-mini") && s > 991) l.length && l.parent(".slimScrollDiv").length && (l.slimScroll({
190                        destroy: !0
191                    }), l.attr("style", ""));
192                    else if (a.hasClass("header-fixed-top") || a.hasClass("header-fixed-bottom")) {
193                        var t = $(window).height();
194                        if (l.length && !l.parent(".slimScrollDiv").length) {
195                            l.slimScroll({
196                                height: t,
197                                color: primaryColour,
198                                size: "10px",
199                                touchScrollStep: 100,
200                                alwaysVisible: true /* added by: sudheeran jos - task: https://app.clickup.com/t/2adny5y - date: 13/05/2022 - time: 13:15 */
201                            });
202                            var n;
203                            $(window).on("resize orientationchange", function() {
204                                clearTimeout(n), n = setTimeout(function() {
205                                    g("sidebar-scroll")
206                                }, 150)
207                            })
208                        } else l.add(l.parent()).css("height", t)
209                    }
210                } else if ("sidebar-alt-scroll" === e && (a.hasClass("header-fixed-top") || a.hasClass("header-fixed-bottom"))) {
211                    var r = $(window).height();
212                    if (o.length && !o.parent(".slimScrollDiv").length) {
213                        o.slimScroll({
214                            height: r,
215                            color: primaryColour,
216                            size: "10px",
217                            touchScrollStep: 100,
218                            alwaysVisible: true /* added by: sudheeran jos - task: https://app.clickup.com/t/2adny5y - date: 13/05/2022 - time: 13:15 */
219                        });
220                        var d;
221                        $(window).on("resize orientationchange", function() {
222                            clearTimeout(d), d = setTimeout(function() {
223                                g("sidebar-alt-scroll")
224                            }, 150)
225                        })
226                    } else o.add(o.parent()).css("height", r)
227                }
228            }
229            return !1
230        },
231        b = function() {
232            var l = $(window).height(),
233                o = t.outerHeight(),
234                r = n.outerHeight(),
235                d = i.outerHeight(),
236                c = s.outerHeight();
237            i.hasClass("navbar-fixed-top") || i.hasClass("navbar-fixed-bottom") || l > o && l > r ? a.hasClass("footer-fixed") ? e.css("min-height", l - d + "px") : e.css("min-height", l - (d + c) + "px") : a.hasClass("footer-fixed") ? e.css("min-height", (o > r ? o : r) - d + "px") : e.css("min-height", (o > r ? o : r) - (d + c) + "px")
238        },
239        p = function() {
240            $('[data-toggle="block-toggle-content"]').on("click", function() {
241                var a = $(this).closest(".block").find(".block-content");
242                $(this).hasClass("active") ? a.slideDown() : a.slideUp(), $(this).toggleClass("active")
243            }), $('[data-toggle="block-toggle-fullscreen"]').on("click", function() {
244                var a = $(this).closest(".block");
245                $(this).hasClass("active") ? a.removeClass("block-fullscreen") : a.addClass("block-fullscreen"), $(this).toggleClass("active")
246            }), $('[data-toggle="block-hide"]').on("click", function() {
247                $(this).closest(".block").fadeOut()
248            })
249        },
250        m = function() {
251            var a = $("#to-top");
252            $(window).scroll(function() {
253                $(this).scrollTop() > 150 && c() > 991 ? a.fadeIn(100) : a.fadeOut(100)
254            }), a.click(function() {
255                return $("html, body").animate({
256                    scrollTop: 0
257                }, 400), !1
258            })
259        },
260        f = function() {
261            var a = $(".chat-users"),
262                e = $(".chat-talk"),
263                i = $(".chat-talk-messages"),
264                s = $("#sidebar-chat-message"),
265                t = "";
266            $(".chat-talk-messages").slimScroll({
267                height: 210,
268                color: primaryColour,
269                size: "10px",
270                position: "left",
271                touchScrollStep: 100,
272                alwaysVisible: true /* added by: sudheeran jos - task: https://app.clickup.com/t/2adny5y - date: 13/05/2022 - time: 13:15 */
273            }), $("a", a).click(function() {
274                return a.slideUp(), e.slideDown(), s.focus(), !1
275            }), $("#chat-talk-close-btn").click(function() {
276                return e.slideUp(), a.slideDown(), !1
277            }), $("#sidebar-chat-form").submit(function(a) {
278                t = s.val(), t && (i.append('<li class="chat-talk-msg chat-talk-msg-highlight themed-border animation-sli
278deLeft">' + $("<div />").text(t).html() + "</li>"), i.animate({
279                    scrollTop: i[0].scrollHeight
280                }, 500), s.val("")), a.preventDefault()
281            })
282        },
283        v = function() {
284            var e, s = $(".sidebar-themes"),
285                t = $("#theme-link"),
286                l = t.length ? t.attr("href") : "default",
287                n = a.hasClass("enable-cookies") ? !0 : !1;
288            n && (e = Cookies.get("optionThemeColor") ? Cookies.get("optionThemeColor") : !1, e && ("default" === e ? t.length && (t.remove(), t = $("#theme-link")) : t.length ? t.attr("href", e) : ($('link[href="css/themes-3.1.css"]').before('<link id="theme-link" rel="stylesheet" href="' + e + '">'), t = $("#theme-link"))), l = e ? e : l), $('a[data-theme="' + l + '"]', s).parent("li").addClass("active"), $("a", s).click(function() {
289                l = $(this).data("theme"), $("li", s).removeClass("active"), $(this).parent("li").addClass("active"), "default" === l ? t.length && (t.remove(), t = $("#theme-link")) : t.length ? t.attr("href", l) : ($('link[href="css/themes-3.1.css"]').before('<link id="theme-link" rel="stylesheet" href="' + l + '">'), t = $("#theme-link")), n && Cookies.set("optionThemeColor", l, {
290                    expires: 7
291                })
292            }), $(".dropdown-options a").click(function(a) {
293                a.stopPropagation()
294            });
295            var o = $("#options-main-style"),
296                r = $("#options-main-style-alt");
297            a.hasClass("style-alt") ? r.addClass("active") : o.addClass("active"), o.click(function() {
298                a.removeClass("style-alt"), $(this).addClass("active"), r.removeClass("active")
299            }), r.click(function() {
300                a.addClass("style-alt"), $(this).addClass("active"), o.removeClass("active")
301            });
302            var d = $("#options-header-default"),
303                c = $("#options-header-inverse");
304            i.hasClass("navbar-default") ? d.addClass("active") : c.addClass("active"), d.click(function() {
305                i.removeClass("navbar-inverse").addClass("navbar-default"), $(this).addClass("active"), c.removeClass("active")
306            }), c.click(function() {
307                i.removeClass("navbar-default").addClass("navbar-inverse"), $(this).addClass("active"), d.removeClass("active")
308            })
309        },
310        C = function() {
311            $.extend(!0, $.fn.dataTable.defaults, {
312                sDom: "<'row'<'col-sm-6 col-xs-5'l><'col-sm-6 col-xs-7'f>r>t<'row'<'col-sm-5 hidden-xs'i><'col-sm-7 col-xs-12 clearfix'p>>",
313                sPaginationType: "bootstrap",
314                oLanguage: {
315                    sLengthMenu: "_MENU_",
316                    sSearch: '<div class="input-group">_INPUT_<span class="input-group-addon"><i class="fa fa-search"></i></span></div>',
317                    sInfo: "<strong>_START_</strong>-<strong>_END_</strong> of <strong>_TOTAL_</strong>",
318                    oPaginate: {
319                        sPrevious: "",
320                        sNext: ""
321                    }
322                }
323            }), $.extend($.fn.dataTableExt.oStdClasses, {
324                sWrapper: "dataTables_wrapper form-inline",
325                sFilterInput: "form-control",
326                sLengthSelect: "form-control"
327            })
328        },
329        k = function() {
330            var e = a.prop("class");
331            a.prop("class", ""), window.print(), a.prop("class", e)
332        };
333    return {
334        init: function() {
335            r(), d()
336        },
337        sidebar: function(a, e) {
338            g(a, e)
339        },
340        datatables: function() {
341            C()
342        },
343        pagePrint: function() {
344            k()
345        }
346    }
347}();
348$(function() {
349    App.init()
350});

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.