[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[linterna-magica-commit] [87] Fixes the support for The Onion in branch
From: |
Ivaylo Valkov |
Subject: |
[linterna-magica-commit] [87] Fixes the support for The Onion in branch 0.0.9. |
Date: |
Mon, 13 Jun 2011 18:09:04 +0000 |
Revision: 87
http://svn.sv.gnu.org/viewvc/?view=rev&root=linterna-magica&revision=87
Author: valkov
Date: 2011-06-13 18:09:03 +0000 (Mon, 13 Jun 2011)
Log Message:
-----------
Fixes the support for The Onion in branch 0.0.9. Removes the capability to
switch videos. Too bugy. Sree support #107708.
Ticket Links:
------------
http://savannah.gnu.org/support/?107708
Modified Paths:
--------------
branches/0.0.9/src/lm_site_theonion.js
branches/0.0.9/src/lm_xhr.js
Modified: branches/0.0.9/src/lm_site_theonion.js
===================================================================
--- branches/0.0.9/src/lm_site_theonion.js 2011-06-12 13:31:36 UTC (rev 86)
+++ branches/0.0.9/src/lm_site_theonion.js 2011-06-13 18:09:03 UTC (rev 87)
@@ -71,73 +71,16 @@
if (flash_object)
{
- // object_data.linterna_magica_id =
- // this.mark_flash_object(flash_object);
+ this.dirty_objects.push(flash_object);
}
else
{
- object_data.linterna_magica_id =
- this.mark_flash_object("extracted-from-script");
+ // Ugly && dirty hack.
+ // This way we have linterna_magica_id
+ this.dirty_objects.push(null);
}
+ object_data.linterna_magica_id = this.dirty_objects.length-1;
+
return object_data;
}
-
-// Add custom click event listeners to the buttons that change the
-// clips. This is active only on the front page.
-LinternaMagica.prototype.capture_theonion_clip_change = function(object_data)
-{
- var list = document.getElementById("onn_recent");
-
- if (!list || !/HTMLUListElement/i.test(list))
- {
- return null;
- }
-
- var self = this;
- var click_function = function(ev)
- {
- var el = this;
- var od = object_data;
-
- self.theonion_clip_change_click_function.apply(self,[ev,el,od]);
- };
-
- var buttons = list.getElementsByTagName("li");
-
- for (var i=0,l=buttons.length; i<l; i++)
- {
- var li = buttons[i];
- li.addEventListener("click", click_function, true);
- }
-}
-
-// Event listener for click on <li> elements, that change the iframe
-// src.
-LinternaMagica.prototype.theonion_clip_change_click_function =
-function(event,element,object_data)
-{
- var p = element.getElementsByTagName("p");
-
- for (var i=0, l=p.length; i<l; i++)
- {
- if (p[i].hasAttribute("rel") &&
- p[i].hasAttribute("class") &&
- /title/i.test(p[i].getAttribute("class")))
- {
- object_data.video_id = p[i].getAttribute("rel");
- this.request_video_link(object_data);
-
- var lm = this.get_video_object(object_data.linterna_magica_id);
- // The whole LM wrapper
- lm = lm.parentNode;
-
- // Remove the object, because the XHR will call
- // create_video_object and will make new one.
- object_data.parent.removeChild(lm);
-
- break;
- }
- }
-}
-
Modified: branches/0.0.9/src/lm_xhr.js
===================================================================
--- branches/0.0.9/src/lm_xhr.js 2011-06-12 13:31:36 UTC (rev 86)
+++ branches/0.0.9/src/lm_xhr.js 2011-06-13 18:09:03 UTC (rev 87)
@@ -446,7 +446,6 @@
{
var onion_data = eval("("+client.responseText+")");
url = onion_data.video_url;
- this.capture_theonion_clip_change(object_data);
}
if (!url)
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [linterna-magica-commit] [87] Fixes the support for The Onion in branch 0.0.9.,
Ivaylo Valkov <=