Adopted QtCreator suggestion about using ===
[quandoparte] / www / screenshot-generator.js
index e647660..53b4add 100644 (file)
@@ -1,6 +1,8 @@
 var screenshots = {
        "screenshot-stationlist.png" : "The Station List View",
        "screenshot-stationview.png" : "The Station Departures View",
+       "screenshot-stationlist-menu.png" : "The Station List Menu",
+       "screenshot-stationview-menu.png" : "The Station Departures Menu",
 };
 
 function generate_div(value, index, array)
@@ -12,12 +14,16 @@ function generate_div(value, index, array)
        var p1Element = document.createElement('div');
        var p2Element = p1Element.cloneNode(true);
        
+       var aElement = document.createElement('a');
+       aElement.setAttribute('href', index);
+
        var imgElement = document.createElement('img');
        imgElement.setAttribute('src', index);
 
        var captionElement = document.createTextNode(value);
 
-       p1Element.appendChild(imgElement);
+       p1Element.appendChild(aElement);
+       aElement.appendChild(imgElement);
        p2Element.appendChild(captionElement);
 
        screenshotDiv.appendChild(p1Element);
@@ -31,4 +37,8 @@ function build_screenshot_list()
                generate_div(screenshots[key], key, screenshots);
 }
 
-window.addEventListener('load', build_screenshot_list);
+if (window.addEventListener) {
+       window.addEventListener('load', build_screenshot_list, false);
+} else if (window.attachEvent) {
+       window.attachEvent('onload', build_screenshot_list);
+}