gulp coffescript

This commit is contained in:
nitely 2015-10-04 22:53:13 -03:00
parent 078b43172d
commit 10a3d407a1
14 changed files with 87 additions and 82 deletions

View File

@ -1,12 +1,25 @@
var gulp = require('gulp'); var gulp = require('gulp');
var gutil = require('gulp-util');
var sass = require('gulp-ruby-sass'); var sass = require('gulp-ruby-sass');
var coffee = require('gulp-coffee');
var sourcemaps = require('gulp-sourcemaps');
var assetsPath = 'spirit/core/static/spirit/'; var assetsPath = 'spirit/core/static/spirit/';
var cssPath = assetsPath + 'stylesheets/'; var cssPath = assetsPath + 'stylesheets/';
var jsPath = assetsPath + 'scripts/';
gulp.task('sass', function () { gulp.task('sass', function () {
return sass(cssPath + 'src/styles.scss') return sass(cssPath + 'src/styles.scss')
.on('error', sass.logError) .on('error', sass.logError)
.pipe(gulp.dest(cssPath)); .pipe(gulp.dest(cssPath));
});
gulp.task('coffee', function() {
gulp.src(jsPath + '*.coffee')
.pipe(sourcemaps.init())
.pipe(coffee({bare: false}).on('error', gutil.log))
.pipe(sourcemaps.write('.'))
.pipe(gulp.dest(jsPath))
}); });

View File

