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 gutil = require('gulp-util');
var sass = require('gulp-ruby-sass');
var coffee = require('gulp-coffee');
var sourcemaps = require('gulp-sourcemaps');
var assetsPath = 'spirit/core/static/spirit/';
var cssPath = assetsPath + 'stylesheets/';
var jsPath = assetsPath + 'scripts/';
gulp.task('sass', function () {
return sass(cssPath + 'src/styles.scss')
.on('error', sass.logError)
.pipe(gulp.dest(cssPath));
return sass(cssPath + 'src/styles.scss')
.on('error', sass.logError)
.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": {
"coffee-script": "^1.10.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": {
"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.
@ -7,7 +6,7 @@
(function() {
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;
@ -41,8 +40,8 @@
};
function Bookmark(el, mark, options) {
this.sendCommentNumber = __bind(this.sendCommentNumber, this);
this.onWaypoint = __bind(this.onWaypoint, this);
this.sendCommentNumber = bind(this.sendCommentNumber, this);
this.onWaypoint = bind(this.onWaypoint, this);
this.el = $(el);
this.mark = mark;
this.options = $.extend({}, this.defaults, options);
@ -103,4 +102,4 @@
}).call(this);
//# sourceMappingURL=bookmark.map
//# sourceMappingURL=bookmark.js.map

View File

@ -1,4 +1,3 @@
// Generated by CoffeeScript 1.7.1
/*
Markdown editor
@ -7,7 +6,7 @@
(function() {
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;
@ -23,13 +22,13 @@
};
function Editor(el, options) {
this.togglePreview = __bind(this.togglePreview, this);
this.addImage = __bind(this.addImage, this);
this.addUrl = __bind(this.addUrl, this);
this.addList = __bind(this.addList, this);
this.addItalic = __bind(this.addItalic, this);
this.addBold = __bind(this.addBold, this);
this.wrapSelection = __bind(this.wrapSelection, this);
this.togglePreview = bind(this.togglePreview, this);
this.addImage = bind(this.addImage, this);
this.addUrl = bind(this.addUrl, this);
this.addList = bind(this.addList, this);
this.addItalic = bind(this.addItalic, this);
this.addBold = bind(this.addBold, this);
this.wrapSelection = bind(this.wrapSelection, this);
this.el = $(el);
this.options = $.extend({}, this.defaults, options);
this.setUp();
@ -107,4 +106,4 @@
}).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()
@ -7,7 +6,7 @@
(function() {
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;
@ -19,14 +18,14 @@
};
function EditorImageUpload(el, options) {
this.openFileDialog = __bind(this.openFileDialog, this);
this.textReplace = __bind(this.textReplace, this);
this.addStatusError = __bind(this.addStatusError, this);
this.addError = __bind(this.addError, this);
this.addImage = __bind(this.addImage, this);
this.buildFormData = __bind(this.buildFormData, this);
this.addPlaceholder = __bind(this.addPlaceholder, this);
this.sendFile = __bind(this.sendFile, this);
this.openFileDialog = bind(this.openFileDialog, this);
this.textReplace = bind(this.textReplace, this);
this.addStatusError = bind(this.addStatusError, this);
this.addError = bind(this.addError, this);
this.addImage = bind(this.addImage, this);
this.buildFormData = bind(this.buildFormData, this);
this.addPlaceholder = bind(this.addPlaceholder, this);
this.sendFile = bind(this.sendFile, this);
this.el = $(el);
this.options = $.extend({}, this.defaults, options);
this.inputFile = $("<input/>", {
@ -148,4 +147,4 @@
}).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
@ -17,4 +16,4 @@
}).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
@ -7,7 +6,7 @@
(function() {
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;
@ -19,10 +18,10 @@
};
function Like(el, options) {
this.apiError = __bind(this.apiError, this);
this.removeLike = __bind(this.removeLike, this);
this.addLike = __bind(this.addLike, this);
this.sendLike = __bind(this.sendLike, this);
this.apiError = bind(this.apiError, this);
this.removeLike = bind(this.removeLike, this);
this.addLike = bind(this.addLike, this);
this.sendLike = bind(this.sendLike, this);
this.el = $(el);
this.options = $.extend({}, this.defaults, options);
this.isSending = false;
@ -112,4 +111,4 @@
}).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
@ -6,7 +5,7 @@
(function() {
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;
@ -17,9 +16,9 @@
};
function MoveComment(el, options) {
this.moveComments = __bind(this.moveComments, this);
this.addCommentSelection = __bind(this.addCommentSelection, this);
this.showMoveComments = __bind(this.showMoveComments, this);
this.moveComments = bind(this.moveComments, this);
this.addCommentSelection = bind(this.addCommentSelection, this);
this.showMoveComments = bind(this.showMoveComments, this);
this.el = $(el);
this.options = $.extend({}, this.defaults, options);
this.setUp();
@ -105,4 +104,4 @@
}).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
@ -7,7 +6,7 @@
(function() {
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;
@ -23,11 +22,11 @@
};
function Notification(el, options) {
this.ajaxDone = __bind(this.ajaxDone, this);
this.addErrorTxt = __bind(this.addErrorTxt, this);
this.addIsEmptyTxt = __bind(this.addIsEmptyTxt, this);
this.addNotifications = __bind(this.addNotifications, this);
this.tabSwitch = __bind(this.tabSwitch, this);
this.ajaxDone = bind(this.ajaxDone, this);
this.addErrorTxt = bind(this.addErrorTxt, this);
this.addIsEmptyTxt = bind(this.addIsEmptyTxt, this);
this.addNotifications = bind(this.addNotifications, this);
this.tabSwitch = bind(this.tabSwitch, this);
this.el = $(el);
this.options = $.extend({}, this.defaults, options);
this.tabNotificationContent = $(this.el.data("related"));
@ -75,7 +74,7 @@
txt = _this.options.commentTxt;
}
if (!obj.is_read) {
txt = "" + txt + " " + unread;
txt = txt + " " + unread;
}
link = "<a href=\"" + obj.url + "\">" + obj.title + "</a>";
txt = $.format(txt, {
@ -126,4 +125,4 @@
}).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
@ -6,7 +5,7 @@
(function() {
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;
@ -16,7 +15,7 @@
};
function Postify(el, options) {
this.makePost = __bind(this.makePost, this);
this.makePost = bind(this.makePost, this);
this.el = $(el);
this.options = $.extend({}, this.defaults, options);
this.setUp();
@ -68,4 +67,4 @@
}).call(this);
//# sourceMappingURL=postify.map
//# sourceMappingURL=postify.js.map

View File

@ -1,4 +1,3 @@
// Generated by CoffeeScript 1.7.1
/*
Social share popup
@ -6,14 +5,14 @@
(function() {
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;
SocialShare = (function() {
function SocialShare(el) {
this.closeDialog = __bind(this.closeDialog, this);
this.showDialog = __bind(this.showDialog, this);
this.closeDialog = bind(this.closeDialog, this);
this.showDialog = bind(this.showDialog, this);
this.el = $(el);
this.dialog = $(this.el.data("dialog"));
this.setUp();
@ -67,4 +66,4 @@
}).call(this);
//# sourceMappingURL=social_share.map
//# sourceMappingURL=social_share.js.map

View File

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

View File

@ -1,4 +1,3 @@
// Generated by CoffeeScript 1.7.1
/*
Generic tabs
@ -6,17 +5,17 @@
(function() {
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;
Tab = (function() {
function Tab(el) {
this.showTabContent = __bind(this.showTabContent, this);
this.selectTab = __bind(this.selectTab, this);
this.unselectAllTabs = __bind(this.unselectAllTabs, this);
this.hideAllTabsContent = __bind(this.hideAllTabsContent, this);
this.tabSwitch = __bind(this.tabSwitch, this);
this.showTabContent = bind(this.showTabContent, this);
this.selectTab = bind(this.selectTab, this);
this.unselectAllTabs = bind(this.unselectAllTabs, this);
this.hideAllTabsContent = bind(this.hideAllTabsContent, this);
this.tabSwitch = bind(this.tabSwitch, this);
this.el = $(el);
this.setUp();
}
@ -84,4 +83,4 @@
}).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.
@ -22,4 +21,4 @@
}).call(this);
//# sourceMappingURL=util.map
//# sourceMappingURL=util.js.map