comparison annotator_files/lib/plugin/markdown.js @ 4:6979313586cf

new version of annotator.
author casties
date Mon, 27 Aug 2012 19:05:38 +0200
parents 6356e78ccf5c
children
comparison
equal deleted inserted replaced
3:6356e78ccf5c 4:6979313586cf
1 // Generated by CoffeeScript 1.3.3
1 var __bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; }, 2 var __bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; },
2 __hasProp = Object.prototype.hasOwnProperty, 3 __hasProp = {}.hasOwnProperty,
3 __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor; child.__super__ = parent.prototype; return child; }; 4 __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; };
4 5
5 Annotator.Plugin.Markdown = (function(_super) { 6 Annotator.Plugin.Markdown = (function(_super) {
6 7
7 __extends(Markdown, _super); 8 __extends(Markdown, _super);
8 9
9 Markdown.prototype.events = { 10 Markdown.prototype.events = {
10 'annotationViewerTextField': 'updateTextField' 11 'annotationViewerTextField': 'updateTextField'
11 }; 12 };
12 13
13 function Markdown(element, options) { 14 function Markdown(element, options) {
14 this.updateTextField = __bind(this.updateTextField, this); if ((typeof Showdown !== "undefined" && Showdown !== null ? Showdown.converter : void 0) != null) { 15 this.updateTextField = __bind(this.updateTextField, this);
16 if ((typeof Showdown !== "undefined" && Showdown !== null ? Showdown.converter : void 0) != null) {
15 Markdown.__super__.constructor.apply(this, arguments); 17 Markdown.__super__.constructor.apply(this, arguments);
16 this.converter = new Showdown.converter(); 18 this.converter = new Showdown.converter();
17 } else { 19 } else {
18 console.error(Annotator._t("To use the Markdown plugin, you must include Showdown into the page first.")); 20 console.error(Annotator._t("To use the Markdown plugin, you must include Showdown into the page first."));
19 } 21 }