Apply the new timezone template variables to the vintage theme
This commit is contained in:
parent
a07373135e
commit
49bc541d79
5 changed files with 85 additions and 4 deletions
|
@ -4,7 +4,6 @@
|
||||||
<body onload="document.configform.title.focus();">
|
<body onload="document.configform.title.focus();">
|
||||||
<div id="pageheader">
|
<div id="pageheader">
|
||||||
{include="page.header"}
|
{include="page.header"}
|
||||||
{$timezone_js}
|
|
||||||
<form method="POST" action="#" name="configform" id="configform">
|
<form method="POST" action="#" name="configform" id="configform">
|
||||||
<input type="hidden" name="token" value="{$token}">
|
<input type="hidden" name="token" value="{$token}">
|
||||||
<table id="configuration_table">
|
<table id="configuration_table">
|
||||||
|
@ -35,7 +34,28 @@
|
||||||
|
|
||||||
<tr>
|
<tr>
|
||||||
<td><b>Timezone:</b></td>
|
<td><b>Timezone:</b></td>
|
||||||
<td>{$timezone_form}</td>
|
<td>
|
||||||
|
<select id="continent" name="continent">
|
||||||
|
{loop="$continents"}
|
||||||
|
{if="$key !== 'selected'"}
|
||||||
|
<option value="{$value}" {if="$continents.selected === $value"}selected{/if}>
|
||||||
|
{$value}
|
||||||
|
</option>
|
||||||
|
{/if}
|
||||||
|
{/loop}
|
||||||
|
</select>
|
||||||
|
<select id="city" name="city">
|
||||||
|
{loop="$cities"}
|
||||||
|
{if="$key !== 'selected'"}
|
||||||
|
<option value="{$value.city}"
|
||||||
|
{if="$cities.selected === $value.city"}selected{/if}
|
||||||
|
data-continent="{$value.continent}">
|
||||||
|
{$value.city}
|
||||||
|
</option>
|
||||||
|
{/if}
|
||||||
|
{/loop}
|
||||||
|
</select>
|
||||||
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
<tr>
|
<tr>
|
||||||
|
|
|
@ -41,6 +41,10 @@ strong {
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.hidden {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
/* Buttons */
|
/* Buttons */
|
||||||
.bigbutton, #pageheader a.bigbutton {
|
.bigbutton, #pageheader a.bigbutton {
|
||||||
background-color: #c0c0c0;
|
background-color: #c0c0c0;
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html>
|
<html>
|
||||||
<head>{include="includes"}{$timezone_js}</head>
|
<head>{include="includes"}</head>
|
||||||
<body onload="document.installform.setlogin.focus();">
|
<body onload="document.installform.setlogin.focus();">
|
||||||
<div id="install">
|
<div id="install">
|
||||||
<h1>Shaarli</h1>
|
<h1>Shaarli</h1>
|
||||||
|
@ -9,7 +9,31 @@ <h1>Shaarli</h1>
|
||||||
<table>
|
<table>
|
||||||
<tr><td><b>Login:</b></td><td><input type="text" name="setlogin" size="30"></td></tr>
|
<tr><td><b>Login:</b></td><td><input type="text" name="setlogin" size="30"></td></tr>
|
||||||
<tr><td><b>Password:</b></td><td><input type="password" name="setpassword" size="30"></td></tr>
|
<tr><td><b>Password:</b></td><td><input type="password" name="setpassword" size="30"></td></tr>
|
||||||
{$timezone_html}
|
<tr>
|
||||||
|
<td><b>Timezone:</b></td>
|
||||||
|
<td>
|
||||||
|
<select id="continent" name="continent">
|
||||||
|
{loop="$continents"}
|
||||||
|
{if="$key !== 'selected'"}
|
||||||
|
<option value="{$value}" {if="$continents.selected === $value"}selected{/if}>
|
||||||
|
{$value}
|
||||||
|
</option>
|
||||||
|
{/if}
|
||||||
|
{/loop}
|
||||||
|
</select>
|
||||||
|
<select id="city" name="city">
|
||||||
|
{loop="$cities"}
|
||||||
|
{if="$key !== 'selected'"}
|
||||||
|
<option value="{$value.city}"
|
||||||
|
{if="$cities.selected === $value.city"}selected{/if}
|
||||||
|
data-continent="{$value.continent}">
|
||||||
|
{$value.city}
|
||||||
|
</option>
|
||||||
|
{/if}
|
||||||
|
{/loop}
|
||||||
|
</select>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
<tr><td><b>Page title:</b></td><td><input type="text" name="title" size="30"></td></tr>
|
<tr><td><b>Page title:</b></td><td><input type="text" name="title" size="30"></td></tr>
|
||||||
<tr><td valign="top"><b>Update:</b></td><td>
|
<tr><td valign="top"><b>Update:</b></td><td>
|
||||||
<input type="checkbox" name="updateCheck" id="updateCheck" checked="checked"><label for="updateCheck"> Notify me when a new release is ready</label></td>
|
<input type="checkbox" name="updateCheck" id="updateCheck" checked="checked"><label for="updateCheck"> Notify me when a new release is ready</label></td>
|
||||||
|
|
32
tpl/vintage/js/shaarli.js
Normal file
32
tpl/vintage/js/shaarli.js
Normal file
|
@ -0,0 +1,32 @@
|
||||||
|
window.onload = function () {
|
||||||
|
var continent = document.getElementById('continent');
|
||||||
|
var city = document.getElementById('city');
|
||||||
|
if (continent != null && city != null) {
|
||||||
|
continent.addEventListener('change', function(event) {
|
||||||
|
hideTimezoneCities(city, continent.options[continent.selectedIndex].value, true);
|
||||||
|
});
|
||||||
|
hideTimezoneCities(city, continent.options[continent.selectedIndex].value, false);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Add the class 'hidden' to city options not attached to the current selected continent.
|
||||||
|
*
|
||||||
|
* @param cities List of <option> elements
|
||||||
|
* @param currentContinent Current selected continent
|
||||||
|
* @param reset Set to true to reset the selected value
|
||||||
|
*/
|
||||||
|
function hideTimezoneCities(cities, currentContinent, reset = false) {
|
||||||
|
var first = true;
|
||||||
|
[].forEach.call(cities, function(option) {
|
||||||
|
if (option.getAttribute('data-continent') != currentContinent) {
|
||||||
|
option.className = 'hidden';
|
||||||
|
} else {
|
||||||
|
option.className = '';
|
||||||
|
if (reset === true && first === true) {
|
||||||
|
option.setAttribute('selected', 'selected');
|
||||||
|
first = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
|
@ -26,6 +26,7 @@
|
||||||
<script>function confirmDeleteLink() { var agree=confirm("Are you sure you want to delete this link ?"); if (agree) return true ; else return false ; }</script>
|
<script>function confirmDeleteLink() { var agree=confirm("Are you sure you want to delete this link ?"); if (agree) return true ; else return false ; }</script>
|
||||||
{/if}
|
{/if}
|
||||||
|
|
||||||
|
<script src="js/shaarli.js"></script>
|
||||||
{loop="$plugins_footer.js_files"}
|
{loop="$plugins_footer.js_files"}
|
||||||
<script src="{$value}#"></script>
|
<script src="{$value}#"></script>
|
||||||
{/loop}
|
{/loop}
|
||||||
|
|
Loading…
Reference in a new issue