PageSourceSearch

https://www.acorn.org.au/nova_library/javascript/common/utilities.min.js?v=RLS_3_2_9_0

js acorn.org.au collected 2026-09-29 11:49:30 UTC 9,740 bytes, 22 lines download raw bytes

1function loadHeaders(a){if(a){"string"===typeof a&&(a=[a]);var c=$("head");a.forEach(function(b){var d=$(b);if("SCRIPT"==d[0].tagName)if(""!=d.attr("src"))0==c.find("script[src='"+d.attr("src")+"']").length&&c.append(d);else{var e=!1;$("head > script:not([src])").first(function(){if(this.innerText.trim()==d[0].innerText.trim())return e=!0,!1});e||c.append(d)}else"LINK"==d[0].tagName?""!=d.attr("href")?0==c.find("link[href='"+d.attr("href")+"']").length&&c.append(d):c.append(d):c.append(d)});setTimeout(function(){try{window.fm_utilities&&
2window.fm_utilities.doKickstart()}catch(b){console.log(b)}},100)}}function autoConfirmDelete(){var a=$(this),c=a.data("delmsg")||'You are about to delete "<strong>'+a.closest("tr").find("td").first().text().trim()+'</strong>" from '+$(".ln-module-heading").text().trim()+".<br /><br />Are you sure? Click Confirm to delete";confirmAction({message:c,onConfirm:function(){showLoader(!0);window.location.href=a.data("href")||a.attr("href")},danger:!0});return!1}
3function confirmAction(a){var c=$("#mb-confirmation-modal");c.length||(a.buttonText=a.buttonText||"Continue",$("body").append("<div class='modal fade' id='mb-confirmation-modal' role='dialog' tabindex='-1'><div class='modal-dialog "+(a.size?"modal-"+a.size:"modal-sm")+"' role='document'><div class='modal-content'><div class='modal-header'><h4 class='modal-title'>"+(a.title||"Confirm Action")+"</h4></div><div class='modal-body'>"+(a.isHTML?a.message:a.message.replaceAll("\n","<br />"))+"</div><div class='modal-footer' ><a href='#' data-dismiss='modal' class='btn btn-default'>"+
4(a.cancelButtonText||"Cancel")+'</a><a href=\'#\' data-loading-text=\'<span class="spinner-border" role="status"></span> '+a.buttonText+"' class='btn btn-"+(a.danger?"danger":"primary")+"' data-actiontype='confirm'>"+a.buttonText+"</a></div></div></div></div>"),c=$("#mb-confirmation-modal"),c.on("hidden.bs.modal",function(){c.remove()}).on("click",".btn",function(b){if("confirm"===$(this).data("actiontype")){var d=c.find("form");if(d.length&&!d[0].checkValidity())return b.stopPropagation(),b.preventDefault(),
5!1;c.modal("hide");if(a.onConfirm)a.onConfirm(c);a.originalEvent&&rethrowEvent(a.originalEvent)}else if(a.onCancel)a.onCancel()}));a.danger&&(c.find(".btn-danger").button("loading"),setTimeout(function(){c.find(".btn-danger").button("reset").focus()},a.dangerDelay||1500));c.modal({show:!0,keyboard:!0,backdrop:"static"});return c}
6function rethrowEvent(a){($(a.target).data("custom-onclick")||function(){return!0})()&&$(a.target).trigger(a.originalEvent.type,{override_handler:!0,originalEvent:a.originalEvent})}
7$.fn.animateHighlight=function(a,c){if(0>=this.length)return this;a=a||"#FFFF9C";c=c||1E3;var b=this.data("cssBG")||this[0].style.backgroundColor,d=b||this.css("background-color"),e=this;this.data("cssBG",b);this.stop().css("background-color",a).animate({backgroundColor:d},c,function(){""===b&&e.css("background-color","")});return this};jQuery.expr[":"].containsNoCase=function(a,c,b){return 0<=jQuery(a).text().toUpperCase().indexOf(b[3].toUpperCase())};
8function isDarkColour(a){if(!a)return!1;a=hexToRgb(a+"");if(!a)return!1;a=[a.r/255,a.g/255,a.b/255];for(var c=0;c<a.length;++c)a[c]=.03928>=a[c]?a[c]/12.92:Math.pow((a[c]+.055)/1.055,2.4);return.22>=.2126*a[0]+.7152*a[1]+.0722*a[2]}
9function hexToRgb(a){var c=/^rgb\((\d{1,3}),\s?(\d{1,3}),\s?(\d{1,3})\)$/i.exec(a);if(c&&1<c.length)return{r:parseInt(c[1]),g:parseInt(c[2]),b:parseInt(c[3])};a=a.replace(/^#?([a-f\d])([a-f\d])([a-f\d])$/i,function(b,d,e,g){return d+d+e+e+g+g});return(a=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(a))?{r:parseInt(a[1],16),g:parseInt(a[2],16),b:parseInt(a[3],16)}:null}
10$(document).ready(function(){$(".auto-text-colour").each(function(){var a=$(this);isDarkColour(a.css("background-color"))&&a.css("color","#fff")});$('i[title*="Role Restricted" i]').tooltip();$(".auto_confirm_delete").on("click",autoConfirmDelete).each(function(){$(this).hasClass("acd")||$(this).data("href",this.href).removeAttr("href").addClass("acd")})});
11function showMemberMessage(a){a=a||{};try{var c=crypto.randomUUID()}catch(d){c=Math.random()}"string"===typeof a&&(a={message:a});var b=$("#mb-message-modal-"+c);
11b.length?b.find(".modal-footer .btn").text("Close"):($("body").append("<div class='modal fade mb-message-modal' id='mb-message-modal-"+c+"' role='dialog' tabindex='-1'><div class='modal-dialog "+(a.size?"modal-"+a.size:"modal-sm")+"' role='document'><div class='modal-content'><div class='modal-header'><h4 class='modal-title' style='display:none;'></h4><button type='button' class='close' data-dismiss='modal' aria-hidden='true'>&times;</button></div><div class='modal-body'></div><div class='modal-footer' ><a href='#' data-dismiss='modal' class='btn btn-default btn-close-mdl'>Close</a></div></div></div></div>"),
12b=$("#mb-message-modal-"+c),b.on("hidden.bs.modal",function(){b.remove()}));a.timeout="undefined"===typeof a.timeout?5E3:a.timeout;a.allowCancel="undefined"===typeof a.allowCancel?!0:a.allowCancel;a.title?b.find(".modal-header .modal-title").text(a.title).show():b.find(".modal-header .modal-title").text("").hide();a.allowCancel?(b.find(".modal-footer").show(),b.find(".modal-header .close").show()):(b.find(".modal-footer").hide(),b.find(".modal-header .close").hide());a.hideHeader||!a.allowCancel&&
13!a.title?b.find(".modal-header").hide():b.find(".modal-header").show();a.buttonText&&b.find(".modal-footer .btn").text(a.buttonText);b.find(".modal-body").html(a.message);b.modal({show:!0,keyboard:a.allowCancel,backdrop:"static"});0<a.timeout&&setTimeout(function(){b.modal("hide")},a.timeout);return b}
14function addProgress(a,c,b){a.css("position","relative");a.append('<div class="ln-progbar progress"><div style="transition: width '+c+'ms linear;width: 0;" class="progress-bar" role="progressbar" aria-valuenow="0" aria-valuemin="0" aria-valuemax="100"></div></div>');setTimeout(function(){a.find(".progress-bar").css("width","100%")},100);b&&setTimeout(function(){a.find(".ln-progbar").remove()},c+500)}
15async function downloadContent(a,c){var b=showMemberMessage({message:"<p>preparing content...</p>",timeout:0,allowCancel:!1});showBlockLoader(b.find(".modal-body"));try{const d=await fetch(a,{method:"POST",redirect:"manual"});if("opaqueredirect"===d.type||300<=d.status&&400>d.status){const e=d.headers.get("Location")||d.url;if(e){window.open(e);b.find(".modal-body").html('<em class="text-muted">Your link has been opened in a new window.</em><br /><br /><p class="text-muted text-sm">If you do not see it, please <a href="'+
16e+'" target="_blank">click here</a></p>').end().find(".modal-footer").css("display","block");if(c)b.one("hidden.bs.modal",function(){c()}).on("click","a",function(){b.modal("hide")});return}}if(200===d.status){const e=d.headers.get("Content-Disposition");a="file";if(e){const f=/filename="?(.+)"?/.exec(e);f&&f[1]&&(a=f[1])}const g=await d.blob();if(window.navigator.msSaveOrOpenBlob)window.navigator.msSaveBlob(g,a);else{const f=window.document.createElement("a");f.href=window.URL.createObjectURL(g);
17f.download=a;document.body.appendChild(f);f.click();document.body.removeChild(f);window.URL.revokeObjectURL(g)}b.find(".modal-body").html('<em class="text-muted">Your download has been opened in a new window.</em><br /><br /><p class="text-muted text-sm">If you do not see it, please <a href="'+window.URL.createObjectURL(g)+'" target="_blank">click here</a></p>').end().find(".modal-footer").css("display","block");if(c)b.one("hidden.bs.modal",function(){c()}).on("click","a",function(){b.modal("hide")})}else if(400===
18d.status){b.modal("hide");const e=d.headers.get("statusText")||d.statusText;showMemberMessage({message:e,timeout:0})}else b.modal("hide"),showMemberMessage({message:"An error fetching content! Please try again (status:"+d.status+")",timeout:5E3})}catch(d){console.error("Fetch error:",d),b.modal("hide"),showMemberMessage({message:"An error fetching content! Please try again",timeout:5E3})}}function bufferFromBase64(a){return Uint8Array.from(atob(a),c=>c.charCodeAt(0))}
19function base64FromBuffer(a){return btoa(String.fromCharCode(...(new Uint8Array(a))))}function bufferFromString(a){return(new TextEncoder).encode(a)}
20function getPopupModal(a){a=a||{};try{var c=a.id||crypto.randomUUID()}catch(d){c=Math.random()}a.size=a.size||"md";var b=$("#pp-modal-"+c);
20b.length?b.find(".modal-footer .btn").text("Close"):($("body").append("<div class='modal fade pp-modal' id='pp-modal-"+c+"' role='dialog' tabindex='-1'><div class='modal-dialog modal-"+a.size+"' role='document'>"+(a.isForm?"<form class='modal-content form-horizontal' action='#' method='post'>":"<div class='modal-content'>")+"<div class='modal-header'><h4 class='modal-title' style='display:none;'></h4><button type='button' class='close' data-dismiss='modal' aria-hidden='true'>&times;</button></div><div class='modal-body'></div><div class='modal-footer' ><a href='#' data-dismiss='modal' class='btn btn-default btn-close-mdl'>Close</a></div>"+
21(a.isForm?"</form>":"</div>")+"</div></div>"),b=$("#pp-modal-"+c),b.on("hidden.bs.modal",function(){b.remove()}));a.allowCancel="undefined"===typeof a.allowCancel?!0:a.allowCancel;a.title?b.find(".modal-header .modal-title").text(a.title).show():b.find(".modal-header .modal-title").text("").hide();a.allowCancel?(b.find(".modal-footer").show(),b.find(".modal-header .close").show()):(b.find(".modal-footer").hide(),b.find(".modal-header .close").hide());a.hideHeader||!a.allowCancel&&!a.title?b.find(".modal-header").hide():
22b.find(".modal-header").show();a.buttonText&&b.find(".modal-footer .btn").text(a.buttonText);b.find(".modal-body").html(a.content);b.modal({show:!0,keyboard:a.allowCancel,backdrop:a.allowCancel?!0:"static"});return b};

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.