Mercurial > hg > digilib-old
changeset 791:304488c72344 jquery
first step to birdseye view as a plugin.
author | robcast |
---|---|
date | Fri, 18 Feb 2011 10:39:40 +0100 |
parents | baa98b639126 |
children | d742bd92b05a 63c1b33e38b1 |
files | client/digitallibrary/jquery/jquery.digilib.birdseye.js client/digitallibrary/jquery/jquery.digilib.js |
diffstat | 2 files changed, 45 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/client/digitallibrary/jquery/jquery.digilib.birdseye.js Fri Feb 18 10:39:40 2011 +0100 @@ -0,0 +1,41 @@ +/** required digilib geometry plugin + */ + +(function($) { + + // affine geometry plugin stub + var geom; + + var FULL_AREA; + + var actions = { + }; + + // init: plugin initialization + var plugInit = function(data) { + // import geometry classes + geom = digilib.fn.geometry; + FULL_AREA = digilib.fn.FULL_AREA; + // TODO: add actions + // TODO: add buttons + // TODO: add event handlers + }; + + + // plugin object with name and init + // shared objects filled by digilib on registration + var digilib = { + name : 'birdseye', + init : plugInit, + buttons : {}, + actions : {}, + fn : {}, + plugins : {} + }; + + if ($.fn.digilib == null) { + $.error("jquery.digilib.birdview must be loaded after jquery.digilib!"); + } else { + $.fn.digilib('plugin', digilib); + } +})(jQuery);
--- a/client/digitallibrary/jquery/jquery.digilib.js Fri Feb 18 09:44:42 2011 +0100 +++ b/client/digitallibrary/jquery/jquery.digilib.js Fri Feb 18 10:39:40 2011 +0100 @@ -318,7 +318,7 @@ } } } - // store $(this) element in the settings + // store $(this) element in data elemSettings = $.extend({}, settings, params); data = { $elem : $elem, @@ -1780,7 +1780,8 @@ // functions to export to plugins fn = { - geom : geom, + geometry : geom, + FULL_AREA : FULL_AREA, parseQueryString : parseQueryString, getScalerUrl : getScalerUrl, getParamString : getParamString, @@ -1789,6 +1790,7 @@ packParams : packParams, redisplay : redisplay, updateDisplay : updateDisplay, + showDiv : showDiv, getImgTrafo : getImgTrafo, getQuality : getQuality, setQuality : setQuality,