Changeset 4:6979313586cf in OKFNAnnotator (for Zope) for annotator_files/lib/plugin/kitchensink.js
- Timestamp:
- Aug 27, 2012, 5:05:38 PM (12 years ago)
- Branch:
- default
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
annotator_files/lib/plugin/kitchensink.js
r3 r4 1 var __hasProp = Object.prototype.hasOwnProperty, 2 __indexOf = Array.prototype.indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; }; 1 // Generated by CoffeeScript 1.3.3 2 var __hasProp = {}.hasOwnProperty, 3 __indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; }; 3 4 4 5 Annotator.prototype.setupPlugins = function(config, options) { 5 6 var name, opts, pluginConfig, plugins, uri, win, _i, _len, _results; 6 if (config == null) config = {}; 7 if (options == null) options = {}; 7 if (config == null) { 8 config = {}; 9 } 10 if (options == null) { 11 options = {}; 12 } 8 13 win = util.getGlobal(); 9 plugins = ['Unsupported', 'Auth', 'Tags', 'Filter', 'Store', 'Permissions']; 10 if (win.Showdown) plugins.push('Markdown'); 14 plugins = ['Unsupported', 'Auth', 'Tags', 'Filter', 'Store', 'AnnotateItPermissions']; 15 if (win.Showdown) { 16 plugins.push('Markdown'); 17 } 11 18 uri = win.location.href.split(/#|\?/).shift() || ''; 12 19 pluginConfig = { … … 39 46 if (!__hasProp.call(options, name)) continue; 40 47 opts = options[name]; 41 if (__indexOf.call(plugins, name) < 0) plugins.push(name); 48 if (__indexOf.call(plugins, name) < 0) { 49 plugins.push(name); 50 } 42 51 } 43 52 $.extend(true, pluginConfig, options);
Note: See TracChangeset
for help on using the changeset viewer.