/*! * jQuery JavaScript Library v1.12.4 * http://jquery.com/ * * Includes Sizzle.js * http://sizzlejs.com/ * * Copyright jQuery Foundation and other contributors * Released under the MIT license * http://jquery.org/license * * Date: 2016-05-20T17:17Z */ function copyCitation(t){var e,i;window.getSelection&&document.createRange?(i=window.getSelection(),(e=document.createRange()).selectNodeContents(t),i.removeAllRanges(),i.addRange(e),document.execCommand("copy"),i.removeAllRanges()):document.selection&&document.body.createTextRange&&((e=document.body.createTextRange()).moveToElementText(t),e.select(),document.execCommand("copy"),document.selection.empty())}function updateEmbedCode(t,e,i,n){0==e.length&&(e=1),0==i.length&&(i=1);var r=`
`;document.getElementById("embedCode").value=r} //! openseadragon 2.4.2 //! Built on 2020-03-05 //! Git commit: v2.4.2-0-c450749 //! http://openseadragon.github.io //! License: http://openseadragon.github.io/license/ /* * OpenSeadragon * * Copyright (C) 2009 CodePlex Foundation * Copyright (C) 2010-2013 OpenSeadragon contributors * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: * * - Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * * - Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * - Neither the name of CodePlex Foundation nor the names of its * contributors may be used to endorse or promote products derived from * this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* * Portions of this source file taken from jQuery: * * Copyright 2011 John Resig * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files (the * "Software"), to deal in the Software without restriction, including * without limitation the rights to use, copy, modify, merge, publish, * distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to * the following conditions: * * The above copyright notice and this permission notice shall be * included in all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /* * Portions of this source file taken from mattsnider.com: * * Copyright (c) 2006-2013 Matt Snider * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included * in all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT * OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR * THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ function OpenSeadragon(t){return new OpenSeadragon.Viewer(t)}function toggleTrophy(t,e){$.ajax({url:t,type:"post",success:function(t){gid=t.work_id,e.hasClass("trophy-on")?trophyOff(e):trophyOn(e),e.toggleClass("trophy-on"),e.toggleClass("trophy-off")}})}function trophyOff(t){t.data("removerow")?$("#trophyrow_"+gid).fadeOut(1e3,function(){$("#trophyrow_"+gid).remove()}):setAnchorAttrs(t,"Highlight work","add-text")}function trophyOn(t){setAnchorAttrs(t,"Unhighlight work","remove-text")}function setAnchorAttrs(t,e,i){t.attr("title",e),$nodes=t.contents(),$nodes[$nodes.length-1].nodeValue=t.data(i)}function setWeight(t,e){weightField(t).val(e)}function weightField(t){return findProperty(t,"order")}function findProperty(t,e){return t.find("input[data-property="+e+"]")}function findNode(t,e){return e.find("[data-id="+t+"]")}function dragAndDrop(t){t.nestable({maxDepth:1}),t.on("change",function(t){container=$(t.currentTarget);var e=$(this).nestable("serialize"),i=0;for(var n in e){var r=e[n].id;parent_node=findNode(r,container),setWeight(parent_node,i++)}})}function toggleButtons(t,e){t=void 0!==t&&t,e=void 0!==e?e:!window.batch_part_on_other_page,$(".batch_document_selector:checked").length>0||t?($(".batch-toggle").show(),$(".batch-select-all").removeClass("hidden"),$("#batch-edit").removeClass("hidden")):e&&($(".batch-toggle").hide(),$(".batch-select-all").addClass("hidden"),$("#batch-edit").addClass("hidden")),$("body").css("cursor","auto")}function toggleState(t,e){toggleStateBool(t,"on"==e)}function toggleStateBool(t,e){e?(t.attr("data-state","on"),t.find("a i").addClass("glyphicon glyphicon-ok")):(t.attr("data-state","off"),t.find("a i").removeClass("glyphicon glyphicon-ok"))}function check_all_page(){var t=$("#check_all")[0].checked;$("input[type='checkbox'].batch_document_selector").each(function(e,i){i.checked=t}),toggleButtons(),toggleStateBool($("[data-behavior='batch-edit-select-page']"),t),toggleStateBool($("[data-behavior='batch-edit-select-none']"),!t)}function select_page(t){$("#check_all").prop("checked",t),check_all_page()}function nav_safety_on(){$("#nav-safety-modal")[0].setAttribute("dirtyData",!0)}function nav_safety_off(){$("#nav-safety-modal")[0].setAttribute("dirtyData",!1)}function tinymce_nav_safety(t){t.on("Change",function(t){$(t.target.targetElm).parents("form.nav-safety").change()})}function tabNavigation(){var t=$('[href="'+location.hash+'"]');if(t.length)t.tab("show");else{var e=$(".nav-tabs a:first");e[0]!==undefined&&""!=e[0].id&&$(e).tab("show")}}function batch_edit_init(){function t(t){for(var e=t.split("&"),i=e.length,n={};i--;){var r=decodeURIComponent(e[i]).split("="),o=r[0],s=r[1];null!=n[o]?($.isArray(n[o])||(n[o]=[n[o]]),n[o].push(s)):n[o]=s}return n}function e(t){t.enableForm()}function i(t){t.disableForm()}function n(t){t.preventDefault();var n=$(this).closest("form"),r=new a(n),o=n[0].id;i(r),s.addReq({form:o,key:n.data("model"),queue:"add_doc",url:n.attr("action"),dataType:"json",type:n.attr("method").toUpperCase(),data:n.serialize(),success:function(){e(r)},fail:function(t){alert("Error! Status: "+t.status)}}),setTimeout(s.runNow(),100)}var r,o,s=(r=[],o=!1,{addReq:function(t){r.push(t)},removeReq:function(t){$.inArray(t,r)>-1&&r.splice($.inArray(t,r),1)},runNow:function(){clearTimeout(this.tid),o||this.run()},run:function(){o=!0;var t=this;r.length?(r.length>1&&(r=this.combine_requests(r)),r=this.setup_request_complete(r),$.ajax(r[0])):(t.tid=setTimeout(function(){t.run.apply(t,[])},500),o=!1)},stop:function(){r=[],clearTimeout(this.tid)},setup_request_complete:function(t){return oriComp=t[0].complete,t[0].complete=[function(){if(req=t.shift(),"object"==typeof req.form)for(f in req.form)form_id=form[f],e(new a($("#"+form_id)));return this.tid=setTimeout(function(){s.run.apply(s,[])},50),!0}],"function"==typeof oriComp&&t[0].complete.push(oriComp),t},combine_requests:function(e){var i,n=t(e[0].data.replace(/\+/g," "));form=[e[0].form];for(var r=e.length-1;r>0;r--)for(key in req=e.pop(),i=t(req.data.replace(/\+/g," ")),Object.keys(i))curKey=Object.keys(i)[key],curKey.slice(0,12)==req.key&&(n[curKey]=i[curKey],form.push(req.form));return e[0].data=$.param(n),e[0].form=form,e}});s.run();var a=function(t){this.form=t,this.formButtons=t.find(".btn"),this.formFields=t.find(".form-group > *"),this.formRightPanel=t.find(".form-group"),this.statusField=t.find(".status")};a.prototype={disableForm:function(){this.formButtons.attr("disabled","disabled"),this.formRightPanel.addClass("loading"),this.formFields.addClass("invisible")},enableForm:function(){this.statusField.html("Changes Saved"),this.formButtons.removeAttr("disabled"),this.formRightPanel.removeClass("loading"),this.formFields.removeClass("invisible")}},$("#permissions_visibility_save").click(n),$("#permissions_roles_save").click(n),$(".field-save").click(n)}function hideUnhide(t){(hide($("body").find(".export-source-option")),t.length>0)&&unhideSelected($("."+t));"collection"===t&&initCollectionSearchInputs()}function hide(t){t.addClass("hidden"),t.find("#exporter_export_source").addClass("hidden").attr("type","hidden")}function unhideSelected(t){t.removeClass("hidden").removeAttr("type"),t.parent().removeClass("hidden").removeAttr("type")}function initCollectionSearchInputs(){$("[data-autocomplete]").each(function(){var t=$(this);initSelect2(t,t.data("autocompleteUrl"))})}function initSelect2(t,e){t.select2({minimumInputLength:2,initSelection:(t,e)=>{e({id:t.val(),text:t.val()})},ajax:{url:e,dataType:"json",data:t=>({q:t}),results:function(t){return{results:t.map(t=>({id:t.id,text:t.label[0]}))}}}}).select2("data",null)}function prepBulkrax(){var t=$(".refresh-set-source"),e=$("#importer_parser_fields_base_url"),i=e.val();if(handleFileToggle($("#importer_parser_fields_import_file_path").val()),$("body").on("click",".refresh-set-source",function(i){i.preventDefault(),external_set_select=$("#importer_parser_fields_set"),handleSourceLoad(t,e,external_set_select)}),$("body").on("blur","#importer_parser_fields_base_url",function(n){n.preventDefault(),e=$("#importer_parser_fields_base_url"),i!=e.val()&&(external_set_select=$("#importer_parser_fields_set"),handleSourceLoad(t,e,external_set_select),i=e.val())}),$("body").on("change","#importer_parser_klass",function(){handleParserKlass()}),handleParserKlass(),null==(n=document.getElementById("new_importer")))var n=document.getElementsByClassName("edit_importer")[0];if(null!=n){var r={childList:!0,attributes:!0};new MutationObserver(function(t){for(var e of t)if("childList"==e.type){browseButton=document.getElementById("browse");var i=/selected_files\[[0-9]*\]\[url\]/;for(var n of e.addedNodes)if(n.attributes!=undefined){var r=n.attributes.name.value;i.test(r)&&(browseButton.innerHTML="Cloud Files Added",browseButton.style.backgroundColor="green",browseButton.after(document.createElement("br"),n.value.toString()))}}}).observe(n,r)}}function handleFileToggle(t){t===undefined||0===t.length?($("#file_path").hide(),$("#file_upload").hide(),$("#cloud").hide(),$("#file_path input").attr("required",null),$("#file_upload input").attr("required",null)):($("#file_path").show(),$("#file_upload").hide(),$("#cloud").hide(),$("#file_path input").attr("required","required"),$("#file_upload input").attr("required",null),$("#importer_parser_fields_file_style_specify_a_path_on_the_server").attr("checked",!0)),$("#importer_parser_fields_file_style_upload_a_file").click(function(){$("#file_path").hide(),$("#file_upload").show(),$("#cloud").hide(),$("#file_path input").attr("required",null),$("#file_upload input").attr("required","required")}),$("#importer_parser_fields_file_style_specify_a_path_on_the_server").click(function(){$("#file_path").show(),$("#file_upload").hide(),$("#cloud").hide(),$("#file_path input").attr("required","required"),$("#file_upload input").attr("required",null)}),$("#importer_parser_fields_file_style_add_cloud_file").click(function(){$("#file_path").hide(),$("#file_upload").hide(),$("#cloud").show(),$("#file_path input").attr("required",null),$("#file_upload input").attr("required",null)})}function handleParserKlass(){$(".csv_fields").length>0&&(window.csv_fields=$(".csv_fields").detach());var t=$("#importer_parser_klass option:selected");t.length>0&&t.data("partial")&&t.data("partial").length>0&&$(".parser_fields").append(window[t.data("partial")]),handleFileToggle($("#importer_parser_fields_import_file_path").val())}function handleSourceLoad(t,e,i){if(""!=e.val()){var n=t.html();t.html("Refreshing..."),t.attr("disabled",!0),$.post("/importers/external_sets",{base_url:e.val()},function(e){e.error?setError(i,e.error):genExternalSetOptions(i,e.sets),t.html(n),t.attr("disabled",!1)})}}function genExternalSetOptions(t,e){out='',out+=e.map(function(t){return'"}),t.html(out),t.attr("disabled",!1)}function setError(t){t.html(''),t.attr("disabled",!0)} /** * @license almond 0.3.3 Copyright jQuery Foundation and other contributors. * Released under MIT license, http://github.com/requirejs/almond/LICENSE */ var requirejs,require,define;!function(t,e){"object"==typeof module&&"object"==typeof module.exports?module.exports=t.document?e(t,!0):function(t){if(!t.document)throw new Error("jQuery requires a window with a document");return e(t)}:e(t)}("undefined"!=typeof window?window:this,function(t,e){function i(t){var e=!!t&&"length"in t&&t.length,i=pt.type(t);return"function"!==i&&!pt.isWindow(t)&&("array"===i||0===e||"number"==typeof e&&e>0&&e-1 in t)}function n(t,e,i){if(pt.isFunction(e))return pt.grep(t,function(t,n){return!!e.call(t,n,t)!==i});if(e.nodeType)return pt.grep(t,function(t){return t===e!==i});if("string"==typeof e){if(St.test(e))return pt.filter(e,t,i);e=pt.filter(e,t)}return pt.grep(t,function(t){return pt.inArray(t,e)>-1!==i})}function r(t,e){do{t=t[e]}while(t&&1!==t.nodeType);return t}function o(t){var e={};return pt.each(t.match(It)||[],function(t,i){e[i]=!0}),e}function s(){nt.addEventListener?(nt.removeEventListener("DOMContentLoaded",a),t.removeEventListener("load",a)):(nt.detachEvent("onreadystatechange",a),t.detachEvent("onload",a))}function a(){(nt.addEventListener||"load"===t.event.type||"complete"===nt.readyState)&&(s(),pt.ready())}function l(t,e,i){if(i===undefined&&1===t.nodeType){var n="data-"+e.replace(Ot,"-$1").toLowerCase();if("string"==typeof(i=t.getAttribute(n))){try{i="true"===i||"false"!==i&&("null"===i?null:+i+""===i?+i:Mt.test(i)?pt.parseJSON(i):i)}catch(r){}pt.data(t,e,i)}else i=undefined}return i}function c(t){var e;for(e in t)if(("data"!==e||!pt.isEmptyObject(t[e]))&&"toJSON"!==e)return!1;return!0}function u(t,e,i,n){if(Rt(t)){var r,o,s=pt.expando,a=t.nodeType,l=a?pt.cache:t,c=a?t[s]:t[s]&&s;if(c&&l[c]&&(n||l[c].data)||i!==undefined||"string"!=typeof e)return c||(c=a?t[s]=it.pop()||pt.guid++:s),l[c]||(l[c]=a?{}:{toJSON:pt.noop}),"object"!=typeof e&&"function"!=typeof e||(n?l[c]=pt.extend(l[c],e):l[c].data=pt.extend(l[c].data,e)),o=l[c],n||(o.data||(o.data={}),o=o.data),i!==undefined&&(o[pt.camelCase(e)]=i),"string"==typeof e?null==(r=o[e])&&(r=o[pt.camelCase(e)]):r=o,r}}function h(t,e,i){if(Rt(t)){var n,r,o=t.nodeType,s=o?pt.cache:t,a=o?t[pt.expando]:pt.expando;if(s[a]){if(e&&(n=i?s[a]:s[a].data)){r=(e=pt.isArray(e)?e.concat(pt.map(e,pt.camelCase)):e in n?[e]:(e=pt.camelCase(e))in n?[e]:e.split(" ")).length;for(;r--;)delete n[e[r]];if(i?!c(n):!pt.isEmptyObject(n))return}(i||(delete s[a].data,c(s[a])))&&(o?pt.cleanData([t],!0):ht.deleteExpando||s!=s.window?delete s[a]:s[a]=undefined)}}}function d(t,e,i,n){var r,o=1,s=20,a=n?function(){return n.cur()}:function(){return pt.css(t,e,"")},l=a(),c=i&&i[3]||(pt.cssNumber[e]?"":"px"),u=(pt.cssNumber[e]||"px"!==c&&+l)&&Ht.exec(pt.css(t,e));if(u&&u[3]!==c){c=c||u[3],i=i||[],u=+l||1;do{u/=o=o||".5",pt.style(t,e,u+c)}while(o!==(o=a()/l)&&1!==o&&--s)}return i&&(u=+u||+l||0,r=i[1]?u+(i[1]+1)*i[2]:+i[2],n&&(n.unit=c,n.start=u,n.end=r)),r}function p(t){var e=Gt.split("|"),i=t.createDocumentFragment();if(i.createElement)for(;e.length;)i.createElement(e.pop());return i}function f(t,e){var i,n,r=0,o="undefined"!=typeof t.getElementsByTagName?t.getElementsByTagName(e||"*"):"undefined"!=typeof t.querySelectorAll?t.querySelectorAll(e||"*"):undefined;if(!o)for(o=[],i=t.childNodes||t;null!=(n=i[r]);r++)!e||pt.nodeName(n,e)?o.push(n):pt.merge(o,f(n,e));return e===undefined||e&&pt.nodeName(t,e)?pt.merge([t],o):o}function m(t,e){for(var i,n=0;null!=(i=t[n]);n++)pt._data(i,"globalEval",!e||pt._data(e[n],"globalEval"))}function g(t){qt.test(t.type)&&(t.defaultChecked=t.checked)}function v(t,e,i,n,r){for(var o,s,a,l,c,u,h,d=t.length,v=p(e),y=[],b=0;b