From 05b297b0525b8e70ffeeb03389c2f9e53311fba8 Mon Sep 17 00:00:00 2001 From: iangilman Date: Wed, 21 Aug 2013 09:40:37 -0700 Subject: [PATCH] Updated Making OpenSeadragon Plugins (markdown) --- Making-OpenSeadragon-Plugins.md | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Making-OpenSeadragon-Plugins.md b/Making-OpenSeadragon-Plugins.md index bd20da2..bf51dc0 100644 --- a/Making-OpenSeadragon-Plugins.md +++ b/Making-OpenSeadragon-Plugins.md @@ -1,3 +1,8 @@ We don't have a formal plugin architecture (though we're open to suggestions on that front). Basically you just create a new JS file that's intended to be loaded after openseadragon.js, and which patches OpenSeadragon in some way or another to enable your functionality. -Once you have created your plugin, link to it from https://github.com/openseadragon/site-build/issues/26 and we'll get it on the directory. \ No newline at end of file +Once you have created your plugin, link to it from https://github.com/openseadragon/site-build/issues/26 and we'll get it on the directory. + +Tips: + +* `OpenSeadragon` is the namespace for all OpenSeadragon properties, classes, and methods. Adding a new top level function could be as simple as `OpenSeadragon.myFunc = function() { ... }`. +* If you want to add methods to any of OpenSeadragon's classes, add it to the class's prototype, such as `OpenSeadragon.Viewer.prototype.myFunc = function() { ... }`. \ No newline at end of file