Browse files

Fix minor issues for custom pender build

  • Loading branch information...
1 parent e9db4a4 commit 652fa5f17a8a458817a7bfcf900707db0d46b868 Tobias von Klipstein committed Nov 23, 2012
Showing with 18 additions and 3 deletions.
  1. +5 −0 Makefile
  2. +1 −1 src/bootstrapper/_build/pender.js
  3. +12 −2 src/bootstrapper/context/pender/bootstrap.js
View
5 Makefile
@@ -105,6 +105,11 @@ profile: mktemp
doc: mkjsdoc
jsdoc -r -d ${WORKSPACE}/jsdoc${SUB_DIR} ${WORKSPACE}/src || true
+build-pender: clean mkdist
+ ${CLOSURE_AMD} --common_js_entry_module bootstrapper/_build/pender.js \
+ src/bootstrapper/_build/pender.js \
+ `find src -name '*.js' -not -path 'src/bootstrapper/_dev/*' -not -path 'src/bootstrapper/_build/*' -not -path 'src/bootstrapper/context/socketio/*' -not -path 'src/bootstrapper/context/node/*'` | ${CLOSURE_PRETTY} > ${DIST_DIR}/bonsai.js
+
build: clean mkdist
${CLOSURE_AMD} --common_js_entry_module bootstrapper/_build/common.js \
src/bootstrapper/_build/common.js \
View
2 src/bootstrapper/_build/pender.js
@@ -1,4 +1,4 @@
-require(['bonsai/bootstrapper/context/pender/bootstrap'], function(bootstrapPender) {
+define(['../context/pender/bootstrap'], function(bootstrapPender) {
/**
* @type {Object}
* @method on(type, callback) Takes a callback for an event type string.
View
14 src/bootstrapper/context/pender/bootstrap.js
@@ -30,9 +30,19 @@ define([
global.load = function(url, callback) { return loader.load() };
*/
- global.run = function(node, url, options) {
+ global.run = function(options) {
+ var code;
+ if (typeof options.code == 'function') {
+ code = '(' + options.code.toString() + '());';
+ } else {
+ code = options.code;
+ }
+ stage.setFramerate(options.framerate || 30);
+ stage.width = +options.width || Infinity;
+ stage.height = +options.height || Infinity;
+
//TODO: run all the things here with runCode
- runCode(options.code, exports);
+ runCode(code, exports);
//TODO: make run unusable after the first call?

0 comments on commit 652fa5f

Please sign in to comment.