From 5eec46614efdc95b77c572a66c9eb19b68f66193 Mon Sep 17 00:00:00 2001
From: Mark MacGillivray
Date: Thu, 12 May 2022 11:35:22 +0100
Subject: [PATCH] catch use of old _oab_config class names on old website pages
---
embed.js | 4 +++-
embed.min.js | 2 +-
2 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/embed.js b/embed.js
index 4a99d4d..3188090 100644
--- a/embed.js
+++ b/embed.js
@@ -1807,7 +1807,9 @@ _oaw.prototype.configure = function(key, val, build, preview) {
return this.deposit(e);
});
}
- if (el = _OA.gebi('_oaw_config')) {
+ el = _OA.gebi('_oaw_config');
+ if (!el) el = _OA.gebi('_oab_config');
+ if (el) {
ncwc = JSON.parse(JSON.stringify(wc));
nk = {
ill_institution: 'institution', // translate instantill old config keys
diff --git a/embed.min.js b/embed.min.js
index 742c2e7..920c660 100644
--- a/embed.min.js
+++ b/embed.min.js
@@ -1 +1 @@
-var _OA,_oaw,indexOf=[].indexOf;(_OA={gebi:function(t){return document.getElementById(t.replace("#",""))},gebc:function(t){return document.getElementsByClassName(t.replace(".",""))},gebn:function(t){var i;return null!=(i=document.getElementsByTagName(t.replace("<","").replace(">","")))?i:document.getElementsByName(t)}}).each=function(t,i,e){var a,o,s,n;if("string"==typeof t?t=t.startsWith("#")?[_OA.gebi(t)]:t.startsWith(".")?_OA.gebc(t):_OA.gebn(t):"object"==typeof t&&(Array.isArray(t)||(t=[t])),null!=t){for(n=[],o=0,s=t.length;o=0||!!t.getAttribute(i)},_OA.css=function(t,i,e){return _OA.each(t,(function(t){var a,o,s,n,r,l,h,d;for(d={},a=0,s=(r=("string"==typeof(l=_OA.get(t,"style"))?l:"").split(";")).length;athis.configure()),1),!this.config.autorun_off){for("string"==typeof(i="string"==typeof this.config.autorunparams&&this.config.autorunparams.length?this.config.autorunparams.split(","):"object"==typeof this.config.autorunparams?this.config.autorunparams:["doi","title","url","atitle","rft_id","journal","issn","year","author"])&&(i=i.replace(/"/g,"").replace(/'/g,"").split(",")),l=0,d=i.length;l
Please provide your university email address.
"),_OA.css("#_oaw_email","border-color","#f04717"),_OA.gebi("#_oaw_email").focus()))},_oaw.prototype.submit=function(t){var i,e,a,o,s,n,r;try{try{t.preventDefault()}catch(t){}if(this.openurl()||this.data.email||!_OA.gebi("#_oaw_email")){if("{}"!==JSON.stringify(this.f)&&null!=this.f.metadata&&this.f.metadata.title&&this.f.metadata.journal&&this.f.metadata.year){for(this.loading(),(i={match:this.f.input,email:this.data.email,from:this.uid,plugin:this.plugin,embedded:window.location.href}).config=this.config,i.metadata=this.f.metadata?this.f.metadata:{},e=0,o=(r=["title","journal","year","doi"]).length;eYour confirmation code is: "+t+", this will not be emailed to you. The "+(this.config.say_paper?"paper":"article")+" will be sent to "+this.data.email+" as soon as possible.
"):(_OA.html("#_oaw_done_header",""+this.contact()+"
"),_OA.html("#_oaw_done_restart","Try another"),this.ping(null!=i?i:"instantill_couldnt_submit_ill"),setTimeout((()=>this.restart()),6e3)),_OA.show("#_oaw_done")),"function"==typeof this.after)return this.after()},_oaw.prototype.deposit=function(t){var i,e,a,o,s;try{try{t.preventDefault()}catch(t){}if(!this.data.email&&_OA.gebi("#_oaw_email"))return this.validate();if(!0!==this.demo||null==this.data.doi||!this.data.doi.startsWith("10.1234/oab-syp-")){if(null!=(a=_OA.gebi("#_oaw_file"))&&null!=a.files&&a.files.length)this.file=new FormData,this.file.append("file",a.files[0]);else if(!0!==this.file)return _OA.show("#_oaw_error","Whoops, you need to give us a file! Check it's uploaded.
"),void _OA.css("#_oaw_file","border-color","#f04717");if(this.loading(),e={from:this.uid,plugin:this.plugin,embedded:window.location.href,metadata:void 0!==this.f?this.f.metadata:void 0},!0===this.demo&&(e.demo=!0),e.config=this.config,this.data.email&&(e.email=this.data.email),this.data.confirmed&&(e.confirmed=this.data.confirmed),void 0!==this.f&&"string"==typeof this.f.url&&(e.redeposit=this.f.url),this.config.pilot&&(e.pilot=this.config.pilot),this.config.live&&(e.live=this.config.live),"boolean"!=typeof this.file){for(i in e)if("metadata"===i)for(s in e[i])"string"!=typeof e[i][s]&&"number"!=typeof e[i][s]||this.file.append(s,e[i][s]);else"object"==typeof e[i]?this.file.append(i,JSON.stringify(e[i])):this.file.append(i,e[i]);e=this.file}return _OA.jx(this.api.replace("://","://bg.")+"/deposit",e,(t=>(this.loading(!1),"boolean"!=typeof this.file?void 0!==t.zenodo&&t.zenodo.already||this.data.confirmed&&(void 0===t.zenodo||!t.zenodo.url)?this.done("check"):t.error?this.done("partial"):void 0!==t.zenodo&&t.zenodo.url?(_OA.set("#_oaw_zenodo_url",t.zenodo.url),t.embargo?(o="You've done your part for now. Unfortunately, "+(void 0!==this.f&&void 0!==this.f.metadata&&this.f.metadata.shortname?this.f.metadata.shortname:void 0!==this.f&&void 0!==this.f.metadata&&this.f.metadata.journal?this.f.metadata.journal:"the journal")+" won't let us make it public until ",o+=new Date(t.embargo).toLocaleString("en-GB",{year:"numeric",month:"long",day:"numeric"}).replace(/(11|12|13) /,"$1th ").replace("1 ","1st ").replace("2 ","2nd ").replace("3 ","3rd ").replace(/([0-9]) /,"$1th "),o+=". After release, you'll find your paper on "+(this.config.repo_name?this.config.repo_name:"ScholarWorks")+", Google Scholar, Web of Science.
",o+="You'll soon find your paper freely available in "+(this.config.repo_name?this.config.repo_name:"ScholarWorks")+", Google Scholar, Web of Science, and other popular tools.",o+="
Sorry, we were not able to deposit this paper for you. "+this.contact()+'
'),this.ping("shareyourpaper_couldnt_submit_deposit"))))}if("10.1234/oab-syp-confirm"!==this.data.doi?(o="You'll soon find your paper freely available in "+(this.config.repo_name?this.config.repo_name:"ScholarWorks")+", Google Scholar, Web of Science, and other popular tools.",o+="
Double check your DOI, that doesn't look right to us.
"),_OA.gebi("_oaw_input").focus();if(void 0!==this.f.metadata.crossref_type&&"journal-article"!==this.f.metadata.crossref_type&&"proceedings-article"!==this.f.metadata.crossref_type||void 0!==this.f.metadata.type&&"journal-article"!==this.f.metadata.type&&"proceedings-article"!==this.f.metadata.type)return _OA.gebi("_oaw_input").focus(),i="Sorry, right now this only works with academic journal articles.",(this.cml()||this.config.old_way&&this.config.old_way.includes("@"))&&(i+=' To get help with depositing, click here"),this.restart(void 0,void 0,i+".
");if(this.f.metadata.title){_OA.hide("._oaw_panel"),_OA.hide("._oaw_section"),_OA.show("#_oaw_permissions"),this.loading(!1),l='terms [1]',this.config.terms&&(l+=' [2]'),o="your.name@institution.edu",null!=this.config.email_domains&&this.config.email_domains.length&&("string"==typeof this.config.email_domains&&(this.config.email_domains=this.config.email_domains.split(",")),(o=this.config.email_domains[0]).includes("@")&&(o=o.split("@")[1]),o.includes("//")&&(o=o.split("//")[1]),o=o.toLowerCase().replace("www.","")),(null==o||o.length<3)&&(o="your.name@institution.edu"),o.includes("@")||(o="your.name@"+o),this.data.email?_OA.hide("._oaw_get_email"):(_OA.show("._oaw_get_email"),_OA.set("#_oaw_email","placeholder",o),_OA.html("._oaw_terms",l)),n="";try{for(e in this.f.permissions.best_permission.provenance.archiving_policy)n+=' ['+(parseInt(e)+1)+"]"}catch(t){}return _OA.html("._oaw_refs",n),a=this.f.metadata.doi?'your paper':"your paper",_OA.html("._oaw_your_paper",("publishedVersion"===this.f.permissions.best_permission.version?"the publisher pdf of ":"")+a),_OA.html("._oaw_journal",this.f.metadata.shortname?this.f.metadata.shortname:"the journal"),this.f.url?(_OA.set("._oaw_oa_url","href",this.f.url),this.config.oa_deposit_off?(_OA.hide("._oaw_get_email"),_OA.show("._oaw_oa")):(this.file=!0,_OA.show("._oaw_oa_deposit"))):this.f.permissions.best_permission.can_archive?("publishedVersion"===this.f.permissions.best_permission.version&&_OA.hide("#_oaw_not_pdf"),"string"==typeof this.f.permissions.best_permission.licence&&this.f.permissions.best_permission.licence.startsWith("other-")?_OA.html("._oaw_licence","under the publisher's terms"+n):_OA.html("._oaw_licence",this.f.permissions.best_permission.licence?this.f.permissions.best_permission.licence:"CC-BY"),_OA.show("._oaw_archivable")):this.config.dark_deposit_off?(r="mailto:"+(this.f.permissions.best_permission.permissions_contact?this.f.permissions.best_permission.permissions_contact:this.config.deposit_help?this.config.deposit_help:this.cml())+"?",this.f.permissions.best_permission.permissions_contact&&(r+="cc="+(this.config.deposit_help?this.config.deposit_help:this.cml())+"&"),r+="subject=Request%20to%20self%20archive%20"+(this.f.metadata.doi?this.f.metadata.doi:"")+"&body=",r+=encodeURIComponent("To whom it may concern,\n\n"),r+=encodeURIComponent('I am writing to request permission to deposit the full text of my paper "'+(this.f.metadata.title?this.f.metadata.title:this.f.metadata.doi?this.f.metadata.doi:"Untitled paper")+'" '),this.f.metadata.journal&&(r+=encodeURIComponent('published in "'+this.f.metadata.journal+'"')),r+=encodeURIComponent("\n\nI would like to archive the final pdf. If that is not possible, I would like to archive the accepted manuscript. Ideally, I would like to do so immediately but will respect a reasonable embargo if requested.\n\n"),this.config.repo_name&&(r+=encodeURIComponent('I plan to deposit it into "'+this.config.repo_name+'", a not-for-profit, digital, publicly accessible repository for scholarly work created for researchers '+(this.config.institution_name?"at "+this.config.institution_name:"")+". It helps make research available to a wider audience, get citations for the original article, and assure its long-term preservation. The deposit will include a complete citation of the published version, and a link to it.\n\n")),r+=encodeURIComponent("Thank you for your attention and I look forward to hearing from you."),_OA.set("#_oaw_reviewemail","href",r),s="mailto:"+(this.config.deposit_help?this.config.deposit_help:this.cml())+"?subject=Permission%20Given%20to%20Deposit%20"+(this.f.metadata.doi?this.f.metadata.doi:"")+"&body=",s+=encodeURIComponent("To whom it may concern,\n\nAttached is written confirmation of permission I've been given to deposit, and the permitted version of my paper: "),s+=encodeURIComponent('"'+(this.f.metadata.title?this.f.metadata.title:this.f.metadata.doi?this.f.metadata.doi:"Untitled paper")+'" \n\nCan you please deposit it into the repository on my behalf? \n\nSincerely, '),_OA.set("#_oaw_permissionemail","href",s),_OA.hide("._oaw_get_email"),_OA.show("._oaw_permission_required")):(this.file=!0,_OA.hide("#_oaw_file"),_OA.show("._oaw_dark_deposit"))}return _OA.show("#_oaw_error","Sorry, we cannot find this paper or sufficient metadata. "+this.contact()+"
"),this.ping("shareyourpaper_unknown_article")}return setTimeout((()=>this.permissions()),100)}catch(t){return this.ping("shareyourpaper_try_permissions_catch")}},_oaw.prototype.findings=function(t){var i,e,a,o,s,n;try{if(null!=t&&(this.f=t),void 0===this.f.metadata&&(this.f.metadata={}),!_OA.gebi(this.element))return setTimeout((()=>this.findings()),100);if(this.loading(!1),(e=this.f.metadata.crossref_type?this.f.metadata.crossref_type:this.f.metadata.type?this.f.metadata.type:void 0)&&"journal-article"!==e&&"proceedings-article"!==e&&"posted-content"!==e)return a="book-section"===e||"book-part"===e||"book-chapter"===e?"Please make your request through our "+(this.config.book?'book form':"book form"):"
We can only process academic journal articles, please use another form.",void this.restart(void 0,void 0,a+"
");if(_OA.hide("._oaw_panel"),_OA.hide("._oaw_section"),this.config.resolver&&((t={match:this.f.input,from:this.uid,plugin:this.plugin,embedded:window.location.href}).config=this.config,t.metadata=this.f.metadata,this.config.pilot&&(t.pilot=this.config.pilot),this.config.live&&(t.live=this.config.live),void 0===this.f.ill&&(this.f.ill={}),void 0===this.f.ill.subscription&&(this.f.ill.subscription={}),this.f.ill.subscription.url?t.resolved="subscription":this.f.url?t.resolved="open":(n=this.openurl())&&(t.resolved="library"),null!=t.resolved&&(t.url=this.f.ill.subscription.url?this.f.ill.subscription.url:this.f.url?this.f.url:n,_OA.jx(this.api+"/ill",t,(()=>window.location=this.f.ill.subscription.url?this.f.ill.subscription.url:this.f.url?this.f.url:n),(()=>window.location=this.f.ill.subscription.url?this.f.ill.subscription.url:this.f.url?this.f.url:n)))),_OA.show("#_oaw_findings"),void 0!==this.f.ill.error&&_OA.show("#_oaw_error","Please note, we encountered errors querying the following subscription services: "+this.f.ill.error.join(", ")+"
"),!this.f.metadata.title||!this.f.metadata.journal&&!this.data.usermetadata)return this.data.usermetadata?(_OA.html("#_oaw_citation","Sorry, we can't find this "+(this.config.say_paper?"paper":"article")+" or sufficient metadata. "+this.contact()+"
"),this.ping("shareyourpaper_unknown_article"),setTimeout((()=>this.restart()),6e3)):this.metadata();if(i="",this.f.metadata.year&&(i+=this.f.metadata.year+(this.f.metadata.journal||this.f.metadata.volume||this.f.metadata.issue?", ":"")),this.f.metadata.journal?i+=this.f.metadata.journal:(this.f.metadata.volume&&(i+="vol. "+this.f.metadata.volume),this.f.metadata.issue&&(i+=(this.f.metadata.volume?", ":"")+"issue "+this.f.metadata.issue)),i+="
"),_OA.html("#_oaw_citation",i),s=!1,o=!1,this.f.ill.subscription.journal||this.f.ill.subscription.url?(s=!0,null!=this.f.ill.subscription.url&&_OA.set("#_oaw_sub_url","href",this.f.ill.subscription.url),_OA.show("#_oaw_sub_available")):this.f.url&&(o=!0,_OA.set("#_oaw_url","href",this.f.url),_OA.show("#_oaw_oa_available")),null!=this.f.ill&&!(this.config.ill_if_sub_off&&s||this.config.ill_if_oa_off&&o))return _OA.html("#_oaw_cost_time","It "+(this.config.cost?"costs "+this.config.cost:"is free to you,")+" and we'll usually email the link within "+(this.config.time?this.config.time:"24 hours")+".
Please complete all required fields
");if(this.submit_after_metadata)return void this.submit()}return this.data.atitle&&!this.data.title&&(this.data.title=this.data.atitle),this.data.rft_id&&!this.data.doi&&(this.data.doi=this.data.rft_id),this.data.doi&&this.data.doi.includes("10.")&&this.data.doi.startsWith("http")&&(this.data.url=this.data.doi,delete this.data.doi),(r=_OA.get("#_oaw_input"))?(r=r.trim().replace(/\.$/,"")).length&&(r.includes(" ")?this.data.title=r:r.includes("doi.org/")?(this.data.url=r,this.data.doi="10."+r.split("/10.")[1].split(" ")[0]):r.includes("10.")?this.data.doi=r:r.startsWith("http")||r.includes("www.")?this.data.url=r:0===r.toLowerCase().replace("pmc","").replace("pmid","").replace(":","").replace(/[0-9]/g,"").length?this.data.id=r:this.data.title=r):(this.data.doi||this.data.title||this.data.url||this.data.id)&&_OA.set("#_oaw_input",this.data.doi?this.data.doi:this.data.title?this.data.title:this.data.url?this.data.url:this.data.id),"instantill"!==this.plugin||this.data.doi||this.needmore||void 0!==this.f&&void 0!==this.f.metadata&&this.f.metadata.journal||this.data.title&&!(this.data.title.length<30&&this.data.title.split(" ").length<3)?this.data.doi||"shareyourpaper"!==this.plugin&&(this.data.url||this.data.pmid||this.data.pmcid||this.data.title||this.data.id)?!this.data.doi||"shareyourpaper"!==this.plugin||this.data.doi.startsWith("10")&&this.data.doi.includes("/")&&this.data.doi.includes(".")&&!(this.data.doi.length<8)?(this.state(),this.loading(),this.data.config=this.config,this.data.from||(this.data.from=this.uid),this.data.plugin||(this.data.plugin=this.plugin),this.data.embedded||(this.data.embedded=window.location.href),this.config.pilot&&void 0===this.data.pilot&&(this.data.pilot=this.config.pilot),this.config.live&&void 0===this.data.live&&(this.data.live=this.config.live),!0===this.demo&&("Engineering a Powerfully Simple Interlibrary Loan Experience with InstantILL"===this.data.title||"10.1234/567890"===this.data.doi||null!=this.data.doi&&this.data.doi.startsWith("10.1234/oab-syp"))?((i={metadata:{title:"Engineering a Powerfully Simple Interlibrary Loan Experience with InstantILL",year:"2019",crossref_type:"journal-article",doi:this.data.doi?this.data.doi:"10.1234/oab-syp-aam"}}).metadata.journal="Proceedings of the 16th IFLA ILDS conference: Beyond the paywall - Resource sharing in a disruptive ecosystem",i.metadata.author=[{given:"Mike",family:"Paxton"},{given:"Gary",family:"Maixner III"},{given:"Joseph",family:"McArthur"},{given:"Tina",family:"Baich"}],i.ill={subscription:{findings:{},uid:this.uid,lookups:[],error:[],url:"https://scholarworks.iupui.edu/bitstream/handle/1805/20422/07-PAXTON.pdf?sequence=1&isAllowed=y"}},i.permissions={best_permission:{can_archive:"10.1234/oab-syp-aam"===this.data.doi,version:"10.1234/oab-syp-aam"===this.data.doi?"postprint":void 0},file:{archivable:!0,archivable_reason:"Demo acceptance",version:"postprint",licence:"cc-by",same_paper:!0,name:"example.pdf",format:"pdf",checksum:"example-checksum"}},"instantill"===this.plugin?this.findings(i):this.permissions(i)):_OA.jx(this.api+"/find",this.data,(t=>"instantill"===this.plugin?this.findings(t):this.permissions(t)),(()=>_OA.show("#_oaw_error","Oh dear, the service is down! We're aware, and working to fix the problem. "+this.contact()+"
")))):(delete this.data.doi,_OA.set("#_oaw_input",""),_OA.gebi("_oaw_input").focus(),_OA.show("#_oaw_error",'Please provide a DOI. If you\'re not sure what a DOI is, go here.
')):"shareyourpaper"===this.plugin?(delete this.data.title,delete this.data.url,delete this.data.id,_OA.show("#_oaw_error",'Please provide a DOI. If you\'re not sure what a DOI is, go here.
')):_OA.show("#_oaw_error","❌ Sorry please provide the full DOI, title, citation, PMID or PMC ID.
"):(this.needmore=!0,this.metadata())}catch(t){return this.ping(this.plugin+"_try_find_catch")}},_oaw.css="",_oaw.instantill_template=' If you need an article you can request it from any library in the world through Interlibrary loan.
Start by entering a full article title, citation, or DOI:
We can help you make your paper Open Access, for free, wherever you publish. It\'s legal and takes just minutes. Join millions of researchers sharing their papers freely with colleagues and the public.
We\'ll gather information about your paper and find the easiest way to share it.
Notice a change? We're testing a simpler and faster way to "+("instantill"===this.plugin?"get":"deposit")+" your "+(this.config.say_paper?"paper":"article")+("instantill"===this.plugin?"":"s")+". You can ",_+='give feedback or ',"instantill"===this.plugin?_+='use the old form.
Need ",this.config.book&&(i+='a book chapter'),this.config.other&&(i+=(this.config.book?" or ":" ")+'something else'),_OA.html("#_oaw_book_or_other",i+"?
")):_OA.html("#_oaw_book_or_other",""),this.config.intro_off&&_OA.hide("#_oaw_intro"),this.config.advanced_ill_form||this.config.account||this.config.ill_info?(t="Or ",this.config.advanced_ill_form&&(_OA.show("#_oaw_advanced_ill_form",' or use full request form'),t+='use full request form',this.config.account&&this.config.ill_info?t+=", ":(this.config.account||this.config.ill_info)&&(t+=" and ")),this.config.account&&(t+='view account',this.config.ill_info&&(t+=" and ")),this.config.ill_info&&(t+='learn about Interlibrary Loan'),_OA.html("#_oaw_advanced_account_info",t+"
")):(_OA.html("#_oaw_advanced_account_info",""),_OA.hide("#_oaw_advanced_ill_form"))),_OA.listen("enter","#_oaw_input",(t=>this.find(t))),_OA.listen("enter","#_oaw_email",(t=>this.validate(t))),_OA.listen("click","._oaw_find",(t=>this.find(t))),_OA.listen("click","._oaw_submit",(t=>this.submit(t))),_OA.listen("click","._oaw_restart",(t=>this.restart(t))),_OA.listen("click","._oaw_ping",(t=>this.ping(_OA.get(t.target,"message")))),_OA.listen("click","._oaw_wrong",(t=>(t.preventDefault(),this.ping("_wrong_article"),this.metadata()))),_OA.listen("click","._oaw_reload",(t=>{var i;return t.preventDefault(),(i=_OA.gebi("_oaw_file"))&&(i.value=""),this.file=!1,this.permissions()})),_OA.listen("click","._oaw_confirm",(t=>(t.preventDefault(),this.data.confirmed=!0,this.deposit()))),_OA.listen("click","#_oaw_reviewemail",(t=>this.done("review"))),_OA.listen("click","._oaw_deposit",(t=>this.deposit(t)))),n=_OA.gebi("_oaw_config")){for(l in h=JSON.parse(JSON.stringify(d)),p={ill_institution:"institution",ill_redirect_base_url:"ill_form",ill_redirect_params:"ill_added_params",deposit_terms:"terms",problem_email:"problem",viewaccount:"account",autorun:"autorun_off",intropara:"intro_off",norequests:"requests_off",illinfo:"ill_info",noillifoa:"ill_if_oa_off",noillifsub:"ill_if_sub_off",saypaper:"say_paper",advancedform:"advanced_ill_form",deposit_date:"depositdate",deposit_terms:"terms",allow_oa_deposit:"oa_deposit_off",ROR_ID:"ror",not_a_library:"not_library",adminemail:"email",css:"css_off",bootstrap:"bootstrap_off"})null!=h[l]&&(h[p[l]]=h[l],delete h[l]);n.innerHTML=JSON.stringify(h)}return window.location.search.includes("panel=")&&this.panel(window.location.search.split("panel=")[1].split("&")[0].split("#")[0],window.location.search.includes("section=")?window.location.search.split("section=")[1].split("&")[0].split("#")[0]:void 0),a&&(("string"!=typeof a||"string"==typeof this.config.val&&this.config.val.length)&&(a=this.config.val),this.data={},this.f={},this.loading(!1),(r=_OA.gebi("_oaw_file"))&&(r.value=""),this.file=!1,_OA.hide("._oaw_panel"),_OA.show("#_oaw_inputs"),_OA.set("#_oaw_input",a),setTimeout((()=>this.find()),1)),this.needmore&&this.metadata(),"function"==typeof this.loaded?this.loaded():void 0})(),d},this.shareyourpaper=function(t){return null==t&&(t={}),t.plugin="shareyourpaper",new _oaw(t)},this.instantill=function(t){return null==t&&(t={}),t.plugin="instantill",new _oaw(t)}; +var _OA,_oaw,indexOf=[].indexOf;(_OA={gebi:function(t){return document.getElementById(t.replace("#",""))},gebc:function(t){return document.getElementsByClassName(t.replace(".",""))},gebn:function(t){var i;return null!=(i=document.getElementsByTagName(t.replace("<","").replace(">","")))?i:document.getElementsByName(t)}}).each=function(t,i,e){var a,o,s,n;if("string"==typeof t?t=t.startsWith("#")?[_OA.gebi(t)]:t.startsWith(".")?_OA.gebc(t):_OA.gebn(t):"object"==typeof t&&(Array.isArray(t)||(t=[t])),null!=t){for(n=[],o=0,s=t.length;oPlease provide your university email address.
"),_OA.css("#_oaw_email","border-color","#f04717"),_OA.gebi("#_oaw_email").focus()))},_oaw.prototype.submit=function(t){var i,e,a,o,s,n,r;try{try{t.preventDefault()}catch(t){}if(this.openurl()||this.data.email||!_OA.gebi("#_oaw_email")){if("{}"!==JSON.stringify(this.f)&&null!=this.f.metadata&&this.f.metadata.title&&this.f.metadata.journal&&this.f.metadata.year){for(this.loading(),(i={match:this.f.input,email:this.data.email,from:this.uid,plugin:this.plugin,embedded:window.location.href}).config=this.config,i.metadata=this.f.metadata?this.f.metadata:{},e=0,o=(r=["title","journal","year","doi"]).length;eYour confirmation code is: "+t+", this will not be emailed to you. The "+(this.config.say_paper?"paper":"article")+" will be sent to "+this.data.email+" as soon as possible.
"):(_OA.html("#_oaw_done_header",""+this.contact()+"
"),_OA.html("#_oaw_done_restart","Try another"),this.ping(null!=i?i:"instantill_couldnt_submit_ill"),setTimeout((()=>this.restart()),6e3)),_OA.show("#_oaw_done")),"function"==typeof this.after)return this.after()},_oaw.prototype.deposit=function(t){var i,e,a,o,s;try{try{t.preventDefault()}catch(t){}if(!this.data.email&&_OA.gebi("#_oaw_email"))return this.validate();if(!0!==this.demo||null==this.data.doi||!this.data.doi.startsWith("10.1234/oab-syp-")){if(null!=(a=_OA.gebi("#_oaw_file"))&&null!=a.files&&a.files.length)this.file=new FormData,this.file.append("file",a.files[0]);else if(!0!==this.file)return _OA.show("#_oaw_error","Whoops, you need to give us a file! Check it's uploaded.
"),void _OA.css("#_oaw_file","border-color","#f04717");if(this.loading(),e={from:this.uid,plugin:this.plugin,embedded:window.location.href,metadata:void 0!==this.f?this.f.metadata:void 0},!0===this.demo&&(e.demo=!0),e.config=this.config,this.data.email&&(e.email=this.data.email),this.data.confirmed&&(e.confirmed=this.data.confirmed),void 0!==this.f&&"string"==typeof this.f.url&&(e.redeposit=this.f.url),this.config.pilot&&(e.pilot=this.config.pilot),this.config.live&&(e.live=this.config.live),"boolean"!=typeof this.file){for(i in e)if("metadata"===i)for(s in e[i])"string"!=typeof e[i][s]&&"number"!=typeof e[i][s]||this.file.append(s,e[i][s]);else"object"==typeof e[i]?this.file.append(i,JSON.stringify(e[i])):this.file.append(i,e[i]);e=this.file}return _OA.jx(this.api.replace("://","://bg.")+"/deposit",e,(t=>(this.loading(!1),"boolean"!=typeof this.file?void 0!==t.zenodo&&t.zenodo.already||this.data.confirmed&&(void 0===t.zenodo||!t.zenodo.url)?this.done("check"):t.error?this.done("partial"):void 0!==t.zenodo&&t.zenodo.url?(_OA.set("#_oaw_zenodo_url",t.zenodo.url),t.embargo?(o="You've done your part for now. Unfortunately, "+(void 0!==this.f&&void 0!==this.f.metadata&&this.f.metadata.shortname?this.f.metadata.shortname:void 0!==this.f&&void 0!==this.f.metadata&&this.f.metadata.journal?this.f.metadata.journal:"the journal")+" won't let us make it public until ",o+=new Date(t.embargo).toLocaleString("en-GB",{year:"numeric",month:"long",day:"numeric"}).replace(/(11|12|13) /,"$1th ").replace("1 ","1st ").replace("2 ","2nd ").replace("3 ","3rd ").replace(/([0-9]) /,"$1th "),o+=". After release, you'll find your paper on "+(this.config.repo_name?this.config.repo_name:"ScholarWorks")+", Google Scholar, Web of Science.
",o+="You'll soon find your paper freely available in "+(this.config.repo_name?this.config.repo_name:"ScholarWorks")+", Google Scholar, Web of Science, and other popular tools.",o+="
Sorry, we were not able to deposit this paper for you. "+this.contact()+'
'),this.ping("shareyourpaper_couldnt_submit_deposit"))))}if("10.1234/oab-syp-confirm"!==this.data.doi?(o="You'll soon find your paper freely available in "+(this.config.repo_name?this.config.repo_name:"ScholarWorks")+", Google Scholar, Web of Science, and other popular tools.",o+="
Double check your DOI, that doesn't look right to us.
"),_OA.gebi("_oaw_input").focus();if(void 0!==this.f.metadata.crossref_type&&"journal-article"!==this.f.metadata.crossref_type&&"proceedings-article"!==this.f.metadata.crossref_type||void 0!==this.f.metadata.type&&"journal-article"!==this.f.metadata.type&&"proceedings-article"!==this.f.metadata.type)return _OA.gebi("_oaw_input").focus(),i="Sorry, right now this only works with academic journal articles.",(this.cml()||this.config.old_way&&this.config.old_way.includes("@"))&&(i+=' To get help with depositing, click here"),this.restart(void 0,void 0,i+".
");if(this.f.metadata.title){_OA.hide("._oaw_panel"),_OA.hide("._oaw_section"),_OA.show("#_oaw_permissions"),this.loading(!1),l='terms [1]',this.config.terms&&(l+=' [2]'),o="your.name@institution.edu",null!=this.config.email_domains&&this.config.email_domains.length&&("string"==typeof this.config.email_domains&&(this.config.email_domains=this.config.email_domains.split(",")),(o=this.config.email_domains[0]).includes("@")&&(o=o.split("@")[1]),o.includes("//")&&(o=o.split("//")[1]),o=o.toLowerCase().replace("www.","")),(null==o||o.length<3)&&(o="your.name@institution.edu"),o.includes("@")||(o="your.name@"+o),this.data.email?_OA.hide("._oaw_get_email"):(_OA.show("._oaw_get_email"),_OA.set("#_oaw_email","placeholder",o),_OA.html("._oaw_terms",l)),n="";try{for(e in this.f.permissions.best_permission.provenance.archiving_policy)n+=' ['+(parseInt(e)+1)+"]"}catch(t){}return _OA.html("._oaw_refs",n),a=this.f.metadata.doi?'your paper':"your paper",_OA.html("._oaw_your_paper",("publishedVersion"===this.f.permissions.best_permission.version?"the publisher pdf of ":"")+a),_OA.html("._oaw_journal",this.f.metadata.shortname?this.f.metadata.shortname:"the journal"),this.f.url?(_OA.set("._oaw_oa_url","href",this.f.url),this.config.oa_deposit_off?(_OA.hide("._oaw_get_email"),_OA.show("._oaw_oa")):(this.file=!0,_OA.show("._oaw_oa_deposit"))):this.f.permissions.best_permission.can_archive?("publishedVersion"===this.f.permissions.best_permission.version&&_OA.hide("#_oaw_not_pdf"),"string"==typeof this.f.permissions.best_permission.licence&&this.f.permissions.best_permission.licence.startsWith("other-")?_OA.html("._oaw_licence","under the publisher's terms"+n):_OA.html("._oaw_licence",this.f.permissions.best_permission.licence?this.f.permissions.best_permission.licence:"CC-BY"),_OA.show("._oaw_archivable")):this.config.dark_deposit_off?(r="mailto:"+(this.f.permissions.best_permission.permissions_contact?this.f.permissions.best_permission.permissions_contact:this.config.deposit_help?this.config.deposit_help:this.cml())+"?",this.f.permissions.best_permission.permissions_contact&&(r+="cc="+(this.config.deposit_help?this.config.deposit_help:this.cml())+"&"),r+="subject=Request%20to%20self%20archive%20"+(this.f.metadata.doi?this.f.metadata.doi:"")+"&body=",r+=encodeURIComponent("To whom it may concern,\n\n"),r+=encodeURIComponent('I am writing to request permission to deposit the full text of my paper "'+(this.f.metadata.title?this.f.metadata.title:this.f.metadata.doi?this.f.metadata.doi:"Untitled paper")+'" '),this.f.metadata.journal&&(r+=encodeURIComponent('published in "'+this.f.metadata.journal+'"')),r+=encodeURIComponent("\n\nI would like to archive the final pdf. If that is not possible, I would like to archive the accepted manuscript. Ideally, I would like to do so immediately but will respect a reasonable embargo if requested.\n\n"),this.config.repo_name&&(r+=encodeURIComponent('I plan to deposit it into "'+this.config.repo_name+'", a not-for-profit, digital, publicly accessible repository for scholarly work created for researchers '+(this.config.institution_name?"at "+this.config.institution_name:"")+". It helps make research available to a wider audience, get citations for the original article, and assure its long-term preservation. The deposit will include a complete citation of the published version, and a link to it.\n\n")),r+=encodeURIComponent("Thank you for your attention and I look forward to hearing from you."),_OA.set("#_oaw_reviewemail","href",r),s="mailto:"+(this.config.deposit_help?this.config.deposit_help:this.cml())+"?subject=Permission%20Given%20to%20Deposit%20"+(this.f.metadata.doi?this.f.metadata.doi:"")+"&body=",s+=encodeURIComponent("To whom it may concern,\n\nAttached is written confirmation of permission I've been given to deposit, and the permitted version of my paper: "),s+=encodeURIComponent('"'+(this.f.metadata.title?this.f.metadata.title:this.f.metadata.doi?this.f.metadata.doi:"Untitled paper")+'" \n\nCan you please deposit it into the repository on my behalf? \n\nSincerely, '),_OA.set("#_oaw_permissionemail","href",s),_OA.hide("._oaw_get_email"),_OA.show("._oaw_permission_required")):(this.file=!0,_OA.hide("#_oaw_file"),_OA.show("._oaw_dark_deposit"))}return _OA.show("#_oaw_error","Sorry, we cannot find this paper or sufficient metadata. "+this.contact()+"
"),this.ping("shareyourpaper_unknown_article")}return setTimeout((()=>this.permissions()),100)}catch(t){return this.ping("shareyourpaper_try_permissions_catch")}},_oaw.prototype.findings=function(t){var i,e,a,o,s,n;try{if(null!=t&&(this.f=t),void 0===this.f.metadata&&(this.f.metadata={}),!_OA.gebi(this.element))return setTimeout((()=>this.findings()),100);if(this.loading(!1),(e=this.f.metadata.crossref_type?this.f.metadata.crossref_type:this.f.metadata.type?this.f.metadata.type:void 0)&&"journal-article"!==e&&"proceedings-article"!==e&&"posted-content"!==e)return a="book-section"===e||"book-part"===e||"book-chapter"===e?"Please make your request through our "+(this.config.book?'book form':"book form"):"
We can only process academic journal articles, please use another form.",void this.restart(void 0,void 0,a+"
");if(_OA.hide("._oaw_panel"),_OA.hide("._oaw_section"),this.config.resolver&&((t={match:this.f.input,from:this.uid,plugin:this.plugin,embedded:window.location.href}).config=this.config,t.metadata=this.f.metadata,this.config.pilot&&(t.pilot=this.config.pilot),this.config.live&&(t.live=this.config.live),void 0===this.f.ill&&(this.f.ill={}),void 0===this.f.ill.subscription&&(this.f.ill.subscription={}),this.f.ill.subscription.url?t.resolved="subscription":this.f.url?t.resolved="open":(n=this.openurl())&&(t.resolved="library"),null!=t.resolved&&(t.url=this.f.ill.subscription.url?this.f.ill.subscription.url:this.f.url?this.f.url:n,_OA.jx(this.api+"/ill",t,(()=>window.location=this.f.ill.subscription.url?this.f.ill.subscription.url:this.f.url?this.f.url:n),(()=>window.location=this.f.ill.subscription.url?this.f.ill.subscription.url:this.f.url?this.f.url:n)))),_OA.show("#_oaw_findings"),void 0!==this.f.ill.error&&_OA.show("#_oaw_error","Please note, we encountered errors querying the following subscription services: "+this.f.ill.error.join(", ")+"
"),!this.f.metadata.title||!this.f.metadata.journal&&!this.data.usermetadata)return this.data.usermetadata?(_OA.html("#_oaw_citation","Sorry, we can't find this "+(this.config.say_paper?"paper":"article")+" or sufficient metadata. "+this.contact()+"
"),this.ping("shareyourpaper_unknown_article"),setTimeout((()=>this.restart()),6e3)):this.metadata();if(i="",this.f.metadata.year&&(i+=this.f.metadata.year+(this.f.metadata.journal||this.f.metadata.volume||this.f.metadata.issue?", ":"")),this.f.metadata.journal?i+=this.f.metadata.journal:(this.f.metadata.volume&&(i+="vol. "+this.f.metadata.volume),this.f.metadata.issue&&(i+=(this.f.metadata.volume?", ":"")+"issue "+this.f.metadata.issue)),i+="
"),_OA.html("#_oaw_citation",i),s=!1,o=!1,this.f.ill.subscription.journal||this.f.ill.subscription.url?(s=!0,null!=this.f.ill.subscription.url&&_OA.set("#_oaw_sub_url","href",this.f.ill.subscription.url),_OA.show("#_oaw_sub_available")):this.f.url&&(o=!0,_OA.set("#_oaw_url","href",this.f.url),_OA.show("#_oaw_oa_available")),null!=this.f.ill&&!(this.config.ill_if_sub_off&&s||this.config.ill_if_oa_off&&o))return _OA.html("#_oaw_cost_time","It "+(this.config.cost?"costs "+this.config.cost:"is free to you,")+" and we'll usually email the link within "+(this.config.time?this.config.time:"24 hours")+".
Please complete all required fields
");if(this.submit_after_metadata)return void this.submit()}return this.data.atitle&&!this.data.title&&(this.data.title=this.data.atitle),this.data.rft_id&&!this.data.doi&&(this.data.doi=this.data.rft_id),this.data.doi&&this.data.doi.includes("10.")&&this.data.doi.startsWith("http")&&(this.data.url=this.data.doi,delete this.data.doi),(r=_OA.get("#_oaw_input"))?(r=r.trim().replace(/\.$/,"")).length&&(r.includes(" ")?this.data.title=r:r.includes("doi.org/")?(this.data.url=r,this.data.doi="10."+r.split("/10.")[1].split(" ")[0]):r.includes("10.")?this.data.doi=r:r.startsWith("http")||r.includes("www.")?this.data.url=r:0===r.toLowerCase().replace("pmc","").replace("pmid","").replace(":","").replace(/[0-9]/g,"").length?this.data.id=r:this.data.title=r):(this.data.doi||this.data.title||this.data.url||this.data.id)&&_OA.set("#_oaw_input",this.data.doi?this.data.doi:this.data.title?this.data.title:this.data.url?this.data.url:this.data.id),"instantill"!==this.plugin||this.data.doi||this.needmore||void 0!==this.f&&void 0!==this.f.metadata&&this.f.metadata.journal||this.data.title&&!(this.data.title.length<30&&this.data.title.split(" ").length<3)?this.data.doi||"shareyourpaper"!==this.plugin&&(this.data.url||this.data.pmid||this.data.pmcid||this.data.title||this.data.id)?!this.data.doi||"shareyourpaper"!==this.plugin||this.data.doi.startsWith("10")&&this.data.doi.includes("/")&&this.data.doi.includes(".")&&!(this.data.doi.length<8)?(this.state(),this.loading(),this.data.config=this.config,this.data.from||(this.data.from=this.uid),this.data.plugin||(this.data.plugin=this.plugin),this.data.embedded||(this.data.embedded=window.location.href),this.config.pilot&&void 0===this.data.pilot&&(this.data.pilot=this.config.pilot),this.config.live&&void 0===this.data.live&&(this.data.live=this.config.live),!0===this.demo&&("Engineering a Powerfully Simple Interlibrary Loan Experience with InstantILL"===this.data.title||"10.1234/567890"===this.data.doi||null!=this.data.doi&&this.data.doi.startsWith("10.1234/oab-syp"))?((i={metadata:{title:"Engineering a Powerfully Simple Interlibrary Loan Experience with InstantILL",year:"2019",crossref_type:"journal-article",doi:this.data.doi?this.data.doi:"10.1234/oab-syp-aam"}}).metadata.journal="Proceedings of the 16th IFLA ILDS conference: Beyond the paywall - Resource sharing in a disruptive ecosystem",i.metadata.author=[{given:"Mike",family:"Paxton"},{given:"Gary",family:"Maixner III"},{given:"Joseph",family:"McArthur"},{given:"Tina",family:"Baich"}],i.ill={subscription:{findings:{},uid:this.uid,lookups:[],error:[],url:"https://scholarworks.iupui.edu/bitstream/handle/1805/20422/07-PAXTON.pdf?sequence=1&isAllowed=y"}},i.permissions={best_permission:{can_archive:"10.1234/oab-syp-aam"===this.data.doi,version:"10.1234/oab-syp-aam"===this.data.doi?"postprint":void 0},file:{archivable:!0,archivable_reason:"Demo acceptance",version:"postprint",licence:"cc-by",same_paper:!0,name:"example.pdf",format:"pdf",checksum:"example-checksum"}},"instantill"===this.plugin?this.findings(i):this.permissions(i)):_OA.jx(this.api+"/find",this.data,(t=>"instantill"===this.plugin?this.findings(t):this.permissions(t)),(()=>_OA.show("#_oaw_error","Oh dear, the service is down! We're aware, and working to fix the problem. "+this.contact()+"
")))):(delete this.data.doi,_OA.set("#_oaw_input",""),_OA.gebi("_oaw_input").focus(),_OA.show("#_oaw_error",'Please provide a DOI. If you\'re not sure what a DOI is, go here.
')):"shareyourpaper"===this.plugin?(delete this.data.title,delete this.data.url,delete this.data.id,_OA.show("#_oaw_error",'Please provide a DOI. If you\'re not sure what a DOI is, go here.
')):_OA.show("#_oaw_error","❌ Sorry please provide the full DOI, title, citation, PMID or PMC ID.
"):(this.needmore=!0,this.metadata())}catch(t){return this.ping(this.plugin+"_try_find_catch")}},_oaw.css="",_oaw.instantill_template=' If you need an article you can request it from any library in the world through Interlibrary loan.
Start by entering a full article title, citation, or DOI:
We can help you make your paper Open Access, for free, wherever you publish. It\'s legal and takes just minutes. Join millions of researchers sharing their papers freely with colleagues and the public.
We\'ll gather information about your paper and find the easiest way to share it.
Notice a change? We're testing a simpler and faster way to "+("instantill"===this.plugin?"get":"deposit")+" your "+(this.config.say_paper?"paper":"article")+("instantill"===this.plugin?"":"s")+". You can ",_+='give feedback or ',"instantill"===this.plugin?_+='use the old form.
Need ",this.config.book&&(i+='a book chapter'),this.config.other&&(i+=(this.config.book?" or ":" ")+'something else'),_OA.html("#_oaw_book_or_other",i+"?
")):_OA.html("#_oaw_book_or_other",""),this.config.intro_off&&_OA.hide("#_oaw_intro"),this.config.advanced_ill_form||this.config.account||this.config.ill_info?(t="Or ",this.config.advanced_ill_form&&(_OA.show("#_oaw_advanced_ill_form",' or use full request form'),t+='use full request form',this.config.account&&this.config.ill_info?t+=", ":(this.config.account||this.config.ill_info)&&(t+=" and ")),this.config.account&&(t+='view account',this.config.ill_info&&(t+=" and ")),this.config.ill_info&&(t+='learn about Interlibrary Loan'),_OA.html("#_oaw_advanced_account_info",t+"
")):(_OA.html("#_oaw_advanced_account_info",""),_OA.hide("#_oaw_advanced_ill_form"))),_OA.listen("enter","#_oaw_input",(t=>this.find(t))),_OA.listen("enter","#_oaw_email",(t=>this.validate(t))),_OA.listen("click","._oaw_find",(t=>this.find(t))),_OA.listen("click","._oaw_submit",(t=>this.submit(t))),_OA.listen("click","._oaw_restart",(t=>this.restart(t))),_OA.listen("click","._oaw_ping",(t=>this.ping(_OA.get(t.target,"message")))),_OA.listen("click","._oaw_wrong",(t=>(t.preventDefault(),this.ping("_wrong_article"),this.metadata()))),_OA.listen("click","._oaw_reload",(t=>{var i;return t.preventDefault(),(i=_OA.gebi("_oaw_file"))&&(i.value=""),this.file=!1,this.permissions()})),_OA.listen("click","._oaw_confirm",(t=>(t.preventDefault(),this.data.confirmed=!0,this.deposit()))),_OA.listen("click","#_oaw_reviewemail",(t=>this.done("review"))),_OA.listen("click","._oaw_deposit",(t=>this.deposit(t)))),(n=_OA.gebi("_oaw_config"))||(n=_OA.gebi("_oab_config")),n){for(l in h=JSON.parse(JSON.stringify(d)),p={ill_institution:"institution",ill_redirect_base_url:"ill_form",ill_redirect_params:"ill_added_params",deposit_terms:"terms",problem_email:"problem",viewaccount:"account",autorun:"autorun_off",intropara:"intro_off",norequests:"requests_off",illinfo:"ill_info",noillifoa:"ill_if_oa_off",noillifsub:"ill_if_sub_off",saypaper:"say_paper",advancedform:"advanced_ill_form",deposit_date:"depositdate",deposit_terms:"terms",allow_oa_deposit:"oa_deposit_off",ROR_ID:"ror",not_a_library:"not_library",adminemail:"email",css:"css_off",bootstrap:"bootstrap_off"})null!=h[l]&&(h[p[l]]=h[l],delete h[l]);n.innerHTML=JSON.stringify(h)}return window.location.search.includes("panel=")&&this.panel(window.location.search.split("panel=")[1].split("&")[0].split("#")[0],window.location.search.includes("section=")?window.location.search.split("section=")[1].split("&")[0].split("#")[0]:void 0),a&&(("string"!=typeof a||"string"==typeof this.config.val&&this.config.val.length)&&(a=this.config.val),this.data={},this.f={},this.loading(!1),(r=_OA.gebi("_oaw_file"))&&(r.value=""),this.file=!1,_OA.hide("._oaw_panel"),_OA.show("#_oaw_inputs"),_OA.set("#_oaw_input",a),setTimeout((()=>this.find()),1)),this.needmore&&this.metadata(),"function"==typeof this.loaded?this.loaded():void 0})(),d},this.shareyourpaper=function(t){return null==t&&(t={}),t.plugin="shareyourpaper",new _oaw(t)},this.instantill=function(t){return null==t&&(t={}),t.plugin="instantill",new _oaw(t)};