123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826 |
- smalltalk.addClass('JQuery', smalltalk.Object, ['jquery'], 'JQuery');
- smalltalk.addMethod(
- '_append_',
- smalltalk.method({
- selector: 'append:',
- fn: function (anObject){
- var self=this;
- smalltalk.send(anObject, "_appendToJQuery_", [self]);
- return self;}
- }),
- smalltalk.JQuery);
- smalltalk.addMethod(
- '_appendElement_',
- smalltalk.method({
- selector: 'appendElement:',
- fn: function (anElement){
- var self=this;
- smalltalk.send(self, "_call_withArgument_", ["append", anElement]);
- return self;}
- }),
- smalltalk.JQuery);
- smalltalk.addMethod(
- '_appendToJQuery_',
- smalltalk.method({
- selector: 'appendToJQuery:',
- fn: function (aJQuery){
- var self=this;
- smalltalk.send(aJQuery, "_appendElement_", [self['@jquery']]);
- return self;}
- }),
- smalltalk.JQuery);
- smalltalk.addMethod(
- '_contents_',
- smalltalk.method({
- selector: 'contents:',
- fn: function (anObject){
- var self=this;
- smalltalk.send(self, "_empty", []);
- smalltalk.send(self, "_append_", [anObject]);
- return self;}
- }),
- smalltalk.JQuery);
- smalltalk.addMethod(
- '_empty',
- smalltalk.method({
- selector: 'empty',
- fn: function (){
- var self=this;
- return smalltalk.send(self, "_call_", ["empty"]);
- return self;}
- }),
- smalltalk.JQuery);
- smalltalk.addMethod(
- '_jquery',
- smalltalk.method({
- selector: 'jquery',
- fn: function (){
- var self=this;
- return self['@jquery'];
- return self;}
- }),
- smalltalk.JQuery);
- smalltalk.addMethod(
- '_removeAttribute_',
- smalltalk.method({
- selector: 'removeAttribute:',
- fn: function (aString){
- var self=this;
- return smalltalk.send(self, "_call_withArgument_", ["removeAttribute", aString]);
- return self;}
- }),
- smalltalk.JQuery);
- smalltalk.addMethod(
- '_attr_',
- smalltalk.method({
- selector: 'attr:',
- fn: function (aString){
- var self=this;
- return smalltalk.send(self, "_call_withArgument_", ["attr", aString]);
- return self;}
- }),
- smalltalk.JQuery);
- smalltalk.addMethod(
- '_val',
- smalltalk.method({
- selector: 'val',
- fn: function (){
- var self=this;
- return smalltalk.send(self, "_call_", ["val"]);
- return self;}
- }),
- smalltalk.JQuery);
- smalltalk.addMethod(
- '_val_',
- smalltalk.method({
- selector: 'val:',
- fn: function (aString){
- var self=this;
- smalltalk.send(self, "_call_withArgument_", ["val", aString]);
- return self;}
- }),
- smalltalk.JQuery);
- smalltalk.addMethod(
- '_attrAt_put_',
- smalltalk.method({
- selector: 'attrAt:put:',
- fn: function (aString, anotherString){
- var self=this;
- self['@jquery'].attr(aString, anotherString);
- return self;}
- }),
- smalltalk.JQuery);
- smalltalk.addMethod(
- '_cssAt_',
- smalltalk.method({
- selector: 'cssAt:',
- fn: function (aString){
- var self=this;
- return self['@jquery'].css(aString);
- return self;}
- }),
- smalltalk.JQuery);
- smalltalk.addMethod(
- '_cssAt_put_',
- smalltalk.method({
- selector: 'cssAt:put:',
- fn: function (aString, anotherString){
- var self=this;
- self['@jquery'].css(aString, anotherString);
- return self;}
- }),
- smalltalk.JQuery);
- smalltalk.addMethod(
- '_addClass_',
- smalltalk.method({
- selector: 'addClass:',
- fn: function (aString){
- var self=this;
- smalltalk.send(self, "_call_withArgument_", ["addClass", aString]);
- return self;}
- }),
- smalltalk.JQuery);
- smalltalk.addMethod(
- '_removeClass_',
- smalltalk.method({
- selector: 'removeClass:',
- fn: function (aString){
- var self=this;
- smalltalk.send(self, "_call_withArgument_", ["removeClass", aString]);
- return self;}
- }),
- smalltalk.JQuery);
- smalltalk.addMethod(
- '_toggleClass_',
- smalltalk.method({
- selector: 'toggleClass:',
- fn: function (aString){
- var self=this;
- smalltalk.send(self, "_call_withArgument_", ["toggleClass", aString]);
- return self;}
- }),
- smalltalk.JQuery);
- smalltalk.addMethod(
- '_height',
- smalltalk.method({
- selector: 'height',
- fn: function (){
- var self=this;
- return smalltalk.send(self, "_call_", ["height"]);
- return self;}
- }),
- smalltalk.JQuery);
- smalltalk.addMethod(
- '_height_',
- smalltalk.method({
- selector: 'height:',
- fn: function (anInteger){
- var self=this;
- smalltalk.send(self, "_call_withArgument_", ["height", anInteger]);
- return self;}
- }),
- smalltalk.JQuery);
- smalltalk.addMethod(
- '_width_',
- smalltalk.method({
- selector: 'width:',
- fn: function (anInteger){
- var self=this;
- smalltalk.send(self, "_call_withArgument_", ["width", anInteger]);
- return self;}
- }),
- smalltalk.JQuery);
- smalltalk.addMethod(
- '_width',
- smalltalk.method({
- selector: 'width',
- fn: function (){
- var self=this;
- return smalltalk.send(self, "_call_", ["width"]);
- return self;}
- }),
- smalltalk.JQuery);
- smalltalk.addMethod(
- '_innerHeight',
- smalltalk.method({
- selector: 'innerHeight',
- fn: function (){
- var self=this;
- return smalltalk.send(self, "_call_", ["innerHeight"]);
- return self;}
- }),
- smalltalk.JQuery);
- smalltalk.addMethod(
- '_innerWidth',
- smalltalk.method({
- selector: 'innerWidth',
- fn: function (){
- var self=this;
- return smalltalk.send(self, "_call_", ["innerWidth"]);
- return self;}
- }),
- smalltalk.JQuery);
- smalltalk.addMethod(
- '_outerHeight',
- smalltalk.method({
- selector: 'outerHeight',
- fn: function (){
- var self=this;
- return smalltalk.send(self, "_call_", ["outerHeight"]);
- return self;}
- }),
- smalltalk.JQuery);
- smalltalk.addMethod(
- '_outerWidth',
- smalltalk.method({
- selector: 'outerWidth',
- fn: function (){
- var self=this;
- return smalltalk.send(self, "_call_", ["outerWidth"]);
- return self;}
- }),
- smalltalk.JQuery);
- smalltalk.addMethod(
- '_top',
- smalltalk.method({
- selector: 'top',
- fn: function (){
- var self=this;
- return smalltalk.send(smalltalk.send(self, "_call_", ["position"]), "_basicAt_", ["top"]);
- return self;}
- }),
- smalltalk.JQuery);
- smalltalk.addMethod(
- '_left',
- smalltalk.method({
- selector: 'left',
- fn: function (){
- var self=this;
- return smalltalk.send(smalltalk.send(self, "_call_", ["position"]), "_basicAt_", ["left"]);
- return self;}
- }),
- smalltalk.JQuery);
- smalltalk.addMethod(
- '_offsetLeft',
- smalltalk.method({
- selector: 'offsetLeft',
- fn: function (){
- var self=this;
- return smalltalk.send(smalltalk.send(self, "_call_", ["offset"]), "_basicAt_", ["left"]);
- return self;}
- }),
- smalltalk.JQuery);
- smalltalk.addMethod(
- '_offsetTop',
- smalltalk.method({
- selector: 'offsetTop',
- fn: function (){
- var self=this;
- return smalltalk.send(smalltalk.send(self, "_call_", ["offset"]), "_basicAt_", ["top"]);
- return self;}
- }),
- smalltalk.JQuery);
- smalltalk.addMethod(
- '_scrollLeft',
- smalltalk.method({
- selector: 'scrollLeft',
- fn: function (){
- var self=this;
- return smalltalk.send(self, "_call_", ["scrollLeft"]);
- return self;}
- }),
- smalltalk.JQuery);
- smalltalk.addMethod(
- '_scrollTop',
- smalltalk.method({
- selector: 'scrollTop',
- fn: function (){
- var self=this;
- return smalltalk.send(self, "_call_", ["scrollTop"]);
- return self;}
- }),
- smalltalk.JQuery);
- smalltalk.addMethod(
- '_scrollLeft_',
- smalltalk.method({
- selector: 'scrollLeft:',
- fn: function (anInteger){
- var self=this;
- smalltalk.send(self, "_call_withArgument_", ["scrollLeft", anInteger]);
- return self;}
- }),
- smalltalk.JQuery);
- smalltalk.addMethod(
- '_scrollTop_',
- smalltalk.method({
- selector: 'scrollTop:',
- fn: function (anInteger){
- var self=this;
- smalltalk.send(self, "_call_withArgument_", ["scrollTop", anInteger]);
- return self;}
- }),
- smalltalk.JQuery);
- smalltalk.addMethod(
- '_fadeIn',
- smalltalk.method({
- selector: 'fadeIn',
- fn: function (){
- var self=this;
- smalltalk.send(self, "_call_", ["fadeIn"]);
- return self;}
- }),
- smalltalk.JQuery);
- smalltalk.addMethod(
- '_slideDown',
- smalltalk.method({
- selector: 'slideDown',
- fn: function (){
- var self=this;
- smalltalk.send(self, "_call_", ["slideDown"]);
- return self;}
- }),
- smalltalk.JQuery);
- smalltalk.addMethod(
- '_fadeInSlow',
- smalltalk.method({
- selector: 'fadeInSlow',
- fn: function (){
- var self=this;
- smalltalk.send(self, "_call_withArgument_", ["fadeIn", "slow"]);
- return self;}
- }),
- smalltalk.JQuery);
- smalltalk.addMethod(
- '_fadeOut',
- smalltalk.method({
- selector: 'fadeOut',
- fn: function (){
- var self=this;
- smalltalk.send(self, "_call_", ["fadeOut"]);
- return self;}
- }),
- smalltalk.JQuery);
- smalltalk.addMethod(
- '_fadeOutSlow',
- smalltalk.method({
- selector: 'fadeOutSlow',
- fn: function (){
- var self=this;
- smalltalk.send(self, "_call_withArgument_", ["fadeOut", "slow"]);
- return self;}
- }),
- smalltalk.JQuery);
- smalltalk.addMethod(
- '_slideUp',
- smalltalk.method({
- selector: 'slideUp',
- fn: function (){
- var self=this;
- smalltalk.send(self, "_call_", ["slideUp"]);
- return self;}
- }),
- smalltalk.JQuery);
- smalltalk.addMethod(
- '_fadeOut_do_',
- smalltalk.method({
- selector: 'fadeOut:do:',
- fn: function (aString, aBlock){
- var self=this;
- self['@jquery'].fadeOut(aString, aBlock);
- return self;}
- }),
- smalltalk.JQuery);
- smalltalk.addMethod(
- '_do_',
- smalltalk.method({
- selector: 'do:',
- fn: function (aBlock){
- var self=this;
- smalltalk.send(self, "_elementsDo_", [(function(anElement){return smalltalk.send(aBlock, "_value_", [smalltalk.send((smalltalk.JQuery || JQuery), "_fromElement_", [anElement])]);})]);
- return self;}
- }),
- smalltalk.JQuery);
- smalltalk.addMethod(
- '_focus',
- smalltalk.method({
- selector: 'focus',
- fn: function (){
- var self=this;
- smalltalk.send(self, "_call_", ["focus"]);
- return self;}
- }),
- smalltalk.JQuery);
- smalltalk.addMethod(
- '_show',
- smalltalk.method({
- selector: 'show',
- fn: function (){
- var self=this;
- smalltalk.send(self, "_call_", ["show"]);
- return self;}
- }),
- smalltalk.JQuery);
- smalltalk.addMethod(
- '_hide',
- smalltalk.method({
- selector: 'hide',
- fn: function (){
- var self=this;
- smalltalk.send(self, "_call_", ["hide"]);
- return self;}
- }),
- smalltalk.JQuery);
- smalltalk.addMethod(
- '_remove',
- smalltalk.method({
- selector: 'remove',
- fn: function (){
- var self=this;
- smalltalk.send(self, "_call_", ["remove"]);
- return self;}
- }),
- smalltalk.JQuery);
- smalltalk.addMethod(
- '_on_do_',
- smalltalk.method({
- selector: 'on:do:',
- fn: function (anEventString, aBlock){
- var self=this;
- self['@jquery'].bind(anEventString, function(e){aBlock(e, self)});
- return self;}
- }),
- smalltalk.JQuery);
- smalltalk.addMethod(
- '_removeEvents_',
- smalltalk.method({
- selector: 'removeEvents:',
- fn: function (aString){
- var self=this;
- smalltalk.send(self, "_call_withArgument_", ["unbind", aString]);
- return self;}
- }),
- smalltalk.JQuery);
- smalltalk.addMethod(
- '_onLoadDo_',
- smalltalk.method({
- selector: 'onLoadDo:',
- fn: function (aBlock){
- var self=this;
- smalltalk.send(self, "_call_withArgument_", ["load", aBlock]);
- return self;}
- }),
- smalltalk.JQuery);
- smalltalk.addMethod(
- '_initializeWithJQueryObject_',
- smalltalk.method({
- selector: 'initializeWithJQueryObject:',
- fn: function (anObject){
- var self=this;
- self['@jquery']=anObject;
- return self;}
- }),
- smalltalk.JQuery);
- smalltalk.addMethod(
- '_call_',
- smalltalk.method({
- selector: 'call:',
- fn: function (aString){
- var self=this;
- return self['@jquery'][aString]();
- return self;}
- }),
- smalltalk.JQuery);
- smalltalk.addMethod(
- '_call_withArgument_',
- smalltalk.method({
- selector: 'call:withArgument:',
- fn: function (aString, anObject){
- var self=this;
- return self['@jquery'][aString](anObject);
- return self;}
- }),
- smalltalk.JQuery);
- smalltalk.addMethod(
- '_elementsDo_',
- smalltalk.method({
- selector: 'elementsDo:',
- fn: function (aBlock){
- var self=this;
- self['@jquery'].each(function(index, element){aBlock(element, self)});
- return self;}
- }),
- smalltalk.JQuery);
- smalltalk.addMethod(
- '_hasClass_',
- smalltalk.method({
- selector: 'hasClass:',
- fn: function (aString){
- var self=this;
- return smalltalk.send(self, "_call_withArgument_", ["hasClass", aString]);
- return self;}
- }),
- smalltalk.JQuery);
- smalltalk.addMethod(
- '_find_',
- smalltalk.method({
- selector: 'find:',
- fn: function (aSelector){
- var self=this;
- return smalltalk.send(self, "_call_withArgument_", ["find", aSelector]);
- return self;}
- }),
- smalltalk.JQuery);
- smalltalk.addMethod(
- '_fromString_',
- smalltalk.method({
- selector: 'fromString:',
- fn: function (aString){
- var self=this;
- var newJQuery=nil;
- newJQuery = jQuery(String(aString));
- return smalltalk.send(self, "_from_", [newJQuery]);
- return self;}
- }),
- smalltalk.JQuery.klass);
- smalltalk.addMethod(
- '_from_',
- smalltalk.method({
- selector: 'from:',
- fn: function (anObject){
- var self=this;
- return (function($rec){smalltalk.send($rec, "_initializeWithJQueryObject_", [anObject]);return smalltalk.send($rec, "_yourself", []);})(smalltalk.send(self, "_new", []));
- return self;}
- }),
- smalltalk.JQuery.klass);
- smalltalk.addMethod(
- '_window',
- smalltalk.method({
- selector: 'window',
- fn: function (){
- var self=this;
- return self._from_(jQuery(window));
- return self;}
- }),
- smalltalk.JQuery.klass);
- smalltalk.addMethod(
- '_body',
- smalltalk.method({
- selector: 'body',
- fn: function (){
- var self=this;
- return self._from_(jQuery('body'));
- return self;}
- }),
- smalltalk.JQuery.klass);
- smalltalk.addMethod(
- '_document',
- smalltalk.method({
- selector: 'document',
- fn: function (){
- var self=this;
- return self._from_(jQuery(document));
- return self;}
- }),
- smalltalk.JQuery.klass);
- smalltalk.addMethod(
- '_fromElement_',
- smalltalk.method({
- selector: 'fromElement:',
- fn: function (anElement){
- var self=this;
- var newJQuery=nil;
- newJQuery = jQuery(anElement);
- return smalltalk.send(self, "_from_", [newJQuery]);
- return self;}
- }),
- smalltalk.JQuery.klass);
- smalltalk.addMethod(
- '_documentReady_',
- smalltalk.method({
- selector: 'documentReady:',
- fn: function (aBlock){
- var self=this;
- jQuery(document).ready(aBlock);
- return self;}
- }),
- smalltalk.JQuery.klass);
- smalltalk.addClass('Ajax', smalltalk.Object, ['settings'], 'JQuery');
- smalltalk.addMethod(
- '_at_',
- smalltalk.method({
- selector: 'at:',
- fn: function (aKey){
- var self=this;
- return smalltalk.send(self['@settings'], "_at_ifAbsent_", [aKey, (function(){return nil;})]);
- return self;}
- }),
- smalltalk.Ajax);
- smalltalk.addMethod(
- '_at_put_',
- smalltalk.method({
- selector: 'at:put:',
- fn: function (aKey, aValue){
- var self=this;
- smalltalk.send(self['@settings'], "_at_put_", [aKey, aValue]);
- return self;}
- }),
- smalltalk.Ajax);
- smalltalk.addMethod(
- '_url',
- smalltalk.method({
- selector: 'url',
- fn: function (){
- var self=this;
- return smalltalk.send(self, "_at_", ["url"]);
- return self;}
- }),
- smalltalk.Ajax);
- smalltalk.addMethod(
- '_url_',
- smalltalk.method({
- selector: 'url:',
- fn: function (aString){
- var self=this;
- smalltalk.send(self, "_at_put_", ["url", aString]);
- return self;}
- }),
- smalltalk.Ajax);
- smalltalk.addMethod(
- '_send',
- smalltalk.method({
- selector: 'send',
- fn: function (){
- var self=this;
- jQuery.ajax(self['@settings']);
- return self;}
- }),
- smalltalk.Ajax);
- smalltalk.addMethod(
- '_onSuccessDo_',
- smalltalk.method({
- selector: 'onSuccessDo:',
- fn: function (aBlock){
- var self=this;
- smalltalk.send(self, "_at_put_", ["success", aBlock]);
- return self;}
- }),
- smalltalk.Ajax);
- smalltalk.addMethod(
- '_onCompleteDo_',
- smalltalk.method({
- selector: 'onCompleteDo:',
- fn: function (aBlock){
- var self=this;
- smalltalk.send(self, "_at_put_", ["complete", aBlock]);
- return self;}
- }),
- smalltalk.Ajax);
- smalltalk.addMethod(
- '_onErrorDo_',
- smalltalk.method({
- selector: 'onErrorDo:',
- fn: function (aBlock){
- var self=this;
- smalltalk.send(self, "_at_put_", ["error", aBlock]);
- return self;}
- }),
- smalltalk.Ajax);
- smalltalk.addMethod(
- '_initialize',
- smalltalk.method({
- selector: 'initialize',
- fn: function (){
- var self=this;
- smalltalk.send(self, "_initialize", [], smalltalk.Object);
- self['@settings']=smalltalk.send((smalltalk.Dictionary || Dictionary), "_new", []);
- return self;}
- }),
- smalltalk.Ajax);
- smalltalk.addMethod(
- '_url_',
- smalltalk.method({
- selector: 'url:',
- fn: function (aString){
- var self=this;
- return (function($rec){smalltalk.send($rec, "_url_", [aString]);return smalltalk.send($rec, "_yourself", []);})(smalltalk.send(self, "_new", []));
- return self;}
- }),
- smalltalk.Ajax.klass);
- smalltalk.addMethod(
- '_appendToJQuery_',
- smalltalk.method({
- selector: 'appendToJQuery:',
- fn: function (aJQuery){
- var self=this;
- smalltalk.send(self, "_value_", [smalltalk.send((smalltalk.HTMLCanvas || HTMLCanvas), "_onJQuery_", [aJQuery])]);
- return self;}
- }),
- smalltalk.BlockClosure);
- smalltalk.addMethod(
- '_asJQuery',
- smalltalk.method({
- selector: 'asJQuery',
- fn: function (){
- var self=this;
- return smalltalk.send((smalltalk.JQuery || JQuery), "_fromString_", [self]);
- return self;}
- }),
- smalltalk.String);
- smalltalk.addMethod(
- '_appendToJQuery_',
- smalltalk.method({
- selector: 'appendToJQuery:',
- fn: function (aJQuery){
- var self=this;
- aJQuery._appendElement_(String(self));
- return self;}
- }),
- smalltalk.String);
- smalltalk.addMethod(
- '_appendToJQuery_',
- smalltalk.method({
- selector: 'appendToJQuery:',
- fn: function (aJQuery){
- var self=this;
- smalltalk.send(aJQuery, "_appendElement_", [smalltalk.send(self['@root'], "_element", [])]);
- return self;}
- }),
- smalltalk.HTMLCanvas);
|