Mercurial > hg > digilib-old
changeset 628:1f077f8afc5e jquery
changed methods to pass "data" around instead of "settings"
renamed makeParamString to getParamString
author | robcast |
---|---|
date | Tue, 18 Jan 2011 00:11:53 +0100 |
parents | c2566e470569 |
children | b426efcc8a8e |
files | client/digitallibrary/jquery/jquery.digilib.js |
diffstat | 1 files changed, 15 insertions(+), 9 deletions(-) [+] |
line wrap: on
line diff
--- a/client/digitallibrary/jquery/jquery.digilib.js Mon Jan 17 23:57:09 2011 +0100 +++ b/client/digitallibrary/jquery/jquery.digilib.js Tue Jan 18 00:11:53 2011 +0100 @@ -215,11 +215,11 @@ } // create HTML structure setupScalerDiv(data); - setupButtons($elem, elemSettings, 'actionsStandard'); + setupButtons(data, 'actionsStandard'); // bird's eye view creation - TODO: could be deferred? - setupBirdviewDiv($elem, elemSettings); + setupBirdviewDiv(data); // about window creation - TODO: could be deferred? restrict to only one item? - setupAboutDiv($elem, elemSettings); + setupAboutDiv(data); }); }, @@ -340,7 +340,7 @@ }; // returns a query string from key names from a parameter hash - var makeParamString = function (settings, keys) { + var getParamString = function (settings, keys) { var paramString = ''; var latter = false; for (i = 0; i < keys.length; ++i) { @@ -359,7 +359,7 @@ // returns URL and query string for Scaler var getScalerString = function (settings) { var keys = settings.scalerParamNames; - var queryString = makeParamString(settings, keys); + var queryString = getParamString(settings, keys); var url = settings.scalerBaseUrl + '?' + queryString; return url; }; @@ -414,7 +414,9 @@ }; // creates HTML structure for buttons in elem - var setupButtons = function ($elem, settings, actionGroup) { + var setupButtons = function (data, actionGroup) { + var $elem = data.target; + var settings = data.settings; if (settings.interactionMode === 'fullscreen') { // fullscreen -- create new var $buttonsDiv = $('<div class="buttons"></div>'); @@ -459,7 +461,9 @@ }; // creates HTML structure for the bird's eye view in elem - var setupBirdviewDiv = function ($elem, settings) { + var setupBirdviewDiv = function (data) { + var $elem = data.target; + var settings = data.settings; // use only the relevant parameters var keys = ['fn','pn','dw','dh']; var birdDimensions = { @@ -467,7 +471,7 @@ 'dh' : settings.birdMaxY }; var birdSettings = $.extend({}, settings, birdDimensions); - var birdUrl = settings.scalerBaseUrl + '?' + makeParamString(birdSettings, keys); + var birdUrl = settings.scalerBaseUrl + '?' + getParamString(birdSettings, keys); // the bird's eye div var $birdviewDiv = $('<div class="birdview" style="display:none"/>'); // the detail indicator frame @@ -481,7 +485,9 @@ }; // creates HTML structure for the about view in elem - var setupAboutDiv = function ($elem, settings) { + var setupAboutDiv = function (data) { + var $elem = data.target; + var settings = data.settings; var $aboutDiv = $('<div class="about" style="display:none"/>'); var $header = $('<p>Digilib Graphic Viewer</p>'); var $link = $('<a/>');