From b031f59a6c6c51edc962667885b160bafc9460d0 Mon Sep 17 00:00:00 2001
From: ands <ands@andspad.(none)>
Date: Sun, 5 Dec 2010 22:20:06 +0100
Subject: [PATCH] tweetwall weitergebaut

---
 webroot/config.php                          | 10 ++++----
 webroot/widgets/TwitterWall/TwitterWall.js  | 28 ---------------------
 webroot/widgets/TwitterWall/TwitterWall.php | 14 ++++++++++-
 3 files changed, 18 insertions(+), 34 deletions(-)
 delete mode 100644 webroot/widgets/TwitterWall/TwitterWall.js

diff --git a/webroot/config.php b/webroot/config.php
index 1743ab0..a567787 100644
--- a/webroot/config.php
+++ b/webroot/config.php
@@ -1,9 +1,9 @@
 <?php
-	$widget_unit_width = 200;
-	$widget_unit_height = 200;
+	$widget_unit_width = 185;
+	$widget_unit_height = 170;
 
-	$widget_spacing_x = 40;
-	$widget_spacing_y = 40;
+	$widget_spacing_x = 10;
+	$widget_spacing_y = 10;
 
 	$widgets = array(
 		//array("widget_name", "style_name", position_x, position_y, size_x, size_y);
@@ -11,7 +11,7 @@
 		array("ZoneOffen",	"widget_dark",		4,0,	2,1),
 		array("Dummy",		"widget_light",		0,1,	4,2),
 		array("Marvin",		"widget_light",		4,1,	2,1),
-		array("Dummy",		"widget_light",		4,2,	2,4),
+		array("TwitterWall","widget_light",		4,2,	2,4),
 		array("Dummy",		"widget_light",		0,3,	1,2),
 		array("Dummy",		"widget_dark",		1,3,	2,2),
 		array("Dummy",		"widget_light",		3,3,	1,2),
diff --git a/webroot/widgets/TwitterWall/TwitterWall.js b/webroot/widgets/TwitterWall/TwitterWall.js
deleted file mode 100644
index 422bec4..0000000
--- a/webroot/widgets/TwitterWall/TwitterWall.js
+++ /dev/null
@@ -1,28 +0,0 @@
-function fillContent(response) {
-  var content = "";
-  if (response["tuerOffen"] == false){
-    content = "<p><font color='cc0000'>Geschlossen</font></p>";
-  } else {
-    content = "<p><font color='00cc00'>Offen</font></p>";
-  }  
-  content += "<p>" + response["tempLounge"] + "&deg;C</p>";
-  content += "<p>" + response["tempWerkstatt"] + "&deg;C</p>";
-  $("#ZoneOffen_values").html(content);
-}
-
-function updateZoneOffen () {
-  $.getJSON("widgets/ZoneOffen/ajax.php", function (response) 
-    {
-      fillContent(response);
-    });
-}
-
-
-$(document).ready(function()
-  {
-    addFunctionToMinuteTimer(updateZoneOffen);
-    updateZoneOffen();
-  }
-);
-
-
diff --git a/webroot/widgets/TwitterWall/TwitterWall.php b/webroot/widgets/TwitterWall/TwitterWall.php
index 26b6b07..2c93bbe 100644
--- a/webroot/widgets/TwitterWall/TwitterWall.php
+++ b/webroot/widgets/TwitterWall/TwitterWall.php
@@ -12,7 +12,19 @@ class TwitterWall implements iWidget
 
   public function giveOutput() 
   {
-    $widgetOutput = '<script src="widgets/TwitterWall/TwitterWall.js" type="text/javascript"></script>'."\n";
+    $widgetOutput = '
+      <script src="widgets/TwitterWall/jquery.tweet.js" type="text/javascript"></script>
+      <script type="text/javascript">
+        $(document).ready(function(){
+          $(".tweet").tweet({
+            username: "warpzone_ms",
+            avatar_size: 64,
+            count: 5,
+            loading_text: "loading tweets..."
+          });
+        });
+      </script>'."\n";
+    $widgetOutput .= '<div class="tweet"></div>'."\n";
    
     return $widgetOutput;
   }
-- 
GitLab