Changeset 4:6979313586cf in OKFNAnnotator (for Zope) for annotator_files/lib/plugin/kitchensink.js


Ignore:
Timestamp:
Aug 27, 2012, 5:05:38 PM (12 years ago)
Author:
casties
Branch:
default
Message:

new version of annotator.

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
     2var __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; };
    34
    45Annotator.prototype.setupPlugins = function(config, options) {
    56  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  }
    813  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  }
    1118  uri = win.location.href.split(/#|\?/).shift() || '';
    1219  pluginConfig = {
     
    3946    if (!__hasProp.call(options, name)) continue;
    4047    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    }
    4251  }
    4352  $.extend(true, pluginConfig, options);
Note: See TracChangeset for help on using the changeset viewer.