Mercurial > hg > OKFNAnnotator
diff annotator_files/lib/plugin/kitchensink.js @ 4:6979313586cf
new version of annotator.
author | casties |
---|---|
date | Mon, 27 Aug 2012 19:05:38 +0200 |
parents | 6356e78ccf5c |
children |
line wrap: on
line diff
--- a/annotator_files/lib/plugin/kitchensink.js Thu Apr 05 19:37:27 2012 +0200 +++ b/annotator_files/lib/plugin/kitchensink.js Mon Aug 27 19:05:38 2012 +0200 @@ -1,13 +1,20 @@ -var __hasProp = Object.prototype.hasOwnProperty, - __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; }; +// Generated by CoffeeScript 1.3.3 +var __hasProp = {}.hasOwnProperty, + __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; }; Annotator.prototype.setupPlugins = function(config, options) { var name, opts, pluginConfig, plugins, uri, win, _i, _len, _results; - if (config == null) config = {}; - if (options == null) options = {}; + if (config == null) { + config = {}; + } + if (options == null) { + options = {}; + } win = util.getGlobal(); - plugins = ['Unsupported', 'Auth', 'Tags', 'Filter', 'Store', 'Permissions']; - if (win.Showdown) plugins.push('Markdown'); + plugins = ['Unsupported', 'Auth', 'Tags', 'Filter', 'Store', 'AnnotateItPermissions']; + if (win.Showdown) { + plugins.push('Markdown'); + } uri = win.location.href.split(/#|\?/).shift() || ''; pluginConfig = { Tags: {}, @@ -38,7 +45,9 @@ for (name in options) { if (!__hasProp.call(options, name)) continue; opts = options[name]; - if (__indexOf.call(plugins, name) < 0) plugins.push(name); + if (__indexOf.call(plugins, name) < 0) { + plugins.push(name); + } } $.extend(true, pluginConfig, options); _results = [];