-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'origin/develop'
- Loading branch information
Showing
9 changed files
with
227 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,6 +8,36 @@ | |
$('#oabutton_find').trigger('click'); | ||
},500) | ||
}); | ||
|
||
var save = function(e) { | ||
if (e) e.preventDefault(); | ||
var data = {}; | ||
$('.setting').each(function(i, obj) { | ||
if ( $(this).val() !== undefined ) { | ||
data[$(this).attr('id')] = $(this).val(); | ||
} | ||
}); | ||
|
||
var opts = { | ||
url: api + '/ill/config', | ||
type:'POST', | ||
cache:false, | ||
processData:false, | ||
contentType: 'application/json', | ||
dataType: 'json', | ||
success: function(data) { | ||
$('#save').hide().after('<span id="saved">Changes saved!</span>'); | ||
setTimeout(function() { $('#saved').hide(); $('#save').show(); }, 5000); | ||
}, | ||
error: function(data) { | ||
$('#save').hide().after('<span id="saved">Sorry, changes could not be saved.</span>'); | ||
setTimeout(function() { $('#saved').hide(); $('#save').show(); }, 5000); | ||
}, | ||
beforeSend: function (request) { request.setRequestHeader("x-apikey", noddy.apikey); } | ||
} | ||
opts.data = JSON.stringify(data); | ||
$.ajax(opts); | ||
} | ||
|
||
noddy.afterLogin = function() { | ||
$('.promptsignup').hide(); | ||
|
@@ -16,6 +46,16 @@ | |
$('.stickidin').html($('.stickidin').html().replace('instantill()','instantill({uid:"' + uid + '"})')); | ||
$('#onlyyou').html($('#onlyyou').html().replace('but only you ','but only you (' + noddy.user.account.profile.firstname + ') ')); | ||
instantill({uid:uid, api:api}); | ||
console.log(noddy.user.account.service) | ||
try { | ||
for (var k in noddy.user.account.service.openaccessbutton.ill.config) { | ||
$('#'+k).val(noddy.user.account.service.openaccessbutton.ill.config[k]); | ||
} | ||
} catch(err) {} | ||
$('#save').bind('click',save); | ||
if (noddy.hasRole('root')) { | ||
$('#ill_config').prepend('<input style="border-color:red;" id="uid" type="text" class="form-control setting" placeholder="UID (ADMIN setting override)"><br>') | ||
} | ||
} | ||
noddy.nologin = function() { | ||
instantill({uid:'oab_site', api:api}); | ||
|
@@ -99,6 +139,46 @@ <h2>Install your own</h2> | |
<pre> | ||
<div id="instantill"></div></pre> | ||
</ol> | ||
|
||
<h2>Configure your OpenURL <small>(optional)</small></h2> | ||
|
||
<p>We can forward OpenURL requests (or any request) to a URL of your choice, to trigger your ILL workflow. | ||
Just set your base URL, any necessary URL params that must always be present, <!--, request method,--> | ||
and the URL parameter keys you would like us to put the various bits of metadata in, if our defaults are not suitable. | ||
(Our defaults are OpenURL compatible, so these can be used without changes if all you need is OpenURL compatibility.)</p> | ||
|
||
<p id="ill_config"> | ||
URL (required)<br> | ||
<input id="ill_redirect_base_url" type="text" class="form-control setting" placeholder="URL (required)"><br> | ||
Add any additional params your base URL needs, such as a=b&c=d<br> | ||
<input id="ill_redirect_params" type="text" class="form-control setting" placeholder="Add any additional params your base URL needs"><br> | ||
<!--<input id="method" type="text" class="form-control setting" placeholder="Method (default GET)"><br>--> | ||
Title<br> | ||
<input id="title" type="text" class="form-control setting" placeholder="Title (default atitle)"><br> | ||
Journal title<br> | ||
<input id="journal" type="text" class="form-control setting" placeholder="Journal title (default title)"><br> | ||
DOI<br> | ||
<input id="doi" type="text" class="form-control setting" placeholder="DOI (default rft_id)"><br> | ||
Author<br> | ||
<input id="author" type="text" class="form-control setting" placeholder="Author (default au)"><br> | ||
ISSN<br> | ||
<input id="issn" type="text" class="form-control setting" placeholder="ISSN (default issn)"><br> | ||
Volume<br> | ||
<input id="volume" type="text" class="form-control setting" placeholder="Volume (default volume)"><br> | ||
Issue<br> | ||
<input id="issue" type="text" class="form-control setting" placeholder="Issue (default issue)"><br> | ||
Page<br> | ||
<input id="page" type="text" class="form-control setting" placeholder="Page (default pages)"><br> | ||
Published<br> | ||
<input id="published" type="text" class="form-control setting" placeholder="Published (default date)"><br> | ||
PMID<br> | ||
<input id="pmid" type="text" class="form-control setting" placeholder="PMID (default pmid)"><br> | ||
<!--<input id="pmcid" type="text" class="form-control setting" placeholder="PMCID (default pmcid)"><br>--> | ||
Year | ||
<input id="year" type="text" class="form-control setting" placeholder="Year (default rft.year)"> | ||
</p> | ||
|
||
<p><a id="save" class="btn btn-primary btn-block" href="#">Save your settings</a></p> | ||
|
||
<p>If anything is wrong, <a href="mailto:[email protected]?Subject=Trouble%20setting%20up%20InstantILL&body=Please%20send%20us%20the%20URL%20of%20the%20page%20you're%20working%20on,%20or%20a%20screenshot%20of%20what%20you're%20seeing%20and%20a%20copy%20of%20the%20page's%20code%20-%20right-click%20on%20the%20page%20and%20View%20Page%20Source.">get in touch</a>.</p> | ||
</div> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.