properly support embedded videos with "original" size selected
authorGuillaume Cottenceau <gcottenc@gmail.com>
Tue, 16 Mar 2010 14:19:35 +0000 (15:19 +0100)
committerGuillaume Cottenceau <gcottenc@gmail.com>
Tue, 16 Mar 2010 14:19:35 +0000 (15:19 +0100)
bin/booh-backend [changed mode: 0644->0755]
data/booh/themes/cardu/root/booh.js
data/booh/themes/dark/root/booh.js
data/booh/themes/sbs/root/booh.js
data/booh/themes/simple/root/booh.js

old mode 100644 (file)
new mode 100755 (executable)
index 40bed8f..9ba4a42
@@ -1395,7 +1395,7 @@ def walk_source_dir
                                 if type == 'image'
                                     index = images.index(file)
                                     oe4js << '"' + fullscreen_images[sizeobj2['name']][index] + '"'
-                                else
+                                elsif sizeobj2['name'] != 'original'
                                     index = videos.index(file)
                                     oe4js << '"' + fullscreen_videos[sizeobj2['name']][index] + '"'
                                 end
index 241bb5c..3ddff42 100644 (file)
@@ -233,7 +233,13 @@ function show_current_text() {
         document.getElementById('main_text').innerHTML = captions[current];
         for (i = 0; i < other_sizes.length; i++) { 
             if (other_sizes[i] == "original") {
-                document.getElementById('link' + other_sizes[i]).href = eval("elements_" + other_sizes[i] + "[current]");
+                var original = eval("elements_" + other_sizes[i] + "[current]");
+                if (original != undefined) {
+                    document.getElementById('link' + other_sizes[i]).href = original;
+                    document.getElementById('link' + other_sizes[i]).style.display = '';
+                } else {
+                    document.getElementById('link' + other_sizes[i]).style.display = 'none';
+                }
             } else {
                 document.getElementById('link' + other_sizes[i]).href = 'image-' + other_sizes[i] + dbltilda_htmlsuffix + '#current=' + eval("elements_" + other_sizes[i] + "[current]");
             }
index c50f3d9..6fa9172 100644 (file)
@@ -224,7 +224,13 @@ function show_current_text() {
         document.getElementById('main_text').innerHTML = captions[current];
         for (i = 0; i < other_sizes.length; i++) { 
             if (other_sizes[i] == "original") {
-                document.getElementById('link' + other_sizes[i]).href = eval("elements_" + other_sizes[i] + "[current]");
+                var original = eval("elements_" + other_sizes[i] + "[current]");
+                if (original != undefined) {
+                    document.getElementById('link' + other_sizes[i]).href = original;
+                    document.getElementById('link' + other_sizes[i]).style.display = '';
+                } else {
+                    document.getElementById('link' + other_sizes[i]).style.display = 'none';
+                }
             } else {
                 document.getElementById('link' + other_sizes[i]).href = 'image-' + other_sizes[i] + dbltilda_htmlsuffix + '#current=' + eval("elements_" + other_sizes[i] + "[current]");
             }
index 66b0f90..7b8eb73 100644 (file)
@@ -224,7 +224,13 @@ function show_current_text() {
         document.getElementById('main_text').innerHTML = captions[current];
         for (i = 0; i < other_sizes.length; i++) { 
             if (other_sizes[i] == "original") {
-                document.getElementById('link' + other_sizes[i]).href = eval("elements_" + other_sizes[i] + "[current]");
+                var original = eval("elements_" + other_sizes[i] + "[current]");
+                if (original != undefined) {
+                    document.getElementById('link' + other_sizes[i]).href = original;
+                    document.getElementById('link' + other_sizes[i]).style.display = '';
+                } else {
+                    document.getElementById('link' + other_sizes[i]).style.display = 'none';
+                }
             } else {
                 document.getElementById('link' + other_sizes[i]).href = 'image-' + other_sizes[i] + dbltilda_htmlsuffix + '#current=' + eval("elements_" + other_sizes[i] + "[current]");
             }
index c50f3d9..6fa9172 100644 (file)
@@ -224,7 +224,13 @@ function show_current_text() {
         document.getElementById('main_text').innerHTML = captions[current];
         for (i = 0; i < other_sizes.length; i++) { 
             if (other_sizes[i] == "original") {
-                document.getElementById('link' + other_sizes[i]).href = eval("elements_" + other_sizes[i] + "[current]");
+                var original = eval("elements_" + other_sizes[i] + "[current]");
+                if (original != undefined) {
+                    document.getElementById('link' + other_sizes[i]).href = original;
+                    document.getElementById('link' + other_sizes[i]).style.display = '';
+                } else {
+                    document.getElementById('link' + other_sizes[i]).style.display = 'none';
+                }
             } else {
                 document.getElementById('link' + other_sizes[i]).href = 'image-' + other_sizes[i] + dbltilda_htmlsuffix + '#current=' + eval("elements_" + other_sizes[i] + "[current]");
             }