Skip to content

Commit 8328d69

Browse files
committed
Merge branch 'develop' into testing
Conflicts: Gruntfile.js src/drawing.js tests/core.html tests/stage.html
2 parents dfc6008 + 56b3f0f commit 8328d69

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

58 files changed

+3698
-3022
lines changed

CONTRIBUTING.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# How to contribute
2+
3+
Hi, thanks for contributing to Crafty! We've got guidlines on
4+
5+
- [How to build Crafty](https://github.com/craftyjs/Crafty/wiki/Building)
6+
- [What workflow to use](https://github.com/craftyjs/Crafty/wiki/Workflow)
7+
8+
## Quick summary
9+
10+
- You'll need node, npm, and grunt-cli (installed globally) to work with Crafty's dev tools
11+
- With those already installed, `npm install` from Crafty's directory will setup everything else you need
12+
- Once you've made any changes, then `grunt check` will build and test your new version of Crafty.

Gruntfile.js

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -76,51 +76,52 @@ module.exports = function (grunt) {
7676
},
7777

7878
jshint: {
79-
files: ['Gruntfile.js', 'src/**/*.js'],
79+
files: ['Gruntfile.js', 'src/**/*.js', 'tests/*.js'],
8080
options: {
81+
trailing: true,
8182
globals: {
8283
}
8384
}
8485
},
8586

8687
qunit: {
8788
all: [
88-
'tests/core.html',
89-
'tests/animation/animation.html',
90-
'tests/stage.html',
91-
'tests/events.html',
92-
'tests/math.html',
93-
'tests/isometric.html',
94-
'tests/loader.html',
95-
'tests/text.html',
96-
'tests/dom.html',
97-
'tests/tween.html',
98-
'tests/sound.html'
89+
'tests/index.html',
90+
'tests/animation/animation.html'
9991
]
100-
},
92+
},
10193

10294
jsvalidate: {
103-
files: "crafty.js"
95+
files: ['crafty.js', 'tests/*.js']
10496
},
10597

98+
connect: {
99+
server: {
100+
options: {
101+
keepalive: true
102+
}
103+
}
104+
}
105+
106106
});
107107

108108
// Load the plugin that provides the "uglify" task.
109109
grunt.loadNpmTasks('grunt-contrib-uglify');
110110
grunt.loadNpmTasks('grunt-contrib-jshint');
111111
grunt.loadNpmTasks('grunt-contrib-qunit');
112112
grunt.loadNpmTasks('grunt-contrib-watch');
113+
grunt.loadNpmTasks('grunt-contrib-connect');
113114
grunt.loadNpmTasks('grunt-jsvalidate');
114115
grunt.loadNpmTasks('grunt-browserify');
115116
grunt.loadNpmTasks('grunt-banner');
116117

117118
grunt.registerTask('version', 'Takes the version into src/version.js', function() {
118119
fs.writeFileSync('src/version.js', 'module.exports = "' + version + '";');
119120
});
120-
121+
121122
// Build development
122123
grunt.registerTask('build:dev', ['browserify:debug', 'usebanner']);
123-
124+
124125
// Build release
125126
grunt.registerTask('build:release', ['browserify:dist', 'usebanner']);
126127

@@ -139,5 +140,4 @@ module.exports = function (grunt) {
139140
// Run only tests
140141
grunt.registerTask('validate', ['qunit']);
141142

142-
143143
};

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ Crafty.e("RightPoints, DOM, 2D, Text")
7272
##Developing
7373

