2
0
Преглед на файлове

Merge pull request #27 from tomrake/update-examples

amber examples updated
Nicolas Petton преди 10 години
родител
ревизия
d79d11af3a

+ 3 - 0
android/.gitignore

@@ -0,0 +1,3 @@
+helloamber/.classpath
+helloamber/.project
+helloamber/.settings

+ 1 - 1
googlecharts

@@ -1 +1 @@
-Subproject commit 1811f701613a9ce76dfe46f8d43b0aba41fda942
+Subproject commit e5fa09e2089253a5a6571eeff3c257e6369ca600

+ 0 - 1
index.html

@@ -8,7 +8,6 @@
 		<li><a href="./presentation/index.html">Amber Presentations</a></li>
 		<li><a href="./processing/index.html">Amber Example using Processing.js</a></li>
 		<li><a href="./trysmalltalk/index.html">Prof Stef Tutorial</a></li>
-		<li><a href="./twitterwall/index.html">Twitterwall Example</a></li>
 	</ul>
 </body>
 </html>

+ 2 - 1
presentation/Gruntfile.js

@@ -15,7 +15,8 @@ module.exports = function(grunt) {
         src: ['st/Presentation.st'],
         libraries: ['Canvas'],
         output_dir: 'js',
-        deploy: true
+        deploy: true,
+        amd_namespace: 'amber_examples_presentation'
       }
     }
   });

+ 13 - 6
presentation/index.html

@@ -1,16 +1,23 @@
 <html>
 <head>
 <title>JTalk - Presentation</title>
-<script src="../vendor/amber/js/amber.js" type="text/javascript"></script>
+<script src="../vendor/amber/support/requirejs/require.min.js" type="text/javascript"></script>
+<script src="../vendor/amber/support/amber.js" type="text/javascript"></script>
 </head>
 <body>
 
 <script type="text/javascript"> 
-	loadAmber({
-		files: ['Presentation'],
-		packageHome: './'
-		//ready: function() {smalltalk.Browser._openOn_(smalltalk.FOSDEM2012Presentation)}
-	}); 
+	require.config({
+		paths: {
+			'amber_examples_presentation': 'js',
+			'amber_examples_presentation\_source': 'st'
+		}
+	});
+	require(['amber/devel','amber_examples_presentation/Presentation'],function(smalltalk) {
+		smalltalk.defaultAmdNamespace = 'amber_examples_presentation';
+		smalltalk.initialize();
+		smalltalk.Browser._openOn_(smalltalk.FOSDEM2012Presentation);
+	});
 </script>
 
 </body>

+ 2 - 0
presentation/js/Presentation.deploy.js

@@ -1,3 +1,4 @@
+(function(smalltalk,nil,_st){
 smalltalk.addPackage('Presentation');
 smalltalk.addClass('Presentation', smalltalk.Widget, ['currentSlide', 'slides'], 'Presentation');
 smalltalk.addMethod(
@@ -3285,3 +3286,4 @@ smalltalk.WorkspaceSlide);
 
 
 
+})(global_smalltalk,global_nil,global__st);

+ 4 - 1
presentation/js/Presentation.js

@@ -1,4 +1,7 @@
+define("amber_examples_presentation/Presentation", ["amber_vm/smalltalk", "amber_vm/nil", "amber_vm/_st", "amber_core/Canvas"], function(smalltalk,nil,_st){
 smalltalk.addPackage('Presentation');
+smalltalk.packages["Presentation"].transport = {"type":"amd","amdNamespace":"amber_examples_presentation"};
+
 smalltalk.addClass('Presentation', smalltalk.Widget, ['currentSlide', 'slides'], 'Presentation');
 smalltalk.addMethod(
 smalltalk.method({
@@ -4204,4 +4207,4 @@ referencedClasses: ["SourceArea"]
 smalltalk.WorkspaceSlide);
 
 
-
+});

+ 2 - 1
processing/Gruntfile.js

@@ -14,7 +14,8 @@ module.exports = function(grunt) {
       processing: {
         src: ['st/Processing-Examples.st'],
         output_dir: 'js',
-        deploy: true
+        deploy: true,
+        amd_namespace: 'amber_examples_processing'
       }
     }
   });

+ 21 - 14
processing/index.html

@@ -7,15 +7,17 @@
     <link rel="stylesheet" type="text/css" href='css/style.css' /> 
     <link type="image/x-icon" rel="shortcut icon" href="/favicon.ico"/> 
     <link href='http://fonts.googleapis.com/css?family=Istok+Web' rel='stylesheet' type='text/css'> 
-    <script type='text/javascript' src='../vendor/amber/js/amber.js'></script>
+	<script type="text/javascript" src="../vendor/amber/support/requirejs/require.min.js"></script>
+    <script type='text/javascript' src='../vendor/amber/support/amber.js'></script>
     <script type='text/javascript' src='showdown/showdown.js'></script>
 	<script type="text/javascript" src="processing-1.4.1.js"></script>
   </head> 
   <body> 
