Merge lp:~martijn/udstream/gdata into lp:udstream

Proposed by Martijn vdS
Status: Merged
Merged at revision: not available
Proposed branch: lp:~martijn/udstream/gdata
Merge into: lp:udstream
To merge this branch: bzr merge lp:~martijn/udstream/gdata
Reviewer Review Type Date Requested Status
Martijn vdS Approve
Paul Hummer (community) Needs Fixing
Review via email: mp+2548@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Paul Hummer (rockstar) wrote :
Download full text (5.5 KiB)

Here's the diff for this branch:

=== modified file 'lifestream.html'
--- lifestream.html 2008-12-12 00:16:45 +0000
+++ lifestream.html 2008-12-27 19:16:42 +0000
@@ -14,12 +14,16 @@ td.time, td.source {
   color: #aaa;
   background: white;
 }
-tr.flickr td.data { color: white; background: #0c0; }
-tr.twitter td.data { color: white; background: #933; }
-tr.identica td.data { color: white; background: #339; }
-tr.flickr:hover td { color: white; background: #0d0; }
-tr.twitter:hover td { color: white; background: #a33; }
+tr.flickr td.data { color: white; background: #0c0; }
+tr.twitter td.data { color: white; background: #933; }
+tr.identica td.data { color: white; background: #339; }
+tr.picasa td.data { color: white; background: #8c8; }
+tr.youtube td.data { color: white; background: #c00; }
+tr.flickr:hover td { color: white; background: #0d0; }
+tr.twitter:hover td { color: white; background: #a33; }
 tr.identica:hover td { color: white; background: #33a; }
+tr.picasa:hover td { color: white; background: #8d8; }
+tr.youtube:hover td { color: white; background: #d00; }
 </style>
 <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.2.6/jquery.min.js"></script>
 <script>
@@ -136,13 +140,13 @@ Date.prototype.format = function (mask,
  return dateFormat(this, mask, utc);
 };

-
-
 ls = {
   tag_api: [
     ["http://search.twitter.com/search.json?callback=?&q=%23$TAG", "twittersearch"],
     ["http://api.flickr.com/services/feeds/photos_public.gne?tags=$TAG&lang=en-us&format=json&jsoncallback=?", "flickr"],
- ["http://pipes.yahoo.com/pipes/pipe.run?_id=qGysIErH3RGVW2OJBRNMsA&_render=json&tag=$TAG&_callback=?", "identicasearch"]
+ ["http://pipes.yahoo.com/pipes/pipe.run?_id=qGysIErH3RGVW2OJBRNMsA&_render=json&tag=$TAG&_callback=?", "identicasearch"],
+ ["http://gdata.youtube.com/feeds/videos?alt=json-in-script&vq=$TAG&callback=?", "gdata"],
+ ["http://picasaweb.google.com/data/feed/api/all?alt=json-in-script&q=$TAG&callback=?", "gdata"],
   ],
   init: function(tag, element) {
     if (element && element.nodeName.toLowerCase() == "table") {
@@ -158,7 +162,7 @@ ls = {
       }
     }
   },
- addItem: function(td, time, src, link) {
+ addItem: function(td, time, src, link, thumbnail) {
     // time should be in ISO 2008-12-11T02:30:43-08:00 format
     var tr = document.createElement("tr");
     $(tr).click(function(){ location.href = link; });
@@ -168,6 +172,19 @@ ls = {
     timetd.className = "time";
     tr.appendChild(timetd);
     td.className = "data";
+ if(thumbnail) {
+ td.img = document.createElement('img');
+ td.img.src = thumbnail ;
+
+ $(td).hover(function(){
+ this.img.style.position = "absolute";
+ this.img.style.top = (this.offsetTop + this.offsetHeight) + "px";
+ this.img.style.left = this.offsetLeft + "px";
+ document.body.appendChild(this.img);
+ }, function(){
+ document.body.removeChild(this.img);
+ });
+ }
     tr.appendChild(td);
     var srctd = document.createElement("td");
     srctd.appendChild(document.createTextNode(src));
@@ -184,6 +201,7 @@ ls = {
     });
     if (!found) ls.element.appendChild(tr);
   },
+
   tw...

Read more...

Revision history for this message
Paul Hummer (rockstar) wrote :

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Overall, this branch looks good. There is a slight bug in the
implementation of showing the thumbnail that should probably be fixed
before this lands (detailed below). Other than that, I'm happy to merge
this for you.

 review needs_fixing

Paul

> === modified file 'lifestream.html'
> --- lifestream.html 2008-12-12 00:16:45 +0000
> +++ lifestream.html 2008-12-27 19:16:42 +0000
> @@ -168,6 +172,19 @@ ls = {
> timetd.className = "time";
> tr.appendChild(timetd);
> td.className = "data";
> + if(thumbnail) {
> + td.img = document.createElement('img');
> + td.img.src = thumbnail ;
> +
> + $(td).hover(function(){
> + this.img.style.position = "absolute";
> + this.img.style.top = (this.offsetTop + this.offsetHeight) + "px";
> + this.img.style.left = this.offsetLeft + "px";
> + document.body.appendChild(this.img);
> + }, function(){
> + document.body.removeChild(this.img);
> + });
> + }
> tr.appendChild(td);
> var srctd = document.createElement("td");
> srctd.appendChild(document.createTextNode(src));
>

There's an issue here with the thumbnail popup. If the image pops up
under your mouse, it flickers on and off because of the mouseOut event.
I'm not sure the best way to fix this, but you'll probably need to do
some checking on the mouse position, and see if they overlap, and move
the document.removeChild() to the mouseOut event of image if it's
visible under the mouse. Complicated, I know.

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAklWh2sACgkQHE2KxYYv8I+k6ACgmqkSqylWW45wuGC1kbvoupuC
xTkAn06099c2nOof5Mb2CfoVwPYK2mOa
=VSPM
-----END PGP SIGNATURE-----

review: Needs Fixing
Revision history for this message
Martijn vdS (martijn) wrote :

On Sat, Dec 27, 2008 at 8:54 PM, Paul Hummer <email address hidden>wrote:

> Overall, this branch looks good. There is a slight bug in the
> implementation of showing the thumbnail that should probably be fixed
> before this lands (detailed below). Other than that, I'm happy to merge
> this for you.

This code is identical to the code in trunk (where it's only in the Flickr
plugin). I just moved it to a different location.

Martijn

Revision history for this message
Martijn vdS (martijn) wrote :

I've been playing around a bit, but it seems like a mouseout event is always generated before a mouseover, so adding a hover() handler to the image that temporarily disables the td hover handling doesn't fix the flickering.

I have no further ideas on how to fix this.

Martijn

lp:~martijn/udstream/gdata updated
7. By Martijn van de Streek <martijn@martijn-desktop>

Fix image flicker problem on hover

Revision history for this message
Martijn vdS (martijn) wrote :

I've moved the image to the right, and the flickering seems to have stopped.

Revision history for this message
Martijn vdS (martijn) :
review: Needs Resubmitting
Revision history for this message
Martijn vdS (martijn) :
review: Abstain
Revision history for this message
Martijn vdS (martijn) :
review: Approve

Subscribers

People subscribed via source and target branches