aboutsummaryrefslogtreecommitdiffhomepage
path: root/tpl
diff options
context:
space:
mode:
Diffstat (limited to 'tpl')
-rw-r--r--tpl/default/configure.html32
-rw-r--r--tpl/default/css/shaarli.css31
-rw-r--r--tpl/default/daily.html2
-rw-r--r--tpl/default/fonts/Fira-Sans-regular.woffbin17100 -> 0 bytes
-rw-r--r--tpl/default/fonts/Fira-Sans-regular.woff2bin13836 -> 0 bytes
-rw-r--r--tpl/default/fonts/Roboto-Bold.woffbin0 -> 89584 bytes
-rw-r--r--tpl/default/fonts/Roboto-Bold.woff2bin0 -> 63320 bytes
-rw-r--r--tpl/default/fonts/Roboto-Regular.woffbin0 -> 89732 bytes
-rw-r--r--tpl/default/fonts/Roboto-Regular.woff2bin0 -> 63412 bytes
-rw-r--r--tpl/default/import.html1
-rw-r--r--tpl/default/install.html60
-rw-r--r--tpl/default/js/shaarli.js58
-rw-r--r--tpl/vintage/configure.html28
-rw-r--r--tpl/vintage/css/shaarli.css4
-rw-r--r--tpl/vintage/import.html2
-rw-r--r--tpl/vintage/install.html28
-rw-r--r--tpl/vintage/js/shaarli.js32
-rw-r--r--tpl/vintage/page.footer.html1
18 files changed, 223 insertions, 56 deletions
diff --git a/tpl/default/configure.html b/tpl/default/configure.html
index d6536d47..7469ab59 100644
--- a/tpl/default/configure.html
+++ b/tpl/default/configure.html
@@ -73,15 +73,35 @@
73 <div class="pure-u-lg-{$ratioLabel} pure-u-1 "> 73 <div class="pure-u-lg-{$ratioLabel} pure-u-1 ">
74 <div class="form-label"> 74 <div class="form-label">
75 <label> 75 <label>
76 <span class="label-name">{'Timezone'|t}</span> 76 <span class="label-name">{'Timezone'|t}</span><br>
77 <span class="label-desc">{'Continent'|t} &middot; {'City'|t}</span>
77 </label> 78 </label>
78 </div> 79 </div>
79 </div> 80 </div>
80 <div class="pure-u-lg-{$ratioInput} pure-u-1 "> 81 <div class="pure-u-lg-{$ratioInput} pure-u-1 ">
81 <div class="form-input"> 82 <div class="form-input">
82 {ignore}FIXME! too hackish, needs to be fixed upstream{/ignore} 83 <div class="timezone">
83 <div class="timezone" id="timezone-remove">{$timezone_form}</div> 84 <select id="continent" name="continent">
84 <div class="timezone" id="timezone-add"></div> 85 {loop="$continents"}
86 {if="$key !== 'selected'"}
87 <option value="{$value}" {if="$continents.selected === $value"}selected{/if}>
88 {$value}
89 </option>
90 {/if}
91 {/loop}
92 </select>
93 <select id="city" name="city">
94 {loop="$cities"}
95 {if="$key !== 'selected'"}
96 <option value="{$value.city}"
97 {if="$cities.selected === $value.city"}selected{/if}
98 data-continent="{$value.continent}">
99 {$value.city}
100 </option>
101 {/if}
102 {/loop}
103 </select>
104 </div>
85 </div> 105 </div>
86 </div> 106 </div>
87 </div> 107 </div>
@@ -186,7 +206,7 @@
186 <div class="pure-g"> 206 <div class="pure-g">
187 <div class="pure-u-lg-{$ratioLabel} pure-u-{$ratioLabelMobile}"> 207 <div class="pure-u-lg-{$ratioLabel} pure-u-{$ratioLabelMobile}">
188 <div class="form-label"> 208 <div class="form-label">
189 <label for="apiEnabled"> 209 <label for="enableApi">
190 <span class="label-name">{'Enable REST API'|t}</span><br> 210 <span class="label-name">{'Enable REST API'|t}</span><br>
191 <span class="label-desc">{'Allow third party software to use Shaarli such as mobile application'|t}</span> 211 <span class="label-desc">{'Allow third party software to use Shaarli such as mobile application'|t}</span>
192 </label> 212 </label>
@@ -194,7 +214,7 @@
194 </div> 214 </div>
195 <div class="pure-u-lg-{$ratioInput} pure-u-{$ratioInputMobile}"> 215 <div class="pure-u-lg-{$ratioInput} pure-u-{$ratioInputMobile}">
196 <div class="form-input"> 216 <div class="form-input">
197 <input type="checkbox" name="apiEnabled" id="apiEnabled" 217 <input type="checkbox" name="enableApi" id="enableApi"
198 {if="$api_enabled"}checked{/if}/> 218 {if="$api_enabled"}checked{/if}/>
199 </div> 219 </div>
200 </div> 220 </div>
diff --git a/tpl/default/css/shaarli.css b/tpl/default/css/shaarli.css
index 8fcd13af..73fade5f 100644
--- a/tpl/default/css/shaarli.css
+++ b/tpl/default/css/shaarli.css
@@ -35,14 +35,29 @@ pre {
35} 35}
36 36
37@font-face { 37@font-face {
38 font-family: 'Roboto Slab'; 38 font-family: 'Roboto';
39 font-weight: 400; 39 font-weight: 400;
40 font-style: normal; 40 font-style: normal;
41 src: 41 src:
42 local('Fira Sans'), 42 local('Roboto'),
43 local('Fira-Sans-regular'), 43 local('Roboto-Regular'),
44 url('../fonts/Fira-Sans-regular.woff2') format('woff2'), 44 url('../fonts/Roboto-Regular.woff2') format('woff2'),
45 url('../fonts/Fira-Sans-regular.woff') format('woff'); 45 url('../fonts/Roboto-Regular.woff') format('woff');
46}
47
48@font-face {
49 font-family: 'Roboto';
50 font-weight: 700;
51 font-style: normal;
52 src:
53 local('Roboto'),
54 local('Roboto-Bold'),
55 url('../fonts/Roboto-Bold.woff2') format('woff2'),
56 url('../fonts/Roboto-Bold.woff') format('woff');
57}
58
59body, .pure-g [class*="pure-u"] {
60 font-family: Roboto, Arial, sans-serif;
46} 61}
47 62
48/** 63/**
@@ -68,10 +83,6 @@ pre {
68 .pure-u-xl-visible { display: inline-block !important; } 83 .pure-u-xl-visible { display: inline-block !important; }
69} 84}
70 85
71.pure-g [class*="pure-u"]{
72 font-family: Roboto Slab, Arial, sans-serif;
73}
74
75/** 86/**
76 * Make pure-extras alert closable. 87 * Make pure-extras alert closable.
77 */ 88 */
@@ -504,7 +515,6 @@ pre {
504 color: #252525; 515 color: #252525;
505 text-decoration: none; 516 text-decoration: none;
506 vertical-align: middle; 517 vertical-align: middle;
507 font-family: Roboto Slab, Arial, sans-serif;
508} 518}
509 519
510.linklist-item-title .linklist-link { 520.linklist-item-title .linklist-link {
@@ -560,7 +570,6 @@ pre {
560.linklist-item-description { 570.linklist-item-description {
561 position: relative; 571 position: relative;
562 padding: 10px; 572 padding: 10px;
563 font-family: Roboto Slab, Arial, sans-serif;
564 word-wrap: break-word; 573 word-wrap: break-word;
565 color: #252525; 574 color: #252525;
566 line-height: 1.3em; 575 line-height: 1.3em;
diff --git a/tpl/default/daily.html b/tpl/default/daily.html
index d8c91078..29d845d5 100644
--- a/tpl/default/daily.html
+++ b/tpl/default/daily.html
@@ -44,7 +44,7 @@
44 </div> 44 </div>
45 </div> 45 </div>
46 <div> 46 <div>
47 <h3 class="window-subtitle">{function="strftime('%A %d, %B %Y', $day)"}</h3> 47 <h3 class="window-subtitle">{function="format_date($dayDate, false)"}</h3>
48 48
49 <div id="plugin_zone_about_daily" class="plugin_zone"> 49 <div id="plugin_zone_about_daily" class="plugin_zone">
50 {loop="$daily_about_plugin"} 50 {loop="$daily_about_plugin"}
diff --git a/tpl/default/fonts/Fira-Sans-regular.woff b/tpl/default/fonts/Fira-Sans-regular.woff
deleted file mode 100644
index 014ac317..00000000
--- a/tpl/default/fonts/Fira-Sans-regular.woff
+++ /dev/null
Binary files differ
diff --git a/tpl/default/fonts/Fira-Sans-regular.woff2 b/tpl/default/fonts/Fira-Sans-regular.woff2
deleted file mode 100644
index bf3ad9a4..00000000
--- a/tpl/default/fonts/Fira-Sans-regular.woff2
+++ /dev/null
Binary files differ
diff --git a/tpl/default/fonts/Roboto-Bold.woff b/tpl/default/fonts/Roboto-Bold.woff
new file mode 100644
index 00000000..3d86753b
--- /dev/null
+++ b/tpl/default/fonts/Roboto-Bold.woff
Binary files differ
diff --git a/tpl/default/fonts/Roboto-Bold.woff2 b/tpl/default/fonts/Roboto-Bold.woff2
new file mode 100644
index 00000000..bd05e2ea
--- /dev/null
+++ b/tpl/default/fonts/Roboto-Bold.woff2
Binary files differ
diff --git a/tpl/default/fonts/Roboto-Regular.woff b/tpl/default/fonts/Roboto-Regular.woff
new file mode 100644
index 00000000..464d2062
--- /dev/null
+++ b/tpl/default/fonts/Roboto-Regular.woff
Binary files differ
diff --git a/tpl/default/fonts/Roboto-Regular.woff2 b/tpl/default/fonts/Roboto-Regular.woff2
new file mode 100644
index 00000000..f9661967
--- /dev/null
+++ b/tpl/default/fonts/Roboto-Regular.woff2
Binary files differ
diff --git a/tpl/default/import.html b/tpl/default/import.html
index e6e521e8..1f040685 100644
--- a/tpl/default/import.html
+++ b/tpl/default/import.html
@@ -18,6 +18,7 @@
18 <div class="center" id="import-field"> 18 <div class="center" id="import-field">
19 <input type="hidden" name="MAX_FILE_SIZE" value="{$maxfilesize}"> 19 <input type="hidden" name="MAX_FILE_SIZE" value="{$maxfilesize}">
20 <input type="file" name="filetoupload"> 20 <input type="file" name="filetoupload">
21 <p><br>Maximum size allowed: <strong>{$maxfilesizeHuman}</strong></p>
21 </div> 22 </div>
22 23
23 <div class="pure-g"> 24 <div class="pure-g">
diff --git a/tpl/default/install.html b/tpl/default/install.html
index 33f8a453..164d453b 100644
--- a/tpl/default/install.html
+++ b/tpl/default/install.html
@@ -7,6 +7,8 @@
7 7
8{$ratioLabel='1-4'} 8{$ratioLabel='1-4'}
9{$ratioInput='3-4'} 9{$ratioInput='3-4'}
10{$ratioLabelMobile='7-8'}
11{$ratioInputMobile='1-8'}
10 12
11<form method="POST" action="#" name="installform" id="installform"> 13<form method="POST" action="#" name="installform" id="installform">
12<div class="pure-g"> 14<div class="pure-g">
@@ -43,24 +45,22 @@
43 </div> 45 </div>
44 <div class="pure-u-lg-{$ratioInput} pure-u-1"> 46 <div class="pure-u-lg-{$ratioInput} pure-u-1">
45 <div class="form-input"> 47 <div class="form-input">
46 <input type="text" name="setpassword" id="password"> 48 <input type="password" name="setpassword" id="password">
47 </div> 49 </div>
48 </div> 50 </div>
49 </div> 51 </div>
50 52
51 <div class="pure-g"> 53 <div class="pure-g">
52 <div class="pure-u-lg-{$ratioLabel} pure-u-1 "> 54 <div class="pure-u-lg-{$ratioLabel} pure-u-1">
53 <div class="form-label"> 55 <div class="form-label">
54 <label> 56 <label for="title">
55 <span class="label-name">{'Timezone'|t}</span> 57 <span class="label-name">{'Shaarli title'|t}</span>
56 </label> 58 </label>
57 </div> 59 </div>
58 </div> 60 </div>
59 <div class="pure-u-lg-{$ratioInput} pure-u-1 "> 61 <div class="pure-u-lg-{$ratioInput} pure-u-1">
60 <div class="form-input"> 62 <div class="form-input">
61 {ignore}FIXME! too hackish, needs to be fixed upstream{/ignore} 63 <input type="text" name="title" id="title" placeholder="{'My links'|t}">
62 <div class="timezone" id="timezone-remove">{$timezone_html}</div>
63 <div class="timezone" id="timezone-add"></div>
64 </div> 64 </div>
65 </div> 65 </div>
66 </div> 66 </div>
@@ -68,14 +68,36 @@
68 <div class="pure-g"> 68 <div class="pure-g">
69 <div class="pure-u-lg-{$ratioLabel} pure-u-1"> 69 <div class="pure-u-lg-{$ratioLabel} pure-u-1">
70 <div class="form-label"> 70 <div class="form-label">
71 <label for="title"> 71 <label>
72 <span class="label-name">{'Shaarli title'|t}</span> 72 <span class="label-name">{'Timezone'|t}</span><br>
73 <span class="label-desc">{'Continent'|t} &middot; {'City'|t}</span>
73 </label> 74 </label>
74 </div> 75 </div>
75 </div> 76 </div>
76 <div class="pure-u-lg-{$ratioInput} pure-u-1"> 77 <div class="pure-u-lg-{$ratioInput} pure-u-1">
77 <div class="form-input"> 78 <div class="form-input">
78 <input type="text" name="title" id="title" placeholder="{'My links'|t}"> 79 <div class="timezone">
80 <select id="continent" name="continent">
81 {loop="$continents"}
82 {if="$key !== 'selected'"}
83 <option value="{$value}" {if="$continents.selected === $value"}selected{/if}>
84 {$value}
85 </option>
86 {/if}
87 {/loop}
88 </select>
89 <select id="city" name="city">
90 {loop="$cities"}
91 {if="$key !== 'selected'"}
92 <option value="{$value.city}"
93 {if="$cities.selected === $value.city"}selected{/if}
94 data-continent="{$value.continent}">
95 {$value.city}
96 </option>
97 {/if}
98 {/loop}
99 </select>
100 </div>
79 </div> 101 </div>
80 </div> 102 </div>
81 </div> 103 </div>
@@ -98,6 +120,22 @@
98 </div> 120 </div>
99 </div> 121 </div>
100 122
123 <div class="pure-g">
124 <div class="pure-u-lg-{$ratioLabel} pure-u-{$ratioLabelMobile}">
125 <div class="form-label">
126 <label for="enableApi">
127 <span class="label-name">{'Enable REST API'|t}</span><br>
128 <span class="label-desc">{'Allow third party software to use Shaarli such as mobile application'|t}</span>
129 </label>
130 </div>
131 </div>
132 <div class="pure-u-lg-{$ratioInput} pure-u-{$ratioInputMobile}">
133 <div class="form-input">
134 <input type="checkbox" name="enableApi" id="enableApi" checked />
135 </div>
136 </div>
137 </div>
138
101 <div class="center"> 139 <div class="center">
102 <input type="submit" value="{'Install'|t}" name="Save"> 140 <input type="submit" value="{'Install'|t}" name="Save">
103 </div> 141 </div>
diff --git a/tpl/default/js/shaarli.js b/tpl/default/js/shaarli.js
index 30d8ed6f..4d47fcd0 100644
--- a/tpl/default/js/shaarli.js
+++ b/tpl/default/js/shaarli.js
@@ -76,9 +76,12 @@ window.onload = function () {
76 } 76 }
77 } 77 }
78 78
79 document.getElementById('menu-toggle').addEventListener('click', function (e) { 79 var menuToggle = document.getElementById('menu-toggle');
80 toggleMenu(); 80 if (menuToggle != null) {
81 }); 81 menuToggle.addEventListener('click', function (e) {
82 toggleMenu();
83 });
84 }
82 85
83 window.addEventListener(WINDOW_CHANGE_EVENT, closeMenu); 86 window.addEventListener(WINDOW_CHANGE_EVENT, closeMenu);
84 })(this, this.document); 87 })(this, this.document);
@@ -255,10 +258,9 @@ window.onload = function () {
255 * Remove CSS target padding (for fixed bar) 258 * Remove CSS target padding (for fixed bar)
256 */ 259 */
257 if (location.hash != '') { 260 if (location.hash != '') {
258 var anchor = document.querySelector(location.hash); 261 var anchor = document.getElementById(location.hash.substr(1));
259 if (anchor != null) { 262 if (anchor != null) {
260 var padsize = anchor.clientHeight; 263 var padsize = anchor.clientHeight;
261 console.log(document.querySelector(location.hash).clientHeight);
262 this.window.scroll(0, this.window.scrollY - padsize); 264 this.window.scroll(0, this.window.scrollY - padsize);
263 anchor.style.paddingTop = 0; 265 anchor.style.paddingTop = 0;
264 } 266 }
@@ -300,21 +302,6 @@ window.onload = function () {
300 } 302 }
301 303
302 /** 304 /**
303 * TimeZome select
304 * FIXME! way too hackish
305 */
306 var toRemove = document.getElementById('timezone-remove');
307 if (toRemove != null) {
308 var firstSelect = toRemove.getElementsByTagName('select')[0];
309 var secondSelect = toRemove.getElementsByTagName('select')[1];
310 toRemove.parentNode.removeChild(toRemove);
311 var toAdd = document.getElementById('timezone-add');
312 var newTimezone = '<span class="timezone-continent">Continent ' + firstSelect.outerHTML + '</span>';
313 newTimezone += ' <span class="timezone-country">Country ' + secondSelect.outerHTML + '</span>';
314 toAdd.innerHTML = newTimezone;
315 }
316
317 /**
318 * Awesomplete trigger. 305 * Awesomplete trigger.
319 */ 306 */
320 var tags = document.getElementById('lf_tags'); 307 var tags = document.getElementById('lf_tags');
@@ -366,6 +353,15 @@ window.onload = function () {
366 } 353 }
367 }); 354 });
368 }); 355 });
356
357 var continent = document.getElementById('continent');
358 var city = document.getElementById('city');
359 if (continent != null && city != null) {
360 continent.addEventListener('change', function(event) {
361 hideTimezoneCities(city, continent.options[continent.selectedIndex].value, true);
362 });
363 hideTimezoneCities(city, continent.options[continent.selectedIndex].value, false);
364 }
369}; 365};
370 366
371function activateFirefoxSocial(node) { 367function activateFirefoxSocial(node) {
@@ -391,3 +387,25 @@ function activateFirefoxSocial(node) {
391 var activate = new CustomEvent("ActivateSocialFeature"); 387 var activate = new CustomEvent("ActivateSocialFeature");
392 node.dispatchEvent(activate); 388 node.dispatchEvent(activate);
393} 389}
390
391/**
392 * Add the class 'hidden' to city options not attached to the current selected continent.
393 *
394 * @param cities List of <option> elements
395 * @param currentContinent Current selected continent
396 * @param reset Set to true to reset the selected value
397 */
398function hideTimezoneCities(cities, currentContinent, reset = false) {
399 var first = true;
400 [].forEach.call(cities, function(option) {
401 if (option.getAttribute('data-continent') != currentContinent) {
402 option.className = 'hidden';
403 } else {
404 option.className = '';
405 if (reset === true && first === true) {
406 option.setAttribute('selected', 'selected');
407 first = false;
408 }
409 }
410 });
411}
diff --git a/tpl/vintage/configure.html b/tpl/vintage/configure.html
index 5820e6e4..7adc7545 100644
--- a/tpl/vintage/configure.html
+++ b/tpl/vintage/configure.html
@@ -4,7 +4,6 @@
4<body onload="document.configform.title.focus();"> 4<body onload="document.configform.title.focus();">
5<div id="pageheader"> 5<div id="pageheader">
6 {include="page.header"} 6 {include="page.header"}
7 {$timezone_js}
8 <form method="POST" action="#" name="configform" id="configform"> 7 <form method="POST" action="#" name="configform" id="configform">
9 <input type="hidden" name="token" value="{$token}"> 8 <input type="hidden" name="token" value="{$token}">
10 <table id="configuration_table"> 9 <table id="configuration_table">
@@ -35,7 +34,28 @@
35 34
36 <tr> 35 <tr>
37 <td><b>Timezone:</b></td> 36 <td><b>Timezone:</b></td>
38 <td>{$timezone_form}</td> 37 <td>
38 <select id="continent" name="continent">
39 {loop="$continents"}
40 {if="$key !== 'selected'"}
41 <option value="{$value}" {if="$continents.selected === $value"}selected{/if}>
42 {$value}
43 </option>
44 {/if}
45 {/loop}
46 </select>
47 <select id="city" name="city">
48 {loop="$cities"}
49 {if="$key !== 'selected'"}
50 <option value="{$value.city}"
51 {if="$cities.selected === $value.city"}selected{/if}
52 data-continent="{$value.continent}">
53 {$value.city}
54 </option>
55 {/if}
56 {/loop}
57 </select>
58 </td>
39 </tr> 59 </tr>
40 60
41 <tr> 61 <tr>
@@ -97,9 +117,9 @@
97 <tr> 117 <tr>
98 <td valign="top"><b>Enable REST API</b></td> 118 <td valign="top"><b>Enable REST API</b></td>
99 <td> 119 <td>
100 <input type="checkbox" name="apiEnabled" id="apiEnabled" 120 <input type="checkbox" name="enableApi" id="enableApi"
101 {if="$api_enabled"}checked{/if}/> 121 {if="$api_enabled"}checked{/if}/>
102 <label for="apiEnabled">&nbsp;Allow third party software to use Shaarli such as mobile application.</label> 122 <label for="enableApi">&nbsp;Allow third party software to use Shaarli such as mobile application.</label>
103 </td> 123 </td>
104 </tr> 124 </tr>
105 <tr> 125 <tr>
diff --git a/tpl/vintage/css/shaarli.css b/tpl/vintage/css/shaarli.css
index 7ca567e7..9c72d993 100644
--- a/tpl/vintage/css/shaarli.css
+++ b/tpl/vintage/css/shaarli.css
@@ -41,6 +41,10 @@ strong {
41 font-weight: bold; 41 font-weight: bold;
42} 42}
43 43
44.hidden {
45 display: none;
46}
47
44/* Buttons */ 48/* Buttons */
45.bigbutton, #pageheader a.bigbutton { 49.bigbutton, #pageheader a.bigbutton {
46 background-color: #c0c0c0; 50 background-color: #c0c0c0;
diff --git a/tpl/vintage/import.html b/tpl/vintage/import.html
index 071e1160..bb9e4a56 100644
--- a/tpl/vintage/import.html
+++ b/tpl/vintage/import.html
@@ -5,7 +5,7 @@
5<div id="pageheader"> 5<div id="pageheader">
6 {include="page.header"} 6 {include="page.header"}
7 <div id="uploaddiv"> 7 <div id="uploaddiv">
8 Import Netscape HTML bookmarks (as exported from Firefox/Chrome/Opera/Delicious/Diigo...) (Max: {$maxfilesize} bytes). 8 Import Netscape HTML bookmarks (as exported from Firefox/Chrome/Opera/Delicious/Diigo...) (Max: {$maxfilesize}).
9 <form method="POST" action="?do=import" enctype="multipart/form-data" 9 <form method="POST" action="?do=import" enctype="multipart/form-data"
10 name="uploadform" id="uploadform"> 10 name="uploadform" id="uploadform">
11 <input type="hidden" name="token" value="{$token}"> 11 <input type="hidden" name="token" value="{$token}">
diff --git a/tpl/vintage/install.html b/tpl/vintage/install.html
index 42874dcd..aca890d6 100644
--- a/tpl/vintage/install.html
+++ b/tpl/vintage/install.html
@@ -1,6 +1,6 @@
1<!DOCTYPE html> 1<!DOCTYPE html>
2<html> 2<html>
3<head>{include="includes"}{$timezone_js}</head> 3<head>{include="includes"}</head>
4<body onload="document.installform.setlogin.focus();"> 4<body onload="document.installform.setlogin.focus();">
5<div id="install"> 5<div id="install">
6 <h1>Shaarli</h1> 6 <h1>Shaarli</h1>
@@ -9,7 +9,31 @@
9 <table> 9 <table>
10 <tr><td><b>Login:</b></td><td><input type="text" name="setlogin" size="30"></td></tr> 10 <tr><td><b>Login:</b></td><td><input type="text" name="setlogin" size="30"></td></tr>
11 <tr><td><b>Password:</b></td><td><input type="password" name="setpassword" size="30"></td></tr> 11 <tr><td><b>Password:</b></td><td><input type="password" name="setpassword" size="30"></td></tr>
12 {$timezone_html} 12 <tr>
13 <td><b>Timezone:</b></td>
14 <td>
15 <select id="continent" name="continent">
16 {loop="$continents"}
17 {if="$key !== 'selected'"}
18 <option value="{$value}" {if="$continents.selected === $value"}selected{/if}>
19 {$value}
20 </option>
21 {/if}
22 {/loop}
23 </select>
24 <select id="city" name="city">
25 {loop="$cities"}
26 {if="$key !== 'selected'"}
27 <option value="{$value.city}"
28 {if="$cities.selected === $value.city"}selected{/if}
29 data-continent="{$value.continent}">
30 {$value.city}
31 </option>
32 {/if}
33 {/loop}
34 </select>
35 </td>
36 </tr>
13 <tr><td><b>Page title:</b></td><td><input type="text" name="title" size="30"></td></tr> 37 <tr><td><b>Page title:</b></td><td><input type="text" name="title" size="30"></td></tr>
14 <tr><td valign="top"><b>Update:</b></td><td> 38 <tr><td valign="top"><b>Update:</b></td><td>
15 <input type="checkbox" name="updateCheck" id="updateCheck" checked="checked"><label for="updateCheck">&nbsp;Notify me when a new release is ready</label></td> 39 <input type="checkbox" name="updateCheck" id="updateCheck" checked="checked"><label for="updateCheck">&nbsp;Notify me when a new release is ready</label></td>
diff --git a/tpl/vintage/js/shaarli.js b/tpl/vintage/js/shaarli.js
new file mode 100644
index 00000000..9bcc96fb
--- /dev/null
+++ b/tpl/vintage/js/shaarli.js
@@ -0,0 +1,32 @@
1window.onload = function () {
2 var continent = document.getElementById('continent');
3 var city = document.getElementById('city');
4 if (continent != null && city != null) {
5 continent.addEventListener('change', function(event) {
6 hideTimezoneCities(city, continent.options[continent.selectedIndex].value, true);
7 });
8 hideTimezoneCities(city, continent.options[continent.selectedIndex].value, false);
9 }
10};
11
12/**
13 * Add the class 'hidden' to city options not attached to the current selected continent.
14 *
15 * @param cities List of <option> elements
16 * @param currentContinent Current selected continent
17 * @param reset Set to true to reset the selected value
18 */
19function hideTimezoneCities(cities, currentContinent, reset = false) {
20 var first = true;
21 [].forEach.call(cities, function(option) {
22 if (option.getAttribute('data-continent') != currentContinent) {
23 option.className = 'hidden';
24 } else {
25 option.className = '';
26 if (reset === true && first === true) {
27 option.setAttribute('selected', 'selected');
28 first = false;
29 }
30 }
31 });
32}
diff --git a/tpl/vintage/page.footer.html b/tpl/vintage/page.footer.html
index 006d1d68..4ce0803a 100644
--- a/tpl/vintage/page.footer.html
+++ b/tpl/vintage/page.footer.html
@@ -26,6 +26,7 @@
26<script>function confirmDeleteLink() { var agree=confirm("Are you sure you want to delete this link ?"); if (agree) return true ; else return false ; }</script> 26<script>function confirmDeleteLink() { var agree=confirm("Are you sure you want to delete this link ?"); if (agree) return true ; else return false ; }</script>
27{/if} 27{/if}
28 28
29<script src="js/shaarli.js"></script>
29{loop="$plugins_footer.js_files"} 30{loop="$plugins_footer.js_files"}
30 <script src="{$value}#"></script> 31 <script src="{$value}#"></script>
31{/loop} 32{/loop}