-	A Clock made with <a href="http://processingjs.org">Processing.js</a> and <a href"http://amber-lang.net/">Amber</a>
-	<p>Examine the <button onClick="smalltalk.Browser._openOn_(smalltalk.ProcessingClock)"> ProcessingClock class</button></p> 
+	A Clock made with <a href="http://processingjs.org">Processing.js</a> and <a href="http://amber-lang.net/">Amber</a>
+	<p>Examine the <button onClick="buttonClick()"> ProcessingClock class</button></p> 
 	<p><canvas id="canvas1" width="200" height="200"></canvas></p>
 	<script id="script1" type="text/javascript">
+		var buttonClick;
 		// Simple way to attach js code to the canvas is by using a function
 		function sketchProc(processing) {
 			// Override draw function, by default it will be called 60 times per second
@@ -25,17 +27,22 @@
 		var canvas = document.getElementById("canvas1");
 		// attaching the sketchProc function to the canvas
 		var p = new Processing(canvas, sketchProc);
-	</script>
-	   
-	<script type='text/javascript'> loadAmber(
-		{
-			packages: [ 'Processing-Examples' ],
-            packageHome: './',
-			ready: function() {
-				smalltalk.ProcessingClock._init() 
+		require.config({
+			paths: {
+				'amber_examples_processing': 'js',
+				'amber_examples_processing\_source': 'st'
 			}
-		}) 
-	</script> 
-	
+		});
+		require(['amber/devel','amber_examples_processing/Processing-Examples'],function(smalltalk){
+
+			smalltalk.defaultAmdNamespace = 'amber_examples_processing';
+			smalltalk.initialize();
+			buttonClick = function() {
+				smalltalk.Browser._openOn_(smalltalk.ProcessingClock);
+			};
+			smalltalk.ProcessingClock._init();
+		});
+	</script>
+	   	
   </body> 
 </html> 

+ 5 - 3
processing/js/Processing-Examples.deploy.js

@@ -1,4 +1,6 @@
+(function(smalltalk,nil,_st){
 smalltalk.addPackage('Processing-Examples');
+
 smalltalk.addClass('ProcessingClock', smalltalk.Object, ['processing', 'centerX', 'centerY', 'maxArmLength'], 'Processing-Examples');
 smalltalk.addMethod(
 smalltalk.method({
@@ -15,10 +17,10 @@ return smalltalk.withContext(function($ctx2) {
 _st(self["@processing"])._background_((224));
 now=_st($Date())._new();
 now;
-hoursPosition=_st(_st(_st(_st(_st(now)._hours()).__backslash_backslash((12))).__plus(_st(now)._minutes())).__slash((60))).__slash((12));
+hoursPosition=_st(_st(_st(_st(now)._hours()).__backslash_backslash((12))).__plus(_st(_st(now)._minutes()).__slash((60)))).__slash((12));
 hoursPosition;
 self._drawArm_lengthScale_weight_(hoursPosition,(0.5),(5));
-minutesPosition=_st(_st(_st(_st(now)._minutes()).__plus(_st(now)._seconds())).__slash((60))).__slash((60));
+minutesPosition=_st(_st(_st(now)._minutes()).__plus(_st(_st(now)._seconds()).__slash((60)))).__slash((60));
 minutesPosition;
 self._drawArm_lengthScale_weight_(minutesPosition,(0.8),(3));
 secondsPosition=_st(_st(now)._seconds()).__slash((60));
@@ -103,4 +105,4 @@ return self}, function($ctx1) {$ctx1.fill(self,"init",{clock:clock,processing:pr
 messageSends: ["new", "processing", "draw", "at:put:"]}),
 smalltalk.ProcessingClock.klass);
 
-
+})(global_smalltalk,global_nil,global__st);

+ 7 - 4
processing/js/Processing-Examples.js

@@ -1,4 +1,7 @@
+define("amber_examples_processing/Processing-Examples", ["amber_vm/smalltalk", "amber_vm/nil", "amber_vm/_st", "amber_core/Kernel-Objects"], function(smalltalk,nil,_st){
 smalltalk.addPackage('Processing-Examples');
+smalltalk.packages["Processing-Examples"].transport = {"type":"amd","amdNamespace":"amber_examples_processing"};
+
 smalltalk.addClass('ProcessingClock', smalltalk.Object, ['processing', 'centerX', 'centerY', 'maxArmLength'], 'Processing-Examples');
 smalltalk.addMethod(
 smalltalk.method({
@@ -16,10 +19,10 @@ return smalltalk.withContext(function($ctx2) {
 _st(self["@processing"])._background_((224));
 now=_st($Date())._new();
 now;
-hoursPosition=_st(_st(_st(_st(_st(now)._hours()).__backslash_backslash((12))).__plus(_st(now)._minutes())).__slash((60))).__slash((12));
+hoursPosition=_st(_st(_st(_st(now)._hours()).__backslash_backslash((12))).__plus(_st(_st(now)._minutes()).__slash((60)))).__slash((12));
 hoursPosition;
 self._drawArm_lengthScale_weight_(hoursPosition,(0.5),(5));
-minutesPosition=_st(_st(_st(_st(now)._minutes()).__plus(_st(now)._seconds())).__slash((60))).__slash((60));
+minutesPosition=_st(_st(_st(now)._minutes()).__plus(_st(_st(now)._seconds()).__slash((60)))).__slash((60));
 minutesPosition;
 self._drawArm_lengthScale_weight_(minutesPosition,(0.8),(3));
 secondsPosition=_st(_st(now)._seconds()).__slash((60));
@@ -30,7 +33,7 @@ $1=drawBlock;
 return $1;
 }, function($ctx1) {$ctx1.fill(self,"draw",{drawBlock:drawBlock},smalltalk.ProcessingClock)})},
 args: [],
-source: "draw\x0a| drawBlock |\x0a\x0adrawBlock := [\x0a  | now hoursPosition minutesPosition secondsPosition |  \x0a  processing background: 224.\x0a  \x0a  now := Date new.\x0a  \x0a  \x22Moving hours arm by small increments\x22\x0a   hoursPosition := now hours \x5c\x5c 12 + now minutes / 60 / 12.\x0a   self drawArm: hoursPosition lengthScale: 0.5 weight: 5.\x0a   \x0a   \x22Moving minutes arm by small increments\x22\x0a    minutesPosition := now minutes + now seconds / 60 / 60.\x0a    self drawArm: minutesPosition lengthScale: 0.80 weight: 3.\x0a\x0a    \x22Moving hour arm by second increments\x22\x0a    secondsPosition := now seconds / 60.\x0a    self drawArm: secondsPosition lengthScale: 0.90 weight: 1.\x0a  ].\x0a\x0a^drawBlock",
+source: "draw\x0a| drawBlock |\x0a\x0adrawBlock := [\x0a  | now hoursPosition minutesPosition secondsPosition |  \x0a  processing background: 224.\x0a  \x0a  now := Date new.\x0a  \x0a  \x22Moving hours arm by small increments\x22\x0a   hoursPosition := ((now hours \x5c\x5c 12) + (now minutes / 60 )) /12 .\x0a   self drawArm: hoursPosition lengthScale: 0.5 weight: 5.\x0a   \x0a   \x22Moving minutes arm by small increments\x22\x0a    minutesPosition := (now minutes + (now seconds / 60))/60.\x0a    self drawArm: minutesPosition lengthScale: 0.80 weight: 3.\x0a\x0a    \x22Moving hour arm by second increments\x22\x0a    secondsPosition := now seconds / 60.\x0a    self drawArm: secondsPosition lengthScale: 0.90 weight: 1.\x0a  ].\x0a\x0a^drawBlock",
 messageSends: ["background:", "new", "/", "+", "minutes", "\x5c\x5c", "hours", "drawArm:lengthScale:weight:", "seconds"],
 referencedClasses: ["Date"]
 }),
@@ -133,4 +136,4 @@ referencedClasses: ["ProcessingClock"]
 }),
 smalltalk.ProcessingClock.klass);
 
-
+});

+ 2 - 2
processing/st/Processing-Examples.st

@@ -15,11 +15,11 @@ drawBlock := [
   now := Date new.
   
   "Moving hours arm by small increments"
-   hoursPosition := now hours \\ 12 + now minutes / 60 / 12.
+   hoursPosition := ((now hours \\ 12) + (now minutes / 60 )) /12 .
    self drawArm: hoursPosition lengthScale: 0.5 weight: 5.
    
    "Moving minutes arm by small increments"
-    minutesPosition := now minutes + now seconds / 60 / 60.
+    minutesPosition := (now minutes + (now seconds / 60))/60.
     self drawArm: minutesPosition lengthScale: 0.80 weight: 3.
 
     "Moving hour arm by second increments"

+ 2 - 1
trysmalltalk/Gruntfile.js

@@ -15,7 +15,8 @@ module.exports = function(grunt) {
         src: ['st/TrySmalltalk.st'],
         libraries: ['Canvas'],
         output_dir: 'js',
-        deploy: true
+        deploy: true,
+        amd_namespace: 'amber_examples_profstef'
       }
     }
   });

+ 15 - 8
trysmalltalk/index.html

@@ -1,17 +1,24 @@
 <html>
 <head>
 <title>TrySmalltalk</title>
-<script src="../vendor/amber/js/amber.js" type="text/javascript"></script>
+<script src="../vendor/amber/support/requirejs/require.min.js" type="text/javascript"></script>
+<script src="../vendor/amber/support/amber.js" type="text/javascript"></script>
 </head>
 <body>
 <script type="text/javascript"> 
-	loadAmber({
-		files: ['TrySmalltalk'],
-		packageHome: './',
-		ready: function() {
-			smalltalk.Browser._openOn_(smalltalk.ProfStef)
-			smalltalk.TrySmalltalkWidget._open();
-		}}); 
+	require.config({
+		paths: {
+			'amber_examples_profstef': 'js',
+			'amber_examples_profstef\_source': 'st'
+		}
+	});
+	require(['amber/devel','amber_examples_profstef/TrySmalltalk'],function(smalltalk) {
+		smalltalk.defaultAmdNamespace = 'amber_examples_profstef';
+		smalltalk.initialize();
+		smalltalk.Browser._openOn_(smalltalk.ProfStef);
+		smalltalk.TrySmalltalkWidget._open();
+
+	});
 </script>
 
 </body>

+ 2 - 0
trysmalltalk/js/TrySmalltalk.deploy.js

@@ -1,3 +1,4 @@
+(function(smalltalk,nil,_st){
 smalltalk.addPackage('TrySmalltalk');
 smalltalk.addClass('AbstractTutorial', smalltalk.Object, [], 'TrySmalltalk');
 smalltalk.addMethod(
@@ -1083,3 +1084,4 @@ smalltalk.TutorialPlayer);
 
 
 
+})(global_smalltalk,global_nil,global__st);

+ 4 - 1
trysmalltalk/js/TrySmalltalk.js

@@ -1,4 +1,7 @@
+define("amber_examples_profstef/TrySmalltalk", ["amber_vm/smalltalk", "amber_vm/nil", "amber_vm/_st", "amber_core/Kernel-Objects", "amber_core/Canvas"], function(smalltalk,nil,_st){
 smalltalk.addPackage('TrySmalltalk');
+smalltalk.packages["TrySmalltalk"].transport = {"type":"amd","amdNamespace":"amber_examples_profstef"};
+
 smalltalk.addClass('AbstractTutorial', smalltalk.Object, [], 'TrySmalltalk');
 smalltalk.AbstractTutorial.comment="Parent class of all ProfStef tutorials.\x0a\x0aTo create your own tutorial:\x0a- subclass AbstractTutorial\x0a- implement a few methods which returns a Lesson instance\x0a- implement tutorial which returns a Collection of selectors to the methods you've created.";
 smalltalk.addMethod(
@@ -1451,4 +1454,4 @@ referencedClasses: []
 smalltalk.TutorialPlayer);
 
 
-
+});

+ 0 - 23
twitterwall/Gruntfile.js

@@ -1,23 +0,0 @@
-module.exports = function(grunt) {
-  grunt.loadTasks('../vendor/amber/grunt/tasks/');
-
-  grunt.registerTask('default', ['amberc:twitterwall']);
-
-  grunt.initConfig({
-    pkg: grunt.file.readJSON('../package.json'),
-
-    amberc: {  
-      options: {
-        amber_dir: '../vendor/amber',
-        closure_jar: ''
-      },
-      twitterwall: {
-        src: ['st/TwitterWall.st'],
-        output_dir: 'js',
-        libraries:[ 'Canvas'],
-        deploy: true
-      }
-    }
-  });
-
-}

+ 0 - 19
twitterwall/css/twitterwall.css

@@ -1,19 +0,0 @@
-#twitterwall {
-    background: #eee;
-    border: 3px solid #ccc;
-    padding: 20px;
-    margin-bottom: 50px;
-	width: 500px;
-	height: 500px;
-}
-#user {
-	width: 15%;
-}
-#message{
-	font-family:'Verdana';
-	font-size: 12px
-}
-#date{
-	font-family:'Verdana';
-	font-size: 10px
-}

