1/// <reference path="jquery-1.4.4.min.js" /> 2/// <reference path="fancybox/jquery.fancybox-1.3.4.js" /> 3/// <reference path="galleria/galleria-1.2.js" /> 4 5if (!acos) var acos = {}; 6if (!acos.jq) acos.jq = {}; 7acos.jq.treeview = function (selector, cssclass, isCollapsed) { 8 var c = (isCollapsed.toLowerCase() === 'true'); 9 $(selector).treeview({ 10 collapsed: c, 11 animated: "fast", 12 persist: "location", 13 cssClass: cssclass 14 }); 15}; 16acos.jq.fb = function (selector, rel, options) { 17 var o = $.extend({ "rel": "fancybox" }, rel); 18 var r = acos.jq.fb.resize(); 19 20 var titleFormat = acos.jq.fb.tfHTML; 21 22 23 var $el = $(selector).attr('rel', o.rel); 24 25 if (!$el.fancybox) { 26 return null; 27 } 28 29 if ($el.attr('data-description')) { 30 titleFormat = function (ti, d, i, a) { return '<div id="fancybox-title-over">' + $el.attr('data-description') + '</div>'; } 31 } 32 33 var fbOptions = $.extend({ titlePosition: 'over', centerOnScroll: true, cyclic: true, titleFormat: titleFormat, onStart: r.onStart, onComplete: r.onComplete, onClosed: r.onClosed }, options); 34 35 return $el.fancybox(fbOptions); 36}; 37acos.jq.fb.tf = function (ti, d, i, a) { 38 if (ti.length > 0) { 39 var idx = ti.lastIndexOf("-"); 40 if (idx > 0) 41 ti = ti.substring(0, idx); 42 } 43 if (d.length > 0) { 44 var idx = d.lastIndexOf("-"); 45 if (idx > 0) 46 d = d.substring(0, idx); 47 } 48 var t = (ti.length > 0) ? '<b>' + ti + '</b>' : ''; 49 if (d.length > 0 && d != ti) t += (t.length > 0 ? '<br />' : '') + d.replace(" | ", "<br />"); 50 return '<div id="fancybox-title-over">' + t + '</div>'; 51}; 52acos.jq.fb.tfGALLERIA = function (ti, a, i) { var o = a[i]; return acos.jq.fb.tf(ti, o.desc, i, a); }; 53acos.jq.fb.tfHTML = function (ti, a, i) { var tf = (typeof custom_fancy_tfHTML === 'undefined') ? acos.jq.fb.tf : custom_fancy_tfHTML; var d = $("img", a[i]).attr("alt"); return tf(ti, d, i, a); }; 54acos.jq.fb.resize = function () { var ret = { index: 0, handle: null, onStart: function () { $(window).bind("resize", ret.resize); }, onClosed: function () { $(window).unbind("resize", ret.resize); }, onComplete: function (a, i) { ret.index = i }, resize: function () { if (ret.handle) { clearTimeout(ret.handle); } ret.handle = setTimeout(function () { $.fancybox.pos(ret.index); }, 150); } }; return ret; }; 55 56acos.jq.cycle = function (s, d) { 57 var c = $(s); 58 for (var i = 0; i < d.data.length; i++) { 59 c.append('<img src="' + d.root + '/' + d.data[i].src + '" alt="' + d.data[i].alt + '" />'); 60 } 61 c.cycle({ fx: 'fade', speed: 3500, timeout: 8300 }); 62}; 63 64if (!acos.calendar) acos.calendar = {}; 65acos.calendar.searchdatetime = function () { 66 $(function () { 67 var classes = $(".jq-start, .jq-end").attr('class'); 68 var index = classes.indexOf("jq-datepicker-sprak-"); 69 var regcode = classes.substring(index + 20, index + 20 + 2); 70 /* Sjekk om vi fant en regcode */ 71 if (regcode == "") 72 regcode = "no"; 73 /* reset til default hvis vi har engelsk */ 74 if (regcode == "en") 75 regcode = ""; 76 77 $.datepicker.setDefaults($.datepicker.regional[regcode]); 78 79 $(".jq-interval").each( 80 function (index, element) { 81 var dates = $(".jq-start, .jq-end", $(this)).datepicker({ 82 defaultDate: 0, 83 changeMonth: true, 84 changeYear: true, 85 showButtonPanel: true, 86 dateFormat: 'dd.mm.yy', 87 showOn: "button", 88 buttonImage: '/images/Kalender/Icons/icoCalendar.png', 89 buttonImageOnly: true, 90 onSelect: function (selectedDate) { 91 var option = $(this).hasClass("jq-start") ? "minDate" : "maxDate", instance = $(this).data("datepicker"); 92 date = $.datepicker.parseDate(instance.settings.dateFormat || 93 $.datepicker._defaults.dateFormat, selectedDate, instance.settings); 94 dates.not(this).datepicker("option", option, date); 95 } 96 }); 97 }); 98 });
99}; 100 101var selectHandler = function () { 102 var d = new Date(); 103 switch ($(".jq-sel").val()) { 104 case "0": //Alle 105 $(".jq-start").val(""); 106 $(".jq-end").val(""); 107 break; 108 case "1": //I dag 109 $(".jq-start").datepicker('setDate', d); 110 $(".jq-end").datepicker('setDate', d); 111 break; 112 case "2": //Neste 7 dager 113 $(".jq-start").datepicker('setDate', d); 114 d.setDate(d.getDate() + 7); 115 $(".jq-end").datepicker('setDate', d); 116 break; 117 case "3": //Neste 14 dager 118 $(".jq-start").datepicker('setDate', d); 119 d.setDate(d.getDate() + 14); 120 $(".jq-end").datepicker('setDate', d); 121 break; 122 case "4": //Denne måneden 123 $(".jq-start").datepicker('setDate', d); 124 d.setMonth(d.getMonth() + 1); // + 1 month extra 125 d.setDate(0); // day 0 = last day of prev month 126 $(".jq-end").datepicker('setDate', d); 127 break; 128 case "5": //Neste måned 129 d.setDate(1); 130 d.setMonth(d.getMonth() + 1); 131 $(".jq-start").datepicker('setDate', d); 132 d.setMonth(d.getMonth() + 1); // + 1 month extra 133 d.setDate(0); // day 0 = last day of prev month 134 $(".jq-end").datepicker('setDate', d); 135 break; 136 case "6": //Neste 3 måneder 137 $(".jq-start").datepicker('setDate', d); 138 d.setMonth(d.getMonth() + 3); 139 $(".jq-end").datepicker('setDate', d); 140 break; 141 case "7": //Neste 6 måneder 142 $(".jq-start").datepicker('setDate', d); 143 d.setMonth(d.getMonth() + 6); 144 $(".jq-end").datepicker('setDate', d); 145 break; 146 case "8": //Neste 12 måneder 147 $(".jq-start").datepicker('setDate', d); 148 d.setMonth(d.getMonth() + 12); 149 $(".jq-end").datepicker('setDate', d); 150 break; 151 }; 152};
153 154clearSearch = function () { 155 $(".jq-start").val(""); 156 $(".jq-end").val(""); 157 $(".jq-search").val(""); 158 $(".jq-sel").val("0"); 159}; 160 161/* Lager en notification bar i høyre hjørne */ 162var glonPress = ''; 163function Notify(text, onPress, css) { 164 if ($("#notificationAlert").length == 0) { 165 glonPress = onPress; 166 var html = "<div id='notificationAlert' class='notification " + css + "'>"; 167 html += "<div id='notificationCancel'><img src='images/FrontendAdmin/icon-16-cancel.png' onclick='notificationDestroy()' alt='cancel' /></div>"; 168 html += "<div onclick='notificationClick();return false;' id='notificationText'>" + text + "</div>"; 169 html += "</div>"; 170 if (jQuery.ui) { 171 $(html).appendTo("Body").show('drop', { direction: "down" }, 1000, function () { 172 blink("#notificationText"); 173 }); 174 } else { 175 $("Body").append(html); 176 } 177 $(onPress).bind("click", function () { 178 notificationDestroy(); 179 }); 180 } 181} 182 183function notificationClick() { 184 if ($(glonPress).length != 0) { 185 $(glonPress).click(); 186 } 187 notificationDestroy(); 188} 189 190function notificationDestroy() { 191 $("#notificationAlert").remove(); 192} 193 194function blink(selector) { 195 $(selector).fadeOut('slow', function () { 196 $(this).fadeIn('slow', function () { 197 blink(this); 198 }); 199 }); 200} 201 202$(".jq-target-blank").click(function () { 203 window.open(this.href, "asdfasdf"); 204});
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.