ttrss/utils/notifier/options.html

205 lines
4.9 KiB
HTML
Raw Normal View History

2010-02-17 11:26:25 +00:00
<html>
<head>
<title>Tiny Tiny RSS Notifier Options</title>
<link rel="stylesheet" href="style.css" type="text/css"/>
<script type="text/javascript" src="lib/prototype.js"></script>
<script type="text/javascript" src="lib/scriptaculous/scriptaculous.js?load=effects,dragdrop,controls"></script>
<script type="text/javascript">
function save() {
var s = $("status");
s.innerHTML = "Options saved successfully.";
var f = document.forms['options'];
if (f.site_url.value.length > 0)
localStorage['site_url'] = f.site_url.value;
else {
s.innerHTML = "Error: Site url cannot be blank.";
new Effect.Highlight(f.site_url);
}
if (f.login.value.length > 0)
localStorage['login'] = f.login.value;
else {
s.innerHTML = "Error: Login cannot be blank.";
new Effect.Highlight(f.login);
}
var update_interval = parseInt(f.update_interval.value);
if (update_interval > 0)
localStorage['update_interval'] = f.update_interval.value;
else {
s.innerHTML = "Error: Update interval must be greater than zero.";
new Effect.Highlight(f.update_interval);
}
2010-02-17 12:53:38 +00:00
localStorage['show_badge'] = (f.show_badge.checked) ? "1" : "0";
localStorage['show_fresh'] = (f.show_fresh.checked) ? "1" : "0";
localStorage['single_user'] = (f.single_user.checked) ? "1" : "0";
localStorage['update_feeds'] = (f.update_feeds.checked) ? "1" : "0";
2010-02-17 12:53:38 +00:00
2010-02-17 11:26:25 +00:00
var d = new Date();
localStorage["prefs_updated"] = d.getTime();
Element.show(s);
return false;
}
function single_user_toggle() {
var f = document.forms['options'];
f.login.disabled = f.single_user.checked;
}
2010-02-17 11:26:25 +00:00
function init() {
var f = document.forms['options'];
if (localStorage['site_url'])
f.site_url.value = localStorage['site_url'];
else
f.site_url.value = "http://example.dom/tt-rss/";
if (localStorage['login'])
f.login.value = localStorage['login'];
else
f.login.value = "user";
if (localStorage['update_interval'])
f.update_interval.value = localStorage['update_interval'];
else
f.update_interval.value = '15';
2010-02-17 12:53:38 +00:00
if (localStorage['show_badge'])
f.show_badge.checked = localStorage['show_badge'] == "1";
else
f.show_badge.checked = true;
if (localStorage['show_fresh'])
f.show_fresh.checked = localStorage['show_fresh'] == "1";
else
f.show_fresh.checked = false;
if (localStorage['single_user'])
f.single_user.checked = localStorage['single_user'] == "1";
else
f.single_user.checked = false;
if (localStorage['update_feeds'])
f.update_feeds.checked = localStorage['update_feeds'] == "1";
else
f.update_feeds.checked = false;
single_user_toggle();
2010-02-17 11:26:25 +00:00
var last_updated = $('last_updated');
var d = new Date();
d.setTime(localStorage["last_updated"]);
last_updated.innerHTML = d;
var feeds_last_updated = $('feeds-last-updated');
d.setTime(localStorage["last_feeds_updated"]);
feeds_last_updated.innerHTML = d;
2010-02-17 11:26:25 +00:00
}
</script>
<style type="text/css">
fieldset {
border : 0px;
margin : 0px;
clear : left;
line-height : 25px;
}
div#status {
font-size : 14px;
color : #88b0ff;
}
label {
width : 250px;
display : block;
float : left;
text-align : right;
padding-right : 1em;
}
p.last-updated {
color : gray;
}
fieldset span.note {
color : gray;
font-style : italic;
}
2010-02-17 11:26:25 +00:00
</style>
<body onload="init()">
2012-01-26 11:38:26 +00:00
<div class="floatingLogo"><img src="images/icon_128.png"></div>
2010-02-17 11:26:25 +00:00
<h1>Tiny Tiny RSS Notifier</h1>
<p class='last-updated'>Last update: <span id="last_updated">N/A</span></p>
<div style='display : none' id="status"></div>
<h2>Options</h2>
<form name="options" id="options" onsubmit="return save()">
<fieldset>
<label>URL of your Tiny Tiny RSS installation:</label>
<input name="site_url" size="60" value=""/>
</fieldset>
<fieldset>
<label>Login:</label>
<input name="login" size="30" value=""/>
</fieldset>
<fieldset>
<label>Single-user mode:</label>
<input name="single_user" onchange="single_user_toggle()"
type="checkbox" value="1"/>
</fieldset>
2010-02-17 11:26:25 +00:00
<fieldset>
<label>Update interval (in minutes):</label>
<input name="update_interval" size="30" value=""/>
</fieldset>
2010-02-17 12:53:38 +00:00
<fieldset>
<label>Show badge:</label>
<input name="show_badge" type="checkbox" value="1"/>
</fieldset>
<fieldset>
<label>Badge shows fresh articles:</label>
<input name="show_fresh" type="checkbox" value="1"/>
<span class="note">(requires Tiny Tiny RSS 1.4.1 or trunk)</span>
</fieldset>
<fieldset>
<label>Periodically try to update tt-rss feeds:</label>
<input name="update_feeds" type="checkbox" value="1"/>
<span class="note">Please use this as a last resort method only in case you can't update your feeds <a target="_blank" href="http://tt-rss.org/wiki/UpdatingFeeds">in any other way</a>. Last updated: <span id='feeds-last-updated'>N/A</span></span>
</fieldset>
2010-02-17 11:26:25 +00:00
<input type="submit" value="Save"/>
</form>
<p>Copyright &copy; 2010-2012
2010-02-18 12:42:40 +00:00
<a target="_blank" href="http://tt-rss.org">Andrew Dolgov</a>.
Licensed under GNU GPL version 2.</p>
2010-02-17 11:26:25 +00:00
</body>