";if(q.w3c||s){n+=''}q.width=q.height=q.id=q.w3c=q.src=null;for(var l in q){if(q[l]!==null){n+=''}}var o="";if(t){for(var m in t){if(t[m]!==null){o+=m+"="+(typeof t[m]=="object"?g(t[m]):t[m])+"&"}}o=o.substring(0,o.length-1);n+='"}n+="";return n}function d(m,p,l){var k=flashembed.getVersion();f(this,{getContainer:function(){return m},getConf:function(){return p},getVersion:function(){return k},getFlashvars:function(){return l},getApi:function(){return m.firstChild},getHTML:function(){return a(p,l)}});var q=p.version;var r=p.expressInstall;var o=!q||flashembed.isSupported(q);if(o){p.onFail=p.version=p.expressInstall=null;m.innerHTML=a(p,l)}else{if(q&&r&&flashembed.isSupported([6,65])){f(p,{src:r});l={MMredirectURL:location.href,MMplayerType:"PlugIn",MMdoctitle:document.title};m.innerHTML=a(p,l)}else{if(m.innerHTML.replace(/\s/g,"")!==""){}else{m.innerHTML="Flash version "+q+" or greater is required
"+(k[0]>0?"Your version is "+k:"You have no flash plugin installed")+"
"+(m.tagName=="A"?"Click here to download latest version
":"Download latest version from here
");if(m.tagName=="A"){m.onclick=function(){location.href="http://www.adobe.com/go/getflashplayer"}}}}}if(!o&&p.onFail){var n=p.onFail.call(this);if(typeof n=="string"){m.innerHTML=n}}if(document.all){window[p.id]=document.getElementById(p.id)}}window.flashembed=function(l,m,k){if(typeof l=="string"){var n=document.getElementById(l);if(n){l=n}else{c(function(){flashembed(l,m,k)});return}}if(!l){return}if(typeof m=="string"){m={src:m}}var o=f({},i);f(o,m);return new d(l,o,k)};f(window.flashembed,{getVersion:function(){var m=[0,0];if(navigator.plugins&&typeof navigator.plugins["Shockwave Flash"]=="object"){var l=navigator.plugins["Shockwave Flash"].description;if(typeof l!="undefined"){l=l.replace(/^.*\s+(\S+\s+\S+$)/,"$1");var n=parseInt(l.replace(/^(.*)\..*$/,"$1"),10);var r=/r/.test(l)?parseInt(l.replace(/^.*r(.*)$/,"$1"),10):0;m=[n,r]}}else{if(window.ActiveXObject){try{var p=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7")}catch(q){try{p=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");m=[6,0];p.AllowScriptAccess="always"}catch(k){if(m[0]==6){return m}}try{p=new ActiveXObject("ShockwaveFlash.ShockwaveFlash")}catch(o){}}if(typeof p=="object"){l=p.GetVariable("$version");if(typeof l!="undefined"){l=l.replace(/^\S+\s+(.*)$/,"$1").split(",");m=[parseInt(l[0],10),parseInt(l[2],10)]}}}}return m},isSupported:function(k){var m=flashembed.getVersion();var l=(m[0]>k[0])||(m[0]==k[0]&&m[1]>=k[1]);return l},domReady:c,asString:g,getHTML:a});if(e){jQuery.fn.flashembed=function(l,k){var m=null;this.each(function(){m=flashembed(this,l,k)});return l.api===false?this:m}}})();
/* From: /data/eprints/lib/static/javascript/auto/jscss.js */
/*
* IE compatibility based on a information given here:
* http://www.mapbender.org/index.php/Add_styles_via_DOM_in_IE_and_FF
*
*/
var css = {
".ep_no_js" : "display: none",
".ep_no_js_inline" : "display: none",
".ep_no_js_table_cell" : "display: none",
".ep_only_js" : "display: block",
".ep_only_js_inline" : "display: inline",
".ep_only_js_table_cell" : "display: block"
};
if( document.createStyleSheet )
{
// Internet Explorer
var styleSheetObj = document.createStyleSheet();
var styleObj = styleSheetObj.owningElement || styleSheetObj.ownerNode;
styleObj.setAttribute( "type", "text/css" );
for (tag in css)
{
styleSheetObj.addRule(tag,css[tag]);
}
}
else
{
// Firefox
var styleObj = document.createElement("style");
styleObj.setAttribute( "type", "text/css" );
document.getElementsByTagName("head")[0].appendChild( styleObj );
var css_string = "";
for (tag in css)
{
css_string += tag + " { " + css[tag] + "}\n";
}
styleObj.appendChild(document.createTextNode( css_string ));
}
/* From: /data/eprints/lib/static/javascript/auto/reports.js */
var initReportForm = function(){
//polyfill for IE
(function () {
if ( typeof window.CustomEvent === "function" ) return false; //If not IE
function CustomEvent ( event, params ) {
params = params || { bubbles: false, cancelable: false, detail: undefined };
var evt = document.createEvent( 'CustomEvent' );
evt.initCustomEvent( event, params.bubbles, params.cancelable, params.detail );
return evt;
}
CustomEvent.prototype = window.Event.prototype;
window.CustomEvent = CustomEvent;
})();
var select = document.getElementById('select_report');
select.addEventListener('change', onFormSelect);
document.observe("dom:loaded", function() {
var changeSelect = new CustomEvent("change");
select.dispatchEvent(changeSelect);
});
};
var onFormSelect = function(){
//get form id
var formid = this.options[this.selectedIndex].getAttribute('form');
//hide other forms
$$('table.ep_search_fields').each(function (elem)
{
//hide the form
$(elem).hide();
$(elem).removeClassName("selected_form");
$(elem).select('input').each(function (input)
{
$(input).setAttribute("disabled", "disabled");
});
});
//show the form we want
$(formid).show();
$(formid).addClassName("selected_form");
//enable this form's input elements
$(formid).select('input').each(function (input)
{
$(input).removeAttribute("disabled");
});
};
// Used by the Screen::Report::render method
var EPrints_Screen_Report_Loader = Class.create({
has_problems: 0,
count: 0,
runs: 0,
progress: null,
ids: Array(),
step: 20,
prefix: '',
onProblems: function() {},
onFinish: function() {},
url: "",
parameters: "",
container: null,
show_compliance: 1,
// to show a pretty progress bar (% compliance):
total_dataobjs: 0,
total_noncompliant: 0,
initialize: function(opts) {
if( opts.ids )
this.ids = opts.ids;
if( opts.step )
this.step = opts.step;
if( opts.prefix )
this.prefix = opts.prefix;
if( opts.onFinish )
this.onFinish = opts.onFinish;
if( opts.onProblems )
this.onProblems = opts.onProblems;
if( opts.url )
{
this.url = opts.url;
}
if( opts.parameters )
this.parameters = opts.parameters;
if( opts.container_id )
this.container = $( opts.container_id ); // should fail if container doesn't exist...
if( opts.hasOwnProperty('show_compliance') )
{
this.show_compliance = opts.show_compliance;
}
if( opts.labels )
{
this.labels = opts.labels;
}
},
execute: function() {
// progress-bar
this.container.insert( new Element( 'div', { 'class': 'ep_report_progress_bar', 'id': this.prefix + "_progress_bar" } ) );
var current_grouping = null; // might not be set in the returned value but that's allowed/OK
var dataobjs = {};
var grouped = false;
var seen_ids = {};
this.no_items = this.ids.length;
this.retrieved = [];
if( !isInteger(this.ids[0]) ) //ids have been grouped
{
grouped = true;
this.grouped_ids = this.ids;
this.ids = [];
for( var i = 0; i < this.grouped_ids.length; i++ )
{
this.ids = this.ids.concat(this.grouped_ids[i].list);
}
//the grouping may have created duplicate records (i.e. a record can appear in more than one group) - it's handy to have an array of all the unique records
this.unique = this.ids.filter(function(item, i, ar){ return ar.indexOf(item) === i; });
this.no_items = this.unique.length;
}
for(var i = 0; i < this.ids.length; i+=this.step)
{
// arguments for Ajax query AND creates the HTML placeholders 's (that will receive the content of the Ajax query...)
var args = '&ajax='+this.prefix;
for(var j = 0; j < this.step && i+j < this.ids.length; j++)
{
args += '&' + this.prefix + '=' + this.ids[i+j];
var id = this.prefix + '_' + this.ids[i+j];
var target_el = $( id );
if( target_el != null )
{
//store a record of this in seen_ids to ensure each placeholder has a unique id
if( !(id in seen_ids) )
{
seen_ids[id] = 1;
}
else
{
seen_ids[id] = seen_ids[id] + 1;
}
id = id + "_" + seen_ids[id];
}
this.container.insert( new Element( 'div', { 'class': 'ep_report_row', 'id': id, 'position': i+j } ), { 'position': 'after' } );
}
new Ajax.Request( this.url, {
method: 'get',
parameters: this.parameters + args,
onSuccess: (function(transport) {
var json = transport.responseText.evalJSON();
var data = json.data;
if( data == null )
data = new Array();
for( var i=0; i 0 )
{
target_id = target_id + '_' + added_ids[dataobjid];
}
var target_el = $( target_id );
if( target_el != null && summary != null )
{
var summary_el = target_el.appendChild( new Element( 'div', { 'class': 'ep_report_row_summary' } ) );
summary_el.update( summary );
//total up non compliant records
if( entry.is_compliant == null && entry.problems && entry.problems.length )
{
this.total_noncompliant++;
}
if( entry.problems && entry.problems.length )
{
var problems_el = target_el.appendChild( new Element( 'ul', { 'class': 'ep_report_row_problems' } ) );
for( var p=0; p< entry.problems.length; p++ )
{
var li = problems_el.appendChild( new Element( 'li' ));
li.update( entry.problems[p] );
}
}
else
{
//add support for compliant items to include bullet points too
if( entry.bullets && entry.bullets.length )
{
var bullets_el = target_el.appendChild( new Element( 'ul', { 'class': 'ep_report_row_bullets' } ) );
for( var b=0; b< entry.bullets.length; b++ )
{
var li = bullets_el.appendChild( new Element( 'li' ));
li.update( entry.bullets[b] );
}
}
}
//display state
var re = new RegExp("^#(?:[0-9a-fA-F]{3}){1,2}$");
if( entry.state && re.test(entry.state) )
{
target_el.style.borderLeftWidth = '7px';
target_el.style.borderLeftStyle = 'solid';
target_el.style.borderLeftColor = entry.state;
}
else //no state provided, so derive one from existence of problems
{
if( entry.problems && entry.problems.length )
{
target_el.addClassName( 'ep_report_row_problems' );
}
else
{
target_el.addClassName( 'ep_report_row_ok' );
}
if( !this.show_compliance )
{
target_el.addClassName( 'ep_report_row_no_compliance' );
}
}
target_el.show();
var grouping = entry.grouping;
if( grouping != null )
{
if( current_grouping == null || current_grouping != grouping)
{
current_grouping = grouping;
var grouping_container = new Element( 'div', { 'class': 'ep_report_grouping' } );
target_el.insert( { 'before' : grouping_container } );
grouping_container.update( current_grouping );
}
}
}
}
if( this.total_dataobjs )
{
this.container.insertBefore( new Element( 'div', { 'class': 'ep_report_compliance_container', 'id': this.prefix + "_compliance_container" } ), this.container.firstChild );
//set up text container
$( this.prefix + "_compliance_container" ).appendChild( new Element( 'div', { 'class': 'ep_report_compliance_text', 'id': this.prefix + "_compliance_text", } ));
//set up outputs label
var outputs;
if( this.labels )
{
outputs = this.labels.outputs;
}
else
{
outputs = "output";
if( this.total_dataobjs > 1 )
outputs = outputs + "s";
}
if( this.show_compliance )
{
var ref_width = 200;
var compliance = ( this.total_dataobjs - this.total_noncompliant ) / this.total_dataobjs;
$( this.prefix + "_compliance_container" ).appendChild( new Element( 'div', { 'class': 'ep_report_compliance_wrapper', 'id': this.prefix + "_compliance", 'style': 'width: '+ref_width + 'px' } ) );
var compliance_width = Math.floor( 200 * compliance );
$( this.prefix + "_compliance" ).appendChild( new Element( 'div', { 'class': 'ep_report_compliance', 'style': 'width:'+compliance_width + 'px' } ) );
$( this.prefix + "_compliance_text" ).update( this.total_dataobjs + " " + outputs + " - " + Math.floor( compliance * 100 ) + "% compliance");
}
else
{
$( this.prefix + "_compliance_text" ).update( this.total_dataobjs + " " + outputs );
}
}
}
else
{
var width = 200;
$( this.prefix + '_progress_bar' ).style.backgroundPosition = Math.round(-width + width * this.count / this.ids.length) + "px 0px";
}
if( this.runs == 0 && this.count == 0 )
{
var pNode = $( this.prefix + '_progress_bar' ).parentNode;
$(this.prefix + '_progress_bar').remove();
var span = new Element( 'span', { 'class': 'ep_ref_report_empty' } );
span.update( 'Report empty' );
pNode.insert( span );
}
this.runs++;
}).bind(this)
});
}
if( this.ids == null || this.ids.length == 0 )
{
var pNode = $(this.prefix + '_progress_bar').parentNode;
$(this.prefix + '_progress_bar').hide();
var span = new Element( 'span', { 'class': 'ep_ref_report_empty' } );
span.update( 'Report empty' );
pNode.insert( span );
}
}
});
function group_report(group)
{
document.group_report.group.value = group;
document.group_report.submit();
}
function sort_report(sort)
{
document.sort_report.sort.value = sort;
document.sort_report.submit();
}
function isInteger(num) {
return (num ^ 0) === num;
}