|
@@ -1,4 +1,4 @@
|
|
-define(["amber/boot", "amber_core/Kernel-Objects"], function($boot){"use strict";
|
|
+define(["amber/boot", "amber_core/Kernel-Collections", "amber_core/Kernel-Infrastructure", "amber_core/Kernel-Objects"], function($boot){"use strict";
|
|
if(!$boot.nilAsReceiver)$boot.nilAsReceiver=$boot.nil;
|
|
if(!$boot.nilAsReceiver)$boot.nilAsReceiver=$boot.nil;
|
|
var $core=$boot.api,nil=$boot.nilAsReceiver,$recv=$boot.asReceiver,$globals=$boot.globals;
|
|
var $core=$boot.api,nil=$boot.nilAsReceiver,$recv=$boot.asReceiver,$globals=$boot.globals;
|
|
if(!$boot.nilAsClass)$boot.nilAsClass=$boot.dnu;
|
|
if(!$boot.nilAsClass)$boot.nilAsClass=$boot.dnu;
|
|
@@ -141,4 +141,99 @@ messageSends: []
|
|
}),
|
|
}),
|
|
$globals.PlatformDom.klass);
|
|
$globals.PlatformDom.klass);
|
|
|
|
|
|
|
|
+$core.addMethod(
|
|
|
|
+$core.method({
|
|
|
|
+selector: "asDomNode",
|
|
|
|
+protocol: '*Platform-DOM',
|
|
|
|
+fn: function (){
|
|
|
|
+var self=this;
|
|
|
|
+
|
|
|
|
+return $core.withContext(function($ctx1) {
|
|
|
|
+
|
|
|
|
+return $recv($globals.PlatformDom)._newTextNode_(self._asString());
|
|
|
|
+
|
|
|
|
+}, function($ctx1) {$ctx1.fill(self,"asDomNode",{},$globals.CharacterArray)});
|
|
|
|
+
|
|
|
|
+},
|
|
|
|
+
|
|
|
|
+args: [],
|
|
|
|
+source: "asDomNode\x0a\x09^ PlatformDom newTextNode: self asString",
|
|
|
|
+referencedClasses: ["PlatformDom"],
|
|
|
|
+
|
|
|
|
+messageSends: ["newTextNode:", "asString"]
|
|
|
|
+}),
|
|
|
|
+$globals.CharacterArray);
|
|
|
|
+
|
|
|
|
+$core.addMethod(
|
|
|
|
+$core.method({
|
|
|
|
+selector: "asDomNode",
|
|
|
|
+protocol: '*Platform-DOM',
|
|
|
|
+fn: function (){
|
|
|
|
+var self=this;
|
|
|
|
+var fragment;
|
|
|
|
+
|
|
|
|
+return $core.withContext(function($ctx1) {
|
|
|
|
+
|
|
|
|
+fragment=$recv($globals.PlatformDom)._newDocumentFragment();
|
|
|
|
+self._do_((function(each){
|
|
|
|
+
|
|
|
|
+return $core.withContext(function($ctx2) {
|
|
|
|
+
|
|
|
|
+return $recv(fragment)._appendChild_($recv(each)._asDomNode());
|
|
|
|
+
|
|
|
|
+}, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,1)});
|
|
|
|
+
|
|
|
|
+}));
|
|
|
|
+return fragment;
|
|
|
|
+
|
|
|
|
+}, function($ctx1) {$ctx1.fill(self,"asDomNode",{fragment:fragment},$globals.Collection)});
|
|
|
|
+
|
|
|
|
+},
|
|
|
|
+
|
|
|
|
+args: [],
|
|
|
|
+source: "asDomNode\x0a\x09| fragment |\x0a\x09fragment := PlatformDom newDocumentFragment.\x0a\x09self do: [ :each | fragment appendChild: each asDomNode ].\x0a\x09^ fragment",
|
|
|
|
+referencedClasses: ["PlatformDom"],
|
|
|
|
+
|
|
|
|
+messageSends: ["newDocumentFragment", "do:", "appendChild:", "asDomNode"]
|
|
|
|
+}),
|
|
|
|
+$globals.Collection);
|
|
|
|
+
|
|
|
|
+$core.addMethod(
|
|
|
|
+$core.method({
|
|
|
|
+selector: "asDomNode",
|
|
|
|
+protocol: '*Platform-DOM',
|
|
|
|
+fn: function (){
|
|
|
|
+var self=this;
|
|
|
|
+
|
|
|
|
+return $core.withContext(function($ctx1) {
|
|
|
|
+
|
|
|
|
+var $1,$2;
|
|
|
|
+$1=$recv($globals.PlatformDom)._isDomNode_(self["@jsObject"]);
|
|
|
|
+if($core.assert($1)){
|
|
|
|
+return self["@jsObject"];
|
|
|
|
+} else {
|
|
|
|
+$2=(
|
|
|
|
+
|
|
|
|
+$ctx1.supercall = true,
|
|
|
|
+
|
|
|
|
+($globals.JSObjectProxy.superclass||$boot.nilAsClass).fn.prototype._asDomNode.apply($recv(self), []));
|
|
|
|
+
|
|
|
|
+$ctx1.supercall = false;
|
|
|
|
+
|
|
|
|
+return $2;
|
|
|
|
+}
|
|
|
|
+return self;
|
|
|
|
+
|
|
|
|
+}, function($ctx1) {$ctx1.fill(self,"asDomNode",{},$globals.JSObjectProxy)});
|
|
|
|
+
|
|
|
|
+},
|
|
|
|
+
|
|
|
|
+args: [],
|
|
|
|
+source: "asDomNode\x0a\x09(PlatformDom isDomNode: jsObject)\x0a\x09\x09ifTrue: [ ^ jsObject ]\x0a\x09\x09ifFalse: [ ^ super asDomNode ]",
|
|
|
|
+referencedClasses: ["PlatformDom"],
|
|
|
|
+
|
|
|
|
+messageSends: ["ifTrue:ifFalse:", "isDomNode:", "asDomNode"]
|
|
|
|
+}),
|
|
|
|
+$globals.JSObjectProxy);
|
|
|
|
+
|
|
});
|
|
});
|