Forráskód Böngészése

Using generic replace:with: and attr:, classDoneXxx: out

(though it is left to show the use of dataToView:)
Herbert Vojčík 10 éve
szülő
commit
dc7ecba352

+ 1 - 1
example-todo/js/Trapped-Todo.js

@@ -245,7 +245,7 @@ return _st(_st(carrier)._target())._class_("done-".__comma(_st(carrier)._value()
 return $1;
 }, function($ctx1) {$ctx1.fill(self,"classDoneXxx",{},smalltalk.TrappedProcessor.klass)})},
 args: [],
-source: "classDoneXxx\x0a\x09^self dataToView: [ :carrier | carrier target class: 'done-', carrier value ]",
+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: []
 }),

+ 8 - 0
example-todo/st/Trapped-Todo.st

@@ -124,6 +124,14 @@ archive
 !TrappedProcessor class methodsFor: '*Trapped-Todo'!
 
 classDoneXxx
+	"This processor is not used any more,
+	it was replaced by generic
+	(replace ^ with ^done-) (attr class)
+	in HTML.
+
+	This example is left here to show how you can create quick
+	toView-only processor without class by just passing a block"
+
 	^self dataToView: [ :carrier | carrier target class: 'done-', carrier value ]
 ! !
 

+ 1 - 1
example-todo/todo.html

@@ -44,7 +44,7 @@
     <ul><ins data-trap="#todos: loopContents">
         <li>
             <input type="checkbox" data-trap="done: inputChecked" />
-            <span data-trap="done: classDoneXxx. text" ></span>
+            <span data-trap="done: (replace ^ with ^done-) (attr class). text" ></span>
         </li>
     </ins></ul>
     <form data-trap=": (signal addTodo) whenSubmitted">