+ 0 - 35
twitterwall/index.html

@@ -1,35 +0,0 @@
-
-<!DOCTYPE html> 
-<html> 
-  <head> 
-    <title>Twitterwall</title> 
-    <meta http-equiv="content-type" content="text/html; charset=utf-8" /> 
-    <meta name="author" content="Stefan Krecher" /> 
-	<link rel="stylesheet" type="text/css" href='css/twitterwall.css' /> 
-    <link type="image/x-icon" rel="shortcut icon" href="/favicon.ico"/> 
-    <link href='http://fonts.googleapis.com/css?family=Istok+Web' rel='stylesheet' type='text/css'> 
-    <script src="../vendor/amber/js/amber.js" type="text/javascript"></script>
-  </head> 
-  <body> 
-         
-	<center>
-		<h2>A simple Twitterwall made with Amber</h2>
-		<p>Shows the last 5 Tweets regarding your query</p>
-	    <p>Examine the <button onClick="smalltalk.Browser._openOn_(smalltalk.TwitterSearch)"> TwitterSearch class</button></p> 
-
-	<p>Query:<br><input id="searchQuery" type="text" size="30" maxlength="30" value="#amber-smalltalk">
-	<button onClick="smalltalk.TwitterSearch._new()._query()">update</button>
-	</p>
-	<div id="playground"></div>
-	</center>
-	<script type="text/javascript"> 
-	loadAmber({
-		files: ['TwitterWall'],
-		packageHome: './',
-		ready: function() {
-			smalltalk.TwitterSearch._new()._query() 
-		}}); 
-</script>
-	
-  </body> 
-</html> 

