Skip to content

Commit

Permalink
Merge branch 'develop' into testing
Browse files Browse the repository at this point in the history
Conflicts:
	Gruntfile.js
	src/drawing.js
	tests/core.html
	tests/stage.html
  • Loading branch information
starwed committed Jan 15, 2014
2 parents dfc6008 + 56b3f0f commit 8328d69
Show file tree
Hide file tree
Showing 58 changed files with 3,698 additions and 3,022 deletions.
12 changes: 12 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# How to contribute

Hi, thanks for contributing to Crafty! We've got guidlines on

- [How to build Crafty](https://github.com/craftyjs/Crafty/wiki/Building)
- [What workflow to use](https://github.com/craftyjs/Crafty/wiki/Workflow)

## Quick summary

- You'll need node, npm, and grunt-cli (installed globally) to work with Crafty's dev tools
- With those already installed, `npm install` from Crafty's directory will setup everything else you need
- Once you've made any changes, then `grunt check` will build and test your new version of Crafty.
34 changes: 17 additions & 17 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,51 +76,52 @@ module.exports = function (grunt) {
},

jshint: {
files: ['Gruntfile.js', 'src/**/*.js'],
files: ['Gruntfile.js', 'src/**/*.js', 'tests/*.js'],
options: {
trailing: true,
globals: {
}
}
},

qunit: {
all: [
'tests/core.html',
'tests/animation/animation.html',
'tests/stage.html',
'tests/events.html',
'tests/math.html',
'tests/isometric.html',
'tests/loader.html',
'tests/text.html',
'tests/dom.html',
'tests/tween.html',
'tests/sound.html'
'tests/index.html',
'tests/animation/animation.html'
]
},
},

jsvalidate: {
files: "crafty.js"
files: ['crafty.js', 'tests/*.js']
},

connect: {
server: {
options: {
keepalive: true
}
}
}

});

// Load the plugin that provides the "uglify" task.
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-contrib-qunit');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-contrib-connect');
grunt.loadNpmTasks('grunt-jsvalidate');
grunt.loadNpmTasks('grunt-browserify');
grunt.loadNpmTasks('grunt-banner');

grunt.registerTask('version', 'Takes the version into src/version.js', function() {
fs.writeFileSync('src/version.js', 'module.exports = "' + version + '";');
});

// Build development
grunt.registerTask('build:dev', ['browserify:debug', 'usebanner']);

// Build release
grunt.registerTask('build:release', ['browserify:dist', 'usebanner']);

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


};
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ Crafty.e("RightPoints, DOM, 2D, Text")
##Developing

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)

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 :-)


Expand Down
28 changes: 14 additions & 14 deletions build/api-gen.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ processBlock = (block)->
if not Table.comps[block.comp]
Table.comps[block.name] = {name:block.name, parts:[]}
Table.comps[block.name].block = block

# Having a component tag means it's part of a component page
if block.comp
if not Table.comps[block.comp]
Expand Down Expand Up @@ -123,10 +123,10 @@ class DocBlock
else
return false

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

# parse js file
parseJS = (path) ->
Expand All @@ -140,7 +140,7 @@ parseJS = (path) ->
block = new DocBlock()
block.file = path
block.line = ln
open = true
open = true
# process
if open
block.processLine(line)
Expand All @@ -153,18 +153,18 @@ parseJS = (path) ->
if block.categories.length is 0 and block.comp is null
console.log("No component or category for block at #{block.file}:#{block.line+1} (#{block.name})")
data.push block


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

triggerBlock = (triggers, noheader)->
return '' if triggers?.length is 0
if noheader then block = "<dl>" else block = "\n<h4>Events</h4>\n<dl>"
return '' if triggers?.length is 0
if noheader then block = "<dl>" else block = "\n<h4>Events</h4>\n<dl>"
for t in triggers
if t.objProp?
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"
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"
else
block+= "<dt><span class='event-name'>#{t.event}</span></dt><dd>#{t.description}</dd>\n"
block+= "<dt><span class='event-name'>#{t.event}</span></dt><dd>#{t.description}</dd>\n"
block+="</dl>"
return block

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

partContent = ""
if page.parts.length
if page.parts.length
partList = "<div class='doc-contents'><h4>Properties and Methods</h4><ul>"
for part in page.parts
for part in page.parts
clName = cleanName(part.name)
partList += """<li><a href='##{clName}'>#{part.name}</a></li>"""
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"
Expand Down Expand Up @@ -219,7 +219,7 @@ saveMd = (data) ->
nav_html+="<li><a href='#{cleanName(page.name)}.html'>#{page.name}</a></li>"

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

# Make page
Expand All @@ -246,7 +246,7 @@ saveMd = (data) ->
for page in pages
html = template.replace("CONTENT_DIV", page.content_html).replace("NAV_DIV", nav_html)
writeOut(page.name, html)

return


Expand All @@ -267,7 +267,7 @@ document = (files, output, template, version, callback)->
dirOut = output
versionString = version
for file in files
parseJS file
parseJS file

# Save the data to files
saveMd data
Expand Down
2 changes: 1 addition & 1 deletion build/template.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
---
---
layout: default
---

Expand Down
2 changes: 1 addition & 1 deletion changelog.txt
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ v0.3.2

* Fixed a collision bug

v0.3.1
v0.3.1

* Window resize even on fullscreen
* Use scrollTop and scrollLeft
Expand Down
7 changes: 6 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
"src/core.js",
"src/HashMap.js",
"src/2D.js",
"src/scenes.js",
"src/collision.js",
"src/DOM.js",
"src/html.js",
Expand All @@ -57,7 +58,8 @@
"src/loader.js",
"src/math.js",
"src/time.js",
"src/DebugLayer.js"
"src/DebugLayer.js",
"src/keycodes.js"
],
"dependencies": {
"grunt": "~0.4.1",
Expand All @@ -71,5 +73,8 @@
"grunt-browserify": "~1.2.9",
"grunt-banner": "~0.2.0",
"grunt-contrib-watch": "~0.5.3"
},
"devDependencies": {
"grunt-contrib-connect": "~0.6.0"
}
}
Loading

0 comments on commit 8328d69

Please sign in to comment.