Skip to content

Commit

Permalink
Added autoloader for EMIC
Browse files Browse the repository at this point in the history
  • Loading branch information
Alan Stanley committed Feb 22, 2012
1 parent 6de147a commit 235c2a1
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 0 deletions.
9 changes: 9 additions & 0 deletions lib/islandora/startup.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
$.urlParam = function(name){
var results = new RegExp('[\\?&]' + name + '=([^&#]*)').exec(window.location.href);
if (!results)
{
return 0;
}
return results[1] || 0;
}

26 changes: 26 additions & 0 deletions plugins/AutoLoadEmic/tileplugin.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
/*
* AutoLoadEmic
*
* @author Alan Stanley
*
* Wrapper for TILE engine to automatically load
* JSON data from Fedora Repository, based on the PID from the url
*
*/
var AutoLoadEmic={
id:"Auto1000101",
name:'AutoLoad',
/*
* start()
* @constructor
* @params mode {Object} - Mode object passed to method
*/
start:function(mode){
var PID = $.urlParam('PID');

TILE.preLoad='http://localhost/Development/emic/getTILE/' + PID;
}
};

// register the plugin with TILE
TILE.engine.registerPlugin(AutoLoadEmic);

0 comments on commit 235c2a1

Please sign in to comment.