-
<script type="text/javascript">
-
+;(function() {
/* Checks to see if a given type of added content has data to show.
* The first arg to callback() is boolean indicating the presence of data */
function acIsAvailable(bre_id, type, callback) {
var url = '/opac/extras/ac/' + type + '/html/r/' + bre_id;
- dojo.xhr('HEAD', {
- url : url,
- failOk : true, // http://bugs.dojotoolkit.org/ticket/11568
- error : function(err) { callback(false, bre_id, type); },
- load : function(result) { callback(true, bre_id, type); }
- });
+ var req = new XMLHttpRequest();
+ req.addEventListener('load', callback(true, bre_id, type));
+ req.addEventListener('abort', callback(false, bre_id, type));
+ req.addEventListener('error', callback(false, bre_id, type));
+ req.open('HEAD', url);
}
[%-
FOR type IN ctx.added_content.keys;
IF ctx.added_content.$type.status == '3' # status unknown %]
- dojo.addOnLoad(function() {
+ window.addEventListener('load', function() {
var bre_id = '[% ctx.bre_id %]';
var type = '[% type %]';
[% IF CGI.param('expand') == 'addedcontent' %]
// if the content is available, un-hide the tab
- dojo.removeClass(dojo.byId('ac:' + type), 'hidden');
+ var actype = document.elementById('ac:' + type);
+ actype.class = actype.class.replace(/hidden/, '');
[% ELSE %]
// if no default type is selected on the main tab link
// set one here, since we have available content
- var link = dojo.query('[name=addedcontent]')[0];
+ var link = document.querySelectorAll('[name="addedcontent"]')[0];
var href = link.getAttribute('href');
if (!href.match('[\&;]ac=')) {
href = href.replace('#addedcontent', ';ac=' + type + '#addedcontent');
- dojo.attr(link, 'href', href);
- dojo.attr(dojo.query('[name=addedcontent_lbl]')[0], 'href', href);
+ link.href = href;
+ document.querySelectorAll('[name="addedcontent_lbl"]')[0].href = href;
}
[% END %]
function(d){
// note if d.length == 0, there is no content to display
// hide the Loading... text
- dojo.byId('novelist-loading').innerHTML = '';
+ document.getElementById('novelist-loading').innerHTML = '';
}
)}, 100);
[%- END; # Novelist -%]
[% END; # IF ident
%]
+})()
</script>
IF CGI.https; url = url.replace('^http:', 'https:'); END; %]
<script type='text/javascript' id='EIT' src='[% url %]'></script>
[%- END %]
+[% INCLUDE "opac/parts/acjs.tt2" IF ctx.page == 'record' %]
[%- IF want_dojo; -%]
<script type="text/javascript">
var djConfig = {
</script>
[% END; # use_autosuggest %]
-[% INCLUDE "opac/parts/acjs.tt2" IF ctx.page == 'record' %]
[% INCLUDE "opac/parts/ac_google_books.tt2" IF ctx.page == 'record' AND ctx.google_books_preview %]
[% IF ctx.page == 'advanced' %]
<script type="text/javascript"