Skip to content

Commit

Permalink
Merge pull request #34 from zephod/master
Browse files Browse the repository at this point in the history
Minimising use of Showdown.js (from zephod).
  • Loading branch information
rufuspollock committed Oct 6, 2011
2 parents 6a83ad1 + b3f1869 commit 8a4fc98
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
3 changes: 2 additions & 1 deletion lib/model.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
var showdown = new Showdown.converter();
this.CKAN = this.CKAN || {};

// Global object that stores all CKAN models.
Expand Down Expand Up @@ -189,6 +188,8 @@ CKAN.Model = function ($, _, Backbone, undefined) {
var title = this.get('title');
out.displaytitle = title ? title : 'No title ...';
var notes = this.get('notes');
// Don't use a global Showdown; CKAN doesn't need that library
var showdown = new Showdown.converter();
out.notesHtml = showdown.makeHtml(notes ? notes : '');
out.snippet = this.makeSnippet(out.notesHtml);
return out;
Expand Down
1 change: 0 additions & 1 deletion lib/view.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ var CKAN = CKAN || {};

CKAN.View = function($) {
var my = {};
var showdown = new Showdown.converter();

// Flash a notification message
//
Expand Down
4 changes: 2 additions & 2 deletions pkg/ckanjs.js
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,6 @@ this.CKAN.Client = (function (CKAN, $, _, Backbone, undefined) {
return Client;

})(this.CKAN, this.$, this._, this.Backbone);
var showdown = new Showdown.converter();
this.CKAN = this.CKAN || {};

// Global object that stores all CKAN models.
Expand Down Expand Up @@ -399,6 +398,8 @@ CKAN.Model = function ($, _, Backbone, undefined) {
var title = this.get('title');
out.displaytitle = title ? title : 'No title ...';
var notes = this.get('notes');
// Don't use a global Showdown; CKAN doesn't need that library
var showdown = new Showdown.converter();
out.notesHtml = showdown.makeHtml(notes ? notes : '');
out.snippet = this.makeSnippet(out.notesHtml);
return out;
Expand Down Expand Up @@ -544,7 +545,6 @@ var CKAN = CKAN || {};

CKAN.View = function($) {
var my = {};
var showdown = new Showdown.converter();

// Flash a notification message
//
Expand Down

0 comments on commit 8a4fc98

Please sign in to comment.