|
@@ -1,4 +1,4 @@
|
|
-define("silk/Silk", ["amber/boot", "domite/DOMite", "amber_core/Kernel-Objects", "amber_core/Kernel-Methods"], function($boot){
|
|
|
|
|
|
+define("silk/Silk", ["amber/boot", "domite/DOMite", "amber_core/Kernel-Objects", "amber_core/Kernel-Methods", "amber_core/Kernel-Collections", "amber_core/Kernel-Infrastructure"], function($boot){
|
|
var $core=$boot.api,nil=$boot.nil,$recv=$boot.asReceiver,$globals=$boot.globals;
|
|
var $core=$boot.api,nil=$boot.nil,$recv=$boot.asReceiver,$globals=$boot.globals;
|
|
$core.addPackage('Silk');
|
|
$core.addPackage('Silk');
|
|
$core.packages["Silk"].innerEval = function (expr) { return eval(expr); };
|
|
$core.packages["Silk"].innerEval = function (expr) { return eval(expr); };
|
|
@@ -6,7 +6,7 @@ $core.packages["Silk"].transport = {"type":"amd","amdNamespace":"silk"};
|
|
|
|
|
|
$core.addClass('Silk', $globals.Domite, [], 'Silk');
|
|
$core.addClass('Silk', $globals.Domite, [], 'Silk');
|
|
//>>excludeStart("ide", pragmas.excludeIdeData);
|
|
//>>excludeStart("ide", pragmas.excludeIdeData);
|
|
-$globals.Silk.comment="I am adding convenience APIs to my subclass, `Domite`.\x0a\x0a##Rendering\x0a\x0a - `aSilk << anObject` uses double-dispatch via `renderOnSilk:`. This allows creating widgets (no formal superclass, anything with `renderOnSilk:` is a widget), as well as incorporating blocks: `aSilk << aBlock` runs the block, passing aSilk as a parameter.";
|
|
|
|
|
|
+$globals.Silk.comment="I am adding convenience APIs to my subclass, `Domite`.\x0a\x0a##Rendering\x0a\x0a - `aSilk << anObject` uses double-dispatch via `renderOnSilk:`. This allows creating widgets (no formal superclass, anything with `renderOnSilk:` is a widget), as well as incorporating blocks: `aSilk << aBlock` runs the block, passing aSilk as a parameter.\x0a\x0a##Convenience\x0a\x0a - `aCssSelectorString asSilk` returns Silk wrapping an element at a selector.\x0a - `anObject inSilk` returns anObject rendered in a document fragment.";
|
|
//>>excludeEnd("ide");
|
|
//>>excludeEnd("ide");
|
|
$core.addMethod(
|
|
$core.addMethod(
|
|
$core.method({
|
|
$core.method({
|
|
@@ -70,6 +70,90 @@ messageSends: ["value:"]
|
|
}),
|
|
}),
|
|
$globals.BlockClosure);
|
|
$globals.BlockClosure);
|
|
|
|
|
|
|
|
+$core.addMethod(
|
|
|
|
+$core.method({
|
|
|
|
+selector: "asSilk",
|
|
|
|
+protocol: '*Silk',
|
|
|
|
+fn: function (){
|
|
|
|
+var self=this;
|
|
|
|
+function $Silk(){return $globals.Silk||(typeof Silk=="undefined"?nil:Silk)}
|
|
|
|
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
|
|
|
|
+return $core.withContext(function($ctx1) {
|
|
|
|
+//>>excludeEnd("ctx");
|
|
|
|
+var $1;
|
|
|
|
+$1=$recv($Silk())._at_(self._asString());
|
|
|
|
+return $1;
|
|
|
|
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
|
|
|
|
+}, function($ctx1) {$ctx1.fill(self,"asSilk",{},$globals.CharacterArray)});
|
|
|
|
+//>>excludeEnd("ctx");
|
|
|
|
+},
|
|
|
|
+//>>excludeStart("ide", pragmas.excludeIdeData);
|
|
|
|
+args: [],
|
|
|
|
+source: "asSilk\x0a\x09^ Silk at: self asString",
|
|
|
|
+referencedClasses: ["Silk"],
|
|
|
|
+//>>excludeEnd("ide");
|
|
|
|
+messageSends: ["at:", "asString"]
|
|
|
|
+}),
|
|
|
|
+$globals.CharacterArray);
|
|
|
|
+
|
|
|
|
+$core.addMethod(
|
|
|
|
+$core.method({
|
|
|
|
+selector: "inSilk",
|
|
|
|
+protocol: '*Silk',
|
|
|
|
+fn: function (){
|
|
|
|
+var self=this;
|
|
|
|
+function $Silk(){return $globals.Silk||(typeof Silk=="undefined"?nil:Silk)}
|
|
|
|
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
|
|
|
|
+return $core.withContext(function($ctx1) {
|
|
|
|
+//>>excludeEnd("ctx");
|
|
|
|
+var $2,$3,$1;
|
|
|
|
+$2=$recv($Silk())._newStream();
|
|
|
|
+$recv($2).__lt_lt(self);
|
|
|
|
+$3=$recv($2)._yourself();
|
|
|
|
+$1=$3;
|
|
|
|
+return $1;
|
|
|
|
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
|
|
|
|
+}, function($ctx1) {$ctx1.fill(self,"inSilk",{},$globals.JSObjectProxy)});
|
|
|
|
+//>>excludeEnd("ctx");
|
|
|
|
+},
|
|
|
|
+//>>excludeStart("ide", pragmas.excludeIdeData);
|
|
|
|
+args: [],
|
|
|
|
+source: "inSilk\x0a\x09^ Silk newStream << self; yourself",
|
|
|
|
+referencedClasses: ["Silk"],
|
|
|
|
+//>>excludeEnd("ide");
|
|
|
|
+messageSends: ["<<", "newStream", "yourself"]
|
|
|
|
+}),
|
|
|
|
+$globals.JSObjectProxy);
|
|
|
|
+
|
|
|
|
+$core.addMethod(
|
|
|
|
+$core.method({
|
|
|
|
+selector: "inSilk",
|
|
|
|
+protocol: '*Silk',
|
|
|
|
+fn: function (){
|
|
|
|
+var self=this;
|
|
|
|
+function $Silk(){return $globals.Silk||(typeof Silk=="undefined"?nil:Silk)}
|
|
|
|
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
|
|
|
|
+return $core.withContext(function($ctx1) {
|
|
|
|
+//>>excludeEnd("ctx");
|
|
|
|
+var $2,$3,$1;
|
|
|
|
+$2=$recv($Silk())._newStream();
|
|
|
|
+$recv($2).__lt_lt(self);
|
|
|
|
+$3=$recv($2)._yourself();
|
|
|
|
+$1=$3;
|
|
|
|
+return $1;
|
|
|
|
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
|
|
|
|
+}, function($ctx1) {$ctx1.fill(self,"inSilk",{},$globals.Object)});
|
|
|
|
+//>>excludeEnd("ctx");
|
|
|
|
+},
|
|
|
|
+//>>excludeStart("ide", pragmas.excludeIdeData);
|
|
|
|
+args: [],
|
|
|
|
+source: "inSilk\x0a\x09^ Silk newStream << self; yourself",
|
|
|
|
+referencedClasses: ["Silk"],
|
|
|
|
+//>>excludeEnd("ide");
|
|
|
|
+messageSends: ["<<", "newStream", "yourself"]
|
|
|
|
+}),
|
|
|
|
+$globals.Object);
|
|
|
|
+
|
|
$core.addMethod(
|
|
$core.addMethod(
|
|
$core.method({
|
|
$core.method({
|
|
selector: "renderOnSilk:",
|
|
selector: "renderOnSilk:",
|