Sailfish OS screenshots for the web site
[quandoparte] / www / screenshot-generator.js
index 7aec65e..0ded54f 100644 (file)
@@ -1,4 +1,11 @@
 var screenshots = {
+       "@1" : "Version 0.6.0 for Sailfish OS",
+       "sailfish-screenshot-stationlist.png" : "The Station List View",
+       "sailfish-screenshot-stationview.png" : "The Station Departures View",
+       "@1" : "Version 0.5.0 for Meego Harmattan N9/N950",
+       "harmattan-screenshot-stationlist.png" : "The Station List View",
+       "harmattan-screenshot-stationview.png" : "The Station Departures View",
+       "@2" : "Version 0.4.3 for Maemo 5 N900",
        "screenshot-stationlist.png" : "The Station List View",
        "screenshot-stationview.png" : "The Station Departures View",
        "screenshot-stationlist-menu.png" : "The Station List Menu",
@@ -56,10 +63,24 @@ function generate_div(value, index, array)
        screenshots.appendChild(screenshotDiv);
 }
 
+function generate_section(value, index, array)
+{
+       var screenshots = document.getElementById('screenshot-list');
+       var sectionElement = document.createElement('h3');
+       var captionElement = document.createTextNode(value);
+       
+       sectionElement.appendChild(captionElement);
+       screenshots.appendChild(sectionElement);
+}
+
 function build_screenshot_list()
 {
-       for (var key in screenshots)
-               generate_div(screenshots[key], key, screenshots);
+       for (var key in screenshots) {
+               if (key.match(/^@.*/)) 
+                       generate_section(screenshots[key], key, screenshots);
+               else
+                       generate_div(screenshots[key], key, screenshots);
+       }
 
        var element = document.getElementById('picture-display-picture');
        if (element.addEventListener) {
@@ -74,5 +95,3 @@ if (window.addEventListener) {
 } else if (window.attachEvent) {
        window.attachEvent('onload', build_screenshot_list);
 }
-
-