From 41f447a0dd503ac497c23f20d38462aa24cce365 Mon Sep 17 00:00:00 2001 From: iangilman Date: Wed, 4 Sep 2013 10:20:39 -0700 Subject: [PATCH] Updated Making OpenSeadragon Plugins (markdown) --- Making-OpenSeadragon-Plugins.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Making-OpenSeadragon-Plugins.md b/Making-OpenSeadragon-Plugins.md index 1e809d8..ff790fa 100644 --- a/Making-OpenSeadragon-Plugins.md +++ b/Making-OpenSeadragon-Plugins.md @@ -8,12 +8,13 @@ Tips: * 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() { ... }`. * Minimize your plugin's footprint: instead of adding a bunch of new methods, just add a single multi-purpose method. That way you're less likely to collide with other plugins, and it'll be easier for developers to keep track of what belongs to your plugin. * Use an "options" object in your method to keep things flexible. +* Perhaps we should have a convention that the plugin file be prefixed with `openseadragon-`, like `openseadragon-scalebar.js`. Example: ``` (function($) { - OpenSeadragon.myPlugin = function(options) { + $.myPlugin = function(options) { options = options || {}; if (options.foo) { ...