|
@@ -1,4 +1,4 @@
|
|
|
-define(["amber/boot", "amber_core/Kernel-Objects", "trapped/Trapped-Backend"], function($boot){"use strict";
|
|
|
+define(["amber/boot", "amber_core/Kernel-Objects"], function($boot){"use strict";
|
|
|
if(!$boot.nilAsReceiver)$boot.nilAsReceiver=$boot.nil;
|
|
|
if(!("nilAsValue" in $boot))$boot.nilAsValue=$boot.nilAsReceiver;
|
|
|
var $core=$boot.api,nil=$boot.nilAsValue,$nil=$boot.nilAsReceiver,$recv=$boot.asReceiver,$globals=$boot.globals;
|
|
@@ -7,51 +7,7 @@ $core.addPackage("Trapped-Counter");
|
|
|
$core.packages["Trapped-Counter"].innerEval = function (expr) { return eval(expr); };
|
|
|
$core.packages["Trapped-Counter"].transport = {"type":"amd","amdNamespace":"trapped-counter"};
|
|
|
|
|
|
-$core.addClass("App", $globals.DirectTrapper, [], "Trapped-Counter");
|
|
|
-//>>excludeStart("ide", pragmas.excludeIdeData);
|
|
|
-$globals.App.comment="// Code from AngularJS Todo example, http://angularjs.org/#todo-js\x0afunction TodoCtrl($scope) {\x0a $scope.todos = [\x0a {text:'learn angular', done:true},\x0a {text:'build an angular app', done:false}];\x0a \x0a $scope.addTodo = function() {\x0a $scope.todos.push({text:$scope.todoText, done:false});\x0a $scope.todoText = '';\x0a };\x0a \x0a $scope.remaining = function() {\x0a var count = 0;\x0a angular.forEach($scope.todos, function(todo) {\x0a count += todo.done ? 0 : 1;\x0a });\x0a return count;\x0a };\x0a \x0a $scope.archive = function() {\x0a var oldTodos = $scope.todos;\x0a $scope.todos = [];\x0a angular.forEach(oldTodos, function(todo) {\x0a if (!todo.done) $scope.todos.push(todo);\x0a });\x0a };\x0a}";
|
|
|
-//>>excludeEnd("ide");
|
|
|
-$core.addMethod(
|
|
|
-$core.method({
|
|
|
-selector: "initialize",
|
|
|
-protocol: "initialization",
|
|
|
-fn: function (){
|
|
|
-var self=this,$self=this;
|
|
|
-//>>excludeStart("ctx", pragmas.excludeDebugContexts);
|
|
|
-return $core.withContext(function($ctx1) {
|
|
|
-//>>excludeEnd("ctx");
|
|
|
-var $1;
|
|
|
-(
|
|
|
-//>>excludeStart("ctx", pragmas.excludeDebugContexts);
|
|
|
-$ctx1.supercall = true,
|
|
|
-//>>excludeEnd("ctx");
|
|
|
-($globals.App.superclass||$boot.nilAsClass).fn.prototype._initialize.apply($self, []));
|
|
|
-//>>excludeStart("ctx", pragmas.excludeDebugContexts);
|
|
|
-$ctx1.supercall = false;
|
|
|
-//>>excludeEnd("ctx");;
|
|
|
-$1=$recv($globals.SimpleAxon)._new();
|
|
|
-//>>excludeStart("ctx", pragmas.excludeDebugContexts);
|
|
|
-$ctx1.sendIdx["new"]=1;
|
|
|
-//>>excludeEnd("ctx");
|
|
|
-$self._axon_($1);
|
|
|
-$self._model_($recv($globals.AppModel)._new());
|
|
|
-return self;
|
|
|
-//>>excludeStart("ctx", pragmas.excludeDebugContexts);
|
|
|
-}, function($ctx1) {$ctx1.fill(self,"initialize",{},$globals.App)});
|
|
|
-//>>excludeEnd("ctx");
|
|
|
-},
|
|
|
-//>>excludeStart("ide", pragmas.excludeIdeData);
|
|
|
-args: [],
|
|
|
-source: "initialize\x0a\x09super initialize.\x0a self axon: SimpleAxon new.\x0a self model: AppModel new",
|
|
|
-referencedClasses: ["SimpleAxon", "AppModel"],
|
|
|
-//>>excludeEnd("ide");
|
|
|
-messageSends: ["initialize", "axon:", "new", "model:"]
|
|
|
-}),
|
|
|
-$globals.App);
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-$core.addClass("AppModel", $globals.Object, ["value"], "Trapped-Counter");
|
|
|
+$core.addClass("TrappedCounter", $globals.Object, ["value"], "Trapped-Counter");
|
|
|
$core.addMethod(
|
|
|
$core.method({
|
|
|
selector: "decrement",
|
|
@@ -64,7 +20,7 @@ return $core.withContext(function($ctx1) {
|
|
|
$self["@value"]=$recv($self["@value"]).__minus((1));
|
|
|
return self;
|
|
|
//>>excludeStart("ctx", pragmas.excludeDebugContexts);
|
|
|
-}, function($ctx1) {$ctx1.fill(self,"decrement",{},$globals.AppModel)});
|
|
|
+}, function($ctx1) {$ctx1.fill(self,"decrement",{},$globals.TrappedCounter)});
|
|
|
//>>excludeEnd("ctx");
|
|
|
},
|
|
|
//>>excludeStart("ide", pragmas.excludeIdeData);
|
|
@@ -74,7 +30,7 @@ referencedClasses: [],
|
|
|
//>>excludeEnd("ide");
|
|
|
messageSends: ["-"]
|
|
|
}),
|
|
|
-$globals.AppModel);
|
|
|
+$globals.TrappedCounter);
|
|
|
|
|
|
$core.addMethod(
|
|
|
$core.method({
|
|
@@ -88,7 +44,7 @@ return $core.withContext(function($ctx1) {
|
|
|
$self["@value"]=$recv($self["@value"]).__plus((1));
|
|
|
return self;
|
|
|
//>>excludeStart("ctx", pragmas.excludeDebugContexts);
|
|
|
-}, function($ctx1) {$ctx1.fill(self,"increment",{},$globals.AppModel)});
|
|
|
+}, function($ctx1) {$ctx1.fill(self,"increment",{},$globals.TrappedCounter)});
|
|
|
//>>excludeEnd("ctx");
|
|
|
},
|
|
|
//>>excludeStart("ide", pragmas.excludeIdeData);
|
|
@@ -98,7 +54,7 @@ referencedClasses: [],
|
|
|
//>>excludeEnd("ide");
|
|
|
messageSends: ["+"]
|
|
|
}),
|
|
|
-$globals.AppModel);
|
|
|
+$globals.TrappedCounter);
|
|
|
|
|
|
$core.addMethod(
|
|
|
$core.method({
|
|
@@ -113,24 +69,25 @@ return $core.withContext(function($ctx1) {
|
|
|
//>>excludeStart("ctx", pragmas.excludeDebugContexts);
|
|
|
$ctx1.supercall = true,
|
|
|
//>>excludeEnd("ctx");
|
|
|
-($globals.AppModel.superclass||$boot.nilAsClass).fn.prototype._initialize.apply($self, []));
|
|
|
+($globals.TrappedCounter.superclass||$boot.nilAsClass).fn.prototype._initialize.apply($self, []));
|
|
|
//>>excludeStart("ctx", pragmas.excludeDebugContexts);
|
|
|
$ctx1.supercall = false;
|
|
|
//>>excludeEnd("ctx");;
|
|
|
+$recv($recv($globals.SimpleAxon)._new())._registerIn_(self);
|
|
|
$self["@value"]=(0);
|
|
|
return self;
|
|
|
//>>excludeStart("ctx", pragmas.excludeDebugContexts);
|
|
|
-}, function($ctx1) {$ctx1.fill(self,"initialize",{},$globals.AppModel)});
|
|
|
+}, function($ctx1) {$ctx1.fill(self,"initialize",{},$globals.TrappedCounter)});
|
|
|
//>>excludeEnd("ctx");
|
|
|
},
|
|
|
//>>excludeStart("ide", pragmas.excludeIdeData);
|
|
|
args: [],
|
|
|
-source: "initialize\x0a\x09super initialize.\x0a\x09value := 0",
|
|
|
-referencedClasses: [],
|
|
|
+source: "initialize\x0a\x09super initialize.\x0a\x09SimpleAxon new registerIn: self.\x0a\x09value := 0",
|
|
|
+referencedClasses: ["SimpleAxon"],
|
|
|
//>>excludeEnd("ide");
|
|
|
-messageSends: ["initialize"]
|
|
|
+messageSends: ["initialize", "registerIn:", "new"]
|
|
|
}),
|
|
|
-$globals.AppModel);
|
|
|
+$globals.TrappedCounter);
|
|
|
|
|
|
$core.addMethod(
|
|
|
$core.method({
|
|
@@ -148,7 +105,7 @@ referencedClasses: [],
|
|
|
//>>excludeEnd("ide");
|
|
|
messageSends: []
|
|
|
}),
|
|
|
-$globals.AppModel);
|
|
|
+$globals.TrappedCounter);
|
|
|
|
|
|
$core.addMethod(
|
|
|
$core.method({
|
|
@@ -167,7 +124,7 @@ referencedClasses: [],
|
|
|
//>>excludeEnd("ide");
|
|
|
messageSends: []
|
|
|
}),
|
|
|
-$globals.AppModel);
|
|
|
+$globals.TrappedCounter);
|
|
|
|
|
|
|
|
|
});
|