Advertisement
keysle

Unobtrusive Object Oriented JavaScript Plugin Startup Templa

Oct 22nd, 2012
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.11 KB | None | 0 0
  1. (function(){options = (function(){function options(){var Plugin, options;
  2. ///////////////////////////////////////////////////////////////////////////////////////////////////////// START: Options
  3. this.ns = 'unique';
  4. this.pluginPropery = 'custom value';
  5. ///////////////////////////////////////////////////////////////////////////////////////////////////////// END: Options
  6. }return options;})();Plugin = (function(){function Plugin(options){this.options = options;
  7. ///////////////////////////////////////////////////////////////////////////////////////////////////////// START: MEAT
  8. this.other_initial_variables = 'initial variable';
  9. this.initializing_function();
  10. }
  11.  
  12. Plugin.prototype.initializing_function = function(){
  13. /* your plugin's unqiue stuff */
  14. };
  15. ///////////////////////////////////////////////////////////////////////////////////////////////////////// END: MEAT
  16. return Plugin;})();function initiate(){var plugin;return plugin = new Plugin(new options);}if(window.addEventListener){window.addEventListener('load',initiate,false);}else{window.attachEvent('onload',initiate);}}).call(this);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement