Skip to content

Commit

Permalink
set up grunt
Browse files Browse the repository at this point in the history
  • Loading branch information
jhchen committed Nov 10, 2012
1 parent 619dcef commit 658c7dc
Show file tree
Hide file tree
Showing 12 changed files with 33 additions and 36 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
bin/
build/
.DS_Store
lib/jetsync.js
node_modules/
32 changes: 32 additions & 0 deletions grunt.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
/*global module:false*/
module.exports = function(grunt) {

// Project configuration.
grunt.initConfig({
meta: {
version: '0.1.0',
banner: '/*! PROJECT_NAME - v<%= meta.version %> - ' +
'<%= grunt.template.today("yyyy-mm-dd") %>\n' +
'* http://PROJECT_WEBSITE/\n' +
'* Copyright (c) <%= grunt.template.today("yyyy") %> ' +
'YOUR_NAME; Licensed MIT */'
},
concat: {
dist: {
src: ['<banner:meta.banner>', 'bin/src/*.js'],
dest: 'build/tandem.js'
}
},
min: {
dist: {
src: ['<banner:meta.banner>', '<config:concat.dist.dest>'],
dest: 'build/tandem.min.js'
}
},
uglify: {}
});

// Default task.
grunt.registerTask('default', 'concat min');

};
2 changes: 0 additions & 2 deletions src/constants.coffee
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#= require underscore

# Arrays must be alphabetized, so we can use binary search

TandemConstants =
Expand Down
5 changes: 0 additions & 5 deletions src/document.coffee
Original file line number Diff line number Diff line change
@@ -1,8 +1,3 @@
#= require underscore
#= require linked_list
#= require tandem/line


class TandemDocument
@INDENT_PREFIX: 'indent-'

Expand Down
3 changes: 0 additions & 3 deletions src/leaf.coffee
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
#= require underscore
#= require linked_list

class TandemLeaf extends LinkedList.Node
@ID_PREFIX: 'leaf-'
@TAB_NODE_CLASS: 'tab'
Expand Down
6 changes: 0 additions & 6 deletions src/line.coffee
Original file line number Diff line number Diff line change
@@ -1,9 +1,3 @@
#= require underscore
#= require linked_list
#= require tandem/constants
#= require tandem/leaf
#= require tandem/utils

class TandemLine extends LinkedList.Node
@CLASS_NAME : 'line'
@DIRTY_CLASS: 'dirty'
Expand Down
3 changes: 0 additions & 3 deletions src/position.coffee
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
#= require underscore
#= require tandem/line

# TODO fix this entire file, esp findDeepestNode
class TandemPosition
@findDeepestNode: (editor, node, offset) ->
Expand Down
5 changes: 0 additions & 5 deletions src/range.coffee
Original file line number Diff line number Diff line change
@@ -1,8 +1,3 @@
#= underscore
#= require rangy/rangy-core
#= require rangy/rangy-selectionsaverestore
#= require tandem/position

rangy.init() # getRangy

class TandemRange
Expand Down
2 changes: 0 additions & 2 deletions src/renderer.coffee
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#= require underscore

class TandemRenderer
@DEFAULTS:
keepHTML: false
Expand Down
5 changes: 0 additions & 5 deletions src/selection.coffee
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
#= require underscore
#= require rangy/rangy-core
#= require tandem/range

class TandemSelection
@POLL_INTERVAL: 500

Expand Down Expand Up @@ -34,7 +30,6 @@ class TandemSelection
@editor.doc.root.removeEventListener('mousedown', debouncedUpdate)
)


getNative: ->
rangySel = rangy.getSelection(@editor.contentWindow)
return null unless rangySel.anchorNode? && rangySel.focusNode?
Expand Down
2 changes: 0 additions & 2 deletions src/toolbar.coffee
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#= require eventemitter2

class TandemToolbar extends EventEmitter2
constructor: (@editor) ->
@editor.on(Tandem.Editor.events.SELECTION_CHANGE, (selection) =>
Expand Down
3 changes: 0 additions & 3 deletions src/utils.coffee
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
#= underscore
#= tandem/constants

TandemUtils =
canModify: (node) ->
return !node.classList.contains(Tandem.Constants.SPECIAL_CLASSES.ATOMIC) && !node.classList.contains(Tandem.Constants.SPECIAL_CLASSES.EXTERNAL)
Expand Down

0 comments on commit 658c7dc

Please sign in to comment.