comparison client/digitallibrary/jquery/jquery.digilib.birdseye.js @ 801:2fb1f576375d jquery

stub for new plugins; overlay div for regions plugin
author hertzhaft
date Sun, 20 Feb 2011 13:24:49 +0100
parents 52c5595af03e
children 5627e5f09848
comparison
equal deleted inserted replaced
800:ac1d6b056a6f 801:2fb1f576375d
43 } 43 }
44 }; 44 };
45 45
46 // plugin installation called by digilib on plugin object. 46 // plugin installation called by digilib on plugin object.
47 var install = function(digilib) { 47 var install = function(digilib) {
48 console.debug('installing birdseye plugin. digilib:', digilib);
48 // import geometry classes 49 // import geometry classes
49 geom = digilib.fn.geometry; 50 geom = digilib.fn.geometry;
50 FULL_AREA = geom.rectangle(0,0,1,1); 51 FULL_AREA = geom.rectangle(0,0,1,1);
51 // add defaults 52 // add defaults
52 $.extend(digilib.defaults, defaults); 53 $.extend(digilib.defaults, defaults);
59 digilib.defaults.buttonSettings.embedded.standardSet.splice(5, 0, 'bird'); 60 digilib.defaults.buttonSettings.embedded.standardSet.splice(5, 0, 'bird');
60 }; 61 };
61 62
62 // plugin initialization 63 // plugin initialization
63 var init = function (data) { 64 var init = function (data) {
65 console.debug('initialising birdseye plugin. data:', data);
64 var $data = $(data); 66 var $data = $(data);
65 // install event handler 67 // install event handler
66 $data.bind('setup', handleSetup); 68 $data.bind('setup', handleSetup);
67 $data.bind('update', handleUpdate); 69 $data.bind('update', handleUpdate);
68 $data.bind('redisplay', handleRedisplay); 70 $data.bind('redisplay', handleRedisplay);
303 birdRect.adjustDiv(data.$birdZoom); 305 birdRect.adjustDiv(data.$birdZoom);
304 }; 306 };
305 307
306 // plugin object with name and init 308 // plugin object with name and init
307 // shared objects filled by digilib on registration 309 // shared objects filled by digilib on registration
308 var digilib = { 310 var plugin = {
309 name : 'birdseye', 311 name : 'birdseye',
310 install : install, 312 install : install,
311 init : init, 313 init : init,
312 buttons : {}, 314 buttons : {},
313 actions : {}, 315 actions : {},
316 }; 318 };
317 319
318 if ($.fn.digilib == null) { 320 if ($.fn.digilib == null) {
319 $.error("jquery.digilib.birdview must be loaded after jquery.digilib!"); 321 $.error("jquery.digilib.birdview must be loaded after jquery.digilib!");
320 } else { 322 } else {
321 $.fn.digilib('plugin', digilib); 323 $.fn.digilib('plugin', plugin);
322 } 324 }
323 })(jQuery); 325 })(jQuery);