From: dsc Date: Sun, 5 Dec 2010 07:40:41 +0000 (-0800) Subject: Adds tags; fixes problem in op. X-Git-Url: http://git.less.ly:3516/?a=commitdiff_plain;h=467099a97c28c477a74debed7cf3f90c7bb35900;p=tanks.git Adds tags; fixes problem in op. --- diff --git a/src/Y/op.cjs b/src/Y/op.cjs index e621efa..e52348b 100644 --- a/src/Y/op.cjs +++ b/src/Y/op.cjs @@ -49,7 +49,7 @@ var core = require('Y/core') khas: function(k,o){ return k in o; }, kget: function(k,o){ return o[k] }, defkget: function(def,k,o){ return (k in o ? o[k] : def); }, - vkset: function(o,v,k){ if (o && k !== undefined) o[k] = v; return o; }, + vkset: function(o,v,k){ if (o && k !== undefined){ o[k] = v; } return o; }, // curry-ordered values & accessors has: function(o,k){ return k in o; }, @@ -76,4 +76,4 @@ function extender(target, donor){ return core.reduce(donor, op.vkset, target); } -core.extend(exports, op); +op.extend(exports, op); diff --git a/src/Y/utils.cjs b/src/Y/utils.cjs index 9886733..6afbee3 100644 --- a/src/Y/utils.cjs +++ b/src/Y/utils.cjs @@ -30,9 +30,9 @@ var defaults = { 'wrap' : false, 'chain' : false }; -function mixin(target, options){ +function mixin(o, options){ var opt = op.extend({}, defaults, options), Donor = opt.donor - , target = ( isFunction(target) ? target.prototype : target ) + , target = ( isFunction(o) ? o.prototype : o ) , proto = ( isFunction(Donor) ? Donor.prototype : Donor ) , names = opt.names ; diff --git a/src/tanks/index.cjs b/src/tanks/index.js similarity index 94% rename from src/tanks/index.cjs rename to src/tanks/index.js index 651be7c..deeb351 100644 --- a/src/tanks/index.cjs +++ b/src/tanks/index.js @@ -24,3 +24,6 @@ if (!window.console) { debug : Y.op.nop }; } + +jQuery(tanks.ui.main.main); + diff --git a/src/tanks/ui/main.cjs b/src/tanks/ui/main.cjs index 6924f9c..19080f0 100644 --- a/src/tanks/ui/main.cjs +++ b/src/tanks/ui/main.cjs @@ -11,11 +11,10 @@ var Y = require('Y').Y qkv = Y(window.location.search.slice(1)).fromKV().end(); -jQuery(main); - // Main method is only executed once, so we'll setup things // that don't change between games. function main(){ + console.log('main!'); /// Debug /// if (qkv.ai) { diff --git a/tags.html b/tags.html new file mode 100644 index 0000000..a988a4f --- /dev/null +++ b/tags.html @@ -0,0 +1,61 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tanks.php b/tanks.php index 3858af2..cdcb047 100644 --- a/tanks.php +++ b/tanks.php @@ -106,16 +106,16 @@ class Tanks { error_reporting(E_ALL); echo ""; - include "tags.php"; + include "build/tags.html"; } static function writeLoaders($modules=null, $recompile=true){ $modules = ($modules ? $modules : self::$modules); - js('lib/cjs/require.js'); + // js('lib/cjs/require.js'); if ($recompile) Tanks::compile($modules); // foreach ($modules as $module) js($module['loader'], Tanks::BUILD_DIR."/"); }