@ -1,7 +1,11 @@
{ {
"devDependencies": { "devDependencies": {
"coffee-script": "^1.10.0",
"gulp": "^3.9.0", "gulp": "^3.9.0",
"gulp-ruby-sass": "^1.4.0" "gulp-coffee": "^2.3.1",
"gulp-ruby-sass": "^1.4.0",
"gulp-sourcemaps": "^1.6.0",
"gulp-util": "^3.0.6"
}, },
"scripts": { "scripts": {
"gulp": "gulp" "gulp": "gulp"

View File

@ -1,4 +1,3 @@
// Generated by CoffeeScript 1.7.1
/* /*
A library to tell the server how far you have scrolled down. A library to tell the server how far you have scrolled down.
@ -7,7 +6,7 @@
(function() { (function() {
var $, Bookmark, Mark, var $, Bookmark, Mark,
__bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; }; bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; };
$ = jQuery; $ = jQuery;
@ -41,8 +40,8 @@
}; };
function Bookmark(el, mark, options) { function Bookmark(el, mark, options) {
this.sendCommentNumber = __bind(this.sendCommentNumber, this); this.sendCommentNumber = bind(this.sendCommentNumber, this);
this.onWaypoint = __bind(this.onWaypoint, this); this.onWaypoint = bind(this.onWaypoint, this);
this.el = $(el); this.el = $(el);
this.mark = mark; this.mark = mark;
this.options = $.extend({}, this.defaults, options); this.options = $.extend({}, this.defaults, options);
@ -103,4 +102,4 @@
}).call(this); }).call(this);
//# sourceMappingURL=bookmark.map //# sourceMappingURL=bookmark.js.map

View File

@ -1,4 +1,3 @@
// Generated by CoffeeScript 1.7.1
/* /*
Markdown editor Markdown editor
@ -7,7 +6,7 @@
(function() { (function() {
var $, Editor, var $, Editor,
__bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; }; bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; };
$ = jQuery; $ = jQuery;
@ -23,13 +22,13 @@
}; };
function Editor(el, options) { function Editor(el, options) {
this.togglePreview = __bind(this.togglePreview, this); this.togglePreview = bind(this.togglePreview, this);
this.addImage = __bind(this.addImage, this); this.addImage = bind(this.addImage, this);
this.addUrl = __bind(this.addUrl, this); this.addUrl = bind(this.addUrl, this);
this.addList = __bind(this.addList, this); this.addList = bind(this.addList, this);
this.addItalic = __bind(this.addItalic, this); this.addItalic = bind(this.addItalic, this);
this.addBold = __bind(this.addBold, this); this.addBold = bind(this.addBold, this);
this.wrapSelection = __bind(this.wrapSelection, this); this.wrapSelection = bind(this.wrapSelection, this);
this.el = $(el); this.el = $(el);
this.options = $.extend({}, this.defaults, options); this.options = $.extend({}, this.defaults, options);
this.setUp(); this.setUp();
@ -107,4 +106,4 @@
}).call(this); }).call(this);
//# sourceMappingURL=editor.map //# sourceMappingURL=editor.js.map

View File

@ -1,4 +1,3 @@
// Generated by CoffeeScript 1.7.1
/* /*
Markdown editor image upload, should be loaded before $.editor() Markdown editor image upload, should be loaded before $.editor()
@ -7,7 +6,7 @@
(function() { (function() {
var $, EditorImageUpload, var $, EditorImageUpload,
__bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; }; bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; };
$ = jQuery; $ = jQuery;
@ -19,14 +18,14 @@
}; };
function EditorImageUpload(el, options) { function EditorImageUpload(el, options) {
this.openFileDialog = __bind(this.openFileDialog, this); this.openFileDialog = bind(this.openFileDialog, this);
this.textReplace = __bind(this.textReplace, this); this.textReplace = bind(this.textReplace, this);
this.addStatusError = __bind(this.addStatusError, this); this.addStatusError = bind(this.addStatusError, this);
this.addError = __bind(this.addError, this); this.addError = bind(this.addError, this);
this.addImage = __bind(this.addImage, this); this.addImage = bind(this.addImage, this);
this.buildFormData = __bind(this.buildFormData, this); this.buildFormData = bind(this.buildFormData, this);
this.addPlaceholder = __bind(this.addPlaceholder, this); this.addPlaceholder = bind(this.addPlaceholder, this);
this.sendFile = __bind(this.sendFile, this); this.sendFile = bind(this.sendFile, this);
this.el = $(el); this.el = $(el);
this.options = $.extend({}, this.defaults, options); this.options = $.extend({}, this.defaults, options);
this.inputFile = $("<input/>", { this.inputFile = $("<input/>", {
@ -148,4 +147,4 @@
}).call(this); }).call(this);
//# sourceMappingURL=editor_image_upload.map //# sourceMappingURL=editor_image_upload.js.map

View File

@ -1,4 +1,3 @@
// Generated by CoffeeScript 1.7.1
/* /*
Emoji list Emoji list
@ -17,4 +16,4 @@
}).call(this); }).call(this);
//# sourceMappingURL=emoji_list.map //# sourceMappingURL=emoji_list.js.map

View File

@ -1,4 +1,3 @@
// Generated by CoffeeScript 1.7.1
/* /*
Post likes via Ajax Post likes via Ajax
@ -7,7 +6,7 @@
(function() { (function() {
var $, Like, var $, Like,
__bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; }; bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; };
$ = jQuery; $ = jQuery;
@ -19,10 +18,10 @@
}; };
function Like(el, options) { function Like(el, options) {
this.apiError = __bind(this.apiError, this); this.apiError = bind(this.apiError, this);
this.removeLike = __bind(this.removeLike, this); this.removeLike = bind(this.removeLike, this);
this.addLike = __bind(this.addLike, this); this.addLike = bind(this.addLike, this);
this.sendLike = __bind(this.sendLike, this); this.sendLike = bind(this.sendLike, this);
this.el = $(el); this.el = $(el);
this.options = $.extend({}, this.defaults, options); this.options = $.extend({}, this.defaults, options);
this.isSending = false; this.isSending = false;
@ -112,4 +111,4 @@
}).call(this); }).call(this);
//# sourceMappingURL=like.map //# sourceMappingURL=like.js.map

View File

@ -1,4 +1,3 @@
// Generated by CoffeeScript 1.7.1
/* /*
Move comments to other topic Move comments to other topic
@ -6,7 +5,7 @@
(function() { (function() {
var $, MoveComment, var $, MoveComment,
__bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; }; bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; };
$ = jQuery; $ = jQuery;
@ -17,9 +16,9 @@
}; };
function MoveComment(el, options) { function MoveComment(el, options) {
this.moveComments = __bind(this.moveComments, this); this.moveComments = bind(this.moveComments, this);
this.addCommentSelection = __bind(this.addCommentSelection, this); this.addCommentSelection = bind(this.addCommentSelection, this);
this.showMoveComments = __bind(this.showMoveComments, this); this.showMoveComments = bind(this.showMoveComments, this);
this.el = $(el); this.el = $(el);
this.options = $.extend({}, this.defaults, options); this.options = $.extend({}, this.defaults, options);
this.setUp(); this.setUp();
@ -105,4 +104,4 @@
}).call(this); }).call(this);
//# sourceMappingURL=move_comments.map //# sourceMappingURL=move_comments.js.map

View File

@ -1,4 +1,3 @@
// Generated by CoffeeScript 1.7.1
/* /*
Notifications ajax tab Notifications ajax tab
@ -7,7 +6,7 @@
(function() { (function() {
var $, Notification, var $, Notification,
__bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; }; bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; };
$ = jQuery; $ = jQuery;
@ -23,11 +22,11 @@
}; };
function Notification(el, options) { function Notification(el, options) {
this.ajaxDone = __bind(this.ajaxDone, this); this.ajaxDone = bind(this.ajaxDone, this);
this.addErrorTxt = __bind(this.addErrorTxt, this); this.addErrorTxt = bind(this.addErrorTxt, this);
this.addIsEmptyTxt = __bind(this.addIsEmptyTxt, this); this.addIsEmptyTxt = bind(this.addIsEmptyTxt, this);
this.addNotifications = __bind(this.addNotifications, this); this.addNotifications = bind(this.addNotifications, this);
this.tabSwitch = __bind(this.tabSwitch, this); this.tabSwitch = bind(this.tabSwitch, this);
this.el = $(el); this.el = $(el);
this.options = $.extend({}, this.defaults, options); this.options = $.extend({}, this.defaults, options);
this.tabNotificationContent = $(this.el.data("related")); this.tabNotificationContent = $(this.el.data("related"));
@ -75,7 +74,7 @@
txt = _this.options.commentTxt; txt = _this.options.commentTxt;
} }
if (!obj.is_read) { if (!obj.is_read) {
txt = "" + txt + " " + unread; txt = txt + " " + unread;
} }
link = "<a href=\"" + obj.url + "\">" + obj.title + "</a>"; link = "<a href=\"" + obj.url + "\">" + obj.title + "</a>";
txt = $.format(txt, { txt = $.format(txt, {
@ -126,4 +125,4 @@
}).call(this); }).call(this);
//# sourceMappingURL=notification.map //# sourceMappingURL=notification.js.map

View File

@ -1,4 +1,3 @@
// Generated by CoffeeScript 1.7.1
/* /*
Make post on anchor click Make post on anchor click
@ -6,7 +5,7 @@
(function() { (function() {
var $, Postify, var $, Postify,
__bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; }; bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; };
$ = jQuery; $ = jQuery;
@ -16,7 +15,7 @@
}; };
function Postify(el, options) { function Postify(el, options) {
this.makePost = __bind(this.makePost, this); this.makePost = bind(this.makePost, this);
this.el = $(el); this.el = $(el);
this.options = $.extend({}, this.defaults, options); this.options = $.extend({}, this.defaults, options);
this.setUp(); this.setUp();
@ -68,4 +67,4 @@
}).call(this); }).call(this);
//# sourceMappingURL=postify.map //# sourceMappingURL=postify.js.map

View File

@ -1,4 +1,3 @@
// Generated by CoffeeScript 1.7.1
/* /*
Social share popup Social share popup
@ -6,14 +5,14 @@
(function() { (function() {
var $, SocialShare, var $, SocialShare,
__bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; }; bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; };
$ = jQuery; $ = jQuery;
SocialShare = (function() { SocialShare = (function() {
function SocialShare(el) { function SocialShare(el) {
this.closeDialog = __bind(this.closeDialog, this); this.closeDialog = bind(this.closeDialog, this);
this.showDialog = __bind(this.showDialog, this); this.showDialog = bind(this.showDialog, this);
this.el = $(el); this.el = $(el);
this.dialog = $(this.el.data("dialog")); this.dialog = $(this.el.data("dialog"));
this.setUp(); this.setUp();
@ -67,4 +66,4 @@
}).call(this); }).call(this);
//# sourceMappingURL=social_share.map //# sourceMappingURL=social_share.js.map

View File

@ -1,15 +1,14 @@
// Generated by CoffeeScript 1.7.1
(function() { (function() {
var $, Storage, var $, Storage,
__bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; }; bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; };
$ = jQuery; $ = jQuery;
Storage = (function() { Storage = (function() {
function Storage(el, lsKey) { function Storage(el, lsKey) {
this.clearStorage = __bind(this.clearStorage, this); this.clearStorage = bind(this.clearStorage, this);
this.updateField = __bind(this.updateField, this); this.updateField = bind(this.updateField, this);
this.updateStorage = __bind(this.updateStorage, this); this.updateStorage = bind(this.updateStorage, this);
this.el = $(el); this.el = $(el);
this.lsKey = lsKey; this.lsKey = lsKey;
this.setUp(); this.setUp();
@ -36,12 +35,12 @@
}; };
Storage.prototype.updateStorage = function() { Storage.prototype.updateStorage = function() {
var err, value; var err, error, value;
value = this.el.val(); value = this.el.val();
try { try {
localStorage[this.lsKey] = value; localStorage[this.lsKey] = value;
} catch (_error) { } catch (error) {
err = _error; err = error;
localStorage.clear(); localStorage.clear();
} }
}; };
@ -72,4 +71,4 @@
}).call(this); }).call(this);
//# sourceMappingURL=store.map //# sourceMappingURL=store.js.map

View File

@ -1,4 +1,3 @@
// Generated by CoffeeScript 1.7.1
/* /*
Generic tabs Generic tabs
@ -6,17 +5,17 @@
(function() { (function() {
var $, Tab, var $, Tab,
__bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; }; bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; };
$ = jQuery; $ = jQuery;
Tab = (function() { Tab = (function() {
function Tab(el) { function Tab(el) {
this.showTabContent = __bind(this.showTabContent, this); this.showTabContent = bind(this.showTabContent, this);
this.selectTab = __bind(this.selectTab, this); this.selectTab = bind(this.selectTab, this);
this.unselectAllTabs = __bind(this.unselectAllTabs, this); this.unselectAllTabs = bind(this.unselectAllTabs, this);
this.hideAllTabsContent = __bind(this.hideAllTabsContent, this); this.hideAllTabsContent = bind(this.hideAllTabsContent, this);
this.tabSwitch = __bind(this.tabSwitch, this); this.tabSwitch = bind(this.tabSwitch, this);
this.el = $(el); this.el = $(el);
this.setUp(); this.setUp();
} }
@ -84,4 +83,4 @@
}).call(this); }).call(this);
//# sourceMappingURL=tab.map //# sourceMappingURL=tab.js.map

View File

@ -1,4 +1,3 @@
// Generated by CoffeeScript 1.7.1
/* /*
A bunch of generic functions, this are used by other plugins. A bunch of generic functions, this are used by other plugins.
@ -22,4 +21,4 @@
}).call(this); }).call(this);
//# sourceMappingURL=util.map //# sourceMappingURL=util.js.map