comparison client/digitallibrary/jquery/jquery.digilib.geometry.js @ 786:912519475259 jquery

documentation for new plugin api in jquery-digilib-plugin.txt. more steps towards plugification of birdseye view.
author robcast
date Fri, 18 Feb 2011 15:16:30 +0100
parents 29de7131a5a8
children ac1d6b056a6f
comparison
equal deleted inserted replaced
784:966d5c938b4c 786:912519475259
473 }; 473 };
474 return transform(traf); 474 return transform(traf);
475 }; 475 };
476 476
477 // export constructor functions to digilib plugin 477 // export constructor functions to digilib plugin
478 var init = function () { 478 var geometry = {
479 return {
480 size : size, 479 size : size,
481 position : position, 480 position : position,
482 rectangle : rectangle, 481 rectangle : rectangle,
483 transform : transform 482 transform : transform
484 }; 483 };
485 }; 484 // install function called by digilib on plugin object
485 var install = function() {
486 // add constructor object to fn
487 this.fn.geometry = geometry;
488 };
489 // digilib plugin object
490 var plugin = {
491 name : 'geometry',
492 install : install,
493 fn : {},
494 // TODO: remove old init
495 init : init
496 };
497 // TODO: remove old version of init returning contructor
498 var init = function () {
499 return geometry;
500 };
501 // plug into digilib
486 if ($.fn.digilib == null) { 502 if ($.fn.digilib == null) {
487 $.error("jquery.digilib.geometry must be loaded after jquery.digilib!"); 503 $.error("jquery.digilib.geometry must be loaded after jquery.digilib!");
488 } else { 504 } else {
489 $.fn.digilib('plugin', {name : 'geometry', init : init}); 505 $.fn.digilib('plugin', plugin);
490 } 506 }
491 })(jQuery); 507 })(jQuery);