+ 0 - 126
twitterwall/js/TwitterWall.deploy.js

@@ -1,126 +0,0 @@
-smalltalk.addPackage('TwitterWall');
-smalltalk.addClass('Tweet', smalltalk.Widget, ['json'], 'TwitterWall');
-smalltalk.addMethod(
-smalltalk.method({
-selector: "json",
-fn: function (){
-var self=this;
-return smalltalk.withContext(function($ctx1) { 
-var $1;
-$1=self["@json"];
-return $1;
-}, function($ctx1) {$ctx1.fill(self,"json",{},smalltalk.Tweet)})},
-messageSends: []}),
-smalltalk.Tweet);
-
-smalltalk.addMethod(
-smalltalk.method({
-selector: "json:",
-fn: function (aJson){
-var self=this;
-return smalltalk.withContext(function($ctx1) { 
-self["@json"]=aJson;
-return self}, function($ctx1) {$ctx1.fill(self,"json:",{aJson:aJson},smalltalk.Tweet)})},
-messageSends: []}),
-smalltalk.Tweet);
-
-smalltalk.addMethod(
-smalltalk.method({
-selector: "renderOn:",
-fn: function (tr){
-var self=this;
-var tdUser,tdMessage,img,a,pMessage,pDate;
-function $HTMLCanvas(){return smalltalk.HTMLCanvas||(typeof HTMLCanvas=="undefined"?nil:HTMLCanvas)}
-return smalltalk.withContext(function($ctx1) { 
-tdUser=_st(_st($HTMLCanvas())._new())._td();
-_st(_st(tdUser)._element())._id_("user");
-tdMessage=_st(_st($HTMLCanvas())._new())._td();
-_st(_st(tdMessage)._element())._id_("messageBox");
-_st(tr)._append_(tdUser);
-_st(tr)._append_(tdMessage);
-img=_st(_st(_st($HTMLCanvas())._new())._img())._src_(_st(self["@json"])._at_("profile_image_url"));
-_st(_st(img)._element())._title_(_st(self["@json"])._at_("from_user"));
-_st(_st(img)._element())._longDesc_("http://twitter.com/".__comma(_st(self["@json"])._at_("from_user")));
-a=_st(_st(_st($HTMLCanvas())._new())._a())._href_("http://twitter.com/".__comma(_st(self["@json"])._at_("from_user")));
-_st(a)._append_(img);
-_st(tdUser)._append_(a);
-pMessage=_st(_st($HTMLCanvas())._new())._p();
-_st(_st(pMessage)._element())._id_("message");
-_st(pMessage)._append_(_st(self["@json"])._at_("text"));
-_st(tdMessage)._append_(pMessage);
-pDate=_st(_st($HTMLCanvas())._new())._p();
-_st(_st(pDate)._element())._id_("date");
-_st(pDate)._append_(_st(self["@json"])._at_("created_at"));
-_st(tdMessage)._append_(pDate);
-return self}, function($ctx1) {$ctx1.fill(self,"renderOn:",{tr:tr,tdUser:tdUser,tdMessage:tdMessage,img:img,a:a,pMessage:pMessage,pDate:pDate},smalltalk.Tweet)})},
-messageSends: ["td", "new", "id:", "element", "append:", "src:", "at:", "img", "title:", "longDesc:", ",", "href:", "a", "p"]}),
-smalltalk.Tweet);
-
-
-smalltalk.addMethod(
-smalltalk.method({
-selector: "openAt:with:",
-fn: function (tr,aJson){
-var self=this;
-var tweet;
-return smalltalk.withContext(function($ctx1) { 
-var $1;
-tweet=self._new();
-_st(tweet)._json_(aJson);
-_st(tweet)._renderOn_(tr);
-$1=tr;
-return $1;
-}, function($ctx1) {$ctx1.fill(self,"openAt:with:",{tr:tr,aJson:aJson,tweet:tweet},smalltalk.Tweet.klass)})},
-messageSends: ["new", "json:", "renderOn:"]}),
-smalltalk.Tweet.klass);
-
-
-smalltalk.addClass('TwitterSearch', smalltalk.Object, [], 'TwitterWall');
-smalltalk.addMethod(
-smalltalk.method({
-selector: "query",
-fn: function (){
-var self=this;
-var result,queryString;
-return smalltalk.withContext(function($ctx1) { 
-queryString=_st(_st("#searchQuery"._asJQuery())._val())._replace_with_("#","%23");
-result=_st(jQuery)._ajax_options_("http://search.twitter.com/search.json?rpp=5&q=".__comma(queryString),smalltalk.HashedCollection._from_(["type".__minus_gt("GET"),"success".__minus_gt((function(tmp){
-return smalltalk.withContext(function($ctx2) {
-return self._success_(_st(tmp)._results());
-}, function($ctx2) {$ctx2.fillBlock({tmp:tmp},$ctx1)})})),"error".__minus_gt((function(){
-return smalltalk.withContext(function($ctx2) {
-return _st(window)._alert_("error");
-}, function($ctx2) {$ctx2.fillBlock({},$ctx1)})})),"dataType".__minus_gt("jsonp")]));
-return self}, function($ctx1) {$ctx1.fill(self,"query",{result:result,queryString:queryString},smalltalk.TwitterSearch)})},
-messageSends: ["replace:with:", "val", "asJQuery", "ajax:options:", ",", "->", "success:", "results", "alert:"]}),
-smalltalk.TwitterSearch);
-
-smalltalk.addMethod(
-smalltalk.method({
-selector: "success:",
-fn: function (tweets){
-var self=this;
-var playground,table,tr;
-function $Tweet(){return smalltalk.Tweet||(typeof Tweet=="undefined"?nil:Tweet)}
-return smalltalk.withContext(function($ctx1) { 
-playground="#playground"._asJQuery();
-_st(playground)._empty();
-_st((function(html){
-return smalltalk.withContext(function($ctx2) {
-table=_st(html)._table();
-table;
-_st(_st(table)._element())._id_("twitterwall");
-return _st(tweets)._do_((function(tweet){
-return smalltalk.withContext(function($ctx3) {
-tr=_st(html)._tr();
-tr;
-_st(table)._append_(tr);
-return _st($Tweet())._openAt_with_(tr,tweet);
-}, function($ctx3) {$ctx3.fillBlock({tweet:tweet},$ctx2)})}));
-}, function($ctx2) {$ctx2.fillBlock({html:html},$ctx1)})}))._appendToJQuery_(playground);
-return self}, function($ctx1) {$ctx1.fill(self,"success:",{tweets:tweets,playground:playground,table:table,tr:tr},smalltalk.TwitterSearch)})},
-messageSends: ["asJQuery", "empty", "appendToJQuery:", "table", "id:", "element", "do:", "tr", "append:", "openAt:with:"]}),
-smalltalk.TwitterSearch);
-
-
-

