Browse Source

0.4.0: migration to 0.14.4, jQuery bug workaround

$(documentFragment).data('foo', 'bar') does not set the data.
This caused stack range error in xontent.
Must have switched to different holder
of loop-iteration produced content.
Herbert Vojčík 9 years ago
parent
commit
fbf80b7cd6

+ 4 - 1
.gitignore

@@ -1 +1,4 @@
-bower_components
+/node_modules/
+/bower_components/
+
+/test_runner.js

+ 109 - 0
Gruntfile.js

@@ -0,0 +1,109 @@
+'use strict';
+
+module.exports = function (grunt) {
+    var path = require('path');
+
+    // These plugins provide necessary tasks.
+    grunt.loadNpmTasks('grunt-contrib-clean');
+    grunt.loadNpmTasks('grunt-contrib-requirejs');
+    grunt.loadNpmTasks('grunt-execute');
+    grunt.loadNpmTasks('amber-dev');
+
+    // Default task.
+    grunt.registerTask('default', ['amberc:all', 'amberc:counter', 'amberc:todo']);
+    grunt.registerTask('test', ['amberc:test_runner', 'execute:test_runner', 'clean:test_runner']);
+    grunt.registerTask('devel', ['amdconfig:app', 'requirejs:devel']);
+    grunt.registerTask('deploy', ['amdconfig:app', 'requirejs:deploy']);
+
+    // Project configuration.
+    grunt.initConfig({
+        // Metadata.
+        // pkg: grunt.file.readJSON(''),
+        banner: '/*! <%= pkg.title || pkg.name %> - v<%= pkg.version %> - ' +
+        '<%= grunt.template.today("yyyy-mm-dd") %>\n' +
+        '<%= pkg.homepage ? "* " + pkg.homepage + "\\n" : "" %>' +
+        '* Copyright (c) <%= grunt.template.today("yyyy") %> <%= pkg.author.name %>;' +
+        ' Licensed <%= _.pluck(pkg.licenses, "type").join(", ") %> */\n',
+        // task configuration
+        amberc: {
+            options: {
+                amber_dir: path.join(__dirname, "bower_components", "amber"),
+                library_dirs: ['src'],
+                closure_jar: ''
+            },
+            all: {
+                src: [
+                    'src/Trapped-Backend.st', 'src/Trapped-Frontend.st', 'src/Trapped-Processors.st', // list all sources in dependency order
+                    'src/Trapped-Tests.st' // list all tests in dependency order
+                ],
+                amd_namespace: 'trapped',
+                libraries: ['SUnit', 'Web']
+            },
+            counter: {
+                src: [
+                    'example-counter/src/Trapped-Counter.st'
+                ],
+                amd_namespace: 'trapped-counter',
+                libraries: ['SUnit', 'Web', 'Trapped-Backend']
+            },
+            todo: {
+                src: [
+                    'example-todo/src/Trapped-Todo.st'
+                ],
+                amd_namespace: 'trapped-todo',
+                libraries: ['SUnit', 'Web', 'Trapped-Frontend', 'Trapped-Backend']
+            },
+            test_runner: {
+                src: ['node_modules/amber-dev/lib/Test.st'],
+                libraries: [
+                    /* add dependencies packages here */
+                    'Trapped', /* add other code-to-test packages here */
+                    'SUnit',
+                    'Trapped-Tests' /* add other test packages here */
+                ],
+                main_class: 'NodeTestRunner',
+                output_name: 'test_runner'
+            }
+        },
+
+        amdconfig: {app: {dest: 'config.js'}},
+
+        requirejs: {
+            deploy: {
+                options: {
+                    mainConfigFile: "config.js",
+                    onBuildWrite: function (moduleName, path, contents) {
+                        return moduleName === "config" ? contents + "\nrequire.config({map:{'*':{app:'deploy'}}});" : contents;
+                    },
+                    pragmas: {
+                        excludeIdeData: true,
+                        excludeDebugContexts: true
+                    },
+                    include: ['config', 'node_modules/requirejs/require', 'deploy'],
+                    out: "the.js"
+                }
+            },
+            devel: {
+                options: {
+                    mainConfigFile: "config.js",
+                    onBuildWrite: function (moduleName, path, contents) {
+                        return moduleName === "config" ? contents + "\nrequire.config({map:{'*':{app:'devel'}}});" : contents;
+                    },
+                    include: ['config', 'node_modules/requirejs/require'],
+                    out: "the.js"
+                }
+            }
+        },
+
+        execute: {
+            test_runner: {
+                src: ['test_runner.js']
+            }
+        },
+
+        clean: {
+            test_runner: ['test_runner.js']
+        }
+    });
+
+};

+ 22 - 0
LICENSE-MIT

@@ -0,0 +1,22 @@
+Copyright (c) 2015 Herbert Vojčík
+
+Permission is hereby granted, free of charge, to any person
+obtaining a copy of this software and associated documentation
+files (the "Software"), to deal in the Software without
+restriction, including without limitation the rights to use,
+copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the
+Software is furnished to do so, subject to the following
+conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+OTHER DEALINGS IN THE SOFTWARE.

+ 10 - 4
bower.json

@@ -1,6 +1,6 @@
 {
   "name": "trapped",
-  "version": "0.3.2",
+  "version": "0.4.0",
   "homepage": "https://github.com/herby/trapped",
   "authors": [
     "Herbert Vojčík <herby@mailbox.sk>"
@@ -18,12 +18,18 @@
     "**/.*",
     "node_modules",
     "bower_components",
-    "meta",
+    "/*.js",
+    "/*.html",
     "test",
     "tests"
   ],
   "dependencies": {
-    "amber": ">=0.12.2",
-    "xontent": "~0.1.0"
+    "amber": ">=0.14.4",
+    "xontent": "^0.1.0"
+  },
+  "devDependencies": {
+    "amber-ide-starter-dialog": "^0.1.0",
+    "amber-attic": "^0.1.0",
+    "helios": "^0.3.4"
   }
 }

+ 61 - 0
config.js

@@ -0,0 +1,61 @@
+/* DO NOT EDIT! This file is generated. */
+
+var require;
+if (!require) require = {config: function (x) {require = x;}};
+require.config({
+  "paths": {
+    "helios/showdown": "bower_components/showdown/src/showdown",
+    "requireJS": "node_modules/requirejs/require",
+    "require-css": "bower_components/require-css",
+    "jquery": "bower_components/jquery/jquery",
+    "jquery-ui": "bower_components/jquery-ui/jquery-ui",
+    "codemirror": "bower_components/codemirror",
+    "bootstrap2.3.2": "bower_components/bootstrap2.3.2/bootstrap",
+    "mousetrap": "bower_components/mousetrap/mousetrap",
+    "jquery.blockUI": "bower_components/blockui/jquery.blockUI",
+    "jquery.xontent": "bower_components/xontent/jquery.xontent",
+    "helios": "bower_components/helios/src",
+    "helios/resources": "bower_components/helios/resources",
+    "helios/index": "bower_components/helios/index",
+    "amber-ide-starter-dialog": "bower_components/amber-ide-starter-dialog/lib/idestarter",
+    "amber-attic": "bower_components/amber-attic/src",
+    "amber-attic/resources": "bower_components/amber-attic/resources",
+    "amber": "bower_components/amber/support",
+    "amber_core": "bower_components/amber/src",
+    "trapped": "src",
+    "trapped-todo": "example-todo/src",
+    "trapped-counter": "example-counter/src"
+  },
+  "rjs_comment1": "require.min should be removed",
+  "rjs_comment2": "it's backward compatibility hack if config finds",
+  "rjs_comment3": "support/requirejs before node_modules/requirejs;",
+  "rjs_comment4": "the former will go away in 0.14.0",
+  "map": {
+    "*": {
+      "css": "require-css/css"
+    }
+  },
+  "shim": {
+    "jquery-ui": {
+      "deps": [
+        "jquery",
+        "jquery"
+      ]
+    },
+    "codemirror/lib/codemirror": {
+      "deps": [
+        "css!codemirror/lib/codemirror",
+        "css!codemirror/lib/codemirror"
+      ]
+    },
+    "bootstrap2.3.2/js/bootstrap": {
+      "deps": [
+        "jquery",
+        "css!bootstrap2.3.2/css/bootstrap"
+      ]
+    },
+    "ensure-console": {
+      "exports": "console"
+    }
+  }
+});

+ 9 - 0
deploy.js

@@ -0,0 +1,9 @@
+define([
+    'amber/deploy',
+    // --- packages to be deployed begin here ---
+    "trapped/Trapped-Backend",
+    "trapped/Trapped-Processors"
+    // --- packages to be deployed end here ---
+], function (amber) {
+    return amber;
+});

+ 10 - 0
devel.js

@@ -0,0 +1,10 @@
+define([
+    'amber/devel',
+    './deploy',
+    // --- packages used only during development begin here ---
+    'trapped/Trapped-Tests',
+    'amber-attic/IDE'
+    // --- packages used only during development end here ---
+], function (amber) {
+    return amber;
+});

+ 12 - 17
example-counter/counter.html

@@ -10,28 +10,23 @@
             font-family: monospace;
         }
     </style>
-    <script src="../bower_components/amber/support/amber.js"></script>
-    <script type='text/javascript' src='../bower_components/amber/support/requirejs/require.min.js'></script>
+    <meta name="author" content="Herbert Vojčík" />
+    <script type='text/javascript' src='../the.js'></script>
     <script type="text/javascript">
         var blackboard;
-        require.config({
-            paths: {
-                'gh_herby_trapped': '../js',
-                'gh_herby_trapped_counter': 'js',
-                'gh_herby_trapped_counter/_source': 'st'
-            }
-        });
+        require.config({baseUrl: '..'});
         require(
-                ["amber/devel",
-                    "gh_herby_trapped/Trapped-Processors", "gh_herby_trapped_counter/Trapped-Counter" ],
-                function (smalltalk) {
-                    smalltalk.defaultAmdNamespace = 'gh_herby_trapped_todo';
-                    smalltalk.initialize();
+                ["app", "trapped-counter/Trapped-Counter" ],
+                function (amber) {
+                    amber.initialize({
+                        //used for all new packages in IDE
+                        'transport.defaultAmdNamespace': "trapped-counter"
+                    });
+                    require(["amber-ide-starter-dialog"], function (dlg) { dlg.start(); });
 
                     $(function () {
-                        smalltalk.Browser._openOn_(smalltalk.App);
-                        blackboard = smalltalk.App._new();
-                        smalltalk.Trapped._start_([blackboard]);
+                        blackboard = amber.globals.App._new();
+                        amber.globals.Trapped._start_([blackboard]);
                     });
                 }
         );

+ 0 - 117
example-counter/js/Trapped-Counter.js

@@ -1,117 +0,0 @@
-define("gh_herby_trapped_counter/Trapped-Counter", ["amber_vm/smalltalk", "amber_vm/nil", "amber_vm/_st", "gh_herby_trapped/Trapped-Backend", "amber_core/Kernel-Objects"], function(smalltalk,nil,_st){
-smalltalk.addPackage('Trapped-Counter');
-smalltalk.packages["Trapped-Counter"].transport = {"type":"amd","amdNamespace":"gh_herby_trapped_counter"};
-
-smalltalk.addClass('App', smalltalk.ListKeyedIsolatedEntity, [], 'Trapped-Counter');
-smalltalk.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}";
-smalltalk.addMethod(
-smalltalk.method({
-selector: "initialize",
-category: 'initialization',
-fn: function (){
-var self=this;
-function $SimpleKeyedPubSub(){return smalltalk.SimpleKeyedPubSub||(typeof SimpleKeyedPubSub=="undefined"?nil:SimpleKeyedPubSub)}
-function $AppModel(){return smalltalk.AppModel||(typeof AppModel=="undefined"?nil:AppModel)}
-return smalltalk.withContext(function($ctx1) { 
-var $1;
-smalltalk.App.superclass.fn.prototype._initialize.apply(_st(self), []);
-$1=_st($SimpleKeyedPubSub())._new();
-$ctx1.sendIdx["new"]=1;
-self._dispatcher_($1);
-self._model_(_st($AppModel())._new());
-return self}, function($ctx1) {$ctx1.fill(self,"initialize",{},smalltalk.App)})},
-args: [],
-source: "initialize\x0a\x09super initialize.\x0a    self dispatcher: SimpleKeyedPubSub new.\x0a    self model: AppModel new",
-messageSends: ["initialize", "dispatcher:", "new", "model:"],
-referencedClasses: ["SimpleKeyedPubSub", "AppModel"]
-}),
-smalltalk.App);
-
-
-
-smalltalk.addClass('AppModel', smalltalk.Object, ['value'], 'Trapped-Counter');
-smalltalk.addMethod(
-smalltalk.method({
-selector: "decrement",
-category: 'action',
-fn: function (){
-var self=this;
-return smalltalk.withContext(function($ctx1) { 
-self["@value"]=_st(self["@value"]).__minus((1));
-return self}, function($ctx1) {$ctx1.fill(self,"decrement",{},smalltalk.AppModel)})},
-args: [],
-source: "decrement\x0a\x09value := value - 1",
-messageSends: ["-"],
-referencedClasses: []
-}),
-smalltalk.AppModel);
-
-smalltalk.addMethod(
-smalltalk.method({
-selector: "increment",
-category: 'action',
-fn: function (){
-var self=this;
-return smalltalk.withContext(function($ctx1) { 
-self["@value"]=_st(self["@value"]).__plus((1));
-return self}, function($ctx1) {$ctx1.fill(self,"increment",{},smalltalk.AppModel)})},
-args: [],
-source: "increment\x0a\x09value := value + 1",
-messageSends: ["+"],
-referencedClasses: []
-}),
-smalltalk.AppModel);
-
-smalltalk.addMethod(
-smalltalk.method({
-selector: "initialize",
-category: 'initialization',
-fn: function (){
-var self=this;
-return smalltalk.withContext(function($ctx1) { 
-smalltalk.AppModel.superclass.fn.prototype._initialize.apply(_st(self), []);
-self["@value"]=(0);
-return self}, function($ctx1) {$ctx1.fill(self,"initialize",{},smalltalk.AppModel)})},
-args: [],
-source: "initialize\x0a\x09super initialize.\x0a\x09value := 0",
-messageSends: ["initialize"],
-referencedClasses: []
-}),
-smalltalk.AppModel);
-
-smalltalk.addMethod(
-smalltalk.method({
-selector: "value",
-category: 'accessing',
-fn: function (){
-var self=this;
-return smalltalk.withContext(function($ctx1) { 
-var $1;
-$1=self["@value"];
-return $1;
-}, function($ctx1) {$ctx1.fill(self,"value",{},smalltalk.AppModel)})},
-args: [],
-source: "value\x0a\x09^value",
-messageSends: [],
-referencedClasses: []
-}),
-smalltalk.AppModel);
-
-smalltalk.addMethod(
-smalltalk.method({
-selector: "value:",
-category: 'accessing',
-fn: function (aNumber){
-var self=this;
-return smalltalk.withContext(function($ctx1) { 
-self["@value"]=aNumber;
-return self}, function($ctx1) {$ctx1.fill(self,"value:",{aNumber:aNumber},smalltalk.AppModel)})},
-args: ["aNumber"],
-source: "value: aNumber\x0a\x09value := aNumber",
-messageSends: [],
-referencedClasses: []
-}),
-smalltalk.AppModel);
-
-
-});

+ 174 - 0
example-counter/src/Trapped-Counter.js

@@ -0,0 +1,174 @@
+define("trapped-counter/Trapped-Counter", ["amber/boot", "trapped/Trapped-Backend", "amber_core/Kernel-Objects"], function($boot){
+var $core=$boot.api,nil=$boot.nil,$recv=$boot.asReceiver,$globals=$boot.globals;
+$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.ListKeyedIsolatedEntity, [], '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;
+function $SimpleKeyedPubSub(){return $globals.SimpleKeyedPubSub||(typeof SimpleKeyedPubSub=="undefined"?nil:SimpleKeyedPubSub)}
+function $AppModel(){return $globals.AppModel||(typeof AppModel=="undefined"?nil:AppModel)}
+//>>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.fn.prototype._initialize.apply($recv(self), []));
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+$ctx1.supercall = false;
+//>>excludeEnd("ctx");;
+$1=$recv($SimpleKeyedPubSub())._new();
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+$ctx1.sendIdx["new"]=1;
+//>>excludeEnd("ctx");
+self._dispatcher_($1);
+self._model_($recv($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 dispatcher: SimpleKeyedPubSub new.\x0a    self model: AppModel new",
+referencedClasses: ["SimpleKeyedPubSub", "AppModel"],
+//>>excludeEnd("ide");
+messageSends: ["initialize", "dispatcher:", "new", "model:"]
+}),
+$globals.App);
+
+
+
+$core.addClass('AppModel', $globals.Object, ['value'], 'Trapped-Counter');
+$core.addMethod(
+$core.method({
+selector: "decrement",
+protocol: 'action',
+fn: function (){
+var self=this;
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+return $core.withContext(function($ctx1) {
+//>>excludeEnd("ctx");
+self["@value"]=$recv(self["@value"]).__minus((1));
+return self;
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+}, function($ctx1) {$ctx1.fill(self,"decrement",{},$globals.AppModel)});
+//>>excludeEnd("ctx");
+},
+//>>excludeStart("ide", pragmas.excludeIdeData);
+args: [],
+source: "decrement\x0a\x09value := value - 1",
+referencedClasses: [],
+//>>excludeEnd("ide");
+messageSends: ["-"]
+}),
+$globals.AppModel);
+
+$core.addMethod(
+$core.method({
+selector: "increment",
+protocol: 'action',
+fn: function (){
+var self=this;
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+return $core.withContext(function($ctx1) {
+//>>excludeEnd("ctx");
+self["@value"]=$recv(self["@value"]).__plus((1));
+return self;
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+}, function($ctx1) {$ctx1.fill(self,"increment",{},$globals.AppModel)});
+//>>excludeEnd("ctx");
+},
+//>>excludeStart("ide", pragmas.excludeIdeData);
+args: [],
+source: "increment\x0a\x09value := value + 1",
+referencedClasses: [],
+//>>excludeEnd("ide");
+messageSends: ["+"]
+}),
+$globals.AppModel);
+
+$core.addMethod(
+$core.method({
+selector: "initialize",
+protocol: 'initialization',
+fn: function (){
+var self=this;
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+return $core.withContext(function($ctx1) {
+//>>excludeEnd("ctx");
+(
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+$ctx1.supercall = true, 
+//>>excludeEnd("ctx");
+$globals.AppModel.superclass.fn.prototype._initialize.apply($recv(self), []));
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+$ctx1.supercall = false;
+//>>excludeEnd("ctx");;
+self["@value"]=(0);
+return self;
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+}, function($ctx1) {$ctx1.fill(self,"initialize",{},$globals.AppModel)});
+//>>excludeEnd("ctx");
+},
+//>>excludeStart("ide", pragmas.excludeIdeData);
+args: [],
+source: "initialize\x0a\x09super initialize.\x0a\x09value := 0",
+referencedClasses: [],
+//>>excludeEnd("ide");
+messageSends: ["initialize"]
+}),
+$globals.AppModel);
+
+$core.addMethod(
+$core.method({
+selector: "value",
+protocol: 'accessing',
+fn: function (){
+var self=this;
+var $1;
+$1=self["@value"];
+return $1;
+
+},
+//>>excludeStart("ide", pragmas.excludeIdeData);
+args: [],
+source: "value\x0a\x09^value",
+referencedClasses: [],
+//>>excludeEnd("ide");
+messageSends: []
+}),
+$globals.AppModel);
+
+$core.addMethod(
+$core.method({
+selector: "value:",
+protocol: 'accessing',
+fn: function (aNumber){
+var self=this;
+self["@value"]=aNumber;
+return self;
+
+},
+//>>excludeStart("ide", pragmas.excludeIdeData);
+args: ["aNumber"],
+source: "value: aNumber\x0a\x09value := aNumber",
+referencedClasses: [],
+//>>excludeEnd("ide");
+messageSends: []
+}),
+$globals.AppModel);
+
+
+});

+ 1 - 1
example-counter/st/Trapped-Counter.st → example-counter/src/Trapped-Counter.st

@@ -1,4 +1,4 @@
-Smalltalk current createPackage: 'Trapped-Counter'!
+Smalltalk createPackage: 'Trapped-Counter'!
 ListKeyedIsolatedEntity subclass: #App
 	instanceVariableNames: ''
 	package: 'Trapped-Counter'!

+ 0 - 254
example-todo/js/Trapped-Todo.js

@@ -1,254 +0,0 @@
-define("gh_herby_trapped_todo/Trapped-Todo", ["amber_vm/smalltalk", "amber_vm/nil", "amber_vm/_st", "gh_herby_trapped/Trapped-Backend", "amber_core/Kernel-Objects", "gh_herby_trapped/Trapped-Frontend"], function(smalltalk,nil,_st){
-smalltalk.addPackage('Trapped-Todo');
-smalltalk.packages["Trapped-Todo"].transport = {"type":"amd","amdNamespace":"gh_herby_trapped_todo"};
-
-smalltalk.addClass('App', smalltalk.ListKeyedIsolatedEntity, [], 'Trapped-Todo');
-smalltalk.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}";
-smalltalk.addMethod(
-smalltalk.method({
-selector: "initialize",
-category: 'initialization',
-fn: function (){
-var self=this;
-function $SimpleKeyedPubSub(){return smalltalk.SimpleKeyedPubSub||(typeof SimpleKeyedPubSub=="undefined"?nil:SimpleKeyedPubSub)}
-function $AppModel(){return smalltalk.AppModel||(typeof AppModel=="undefined"?nil:AppModel)}
-return smalltalk.withContext(function($ctx1) { 
-var $1,$3,$4,$2,$6,$5;
-smalltalk.App.superclass.fn.prototype._initialize.apply(_st(self), []);
-$1=_st($SimpleKeyedPubSub())._new();
-$ctx1.sendIdx["new"]=1;
-self._dispatcher_($1);
-self._model_(_st(_st($AppModel())._new())._title_("Todo"));
-self._watch_do_([["todos"], nil],(function(){
-return smalltalk.withContext(function($ctx2) {
-return _st(self._dispatcher())._changed_([["remaining"]]);
-}, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})}));
-_st((function(){
-return smalltalk.withContext(function($ctx2) {
-return self._modify_do_([["todos"]],(function(){
-return smalltalk.withContext(function($ctx3) {
-$3="text".__minus_gt("learn trapped");
-$ctx3.sendIdx["->"]=1;
-$4="done".__minus_gt(true);
-$ctx3.sendIdx["->"]=2;
-$2=smalltalk.HashedCollection._from_([$3,$4]);
-$6="text".__minus_gt("build a trapped app");
-$ctx3.sendIdx["->"]=3;
-$5=smalltalk.HashedCollection._from_([$6,"done".__minus_gt(false)]);
-return [$2,$5];
-}, function($ctx3) {$ctx3.fillBlock({},$ctx2,3)})}));
-}, function($ctx2) {$ctx2.fillBlock({},$ctx1,2)})}))._valueWithTimeout_((2000));
-return self}, function($ctx1) {$ctx1.fill(self,"initialize",{},smalltalk.App)})},
-args: [],
-source: "initialize\x0a\x09super initialize.\x0a    self dispatcher: SimpleKeyedPubSub new.\x0a    self model: (AppModel new title: 'Todo').\x0a\x09self watch: #((todos) nil) do: [ self dispatcher changed: #((remaining)) ].\x0a    [ self modify: #((todos)) do: [{\x0a        #{'text'->'learn trapped'. 'done'->true}.\x0a        #{'text'->'build a trapped app'. 'done'->false}\x0a    }]] valueWithTimeout: 2000",
-messageSends: ["initialize", "dispatcher:", "new", "model:", "title:", "watch:do:", "changed:", "dispatcher", "valueWithTimeout:", "modify:do:", "->"],
-referencedClasses: ["SimpleKeyedPubSub", "AppModel"]
-}),
-smalltalk.App);
-
-
-
-smalltalk.addClass('AppModel', smalltalk.Object, ['title', 'todos', 'todoText'], 'Trapped-Todo');
-smalltalk.AppModel.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}";
-smalltalk.addMethod(
-smalltalk.method({
-selector: "addTodo",
-category: 'action',
-fn: function (){
-var self=this;
-return smalltalk.withContext(function($ctx1) { 
-var $1,$3,$2;
-$1=self._todos();
-$3="text".__minus_gt(self._todoText());
-$ctx1.sendIdx["->"]=1;
-$2=smalltalk.HashedCollection._from_([$3,"done".__minus_gt(false)]);
-_st($1)._add_($2);
-self._todoText_("");
-return self}, function($ctx1) {$ctx1.fill(self,"addTodo",{},smalltalk.AppModel)})},
-args: [],
-source: "addTodo\x0a    self todos add: #{'text'->self todoText. 'done'->false}.\x0a    self todoText: ''",
-messageSends: ["add:", "todos", "->", "todoText", "todoText:"],
-referencedClasses: []
-}),
-smalltalk.AppModel);
-
-smalltalk.addMethod(
-smalltalk.method({
-selector: "archive",
-category: 'action',
-fn: function (){
-var self=this;
-return smalltalk.withContext(function($ctx1) { 
-self._todos_(self._todosNotDone());
-return self}, function($ctx1) {$ctx1.fill(self,"archive",{},smalltalk.AppModel)})},
-args: [],
-source: "archive\x0a    self todos: self todosNotDone",
-messageSends: ["todos:", "todosNotDone"],
-referencedClasses: []
-}),
-smalltalk.AppModel);
-
-smalltalk.addMethod(
-smalltalk.method({
-selector: "remaining",
-category: 'accessing',
-fn: function (){
-var self=this;
-return smalltalk.withContext(function($ctx1) { 
-var $1;
-$1=_st(self._todosNotDone())._size();
-return $1;
-}, function($ctx1) {$ctx1.fill(self,"remaining",{},smalltalk.AppModel)})},
-args: [],
-source: "remaining\x0a    ^self todosNotDone size",
-messageSends: ["size", "todosNotDone"],
-referencedClasses: []
-}),
-smalltalk.AppModel);
-
-smalltalk.addMethod(
-smalltalk.method({
-selector: "title",
-category: 'accessing',
-fn: function (){
-var self=this;
-return smalltalk.withContext(function($ctx1) { 
-var $1;
-$1=self["@title"];
-return $1;
-}, function($ctx1) {$ctx1.fill(self,"title",{},smalltalk.AppModel)})},
-args: [],
-source: "title\x0a\x09^title",
-messageSends: [],
-referencedClasses: []
-}),
-smalltalk.AppModel);
-
-smalltalk.addMethod(
-smalltalk.method({
-selector: "title:",
-category: 'accessing',
-fn: function (aString){
-var self=this;
-return smalltalk.withContext(function($ctx1) { 
-self["@title"]=aString;
-return self}, function($ctx1) {$ctx1.fill(self,"title:",{aString:aString},smalltalk.AppModel)})},
-args: ["aString"],
-source: "title: aString\x0a\x09title := aString",
-messageSends: [],
-referencedClasses: []
-}),
-smalltalk.AppModel);
-
-smalltalk.addMethod(
-smalltalk.method({
-selector: "todoText",
-category: 'accessing',
-fn: function (){
-var self=this;
-return smalltalk.withContext(function($ctx1) { 
-var $1;
-$1=self["@todoText"];
-return $1;
-}, function($ctx1) {$ctx1.fill(self,"todoText",{},smalltalk.AppModel)})},
-args: [],
-source: "todoText\x0a\x09^todoText",
-messageSends: [],
-referencedClasses: []
-}),
-smalltalk.AppModel);
-
-smalltalk.addMethod(
-smalltalk.method({
-selector: "todoText:",
-category: 'accessing',
-fn: function (aString){
-var self=this;
-return smalltalk.withContext(function($ctx1) { 
-self["@todoText"]=aString;
-return self}, function($ctx1) {$ctx1.fill(self,"todoText:",{aString:aString},smalltalk.AppModel)})},
-args: ["aString"],
-source: "todoText: aString\x0a\x09todoText := aString",
-messageSends: [],
-referencedClasses: []
-}),
-smalltalk.AppModel);
-
-smalltalk.addMethod(
-smalltalk.method({
-selector: "todos",
-category: 'accessing',
-fn: function (){
-var self=this;
-return smalltalk.withContext(function($ctx1) { 
-var $1;
-$1=self["@todos"];
-return $1;
-}, function($ctx1) {$ctx1.fill(self,"todos",{},smalltalk.AppModel)})},
-args: [],
-source: "todos\x0a\x09^todos",
-messageSends: [],
-referencedClasses: []
-}),
-smalltalk.AppModel);
-
-smalltalk.addMethod(
-smalltalk.method({
-selector: "todos:",
-category: 'accessing',
-fn: function (anArray){
-var self=this;
-return smalltalk.withContext(function($ctx1) { 
-self["@todos"]=anArray;
-return self}, function($ctx1) {$ctx1.fill(self,"todos:",{anArray:anArray},smalltalk.AppModel)})},
-args: ["anArray"],
-source: "todos: anArray\x0a\x09todos := anArray",
-messageSends: [],
-referencedClasses: []
-}),
-smalltalk.AppModel);
-
-smalltalk.addMethod(
-smalltalk.method({
-selector: "todosNotDone",
-category: 'accessing',
-fn: function (){
-var self=this;
-return smalltalk.withContext(function($ctx1) { 
-var $1;
-$1=_st(self._todos())._reject_((function(each){
-return smalltalk.withContext(function($ctx2) {
-return _st(each)._at_("done");
-}, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,1)})}));
-return $1;
-}, function($ctx1) {$ctx1.fill(self,"todosNotDone",{},smalltalk.AppModel)})},
-args: [],
-source: "todosNotDone\x0a    ^self todos reject: [ :each | each at: 'done' ]",
-messageSends: ["reject:", "todos", "at:"],
-referencedClasses: []
-}),
-smalltalk.AppModel);
-
-
-smalltalk.addMethod(
-smalltalk.method({
-selector: "classDoneXxx",
-category: '*Trapped-Todo',
-fn: function (){
-var self=this;
-return smalltalk.withContext(function($ctx1) {
-var $1;
-$1=self._dataToView_((function(carrier){
-return smalltalk.withContext(function($ctx2) {
-return _st(_st(carrier)._target())._class_("done-".__comma(_st(carrier)._value()));
-}, function($ctx2) {$ctx2.fillBlock({carrier:carrier},$ctx1,1)})}));
-return $1;
-}, function($ctx1) {$ctx1.fill(self,"classDoneXxx",{},smalltalk.TrappedProcessor.klass)})},
-args: [],
-source: "classDoneXxx\x0a\x09\x22This processor is not used any more,\x0a\x09it was replaced by generic\x0a\x09(replace ^ with ^done-) (attr class)\x0a\x09in HTML.\x0a\x0a\x09This example is left here to show how you can create quick\x0a\x09toView-only processor without class by just passing a block\x22\x0a\x0a\x09^self dataToView: [ :carrier | carrier target class: 'done-', carrier value ]",
-messageSends: ["dataToView:", "class:", "target", ",", "value"],
-referencedClasses: []
-}),
-smalltalk.TrappedProcessor.klass);
-
-});

+ 336 - 0
example-todo/src/Trapped-Todo.js

@@ -0,0 +1,336 @@
+define("trapped-todo/Trapped-Todo", ["amber/boot", "trapped/Trapped-Backend", "amber_core/Kernel-Objects", "trapped/Trapped-Frontend"], function($boot){
+var $core=$boot.api,nil=$boot.nil,$recv=$boot.asReceiver,$globals=$boot.globals;
+$core.addPackage('Trapped-Todo');
+$core.packages["Trapped-Todo"].innerEval = function (expr) { return eval(expr); };
+$core.packages["Trapped-Todo"].transport = {"type":"amd","amdNamespace":"trapped-todo"};
+
+$core.addClass('App', $globals.ListKeyedIsolatedEntity, [], 'Trapped-Todo');
+//>>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;
+function $SimpleKeyedPubSub(){return $globals.SimpleKeyedPubSub||(typeof SimpleKeyedPubSub=="undefined"?nil:SimpleKeyedPubSub)}
+function $AppModel(){return $globals.AppModel||(typeof AppModel=="undefined"?nil:AppModel)}
+//>>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.fn.prototype._initialize.apply($recv(self), []));
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+$ctx1.supercall = false;
+//>>excludeEnd("ctx");;
+$1=$recv($SimpleKeyedPubSub())._new();
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+$ctx1.sendIdx["new"]=1;
+//>>excludeEnd("ctx");
+self._dispatcher_($1);
+self._model_($recv($recv($AppModel())._new())._title_("Todo"));
+self._watch_do_([["todos"], nil],(function(){
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+return $core.withContext(function($ctx2) {
+//>>excludeEnd("ctx");
+return $recv(self._dispatcher())._changed_([["remaining"]]);
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+}, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
+//>>excludeEnd("ctx");
+}));
+$recv((function(){
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+return $core.withContext(function($ctx2) {
+//>>excludeEnd("ctx");
+return self._modify_do_([["todos"]],(function(){
+return [$globals.HashedCollection._newFromPairs_(["text","learn trapped","done",true]),$globals.HashedCollection._newFromPairs_(["text","build a trapped app","done",false])];
+
+}));
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+}, function($ctx2) {$ctx2.fillBlock({},$ctx1,2)});
+//>>excludeEnd("ctx");
+}))._valueWithTimeout_((2000));
+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 dispatcher: SimpleKeyedPubSub new.\x0a    self model: (AppModel new title: 'Todo').\x0a\x09self watch: #((todos) nil) do: [ self dispatcher changed: #((remaining)) ].\x0a    [ self modify: #((todos)) do: [{\x0a        #{'text'->'learn trapped'. 'done'->true}.\x0a        #{'text'->'build a trapped app'. 'done'->false}\x0a    }]] valueWithTimeout: 2000",
+referencedClasses: ["SimpleKeyedPubSub", "AppModel"],
+//>>excludeEnd("ide");
+messageSends: ["initialize", "dispatcher:", "new", "model:", "title:", "watch:do:", "changed:", "dispatcher", "valueWithTimeout:", "modify:do:"]
+}),
+$globals.App);
+
+
+
+$core.addClass('AppModel', $globals.Object, ['title', 'todos', 'todoText'], 'Trapped-Todo');
+//>>excludeStart("ide", pragmas.excludeIdeData);
+$globals.AppModel.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: "addTodo",
+protocol: 'action',
+fn: function (){
+var self=this;
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+return $core.withContext(function($ctx1) {
+//>>excludeEnd("ctx");
+$recv(self._todos())._add_($globals.HashedCollection._newFromPairs_(["text",self._todoText(),"done",false]));
+self._todoText_("");
+return self;
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+}, function($ctx1) {$ctx1.fill(self,"addTodo",{},$globals.AppModel)});
+//>>excludeEnd("ctx");
+},
+//>>excludeStart("ide", pragmas.excludeIdeData);
+args: [],
+source: "addTodo\x0a    self todos add: #{'text'->self todoText. 'done'->false}.\x0a    self todoText: ''",
+referencedClasses: [],
+//>>excludeEnd("ide");
+messageSends: ["add:", "todos", "todoText", "todoText:"]
+}),
+$globals.AppModel);
+
+$core.addMethod(
+$core.method({
+selector: "archive",
+protocol: 'action',
+fn: function (){
+var self=this;
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+return $core.withContext(function($ctx1) {
+//>>excludeEnd("ctx");
+self._todos_(self._todosNotDone());
+return self;
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+}, function($ctx1) {$ctx1.fill(self,"archive",{},$globals.AppModel)});
+//>>excludeEnd("ctx");
+},
+//>>excludeStart("ide", pragmas.excludeIdeData);
+args: [],
+source: "archive\x0a    self todos: self todosNotDone",
+referencedClasses: [],
+//>>excludeEnd("ide");
+messageSends: ["todos:", "todosNotDone"]
+}),
+$globals.AppModel);
+
+$core.addMethod(
+$core.method({
+selector: "remaining",
+protocol: 'accessing',
+fn: function (){
+var self=this;
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+return $core.withContext(function($ctx1) {
+//>>excludeEnd("ctx");
+var $1;
+$1=$recv(self._todosNotDone())._size();
+return $1;
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+}, function($ctx1) {$ctx1.fill(self,"remaining",{},$globals.AppModel)});
+//>>excludeEnd("ctx");
+},
+//>>excludeStart("ide", pragmas.excludeIdeData);
+args: [],
+source: "remaining\x0a    ^self todosNotDone size",
+referencedClasses: [],
+//>>excludeEnd("ide");
+messageSends: ["size", "todosNotDone"]
+}),
+$globals.AppModel);
+
+$core.addMethod(
+$core.method({
+selector: "title",
+protocol: 'accessing',
+fn: function (){
+var self=this;
+var $1;
+$1=self["@title"];
+return $1;
+
+},
+//>>excludeStart("ide", pragmas.excludeIdeData);
+args: [],
+source: "title\x0a\x09^title",
+referencedClasses: [],
+//>>excludeEnd("ide");
+messageSends: []
+}),
+$globals.AppModel);
+
+$core.addMethod(
+$core.method({
+selector: "title:",
+protocol: 'accessing',
+fn: function (aString){
+var self=this;
+self["@title"]=aString;
+return self;
+
+},
+//>>excludeStart("ide", pragmas.excludeIdeData);
+args: ["aString"],
+source: "title: aString\x0a\x09title := aString",
+referencedClasses: [],
+//>>excludeEnd("ide");
+messageSends: []
+}),
+$globals.AppModel);
+
+$core.addMethod(
+$core.method({
+selector: "todoText",
+protocol: 'accessing',
+fn: function (){
+var self=this;
+var $1;
+$1=self["@todoText"];
+return $1;
+
+},
+//>>excludeStart("ide", pragmas.excludeIdeData);
+args: [],
+source: "todoText\x0a\x09^todoText",
+referencedClasses: [],
+//>>excludeEnd("ide");
+messageSends: []
+}),
+$globals.AppModel);
+
+$core.addMethod(
+$core.method({
+selector: "todoText:",
+protocol: 'accessing',
+fn: function (aString){
+var self=this;
+self["@todoText"]=aString;
+return self;
+
+},
+//>>excludeStart("ide", pragmas.excludeIdeData);
+args: ["aString"],
+source: "todoText: aString\x0a\x09todoText := aString",
+referencedClasses: [],
+//>>excludeEnd("ide");
+messageSends: []
+}),
+$globals.AppModel);
+
+$core.addMethod(
+$core.method({
+selector: "todos",
+protocol: 'accessing',
+fn: function (){
+var self=this;
+var $1;
+$1=self["@todos"];
+return $1;
+
+},
+//>>excludeStart("ide", pragmas.excludeIdeData);
+args: [],
+source: "todos\x0a\x09^todos",
+referencedClasses: [],
+//>>excludeEnd("ide");
+messageSends: []
+}),
+$globals.AppModel);
+
+$core.addMethod(
+$core.method({
+selector: "todos:",
+protocol: 'accessing',
+fn: function (anArray){
+var self=this;
+self["@todos"]=anArray;
+return self;
+
+},
+//>>excludeStart("ide", pragmas.excludeIdeData);
+args: ["anArray"],
+source: "todos: anArray\x0a\x09todos := anArray",
+referencedClasses: [],
+//>>excludeEnd("ide");
+messageSends: []
+}),
+$globals.AppModel);
+
+$core.addMethod(
+$core.method({
+selector: "todosNotDone",
+protocol: 'accessing',
+fn: function (){
+var self=this;
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+return $core.withContext(function($ctx1) {
+//>>excludeEnd("ctx");
+var $1;
+$1=$recv(self._todos())._reject_((function(each){
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+return $core.withContext(function($ctx2) {
+//>>excludeEnd("ctx");
+return $recv(each)._at_("done");
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+}, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,1)});
+//>>excludeEnd("ctx");
+}));
+return $1;
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+}, function($ctx1) {$ctx1.fill(self,"todosNotDone",{},$globals.AppModel)});
+//>>excludeEnd("ctx");
+},
+//>>excludeStart("ide", pragmas.excludeIdeData);
+args: [],
+source: "todosNotDone\x0a    ^self todos reject: [ :each | each at: 'done' ]",
+referencedClasses: [],
+//>>excludeEnd("ide");
+messageSends: ["reject:", "todos", "at:"]
+}),
+$globals.AppModel);
+
+
+$core.addMethod(
+$core.method({
+selector: "classDoneXxx",
+protocol: '*Trapped-Todo',
+fn: function (){
+var self=this;
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+return $core.withContext(function($ctx1) {
+//>>excludeEnd("ctx");
+var $1;
+$1=self._dataToView_((function(carrier){
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+return $core.withContext(function($ctx2) {
+//>>excludeEnd("ctx");
+return $recv($recv(carrier)._target())._class_("done-".__comma($recv(carrier)._value()));
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+}, function($ctx2) {$ctx2.fillBlock({carrier:carrier},$ctx1,1)});
+//>>excludeEnd("ctx");
+}));
+return $1;
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+}, function($ctx1) {$ctx1.fill(self,"classDoneXxx",{},$globals.TrappedProcessor.klass)});
+//>>excludeEnd("ctx");
+},
+//>>excludeStart("ide", pragmas.excludeIdeData);
+args: [],
+source: "classDoneXxx\x0a\x09\x22This processor is not used any more,\x0a\x09it was replaced by generic\x0a\x09(replace ^ with ^done-) (attr class)\x0a\x09in HTML.\x0a\x0a\x09This example is left here to show how you can create quick\x0a\x09toView-only processor without class by just passing a block\x22\x0a\x0a\x09^self dataToView: [ :carrier | carrier target class: 'done-', carrier value ]",
+referencedClasses: [],
+//>>excludeEnd("ide");
+messageSends: ["dataToView:", "class:", "target", ",", "value"]
+}),
+$globals.TrappedProcessor.klass);
+
+});

+ 1 - 1
example-todo/st/Trapped-Todo.st → example-todo/src/Trapped-Todo.st

@@ -1,4 +1,4 @@
-Smalltalk current createPackage: 'Trapped-Todo'!
+Smalltalk createPackage: 'Trapped-Todo'!
 ListKeyedIsolatedEntity subclass: #App
 	instanceVariableNames: ''
 	package: 'Trapped-Todo'!

+ 12 - 22
example-todo/todo.html

@@ -7,34 +7,24 @@
             display: none
         }
     </style>
-    <script src="../bower_components/amber/support/amber.js"></script>
-    <script type='text/javascript' src='../bower_components/amber/support/requirejs/require.min.js'></script>
+    <meta name="author" content="Herbert Vojčík" />
     <link rel="stylesheet" href="todo.css"/>
+    <script type='text/javascript' src='../the.js'></script>
     <script type="text/javascript">
         var blackboard;
-        require.config({
-            shim: {
-                'amber_lib/xontent/jquery.xontent': {
-                    deps: [ 'jquery' ]
-                }
-            },
-            paths: {
-                'gh_herby_trapped': '../js',
-                'gh_herby_trapped_todo': 'js',
-                'gh_herby_trapped_todo/_source': 'st'
-            }
-        });
+        require.config({baseUrl: '..'});
         require(
-                ["amber/devel",
-                    "gh_herby_trapped/Trapped-Processors", "gh_herby_trapped_todo/Trapped-Todo", "amber_lib/xontent/jquery.xontent" ],
-                function (smalltalk) {
-                    smalltalk.defaultAmdNamespace = 'gh_herby_trapped_todo';
-                    smalltalk.initialize();
+                ["app", "trapped-todo/Trapped-Todo"],
+                function (amber) {
+                    amber.initialize({
+                        //used for all new packages in IDE
+                        'transport.defaultAmdNamespace': "trapped-todo"
+                    });
+                    require(["amber-ide-starter-dialog"], function (dlg) { dlg.start(); });
 
                     $(function () {
-                        smalltalk.Browser._openOn_(smalltalk.App);
-                        blackboard = smalltalk.App._new();
-                        smalltalk.Trapped._start_([blackboard]);
+                        blackboard = amber.globals.App._new();
+                        amber.globals.Trapped._start_([blackboard]);
                     });
                 }
         );

+ 23 - 0
index.html

@@ -0,0 +1,23 @@
+<!DOCTYPE html>
+<html>
+
+  <head>
+    <title>Trapped</title>
+    <meta http-equiv="content-type" content="text/html; charset=utf-8" />
+    <meta name="author" content="Herbert Vojčík" />
+    <script type='text/javascript' src='the.js'></script>
+  </head>
+
+  <body>
+  <script type='text/javascript'>
+      require(['app'], function (amber) {
+          amber.initialize({
+            //used for all new packages in IDE
+            'transport.defaultAmdNamespace': "trapped"
+          });
+          require(["amber-ide-starter-dialog"], function (dlg) { dlg.start(); });
+      });
+  </script>
+  </body>
+
+</html>

+ 5 - 0
jquery.amd.json

@@ -0,0 +1,5 @@
+{
+    "paths": {
+        "jquery": ["dist/jquery", "jquery"]
+    }
+}

+ 0 - 1017
js/Trapped-Backend.js

@@ -1,1017 +0,0 @@
-define("gh_herby_trapped/Trapped-Backend", ["amber_vm/smalltalk", "amber_vm/nil", "amber_vm/_st", "amber_core/Kernel-Objects", "amber_core/Kernel-Exceptions", "amber_core/Kernel-Collections"], function(smalltalk,nil,_st){
-smalltalk.addPackage('Trapped-Backend');
-smalltalk.packages["Trapped-Backend"].transport = {"type":"amd","amdNamespace":"gh_herby_trapped"};
-
-smalltalk.addClass('EavModel', smalltalk.Object, ['getBlock', 'putBlock'], 'Trapped-Backend');
-smalltalk.EavModel.comment="External actor value model.";
-smalltalk.addMethod(
-smalltalk.method({
-selector: "getBlock:",
-category: 'accessing',
-fn: function (aBlock){
-var self=this;
-return smalltalk.withContext(function($ctx1) { 
-self["@getBlock"]=aBlock;
-return self}, function($ctx1) {$ctx1.fill(self,"getBlock:",{aBlock:aBlock},smalltalk.EavModel)})},
-args: ["aBlock"],
-source: "getBlock: aBlock\x0a\x0agetBlock := aBlock",
-messageSends: [],
-referencedClasses: []
-}),
-smalltalk.EavModel);
-
-smalltalk.addMethod(
-smalltalk.method({
-selector: "initialize",
-category: 'initialization',
-fn: function (){
-var self=this;
-return smalltalk.withContext(function($ctx1) { 
-smalltalk.EavModel.superclass.fn.prototype._initialize.apply(_st(self), []);
-self["@getBlock"]=(function(){
-return smalltalk.withContext(function($ctx2) {
-return self._error_("No getter block.");
-$ctx2.sendIdx["error:"]=1;
-}, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})});
-self["@putBlock"]=(function(){
-return smalltalk.withContext(function($ctx2) {
-return self._error_("No putter block.");
-}, function($ctx2) {$ctx2.fillBlock({},$ctx1,2)})});
-return self}, function($ctx1) {$ctx1.fill(self,"initialize",{},smalltalk.EavModel)})},
-args: [],
-source: "initialize\x0a\x09super initialize.\x0a\x09getBlock := [ self error: 'No getter block.' ].\x0a\x09putBlock := [ self error: 'No putter block.' ].",
-messageSends: ["initialize", "error:"],
-referencedClasses: []
-}),
-smalltalk.EavModel);
-
-smalltalk.addMethod(
-smalltalk.method({
-selector: "on:",
-category: 'accessing',
-fn: function (anObject){
-var self=this;
-return smalltalk.withContext(function($ctx1) { 
-var $1;
-$1=_st(self["@getBlock"])._value_(anObject);
-return $1;
-}, function($ctx1) {$ctx1.fill(self,"on:",{anObject:anObject},smalltalk.EavModel)})},
-args: ["anObject"],
-source: "on: anObject\x0a\x22Returns value of model applied on object\x22\x0a\x0a^getBlock value: anObject",
-messageSends: ["value:"],
-referencedClasses: []
-}),
-smalltalk.EavModel);
-
-smalltalk.addMethod(
-smalltalk.method({
-selector: "on:put:",
-category: 'accessing',
-fn: function (anObject,anObject2){
-var self=this;
-return smalltalk.withContext(function($ctx1) { 
-var $1;
-$1=_st(self["@putBlock"])._value_value_(anObject,anObject2);
-return $1;
-}, function($ctx1) {$ctx1.fill(self,"on:put:",{anObject:anObject,anObject2:anObject2},smalltalk.EavModel)})},
-args: ["anObject", "anObject2"],
-source: "on: anObject put: anObject2\x0a\x22Puts a value via model applied on object\x22\x0a\x0a^putBlock value: anObject value: anObject2",
-messageSends: ["value:value:"],
-referencedClasses: []
-}),
-smalltalk.EavModel);
-
-smalltalk.addMethod(
-smalltalk.method({
-selector: "putBlock:",
-category: 'accessing',
-fn: function (aBlock){
-var self=this;
-return smalltalk.withContext(function($ctx1) { 
-self["@putBlock"]=aBlock;
-return self}, function($ctx1) {$ctx1.fill(self,"putBlock:",{aBlock:aBlock},smalltalk.EavModel)})},
-args: ["aBlock"],
-source: "putBlock: aBlock\x0a\x0aputBlock := aBlock",
-messageSends: [],
-referencedClasses: []
-}),
-smalltalk.EavModel);
-
-
-
-smalltalk.addClass('Isolator', smalltalk.Object, ['root'], 'Trapped-Backend');
-smalltalk.addMethod(
-smalltalk.method({
-selector: "model:modify:",
-category: 'action',
-fn: function (anEavModel,aBlock){
-var self=this;
-var newValue;
-return smalltalk.withContext(function($ctx1) { 
-newValue=_st(aBlock)._value_(_st(anEavModel)._on_(self));
-_st(anEavModel)._on_put_(self,_st(newValue)._deepCopy());
-return self}, function($ctx1) {$ctx1.fill(self,"model:modify:",{anEavModel:anEavModel,aBlock:aBlock,newValue:newValue},smalltalk.Isolator)})},
-args: ["anEavModel", "aBlock"],
-source: "model: anEavModel modify: aBlock\x0a\x0a| newValue |\x0anewValue := aBlock value: (anEavModel on: self).\x0aanEavModel on: self put: newValue deepCopy",
-messageSends: ["value:", "on:", "on:put:", "deepCopy"],
-referencedClasses: []
-}),
-smalltalk.Isolator);
-
-smalltalk.addMethod(
-smalltalk.method({
-selector: "model:read:",
-category: 'action',
-fn: function (anEavModel,aBlock){
-var self=this;
-return smalltalk.withContext(function($ctx1) { 
-_st(aBlock)._value_(_st(_st(anEavModel)._on_(self))._deepCopy());
-return self}, function($ctx1) {$ctx1.fill(self,"model:read:",{anEavModel:anEavModel,aBlock:aBlock},smalltalk.Isolator)})},
-args: ["anEavModel", "aBlock"],
-source: "model: anEavModel read: aBlock\x0a\x0aaBlock value: (anEavModel on: self) deepCopy",
-messageSends: ["value:", "deepCopy", "on:"],
-referencedClasses: []
-}),
-smalltalk.Isolator);
-
-smalltalk.addMethod(
-smalltalk.method({
-selector: "root",
-category: 'accessing',
-fn: function (){
-var self=this;
-return smalltalk.withContext(function($ctx1) { 
-var $1;
-$1=self["@root"];
-return $1;
-}, function($ctx1) {$ctx1.fill(self,"root",{},smalltalk.Isolator)})},
-args: [],
-source: "root\x0a\x0a^root",
-messageSends: [],
-referencedClasses: []
-}),
-smalltalk.Isolator);
-
-smalltalk.addMethod(
-smalltalk.method({
-selector: "root:",
-category: 'accessing',
-fn: function (anObject){
-var self=this;
-return smalltalk.withContext(function($ctx1) { 
-self["@root"]=anObject;
-return self}, function($ctx1) {$ctx1.fill(self,"root:",{anObject:anObject},smalltalk.Isolator)})},
-args: ["anObject"],
-source: "root: anObject\x0a\x0aroot := anObject",
-messageSends: [],
-referencedClasses: []
-}),
-smalltalk.Isolator);
-
-
-smalltalk.addMethod(
-smalltalk.method({
-selector: "on:",
-category: 'instance creation',
-fn: function (anObject){
-var self=this;
-return smalltalk.withContext(function($ctx1) { 
-var $1;
-$1=_st(self._new())._root_(anObject);
-return $1;
-}, function($ctx1) {$ctx1.fill(self,"on:",{anObject:anObject},smalltalk.Isolator.klass)})},
-args: ["anObject"],
-source: "on: anObject\x0a^self new root: anObject",
-messageSends: ["root:", "new"],
-referencedClasses: []
-}),
-smalltalk.Isolator.klass);
-
-
-smalltalk.addClass('KeyedPubSubBase', smalltalk.Object, ['factory'], 'Trapped-Backend');
-smalltalk.KeyedPubSubBase.comment="I represent a pub-sub based on a key.\x0d\x0aI manage key-block subscriptions as well as running blocks that are dirty.\x0d\x0aThe subscription objects are reponsible of decision if the change is relevant for them.\x0d\x0aSubscription object must be subclasses of KeyedSubscriptionBase.\x0d\x0a\x0d\x0aMy subclasses must provide implementation for:\x0d\x0a\x09add:\x0d\x0a    do:\x0d\x0a    clean\x0d\x0a    (optionally) run\x0d\x0a\x0d\x0aand issue this call before actual use:\x0d\x0a\x09subscritionFactory: (setting [:key:block|...] factory that creates appropriate subscription)";
-smalltalk.addMethod(
-smalltalk.method({
-selector: "changed:",
-category: 'action',
-fn: function (key){
-var self=this;
-var needsToRun;
-return smalltalk.withContext(function($ctx1) { 
-var $1;
-needsToRun=false;
-self._do_((function(each){
-return smalltalk.withContext(function($ctx2) {
-$1=_st(each)._accepts_(key);
-if(smalltalk.assert($1)){
-_st(each)._flag();
-needsToRun=true;
-return needsToRun;
-};
-}, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,1)})}));
-self._dirty_(needsToRun);
-return self}, function($ctx1) {$ctx1.fill(self,"changed:",{key:key,needsToRun:needsToRun},smalltalk.KeyedPubSubBase)})},
-args: ["key"],
-source: "changed: key\x0a\x09| needsToRun |\x0a    needsToRun := false.\x0a\x09self do: [ :each |\x0a\x09\x09(each accepts: key) ifTrue: [\x0a\x09\x09\x09each flag.\x0a            needsToRun := true.\x0a\x09\x09]\x0a\x09].\x0a\x09self dirty: needsToRun",
-messageSends: ["do:", "ifTrue:", "accepts:", "flag", "dirty:"],
-referencedClasses: []
-}),
-smalltalk.KeyedPubSubBase);
-
-smalltalk.addMethod(
-smalltalk.method({
-selector: "dirty:",
-category: 'action',
-fn: function (aBoolean){
-var self=this;
-return smalltalk.withContext(function($ctx1) { 
-if(smalltalk.assert(aBoolean)){
-_st((function(){
-return smalltalk.withContext(function($ctx2) {
-return self._run();
-}, function($ctx2) {$ctx2.fillBlock({},$ctx1,2)})}))._fork();
-};
-return self}, function($ctx1) {$ctx1.fill(self,"dirty:",{aBoolean:aBoolean},smalltalk.KeyedPubSubBase)})},
-args: ["aBoolean"],
-source: "dirty: aBoolean\x0a\x09aBoolean ifTrue: [[ self run ] fork]",
-messageSends: ["ifTrue:", "fork", "run"],
-referencedClasses: []
-}),
-smalltalk.KeyedPubSubBase);
-
-smalltalk.addMethod(
-smalltalk.method({
-selector: "on:hook:",
-category: 'action',
-fn: function (key,aBlock){
-var self=this;
-return smalltalk.withContext(function($ctx1) { 
-self._add_(_st(_st(self["@factory"])._value_value_(key,aBlock))._flag());
-self._dirty_(true);
-return self}, function($ctx1) {$ctx1.fill(self,"on:hook:",{key:key,aBlock:aBlock},smalltalk.KeyedPubSubBase)})},
-args: ["key", "aBlock"],
-source: "on: key hook: aBlock\x0a\x09self add: (factory value: key value: aBlock) flag.\x0a   \x09self dirty: true",
-messageSends: ["add:", "flag", "value:value:", "dirty:"],
-referencedClasses: []
-}),
-smalltalk.KeyedPubSubBase);
-
-smalltalk.addMethod(
-smalltalk.method({
-selector: "run",
-category: 'action',
-fn: function (){
-var self=this;
-function $Error(){return smalltalk.Error||(typeof Error=="undefined"?nil:Error)}
-return smalltalk.withContext(function($ctx1) { 
-var $1,$2,$3;
-_st((function(){
-var needsClean;
-return smalltalk.withContext(function($ctx2) {
-needsClean=false;
-needsClean;
-self._do_((function(each){
-return smalltalk.withContext(function($ctx3) {
-$1=_st(each)._isFlagged();
-if(smalltalk.assert($1)){
-_st(each)._run();
-};
-$2=_st(each)._isEnabled();
-if(! smalltalk.assert($2)){
-needsClean=true;
-return needsClean;
-};
-}, function($ctx3) {$ctx3.fillBlock({each:each},$ctx2,2)})}));
-$3=needsClean;
-if(smalltalk.assert($3)){
-return self._clean();
-};
-}, function($ctx2) {$ctx2.fillBlock({needsClean:needsClean},$ctx1,1)})}))._on_do_($Error(),(function(){
-return smalltalk.withContext(function($ctx2) {
-return self._dirty_(true);
-}, function($ctx2) {$ctx2.fillBlock({},$ctx1,6)})}));
-return self}, function($ctx1) {$ctx1.fill(self,"run",{},smalltalk.KeyedPubSubBase)})},
-args: [],
-source: "run\x0a\x09[\x0a\x09\x09| needsClean |\x0a\x09    needsClean := false.\x0a\x09\x09self do: [ :each |\x0a\x09\x09\x09each isFlagged ifTrue: [ each run ].\x0a\x09        each isEnabled ifFalse: [ needsClean := true ]\x0a\x09\x09].\x0a    \x09needsClean ifTrue: [ self clean ]\x0a\x09] on: Error do: [ self dirty: true ]",
-messageSends: ["on:do:", "do:", "ifTrue:", "isFlagged", "run", "ifFalse:", "isEnabled", "clean", "dirty:"],
-referencedClasses: ["Error"]
-}),
-smalltalk.KeyedPubSubBase);
-
-smalltalk.addMethod(
-smalltalk.method({
-selector: "subscriptionFactory:",
-category: 'action',
-fn: function (aBlock){
-var self=this;
-return smalltalk.withContext(function($ctx1) { 
-self["@factory"]=aBlock;
-return self}, function($ctx1) {$ctx1.fill(self,"subscriptionFactory:",{aBlock:aBlock},smalltalk.KeyedPubSubBase)})},
-args: ["aBlock"],
-source: "subscriptionFactory: aBlock\x0a    factory := aBlock",
-messageSends: [],
-referencedClasses: []
-}),
-smalltalk.KeyedPubSubBase);
-
-
-
-smalltalk.addClass('SimpleKeyedPubSub', smalltalk.KeyedPubSubBase, ['queue'], 'Trapped-Backend');
-smalltalk.addMethod(
-smalltalk.method({
-selector: "add:",
-category: 'accessing',
-fn: function (aSubscription){
-var self=this;
-return smalltalk.withContext(function($ctx1) { 
-_st(self["@queue"])._add_(aSubscription);
-return self}, function($ctx1) {$ctx1.fill(self,"add:",{aSubscription:aSubscription},smalltalk.SimpleKeyedPubSub)})},
-args: ["aSubscription"],
-source: "add: aSubscription\x0a\x09queue add: aSubscription.",
-messageSends: ["add:"],
-referencedClasses: []
-}),
-smalltalk.SimpleKeyedPubSub);
-
-smalltalk.addMethod(
-smalltalk.method({
-selector: "clean",
-category: 'bookkeeping',
-fn: function (){
-var self=this;
-return smalltalk.withContext(function($ctx1) { 
-self["@queue"]=_st(self["@queue"])._select_((function(each){
-return smalltalk.withContext(function($ctx2) {
-return _st(each)._isEnabled();
-}, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,1)})}));
-return self}, function($ctx1) {$ctx1.fill(self,"clean",{},smalltalk.SimpleKeyedPubSub)})},
-args: [],
-source: "clean\x0a\x09queue := queue select: [ :each | each isEnabled ]",
-messageSends: ["select:", "isEnabled"],
-referencedClasses: []
-}),
-smalltalk.SimpleKeyedPubSub);
-
-smalltalk.addMethod(
-smalltalk.method({
-selector: "do:",
-category: 'enumeration',
-fn: function (aBlock){
-var self=this;
-return smalltalk.withContext(function($ctx1) { 
-_st(self["@queue"])._do_(aBlock);
-return self}, function($ctx1) {$ctx1.fill(self,"do:",{aBlock:aBlock},smalltalk.SimpleKeyedPubSub)})},
-args: ["aBlock"],
-source: "do: aBlock\x0a\x09queue do: aBlock",
-messageSends: ["do:"],
-referencedClasses: []
-}),
-smalltalk.SimpleKeyedPubSub);
-
-smalltalk.addMethod(
-smalltalk.method({
-selector: "initialize",
-category: 'initialization',
-fn: function (){
-var self=this;
-function $OrderedCollection(){return smalltalk.OrderedCollection||(typeof OrderedCollection=="undefined"?nil:OrderedCollection)}
-return smalltalk.withContext(function($ctx1) { 
-smalltalk.SimpleKeyedPubSub.superclass.fn.prototype._initialize.apply(_st(self), []);
-self["@queue"]=_st($OrderedCollection())._new();
-return self}, function($ctx1) {$ctx1.fill(self,"initialize",{},smalltalk.SimpleKeyedPubSub)})},
-args: [],
-source: "initialize\x0a    super initialize.\x0a\x09queue := OrderedCollection new",
-messageSends: ["initialize", "new"],
-referencedClasses: ["OrderedCollection"]
-}),
-smalltalk.SimpleKeyedPubSub);
-
-
-
-smalltalk.addClass('KeyedPubSubUnsubscribe', smalltalk.Error, [], 'Trapped-Backend');
-smalltalk.KeyedPubSubUnsubscribe.comment="SIgnal me from the subscription block to unsubscribe it.";
-
-
-smalltalk.addClass('KeyedSubscriptionBase', smalltalk.Object, ['key', 'actionBlock', 'flagged'], 'Trapped-Backend');
-smalltalk.addMethod(
-smalltalk.method({
-selector: "accepts:",
-category: 'testing',
-fn: function (aKey){
-var self=this;
-return smalltalk.withContext(function($ctx1) { 
-self._subclassResponsibility();
-return self}, function($ctx1) {$ctx1.fill(self,"accepts:",{aKey:aKey},smalltalk.KeyedSubscriptionBase)})},
-args: ["aKey"],
-source: "accepts: aKey\x0a    \x22Should return true if change for aKey is relevant for this subscription\x22\x0a    self subclassResponsibility",
-messageSends: ["subclassResponsibility"],
-referencedClasses: []
-}),
-smalltalk.KeyedSubscriptionBase);
-
-smalltalk.addMethod(
-smalltalk.method({
-selector: "flag",
-category: 'accessing',
-fn: function (){
-var self=this;
-return smalltalk.withContext(function($ctx1) { 
-self["@flagged"]=true;
-return self}, function($ctx1) {$ctx1.fill(self,"flag",{},smalltalk.KeyedSubscriptionBase)})},
-args: [],
-source: "flag\x0a\x09flagged := true",
-messageSends: [],
-referencedClasses: []
-}),
-smalltalk.KeyedSubscriptionBase);
-
-smalltalk.addMethod(
-smalltalk.method({
-selector: "initialize",
-category: 'initialization',
-fn: function (){
-var self=this;
-return smalltalk.withContext(function($ctx1) { 
-smalltalk.KeyedSubscriptionBase.superclass.fn.prototype._initialize.apply(_st(self), []);
-self["@key"]=nil;
-self["@actionBlock"]=nil;
-self["@flagged"]=false;
-return self}, function($ctx1) {$ctx1.fill(self,"initialize",{},smalltalk.KeyedSubscriptionBase)})},
-args: [],
-source: "initialize\x0a\x09super initialize.\x0a    key := nil.\x0a    actionBlock := nil.\x0a    flagged := false.",
-messageSends: ["initialize"],
-referencedClasses: []
-}),
-smalltalk.KeyedSubscriptionBase);
-
-smalltalk.addMethod(
-smalltalk.method({
-selector: "isEnabled",
-category: 'testing',
-fn: function (){
-var self=this;
-return smalltalk.withContext(function($ctx1) { 
-var $1;
-$1=_st(self["@actionBlock"])._notNil();
-return $1;
-}, function($ctx1) {$ctx1.fill(self,"isEnabled",{},smalltalk.KeyedSubscriptionBase)})},
-args: [],
-source: "isEnabled\x0a\x09^actionBlock notNil",
-messageSends: ["notNil"],
-referencedClasses: []
-}),
-smalltalk.KeyedSubscriptionBase);
-
-smalltalk.addMethod(
-smalltalk.method({
-selector: "isFlagged",
-category: 'testing',
-fn: function (){
-var self=this;
-return smalltalk.withContext(function($ctx1) { 
-var $1;
-$1=self["@flagged"];
-return $1;
-}, function($ctx1) {$ctx1.fill(self,"isFlagged",{},smalltalk.KeyedSubscriptionBase)})},
-args: [],
-source: "isFlagged\x0a\x09^flagged",
-messageSends: [],
-referencedClasses: []
-}),
-smalltalk.KeyedSubscriptionBase);
-
-smalltalk.addMethod(
-smalltalk.method({
-selector: "key:block:",
-category: 'accessing',
-fn: function (anObject,aBlock){
-var self=this;
-return smalltalk.withContext(function($ctx1) { 
-self["@key"]=anObject;
-self["@actionBlock"]=aBlock;
-return self}, function($ctx1) {$ctx1.fill(self,"key:block:",{anObject:anObject,aBlock:aBlock},smalltalk.KeyedSubscriptionBase)})},
-args: ["anObject", "aBlock"],
-source: "key: anObject block: aBlock\x0a\x09key := anObject.\x0a    actionBlock := aBlock",
-messageSends: [],
-referencedClasses: []
-}),
-smalltalk.KeyedSubscriptionBase);
-
-smalltalk.addMethod(
-smalltalk.method({
-selector: "run",
-category: 'action',
-fn: function (){
-var self=this;
-function $KeyedPubSubUnsubscribe(){return smalltalk.KeyedPubSubUnsubscribe||(typeof KeyedPubSubUnsubscribe=="undefined"?nil:KeyedPubSubUnsubscribe)}
-return smalltalk.withContext(function($ctx1) { 
-_st((function(){
-return smalltalk.withContext(function($ctx2) {
-self["@flagged"]=false;
-self["@flagged"];
-return _st(self["@actionBlock"])._value();
-}, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})}))._on_do_($KeyedPubSubUnsubscribe(),(function(){
-return smalltalk.withContext(function($ctx2) {
-self["@actionBlock"]=nil;
-return self["@actionBlock"];
-}, function($ctx2) {$ctx2.fillBlock({},$ctx1,2)})}));
-return self}, function($ctx1) {$ctx1.fill(self,"run",{},smalltalk.KeyedSubscriptionBase)})},
-args: [],
-source: "run\x0a\x09[ flagged := false. actionBlock value ]\x0a    on: KeyedPubSubUnsubscribe do: [ actionBlock := nil ]",
-messageSends: ["on:do:", "value"],
-referencedClasses: ["KeyedPubSubUnsubscribe"]
-}),
-smalltalk.KeyedSubscriptionBase);
-
-
-
-smalltalk.addClass('ListKeyedSubscription', smalltalk.KeyedSubscriptionBase, [], 'Trapped-Backend');
-smalltalk.addMethod(
-smalltalk.method({
-selector: "accepts:",
-category: 'testing',
-fn: function (aKey){
-var self=this;
-return smalltalk.withContext(function($ctx1) { 
-var $3,$4,$2,$1;
-$3=_st(aKey)._size();
-$ctx1.sendIdx["size"]=1;
-$4=_st(self["@key"])._size();
-$ctx1.sendIdx["size"]=2;
-$2=_st($3).__lt_eq($4);
-$1=_st($2)._and_((function(){
-return smalltalk.withContext(function($ctx2) {
-return _st(aKey).__eq(_st(self["@key"])._copyFrom_to_((1),_st(aKey)._size()));
-}, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})}));
-return $1;
-}, function($ctx1) {$ctx1.fill(self,"accepts:",{aKey:aKey},smalltalk.ListKeyedSubscription)})},
-args: ["aKey"],
-source: "accepts: aKey\x0a    ^aKey size <= key size and: [aKey = (key copyFrom: 1 to: aKey size)]",
-messageSends: ["and:", "<=", "size", "=", "copyFrom:to:"],
-referencedClasses: []
-}),
-smalltalk.ListKeyedSubscription);
-
-
-
-smalltalk.addClass('TwoWayListKeyedSubscription', smalltalk.KeyedSubscriptionBase, [], 'Trapped-Backend');
-smalltalk.addMethod(
-smalltalk.method({
-selector: "accepts:",
-category: 'testing',
-fn: function (aKey){
-var self=this;
-return smalltalk.withContext(function($ctx1) { 
-var $3,$4,$2,$6,$7,$5,$1;
-$3=_st(aKey)._size();
-$ctx1.sendIdx["size"]=1;
-$4=_st(self["@key"])._size();
-$ctx1.sendIdx["size"]=2;
-$2=_st($3).__lt_eq($4);
-if(smalltalk.assert($2)){
-$6=self["@key"];
-$7=_st(aKey)._size();
-$ctx1.sendIdx["size"]=3;
-$5=_st($6)._copyFrom_to_((1),$7);
-$ctx1.sendIdx["copyFrom:to:"]=1;
-$1=_st(aKey).__eq($5);
-$ctx1.sendIdx["="]=1;
-} else {
-$1=_st(self["@key"]).__eq(_st(aKey)._copyFrom_to_((1),_st(self["@key"])._size()));
-};
-return $1;
-}, function($ctx1) {$ctx1.fill(self,"accepts:",{aKey:aKey},smalltalk.TwoWayListKeyedSubscription)})},
-args: ["aKey"],
-source: "accepts: aKey\x0a    ^aKey size <= key size\x0a\x09\x09ifTrue: [aKey = (key copyFrom: 1 to: aKey size)]\x0a\x09\x09ifFalse: [key = (aKey copyFrom: 1 to: key size)]",
-messageSends: ["ifTrue:ifFalse:", "<=", "size", "=", "copyFrom:to:"],
-referencedClasses: []
-}),
-smalltalk.TwoWayListKeyedSubscription);
-
-
-
-smalltalk.addClass('ListKeyedEntity', smalltalk.Object, ['dispatcher', 'payload'], 'Trapped-Backend');
-smalltalk.ListKeyedEntity.comment="I am base class for #('string-at-index' #selector numeric-at-index)-array-path-keyed entities,\x0d\x0athat moderate access to the wrapped model object via read;do and modify:do:\x0d\x0aand allow pub-sub via watch:do:.\x0d\x0aThis wrapped model can be any smalltalk object.\x0d\x0a\x0d\x0aMy subclasses need to provide implementation for:\x0d\x0a\x09read:do:\x0d\x0a    modify:do:\x0d\x0a\x0d\x0aand must issue these calls when initializing:\x0d\x0a\x09model: (with a wrapped object)\x0d\x0a\x09dispatcher: (with a subclass of KeyedPubSubBase)";
-smalltalk.addMethod(
-smalltalk.method({
-selector: "dispatcher",
-category: 'accessing',
-fn: function (){
-var self=this;
-return smalltalk.withContext(function($ctx1) { 
-var $1;
-$1=self["@dispatcher"];
-return $1;
-}, function($ctx1) {$ctx1.fill(self,"dispatcher",{},smalltalk.ListKeyedEntity)})},
-args: [],
-source: "dispatcher\x0a\x09^dispatcher",
-messageSends: [],
-referencedClasses: []
-}),
-smalltalk.ListKeyedEntity);
-
-smalltalk.addMethod(
-smalltalk.method({
-selector: "dispatcher:",
-category: 'accessing',
-fn: function (aDispatcher){
-var self=this;
-function $TwoWayListKeyedSubscription(){return smalltalk.TwoWayListKeyedSubscription||(typeof TwoWayListKeyedSubscription=="undefined"?nil:TwoWayListKeyedSubscription)}
-function $ListKeyedSubscription(){return smalltalk.ListKeyedSubscription||(typeof ListKeyedSubscription=="undefined"?nil:ListKeyedSubscription)}
-return smalltalk.withContext(function($ctx1) { 
-var $1,$2,$3,$4,$5,$6;
-_st(aDispatcher)._subscriptionFactory_((function(key,block){
-return smalltalk.withContext(function($ctx2) {
-$1=_st(_st(key)._notEmpty())._and_((function(){
-return smalltalk.withContext(function($ctx3) {
-return _st(_st(key)._last())._isNil();
-}, function($ctx3) {$ctx3.fillBlock({},$ctx2,2)})}));
-if(smalltalk.assert($1)){
-$2=_st($TwoWayListKeyedSubscription())._new();
-$ctx2.sendIdx["new"]=1;
-_st($2)._key_block_(_st(key)._allButLast(),block);
-$ctx2.sendIdx["key:block:"]=1;
-$3=_st($2)._yourself();
-$ctx2.sendIdx["yourself"]=1;
-return $3;
-} else {
-$4=_st($ListKeyedSubscription())._new();
-_st($4)._key_block_(key,block);
-$5=_st($4)._yourself();
-$ctx2.sendIdx["yourself"]=2;
-return $5;
-};
-}, function($ctx2) {$ctx2.fillBlock({key:key,block:block},$ctx1,1)})}));
-$6=_st(aDispatcher)._yourself();
-self["@dispatcher"]=$6;
-return self}, function($ctx1) {$ctx1.fill(self,"dispatcher:",{aDispatcher:aDispatcher},smalltalk.ListKeyedEntity)})},
-args: ["aDispatcher"],
-source: "dispatcher: aDispatcher\x0a\x09dispatcher := aDispatcher\x0a        subscriptionFactory: [ :key :block |\x0a\x09\x09\x09(key notEmpty and: [ key last isNil ])\x0a\x09\x09\x09\x09ifTrue: [ TwoWayListKeyedSubscription new key: key allButLast block: block; yourself ]\x0a\x09\x09\x09\x09ifFalse: [ ListKeyedSubscription new key: key block: block; yourself ]];\x0a        yourself",
-messageSends: ["subscriptionFactory:", "ifTrue:ifFalse:", "and:", "notEmpty", "isNil", "last", "key:block:", "new", "allButLast", "yourself"],
-referencedClasses: ["TwoWayListKeyedSubscription", "ListKeyedSubscription"]
-}),
-smalltalk.ListKeyedEntity);
-
-smalltalk.addMethod(
-smalltalk.method({
-selector: "model:",
-category: 'accessing',
-fn: function (anObject){
-var self=this;
-return smalltalk.withContext(function($ctx1) { 
-self["@payload"]=anObject;
-_st(self._dispatcher())._changed_([]);
-return self}, function($ctx1) {$ctx1.fill(self,"model:",{anObject:anObject},smalltalk.ListKeyedEntity)})},
-args: ["anObject"],
-source: "model: anObject\x0a\x09payload := anObject.\x0a    self dispatcher changed: #()",
-messageSends: ["changed:", "dispatcher"],
-referencedClasses: []
-}),
-smalltalk.ListKeyedEntity);
-
-smalltalk.addMethod(
-smalltalk.method({
-selector: "watch:do:",
-category: 'action',
-fn: function (path,aBlock){
-var self=this;
-return smalltalk.withContext(function($ctx1) { 
-_st(self._dispatcher())._on_hook_(path,(function(){
-return smalltalk.withContext(function($ctx2) {
-return self._read_do_(path,aBlock);
-}, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})}));
-return self}, function($ctx1) {$ctx1.fill(self,"watch:do:",{path:path,aBlock:aBlock},smalltalk.ListKeyedEntity)})},
-args: ["path", "aBlock"],
-source: "watch: path do: aBlock\x0a\x09self dispatcher on: path hook: [ self read: path do: aBlock ]",
-messageSends: ["on:hook:", "dispatcher", "read:do:"],
-referencedClasses: []
-}),
-smalltalk.ListKeyedEntity);
-
-
-
-smalltalk.addClass('ListKeyedDirectEntity', smalltalk.ListKeyedEntity, [], 'Trapped-Backend');
-smalltalk.ListKeyedDirectEntity.comment="I am ListKeyedEntity that directly manipulate\x0d\x0athe wrapped model object.";
-smalltalk.addMethod(
-smalltalk.method({
-selector: "modify:do:",
-category: 'action',
-fn: function (path,aBlock){
-var self=this;
-var newValue,eavModel;
-return smalltalk.withContext(function($ctx1) { 
-eavModel=_st(path)._asEavModel();
-newValue=_st(aBlock)._value_(_st(eavModel)._on_(self["@payload"]));
-_st((function(){
-return smalltalk.withContext(function($ctx2) {
-return _st(eavModel)._on_put_(self["@payload"],newValue);
-}, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})}))._ensure_((function(){
-return smalltalk.withContext(function($ctx2) {
-return _st(self._dispatcher())._changed_(path);
-}, function($ctx2) {$ctx2.fillBlock({},$ctx1,2)})}));
-return self}, function($ctx1) {$ctx1.fill(self,"modify:do:",{path:path,aBlock:aBlock,newValue:newValue,eavModel:eavModel},smalltalk.ListKeyedDirectEntity)})},
-args: ["path", "aBlock"],
-source: "modify: path do: aBlock\x0a    | newValue eavModel |\x0a    eavModel := path asEavModel.\x0a    newValue := aBlock value: (eavModel on: payload).\x0a    [ eavModel on: payload put: newValue ] ensure: [ self dispatcher changed: path ]",
-messageSends: ["asEavModel", "value:", "on:", "ensure:", "on:put:", "changed:", "dispatcher"],
-referencedClasses: []
-}),
-smalltalk.ListKeyedDirectEntity);
-
-smalltalk.addMethod(
-smalltalk.method({
-selector: "read:do:",
-category: 'action',
-fn: function (path,aBlock){
-var self=this;
-var eavModel;
-return smalltalk.withContext(function($ctx1) { 
-eavModel=_st(path)._asEavModel();
-_st(aBlock)._value_(_st(eavModel)._on_(self["@payload"]));
-return self}, function($ctx1) {$ctx1.fill(self,"read:do:",{path:path,aBlock:aBlock,eavModel:eavModel},smalltalk.ListKeyedDirectEntity)})},
-args: ["path", "aBlock"],
-source: "read: path do: aBlock\x0a    | eavModel |\x0a    eavModel := path asEavModel.\x0a    aBlock value: (eavModel on: payload)",
-messageSends: ["asEavModel", "value:", "on:"],
-referencedClasses: []
-}),
-smalltalk.ListKeyedDirectEntity);
-
-
-
-smalltalk.addClass('ListKeyedIsolatedEntity', smalltalk.ListKeyedEntity, [], 'Trapped-Backend');
-smalltalk.ListKeyedIsolatedEntity.comment="I am ListKeyedEntity that guards access\x0d\x0ato the wrapped model object via Isolator.";
-smalltalk.addMethod(
-smalltalk.method({
-selector: "model:",
-category: 'accessing',
-fn: function (anObject){
-var self=this;
-function $Isolator(){return smalltalk.Isolator||(typeof Isolator=="undefined"?nil:Isolator)}
-return smalltalk.withContext(function($ctx1) { 
-smalltalk.ListKeyedIsolatedEntity.superclass.fn.prototype._model_.apply(_st(self), [_st($Isolator())._on_(anObject)]);
-return self}, function($ctx1) {$ctx1.fill(self,"model:",{anObject:anObject},smalltalk.ListKeyedIsolatedEntity)})},
-args: ["anObject"],
-source: "model: anObject\x0a\x09super model: (Isolator on: anObject)",
-messageSends: ["model:", "on:"],
-referencedClasses: ["Isolator"]
-}),
-smalltalk.ListKeyedIsolatedEntity);
-
-smalltalk.addMethod(
-smalltalk.method({
-selector: "modify:do:",
-category: 'action',
-fn: function (path,aBlock){
-var self=this;
-var eavModel;
-return smalltalk.withContext(function($ctx1) { 
-eavModel=_st(_st([["root"]]).__comma(path))._asEavModel();
-_st((function(){
-return smalltalk.withContext(function($ctx2) {
-return _st(self["@payload"])._model_modify_(eavModel,aBlock);
-}, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})}))._ensure_((function(){
-return smalltalk.withContext(function($ctx2) {
-return _st(self._dispatcher())._changed_(path);
-}, function($ctx2) {$ctx2.fillBlock({},$ctx1,2)})}));
-return self}, function($ctx1) {$ctx1.fill(self,"modify:do:",{path:path,aBlock:aBlock,eavModel:eavModel},smalltalk.ListKeyedIsolatedEntity)})},
-args: ["path", "aBlock"],
-source: "modify: path do: aBlock\x0a    | eavModel |\x0a    eavModel := ({{#root}},path) asEavModel.\x0a    [ payload model: eavModel modify: aBlock ] ensure: [ self dispatcher changed: path ]",
-messageSends: ["asEavModel", ",", "ensure:", "model:modify:", "changed:", "dispatcher"],
-referencedClasses: []
-}),
-smalltalk.ListKeyedIsolatedEntity);
-
-smalltalk.addMethod(
-smalltalk.method({
-selector: "read:do:",
-category: 'action',
-fn: function (path,aBlock){
-var self=this;
-var eavModel;
-return smalltalk.withContext(function($ctx1) { 
-eavModel=_st(_st([["root"]]).__comma(path))._asEavModel();
-_st(self["@payload"])._model_read_(eavModel,aBlock);
-return self}, function($ctx1) {$ctx1.fill(self,"read:do:",{path:path,aBlock:aBlock,eavModel:eavModel},smalltalk.ListKeyedIsolatedEntity)})},
-args: ["path", "aBlock"],
-source: "read: path do: aBlock\x0a    | eavModel |\x0a    eavModel := ({{#root}},path) asEavModel.\x0a    payload model: eavModel read: aBlock",
-messageSends: ["asEavModel", ",", "model:read:"],
-referencedClasses: []
-}),
-smalltalk.ListKeyedIsolatedEntity);
-
-
-smalltalk.addMethod(
-smalltalk.method({
-selector: "asTrapAtPut:sendTo:",
-category: '*Trapped-Backend',
-fn: function (value,anObject){
-var self=this;
-return smalltalk.withContext(function($ctx1) { 
-var $1;
-$1=_st("Trapped cannot put at ".__comma(_st(self._class())._name())).__comma(" type key.");
-$ctx1.sendIdx[","]=1;
-self._error_($1);
-return self}, function($ctx1) {$ctx1.fill(self,"asTrapAtPut:sendTo:",{value:value,anObject:anObject},smalltalk.Object)})},
-args: ["value", "anObject"],
-source: "asTrapAtPut: value sendTo: anObject\x0a\x09self error: 'Trapped cannot put at ', self class name, ' type key.'",
-messageSends: ["error:", ",", "name", "class"],
-referencedClasses: []
-}),
-smalltalk.Object);
-
-smalltalk.addMethod(
-smalltalk.method({
-selector: "asTrapAtSendTo:",
-category: '*Trapped-Backend',
-fn: function (anObject){
-var self=this;
-return smalltalk.withContext(function($ctx1) { 
-return nil;
-}, function($ctx1) {$ctx1.fill(self,"asTrapAtSendTo:",{anObject:anObject},smalltalk.Object)})},
-args: ["anObject"],
-source: "asTrapAtSendTo: anObject\x0a\x09^nil",
-messageSends: [],
-referencedClasses: []
-}),
-smalltalk.Object);
-
-smalltalk.addMethod(
-smalltalk.method({
-selector: "asTrapAtPut:sendTo:",
-category: '*Trapped-Backend',
-fn: function (value,anObject){
-var self=this;
-return smalltalk.withContext(function($ctx1) { 
-var $1;
-$1=_st(anObject)._at_put_(self,value);
-return $1;
-}, function($ctx1) {$ctx1.fill(self,"asTrapAtPut:sendTo:",{value:value,anObject:anObject},smalltalk.Number)})},
-args: ["value", "anObject"],
-source: "asTrapAtPut: value sendTo: anObject\x0a\x09^anObject at: self put: value",
-messageSends: ["at:put:"],
-referencedClasses: []
-}),
-smalltalk.Number);
-
-smalltalk.addMethod(
-smalltalk.method({
-selector: "asTrapAtSendTo:",
-category: '*Trapped-Backend',
-fn: function (anObject){
-var self=this;
-return smalltalk.withContext(function($ctx1) { 
-var $1;
-if(($receiver = anObject) == nil || $receiver == null){
-$1=anObject;
-} else {
-$1=_st(anObject)._at_ifAbsent_(self,(function(){
-return smalltalk.withContext(function($ctx2) {
-return nil;
-}, function($ctx2) {$ctx2.fillBlock({},$ctx1,2)})}));
-};
-return $1;
-}, function($ctx1) {$ctx1.fill(self,"asTrapAtSendTo:",{anObject:anObject},smalltalk.Number)})},
-args: ["anObject"],
-source: "asTrapAtSendTo: anObject\x0a\x09^anObject ifNotNil: [ anObject at: self ifAbsent: [nil] ]",
-messageSends: ["ifNotNil:", "at:ifAbsent:"],
-referencedClasses: []
-}),
-smalltalk.Number);
-
-smalltalk.addMethod(
-smalltalk.method({
-selector: "asEavModel",
-category: '*Trapped-Backend',
-fn: function (){
-var self=this;
-var model;
-function $EavModel(){return smalltalk.EavModel||(typeof EavModel=="undefined"?nil:EavModel)}
-return smalltalk.withContext(function($ctx1) { 
-var $1,$2;
-model=_st($EavModel())._new();
-_st(model)._getBlock_((function(anObject){
-return smalltalk.withContext(function($ctx2) {
-return self._inject_into_(anObject,(function(soFar,segment){
-return smalltalk.withContext(function($ctx3) {
-return _st(segment)._asTrapAtSendTo_(soFar);
-$ctx3.sendIdx["asTrapAtSendTo:"]=1;
-}, function($ctx3) {$ctx3.fillBlock({soFar:soFar,segment:segment},$ctx2,2)})}));
-$ctx2.sendIdx["inject:into:"]=1;
-}, function($ctx2) {$ctx2.fillBlock({anObject:anObject},$ctx1,1)})}));
-$1=self._isEmpty();
-if(! smalltalk.assert($1)){
-_st(model)._putBlock_((function(anObject,value){
-var penultimate;
-return smalltalk.withContext(function($ctx2) {
-penultimate=_st(self._allButLast())._inject_into_(anObject,(function(soFar,segment){
-return smalltalk.withContext(function($ctx3) {
-if(($receiver = soFar) == nil || $receiver == null){
-return soFar;
-} else {
-return _st(segment)._asTrapAtSendTo_(soFar);
-};
-}, function($ctx3) {$ctx3.fillBlock({soFar:soFar,segment:segment},$ctx2,5)})}));
-penultimate;
-return _st(self._last())._asTrapAtPut_sendTo_(value,penultimate);
-}, function($ctx2) {$ctx2.fillBlock({anObject:anObject,value:value,penultimate:penultimate},$ctx1,4)})}));
-};
-$2=model;
-return $2;
-}, function($ctx1) {$ctx1.fill(self,"asEavModel",{model:model},smalltalk.SequenceableCollection)})},
-args: [],
-source: "asEavModel\x0a    | model |\x0a    model := EavModel new.\x0a    model getBlock: [ :anObject |\x0a        self inject: anObject into: [ :soFar :segment |\x0a            segment asTrapAtSendTo: soFar ]].\x0a    self isEmpty ifFalse: [\x0a        model putBlock: [ :anObject :value | | penultimate |\x0a            penultimate :=  self allButLast inject: anObject into: [ :soFar :segment |\x0a                soFar ifNotNil: [ segment asTrapAtSendTo: soFar ]].\x0a            self last asTrapAtPut:value sendTo: penultimate ]].\x0a    ^model",
-messageSends: ["new", "getBlock:", "inject:into:", "asTrapAtSendTo:", "ifFalse:", "isEmpty", "putBlock:", "allButLast", "ifNotNil:", "asTrapAtPut:sendTo:", "last"],
-referencedClasses: ["EavModel"]
-}),
-smalltalk.SequenceableCollection);
-
-smalltalk.addMethod(
-smalltalk.method({
-selector: "asTrapAtPut:sendTo:",
-category: '*Trapped-Backend',
-fn: function (value,anObject){
-var self=this;
-return smalltalk.withContext(function($ctx1) { 
-var $1;
-$1=_st(anObject)._at_put_(self,value);
-return $1;
-}, function($ctx1) {$ctx1.fill(self,"asTrapAtPut:sendTo:",{value:value,anObject:anObject},smalltalk.String)})},
-args: ["value", "anObject"],
-source: "asTrapAtPut: value sendTo: anObject\x0a\x09^anObject at: self put: value",
-messageSends: ["at:put:"],
-referencedClasses: []
-}),
-smalltalk.String);
-
-smalltalk.addMethod(
-smalltalk.method({
-selector: "asTrapAtSendTo:",
-category: '*Trapped-Backend',
-fn: function (anObject){
-var self=this;
-return smalltalk.withContext(function($ctx1) { 
-var $1;
-if(($receiver = anObject) == nil || $receiver == null){
-$1=anObject;
-} else {
-$1=_st(anObject)._at_ifAbsent_(self,(function(){
-return smalltalk.withContext(function($ctx2) {
-return nil;
-}, function($ctx2) {$ctx2.fillBlock({},$ctx1,2)})}));
-};
-return $1;
-}, function($ctx1) {$ctx1.fill(self,"asTrapAtSendTo:",{anObject:anObject},smalltalk.String)})},
-args: ["anObject"],
-source: "asTrapAtSendTo: anObject\x0a\x09^anObject ifNotNil: [ anObject at: self ifAbsent: [nil] ]",
-messageSends: ["ifNotNil:", "at:ifAbsent:"],
-referencedClasses: []
-}),
-smalltalk.String);
-
-smalltalk.addMethod(
-smalltalk.method({
-selector: "asTrapAtPut:sendTo:",
-category: '*Trapped-Backend',
-fn: function (value,anObject){
-var self=this;
-return smalltalk.withContext(function($ctx1) { 
-var $1;
-$1=_st(anObject)._perform_withArguments_(_st(_st(self._first()).__comma(":"))._asSymbol(),[value]);
-return $1;
-}, function($ctx1) {$ctx1.fill(self,"asTrapAtPut:sendTo:",{value:value,anObject:anObject},smalltalk.Array)})},
-args: ["value", "anObject"],
-source: "asTrapAtPut: value sendTo: anObject\x0a    ^anObject perform: (self first, ':') asSymbol withArguments: { value }",
-messageSends: ["perform:withArguments:", "asSymbol", ",", "first"],
-referencedClasses: []
-}),
-smalltalk.Array);
-
-smalltalk.addMethod(
-smalltalk.method({
-selector: "asTrapAtSendTo:",
-category: '*Trapped-Backend',
-fn: function (anObject){
-var self=this;
-function $MessageNotUnderstood(){return smalltalk.MessageNotUnderstood||(typeof MessageNotUnderstood=="undefined"?nil:MessageNotUnderstood)}
-return smalltalk.withContext(function($ctx1) { 
-var $1;
-var $early={};
-try {
-$1=_st((function(){
-return smalltalk.withContext(function($ctx2) {
-return _st(anObject)._perform_(self._first());
-}, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})}))._on_do_($MessageNotUnderstood(),(function(){
-return smalltalk.withContext(function($ctx2) {
-throw $early=[nil];
-}, function($ctx2) {$ctx2.fillBlock({},$ctx1,2)})}));
-return $1;
-}
-catch(e) {if(e===$early)return e[0]; throw e}
-}, function($ctx1) {$ctx1.fill(self,"asTrapAtSendTo:",{anObject:anObject},smalltalk.Array)})},
-args: ["anObject"],
-source: "asTrapAtSendTo: anObject\x0a\x09^[anObject perform: self first] on: MessageNotUnderstood do: [^nil]",
-messageSends: ["on:do:", "perform:", "first"],
-referencedClasses: ["MessageNotUnderstood"]
-}),
-smalltalk.Array);
-
-});

+ 0 - 1570
js/Trapped-Frontend.js

@@ -1,1570 +0,0 @@
-define("gh_herby_trapped/Trapped-Frontend", ["amber_vm/smalltalk", "amber_vm/nil", "amber_vm/_st", "amber_core/Kernel-Objects", "amber_core/Kernel-Collections", "amber_core/Canvas"], function(smalltalk,nil,_st){
-smalltalk.addPackage('Trapped-Frontend');
-smalltalk.packages["Trapped-Frontend"].transport = {"type":"amd","amdNamespace":"gh_herby_trapped"};
-
-smalltalk.addClass('TrappedDataCarrier', smalltalk.Object, ['target', 'model', 'chain', 'source'], 'Trapped-Frontend');
-smalltalk.addMethod(
-smalltalk.method({
-selector: "chain:",
-category: 'accessing',
-fn: function (aProcessingChain){
-var self=this;
-return smalltalk.withContext(function($ctx1) { 
-self["@chain"]=aProcessingChain;
-return self}, function($ctx1) {$ctx1.fill(self,"chain:",{aProcessingChain:aProcessingChain},smalltalk.TrappedDataCarrier)})},
-args: ["aProcessingChain"],
-source: "chain: aProcessingChain\x0a\x09chain := aProcessingChain",
-messageSends: [],
-referencedClasses: []
-}),
-smalltalk.TrappedDataCarrier);
-
-smalltalk.addMethod(
-smalltalk.method({
-selector: "falseAsNilValue",
-category: 'converting',
-fn: function (){
-var self=this;
-var value;
-return smalltalk.withContext(function($ctx1) { 
-var $1,$2;
-value=self._value();
-$1=_st(value).__eq(false);
-if(smalltalk.assert($1)){
-return nil;
-} else {
-$2=value;
-return $2;
-};
-return self}, function($ctx1) {$ctx1.fill(self,"falseAsNilValue",{value:value},smalltalk.TrappedDataCarrier)})},
-args: [],
-source: "falseAsNilValue\x0a\x09| value |\x0a\x09value := self value.\x0a\x09value = false ifTrue: [ ^nil ] ifFalse: [ ^value ]",
-messageSends: ["value", "ifTrue:ifFalse:", "="],
-referencedClasses: []
-}),
-smalltalk.TrappedDataCarrier);
-
-smalltalk.addMethod(
-smalltalk.method({
-selector: "initialize",
-category: 'initialization',
-fn: function (){
-var self=this;
-return smalltalk.withContext(function($ctx1) { 
-smalltalk.TrappedDataCarrier.superclass.fn.prototype._initialize.apply(_st(self), []);
-self["@model"]=true;
-return self}, function($ctx1) {$ctx1.fill(self,"initialize",{},smalltalk.TrappedDataCarrier)})},
-args: [],
-source: "initialize\x0a\x09super initialize.\x0a\x09model := true",
-messageSends: ["initialize"],
-referencedClasses: []
-}),
-smalltalk.TrappedDataCarrier);
-
-smalltalk.addMethod(
-smalltalk.method({
-selector: "source",
-category: 'accessing',
-fn: function (){
-var self=this;
-return smalltalk.withContext(function($ctx1) { 
-var $1;
-$1=self["@source"];
-return $1;
-}, function($ctx1) {$ctx1.fill(self,"source",{},smalltalk.TrappedDataCarrier)})},
-args: [],
-source: "source\x0a\x09^source",
-messageSends: [],
-referencedClasses: []
-}),
-smalltalk.TrappedDataCarrier);
-
-smalltalk.addMethod(
-smalltalk.method({
-selector: "source:",
-category: 'accessing',
-fn: function (anObject){
-var self=this;
-return smalltalk.withContext(function($ctx1) { 
-self["@source"]=anObject;
-return self}, function($ctx1) {$ctx1.fill(self,"source:",{anObject:anObject},smalltalk.TrappedDataCarrier)})},
-args: ["anObject"],
-source: "source: anObject\x0a\x09source := anObject",
-messageSends: [],
-referencedClasses: []
-}),
-smalltalk.TrappedDataCarrier);
-
-smalltalk.addMethod(
-smalltalk.method({
-selector: "target",
-category: 'accessing',
-fn: function (){
-var self=this;
-return smalltalk.withContext(function($ctx1) { 
-var $1;
-$1=self["@target"];
-return $1;
-}, function($ctx1) {$ctx1.fill(self,"target",{},smalltalk.TrappedDataCarrier)})},
-args: [],
-source: "target\x0a\x09^target",
-messageSends: [],
-referencedClasses: []
-}),
-smalltalk.TrappedDataCarrier);
-
-smalltalk.addMethod(
-smalltalk.method({
-selector: "target:",
-category: 'accessing',
-fn: function (anObject){
-var self=this;
-return smalltalk.withContext(function($ctx1) { 
-self["@target"]=anObject;
-return self}, function($ctx1) {$ctx1.fill(self,"target:",{anObject:anObject},smalltalk.TrappedDataCarrier)})},
-args: ["anObject"],
-source: "target: anObject\x0a\x09target := anObject",
-messageSends: [],
-referencedClasses: []
-}),
-smalltalk.TrappedDataCarrier);
-
-smalltalk.addMethod(
-smalltalk.method({
-selector: "value",
-category: 'accessing',
-fn: function (){
-var self=this;
-return smalltalk.withContext(function($ctx1) { 
-var $1;
-$1=self["@model"];
-return $1;
-}, function($ctx1) {$ctx1.fill(self,"value",{},smalltalk.TrappedDataCarrier)})},
-args: [],
-source: "value\x0a\x09^model",
-messageSends: [],
-referencedClasses: []
-}),
-smalltalk.TrappedDataCarrier);
-
-smalltalk.addMethod(
-smalltalk.method({
-selector: "value:",
-category: 'accessing',
-fn: function (anObject){
-var self=this;
-return smalltalk.withContext(function($ctx1) { 
-self["@model"]=anObject;
-return self}, function($ctx1) {$ctx1.fill(self,"value:",{anObject:anObject},smalltalk.TrappedDataCarrier)})},
-args: ["anObject"],
-source: "value: anObject\x0a\x09model := anObject",
-messageSends: [],
-referencedClasses: []
-}),
-smalltalk.TrappedDataCarrier);
-
-smalltalk.addMethod(
-smalltalk.method({
-selector: "value:whenDifferentFrom:",
-category: 'accessing',
-fn: function (anObject,anotherObject){
-var self=this;
-return smalltalk.withContext(function($ctx1) { 
-var $1;
-$1=_st(anObject).__eq(anotherObject);
-if(! smalltalk.assert($1)){
-self._value_(anObject);
-};
-return self}, function($ctx1) {$ctx1.fill(self,"value:whenDifferentFrom:",{anObject:anObject,anotherObject:anotherObject},smalltalk.TrappedDataCarrier)})},
-args: ["anObject", "anotherObject"],
-source: "value: anObject whenDifferentFrom: anotherObject\x0a\x09anObject = anotherObject ifFalse: [ self value: anObject ]",
-messageSends: ["ifFalse:", "=", "value:"],
-referencedClasses: []
-}),
-smalltalk.TrappedDataCarrier);
-
-
-smalltalk.addMethod(
-smalltalk.method({
-selector: "on:target:",
-category: 'not yet classified',
-fn: function (aProcessingChain,anObject){
-var self=this;
-return smalltalk.withContext(function($ctx1) { 
-var $2,$3,$1;
-$2=self._new();
-_st($2)._chain_(aProcessingChain);
-_st($2)._target_(anObject);
-$3=_st($2)._yourself();
-$1=$3;
-return $1;
-}, function($ctx1) {$ctx1.fill(self,"on:target:",{aProcessingChain:aProcessingChain,anObject:anObject},smalltalk.TrappedDataCarrier.klass)})},
-args: ["aProcessingChain", "anObject"],
-source: "on: aProcessingChain target: anObject\x0a\x09^self new\x0a\x09\x09chain: aProcessingChain;\x0a\x09\x09target: anObject;\x0a\x09\x09yourself",
-messageSends: ["chain:", "new", "target:", "yourself"],
-referencedClasses: []
-}),
-smalltalk.TrappedDataCarrier.klass);
-
-
-smalltalk.addClass('TrappedDataCarrierToModel', smalltalk.TrappedDataCarrier, ['index'], 'Trapped-Frontend');
-smalltalk.addMethod(
-smalltalk.method({
-selector: "proceed",
-category: 'not yet classified',
-fn: function (){
-var self=this;
-return smalltalk.withContext(function($ctx1) { 
-var $1;
-$1=self["@index"];
-if(($receiver = $1) == nil || $receiver == null){
-self["@index"]=_st(self["@chain"])._lastProcessorNo();
-} else {
-self["@index"]=_st(self["@index"]).__minus((1));
-};
-_st(_st(self["@chain"])._processorNo_(self["@index"]))._toModel_(self);
-return self}, function($ctx1) {$ctx1.fill(self,"proceed",{},smalltalk.TrappedDataCarrierToModel)})},
-args: [],
-source: "proceed\x0a\x09index := index ifNil: [ chain lastProcessorNo ] ifNotNil: [ index - 1 ].\x0a\x09(chain processorNo: index) toModel: self",
-messageSends: ["ifNil:ifNotNil:", "lastProcessorNo", "-", "toModel:", "processorNo:"],
-referencedClasses: []
-}),
-smalltalk.TrappedDataCarrierToModel);
-
-
-
-smalltalk.addClass('TrappedDataCarrierToView', smalltalk.TrappedDataCarrier, ['index'], 'Trapped-Frontend');
-smalltalk.addMethod(
-smalltalk.method({
-selector: "proceed",
-category: 'not yet classified',
-fn: function (){
-var self=this;
-return smalltalk.withContext(function($ctx1) { 
-var $1;
-$1=self["@index"];
-if(($receiver = $1) == nil || $receiver == null){
-self["@index"]=_st(self["@chain"])._firstProcessorNo();
-} else {
-self["@index"]=_st(self["@index"]).__plus((1));
-};
-_st(_st(self["@chain"])._processorNo_(self["@index"]))._toView_(self);
-return self}, function($ctx1) {$ctx1.fill(self,"proceed",{},smalltalk.TrappedDataCarrierToView)})},
-args: [],
-source: "proceed\x0a\x09index := index ifNil: [ chain firstProcessorNo ] ifNotNil: [ index + 1 ].\x0a\x09(chain processorNo: index) toView: self",
-messageSends: ["ifNil:ifNotNil:", "firstProcessorNo", "+", "toView:", "processorNo:"],
-referencedClasses: []
-}),
-smalltalk.TrappedDataCarrierToView);
-
-
-
-smalltalk.addClass('TrappedProcessingChain', smalltalk.Object, ['processors'], 'Trapped-Frontend');
-smalltalk.addMethod(
-smalltalk.method({
-selector: "firstProcessorNo",
-category: 'accessing',
-fn: function (){
-var self=this;
-return smalltalk.withContext(function($ctx1) { 
-return (1);
-}, function($ctx1) {$ctx1.fill(self,"firstProcessorNo",{},smalltalk.TrappedProcessingChain)})},
-args: [],
-source: "firstProcessorNo\x0a\x09^1",
-messageSends: [],
-referencedClasses: []
-}),
-smalltalk.TrappedProcessingChain);
-
-smalltalk.addMethod(
-smalltalk.method({
-selector: "forSnapshot:andBrush:",
-category: 'action',
-fn: function (aSnapshot,aTagBrush){
-var self=this;
-var toViewCarrier,toModelCarrier;
-function $TrappedDataCarrierToView(){return smalltalk.TrappedDataCarrierToView||(typeof TrappedDataCarrierToView=="undefined"?nil:TrappedDataCarrierToView)}
-function $TrappedDataCarrierToModel(){return smalltalk.TrappedDataCarrierToModel||(typeof TrappedDataCarrierToModel=="undefined"?nil:TrappedDataCarrierToModel)}
-return smalltalk.withContext(function($ctx1) { 
-var $1;
-toViewCarrier=_st($TrappedDataCarrierToView())._on_target_(self,aTagBrush);
-$ctx1.sendIdx["on:target:"]=1;
-toModelCarrier=_st($TrappedDataCarrierToModel())._on_target_(self,aSnapshot);
-_st(self["@processors"])._do_((function(each){
-return smalltalk.withContext(function($ctx2) {
-return _st(each)._installToView_toModel_(toViewCarrier,toModelCarrier);
-}, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,1)})}));
-_st(toViewCarrier)._source_(aSnapshot);
-$ctx1.sendIdx["source:"]=1;
-_st(toModelCarrier)._source_(aTagBrush);
-$1=_st(_st(toViewCarrier)._value()).__eq(true);
-if(smalltalk.assert($1)){
-_st(_st(toViewCarrier)._copy())._proceed();
-};
-return self}, function($ctx1) {$ctx1.fill(self,"forSnapshot:andBrush:",{aSnapshot:aSnapshot,aTagBrush:aTagBrush,toViewCarrier:toViewCarrier,toModelCarrier:toModelCarrier},smalltalk.TrappedProcessingChain)})},
-args: ["aSnapshot", "aTagBrush"],
-source: "forSnapshot: aSnapshot andBrush: aTagBrush\x0a\x09| toViewCarrier toModelCarrier |\x0a\x09toViewCarrier := TrappedDataCarrierToView on: self target: aTagBrush.\x0a\x09toModelCarrier := TrappedDataCarrierToModel on: self target: aSnapshot.\x0a\x09processors do: [ :each | each installToView: toViewCarrier toModel: toModelCarrier ].\x0a\x09toViewCarrier source: aSnapshot.\x0a\x09toModelCarrier source: aTagBrush.\x0a\x09toViewCarrier value = true ifTrue: [ toViewCarrier copy proceed ]",
-messageSends: ["on:target:", "do:", "installToView:toModel:", "source:", "ifTrue:", "=", "value", "proceed", "copy"],
-referencedClasses: ["TrappedDataCarrierToView", "TrappedDataCarrierToModel"]
-}),
-smalltalk.TrappedProcessingChain);
-
-smalltalk.addMethod(
-smalltalk.method({
-selector: "lastProcessorNo",
-category: 'accessing',
-fn: function (){
-var self=this;
-return smalltalk.withContext(function($ctx1) { 
-var $1;
-$1=_st(self["@processors"])._size();
-return $1;
-}, function($ctx1) {$ctx1.fill(self,"lastProcessorNo",{},smalltalk.TrappedProcessingChain)})},
-args: [],
-source: "lastProcessorNo\x0a\x09^processors size",
-messageSends: ["size"],
-referencedClasses: []
-}),
-smalltalk.TrappedProcessingChain);
-
-smalltalk.addMethod(
-smalltalk.method({
-selector: "processorNo:",
-category: 'accessing',
-fn: function (aNumber){
-var self=this;
-return smalltalk.withContext(function($ctx1) { 
-var $1;
-$1=_st(self["@processors"])._at_(aNumber);
-return $1;
-}, function($ctx1) {$ctx1.fill(self,"processorNo:",{aNumber:aNumber},smalltalk.TrappedProcessingChain)})},
-args: ["aNumber"],
-source: "processorNo: aNumber\x0a\x09^processors at: aNumber",
-messageSends: ["at:"],
-referencedClasses: []
-}),
-smalltalk.TrappedProcessingChain);
-
-smalltalk.addMethod(
-smalltalk.method({
-selector: "processors:",
-category: 'accessing',
-fn: function (anArray){
-var self=this;
-return smalltalk.withContext(function($ctx1) { 
-self["@processors"]=anArray;
-return self}, function($ctx1) {$ctx1.fill(self,"processors:",{anArray:anArray},smalltalk.TrappedProcessingChain)})},
-args: ["anArray"],
-source: "processors: anArray\x0a\x09processors := anArray",
-messageSends: [],
-referencedClasses: []
-}),
-smalltalk.TrappedProcessingChain);
-
-
-smalltalk.addMethod(
-smalltalk.method({
-selector: "blackboardReaderWriter",
-category: 'private',
-fn: function (){
-var self=this;
-function $TrappedProcessorBlackboard(){return smalltalk.TrappedProcessorBlackboard||(typeof TrappedProcessorBlackboard=="undefined"?nil:TrappedProcessorBlackboard)}
-return smalltalk.withContext(function($ctx1) { 
-var $1;
-$1=_st($TrappedProcessorBlackboard())._new();
-return $1;
-}, function($ctx1) {$ctx1.fill(self,"blackboardReaderWriter",{},smalltalk.TrappedProcessingChain.klass)})},
-args: [],
-source: "blackboardReaderWriter\x0a\x09^TrappedProcessorBlackboard new",
-messageSends: ["new"],
-referencedClasses: ["TrappedProcessorBlackboard"]
-}),
-smalltalk.TrappedProcessingChain.klass);
-
-smalltalk.addMethod(
-smalltalk.method({
-selector: "dataTerminator",
-category: 'private',
-fn: function (){
-var self=this;
-function $TrappedProcessorTerminator(){return smalltalk.TrappedProcessorTerminator||(typeof TrappedProcessorTerminator=="undefined"?nil:TrappedProcessorTerminator)}
-return smalltalk.withContext(function($ctx1) { 
-var $1;
-$1=_st($TrappedProcessorTerminator())._new();
-return $1;
-}, function($ctx1) {$ctx1.fill(self,"dataTerminator",{},smalltalk.TrappedProcessingChain.klass)})},
-args: [],
-source: "dataTerminator\x0a\x09^TrappedProcessorTerminator new",
-messageSends: ["new"],
-referencedClasses: ["TrappedProcessorTerminator"]
-}),
-smalltalk.TrappedProcessingChain.klass);
-
-smalltalk.addMethod(
-smalltalk.method({
-selector: "new:",
-category: 'instance creation',
-fn: function (anArray){
-var self=this;
-return smalltalk.withContext(function($ctx1) { 
-var $1,$3,$4,$2;
-$1=_st(anArray)._anySatisfy_((function(each){
-return smalltalk.withContext(function($ctx2) {
-return _st(each)._isExpectingModelData();
-}, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,1)})}));
-if(smalltalk.assert($1)){
-_st(anArray)._addFirst_(self._blackboardReaderWriter());
-} else {
-_st(anArray)._add_(self._dataTerminator());
-};
-$3=self._new();
-_st($3)._processors_(anArray);
-$4=_st($3)._yourself();
-$2=$4;
-return $2;
-}, function($ctx1) {$ctx1.fill(self,"new:",{anArray:anArray},smalltalk.TrappedProcessingChain.klass)})},
-args: ["anArray"],
-source: "new: anArray\x0a\x09(anArray anySatisfy: [ :each | each isExpectingModelData ])\x0a\x09\x09ifFalse: [ anArray add: self dataTerminator ]\x0a\x09\x09ifTrue: [ anArray addFirst: self blackboardReaderWriter ].\x0a\x09^self new\x0a\x09\x09processors: anArray;\x0a\x09\x09yourself",
-messageSends: ["ifFalse:ifTrue:", "anySatisfy:", "isExpectingModelData", "add:", "dataTerminator", "addFirst:", "blackboardReaderWriter", "processors:", "new", "yourself"],
-referencedClasses: []
-}),
-smalltalk.TrappedProcessingChain.klass);
-
-smalltalk.addMethod(
-smalltalk.method({
-selector: "newFromProcessorSpecs:",
-category: 'instance creation',
-fn: function (anArray){
-var self=this;
-function $TrappedProcessor(){return smalltalk.TrappedProcessor||(typeof TrappedProcessor=="undefined"?nil:TrappedProcessor)}
-return smalltalk.withContext(function($ctx1) { 
-var $1;
-$1=self._new_(_st(_st(anArray)._ifEmpty_((function(){
-return smalltalk.withContext(function($ctx2) {
-return ["contents"];
-}, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})})))._collect_((function(each){
-return smalltalk.withContext(function($ctx2) {
-return _st(each)._asTrapProcSendTo_($TrappedProcessor());
-}, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,2)})})));
-return $1;
-}, function($ctx1) {$ctx1.fill(self,"newFromProcessorSpecs:",{anArray:anArray},smalltalk.TrappedProcessingChain.klass)})},
-args: ["anArray"],
-source: "newFromProcessorSpecs: anArray\x0a\x09^self new: ((anArray ifEmpty: [ #(contents) ]) collect: [ :each | each asTrapProcSendTo: TrappedProcessor ])",
-messageSends: ["new:", "collect:", "ifEmpty:", "asTrapProcSendTo:"],
-referencedClasses: ["TrappedProcessor"]
-}),
-smalltalk.TrappedProcessingChain.klass);
-
-
-smalltalk.addClass('TrappedProcessor', smalltalk.Object, [], 'Trapped-Frontend');
-smalltalk.TrappedProcessor.comment="I am a processing step in TrappedProcessingChain.\x0aI am stateless flyweight (aka servant)\x0aand will get all necessary data as arguments in API calls.\x0a\x0aMy public API is:\x0a - installToView:toModel:\x0a   This gets two TrappedDataCarriers set up without actual data\x0a   and at the beginning of their chains. It should do one-time\x0a   installation task needed (install event handlers etc.).\x0a   To start a chain, do: dataCarrier copy value: data; proceed.\x0a - toView:\x0a   This performs transformation of TrappedDataCarrier on its way from model to view.\x0a   Should call aDataCarrier proceed to proceed to subsequent step.\x0a - toModel:\x0a   This performs transformation of TrappedDataCarrier on its way from view to model.\x0a   Should call aDataCarrier proceed to proceed to subsequent step.\x0a";
-smalltalk.addMethod(
-smalltalk.method({
-selector: "installToView:toModel:",
-category: 'installation',
-fn: function (aDataCarrier,anotherDataCarrier){
-var self=this;
-return smalltalk.withContext(function($ctx1) { 
-return self}, function($ctx1) {$ctx1.fill(self,"installToView:toModel:",{aDataCarrier:aDataCarrier,anotherDataCarrier:anotherDataCarrier},smalltalk.TrappedProcessor)})},
-args: ["aDataCarrier", "anotherDataCarrier"],
-source: "installToView: aDataCarrier toModel: anotherDataCarrier\x0a\x09\x22by default, do nothing\x22",
-messageSends: [],
-referencedClasses: []
-}),
-smalltalk.TrappedProcessor);
-
-smalltalk.addMethod(
-smalltalk.method({
-selector: "isExpectingModelData",
-category: 'testing',
-fn: function (){
-var self=this;
-return smalltalk.withContext(function($ctx1) { 
-return false;
-}, function($ctx1) {$ctx1.fill(self,"isExpectingModelData",{},smalltalk.TrappedProcessor)})},
-args: [],
-source: "isExpectingModelData\x0a\x09^false",
-messageSends: [],
-referencedClasses: []
-}),
-smalltalk.TrappedProcessor);
-
-smalltalk.addMethod(
-smalltalk.method({
-selector: "toModel:",
-category: 'data transformation',
-fn: function (aDataCarrier){
-var self=this;
-return smalltalk.withContext(function($ctx1) { 
-_st(aDataCarrier)._proceed();
-return self}, function($ctx1) {$ctx1.fill(self,"toModel:",{aDataCarrier:aDataCarrier},smalltalk.TrappedProcessor)})},
-args: ["aDataCarrier"],
-source: "toModel: aDataCarrier\x0a\x09\x22by default, proceed\x22\x0a\x09aDataCarrier proceed",
-messageSends: ["proceed"],
-referencedClasses: []
-}),
-smalltalk.TrappedProcessor);
-
-smalltalk.addMethod(
-smalltalk.method({
-selector: "toView:",
-category: 'data transformation',
-fn: function (aDataCarrier){
-var self=this;
-return smalltalk.withContext(function($ctx1) { 
-_st(aDataCarrier)._proceed();
-return self}, function($ctx1) {$ctx1.fill(self,"toView:",{aDataCarrier:aDataCarrier},smalltalk.TrappedProcessor)})},
-args: ["aDataCarrier"],
-source: "toView: aDataCarrier\x0a\x09\x22by default, proceed\x22\x0a\x09aDataCarrier proceed",
-messageSends: ["proceed"],
-referencedClasses: []
-}),
-smalltalk.TrappedProcessor);
-
-
-smalltalk.addMethod(
-smalltalk.method({
-selector: "contents",
-category: 'factory',
-fn: function (){
-var self=this;
-function $TrappedProcessorContents(){return smalltalk.TrappedProcessorContents||(typeof TrappedProcessorContents=="undefined"?nil:TrappedProcessorContents)}
-return smalltalk.withContext(function($ctx1) { 
-var $1;
-$1=_st($TrappedProcessorContents())._new();
-return $1;
-}, function($ctx1) {$ctx1.fill(self,"contents",{},smalltalk.TrappedProcessor.klass)})},
-args: [],
-source: "contents\x0a\x09^TrappedProcessorContents new",
-messageSends: ["new"],
-referencedClasses: ["TrappedProcessorContents"]
-}),
-smalltalk.TrappedProcessor.klass);
-
-
-smalltalk.addClass('TrappedDataExpectingProcessor', smalltalk.TrappedProcessor, [], 'Trapped-Frontend');
-smalltalk.TrappedDataExpectingProcessor.comment="I answer true to isExpectingModelData and serve as a base class\x0afor processor that present / change model data.\x0a\x0aWhen at least one of my instances is present in the chain,\x0aautomatic databinding processor is added at the beginning\x0a(the data-binding scenario); otherwise, the chain\x0ais run immediately with true as data (run-once scenario).";
-smalltalk.addMethod(
-smalltalk.method({
-selector: "isExpectingModelData",
-category: 'testing',
-fn: function (){
-var self=this;
-return smalltalk.withContext(function($ctx1) { 
-return true;
-}, function($ctx1) {$ctx1.fill(self,"isExpectingModelData",{},smalltalk.TrappedDataExpectingProcessor)})},
-args: [],
-source: "isExpectingModelData\x0a\x09^true",
-messageSends: [],
-referencedClasses: []
-}),
-smalltalk.TrappedDataExpectingProcessor);
-
-
-
-smalltalk.addClass('TrappedProcessorContents', smalltalk.TrappedDataExpectingProcessor, [], 'Trapped-Frontend');
-smalltalk.TrappedProcessorContents.comment="I put data into target via contents: in toView:";
-smalltalk.addMethod(
-smalltalk.method({
-selector: "toView:",
-category: 'data transformation',
-fn: function (aDataCarrier){
-var self=this;
-return smalltalk.withContext(function($ctx1) { 
-_st(aDataCarrier)._toTargetContents();
-return self}, function($ctx1) {$ctx1.fill(self,"toView:",{aDataCarrier:aDataCarrier},smalltalk.TrappedProcessorContents)})},
-args: ["aDataCarrier"],
-source: "toView: aDataCarrier\x0a\x09aDataCarrier toTargetContents",
-messageSends: ["toTargetContents"],
-referencedClasses: []
-}),
-smalltalk.TrappedProcessorContents);
-
-
-
-smalltalk.addClass('TrappedProcessorBlackboard', smalltalk.TrappedProcessor, [], 'Trapped-Frontend');
-smalltalk.TrappedProcessorBlackboard.comment="I am used internally to fetch data from blackboard\x0aor write it back.\x0a\x0aI am added to the beginning of the chain\x0awhen the chain contains at least one element\x0athat isExpectingModelData (see TrappedDataExpectingProcessor).";
-smalltalk.addMethod(
-smalltalk.method({
-selector: "installToView:toModel:",
-category: 'installation',
-fn: function (aDataCarrier,anotherDataCarrier){
-var self=this;
-var snap;
-function $KeyedPubSubUnsubscribe(){return smalltalk.KeyedPubSubUnsubscribe||(typeof KeyedPubSubUnsubscribe=="undefined"?nil:KeyedPubSubUnsubscribe)}
-return smalltalk.withContext(function($ctx1) { 
-var $1,$2,$3;
-snap=_st(anotherDataCarrier)._target();
-$ctx1.sendIdx["target"]=1;
-_st(snap)._watch_((function(data){
-return smalltalk.withContext(function($ctx2) {
-$1=_st(_st(_st(_st(_st(aDataCarrier)._target())._asJQuery())._closest_("html"))._toArray())._isEmpty();
-if(smalltalk.assert($1)){
-_st($KeyedPubSubUnsubscribe())._signal();
-};
-return _st(snap)._do_((function(){
-return smalltalk.withContext(function($ctx3) {
-$2=_st(aDataCarrier)._copy();
-_st($2)._value_(data);
-$ctx3.sendIdx["value:"]=1;
-$3=_st($2)._proceed();
-return $3;
-}, function($ctx3) {$ctx3.fillBlock({},$ctx2,3)})}));
-}, function($ctx2) {$ctx2.fillBlock({data:data},$ctx1,1)})}));
-_st(aDataCarrier)._value_(false);
-return self}, function($ctx1) {$ctx1.fill(self,"installToView:toModel:",{aDataCarrier:aDataCarrier,anotherDataCarrier:anotherDataCarrier,snap:snap},smalltalk.TrappedProcessorBlackboard)})},
-args: ["aDataCarrier", "anotherDataCarrier"],
-source: "installToView: aDataCarrier toModel: anotherDataCarrier\x0a\x09| snap |\x0a\x09snap := anotherDataCarrier target.\x0a\x09snap watch: [ :data |\x0a\x09\x09(aDataCarrier target asJQuery closest: 'html') toArray isEmpty ifTrue: [ KeyedPubSubUnsubscribe signal ].\x0a        snap do: [ aDataCarrier copy value: data; proceed ] ].\x0a\x09aDataCarrier value: false",
-messageSends: ["target", "watch:", "ifTrue:", "isEmpty", "toArray", "closest:", "asJQuery", "signal", "do:", "value:", "copy", "proceed"],
-referencedClasses: ["KeyedPubSubUnsubscribe"]
-}),
-smalltalk.TrappedProcessorBlackboard);
-
-smalltalk.addMethod(
-smalltalk.method({
-selector: "toModel:",
-category: 'data transformation',
-fn: function (aDataCarrier){
-var self=this;
-return smalltalk.withContext(function($ctx1) { 
-_st(aDataCarrier)._modifyTarget();
-return self}, function($ctx1) {$ctx1.fill(self,"toModel:",{aDataCarrier:aDataCarrier},smalltalk.TrappedProcessorBlackboard)})},
-args: ["aDataCarrier"],
-source: "toModel: aDataCarrier\x0a\x09aDataCarrier modifyTarget",
-messageSends: ["modifyTarget"],
-referencedClasses: []
-}),
-smalltalk.TrappedProcessorBlackboard);
-
-
-
-smalltalk.addClass('TrappedProcessorTerminator', smalltalk.TrappedProcessor, [], 'Trapped-Frontend');
-smalltalk.TrappedProcessorTerminator.comment="I do not proceed in toView:.\x0a\x0aI am added automatically to end of chain when it does not contain\x0aany element that isExpectingModelData (see TrappedDataExpectingProcessor).";
-smalltalk.addMethod(
-smalltalk.method({
-selector: "toView:",
-category: 'data transformation',
-fn: function (aDataCarrier){
-var self=this;
-return smalltalk.withContext(function($ctx1) { 
-return self}, function($ctx1) {$ctx1.fill(self,"toView:",{aDataCarrier:aDataCarrier},smalltalk.TrappedProcessorTerminator)})},
-args: ["aDataCarrier"],
-source: "toView: aDataCarrier\x0a\x09\x22stop\x22",
-messageSends: [],
-referencedClasses: []
-}),
-smalltalk.TrappedProcessorTerminator);
-
-
-
-smalltalk.addClass('TrappedSingleton', smalltalk.Object, [], 'Trapped-Frontend');
-smalltalk.addMethod(
-smalltalk.method({
-selector: "start:",
-category: 'action',
-fn: function (args){
-var self=this;
-return smalltalk.withContext(function($ctx1) { 
-var $1;
-$1=self._subclassResponsibility();
-return $1;
-}, function($ctx1) {$ctx1.fill(self,"start:",{args:args},smalltalk.TrappedSingleton)})},
-args: ["args"],
-source: "start: args\x0a\x09^ self subclassResponsibility",
-messageSends: ["subclassResponsibility"],
-referencedClasses: []
-}),
-smalltalk.TrappedSingleton);
-
-
-smalltalk.TrappedSingleton.klass.iVarNames = ['current'];
-smalltalk.addMethod(
-smalltalk.method({
-selector: "current",
-category: 'accessing',
-fn: function (){
-var self=this;
-return smalltalk.withContext(function($ctx1) { 
-var $2,$1;
-$2=self["@current"];
-if(($receiver = $2) == nil || $receiver == null){
-self["@current"]=self._new();
-$1=self["@current"];
-} else {
-$1=$2;
-};
-return $1;
-}, function($ctx1) {$ctx1.fill(self,"current",{},smalltalk.TrappedSingleton.klass)})},
-args: [],
-source: "current\x0a\x09^ current ifNil: [ current := self new ]",
-messageSends: ["ifNil:", "new"],
-referencedClasses: []
-}),
-smalltalk.TrappedSingleton.klass);
-
-smalltalk.addMethod(
-smalltalk.method({
-selector: "start:",
-category: 'action',
-fn: function (args){
-var self=this;
-return smalltalk.withContext(function($ctx1) { 
-_st(self._current())._start_(args);
-return self}, function($ctx1) {$ctx1.fill(self,"start:",{args:args},smalltalk.TrappedSingleton.klass)})},
-args: ["args"],
-source: "start: args\x0a\x09self current start: args",
-messageSends: ["start:", "current"],
-referencedClasses: []
-}),
-smalltalk.TrappedSingleton.klass);
-
-
-smalltalk.addClass('Trapped', smalltalk.TrappedSingleton, ['registry'], 'Trapped-Frontend');
-smalltalk.addMethod(
-smalltalk.method({
-selector: "byName:",
-category: 'accessing',
-fn: function (aString){
-var self=this;
-return smalltalk.withContext(function($ctx1) { 
-var $1;
-$1=_st(self["@registry"])._at_(aString);
-return $1;
-}, function($ctx1) {$ctx1.fill(self,"byName:",{aString:aString},smalltalk.Trapped)})},
-args: ["aString"],
-source: "byName: aString\x0a\x09^ registry at: aString",
-messageSends: ["at:"],
-referencedClasses: []
-}),
-smalltalk.Trapped);
-
-smalltalk.addMethod(
-smalltalk.method({
-selector: "cloneAndInject:",
-category: 'private',
-fn: function (anObject){
-var self=this;
-return smalltalk.withContext(function($ctx1) { 
-var $2,$3,$1;
-$2=_st(_st(anObject)._asJQuery())._clone();
-_st($2)._each_((function(i,each){
-return smalltalk.withContext(function($ctx2) {
-return self._injectToElement_(each);
-}, function($ctx2) {$ctx2.fillBlock({i:i,each:each},$ctx1,1)})}));
-$3=_st($2)._get_((0));
-$1=$3;
-return $1;
-}, function($ctx1) {$ctx1.fill(self,"cloneAndInject:",{anObject:anObject},smalltalk.Trapped)})},
-args: ["anObject"],
-source: "cloneAndInject: anObject\x0a\x09^anObject asJQuery clone\x0a\x09\x09each: [ :i :each | self injectToElement: each ];\x0a\x09\x09get: 0",
-messageSends: ["each:", "clone", "asJQuery", "injectToElement:", "get:"],
-referencedClasses: []
-}),
-smalltalk.Trapped);
-
-smalltalk.addMethod(
-smalltalk.method({
-selector: "descend:snapshotDo:",
-category: 'private',
-fn: function (anArray,aBlock){
-var self=this;
-var tpsc;
-function $TrappedPathStack(){return smalltalk.TrappedPathStack||(typeof TrappedPathStack=="undefined"?nil:TrappedPathStack)}
-function $TrappedSnapshot(){return smalltalk.TrappedSnapshot||(typeof TrappedSnapshot=="undefined"?nil:TrappedSnapshot)}
-return smalltalk.withContext(function($ctx1) { 
-tpsc=_st($TrappedPathStack())._current();
-_st(tpsc)._append_do_(anArray,(function(){
-var path,model;
-return smalltalk.withContext(function($ctx2) {
-path=_st(_st(tpsc)._elements())._copy();
-path;
-model=self._byName_(_st(path)._first());
-model;
-return _st(aBlock)._value_(_st(_st($TrappedSnapshot())._new())._path_model_(path,model));
-}, function($ctx2) {$ctx2.fillBlock({path:path,model:model},$ctx1,1)})}));
-return self}, function($ctx1) {$ctx1.fill(self,"descend:snapshotDo:",{anArray:anArray,aBlock:aBlock,tpsc:tpsc},smalltalk.Trapped)})},
-args: ["anArray", "aBlock"],
-source: "descend: anArray snapshotDo: aBlock\x0a\x09| tpsc |\x0a    tpsc := TrappedPathStack current.\x0a    tpsc append: anArray do: [\x0a        | path model |\x0a        path := tpsc elements copy.\x0a   \x09    model := self byName: path first.\x0a        aBlock value: (TrappedSnapshot new path: path model: model)\x0a    ]",
-messageSends: ["current", "append:do:", "copy", "elements", "byName:", "first", "value:", "path:model:", "new"],
-referencedClasses: ["TrappedPathStack", "TrappedSnapshot"]
-}),
-smalltalk.Trapped);
-
-smalltalk.addMethod(
-smalltalk.method({
-selector: "initialize",
-category: 'initialization',
-fn: function (){
-var self=this;
-return smalltalk.withContext(function($ctx1) { 
-smalltalk.Trapped.superclass.fn.prototype._initialize.apply(_st(self), []);
-self["@registry"]=smalltalk.HashedCollection._from_([]);
-return self}, function($ctx1) {$ctx1.fill(self,"initialize",{},smalltalk.Trapped)})},
-args: [],
-source: "initialize\x0a\x09super initialize.\x0a\x09registry := #{}.",
-messageSends: ["initialize"],
-referencedClasses: []
-}),
-smalltalk.Trapped);
-
-smalltalk.addMethod(
-smalltalk.method({
-selector: "injectToChildren:",
-category: 'private',
-fn: function (anElement){
-var self=this;
-var child;
-return smalltalk.withContext(function($ctx1) { 
-child=_st(anElement)._firstChild();
-_st((function(){
-return smalltalk.withContext(function($ctx2) {
-return _st(child)._isNil();
-}, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})}))._whileFalse_((function(){
-return smalltalk.withContext(function($ctx2) {
-self._injectToElement_(child);
-child=_st(child)._nextSibling();
-return child;
-}, function($ctx2) {$ctx2.fillBlock({},$ctx1,2)})}));
-return self}, function($ctx1) {$ctx1.fill(self,"injectToChildren:",{anElement:anElement,child:child},smalltalk.Trapped)})},
-args: ["anElement"],
-source: "injectToChildren: anElement\x0a\x09| child |\x0a\x09child := anElement firstChild.\x0a\x09[ child isNil ] whileFalse: [ self injectToElement: child. child := child nextSibling ]",
-messageSends: ["firstChild", "whileFalse:", "isNil", "injectToElement:", "nextSibling"],
-referencedClasses: []
-}),
-smalltalk.Trapped);
-
-smalltalk.addMethod(
-smalltalk.method({
-selector: "injectToElement:",
-category: 'private',
-fn: function (anElement){
-var self=this;
-var jq;
-function $Trapped(){return smalltalk.Trapped||(typeof Trapped=="undefined"?nil:Trapped)}
-function $HTMLCanvas(){return smalltalk.HTMLCanvas||(typeof HTMLCanvas=="undefined"?nil:HTMLCanvas)}
-return smalltalk.withContext(function($ctx1) { 
-var $1;
-jq=_st(anElement)._asJQuery();
-$1=_st(jq)._attr_("data-trap");
-if(($receiver = $1) == nil || $receiver == null){
-$1;
-} else {
-var attr;
-attr=$receiver;
-_st(jq)._removeAttr_("data-trap");
-_st(_st($Trapped())._parse_(attr))._do_((function(rule){
-return smalltalk.withContext(function($ctx2) {
-return _st(_st(_st($HTMLCanvas())._onJQuery_(jq))._root())._trap_processors_(_st(rule)._first(),_st(rule)._at_ifAbsent_((2),(function(){
-return smalltalk.withContext(function($ctx3) {
-return [];
-}, function($ctx3) {$ctx3.fillBlock({},$ctx2,3)})})));
-}, function($ctx2) {$ctx2.fillBlock({rule:rule},$ctx1,2)})}));
-};
-self._injectToChildren_(anElement);
-return self}, function($ctx1) {$ctx1.fill(self,"injectToElement:",{anElement:anElement,jq:jq},smalltalk.Trapped)})},
-args: ["anElement"],
-source: "injectToElement: anElement\x0a\x09| jq |\x0a\x09jq := anElement asJQuery.\x0a\x09(jq attr: 'data-trap') ifNotNil: [ :attr |\x0a\x09\x09jq removeAttr: 'data-trap'.\x0a\x09\x09(Trapped parse: attr) do: [ :rule |\x0a\x09\x09\x09(HTMLCanvas onJQuery: jq) root trap: rule first processors: (rule at: 2 ifAbsent: [#()]) ] ].\x0a\x09self injectToChildren: anElement",
-messageSends: ["asJQuery", "ifNotNil:", "attr:", "removeAttr:", "do:", "parse:", "trap:processors:", "root", "onJQuery:", "first", "at:ifAbsent:", "injectToChildren:"],
-referencedClasses: ["Trapped", "HTMLCanvas"]
-}),
-smalltalk.Trapped);
-
-smalltalk.addMethod(
-smalltalk.method({
-selector: "register:",
-category: 'accessing',
-fn: function (aListKeyedEntity){
-var self=this;
-return smalltalk.withContext(function($ctx1) { 
-self._register_name_(aListKeyedEntity,_st(_st(aListKeyedEntity)._class())._name());
-return self}, function($ctx1) {$ctx1.fill(self,"register:",{aListKeyedEntity:aListKeyedEntity},smalltalk.Trapped)})},
-args: ["aListKeyedEntity"],
-source: "register: aListKeyedEntity\x0a\x09self register: aListKeyedEntity name: aListKeyedEntity class name",
-messageSends: ["register:name:", "name", "class"],
-referencedClasses: []
-}),
-smalltalk.Trapped);
-
-smalltalk.addMethod(
-smalltalk.method({
-selector: "register:name:",
-category: 'accessing',
-fn: function (aListKeyedEntity,aString){
-var self=this;
-return smalltalk.withContext(function($ctx1) { 
-_st(self["@registry"])._at_put_(aString,aListKeyedEntity);
-return self}, function($ctx1) {$ctx1.fill(self,"register:name:",{aListKeyedEntity:aListKeyedEntity,aString:aString},smalltalk.Trapped)})},
-args: ["aListKeyedEntity", "aString"],
-source: "register: aListKeyedEntity name: aString\x0a\x09registry at: aString put: aListKeyedEntity",
-messageSends: ["at:put:"],
-referencedClasses: []
-}),
-smalltalk.Trapped);
-
-smalltalk.addMethod(
-smalltalk.method({
-selector: "start:",
-category: 'action',
-fn: function (args){
-var self=this;
-return smalltalk.withContext(function($ctx1) { 
-_st(args)._do_((function(each){
-return smalltalk.withContext(function($ctx2) {
-return self._register_(each);
-}, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,1)})}));
-self._injectToElement_(document);
-return self}, function($ctx1) {$ctx1.fill(self,"start:",{args:args},smalltalk.Trapped)})},
-args: ["args"],
-source: "start: args\x0a\x09args do: [ :each | self register: each ].\x0a\x09self injectToElement: document",
-messageSends: ["do:", "register:", "injectToElement:"],
-referencedClasses: []
-}),
-smalltalk.Trapped);
-
-
-smalltalk.addMethod(
-smalltalk.method({
-selector: "loop:before:do:",
-category: 'private',
-fn: function (aSequenceableCollection,aNode,aBlock){
-var self=this;
-function $HTMLCanvas(){return smalltalk.HTMLCanvas||(typeof HTMLCanvas=="undefined"?nil:HTMLCanvas)}
-return smalltalk.withContext(function($ctx1) { 
-_st(aSequenceableCollection)._withIndexDo_((function(item,i){
-var env;
-return smalltalk.withContext(function($ctx2) {
-env=_st(document)._createDocumentFragment();
-env;
-_st([i])._trapDescend_((function(){
-return smalltalk.withContext(function($ctx3) {
-return _st(_st(_st($HTMLCanvas())._onJQuery_(_st(env)._asJQuery()))._root())._with_(aBlock);
-}, function($ctx3) {$ctx3.fillBlock({},$ctx2,2)})}));
-return _st(_st(aNode)._parentNode())._insertBefore_reference_(env,aNode);
-}, function($ctx2) {$ctx2.fillBlock({item:item,i:i,env:env},$ctx1,1)})}));
-return self}, function($ctx1) {$ctx1.fill(self,"loop:before:do:",{aSequenceableCollection:aSequenceableCollection,aNode:aNode,aBlock:aBlock},smalltalk.Trapped.klass)})},
-args: ["aSequenceableCollection", "aNode", "aBlock"],
-source: "loop: aSequenceableCollection before: aNode do: aBlock\x0a\x09aSequenceableCollection withIndexDo: [ :item :i |\x0a\x09\x09| env |\x0a\x09\x09env := document createDocumentFragment.\x0a\x09\x09{i} trapDescend: [ (HTMLCanvas onJQuery: env asJQuery) root with: aBlock ].\x0a\x09\x09aNode parentNode insertBefore: env reference: aNode ]",
-messageSends: ["withIndexDo:", "createDocumentFragment", "trapDescend:", "with:", "root", "onJQuery:", "asJQuery", "insertBefore:reference:", "parentNode"],
-referencedClasses: ["HTMLCanvas"]
-}),
-smalltalk.Trapped.klass);
-
-smalltalk.addMethod(
-smalltalk.method({
-selector: "loop:between:and:do:",
-category: 'private',
-fn: function (aSequenceableCollection,aTagBrush,anotherTagBrush,aBlock){
-var self=this;
-return smalltalk.withContext(function($ctx1) { 
-var $2,$3,$1;
-$2=_st(aTagBrush)._asJQuery();
-$3=_st(anotherTagBrush)._element();
-$ctx1.sendIdx["element"]=1;
-$1=_st($2)._nextUntil_($3);
-_st($1)._remove();
-if(($receiver = aSequenceableCollection) == nil || $receiver == null){
-aSequenceableCollection;
-} else {
-self._loop_before_do_(aSequenceableCollection,_st(anotherTagBrush)._element(),aBlock);
-};
-return self}, function($ctx1) {$ctx1.fill(self,"loop:between:and:do:",{aSequenceableCollection:aSequenceableCollection,aTagBrush:aTagBrush,anotherTagBrush:anotherTagBrush,aBlock:aBlock},smalltalk.Trapped.klass)})},
-args: ["aSequenceableCollection", "aTagBrush", "anotherTagBrush", "aBlock"],
-source: "loop: aSequenceableCollection between: aTagBrush and: anotherTagBrush do: aBlock\x0a\x09(aTagBrush asJQuery nextUntil: anotherTagBrush element) remove.\x0a\x09aSequenceableCollection ifNotNil: [\x0a\x09\x09self loop: aSequenceableCollection before: anotherTagBrush element do: aBlock\x0a\x09]",
-messageSends: ["remove", "nextUntil:", "asJQuery", "element", "ifNotNil:", "loop:before:do:"],
-referencedClasses: []
-}),
-smalltalk.Trapped.klass);
-
-smalltalk.addMethod(
-smalltalk.method({
-selector: "parse:",
-category: 'accessing',
-fn: function (aString){
-var self=this;
-return smalltalk.withContext(function($ctx1) { 
-var $2,$3,$4,$5,$6,$8,$7,$9,$10,$11,$12,$13,$14,$1;
-$2=_st(aString)._tokenize_(".");
-$ctx1.sendIdx["tokenize:"]=1;
-$1=_st($2)._collect_((function(rule){
-return smalltalk.withContext(function($ctx2) {
-$3=_st(rule)._tokenize_(":");
-$ctx2.sendIdx["tokenize:"]=2;
-return _st($3)._collect_((function(message){
-var result,stack,anArray;
-return smalltalk.withContext(function($ctx3) {
-anArray=_st(message)._tokenize_(" ");
-anArray;
-result=[];
-result;
-stack=[result];
-stack;
-_st(anArray)._do_((function(each){
-var asNum,inner,close;
-return smalltalk.withContext(function($ctx4) {
-close=(0);
-close;
-inner=each;
-inner;
-_st((function(){
-return smalltalk.withContext(function($ctx5) {
-$4=_st(inner)._notEmpty();
-$ctx5.sendIdx["notEmpty"]=1;
-return _st($4)._and_((function(){
-return smalltalk.withContext(function($ctx6) {
-$5=_st(inner)._first();
-$ctx6.sendIdx["first"]=1;
-return _st($5).__eq("(");
-$ctx6.sendIdx["="]=1;
-}, function($ctx6) {$ctx6.fillBlock({},$ctx5,5)})}));
-$ctx5.sendIdx["and:"]=1;
-}, function($ctx5) {$ctx5.fillBlock({},$ctx4,4)})}))._whileTrue_((function(){
-return smalltalk.withContext(function($ctx5) {
-inner=_st(inner)._allButFirst();
-$ctx5.sendIdx["allButFirst"]=1;
-inner;
-$6=stack;
-$8=_st(stack)._last();
-$ctx5.sendIdx["last"]=1;
-$7=_st($8)._add_([]);
-$ctx5.sendIdx["add:"]=2;
-return _st($6)._add_($7);
-$ctx5.sendIdx["add:"]=1;
-}, function($ctx5) {$ctx5.fillBlock({},$ctx4,6)})}));
-$ctx4.sendIdx["whileTrue:"]=1;
-_st((function(){
-return smalltalk.withContext(function($ctx5) {
-$9=_st(inner)._notEmpty();
-$ctx5.sendIdx["notEmpty"]=2;
-return _st($9)._and_((function(){
-return smalltalk.withContext(function($ctx6) {
-$10=_st(inner)._last();
-$ctx6.sendIdx["last"]=2;
-return _st($10).__eq(")");
-$ctx6.sendIdx["="]=2;
-}, function($ctx6) {$ctx6.fillBlock({},$ctx5,8)})}));
-$ctx5.sendIdx["and:"]=2;
-}, function($ctx5) {$ctx5.fillBlock({},$ctx4,7)})}))._whileTrue_((function(){
-return smalltalk.withContext(function($ctx5) {
-inner=_st(inner)._allButLast();
-inner;
-close=_st(close).__plus((1));
-return close;
-}, function($ctx5) {$ctx5.fillBlock({},$ctx4,9)})}));
-$11=_st(_st(inner)._notEmpty())._and_((function(){
-return smalltalk.withContext(function($ctx5) {
-return _st(_st(inner)._first()).__eq("#");
-$ctx5.sendIdx["="]=3;
-}, function($ctx5) {$ctx5.fillBlock({},$ctx4,10)})}));
-if(smalltalk.assert($11)){
-inner=[_st(inner)._allButFirst()];
-inner;
-};
-$12=_st(inner)._isString();
-if(smalltalk.assert($12)){
-asNum=_st(_st(inner)._ifEmpty_((function(){
-return smalltalk.withContext(function($ctx5) {
-return "NaN";
-}, function($ctx5) {$ctx5.fillBlock({},$ctx4,13)})})))._asNumber();
-} else {
-asNum=inner;
-};
-asNum;
-$13=_st(asNum).__eq(asNum);
-if(smalltalk.assert($13)){
-$14=_st(stack)._last();
-$ctx4.sendIdx["last"]=3;
-_st($14)._add_(asNum);
-$ctx4.sendIdx["add:"]=3;
-} else {
-_st(inner)._ifNotEmpty_((function(){
-return smalltalk.withContext(function($ctx5) {
-return _st(_st(stack)._last())._add_(inner);
-}, function($ctx5) {$ctx5.fillBlock({},$ctx4,17)})}));
-};
-return _st(close)._timesRepeat_((function(){
-return smalltalk.withContext(function($ctx5) {
-return _st(stack)._removeLast();
-}, function($ctx5) {$ctx5.fillBlock({},$ctx4,18)})}));
-}, function($ctx4) {$ctx4.fillBlock({each:each,asNum:asNum,inner:inner,close:close},$ctx3,3)})}));
-return result;
-}, function($ctx3) {$ctx3.fillBlock({message:message,result:result,stack:stack,anArray:anArray},$ctx2,2)})}));
-}, function($ctx2) {$ctx2.fillBlock({rule:rule},$ctx1,1)})}));
-$ctx1.sendIdx["collect:"]=1;
-return $1;
-}, function($ctx1) {$ctx1.fill(self,"parse:",{aString:aString},smalltalk.Trapped.klass)})},
-args: ["aString"],
-source: "parse: aString\x0a\x09^ (aString tokenize: '.') collect: [ :rule |\x0a\x09\x09(rule tokenize: ':') collect: [ :message |\x0a\x09\x09\x09| result stack anArray |\x0a\x09\x09\x09anArray := message tokenize: ' '.\x0a\x09\x09\x09result := #().\x0a\x09\x09\x09stack := { result }.\x0a\x09\x09\x09anArray do: [ :each |\x0a    \x09\x09\x09| asNum inner close |\x0a\x09\x09\x09\x09close := 0.\x0a\x09\x09\x09\x09inner := each.\x0a\x09\x09\x09\x09[ inner notEmpty and: [ inner first = '(' ]] whileTrue: [ inner := inner allButFirst. stack add: (stack last add: #()) ].\x0a\x09\x09\x09\x09[ inner notEmpty and: [ inner last = ')' ]] whileTrue: [ inner := inner allButLast. close := close + 1 ].\x0a\x09\x09\x09\x09(inner notEmpty and: [ inner first = '#' ]) ifTrue: [ inner := { inner allButFirst } ].\x0a\x09\x09       \x09asNum := inner isString ifTrue: [ (inner ifEmpty: [ 'NaN' ]) asNumber ] ifFalse: [ inner ].\x0a        \x09\x09asNum = asNum ifTrue: [ stack last add: asNum ] ifFalse: [\x0a\x09\x09\x09\x09\x09inner ifNotEmpty: [ stack last add: inner ] ].\x0a\x09\x09\x09\x09close timesRepeat: [ stack removeLast ] ].\x0a\x09\x09\x09result ] ]",
-messageSends: ["collect:", "tokenize:", "do:", "whileTrue:", "and:", "notEmpty", "=", "first", "allButFirst", "add:", "last", "allButLast", "+", "ifTrue:", "ifTrue:ifFalse:", "isString", "asNumber", "ifEmpty:", "ifNotEmpty:", "timesRepeat:", "removeLast"],
-referencedClasses: []
-}),
-smalltalk.Trapped.klass);
-
-
-smalltalk.addClass('TrappedPathStack', smalltalk.TrappedSingleton, ['elements'], 'Trapped-Frontend');
-smalltalk.addMethod(
-smalltalk.method({
-selector: "append:do:",
-category: 'descending',
-fn: function (anArray,aBlock){
-var self=this;
-return smalltalk.withContext(function($ctx1) { 
-self._with_do_(_st(self["@elements"]).__comma(anArray),aBlock);
-return self}, function($ctx1) {$ctx1.fill(self,"append:do:",{anArray:anArray,aBlock:aBlock},smalltalk.TrappedPathStack)})},
-args: ["anArray", "aBlock"],
-source: "append: anArray do: aBlock\x0a    self with: elements, anArray do: aBlock",
-messageSends: ["with:do:", ","],
-referencedClasses: []
-}),
-smalltalk.TrappedPathStack);
-
-smalltalk.addMethod(
-smalltalk.method({
-selector: "elements",
-category: 'accessing',
-fn: function (){
-var self=this;
-return smalltalk.withContext(function($ctx1) { 
-var $1;
-$1=self["@elements"];
-return $1;
-}, function($ctx1) {$ctx1.fill(self,"elements",{},smalltalk.TrappedPathStack)})},
-args: [],
-source: "elements\x0a\x09^elements",
-messageSends: [],
-referencedClasses: []
-}),
-smalltalk.TrappedPathStack);
-
-smalltalk.addMethod(
-smalltalk.method({
-selector: "initialize",
-category: 'initialization',
-fn: function (){
-var self=this;
-return smalltalk.withContext(function($ctx1) { 
-smalltalk.TrappedPathStack.superclass.fn.prototype._initialize.apply(_st(self), []);
-self["@elements"]=[];
-return self}, function($ctx1) {$ctx1.fill(self,"initialize",{},smalltalk.TrappedPathStack)})},
-args: [],
-source: "initialize\x0a    super initialize.\x0a\x09elements := #().",
-messageSends: ["initialize"],
-referencedClasses: []
-}),
-smalltalk.TrappedPathStack);
-
-smalltalk.addMethod(
-smalltalk.method({
-selector: "with:do:",
-category: 'descending',
-fn: function (anArray,aBlock){
-var self=this;
-var old;
-return smalltalk.withContext(function($ctx1) { 
-old=self["@elements"];
-_st((function(){
-return smalltalk.withContext(function($ctx2) {
-self["@elements"]=anArray;
-self["@elements"];
-return _st(aBlock)._value();
-}, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})}))._ensure_((function(){
-return smalltalk.withContext(function($ctx2) {
-self["@elements"]=old;
-return self["@elements"];
-}, function($ctx2) {$ctx2.fillBlock({},$ctx1,2)})}));
-return self}, function($ctx1) {$ctx1.fill(self,"with:do:",{anArray:anArray,aBlock:aBlock,old:old},smalltalk.TrappedPathStack)})},
-args: ["anArray", "aBlock"],
-source: "with: anArray do: aBlock\x0a\x09| old |\x0a    old := elements.\x0a    [ elements := anArray.\x0a\x09aBlock value ] ensure: [ elements := old ]",
-messageSends: ["ensure:", "value"],
-referencedClasses: []
-}),
-smalltalk.TrappedPathStack);
-
-
-
-smalltalk.addClass('TrappedSnapshot', smalltalk.Object, ['path', 'model'], 'Trapped-Frontend');
-smalltalk.addMethod(
-smalltalk.method({
-selector: "do:",
-category: 'action',
-fn: function (aBlock){
-var self=this;
-function $TrappedPathStack(){return smalltalk.TrappedPathStack||(typeof TrappedPathStack=="undefined"?nil:TrappedPathStack)}
-return smalltalk.withContext(function($ctx1) { 
-_st(_st($TrappedPathStack())._current())._with_do_(self["@path"],(function(){
-return smalltalk.withContext(function($ctx2) {
-return _st(aBlock)._value_(self["@model"]);
-}, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})}));
-return self}, function($ctx1) {$ctx1.fill(self,"do:",{aBlock:aBlock},smalltalk.TrappedSnapshot)})},
-args: ["aBlock"],
-source: "do: aBlock\x0a\x09TrappedPathStack current with: path do: [ aBlock value: model ]",
-messageSends: ["with:do:", "current", "value:"],
-referencedClasses: ["TrappedPathStack"]
-}),
-smalltalk.TrappedSnapshot);
-
-smalltalk.addMethod(
-smalltalk.method({
-selector: "model",
-category: 'accessing',
-fn: function (){
-var self=this;
-return smalltalk.withContext(function($ctx1) { 
-var $1;
-$1=self["@model"];
-return $1;
-}, function($ctx1) {$ctx1.fill(self,"model",{},smalltalk.TrappedSnapshot)})},
-args: [],
-source: "model\x0a\x09^model",
-messageSends: [],
-referencedClasses: []
-}),
-smalltalk.TrappedSnapshot);
-
-smalltalk.addMethod(
-smalltalk.method({
-selector: "modify:",
-category: 'action',
-fn: function (aBlock){
-var self=this;
-return smalltalk.withContext(function($ctx1) { 
-_st(self._model())._modify_do_(_st(self._path())._allButFirst(),aBlock);
-return self}, function($ctx1) {$ctx1.fill(self,"modify:",{aBlock:aBlock},smalltalk.TrappedSnapshot)})},
-args: ["aBlock"],
-source: "modify: aBlock\x0a\x09self model modify: self path allButFirst do: aBlock",
-messageSends: ["modify:do:", "model", "allButFirst", "path"],
-referencedClasses: []
-}),
-smalltalk.TrappedSnapshot);
-
-smalltalk.addMethod(
-smalltalk.method({
-selector: "path",
-category: 'accessing',
-fn: function (){
-var self=this;
-return smalltalk.withContext(function($ctx1) { 
-var $1;
-$1=self["@path"];
-return $1;
-}, function($ctx1) {$ctx1.fill(self,"path",{},smalltalk.TrappedSnapshot)})},
-args: [],
-source: "path\x0a\x09^path",
-messageSends: [],
-referencedClasses: []
-}),
-smalltalk.TrappedSnapshot);
-
-smalltalk.addMethod(
-smalltalk.method({
-selector: "path:model:",
-category: 'accessing',
-fn: function (anArray,aTrappedMW){
-var self=this;
-return smalltalk.withContext(function($ctx1) { 
-self["@path"]=anArray;
-self["@model"]=aTrappedMW;
-return self}, function($ctx1) {$ctx1.fill(self,"path:model:",{anArray:anArray,aTrappedMW:aTrappedMW},smalltalk.TrappedSnapshot)})},
-args: ["anArray", "aTrappedMW"],
-source: "path: anArray model: aTrappedMW\x0a\x09path := anArray.\x0a    model := aTrappedMW",
-messageSends: [],
-referencedClasses: []
-}),
-smalltalk.TrappedSnapshot);
-
-smalltalk.addMethod(
-smalltalk.method({
-selector: "read:",
-category: 'action',
-fn: function (aBlock){
-var self=this;
-return smalltalk.withContext(function($ctx1) { 
-_st(self._model())._read_do_(_st(self._path())._allButFirst(),aBlock);
-return self}, function($ctx1) {$ctx1.fill(self,"read:",{aBlock:aBlock},smalltalk.TrappedSnapshot)})},
-args: ["aBlock"],
-source: "read: aBlock\x0a\x09self model read: self path allButFirst do: aBlock",
-messageSends: ["read:do:", "model", "allButFirst", "path"],
-referencedClasses: []
-}),
-smalltalk.TrappedSnapshot);
-
-smalltalk.addMethod(
-smalltalk.method({
-selector: "watch:",
-category: 'action',
-fn: function (aBlock){
-var self=this;
-return smalltalk.withContext(function($ctx1) { 
-_st(self._model())._watch_do_(_st(self._path())._allButFirst(),aBlock);
-return self}, function($ctx1) {$ctx1.fill(self,"watch:",{aBlock:aBlock},smalltalk.TrappedSnapshot)})},
-args: ["aBlock"],
-source: "watch: aBlock\x0a\x09self model watch: self path allButFirst do: aBlock",
-messageSends: ["watch:do:", "model", "allButFirst", "path"],
-referencedClasses: []
-}),
-smalltalk.TrappedSnapshot);
-
-
-smalltalk.addMethod(
-smalltalk.method({
-selector: "asTrapProcSendTo:",
-category: '*Trapped-Frontend',
-fn: function (anObject){
-var self=this;
-return smalltalk.withContext(function($ctx1) { 
-var $1;
-$1=_st("Trapped cannot use processor descriptor of ".__comma(_st(self._class())._name())).__comma(" type.");
-$ctx1.sendIdx[","]=1;
-self._error_($1);
-return self}, function($ctx1) {$ctx1.fill(self,"asTrapProcSendTo:",{anObject:anObject},smalltalk.Object)})},
-args: ["anObject"],
-source: "asTrapProcSendTo: anObject\x0a\x09self error: 'Trapped cannot use processor descriptor of ', self class name, ' type.'",
-messageSends: ["error:", ",", "name", "class"],
-referencedClasses: []
-}),
-smalltalk.Object);
-
-smalltalk.addMethod(
-smalltalk.method({
-selector: "asTrapProcSendTo:",
-category: '*Trapped-Frontend',
-fn: function (anObject){
-var self=this;
-return smalltalk.withContext(function($ctx1) { 
-var $1;
-$1=_st(anObject)._perform_(self);
-return $1;
-}, function($ctx1) {$ctx1.fill(self,"asTrapProcSendTo:",{anObject:anObject},smalltalk.String)})},
-args: ["anObject"],
-source: "asTrapProcSendTo: anObject\x0a\x09^anObject perform: self",
-messageSends: ["perform:"],
-referencedClasses: []
-}),
-smalltalk.String);
-
-smalltalk.addMethod(
-smalltalk.method({
-selector: "asTrapProcSendTo:",
-category: '*Trapped-Frontend',
-fn: function (anObject){
-var self=this;
-var selector,args;
-return smalltalk.withContext(function($ctx1) { 
-var $1,$2;
-selector="";
-args=[];
-self._withIndexDo_((function(element,index){
-return smalltalk.withContext(function($ctx2) {
-$1=_st(index)._odd();
-if(smalltalk.assert($1)){
-selector=_st(selector).__comma(element);
-$ctx2.sendIdx[","]=1;
-return selector;
-} else {
-selector=_st(selector).__comma(":");
-selector;
-return _st(args)._add_(element);
-};
-}, function($ctx2) {$ctx2.fillBlock({element:element,index:index},$ctx1,1)})}));
-$2=_st(anObject)._perform_withArguments_(selector,args);
-return $2;
-}, function($ctx1) {$ctx1.fill(self,"asTrapProcSendTo:",{anObject:anObject,selector:selector,args:args},smalltalk.Array)})},
-args: ["anObject"],
-source: "asTrapProcSendTo: anObject\x0a\x09| selector args |\x0a\x09selector := ''.\x0a\x09args := #().\x0a\x09\x09self withIndexDo: [ :element :index | index odd\x0a\x09\x09\x09ifTrue: [ selector := selector, element ]\x0a\x09\x09\x09ifFalse: [ selector := selector, ':'. args add: element ] ].\x0a\x09^anObject perform: selector withArguments: args",
-messageSends: ["withIndexDo:", "ifTrue:ifFalse:", "odd", ",", "add:", "perform:withArguments:"],
-referencedClasses: []
-}),
-smalltalk.Array);
-
-smalltalk.addMethod(
-smalltalk.method({
-selector: "trapDescend:",
-category: '*Trapped-Frontend',
-fn: function (aBlock){
-var self=this;
-function $Trapped(){return smalltalk.Trapped||(typeof Trapped=="undefined"?nil:Trapped)}
-return smalltalk.withContext(function($ctx1) { 
-_st(_st($Trapped())._current())._descend_snapshotDo_(self,aBlock);
-return self}, function($ctx1) {$ctx1.fill(self,"trapDescend:",{aBlock:aBlock},smalltalk.Array)})},
-args: ["aBlock"],
-source: "trapDescend: aBlock\x0a\x09Trapped current descend: self snapshotDo: aBlock",
-messageSends: ["descend:snapshotDo:", "current"],
-referencedClasses: ["Trapped"]
-}),
-smalltalk.Array);
-
-smalltalk.addMethod(
-smalltalk.method({
-selector: "trapIter:do:",
-category: '*Trapped-Frontend',
-fn: function (path,aBlock){
-var self=this;
-return smalltalk.withContext(function($ctx1) { 
-var $1,$2;
-self._with_((function(html){
-return smalltalk.withContext(function($ctx2) {
-$1=_st(html)._tag_("script");
-_st($1)._at_put_("type","application/x-beacon");
-$2=_st($1)._trapIter_after_(path,aBlock);
-return $2;
-}, function($ctx2) {$ctx2.fillBlock({html:html},$ctx1,1)})}));
-return self}, function($ctx1) {$ctx1.fill(self,"trapIter:do:",{path:path,aBlock:aBlock},smalltalk.HTMLCanvas)})},
-args: ["path", "aBlock"],
-source: "trapIter: path do: aBlock\x0a    self with: [ :html | (html tag: 'script') at: 'type' put: 'application/x-beacon'; trapIter: path after: aBlock ]",
-messageSends: ["with:", "at:put:", "tag:", "trapIter:after:"],
-referencedClasses: []
-}),
-smalltalk.HTMLCanvas);
-
-smalltalk.addMethod(
-smalltalk.method({
-selector: "trap:",
-category: '*Trapped-Frontend',
-fn: function (path){
-var self=this;
-return smalltalk.withContext(function($ctx1) { 
-self._trap_processors_(path,[]);
-return self}, function($ctx1) {$ctx1.fill(self,"trap:",{path:path},smalltalk.TagBrush)})},
-args: ["path"],
-source: "trap: path\x0a\x09self trap: path processors: #()",
-messageSends: ["trap:processors:"],
-referencedClasses: []
-}),
-smalltalk.TagBrush);
-
-smalltalk.addMethod(
-smalltalk.method({
-selector: "trap:processors:",
-category: '*Trapped-Frontend',
-fn: function (path,anArray){
-var self=this;
-function $TrappedProcessingChain(){return smalltalk.TrappedProcessingChain||(typeof TrappedProcessingChain=="undefined"?nil:TrappedProcessingChain)}
-return smalltalk.withContext(function($ctx1) { 
-_st(path)._trapDescend_((function(snap){
-return smalltalk.withContext(function($ctx2) {
-return _st(_st($TrappedProcessingChain())._newFromProcessorSpecs_(anArray))._forSnapshot_andBrush_(snap,self);
-}, function($ctx2) {$ctx2.fillBlock({snap:snap},$ctx1,1)})}));
-return self}, function($ctx1) {$ctx1.fill(self,"trap:processors:",{path:path,anArray:anArray},smalltalk.TagBrush)})},
-args: ["path", "anArray"],
-source: "trap: path processors: anArray\x0a\x09path trapDescend: [ :snap |\x0a\x09\x09(TrappedProcessingChain newFromProcessorSpecs: anArray)\x0a\x09\x09\x09forSnapshot: snap andBrush: self ]",
-messageSends: ["trapDescend:", "forSnapshot:andBrush:", "newFromProcessorSpecs:"],
-referencedClasses: ["TrappedProcessingChain"]
-}),
-smalltalk.TagBrush);
-
-smalltalk.addMethod(
-smalltalk.method({
-selector: "trap:read:",
-category: '*Trapped-Frontend',
-fn: function (path,aBlock){
-var self=this;
-function $KeyedPubSubUnsubscribe(){return smalltalk.KeyedPubSubUnsubscribe||(typeof KeyedPubSubUnsubscribe=="undefined"?nil:KeyedPubSubUnsubscribe)}
-return smalltalk.withContext(function($ctx1) { 
-var $1;
-_st(path)._trapDescend_((function(snap){
-return smalltalk.withContext(function($ctx2) {
-return _st(snap)._watch_((function(data){
-return smalltalk.withContext(function($ctx3) {
-$1=_st(_st(_st(self._asJQuery())._closest_("html"))._toArray())._isEmpty();
-if(smalltalk.assert($1)){
-_st($KeyedPubSubUnsubscribe())._signal();
-};
-return _st(snap)._do_((function(){
-return smalltalk.withContext(function($ctx4) {
-return self._with_((function(html){
-return smalltalk.withContext(function($ctx5) {
-return _st(aBlock)._value_value_(data,html);
-}, function($ctx5) {$ctx5.fillBlock({html:html},$ctx4,5)})}));
-}, function($ctx4) {$ctx4.fillBlock({},$ctx3,4)})}));
-}, function($ctx3) {$ctx3.fillBlock({data:data},$ctx2,2)})}));
-}, function($ctx2) {$ctx2.fillBlock({snap:snap},$ctx1,1)})}));
-return self}, function($ctx1) {$ctx1.fill(self,"trap:read:",{path:path,aBlock:aBlock},smalltalk.TagBrush)})},
-args: ["path", "aBlock"],
-source: "trap: path read: aBlock\x0a\x09path trapDescend: [ :snap |\x0a        snap watch: [ :data |\x0a            (self asJQuery closest: 'html') toArray isEmpty ifTrue: [ KeyedPubSubUnsubscribe signal ].\x0a        \x09snap do: [ self with: [ :html | aBlock value: data value: html ] ]\x0a    \x09]\x0a    ]",
-messageSends: ["trapDescend:", "watch:", "ifTrue:", "isEmpty", "toArray", "closest:", "asJQuery", "signal", "do:", "with:", "value:value:"],
-referencedClasses: ["KeyedPubSubUnsubscribe"]
-}),
-smalltalk.TagBrush);
-
-smalltalk.addMethod(
-smalltalk.method({
-selector: "trapGuard:contents:",
-category: '*Trapped-Frontend',
-fn: function (anArray,aBlock){
-var self=this;
-return smalltalk.withContext(function($ctx1) { 
-var $1,$2,$3,$4,$5;
-[]._trapDescend_((function(snap){
-var shown;
-return smalltalk.withContext(function($ctx2) {
-shown=nil;
-shown;
-return self._trap_read_(anArray,(function(gdata){
-var sanitized;
-return smalltalk.withContext(function($ctx3) {
-if(($receiver = gdata) == nil || $receiver == null){
-sanitized=false;
-} else {
-sanitized=gdata;
-};
-sanitized;
-$1=_st(shown).__eq(sanitized);
-if(! smalltalk.assert($1)){
-shown=sanitized;
-shown;
-$2=shown;
-if(smalltalk.assert($2)){
-_st(snap)._do_((function(){
-return smalltalk.withContext(function($ctx4) {
-return self._contents_(aBlock);
-}, function($ctx4) {$ctx4.fillBlock({},$ctx3,6)})}));
-$3=self._asJQuery();
-$ctx3.sendIdx["asJQuery"]=1;
-return _st($3)._show();
-} else {
-$4=self._asJQuery();
-_st($4)._hide();
-$5=_st($4)._empty();
-return $5;
-};
-};
-}, function($ctx3) {$ctx3.fillBlock({gdata:gdata,sanitized:sanitized},$ctx2,2)})}));
-}, function($ctx2) {$ctx2.fillBlock({snap:snap,shown:shown},$ctx1,1)})}));
-return self}, function($ctx1) {$ctx1.fill(self,"trapGuard:contents:",{anArray:anArray,aBlock:aBlock},smalltalk.TagBrush)})},
-args: ["anArray", "aBlock"],
-source: "trapGuard: anArray contents: aBlock\x0a\x09#() trapDescend: [ :snap |\x0a\x09    | shown |\x0a    \x09shown := nil.\x0a\x09    self trap: anArray read: [ :gdata |\x0a\x09\x09\x09| sanitized |\x0a\x09\x09\x09sanitized := gdata ifNil: [ false ].\x0a    \x09    shown = sanitized ifFalse: [\x0a        \x09    shown := sanitized.\x0a            \x09shown\x0a\x09\x09\x09\x09\x09ifTrue: [ snap do: [ self contents: aBlock ]. self asJQuery show ]\x0a\x09\x09\x09\x09\x09ifFalse: [ self asJQuery hide; empty ] ] ] ]",
-messageSends: ["trapDescend:", "trap:read:", "ifNil:", "ifFalse:", "=", "ifTrue:ifFalse:", "do:", "contents:", "show", "asJQuery", "hide", "empty"],
-referencedClasses: []
-}),
-smalltalk.TagBrush);
-
-smalltalk.addMethod(
-smalltalk.method({
-selector: "trapIter:after:",
-category: '*Trapped-Frontend',
-fn: function (path,aBlock){
-var self=this;
-var end;
-function $TagBrush(){return smalltalk.TagBrush||(typeof TagBrush=="undefined"?nil:TagBrush)}
-function $Trapped(){return smalltalk.Trapped||(typeof Trapped=="undefined"?nil:Trapped)}
-return smalltalk.withContext(function($ctx1) { 
-var $2,$1,$3;
-end=_st($TagBrush())._fromJQuery_canvas_("<script type=\x22application/x-beacon\x22 />"._asJQuery(),self["@canvas"]);
-$2=self._element();
-$ctx1.sendIdx["element"]=1;
-$1=_st($2)._parentNode();
-$3=_st(end)._element();
-$ctx1.sendIdx["element"]=2;
-_st($1)._insertBefore_reference_($3,_st(self._element())._nextSibling());
-self._trap_read_(path,(function(model){
-return smalltalk.withContext(function($ctx2) {
-return _st($Trapped())._loop_between_and_do_(model,self,end,aBlock);
-}, function($ctx2) {$ctx2.fillBlock({model:model},$ctx1,1)})}));
-return self}, function($ctx1) {$ctx1.fill(self,"trapIter:after:",{path:path,aBlock:aBlock,end:end},smalltalk.TagBrush)})},
-args: ["path", "aBlock"],
-source: "trapIter: path after: aBlock\x0a\x09| end |\x0a\x09end := TagBrush fromJQuery: ('<script type=\x22application/x-beacon\x22 />' asJQuery) canvas: canvas.\x0a\x09self element parentNode insertBefore: end element reference: self element nextSibling.\x0a    self trap: path read: [ :model |\x0a    \x09Trapped loop: model between: self and: end do: aBlock.\x0a    ]",
-messageSends: ["fromJQuery:canvas:", "asJQuery", "insertBefore:reference:", "parentNode", "element", "nextSibling", "trap:read:", "loop:between:and:do:"],
-referencedClasses: ["TagBrush", "Trapped"]
-}),
-smalltalk.TagBrush);
-
-});

+ 0 - 1402
js/Trapped-Processors.js

@@ -1,1402 +0,0 @@
-define("gh_herby_trapped/Trapped-Processors", ["amber_vm/smalltalk", "amber_vm/nil", "amber_vm/_st", "gh_herby_trapped/Trapped-Frontend"], function(smalltalk,nil,_st){
-smalltalk.addPackage('Trapped-Processors');
-smalltalk.packages["Trapped-Processors"].transport = {"type":"amd","amdNamespace":"gh_herby_trapped"};
-
-smalltalk.addClass('TrappedProcessorAttribute', smalltalk.TrappedDataExpectingProcessor, ['attrName'], 'Trapped-Processors');
-smalltalk.TrappedProcessorAttribute.comment="I set the data into an attribute speciried when creating me.\x0aNo observing and sending back, atm.";
-smalltalk.addMethod(
-smalltalk.method({
-selector: "attrName:",
-category: 'accessing',
-fn: function (aString){
-var self=this;
-return smalltalk.withContext(function($ctx1) { 
-self["@attrName"]=aString;
-return self}, function($ctx1) {$ctx1.fill(self,"attrName:",{aString:aString},smalltalk.TrappedProcessorAttribute)})},
-args: ["aString"],
-source: "attrName: aString\x0a\x09attrName := aString",
-messageSends: [],
-referencedClasses: []
-}),
-smalltalk.TrappedProcessorAttribute);
-
-smalltalk.addMethod(
-smalltalk.method({
-selector: "toView:",
-category: 'data transformation',
-fn: function (aDataCarrier){
-var self=this;
-return smalltalk.withContext(function($ctx1) { 
-_st(aDataCarrier)._toTargetAttr_(self["@attrName"]);
-return self}, function($ctx1) {$ctx1.fill(self,"toView:",{aDataCarrier:aDataCarrier},smalltalk.TrappedProcessorAttribute)})},
-args: ["aDataCarrier"],
-source: "toView: aDataCarrier\x0a\x09aDataCarrier toTargetAttr: attrName",
-messageSends: ["toTargetAttr:"],
-referencedClasses: []
-}),
-smalltalk.TrappedProcessorAttribute);
-
-
-smalltalk.addMethod(
-smalltalk.method({
-selector: "new:",
-category: 'instance creation',
-fn: function (aString){
-var self=this;
-return smalltalk.withContext(function($ctx1) { 
-var $2,$3,$1;
-$2=self._new();
-_st($2)._attrName_(aString);
-$3=_st($2)._yourself();
-$1=$3;
-return $1;
-}, function($ctx1) {$ctx1.fill(self,"new:",{aString:aString},smalltalk.TrappedProcessorAttribute.klass)})},
-args: ["aString"],
-source: "new: aString\x0a\x09^self new\x0a\x09\x09attrName: aString;\x0a\x09\x09yourself",
-messageSends: ["attrName:", "new", "yourself"],
-referencedClasses: []
-}),
-smalltalk.TrappedProcessorAttribute.klass);
-
-
-smalltalk.addClass('TrappedProcessorDataAdhoc', smalltalk.TrappedDataExpectingProcessor, ['toViewBlock'], 'Trapped-Processors');
-smalltalk.TrappedProcessorDataAdhoc.comment="I put data into target via contents: in toView:";
-smalltalk.addMethod(
-smalltalk.method({
-selector: "toView:",
-category: 'data transformation',
-fn: function (aDataCarrier){
-var self=this;
-return smalltalk.withContext(function($ctx1) { 
-_st(self["@toViewBlock"])._value_(aDataCarrier);
-return self}, function($ctx1) {$ctx1.fill(self,"toView:",{aDataCarrier:aDataCarrier},smalltalk.TrappedProcessorDataAdhoc)})},
-args: ["aDataCarrier"],
-source: "toView: aDataCarrier\x0a\x09toViewBlock value: aDataCarrier",
-messageSends: ["value:"],
-referencedClasses: []
-}),
-smalltalk.TrappedProcessorDataAdhoc);
-
-smalltalk.addMethod(
-smalltalk.method({
-selector: "toViewBlock:",
-category: 'accessing',
-fn: function (aBlock){
-var self=this;
-return smalltalk.withContext(function($ctx1) { 
-self["@toViewBlock"]=aBlock;
-return self}, function($ctx1) {$ctx1.fill(self,"toViewBlock:",{aBlock:aBlock},smalltalk.TrappedProcessorDataAdhoc)})},
-args: ["aBlock"],
-source: "toViewBlock: aBlock\x0a\x09toViewBlock := aBlock",
-messageSends: [],
-referencedClasses: []
-}),
-smalltalk.TrappedProcessorDataAdhoc);
-
-
-smalltalk.addMethod(
-smalltalk.method({
-selector: "newToView:",
-category: 'instance creation',
-fn: function (aBlock){
-var self=this;
-return smalltalk.withContext(function($ctx1) { 
-var $2,$3,$1;
-$2=self._new();
-_st($2)._toViewBlock_(aBlock);
-$3=_st($2)._yourself();
-$1=$3;
-return $1;
-}, function($ctx1) {$ctx1.fill(self,"newToView:",{aBlock:aBlock},smalltalk.TrappedProcessorDataAdhoc.klass)})},
-args: ["aBlock"],
-source: "newToView: aBlock\x0a\x09^self new\x0a\x09\x09toViewBlock: aBlock;\x0a\x09\x09yourself",
-messageSends: ["toViewBlock:", "new", "yourself"],
-referencedClasses: []
-}),
-smalltalk.TrappedProcessorDataAdhoc.klass);
-
-
-smalltalk.addClass('TrappedProcessorDescend', smalltalk.TrappedProcessor, [], 'Trapped-Processors');
-smalltalk.TrappedProcessorDescend.comment="I intepret data-trap in descendants of my brush.";
-smalltalk.addMethod(
-smalltalk.method({
-selector: "toView:",
-category: 'data transformation',
-fn: function (aDataCarrier){
-var self=this;
-function $Trapped(){return smalltalk.Trapped||(typeof Trapped=="undefined"?nil:Trapped)}
-return smalltalk.withContext(function($ctx1) { 
-_st(_st($Trapped())._current())._injectToChildren_(_st(_st(aDataCarrier)._target())._element());
-return self}, function($ctx1) {$ctx1.fill(self,"toView:",{aDataCarrier:aDataCarrier},smalltalk.TrappedProcessorDescend)})},
-args: ["aDataCarrier"],
-source: "toView: aDataCarrier\x0a\x09Trapped current injectToChildren: aDataCarrier target element",
-messageSends: ["injectToChildren:", "current", "element", "target"],
-referencedClasses: ["Trapped"]
-}),
-smalltalk.TrappedProcessorDescend);
-
-
-
-smalltalk.addClass('TrappedProcessorGuardBase', smalltalk.TrappedProcessor, ['guardPath'], 'Trapped-Processors');
-smalltalk.TrappedProcessorGuardBase.comment="I serve as base class for brush-guarding processors.\x0a\x0aI cover instantiation and subclasses have to provide\x0aimplementation of toVIew: that react appropriately to guard releasing.";
-smalltalk.addMethod(
-smalltalk.method({
-selector: "guardPath:",
-category: 'accessing',
-fn: function (anArray){
-var self=this;
-return smalltalk.withContext(function($ctx1) { 
-self["@guardPath"]=anArray;
-return self}, function($ctx1) {$ctx1.fill(self,"guardPath:",{anArray:anArray},smalltalk.TrappedProcessorGuardBase)})},
-args: ["anArray"],
-source: "guardPath: anArray\x0a\x09guardPath := anArray",
-messageSends: [],
-referencedClasses: []
-}),
-smalltalk.TrappedProcessorGuardBase);
-
-smalltalk.addMethod(
-smalltalk.method({
-selector: "toModel:",
-category: 'data transformation',
-fn: function (aDataCarrier){
-var self=this;
-return smalltalk.withContext(function($ctx1) { 
-return self}, function($ctx1) {$ctx1.fill(self,"toModel:",{aDataCarrier:aDataCarrier},smalltalk.TrappedProcessorGuardBase)})},
-args: ["aDataCarrier"],
-source: "toModel: aDataCarrier\x0a\x09\x22stop\x22",
-messageSends: [],
-referencedClasses: []
-}),
-smalltalk.TrappedProcessorGuardBase);
-
-smalltalk.addMethod(
-smalltalk.method({
-selector: "toView:",
-category: 'data transformation',
-fn: function (aDataCarrier){
-var self=this;
-return smalltalk.withContext(function($ctx1) { 
-self._subclassResponsibility();
-return self}, function($ctx1) {$ctx1.fill(self,"toView:",{aDataCarrier:aDataCarrier},smalltalk.TrappedProcessorGuardBase)})},
-args: ["aDataCarrier"],
-source: "toView: aDataCarrier\x0a\x09self subclassResponsibility",
-messageSends: ["subclassResponsibility"],
-referencedClasses: []
-}),
-smalltalk.TrappedProcessorGuardBase);
-
-
-smalltalk.addMethod(
-smalltalk.method({
-selector: "new:",
-category: 'instance creation',
-fn: function (anArray){
-var self=this;
-return smalltalk.withContext(function($ctx1) { 
-var $2,$3,$1;
-$2=self._new();
-_st($2)._guardPath_(anArray);
-$3=_st($2)._yourself();
-$1=$3;
-return $1;
-}, function($ctx1) {$ctx1.fill(self,"new:",{anArray:anArray},smalltalk.TrappedProcessorGuardBase.klass)})},
-args: ["anArray"],
-source: "new: anArray\x0a\x09^ self new\x0a\x09\x09guardPath: anArray;\x0a\x09\x09yourself",
-messageSends: ["guardPath:", "new", "yourself"],
-referencedClasses: []
-}),
-smalltalk.TrappedProcessorGuardBase.klass);
-
-
-smalltalk.addClass('TrappedProcessorGuard', smalltalk.TrappedProcessorGuardBase, [], 'Trapped-Processors');
-smalltalk.TrappedProcessorGuard.comment="I am used to guard contents filling process of the brush I am installed on.\x0a\x0aI observe guard expression in the model,\x0aand when it changes to nil or false, I delete the brush contents;\x0aon the other hand, when it changes to non-nil and non-false,\x0aI run the rest on the chain, which should be one-time\x0athat sets up the contents,";
-smalltalk.addMethod(
-smalltalk.method({
-selector: "toView:",
-category: 'data transformation',
-fn: function (aDataCarrier){
-var self=this;
-var frozen,xon;
-return smalltalk.withContext(function($ctx1) { 
-var $1,$2;
-frozen=_st(aDataCarrier)._copy();
-$ctx1.sendIdx["copy"]=1;
-xon=_st(frozen)._xontent();
-_st(_st(frozen)._target())._trapGuard_contents_(self["@guardPath"],(function(html){
-return smalltalk.withContext(function($ctx2) {
-$1=_st(frozen)._copy();
-_st($1)._target_(_st(html)._root());
-_st($1)._xontent_(xon);
-$2=_st($1)._proceed();
-return $2;
-}, function($ctx2) {$ctx2.fillBlock({html:html},$ctx1,1)})}));
-return self}, function($ctx1) {$ctx1.fill(self,"toView:",{aDataCarrier:aDataCarrier,frozen:frozen,xon:xon},smalltalk.TrappedProcessorGuard)})},
-args: ["aDataCarrier"],
-source: "toView: aDataCarrier\x0a\x09| frozen xon |\x0a\x09frozen := aDataCarrier copy.\x0a\x09xon := frozen xontent.\x0a\x09frozen target trapGuard: guardPath contents: [ :html | frozen copy target: html root; xontent: xon; proceed ]",
-messageSends: ["copy", "xontent", "trapGuard:contents:", "target", "target:", "root", "xontent:", "proceed"],
-referencedClasses: []
-}),
-smalltalk.TrappedProcessorGuard);
-
-
-
-smalltalk.addClass('TrappedProcessorInputChecked', smalltalk.TrappedDataExpectingProcessor, [], 'Trapped-Processors');
-smalltalk.TrappedProcessorInputChecked.comment="I bind to checkbox checked state.";
-smalltalk.addMethod(
-smalltalk.method({
-selector: "installToView:toModel:",
-category: 'installation',
-fn: function (aDataCarrier,anotherDataCarrier){
-var self=this;
-var brush;
-return smalltalk.withContext(function($ctx1) { 
-var $1,$2;
-brush=_st(aDataCarrier)._target();
-_st(brush)._onChange_((function(){
-return smalltalk.withContext(function($ctx2) {
-$1=_st(anotherDataCarrier)._copy();
-_st($1)._value_(_st(_st(brush)._asJQuery())._prop_("checked"));
-$2=_st($1)._proceed();
-return $2;
-}, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})}));
-return self}, function($ctx1) {$ctx1.fill(self,"installToView:toModel:",{aDataCarrier:aDataCarrier,anotherDataCarrier:anotherDataCarrier,brush:brush},smalltalk.TrappedProcessorInputChecked)})},
-args: ["aDataCarrier", "anotherDataCarrier"],
-source: "installToView: aDataCarrier toModel: anotherDataCarrier\x0a\x09| brush |\x0a\x09brush := aDataCarrier target.\x0a\x09brush onChange: [ anotherDataCarrier copy value: (brush asJQuery prop: 'checked'); proceed ]",
-messageSends: ["target", "onChange:", "value:", "copy", "prop:", "asJQuery", "proceed"],
-referencedClasses: []
-}),
-smalltalk.TrappedProcessorInputChecked);
-
-smalltalk.addMethod(
-smalltalk.method({
-selector: "toView:",
-category: 'data transformation',
-fn: function (aDataCarrier){
-var self=this;
-return smalltalk.withContext(function($ctx1) { 
-_st(aDataCarrier)._toTargetProp_("checked");
-return self}, function($ctx1) {$ctx1.fill(self,"toView:",{aDataCarrier:aDataCarrier},smalltalk.TrappedProcessorInputChecked)})},
-args: ["aDataCarrier"],
-source: "toView: aDataCarrier\x0a\x09aDataCarrier toTargetProp: 'checked'",
-messageSends: ["toTargetProp:"],
-referencedClasses: []
-}),
-smalltalk.TrappedProcessorInputChecked);
-
-
-
-smalltalk.addClass('TrappedProcessorInputValue', smalltalk.TrappedDataExpectingProcessor, [], 'Trapped-Processors');
-smalltalk.TrappedProcessorInputValue.comment="I bind to input value.";
-smalltalk.addMethod(
-smalltalk.method({
-selector: "installToView:toModel:",
-category: 'installation',
-fn: function (aDataCarrier,anotherDataCarrier){
-var self=this;
-var brush;
-return smalltalk.withContext(function($ctx1) { 
-var $1,$2;
-brush=_st(aDataCarrier)._target();
-_st(brush)._onChange_((function(){
-return smalltalk.withContext(function($ctx2) {
-$1=_st(anotherDataCarrier)._copy();
-_st($1)._value_(_st(_st(brush)._asJQuery())._val());
-$2=_st($1)._proceed();
-return $2;
-}, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})}));
-return self}, function($ctx1) {$ctx1.fill(self,"installToView:toModel:",{aDataCarrier:aDataCarrier,anotherDataCarrier:anotherDataCarrier,brush:brush},smalltalk.TrappedProcessorInputValue)})},
-args: ["aDataCarrier", "anotherDataCarrier"],
-source: "installToView: aDataCarrier toModel: anotherDataCarrier\x0a\x09| brush |\x0a\x09brush := aDataCarrier target.\x0a\x09brush onChange: [ anotherDataCarrier copy value: brush asJQuery val; proceed ]",
-messageSends: ["target", "onChange:", "value:", "copy", "val", "asJQuery", "proceed"],
-referencedClasses: []
-}),
-smalltalk.TrappedProcessorInputValue);
-
-smalltalk.addMethod(
-smalltalk.method({
-selector: "toView:",
-category: 'data transformation',
-fn: function (aDataCarrier){
-var self=this;
-return smalltalk.withContext(function($ctx1) { 
-_st(aDataCarrier)._toTargetValue();
-return self}, function($ctx1) {$ctx1.fill(self,"toView:",{aDataCarrier:aDataCarrier},smalltalk.TrappedProcessorInputValue)})},
-args: ["aDataCarrier"],
-source: "toView: aDataCarrier\x0a\x09aDataCarrier toTargetValue",
-messageSends: ["toTargetValue"],
-referencedClasses: []
-}),
-smalltalk.TrappedProcessorInputValue);
-
-
-
-smalltalk.addClass('TrappedProcessorLoopBase', smalltalk.TrappedProcessor, [], 'Trapped-Processors');
-smalltalk.TrappedProcessorLoopBase.comment="I serve as base class for looping processors.\x0a\x0aI cover instantiation and subclasses have to provide\x0aimplementation of toVIew: that loops appropriately.";
-smalltalk.addMethod(
-smalltalk.method({
-selector: "toModel:",
-category: 'data transformation',
-fn: function (aDataCarrier){
-var self=this;
-return smalltalk.withContext(function($ctx1) { 
-return self}, function($ctx1) {$ctx1.fill(self,"toModel:",{aDataCarrier:aDataCarrier},smalltalk.TrappedProcessorLoopBase)})},
-args: ["aDataCarrier"],
-source: "toModel: aDataCarrier\x0a\x09\x22stop\x22",
-messageSends: [],
-referencedClasses: []
-}),
-smalltalk.TrappedProcessorLoopBase);
-
-smalltalk.addMethod(
-smalltalk.method({
-selector: "toView:",
-category: 'data transformation',
-fn: function (aDataCarrier){
-var self=this;
-return smalltalk.withContext(function($ctx1) { 
-self._subclassResponsibility();
-return self}, function($ctx1) {$ctx1.fill(self,"toView:",{aDataCarrier:aDataCarrier},smalltalk.TrappedProcessorLoopBase)})},
-args: ["aDataCarrier"],
-source: "toView: aDataCarrier\x0a\x09self subclassResponsibility",
-messageSends: ["subclassResponsibility"],
-referencedClasses: []
-}),
-smalltalk.TrappedProcessorLoopBase);
-
-
-
-smalltalk.addClass('TrappedProcessorLoopZ', smalltalk.TrappedProcessorLoopBase, [], 'Trapped-Processors');
-smalltalk.TrappedProcessorLoopZ.comment="I am used to loop over data and repeat the contents filling process\x0aof the brush I am installed on.\x0a\x0aI observe the data in the model,\x0aand when it changes, I loop over it\x0aand run the rest of the processing chain\x0afor each element, putting the result _after_ my brush.\x0a\x0aMy brush itself should be as least visible as possible,\x0aas it only serve as a position flag (use for example\x0ascript type=application/x-beacon, noscript, ins or del).";
-smalltalk.addMethod(
-smalltalk.method({
-selector: "toView:",
-category: 'data transformation',
-fn: function (aDataCarrier){
-var self=this;
-var frozen,xon;
-return smalltalk.withContext(function($ctx1) { 
-var $1,$2;
-frozen=_st(aDataCarrier)._copy();
-$ctx1.sendIdx["copy"]=1;
-xon=_st(frozen)._xontent();
-_st(_st(frozen)._target())._trapIter_after_([],(function(html){
-return smalltalk.withContext(function($ctx2) {
-$1=_st(frozen)._copy();
-_st($1)._target_(_st(html)._root());
-_st($1)._xontent_(xon);
-$2=_st($1)._proceed();
-return $2;
-}, function($ctx2) {$ctx2.fillBlock({html:html},$ctx1,1)})}));
-return self}, function($ctx1) {$ctx1.fill(self,"toView:",{aDataCarrier:aDataCarrier,frozen:frozen,xon:xon},smalltalk.TrappedProcessorLoopZ)})},
-args: ["aDataCarrier"],
-source: "toView: aDataCarrier\x0a\x09| frozen xon |\x0a\x09frozen := aDataCarrier copy.\x0a\x09xon := frozen xontent.\x0a\x09frozen target trapIter: #() after: [ :html | frozen copy target: html root; xontent: xon; proceed ]",
-messageSends: ["copy", "xontent", "trapIter:after:", "target", "target:", "root", "xontent:", "proceed"],
-referencedClasses: []
-}),
-smalltalk.TrappedProcessorLoopZ);
-
-
-
-smalltalk.addClass('TrappedProcessorOptionValue', smalltalk.TrappedDataExpectingProcessor, [], 'Trapped-Processors');
-smalltalk.TrappedProcessorOptionValue.comment="I set the option value.\x0a\x0aAdditionally, when changed (by toView:),\x0aI ping closest <select> with 'trappedselectreplay' event.";
-smalltalk.addMethod(
-smalltalk.method({
-selector: "toView:",
-category: 'data transformation',
-fn: function (aDataCarrier){
-var self=this;
-return smalltalk.withContext(function($ctx1) { 
-_st(aDataCarrier)._toTargetValue();
-_st(_st(_st(_st(aDataCarrier)._target())._asJQuery())._closest_("select"))._trigger_("trappedselectreplay");
-return self}, function($ctx1) {$ctx1.fill(self,"toView:",{aDataCarrier:aDataCarrier},smalltalk.TrappedProcessorOptionValue)})},
-args: ["aDataCarrier"],
-source: "toView: aDataCarrier\x0a\x09aDataCarrier toTargetValue.\x0a\x09(aDataCarrier target asJQuery closest: 'select')\x0a\x09\x09trigger: 'trappedselectreplay'",
-messageSends: ["toTargetValue", "trigger:", "closest:", "asJQuery", "target"],
-referencedClasses: []
-}),
-smalltalk.TrappedProcessorOptionValue);
-
-
-
-smalltalk.addClass('TrappedProcessorReplace', smalltalk.TrappedProcessor, ['left', 'right'], 'Trapped-Processors');
-smalltalk.TrappedProcessorReplace.comment="I convert data to string representation and do a regex replace.\x0aI get two parameters, in toView:, first is replaced with second,\x0aand in toModel:, the second is replaced with first.\x0a\x0aI remove leading '^' and ending '$' from the string used as replacement,\x0aso it safe to replace ^to with ^To, for example.\x0a";
-smalltalk.addMethod(
-smalltalk.method({
-selector: "left:",
-category: 'accessing',
-fn: function (aString){
-var self=this;
-return smalltalk.withContext(function($ctx1) { 
-self["@left"]=aString;
-return self}, function($ctx1) {$ctx1.fill(self,"left:",{aString:aString},smalltalk.TrappedProcessorReplace)})},
-args: ["aString"],
-source: "left: aString\x0a\x09left := aString",
-messageSends: [],
-referencedClasses: []
-}),
-smalltalk.TrappedProcessorReplace);
-
-smalltalk.addMethod(
-smalltalk.method({
-selector: "right:",
-category: 'accessing',
-fn: function (aString){
-var self=this;
-return smalltalk.withContext(function($ctx1) { 
-self["@right"]=aString;
-return self}, function($ctx1) {$ctx1.fill(self,"right:",{aString:aString},smalltalk.TrappedProcessorReplace)})},
-args: ["aString"],
-source: "right: aString\x0a\x09right := aString",
-messageSends: [],
-referencedClasses: []
-}),
-smalltalk.TrappedProcessorReplace);
-
-smalltalk.addMethod(
-smalltalk.method({
-selector: "toModel:",
-category: 'data transformation',
-fn: function (aDataCarrier){
-var self=this;
-var replacement,old;
-return smalltalk.withContext(function($ctx1) { 
-var $1,$2;
-$1=_st(self["@left"])._replace_with_("^\x5c^","");
-$ctx1.sendIdx["replace:with:"]=2;
-replacement=_st($1)._replace_with_("\x5c$$","");
-$ctx1.sendIdx["replace:with:"]=1;
-old=_st(_st(aDataCarrier)._value())._asString();
-_st(aDataCarrier)._value_whenDifferentFrom_(_st(old)._replace_with_(self["@right"],replacement),old);
-$2=_st(aDataCarrier)._proceed();
-return self}, function($ctx1) {$ctx1.fill(self,"toModel:",{aDataCarrier:aDataCarrier,replacement:replacement,old:old},smalltalk.TrappedProcessorReplace)})},
-args: ["aDataCarrier"],
-source: "toModel: aDataCarrier\x0a\x09| replacement old |\x0a\x09replacement := (left replace: '^\x5c^' with: '') replace: '\x5c$$' with: ''.\x0a\x09old := aDataCarrier value asString.\x0a\x09aDataCarrier\x0a\x09\x09value: (old replace: right with: replacement) whenDifferentFrom: old;\x0a\x09\x09proceed",
-messageSends: ["replace:with:", "asString", "value", "value:whenDifferentFrom:", "proceed"],
-referencedClasses: []
-}),
-smalltalk.TrappedProcessorReplace);
-
-smalltalk.addMethod(
-smalltalk.method({
-selector: "toView:",
-category: 'data transformation',
-fn: function (aDataCarrier){
-var self=this;
-var replacement,old;
-return smalltalk.withContext(function($ctx1) { 
-var $1,$2;
-$1=_st(self["@right"])._replace_with_("^\x5c^","");
-$ctx1.sendIdx["replace:with:"]=2;
-replacement=_st($1)._replace_with_("\x5c$$","");
-$ctx1.sendIdx["replace:with:"]=1;
-old=_st(_st(aDataCarrier)._value())._asString();
-_st(aDataCarrier)._value_whenDifferentFrom_(_st(old)._replace_with_(self["@left"],replacement),old);
-$2=_st(aDataCarrier)._proceed();
-return self}, function($ctx1) {$ctx1.fill(self,"toView:",{aDataCarrier:aDataCarrier,replacement:replacement,old:old},smalltalk.TrappedProcessorReplace)})},
-args: ["aDataCarrier"],
-source: "toView: aDataCarrier\x0a\x09| replacement old |\x0a\x09replacement := (right replace: '^\x5c^' with: '') replace: '\x5c$$' with: ''.\x0a\x09old := aDataCarrier value asString.\x0a\x09aDataCarrier\x0a\x09\x09value: (old replace: left with: replacement) whenDifferentFrom: old;\x0a\x09\x09proceed",
-messageSends: ["replace:with:", "asString", "value", "value:whenDifferentFrom:", "proceed"],
-referencedClasses: []
-}),
-smalltalk.TrappedProcessorReplace);
-
-
-smalltalk.addMethod(
-smalltalk.method({
-selector: "new:with:",
-category: 'instance creation',
-fn: function (aString,anotherString){
-var self=this;
-return smalltalk.withContext(function($ctx1) { 
-var $2,$3,$4,$5,$1;
-$2=self._new();
-$3=$2;
-$4=_st(aString)._asString();
-$ctx1.sendIdx["asString"]=1;
-_st($3)._left_($4);
-_st($2)._right_(_st(anotherString)._asString());
-$5=_st($2)._yourself();
-$1=$5;
-return $1;
-}, function($ctx1) {$ctx1.fill(self,"new:with:",{aString:aString,anotherString:anotherString},smalltalk.TrappedProcessorReplace.klass)})},
-args: ["aString", "anotherString"],
-source: "new: aString with: anotherString\x0a\x09^ self new\x0a\x09\x09left: aString asString;\x0a\x09\x09right: anotherString asString;\x0a\x09\x09yourself",
-messageSends: ["left:", "new", "asString", "right:", "yourself"],
-referencedClasses: []
-}),
-smalltalk.TrappedProcessorReplace.klass);
-
-
-smalltalk.addClass('TrappedProcessorSelectValue', smalltalk.TrappedDataExpectingProcessor, [], 'Trapped-Processors');
-smalltalk.TrappedProcessorSelectValue.comment="I bind to select value.\x0a\x0aWhen changed (by toView: or by user),\x0aI remember the selected set.\x0a\x0aWhen pinged by 'trappedselectreplay',\x0aI set the remembered value.\x0a\x0aThis allows to have select-option groups\x0awith later setting of option values\x0a(if those are set via related processor 'optionValue',\x0awhich pings me with 'trappedselectreplay').";
-smalltalk.addMethod(
-smalltalk.method({
-selector: "installToView:toModel:",
-category: 'installation',
-fn: function (aDataCarrier,anotherDataCarrier){
-var self=this;
-var jq,val;
-return smalltalk.withContext(function($ctx1) { 
-var $1,$2,$3,$4;
-jq=_st(_st(aDataCarrier)._target())._asJQuery();
-val=_st(jq)._val();
-$ctx1.sendIdx["val"]=1;
-$1=jq;
-_st($1)._data_("trapped.saved.val");
-$ctx1.sendIdx["data:"]=1;
-_st($1)._on_bind_("change",(function(){
-return smalltalk.withContext(function($ctx2) {
-$2=_st(anotherDataCarrier)._copy();
-_st($2)._value_(_st(jq)._val());
-$3=_st($2)._proceed();
-return $3;
-}, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})}));
-$ctx1.sendIdx["on:bind:"]=1;
-$4=_st($1)._on_bind_("trappedselectreplay",(function(){
-return smalltalk.withContext(function($ctx2) {
-return _st(jq)._val_(_st(jq)._data_("trapped.saved.val"));
-}, function($ctx2) {$ctx2.fillBlock({},$ctx1,2)})}));
-return self}, function($ctx1) {$ctx1.fill(self,"installToView:toModel:",{aDataCarrier:aDataCarrier,anotherDataCarrier:anotherDataCarrier,jq:jq,val:val},smalltalk.TrappedProcessorSelectValue)})},
-args: ["aDataCarrier", "anotherDataCarrier"],
-source: "installToView: aDataCarrier toModel: anotherDataCarrier\x0a\x09| jq val |\x0a\x09jq := aDataCarrier target asJQuery.\x0a\x09val := jq val.\x0a\x09jq\x0a\x09\x09data: 'trapped.saved.val';\x0a\x09\x09on: 'change' bind: [ anotherDataCarrier copy value: jq val; proceed ];\x0a\x09\x09on: 'trappedselectreplay' bind: [ jq val: (jq data: 'trapped.saved.val') ]",
-messageSends: ["asJQuery", "target", "val", "data:", "on:bind:", "value:", "copy", "proceed", "val:"],
-referencedClasses: []
-}),
-smalltalk.TrappedProcessorSelectValue);
-
-smalltalk.addMethod(
-smalltalk.method({
-selector: "toView:",
-category: 'data transformation',
-fn: function (aDataCarrier){
-var self=this;
-return smalltalk.withContext(function($ctx1) { 
-_st(aDataCarrier)._toTargetValue();
-_st(_st(_st(aDataCarrier)._target())._asJQuery())._data_put_("trapped.saved.val",_st(aDataCarrier)._value());
-return self}, function($ctx1) {$ctx1.fill(self,"toView:",{aDataCarrier:aDataCarrier},smalltalk.TrappedProcessorSelectValue)})},
-args: ["aDataCarrier"],
-source: "toView: aDataCarrier\x0a\x09aDataCarrier toTargetValue.\x0a\x09aDataCarrier target asJQuery data: 'trapped.saved.val' put: aDataCarrier value",
-messageSends: ["toTargetValue", "data:put:", "asJQuery", "target", "value"],
-referencedClasses: []
-}),
-smalltalk.TrappedProcessorSelectValue);
-
-
-
-smalltalk.addClass('TrappedProcessorSignal', smalltalk.TrappedProcessor, ['selector'], 'Trapped-Processors');
-smalltalk.TrappedProcessorSignal.comment="Instead of writing data directly to model,\x0aI instead modify it by sending a message specified when instantiating me.";
-smalltalk.addMethod(
-smalltalk.method({
-selector: "selector:",
-category: 'accessing',
-fn: function (aString){
-var self=this;
-return smalltalk.withContext(function($ctx1) { 
-self["@selector"]=aString;
-return self}, function($ctx1) {$ctx1.fill(self,"selector:",{aString:aString},smalltalk.TrappedProcessorSignal)})},
-args: ["aString"],
-source: "selector: aString\x0a\x09selector := aString",
-messageSends: [],
-referencedClasses: []
-}),
-smalltalk.TrappedProcessorSignal);
-
-smalltalk.addMethod(
-smalltalk.method({
-selector: "toModel:",
-category: 'data transformation',
-fn: function (aDataCarrier){
-var self=this;
-return smalltalk.withContext(function($ctx1) { 
-_st(aDataCarrier)._modifyTargetByPerforming_(self["@selector"]);
-return self}, function($ctx1) {$ctx1.fill(self,"toModel:",{aDataCarrier:aDataCarrier},smalltalk.TrappedProcessorSignal)})},
-args: ["aDataCarrier"],
-source: "toModel: aDataCarrier\x0a\x09aDataCarrier modifyTargetByPerforming: selector",
-messageSends: ["modifyTargetByPerforming:"],
-referencedClasses: []
-}),
-smalltalk.TrappedProcessorSignal);
-
-smalltalk.addMethod(
-smalltalk.method({
-selector: "toView:",
-category: 'data transformation',
-fn: function (aDataCarrier){
-var self=this;
-return smalltalk.withContext(function($ctx1) { 
-return self}, function($ctx1) {$ctx1.fill(self,"toView:",{aDataCarrier:aDataCarrier},smalltalk.TrappedProcessorSignal)})},
-args: ["aDataCarrier"],
-source: "toView: aDataCarrier\x0a\x09\x22stop\x22",
-messageSends: [],
-referencedClasses: []
-}),
-smalltalk.TrappedProcessorSignal);
-
-
-smalltalk.addMethod(
-smalltalk.method({
-selector: "new:",
-category: 'instance creation',
-fn: function (aString){
-var self=this;
-return smalltalk.withContext(function($ctx1) { 
-var $2,$3,$1;
-$2=self._new();
-_st($2)._selector_(aString);
-$3=_st($2)._yourself();
-$1=$3;
-return $1;
-}, function($ctx1) {$ctx1.fill(self,"new:",{aString:aString},smalltalk.TrappedProcessorSignal.klass)})},
-args: ["aString"],
-source: "new: aString\x0a\x09^self new\x0a\x09\x09selector: aString;\x0a\x09\x09yourself",
-messageSends: ["selector:", "new", "yourself"],
-referencedClasses: []
-}),
-smalltalk.TrappedProcessorSignal.klass);
-
-
-smalltalk.addClass('TrappedProcessorToBlackboard', smalltalk.TrappedDataExpectingProcessor, [], 'Trapped-Processors');
-smalltalk.TrappedProcessorToBlackboard.comment="I save the data to blackboard in toModel:, to position specified by path.";
-smalltalk.addMethod(
-smalltalk.method({
-selector: "toModel:",
-category: 'data transformation',
-fn: function (aDataCarrier){
-var self=this;
-return smalltalk.withContext(function($ctx1) { 
-_st(_st(aDataCarrier)._target())._modify_((function(){
-return smalltalk.withContext(function($ctx2) {
-return _st(aDataCarrier)._value();
-}, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})}));
-return self}, function($ctx1) {$ctx1.fill(self,"toModel:",{aDataCarrier:aDataCarrier},smalltalk.TrappedProcessorToBlackboard)})},
-args: ["aDataCarrier"],
-source: "toModel: aDataCarrier\x0a\x09aDataCarrier target modify: [ aDataCarrier value ]",
-messageSends: ["modify:", "target", "value"],
-referencedClasses: []
-}),
-smalltalk.TrappedProcessorToBlackboard);
-
-
-
-smalltalk.addClass('TrappedProcessorUriComponentDecode', smalltalk.TrappedProcessor, [], 'Trapped-Processors');
-smalltalk.TrappedProcessorUriComponentDecode.comment="I uriComponentDecode in toView:\x0aand encode in toModel:";
-smalltalk.addMethod(
-smalltalk.method({
-selector: "toModel:",
-category: 'data transformation',
-fn: function (aDataCarrier){
-var self=this;
-return smalltalk.withContext(function($ctx1) { 
-var $1;
-_st(aDataCarrier)._value_(_st(_st(aDataCarrier)._value())._uriComponentEncoded());
-$1=_st(aDataCarrier)._proceed();
-return self}, function($ctx1) {$ctx1.fill(self,"toModel:",{aDataCarrier:aDataCarrier},smalltalk.TrappedProcessorUriComponentDecode)})},
-args: ["aDataCarrier"],
-source: "toModel: aDataCarrier\x0a\x09aDataCarrier\x0a\x09\x09value: aDataCarrier value uriComponentEncoded;\x0a\x09\x09proceed",
-messageSends: ["value:", "uriComponentEncoded", "value", "proceed"],
-referencedClasses: []
-}),
-smalltalk.TrappedProcessorUriComponentDecode);
-
-smalltalk.addMethod(
-smalltalk.method({
-selector: "toView:",
-category: 'data transformation',
-fn: function (aDataCarrier){
-var self=this;
-return smalltalk.withContext(function($ctx1) { 
-var $1;
-_st(aDataCarrier)._value_(_st(_st(aDataCarrier)._value())._uriComponentDecoded());
-$1=_st(aDataCarrier)._proceed();
-return self}, function($ctx1) {$ctx1.fill(self,"toView:",{aDataCarrier:aDataCarrier},smalltalk.TrappedProcessorUriComponentDecode)})},
-args: ["aDataCarrier"],
-source: "toView: aDataCarrier\x0a\x09aDataCarrier\x0a\x09\x09value: aDataCarrier value uriComponentDecoded;\x0a\x09\x09proceed",
-messageSends: ["value:", "uriComponentDecoded", "value", "proceed"],
-referencedClasses: []
-}),
-smalltalk.TrappedProcessorUriComponentDecode);
-
-
-
-smalltalk.addClass('TrappedProcessorUriComponentEncode', smalltalk.TrappedProcessor, [], 'Trapped-Processors');
-smalltalk.TrappedProcessorUriComponentEncode.comment="I uriComponentEncode in toView:\x0aand decode in toModel:";
-smalltalk.addMethod(
-smalltalk.method({
-selector: "toModel:",
-category: 'data transformation',
-fn: function (aDataCarrier){
-var self=this;
-return smalltalk.withContext(function($ctx1) { 
-var $1;
-_st(aDataCarrier)._value_(_st(_st(aDataCarrier)._value())._uriComponentDecoded());
-$1=_st(aDataCarrier)._proceed();
-return self}, function($ctx1) {$ctx1.fill(self,"toModel:",{aDataCarrier:aDataCarrier},smalltalk.TrappedProcessorUriComponentEncode)})},
-args: ["aDataCarrier"],
-source: "toModel: aDataCarrier\x0a\x09aDataCarrier\x0a\x09\x09value: aDataCarrier value uriComponentDecoded;\x0a\x09\x09proceed",
-messageSends: ["value:", "uriComponentDecoded", "value", "proceed"],
-referencedClasses: []
-}),
-smalltalk.TrappedProcessorUriComponentEncode);
-
-smalltalk.addMethod(
-smalltalk.method({
-selector: "toView:",
-category: 'data transformation',
-fn: function (aDataCarrier){
-var self=this;
-return smalltalk.withContext(function($ctx1) { 
-var $1;
-_st(aDataCarrier)._value_(_st(_st(aDataCarrier)._value())._uriComponentEncoded());
-$1=_st(aDataCarrier)._proceed();
-return self}, function($ctx1) {$ctx1.fill(self,"toView:",{aDataCarrier:aDataCarrier},smalltalk.TrappedProcessorUriComponentEncode)})},
-args: ["aDataCarrier"],
-source: "toView: aDataCarrier\x0a\x09aDataCarrier\x0a\x09\x09value: aDataCarrier value uriComponentEncoded;\x0a\x09\x09proceed",
-messageSends: ["value:", "uriComponentEncoded", "value", "proceed"],
-referencedClasses: []
-}),
-smalltalk.TrappedProcessorUriComponentEncode);
-
-
-
-smalltalk.addClass('TrappedProcessorWhenClicked', smalltalk.TrappedProcessor, [], 'Trapped-Processors');
-smalltalk.TrappedProcessorWhenClicked.comment="I bind to an element and send true to blackboard when clicked.";
-smalltalk.addMethod(
-smalltalk.method({
-selector: "installToView:toModel:",
-category: 'installation',
-fn: function (aDataCarrier,anotherDataCarrier){
-var self=this;
-return smalltalk.withContext(function($ctx1) { 
-_st(_st(aDataCarrier)._target())._onClick_((function(){
-return smalltalk.withContext(function($ctx2) {
-_st(_st(anotherDataCarrier)._copy())._proceed();
-return false;
-}, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})}));
-return self}, function($ctx1) {$ctx1.fill(self,"installToView:toModel:",{aDataCarrier:aDataCarrier,anotherDataCarrier:anotherDataCarrier},smalltalk.TrappedProcessorWhenClicked)})},
-args: ["aDataCarrier", "anotherDataCarrier"],
-source: "installToView: aDataCarrier toModel: anotherDataCarrier\x0a\x09aDataCarrier target onClick: [ anotherDataCarrier copy proceed. false ]",
-messageSends: ["onClick:", "target", "proceed", "copy"],
-referencedClasses: []
-}),
-smalltalk.TrappedProcessorWhenClicked);
-
-
-
-smalltalk.addClass('TrappedProcessorWhenSubmitted', smalltalk.TrappedProcessor, [], 'Trapped-Processors');
-smalltalk.TrappedProcessorWhenSubmitted.comment="I bind to a form and send true to blackboard when submitted.";
-smalltalk.addMethod(
-smalltalk.method({
-selector: "installToView:toModel:",
-category: 'installation',
-fn: function (aDataCarrier,anotherDataCarrier){
-var self=this;
-return smalltalk.withContext(function($ctx1) { 
-_st(_st(aDataCarrier)._target())._onSubmit_((function(){
-return smalltalk.withContext(function($ctx2) {
-_st(_st(anotherDataCarrier)._copy())._proceed();
-return false;
-}, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})}));
-return self}, function($ctx1) {$ctx1.fill(self,"installToView:toModel:",{aDataCarrier:aDataCarrier,anotherDataCarrier:anotherDataCarrier},smalltalk.TrappedProcessorWhenSubmitted)})},
-args: ["aDataCarrier", "anotherDataCarrier"],
-source: "installToView: aDataCarrier toModel: anotherDataCarrier\x0a\x09aDataCarrier target onSubmit: [ anotherDataCarrier copy proceed. false ]",
-messageSends: ["onSubmit:", "target", "proceed", "copy"],
-referencedClasses: []
-}),
-smalltalk.TrappedProcessorWhenSubmitted);
-
-
-
-smalltalk.addClass('TrappedProcessorWidget', smalltalk.TrappedProcessor, ['viewName'], 'Trapped-Processors');
-smalltalk.TrappedProcessorWidget.comment="I insert a widget instance of the class specified when creating me.";
-smalltalk.addMethod(
-smalltalk.method({
-selector: "toView:",
-category: 'data transformation',
-fn: function (aDataCarrier){
-var self=this;
-function $Smalltalk(){return smalltalk.Smalltalk||(typeof Smalltalk=="undefined"?nil:Smalltalk)}
-return smalltalk.withContext(function($ctx1) { 
-_st(_st(aDataCarrier)._target())._with_(_st(_st(_st($Smalltalk())._current())._at_(self["@viewName"]))._new());
-return self}, function($ctx1) {$ctx1.fill(self,"toView:",{aDataCarrier:aDataCarrier},smalltalk.TrappedProcessorWidget)})},
-args: ["aDataCarrier"],
-source: "toView: aDataCarrier\x0a\x09aDataCarrier target with: (Smalltalk current at: viewName) new",
-messageSends: ["with:", "target", "new", "at:", "current"],
-referencedClasses: ["Smalltalk"]
-}),
-smalltalk.TrappedProcessorWidget);
-
-smalltalk.addMethod(
-smalltalk.method({
-selector: "viewName:",
-category: 'accessing',
-fn: function (aString){
-var self=this;
-return smalltalk.withContext(function($ctx1) { 
-self["@viewName"]=aString;
-return self}, function($ctx1) {$ctx1.fill(self,"viewName:",{aString:aString},smalltalk.TrappedProcessorWidget)})},
-args: ["aString"],
-source: "viewName: aString\x0a\x09viewName := aString",
-messageSends: [],
-referencedClasses: []
-}),
-smalltalk.TrappedProcessorWidget);
-
-
-smalltalk.addMethod(
-smalltalk.method({
-selector: "new:",
-category: 'instance creation',
-fn: function (aString){
-var self=this;
-return smalltalk.withContext(function($ctx1) { 
-var $2,$3,$1;
-$2=self._new();
-_st($2)._viewName_(aString);
-$3=_st($2)._yourself();
-$1=$3;
-return $1;
-}, function($ctx1) {$ctx1.fill(self,"new:",{aString:aString},smalltalk.TrappedProcessorWidget.klass)})},
-args: ["aString"],
-source: "new: aString\x0a\x09^self new\x0a\x09\x09viewName: aString;\x0a\x09\x09yourself",
-messageSends: ["viewName:", "new", "yourself"],
-referencedClasses: []
-}),
-smalltalk.TrappedProcessorWidget.klass);
-
-
-smalltalk.addClass('TrappedProcessorXontent', smalltalk.TrappedProcessor, [], 'Trapped-Processors');
-smalltalk.TrappedProcessorXontent.comment="I am used to show xontent of the brush I am installed on\x0a(see jQuery plugin Xontent for details).\x0a\x0aI clone xontent of the brush, put it into HTML\x0aand interpret all contained data-trap attributes.";
-smalltalk.addMethod(
-smalltalk.method({
-selector: "toView:",
-category: 'data transformation',
-fn: function (aDataCarrier){
-var self=this;
-function $Trapped(){return smalltalk.Trapped||(typeof Trapped=="undefined"?nil:Trapped)}
-return smalltalk.withContext(function($ctx1) { 
-_st(_st(_st(aDataCarrier)._target())._asJQuery())._append_(_st(_st($Trapped())._current())._cloneAndInject_(_st(_st(aDataCarrier)._xontent())._get_((0))));
-_st(aDataCarrier)._proceed();
-return self}, function($ctx1) {$ctx1.fill(self,"toView:",{aDataCarrier:aDataCarrier},smalltalk.TrappedProcessorXontent)})},
-args: ["aDataCarrier"],
-source: "toView: aDataCarrier\x0a\x09aDataCarrier target asJQuery append: (Trapped current cloneAndInject: (aDataCarrier xontent get: 0)).\x0a\x09aDataCarrier proceed",
-messageSends: ["append:", "asJQuery", "target", "cloneAndInject:", "current", "get:", "xontent", "proceed"],
-referencedClasses: ["Trapped"]
-}),
-smalltalk.TrappedProcessorXontent);
-
-
-smalltalk.addMethod(
-smalltalk.method({
-selector: "modifyTarget",
-category: '*Trapped-Processors',
-fn: function (){
-var self=this;
-return smalltalk.withContext(function($ctx1) { 
-_st(self._target())._modify_((function(){
-return smalltalk.withContext(function($ctx2) {
-return self._value();
-}, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})}));
-return self}, function($ctx1) {$ctx1.fill(self,"modifyTarget",{},smalltalk.TrappedDataCarrier)})},
-args: [],
-source: "modifyTarget\x0a\x09self target modify: [ self value ]",
-messageSends: ["modify:", "target", "value"],
-referencedClasses: []
-}),
-smalltalk.TrappedDataCarrier);
-
-smalltalk.addMethod(
-smalltalk.method({
-selector: "modifyTargetByPerforming:",
-category: '*Trapped-Processors',
-fn: function (aString){
-var self=this;
-return smalltalk.withContext(function($ctx1) { 
-_st(self._target())._modify_((function(m){
-return smalltalk.withContext(function($ctx2) {
-return _st(m)._perform_(aString);
-}, function($ctx2) {$ctx2.fillBlock({m:m},$ctx1,1)})}));
-return self}, function($ctx1) {$ctx1.fill(self,"modifyTargetByPerforming:",{aString:aString},smalltalk.TrappedDataCarrier)})},
-args: ["aString"],
-source: "modifyTargetByPerforming: aString\x0a\x09self target modify: [ :m | m perform: aString ]",
-messageSends: ["modify:", "target", "perform:"],
-referencedClasses: []
-}),
-smalltalk.TrappedDataCarrier);
-
-smalltalk.addMethod(
-smalltalk.method({
-selector: "primitive:",
-category: '*Trapped-Processors',
-fn: function (anObject){
-var self=this;
-return smalltalk.withContext(function($ctx1) { 
-return anObject === nil ? null : anObject.valueOf();
-return self}, function($ctx1) {$ctx1.fill(self,"primitive:",{anObject:anObject},smalltalk.TrappedDataCarrier)})},
-args: ["anObject"],
-source: "primitive: anObject\x0a\x09<return anObject === nil ? null : anObject.valueOf()>",
-messageSends: [],
-referencedClasses: []
-}),
-smalltalk.TrappedDataCarrier);
-
-smalltalk.addMethod(
-smalltalk.method({
-selector: "toTargetAttr:",
-category: '*Trapped-Processors',
-fn: function (aString){
-var self=this;
-return smalltalk.withContext(function($ctx1) { 
-var $1,$2,$3,$5,$4;
-$1=self._falseAsNilValue();
-if(($receiver = $1) == nil || $receiver == null){
-$2=self._target();
-$ctx1.sendIdx["target"]=1;
-_st($2)._removeAt_(aString);
-} else {
-var value,bvalue;
-bvalue=$receiver;
-value=self._primitive_(bvalue);
-value;
-$3=self._target();
-$5=_st(value).__eq(true);
-if(smalltalk.assert($5)){
-$4=aString;
-} else {
-$4=value;
-};
-_st($3)._at_put_(aString,$4);
-};
-return self}, function($ctx1) {$ctx1.fill(self,"toTargetAttr:",{aString:aString},smalltalk.TrappedDataCarrier)})},
-args: ["aString"],
-source: "toTargetAttr: aString\x0a\x09self falseAsNilValue\x0a\x09\x09ifNil: [ self target removeAt: aString ]\x0a\x09\x09ifNotNil: [ :bvalue |\x0a\x09\x09\x09| value |\x0a\x09\x09\x09value := self primitive: bvalue.\x0a\x09\x09\x09self target at: aString put: (value = true ifTrue: [ aString ] ifFalse: [ value ]) ]",
-messageSends: ["ifNil:ifNotNil:", "falseAsNilValue", "removeAt:", "target", "primitive:", "at:put:", "ifTrue:ifFalse:", "="],
-referencedClasses: []
-}),
-smalltalk.TrappedDataCarrier);
-
-smalltalk.addMethod(
-smalltalk.method({
-selector: "toTargetContents",
-category: '*Trapped-Processors',
-fn: function (){
-var self=this;
-return smalltalk.withContext(function($ctx1) { 
-_st(self._target())._contents_(self._primitive_(self._value()));
-return self}, function($ctx1) {$ctx1.fill(self,"toTargetContents",{},smalltalk.TrappedDataCarrier)})},
-args: [],
-source: "toTargetContents\x0a\x09self target contents: (self primitive: self value)",
-messageSends: ["contents:", "target", "primitive:", "value"],
-referencedClasses: []
-}),
-smalltalk.TrappedDataCarrier);
-
-smalltalk.addMethod(
-smalltalk.method({
-selector: "toTargetProp:",
-category: '*Trapped-Processors',
-fn: function (aString){
-var self=this;
-return smalltalk.withContext(function($ctx1) { 
-_st(_st(self._target())._element())._at_put_(aString,self._primitive_(self._value()));
-return self}, function($ctx1) {$ctx1.fill(self,"toTargetProp:",{aString:aString},smalltalk.TrappedDataCarrier)})},
-args: ["aString"],
-source: "toTargetProp: aString\x0a\x09self target element at: aString put: (self primitive: self value)",
-messageSends: ["at:put:", "element", "target", "primitive:", "value"],
-referencedClasses: []
-}),
-smalltalk.TrappedDataCarrier);
-
-smalltalk.addMethod(
-smalltalk.method({
-selector: "toTargetValue",
-category: '*Trapped-Processors',
-fn: function (){
-var self=this;
-return smalltalk.withContext(function($ctx1) { 
-_st(_st(self._target())._asJQuery())._val_(self._primitive_(self._value()));
-return self}, function($ctx1) {$ctx1.fill(self,"toTargetValue",{},smalltalk.TrappedDataCarrier)})},
-args: [],
-source: "toTargetValue\x0a\x09self target asJQuery val: (self primitive: self value)",
-messageSends: ["val:", "asJQuery", "target", "primitive:", "value"],
-referencedClasses: []
-}),
-smalltalk.TrappedDataCarrier);
-
-smalltalk.addMethod(
-smalltalk.method({
-selector: "xontent",
-category: '*Trapped-Processors',
-fn: function (){
-var self=this;
-return smalltalk.withContext(function($ctx1) { 
-var $1;
-$1=_st(_st(self._target())._asJQuery())._xontent();
-return $1;
-}, function($ctx1) {$ctx1.fill(self,"xontent",{},smalltalk.TrappedDataCarrier)})},
-args: [],
-source: "xontent\x0a\x09^self target asJQuery xontent",
-messageSends: ["xontent", "asJQuery", "target"],
-referencedClasses: []
-}),
-smalltalk.TrappedDataCarrier);
-
-smalltalk.addMethod(
-smalltalk.method({
-selector: "xontent:",
-category: '*Trapped-Processors',
-fn: function (anObject){
-var self=this;
-return smalltalk.withContext(function($ctx1) { 
-_st(_st(self._target())._asJQuery())._xontent_data_("set",anObject);
-return self}, function($ctx1) {$ctx1.fill(self,"xontent:",{anObject:anObject},smalltalk.TrappedDataCarrier)})},
-args: ["anObject"],
-source: "xontent: anObject\x0a\x09self target asJQuery xontent: 'set' data: anObject",
-messageSends: ["xontent:data:", "asJQuery", "target"],
-referencedClasses: []
-}),
-smalltalk.TrappedDataCarrier);
-
-smalltalk.addMethod(
-smalltalk.method({
-selector: "attr:",
-category: '*Trapped-Processors',
-fn: function (aString){
-var self=this;
-function $TrappedProcessorAttribute(){return smalltalk.TrappedProcessorAttribute||(typeof TrappedProcessorAttribute=="undefined"?nil:TrappedProcessorAttribute)}
-return smalltalk.withContext(function($ctx1) { 
-var $1;
-$1=_st($TrappedProcessorAttribute())._new_(aString);
-return $1;
-}, function($ctx1) {$ctx1.fill(self,"attr:",{aString:aString},smalltalk.TrappedProcessor.klass)})},
-args: ["aString"],
-source: "attr: aString\x0a\x09^TrappedProcessorAttribute new: aString",
-messageSends: ["new:"],
-referencedClasses: ["TrappedProcessorAttribute"]
-}),
-smalltalk.TrappedProcessor.klass);
-
-smalltalk.addMethod(
-smalltalk.method({
-selector: "dataToView:",
-category: '*Trapped-Processors',
-fn: function (aBlock){
-var self=this;
-function $TrappedProcessorDataAdhoc(){return smalltalk.TrappedProcessorDataAdhoc||(typeof TrappedProcessorDataAdhoc=="undefined"?nil:TrappedProcessorDataAdhoc)}
-return smalltalk.withContext(function($ctx1) { 
-var $1;
-$1=_st($TrappedProcessorDataAdhoc())._newToView_(aBlock);
-return $1;
-}, function($ctx1) {$ctx1.fill(self,"dataToView:",{aBlock:aBlock},smalltalk.TrappedProcessor.klass)})},
-args: ["aBlock"],
-source: "dataToView: aBlock\x0a\x09^TrappedProcessorDataAdhoc newToView: aBlock",
-messageSends: ["newToView:"],
-referencedClasses: ["TrappedProcessorDataAdhoc"]
-}),
-smalltalk.TrappedProcessor.klass);
-
-smalltalk.addMethod(
-smalltalk.method({
-selector: "deuric",
-category: '*Trapped-Processors',
-fn: function (){
-var self=this;
-function $TrappedProcessorUriComponentDecode(){return smalltalk.TrappedProcessorUriComponentDecode||(typeof TrappedProcessorUriComponentDecode=="undefined"?nil:TrappedProcessorUriComponentDecode)}
-return smalltalk.withContext(function($ctx1) { 
-var $1;
-$1=_st($TrappedProcessorUriComponentDecode())._new();
-return $1;
-}, function($ctx1) {$ctx1.fill(self,"deuric",{},smalltalk.TrappedProcessor.klass)})},
-args: [],
-source: "deuric\x0a\x09^TrappedProcessorUriComponentDecode new",
-messageSends: ["new"],
-referencedClasses: ["TrappedProcessorUriComponentDecode"]
-}),
-smalltalk.TrappedProcessor.klass);
-
-smalltalk.addMethod(
-smalltalk.method({
-selector: "guard:",
-category: '*Trapped-Processors',
-fn: function (anArray){
-var self=this;
-function $TrappedProcessorGuard(){return smalltalk.TrappedProcessorGuard||(typeof TrappedProcessorGuard=="undefined"?nil:TrappedProcessorGuard)}
-return smalltalk.withContext(function($ctx1) { 
-var $1;
-$1=_st($TrappedProcessorGuard())._new_(anArray);
-return $1;
-}, function($ctx1) {$ctx1.fill(self,"guard:",{anArray:anArray},smalltalk.TrappedProcessor.klass)})},
-args: ["anArray"],
-source: "guard: anArray\x0a\x09^TrappedProcessorGuard new: anArray",
-messageSends: ["new:"],
-referencedClasses: ["TrappedProcessorGuard"]
-}),
-smalltalk.TrappedProcessor.klass);
-
-smalltalk.addMethod(
-smalltalk.method({
-selector: "inputChecked",
-category: '*Trapped-Processors',
-fn: function (){
-var self=this;
-function $TrappedProcessorInputChecked(){return smalltalk.TrappedProcessorInputChecked||(typeof TrappedProcessorInputChecked=="undefined"?nil:TrappedProcessorInputChecked)}
-return smalltalk.withContext(function($ctx1) { 
-var $1;
-$1=_st($TrappedProcessorInputChecked())._new();
-return $1;
-}, function($ctx1) {$ctx1.fill(self,"inputChecked",{},smalltalk.TrappedProcessor.klass)})},
-args: [],
-source: "inputChecked\x0a\x09^TrappedProcessorInputChecked new",
-messageSends: ["new"],
-referencedClasses: ["TrappedProcessorInputChecked"]
-}),
-smalltalk.TrappedProcessor.klass);
-
-smalltalk.addMethod(
-smalltalk.method({
-selector: "inputValue",
-category: '*Trapped-Processors',
-fn: function (){
-var self=this;
-function $TrappedProcessorInputValue(){return smalltalk.TrappedProcessorInputValue||(typeof TrappedProcessorInputValue=="undefined"?nil:TrappedProcessorInputValue)}
-return smalltalk.withContext(function($ctx1) { 
-var $1;
-$1=_st($TrappedProcessorInputValue())._new();
-return $1;
-}, function($ctx1) {$ctx1.fill(self,"inputValue",{},smalltalk.TrappedProcessor.klass)})},
-args: [],
-source: "inputValue\x0a\x09^TrappedProcessorInputValue new",
-messageSends: ["new"],
-referencedClasses: ["TrappedProcessorInputValue"]
-}),
-smalltalk.TrappedProcessor.klass);
-
-smalltalk.addMethod(
-smalltalk.method({
-selector: "loopZ",
-category: '*Trapped-Processors',
-fn: function (){
-var self=this;
-function $TrappedProcessorLoopZ(){return smalltalk.TrappedProcessorLoopZ||(typeof TrappedProcessorLoopZ=="undefined"?nil:TrappedProcessorLoopZ)}
-return smalltalk.withContext(function($ctx1) { 
-var $1;
-$1=_st($TrappedProcessorLoopZ())._new();
-return $1;
-}, function($ctx1) {$ctx1.fill(self,"loopZ",{},smalltalk.TrappedProcessor.klass)})},
-args: [],
-source: "loopZ\x0a\x09^TrappedProcessorLoopZ new",
-messageSends: ["new"],
-referencedClasses: ["TrappedProcessorLoopZ"]
-}),
-smalltalk.TrappedProcessor.klass);
-
-smalltalk.addMethod(
-smalltalk.method({
-selector: "optionValue",
-category: '*Trapped-Processors',
-fn: function (){
-var self=this;
-function $TrappedProcessorOptionValue(){return smalltalk.TrappedProcessorOptionValue||(typeof TrappedProcessorOptionValue=="undefined"?nil:TrappedProcessorOptionValue)}
-return smalltalk.withContext(function($ctx1) { 
-var $1;
-$1=_st($TrappedProcessorOptionValue())._new();
-return $1;
-}, function($ctx1) {$ctx1.fill(self,"optionValue",{},smalltalk.TrappedProcessor.klass)})},
-args: [],
-source: "optionValue\x0a\x09^TrappedProcessorOptionValue new",
-messageSends: ["new"],
-referencedClasses: ["TrappedProcessorOptionValue"]
-}),
-smalltalk.TrappedProcessor.klass);
-
-smalltalk.addMethod(
-smalltalk.method({
-selector: "path",
-category: '*Trapped-Processors',
-fn: function (){
-var self=this;
-function $TrappedProcessorDescend(){return smalltalk.TrappedProcessorDescend||(typeof TrappedProcessorDescend=="undefined"?nil:TrappedProcessorDescend)}
-return smalltalk.withContext(function($ctx1) { 
-var $1;
-$1=_st($TrappedProcessorDescend())._new();
-return $1;
-}, function($ctx1) {$ctx1.fill(self,"path",{},smalltalk.TrappedProcessor.klass)})},
-args: [],
-source: "path\x0a\x09^TrappedProcessorDescend new",
-messageSends: ["new"],
-referencedClasses: ["TrappedProcessorDescend"]
-}),
-smalltalk.TrappedProcessor.klass);
-
-smalltalk.addMethod(
-smalltalk.method({
-selector: "replace:with:",
-category: '*Trapped-Processors',
-fn: function (aString,anotherString){
-var self=this;
-function $TrappedProcessorReplace(){return smalltalk.TrappedProcessorReplace||(typeof TrappedProcessorReplace=="undefined"?nil:TrappedProcessorReplace)}
-return smalltalk.withContext(function($ctx1) { 
-var $1;
-$1=_st($TrappedProcessorReplace())._new_with_(aString,anotherString);
-return $1;
-}, function($ctx1) {$ctx1.fill(self,"replace:with:",{aString:aString,anotherString:anotherString},smalltalk.TrappedProcessor.klass)})},
-args: ["aString", "anotherString"],
-source: "replace: aString with: anotherString\x0a\x09^TrappedProcessorReplace new: aString with: anotherString",
-messageSends: ["new:with:"],
-referencedClasses: ["TrappedProcessorReplace"]
-}),
-smalltalk.TrappedProcessor.klass);
-
-smalltalk.addMethod(
-smalltalk.method({
-selector: "selectValue",
-category: '*Trapped-Processors',
-fn: function (){
-var self=this;
-function $TrappedProcessorSelectValue(){return smalltalk.TrappedProcessorSelectValue||(typeof TrappedProcessorSelectValue=="undefined"?nil:TrappedProcessorSelectValue)}
-return smalltalk.withContext(function($ctx1) { 
-var $1;
-$1=_st($TrappedProcessorSelectValue())._new();
-return $1;
-}, function($ctx1) {$ctx1.fill(self,"selectValue",{},smalltalk.TrappedProcessor.klass)})},
-args: [],
-source: "selectValue\x0a\x09^TrappedProcessorSelectValue new",
-messageSends: ["new"],
-referencedClasses: ["TrappedProcessorSelectValue"]
-}),
-smalltalk.TrappedProcessor.klass);
-
-smalltalk.addMethod(
-smalltalk.method({
-selector: "signal:",
-category: '*Trapped-Processors',
-fn: function (aString){
-var self=this;
-function $TrappedProcessorSignal(){return smalltalk.TrappedProcessorSignal||(typeof TrappedProcessorSignal=="undefined"?nil:TrappedProcessorSignal)}
-return smalltalk.withContext(function($ctx1) { 
-var $1;
-$1=_st($TrappedProcessorSignal())._new_(aString);
-return $1;
-}, function($ctx1) {$ctx1.fill(self,"signal:",{aString:aString},smalltalk.TrappedProcessor.klass)})},
-args: ["aString"],
-source: "signal: aString\x0a\x09^TrappedProcessorSignal new: aString",
-messageSends: ["new:"],
-referencedClasses: ["TrappedProcessorSignal"]
-}),
-smalltalk.TrappedProcessor.klass);
-
-smalltalk.addMethod(
-smalltalk.method({
-selector: "toBlackboard",
-category: '*Trapped-Processors',
-fn: function (){
-var self=this;
-function $TrappedProcessorToBlackboard(){return smalltalk.TrappedProcessorToBlackboard||(typeof TrappedProcessorToBlackboard=="undefined"?nil:TrappedProcessorToBlackboard)}
-return smalltalk.withContext(function($ctx1) { 
-var $1;
-$1=_st($TrappedProcessorToBlackboard())._new();
-return $1;
-}, function($ctx1) {$ctx1.fill(self,"toBlackboard",{},smalltalk.TrappedProcessor.klass)})},
-args: [],
-source: "toBlackboard\x0a\x09^TrappedProcessorToBlackboard new",
-messageSends: ["new"],
-referencedClasses: ["TrappedProcessorToBlackboard"]
-}),
-smalltalk.TrappedProcessor.klass);
-
-smalltalk.addMethod(
-smalltalk.method({
-selector: "uric",
-category: '*Trapped-Processors',
-fn: function (){
-var self=this;
-function $TrappedProcessorUriComponentEncode(){return smalltalk.TrappedProcessorUriComponentEncode||(typeof TrappedProcessorUriComponentEncode=="undefined"?nil:TrappedProcessorUriComponentEncode)}
-return smalltalk.withContext(function($ctx1) { 
-var $1;
-$1=_st($TrappedProcessorUriComponentEncode())._new();
-return $1;
-}, function($ctx1) {$ctx1.fill(self,"uric",{},smalltalk.TrappedProcessor.klass)})},
-args: [],
-source: "uric\x0a\x09^TrappedProcessorUriComponentEncode new",
-messageSends: ["new"],
-referencedClasses: ["TrappedProcessorUriComponentEncode"]
-}),
-smalltalk.TrappedProcessor.klass);
-
-smalltalk.addMethod(
-smalltalk.method({
-selector: "whenClicked",
-category: '*Trapped-Processors',
-fn: function (){
-var self=this;
-function $TrappedProcessorWhenClicked(){return smalltalk.TrappedProcessorWhenClicked||(typeof TrappedProcessorWhenClicked=="undefined"?nil:TrappedProcessorWhenClicked)}
-return smalltalk.withContext(function($ctx1) { 
-var $1;
-$1=_st($TrappedProcessorWhenClicked())._new();
-return $1;
-}, function($ctx1) {$ctx1.fill(self,"whenClicked",{},smalltalk.TrappedProcessor.klass)})},
-args: [],
-source: "whenClicked\x0a\x09^TrappedProcessorWhenClicked new",
-messageSends: ["new"],
-referencedClasses: ["TrappedProcessorWhenClicked"]
-}),
-smalltalk.TrappedProcessor.klass);
-
-smalltalk.addMethod(
-smalltalk.method({
-selector: "whenSubmitted",
-category: '*Trapped-Processors',
-fn: function (){
-var self=this;
-function $TrappedProcessorWhenSubmitted(){return smalltalk.TrappedProcessorWhenSubmitted||(typeof TrappedProcessorWhenSubmitted=="undefined"?nil:TrappedProcessorWhenSubmitted)}
-return smalltalk.withContext(function($ctx1) { 
-var $1;
-$1=_st($TrappedProcessorWhenSubmitted())._new();
-return $1;
-}, function($ctx1) {$ctx1.fill(self,"whenSubmitted",{},smalltalk.TrappedProcessor.klass)})},
-args: [],
-source: "whenSubmitted\x0a\x09^TrappedProcessorWhenSubmitted new",
-messageSends: ["new"],
-referencedClasses: ["TrappedProcessorWhenSubmitted"]
-}),
-smalltalk.TrappedProcessor.klass);
-
-smalltalk.addMethod(
-smalltalk.method({
-selector: "widget:",
-category: '*Trapped-Processors',
-fn: function (aString){
-var self=this;
-function $TrappedProcessorWidget(){return smalltalk.TrappedProcessorWidget||(typeof TrappedProcessorWidget=="undefined"?nil:TrappedProcessorWidget)}
-return smalltalk.withContext(function($ctx1) { 
-var $1;
-$1=_st($TrappedProcessorWidget())._new_(aString);
-return $1;
-}, function($ctx1) {$ctx1.fill(self,"widget:",{aString:aString},smalltalk.TrappedProcessor.klass)})},
-args: ["aString"],
-source: "widget: aString\x0a\x09^TrappedProcessorWidget new: aString",
-messageSends: ["new:"],
-referencedClasses: ["TrappedProcessorWidget"]
-}),
-smalltalk.TrappedProcessor.klass);
-
-smalltalk.addMethod(
-smalltalk.method({
-selector: "xontent",
-category: '*Trapped-Processors',
-fn: function (){
-var self=this;
-function $TrappedProcessorXontent(){return smalltalk.TrappedProcessorXontent||(typeof TrappedProcessorXontent=="undefined"?nil:TrappedProcessorXontent)}
-return smalltalk.withContext(function($ctx1) { 
-var $1;
-$1=_st($TrappedProcessorXontent())._new();
-return $1;
-}, function($ctx1) {$ctx1.fill(self,"xontent",{},smalltalk.TrappedProcessor.klass)})},
-args: [],
-source: "xontent\x0a\x09^TrappedProcessorXontent new",
-messageSends: ["new"],
-referencedClasses: ["TrappedProcessorXontent"]
-}),
-smalltalk.TrappedProcessor.klass);
-
-});

+ 0 - 458
js/Trapped-Tests.js

@@ -1,458 +0,0 @@
-define("gh_herby_trapped/Trapped-Tests", ["amber_vm/smalltalk", "amber_vm/nil", "amber_vm/_st", "amber_core/SUnit"], function(smalltalk,nil,_st){
-smalltalk.addPackage('Trapped-Tests');
-smalltalk.packages["Trapped-Tests"].transport = {"type":"amd","amdNamespace":"gh_herby_trapped"};
-
-smalltalk.addClass('IsolatorTest', smalltalk.TestCase, ['rootModel'], 'Trapped-Tests');
-smalltalk.addMethod(
-smalltalk.method({
-selector: "setUp",
-category: 'running',
-fn: function (){
-var self=this;
-function $EavModel(){return smalltalk.EavModel||(typeof EavModel=="undefined"?nil:EavModel)}
-return smalltalk.withContext(function($ctx1) { 
-var $1,$2;
-$1=_st($EavModel())._new();
-_st($1)._getBlock_((function(x){
-return smalltalk.withContext(function($ctx2) {
-return _st(x)._root();
-}, function($ctx2) {$ctx2.fillBlock({x:x},$ctx1,1)})}));
-$2=_st($1)._putBlock_((function(x,y){
-return smalltalk.withContext(function($ctx2) {
-return _st(x)._root_(y);
-}, function($ctx2) {$ctx2.fillBlock({x:x,y:y},$ctx1,2)})}));
-self["@rootModel"]=$2;
-return self}, function($ctx1) {$ctx1.fill(self,"setUp",{},smalltalk.IsolatorTest)})},
-args: [],
-source: "setUp\x0a\x0arootModel := EavModel new\x0a\x09getBlock: [:x | x root];\x0a    putBlock: [:x :y | x root: y].",
-messageSends: ["getBlock:", "new", "root", "putBlock:", "root:"],
-referencedClasses: ["EavModel"]
-}),
-smalltalk.IsolatorTest);
-
-smalltalk.addMethod(
-smalltalk.method({
-selector: "testNontrivialModelGetsAppropriateValueForModification",
-category: 'tests',
-fn: function (){
-var self=this;
-var isolator,model,result;
-function $Isolator(){return smalltalk.Isolator||(typeof Isolator=="undefined"?nil:Isolator)}
-function $EavModel(){return smalltalk.EavModel||(typeof EavModel=="undefined"?nil:EavModel)}
-return smalltalk.withContext(function($ctx1) { 
-var $2,$1,$3,$5,$4,$6;
-result=nil;
-$2="foo".__minus_gt(["bar", [(1), [(2), (5)]], "baz"]);
-$ctx1.sendIdx["->"]=1;
-$1=smalltalk.HashedCollection._from_([$2,"moo".__minus_gt("zoo")]);
-isolator=_st($Isolator())._on_($1);
-$3=_st($EavModel())._new();
-_st($3)._getBlock_((function(x){
-return smalltalk.withContext(function($ctx2) {
-$5=_st(x)._root();
-$ctx2.sendIdx["root"]=1;
-$4=_st($5)._at_("foo");
-$ctx2.sendIdx["at:"]=2;
-return _st($4)._at_((2));
-$ctx2.sendIdx["at:"]=1;
-}, function($ctx2) {$ctx2.fillBlock({x:x},$ctx1,1)})}));
-$6=_st($3)._putBlock_((function(x,y){
-return smalltalk.withContext(function($ctx2) {
-return _st(_st(_st(x)._root())._at_("foo"))._at_put_((2),y);
-}, function($ctx2) {$ctx2.fillBlock({x:x,y:y},$ctx1,2)})}));
-model=$6;
-_st(isolator)._model_modify_(model,(function(r){
-return smalltalk.withContext(function($ctx2) {
-result=r;
-return result;
-}, function($ctx2) {$ctx2.fillBlock({r:r},$ctx1,3)})}));
-self._assert_equals_([(1), [(2), (5)]],result);
-return self}, function($ctx1) {$ctx1.fill(self,"testNontrivialModelGetsAppropriateValueForModification",{isolator:isolator,model:model,result:result},smalltalk.IsolatorTest)})},
-args: [],
-source: "testNontrivialModelGetsAppropriateValueForModification\x0a| isolator model result |\x0aresult := nil.\x0aisolator := Isolator on: #{ 'foo' -> #('bar' #(1 #(2 5)) 'baz'). 'moo' -> 'zoo' }.\x0amodel := EavModel new\x0a\x09getBlock: [ :x | (x root at: 'foo') at: 2 ];\x0a\x09putBlock: [ :x :y | (x root at: 'foo') at: 2 put: y].\x0aisolator model: model modify: [:r|result := r].\x0aself assert: #(1 #(2 5)) equals: result",
-messageSends: ["on:", "->", "getBlock:", "new", "at:", "root", "putBlock:", "at:put:", "model:modify:", "assert:equals:"],
-referencedClasses: ["Isolator", "EavModel"]
-}),
-smalltalk.IsolatorTest);
-
-smalltalk.addMethod(
-smalltalk.method({
-selector: "testNontrivialModelModifiesAppropriateValue",
-category: 'tests',
-fn: function (){
-var self=this;
-var isolator,model,result;
-function $Isolator(){return smalltalk.Isolator||(typeof Isolator=="undefined"?nil:Isolator)}
-function $EavModel(){return smalltalk.EavModel||(typeof EavModel=="undefined"?nil:EavModel)}
-return smalltalk.withContext(function($ctx1) { 
-var $2,$3,$1,$4,$6,$5,$7,$9,$8;
-result=nil;
-$2="foo".__minus_gt(["bar", [(1), [(2), (3)]], "baz"]);
-$ctx1.sendIdx["->"]=1;
-$3="moo".__minus_gt("zoo");
-$ctx1.sendIdx["->"]=2;
-$1=smalltalk.HashedCollection._from_([$2,$3]);
-isolator=_st($Isolator())._on_($1);
-$4=_st($EavModel())._new();
-_st($4)._getBlock_((function(x){
-return smalltalk.withContext(function($ctx2) {
-$6=_st(x)._root();
-$ctx2.sendIdx["root"]=1;
-$5=_st($6)._at_("foo");
-$ctx2.sendIdx["at:"]=2;
-return _st($5)._at_((2));
-$ctx2.sendIdx["at:"]=1;
-}, function($ctx2) {$ctx2.fillBlock({x:x},$ctx1,1)})}));
-$7=_st($4)._putBlock_((function(x,y){
-return smalltalk.withContext(function($ctx2) {
-return _st(_st(_st(x)._root())._at_("foo"))._at_put_((2),y);
-}, function($ctx2) {$ctx2.fillBlock({x:x,y:y},$ctx1,2)})}));
-model=$7;
-_st(isolator)._model_modify_(model,(function(r){
-return smalltalk.withContext(function($ctx2) {
-return "new";
-}, function($ctx2) {$ctx2.fillBlock({r:r},$ctx1,3)})}));
-_st(isolator)._model_read_(model,(function(r){
-return smalltalk.withContext(function($ctx2) {
-result=r;
-return result;
-}, function($ctx2) {$ctx2.fillBlock({r:r},$ctx1,4)})}));
-$ctx1.sendIdx["model:read:"]=1;
-self._assert_equals_("new",result);
-$ctx1.sendIdx["assert:equals:"]=1;
-_st(isolator)._model_read_(self["@rootModel"],(function(r){
-return smalltalk.withContext(function($ctx2) {
-result=r;
-return result;
-}, function($ctx2) {$ctx2.fillBlock({r:r},$ctx1,5)})}));
-$9="foo".__minus_gt(["bar", "new", "baz"]);
-$ctx1.sendIdx["->"]=3;
-$8=smalltalk.HashedCollection._from_([$9,"moo".__minus_gt("zoo")]);
-self._assert_equals_($8,result);
-return self}, function($ctx1) {$ctx1.fill(self,"testNontrivialModelModifiesAppropriateValue",{isolator:isolator,model:model,result:result},smalltalk.IsolatorTest)})},
-args: [],
-source: "testNontrivialModelModifiesAppropriateValue\x0a| isolator model result |\x0aresult := nil.\x0aisolator := Isolator on: #{ 'foo' -> #('bar' #(1 #(2 3)) 'baz'). 'moo' -> 'zoo' }.\x0amodel := EavModel new\x0a\x09getBlock: [ :x | (x root at: 'foo') at: 2 ];\x0a\x09putBlock: [ :x :y | (x root at: 'foo') at: 2 put: y].\x0aisolator model: model modify: [:r|#new].\x0aisolator model: model read: [:r|result := r].\x0aself assert: #new equals: result.\x0aisolator model: rootModel read: [:r|result := r].\x0aself assert: #{ 'foo' -> #('bar' #new 'baz'). 'moo' -> 'zoo' } equals: result",
-messageSends: ["on:", "->", "getBlock:", "new", "at:", "root", "putBlock:", "at:put:", "model:modify:", "model:read:", "assert:equals:"],
-referencedClasses: ["Isolator", "EavModel"]
-}),
-smalltalk.IsolatorTest);
-
-smalltalk.addMethod(
-smalltalk.method({
-selector: "testNontrivialModelReturnsAppropriateValue",
-category: 'tests',
-fn: function (){
-var self=this;
-var isolator,model,result;
-function $Isolator(){return smalltalk.Isolator||(typeof Isolator=="undefined"?nil:Isolator)}
-function $EavModel(){return smalltalk.EavModel||(typeof EavModel=="undefined"?nil:EavModel)}
-return smalltalk.withContext(function($ctx1) { 
-var $2,$1;
-result=nil;
-$2="foo".__minus_gt(["bar", [(1), [(2), (3)]], "baz"]);
-$ctx1.sendIdx["->"]=1;
-$1=smalltalk.HashedCollection._from_([$2,"moo".__minus_gt("zoo")]);
-isolator=_st($Isolator())._on_($1);
-model=_st(_st($EavModel())._new())._getBlock_((function(x){
-return smalltalk.withContext(function($ctx2) {
-return _st(_st(_st(x)._root())._at_("foo"))._at_((2));
-$ctx2.sendIdx["at:"]=1;
-}, function($ctx2) {$ctx2.fillBlock({x:x},$ctx1,1)})}));
-_st(isolator)._model_read_(model,(function(r){
-return smalltalk.withContext(function($ctx2) {
-result=r;
-return result;
-}, function($ctx2) {$ctx2.fillBlock({r:r},$ctx1,2)})}));
-self._assert_equals_([(1), [(2), (3)]],result);
-return self}, function($ctx1) {$ctx1.fill(self,"testNontrivialModelReturnsAppropriateValue",{isolator:isolator,model:model,result:result},smalltalk.IsolatorTest)})},
-args: [],
-source: "testNontrivialModelReturnsAppropriateValue\x0a| isolator model result |\x0aresult := nil.\x0aisolator := Isolator on: #{ 'foo' -> #('bar' #(1 #(2 3)) 'baz'). 'moo' -> 'zoo' }.\x0amodel := EavModel new getBlock: [ :x | (x root at: 'foo') at: 2 ].\x0aisolator model: model read: [:r|result := r].\x0aself assert: #(1 #(2 3)) equals: result",
-messageSends: ["on:", "->", "getBlock:", "new", "at:", "root", "model:read:", "assert:equals:"],
-referencedClasses: ["Isolator", "EavModel"]
-}),
-smalltalk.IsolatorTest);
-
-smalltalk.addMethod(
-smalltalk.method({
-selector: "testRootModelExaminesThenModifiesRoot",
-category: 'tests',
-fn: function (){
-var self=this;
-var isolator,result;
-function $Isolator(){return smalltalk.Isolator||(typeof Isolator=="undefined"?nil:Isolator)}
-return smalltalk.withContext(function($ctx1) { 
-result=nil;
-isolator=_st($Isolator())._on_([(1), [(2), (3)]]);
-_st(isolator)._model_modify_(self["@rootModel"],(function(r){
-return smalltalk.withContext(function($ctx2) {
-return _st(r)._second();
-}, function($ctx2) {$ctx2.fillBlock({r:r},$ctx1,1)})}));
-_st(isolator)._model_read_(self["@rootModel"],(function(r){
-return smalltalk.withContext(function($ctx2) {
-result=r;
-return result;
-}, function($ctx2) {$ctx2.fillBlock({r:r},$ctx1,2)})}));
-self._assert_equals_([(2), (3)],result);
-return self}, function($ctx1) {$ctx1.fill(self,"testRootModelExaminesThenModifiesRoot",{isolator:isolator,result:result},smalltalk.IsolatorTest)})},
-args: [],
-source: "testRootModelExaminesThenModifiesRoot\x0a| isolator result |\x0aresult := nil.\x0aisolator := Isolator on: #(1 #(2 3)).\x0aisolator model: rootModel modify: [:r|r second].\x0aisolator model: rootModel read: [:r|result := r].\x0aself assert: #(2 3) equals: result",
-messageSends: ["on:", "model:modify:", "second", "model:read:", "assert:equals:"],
-referencedClasses: ["Isolator"]
-}),
-smalltalk.IsolatorTest);
-
-smalltalk.addMethod(
-smalltalk.method({
-selector: "testRootModelGetsRootForModification",
-category: 'tests',
-fn: function (){
-var self=this;
-var isolator,result;
-function $Isolator(){return smalltalk.Isolator||(typeof Isolator=="undefined"?nil:Isolator)}
-return smalltalk.withContext(function($ctx1) { 
-result=nil;
-isolator=_st($Isolator())._on_([(2), [(1), (0)]]);
-_st(isolator)._model_modify_(self["@rootModel"],(function(r){
-return smalltalk.withContext(function($ctx2) {
-result=r;
-return result;
-}, function($ctx2) {$ctx2.fillBlock({r:r},$ctx1,1)})}));
-self._assert_equals_([(2), [(1), (0)]],result);
-return self}, function($ctx1) {$ctx1.fill(self,"testRootModelGetsRootForModification",{isolator:isolator,result:result},smalltalk.IsolatorTest)})},
-args: [],
-source: "testRootModelGetsRootForModification\x0a| isolator result |\x0aresult := nil.\x0aisolator := Isolator on: #(2 #(1 0)).\x0aisolator model: rootModel modify: [:r|result := r].\x0aself assert: #(2 #(1 0)) equals: result",
-messageSends: ["on:", "model:modify:", "assert:equals:"],
-referencedClasses: ["Isolator"]
-}),
-smalltalk.IsolatorTest);
-
-smalltalk.addMethod(
-smalltalk.method({
-selector: "testRootModelModifiesAndDeeplyIsolatesInPlaceModifiedRoot",
-category: 'tests',
-fn: function (){
-var self=this;
-var isolator,result,newValue;
-function $Isolator(){return smalltalk.Isolator||(typeof Isolator=="undefined"?nil:Isolator)}
-return smalltalk.withContext(function($ctx1) { 
-result=nil;
-newValue=nil;
-isolator=_st($Isolator())._on_([(1), [(2), (3)]]);
-_st(isolator)._model_modify_(self["@rootModel"],(function(r){
-return smalltalk.withContext(function($ctx2) {
-newValue=r;
-newValue;
-_st(r)._at_put_((1),(4));
-$ctx2.sendIdx["at:put:"]=1;
-return r;
-}, function($ctx2) {$ctx2.fillBlock({r:r},$ctx1,1)})}));
-_st(newValue)._at_put_((2),"bar");
-$ctx1.sendIdx["at:put:"]=2;
-_st(isolator)._model_read_(self["@rootModel"],(function(r){
-return smalltalk.withContext(function($ctx2) {
-result=r;
-return result;
-}, function($ctx2) {$ctx2.fillBlock({r:r},$ctx1,2)})}));
-_st(newValue)._at_put_((2),"baz");
-self._assert_equals_([(4), [(2), (3)]],result);
-return self}, function($ctx1) {$ctx1.fill(self,"testRootModelModifiesAndDeeplyIsolatesInPlaceModifiedRoot",{isolator:isolator,result:result,newValue:newValue},smalltalk.IsolatorTest)})},
-args: [],
-source: "testRootModelModifiesAndDeeplyIsolatesInPlaceModifiedRoot\x0a| isolator result newValue |\x0aresult := nil. newValue := nil.\x0aisolator := Isolator on: #(1 #(2 3)).\x0aisolator model: rootModel modify: [:r|newValue := r. r at: 1 put: 4. r].\x0anewValue at: 2 put: 'bar'.\x0aisolator model: rootModel read: [:r|result := r].\x0anewValue at: 2 put: 'baz'.\x0aself assert: #(4 #(2 3)) equals: result",
-messageSends: ["on:", "model:modify:", "at:put:", "model:read:", "assert:equals:"],
-referencedClasses: ["Isolator"]
-}),
-smalltalk.IsolatorTest);
-
-smalltalk.addMethod(
-smalltalk.method({
-selector: "testRootModelModifiesAndDeeplyIsolatesRoot",
-category: 'tests',
-fn: function (){
-var self=this;
-var isolator,result,newValue;
-function $Isolator(){return smalltalk.Isolator||(typeof Isolator=="undefined"?nil:Isolator)}
-return smalltalk.withContext(function($ctx1) { 
-var $1,$2;
-result=nil;
-isolator=_st($Isolator())._on_([(1), [(2), (3)]]);
-$1="foo".__minus_gt([(4), (5), (6)]);
-$ctx1.sendIdx["->"]=1;
-newValue=smalltalk.HashedCollection._from_([$1]);
-_st(isolator)._model_modify_(self["@rootModel"],(function(r){
-return smalltalk.withContext(function($ctx2) {
-return newValue;
-}, function($ctx2) {$ctx2.fillBlock({r:r},$ctx1,1)})}));
-$2=_st(newValue)._at_("foo");
-$ctx1.sendIdx["at:"]=1;
-_st($2)._at_put_((1),"bar");
-$ctx1.sendIdx["at:put:"]=1;
-_st(isolator)._model_read_(self["@rootModel"],(function(r){
-return smalltalk.withContext(function($ctx2) {
-result=r;
-return result;
-}, function($ctx2) {$ctx2.fillBlock({r:r},$ctx1,2)})}));
-_st(_st(newValue)._at_("foo"))._at_put_((3),"baz");
-self._assert_equals_(smalltalk.HashedCollection._from_(["foo".__minus_gt([(4), (5), (6)])]),result);
-return self}, function($ctx1) {$ctx1.fill(self,"testRootModelModifiesAndDeeplyIsolatesRoot",{isolator:isolator,result:result,newValue:newValue},smalltalk.IsolatorTest)})},
-args: [],
-source: "testRootModelModifiesAndDeeplyIsolatesRoot\x0a| isolator result newValue |\x0aresult := nil.\x0aisolator := Isolator on: #(1 #(2 3)).\x0anewValue := #{'foo'->#(4 5 6)}.\x0aisolator model: rootModel modify: [:r|newValue].\x0a(newValue at: 'foo') at: 1 put: 'bar'.\x0aisolator model: rootModel read: [:r|result := r].\x0a(newValue at: 'foo') at: 3 put: 'baz'.\x0aself assert: #{'foo'->#(4 5 6)} equals: result",
-messageSends: ["on:", "->", "model:modify:", "at:put:", "at:", "model:read:", "assert:equals:"],
-referencedClasses: ["Isolator"]
-}),
-smalltalk.IsolatorTest);
-
-smalltalk.addMethod(
-smalltalk.method({
-selector: "testRootModelModifiesAndIsolatesRoot",
-category: 'tests',
-fn: function (){
-var self=this;
-var isolator,result,newValue;
-function $Isolator(){return smalltalk.Isolator||(typeof Isolator=="undefined"?nil:Isolator)}
-return smalltalk.withContext(function($ctx1) { 
-var $1;
-result=nil;
-isolator=_st($Isolator())._on_([(1), [(2), (3)]]);
-$1="foo".__minus_gt([(4), (5), (6)]);
-$ctx1.sendIdx["->"]=1;
-newValue=smalltalk.HashedCollection._from_([$1]);
-_st(isolator)._model_modify_(self["@rootModel"],(function(r){
-return smalltalk.withContext(function($ctx2) {
-return newValue;
-}, function($ctx2) {$ctx2.fillBlock({r:r},$ctx1,1)})}));
-_st(newValue)._at_put_("foo","bar");
-$ctx1.sendIdx["at:put:"]=1;
-_st(isolator)._model_read_(self["@rootModel"],(function(r){
-return smalltalk.withContext(function($ctx2) {
-result=r;
-return result;
-}, function($ctx2) {$ctx2.fillBlock({r:r},$ctx1,2)})}));
-_st(newValue)._at_put_("foo","baz");
-self._assert_equals_(smalltalk.HashedCollection._from_(["foo".__minus_gt([(4), (5), (6)])]),result);
-return self}, function($ctx1) {$ctx1.fill(self,"testRootModelModifiesAndIsolatesRoot",{isolator:isolator,result:result,newValue:newValue},smalltalk.IsolatorTest)})},
-args: [],
-source: "testRootModelModifiesAndIsolatesRoot\x0a| isolator result newValue |\x0aresult := nil.\x0aisolator := Isolator on: #(1 #(2 3)).\x0anewValue := #{'foo'->#(4 5 6)}.\x0aisolator model: rootModel modify: [:r|newValue].\x0anewValue at: 'foo' put: 'bar'.\x0aisolator model: rootModel read: [:r|result := r].\x0anewValue at: 'foo' put: 'baz'.\x0aself assert: #{'foo'->#(4 5 6)} equals: result",
-messageSends: ["on:", "->", "model:modify:", "at:put:", "model:read:", "assert:equals:"],
-referencedClasses: ["Isolator"]
-}),
-smalltalk.IsolatorTest);
-
-smalltalk.addMethod(
-smalltalk.method({
-selector: "testRootModelModifiesRoot",
-category: 'tests',
-fn: function (){
-var self=this;
-var isolator,result;
-function $Isolator(){return smalltalk.Isolator||(typeof Isolator=="undefined"?nil:Isolator)}
-return smalltalk.withContext(function($ctx1) { 
-var $1;
-result=nil;
-isolator=_st($Isolator())._on_([(1), [(2), (3)]]);
-_st(isolator)._model_modify_(self["@rootModel"],(function(r){
-return smalltalk.withContext(function($ctx2) {
-$1="foo".__minus_gt([(4), (5), (6)]);
-$ctx2.sendIdx["->"]=1;
-return smalltalk.HashedCollection._from_([$1]);
-}, function($ctx2) {$ctx2.fillBlock({r:r},$ctx1,1)})}));
-_st(isolator)._model_read_(self["@rootModel"],(function(r){
-return smalltalk.withContext(function($ctx2) {
-result=r;
-return result;
-}, function($ctx2) {$ctx2.fillBlock({r:r},$ctx1,2)})}));
-self._assert_equals_(smalltalk.HashedCollection._from_(["foo".__minus_gt([(4), (5), (6)])]),result);
-return self}, function($ctx1) {$ctx1.fill(self,"testRootModelModifiesRoot",{isolator:isolator,result:result},smalltalk.IsolatorTest)})},
-args: [],
-source: "testRootModelModifiesRoot\x0a| isolator result |\x0aresult := nil.\x0aisolator := Isolator on: #(1 #(2 3)).\x0aisolator model: rootModel modify: [:r|#{'foo'->#(4 5 6)}].\x0aisolator model: rootModel read: [:r|result := r].\x0aself assert: #{'foo'->#(4 5 6)} equals: result",
-messageSends: ["on:", "model:modify:", "->", "model:read:", "assert:equals:"],
-referencedClasses: ["Isolator"]
-}),
-smalltalk.IsolatorTest);
-
-smalltalk.addMethod(
-smalltalk.method({
-selector: "testRootModelReturnsDeeplyIsolatedRoot",
-category: 'tests',
-fn: function (){
-var self=this;
-var isolator,result;
-function $Isolator(){return smalltalk.Isolator||(typeof Isolator=="undefined"?nil:Isolator)}
-return smalltalk.withContext(function($ctx1) { 
-result=nil;
-isolator=_st($Isolator())._on_([(1), [(2), (3)]]);
-_st(isolator)._model_read_(self["@rootModel"],(function(r){
-return smalltalk.withContext(function($ctx2) {
-return _st(_st(r)._at_((2)))._at_put_((1),(0));
-}, function($ctx2) {$ctx2.fillBlock({r:r},$ctx1,1)})}));
-$ctx1.sendIdx["model:read:"]=1;
-_st(isolator)._model_read_(self["@rootModel"],(function(r){
-return smalltalk.withContext(function($ctx2) {
-result=r;
-return result;
-}, function($ctx2) {$ctx2.fillBlock({r:r},$ctx1,2)})}));
-self._assert_equals_([(1), [(2), (3)]],result);
-return self}, function($ctx1) {$ctx1.fill(self,"testRootModelReturnsDeeplyIsolatedRoot",{isolator:isolator,result:result},smalltalk.IsolatorTest)})},
-args: [],
-source: "testRootModelReturnsDeeplyIsolatedRoot\x0a| isolator result |\x0aresult := nil.\x0aisolator := Isolator on: #(1 #(2 3)).\x0aisolator model: rootModel read: [:r|(r at: 2) at: 1 put: 0].\x0aisolator model: rootModel read: [:r|result := r].\x0aself assert: #(1 #(2 3)) equals: result",
-messageSends: ["on:", "model:read:", "at:put:", "at:", "assert:equals:"],
-referencedClasses: ["Isolator"]
-}),
-smalltalk.IsolatorTest);
-
-smalltalk.addMethod(
-smalltalk.method({
-selector: "testRootModelReturnsIsolatedRoot",
-category: 'tests',
-fn: function (){
-var self=this;
-var isolator,result;
-function $Isolator(){return smalltalk.Isolator||(typeof Isolator=="undefined"?nil:Isolator)}
-return smalltalk.withContext(function($ctx1) { 
-result=nil;
-isolator=_st($Isolator())._on_([(1), [(2), (4)]]);
-_st(isolator)._model_read_(self["@rootModel"],(function(r){
-return smalltalk.withContext(function($ctx2) {
-return _st(r)._at_put_((2),nil);
-}, function($ctx2) {$ctx2.fillBlock({r:r},$ctx1,1)})}));
-$ctx1.sendIdx["model:read:"]=1;
-_st(isolator)._model_read_(self["@rootModel"],(function(r){
-return smalltalk.withContext(function($ctx2) {
-result=r;
-return result;
-}, function($ctx2) {$ctx2.fillBlock({r:r},$ctx1,2)})}));
-self._assert_equals_([(1), [(2), (4)]],result);
-return self}, function($ctx1) {$ctx1.fill(self,"testRootModelReturnsIsolatedRoot",{isolator:isolator,result:result},smalltalk.IsolatorTest)})},
-args: [],
-source: "testRootModelReturnsIsolatedRoot\x0a| isolator result |\x0aresult := nil.\x0aisolator := Isolator on: #(1 #(2 4)).\x0aisolator model: rootModel read: [:r|r at: 2 put: nil].\x0aisolator model: rootModel read: [:r|result := r].\x0aself assert: #(1 #(2 4)) equals: result",
-messageSends: ["on:", "model:read:", "at:put:", "assert:equals:"],
-referencedClasses: ["Isolator"]
-}),
-smalltalk.IsolatorTest);
-
-smalltalk.addMethod(
-smalltalk.method({
-selector: "testRootModelReturnsRoot",
-category: 'tests',
-fn: function (){
-var self=this;
-var isolator,result;
-function $Isolator(){return smalltalk.Isolator||(typeof Isolator=="undefined"?nil:Isolator)}
-return smalltalk.withContext(function($ctx1) { 
-result=nil;
-isolator=_st($Isolator())._on_([(1), [(2), (3)]]);
-_st(isolator)._model_read_(self["@rootModel"],(function(r){
-return smalltalk.withContext(function($ctx2) {
-result=r;
-return result;
-}, function($ctx2) {$ctx2.fillBlock({r:r},$ctx1,1)})}));
-self._assert_equals_([(1), [(2), (3)]],result);
-return self}, function($ctx1) {$ctx1.fill(self,"testRootModelReturnsRoot",{isolator:isolator,result:result},smalltalk.IsolatorTest)})},
-args: [],
-source: "testRootModelReturnsRoot\x0a| isolator result |\x0aresult := nil.\x0aisolator := Isolator on: #(1 #(2 3)).\x0aisolator model: rootModel read: [:r|result := r].\x0aself assert: #(1 #(2 3)) equals: result",
-messageSends: ["on:", "model:read:", "assert:equals:"],
-referencedClasses: ["Isolator"]
-}),
-smalltalk.IsolatorTest);
-
-
-});

+ 7 - 0
local.amd.json

@@ -0,0 +1,7 @@
+{
+    "paths": {
+        "trapped": "src",
+        "trapped-todo": "example-todo/src",
+        "trapped-counter": "example-counter/src"
+    }
+}

+ 0 - 29
meta/devel.html

@@ -1,29 +0,0 @@
-<html>
-<head>
-    <title>{{name}}</title>
-    <script src="../bower_components/amber/support/amber.js"></script>
-    <script type='text/javascript' src='../bower_components/amber/support/requirejs/require.min.js'></script>
-</head>
-<body>
-<script type="text/javascript">
-    require.config({
-        paths: {
-            'gh_herby_trapped': '../js',
-            'gh_herby_trapped/_source': '../st'
-        }
-    });
-    require(
-            ["amber/devel",
-                "gh_herby_trapped/Trapped-Backend", "gh_herby_trapped/Trapped-Processors", "gh_herby_trapped/Trapped-Tests" ],
-            function (smalltalk) {
-                smalltalk.defaultAmdNamespace = 'gh_herby_trapped';
-                smalltalk.initialize();
-
-                smalltalk.Browser._openOn_(smalltalk.IsolatorTest);
-            }
-    );
-</script>
-<div>
-</div>
-</body>
-</html>

+ 42 - 0
package.json

@@ -0,0 +1,42 @@
+{
+  "name": "trapped",
+  "title": "Trapped",
+  "description": "Bidirectional DOM data-binding for Amber Smalltalk",
+  "version": "0.4.0",
+  "homepage": "https://github.com/herby/trapped",
+  "author": {
+    "name": "Herbert Vojčík",
+    "email": "herby@mailbox.sk"
+  },
+  "repository": {
+    "type": "git",
+    "url": "git://github.com/herby/trapped.git"
+  },
+  "bugs": {
+    "url": "https://github.com/herby/trapped/issues"
+  },
+  "licenses": [
+    {
+      "type": "MIT",
+      "url": "https://github.com/herby/trapped/blob/master/LICENSE-MIT"
+    }
+  ],
+  "engines": {
+    "node": ">= 0.8.0"
+  },
+  "scripts": {
+    "test": "grunt test"
+  },
+  "devDependencies": {
+    "amber-dev": "^0.3.0",
+    "grunt": "^0.4.5",
+    "grunt-contrib-clean": "^0.6.0",
+    "grunt-contrib-requirejs": "^0.4.4",
+    "grunt-execute": "^0.2.2",
+    "requirejs": "^2.1.15"
+  },
+  "keywords": [
+    "Amber",
+    "Smalltalk"
+  ]
+}

+ 1500 - 0
src/Trapped-Backend.js

@@ -0,0 +1,1500 @@
+define("trapped/Trapped-Backend", ["amber/boot", "amber_core/Kernel-Objects", "amber_core/Kernel-Exceptions", "amber_core/Kernel-Collections"], function($boot){
+var $core=$boot.api,nil=$boot.nil,$recv=$boot.asReceiver,$globals=$boot.globals;
+$core.addPackage('Trapped-Backend');
+$core.packages["Trapped-Backend"].innerEval = function (expr) { return eval(expr); };
+$core.packages["Trapped-Backend"].transport = {"type":"amd","amdNamespace":"trapped"};
+
+$core.addClass('EavModel', $globals.Object, ['getBlock', 'putBlock'], 'Trapped-Backend');
+//>>excludeStart("ide", pragmas.excludeIdeData);
+$globals.EavModel.comment="External actor value model.";
+//>>excludeEnd("ide");
+$core.addMethod(
+$core.method({
+selector: "getBlock:",
+protocol: 'accessing',
+fn: function (aBlock){
+var self=this;
+self["@getBlock"]=aBlock;
+return self;
+
+},
+//>>excludeStart("ide", pragmas.excludeIdeData);
+args: ["aBlock"],
+source: "getBlock: aBlock\x0a\x0agetBlock := aBlock",
+referencedClasses: [],
+//>>excludeEnd("ide");
+messageSends: []
+}),
+$globals.EavModel);
+
+$core.addMethod(
+$core.method({
+selector: "initialize",
+protocol: 'initialization',
+fn: function (){
+var self=this;
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+return $core.withContext(function($ctx1) {
+//>>excludeEnd("ctx");
+(
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+$ctx1.supercall = true, 
+//>>excludeEnd("ctx");
+$globals.EavModel.superclass.fn.prototype._initialize.apply($recv(self), []));
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+$ctx1.supercall = false;
+//>>excludeEnd("ctx");;
+self["@getBlock"]=(function(){
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+return $core.withContext(function($ctx2) {
+//>>excludeEnd("ctx");
+return self._error_("No getter block.");
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+$ctx2.sendIdx["error:"]=1;
+//>>excludeEnd("ctx");
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+}, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
+//>>excludeEnd("ctx");
+});
+self["@putBlock"]=(function(){
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+return $core.withContext(function($ctx2) {
+//>>excludeEnd("ctx");
+return self._error_("No putter block.");
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+}, function($ctx2) {$ctx2.fillBlock({},$ctx1,2)});
+//>>excludeEnd("ctx");
+});
+return self;
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+}, function($ctx1) {$ctx1.fill(self,"initialize",{},$globals.EavModel)});
+//>>excludeEnd("ctx");
+},
+//>>excludeStart("ide", pragmas.excludeIdeData);
+args: [],
+source: "initialize\x0a\x09super initialize.\x0a\x09getBlock := [ self error: 'No getter block.' ].\x0a\x09putBlock := [ self error: 'No putter block.' ].",
+referencedClasses: [],
+//>>excludeEnd("ide");
+messageSends: ["initialize", "error:"]
+}),
+$globals.EavModel);
+
+$core.addMethod(
+$core.method({
+selector: "on:",
+protocol: 'accessing',
+fn: function (anObject){
+var self=this;
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+return $core.withContext(function($ctx1) {
+//>>excludeEnd("ctx");
+var $1;
+$1=$recv(self["@getBlock"])._value_(anObject);
+return $1;
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+}, function($ctx1) {$ctx1.fill(self,"on:",{anObject:anObject},$globals.EavModel)});
+//>>excludeEnd("ctx");
+},
+//>>excludeStart("ide", pragmas.excludeIdeData);
+args: ["anObject"],
+source: "on: anObject\x0a\x22Returns value of model applied on object\x22\x0a\x0a^getBlock value: anObject",
+referencedClasses: [],
+//>>excludeEnd("ide");
+messageSends: ["value:"]
+}),
+$globals.EavModel);
+
+$core.addMethod(
+$core.method({
+selector: "on:put:",
+protocol: 'accessing',
+fn: function (anObject,anObject2){
+var self=this;
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+return $core.withContext(function($ctx1) {
+//>>excludeEnd("ctx");
+var $1;
+$1=$recv(self["@putBlock"])._value_value_(anObject,anObject2);
+return $1;
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+}, function($ctx1) {$ctx1.fill(self,"on:put:",{anObject:anObject,anObject2:anObject2},$globals.EavModel)});
+//>>excludeEnd("ctx");
+},
+//>>excludeStart("ide", pragmas.excludeIdeData);
+args: ["anObject", "anObject2"],
+source: "on: anObject put: anObject2\x0a\x22Puts a value via model applied on object\x22\x0a\x0a^putBlock value: anObject value: anObject2",
+referencedClasses: [],
+//>>excludeEnd("ide");
+messageSends: ["value:value:"]
+}),
+$globals.EavModel);
+
+$core.addMethod(
+$core.method({
+selector: "putBlock:",
+protocol: 'accessing',
+fn: function (aBlock){
+var self=this;
+self["@putBlock"]=aBlock;
+return self;
+
+},
+//>>excludeStart("ide", pragmas.excludeIdeData);
+args: ["aBlock"],
+source: "putBlock: aBlock\x0a\x0aputBlock := aBlock",
+referencedClasses: [],
+//>>excludeEnd("ide");
+messageSends: []
+}),
+$globals.EavModel);
+
+
+
+$core.addClass('Isolator', $globals.Object, ['root'], 'Trapped-Backend');
+$core.addMethod(
+$core.method({
+selector: "model:modify:",
+protocol: 'action',
+fn: function (anEavModel,aBlock){
+var self=this;
+var newValue;
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+return $core.withContext(function($ctx1) {
+//>>excludeEnd("ctx");
+newValue=$recv(aBlock)._value_($recv(anEavModel)._on_(self));
+$recv(anEavModel)._on_put_(self,$recv(newValue)._deepCopy());
+return self;
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+}, function($ctx1) {$ctx1.fill(self,"model:modify:",{anEavModel:anEavModel,aBlock:aBlock,newValue:newValue},$globals.Isolator)});
+//>>excludeEnd("ctx");
+},
+//>>excludeStart("ide", pragmas.excludeIdeData);
+args: ["anEavModel", "aBlock"],
+source: "model: anEavModel modify: aBlock\x0a\x0a| newValue |\x0anewValue := aBlock value: (anEavModel on: self).\x0aanEavModel on: self put: newValue deepCopy",
+referencedClasses: [],
+//>>excludeEnd("ide");
+messageSends: ["value:", "on:", "on:put:", "deepCopy"]
+}),
+$globals.Isolator);
+
+$core.addMethod(
+$core.method({
+selector: "model:read:",
+protocol: 'action',
+fn: function (anEavModel,aBlock){
+var self=this;
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+return $core.withContext(function($ctx1) {
+//>>excludeEnd("ctx");
+$recv(aBlock)._value_($recv($recv(anEavModel)._on_(self))._deepCopy());
+return self;
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+}, function($ctx1) {$ctx1.fill(self,"model:read:",{anEavModel:anEavModel,aBlock:aBlock},$globals.Isolator)});
+//>>excludeEnd("ctx");
+},
+//>>excludeStart("ide", pragmas.excludeIdeData);
+args: ["anEavModel", "aBlock"],
+source: "model: anEavModel read: aBlock\x0a\x0aaBlock value: (anEavModel on: self) deepCopy",
+referencedClasses: [],
+//>>excludeEnd("ide");
+messageSends: ["value:", "deepCopy", "on:"]
+}),
+$globals.Isolator);
+
+$core.addMethod(
+$core.method({
+selector: "root",
+protocol: 'accessing',
+fn: function (){
+var self=this;
+var $1;
+$1=self["@root"];
+return $1;
+
+},
+//>>excludeStart("ide", pragmas.excludeIdeData);
+args: [],
+source: "root\x0a\x0a^root",
+referencedClasses: [],
+//>>excludeEnd("ide");
+messageSends: []
+}),
+$globals.Isolator);
+
+$core.addMethod(
+$core.method({
+selector: "root:",
+protocol: 'accessing',
+fn: function (anObject){
+var self=this;
+self["@root"]=anObject;
+return self;
+
+},
+//>>excludeStart("ide", pragmas.excludeIdeData);
+args: ["anObject"],
+source: "root: anObject\x0a\x0aroot := anObject",
+referencedClasses: [],
+//>>excludeEnd("ide");
+messageSends: []
+}),
+$globals.Isolator);
+
+
+$core.addMethod(
+$core.method({
+selector: "on:",
+protocol: 'instance creation',
+fn: function (anObject){
+var self=this;
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+return $core.withContext(function($ctx1) {
+//>>excludeEnd("ctx");
+var $1;
+$1=$recv(self._new())._root_(anObject);
+return $1;
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+}, function($ctx1) {$ctx1.fill(self,"on:",{anObject:anObject},$globals.Isolator.klass)});
+//>>excludeEnd("ctx");
+},
+//>>excludeStart("ide", pragmas.excludeIdeData);
+args: ["anObject"],
+source: "on: anObject\x0a^self new root: anObject",
+referencedClasses: [],
+//>>excludeEnd("ide");
+messageSends: ["root:", "new"]
+}),
+$globals.Isolator.klass);
+
+
+$core.addClass('KeyedPubSubBase', $globals.Object, ['factory'], 'Trapped-Backend');
+//>>excludeStart("ide", pragmas.excludeIdeData);
+$globals.KeyedPubSubBase.comment="I represent a pub-sub based on a key.\x0aI manage key-block subscriptions as well as running blocks that are dirty.\x0aThe subscription objects are reponsible of decision if the change is relevant for them.\x0aSubscription object must be subclasses of KeyedSubscriptionBase.\x0a\x0aMy subclasses must provide implementation for:\x0a\x09add:\x0a    do:\x0a    clean\x0a    (optionally) run\x0a\x0aand issue this call before actual use:\x0a\x09subscritionFactory: (setting [:key:block|...] factory that creates appropriate subscription)";
+//>>excludeEnd("ide");
+$core.addMethod(
+$core.method({
+selector: "changed:",
+protocol: 'action',
+fn: function (key){
+var self=this;
+var needsToRun;
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+return $core.withContext(function($ctx1) {
+//>>excludeEnd("ctx");
+var $1;
+needsToRun=false;
+self._do_((function(each){
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+return $core.withContext(function($ctx2) {
+//>>excludeEnd("ctx");
+$1=$recv(each)._accepts_(key);
+if($core.assert($1)){
+$recv(each)._flag();
+needsToRun=true;
+return needsToRun;
+};
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+}, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,1)});
+//>>excludeEnd("ctx");
+}));
+self._dirty_(needsToRun);
+return self;
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+}, function($ctx1) {$ctx1.fill(self,"changed:",{key:key,needsToRun:needsToRun},$globals.KeyedPubSubBase)});
+//>>excludeEnd("ctx");
+},
+//>>excludeStart("ide", pragmas.excludeIdeData);
+args: ["key"],
+source: "changed: key\x0a\x09| needsToRun |\x0a    needsToRun := false.\x0a\x09self do: [ :each |\x0a\x09\x09(each accepts: key) ifTrue: [\x0a\x09\x09\x09each flag.\x0a            needsToRun := true.\x0a\x09\x09]\x0a\x09].\x0a\x09self dirty: needsToRun",
+referencedClasses: [],
+//>>excludeEnd("ide");
+messageSends: ["do:", "ifTrue:", "accepts:", "flag", "dirty:"]
+}),
+$globals.KeyedPubSubBase);
+
+$core.addMethod(
+$core.method({
+selector: "dirty:",
+protocol: 'action',
+fn: function (aBoolean){
+var self=this;
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+return $core.withContext(function($ctx1) {
+//>>excludeEnd("ctx");
+if($core.assert(aBoolean)){
+$recv((function(){
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+return $core.withContext(function($ctx2) {
+//>>excludeEnd("ctx");
+return self._run();
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+}, function($ctx2) {$ctx2.fillBlock({},$ctx1,2)});
+//>>excludeEnd("ctx");
+}))._fork();
+};
+return self;
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+}, function($ctx1) {$ctx1.fill(self,"dirty:",{aBoolean:aBoolean},$globals.KeyedPubSubBase)});
+//>>excludeEnd("ctx");
+},
+//>>excludeStart("ide", pragmas.excludeIdeData);
+args: ["aBoolean"],
+source: "dirty: aBoolean\x0a\x09aBoolean ifTrue: [[ self run ] fork]",
+referencedClasses: [],
+//>>excludeEnd("ide");
+messageSends: ["ifTrue:", "fork", "run"]
+}),
+$globals.KeyedPubSubBase);
+
+$core.addMethod(
+$core.method({
+selector: "on:hook:",
+protocol: 'action',
+fn: function (key,aBlock){
+var self=this;
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+return $core.withContext(function($ctx1) {
+//>>excludeEnd("ctx");
+self._add_($recv($recv(self["@factory"])._value_value_(key,aBlock))._flag());
+self._dirty_(true);
+return self;
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+}, function($ctx1) {$ctx1.fill(self,"on:hook:",{key:key,aBlock:aBlock},$globals.KeyedPubSubBase)});
+//>>excludeEnd("ctx");
+},
+//>>excludeStart("ide", pragmas.excludeIdeData);
+args: ["key", "aBlock"],
+source: "on: key hook: aBlock\x0a\x09self add: (factory value: key value: aBlock) flag.\x0a   \x09self dirty: true",
+referencedClasses: [],
+//>>excludeEnd("ide");
+messageSends: ["add:", "flag", "value:value:", "dirty:"]
+}),
+$globals.KeyedPubSubBase);
+
+$core.addMethod(
+$core.method({
+selector: "run",
+protocol: 'action',
+fn: function (){
+var self=this;
+function $Error(){return $globals.Error||(typeof Error=="undefined"?nil:Error)}
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+return $core.withContext(function($ctx1) {
+//>>excludeEnd("ctx");
+var $1,$2,$3;
+$recv((function(){
+var needsClean;
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+return $core.withContext(function($ctx2) {
+//>>excludeEnd("ctx");
+needsClean=false;
+needsClean;
+self._do_((function(each){
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+return $core.withContext(function($ctx3) {
+//>>excludeEnd("ctx");
+$1=$recv(each)._isFlagged();
+if($core.assert($1)){
+$recv(each)._run();
+};
+$2=$recv(each)._isEnabled();
+if(!$core.assert($2)){
+needsClean=true;
+return needsClean;
+};
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+}, function($ctx3) {$ctx3.fillBlock({each:each},$ctx2,2)});
+//>>excludeEnd("ctx");
+}));
+$3=needsClean;
+if($core.assert($3)){
+return self._clean();
+};
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+}, function($ctx2) {$ctx2.fillBlock({needsClean:needsClean},$ctx1,1)});
+//>>excludeEnd("ctx");
+}))._on_do_($Error(),(function(){
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+return $core.withContext(function($ctx2) {
+//>>excludeEnd("ctx");
+return self._dirty_(true);
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+}, function($ctx2) {$ctx2.fillBlock({},$ctx1,6)});
+//>>excludeEnd("ctx");
+}));
+return self;
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+}, function($ctx1) {$ctx1.fill(self,"run",{},$globals.KeyedPubSubBase)});
+//>>excludeEnd("ctx");
+},
+//>>excludeStart("ide", pragmas.excludeIdeData);
+args: [],
+source: "run\x0a\x09[\x0a\x09\x09| needsClean |\x0a\x09    needsClean := false.\x0a\x09\x09self do: [ :each |\x0a\x09\x09\x09each isFlagged ifTrue: [ each run ].\x0a\x09        each isEnabled ifFalse: [ needsClean := true ]\x0a\x09\x09].\x0a    \x09needsClean ifTrue: [ self clean ]\x0a\x09] on: Error do: [ self dirty: true ]",
+referencedClasses: ["Error"],
+//>>excludeEnd("ide");
+messageSends: ["on:do:", "do:", "ifTrue:", "isFlagged", "run", "ifFalse:", "isEnabled", "clean", "dirty:"]
+}),
+$globals.KeyedPubSubBase);
+
+$core.addMethod(
+$core.method({
+selector: "subscriptionFactory:",
+protocol: 'action',
+fn: function (aBlock){
+var self=this;
+self["@factory"]=aBlock;
+return self;
+
+},
+//>>excludeStart("ide", pragmas.excludeIdeData);
+args: ["aBlock"],
+source: "subscriptionFactory: aBlock\x0a    factory := aBlock",
+referencedClasses: [],
+//>>excludeEnd("ide");
+messageSends: []
+}),
+$globals.KeyedPubSubBase);
+
+
+
+$core.addClass('SimpleKeyedPubSub', $globals.KeyedPubSubBase, ['queue'], 'Trapped-Backend');
+$core.addMethod(
+$core.method({
+selector: "add:",
+protocol: 'accessing',
+fn: function (aSubscription){
+var self=this;
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+return $core.withContext(function($ctx1) {
+//>>excludeEnd("ctx");
+$recv(self["@queue"])._add_(aSubscription);
+return self;
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+}, function($ctx1) {$ctx1.fill(self,"add:",{aSubscription:aSubscription},$globals.SimpleKeyedPubSub)});
+//>>excludeEnd("ctx");
+},
+//>>excludeStart("ide", pragmas.excludeIdeData);
+args: ["aSubscription"],
+source: "add: aSubscription\x0a\x09queue add: aSubscription.",
+referencedClasses: [],
+//>>excludeEnd("ide");
+messageSends: ["add:"]
+}),
+$globals.SimpleKeyedPubSub);
+
+$core.addMethod(
+$core.method({
+selector: "clean",
+protocol: 'bookkeeping',
+fn: function (){
+var self=this;
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+return $core.withContext(function($ctx1) {
+//>>excludeEnd("ctx");
+self["@queue"]=$recv(self["@queue"])._select_((function(each){
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+return $core.withContext(function($ctx2) {
+//>>excludeEnd("ctx");
+return $recv(each)._isEnabled();
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+}, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,1)});
+//>>excludeEnd("ctx");
+}));
+return self;
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+}, function($ctx1) {$ctx1.fill(self,"clean",{},$globals.SimpleKeyedPubSub)});
+//>>excludeEnd("ctx");
+},
+//>>excludeStart("ide", pragmas.excludeIdeData);
+args: [],
+source: "clean\x0a\x09queue := queue select: [ :each | each isEnabled ]",
+referencedClasses: [],
+//>>excludeEnd("ide");
+messageSends: ["select:", "isEnabled"]
+}),
+$globals.SimpleKeyedPubSub);
+
+$core.addMethod(
+$core.method({
+selector: "do:",
+protocol: 'enumeration',
+fn: function (aBlock){
+var self=this;
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+return $core.withContext(function($ctx1) {
+//>>excludeEnd("ctx");
+$recv(self["@queue"])._do_(aBlock);
+return self;
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+}, function($ctx1) {$ctx1.fill(self,"do:",{aBlock:aBlock},$globals.SimpleKeyedPubSub)});
+//>>excludeEnd("ctx");
+},
+//>>excludeStart("ide", pragmas.excludeIdeData);
+args: ["aBlock"],
+source: "do: aBlock\x0a\x09queue do: aBlock",
+referencedClasses: [],
+//>>excludeEnd("ide");
+messageSends: ["do:"]
+}),
+$globals.SimpleKeyedPubSub);
+
+$core.addMethod(
+$core.method({
+selector: "initialize",
+protocol: 'initialization',
+fn: function (){
+var self=this;
+function $OrderedCollection(){return $globals.OrderedCollection||(typeof OrderedCollection=="undefined"?nil:OrderedCollection)}
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+return $core.withContext(function($ctx1) {
+//>>excludeEnd("ctx");
+(
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+$ctx1.supercall = true, 
+//>>excludeEnd("ctx");
+$globals.SimpleKeyedPubSub.superclass.fn.prototype._initialize.apply($recv(self), []));
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+$ctx1.supercall = false;
+//>>excludeEnd("ctx");;
+self["@queue"]=$recv($OrderedCollection())._new();
+return self;
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+}, function($ctx1) {$ctx1.fill(self,"initialize",{},$globals.SimpleKeyedPubSub)});
+//>>excludeEnd("ctx");
+},
+//>>excludeStart("ide", pragmas.excludeIdeData);
+args: [],
+source: "initialize\x0a    super initialize.\x0a\x09queue := OrderedCollection new",
+referencedClasses: ["OrderedCollection"],
+//>>excludeEnd("ide");
+messageSends: ["initialize", "new"]
+}),
+$globals.SimpleKeyedPubSub);
+
+
+
+$core.addClass('KeyedPubSubUnsubscribe', $globals.Error, [], 'Trapped-Backend');
+//>>excludeStart("ide", pragmas.excludeIdeData);
+$globals.KeyedPubSubUnsubscribe.comment="SIgnal me from the subscription block to unsubscribe it.";
+//>>excludeEnd("ide");
+
+
+$core.addClass('KeyedSubscriptionBase', $globals.Object, ['key', 'actionBlock', 'flagged'], 'Trapped-Backend');
+$core.addMethod(
+$core.method({
+selector: "accepts:",
+protocol: 'testing',
+fn: function (aKey){
+var self=this;
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+return $core.withContext(function($ctx1) {
+//>>excludeEnd("ctx");
+self._subclassResponsibility();
+return self;
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+}, function($ctx1) {$ctx1.fill(self,"accepts:",{aKey:aKey},$globals.KeyedSubscriptionBase)});
+//>>excludeEnd("ctx");
+},
+//>>excludeStart("ide", pragmas.excludeIdeData);
+args: ["aKey"],
+source: "accepts: aKey\x0a    \x22Should return true if change for aKey is relevant for this subscription\x22\x0a    self subclassResponsibility",
+referencedClasses: [],
+//>>excludeEnd("ide");
+messageSends: ["subclassResponsibility"]
+}),
+$globals.KeyedSubscriptionBase);
+
+$core.addMethod(
+$core.method({
+selector: "flag",
+protocol: 'accessing',
+fn: function (){
+var self=this;
+self["@flagged"]=true;
+return self;
+
+},
+//>>excludeStart("ide", pragmas.excludeIdeData);
+args: [],
+source: "flag\x0a\x09flagged := true",
+referencedClasses: [],
+//>>excludeEnd("ide");
+messageSends: []
+}),
+$globals.KeyedSubscriptionBase);
+
+$core.addMethod(
+$core.method({
+selector: "initialize",
+protocol: 'initialization',
+fn: function (){
+var self=this;
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+return $core.withContext(function($ctx1) {
+//>>excludeEnd("ctx");
+(
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+$ctx1.supercall = true, 
+//>>excludeEnd("ctx");
+$globals.KeyedSubscriptionBase.superclass.fn.prototype._initialize.apply($recv(self), []));
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+$ctx1.supercall = false;
+//>>excludeEnd("ctx");;
+self["@key"]=nil;
+self["@actionBlock"]=nil;
+self["@flagged"]=false;
+return self;
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+}, function($ctx1) {$ctx1.fill(self,"initialize",{},$globals.KeyedSubscriptionBase)});
+//>>excludeEnd("ctx");
+},
+//>>excludeStart("ide", pragmas.excludeIdeData);
+args: [],
+source: "initialize\x0a\x09super initialize.\x0a    key := nil.\x0a    actionBlock := nil.\x0a    flagged := false.",
+referencedClasses: [],
+//>>excludeEnd("ide");
+messageSends: ["initialize"]
+}),
+$globals.KeyedSubscriptionBase);
+
+$core.addMethod(
+$core.method({
+selector: "isEnabled",
+protocol: 'testing',
+fn: function (){
+var self=this;
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+return $core.withContext(function($ctx1) {
+//>>excludeEnd("ctx");
+var $1;
+$1=$recv(self["@actionBlock"])._notNil();
+return $1;
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+}, function($ctx1) {$ctx1.fill(self,"isEnabled",{},$globals.KeyedSubscriptionBase)});
+//>>excludeEnd("ctx");
+},
+//>>excludeStart("ide", pragmas.excludeIdeData);
+args: [],
+source: "isEnabled\x0a\x09^actionBlock notNil",
+referencedClasses: [],
+//>>excludeEnd("ide");
+messageSends: ["notNil"]
+}),
+$globals.KeyedSubscriptionBase);
+
+$core.addMethod(
+$core.method({
+selector: "isFlagged",
+protocol: 'testing',
+fn: function (){
+var self=this;
+var $1;
+$1=self["@flagged"];
+return $1;
+
+},
+//>>excludeStart("ide", pragmas.excludeIdeData);
+args: [],
+source: "isFlagged\x0a\x09^flagged",
+referencedClasses: [],
+//>>excludeEnd("ide");
+messageSends: []
+}),
+$globals.KeyedSubscriptionBase);
+
+$core.addMethod(
+$core.method({
+selector: "key:block:",
+protocol: 'accessing',
+fn: function (anObject,aBlock){
+var self=this;
+self["@key"]=anObject;
+self["@actionBlock"]=aBlock;
+return self;
+
+},
+//>>excludeStart("ide", pragmas.excludeIdeData);
+args: ["anObject", "aBlock"],
+source: "key: anObject block: aBlock\x0a\x09key := anObject.\x0a    actionBlock := aBlock",
+referencedClasses: [],
+//>>excludeEnd("ide");
+messageSends: []
+}),
+$globals.KeyedSubscriptionBase);
+
+$core.addMethod(
+$core.method({
+selector: "run",
+protocol: 'action',
+fn: function (){
+var self=this;
+function $KeyedPubSubUnsubscribe(){return $globals.KeyedPubSubUnsubscribe||(typeof KeyedPubSubUnsubscribe=="undefined"?nil:KeyedPubSubUnsubscribe)}
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+return $core.withContext(function($ctx1) {
+//>>excludeEnd("ctx");
+$recv((function(){
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+return $core.withContext(function($ctx2) {
+//>>excludeEnd("ctx");
+self["@flagged"]=false;
+self["@flagged"];
+return $recv(self["@actionBlock"])._value();
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+}, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
+//>>excludeEnd("ctx");
+}))._on_do_($KeyedPubSubUnsubscribe(),(function(){
+self["@actionBlock"]=nil;
+return self["@actionBlock"];
+
+}));
+return self;
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+}, function($ctx1) {$ctx1.fill(self,"run",{},$globals.KeyedSubscriptionBase)});
+//>>excludeEnd("ctx");
+},
+//>>excludeStart("ide", pragmas.excludeIdeData);
+args: [],
+source: "run\x0a\x09[ flagged := false. actionBlock value ]\x0a    on: KeyedPubSubUnsubscribe do: [ actionBlock := nil ]",
+referencedClasses: ["KeyedPubSubUnsubscribe"],
+//>>excludeEnd("ide");
+messageSends: ["on:do:", "value"]
+}),
+$globals.KeyedSubscriptionBase);
+
+
+
+$core.addClass('ListKeyedSubscription', $globals.KeyedSubscriptionBase, [], 'Trapped-Backend');
+$core.addMethod(
+$core.method({
+selector: "accepts:",
+protocol: 'testing',
+fn: function (aKey){
+var self=this;
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+return $core.withContext(function($ctx1) {
+//>>excludeEnd("ctx");
+var $3,$4,$2,$1;
+$3=$recv(aKey)._size();
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+$ctx1.sendIdx["size"]=1;
+//>>excludeEnd("ctx");
+$4=$recv(self["@key"])._size();
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+$ctx1.sendIdx["size"]=2;
+//>>excludeEnd("ctx");
+$2=$recv($3).__lt_eq($4);
+$1=$recv($2)._and_((function(){
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+return $core.withContext(function($ctx2) {
+//>>excludeEnd("ctx");
+return $recv(aKey).__eq($recv(self["@key"])._copyFrom_to_((1),$recv(aKey)._size()));
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+}, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
+//>>excludeEnd("ctx");
+}));
+return $1;
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+}, function($ctx1) {$ctx1.fill(self,"accepts:",{aKey:aKey},$globals.ListKeyedSubscription)});
+//>>excludeEnd("ctx");
+},
+//>>excludeStart("ide", pragmas.excludeIdeData);
+args: ["aKey"],
+source: "accepts: aKey\x0a    ^aKey size <= key size and: [aKey = (key copyFrom: 1 to: aKey size)]",
+referencedClasses: [],
+//>>excludeEnd("ide");
+messageSends: ["and:", "<=", "size", "=", "copyFrom:to:"]
+}),
+$globals.ListKeyedSubscription);
+
+
+
+$core.addClass('TwoWayListKeyedSubscription', $globals.KeyedSubscriptionBase, [], 'Trapped-Backend');
+$core.addMethod(
+$core.method({
+selector: "accepts:",
+protocol: 'testing',
+fn: function (aKey){
+var self=this;
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+return $core.withContext(function($ctx1) {
+//>>excludeEnd("ctx");
+var $3,$4,$2,$6,$7,$5,$1;
+$3=$recv(aKey)._size();
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+$ctx1.sendIdx["size"]=1;
+//>>excludeEnd("ctx");
+$4=$recv(self["@key"])._size();
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+$ctx1.sendIdx["size"]=2;
+//>>excludeEnd("ctx");
+$2=$recv($3).__lt_eq($4);
+if($core.assert($2)){
+$6=self["@key"];
+$7=$recv(aKey)._size();
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+$ctx1.sendIdx["size"]=3;
+//>>excludeEnd("ctx");
+$5=$recv($6)._copyFrom_to_((1),$7);
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+$ctx1.sendIdx["copyFrom:to:"]=1;
+//>>excludeEnd("ctx");
+$1=$recv(aKey).__eq($5);
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+$ctx1.sendIdx["="]=1;
+//>>excludeEnd("ctx");
+} else {
+$1=$recv(self["@key"]).__eq($recv(aKey)._copyFrom_to_((1),$recv(self["@key"])._size()));
+};
+return $1;
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+}, function($ctx1) {$ctx1.fill(self,"accepts:",{aKey:aKey},$globals.TwoWayListKeyedSubscription)});
+//>>excludeEnd("ctx");
+},
+//>>excludeStart("ide", pragmas.excludeIdeData);
+args: ["aKey"],
+source: "accepts: aKey\x0a    ^aKey size <= key size\x0a\x09\x09ifTrue: [aKey = (key copyFrom: 1 to: aKey size)]\x0a\x09\x09ifFalse: [key = (aKey copyFrom: 1 to: key size)]",
+referencedClasses: [],
+//>>excludeEnd("ide");
+messageSends: ["ifTrue:ifFalse:", "<=", "size", "=", "copyFrom:to:"]
+}),
+$globals.TwoWayListKeyedSubscription);
+
+
+
+$core.addClass('ListKeyedEntity', $globals.Object, ['dispatcher', 'payload'], 'Trapped-Backend');
+//>>excludeStart("ide", pragmas.excludeIdeData);
+$globals.ListKeyedEntity.comment="I am base class for #('string-at-index' #selector numeric-at-index)-array-path-keyed entities,\x0athat moderate access to the wrapped model object via read;do and modify:do:\x0aand allow pub-sub via watch:do:.\x0aThis wrapped model can be any smalltalk object.\x0a\x0aMy subclasses need to provide implementation for:\x0a\x09read:do:\x0a    modify:do:\x0a\x0aand must issue these calls when initializing:\x0a\x09model: (with a wrapped object)\x0a\x09dispatcher: (with a subclass of KeyedPubSubBase)";
+//>>excludeEnd("ide");
+$core.addMethod(
+$core.method({
+selector: "dispatcher",
+protocol: 'accessing',
+fn: function (){
+var self=this;
+var $1;
+$1=self["@dispatcher"];
+return $1;
+
+},
+//>>excludeStart("ide", pragmas.excludeIdeData);
+args: [],
+source: "dispatcher\x0a\x09^dispatcher",
+referencedClasses: [],
+//>>excludeEnd("ide");
+messageSends: []
+}),
+$globals.ListKeyedEntity);
+
+$core.addMethod(
+$core.method({
+selector: "dispatcher:",
+protocol: 'accessing',
+fn: function (aDispatcher){
+var self=this;
+function $TwoWayListKeyedSubscription(){return $globals.TwoWayListKeyedSubscription||(typeof TwoWayListKeyedSubscription=="undefined"?nil:TwoWayListKeyedSubscription)}
+function $ListKeyedSubscription(){return $globals.ListKeyedSubscription||(typeof ListKeyedSubscription=="undefined"?nil:ListKeyedSubscription)}
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+return $core.withContext(function($ctx1) {
+//>>excludeEnd("ctx");
+var $1,$2,$3,$4,$5,$6;
+$recv(aDispatcher)._subscriptionFactory_((function(key,block){
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+return $core.withContext(function($ctx2) {
+//>>excludeEnd("ctx");
+$1=$recv($recv(key)._notEmpty())._and_((function(){
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+return $core.withContext(function($ctx3) {
+//>>excludeEnd("ctx");
+return $recv($recv(key)._last())._isNil();
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+}, function($ctx3) {$ctx3.fillBlock({},$ctx2,2)});
+//>>excludeEnd("ctx");
+}));
+if($core.assert($1)){
+$2=$recv($TwoWayListKeyedSubscription())._new();
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+$ctx2.sendIdx["new"]=1;
+//>>excludeEnd("ctx");
+$recv($2)._key_block_($recv(key)._allButLast(),block);
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+$ctx2.sendIdx["key:block:"]=1;
+//>>excludeEnd("ctx");
+$3=$recv($2)._yourself();
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+$ctx2.sendIdx["yourself"]=1;
+//>>excludeEnd("ctx");
+return $3;
+} else {
+$4=$recv($ListKeyedSubscription())._new();
+$recv($4)._key_block_(key,block);
+$5=$recv($4)._yourself();
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+$ctx2.sendIdx["yourself"]=2;
+//>>excludeEnd("ctx");
+return $5;
+};
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+}, function($ctx2) {$ctx2.fillBlock({key:key,block:block},$ctx1,1)});
+//>>excludeEnd("ctx");
+}));
+$6=$recv(aDispatcher)._yourself();
+self["@dispatcher"]=$6;
+return self;
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+}, function($ctx1) {$ctx1.fill(self,"dispatcher:",{aDispatcher:aDispatcher},$globals.ListKeyedEntity)});
+//>>excludeEnd("ctx");
+},
+//>>excludeStart("ide", pragmas.excludeIdeData);
+args: ["aDispatcher"],
+source: "dispatcher: aDispatcher\x0a\x09dispatcher := aDispatcher\x0a        subscriptionFactory: [ :key :block |\x0a\x09\x09\x09(key notEmpty and: [ key last isNil ])\x0a\x09\x09\x09\x09ifTrue: [ TwoWayListKeyedSubscription new key: key allButLast block: block; yourself ]\x0a\x09\x09\x09\x09ifFalse: [ ListKeyedSubscription new key: key block: block; yourself ]];\x0a        yourself",
+referencedClasses: ["TwoWayListKeyedSubscription", "ListKeyedSubscription"],
+//>>excludeEnd("ide");
+messageSends: ["subscriptionFactory:", "ifTrue:ifFalse:", "and:", "notEmpty", "isNil", "last", "key:block:", "new", "allButLast", "yourself"]
+}),
+$globals.ListKeyedEntity);
+
+$core.addMethod(
+$core.method({
+selector: "model:",
+protocol: 'accessing',
+fn: function (anObject){
+var self=this;
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+return $core.withContext(function($ctx1) {
+//>>excludeEnd("ctx");
+self["@payload"]=anObject;
+$recv(self._dispatcher())._changed_([]);
+return self;
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+}, function($ctx1) {$ctx1.fill(self,"model:",{anObject:anObject},$globals.ListKeyedEntity)});
+//>>excludeEnd("ctx");
+},
+//>>excludeStart("ide", pragmas.excludeIdeData);
+args: ["anObject"],
+source: "model: anObject\x0a\x09payload := anObject.\x0a    self dispatcher changed: #()",
+referencedClasses: [],
+//>>excludeEnd("ide");
+messageSends: ["changed:", "dispatcher"]
+}),
+$globals.ListKeyedEntity);
+
+$core.addMethod(
+$core.method({
+selector: "watch:do:",
+protocol: 'action',
+fn: function (path,aBlock){
+var self=this;
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+return $core.withContext(function($ctx1) {
+//>>excludeEnd("ctx");
+$recv(self._dispatcher())._on_hook_(path,(function(){
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+return $core.withContext(function($ctx2) {
+//>>excludeEnd("ctx");
+return self._read_do_(path,aBlock);
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+}, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
+//>>excludeEnd("ctx");
+}));
+return self;
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+}, function($ctx1) {$ctx1.fill(self,"watch:do:",{path:path,aBlock:aBlock},$globals.ListKeyedEntity)});
+//>>excludeEnd("ctx");
+},
+//>>excludeStart("ide", pragmas.excludeIdeData);
+args: ["path", "aBlock"],
+source: "watch: path do: aBlock\x0a\x09self dispatcher on: path hook: [ self read: path do: aBlock ]",
+referencedClasses: [],
+//>>excludeEnd("ide");
+messageSends: ["on:hook:", "dispatcher", "read:do:"]
+}),
+$globals.ListKeyedEntity);
+
+
+
+$core.addClass('ListKeyedDirectEntity', $globals.ListKeyedEntity, [], 'Trapped-Backend');
+//>>excludeStart("ide", pragmas.excludeIdeData);
+$globals.ListKeyedDirectEntity.comment="I am ListKeyedEntity that directly manipulate\x0athe wrapped model object.";
+//>>excludeEnd("ide");
+$core.addMethod(
+$core.method({
+selector: "modify:do:",
+protocol: 'action',
+fn: function (path,aBlock){
+var self=this;
+var newValue,eavModel;
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+return $core.withContext(function($ctx1) {
+//>>excludeEnd("ctx");
+eavModel=$recv(path)._asEavModel();
+newValue=$recv(aBlock)._value_($recv(eavModel)._on_(self["@payload"]));
+$recv((function(){
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+return $core.withContext(function($ctx2) {
+//>>excludeEnd("ctx");
+return $recv(eavModel)._on_put_(self["@payload"],newValue);
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+}, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
+//>>excludeEnd("ctx");
+}))._ensure_((function(){
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+return $core.withContext(function($ctx2) {
+//>>excludeEnd("ctx");
+return $recv(self._dispatcher())._changed_(path);
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+}, function($ctx2) {$ctx2.fillBlock({},$ctx1,2)});
+//>>excludeEnd("ctx");
+}));
+return self;
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+}, function($ctx1) {$ctx1.fill(self,"modify:do:",{path:path,aBlock:aBlock,newValue:newValue,eavModel:eavModel},$globals.ListKeyedDirectEntity)});
+//>>excludeEnd("ctx");
+},
+//>>excludeStart("ide", pragmas.excludeIdeData);
+args: ["path", "aBlock"],
+source: "modify: path do: aBlock\x0a    | newValue eavModel |\x0a    eavModel := path asEavModel.\x0a    newValue := aBlock value: (eavModel on: payload).\x0a    [ eavModel on: payload put: newValue ] ensure: [ self dispatcher changed: path ]",
+referencedClasses: [],
+//>>excludeEnd("ide");
+messageSends: ["asEavModel", "value:", "on:", "ensure:", "on:put:", "changed:", "dispatcher"]
+}),
+$globals.ListKeyedDirectEntity);
+
+$core.addMethod(
+$core.method({
+selector: "read:do:",
+protocol: 'action',
+fn: function (path,aBlock){
+var self=this;
+var eavModel;
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+return $core.withContext(function($ctx1) {
+//>>excludeEnd("ctx");
+eavModel=$recv(path)._asEavModel();
+$recv(aBlock)._value_($recv(eavModel)._on_(self["@payload"]));
+return self;
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+}, function($ctx1) {$ctx1.fill(self,"read:do:",{path:path,aBlock:aBlock,eavModel:eavModel},$globals.ListKeyedDirectEntity)});
+//>>excludeEnd("ctx");
+},
+//>>excludeStart("ide", pragmas.excludeIdeData);
+args: ["path", "aBlock"],
+source: "read: path do: aBlock\x0a    | eavModel |\x0a    eavModel := path asEavModel.\x0a    aBlock value: (eavModel on: payload)",
+referencedClasses: [],
+//>>excludeEnd("ide");
+messageSends: ["asEavModel", "value:", "on:"]
+}),
+$globals.ListKeyedDirectEntity);
+
+
+
+$core.addClass('ListKeyedIsolatedEntity', $globals.ListKeyedEntity, [], 'Trapped-Backend');
+//>>excludeStart("ide", pragmas.excludeIdeData);
+$globals.ListKeyedIsolatedEntity.comment="I am ListKeyedEntity that guards access\x0ato the wrapped model object via Isolator.";
+//>>excludeEnd("ide");
+$core.addMethod(
+$core.method({
+selector: "model:",
+protocol: 'accessing',
+fn: function (anObject){
+var self=this;
+function $Isolator(){return $globals.Isolator||(typeof Isolator=="undefined"?nil:Isolator)}
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+return $core.withContext(function($ctx1) {
+//>>excludeEnd("ctx");
+(
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+$ctx1.supercall = true, 
+//>>excludeEnd("ctx");
+$globals.ListKeyedIsolatedEntity.superclass.fn.prototype._model_.apply($recv(self), [$recv($Isolator())._on_(anObject)]));
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+$ctx1.supercall = false;
+//>>excludeEnd("ctx");;
+return self;
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+}, function($ctx1) {$ctx1.fill(self,"model:",{anObject:anObject},$globals.ListKeyedIsolatedEntity)});
+//>>excludeEnd("ctx");
+},
+//>>excludeStart("ide", pragmas.excludeIdeData);
+args: ["anObject"],
+source: "model: anObject\x0a\x09super model: (Isolator on: anObject)",
+referencedClasses: ["Isolator"],
+//>>excludeEnd("ide");
+messageSends: ["model:", "on:"]
+}),
+$globals.ListKeyedIsolatedEntity);
+
+$core.addMethod(
+$core.method({
+selector: "modify:do:",
+protocol: 'action',
+fn: function (path,aBlock){
+var self=this;
+var eavModel;
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+return $core.withContext(function($ctx1) {
+//>>excludeEnd("ctx");
+eavModel=$recv($recv([["root"]]).__comma(path))._asEavModel();
+$recv((function(){
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+return $core.withContext(function($ctx2) {
+//>>excludeEnd("ctx");
+return $recv(self["@payload"])._model_modify_(eavModel,aBlock);
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+}, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
+//>>excludeEnd("ctx");
+}))._ensure_((function(){
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+return $core.withContext(function($ctx2) {
+//>>excludeEnd("ctx");
+return $recv(self._dispatcher())._changed_(path);
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+}, function($ctx2) {$ctx2.fillBlock({},$ctx1,2)});
+//>>excludeEnd("ctx");
+}));
+return self;
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+}, function($ctx1) {$ctx1.fill(self,"modify:do:",{path:path,aBlock:aBlock,eavModel:eavModel},$globals.ListKeyedIsolatedEntity)});
+//>>excludeEnd("ctx");
+},
+//>>excludeStart("ide", pragmas.excludeIdeData);
+args: ["path", "aBlock"],
+source: "modify: path do: aBlock\x0a    | eavModel |\x0a    eavModel := ({{#root}},path) asEavModel.\x0a    [ payload model: eavModel modify: aBlock ] ensure: [ self dispatcher changed: path ]",
+referencedClasses: [],
+//>>excludeEnd("ide");
+messageSends: ["asEavModel", ",", "ensure:", "model:modify:", "changed:", "dispatcher"]
+}),
+$globals.ListKeyedIsolatedEntity);
+
+$core.addMethod(
+$core.method({
+selector: "read:do:",
+protocol: 'action',
+fn: function (path,aBlock){
+var self=this;
+var eavModel;
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+return $core.withContext(function($ctx1) {
+//>>excludeEnd("ctx");
+eavModel=$recv($recv([["root"]]).__comma(path))._asEavModel();
+$recv(self["@payload"])._model_read_(eavModel,aBlock);
+return self;
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+}, function($ctx1) {$ctx1.fill(self,"read:do:",{path:path,aBlock:aBlock,eavModel:eavModel},$globals.ListKeyedIsolatedEntity)});
+//>>excludeEnd("ctx");
+},
+//>>excludeStart("ide", pragmas.excludeIdeData);
+args: ["path", "aBlock"],
+source: "read: path do: aBlock\x0a    | eavModel |\x0a    eavModel := ({{#root}},path) asEavModel.\x0a    payload model: eavModel read: aBlock",
+referencedClasses: [],
+//>>excludeEnd("ide");
+messageSends: ["asEavModel", ",", "model:read:"]
+}),
+$globals.ListKeyedIsolatedEntity);
+
+
+$core.addMethod(
+$core.method({
+selector: "asTrapAtPut:sendTo:",
+protocol: '*Trapped-Backend',
+fn: function (value,anObject){
+var self=this;
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+return $core.withContext(function($ctx1) {
+//>>excludeEnd("ctx");
+var $1;
+$1=$recv(anObject)._perform_withArguments_($recv($recv(self._first()).__comma(":"))._asSymbol(),[value]);
+return $1;
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+}, function($ctx1) {$ctx1.fill(self,"asTrapAtPut:sendTo:",{value:value,anObject:anObject},$globals.Array)});
+//>>excludeEnd("ctx");
+},
+//>>excludeStart("ide", pragmas.excludeIdeData);
+args: ["value", "anObject"],
+source: "asTrapAtPut: value sendTo: anObject\x0a    ^anObject perform: (self first, ':') asSymbol withArguments: { value }",
+referencedClasses: [],
+//>>excludeEnd("ide");
+messageSends: ["perform:withArguments:", "asSymbol", ",", "first"]
+}),
+$globals.Array);
+
+$core.addMethod(
+$core.method({
+selector: "asTrapAtSendTo:",
+protocol: '*Trapped-Backend',
+fn: function (anObject){
+var self=this;
+function $MessageNotUnderstood(){return $globals.MessageNotUnderstood||(typeof MessageNotUnderstood=="undefined"?nil:MessageNotUnderstood)}
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+return $core.withContext(function($ctx1) {
+//>>excludeEnd("ctx");
+var $1;
+var $early={};
+try {
+$1=$recv((function(){
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+return $core.withContext(function($ctx2) {
+//>>excludeEnd("ctx");
+return $recv(anObject)._perform_(self._first());
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+}, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
+//>>excludeEnd("ctx");
+}))._on_do_($MessageNotUnderstood(),(function(){
+throw $early=[nil];
+
+}));
+return $1;
+}
+catch(e) {if(e===$early)return e[0]; throw e}
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+}, function($ctx1) {$ctx1.fill(self,"asTrapAtSendTo:",{anObject:anObject},$globals.Array)});
+//>>excludeEnd("ctx");
+},
+//>>excludeStart("ide", pragmas.excludeIdeData);
+args: ["anObject"],
+source: "asTrapAtSendTo: anObject\x0a\x09^[anObject perform: self first] on: MessageNotUnderstood do: [^nil]",
+referencedClasses: ["MessageNotUnderstood"],
+//>>excludeEnd("ide");
+messageSends: ["on:do:", "perform:", "first"]
+}),
+$globals.Array);
+
+$core.addMethod(
+$core.method({
+selector: "asTrapAtPut:sendTo:",
+protocol: '*Trapped-Backend',
+fn: function (value,anObject){
+var self=this;
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+return $core.withContext(function($ctx1) {
+//>>excludeEnd("ctx");
+var $1;
+$1=$recv(anObject)._at_put_(self,value);
+return $1;
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+}, function($ctx1) {$ctx1.fill(self,"asTrapAtPut:sendTo:",{value:value,anObject:anObject},$globals.Number)});
+//>>excludeEnd("ctx");
+},
+//>>excludeStart("ide", pragmas.excludeIdeData);
+args: ["value", "anObject"],
+source: "asTrapAtPut: value sendTo: anObject\x0a\x09^anObject at: self put: value",
+referencedClasses: [],
+//>>excludeEnd("ide");
+messageSends: ["at:put:"]
+}),
+$globals.Number);
+
+$core.addMethod(
+$core.method({
+selector: "asTrapAtSendTo:",
+protocol: '*Trapped-Backend',
+fn: function (anObject){
+var self=this;
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+return $core.withContext(function($ctx1) {
+//>>excludeEnd("ctx");
+var $1,$receiver;
+if(($receiver = anObject) == null || $receiver.isNil){
+$1=anObject;
+} else {
+$1=$recv(anObject)._at_ifAbsent_(self,(function(){
+return nil;
+
+}));
+};
+return $1;
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+}, function($ctx1) {$ctx1.fill(self,"asTrapAtSendTo:",{anObject:anObject},$globals.Number)});
+//>>excludeEnd("ctx");
+},
+//>>excludeStart("ide", pragmas.excludeIdeData);
+args: ["anObject"],
+source: "asTrapAtSendTo: anObject\x0a\x09^anObject ifNotNil: [ anObject at: self ifAbsent: [nil] ]",
+referencedClasses: [],
+//>>excludeEnd("ide");
+messageSends: ["ifNotNil:", "at:ifAbsent:"]
+}),
+$globals.Number);
+
+$core.addMethod(
+$core.method({
+selector: "asTrapAtPut:sendTo:",
+protocol: '*Trapped-Backend',
+fn: function (value,anObject){
+var self=this;
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+return $core.withContext(function($ctx1) {
+//>>excludeEnd("ctx");
+var $1;
+$1=$recv("Trapped cannot put at ".__comma($recv(self._class())._name())).__comma(" type key.");
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+$ctx1.sendIdx[","]=1;
+//>>excludeEnd("ctx");
+self._error_($1);
+return self;
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+}, function($ctx1) {$ctx1.fill(self,"asTrapAtPut:sendTo:",{value:value,anObject:anObject},$globals.Object)});
+//>>excludeEnd("ctx");
+},
+//>>excludeStart("ide", pragmas.excludeIdeData);
+args: ["value", "anObject"],
+source: "asTrapAtPut: value sendTo: anObject\x0a\x09self error: 'Trapped cannot put at ', self class name, ' type key.'",
+referencedClasses: [],
+//>>excludeEnd("ide");
+messageSends: ["error:", ",", "name", "class"]
+}),
+$globals.Object);
+
+$core.addMethod(
+$core.method({
+selector: "asTrapAtSendTo:",
+protocol: '*Trapped-Backend',
+fn: function (anObject){
+var self=this;
+return nil;
+
+},
+//>>excludeStart("ide", pragmas.excludeIdeData);
+args: ["anObject"],
+source: "asTrapAtSendTo: anObject\x0a\x09^nil",
+referencedClasses: [],
+//>>excludeEnd("ide");
+messageSends: []
+}),
+$globals.Object);
+
+$core.addMethod(
+$core.method({
+selector: "asEavModel",
+protocol: '*Trapped-Backend',
+fn: function (){
+var self=this;
+var model;
+function $EavModel(){return $globals.EavModel||(typeof EavModel=="undefined"?nil:EavModel)}
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+return $core.withContext(function($ctx1) {
+//>>excludeEnd("ctx");
+var $1,$2,$receiver;
+model=$recv($EavModel())._new();
+$recv(model)._getBlock_((function(anObject){
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+return $core.withContext(function($ctx2) {
+//>>excludeEnd("ctx");
+return self._inject_into_(anObject,(function(soFar,segment){
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+return $core.withContext(function($ctx3) {
+//>>excludeEnd("ctx");
+return $recv(segment)._asTrapAtSendTo_(soFar);
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+$ctx3.sendIdx["asTrapAtSendTo:"]=1;
+//>>excludeEnd("ctx");
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+}, function($ctx3) {$ctx3.fillBlock({soFar:soFar,segment:segment},$ctx2,2)});
+//>>excludeEnd("ctx");
+}));
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+$ctx2.sendIdx["inject:into:"]=1;
+//>>excludeEnd("ctx");
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+}, function($ctx2) {$ctx2.fillBlock({anObject:anObject},$ctx1,1)});
+//>>excludeEnd("ctx");
+}));
+$1=self._isEmpty();
+if(!$core.assert($1)){
+$recv(model)._putBlock_((function(anObject,value){
+var penultimate;
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+return $core.withContext(function($ctx2) {
+//>>excludeEnd("ctx");
+penultimate=$recv(self._allButLast())._inject_into_(anObject,(function(soFar,segment){
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+return $core.withContext(function($ctx3) {
+//>>excludeEnd("ctx");
+if(($receiver = soFar) == null || $receiver.isNil){
+return soFar;
+} else {
+return $recv(segment)._asTrapAtSendTo_(soFar);
+};
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+}, function($ctx3) {$ctx3.fillBlock({soFar:soFar,segment:segment},$ctx2,5)});
+//>>excludeEnd("ctx");
+}));
+penultimate;
+return $recv(self._last())._asTrapAtPut_sendTo_(value,penultimate);
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+}, function($ctx2) {$ctx2.fillBlock({anObject:anObject,value:value,penultimate:penultimate},$ctx1,4)});
+//>>excludeEnd("ctx");
+}));
+};
+$2=model;
+return $2;
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+}, function($ctx1) {$ctx1.fill(self,"asEavModel",{model:model},$globals.SequenceableCollection)});
+//>>excludeEnd("ctx");
+},
+//>>excludeStart("ide", pragmas.excludeIdeData);
+args: [],
+source: "asEavModel\x0a    | model |\x0a    model := EavModel new.\x0a    model getBlock: [ :anObject |\x0a        self inject: anObject into: [ :soFar :segment |\x0a            segment asTrapAtSendTo: soFar ]].\x0a    self isEmpty ifFalse: [\x0a        model putBlock: [ :anObject :value | | penultimate |\x0a            penultimate :=  self allButLast inject: anObject into: [ :soFar :segment |\x0a                soFar ifNotNil: [ segment asTrapAtSendTo: soFar ]].\x0a            self last asTrapAtPut:value sendTo: penultimate ]].\x0a    ^model",
+referencedClasses: ["EavModel"],
+//>>excludeEnd("ide");
+messageSends: ["new", "getBlock:", "inject:into:", "asTrapAtSendTo:", "ifFalse:", "isEmpty", "putBlock:", "allButLast", "ifNotNil:", "asTrapAtPut:sendTo:", "last"]
+}),
+$globals.SequenceableCollection);
+
+$core.addMethod(
+$core.method({
+selector: "asTrapAtPut:sendTo:",
+protocol: '*Trapped-Backend',
+fn: function (value,anObject){
+var self=this;
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+return $core.withContext(function($ctx1) {
+//>>excludeEnd("ctx");
+var $1;
+$1=$recv(anObject)._at_put_(self,value);
+return $1;
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+}, function($ctx1) {$ctx1.fill(self,"asTrapAtPut:sendTo:",{value:value,anObject:anObject},$globals.String)});
+//>>excludeEnd("ctx");
+},
+//>>excludeStart("ide", pragmas.excludeIdeData);
+args: ["value", "anObject"],
+source: "asTrapAtPut: value sendTo: anObject\x0a\x09^anObject at: self put: value",
+referencedClasses: [],
+//>>excludeEnd("ide");
+messageSends: ["at:put:"]
+}),
+$globals.String);
+
+$core.addMethod(
+$core.method({
+selector: "asTrapAtSendTo:",
+protocol: '*Trapped-Backend',
+fn: function (anObject){
+var self=this;
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+return $core.withContext(function($ctx1) {
+//>>excludeEnd("ctx");
+var $1,$receiver;
+if(($receiver = anObject) == null || $receiver.isNil){
+$1=anObject;
+} else {
+$1=$recv(anObject)._at_ifAbsent_(self,(function(){
+return nil;
+
+}));
+};
+return $1;
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+}, function($ctx1) {$ctx1.fill(self,"asTrapAtSendTo:",{anObject:anObject},$globals.String)});
+//>>excludeEnd("ctx");
+},
+//>>excludeStart("ide", pragmas.excludeIdeData);
+args: ["anObject"],
+source: "asTrapAtSendTo: anObject\x0a\x09^anObject ifNotNil: [ anObject at: self ifAbsent: [nil] ]",
+referencedClasses: [],
+//>>excludeEnd("ide");
+messageSends: ["ifNotNil:", "at:ifAbsent:"]
+}),
+$globals.String);
+
+});

+ 14 - 14
st/Trapped-Backend.st → src/Trapped-Backend.st

@@ -1,4 +1,4 @@
-Smalltalk current createPackage: 'Trapped-Backend'!
+Smalltalk createPackage: 'Trapped-Backend'!
 Object subclass: #EavModel
 	instanceVariableNames: 'getBlock putBlock'
 	package: 'Trapped-Backend'!
@@ -325,14 +325,14 @@ read: path do: aBlock
     payload model: eavModel read: aBlock
 ! !
 
-!Object methodsFor: '*Trapped-Backend'!
+!Array methodsFor: '*Trapped-Backend'!
 
 asTrapAtPut: value sendTo: anObject
-	self error: 'Trapped cannot put at ', self class name, ' type key.'
+    ^anObject perform: (self first, ':') asSymbol withArguments: { value }
 !
 
 asTrapAtSendTo: anObject
-	^nil
+	^[anObject perform: self first] on: MessageNotUnderstood do: [^nil]
 ! !
 
 !Number methodsFor: '*Trapped-Backend'!
@@ -345,6 +345,16 @@ asTrapAtSendTo: anObject
 	^anObject ifNotNil: [ anObject at: self ifAbsent: [nil] ]
 ! !
 
+!Object methodsFor: '*Trapped-Backend'!
+
+asTrapAtPut: value sendTo: anObject
+	self error: 'Trapped cannot put at ', self class name, ' type key.'
+!
+
+asTrapAtSendTo: anObject
+	^nil
+! !
+
 !SequenceableCollection methodsFor: '*Trapped-Backend'!
 
 asEavModel
@@ -371,13 +381,3 @@ asTrapAtSendTo: anObject
 	^anObject ifNotNil: [ anObject at: self ifAbsent: [nil] ]
 ! !
 
-!Array methodsFor: '*Trapped-Backend'!
-
-asTrapAtPut: value sendTo: anObject
-    ^anObject perform: (self first, ':') asSymbol withArguments: { value }
-!
-
-asTrapAtSendTo: anObject
-	^[anObject perform: self first] on: MessageNotUnderstood do: [^nil]
-! !
-

+ 2324 - 0
src/Trapped-Frontend.js

@@ -0,0 +1,2324 @@
+define("trapped/Trapped-Frontend", ["amber/boot", "amber_core/Kernel-Objects", "amber_core/Kernel-Collections", "amber_core/Web"], function($boot){
+var $core=$boot.api,nil=$boot.nil,$recv=$boot.asReceiver,$globals=$boot.globals;
+$core.addPackage('Trapped-Frontend');
+$core.packages["Trapped-Frontend"].innerEval = function (expr) { return eval(expr); };
+$core.packages["Trapped-Frontend"].transport = {"type":"amd","amdNamespace":"trapped"};
+
+$core.addClass('TrappedDataCarrier', $globals.Object, ['target', 'model', 'chain', 'source'], 'Trapped-Frontend');
+$core.addMethod(
+$core.method({
+selector: "chain:",
+protocol: 'accessing',
+fn: function (aProcessingChain){
+var self=this;
+self["@chain"]=aProcessingChain;
+return self;
+
+},
+//>>excludeStart("ide", pragmas.excludeIdeData);
+args: ["aProcessingChain"],
+source: "chain: aProcessingChain\x0a\x09chain := aProcessingChain",
+referencedClasses: [],
+//>>excludeEnd("ide");
+messageSends: []
+}),
+$globals.TrappedDataCarrier);
+
+$core.addMethod(
+$core.method({
+selector: "falseAsNilValue",
+protocol: 'converting',
+fn: function (){
+var self=this;
+var value;
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+return $core.withContext(function($ctx1) {
+//>>excludeEnd("ctx");
+var $1,$2;
+value=self._value();
+$1=$recv(value).__eq(false);
+if($core.assert($1)){
+return nil;
+} else {
+$2=value;
+return $2;
+};
+return self;
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+}, function($ctx1) {$ctx1.fill(self,"falseAsNilValue",{value:value},$globals.TrappedDataCarrier)});
+//>>excludeEnd("ctx");
+},
+//>>excludeStart("ide", pragmas.excludeIdeData);
+args: [],
+source: "falseAsNilValue\x0a\x09| value |\x0a\x09value := self value.\x0a\x09value = false ifTrue: [ ^nil ] ifFalse: [ ^value ]",
+referencedClasses: [],
+//>>excludeEnd("ide");
+messageSends: ["value", "ifTrue:ifFalse:", "="]
+}),
+$globals.TrappedDataCarrier);
+
+$core.addMethod(
+$core.method({
+selector: "initialize",
+protocol: 'initialization',
+fn: function (){
+var self=this;
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+return $core.withContext(function($ctx1) {
+//>>excludeEnd("ctx");
+(
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+$ctx1.supercall = true, 
+//>>excludeEnd("ctx");
+$globals.TrappedDataCarrier.superclass.fn.prototype._initialize.apply($recv(self), []));
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+$ctx1.supercall = false;
+//>>excludeEnd("ctx");;
+self["@model"]=true;
+return self;
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+}, function($ctx1) {$ctx1.fill(self,"initialize",{},$globals.TrappedDataCarrier)});
+//>>excludeEnd("ctx");
+},
+//>>excludeStart("ide", pragmas.excludeIdeData);
+args: [],
+source: "initialize\x0a\x09super initialize.\x0a\x09model := true",
+referencedClasses: [],
+//>>excludeEnd("ide");
+messageSends: ["initialize"]
+}),
+$globals.TrappedDataCarrier);
+
+$core.addMethod(
+$core.method({
+selector: "source",
+protocol: 'accessing',
+fn: function (){
+var self=this;
+var $1;
+$1=self["@source"];
+return $1;
+
+},
+//>>excludeStart("ide", pragmas.excludeIdeData);
+args: [],
+source: "source\x0a\x09^source",
+referencedClasses: [],
+//>>excludeEnd("ide");
+messageSends: []
+}),
+$globals.TrappedDataCarrier);
+
+$core.addMethod(
+$core.method({
+selector: "source:",
+protocol: 'accessing',
+fn: function (anObject){
+var self=this;
+self["@source"]=anObject;
+return self;
+
+},
+//>>excludeStart("ide", pragmas.excludeIdeData);
+args: ["anObject"],
+source: "source: anObject\x0a\x09source := anObject",
+referencedClasses: [],
+//>>excludeEnd("ide");
+messageSends: []
+}),
+$globals.TrappedDataCarrier);
+
+$core.addMethod(
+$core.method({
+selector: "target",
+protocol: 'accessing',
+fn: function (){
+var self=this;
+var $1;
+$1=self["@target"];
+return $1;
+
+},
+//>>excludeStart("ide", pragmas.excludeIdeData);
+args: [],
+source: "target\x0a\x09^target",
+referencedClasses: [],
+//>>excludeEnd("ide");
+messageSends: []
+}),
+$globals.TrappedDataCarrier);
+
+$core.addMethod(
+$core.method({
+selector: "target:",
+protocol: 'accessing',
+fn: function (anObject){
+var self=this;
+self["@target"]=anObject;
+return self;
+
+},
+//>>excludeStart("ide", pragmas.excludeIdeData);
+args: ["anObject"],
+source: "target: anObject\x0a\x09target := anObject",
+referencedClasses: [],
+//>>excludeEnd("ide");
+messageSends: []
+}),
+$globals.TrappedDataCarrier);
+
+$core.addMethod(
+$core.method({
+selector: "value",
+protocol: 'accessing',
+fn: function (){
+var self=this;
+var $1;
+$1=self["@model"];
+return $1;
+
+},
+//>>excludeStart("ide", pragmas.excludeIdeData);
+args: [],
+source: "value\x0a\x09^model",
+referencedClasses: [],
+//>>excludeEnd("ide");
+messageSends: []
+}),
+$globals.TrappedDataCarrier);
+
+$core.addMethod(
+$core.method({
+selector: "value:",
+protocol: 'accessing',
+fn: function (anObject){
+var self=this;
+self["@model"]=anObject;
+return self;
+
+},
+//>>excludeStart("ide", pragmas.excludeIdeData);
+args: ["anObject"],
+source: "value: anObject\x0a\x09model := anObject",
+referencedClasses: [],
+//>>excludeEnd("ide");
+messageSends: []
+}),
+$globals.TrappedDataCarrier);
+
+$core.addMethod(
+$core.method({
+selector: "value:whenDifferentFrom:",
+protocol: 'accessing',
+fn: function (anObject,anotherObject){
+var self=this;
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+return $core.withContext(function($ctx1) {
+//>>excludeEnd("ctx");
+var $1;
+$1=$recv(anObject).__eq(anotherObject);
+if(!$core.assert($1)){
+self._value_(anObject);
+};
+return self;
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+}, function($ctx1) {$ctx1.fill(self,"value:whenDifferentFrom:",{anObject:anObject,anotherObject:anotherObject},$globals.TrappedDataCarrier)});
+//>>excludeEnd("ctx");
+},
+//>>excludeStart("ide", pragmas.excludeIdeData);
+args: ["anObject", "anotherObject"],
+source: "value: anObject whenDifferentFrom: anotherObject\x0a\x09anObject = anotherObject ifFalse: [ self value: anObject ]",
+referencedClasses: [],
+//>>excludeEnd("ide");
+messageSends: ["ifFalse:", "=", "value:"]
+}),
+$globals.TrappedDataCarrier);
+
+
+$core.addMethod(
+$core.method({
+selector: "on:target:",
+protocol: 'not yet classified',
+fn: function (aProcessingChain,anObject){
+var self=this;
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+return $core.withContext(function($ctx1) {
+//>>excludeEnd("ctx");
+var $2,$3,$1;
+$2=self._new();
+$recv($2)._chain_(aProcessingChain);
+$recv($2)._target_(anObject);
+$3=$recv($2)._yourself();
+$1=$3;
+return $1;
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+}, function($ctx1) {$ctx1.fill(self,"on:target:",{aProcessingChain:aProcessingChain,anObject:anObject},$globals.TrappedDataCarrier.klass)});
+//>>excludeEnd("ctx");
+},
+//>>excludeStart("ide", pragmas.excludeIdeData);
+args: ["aProcessingChain", "anObject"],
+source: "on: aProcessingChain target: anObject\x0a\x09^self new\x0a\x09\x09chain: aProcessingChain;\x0a\x09\x09target: anObject;\x0a\x09\x09yourself",
+referencedClasses: [],
+//>>excludeEnd("ide");
+messageSends: ["chain:", "new", "target:", "yourself"]
+}),
+$globals.TrappedDataCarrier.klass);
+
+
+$core.addClass('TrappedDataCarrierToModel', $globals.TrappedDataCarrier, ['index'], 'Trapped-Frontend');
+$core.addMethod(
+$core.method({
+selector: "proceed",
+protocol: 'not yet classified',
+fn: function (){
+var self=this;
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+return $core.withContext(function($ctx1) {
+//>>excludeEnd("ctx");
+var $1,$receiver;
+$1=self["@index"];
+if(($receiver = $1) == null || $receiver.isNil){
+self["@index"]=$recv(self["@chain"])._lastProcessorNo();
+} else {
+self["@index"]=$recv(self["@index"]).__minus((1));
+};
+$recv($recv(self["@chain"])._processorNo_(self["@index"]))._toModel_(self);
+return self;
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+}, function($ctx1) {$ctx1.fill(self,"proceed",{},$globals.TrappedDataCarrierToModel)});
+//>>excludeEnd("ctx");
+},
+//>>excludeStart("ide", pragmas.excludeIdeData);
+args: [],
+source: "proceed\x0a\x09index := index ifNil: [ chain lastProcessorNo ] ifNotNil: [ index - 1 ].\x0a\x09(chain processorNo: index) toModel: self",
+referencedClasses: [],
+//>>excludeEnd("ide");
+messageSends: ["ifNil:ifNotNil:", "lastProcessorNo", "-", "toModel:", "processorNo:"]
+}),
+$globals.TrappedDataCarrierToModel);
+
+
+
+$core.addClass('TrappedDataCarrierToView', $globals.TrappedDataCarrier, ['index'], 'Trapped-Frontend');
+$core.addMethod(
+$core.method({
+selector: "proceed",
+protocol: 'not yet classified',
+fn: function (){
+var self=this;
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+return $core.withContext(function($ctx1) {
+//>>excludeEnd("ctx");
+var $1,$receiver;
+$1=self["@index"];
+if(($receiver = $1) == null || $receiver.isNil){
+self["@index"]=$recv(self["@chain"])._firstProcessorNo();
+} else {
+self["@index"]=$recv(self["@index"]).__plus((1));
+};
+$recv($recv(self["@chain"])._processorNo_(self["@index"]))._toView_(self);
+return self;
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+}, function($ctx1) {$ctx1.fill(self,"proceed",{},$globals.TrappedDataCarrierToView)});
+//>>excludeEnd("ctx");
+},
+//>>excludeStart("ide", pragmas.excludeIdeData);
+args: [],
+source: "proceed\x0a\x09index := index ifNil: [ chain firstProcessorNo ] ifNotNil: [ index + 1 ].\x0a\x09(chain processorNo: index) toView: self",
+referencedClasses: [],
+//>>excludeEnd("ide");
+messageSends: ["ifNil:ifNotNil:", "firstProcessorNo", "+", "toView:", "processorNo:"]
+}),
+$globals.TrappedDataCarrierToView);
+
+
+
+$core.addClass('TrappedProcessingChain', $globals.Object, ['processors'], 'Trapped-Frontend');
+$core.addMethod(
+$core.method({
+selector: "firstProcessorNo",
+protocol: 'accessing',
+fn: function (){
+var self=this;
+return (1);
+
+},
+//>>excludeStart("ide", pragmas.excludeIdeData);
+args: [],
+source: "firstProcessorNo\x0a\x09^1",
+referencedClasses: [],
+//>>excludeEnd("ide");
+messageSends: []
+}),
+$globals.TrappedProcessingChain);
+
+$core.addMethod(
+$core.method({
+selector: "forSnapshot:andBrush:",
+protocol: 'action',
+fn: function (aSnapshot,aTagBrush){
+var self=this;
+var toViewCarrier,toModelCarrier;
+function $TrappedDataCarrierToView(){return $globals.TrappedDataCarrierToView||(typeof TrappedDataCarrierToView=="undefined"?nil:TrappedDataCarrierToView)}
+function $TrappedDataCarrierToModel(){return $globals.TrappedDataCarrierToModel||(typeof TrappedDataCarrierToModel=="undefined"?nil:TrappedDataCarrierToModel)}
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+return $core.withContext(function($ctx1) {
+//>>excludeEnd("ctx");
+var $1;
+toViewCarrier=$recv($TrappedDataCarrierToView())._on_target_(self,aTagBrush);
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+$ctx1.sendIdx["on:target:"]=1;
+//>>excludeEnd("ctx");
+toModelCarrier=$recv($TrappedDataCarrierToModel())._on_target_(self,aSnapshot);
+$recv(self["@processors"])._do_((function(each){
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+return $core.withContext(function($ctx2) {
+//>>excludeEnd("ctx");
+return $recv(each)._installToView_toModel_(toViewCarrier,toModelCarrier);
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+}, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,1)});
+//>>excludeEnd("ctx");
+}));
+$recv(toViewCarrier)._source_(aSnapshot);
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+$ctx1.sendIdx["source:"]=1;
+//>>excludeEnd("ctx");
+$recv(toModelCarrier)._source_(aTagBrush);
+$1=$recv($recv(toViewCarrier)._value()).__eq(true);
+if($core.assert($1)){
+$recv($recv(toViewCarrier)._copy())._proceed();
+};
+return self;
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+}, function($ctx1) {$ctx1.fill(self,"forSnapshot:andBrush:",{aSnapshot:aSnapshot,aTagBrush:aTagBrush,toViewCarrier:toViewCarrier,toModelCarrier:toModelCarrier},$globals.TrappedProcessingChain)});
+//>>excludeEnd("ctx");
+},
+//>>excludeStart("ide", pragmas.excludeIdeData);
+args: ["aSnapshot", "aTagBrush"],
+source: "forSnapshot: aSnapshot andBrush: aTagBrush\x0a\x09| toViewCarrier toModelCarrier |\x0a\x09toViewCarrier := TrappedDataCarrierToView on: self target: aTagBrush.\x0a\x09toModelCarrier := TrappedDataCarrierToModel on: self target: aSnapshot.\x0a\x09processors do: [ :each | each installToView: toViewCarrier toModel: toModelCarrier ].\x0a\x09toViewCarrier source: aSnapshot.\x0a\x09toModelCarrier source: aTagBrush.\x0a\x09toViewCarrier value = true ifTrue: [ toViewCarrier copy proceed ]",
+referencedClasses: ["TrappedDataCarrierToView", "TrappedDataCarrierToModel"],
+//>>excludeEnd("ide");
+messageSends: ["on:target:", "do:", "installToView:toModel:", "source:", "ifTrue:", "=", "value", "proceed", "copy"]
+}),
+$globals.TrappedProcessingChain);
+
+$core.addMethod(
+$core.method({
+selector: "lastProcessorNo",
+protocol: 'accessing',
+fn: function (){
+var self=this;
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+return $core.withContext(function($ctx1) {
+//>>excludeEnd("ctx");
+var $1;
+$1=$recv(self["@processors"])._size();
+return $1;
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+}, function($ctx1) {$ctx1.fill(self,"lastProcessorNo",{},$globals.TrappedProcessingChain)});
+//>>excludeEnd("ctx");
+},
+//>>excludeStart("ide", pragmas.excludeIdeData);
+args: [],
+source: "lastProcessorNo\x0a\x09^processors size",
+referencedClasses: [],
+//>>excludeEnd("ide");
+messageSends: ["size"]
+}),
+$globals.TrappedProcessingChain);
+
+$core.addMethod(
+$core.method({
+selector: "processorNo:",
+protocol: 'accessing',
+fn: function (aNumber){
+var self=this;
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+return $core.withContext(function($ctx1) {
+//>>excludeEnd("ctx");
+var $1;
+$1=$recv(self["@processors"])._at_(aNumber);
+return $1;
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+}, function($ctx1) {$ctx1.fill(self,"processorNo:",{aNumber:aNumber},$globals.TrappedProcessingChain)});
+//>>excludeEnd("ctx");
+},
+//>>excludeStart("ide", pragmas.excludeIdeData);
+args: ["aNumber"],
+source: "processorNo: aNumber\x0a\x09^processors at: aNumber",
+referencedClasses: [],
+//>>excludeEnd("ide");
+messageSends: ["at:"]
+}),
+$globals.TrappedProcessingChain);
+
+$core.addMethod(
+$core.method({
+selector: "processors:",
+protocol: 'accessing',
+fn: function (anArray){
+var self=this;
+self["@processors"]=anArray;
+return self;
+
+},
+//>>excludeStart("ide", pragmas.excludeIdeData);
+args: ["anArray"],
+source: "processors: anArray\x0a\x09processors := anArray",
+referencedClasses: [],
+//>>excludeEnd("ide");
+messageSends: []
+}),
+$globals.TrappedProcessingChain);
+
+
+$core.addMethod(
+$core.method({
+selector: "blackboardReaderWriter",
+protocol: 'private',
+fn: function (){
+var self=this;
+function $TrappedProcessorBlackboard(){return $globals.TrappedProcessorBlackboard||(typeof TrappedProcessorBlackboard=="undefined"?nil:TrappedProcessorBlackboard)}
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+return $core.withContext(function($ctx1) {
+//>>excludeEnd("ctx");
+var $1;
+$1=$recv($TrappedProcessorBlackboard())._new();
+return $1;
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+}, function($ctx1) {$ctx1.fill(self,"blackboardReaderWriter",{},$globals.TrappedProcessingChain.klass)});
+//>>excludeEnd("ctx");
+},
+//>>excludeStart("ide", pragmas.excludeIdeData);
+args: [],
+source: "blackboardReaderWriter\x0a\x09^TrappedProcessorBlackboard new",
+referencedClasses: ["TrappedProcessorBlackboard"],
+//>>excludeEnd("ide");
+messageSends: ["new"]
+}),
+$globals.TrappedProcessingChain.klass);
+
+$core.addMethod(
+$core.method({
+selector: "dataTerminator",
+protocol: 'private',
+fn: function (){
+var self=this;
+function $TrappedProcessorTerminator(){return $globals.TrappedProcessorTerminator||(typeof TrappedProcessorTerminator=="undefined"?nil:TrappedProcessorTerminator)}
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+return $core.withContext(function($ctx1) {
+//>>excludeEnd("ctx");
+var $1;
+$1=$recv($TrappedProcessorTerminator())._new();
+return $1;
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+}, function($ctx1) {$ctx1.fill(self,"dataTerminator",{},$globals.TrappedProcessingChain.klass)});
+//>>excludeEnd("ctx");
+},
+//>>excludeStart("ide", pragmas.excludeIdeData);
+args: [],
+source: "dataTerminator\x0a\x09^TrappedProcessorTerminator new",
+referencedClasses: ["TrappedProcessorTerminator"],
+//>>excludeEnd("ide");
+messageSends: ["new"]
+}),
+$globals.TrappedProcessingChain.klass);
+
+$core.addMethod(
+$core.method({
+selector: "new:",
+protocol: 'instance creation',
+fn: function (anArray){
+var self=this;
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+return $core.withContext(function($ctx1) {
+//>>excludeEnd("ctx");
+var $1,$3,$4,$2;
+$1=$recv(anArray)._anySatisfy_((function(each){
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+return $core.withContext(function($ctx2) {
+//>>excludeEnd("ctx");
+return $recv(each)._isExpectingModelData();
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+}, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,1)});
+//>>excludeEnd("ctx");
+}));
+if($core.assert($1)){
+$recv(anArray)._addFirst_(self._blackboardReaderWriter());
+} else {
+$recv(anArray)._add_(self._dataTerminator());
+};
+$3=self._new();
+$recv($3)._processors_(anArray);
+$4=$recv($3)._yourself();
+$2=$4;
+return $2;
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+}, function($ctx1) {$ctx1.fill(self,"new:",{anArray:anArray},$globals.TrappedProcessingChain.klass)});
+//>>excludeEnd("ctx");
+},
+//>>excludeStart("ide", pragmas.excludeIdeData);
+args: ["anArray"],
+source: "new: anArray\x0a\x09(anArray anySatisfy: [ :each | each isExpectingModelData ])\x0a\x09\x09ifFalse: [ anArray add: self dataTerminator ]\x0a\x09\x09ifTrue: [ anArray addFirst: self blackboardReaderWriter ].\x0a\x09^self new\x0a\x09\x09processors: anArray;\x0a\x09\x09yourself",
+referencedClasses: [],
+//>>excludeEnd("ide");
+messageSends: ["ifFalse:ifTrue:", "anySatisfy:", "isExpectingModelData", "add:", "dataTerminator", "addFirst:", "blackboardReaderWriter", "processors:", "new", "yourself"]
+}),
+$globals.TrappedProcessingChain.klass);
+
+$core.addMethod(
+$core.method({
+selector: "newFromProcessorSpecs:",
+protocol: 'instance creation',
+fn: function (anArray){
+var self=this;
+function $TrappedProcessor(){return $globals.TrappedProcessor||(typeof TrappedProcessor=="undefined"?nil:TrappedProcessor)}
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+return $core.withContext(function($ctx1) {
+//>>excludeEnd("ctx");
+var $1;
+$1=self._new_($recv($recv(anArray)._ifEmpty_((function(){
+return ["contents"];
+
+})))._collect_((function(each){
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+return $core.withContext(function($ctx2) {
+//>>excludeEnd("ctx");
+return $recv(each)._asTrapProcSendTo_($TrappedProcessor());
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+}, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,2)});
+//>>excludeEnd("ctx");
+})));
+return $1;
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+}, function($ctx1) {$ctx1.fill(self,"newFromProcessorSpecs:",{anArray:anArray},$globals.TrappedProcessingChain.klass)});
+//>>excludeEnd("ctx");
+},
+//>>excludeStart("ide", pragmas.excludeIdeData);
+args: ["anArray"],
+source: "newFromProcessorSpecs: anArray\x0a\x09^self new: ((anArray ifEmpty: [ #(contents) ]) collect: [ :each | each asTrapProcSendTo: TrappedProcessor ])",
+referencedClasses: ["TrappedProcessor"],
+//>>excludeEnd("ide");
+messageSends: ["new:", "collect:", "ifEmpty:", "asTrapProcSendTo:"]
+}),
+$globals.TrappedProcessingChain.klass);
+
+
+$core.addClass('TrappedProcessor', $globals.Object, [], 'Trapped-Frontend');
+//>>excludeStart("ide", pragmas.excludeIdeData);
+$globals.TrappedProcessor.comment="I am a processing step in TrappedProcessingChain.\x0aI am stateless flyweight (aka servant)\x0aand will get all necessary data as arguments in API calls.\x0a\x0aMy public API is:\x0a - installToView:toModel:\x0a   This gets two TrappedDataCarriers set up without actual data\x0a   and at the beginning of their chains. It should do one-time\x0a   installation task needed (install event handlers etc.).\x0a   To start a chain, do: dataCarrier copy value: data; proceed.\x0a - toView:\x0a   This performs transformation of TrappedDataCarrier on its way from model to view.\x0a   Should call aDataCarrier proceed to proceed to subsequent step.\x0a - toModel:\x0a   This performs transformation of TrappedDataCarrier on its way from view to model.\x0a   Should call aDataCarrier proceed to proceed to subsequent step.";
+//>>excludeEnd("ide");
+$core.addMethod(
+$core.method({
+selector: "installToView:toModel:",
+protocol: 'installation',
+fn: function (aDataCarrier,anotherDataCarrier){
+var self=this;
+return self;
+
+},
+//>>excludeStart("ide", pragmas.excludeIdeData);
+args: ["aDataCarrier", "anotherDataCarrier"],
+source: "installToView: aDataCarrier toModel: anotherDataCarrier\x0a\x09\x22by default, do nothing\x22",
+referencedClasses: [],
+//>>excludeEnd("ide");
+messageSends: []
+}),
+$globals.TrappedProcessor);
+
+$core.addMethod(
+$core.method({
+selector: "isExpectingModelData",
+protocol: 'testing',
+fn: function (){
+var self=this;
+return false;
+
+},
+//>>excludeStart("ide", pragmas.excludeIdeData);
+args: [],
+source: "isExpectingModelData\x0a\x09^false",
+referencedClasses: [],
+//>>excludeEnd("ide");
+messageSends: []
+}),
+$globals.TrappedProcessor);
+
+$core.addMethod(
+$core.method({
+selector: "toModel:",
+protocol: 'data transformation',
+fn: function (aDataCarrier){
+var self=this;
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+return $core.withContext(function($ctx1) {
+//>>excludeEnd("ctx");
+$recv(aDataCarrier)._proceed();
+return self;
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+}, function($ctx1) {$ctx1.fill(self,"toModel:",{aDataCarrier:aDataCarrier},$globals.TrappedProcessor)});
+//>>excludeEnd("ctx");
+},
+//>>excludeStart("ide", pragmas.excludeIdeData);
+args: ["aDataCarrier"],
+source: "toModel: aDataCarrier\x0a\x09\x22by default, proceed\x22\x0a\x09aDataCarrier proceed",
+referencedClasses: [],
+//>>excludeEnd("ide");
+messageSends: ["proceed"]
+}),
+$globals.TrappedProcessor);
+
+$core.addMethod(
+$core.method({
+selector: "toView:",
+protocol: 'data transformation',
+fn: function (aDataCarrier){
+var self=this;
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+return $core.withContext(function($ctx1) {
+//>>excludeEnd("ctx");
+$recv(aDataCarrier)._proceed();
+return self;
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+}, function($ctx1) {$ctx1.fill(self,"toView:",{aDataCarrier:aDataCarrier},$globals.TrappedProcessor)});
+//>>excludeEnd("ctx");
+},
+//>>excludeStart("ide", pragmas.excludeIdeData);
+args: ["aDataCarrier"],
+source: "toView: aDataCarrier\x0a\x09\x22by default, proceed\x22\x0a\x09aDataCarrier proceed",
+referencedClasses: [],
+//>>excludeEnd("ide");
+messageSends: ["proceed"]
+}),
+$globals.TrappedProcessor);
+
+
+$core.addMethod(
+$core.method({
+selector: "contents",
+protocol: 'factory',
+fn: function (){
+var self=this;
+function $TrappedProcessorContents(){return $globals.TrappedProcessorContents||(typeof TrappedProcessorContents=="undefined"?nil:TrappedProcessorContents)}
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+return $core.withContext(function($ctx1) {
+//>>excludeEnd("ctx");
+var $1;
+$1=$recv($TrappedProcessorContents())._new();
+return $1;
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+}, function($ctx1) {$ctx1.fill(self,"contents",{},$globals.TrappedProcessor.klass)});
+//>>excludeEnd("ctx");
+},
+//>>excludeStart("ide", pragmas.excludeIdeData);
+args: [],
+source: "contents\x0a\x09^TrappedProcessorContents new",
+referencedClasses: ["TrappedProcessorContents"],
+//>>excludeEnd("ide");
+messageSends: ["new"]
+}),
+$globals.TrappedProcessor.klass);
+
+
+$core.addClass('TrappedDataExpectingProcessor', $globals.TrappedProcessor, [], 'Trapped-Frontend');
+//>>excludeStart("ide", pragmas.excludeIdeData);
+$globals.TrappedDataExpectingProcessor.comment="I answer true to isExpectingModelData and serve as a base class\x0afor processor that present / change model data.\x0a\x0aWhen at least one of my instances is present in the chain,\x0aautomatic databinding processor is added at the beginning\x0a(the data-binding scenario); otherwise, the chain\x0ais run immediately with true as data (run-once scenario).";
+//>>excludeEnd("ide");
+$core.addMethod(
+$core.method({
+selector: "isExpectingModelData",
+protocol: 'testing',
+fn: function (){
+var self=this;
+return true;
+
+},
+//>>excludeStart("ide", pragmas.excludeIdeData);
+args: [],
+source: "isExpectingModelData\x0a\x09^true",
+referencedClasses: [],
+//>>excludeEnd("ide");
+messageSends: []
+}),
+$globals.TrappedDataExpectingProcessor);
+
+
+
+$core.addClass('TrappedProcessorContents', $globals.TrappedDataExpectingProcessor, [], 'Trapped-Frontend');
+//>>excludeStart("ide", pragmas.excludeIdeData);
+$globals.TrappedProcessorContents.comment="I put data into target via contents: in toView:";
+//>>excludeEnd("ide");
+$core.addMethod(
+$core.method({
+selector: "toView:",
+protocol: 'data transformation',
+fn: function (aDataCarrier){
+var self=this;
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+return $core.withContext(function($ctx1) {
+//>>excludeEnd("ctx");
+$recv(aDataCarrier)._toTargetContents();
+return self;
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+}, function($ctx1) {$ctx1.fill(self,"toView:",{aDataCarrier:aDataCarrier},$globals.TrappedProcessorContents)});
+//>>excludeEnd("ctx");
+},
+//>>excludeStart("ide", pragmas.excludeIdeData);
+args: ["aDataCarrier"],
+source: "toView: aDataCarrier\x0a\x09aDataCarrier toTargetContents",
+referencedClasses: [],
+//>>excludeEnd("ide");
+messageSends: ["toTargetContents"]
+}),
+$globals.TrappedProcessorContents);
+
+
+
+$core.addClass('TrappedProcessorBlackboard', $globals.TrappedProcessor, [], 'Trapped-Frontend');
+//>>excludeStart("ide", pragmas.excludeIdeData);
+$globals.TrappedProcessorBlackboard.comment="I am used internally to fetch data from blackboard\x0aor write it back.\x0a\x0aI am added to the beginning of the chain\x0awhen the chain contains at least one element\x0athat isExpectingModelData (see TrappedDataExpectingProcessor).";
+//>>excludeEnd("ide");
+$core.addMethod(
+$core.method({
+selector: "installToView:toModel:",
+protocol: 'installation',
+fn: function (aDataCarrier,anotherDataCarrier){
+var self=this;
+var snap;
+function $KeyedPubSubUnsubscribe(){return $globals.KeyedPubSubUnsubscribe||(typeof KeyedPubSubUnsubscribe=="undefined"?nil:KeyedPubSubUnsubscribe)}
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+return $core.withContext(function($ctx1) {
+//>>excludeEnd("ctx");
+var $1,$2,$3;
+snap=$recv(anotherDataCarrier)._target();
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+$ctx1.sendIdx["target"]=1;
+//>>excludeEnd("ctx");
+$recv(snap)._watch_((function(data){
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+return $core.withContext(function($ctx2) {
+//>>excludeEnd("ctx");
+$1=$recv($recv($recv($recv($recv(aDataCarrier)._target())._asJQuery())._closest_("html"))._toArray())._isEmpty();
+if($core.assert($1)){
+$recv($KeyedPubSubUnsubscribe())._signal();
+};
+return $recv(snap)._do_((function(){
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+return $core.withContext(function($ctx3) {
+//>>excludeEnd("ctx");
+$2=$recv(aDataCarrier)._copy();
+$recv($2)._value_(data);
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+$ctx3.sendIdx["value:"]=1;
+//>>excludeEnd("ctx");
+$3=$recv($2)._proceed();
+return $3;
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+}, function($ctx3) {$ctx3.fillBlock({},$ctx2,3)});
+//>>excludeEnd("ctx");
+}));
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+}, function($ctx2) {$ctx2.fillBlock({data:data},$ctx1,1)});
+//>>excludeEnd("ctx");
+}));
+$recv(aDataCarrier)._value_(false);
+return self;
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+}, function($ctx1) {$ctx1.fill(self,"installToView:toModel:",{aDataCarrier:aDataCarrier,anotherDataCarrier:anotherDataCarrier,snap:snap},$globals.TrappedProcessorBlackboard)});
+//>>excludeEnd("ctx");
+},
+//>>excludeStart("ide", pragmas.excludeIdeData);
+args: ["aDataCarrier", "anotherDataCarrier"],
+source: "installToView: aDataCarrier toModel: anotherDataCarrier\x0a\x09| snap |\x0a\x09snap := anotherDataCarrier target.\x0a\x09snap watch: [ :data |\x0a\x09\x09(aDataCarrier target asJQuery closest: 'html') toArray isEmpty ifTrue: [ KeyedPubSubUnsubscribe signal ].\x0a        snap do: [ aDataCarrier copy value: data; proceed ] ].\x0a\x09aDataCarrier value: false",
+referencedClasses: ["KeyedPubSubUnsubscribe"],
+//>>excludeEnd("ide");
+messageSends: ["target", "watch:", "ifTrue:", "isEmpty", "toArray", "closest:", "asJQuery", "signal", "do:", "value:", "copy", "proceed"]
+}),
+$globals.TrappedProcessorBlackboard);
+
+$core.addMethod(
+$core.method({
+selector: "toModel:",
+protocol: 'data transformation',
+fn: function (aDataCarrier){
+var self=this;
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+return $core.withContext(function($ctx1) {
+//>>excludeEnd("ctx");
+$recv(aDataCarrier)._modifyTarget();
+return self;
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+}, function($ctx1) {$ctx1.fill(self,"toModel:",{aDataCarrier:aDataCarrier},$globals.TrappedProcessorBlackboard)});
+//>>excludeEnd("ctx");
+},
+//>>excludeStart("ide", pragmas.excludeIdeData);
+args: ["aDataCarrier"],
+source: "toModel: aDataCarrier\x0a\x09aDataCarrier modifyTarget",
+referencedClasses: [],
+//>>excludeEnd("ide");
+messageSends: ["modifyTarget"]
+}),
+$globals.TrappedProcessorBlackboard);
+
+
+
+$core.addClass('TrappedProcessorTerminator', $globals.TrappedProcessor, [], 'Trapped-Frontend');
+//>>excludeStart("ide", pragmas.excludeIdeData);
+$globals.TrappedProcessorTerminator.comment="I do not proceed in toView:.\x0a\x0aI am added automatically to end of chain when it does not contain\x0aany element that isExpectingModelData (see TrappedDataExpectingProcessor).";
+//>>excludeEnd("ide");
+$core.addMethod(
+$core.method({
+selector: "toView:",
+protocol: 'data transformation',
+fn: function (aDataCarrier){
+var self=this;
+return self;
+
+},
+//>>excludeStart("ide", pragmas.excludeIdeData);
+args: ["aDataCarrier"],
+source: "toView: aDataCarrier\x0a\x09\x22stop\x22",
+referencedClasses: [],
+//>>excludeEnd("ide");
+messageSends: []
+}),
+$globals.TrappedProcessorTerminator);
+
+
+
+$core.addClass('TrappedSingleton', $globals.Object, [], 'Trapped-Frontend');
+$core.addMethod(
+$core.method({
+selector: "start:",
+protocol: 'action',
+fn: function (args){
+var self=this;
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+return $core.withContext(function($ctx1) {
+//>>excludeEnd("ctx");
+var $1;
+$1=self._subclassResponsibility();
+return $1;
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+}, function($ctx1) {$ctx1.fill(self,"start:",{args:args},$globals.TrappedSingleton)});
+//>>excludeEnd("ctx");
+},
+//>>excludeStart("ide", pragmas.excludeIdeData);
+args: ["args"],
+source: "start: args\x0a\x09^ self subclassResponsibility",
+referencedClasses: [],
+//>>excludeEnd("ide");
+messageSends: ["subclassResponsibility"]
+}),
+$globals.TrappedSingleton);
+
+
+$globals.TrappedSingleton.klass.iVarNames = ['current'];
+$core.addMethod(
+$core.method({
+selector: "current",
+protocol: 'accessing',
+fn: function (){
+var self=this;
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+return $core.withContext(function($ctx1) {
+//>>excludeEnd("ctx");
+var $2,$1,$receiver;
+$2=self["@current"];
+if(($receiver = $2) == null || $receiver.isNil){
+self["@current"]=self._new();
+$1=self["@current"];
+} else {
+$1=$2;
+};
+return $1;
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+}, function($ctx1) {$ctx1.fill(self,"current",{},$globals.TrappedSingleton.klass)});
+//>>excludeEnd("ctx");
+},
+//>>excludeStart("ide", pragmas.excludeIdeData);
+args: [],
+source: "current\x0a\x09^ current ifNil: [ current := self new ]",
+referencedClasses: [],
+//>>excludeEnd("ide");
+messageSends: ["ifNil:", "new"]
+}),
+$globals.TrappedSingleton.klass);
+
+$core.addMethod(
+$core.method({
+selector: "start:",
+protocol: 'action',
+fn: function (args){
+var self=this;
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+return $core.withContext(function($ctx1) {
+//>>excludeEnd("ctx");
+$recv(self._current())._start_(args);
+return self;
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+}, function($ctx1) {$ctx1.fill(self,"start:",{args:args},$globals.TrappedSingleton.klass)});
+//>>excludeEnd("ctx");
+},
+//>>excludeStart("ide", pragmas.excludeIdeData);
+args: ["args"],
+source: "start: args\x0a\x09self current start: args",
+referencedClasses: [],
+//>>excludeEnd("ide");
+messageSends: ["start:", "current"]
+}),
+$globals.TrappedSingleton.klass);
+
+
+$core.addClass('Trapped', $globals.TrappedSingleton, ['registry'], 'Trapped-Frontend');
+$core.addMethod(
+$core.method({
+selector: "byName:",
+protocol: 'accessing',
+fn: function (aString){
+var self=this;
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+return $core.withContext(function($ctx1) {
+//>>excludeEnd("ctx");
+var $1;
+$1=$recv(self["@registry"])._at_(aString);
+return $1;
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+}, function($ctx1) {$ctx1.fill(self,"byName:",{aString:aString},$globals.Trapped)});
+//>>excludeEnd("ctx");
+},
+//>>excludeStart("ide", pragmas.excludeIdeData);
+args: ["aString"],
+source: "byName: aString\x0a\x09^ registry at: aString",
+referencedClasses: [],
+//>>excludeEnd("ide");
+messageSends: ["at:"]
+}),
+$globals.Trapped);
+
+$core.addMethod(
+$core.method({
+selector: "cloneAndInject:",
+protocol: 'private',
+fn: function (anObject){
+var self=this;
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+return $core.withContext(function($ctx1) {
+//>>excludeEnd("ctx");
+var $2,$3,$1;
+$2=$recv($recv(anObject)._asJQuery())._clone();
+$recv($2)._each_((function(i,each){
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+return $core.withContext(function($ctx2) {
+//>>excludeEnd("ctx");
+return self._injectToElement_(each);
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+}, function($ctx2) {$ctx2.fillBlock({i:i,each:each},$ctx1,1)});
+//>>excludeEnd("ctx");
+}));
+$3=$recv($2)._get_((0));
+$1=$3;
+return $1;
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+}, function($ctx1) {$ctx1.fill(self,"cloneAndInject:",{anObject:anObject},$globals.Trapped)});
+//>>excludeEnd("ctx");
+},
+//>>excludeStart("ide", pragmas.excludeIdeData);
+args: ["anObject"],
+source: "cloneAndInject: anObject\x0a\x09^anObject asJQuery clone\x0a\x09\x09each: [ :i :each | self injectToElement: each ];\x0a\x09\x09get: 0",
+referencedClasses: [],
+//>>excludeEnd("ide");
+messageSends: ["each:", "clone", "asJQuery", "injectToElement:", "get:"]
+}),
+$globals.Trapped);
+
+$core.addMethod(
+$core.method({
+selector: "descend:snapshotDo:",
+protocol: 'private',
+fn: function (anArray,aBlock){
+var self=this;
+var tpsc;
+function $TrappedPathStack(){return $globals.TrappedPathStack||(typeof TrappedPathStack=="undefined"?nil:TrappedPathStack)}
+function $TrappedSnapshot(){return $globals.TrappedSnapshot||(typeof TrappedSnapshot=="undefined"?nil:TrappedSnapshot)}
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+return $core.withContext(function($ctx1) {
+//>>excludeEnd("ctx");
+tpsc=$recv($TrappedPathStack())._current();
+$recv(tpsc)._append_do_(anArray,(function(){
+var path,model;
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+return $core.withContext(function($ctx2) {
+//>>excludeEnd("ctx");
+path=$recv($recv(tpsc)._elements())._copy();
+path;
+model=self._byName_($recv(path)._first());
+model;
+return $recv(aBlock)._value_($recv($recv($TrappedSnapshot())._new())._path_model_(path,model));
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+}, function($ctx2) {$ctx2.fillBlock({path:path,model:model},$ctx1,1)});
+//>>excludeEnd("ctx");
+}));
+return self;
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+}, function($ctx1) {$ctx1.fill(self,"descend:snapshotDo:",{anArray:anArray,aBlock:aBlock,tpsc:tpsc},$globals.Trapped)});
+//>>excludeEnd("ctx");
+},
+//>>excludeStart("ide", pragmas.excludeIdeData);
+args: ["anArray", "aBlock"],
+source: "descend: anArray snapshotDo: aBlock\x0a\x09| tpsc |\x0a    tpsc := TrappedPathStack current.\x0a    tpsc append: anArray do: [\x0a        | path model |\x0a        path := tpsc elements copy.\x0a   \x09    model := self byName: path first.\x0a        aBlock value: (TrappedSnapshot new path: path model: model)\x0a    ]",
+referencedClasses: ["TrappedPathStack", "TrappedSnapshot"],
+//>>excludeEnd("ide");
+messageSends: ["current", "append:do:", "copy", "elements", "byName:", "first", "value:", "path:model:", "new"]
+}),
+$globals.Trapped);
+
+$core.addMethod(
+$core.method({
+selector: "initialize",
+protocol: 'initialization',
+fn: function (){
+var self=this;
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+return $core.withContext(function($ctx1) {
+//>>excludeEnd("ctx");
+(
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+$ctx1.supercall = true, 
+//>>excludeEnd("ctx");
+$globals.Trapped.superclass.fn.prototype._initialize.apply($recv(self), []));
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+$ctx1.supercall = false;
+//>>excludeEnd("ctx");;
+self["@registry"]=$globals.HashedCollection._newFromPairs_([]);
+return self;
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+}, function($ctx1) {$ctx1.fill(self,"initialize",{},$globals.Trapped)});
+//>>excludeEnd("ctx");
+},
+//>>excludeStart("ide", pragmas.excludeIdeData);
+args: [],
+source: "initialize\x0a\x09super initialize.\x0a\x09registry := #{}.",
+referencedClasses: [],
+//>>excludeEnd("ide");
+messageSends: ["initialize"]
+}),
+$globals.Trapped);
+
+$core.addMethod(
+$core.method({
+selector: "injectToChildren:",
+protocol: 'private',
+fn: function (anElement){
+var self=this;
+var child;
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+return $core.withContext(function($ctx1) {
+//>>excludeEnd("ctx");
+child=$recv(anElement)._firstChild();
+$recv((function(){
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+return $core.withContext(function($ctx2) {
+//>>excludeEnd("ctx");
+return $recv(child)._isNil();
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+}, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
+//>>excludeEnd("ctx");
+}))._whileFalse_((function(){
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+return $core.withContext(function($ctx2) {
+//>>excludeEnd("ctx");
+self._injectToElement_(child);
+child=$recv(child)._nextSibling();
+return child;
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+}, function($ctx2) {$ctx2.fillBlock({},$ctx1,2)});
+//>>excludeEnd("ctx");
+}));
+return self;
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+}, function($ctx1) {$ctx1.fill(self,"injectToChildren:",{anElement:anElement,child:child},$globals.Trapped)});
+//>>excludeEnd("ctx");
+},
+//>>excludeStart("ide", pragmas.excludeIdeData);
+args: ["anElement"],
+source: "injectToChildren: anElement\x0a\x09| child |\x0a\x09child := anElement firstChild.\x0a\x09[ child isNil ] whileFalse: [ self injectToElement: child. child := child nextSibling ]",
+referencedClasses: [],
+//>>excludeEnd("ide");
+messageSends: ["firstChild", "whileFalse:", "isNil", "injectToElement:", "nextSibling"]
+}),
+$globals.Trapped);
+
+$core.addMethod(
+$core.method({
+selector: "injectToElement:",
+protocol: 'private',
+fn: function (anElement){
+var self=this;
+var jq;
+function $Trapped(){return $globals.Trapped||(typeof Trapped=="undefined"?nil:Trapped)}
+function $HTMLCanvas(){return $globals.HTMLCanvas||(typeof HTMLCanvas=="undefined"?nil:HTMLCanvas)}
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+return $core.withContext(function($ctx1) {
+//>>excludeEnd("ctx");
+var $1,$receiver;
+jq=$recv(anElement)._asJQuery();
+$1=$recv(jq)._attr_("data-trap");
+if(($receiver = $1) == null || $receiver.isNil){
+$1;
+} else {
+var attr;
+attr=$receiver;
+$recv(jq)._removeAttr_("data-trap");
+$recv($recv($Trapped())._parse_(attr))._do_((function(rule){
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+return $core.withContext(function($ctx2) {
+//>>excludeEnd("ctx");
+return $recv($recv($recv($HTMLCanvas())._onJQuery_(jq))._root())._trap_processors_($recv(rule)._first(),$recv(rule)._at_ifAbsent_((2),(function(){
+return [];
+
+})));
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+}, function($ctx2) {$ctx2.fillBlock({rule:rule},$ctx1,2)});
+//>>excludeEnd("ctx");
+}));
+};
+self._injectToChildren_(anElement);
+return self;
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+}, function($ctx1) {$ctx1.fill(self,"injectToElement:",{anElement:anElement,jq:jq},$globals.Trapped)});
+//>>excludeEnd("ctx");
+},
+//>>excludeStart("ide", pragmas.excludeIdeData);
+args: ["anElement"],
+source: "injectToElement: anElement\x0a\x09| jq |\x0a\x09jq := anElement asJQuery.\x0a\x09(jq attr: 'data-trap') ifNotNil: [ :attr |\x0a\x09\x09jq removeAttr: 'data-trap'.\x0a\x09\x09(Trapped parse: attr) do: [ :rule |\x0a\x09\x09\x09(HTMLCanvas onJQuery: jq) root trap: rule first processors: (rule at: 2 ifAbsent: [#()]) ] ].\x0a\x09self injectToChildren: anElement",
+referencedClasses: ["Trapped", "HTMLCanvas"],
+//>>excludeEnd("ide");
+messageSends: ["asJQuery", "ifNotNil:", "attr:", "removeAttr:", "do:", "parse:", "trap:processors:", "root", "onJQuery:", "first", "at:ifAbsent:", "injectToChildren:"]
+}),
+$globals.Trapped);
+
+$core.addMethod(
+$core.method({
+selector: "register:",
+protocol: 'accessing',
+fn: function (aListKeyedEntity){
+var self=this;
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+return $core.withContext(function($ctx1) {
+//>>excludeEnd("ctx");
+self._register_name_(aListKeyedEntity,$recv($recv(aListKeyedEntity)._class())._name());
+return self;
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+}, function($ctx1) {$ctx1.fill(self,"register:",{aListKeyedEntity:aListKeyedEntity},$globals.Trapped)});
+//>>excludeEnd("ctx");
+},
+//>>excludeStart("ide", pragmas.excludeIdeData);
+args: ["aListKeyedEntity"],
+source: "register: aListKeyedEntity\x0a\x09self register: aListKeyedEntity name: aListKeyedEntity class name",
+referencedClasses: [],
+//>>excludeEnd("ide");
+messageSends: ["register:name:", "name", "class"]
+}),
+$globals.Trapped);
+
+$core.addMethod(
+$core.method({
+selector: "register:name:",
+protocol: 'accessing',
+fn: function (aListKeyedEntity,aString){
+var self=this;
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+return $core.withContext(function($ctx1) {
+//>>excludeEnd("ctx");
+$recv(self["@registry"])._at_put_(aString,aListKeyedEntity);
+return self;
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+}, function($ctx1) {$ctx1.fill(self,"register:name:",{aListKeyedEntity:aListKeyedEntity,aString:aString},$globals.Trapped)});
+//>>excludeEnd("ctx");
+},
+//>>excludeStart("ide", pragmas.excludeIdeData);
+args: ["aListKeyedEntity", "aString"],
+source: "register: aListKeyedEntity name: aString\x0a\x09registry at: aString put: aListKeyedEntity",
+referencedClasses: [],
+//>>excludeEnd("ide");
+messageSends: ["at:put:"]
+}),
+$globals.Trapped);
+
+$core.addMethod(
+$core.method({
+selector: "start:",
+protocol: 'action',
+fn: function (args){
+var self=this;
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+return $core.withContext(function($ctx1) {
+//>>excludeEnd("ctx");
+$recv(args)._do_((function(each){
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+return $core.withContext(function($ctx2) {
+//>>excludeEnd("ctx");
+return self._register_(each);
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+}, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,1)});
+//>>excludeEnd("ctx");
+}));
+self._injectToElement_(document);
+return self;
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+}, function($ctx1) {$ctx1.fill(self,"start:",{args:args},$globals.Trapped)});
+//>>excludeEnd("ctx");
+},
+//>>excludeStart("ide", pragmas.excludeIdeData);
+args: ["args"],
+source: "start: args\x0a\x09args do: [ :each | self register: each ].\x0a\x09self injectToElement: document",
+referencedClasses: [],
+//>>excludeEnd("ide");
+messageSends: ["do:", "register:", "injectToElement:"]
+}),
+$globals.Trapped);
+
+
+$core.addMethod(
+$core.method({
+selector: "loop:before:do:",
+protocol: 'private',
+fn: function (aSequenceableCollection,aNode,aBlock){
+var self=this;
+function $HTMLCanvas(){return $globals.HTMLCanvas||(typeof HTMLCanvas=="undefined"?nil:HTMLCanvas)}
+function $Array(){return $globals.Array||(typeof Array=="undefined"?nil:Array)}
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+return $core.withContext(function($ctx1) {
+//>>excludeEnd("ctx");
+$recv(aSequenceableCollection)._withIndexDo_((function(item,i){
+var env;
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+return $core.withContext(function($ctx2) {
+//>>excludeEnd("ctx");
+env=$recv(document)._createElement_("ins");
+env;
+$recv([i])._trapDescend_((function(){
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+return $core.withContext(function($ctx3) {
+//>>excludeEnd("ctx");
+return $recv($recv($recv($HTMLCanvas())._onJQuery_($recv(env)._asJQuery()))._root())._with_(aBlock);
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+}, function($ctx3) {$ctx3.fillBlock({},$ctx2,2)});
+//>>excludeEnd("ctx");
+}));
+return $recv($recv($Array())._streamContents_((function(str){
+var child;
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+return $core.withContext(function($ctx3) {
+//>>excludeEnd("ctx");
+child=$recv(env)._firstChild();
+child;
+return $recv((function(){
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+return $core.withContext(function($ctx4) {
+//>>excludeEnd("ctx");
+return $recv(child)._isNil();
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+}, function($ctx4) {$ctx4.fillBlock({},$ctx3,4)});
+//>>excludeEnd("ctx");
+}))._whileFalse_((function(){
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+return $core.withContext(function($ctx4) {
+//>>excludeEnd("ctx");
+$recv(str)._nextPut_(child);
+child=$recv(child)._nextSibling();
+return child;
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+}, function($ctx4) {$ctx4.fillBlock({},$ctx3,5)});
+//>>excludeEnd("ctx");
+}));
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+}, function($ctx3) {$ctx3.fillBlock({str:str,child:child},$ctx2,3)});
+//>>excludeEnd("ctx");
+})))._do_((function(each){
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+return $core.withContext(function($ctx3) {
+//>>excludeEnd("ctx");
+return $recv($recv(aNode)._parentNode())._insertBefore_reference_(each,aNode);
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+}, function($ctx3) {$ctx3.fillBlock({each:each},$ctx2,6)});
+//>>excludeEnd("ctx");
+}));
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+}, function($ctx2) {$ctx2.fillBlock({item:item,i:i,env:env},$ctx1,1)});
+//>>excludeEnd("ctx");
+}));
+return self;
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+}, function($ctx1) {$ctx1.fill(self,"loop:before:do:",{aSequenceableCollection:aSequenceableCollection,aNode:aNode,aBlock:aBlock},$globals.Trapped.klass)});
+//>>excludeEnd("ctx");
+},
+//>>excludeStart("ide", pragmas.excludeIdeData);
+args: ["aSequenceableCollection", "aNode", "aBlock"],
+source: "loop: aSequenceableCollection before: aNode do: aBlock\x0a\x09aSequenceableCollection withIndexDo: [ :item :i |\x0a\x09\x09| env |\x0a\x09\x09\x22env := document createDocumentFragment.\x22\x0a\x09\x09env := document createElement: 'ins'.\x0a\x09\x09{i} trapDescend: [ (HTMLCanvas onJQuery: env asJQuery) root with: aBlock ].\x0a\x09\x09\x22aNode parentNode insertBefore: env reference: aNode\x22\x0a\x09\x09(Array streamContents: [ :str |\x0a\x09\x09\x09| child |\x0a\x09\x09\x09child := env firstChild.\x0a\x09\x09\x09[ child isNil ] whileFalse: [\x0a\x09\x09\x09\x09str nextPut: child.\x0a\x09\x09\x09\x09child := child nextSibling ]])\x0a\x09\x09do: [ :each | aNode parentNode insertBefore: each reference: aNode ]\x0a\x09]",
+referencedClasses: ["HTMLCanvas", "Array"],
+//>>excludeEnd("ide");
+messageSends: ["withIndexDo:", "createElement:", "trapDescend:", "with:", "root", "onJQuery:", "asJQuery", "do:", "streamContents:", "firstChild", "whileFalse:", "isNil", "nextPut:", "nextSibling", "insertBefore:reference:", "parentNode"]
+}),
+$globals.Trapped.klass);
+
+$core.addMethod(
+$core.method({
+selector: "loop:between:and:do:",
+protocol: 'private',
+fn: function (aSequenceableCollection,aTagBrush,anotherTagBrush,aBlock){
+var self=this;
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+return $core.withContext(function($ctx1) {
+//>>excludeEnd("ctx");
+var $2,$3,$1,$receiver;
+$2=$recv(aTagBrush)._asJQuery();
+$3=$recv(anotherTagBrush)._element();
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+$ctx1.sendIdx["element"]=1;
+//>>excludeEnd("ctx");
+$1=$recv($2)._nextUntil_($3);
+$recv($1)._remove();
+if(($receiver = aSequenceableCollection) == null || $receiver.isNil){
+aSequenceableCollection;
+} else {
+self._loop_before_do_(aSequenceableCollection,$recv(anotherTagBrush)._element(),aBlock);
+};
+return self;
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+}, function($ctx1) {$ctx1.fill(self,"loop:between:and:do:",{aSequenceableCollection:aSequenceableCollection,aTagBrush:aTagBrush,anotherTagBrush:anotherTagBrush,aBlock:aBlock},$globals.Trapped.klass)});
+//>>excludeEnd("ctx");
+},
+//>>excludeStart("ide", pragmas.excludeIdeData);
+args: ["aSequenceableCollection", "aTagBrush", "anotherTagBrush", "aBlock"],
+source: "loop: aSequenceableCollection between: aTagBrush and: anotherTagBrush do: aBlock\x0a\x09(aTagBrush asJQuery nextUntil: anotherTagBrush element) remove.\x0a\x09aSequenceableCollection ifNotNil: [\x0a\x09\x09self loop: aSequenceableCollection before: anotherTagBrush element do: aBlock\x0a\x09]",
+referencedClasses: [],
+//>>excludeEnd("ide");
+messageSends: ["remove", "nextUntil:", "asJQuery", "element", "ifNotNil:", "loop:before:do:"]
+}),
+$globals.Trapped.klass);
+
+$core.addMethod(
+$core.method({
+selector: "parse:",
+protocol: 'accessing',
+fn: function (aString){
+var self=this;
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+return $core.withContext(function($ctx1) {
+//>>excludeEnd("ctx");
+var $2,$3,$4,$5,$6,$8,$7,$9,$10,$11,$12,$13,$14,$1;
+$2=$recv(aString)._tokenize_(".");
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+$ctx1.sendIdx["tokenize:"]=1;
+//>>excludeEnd("ctx");
+$1=$recv($2)._collect_((function(rule){
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+return $core.withContext(function($ctx2) {
+//>>excludeEnd("ctx");
+$3=$recv(rule)._tokenize_(":");
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+$ctx2.sendIdx["tokenize:"]=2;
+//>>excludeEnd("ctx");
+return $recv($3)._collect_((function(message){
+var result,stack,anArray;
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+return $core.withContext(function($ctx3) {
+//>>excludeEnd("ctx");
+anArray=$recv(message)._tokenize_(" ");
+anArray;
+result=[];
+result;
+stack=[result];
+stack;
+$recv(anArray)._do_((function(each){
+var asNum,inner,close;
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+return $core.withContext(function($ctx4) {
+//>>excludeEnd("ctx");
+close=(0);
+close;
+inner=each;
+inner;
+$recv((function(){
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+return $core.withContext(function($ctx5) {
+//>>excludeEnd("ctx");
+$4=$recv(inner)._notEmpty();
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+$ctx5.sendIdx["notEmpty"]=1;
+//>>excludeEnd("ctx");
+return $recv($4)._and_((function(){
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+return $core.withContext(function($ctx6) {
+//>>excludeEnd("ctx");
+$5=$recv(inner)._first();
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+$ctx6.sendIdx["first"]=1;
+//>>excludeEnd("ctx");
+return $recv($5).__eq("(");
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+$ctx6.sendIdx["="]=1;
+//>>excludeEnd("ctx");
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+}, function($ctx6) {$ctx6.fillBlock({},$ctx5,5)});
+//>>excludeEnd("ctx");
+}));
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+$ctx5.sendIdx["and:"]=1;
+//>>excludeEnd("ctx");
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+}, function($ctx5) {$ctx5.fillBlock({},$ctx4,4)});
+//>>excludeEnd("ctx");
+}))._whileTrue_((function(){
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+return $core.withContext(function($ctx5) {
+//>>excludeEnd("ctx");
+inner=$recv(inner)._allButFirst();
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+$ctx5.sendIdx["allButFirst"]=1;
+//>>excludeEnd("ctx");
+inner;
+$6=stack;
+$8=$recv(stack)._last();
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+$ctx5.sendIdx["last"]=1;
+//>>excludeEnd("ctx");
+$7=$recv($8)._add_([]);
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+$ctx5.sendIdx["add:"]=2;
+//>>excludeEnd("ctx");
+return $recv($6)._add_($7);
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+$ctx5.sendIdx["add:"]=1;
+//>>excludeEnd("ctx");
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+}, function($ctx5) {$ctx5.fillBlock({},$ctx4,6)});
+//>>excludeEnd("ctx");
+}));
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+$ctx4.sendIdx["whileTrue:"]=1;
+//>>excludeEnd("ctx");
+$recv((function(){
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+return $core.withContext(function($ctx5) {
+//>>excludeEnd("ctx");
+$9=$recv(inner)._notEmpty();
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+$ctx5.sendIdx["notEmpty"]=2;
+//>>excludeEnd("ctx");
+return $recv($9)._and_((function(){
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+return $core.withContext(function($ctx6) {
+//>>excludeEnd("ctx");
+$10=$recv(inner)._last();
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+$ctx6.sendIdx["last"]=2;
+//>>excludeEnd("ctx");
+return $recv($10).__eq(")");
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+$ctx6.sendIdx["="]=2;
+//>>excludeEnd("ctx");
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+}, function($ctx6) {$ctx6.fillBlock({},$ctx5,8)});
+//>>excludeEnd("ctx");
+}));
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+$ctx5.sendIdx["and:"]=2;
+//>>excludeEnd("ctx");
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+}, function($ctx5) {$ctx5.fillBlock({},$ctx4,7)});
+//>>excludeEnd("ctx");
+}))._whileTrue_((function(){
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+return $core.withContext(function($ctx5) {
+//>>excludeEnd("ctx");
+inner=$recv(inner)._allButLast();
+inner;
+close=$recv(close).__plus((1));
+return close;
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+}, function($ctx5) {$ctx5.fillBlock({},$ctx4,9)});
+//>>excludeEnd("ctx");
+}));
+$11=$recv($recv(inner)._notEmpty())._and_((function(){
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+return $core.withContext(function($ctx5) {
+//>>excludeEnd("ctx");
+return $recv($recv(inner)._first()).__eq("#");
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+$ctx5.sendIdx["="]=3;
+//>>excludeEnd("ctx");
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+}, function($ctx5) {$ctx5.fillBlock({},$ctx4,10)});
+//>>excludeEnd("ctx");
+}));
+if($core.assert($11)){
+inner=[$recv(inner)._allButFirst()];
+inner;
+};
+$12=$recv(inner)._isString();
+if($core.assert($12)){
+asNum=$recv($recv(inner)._ifEmpty_((function(){
+return "NaN";
+
+})))._asNumber();
+} else {
+asNum=inner;
+};
+asNum;
+$13=$recv(asNum).__eq(asNum);
+if($core.assert($13)){
+$14=$recv(stack)._last();
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+$ctx4.sendIdx["last"]=3;
+//>>excludeEnd("ctx");
+$recv($14)._add_(asNum);
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+$ctx4.sendIdx["add:"]=3;
+//>>excludeEnd("ctx");
+} else {
+$recv(inner)._ifNotEmpty_((function(){
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+return $core.withContext(function($ctx5) {
+//>>excludeEnd("ctx");
+return $recv($recv(stack)._last())._add_(inner);
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+}, function($ctx5) {$ctx5.fillBlock({},$ctx4,17)});
+//>>excludeEnd("ctx");
+}));
+};
+return $recv(close)._timesRepeat_((function(){
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+return $core.withContext(function($ctx5) {
+//>>excludeEnd("ctx");
+return $recv(stack)._removeLast();
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+}, function($ctx5) {$ctx5.fillBlock({},$ctx4,18)});
+//>>excludeEnd("ctx");
+}));
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+}, function($ctx4) {$ctx4.fillBlock({each:each,asNum:asNum,inner:inner,close:close},$ctx3,3)});
+//>>excludeEnd("ctx");
+}));
+return result;
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+}, function($ctx3) {$ctx3.fillBlock({message:message,result:result,stack:stack,anArray:anArray},$ctx2,2)});
+//>>excludeEnd("ctx");
+}));
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+}, function($ctx2) {$ctx2.fillBlock({rule:rule},$ctx1,1)});
+//>>excludeEnd("ctx");
+}));
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+$ctx1.sendIdx["collect:"]=1;
+//>>excludeEnd("ctx");
+return $1;
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+}, function($ctx1) {$ctx1.fill(self,"parse:",{aString:aString},$globals.Trapped.klass)});
+//>>excludeEnd("ctx");
+},
+//>>excludeStart("ide", pragmas.excludeIdeData);
+args: ["aString"],
+source: "parse: aString\x0a\x09^ (aString tokenize: '.') collect: [ :rule |\x0a\x09\x09(rule tokenize: ':') collect: [ :message |\x0a\x09\x09\x09| result stack anArray |\x0a\x09\x09\x09anArray := message tokenize: ' '.\x0a\x09\x09\x09result := #().\x0a\x09\x09\x09stack := { result }.\x0a\x09\x09\x09anArray do: [ :each |\x0a    \x09\x09\x09| asNum inner close |\x0a\x09\x09\x09\x09close := 0.\x0a\x09\x09\x09\x09inner := each.\x0a\x09\x09\x09\x09[ inner notEmpty and: [ inner first = '(' ]] whileTrue: [ inner := inner allButFirst. stack add: (stack last add: #()) ].\x0a\x09\x09\x09\x09[ inner notEmpty and: [ inner last = ')' ]] whileTrue: [ inner := inner allButLast. close := close + 1 ].\x0a\x09\x09\x09\x09(inner notEmpty and: [ inner first = '#' ]) ifTrue: [ inner := { inner allButFirst } ].\x0a\x09\x09       \x09asNum := inner isString ifTrue: [ (inner ifEmpty: [ 'NaN' ]) asNumber ] ifFalse: [ inner ].\x0a        \x09\x09asNum = asNum ifTrue: [ stack last add: asNum ] ifFalse: [\x0a\x09\x09\x09\x09\x09inner ifNotEmpty: [ stack last add: inner ] ].\x0a\x09\x09\x09\x09close timesRepeat: [ stack removeLast ] ].\x0a\x09\x09\x09result ] ]",
+referencedClasses: [],
+//>>excludeEnd("ide");
+messageSends: ["collect:", "tokenize:", "do:", "whileTrue:", "and:", "notEmpty", "=", "first", "allButFirst", "add:", "last", "allButLast", "+", "ifTrue:", "ifTrue:ifFalse:", "isString", "asNumber", "ifEmpty:", "ifNotEmpty:", "timesRepeat:", "removeLast"]
+}),
+$globals.Trapped.klass);
+
+
+$core.addClass('TrappedPathStack', $globals.TrappedSingleton, ['elements'], 'Trapped-Frontend');
+$core.addMethod(
+$core.method({
+selector: "append:do:",
+protocol: 'descending',
+fn: function (anArray,aBlock){
+var self=this;
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+return $core.withContext(function($ctx1) {
+//>>excludeEnd("ctx");
+self._with_do_($recv(self["@elements"]).__comma(anArray),aBlock);
+return self;
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+}, function($ctx1) {$ctx1.fill(self,"append:do:",{anArray:anArray,aBlock:aBlock},$globals.TrappedPathStack)});
+//>>excludeEnd("ctx");
+},
+//>>excludeStart("ide", pragmas.excludeIdeData);
+args: ["anArray", "aBlock"],
+source: "append: anArray do: aBlock\x0a    self with: elements, anArray do: aBlock",
+referencedClasses: [],
+//>>excludeEnd("ide");
+messageSends: ["with:do:", ","]
+}),
+$globals.TrappedPathStack);
+
+$core.addMethod(
+$core.method({
+selector: "elements",
+protocol: 'accessing',
+fn: function (){
+var self=this;
+var $1;
+$1=self["@elements"];
+return $1;
+
+},
+//>>excludeStart("ide", pragmas.excludeIdeData);
+args: [],
+source: "elements\x0a\x09^elements",
+referencedClasses: [],
+//>>excludeEnd("ide");
+messageSends: []
+}),
+$globals.TrappedPathStack);
+
+$core.addMethod(
+$core.method({
+selector: "initialize",
+protocol: 'initialization',
+fn: function (){
+var self=this;
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+return $core.withContext(function($ctx1) {
+//>>excludeEnd("ctx");
+(
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+$ctx1.supercall = true, 
+//>>excludeEnd("ctx");
+$globals.TrappedPathStack.superclass.fn.prototype._initialize.apply($recv(self), []));
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+$ctx1.supercall = false;
+//>>excludeEnd("ctx");;
+self["@elements"]=[];
+return self;
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+}, function($ctx1) {$ctx1.fill(self,"initialize",{},$globals.TrappedPathStack)});
+//>>excludeEnd("ctx");
+},
+//>>excludeStart("ide", pragmas.excludeIdeData);
+args: [],
+source: "initialize\x0a    super initialize.\x0a\x09elements := #().",
+referencedClasses: [],
+//>>excludeEnd("ide");
+messageSends: ["initialize"]
+}),
+$globals.TrappedPathStack);
+
+$core.addMethod(
+$core.method({
+selector: "with:do:",
+protocol: 'descending',
+fn: function (anArray,aBlock){
+var self=this;
+var old;
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+return $core.withContext(function($ctx1) {
+//>>excludeEnd("ctx");
+old=self["@elements"];
+$recv((function(){
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+return $core.withContext(function($ctx2) {
+//>>excludeEnd("ctx");
+self["@elements"]=anArray;
+self["@elements"];
+return $recv(aBlock)._value();
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+}, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
+//>>excludeEnd("ctx");
+}))._ensure_((function(){
+self["@elements"]=old;
+return self["@elements"];
+
+}));
+return self;
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+}, function($ctx1) {$ctx1.fill(self,"with:do:",{anArray:anArray,aBlock:aBlock,old:old},$globals.TrappedPathStack)});
+//>>excludeEnd("ctx");
+},
+//>>excludeStart("ide", pragmas.excludeIdeData);
+args: ["anArray", "aBlock"],
+source: "with: anArray do: aBlock\x0a\x09| old |\x0a    old := elements.\x0a    [ elements := anArray.\x0a\x09aBlock value ] ensure: [ elements := old ]",
+referencedClasses: [],
+//>>excludeEnd("ide");
+messageSends: ["ensure:", "value"]
+}),
+$globals.TrappedPathStack);
+
+
+
+$core.addClass('TrappedSnapshot', $globals.Object, ['path', 'model'], 'Trapped-Frontend');
+$core.addMethod(
+$core.method({
+selector: "do:",
+protocol: 'action',
+fn: function (aBlock){
+var self=this;
+function $TrappedPathStack(){return $globals.TrappedPathStack||(typeof TrappedPathStack=="undefined"?nil:TrappedPathStack)}
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+return $core.withContext(function($ctx1) {
+//>>excludeEnd("ctx");
+$recv($recv($TrappedPathStack())._current())._with_do_(self["@path"],(function(){
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+return $core.withContext(function($ctx2) {
+//>>excludeEnd("ctx");
+return $recv(aBlock)._value_(self["@model"]);
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+}, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
+//>>excludeEnd("ctx");
+}));
+return self;
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+}, function($ctx1) {$ctx1.fill(self,"do:",{aBlock:aBlock},$globals.TrappedSnapshot)});
+//>>excludeEnd("ctx");
+},
+//>>excludeStart("ide", pragmas.excludeIdeData);
+args: ["aBlock"],
+source: "do: aBlock\x0a\x09TrappedPathStack current with: path do: [ aBlock value: model ]",
+referencedClasses: ["TrappedPathStack"],
+//>>excludeEnd("ide");
+messageSends: ["with:do:", "current", "value:"]
+}),
+$globals.TrappedSnapshot);
+
+$core.addMethod(
+$core.method({
+selector: "model",
+protocol: 'accessing',
+fn: function (){
+var self=this;
+var $1;
+$1=self["@model"];
+return $1;
+
+},
+//>>excludeStart("ide", pragmas.excludeIdeData);
+args: [],
+source: "model\x0a\x09^model",
+referencedClasses: [],
+//>>excludeEnd("ide");
+messageSends: []
+}),
+$globals.TrappedSnapshot);
+
+$core.addMethod(
+$core.method({
+selector: "modify:",
+protocol: 'action',
+fn: function (aBlock){
+var self=this;
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+return $core.withContext(function($ctx1) {
+//>>excludeEnd("ctx");
+$recv(self._model())._modify_do_($recv(self._path())._allButFirst(),aBlock);
+return self;
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+}, function($ctx1) {$ctx1.fill(self,"modify:",{aBlock:aBlock},$globals.TrappedSnapshot)});
+//>>excludeEnd("ctx");
+},
+//>>excludeStart("ide", pragmas.excludeIdeData);
+args: ["aBlock"],
+source: "modify: aBlock\x0a\x09self model modify: self path allButFirst do: aBlock",
+referencedClasses: [],
+//>>excludeEnd("ide");
+messageSends: ["modify:do:", "model", "allButFirst", "path"]
+}),
+$globals.TrappedSnapshot);
+
+$core.addMethod(
+$core.method({
+selector: "path",
+protocol: 'accessing',
+fn: function (){
+var self=this;
+var $1;
+$1=self["@path"];
+return $1;
+
+},
+//>>excludeStart("ide", pragmas.excludeIdeData);
+args: [],
+source: "path\x0a\x09^path",
+referencedClasses: [],
+//>>excludeEnd("ide");
+messageSends: []
+}),
+$globals.TrappedSnapshot);
+
+$core.addMethod(
+$core.method({
+selector: "path:model:",
+protocol: 'accessing',
+fn: function (anArray,aTrappedMW){
+var self=this;
+self["@path"]=anArray;
+self["@model"]=aTrappedMW;
+return self;
+
+},
+//>>excludeStart("ide", pragmas.excludeIdeData);
+args: ["anArray", "aTrappedMW"],
+source: "path: anArray model: aTrappedMW\x0a\x09path := anArray.\x0a    model := aTrappedMW",
+referencedClasses: [],
+//>>excludeEnd("ide");
+messageSends: []
+}),
+$globals.TrappedSnapshot);
+
+$core.addMethod(
+$core.method({
+selector: "read:",
+protocol: 'action',
+fn: function (aBlock){
+var self=this;
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+return $core.withContext(function($ctx1) {
+//>>excludeEnd("ctx");
+$recv(self._model())._read_do_($recv(self._path())._allButFirst(),aBlock);
+return self;
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+}, function($ctx1) {$ctx1.fill(self,"read:",{aBlock:aBlock},$globals.TrappedSnapshot)});
+//>>excludeEnd("ctx");
+},
+//>>excludeStart("ide", pragmas.excludeIdeData);
+args: ["aBlock"],
+source: "read: aBlock\x0a\x09self model read: self path allButFirst do: aBlock",
+referencedClasses: [],
+//>>excludeEnd("ide");
+messageSends: ["read:do:", "model", "allButFirst", "path"]
+}),
+$globals.TrappedSnapshot);
+
+$core.addMethod(
+$core.method({
+selector: "watch:",
+protocol: 'action',
+fn: function (aBlock){
+var self=this;
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+return $core.withContext(function($ctx1) {
+//>>excludeEnd("ctx");
+$recv(self._model())._watch_do_($recv(self._path())._allButFirst(),aBlock);
+return self;
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+}, function($ctx1) {$ctx1.fill(self,"watch:",{aBlock:aBlock},$globals.TrappedSnapshot)});
+//>>excludeEnd("ctx");
+},
+//>>excludeStart("ide", pragmas.excludeIdeData);
+args: ["aBlock"],
+source: "watch: aBlock\x0a\x09self model watch: self path allButFirst do: aBlock",
+referencedClasses: [],
+//>>excludeEnd("ide");
+messageSends: ["watch:do:", "model", "allButFirst", "path"]
+}),
+$globals.TrappedSnapshot);
+
+
+$core.addMethod(
+$core.method({
+selector: "asTrapProcSendTo:",
+protocol: '*Trapped-Frontend',
+fn: function (anObject){
+var self=this;
+var selector,args;
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+return $core.withContext(function($ctx1) {
+//>>excludeEnd("ctx");
+var $1,$2;
+selector="";
+args=[];
+self._withIndexDo_((function(element,index){
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+return $core.withContext(function($ctx2) {
+//>>excludeEnd("ctx");
+$1=$recv(index)._odd();
+if($core.assert($1)){
+selector=$recv(selector).__comma(element);
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+$ctx2.sendIdx[","]=1;
+//>>excludeEnd("ctx");
+return selector;
+} else {
+selector=$recv(selector).__comma(":");
+selector;
+return $recv(args)._add_(element);
+};
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+}, function($ctx2) {$ctx2.fillBlock({element:element,index:index},$ctx1,1)});
+//>>excludeEnd("ctx");
+}));
+$2=$recv(anObject)._perform_withArguments_(selector,args);
+return $2;
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+}, function($ctx1) {$ctx1.fill(self,"asTrapProcSendTo:",{anObject:anObject,selector:selector,args:args},$globals.Array)});
+//>>excludeEnd("ctx");
+},
+//>>excludeStart("ide", pragmas.excludeIdeData);
+args: ["anObject"],
+source: "asTrapProcSendTo: anObject\x0a\x09| selector args |\x0a\x09selector := ''.\x0a\x09args := #().\x0a\x09\x09self withIndexDo: [ :element :index | index odd\x0a\x09\x09\x09ifTrue: [ selector := selector, element ]\x0a\x09\x09\x09ifFalse: [ selector := selector, ':'. args add: element ] ].\x0a\x09^anObject perform: selector withArguments: args",
+referencedClasses: [],
+//>>excludeEnd("ide");
+messageSends: ["withIndexDo:", "ifTrue:ifFalse:", "odd", ",", "add:", "perform:withArguments:"]
+}),
+$globals.Array);
+
+$core.addMethod(
+$core.method({
+selector: "trapDescend:",
+protocol: '*Trapped-Frontend',
+fn: function (aBlock){
+var self=this;
+function $Trapped(){return $globals.Trapped||(typeof Trapped=="undefined"?nil:Trapped)}
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+return $core.withContext(function($ctx1) {
+//>>excludeEnd("ctx");
+$recv($recv($Trapped())._current())._descend_snapshotDo_(self,aBlock);
+return self;
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+}, function($ctx1) {$ctx1.fill(self,"trapDescend:",{aBlock:aBlock},$globals.Array)});
+//>>excludeEnd("ctx");
+},
+//>>excludeStart("ide", pragmas.excludeIdeData);
+args: ["aBlock"],
+source: "trapDescend: aBlock\x0a\x09Trapped current descend: self snapshotDo: aBlock",
+referencedClasses: ["Trapped"],
+//>>excludeEnd("ide");
+messageSends: ["descend:snapshotDo:", "current"]
+}),
+$globals.Array);
+
+$core.addMethod(
+$core.method({
+selector: "trapIter:do:",
+protocol: '*Trapped-Frontend',
+fn: function (path,aBlock){
+var self=this;
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+return $core.withContext(function($ctx1) {
+//>>excludeEnd("ctx");
+var $1,$2;
+self._with_((function(html){
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+return $core.withContext(function($ctx2) {
+//>>excludeEnd("ctx");
+$1=$recv(html)._tag_("script");
+$recv($1)._at_put_("type","application/x-beacon");
+$2=$recv($1)._trapIter_after_(path,aBlock);
+return $2;
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+}, function($ctx2) {$ctx2.fillBlock({html:html},$ctx1,1)});
+//>>excludeEnd("ctx");
+}));
+return self;
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+}, function($ctx1) {$ctx1.fill(self,"trapIter:do:",{path:path,aBlock:aBlock},$globals.HTMLCanvas)});
+//>>excludeEnd("ctx");
+},
+//>>excludeStart("ide", pragmas.excludeIdeData);
+args: ["path", "aBlock"],
+source: "trapIter: path do: aBlock\x0a    self with: [ :html | (html tag: 'script') at: 'type' put: 'application/x-beacon'; trapIter: path after: aBlock ]",
+referencedClasses: [],
+//>>excludeEnd("ide");
+messageSends: ["with:", "at:put:", "tag:", "trapIter:after:"]
+}),
+$globals.HTMLCanvas);
+
+$core.addMethod(
+$core.method({
+selector: "asTrapProcSendTo:",
+protocol: '*Trapped-Frontend',
+fn: function (anObject){
+var self=this;
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+return $core.withContext(function($ctx1) {
+//>>excludeEnd("ctx");
+var $1;
+$1=$recv("Trapped cannot use processor descriptor of ".__comma($recv(self._class())._name())).__comma(" type.");
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+$ctx1.sendIdx[","]=1;
+//>>excludeEnd("ctx");
+self._error_($1);
+return self;
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+}, function($ctx1) {$ctx1.fill(self,"asTrapProcSendTo:",{anObject:anObject},$globals.Object)});
+//>>excludeEnd("ctx");
+},
+//>>excludeStart("ide", pragmas.excludeIdeData);
+args: ["anObject"],
+source: "asTrapProcSendTo: anObject\x0a\x09self error: 'Trapped cannot use processor descriptor of ', self class name, ' type.'",
+referencedClasses: [],
+//>>excludeEnd("ide");
+messageSends: ["error:", ",", "name", "class"]
+}),
+$globals.Object);
+
+$core.addMethod(
+$core.method({
+selector: "asTrapProcSendTo:",
+protocol: '*Trapped-Frontend',
+fn: function (anObject){
+var self=this;
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+return $core.withContext(function($ctx1) {
+//>>excludeEnd("ctx");
+var $1;
+$1=$recv(anObject)._perform_(self);
+return $1;
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+}, function($ctx1) {$ctx1.fill(self,"asTrapProcSendTo:",{anObject:anObject},$globals.String)});
+//>>excludeEnd("ctx");
+},
+//>>excludeStart("ide", pragmas.excludeIdeData);
+args: ["anObject"],
+source: "asTrapProcSendTo: anObject\x0a\x09^anObject perform: self",
+referencedClasses: [],
+//>>excludeEnd("ide");
+messageSends: ["perform:"]
+}),
+$globals.String);
+
+$core.addMethod(
+$core.method({
+selector: "trap:",
+protocol: '*Trapped-Frontend',
+fn: function (path){
+var self=this;
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+return $core.withContext(function($ctx1) {
+//>>excludeEnd("ctx");
+self._trap_processors_(path,[]);
+return self;
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+}, function($ctx1) {$ctx1.fill(self,"trap:",{path:path},$globals.TagBrush)});
+//>>excludeEnd("ctx");
+},
+//>>excludeStart("ide", pragmas.excludeIdeData);
+args: ["path"],
+source: "trap: path\x0a\x09self trap: path processors: #()",
+referencedClasses: [],
+//>>excludeEnd("ide");
+messageSends: ["trap:processors:"]
+}),
+$globals.TagBrush);
+
+$core.addMethod(
+$core.method({
+selector: "trap:processors:",
+protocol: '*Trapped-Frontend',
+fn: function (path,anArray){
+var self=this;
+function $TrappedProcessingChain(){return $globals.TrappedProcessingChain||(typeof TrappedProcessingChain=="undefined"?nil:TrappedProcessingChain)}
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+return $core.withContext(function($ctx1) {
+//>>excludeEnd("ctx");
+$recv(path)._trapDescend_((function(snap){
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+return $core.withContext(function($ctx2) {
+//>>excludeEnd("ctx");
+return $recv($recv($TrappedProcessingChain())._newFromProcessorSpecs_(anArray))._forSnapshot_andBrush_(snap,self);
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+}, function($ctx2) {$ctx2.fillBlock({snap:snap},$ctx1,1)});
+//>>excludeEnd("ctx");
+}));
+return self;
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+}, function($ctx1) {$ctx1.fill(self,"trap:processors:",{path:path,anArray:anArray},$globals.TagBrush)});
+//>>excludeEnd("ctx");
+},
+//>>excludeStart("ide", pragmas.excludeIdeData);
+args: ["path", "anArray"],
+source: "trap: path processors: anArray\x0a\x09path trapDescend: [ :snap |\x0a\x09\x09(TrappedProcessingChain newFromProcessorSpecs: anArray)\x0a\x09\x09\x09forSnapshot: snap andBrush: self ]",
+referencedClasses: ["TrappedProcessingChain"],
+//>>excludeEnd("ide");
+messageSends: ["trapDescend:", "forSnapshot:andBrush:", "newFromProcessorSpecs:"]
+}),
+$globals.TagBrush);
+
+$core.addMethod(
+$core.method({
+selector: "trap:read:",
+protocol: '*Trapped-Frontend',
+fn: function (path,aBlock){
+var self=this;
+function $KeyedPubSubUnsubscribe(){return $globals.KeyedPubSubUnsubscribe||(typeof KeyedPubSubUnsubscribe=="undefined"?nil:KeyedPubSubUnsubscribe)}
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+return $core.withContext(function($ctx1) {
+//>>excludeEnd("ctx");
+var $1;
+$recv(path)._trapDescend_((function(snap){
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+return $core.withContext(function($ctx2) {
+//>>excludeEnd("ctx");
+return $recv(snap)._watch_((function(data){
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+return $core.withContext(function($ctx3) {
+//>>excludeEnd("ctx");
+$1=$recv($recv($recv(self._asJQuery())._closest_("html"))._toArray())._isEmpty();
+if($core.assert($1)){
+$recv($KeyedPubSubUnsubscribe())._signal();
+};
+return $recv(snap)._do_((function(){
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+return $core.withContext(function($ctx4) {
+//>>excludeEnd("ctx");
+return self._with_((function(html){
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+return $core.withContext(function($ctx5) {
+//>>excludeEnd("ctx");
+return $recv(aBlock)._value_value_(data,html);
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+}, function($ctx5) {$ctx5.fillBlock({html:html},$ctx4,5)});
+//>>excludeEnd("ctx");
+}));
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+}, function($ctx4) {$ctx4.fillBlock({},$ctx3,4)});
+//>>excludeEnd("ctx");
+}));
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+}, function($ctx3) {$ctx3.fillBlock({data:data},$ctx2,2)});
+//>>excludeEnd("ctx");
+}));
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+}, function($ctx2) {$ctx2.fillBlock({snap:snap},$ctx1,1)});
+//>>excludeEnd("ctx");
+}));
+return self;
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+}, function($ctx1) {$ctx1.fill(self,"trap:read:",{path:path,aBlock:aBlock},$globals.TagBrush)});
+//>>excludeEnd("ctx");
+},
+//>>excludeStart("ide", pragmas.excludeIdeData);
+args: ["path", "aBlock"],
+source: "trap: path read: aBlock\x0a\x09path trapDescend: [ :snap |\x0a        snap watch: [ :data |\x0a            (self asJQuery closest: 'html') toArray isEmpty ifTrue: [ KeyedPubSubUnsubscribe signal ].\x0a        \x09snap do: [ self with: [ :html | aBlock value: data value: html ] ]\x0a    \x09]\x0a    ]",
+referencedClasses: ["KeyedPubSubUnsubscribe"],
+//>>excludeEnd("ide");
+messageSends: ["trapDescend:", "watch:", "ifTrue:", "isEmpty", "toArray", "closest:", "asJQuery", "signal", "do:", "with:", "value:value:"]
+}),
+$globals.TagBrush);
+
+$core.addMethod(
+$core.method({
+selector: "trapGuard:contents:",
+protocol: '*Trapped-Frontend',
+fn: function (anArray,aBlock){
+var self=this;
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+return $core.withContext(function($ctx1) {
+//>>excludeEnd("ctx");
+var $1,$2,$3,$4,$5,$receiver;
+[]._trapDescend_((function(snap){
+var shown;
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+return $core.withContext(function($ctx2) {
+//>>excludeEnd("ctx");
+shown=nil;
+shown;
+return self._trap_read_(anArray,(function(gdata){
+var sanitized;
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+return $core.withContext(function($ctx3) {
+//>>excludeEnd("ctx");
+if(($receiver = gdata) == null || $receiver.isNil){
+sanitized=false;
+} else {
+sanitized=gdata;
+};
+sanitized;
+$1=$recv(shown).__eq(sanitized);
+if(!$core.assert($1)){
+shown=sanitized;
+shown;
+$2=shown;
+if($core.assert($2)){
+$recv(snap)._do_((function(){
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+return $core.withContext(function($ctx4) {
+//>>excludeEnd("ctx");
+return self._contents_(aBlock);
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+}, function($ctx4) {$ctx4.fillBlock({},$ctx3,6)});
+//>>excludeEnd("ctx");
+}));
+$3=self._asJQuery();
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+$ctx3.sendIdx["asJQuery"]=1;
+//>>excludeEnd("ctx");
+return $recv($3)._show();
+} else {
+$4=self._asJQuery();
+$recv($4)._hide();
+$5=$recv($4)._empty();
+return $5;
+};
+};
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+}, function($ctx3) {$ctx3.fillBlock({gdata:gdata,sanitized:sanitized},$ctx2,2)});
+//>>excludeEnd("ctx");
+}));
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+}, function($ctx2) {$ctx2.fillBlock({snap:snap,shown:shown},$ctx1,1)});
+//>>excludeEnd("ctx");
+}));
+return self;
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+}, function($ctx1) {$ctx1.fill(self,"trapGuard:contents:",{anArray:anArray,aBlock:aBlock},$globals.TagBrush)});
+//>>excludeEnd("ctx");
+},
+//>>excludeStart("ide", pragmas.excludeIdeData);
+args: ["anArray", "aBlock"],
+source: "trapGuard: anArray contents: aBlock\x0a\x09#() trapDescend: [ :snap |\x0a\x09    | shown |\x0a    \x09shown := nil.\x0a\x09    self trap: anArray read: [ :gdata |\x0a\x09\x09\x09| sanitized |\x0a\x09\x09\x09sanitized := gdata ifNil: [ false ].\x0a    \x09    shown = sanitized ifFalse: [\x0a        \x09    shown := sanitized.\x0a            \x09shown\x0a\x09\x09\x09\x09\x09ifTrue: [ snap do: [ self contents: aBlock ]. self asJQuery show ]\x0a\x09\x09\x09\x09\x09ifFalse: [ self asJQuery hide; empty ] ] ] ]",
+referencedClasses: [],
+//>>excludeEnd("ide");
+messageSends: ["trapDescend:", "trap:read:", "ifNil:", "ifFalse:", "=", "ifTrue:ifFalse:", "do:", "contents:", "show", "asJQuery", "hide", "empty"]
+}),
+$globals.TagBrush);
+
+$core.addMethod(
+$core.method({
+selector: "trapIter:after:",
+protocol: '*Trapped-Frontend',
+fn: function (path,aBlock){
+var self=this;
+var end;
+function $TagBrush(){return $globals.TagBrush||(typeof TagBrush=="undefined"?nil:TagBrush)}
+function $Trapped(){return $globals.Trapped||(typeof Trapped=="undefined"?nil:Trapped)}
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+return $core.withContext(function($ctx1) {
+//>>excludeEnd("ctx");
+var $2,$1,$3;
+end=$recv($TagBrush())._fromJQuery_canvas_("<script type=\x22application/x-beacon\x22 />"._asJQuery(),self["@canvas"]);
+$2=self._element();
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+$ctx1.sendIdx["element"]=1;
+//>>excludeEnd("ctx");
+$1=$recv($2)._parentNode();
+$3=$recv(end)._element();
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+$ctx1.sendIdx["element"]=2;
+//>>excludeEnd("ctx");
+$recv($1)._insertBefore_reference_($3,$recv(self._element())._nextSibling());
+self._trap_read_(path,(function(model){
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+return $core.withContext(function($ctx2) {
+//>>excludeEnd("ctx");
+return $recv($Trapped())._loop_between_and_do_(model,self,end,aBlock);
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+}, function($ctx2) {$ctx2.fillBlock({model:model},$ctx1,1)});
+//>>excludeEnd("ctx");
+}));
+return self;
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+}, function($ctx1) {$ctx1.fill(self,"trapIter:after:",{path:path,aBlock:aBlock,end:end},$globals.TagBrush)});
+//>>excludeEnd("ctx");
+},
+//>>excludeStart("ide", pragmas.excludeIdeData);
+args: ["path", "aBlock"],
+source: "trapIter: path after: aBlock\x0a\x09| end |\x0a\x09end := TagBrush fromJQuery: ('<script type=\x22application/x-beacon\x22 />' asJQuery) canvas: canvas.\x0a\x09self element parentNode insertBefore: end element reference: self element nextSibling.\x0a    self trap: path read: [ :model |\x0a    \x09Trapped loop: model between: self and: end do: aBlock.\x0a    ]",
+referencedClasses: ["TagBrush", "Trapped"],
+//>>excludeEnd("ide");
+messageSends: ["fromJQuery:canvas:", "asJQuery", "insertBefore:reference:", "parentNode", "element", "nextSibling", "trap:read:", "loop:between:and:do:"]
+}),
+$globals.TagBrush);
+
+});

+ 24 - 15
st/Trapped-Frontend.st → src/Trapped-Frontend.st

@@ -1,4 +1,4 @@
-Smalltalk current createPackage: 'Trapped-Frontend'!
+Smalltalk createPackage: 'Trapped-Frontend'!
 Object subclass: #TrappedDataCarrier
 	instanceVariableNames: 'target model chain source'
 	package: 'Trapped-Frontend'!
@@ -385,9 +385,18 @@ parse: aString
 loop: aSequenceableCollection before: aNode do: aBlock
 	aSequenceableCollection withIndexDo: [ :item :i |
 		| env |
-		env := document createDocumentFragment.
+		"env := document createDocumentFragment."
+		env := document createElement: 'ins'.
 		{i} trapDescend: [ (HTMLCanvas onJQuery: env asJQuery) root with: aBlock ].
-		aNode parentNode insertBefore: env reference: aNode ]
+		"aNode parentNode insertBefore: env reference: aNode"
+		(Array streamContents: [ :str |
+			| child |
+			child := env firstChild.
+			[ child isNil ] whileFalse: [
+				str nextPut: child.
+				child := child nextSibling ]])
+		do: [ :each | aNode parentNode insertBefore: each reference: aNode ]
+	]
 !
 
 loop: aSequenceableCollection between: aTagBrush and: anotherTagBrush do: aBlock
@@ -464,18 +473,6 @@ watch: aBlock
 	self model watch: self path allButFirst do: aBlock
 ! !
 
-!Object methodsFor: '*Trapped-Frontend'!
-
-asTrapProcSendTo: anObject
-	self error: 'Trapped cannot use processor descriptor of ', self class name, ' type.'
-! !
-
-!String methodsFor: '*Trapped-Frontend'!
-
-asTrapProcSendTo: anObject
-	^anObject perform: self
-! !
-
 !Array methodsFor: '*Trapped-Frontend'!
 
 asTrapProcSendTo: anObject
@@ -498,6 +495,18 @@ trapIter: path do: aBlock
     self with: [ :html | (html tag: 'script') at: 'type' put: 'application/x-beacon'; trapIter: path after: aBlock ]
 ! !
 
+!Object methodsFor: '*Trapped-Frontend'!
+
+asTrapProcSendTo: anObject
+	self error: 'Trapped cannot use processor descriptor of ', self class name, ' type.'
+! !
+
+!String methodsFor: '*Trapped-Frontend'!
+
+asTrapProcSendTo: anObject
+	^anObject perform: self
+! !
+
 !TagBrush methodsFor: '*Trapped-Frontend'!
 
 trap: path

+ 2007 - 0
src/Trapped-Processors.js

@@ -0,0 +1,2007 @@
+define("trapped/Trapped-Processors", ["amber/boot"
+//>>excludeStart("imports", pragmas.excludeImports);
+, "jquery.xontent"
+//>>excludeEnd("imports");
+, "trapped/Trapped-Frontend"], function($boot
+//>>excludeStart("imports", pragmas.excludeImports);
+
+//>>excludeEnd("imports");
+){
+var $core=$boot.api,nil=$boot.nil,$recv=$boot.asReceiver,$globals=$boot.globals;
+$core.addPackage('Trapped-Processors');
+$core.packages["Trapped-Processors"].innerEval = function (expr) { return eval(expr); };
+$core.packages["Trapped-Processors"].imports = ["jquery.xontent"];
+$core.packages["Trapped-Processors"].transport = {"type":"amd","amdNamespace":"trapped"};
+
+$core.addClass('TrappedProcessorAttribute', $globals.TrappedDataExpectingProcessor, ['attrName'], 'Trapped-Processors');
+//>>excludeStart("ide", pragmas.excludeIdeData);
+$globals.TrappedProcessorAttribute.comment="I set the data into an attribute speciried when creating me.\x0aNo observing and sending back, atm.";
+//>>excludeEnd("ide");
+$core.addMethod(
+$core.method({
+selector: "attrName:",
+protocol: 'accessing',
+fn: function (aString){
+var self=this;
+self["@attrName"]=aString;
+return self;
+
+},
+//>>excludeStart("ide", pragmas.excludeIdeData);
+args: ["aString"],
+source: "attrName: aString\x0a\x09attrName := aString",
+referencedClasses: [],
+//>>excludeEnd("ide");
+messageSends: []
+}),
+$globals.TrappedProcessorAttribute);
+
+$core.addMethod(
+$core.method({
+selector: "toView:",
+protocol: 'data transformation',
+fn: function (aDataCarrier){
+var self=this;
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+return $core.withContext(function($ctx1) {
+//>>excludeEnd("ctx");
+$recv(aDataCarrier)._toTargetAttr_(self["@attrName"]);
+return self;
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+}, function($ctx1) {$ctx1.fill(self,"toView:",{aDataCarrier:aDataCarrier},$globals.TrappedProcessorAttribute)});
+//>>excludeEnd("ctx");
+},
+//>>excludeStart("ide", pragmas.excludeIdeData);
+args: ["aDataCarrier"],
+source: "toView: aDataCarrier\x0a\x09aDataCarrier toTargetAttr: attrName",
+referencedClasses: [],
+//>>excludeEnd("ide");
+messageSends: ["toTargetAttr:"]
+}),
+$globals.TrappedProcessorAttribute);
+
+
+$core.addMethod(
+$core.method({
+selector: "new:",
+protocol: 'instance creation',
+fn: function (aString){
+var self=this;
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+return $core.withContext(function($ctx1) {
+//>>excludeEnd("ctx");
+var $2,$3,$1;
+$2=self._new();
+$recv($2)._attrName_(aString);
+$3=$recv($2)._yourself();
+$1=$3;
+return $1;
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+}, function($ctx1) {$ctx1.fill(self,"new:",{aString:aString},$globals.TrappedProcessorAttribute.klass)});
+//>>excludeEnd("ctx");
+},
+//>>excludeStart("ide", pragmas.excludeIdeData);
+args: ["aString"],
+source: "new: aString\x0a\x09^self new\x0a\x09\x09attrName: aString;\x0a\x09\x09yourself",
+referencedClasses: [],
+//>>excludeEnd("ide");
+messageSends: ["attrName:", "new", "yourself"]
+}),
+$globals.TrappedProcessorAttribute.klass);
+
+
+$core.addClass('TrappedProcessorDataAdhoc', $globals.TrappedDataExpectingProcessor, ['toViewBlock'], 'Trapped-Processors');
+//>>excludeStart("ide", pragmas.excludeIdeData);
+$globals.TrappedProcessorDataAdhoc.comment="I put data into target via contents: in toView:";
+//>>excludeEnd("ide");
+$core.addMethod(
+$core.method({
+selector: "toView:",
+protocol: 'data transformation',
+fn: function (aDataCarrier){
+var self=this;
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+return $core.withContext(function($ctx1) {
+//>>excludeEnd("ctx");
+$recv(self["@toViewBlock"])._value_(aDataCarrier);
+return self;
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+}, function($ctx1) {$ctx1.fill(self,"toView:",{aDataCarrier:aDataCarrier},$globals.TrappedProcessorDataAdhoc)});
+//>>excludeEnd("ctx");
+},
+//>>excludeStart("ide", pragmas.excludeIdeData);
+args: ["aDataCarrier"],
+source: "toView: aDataCarrier\x0a\x09toViewBlock value: aDataCarrier",
+referencedClasses: [],
+//>>excludeEnd("ide");
+messageSends: ["value:"]
+}),
+$globals.TrappedProcessorDataAdhoc);
+
+$core.addMethod(
+$core.method({
+selector: "toViewBlock:",
+protocol: 'accessing',
+fn: function (aBlock){
+var self=this;
+self["@toViewBlock"]=aBlock;
+return self;
+
+},
+//>>excludeStart("ide", pragmas.excludeIdeData);
+args: ["aBlock"],
+source: "toViewBlock: aBlock\x0a\x09toViewBlock := aBlock",
+referencedClasses: [],
+//>>excludeEnd("ide");
+messageSends: []
+}),
+$globals.TrappedProcessorDataAdhoc);
+
+
+$core.addMethod(
+$core.method({
+selector: "newToView:",
+protocol: 'instance creation',
+fn: function (aBlock){
+var self=this;
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+return $core.withContext(function($ctx1) {
+//>>excludeEnd("ctx");
+var $2,$3,$1;
+$2=self._new();
+$recv($2)._toViewBlock_(aBlock);
+$3=$recv($2)._yourself();
+$1=$3;
+return $1;
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+}, function($ctx1) {$ctx1.fill(self,"newToView:",{aBlock:aBlock},$globals.TrappedProcessorDataAdhoc.klass)});
+//>>excludeEnd("ctx");
+},
+//>>excludeStart("ide", pragmas.excludeIdeData);
+args: ["aBlock"],
+source: "newToView: aBlock\x0a\x09^self new\x0a\x09\x09toViewBlock: aBlock;\x0a\x09\x09yourself",
+referencedClasses: [],
+//>>excludeEnd("ide");
+messageSends: ["toViewBlock:", "new", "yourself"]
+}),
+$globals.TrappedProcessorDataAdhoc.klass);
+
+
+$core.addClass('TrappedProcessorDescend', $globals.TrappedProcessor, [], 'Trapped-Processors');
+//>>excludeStart("ide", pragmas.excludeIdeData);
+$globals.TrappedProcessorDescend.comment="I intepret data-trap in descendants of my brush.";
+//>>excludeEnd("ide");
+$core.addMethod(
+$core.method({
+selector: "toView:",
+protocol: 'data transformation',
+fn: function (aDataCarrier){
+var self=this;
+function $Trapped(){return $globals.Trapped||(typeof Trapped=="undefined"?nil:Trapped)}
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+return $core.withContext(function($ctx1) {
+//>>excludeEnd("ctx");
+$recv($recv($Trapped())._current())._injectToChildren_($recv($recv(aDataCarrier)._target())._element());
+return self;
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+}, function($ctx1) {$ctx1.fill(self,"toView:",{aDataCarrier:aDataCarrier},$globals.TrappedProcessorDescend)});
+//>>excludeEnd("ctx");
+},
+//>>excludeStart("ide", pragmas.excludeIdeData);
+args: ["aDataCarrier"],
+source: "toView: aDataCarrier\x0a\x09Trapped current injectToChildren: aDataCarrier target element",
+referencedClasses: ["Trapped"],
+//>>excludeEnd("ide");
+messageSends: ["injectToChildren:", "current", "element", "target"]
+}),
+$globals.TrappedProcessorDescend);
+
+
+
+$core.addClass('TrappedProcessorGuardBase', $globals.TrappedProcessor, ['guardPath'], 'Trapped-Processors');
+//>>excludeStart("ide", pragmas.excludeIdeData);
+$globals.TrappedProcessorGuardBase.comment="I serve as base class for brush-guarding processors.\x0a\x0aI cover instantiation and subclasses have to provide\x0aimplementation of toVIew: that react appropriately to guard releasing.";
+//>>excludeEnd("ide");
+$core.addMethod(
+$core.method({
+selector: "guardPath:",
+protocol: 'accessing',
+fn: function (anArray){
+var self=this;
+self["@guardPath"]=anArray;
+return self;
+
+},
+//>>excludeStart("ide", pragmas.excludeIdeData);
+args: ["anArray"],
+source: "guardPath: anArray\x0a\x09guardPath := anArray",
+referencedClasses: [],
+//>>excludeEnd("ide");
+messageSends: []
+}),
+$globals.TrappedProcessorGuardBase);
+
+$core.addMethod(
+$core.method({
+selector: "toModel:",
+protocol: 'data transformation',
+fn: function (aDataCarrier){
+var self=this;
+return self;
+
+},
+//>>excludeStart("ide", pragmas.excludeIdeData);
+args: ["aDataCarrier"],
+source: "toModel: aDataCarrier\x0a\x09\x22stop\x22",
+referencedClasses: [],
+//>>excludeEnd("ide");
+messageSends: []
+}),
+$globals.TrappedProcessorGuardBase);
+
+$core.addMethod(
+$core.method({
+selector: "toView:",
+protocol: 'data transformation',
+fn: function (aDataCarrier){
+var self=this;
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+return $core.withContext(function($ctx1) {
+//>>excludeEnd("ctx");
+self._subclassResponsibility();
+return self;
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+}, function($ctx1) {$ctx1.fill(self,"toView:",{aDataCarrier:aDataCarrier},$globals.TrappedProcessorGuardBase)});
+//>>excludeEnd("ctx");
+},
+//>>excludeStart("ide", pragmas.excludeIdeData);
+args: ["aDataCarrier"],
+source: "toView: aDataCarrier\x0a\x09self subclassResponsibility",
+referencedClasses: [],
+//>>excludeEnd("ide");
+messageSends: ["subclassResponsibility"]
+}),
+$globals.TrappedProcessorGuardBase);
+
+
+$core.addMethod(
+$core.method({
+selector: "new:",
+protocol: 'instance creation',
+fn: function (anArray){
+var self=this;
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+return $core.withContext(function($ctx1) {
+//>>excludeEnd("ctx");
+var $2,$3,$1;
+$2=self._new();
+$recv($2)._guardPath_(anArray);
+$3=$recv($2)._yourself();
+$1=$3;
+return $1;
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+}, function($ctx1) {$ctx1.fill(self,"new:",{anArray:anArray},$globals.TrappedProcessorGuardBase.klass)});
+//>>excludeEnd("ctx");
+},
+//>>excludeStart("ide", pragmas.excludeIdeData);
+args: ["anArray"],
+source: "new: anArray\x0a\x09^ self new\x0a\x09\x09guardPath: anArray;\x0a\x09\x09yourself",
+referencedClasses: [],
+//>>excludeEnd("ide");
+messageSends: ["guardPath:", "new", "yourself"]
+}),
+$globals.TrappedProcessorGuardBase.klass);
+
+
+$core.addClass('TrappedProcessorGuard', $globals.TrappedProcessorGuardBase, [], 'Trapped-Processors');
+//>>excludeStart("ide", pragmas.excludeIdeData);
+$globals.TrappedProcessorGuard.comment="I am used to guard contents filling process of the brush I am installed on.\x0a\x0aI observe guard expression in the model,\x0aand when it changes to nil or false, I delete the brush contents;\x0aon the other hand, when it changes to non-nil and non-false,\x0aI run the rest on the chain, which should be one-time\x0athat sets up the contents,";
+//>>excludeEnd("ide");
+$core.addMethod(
+$core.method({
+selector: "toView:",
+protocol: 'data transformation',
+fn: function (aDataCarrier){
+var self=this;
+var frozen,xon;
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+return $core.withContext(function($ctx1) {
+//>>excludeEnd("ctx");
+var $1,$2;
+frozen=$recv(aDataCarrier)._copy();
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+$ctx1.sendIdx["copy"]=1;
+//>>excludeEnd("ctx");
+xon=$recv(frozen)._xontent();
+$recv($recv(frozen)._target())._trapGuard_contents_(self["@guardPath"],(function(html){
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+return $core.withContext(function($ctx2) {
+//>>excludeEnd("ctx");
+$1=$recv(frozen)._copy();
+$recv($1)._target_($recv(html)._root());
+$recv($1)._xontent_(xon);
+$2=$recv($1)._proceed();
+return $2;
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+}, function($ctx2) {$ctx2.fillBlock({html:html},$ctx1,1)});
+//>>excludeEnd("ctx");
+}));
+return self;
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+}, function($ctx1) {$ctx1.fill(self,"toView:",{aDataCarrier:aDataCarrier,frozen:frozen,xon:xon},$globals.TrappedProcessorGuard)});
+//>>excludeEnd("ctx");
+},
+//>>excludeStart("ide", pragmas.excludeIdeData);
+args: ["aDataCarrier"],
+source: "toView: aDataCarrier\x0a\x09| frozen xon |\x0a\x09frozen := aDataCarrier copy.\x0a\x09xon := frozen xontent.\x0a\x09frozen target trapGuard: guardPath contents: [ :html | frozen copy target: html root; xontent: xon; proceed ]",
+referencedClasses: [],
+//>>excludeEnd("ide");
+messageSends: ["copy", "xontent", "trapGuard:contents:", "target", "target:", "root", "xontent:", "proceed"]
+}),
+$globals.TrappedProcessorGuard);
+
+
+
+$core.addClass('TrappedProcessorInputChecked', $globals.TrappedDataExpectingProcessor, [], 'Trapped-Processors');
+//>>excludeStart("ide", pragmas.excludeIdeData);
+$globals.TrappedProcessorInputChecked.comment="I bind to checkbox checked state.";
+//>>excludeEnd("ide");
+$core.addMethod(
+$core.method({
+selector: "installToView:toModel:",
+protocol: 'installation',
+fn: function (aDataCarrier,anotherDataCarrier){
+var self=this;
+var brush;
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+return $core.withContext(function($ctx1) {
+//>>excludeEnd("ctx");
+var $1,$2;
+brush=$recv(aDataCarrier)._target();
+$recv(brush)._onChange_((function(){
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+return $core.withContext(function($ctx2) {
+//>>excludeEnd("ctx");
+$1=$recv(anotherDataCarrier)._copy();
+$recv($1)._value_($recv($recv(brush)._asJQuery())._prop_("checked"));
+$2=$recv($1)._proceed();
+return $2;
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+}, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
+//>>excludeEnd("ctx");
+}));
+return self;
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+}, function($ctx1) {$ctx1.fill(self,"installToView:toModel:",{aDataCarrier:aDataCarrier,anotherDataCarrier:anotherDataCarrier,brush:brush},$globals.TrappedProcessorInputChecked)});
+//>>excludeEnd("ctx");
+},
+//>>excludeStart("ide", pragmas.excludeIdeData);
+args: ["aDataCarrier", "anotherDataCarrier"],
+source: "installToView: aDataCarrier toModel: anotherDataCarrier\x0a\x09| brush |\x0a\x09brush := aDataCarrier target.\x0a\x09brush onChange: [ anotherDataCarrier copy value: (brush asJQuery prop: 'checked'); proceed ]",
+referencedClasses: [],
+//>>excludeEnd("ide");
+messageSends: ["target", "onChange:", "value:", "copy", "prop:", "asJQuery", "proceed"]
+}),
+$globals.TrappedProcessorInputChecked);
+
+$core.addMethod(
+$core.method({
+selector: "toView:",
+protocol: 'data transformation',
+fn: function (aDataCarrier){
+var self=this;
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+return $core.withContext(function($ctx1) {
+//>>excludeEnd("ctx");
+$recv(aDataCarrier)._toTargetProp_("checked");
+return self;
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+}, function($ctx1) {$ctx1.fill(self,"toView:",{aDataCarrier:aDataCarrier},$globals.TrappedProcessorInputChecked)});
+//>>excludeEnd("ctx");
+},
+//>>excludeStart("ide", pragmas.excludeIdeData);
+args: ["aDataCarrier"],
+source: "toView: aDataCarrier\x0a\x09aDataCarrier toTargetProp: 'checked'",
+referencedClasses: [],
+//>>excludeEnd("ide");
+messageSends: ["toTargetProp:"]
+}),
+$globals.TrappedProcessorInputChecked);
+
+
+
+$core.addClass('TrappedProcessorInputValue', $globals.TrappedDataExpectingProcessor, [], 'Trapped-Processors');
+//>>excludeStart("ide", pragmas.excludeIdeData);
+$globals.TrappedProcessorInputValue.comment="I bind to input value.";
+//>>excludeEnd("ide");
+$core.addMethod(
+$core.method({
+selector: "installToView:toModel:",
+protocol: 'installation',
+fn: function (aDataCarrier,anotherDataCarrier){
+var self=this;
+var brush;
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+return $core.withContext(function($ctx1) {
+//>>excludeEnd("ctx");
+var $1,$2;
+brush=$recv(aDataCarrier)._target();
+$recv(brush)._onChange_((function(){
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+return $core.withContext(function($ctx2) {
+//>>excludeEnd("ctx");
+$1=$recv(anotherDataCarrier)._copy();
+$recv($1)._value_($recv($recv(brush)._asJQuery())._val());
+$2=$recv($1)._proceed();
+return $2;
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+}, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
+//>>excludeEnd("ctx");
+}));
+return self;
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+}, function($ctx1) {$ctx1.fill(self,"installToView:toModel:",{aDataCarrier:aDataCarrier,anotherDataCarrier:anotherDataCarrier,brush:brush},$globals.TrappedProcessorInputValue)});
+//>>excludeEnd("ctx");
+},
+//>>excludeStart("ide", pragmas.excludeIdeData);
+args: ["aDataCarrier", "anotherDataCarrier"],
+source: "installToView: aDataCarrier toModel: anotherDataCarrier\x0a\x09| brush |\x0a\x09brush := aDataCarrier target.\x0a\x09brush onChange: [ anotherDataCarrier copy value: brush asJQuery val; proceed ]",
+referencedClasses: [],
+//>>excludeEnd("ide");
+messageSends: ["target", "onChange:", "value:", "copy", "val", "asJQuery", "proceed"]
+}),
+$globals.TrappedProcessorInputValue);
+
+$core.addMethod(
+$core.method({
+selector: "toView:",
+protocol: 'data transformation',
+fn: function (aDataCarrier){
+var self=this;
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+return $core.withContext(function($ctx1) {
+//>>excludeEnd("ctx");
+$recv(aDataCarrier)._toTargetValue();
+return self;
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+}, function($ctx1) {$ctx1.fill(self,"toView:",{aDataCarrier:aDataCarrier},$globals.TrappedProcessorInputValue)});
+//>>excludeEnd("ctx");
+},
+//>>excludeStart("ide", pragmas.excludeIdeData);
+args: ["aDataCarrier"],
+source: "toView: aDataCarrier\x0a\x09aDataCarrier toTargetValue",
+referencedClasses: [],
+//>>excludeEnd("ide");
+messageSends: ["toTargetValue"]
+}),
+$globals.TrappedProcessorInputValue);
+
+
+
+$core.addClass('TrappedProcessorLoopBase', $globals.TrappedProcessor, [], 'Trapped-Processors');
+//>>excludeStart("ide", pragmas.excludeIdeData);
+$globals.TrappedProcessorLoopBase.comment="I serve as base class for looping processors.\x0a\x0aI cover instantiation and subclasses have to provide\x0aimplementation of toVIew: that loops appropriately.";
+//>>excludeEnd("ide");
+$core.addMethod(
+$core.method({
+selector: "toModel:",
+protocol: 'data transformation',
+fn: function (aDataCarrier){
+var self=this;
+return self;
+
+},
+//>>excludeStart("ide", pragmas.excludeIdeData);
+args: ["aDataCarrier"],
+source: "toModel: aDataCarrier\x0a\x09\x22stop\x22",
+referencedClasses: [],
+//>>excludeEnd("ide");
+messageSends: []
+}),
+$globals.TrappedProcessorLoopBase);
+
+$core.addMethod(
+$core.method({
+selector: "toView:",
+protocol: 'data transformation',
+fn: function (aDataCarrier){
+var self=this;
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+return $core.withContext(function($ctx1) {
+//>>excludeEnd("ctx");
+self._subclassResponsibility();
+return self;
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+}, function($ctx1) {$ctx1.fill(self,"toView:",{aDataCarrier:aDataCarrier},$globals.TrappedProcessorLoopBase)});
+//>>excludeEnd("ctx");
+},
+//>>excludeStart("ide", pragmas.excludeIdeData);
+args: ["aDataCarrier"],
+source: "toView: aDataCarrier\x0a\x09self subclassResponsibility",
+referencedClasses: [],
+//>>excludeEnd("ide");
+messageSends: ["subclassResponsibility"]
+}),
+$globals.TrappedProcessorLoopBase);
+
+
+
+$core.addClass('TrappedProcessorLoopZ', $globals.TrappedProcessorLoopBase, [], 'Trapped-Processors');
+//>>excludeStart("ide", pragmas.excludeIdeData);
+$globals.TrappedProcessorLoopZ.comment="I am used to loop over data and repeat the contents filling process\x0aof the brush I am installed on.\x0a\x0aI observe the data in the model,\x0aand when it changes, I loop over it\x0aand run the rest of the processing chain\x0afor each element, putting the result _after_ my brush.\x0a\x0aMy brush itself should be as least visible as possible,\x0aas it only serve as a position flag (use for example\x0ascript type=application/x-beacon, noscript, ins or del).";
+//>>excludeEnd("ide");
+$core.addMethod(
+$core.method({
+selector: "toView:",
+protocol: 'data transformation',
+fn: function (aDataCarrier){
+var self=this;
+var frozen,xon;
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+return $core.withContext(function($ctx1) {
+//>>excludeEnd("ctx");
+var $1,$2;
+frozen=$recv(aDataCarrier)._copy();
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+$ctx1.sendIdx["copy"]=1;
+//>>excludeEnd("ctx");
+xon=$recv(frozen)._xontent();
+$recv($recv(frozen)._target())._trapIter_after_([],(function(html){
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+return $core.withContext(function($ctx2) {
+//>>excludeEnd("ctx");
+$1=$recv(frozen)._copy();
+$recv($1)._target_($recv(html)._root());
+$recv($1)._xontent_(xon);
+$2=$recv($1)._proceed();
+return $2;
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+}, function($ctx2) {$ctx2.fillBlock({html:html},$ctx1,1)});
+//>>excludeEnd("ctx");
+}));
+return self;
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+}, function($ctx1) {$ctx1.fill(self,"toView:",{aDataCarrier:aDataCarrier,frozen:frozen,xon:xon},$globals.TrappedProcessorLoopZ)});
+//>>excludeEnd("ctx");
+},
+//>>excludeStart("ide", pragmas.excludeIdeData);
+args: ["aDataCarrier"],
+source: "toView: aDataCarrier\x0a\x09| frozen xon |\x0a\x09frozen := aDataCarrier copy.\x0a\x09xon := frozen xontent.\x0a\x09frozen target trapIter: #() after: [ :html | frozen copy target: html root; xontent: xon; proceed ]",
+referencedClasses: [],
+//>>excludeEnd("ide");
+messageSends: ["copy", "xontent", "trapIter:after:", "target", "target:", "root", "xontent:", "proceed"]
+}),
+$globals.TrappedProcessorLoopZ);
+
+
+
+$core.addClass('TrappedProcessorOptionValue', $globals.TrappedDataExpectingProcessor, [], 'Trapped-Processors');
+//>>excludeStart("ide", pragmas.excludeIdeData);
+$globals.TrappedProcessorOptionValue.comment="I set the option value.\x0a\x0aAdditionally, when changed (by toView:),\x0aI ping closest <select> with 'trappedselectreplay' event.";
+//>>excludeEnd("ide");
+$core.addMethod(
+$core.method({
+selector: "toView:",
+protocol: 'data transformation',
+fn: function (aDataCarrier){
+var self=this;
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+return $core.withContext(function($ctx1) {
+//>>excludeEnd("ctx");
+$recv(aDataCarrier)._toTargetValue();
+$recv($recv($recv($recv(aDataCarrier)._target())._asJQuery())._closest_("select"))._trigger_("trappedselectreplay");
+return self;
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+}, function($ctx1) {$ctx1.fill(self,"toView:",{aDataCarrier:aDataCarrier},$globals.TrappedProcessorOptionValue)});
+//>>excludeEnd("ctx");
+},
+//>>excludeStart("ide", pragmas.excludeIdeData);
+args: ["aDataCarrier"],
+source: "toView: aDataCarrier\x0a\x09aDataCarrier toTargetValue.\x0a\x09(aDataCarrier target asJQuery closest: 'select')\x0a\x09\x09trigger: 'trappedselectreplay'",
+referencedClasses: [],
+//>>excludeEnd("ide");
+messageSends: ["toTargetValue", "trigger:", "closest:", "asJQuery", "target"]
+}),
+$globals.TrappedProcessorOptionValue);
+
+
+
+$core.addClass('TrappedProcessorReplace', $globals.TrappedProcessor, ['left', 'right'], 'Trapped-Processors');
+//>>excludeStart("ide", pragmas.excludeIdeData);
+$globals.TrappedProcessorReplace.comment="I convert data to string representation and do a regex replace.\x0aI get two parameters, in toView:, first is replaced with second,\x0aand in toModel:, the second is replaced with first.\x0a\x0aI remove leading '^' and ending '$' from the string used as replacement,\x0aso it safe to replace ^to with ^To, for example.";
+//>>excludeEnd("ide");
+$core.addMethod(
+$core.method({
+selector: "left:",
+protocol: 'accessing',
+fn: function (aString){
+var self=this;
+self["@left"]=aString;
+return self;
+
+},
+//>>excludeStart("ide", pragmas.excludeIdeData);
+args: ["aString"],
+source: "left: aString\x0a\x09left := aString",
+referencedClasses: [],
+//>>excludeEnd("ide");
+messageSends: []
+}),
+$globals.TrappedProcessorReplace);
+
+$core.addMethod(
+$core.method({
+selector: "right:",
+protocol: 'accessing',
+fn: function (aString){
+var self=this;
+self["@right"]=aString;
+return self;
+
+},
+//>>excludeStart("ide", pragmas.excludeIdeData);
+args: ["aString"],
+source: "right: aString\x0a\x09right := aString",
+referencedClasses: [],
+//>>excludeEnd("ide");
+messageSends: []
+}),
+$globals.TrappedProcessorReplace);
+
+$core.addMethod(
+$core.method({
+selector: "toModel:",
+protocol: 'data transformation',
+fn: function (aDataCarrier){
+var self=this;
+var replacement,old;
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+return $core.withContext(function($ctx1) {
+//>>excludeEnd("ctx");
+var $1,$2;
+$1=$recv(self["@left"])._replace_with_("^\x5c^","");
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+$ctx1.sendIdx["replace:with:"]=2;
+//>>excludeEnd("ctx");
+replacement=$recv($1)._replace_with_("\x5c$$","");
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+$ctx1.sendIdx["replace:with:"]=1;
+//>>excludeEnd("ctx");
+old=$recv($recv(aDataCarrier)._value())._asString();
+$recv(aDataCarrier)._value_whenDifferentFrom_($recv(old)._replace_with_(self["@right"],replacement),old);
+$2=$recv(aDataCarrier)._proceed();
+return self;
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+}, function($ctx1) {$ctx1.fill(self,"toModel:",{aDataCarrier:aDataCarrier,replacement:replacement,old:old},$globals.TrappedProcessorReplace)});
+//>>excludeEnd("ctx");
+},
+//>>excludeStart("ide", pragmas.excludeIdeData);
+args: ["aDataCarrier"],
+source: "toModel: aDataCarrier\x0a\x09| replacement old |\x0a\x09replacement := (left replace: '^\x5c^' with: '') replace: '\x5c$$' with: ''.\x0a\x09old := aDataCarrier value asString.\x0a\x09aDataCarrier\x0a\x09\x09value: (old replace: right with: replacement) whenDifferentFrom: old;\x0a\x09\x09proceed",
+referencedClasses: [],
+//>>excludeEnd("ide");
+messageSends: ["replace:with:", "asString", "value", "value:whenDifferentFrom:", "proceed"]
+}),
+$globals.TrappedProcessorReplace);
+
+$core.addMethod(
+$core.method({
+selector: "toView:",
+protocol: 'data transformation',
+fn: function (aDataCarrier){
+var self=this;
+var replacement,old;
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+return $core.withContext(function($ctx1) {
+//>>excludeEnd("ctx");
+var $1,$2;
+$1=$recv(self["@right"])._replace_with_("^\x5c^","");
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+$ctx1.sendIdx["replace:with:"]=2;
+//>>excludeEnd("ctx");
+replacement=$recv($1)._replace_with_("\x5c$$","");
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+$ctx1.sendIdx["replace:with:"]=1;
+//>>excludeEnd("ctx");
+old=$recv($recv(aDataCarrier)._value())._asString();
+$recv(aDataCarrier)._value_whenDifferentFrom_($recv(old)._replace_with_(self["@left"],replacement),old);
+$2=$recv(aDataCarrier)._proceed();
+return self;
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+}, function($ctx1) {$ctx1.fill(self,"toView:",{aDataCarrier:aDataCarrier,replacement:replacement,old:old},$globals.TrappedProcessorReplace)});
+//>>excludeEnd("ctx");
+},
+//>>excludeStart("ide", pragmas.excludeIdeData);
+args: ["aDataCarrier"],
+source: "toView: aDataCarrier\x0a\x09| replacement old |\x0a\x09replacement := (right replace: '^\x5c^' with: '') replace: '\x5c$$' with: ''.\x0a\x09old := aDataCarrier value asString.\x0a\x09aDataCarrier\x0a\x09\x09value: (old replace: left with: replacement) whenDifferentFrom: old;\x0a\x09\x09proceed",
+referencedClasses: [],
+//>>excludeEnd("ide");
+messageSends: ["replace:with:", "asString", "value", "value:whenDifferentFrom:", "proceed"]
+}),
+$globals.TrappedProcessorReplace);
+
+
+$core.addMethod(
+$core.method({
+selector: "new:with:",
+protocol: 'instance creation',
+fn: function (aString,anotherString){
+var self=this;
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+return $core.withContext(function($ctx1) {
+//>>excludeEnd("ctx");
+var $2,$3,$4,$5,$1;
+$2=self._new();
+$3=$2;
+$4=$recv(aString)._asString();
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+$ctx1.sendIdx["asString"]=1;
+//>>excludeEnd("ctx");
+$recv($3)._left_($4);
+$recv($2)._right_($recv(anotherString)._asString());
+$5=$recv($2)._yourself();
+$1=$5;
+return $1;
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+}, function($ctx1) {$ctx1.fill(self,"new:with:",{aString:aString,anotherString:anotherString},$globals.TrappedProcessorReplace.klass)});
+//>>excludeEnd("ctx");
+},
+//>>excludeStart("ide", pragmas.excludeIdeData);
+args: ["aString", "anotherString"],
+source: "new: aString with: anotherString\x0a\x09^ self new\x0a\x09\x09left: aString asString;\x0a\x09\x09right: anotherString asString;\x0a\x09\x09yourself",
+referencedClasses: [],
+//>>excludeEnd("ide");
+messageSends: ["left:", "new", "asString", "right:", "yourself"]
+}),
+$globals.TrappedProcessorReplace.klass);
+
+
+$core.addClass('TrappedProcessorSelectValue', $globals.TrappedDataExpectingProcessor, [], 'Trapped-Processors');
+//>>excludeStart("ide", pragmas.excludeIdeData);
+$globals.TrappedProcessorSelectValue.comment="I bind to select value.\x0a\x0aWhen changed (by toView: or by user),\x0aI remember the selected set.\x0a\x0aWhen pinged by 'trappedselectreplay',\x0aI set the remembered value.\x0a\x0aThis allows to have select-option groups\x0awith later setting of option values\x0a(if those are set via related processor 'optionValue',\x0awhich pings me with 'trappedselectreplay').";
+//>>excludeEnd("ide");
+$core.addMethod(
+$core.method({
+selector: "installToView:toModel:",
+protocol: 'installation',
+fn: function (aDataCarrier,anotherDataCarrier){
+var self=this;
+var jq,val;
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+return $core.withContext(function($ctx1) {
+//>>excludeEnd("ctx");
+var $1,$2,$3,$4;
+jq=$recv($recv(aDataCarrier)._target())._asJQuery();
+val=$recv(jq)._val();
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+$ctx1.sendIdx["val"]=1;
+//>>excludeEnd("ctx");
+$1=jq;
+$recv($1)._data_("trapped.saved.val");
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+$ctx1.sendIdx["data:"]=1;
+//>>excludeEnd("ctx");
+$recv($1)._on_bind_("change",(function(){
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+return $core.withContext(function($ctx2) {
+//>>excludeEnd("ctx");
+$2=$recv(anotherDataCarrier)._copy();
+$recv($2)._value_($recv(jq)._val());
+$3=$recv($2)._proceed();
+return $3;
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+}, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
+//>>excludeEnd("ctx");
+}));
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+$ctx1.sendIdx["on:bind:"]=1;
+//>>excludeEnd("ctx");
+$4=$recv($1)._on_bind_("trappedselectreplay",(function(){
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+return $core.withContext(function($ctx2) {
+//>>excludeEnd("ctx");
+return $recv(jq)._val_($recv(jq)._data_("trapped.saved.val"));
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+}, function($ctx2) {$ctx2.fillBlock({},$ctx1,2)});
+//>>excludeEnd("ctx");
+}));
+return self;
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+}, function($ctx1) {$ctx1.fill(self,"installToView:toModel:",{aDataCarrier:aDataCarrier,anotherDataCarrier:anotherDataCarrier,jq:jq,val:val},$globals.TrappedProcessorSelectValue)});
+//>>excludeEnd("ctx");
+},
+//>>excludeStart("ide", pragmas.excludeIdeData);
+args: ["aDataCarrier", "anotherDataCarrier"],
+source: "installToView: aDataCarrier toModel: anotherDataCarrier\x0a\x09| jq val |\x0a\x09jq := aDataCarrier target asJQuery.\x0a\x09val := jq val.\x0a\x09jq\x0a\x09\x09data: 'trapped.saved.val';\x0a\x09\x09on: 'change' bind: [ anotherDataCarrier copy value: jq val; proceed ];\x0a\x09\x09on: 'trappedselectreplay' bind: [ jq val: (jq data: 'trapped.saved.val') ]",
+referencedClasses: [],
+//>>excludeEnd("ide");
+messageSends: ["asJQuery", "target", "val", "data:", "on:bind:", "value:", "copy", "proceed", "val:"]
+}),
+$globals.TrappedProcessorSelectValue);
+
+$core.addMethod(
+$core.method({
+selector: "toView:",
+protocol: 'data transformation',
+fn: function (aDataCarrier){
+var self=this;
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+return $core.withContext(function($ctx1) {
+//>>excludeEnd("ctx");
+$recv(aDataCarrier)._toTargetValue();
+$recv($recv($recv(aDataCarrier)._target())._asJQuery())._data_put_("trapped.saved.val",$recv(aDataCarrier)._value());
+return self;
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+}, function($ctx1) {$ctx1.fill(self,"toView:",{aDataCarrier:aDataCarrier},$globals.TrappedProcessorSelectValue)});
+//>>excludeEnd("ctx");
+},
+//>>excludeStart("ide", pragmas.excludeIdeData);
+args: ["aDataCarrier"],
+source: "toView: aDataCarrier\x0a\x09aDataCarrier toTargetValue.\x0a\x09aDataCarrier target asJQuery data: 'trapped.saved.val' put: aDataCarrier value",
+referencedClasses: [],
+//>>excludeEnd("ide");
+messageSends: ["toTargetValue", "data:put:", "asJQuery", "target", "value"]
+}),
+$globals.TrappedProcessorSelectValue);
+
+
+
+$core.addClass('TrappedProcessorSignal', $globals.TrappedProcessor, ['selector'], 'Trapped-Processors');
+//>>excludeStart("ide", pragmas.excludeIdeData);
+$globals.TrappedProcessorSignal.comment="Instead of writing data directly to model,\x0aI instead modify it by sending a message specified when instantiating me.";
+//>>excludeEnd("ide");
+$core.addMethod(
+$core.method({
+selector: "selector:",
+protocol: 'accessing',
+fn: function (aString){
+var self=this;
+self["@selector"]=aString;
+return self;
+
+},
+//>>excludeStart("ide", pragmas.excludeIdeData);
+args: ["aString"],
+source: "selector: aString\x0a\x09selector := aString",
+referencedClasses: [],
+//>>excludeEnd("ide");
+messageSends: []
+}),
+$globals.TrappedProcessorSignal);
+
+$core.addMethod(
+$core.method({
+selector: "toModel:",
+protocol: 'data transformation',
+fn: function (aDataCarrier){
+var self=this;
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+return $core.withContext(function($ctx1) {
+//>>excludeEnd("ctx");
+$recv(aDataCarrier)._modifyTargetByPerforming_(self["@selector"]);
+return self;
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+}, function($ctx1) {$ctx1.fill(self,"toModel:",{aDataCarrier:aDataCarrier},$globals.TrappedProcessorSignal)});
+//>>excludeEnd("ctx");
+},
+//>>excludeStart("ide", pragmas.excludeIdeData);
+args: ["aDataCarrier"],
+source: "toModel: aDataCarrier\x0a\x09aDataCarrier modifyTargetByPerforming: selector",
+referencedClasses: [],
+//>>excludeEnd("ide");
+messageSends: ["modifyTargetByPerforming:"]
+}),
+$globals.TrappedProcessorSignal);
+
+$core.addMethod(
+$core.method({
+selector: "toView:",
+protocol: 'data transformation',
+fn: function (aDataCarrier){
+var self=this;
+return self;
+
+},
+//>>excludeStart("ide", pragmas.excludeIdeData);
+args: ["aDataCarrier"],
+source: "toView: aDataCarrier\x0a\x09\x22stop\x22",
+referencedClasses: [],
+//>>excludeEnd("ide");
+messageSends: []
+}),
+$globals.TrappedProcessorSignal);
+
+
+$core.addMethod(
+$core.method({
+selector: "new:",
+protocol: 'instance creation',
+fn: function (aString){
+var self=this;
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+return $core.withContext(function($ctx1) {
+//>>excludeEnd("ctx");
+var $2,$3,$1;
+$2=self._new();
+$recv($2)._selector_(aString);
+$3=$recv($2)._yourself();
+$1=$3;
+return $1;
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+}, function($ctx1) {$ctx1.fill(self,"new:",{aString:aString},$globals.TrappedProcessorSignal.klass)});
+//>>excludeEnd("ctx");
+},
+//>>excludeStart("ide", pragmas.excludeIdeData);
+args: ["aString"],
+source: "new: aString\x0a\x09^self new\x0a\x09\x09selector: aString;\x0a\x09\x09yourself",
+referencedClasses: [],
+//>>excludeEnd("ide");
+messageSends: ["selector:", "new", "yourself"]
+}),
+$globals.TrappedProcessorSignal.klass);
+
+
+$core.addClass('TrappedProcessorToBlackboard', $globals.TrappedDataExpectingProcessor, [], 'Trapped-Processors');
+//>>excludeStart("ide", pragmas.excludeIdeData);
+$globals.TrappedProcessorToBlackboard.comment="I save the data to blackboard in toModel:, to position specified by path.";
+//>>excludeEnd("ide");
+$core.addMethod(
+$core.method({
+selector: "toModel:",
+protocol: 'data transformation',
+fn: function (aDataCarrier){
+var self=this;
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+return $core.withContext(function($ctx1) {
+//>>excludeEnd("ctx");
+$recv($recv(aDataCarrier)._target())._modify_((function(){
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+return $core.withContext(function($ctx2) {
+//>>excludeEnd("ctx");
+return $recv(aDataCarrier)._value();
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+}, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
+//>>excludeEnd("ctx");
+}));
+return self;
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+}, function($ctx1) {$ctx1.fill(self,"toModel:",{aDataCarrier:aDataCarrier},$globals.TrappedProcessorToBlackboard)});
+//>>excludeEnd("ctx");
+},
+//>>excludeStart("ide", pragmas.excludeIdeData);
+args: ["aDataCarrier"],
+source: "toModel: aDataCarrier\x0a\x09aDataCarrier target modify: [ aDataCarrier value ]",
+referencedClasses: [],
+//>>excludeEnd("ide");
+messageSends: ["modify:", "target", "value"]
+}),
+$globals.TrappedProcessorToBlackboard);
+
+
+
+$core.addClass('TrappedProcessorUriComponentDecode', $globals.TrappedProcessor, [], 'Trapped-Processors');
+//>>excludeStart("ide", pragmas.excludeIdeData);
+$globals.TrappedProcessorUriComponentDecode.comment="I uriComponentDecode in toView:\x0aand encode in toModel:";
+//>>excludeEnd("ide");
+$core.addMethod(
+$core.method({
+selector: "toModel:",
+protocol: 'data transformation',
+fn: function (aDataCarrier){
+var self=this;
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+return $core.withContext(function($ctx1) {
+//>>excludeEnd("ctx");
+var $1;
+$recv(aDataCarrier)._value_($recv($recv(aDataCarrier)._value())._uriComponentEncoded());
+$1=$recv(aDataCarrier)._proceed();
+return self;
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+}, function($ctx1) {$ctx1.fill(self,"toModel:",{aDataCarrier:aDataCarrier},$globals.TrappedProcessorUriComponentDecode)});
+//>>excludeEnd("ctx");
+},
+//>>excludeStart("ide", pragmas.excludeIdeData);
+args: ["aDataCarrier"],
+source: "toModel: aDataCarrier\x0a\x09aDataCarrier\x0a\x09\x09value: aDataCarrier value uriComponentEncoded;\x0a\x09\x09proceed",
+referencedClasses: [],
+//>>excludeEnd("ide");
+messageSends: ["value:", "uriComponentEncoded", "value", "proceed"]
+}),
+$globals.TrappedProcessorUriComponentDecode);
+
+$core.addMethod(
+$core.method({
+selector: "toView:",
+protocol: 'data transformation',
+fn: function (aDataCarrier){
+var self=this;
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+return $core.withContext(function($ctx1) {
+//>>excludeEnd("ctx");
+var $1;
+$recv(aDataCarrier)._value_($recv($recv(aDataCarrier)._value())._uriComponentDecoded());
+$1=$recv(aDataCarrier)._proceed();
+return self;
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+}, function($ctx1) {$ctx1.fill(self,"toView:",{aDataCarrier:aDataCarrier},$globals.TrappedProcessorUriComponentDecode)});
+//>>excludeEnd("ctx");
+},
+//>>excludeStart("ide", pragmas.excludeIdeData);
+args: ["aDataCarrier"],
+source: "toView: aDataCarrier\x0a\x09aDataCarrier\x0a\x09\x09value: aDataCarrier value uriComponentDecoded;\x0a\x09\x09proceed",
+referencedClasses: [],
+//>>excludeEnd("ide");
+messageSends: ["value:", "uriComponentDecoded", "value", "proceed"]
+}),
+$globals.TrappedProcessorUriComponentDecode);
+
+
+
+$core.addClass('TrappedProcessorUriComponentEncode', $globals.TrappedProcessor, [], 'Trapped-Processors');
+//>>excludeStart("ide", pragmas.excludeIdeData);
+$globals.TrappedProcessorUriComponentEncode.comment="I uriComponentEncode in toView:\x0aand decode in toModel:";
+//>>excludeEnd("ide");
+$core.addMethod(
+$core.method({
+selector: "toModel:",
+protocol: 'data transformation',
+fn: function (aDataCarrier){
+var self=this;
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+return $core.withContext(function($ctx1) {
+//>>excludeEnd("ctx");
+var $1;
+$recv(aDataCarrier)._value_($recv($recv(aDataCarrier)._value())._uriComponentDecoded());
+$1=$recv(aDataCarrier)._proceed();
+return self;
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+}, function($ctx1) {$ctx1.fill(self,"toModel:",{aDataCarrier:aDataCarrier},$globals.TrappedProcessorUriComponentEncode)});
+//>>excludeEnd("ctx");
+},
+//>>excludeStart("ide", pragmas.excludeIdeData);
+args: ["aDataCarrier"],
+source: "toModel: aDataCarrier\x0a\x09aDataCarrier\x0a\x09\x09value: aDataCarrier value uriComponentDecoded;\x0a\x09\x09proceed",
+referencedClasses: [],
+//>>excludeEnd("ide");
+messageSends: ["value:", "uriComponentDecoded", "value", "proceed"]
+}),
+$globals.TrappedProcessorUriComponentEncode);
+
+$core.addMethod(
+$core.method({
+selector: "toView:",
+protocol: 'data transformation',
+fn: function (aDataCarrier){
+var self=this;
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+return $core.withContext(function($ctx1) {
+//>>excludeEnd("ctx");
+var $1;
+$recv(aDataCarrier)._value_($recv($recv(aDataCarrier)._value())._uriComponentEncoded());
+$1=$recv(aDataCarrier)._proceed();
+return self;
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+}, function($ctx1) {$ctx1.fill(self,"toView:",{aDataCarrier:aDataCarrier},$globals.TrappedProcessorUriComponentEncode)});
+//>>excludeEnd("ctx");
+},
+//>>excludeStart("ide", pragmas.excludeIdeData);
+args: ["aDataCarrier"],
+source: "toView: aDataCarrier\x0a\x09aDataCarrier\x0a\x09\x09value: aDataCarrier value uriComponentEncoded;\x0a\x09\x09proceed",
+referencedClasses: [],
+//>>excludeEnd("ide");
+messageSends: ["value:", "uriComponentEncoded", "value", "proceed"]
+}),
+$globals.TrappedProcessorUriComponentEncode);
+
+
+
+$core.addClass('TrappedProcessorWhenClicked', $globals.TrappedProcessor, [], 'Trapped-Processors');
+//>>excludeStart("ide", pragmas.excludeIdeData);
+$globals.TrappedProcessorWhenClicked.comment="I bind to an element and send true to blackboard when clicked.";
+//>>excludeEnd("ide");
+$core.addMethod(
+$core.method({
+selector: "installToView:toModel:",
+protocol: 'installation',
+fn: function (aDataCarrier,anotherDataCarrier){
+var self=this;
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+return $core.withContext(function($ctx1) {
+//>>excludeEnd("ctx");
+$recv($recv(aDataCarrier)._target())._onClick_((function(){
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+return $core.withContext(function($ctx2) {
+//>>excludeEnd("ctx");
+$recv($recv(anotherDataCarrier)._copy())._proceed();
+return false;
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+}, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
+//>>excludeEnd("ctx");
+}));
+return self;
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+}, function($ctx1) {$ctx1.fill(self,"installToView:toModel:",{aDataCarrier:aDataCarrier,anotherDataCarrier:anotherDataCarrier},$globals.TrappedProcessorWhenClicked)});
+//>>excludeEnd("ctx");
+},
+//>>excludeStart("ide", pragmas.excludeIdeData);
+args: ["aDataCarrier", "anotherDataCarrier"],
+source: "installToView: aDataCarrier toModel: anotherDataCarrier\x0a\x09aDataCarrier target onClick: [ anotherDataCarrier copy proceed. false ]",
+referencedClasses: [],
+//>>excludeEnd("ide");
+messageSends: ["onClick:", "target", "proceed", "copy"]
+}),
+$globals.TrappedProcessorWhenClicked);
+
+
+
+$core.addClass('TrappedProcessorWhenSubmitted', $globals.TrappedProcessor, [], 'Trapped-Processors');
+//>>excludeStart("ide", pragmas.excludeIdeData);
+$globals.TrappedProcessorWhenSubmitted.comment="I bind to a form and send true to blackboard when submitted.";
+//>>excludeEnd("ide");
+$core.addMethod(
+$core.method({
+selector: "installToView:toModel:",
+protocol: 'installation',
+fn: function (aDataCarrier,anotherDataCarrier){
+var self=this;
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+return $core.withContext(function($ctx1) {
+//>>excludeEnd("ctx");
+$recv($recv(aDataCarrier)._target())._onSubmit_((function(){
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+return $core.withContext(function($ctx2) {
+//>>excludeEnd("ctx");
+$recv($recv(anotherDataCarrier)._copy())._proceed();
+return false;
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+}, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
+//>>excludeEnd("ctx");
+}));
+return self;
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+}, function($ctx1) {$ctx1.fill(self,"installToView:toModel:",{aDataCarrier:aDataCarrier,anotherDataCarrier:anotherDataCarrier},$globals.TrappedProcessorWhenSubmitted)});
+//>>excludeEnd("ctx");
+},
+//>>excludeStart("ide", pragmas.excludeIdeData);
+args: ["aDataCarrier", "anotherDataCarrier"],
+source: "installToView: aDataCarrier toModel: anotherDataCarrier\x0a\x09aDataCarrier target onSubmit: [ anotherDataCarrier copy proceed. false ]",
+referencedClasses: [],
+//>>excludeEnd("ide");
+messageSends: ["onSubmit:", "target", "proceed", "copy"]
+}),
+$globals.TrappedProcessorWhenSubmitted);
+
+
+
+$core.addClass('TrappedProcessorWidget', $globals.TrappedProcessor, ['viewName'], 'Trapped-Processors');
+//>>excludeStart("ide", pragmas.excludeIdeData);
+$globals.TrappedProcessorWidget.comment="I insert a widget instance of the class specified when creating me.";
+//>>excludeEnd("ide");
+$core.addMethod(
+$core.method({
+selector: "toView:",
+protocol: 'data transformation',
+fn: function (aDataCarrier){
+var self=this;
+function $Smalltalk(){return $globals.Smalltalk||(typeof Smalltalk=="undefined"?nil:Smalltalk)}
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+return $core.withContext(function($ctx1) {
+//>>excludeEnd("ctx");
+$recv($recv(aDataCarrier)._target())._with_($recv($recv($recv($Smalltalk())._current())._at_(self["@viewName"]))._new());
+return self;
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+}, function($ctx1) {$ctx1.fill(self,"toView:",{aDataCarrier:aDataCarrier},$globals.TrappedProcessorWidget)});
+//>>excludeEnd("ctx");
+},
+//>>excludeStart("ide", pragmas.excludeIdeData);
+args: ["aDataCarrier"],
+source: "toView: aDataCarrier\x0a\x09aDataCarrier target with: (Smalltalk current at: viewName) new",
+referencedClasses: ["Smalltalk"],
+//>>excludeEnd("ide");
+messageSends: ["with:", "target", "new", "at:", "current"]
+}),
+$globals.TrappedProcessorWidget);
+
+$core.addMethod(
+$core.method({
+selector: "viewName:",
+protocol: 'accessing',
+fn: function (aString){
+var self=this;
+self["@viewName"]=aString;
+return self;
+
+},
+//>>excludeStart("ide", pragmas.excludeIdeData);
+args: ["aString"],
+source: "viewName: aString\x0a\x09viewName := aString",
+referencedClasses: [],
+//>>excludeEnd("ide");
+messageSends: []
+}),
+$globals.TrappedProcessorWidget);
+
+
+$core.addMethod(
+$core.method({
+selector: "new:",
+protocol: 'instance creation',
+fn: function (aString){
+var self=this;
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+return $core.withContext(function($ctx1) {
+//>>excludeEnd("ctx");
+var $2,$3,$1;
+$2=self._new();
+$recv($2)._viewName_(aString);
+$3=$recv($2)._yourself();
+$1=$3;
+return $1;
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+}, function($ctx1) {$ctx1.fill(self,"new:",{aString:aString},$globals.TrappedProcessorWidget.klass)});
+//>>excludeEnd("ctx");
+},
+//>>excludeStart("ide", pragmas.excludeIdeData);
+args: ["aString"],
+source: "new: aString\x0a\x09^self new\x0a\x09\x09viewName: aString;\x0a\x09\x09yourself",
+referencedClasses: [],
+//>>excludeEnd("ide");
+messageSends: ["viewName:", "new", "yourself"]
+}),
+$globals.TrappedProcessorWidget.klass);
+
+
+$core.addClass('TrappedProcessorXontent', $globals.TrappedProcessor, [], 'Trapped-Processors');
+//>>excludeStart("ide", pragmas.excludeIdeData);
+$globals.TrappedProcessorXontent.comment="I am used to show xontent of the brush I am installed on\x0a(see jQuery plugin Xontent for details).\x0a\x0aI clone xontent of the brush, put it into HTML\x0aand interpret all contained data-trap attributes.";
+//>>excludeEnd("ide");
+$core.addMethod(
+$core.method({
+selector: "toView:",
+protocol: 'data transformation',
+fn: function (aDataCarrier){
+var self=this;
+function $Trapped(){return $globals.Trapped||(typeof Trapped=="undefined"?nil:Trapped)}
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+return $core.withContext(function($ctx1) {
+//>>excludeEnd("ctx");
+$recv($recv($recv(aDataCarrier)._target())._asJQuery())._append_($recv($recv($Trapped())._current())._cloneAndInject_($recv($recv(aDataCarrier)._xontent())._get_((0))));
+$recv(aDataCarrier)._proceed();
+return self;
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+}, function($ctx1) {$ctx1.fill(self,"toView:",{aDataCarrier:aDataCarrier},$globals.TrappedProcessorXontent)});
+//>>excludeEnd("ctx");
+},
+//>>excludeStart("ide", pragmas.excludeIdeData);
+args: ["aDataCarrier"],
+source: "toView: aDataCarrier\x0a\x09aDataCarrier target asJQuery append: (Trapped current cloneAndInject: (aDataCarrier xontent get: 0)).\x0a\x09aDataCarrier proceed",
+referencedClasses: ["Trapped"],
+//>>excludeEnd("ide");
+messageSends: ["append:", "asJQuery", "target", "cloneAndInject:", "current", "get:", "xontent", "proceed"]
+}),
+$globals.TrappedProcessorXontent);
+
+
+$core.addMethod(
+$core.method({
+selector: "modifyTarget",
+protocol: '*Trapped-Processors',
+fn: function (){
+var self=this;
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+return $core.withContext(function($ctx1) {
+//>>excludeEnd("ctx");
+$recv(self._target())._modify_((function(){
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+return $core.withContext(function($ctx2) {
+//>>excludeEnd("ctx");
+return self._value();
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+}, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
+//>>excludeEnd("ctx");
+}));
+return self;
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+}, function($ctx1) {$ctx1.fill(self,"modifyTarget",{},$globals.TrappedDataCarrier)});
+//>>excludeEnd("ctx");
+},
+//>>excludeStart("ide", pragmas.excludeIdeData);
+args: [],
+source: "modifyTarget\x0a\x09self target modify: [ self value ]",
+referencedClasses: [],
+//>>excludeEnd("ide");
+messageSends: ["modify:", "target", "value"]
+}),
+$globals.TrappedDataCarrier);
+
+$core.addMethod(
+$core.method({
+selector: "modifyTargetByPerforming:",
+protocol: '*Trapped-Processors',
+fn: function (aString){
+var self=this;
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+return $core.withContext(function($ctx1) {
+//>>excludeEnd("ctx");
+$recv(self._target())._modify_((function(m){
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+return $core.withContext(function($ctx2) {
+//>>excludeEnd("ctx");
+return $recv(m)._perform_(aString);
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+}, function($ctx2) {$ctx2.fillBlock({m:m},$ctx1,1)});
+//>>excludeEnd("ctx");
+}));
+return self;
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+}, function($ctx1) {$ctx1.fill(self,"modifyTargetByPerforming:",{aString:aString},$globals.TrappedDataCarrier)});
+//>>excludeEnd("ctx");
+},
+//>>excludeStart("ide", pragmas.excludeIdeData);
+args: ["aString"],
+source: "modifyTargetByPerforming: aString\x0a\x09self target modify: [ :m | m perform: aString ]",
+referencedClasses: [],
+//>>excludeEnd("ide");
+messageSends: ["modify:", "target", "perform:"]
+}),
+$globals.TrappedDataCarrier);
+
+$core.addMethod(
+$core.method({
+selector: "primitive:",
+protocol: '*Trapped-Processors',
+fn: function (anObject){
+var self=this;
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+return $core.withContext(function($ctx1) {
+//>>excludeEnd("ctx");
+return anObject === nil ? null : anObject.valueOf();
+return self;
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+}, function($ctx1) {$ctx1.fill(self,"primitive:",{anObject:anObject},$globals.TrappedDataCarrier)});
+//>>excludeEnd("ctx");
+},
+//>>excludeStart("ide", pragmas.excludeIdeData);
+args: ["anObject"],
+source: "primitive: anObject\x0a\x09<return anObject === nil ? null : anObject.valueOf()>",
+referencedClasses: [],
+//>>excludeEnd("ide");
+messageSends: []
+}),
+$globals.TrappedDataCarrier);
+
+$core.addMethod(
+$core.method({
+selector: "toTargetAttr:",
+protocol: '*Trapped-Processors',
+fn: function (aString){
+var self=this;
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+return $core.withContext(function($ctx1) {
+//>>excludeEnd("ctx");
+var $1,$2,$3,$5,$4,$receiver;
+$1=self._falseAsNilValue();
+if(($receiver = $1) == null || $receiver.isNil){
+$2=self._target();
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+$ctx1.sendIdx["target"]=1;
+//>>excludeEnd("ctx");
+$recv($2)._removeAt_(aString);
+} else {
+var value,bvalue;
+bvalue=$receiver;
+value=self._primitive_(bvalue);
+value;
+$3=self._target();
+$5=$recv(value).__eq(true);
+if($core.assert($5)){
+$4=aString;
+} else {
+$4=value;
+};
+$recv($3)._at_put_(aString,$4);
+};
+return self;
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+}, function($ctx1) {$ctx1.fill(self,"toTargetAttr:",{aString:aString},$globals.TrappedDataCarrier)});
+//>>excludeEnd("ctx");
+},
+//>>excludeStart("ide", pragmas.excludeIdeData);
+args: ["aString"],
+source: "toTargetAttr: aString\x0a\x09self falseAsNilValue\x0a\x09\x09ifNil: [ self target removeAt: aString ]\x0a\x09\x09ifNotNil: [ :bvalue |\x0a\x09\x09\x09| value |\x0a\x09\x09\x09value := self primitive: bvalue.\x0a\x09\x09\x09self target at: aString put: (value = true ifTrue: [ aString ] ifFalse: [ value ]) ]",
+referencedClasses: [],
+//>>excludeEnd("ide");
+messageSends: ["ifNil:ifNotNil:", "falseAsNilValue", "removeAt:", "target", "primitive:", "at:put:", "ifTrue:ifFalse:", "="]
+}),
+$globals.TrappedDataCarrier);
+
+$core.addMethod(
+$core.method({
+selector: "toTargetContents",
+protocol: '*Trapped-Processors',
+fn: function (){
+var self=this;
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+return $core.withContext(function($ctx1) {
+//>>excludeEnd("ctx");
+$recv(self._target())._contents_(self._primitive_(self._value()));
+return self;
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+}, function($ctx1) {$ctx1.fill(self,"toTargetContents",{},$globals.TrappedDataCarrier)});
+//>>excludeEnd("ctx");
+},
+//>>excludeStart("ide", pragmas.excludeIdeData);
+args: [],
+source: "toTargetContents\x0a\x09self target contents: (self primitive: self value)",
+referencedClasses: [],
+//>>excludeEnd("ide");
+messageSends: ["contents:", "target", "primitive:", "value"]
+}),
+$globals.TrappedDataCarrier);
+
+$core.addMethod(
+$core.method({
+selector: "toTargetProp:",
+protocol: '*Trapped-Processors',
+fn: function (aString){
+var self=this;
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+return $core.withContext(function($ctx1) {
+//>>excludeEnd("ctx");
+$recv($recv(self._target())._element())._at_put_(aString,self._primitive_(self._value()));
+return self;
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+}, function($ctx1) {$ctx1.fill(self,"toTargetProp:",{aString:aString},$globals.TrappedDataCarrier)});
+//>>excludeEnd("ctx");
+},
+//>>excludeStart("ide", pragmas.excludeIdeData);
+args: ["aString"],
+source: "toTargetProp: aString\x0a\x09self target element at: aString put: (self primitive: self value)",
+referencedClasses: [],
+//>>excludeEnd("ide");
+messageSends: ["at:put:", "element", "target", "primitive:", "value"]
+}),
+$globals.TrappedDataCarrier);
+
+$core.addMethod(
+$core.method({
+selector: "toTargetValue",
+protocol: '*Trapped-Processors',
+fn: function (){
+var self=this;
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+return $core.withContext(function($ctx1) {
+//>>excludeEnd("ctx");
+$recv($recv(self._target())._asJQuery())._val_(self._primitive_(self._value()));
+return self;
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+}, function($ctx1) {$ctx1.fill(self,"toTargetValue",{},$globals.TrappedDataCarrier)});
+//>>excludeEnd("ctx");
+},
+//>>excludeStart("ide", pragmas.excludeIdeData);
+args: [],
+source: "toTargetValue\x0a\x09self target asJQuery val: (self primitive: self value)",
+referencedClasses: [],
+//>>excludeEnd("ide");
+messageSends: ["val:", "asJQuery", "target", "primitive:", "value"]
+}),
+$globals.TrappedDataCarrier);
+
+$core.addMethod(
+$core.method({
+selector: "xontent",
+protocol: '*Trapped-Processors',
+fn: function (){
+var self=this;
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+return $core.withContext(function($ctx1) {
+//>>excludeEnd("ctx");
+var $1;
+$1=$recv($recv(self._target())._asJQuery())._xontent();
+return $1;
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+}, function($ctx1) {$ctx1.fill(self,"xontent",{},$globals.TrappedDataCarrier)});
+//>>excludeEnd("ctx");
+},
+//>>excludeStart("ide", pragmas.excludeIdeData);
+args: [],
+source: "xontent\x0a\x09^self target asJQuery xontent",
+referencedClasses: [],
+//>>excludeEnd("ide");
+messageSends: ["xontent", "asJQuery", "target"]
+}),
+$globals.TrappedDataCarrier);
+
+$core.addMethod(
+$core.method({
+selector: "xontent:",
+protocol: '*Trapped-Processors',
+fn: function (anObject){
+var self=this;
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+return $core.withContext(function($ctx1) {
+//>>excludeEnd("ctx");
+$recv($recv(self._target())._asJQuery())._xontent_data_("set",anObject);
+return self;
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+}, function($ctx1) {$ctx1.fill(self,"xontent:",{anObject:anObject},$globals.TrappedDataCarrier)});
+//>>excludeEnd("ctx");
+},
+//>>excludeStart("ide", pragmas.excludeIdeData);
+args: ["anObject"],
+source: "xontent: anObject\x0a\x09self target asJQuery xontent: 'set' data: anObject",
+referencedClasses: [],
+//>>excludeEnd("ide");
+messageSends: ["xontent:data:", "asJQuery", "target"]
+}),
+$globals.TrappedDataCarrier);
+
+$core.addMethod(
+$core.method({
+selector: "attr:",
+protocol: '*Trapped-Processors',
+fn: function (aString){
+var self=this;
+function $TrappedProcessorAttribute(){return $globals.TrappedProcessorAttribute||(typeof TrappedProcessorAttribute=="undefined"?nil:TrappedProcessorAttribute)}
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+return $core.withContext(function($ctx1) {
+//>>excludeEnd("ctx");
+var $1;
+$1=$recv($TrappedProcessorAttribute())._new_(aString);
+return $1;
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+}, function($ctx1) {$ctx1.fill(self,"attr:",{aString:aString},$globals.TrappedProcessor.klass)});
+//>>excludeEnd("ctx");
+},
+//>>excludeStart("ide", pragmas.excludeIdeData);
+args: ["aString"],
+source: "attr: aString\x0a\x09^TrappedProcessorAttribute new: aString",
+referencedClasses: ["TrappedProcessorAttribute"],
+//>>excludeEnd("ide");
+messageSends: ["new:"]
+}),
+$globals.TrappedProcessor.klass);
+
+$core.addMethod(
+$core.method({
+selector: "dataToView:",
+protocol: '*Trapped-Processors',
+fn: function (aBlock){
+var self=this;
+function $TrappedProcessorDataAdhoc(){return $globals.TrappedProcessorDataAdhoc||(typeof TrappedProcessorDataAdhoc=="undefined"?nil:TrappedProcessorDataAdhoc)}
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+return $core.withContext(function($ctx1) {
+//>>excludeEnd("ctx");
+var $1;
+$1=$recv($TrappedProcessorDataAdhoc())._newToView_(aBlock);
+return $1;
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+}, function($ctx1) {$ctx1.fill(self,"dataToView:",{aBlock:aBlock},$globals.TrappedProcessor.klass)});
+//>>excludeEnd("ctx");
+},
+//>>excludeStart("ide", pragmas.excludeIdeData);
+args: ["aBlock"],
+source: "dataToView: aBlock\x0a\x09^TrappedProcessorDataAdhoc newToView: aBlock",
+referencedClasses: ["TrappedProcessorDataAdhoc"],
+//>>excludeEnd("ide");
+messageSends: ["newToView:"]
+}),
+$globals.TrappedProcessor.klass);
+
+$core.addMethod(
+$core.method({
+selector: "deuric",
+protocol: '*Trapped-Processors',
+fn: function (){
+var self=this;
+function $TrappedProcessorUriComponentDecode(){return $globals.TrappedProcessorUriComponentDecode||(typeof TrappedProcessorUriComponentDecode=="undefined"?nil:TrappedProcessorUriComponentDecode)}
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+return $core.withContext(function($ctx1) {
+//>>excludeEnd("ctx");
+var $1;
+$1=$recv($TrappedProcessorUriComponentDecode())._new();
+return $1;
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+}, function($ctx1) {$ctx1.fill(self,"deuric",{},$globals.TrappedProcessor.klass)});
+//>>excludeEnd("ctx");
+},
+//>>excludeStart("ide", pragmas.excludeIdeData);
+args: [],
+source: "deuric\x0a\x09^TrappedProcessorUriComponentDecode new",
+referencedClasses: ["TrappedProcessorUriComponentDecode"],
+//>>excludeEnd("ide");
+messageSends: ["new"]
+}),
+$globals.TrappedProcessor.klass);
+
+$core.addMethod(
+$core.method({
+selector: "guard:",
+protocol: '*Trapped-Processors',
+fn: function (anArray){
+var self=this;
+function $TrappedProcessorGuard(){return $globals.TrappedProcessorGuard||(typeof TrappedProcessorGuard=="undefined"?nil:TrappedProcessorGuard)}
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+return $core.withContext(function($ctx1) {
+//>>excludeEnd("ctx");
+var $1;
+$1=$recv($TrappedProcessorGuard())._new_(anArray);
+return $1;
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+}, function($ctx1) {$ctx1.fill(self,"guard:",{anArray:anArray},$globals.TrappedProcessor.klass)});
+//>>excludeEnd("ctx");
+},
+//>>excludeStart("ide", pragmas.excludeIdeData);
+args: ["anArray"],
+source: "guard: anArray\x0a\x09^TrappedProcessorGuard new: anArray",
+referencedClasses: ["TrappedProcessorGuard"],
+//>>excludeEnd("ide");
+messageSends: ["new:"]
+}),
+$globals.TrappedProcessor.klass);
+
+$core.addMethod(
+$core.method({
+selector: "inputChecked",
+protocol: '*Trapped-Processors',
+fn: function (){
+var self=this;
+function $TrappedProcessorInputChecked(){return $globals.TrappedProcessorInputChecked||(typeof TrappedProcessorInputChecked=="undefined"?nil:TrappedProcessorInputChecked)}
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+return $core.withContext(function($ctx1) {
+//>>excludeEnd("ctx");
+var $1;
+$1=$recv($TrappedProcessorInputChecked())._new();
+return $1;
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+}, function($ctx1) {$ctx1.fill(self,"inputChecked",{},$globals.TrappedProcessor.klass)});
+//>>excludeEnd("ctx");
+},
+//>>excludeStart("ide", pragmas.excludeIdeData);
+args: [],
+source: "inputChecked\x0a\x09^TrappedProcessorInputChecked new",
+referencedClasses: ["TrappedProcessorInputChecked"],
+//>>excludeEnd("ide");
+messageSends: ["new"]
+}),
+$globals.TrappedProcessor.klass);
+
+$core.addMethod(
+$core.method({
+selector: "inputValue",
+protocol: '*Trapped-Processors',
+fn: function (){
+var self=this;
+function $TrappedProcessorInputValue(){return $globals.TrappedProcessorInputValue||(typeof TrappedProcessorInputValue=="undefined"?nil:TrappedProcessorInputValue)}
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+return $core.withContext(function($ctx1) {
+//>>excludeEnd("ctx");
+var $1;
+$1=$recv($TrappedProcessorInputValue())._new();
+return $1;
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+}, function($ctx1) {$ctx1.fill(self,"inputValue",{},$globals.TrappedProcessor.klass)});
+//>>excludeEnd("ctx");
+},
+//>>excludeStart("ide", pragmas.excludeIdeData);
+args: [],
+source: "inputValue\x0a\x09^TrappedProcessorInputValue new",
+referencedClasses: ["TrappedProcessorInputValue"],
+//>>excludeEnd("ide");
+messageSends: ["new"]
+}),
+$globals.TrappedProcessor.klass);
+
+$core.addMethod(
+$core.method({
+selector: "loopZ",
+protocol: '*Trapped-Processors',
+fn: function (){
+var self=this;
+function $TrappedProcessorLoopZ(){return $globals.TrappedProcessorLoopZ||(typeof TrappedProcessorLoopZ=="undefined"?nil:TrappedProcessorLoopZ)}
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+return $core.withContext(function($ctx1) {
+//>>excludeEnd("ctx");
+var $1;
+$1=$recv($TrappedProcessorLoopZ())._new();
+return $1;
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+}, function($ctx1) {$ctx1.fill(self,"loopZ",{},$globals.TrappedProcessor.klass)});
+//>>excludeEnd("ctx");
+},
+//>>excludeStart("ide", pragmas.excludeIdeData);
+args: [],
+source: "loopZ\x0a\x09^TrappedProcessorLoopZ new",
+referencedClasses: ["TrappedProcessorLoopZ"],
+//>>excludeEnd("ide");
+messageSends: ["new"]
+}),
+$globals.TrappedProcessor.klass);
+
+$core.addMethod(
+$core.method({
+selector: "optionValue",
+protocol: '*Trapped-Processors',
+fn: function (){
+var self=this;
+function $TrappedProcessorOptionValue(){return $globals.TrappedProcessorOptionValue||(typeof TrappedProcessorOptionValue=="undefined"?nil:TrappedProcessorOptionValue)}
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+return $core.withContext(function($ctx1) {
+//>>excludeEnd("ctx");
+var $1;
+$1=$recv($TrappedProcessorOptionValue())._new();
+return $1;
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+}, function($ctx1) {$ctx1.fill(self,"optionValue",{},$globals.TrappedProcessor.klass)});
+//>>excludeEnd("ctx");
+},
+//>>excludeStart("ide", pragmas.excludeIdeData);
+args: [],
+source: "optionValue\x0a\x09^TrappedProcessorOptionValue new",
+referencedClasses: ["TrappedProcessorOptionValue"],
+//>>excludeEnd("ide");
+messageSends: ["new"]
+}),
+$globals.TrappedProcessor.klass);
+
+$core.addMethod(
+$core.method({
+selector: "path",
+protocol: '*Trapped-Processors',
+fn: function (){
+var self=this;
+function $TrappedProcessorDescend(){return $globals.TrappedProcessorDescend||(typeof TrappedProcessorDescend=="undefined"?nil:TrappedProcessorDescend)}
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+return $core.withContext(function($ctx1) {
+//>>excludeEnd("ctx");
+var $1;
+$1=$recv($TrappedProcessorDescend())._new();
+return $1;
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+}, function($ctx1) {$ctx1.fill(self,"path",{},$globals.TrappedProcessor.klass)});
+//>>excludeEnd("ctx");
+},
+//>>excludeStart("ide", pragmas.excludeIdeData);
+args: [],
+source: "path\x0a\x09^TrappedProcessorDescend new",
+referencedClasses: ["TrappedProcessorDescend"],
+//>>excludeEnd("ide");
+messageSends: ["new"]
+}),
+$globals.TrappedProcessor.klass);
+
+$core.addMethod(
+$core.method({
+selector: "replace:with:",
+protocol: '*Trapped-Processors',
+fn: function (aString,anotherString){
+var self=this;
+function $TrappedProcessorReplace(){return $globals.TrappedProcessorReplace||(typeof TrappedProcessorReplace=="undefined"?nil:TrappedProcessorReplace)}
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+return $core.withContext(function($ctx1) {
+//>>excludeEnd("ctx");
+var $1;
+$1=$recv($TrappedProcessorReplace())._new_with_(aString,anotherString);
+return $1;
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+}, function($ctx1) {$ctx1.fill(self,"replace:with:",{aString:aString,anotherString:anotherString},$globals.TrappedProcessor.klass)});
+//>>excludeEnd("ctx");
+},
+//>>excludeStart("ide", pragmas.excludeIdeData);
+args: ["aString", "anotherString"],
+source: "replace: aString with: anotherString\x0a\x09^TrappedProcessorReplace new: aString with: anotherString",
+referencedClasses: ["TrappedProcessorReplace"],
+//>>excludeEnd("ide");
+messageSends: ["new:with:"]
+}),
+$globals.TrappedProcessor.klass);
+
+$core.addMethod(
+$core.method({
+selector: "selectValue",
+protocol: '*Trapped-Processors',
+fn: function (){
+var self=this;
+function $TrappedProcessorSelectValue(){return $globals.TrappedProcessorSelectValue||(typeof TrappedProcessorSelectValue=="undefined"?nil:TrappedProcessorSelectValue)}
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+return $core.withContext(function($ctx1) {
+//>>excludeEnd("ctx");
+var $1;
+$1=$recv($TrappedProcessorSelectValue())._new();
+return $1;
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+}, function($ctx1) {$ctx1.fill(self,"selectValue",{},$globals.TrappedProcessor.klass)});
+//>>excludeEnd("ctx");
+},
+//>>excludeStart("ide", pragmas.excludeIdeData);
+args: [],
+source: "selectValue\x0a\x09^TrappedProcessorSelectValue new",
+referencedClasses: ["TrappedProcessorSelectValue"],
+//>>excludeEnd("ide");
+messageSends: ["new"]
+}),
+$globals.TrappedProcessor.klass);
+
+$core.addMethod(
+$core.method({
+selector: "signal:",
+protocol: '*Trapped-Processors',
+fn: function (aString){
+var self=this;
+function $TrappedProcessorSignal(){return $globals.TrappedProcessorSignal||(typeof TrappedProcessorSignal=="undefined"?nil:TrappedProcessorSignal)}
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+return $core.withContext(function($ctx1) {
+//>>excludeEnd("ctx");
+var $1;
+$1=$recv($TrappedProcessorSignal())._new_(aString);
+return $1;
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+}, function($ctx1) {$ctx1.fill(self,"signal:",{aString:aString},$globals.TrappedProcessor.klass)});
+//>>excludeEnd("ctx");
+},
+//>>excludeStart("ide", pragmas.excludeIdeData);
+args: ["aString"],
+source: "signal: aString\x0a\x09^TrappedProcessorSignal new: aString",
+referencedClasses: ["TrappedProcessorSignal"],
+//>>excludeEnd("ide");
+messageSends: ["new:"]
+}),
+$globals.TrappedProcessor.klass);
+
+$core.addMethod(
+$core.method({
+selector: "toBlackboard",
+protocol: '*Trapped-Processors',
+fn: function (){
+var self=this;
+function $TrappedProcessorToBlackboard(){return $globals.TrappedProcessorToBlackboard||(typeof TrappedProcessorToBlackboard=="undefined"?nil:TrappedProcessorToBlackboard)}
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+return $core.withContext(function($ctx1) {
+//>>excludeEnd("ctx");
+var $1;
+$1=$recv($TrappedProcessorToBlackboard())._new();
+return $1;
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+}, function($ctx1) {$ctx1.fill(self,"toBlackboard",{},$globals.TrappedProcessor.klass)});
+//>>excludeEnd("ctx");
+},
+//>>excludeStart("ide", pragmas.excludeIdeData);
+args: [],
+source: "toBlackboard\x0a\x09^TrappedProcessorToBlackboard new",
+referencedClasses: ["TrappedProcessorToBlackboard"],
+//>>excludeEnd("ide");
+messageSends: ["new"]
+}),
+$globals.TrappedProcessor.klass);
+
+$core.addMethod(
+$core.method({
+selector: "uric",
+protocol: '*Trapped-Processors',
+fn: function (){
+var self=this;
+function $TrappedProcessorUriComponentEncode(){return $globals.TrappedProcessorUriComponentEncode||(typeof TrappedProcessorUriComponentEncode=="undefined"?nil:TrappedProcessorUriComponentEncode)}
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+return $core.withContext(function($ctx1) {
+//>>excludeEnd("ctx");
+var $1;
+$1=$recv($TrappedProcessorUriComponentEncode())._new();
+return $1;
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+}, function($ctx1) {$ctx1.fill(self,"uric",{},$globals.TrappedProcessor.klass)});
+//>>excludeEnd("ctx");
+},
+//>>excludeStart("ide", pragmas.excludeIdeData);
+args: [],
+source: "uric\x0a\x09^TrappedProcessorUriComponentEncode new",
+referencedClasses: ["TrappedProcessorUriComponentEncode"],
+//>>excludeEnd("ide");
+messageSends: ["new"]
+}),
+$globals.TrappedProcessor.klass);
+
+$core.addMethod(
+$core.method({
+selector: "whenClicked",
+protocol: '*Trapped-Processors',
+fn: function (){
+var self=this;
+function $TrappedProcessorWhenClicked(){return $globals.TrappedProcessorWhenClicked||(typeof TrappedProcessorWhenClicked=="undefined"?nil:TrappedProcessorWhenClicked)}
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+return $core.withContext(function($ctx1) {
+//>>excludeEnd("ctx");
+var $1;
+$1=$recv($TrappedProcessorWhenClicked())._new();
+return $1;
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+}, function($ctx1) {$ctx1.fill(self,"whenClicked",{},$globals.TrappedProcessor.klass)});
+//>>excludeEnd("ctx");
+},
+//>>excludeStart("ide", pragmas.excludeIdeData);
+args: [],
+source: "whenClicked\x0a\x09^TrappedProcessorWhenClicked new",
+referencedClasses: ["TrappedProcessorWhenClicked"],
+//>>excludeEnd("ide");
+messageSends: ["new"]
+}),
+$globals.TrappedProcessor.klass);
+
+$core.addMethod(
+$core.method({
+selector: "whenSubmitted",
+protocol: '*Trapped-Processors',
+fn: function (){
+var self=this;
+function $TrappedProcessorWhenSubmitted(){return $globals.TrappedProcessorWhenSubmitted||(typeof TrappedProcessorWhenSubmitted=="undefined"?nil:TrappedProcessorWhenSubmitted)}
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+return $core.withContext(function($ctx1) {
+//>>excludeEnd("ctx");
+var $1;
+$1=$recv($TrappedProcessorWhenSubmitted())._new();
+return $1;
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+}, function($ctx1) {$ctx1.fill(self,"whenSubmitted",{},$globals.TrappedProcessor.klass)});
+//>>excludeEnd("ctx");
+},
+//>>excludeStart("ide", pragmas.excludeIdeData);
+args: [],
+source: "whenSubmitted\x0a\x09^TrappedProcessorWhenSubmitted new",
+referencedClasses: ["TrappedProcessorWhenSubmitted"],
+//>>excludeEnd("ide");
+messageSends: ["new"]
+}),
+$globals.TrappedProcessor.klass);
+
+$core.addMethod(
+$core.method({
+selector: "widget:",
+protocol: '*Trapped-Processors',
+fn: function (aString){
+var self=this;
+function $TrappedProcessorWidget(){return $globals.TrappedProcessorWidget||(typeof TrappedProcessorWidget=="undefined"?nil:TrappedProcessorWidget)}
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+return $core.withContext(function($ctx1) {
+//>>excludeEnd("ctx");
+var $1;
+$1=$recv($TrappedProcessorWidget())._new_(aString);
+return $1;
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+}, function($ctx1) {$ctx1.fill(self,"widget:",{aString:aString},$globals.TrappedProcessor.klass)});
+//>>excludeEnd("ctx");
+},
+//>>excludeStart("ide", pragmas.excludeIdeData);
+args: ["aString"],
+source: "widget: aString\x0a\x09^TrappedProcessorWidget new: aString",
+referencedClasses: ["TrappedProcessorWidget"],
+//>>excludeEnd("ide");
+messageSends: ["new:"]
+}),
+$globals.TrappedProcessor.klass);
+
+$core.addMethod(
+$core.method({
+selector: "xontent",
+protocol: '*Trapped-Processors',
+fn: function (){
+var self=this;
+function $TrappedProcessorXontent(){return $globals.TrappedProcessorXontent||(typeof TrappedProcessorXontent=="undefined"?nil:TrappedProcessorXontent)}
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+return $core.withContext(function($ctx1) {
+//>>excludeEnd("ctx");
+var $1;
+$1=$recv($TrappedProcessorXontent())._new();
+return $1;
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+}, function($ctx1) {$ctx1.fill(self,"xontent",{},$globals.TrappedProcessor.klass)});
+//>>excludeEnd("ctx");
+},
+//>>excludeStart("ide", pragmas.excludeIdeData);
+args: [],
+source: "xontent\x0a\x09^TrappedProcessorXontent new",
+referencedClasses: ["TrappedProcessorXontent"],
+//>>excludeEnd("ide");
+messageSends: ["new"]
+}),
+$globals.TrappedProcessor.klass);
+
+});

+ 2 - 1
st/Trapped-Processors.st → src/Trapped-Processors.st

@@ -1,4 +1,5 @@
-Smalltalk current createPackage: 'Trapped-Processors'!
+Smalltalk createPackage: 'Trapped-Processors'!
+(Smalltalk packageAt: 'Trapped-Processors') imports: {'jquery.xontent'}!
 TrappedDataExpectingProcessor subclass: #TrappedProcessorAttribute
 	instanceVariableNames: 'attrName'
 	package: 'Trapped-Processors'!

+ 628 - 0
src/Trapped-Tests.js

@@ -0,0 +1,628 @@
+define("trapped/Trapped-Tests", ["amber/boot", "amber_core/SUnit"], function($boot){
+var $core=$boot.api,nil=$boot.nil,$recv=$boot.asReceiver,$globals=$boot.globals;
+$core.addPackage('Trapped-Tests');
+$core.packages["Trapped-Tests"].innerEval = function (expr) { return eval(expr); };
+$core.packages["Trapped-Tests"].transport = {"type":"amd","amdNamespace":"trapped"};
+
+$core.addClass('IsolatorTest', $globals.TestCase, ['rootModel'], 'Trapped-Tests');
+$core.addMethod(
+$core.method({
+selector: "setUp",
+protocol: 'running',
+fn: function (){
+var self=this;
+function $EavModel(){return $globals.EavModel||(typeof EavModel=="undefined"?nil:EavModel)}
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+return $core.withContext(function($ctx1) {
+//>>excludeEnd("ctx");
+var $1,$2;
+$1=$recv($EavModel())._new();
+$recv($1)._getBlock_((function(x){
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+return $core.withContext(function($ctx2) {
+//>>excludeEnd("ctx");
+return $recv(x)._root();
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+}, function($ctx2) {$ctx2.fillBlock({x:x},$ctx1,1)});
+//>>excludeEnd("ctx");
+}));
+$2=$recv($1)._putBlock_((function(x,y){
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+return $core.withContext(function($ctx2) {
+//>>excludeEnd("ctx");
+return $recv(x)._root_(y);
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+}, function($ctx2) {$ctx2.fillBlock({x:x,y:y},$ctx1,2)});
+//>>excludeEnd("ctx");
+}));
+self["@rootModel"]=$2;
+return self;
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+}, function($ctx1) {$ctx1.fill(self,"setUp",{},$globals.IsolatorTest)});
+//>>excludeEnd("ctx");
+},
+//>>excludeStart("ide", pragmas.excludeIdeData);
+args: [],
+source: "setUp\x0a\x0arootModel := EavModel new\x0a\x09getBlock: [:x | x root];\x0a    putBlock: [:x :y | x root: y].",
+referencedClasses: ["EavModel"],
+//>>excludeEnd("ide");
+messageSends: ["getBlock:", "new", "root", "putBlock:", "root:"]
+}),
+$globals.IsolatorTest);
+
+$core.addMethod(
+$core.method({
+selector: "testNontrivialModelGetsAppropriateValueForModification",
+protocol: 'tests',
+fn: function (){
+var self=this;
+var isolator,model,result;
+function $Isolator(){return $globals.Isolator||(typeof Isolator=="undefined"?nil:Isolator)}
+function $EavModel(){return $globals.EavModel||(typeof EavModel=="undefined"?nil:EavModel)}
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+return $core.withContext(function($ctx1) {
+//>>excludeEnd("ctx");
+var $1,$3,$2,$4;
+result=nil;
+isolator=$recv($Isolator())._on_($globals.HashedCollection._newFromPairs_(["foo",["bar", [(1), [(2), (5)]], "baz"],"moo","zoo"]));
+$1=$recv($EavModel())._new();
+$recv($1)._getBlock_((function(x){
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+return $core.withContext(function($ctx2) {
+//>>excludeEnd("ctx");
+$3=$recv(x)._root();
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+$ctx2.sendIdx["root"]=1;
+//>>excludeEnd("ctx");
+$2=$recv($3)._at_("foo");
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+$ctx2.sendIdx["at:"]=2;
+//>>excludeEnd("ctx");
+return $recv($2)._at_((2));
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+$ctx2.sendIdx["at:"]=1;
+//>>excludeEnd("ctx");
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+}, function($ctx2) {$ctx2.fillBlock({x:x},$ctx1,1)});
+//>>excludeEnd("ctx");
+}));
+$4=$recv($1)._putBlock_((function(x,y){
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+return $core.withContext(function($ctx2) {
+//>>excludeEnd("ctx");
+return $recv($recv($recv(x)._root())._at_("foo"))._at_put_((2),y);
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+}, function($ctx2) {$ctx2.fillBlock({x:x,y:y},$ctx1,2)});
+//>>excludeEnd("ctx");
+}));
+model=$4;
+$recv(isolator)._model_modify_(model,(function(r){
+result=r;
+return result;
+
+}));
+self._assert_equals_([(1), [(2), (5)]],result);
+return self;
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+}, function($ctx1) {$ctx1.fill(self,"testNontrivialModelGetsAppropriateValueForModification",{isolator:isolator,model:model,result:result},$globals.IsolatorTest)});
+//>>excludeEnd("ctx");
+},
+//>>excludeStart("ide", pragmas.excludeIdeData);
+args: [],
+source: "testNontrivialModelGetsAppropriateValueForModification\x0a| isolator model result |\x0aresult := nil.\x0aisolator := Isolator on: #{ 'foo' -> #('bar' #(1 #(2 5)) 'baz'). 'moo' -> 'zoo' }.\x0amodel := EavModel new\x0a\x09getBlock: [ :x | (x root at: 'foo') at: 2 ];\x0a\x09putBlock: [ :x :y | (x root at: 'foo') at: 2 put: y].\x0aisolator model: model modify: [:r|result := r].\x0aself assert: #(1 #(2 5)) equals: result",
+referencedClasses: ["Isolator", "EavModel"],
+//>>excludeEnd("ide");
+messageSends: ["on:", "getBlock:", "new", "at:", "root", "putBlock:", "at:put:", "model:modify:", "assert:equals:"]
+}),
+$globals.IsolatorTest);
+
+$core.addMethod(
+$core.method({
+selector: "testNontrivialModelModifiesAppropriateValue",
+protocol: 'tests',
+fn: function (){
+var self=this;
+var isolator,model,result;
+function $Isolator(){return $globals.Isolator||(typeof Isolator=="undefined"?nil:Isolator)}
+function $EavModel(){return $globals.EavModel||(typeof EavModel=="undefined"?nil:EavModel)}
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+return $core.withContext(function($ctx1) {
+//>>excludeEnd("ctx");
+var $1,$3,$2,$4;
+result=nil;
+isolator=$recv($Isolator())._on_($globals.HashedCollection._newFromPairs_(["foo",["bar", [(1), [(2), (3)]], "baz"],"moo","zoo"]));
+$1=$recv($EavModel())._new();
+$recv($1)._getBlock_((function(x){
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+return $core.withContext(function($ctx2) {
+//>>excludeEnd("ctx");
+$3=$recv(x)._root();
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+$ctx2.sendIdx["root"]=1;
+//>>excludeEnd("ctx");
+$2=$recv($3)._at_("foo");
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+$ctx2.sendIdx["at:"]=2;
+//>>excludeEnd("ctx");
+return $recv($2)._at_((2));
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+$ctx2.sendIdx["at:"]=1;
+//>>excludeEnd("ctx");
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+}, function($ctx2) {$ctx2.fillBlock({x:x},$ctx1,1)});
+//>>excludeEnd("ctx");
+}));
+$4=$recv($1)._putBlock_((function(x,y){
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+return $core.withContext(function($ctx2) {
+//>>excludeEnd("ctx");
+return $recv($recv($recv(x)._root())._at_("foo"))._at_put_((2),y);
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+}, function($ctx2) {$ctx2.fillBlock({x:x,y:y},$ctx1,2)});
+//>>excludeEnd("ctx");
+}));
+model=$4;
+$recv(isolator)._model_modify_(model,(function(r){
+return "new";
+
+}));
+$recv(isolator)._model_read_(model,(function(r){
+result=r;
+return result;
+
+}));
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+$ctx1.sendIdx["model:read:"]=1;
+//>>excludeEnd("ctx");
+self._assert_equals_("new",result);
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+$ctx1.sendIdx["assert:equals:"]=1;
+//>>excludeEnd("ctx");
+$recv(isolator)._model_read_(self["@rootModel"],(function(r){
+result=r;
+return result;
+
+}));
+self._assert_equals_($globals.HashedCollection._newFromPairs_(["foo",["bar", "new", "baz"],"moo","zoo"]),result);
+return self;
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+}, function($ctx1) {$ctx1.fill(self,"testNontrivialModelModifiesAppropriateValue",{isolator:isolator,model:model,result:result},$globals.IsolatorTest)});
+//>>excludeEnd("ctx");
+},
+//>>excludeStart("ide", pragmas.excludeIdeData);
+args: [],
+source: "testNontrivialModelModifiesAppropriateValue\x0a| isolator model result |\x0aresult := nil.\x0aisolator := Isolator on: #{ 'foo' -> #('bar' #(1 #(2 3)) 'baz'). 'moo' -> 'zoo' }.\x0amodel := EavModel new\x0a\x09getBlock: [ :x | (x root at: 'foo') at: 2 ];\x0a\x09putBlock: [ :x :y | (x root at: 'foo') at: 2 put: y].\x0aisolator model: model modify: [:r|#new].\x0aisolator model: model read: [:r|result := r].\x0aself assert: #new equals: result.\x0aisolator model: rootModel read: [:r|result := r].\x0aself assert: #{ 'foo' -> #('bar' #new 'baz'). 'moo' -> 'zoo' } equals: result",
+referencedClasses: ["Isolator", "EavModel"],
+//>>excludeEnd("ide");
+messageSends: ["on:", "getBlock:", "new", "at:", "root", "putBlock:", "at:put:", "model:modify:", "model:read:", "assert:equals:"]
+}),
+$globals.IsolatorTest);
+
+$core.addMethod(
+$core.method({
+selector: "testNontrivialModelReturnsAppropriateValue",
+protocol: 'tests',
+fn: function (){
+var self=this;
+var isolator,model,result;
+function $Isolator(){return $globals.Isolator||(typeof Isolator=="undefined"?nil:Isolator)}
+function $EavModel(){return $globals.EavModel||(typeof EavModel=="undefined"?nil:EavModel)}
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+return $core.withContext(function($ctx1) {
+//>>excludeEnd("ctx");
+result=nil;
+isolator=$recv($Isolator())._on_($globals.HashedCollection._newFromPairs_(["foo",["bar", [(1), [(2), (3)]], "baz"],"moo","zoo"]));
+model=$recv($recv($EavModel())._new())._getBlock_((function(x){
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+return $core.withContext(function($ctx2) {
+//>>excludeEnd("ctx");
+return $recv($recv($recv(x)._root())._at_("foo"))._at_((2));
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+$ctx2.sendIdx["at:"]=1;
+//>>excludeEnd("ctx");
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+}, function($ctx2) {$ctx2.fillBlock({x:x},$ctx1,1)});
+//>>excludeEnd("ctx");
+}));
+$recv(isolator)._model_read_(model,(function(r){
+result=r;
+return result;
+
+}));
+self._assert_equals_([(1), [(2), (3)]],result);
+return self;
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+}, function($ctx1) {$ctx1.fill(self,"testNontrivialModelReturnsAppropriateValue",{isolator:isolator,model:model,result:result},$globals.IsolatorTest)});
+//>>excludeEnd("ctx");
+},
+//>>excludeStart("ide", pragmas.excludeIdeData);
+args: [],
+source: "testNontrivialModelReturnsAppropriateValue\x0a| isolator model result |\x0aresult := nil.\x0aisolator := Isolator on: #{ 'foo' -> #('bar' #(1 #(2 3)) 'baz'). 'moo' -> 'zoo' }.\x0amodel := EavModel new getBlock: [ :x | (x root at: 'foo') at: 2 ].\x0aisolator model: model read: [:r|result := r].\x0aself assert: #(1 #(2 3)) equals: result",
+referencedClasses: ["Isolator", "EavModel"],
+//>>excludeEnd("ide");
+messageSends: ["on:", "getBlock:", "new", "at:", "root", "model:read:", "assert:equals:"]
+}),
+$globals.IsolatorTest);
+
+$core.addMethod(
+$core.method({
+selector: "testRootModelExaminesThenModifiesRoot",
+protocol: 'tests',
+fn: function (){
+var self=this;
+var isolator,result;
+function $Isolator(){return $globals.Isolator||(typeof Isolator=="undefined"?nil:Isolator)}
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+return $core.withContext(function($ctx1) {
+//>>excludeEnd("ctx");
+result=nil;
+isolator=$recv($Isolator())._on_([(1), [(2), (3)]]);
+$recv(isolator)._model_modify_(self["@rootModel"],(function(r){
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+return $core.withContext(function($ctx2) {
+//>>excludeEnd("ctx");
+return $recv(r)._second();
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+}, function($ctx2) {$ctx2.fillBlock({r:r},$ctx1,1)});
+//>>excludeEnd("ctx");
+}));
+$recv(isolator)._model_read_(self["@rootModel"],(function(r){
+result=r;
+return result;
+
+}));
+self._assert_equals_([(2), (3)],result);
+return self;
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+}, function($ctx1) {$ctx1.fill(self,"testRootModelExaminesThenModifiesRoot",{isolator:isolator,result:result},$globals.IsolatorTest)});
+//>>excludeEnd("ctx");
+},
+//>>excludeStart("ide", pragmas.excludeIdeData);
+args: [],
+source: "testRootModelExaminesThenModifiesRoot\x0a| isolator result |\x0aresult := nil.\x0aisolator := Isolator on: #(1 #(2 3)).\x0aisolator model: rootModel modify: [:r|r second].\x0aisolator model: rootModel read: [:r|result := r].\x0aself assert: #(2 3) equals: result",
+referencedClasses: ["Isolator"],
+//>>excludeEnd("ide");
+messageSends: ["on:", "model:modify:", "second", "model:read:", "assert:equals:"]
+}),
+$globals.IsolatorTest);
+
+$core.addMethod(
+$core.method({
+selector: "testRootModelGetsRootForModification",
+protocol: 'tests',
+fn: function (){
+var self=this;
+var isolator,result;
+function $Isolator(){return $globals.Isolator||(typeof Isolator=="undefined"?nil:Isolator)}
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+return $core.withContext(function($ctx1) {
+//>>excludeEnd("ctx");
+result=nil;
+isolator=$recv($Isolator())._on_([(2), [(1), (0)]]);
+$recv(isolator)._model_modify_(self["@rootModel"],(function(r){
+result=r;
+return result;
+
+}));
+self._assert_equals_([(2), [(1), (0)]],result);
+return self;
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+}, function($ctx1) {$ctx1.fill(self,"testRootModelGetsRootForModification",{isolator:isolator,result:result},$globals.IsolatorTest)});
+//>>excludeEnd("ctx");
+},
+//>>excludeStart("ide", pragmas.excludeIdeData);
+args: [],
+source: "testRootModelGetsRootForModification\x0a| isolator result |\x0aresult := nil.\x0aisolator := Isolator on: #(2 #(1 0)).\x0aisolator model: rootModel modify: [:r|result := r].\x0aself assert: #(2 #(1 0)) equals: result",
+referencedClasses: ["Isolator"],
+//>>excludeEnd("ide");
+messageSends: ["on:", "model:modify:", "assert:equals:"]
+}),
+$globals.IsolatorTest);
+
+$core.addMethod(
+$core.method({
+selector: "testRootModelModifiesAndDeeplyIsolatesInPlaceModifiedRoot",
+protocol: 'tests',
+fn: function (){
+var self=this;
+var isolator,result,newValue;
+function $Isolator(){return $globals.Isolator||(typeof Isolator=="undefined"?nil:Isolator)}
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+return $core.withContext(function($ctx1) {
+//>>excludeEnd("ctx");
+result=nil;
+newValue=nil;
+isolator=$recv($Isolator())._on_([(1), [(2), (3)]]);
+$recv(isolator)._model_modify_(self["@rootModel"],(function(r){
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+return $core.withContext(function($ctx2) {
+//>>excludeEnd("ctx");
+newValue=r;
+newValue;
+$recv(r)._at_put_((1),(4));
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+$ctx2.sendIdx["at:put:"]=1;
+//>>excludeEnd("ctx");
+return r;
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+}, function($ctx2) {$ctx2.fillBlock({r:r},$ctx1,1)});
+//>>excludeEnd("ctx");
+}));
+$recv(newValue)._at_put_((2),"bar");
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+$ctx1.sendIdx["at:put:"]=2;
+//>>excludeEnd("ctx");
+$recv(isolator)._model_read_(self["@rootModel"],(function(r){
+result=r;
+return result;
+
+}));
+$recv(newValue)._at_put_((2),"baz");
+self._assert_equals_([(4), [(2), (3)]],result);
+return self;
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+}, function($ctx1) {$ctx1.fill(self,"testRootModelModifiesAndDeeplyIsolatesInPlaceModifiedRoot",{isolator:isolator,result:result,newValue:newValue},$globals.IsolatorTest)});
+//>>excludeEnd("ctx");
+},
+//>>excludeStart("ide", pragmas.excludeIdeData);
+args: [],
+source: "testRootModelModifiesAndDeeplyIsolatesInPlaceModifiedRoot\x0a| isolator result newValue |\x0aresult := nil. newValue := nil.\x0aisolator := Isolator on: #(1 #(2 3)).\x0aisolator model: rootModel modify: [:r|newValue := r. r at: 1 put: 4. r].\x0anewValue at: 2 put: 'bar'.\x0aisolator model: rootModel read: [:r|result := r].\x0anewValue at: 2 put: 'baz'.\x0aself assert: #(4 #(2 3)) equals: result",
+referencedClasses: ["Isolator"],
+//>>excludeEnd("ide");
+messageSends: ["on:", "model:modify:", "at:put:", "model:read:", "assert:equals:"]
+}),
+$globals.IsolatorTest);
+
+$core.addMethod(
+$core.method({
+selector: "testRootModelModifiesAndDeeplyIsolatesRoot",
+protocol: 'tests',
+fn: function (){
+var self=this;
+var isolator,result,newValue;
+function $Isolator(){return $globals.Isolator||(typeof Isolator=="undefined"?nil:Isolator)}
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+return $core.withContext(function($ctx1) {
+//>>excludeEnd("ctx");
+var $1;
+result=nil;
+isolator=$recv($Isolator())._on_([(1), [(2), (3)]]);
+newValue=$globals.HashedCollection._newFromPairs_(["foo",[(4), (5), (6)]]);
+$recv(isolator)._model_modify_(self["@rootModel"],(function(r){
+return newValue;
+
+}));
+$1=$recv(newValue)._at_("foo");
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+$ctx1.sendIdx["at:"]=1;
+//>>excludeEnd("ctx");
+$recv($1)._at_put_((1),"bar");
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+$ctx1.sendIdx["at:put:"]=1;
+//>>excludeEnd("ctx");
+$recv(isolator)._model_read_(self["@rootModel"],(function(r){
+result=r;
+return result;
+
+}));
+$recv($recv(newValue)._at_("foo"))._at_put_((3),"baz");
+self._assert_equals_($globals.HashedCollection._newFromPairs_(["foo",[(4), (5), (6)]]),result);
+return self;
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+}, function($ctx1) {$ctx1.fill(self,"testRootModelModifiesAndDeeplyIsolatesRoot",{isolator:isolator,result:result,newValue:newValue},$globals.IsolatorTest)});
+//>>excludeEnd("ctx");
+},
+//>>excludeStart("ide", pragmas.excludeIdeData);
+args: [],
+source: "testRootModelModifiesAndDeeplyIsolatesRoot\x0a| isolator result newValue |\x0aresult := nil.\x0aisolator := Isolator on: #(1 #(2 3)).\x0anewValue := #{'foo'->#(4 5 6)}.\x0aisolator model: rootModel modify: [:r|newValue].\x0a(newValue at: 'foo') at: 1 put: 'bar'.\x0aisolator model: rootModel read: [:r|result := r].\x0a(newValue at: 'foo') at: 3 put: 'baz'.\x0aself assert: #{'foo'->#(4 5 6)} equals: result",
+referencedClasses: ["Isolator"],
+//>>excludeEnd("ide");
+messageSends: ["on:", "model:modify:", "at:put:", "at:", "model:read:", "assert:equals:"]
+}),
+$globals.IsolatorTest);
+
+$core.addMethod(
+$core.method({
+selector: "testRootModelModifiesAndIsolatesRoot",
+protocol: 'tests',
+fn: function (){
+var self=this;
+var isolator,result,newValue;
+function $Isolator(){return $globals.Isolator||(typeof Isolator=="undefined"?nil:Isolator)}
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+return $core.withContext(function($ctx1) {
+//>>excludeEnd("ctx");
+result=nil;
+isolator=$recv($Isolator())._on_([(1), [(2), (3)]]);
+newValue=$globals.HashedCollection._newFromPairs_(["foo",[(4), (5), (6)]]);
+$recv(isolator)._model_modify_(self["@rootModel"],(function(r){
+return newValue;
+
+}));
+$recv(newValue)._at_put_("foo","bar");
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+$ctx1.sendIdx["at:put:"]=1;
+//>>excludeEnd("ctx");
+$recv(isolator)._model_read_(self["@rootModel"],(function(r){
+result=r;
+return result;
+
+}));
+$recv(newValue)._at_put_("foo","baz");
+self._assert_equals_($globals.HashedCollection._newFromPairs_(["foo",[(4), (5), (6)]]),result);
+return self;
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+}, function($ctx1) {$ctx1.fill(self,"testRootModelModifiesAndIsolatesRoot",{isolator:isolator,result:result,newValue:newValue},$globals.IsolatorTest)});
+//>>excludeEnd("ctx");
+},
+//>>excludeStart("ide", pragmas.excludeIdeData);
+args: [],
+source: "testRootModelModifiesAndIsolatesRoot\x0a| isolator result newValue |\x0aresult := nil.\x0aisolator := Isolator on: #(1 #(2 3)).\x0anewValue := #{'foo'->#(4 5 6)}.\x0aisolator model: rootModel modify: [:r|newValue].\x0anewValue at: 'foo' put: 'bar'.\x0aisolator model: rootModel read: [:r|result := r].\x0anewValue at: 'foo' put: 'baz'.\x0aself assert: #{'foo'->#(4 5 6)} equals: result",
+referencedClasses: ["Isolator"],
+//>>excludeEnd("ide");
+messageSends: ["on:", "model:modify:", "at:put:", "model:read:", "assert:equals:"]
+}),
+$globals.IsolatorTest);
+
+$core.addMethod(
+$core.method({
+selector: "testRootModelModifiesRoot",
+protocol: 'tests',
+fn: function (){
+var self=this;
+var isolator,result;
+function $Isolator(){return $globals.Isolator||(typeof Isolator=="undefined"?nil:Isolator)}
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+return $core.withContext(function($ctx1) {
+//>>excludeEnd("ctx");
+result=nil;
+isolator=$recv($Isolator())._on_([(1), [(2), (3)]]);
+$recv(isolator)._model_modify_(self["@rootModel"],(function(r){
+return $globals.HashedCollection._newFromPairs_(["foo",[(4), (5), (6)]]);
+
+}));
+$recv(isolator)._model_read_(self["@rootModel"],(function(r){
+result=r;
+return result;
+
+}));
+self._assert_equals_($globals.HashedCollection._newFromPairs_(["foo",[(4), (5), (6)]]),result);
+return self;
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+}, function($ctx1) {$ctx1.fill(self,"testRootModelModifiesRoot",{isolator:isolator,result:result},$globals.IsolatorTest)});
+//>>excludeEnd("ctx");
+},
+//>>excludeStart("ide", pragmas.excludeIdeData);
+args: [],
+source: "testRootModelModifiesRoot\x0a| isolator result |\x0aresult := nil.\x0aisolator := Isolator on: #(1 #(2 3)).\x0aisolator model: rootModel modify: [:r|#{'foo'->#(4 5 6)}].\x0aisolator model: rootModel read: [:r|result := r].\x0aself assert: #{'foo'->#(4 5 6)} equals: result",
+referencedClasses: ["Isolator"],
+//>>excludeEnd("ide");
+messageSends: ["on:", "model:modify:", "model:read:", "assert:equals:"]
+}),
+$globals.IsolatorTest);
+
+$core.addMethod(
+$core.method({
+selector: "testRootModelReturnsDeeplyIsolatedRoot",
+protocol: 'tests',
+fn: function (){
+var self=this;
+var isolator,result;
+function $Isolator(){return $globals.Isolator||(typeof Isolator=="undefined"?nil:Isolator)}
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+return $core.withContext(function($ctx1) {
+//>>excludeEnd("ctx");
+result=nil;
+isolator=$recv($Isolator())._on_([(1), [(2), (3)]]);
+$recv(isolator)._model_read_(self["@rootModel"],(function(r){
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+return $core.withContext(function($ctx2) {
+//>>excludeEnd("ctx");
+return $recv($recv(r)._at_((2)))._at_put_((1),(0));
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+}, function($ctx2) {$ctx2.fillBlock({r:r},$ctx1,1)});
+//>>excludeEnd("ctx");
+}));
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+$ctx1.sendIdx["model:read:"]=1;
+//>>excludeEnd("ctx");
+$recv(isolator)._model_read_(self["@rootModel"],(function(r){
+result=r;
+return result;
+
+}));
+self._assert_equals_([(1), [(2), (3)]],result);
+return self;
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+}, function($ctx1) {$ctx1.fill(self,"testRootModelReturnsDeeplyIsolatedRoot",{isolator:isolator,result:result},$globals.IsolatorTest)});
+//>>excludeEnd("ctx");
+},
+//>>excludeStart("ide", pragmas.excludeIdeData);
+args: [],
+source: "testRootModelReturnsDeeplyIsolatedRoot\x0a| isolator result |\x0aresult := nil.\x0aisolator := Isolator on: #(1 #(2 3)).\x0aisolator model: rootModel read: [:r|(r at: 2) at: 1 put: 0].\x0aisolator model: rootModel read: [:r|result := r].\x0aself assert: #(1 #(2 3)) equals: result",
+referencedClasses: ["Isolator"],
+//>>excludeEnd("ide");
+messageSends: ["on:", "model:read:", "at:put:", "at:", "assert:equals:"]
+}),
+$globals.IsolatorTest);
+
+$core.addMethod(
+$core.method({
+selector: "testRootModelReturnsIsolatedRoot",
+protocol: 'tests',
+fn: function (){
+var self=this;
+var isolator,result;
+function $Isolator(){return $globals.Isolator||(typeof Isolator=="undefined"?nil:Isolator)}
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+return $core.withContext(function($ctx1) {
+//>>excludeEnd("ctx");
+result=nil;
+isolator=$recv($Isolator())._on_([(1), [(2), (4)]]);
+$recv(isolator)._model_read_(self["@rootModel"],(function(r){
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+return $core.withContext(function($ctx2) {
+//>>excludeEnd("ctx");
+return $recv(r)._at_put_((2),nil);
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+}, function($ctx2) {$ctx2.fillBlock({r:r},$ctx1,1)});
+//>>excludeEnd("ctx");
+}));
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+$ctx1.sendIdx["model:read:"]=1;
+//>>excludeEnd("ctx");
+$recv(isolator)._model_read_(self["@rootModel"],(function(r){
+result=r;
+return result;
+
+}));
+self._assert_equals_([(1), [(2), (4)]],result);
+return self;
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+}, function($ctx1) {$ctx1.fill(self,"testRootModelReturnsIsolatedRoot",{isolator:isolator,result:result},$globals.IsolatorTest)});
+//>>excludeEnd("ctx");
+},
+//>>excludeStart("ide", pragmas.excludeIdeData);
+args: [],
+source: "testRootModelReturnsIsolatedRoot\x0a| isolator result |\x0aresult := nil.\x0aisolator := Isolator on: #(1 #(2 4)).\x0aisolator model: rootModel read: [:r|r at: 2 put: nil].\x0aisolator model: rootModel read: [:r|result := r].\x0aself assert: #(1 #(2 4)) equals: result",
+referencedClasses: ["Isolator"],
+//>>excludeEnd("ide");
+messageSends: ["on:", "model:read:", "at:put:", "assert:equals:"]
+}),
+$globals.IsolatorTest);
+
+$core.addMethod(
+$core.method({
+selector: "testRootModelReturnsRoot",
+protocol: 'tests',
+fn: function (){
+var self=this;
+var isolator,result;
+function $Isolator(){return $globals.Isolator||(typeof Isolator=="undefined"?nil:Isolator)}
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+return $core.withContext(function($ctx1) {
+//>>excludeEnd("ctx");
+result=nil;
+isolator=$recv($Isolator())._on_([(1), [(2), (3)]]);
+$recv(isolator)._model_read_(self["@rootModel"],(function(r){
+result=r;
+return result;
+
+}));
+self._assert_equals_([(1), [(2), (3)]],result);
+return self;
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+}, function($ctx1) {$ctx1.fill(self,"testRootModelReturnsRoot",{isolator:isolator,result:result},$globals.IsolatorTest)});
+//>>excludeEnd("ctx");
+},
+//>>excludeStart("ide", pragmas.excludeIdeData);
+args: [],
+source: "testRootModelReturnsRoot\x0a| isolator result |\x0aresult := nil.\x0aisolator := Isolator on: #(1 #(2 3)).\x0aisolator model: rootModel read: [:r|result := r].\x0aself assert: #(1 #(2 3)) equals: result",
+referencedClasses: ["Isolator"],
+//>>excludeEnd("ide");
+messageSends: ["on:", "model:read:", "assert:equals:"]
+}),
+$globals.IsolatorTest);
+
+
+});

+ 1 - 1
st/Trapped-Tests.st → src/Trapped-Tests.st

@@ -1,4 +1,4 @@
-Smalltalk current createPackage: 'Trapped-Tests'!
+Smalltalk createPackage: 'Trapped-Tests'!
 TestCase subclass: #IsolatorTest
 	instanceVariableNames: 'rootModel'
 	package: 'Trapped-Tests'!

File diff suppressed because it is too large
+ 6 - 0
the.js


+ 5 - 0
xontent.amd.json

@@ -0,0 +1,5 @@
+{
+    "paths": {
+        "jquery.xontent": "jquery.xontent"
+    }
+}

Some files were not shown because too many files changed in this diff