2 "@1" : "Version 0.5.0 for Meego Harmattan N9/N950",
3 "harmattan-screenshot-stationlist.png" : "The Station List View",
4 "harmattan-screenshot-stationview.png" : "The Station Departures View",
5 "@2" : "Version 0.4.3 for Maemo 5 N900",
6 "screenshot-stationlist.png" : "The Station List View",
7 "screenshot-stationview.png" : "The Station Departures View",
8 "screenshot-stationlist-menu.png" : "The Station List Menu",
9 "screenshot-stationview-menu.png" : "The Station Departures Menu",
12 function dismiss_picture()
14 var parent = this.parentNode;
15 parent.style.opacity = 0.0;
16 parent.style.visibility = 'hidden';
17 parent.display = 'none';
20 function present_picture()
22 var display = document.getElementById('picture-display');
23 parent.display = 'block';
24 display.style.visibility = 'visible';
25 display.style.opacity = 1.0;
26 display.style.left = (window.width - display.width) / 2;
27 display.style.top = (window.height - display.height) / 2;
28 var picture = document.getElementById('picture-display-picture');
29 picture.setAttribute('src', this.getAttribute('src'));
32 function generate_div(value, index, array)
34 var screenshots = document.getElementById('screenshot-list');
35 var screenshotDiv = document.createElement('div');
36 screenshotDiv.setAttribute('class', 'screenshot');
38 var p1Element = document.createElement('div');
39 var p2Element = p1Element.cloneNode(true);
41 var aElement = document.createElement('img');
42 aElement.setAttribute('src', index);
43 if (aElement.addEventListener) {
44 aElement.addEventListener('click', present_picture, true);
45 } else if (aElement.attachEvent) {
46 aElement.attachEvent('onclick', show_picture);
49 var imgElement = document.createElement('img');
50 imgElement.setAttribute('src', index);
52 var captionElement = document.createTextNode(value);
54 p1Element.appendChild(aElement);
55 aElement.appendChild(imgElement);
56 p2Element.appendChild(captionElement);
58 screenshotDiv.appendChild(p1Element);
59 screenshotDiv.appendChild(p2Element);
60 screenshots.appendChild(screenshotDiv);
63 function generate_section(value, index, array)
65 var screenshots = document.getElementById('screenshot-list');
66 var sectionElement = document.createElement('h3');
67 var captionElement = document.createTextNode(value);
69 sectionElement.appendChild(captionElement);
70 screenshots.appendChild(sectionElement);
73 function build_screenshot_list()
75 for (var key in screenshots) {
76 if (key.match(/^@.*/))
77 generate_section(screenshots[key], key, screenshots);
79 generate_div(screenshots[key], key, screenshots);
82 var element = document.getElementById('picture-display-picture');
83 if (element.addEventListener) {
84 element.addEventListener('click', dismiss_picture, false);
85 } else if (element.attachEvent) {
86 window.attachEvent('onclick', dismiss_picture);
90 if (window.addEventListener) {
91 window.addEventListener('load', build_screenshot_list, false);
92 } else if (window.attachEvent) {
93 window.attachEvent('onload', build_screenshot_list);