+ 0 - 156
twitterwall/js/TwitterWall.js

@@ -1,156 +0,0 @@
-smalltalk.addPackage('TwitterWall');
-smalltalk.addClass('Tweet', smalltalk.Widget, ['json'], 'TwitterWall');
-smalltalk.addMethod(
-smalltalk.method({
-selector: "json",
-category: 'not yet classified',
-fn: function (){
-var self=this;
-return smalltalk.withContext(function($ctx1) { 
-var $1;
-$1=self["@json"];
-return $1;
-}, function($ctx1) {$ctx1.fill(self,"json",{},smalltalk.Tweet)})},
-args: [],
-source: "json\x0a^json",
-messageSends: [],
-referencedClasses: []
-}),
-smalltalk.Tweet);
-
-smalltalk.addMethod(
-smalltalk.method({
-selector: "json:",
-category: 'not yet classified',
-fn: function (aJson){
-var self=this;
-return smalltalk.withContext(function($ctx1) { 
-self["@json"]=aJson;
-return self}, function($ctx1) {$ctx1.fill(self,"json:",{aJson:aJson},smalltalk.Tweet)})},
-args: ["aJson"],
-source: "json: aJson\x0ajson := aJson",
-messageSends: [],
-referencedClasses: []
-}),
-smalltalk.Tweet);
-
-smalltalk.addMethod(
-smalltalk.method({
-selector: "renderOn:",
-category: 'not yet classified',
-fn: function (tr){
-var self=this;
-var tdUser,tdMessage,img,a,pMessage,pDate;
-function $HTMLCanvas(){return smalltalk.HTMLCanvas||(typeof HTMLCanvas=="undefined"?nil:HTMLCanvas)}
-return smalltalk.withContext(function($ctx1) { 
-tdUser=_st(_st($HTMLCanvas())._new())._td();
-_st(_st(tdUser)._element())._id_("user");
-tdMessage=_st(_st($HTMLCanvas())._new())._td();
-_st(_st(tdMessage)._element())._id_("messageBox");
-_st(tr)._append_(tdUser);
-_st(tr)._append_(tdMessage);
-img=_st(_st(_st($HTMLCanvas())._new())._img())._src_(_st(self["@json"])._at_("profile_image_url"));
-_st(_st(img)._element())._title_(_st(self["@json"])._at_("from_user"));
-_st(_st(img)._element())._longDesc_("http://twitter.com/".__comma(_st(self["@json"])._at_("from_user")));
-a=_st(_st(_st($HTMLCanvas())._new())._a())._href_("http://twitter.com/".__comma(_st(self["@json"])._at_("from_user")));
-_st(a)._append_(img);
-_st(tdUser)._append_(a);
-pMessage=_st(_st($HTMLCanvas())._new())._p();
-_st(_st(pMessage)._element())._id_("message");
-_st(pMessage)._append_(_st(self["@json"])._at_("text"));
-_st(tdMessage)._append_(pMessage);
-pDate=_st(_st($HTMLCanvas())._new())._p();
-_st(_st(pDate)._element())._id_("date");
-_st(pDate)._append_(_st(self["@json"])._at_("created_at"));
-_st(tdMessage)._append_(pDate);
-return self}, function($ctx1) {$ctx1.fill(self,"renderOn:",{tr:tr,tdUser:tdUser,tdMessage:tdMessage,img:img,a:a,pMessage:pMessage,pDate:pDate},smalltalk.Tweet)})},
-args: ["tr"],
-source: "renderOn: tr\x0a\x0a| tdUser tdMessage img a pMessage pDate |\x0atdUser := HTMLCanvas new td.\x0atdUser element id: 'user'.\x0atdMessage := HTMLCanvas new td.\x0atdMessage element id: 'messageBox'.\x0a\x0atr append: tdUser.\x0atr append: tdMessage.\x0a\x0aimg := HTMLCanvas new img src: (json at: 'profile_image_url') .\x0aimg element title: (json at: 'from_user').\x0aimg element longDesc: ('http://twitter.com/', (json at: 'from_user')).\x0a\x0aa := HTMLCanvas new a href: ('http://twitter.com/', (json at: 'from_user')).\x0aa append: img.\x0a\x0atdUser append: a.\x0a\x0apMessage := HTMLCanvas new p.\x0apMessage element id: 'message'.\x0apMessage append: (json at: 'text').\x0atdMessage append: pMessage.\x0a\x0apDate := HTMLCanvas new p.\x0apDate element id: 'date'.\x0apDate append: (json at: 'created_at').\x0atdMessage append: pDate.",
-messageSends: ["td", "new", "id:", "element", "append:", "src:", "at:", "img", "title:", "longDesc:", ",", "href:", "a", "p"],
-referencedClasses: ["HTMLCanvas"]
-}),
-smalltalk.Tweet);
-
-
-smalltalk.addMethod(
-smalltalk.method({
-selector: "openAt:with:",
-category: 'not yet classified',
-fn: function (tr,aJson){
-var self=this;
-var tweet;
-return smalltalk.withContext(function($ctx1) { 
-var $1;
-tweet=self._new();
-_st(tweet)._json_(aJson);
-_st(tweet)._renderOn_(tr);
-$1=tr;
-return $1;
-}, function($ctx1) {$ctx1.fill(self,"openAt:with:",{tr:tr,aJson:aJson,tweet:tweet},smalltalk.Tweet.klass)})},
-args: ["tr", "aJson"],
-source: "openAt: tr with: aJson\x0a| tweet |\x0atweet := self new.\x0atweet json: aJson.\x0atweet renderOn: tr.\x0a^tr",
-messageSends: ["new", "json:", "renderOn:"],
-referencedClasses: []
-}),
-smalltalk.Tweet.klass);
-
-
-smalltalk.addClass('TwitterSearch', smalltalk.Object, [], 'TwitterWall');
-smalltalk.addMethod(
-smalltalk.method({
-selector: "query",
-category: 'not yet classified',
-fn: function (){
-var self=this;
-var result,queryString;
-return smalltalk.withContext(function($ctx1) { 
-queryString=_st(_st("#searchQuery"._asJQuery())._val())._replace_with_("#","%23");
-result=_st(jQuery)._ajax_options_("http://search.twitter.com/search.json?rpp=5&q=".__comma(queryString),smalltalk.HashedCollection._from_(["type".__minus_gt("GET"),"success".__minus_gt((function(tmp){
-return smalltalk.withContext(function($ctx2) {
-return self._success_(_st(tmp)._results());
-}, function($ctx2) {$ctx2.fillBlock({tmp:tmp},$ctx1)})})),"error".__minus_gt((function(){
-return smalltalk.withContext(function($ctx2) {
-return _st(window)._alert_("error");
-}, function($ctx2) {$ctx2.fillBlock({},$ctx1)})})),"dataType".__minus_gt("jsonp")]));
-return self}, function($ctx1) {$ctx1.fill(self,"query",{result:result,queryString:queryString},smalltalk.TwitterSearch)})},
-args: [],
-source: "query\x0a| result queryString |\x0aqueryString := ('#searchQuery'  asJQuery val) replace: '#' with: '%23'.\x0aresult := jQuery \x0a\x09\x09\x09ajax: 'http://search.twitter.com/search.json?rpp=5&q=', queryString\x0a\x09\x09\x09options: #{\x0a\x09\x09\x09\x09'type' -> 'GET'.\x0a\x09\x09\x09\x09'success' -> [ :tmp | self success: (tmp results)].\x0a\x09\x09\x09\x09'error' -> [window alert: 'error'].\x0a\x09\x09\x09\x09'dataType' -> 'jsonp'\x0a\x09\x09\x09}.",
-messageSends: ["replace:with:", "val", "asJQuery", "ajax:options:", ",", "->", "success:", "results", "alert:"],
-referencedClasses: []
-}),
-smalltalk.TwitterSearch);
-
-smalltalk.addMethod(
-smalltalk.method({
-selector: "success:",
-category: 'not yet classified',
-fn: function (tweets){
-var self=this;
-var playground,table,tr;
-function $Tweet(){return smalltalk.Tweet||(typeof Tweet=="undefined"?nil:Tweet)}
-return smalltalk.withContext(function($ctx1) { 
-playground="#playground"._asJQuery();
-_st(playground)._empty();
-_st((function(html){
-return smalltalk.withContext(function($ctx2) {
-table=_st(html)._table();
-table;
-_st(_st(table)._element())._id_("twitterwall");
-return _st(tweets)._do_((function(tweet){
-return smalltalk.withContext(function($ctx3) {
-tr=_st(html)._tr();
-tr;
-_st(table)._append_(tr);
-return _st($Tweet())._openAt_with_(tr,tweet);
-}, function($ctx3) {$ctx3.fillBlock({tweet:tweet},$ctx2)})}));
-}, function($ctx2) {$ctx2.fillBlock({html:html},$ctx1)})}))._appendToJQuery_(playground);
-return self}, function($ctx1) {$ctx1.fill(self,"success:",{tweets:tweets,playground:playground,table:table,tr:tr},smalltalk.TwitterSearch)})},
-args: ["tweets"],
-source: "success: tweets\x0a| playground table tr |\x0aplayground := '#playground' asJQuery.\x0aplayground empty.\x0a [:html | \x0a\x09table := html table.\x0a\x09table element id: 'twitterwall'.\x0a\x0a\x09tweets do: [ :tweet | \x0a        \x09   tr := html tr.\x0a\x09           table append: tr.\x0a        \x09   Tweet openAt: tr with: tweet\x0a        ]\x0a] appendToJQuery: playground.",
-messageSends: ["asJQuery", "empty", "appendToJQuery:", "table", "id:", "element", "do:", "tr", "append:", "openAt:with:"],
-referencedClasses: ["Tweet"]
-}),
-smalltalk.TwitterSearch);
-
-
-