7474
If you want to fix a bug, please submit a pull request against the development branch. Some guides to help you can be found [on the wiki](https://github.com/craftyjs/Crafty/wiki)
75-
75+
7676
If you would like to make larger contributions please catch us in the [forum](https://groups.google.com/forum/?fromgroups#!forum/craftyjs) and we will help you get started. Much appreciated :-)
7777

7878

build/api-gen.coffee

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ processBlock = (block)->
3838
if not Table.comps[block.comp]
3939
Table.comps[block.name] = {name:block.name, parts:[]}
4040
Table.comps[block.name].block = block
41-
41+
4242
# Having a component tag means it's part of a component page
4343
if block.comp
4444
if not Table.comps[block.comp]
@@ -123,10 +123,10 @@ class DocBlock
123123
else
124124
return false
125125

126-
# Method for returning the documentation for this block
126+
# Method for returning the documentation for this block
127127
getContent: ()->
128128
if @isFunctionTag(@prevTag) then @code.push("</dl>")
129-
return @code.join("\n") + triggerBlock(@triggers) + seeBlock(@see)
129+
return @code.join("\n") + triggerBlock(@triggers) + seeBlock(@see)
130130

131131
# parse js file
132132
parseJS = (path) ->
@@ -140,7 +140,7 @@ parseJS = (path) ->
140140
block = new DocBlock()
141141
block.file = path
142142
block.line = ln
143-
open = true
143+
open = true
144144
# process
145145
if open
146146
block.processLine(line)
@@ -153,18 +153,18 @@ parseJS = (path) ->
153153
if block.categories.length is 0 and block.comp is null
154154
console.log("No component or category for block at #{block.file}:#{block.line+1} (#{block.name})")
155155
data.push block
156-
156+
157157

158158
cleanName = (name) -> name.replace(".", "-")
159159

160160
triggerBlock = (triggers, noheader)->
161-
return '' if triggers?.length is 0
162-
if noheader then block = "<dl>" else block = "\n<h4>Events</h4>\n<dl>"
161+
return '' if triggers?.length is 0
162+
if noheader then block = "<dl>" else block = "\n<h4>Events</h4>\n<dl>"
163163
for t in triggers
164164
if t.objProp?
165-
block+= "<dt><span class='event-name'>#{t.event}</span> [<span class='event-property-name'>#{t.objName}</span>: <span class='event-property'>#{t.objProp}</span>]</dt><dd>#{t.description}</dd>\n"
165+
block+= "<dt><span class='event-name'>#{t.event}</span> [<span class='event-property-name'>#{t.objName}</span>: <span class='event-property'>#{t.objProp}</span>]</dt><dd>#{t.description}</dd>\n"
166166
else
167-
block+= "<dt><span class='event-name'>#{t.event}</span></dt><dd>#{t.description}</dd>\n"
167+
block+= "<dt><span class='event-name'>#{t.event}</span></dt><dd>#{t.description}</dd>\n"
168168
block+="</dl>"
169169
return block
170170

@@ -185,9 +185,9 @@ createPage = (page)->
185185
eventContent = "##{page.name}\n" + triggerBlock(page.block.triggers, true)
186186

187187
partContent = ""
188-
if page.parts.length
188+
if page.parts.length
189189
partList = "<div class='doc-contents'><h4>Properties and Methods</h4><ul>"
190-
for part in page.parts
190+
for part in page.parts
191191
clName = cleanName(part.name)
192192
partList += """<li><a href='##{clName}'>#{part.name}</a></li>"""
193193
partContent += "\n\n<div id='#{clName}' class='docblock'>\n\n<a href='#doc-nav' class='doc-top'>Back to top</a><h2>#{part.name}</h2>\n" + marked(part.getContent()) + "\n\n</div>\n\n"
@@ -219,7 +219,7 @@ saveMd = (data) ->
219219
nav_html+="<li><a href='#{cleanName(page.name)}.html'>#{page.name}</a></li>"
220220

221221
# Pages can be listed multiple times in the nav, but we should only generate them once
222-
continue if page.flagged is true
222+
continue if page.flagged is true
223223
page.flagged = true
224224

225225
# Make page
@@ -246,7 +246,7 @@ saveMd = (data) ->
246246
for page in pages
247247
html = template.replace("CONTENT_DIV", page.content_html).replace("NAV_DIV", nav_html)
248248
writeOut(page.name, html)
249-
249+
250250
return
251251

252252

@@ -267,7 +267,7 @@ document = (files, output, template, version, callback)->
267267
dirOut = output
268268
versionString = version
269269
for file in files
270-
parseJS file
270+
parseJS file
271271

272272
# Save the data to files
273273
saveMd data

build/template.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
---
1+
---
22
layout: default
33
---
44

changelog.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ v0.3.2
140140

141141
* Fixed a collision bug
142142

143-
v0.3.1
143+
v0.3.1
144144

145145
* Window resize even on fullscreen
146146
* Use scrollTop and scrollLeft

package.json

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@
3737
"src/core.js",
3838
"src/HashMap.js",
3939
"src/2D.js",
40+
"src/scenes.js",
4041
"src/collision.js",
4142
"src/DOM.js",
4243
"src/html.js",
@@ -57,7 +58,8 @@
5758
"src/loader.js",
5859
"src/math.js",
5960
"src/time.js",
60-
"src/DebugLayer.js"
61+
"src/DebugLayer.js",
62+
"src/keycodes.js"
6163
],
6264
"dependencies": {
6365
"grunt": "~0.4.1",
@@ -71,5 +73,8 @@
7173
"grunt-browserify": "~1.2.9",
7274
"grunt-banner": "~0.2.0",
7375
"grunt-contrib-watch": "~0.5.3"
76+
},
77+
"devDependencies": {
78+
"grunt-contrib-connect": "~0.6.0"
7479
}
7580
}

0 commit comments

Comments
 (0)