Skip to content

Commit

Permalink
Added jquery include
Browse files Browse the repository at this point in the history
  • Loading branch information
jdan committed Aug 25, 2013
1 parent 10c8488 commit 13263c9
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 6 deletions.
13 changes: 9 additions & 4 deletions lib/cleaver.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,9 @@ function Cleaver(options) {
if (!options.file) throw "!! Please specify a file with the --file option";

// filenames which will be used to read in data
this.stylesheetFile = Cleaver.ROOT_DIR + '/styles/default.css';
this.templateFile = Cleaver.ROOT_DIR + '/templates/layout.mustache';
this.stylesheetFile = Cleaver.ROOT_DIR + 'styles/default.css';
this.templateFile = Cleaver.ROOT_DIR + 'templates/layout.mustache';
this.jqueryFile = Cleaver.ROOT_DIR + 'resources/jquery.min.js';

// user-specified files
this.documentFile = options.file;
Expand All @@ -20,6 +21,7 @@ function Cleaver(options) {
this.slides = [];
this.stylesheets = [];
this.template = null;
this.jquery = null;
}

Cleaver.ROOT_DIR = path.normalize(__dirname + '/../');
Expand Down Expand Up @@ -48,6 +50,7 @@ Cleaver.prototype._parseDocument = function () {
Cleaver.prototype._loadAssets = function () {
var promises = [
this._loadSingleAsset(this.templateFile),
this._loadSingleAsset(this.jqueryFile),
this._loadSingleAsset(this.stylesheetFile)
];

Expand All @@ -59,8 +62,9 @@ Cleaver.prototype._loadAssets = function () {
return Q.all(promises)
.then(function (data) {
self.template = data[0];
self.jquery = data[1];

for (var i = 1; i < data.length; i++) {
for (var i = 2; i < data.length; i++) {
self.stylesheets.push(data[i]);
}
})
Expand Down Expand Up @@ -100,7 +104,8 @@ Cleaver.prototype._renderSlideshow = function () {
slides: this.slides,
title: 'Hello, world',
controls: true,
styles: this.stylesheets
styles: this.stylesheets,
jquery: this.jquery
}

console.log(mustache.render(this.template, slideData));
Expand Down
Loading

0 comments on commit 13263c9

Please sign in to comment.