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;l1&&window.location.href.split("?")[0].split("/10.")[1].trim().split("/").length>1&&(this.data.doi="10."+window.location.href.split("?")[0].split("/10.")[1].replace(/\/$/,""))}return window.location.search.includes("email=")&&(this.data.email=window.location.search.split("email=")[1].split("&")[0].split("#")[0],_OA.remove("#_oaw_collect_email")),window.location.search.includes("confirmed=")&&(this.data.confirmed=window.location.search.split("confirmed=")[1].split("&")[0].split("#")[0]),window.location.search.includes("refresh=true")&&(this.data.refresh=!0),(this.data.doi||"instantill"===this.plugin&&(this.data.title||this.data.url))&&this.find(),window.addEventListener("popstate",(t=>this.state(t))),this}catch(t){return this.ping("instantill_or_shareyourpaper_try_initialise_catch")}}).prototype.cml=function(){return this.config.problem?this.config.problem:this.config.owner?this.config.owner:this.config.email?this.config.email:""},_oaw.prototype.contact=function(){return"Please try "+(this.cml()?'contacting us':"contacting us")+" directly"},_oaw.prototype.loading=function(t){if(_OA.hide("#_oaw_error"),!0===t||!this._loading&&!1!==t)return _OA.html("._oaw_find","Searching ."),_OA.html("._oaw_submit","Submitting ."),_OA.html("._oaw_deposit","Depositing ."),_OA.html("._oaw_confirm","Depositing ."),this._loading=setInterval((function(){var t,i,e,a,o,s;for(s=[],e=0,a=(o=_OA.gebc("._oaw_loading")).length;e=4?s.push(t.innerHTML=i[0]):s.push(t.innerHTML=t.innerHTML+" .");return s}),700);try{clearInterval(this._loading)}catch(t){}return this._loading=!1,_OA.each("._oaw_loading",(t=>_OA.has(t,"_oaw_continue")?t.innerHTML="Continue":_OA.has(t,"_oaw_submit")?t.innerHTML="Complete request":_OA.has(t,"_oaw_deposit")?t.innerHTML="Deposit":_OA.has(t,"_oaw_find")?t.innerHTML="Next":_OA.has(t,"_oaw_confirm")?t.innerHTML="My upload was an accepted manuscript":t.innerHTML="Find "+(this.config.say_paper?"paper":"article")))},_oaw.prototype.state=function(t){var i,e,a,o,s;if(this.pushstate)try{if(s=window.location.pathname,null==t)if(window.location.href.includes("shareyourpaper.org"))if(window.location.href.includes("/10.")||window.location.href.replace(/\//g,"").endsWith(".org"))s=window.location.href.split("10.")[0]+(this.data.doi?this.data.doi:"")+window.location.search+window.location.hash;else{if(s+=window.location.search.split("?doi=")[0].split("&doi=")[0],s+=s.includes("?")?"&":"?",s+="doi="+this.data.doi,window.location.search.split("?doi=")[1].includes("&"))for((i=window.location.search.split("?doi=")[1].split("&")).shift(),e=0,o=i.length;ePlease agree to the terms first.

"):("string"!=typeof(t=_OA.get("#_oaw_email"))&&(t=""),(t=t.trim()).length&&2===t.split("@").length?(this.data.email=t,"instantill"===this.plugin?this.submit():this.deposit()):(_OA.show("#_oaw_error","

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;ethis.done(t)),(()=>this.done(!1)))}return this.submit_after_metadata?this.done(!1):(this.submit_after_metadata=!0,this.metadata())}return this.validate()}catch(t){return this.ping("instantill_try_submit_catch")}},_oaw.prototype.metadata=function(t){var i,e,a,o;for(i=0,e=(o=["title","year","journal","doi"]).length;iThanks! Your request has been received

Your 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","

Sorry, we were not able to create an Interlibrary Loan request for you.

"+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+="

Your paper will be freely available at this link:

"):(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+="

Your paper is now freely available at this link:

"),_OA.html("#_oaw_zenodo_embargo",o),this.done("zenodo")):this.done("confirm"):"redeposit"===t.type?this.done("redeposit"):this.done("success"))),(()=>(this.loading(!1),_OA.show("#_oaw_error","

Sorry, we were not able to deposit this paper for you. "+this.contact()+'

Try again

'),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+="

Your paper is now freely available at this link:

",_OA.html("#_oaw_zenodo_embargo",o),_OA.set("#_oaw_zenodo_url","https://zenodo.org/record/3703317"),this.done("zenodo")):this.done("confirm"),"function"==typeof this.loaded)return this.loaded()}catch(t){return this.ping("shareyourpaper_try_deposit_catch")}},_oaw.prototype.permissions=function(t){var i,e,a,o,s,n,r,l;try{if(null!=t&&(this.f=t),_OA.gebi(this.element)){if(this.loading(!1),void 0===this.f&&(this.f={}),void 0===this.f.metadata&&(this.f.metadata={}),void 0===this.f.permissions&&(this.f.permissions={}),void 0===this.f.permissions.best_permission&&(this.f.permissions.best_permission={}),this.f.doi_not_in_crossref||this.f.doi_not_in_oadoi)return this.f={},_OA.show("#_oaw_error","

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","

Unknown paper

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","

Unknown "+(this.config.say_paper?"paper":"article")+"

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.title+"

",(this.f.metadata.year||this.f.metadata.journal||this.f.metadata.volume||this.f.metadata.issue)&&(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")+".

"),this.data.email||(this.openurl()?_OA.hide("#_oaw_collect_email"):this.config.terms?(_OA.show("#_oaw_terms_note"),_OA.set("#_oaw_terms_link","href",this.config.terms)):_OA.hide("#_oaw_terms_note")),_OA.show("#_oaw_ask_library")}catch(a){return this.ping("instantill_try_findings_catch")}},_oaw.prototype.find=function(t){var i,e,a,o,s,n,r;try{try{t.preventDefault()}catch(t){}if("{}"!==JSON.stringify(this.f)||this.needmore){for(a=0,s=(e=["title","journal","year","doi"]).length;aPlease provide the full year e.g 2019

");if(!this.data.title||!this.data.journal||!this.data.year)return void _OA.show("#_oaw_error","

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:

Find article

',_oaw.shareyourpaper_template='

Make your research visible and see 30% more citations

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.

Start by entering the DOI of your paper

We\'ll gather information about your paper and find the easiest way to share it.

Next

My paper doesn\'t have a DOI

',_oaw.prototype.configure=function(t,i,e,a){var o,s,n,r,l,h,d;if("string"==typeof t&&null==i&&t.startsWith("{"))try{t=JSON.parse(t)}catch(t){}if("string"!=typeof t||null!=i||null!=this.uid&&"anonymous"!==this.uid||(this.uid=t,t=void 0),("string"==typeof t&&null!=i||null==t&&null==i)&&"{}"===JSON.stringify(this.config)){try{!1!==this.local&&"object"==typeof(h=JSON.parse(localStorage.getItem("_oaw_config_"+this.plugin)))&&null!==h&&(console.log("Config retrieved from local storage"),this.config=h)}catch(t){}if(!1!==this.remote&&this.uid&&"anonymous"!==this.uid&&"{}"===JSON.stringify(this.config)&&(_OA.jx((this.api.includes("beta.oa.works")?"https://dev.api.cottagelabs.com/service/oab":"https://api.openaccessbutton.org")+"/"+("instantill"===this.plugin?"ill":"deposit")+"/config?uid="+this.uid,void 0,(t=>(console.log("Config retrieved from API"),this.configure(t)))),!1===this.local))return}if("object"==typeof t){for(r in"string"==typeof i&&(this.uid=i),t)(null==this.config[r]||this.config[r]!==t[r]&&!0===i)&&(!1!==e&&(e=!0),this.config[r]="true"===t[r]||"false"!==t[r]&&t[r]);if(!0===i)for(s in this.config)"owner"!==s&&null==t[s]&&delete this.config[s]}else null!=t&&null!=i&&(this.config[t]="true"===i||"false"!==i&&i);for(n in!0===this.config.pilot&&(this.config.pilot=Date.now()),!0===this.config.live&&(this.config.live=Date.now()),this.config)""===this.config[n]&&delete this.config[n];for(l in d=JSON.parse(JSON.stringify(this.config)))(null==d[l]||!1===d[l]||("string"==typeof d[l]||Array.isArray(d[l]))&&0===d[l].length)&&delete d[l];try{"{}"!==JSON.stringify(d)&&!1!==this.local&&localStorage.setItem("_oaw_config_"+this.plugin,JSON.stringify(d))}catch(t){}return!1!==this.css&&this.config.css_off&&(this.css=!1,e=!0),!1!==this.bootstrap&&this.config.bootstrap_off&&(this.bootstrap=!1,e=!0),null==this.element&&(this.element="#"+this.plugin),(o=()=>{var t,i,s,n,r,h,p,_;if(!_OA.gebi(this.element))return console.log("waiting for "+this.element),setTimeout((()=>o()),100);if(!1!==e&&(console.log("Building embed"),_OA.html(this.element,""),null==this.bootstrap&&(s=document.documentElement.innerHTML,this.bootstrap=s.includes("bootstrap/")||s.includes("/bootstrap")||s.includes("bootstrap.css")||s.includes("bootstrap.min.css")||s.includes("btn-"),!0===this.bootstrap&&console.log("Found bootstrap indicators in the doc")),!0===this.bootstrap?this.template.includes("btn-primary")||(this.template=this.template.replace(/_oaw_button/g,"_oaw_button btn btn-primary").replace(/_oaw_form/g,"_oaw_form form-control")):this.template.includes("btn-primary")&&(this.template=this.template.replace(/ btn btn-primary/g,"").replace(/ form-control/g,"")),"string"==typeof this.css&&"false"!==this.css&&!0!==this.bootstrap&&(this.css.startsWith(""),_OA.append(this.element,this.css)),_OA.append(this.element,this.template),(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),_OA.each("._oaw_paper",(t=>{var i;if(i=t.innerHTML,this.config.say_paper){if(!i.includes("aper"))return t.innerHTML="an article"===i?"a paper":"article"===i?"paper":"Paper"}else if(i.includes("aper"))return t.innerHTML="a paper"===i?"an article":"paper"===i?"article":"Article"})),this.config.pilot?(_="


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.

':_+='use the old way.

',_OA.html("#_oaw_pilot",_)):_OA.html("#_oaw_pilot",""),"shareyourpaper"===this.plugin?((null!=this.cml()||this.config.old_way&&this.config.old_way.includes("@"))&&(n=_OA.gebi("_oaw_nodoi"))&&n.setAttribute("href",n.getAttribute("href").replace("help@openaccessbutton.org",this.config.old_way&&this.config.old_way.includes("@")?this.config.old_way:this.cml())),this.config.not_library?_OA.html("._oaw_library","We have"):_OA.html("#_oaw_lib_info","Share your paper with help from the library in "+(this.config.repo_name?this.config.repo_name:"ScholarWorks")+". Legally, for free, in minutes. "),this.config.repo_name&&_OA.html("._oaw_repo",this.config.repo_name)):"instantill"===this.plugin&&(this.config.book||this.config.other?(i="

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;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;l1&&window.location.href.split("?")[0].split("/10.")[1].trim().split("/").length>1&&(this.data.doi="10."+window.location.href.split("?")[0].split("/10.")[1].replace(/\/$/,""))}return window.location.search.includes("email=")&&(this.data.email=window.location.search.split("email=")[1].split("&")[0].split("#")[0],_OA.remove("#_oaw_collect_email")),window.location.search.includes("confirmed=")&&(this.data.confirmed=window.location.search.split("confirmed=")[1].split("&")[0].split("#")[0]),window.location.search.includes("refresh=true")&&(this.data.refresh=!0),(this.data.doi||"instantill"===this.plugin&&(this.data.title||this.data.url))&&this.find(),window.addEventListener("popstate",(t=>this.state(t))),this}catch(t){return this.ping("instantill_or_shareyourpaper_try_initialise_catch")}}).prototype.cml=function(){return this.config.problem?this.config.problem:this.config.owner?this.config.owner:this.config.email?this.config.email:""},_oaw.prototype.contact=function(){return"Please try "+(this.cml()?'contacting us':"contacting us")+" directly"},_oaw.prototype.loading=function(t){if(_OA.hide("#_oaw_error"),!0===t||!this._loading&&!1!==t)return _OA.html("._oaw_find","Searching ."),_OA.html("._oaw_submit","Submitting ."),_OA.html("._oaw_deposit","Depositing ."),_OA.html("._oaw_confirm","Depositing ."),this._loading=setInterval((function(){var t,i,e,a,o,s;for(s=[],e=0,a=(o=_OA.gebc("._oaw_loading")).length;e=4?s.push(t.innerHTML=i[0]):s.push(t.innerHTML=t.innerHTML+" .");return s}),700);try{clearInterval(this._loading)}catch(t){}return this._loading=!1,_OA.each("._oaw_loading",(t=>_OA.has(t,"_oaw_continue")?t.innerHTML="Continue":_OA.has(t,"_oaw_submit")?t.innerHTML="Complete request":_OA.has(t,"_oaw_deposit")?t.innerHTML="Deposit":_OA.has(t,"_oaw_find")?t.innerHTML="Next":_OA.has(t,"_oaw_confirm")?t.innerHTML="My upload was an accepted manuscript":t.innerHTML="Find "+(this.config.say_paper?"paper":"article")))},_oaw.prototype.state=function(t){var i,e,a,o,s;if(this.pushstate)try{if(s=window.location.pathname,null==t)if(window.location.href.includes("shareyourpaper.org"))if(window.location.href.includes("/10.")||window.location.href.replace(/\//g,"").endsWith(".org"))s=window.location.href.split("10.")[0]+(this.data.doi?this.data.doi:"")+window.location.search+window.location.hash;else{if(s+=window.location.search.split("?doi=")[0].split("&doi=")[0],s+=s.includes("?")?"&":"?",s+="doi="+this.data.doi,window.location.search.split("?doi=")[1].includes("&"))for((i=window.location.search.split("?doi=")[1].split("&")).shift(),e=0,o=i.length;ePlease agree to the terms first.

"):("string"!=typeof(t=_OA.get("#_oaw_email"))&&(t=""),(t=t.trim()).length&&2===t.split("@").length?(this.data.email=t,"instantill"===this.plugin?this.submit():this.deposit()):(_OA.show("#_oaw_error","

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;ethis.done(t)),(()=>this.done(!1)))}return this.submit_after_metadata?this.done(!1):(this.submit_after_metadata=!0,this.metadata())}return this.validate()}catch(t){return this.ping("instantill_try_submit_catch")}},_oaw.prototype.metadata=function(t){var i,e,a,o;for(i=0,e=(o=["title","year","journal","doi"]).length;iThanks! Your request has been received

Your 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","

Sorry, we were not able to create an Interlibrary Loan request for you.

"+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+="

Your paper will be freely available at this link:

"):(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+="

Your paper is now freely available at this link:

"),_OA.html("#_oaw_zenodo_embargo",o),this.done("zenodo")):this.done("confirm"):"redeposit"===t.type?this.done("redeposit"):this.done("success"))),(()=>(this.loading(!1),_OA.show("#_oaw_error","

Sorry, we were not able to deposit this paper for you. "+this.contact()+'

Try again

'),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+="

Your paper is now freely available at this link:

",_OA.html("#_oaw_zenodo_embargo",o),_OA.set("#_oaw_zenodo_url","https://zenodo.org/record/3703317"),this.done("zenodo")):this.done("confirm"),"function"==typeof this.loaded)return this.loaded()}catch(t){return this.ping("shareyourpaper_try_deposit_catch")}},_oaw.prototype.permissions=function(t){var i,e,a,o,s,n,r,l;try{if(null!=t&&(this.f=t),_OA.gebi(this.element)){if(this.loading(!1),void 0===this.f&&(this.f={}),void 0===this.f.metadata&&(this.f.metadata={}),void 0===this.f.permissions&&(this.f.permissions={}),void 0===this.f.permissions.best_permission&&(this.f.permissions.best_permission={}),this.f.doi_not_in_crossref||this.f.doi_not_in_oadoi)return this.f={},_OA.show("#_oaw_error","

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","

Unknown paper

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","

Unknown "+(this.config.say_paper?"paper":"article")+"

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.title+"

",(this.f.metadata.year||this.f.metadata.journal||this.f.metadata.volume||this.f.metadata.issue)&&(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")+".

"),this.data.email||(this.openurl()?_OA.hide("#_oaw_collect_email"):this.config.terms?(_OA.show("#_oaw_terms_note"),_OA.set("#_oaw_terms_link","href",this.config.terms)):_OA.hide("#_oaw_terms_note")),_OA.show("#_oaw_ask_library")}catch(a){return this.ping("instantill_try_findings_catch")}},_oaw.prototype.find=function(t){var i,e,a,o,s,n,r;try{try{t.preventDefault()}catch(t){}if("{}"!==JSON.stringify(this.f)||this.needmore){for(a=0,s=(e=["title","journal","year","doi"]).length;aPlease provide the full year e.g 2019

");if(!this.data.title||!this.data.journal||!this.data.year)return void _OA.show("#_oaw_error","

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:

Find article

',_oaw.shareyourpaper_template='

Make your research visible and see 30% more citations

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.

Start by entering the DOI of your paper

We\'ll gather information about your paper and find the easiest way to share it.

Next

My paper doesn\'t have a DOI

',_oaw.prototype.configure=function(t,i,e,a){var o,s,n,r,l,h,d;if("string"==typeof t&&null==i&&t.startsWith("{"))try{t=JSON.parse(t)}catch(t){}if("string"!=typeof t||null!=i||null!=this.uid&&"anonymous"!==this.uid||(this.uid=t,t=void 0),("string"==typeof t&&null!=i||null==t&&null==i)&&"{}"===JSON.stringify(this.config)){try{!1!==this.local&&"object"==typeof(h=JSON.parse(localStorage.getItem("_oaw_config_"+this.plugin)))&&null!==h&&(console.log("Config retrieved from local storage"),this.config=h)}catch(t){}if(!1!==this.remote&&this.uid&&"anonymous"!==this.uid&&"{}"===JSON.stringify(this.config)&&(_OA.jx((this.api.includes("beta.oa.works")?"https://dev.api.cottagelabs.com/service/oab":"https://api.openaccessbutton.org")+"/"+("instantill"===this.plugin?"ill":"deposit")+"/config?uid="+this.uid,void 0,(t=>(console.log("Config retrieved from API"),this.configure(t)))),!1===this.local))return}if("object"==typeof t){for(r in"string"==typeof i&&(this.uid=i),t)(null==this.config[r]||this.config[r]!==t[r]&&!0===i)&&(!1!==e&&(e=!0),this.config[r]="true"===t[r]||"false"!==t[r]&&t[r]);if(!0===i)for(s in this.config)"owner"!==s&&null==t[s]&&delete this.config[s]}else null!=t&&null!=i&&(this.config[t]="true"===i||"false"!==i&&i);for(n in!0===this.config.pilot&&(this.config.pilot=Date.now()),!0===this.config.live&&(this.config.live=Date.now()),this.config)""===this.config[n]&&delete this.config[n];for(l in d=JSON.parse(JSON.stringify(this.config)))(null==d[l]||!1===d[l]||("string"==typeof d[l]||Array.isArray(d[l]))&&0===d[l].length)&&delete d[l];try{"{}"!==JSON.stringify(d)&&!1!==this.local&&localStorage.setItem("_oaw_config_"+this.plugin,JSON.stringify(d))}catch(t){}return!1!==this.css&&this.config.css_off&&(this.css=!1,e=!0),!1!==this.bootstrap&&this.config.bootstrap_off&&(this.bootstrap=!1,e=!0),null==this.element&&(this.element="#"+this.plugin),(o=()=>{var t,i,s,n,r,h,p,_;if(!_OA.gebi(this.element))return console.log("waiting for "+this.element),setTimeout((()=>o()),100);if(!1!==e&&(console.log("Building embed"),_OA.html(this.element,""),null==this.bootstrap&&(s=document.documentElement.innerHTML,this.bootstrap=s.includes("bootstrap/")||s.includes("/bootstrap")||s.includes("bootstrap.css")||s.includes("bootstrap.min.css")||s.includes("btn-"),!0===this.bootstrap&&console.log("Found bootstrap indicators in the doc")),!0===this.bootstrap?this.template.includes("btn-primary")||(this.template=this.template.replace(/_oaw_button/g,"_oaw_button btn btn-primary").replace(/_oaw_form/g,"_oaw_form form-control")):this.template.includes("btn-primary")&&(this.template=this.template.replace(/ btn btn-primary/g,"").replace(/ form-control/g,"")),"string"==typeof this.css&&"false"!==this.css&&!0!==this.bootstrap&&(this.css.startsWith(""),_OA.append(this.element,this.css)),_OA.append(this.element,this.template),(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),_OA.each("._oaw_paper",(t=>{var i;if(i=t.innerHTML,this.config.say_paper){if(!i.includes("aper"))return t.innerHTML="an article"===i?"a paper":"article"===i?"paper":"Paper"}else if(i.includes("aper"))return t.innerHTML="a paper"===i?"an article":"paper"===i?"article":"Article"})),this.config.pilot?(_="


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.

':_+='use the old way.

',_OA.html("#_oaw_pilot",_)):_OA.html("#_oaw_pilot",""),"shareyourpaper"===this.plugin?((null!=this.cml()||this.config.old_way&&this.config.old_way.includes("@"))&&(n=_OA.gebi("_oaw_nodoi"))&&n.setAttribute("href",n.getAttribute("href").replace("help@openaccessbutton.org",this.config.old_way&&this.config.old_way.includes("@")?this.config.old_way:this.cml())),this.config.not_library?_OA.html("._oaw_library","We have"):_OA.html("#_oaw_lib_info","Share your paper with help from the library in "+(this.config.repo_name?this.config.repo_name:"ScholarWorks")+". Legally, for free, in minutes. "),this.config.repo_name&&_OA.html("._oaw_repo",this.config.repo_name)):"instantill"===this.plugin&&(this.config.book||this.config.other?(i="

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)};