|
@@ -1,173 +1,18 @@
|
|
|
define("amber_core/Web", ["amber/boot"
|
|
|
|
|
|
-, "jquery"
|
|
|
+, "amber_core/Wrappers-JQuery"
|
|
|
|
|
|
, "amber_core/Kernel-Objects", "amber_core/Kernel-Infrastructure", "amber_core/Kernel-Methods", "amber_core/Kernel-Collections"], function($boot
|
|
|
|
|
|
-,jQuery
|
|
|
+
|
|
|
|
|
|
){
|
|
|
var $core=$boot.api,nil=$boot.nil,$recv=$boot.asReceiver,$globals=$boot.globals;
|
|
|
$core.addPackage('Web');
|
|
|
$core.packages["Web"].innerEval = function (expr) { return eval(expr); };
|
|
|
-$core.packages["Web"].imports = ["jQuery=jquery"];
|
|
|
+$core.packages["Web"].imports = ["amber_core/Wrappers-JQuery"];
|
|
|
$core.packages["Web"].transport = {"type":"amd","amdNamespace":"amber_core"};
|
|
|
|
|
|
-$core.addClass('BrowserInterface', $globals.Object, [], 'Web');
|
|
|
-
|
|
|
-$globals.BrowserInterface.comment="I am platform interface class that tries to use window and jQuery; that is, one for browser environment.\x0a\x0a## API\x0a\x0a self isAvailable. \x22true if window and jQuery exist\x22.\x0a\x0a self alert: 'Hey, there is a problem'.\x0a self confirm: 'Affirmative?'.\x0a self prompt: 'Your name:'.\x0a\x0a self ajax: #{\x0a 'url' -> '/patch.js'. 'type' -> 'GET'. dataType->'script'\x0a }.";
|
|
|
-
|
|
|
-$core.addMethod(
|
|
|
-$core.method({
|
|
|
-selector: "ajax:",
|
|
|
-protocol: 'actions',
|
|
|
-fn: function (anObject){
|
|
|
-var self=this;
|
|
|
-
|
|
|
-return $core.withContext(function($ctx1) {
|
|
|
-
|
|
|
-var $1;
|
|
|
-$1=$recv(jQuery)._ajax_(anObject);
|
|
|
-return $1;
|
|
|
-
|
|
|
-}, function($ctx1) {$ctx1.fill(self,"ajax:",{anObject:anObject},$globals.BrowserInterface)});
|
|
|
-
|
|
|
-},
|
|
|
-
|
|
|
-args: ["anObject"],
|
|
|
-source: "ajax: anObject\x0a\x09^ jQuery ajax: anObject",
|
|
|
-referencedClasses: [],
|
|
|
-
|
|
|
-messageSends: ["ajax:"]
|
|
|
-}),
|
|
|
-$globals.BrowserInterface);
|
|
|
-
|
|
|
-$core.addMethod(
|
|
|
-$core.method({
|
|
|
-selector: "alert:",
|
|
|
-protocol: 'actions',
|
|
|
-fn: function (aString){
|
|
|
-var self=this;
|
|
|
-
|
|
|
-return $core.withContext(function($ctx1) {
|
|
|
-
|
|
|
-var $1;
|
|
|
-$1=$recv(window)._alert_(aString);
|
|
|
-return $1;
|
|
|
-
|
|
|
-}, function($ctx1) {$ctx1.fill(self,"alert:",{aString:aString},$globals.BrowserInterface)});
|
|
|
-
|
|
|
-},
|
|
|
-
|
|
|
-args: ["aString"],
|
|
|
-source: "alert: aString\x0a\x09^ window alert: aString",
|
|
|
-referencedClasses: [],
|
|
|
-
|
|
|
-messageSends: ["alert:"]
|
|
|
-}),
|
|
|
-$globals.BrowserInterface);
|
|
|
-
|
|
|
-$core.addMethod(
|
|
|
-$core.method({
|
|
|
-selector: "confirm:",
|
|
|
-protocol: 'actions',
|
|
|
-fn: function (aString){
|
|
|
-var self=this;
|
|
|
-
|
|
|
-return $core.withContext(function($ctx1) {
|
|
|
-
|
|
|
-var $1;
|
|
|
-$1=$recv(window)._confirm_(aString);
|
|
|
-return $1;
|
|
|
-
|
|
|
-}, function($ctx1) {$ctx1.fill(self,"confirm:",{aString:aString},$globals.BrowserInterface)});
|
|
|
-
|
|
|
-},
|
|
|
-
|
|
|
-args: ["aString"],
|
|
|
-source: "confirm: aString\x0a\x09^ window confirm: aString",
|
|
|
-referencedClasses: [],
|
|
|
-
|
|
|
-messageSends: ["confirm:"]
|
|
|
-}),
|
|
|
-$globals.BrowserInterface);
|
|
|
-
|
|
|
-$core.addMethod(
|
|
|
-$core.method({
|
|
|
-selector: "isAvailable",
|
|
|
-protocol: 'testing',
|
|
|
-fn: function (){
|
|
|
-var self=this;
|
|
|
-
|
|
|
-return $core.withContext(function($ctx1) {
|
|
|
-
|
|
|
-return typeof window !== "undefined" && typeof jQuery !== "undefined";
|
|
|
-return self;
|
|
|
-
|
|
|
-}, function($ctx1) {$ctx1.fill(self,"isAvailable",{},$globals.BrowserInterface)});
|
|
|
-
|
|
|
-},
|
|
|
-
|
|
|
-args: [],
|
|
|
-source: "isAvailable\x0a<return typeof window !== \x22undefined\x22 && typeof jQuery !== \x22undefined\x22>",
|
|
|
-referencedClasses: [],
|
|
|
-
|
|
|
-messageSends: []
|
|
|
-}),
|
|
|
-$globals.BrowserInterface);
|
|
|
-
|
|
|
-$core.addMethod(
|
|
|
-$core.method({
|
|
|
-selector: "prompt:",
|
|
|
-protocol: 'actions',
|
|
|
-fn: function (aString){
|
|
|
-var self=this;
|
|
|
-
|
|
|
-return $core.withContext(function($ctx1) {
|
|
|
-
|
|
|
-var $1;
|
|
|
-$1=$recv(window)._prompt_(aString);
|
|
|
-return $1;
|
|
|
-
|
|
|
-}, function($ctx1) {$ctx1.fill(self,"prompt:",{aString:aString},$globals.BrowserInterface)});
|
|
|
-
|
|
|
-},
|
|
|
-
|
|
|
-args: ["aString"],
|
|
|
-source: "prompt: aString\x0a\x09^ window prompt: aString",
|
|
|
-referencedClasses: [],
|
|
|
-
|
|
|
-messageSends: ["prompt:"]
|
|
|
-}),
|
|
|
-$globals.BrowserInterface);
|
|
|
-
|
|
|
-$core.addMethod(
|
|
|
-$core.method({
|
|
|
-selector: "prompt:default:",
|
|
|
-protocol: 'actions',
|
|
|
-fn: function (aString,defaultString){
|
|
|
-var self=this;
|
|
|
-
|
|
|
-return $core.withContext(function($ctx1) {
|
|
|
-
|
|
|
-var $1;
|
|
|
-$1=$recv(window)._prompt_default_(aString,defaultString);
|
|
|
-return $1;
|
|
|
-
|
|
|
-}, function($ctx1) {$ctx1.fill(self,"prompt:default:",{aString:aString,defaultString:defaultString},$globals.BrowserInterface)});
|
|
|
-
|
|
|
-},
|
|
|
-
|
|
|
-args: ["aString", "defaultString"],
|
|
|
-source: "prompt: aString default: defaultString\x0a\x09^ window prompt: aString default: defaultString",
|
|
|
-referencedClasses: [],
|
|
|
-
|
|
|
-messageSends: ["prompt:default:"]
|
|
|
-}),
|
|
|
-$globals.BrowserInterface);
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
$core.addClass('HTMLCanvas', $globals.Object, ['root'], 'Web');
|
|
|
|
|
|
$globals.HTMLCanvas.comment="I am a canvas for building HTML.\x0a\x0aI provide the `#tag:` method to create a `TagBrush` (wrapping a DOM element) and convenience methods in the `tags` protocol.\x0a\x0a## API\x0a\x0aMy instances are used as the argument of the `#renderOn:` method of `Widget` objects.\x0a\x0aThe `#with:` method is used to compose HTML, nesting tags. `#with:` can take a `TagBrush`, a `String`, a `BlockClosure` or a `Widget` as argument.\x0a\x0a## Usage example:\x0a\x0a aCanvas a \x0a with: [ aCanvas span with: 'click me' ];\x0a onClick: [ window alert: 'clicked!' ]";
|
|
@@ -3061,31 +2906,6 @@ messageSends: ["with:", "root"]
|
|
|
$globals.HTMLCanvas);
|
|
|
|
|
|
|
|
|
-$core.addMethod(
|
|
|
-$core.method({
|
|
|
-selector: "initialize",
|
|
|
-protocol: 'initialization',
|
|
|
-fn: function (){
|
|
|
-var self=this;
|
|
|
-function $Smalltalk(){return $globals.Smalltalk||(typeof Smalltalk=="undefined"?nil:Smalltalk)}
|
|
|
-
|
|
|
-return $core.withContext(function($ctx1) {
|
|
|
-
|
|
|
-$recv($Smalltalk())._optOut_(jQuery);
|
|
|
-return self;
|
|
|
-
|
|
|
-}, function($ctx1) {$ctx1.fill(self,"initialize",{},$globals.HTMLCanvas.klass)});
|
|
|
-
|
|
|
-},
|
|
|
-
|
|
|
-args: [],
|
|
|
-source: "initialize\x0a\x09\x22Allow JS method calls for the jQuery object.\x0a\x09See boot.js DNU handling.\x22\x0a\x09\x0a\x09Smalltalk optOut: jQuery",
|
|
|
-referencedClasses: ["Smalltalk"],
|
|
|
-
|
|
|
-messageSends: ["optOut:"]
|
|
|
-}),
|
|
|
-$globals.HTMLCanvas.klass);
|
|
|
-
|
|
|
$core.addMethod(
|
|
|
$core.method({
|
|
|
selector: "onJQuery:",
|
|
@@ -5407,56 +5227,6 @@ messageSends: ["value:", "onJQuery:"]
|
|
|
}),
|
|
|
$globals.BlockClosure);
|
|
|
|
|
|
-$core.addMethod(
|
|
|
-$core.method({
|
|
|
-selector: "asJQuery",
|
|
|
-protocol: '*Web',
|
|
|
-fn: function (){
|
|
|
-var self=this;
|
|
|
-
|
|
|
-return $core.withContext(function($ctx1) {
|
|
|
-
|
|
|
-var $1;
|
|
|
-$1=$recv([self])._asJQuery();
|
|
|
-return $1;
|
|
|
-
|
|
|
-}, function($ctx1) {$ctx1.fill(self,"asJQuery",{},$globals.BlockClosure)});
|
|
|
-
|
|
|
-},
|
|
|
-
|
|
|
-args: [],
|
|
|
-source: "asJQuery\x0a\x09^ {self} asJQuery",
|
|
|
-referencedClasses: [],
|
|
|
-
|
|
|
-messageSends: ["asJQuery"]
|
|
|
-}),
|
|
|
-$globals.BlockClosure);
|
|
|
-
|
|
|
-$core.addMethod(
|
|
|
-$core.method({
|
|
|
-selector: "asJQueryInContext:",
|
|
|
-protocol: '*Web',
|
|
|
-fn: function (aContext){
|
|
|
-var self=this;
|
|
|
-
|
|
|
-return $core.withContext(function($ctx1) {
|
|
|
-
|
|
|
-var $1;
|
|
|
-$1=$recv([self])._asJQueryInContext_(aContext);
|
|
|
-return $1;
|
|
|
-
|
|
|
-}, function($ctx1) {$ctx1.fill(self,"asJQueryInContext:",{aContext:aContext},$globals.BlockClosure)});
|
|
|
-
|
|
|
-},
|
|
|
-
|
|
|
-args: ["aContext"],
|
|
|
-source: "asJQueryInContext: aContext\x0a\x09^ {self} asJQueryInContext: aContext",
|
|
|
-referencedClasses: [],
|
|
|
-
|
|
|
-messageSends: ["asJQueryInContext:"]
|
|
|
-}),
|
|
|
-$globals.BlockClosure);
|
|
|
-
|
|
|
$core.addMethod(
|
|
|
$core.method({
|
|
|
selector: "asSnippet",
|
|
@@ -5483,54 +5253,6 @@ messageSends: ["snippetAt:", "current", "asString"]
|
|
|
}),
|
|
|
$globals.CharacterArray);
|
|
|
|
|
|
-$core.addMethod(
|
|
|
-$core.method({
|
|
|
-selector: "asJQuery",
|
|
|
-protocol: '*Web',
|
|
|
-fn: function (){
|
|
|
-var self=this;
|
|
|
-
|
|
|
-return $core.withContext(function($ctx1) {
|
|
|
-
|
|
|
-return jQuery(self['@jsObject']);
|
|
|
-return self;
|
|
|
-
|
|
|
-}, function($ctx1) {$ctx1.fill(self,"asJQuery",{},$globals.JSObjectProxy)});
|
|
|
-
|
|
|
-},
|
|
|
-
|
|
|
-args: [],
|
|
|
-source: "asJQuery\x0a\x09<return jQuery(self['@jsObject'])>",
|
|
|
-referencedClasses: [],
|
|
|
-
|
|
|
-messageSends: []
|
|
|
-}),
|
|
|
-$globals.JSObjectProxy);
|
|
|
-
|
|
|
-$core.addMethod(
|
|
|
-$core.method({
|
|
|
-selector: "asJQueryInContext:",
|
|
|
-protocol: '*Web',
|
|
|
-fn: function (aContext){
|
|
|
-var self=this;
|
|
|
-
|
|
|
-return $core.withContext(function($ctx1) {
|
|
|
-
|
|
|
-return jQuery(self['@jsObject'], aContext);
|
|
|
-return self;
|
|
|
-
|
|
|
-}, function($ctx1) {$ctx1.fill(self,"asJQueryInContext:",{aContext:aContext},$globals.JSObjectProxy)});
|
|
|
-
|
|
|
-},
|
|
|
-
|
|
|
-args: ["aContext"],
|
|
|
-source: "asJQueryInContext: aContext\x0a\x09<return jQuery(self['@jsObject'], aContext)>",
|
|
|
-referencedClasses: [],
|
|
|
-
|
|
|
-messageSends: []
|
|
|
-}),
|
|
|
-$globals.JSObjectProxy);
|
|
|
-
|
|
|
$core.addMethod(
|
|
|
$core.method({
|
|
|
selector: "appendToBrush:",
|
|
@@ -5579,54 +5301,6 @@ messageSends: ["append:", "asString"]
|
|
|
}),
|
|
|
$globals.Object);
|
|
|
|
|
|
-$core.addMethod(
|
|
|
-$core.method({
|
|
|
-selector: "asJQuery",
|
|
|
-protocol: '*Web',
|
|
|
-fn: function (){
|
|
|
-var self=this;
|
|
|
-
|
|
|
-return $core.withContext(function($ctx1) {
|
|
|
-
|
|
|
-return jQuery(self);
|
|
|
-return self;
|
|
|
-
|
|
|
-}, function($ctx1) {$ctx1.fill(self,"asJQuery",{},$globals.Object)});
|
|
|
-
|
|
|
-},
|
|
|
-
|
|
|
-args: [],
|
|
|
-source: "asJQuery\x0a\x09<return jQuery(self)>",
|
|
|
-referencedClasses: [],
|
|
|
-
|
|
|
-messageSends: []
|
|
|
-}),
|
|
|
-$globals.Object);
|
|
|
-
|
|
|
-$core.addMethod(
|
|
|
-$core.method({
|
|
|
-selector: "asJQueryInContext:",
|
|
|
-protocol: '*Web',
|
|
|
-fn: function (aContext){
|
|
|
-var self=this;
|
|
|
-
|
|
|
-return $core.withContext(function($ctx1) {
|
|
|
-
|
|
|
-return jQuery(self, aContext);
|
|
|
-return self;
|
|
|
-
|
|
|
-}, function($ctx1) {$ctx1.fill(self,"asJQueryInContext:",{aContext:aContext},$globals.Object)});
|
|
|
-
|
|
|
-},
|
|
|
-
|
|
|
-args: ["aContext"],
|
|
|
-source: "asJQueryInContext: aContext\x0a\x09<return jQuery(self, aContext)>",
|
|
|
-referencedClasses: [],
|
|
|
-
|
|
|
-messageSends: []
|
|
|
-}),
|
|
|
-$globals.Object);
|
|
|
-
|
|
|
$core.addMethod(
|
|
|
$core.method({
|
|
|
selector: "postMessageTo:",
|
|
@@ -5724,52 +5398,4 @@ messageSends: ["append:"]
|
|
|
}),
|
|
|
$globals.String);
|
|
|
|
|
|
-$core.addMethod(
|
|
|
-$core.method({
|
|
|
-selector: "asJQuery",
|
|
|
-protocol: '*Web',
|
|
|
-fn: function (){
|
|
|
-var self=this;
|
|
|
-
|
|
|
-return $core.withContext(function($ctx1) {
|
|
|
-
|
|
|
-return jQuery(String(self));
|
|
|
-return self;
|
|
|
-
|
|
|
-}, function($ctx1) {$ctx1.fill(self,"asJQuery",{},$globals.String)});
|
|
|
-
|
|
|
-},
|
|
|
-
|
|
|
-args: [],
|
|
|
-source: "asJQuery\x0a\x09<return jQuery(String(self))>",
|
|
|
-referencedClasses: [],
|
|
|
-
|
|
|
-messageSends: []
|
|
|
-}),
|
|
|
-$globals.String);
|
|
|
-
|
|
|
-$core.addMethod(
|
|
|
-$core.method({
|
|
|
-selector: "asJQueryInContext:",
|
|
|
-protocol: '*Web',
|
|
|
-fn: function (aContext){
|
|
|
-var self=this;
|
|
|
-
|
|
|
-return $core.withContext(function($ctx1) {
|
|
|
-
|
|
|
-return jQuery(String(self), aContext);
|
|
|
-return self;
|
|
|
-
|
|
|
-}, function($ctx1) {$ctx1.fill(self,"asJQueryInContext:",{aContext:aContext},$globals.String)});
|
|
|
-
|
|
|
-},
|
|
|
-
|
|
|
-args: ["aContext"],
|
|
|
-source: "asJQueryInContext: aContext\x0a\x09<return jQuery(String(self), aContext)>",
|
|
|
-referencedClasses: [],
|
|
|
-
|
|
|
-messageSends: []
|
|
|
-}),
|
|
|
-$globals.String);
|
|
|
-
|
|
|
});
|