+ 0 - 91
twitterwall/st/TwitterWall.st

@@ -1,91 +0,0 @@
-Smalltalk current createPackage: 'TwitterWall'!
-Widget subclass: #Tweet
-	instanceVariableNames: 'json'
-	package: 'TwitterWall'!
-
-!Tweet methodsFor: 'not yet classified'!
-
-json
-^json
-!
-
-json: aJson
-json := aJson
-!
-
-renderOn: tr
-
-| tdUser tdMessage img a pMessage pDate |
-tdUser := HTMLCanvas new td.
-tdUser element id: 'user'.
-tdMessage := HTMLCanvas new td.
-tdMessage element id: 'messageBox'.
-
-tr append: tdUser.
-tr append: tdMessage.
-
-img := HTMLCanvas new img src: (json at: 'profile_image_url') .
-img element title: (json at: 'from_user').
-img element longDesc: ('http://twitter.com/', (json at: 'from_user')).
-
-a := HTMLCanvas new a href: ('http://twitter.com/', (json at: 'from_user')).
-a append: img.
-
-tdUser append: a.
-
-pMessage := HTMLCanvas new p.
-pMessage element id: 'message'.
-pMessage append: (json at: 'text').
-tdMessage append: pMessage.
-
-pDate := HTMLCanvas new p.
-pDate element id: 'date'.
-pDate append: (json at: 'created_at').
-tdMessage append: pDate.
-! !
-
-!Tweet class methodsFor: 'not yet classified'!
-
-openAt: tr with: aJson
-| tweet |
-tweet := self new.
-tweet json: aJson.
-tweet renderOn: tr.
-^tr
-! !
-
-Object subclass: #TwitterSearch
-	instanceVariableNames: ''
-	package: 'TwitterWall'!
-
-!TwitterSearch methodsFor: 'not yet classified'!
-
-query
-| result queryString |
-queryString := ('#searchQuery'  asJQuery val) replace: '#' with: '%23'.
-result := jQuery 
-			ajax: 'http://search.twitter.com/search.json?rpp=5&q=', queryString
-			options: #{
-				'type' -> 'GET'.
-				'success' -> [ :tmp | self success: (tmp results)].
-				'error' -> [window alert: 'error'].
-				'dataType' -> 'jsonp'
-			}.
-!
-
-success: tweets
-| playground table tr |
-playground := '#playground' asJQuery.
-playground empty.
- [:html | 
-	table := html table.
-	table element id: 'twitterwall'.
-
-	tweets do: [ :tweet | 
-        	   tr := html tr.
-	           table append: tr.
-        	   Tweet openAt: tr with: tweet
-        ]
-] appendToJQuery: playground.
-! !
-

+ 1 - 1
vendor/amber

@@ -1 +1 @@
-Subproject commit 1ba6db617e02edf536d0c2179dbc446597d3cf5d
+Subproject commit 57b06ddff605ffeae9ffdfd9a8c709599604ba65