]> git.wh0rd.org - tt-rss.git/blob - utils/notifier/options.html
release 1.5.8
[tt-rss.git] / utils / notifier / options.html
1 <html>
2 <head>
3 <title>Tiny Tiny RSS Notifier Options</title>
4 <link rel="stylesheet" href="style.css" type="text/css"/>
5 <script type="text/javascript" src="lib/prototype.js"></script>
6 <script type="text/javascript" src="lib/scriptaculous/scriptaculous.js?load=effects,dragdrop,controls"></script>
7
8 <script type="text/javascript">
9 function save() {
10
11 var s = $("status");
12
13 s.innerHTML = "Options saved successfully.";
14
15 var f = document.forms['options'];
16
17 if (f.site_url.value.length > 0)
18 localStorage['site_url'] = f.site_url.value;
19 else {
20 s.innerHTML = "Error: Site url cannot be blank.";
21 new Effect.Highlight(f.site_url);
22 }
23
24 if (f.login.value.length > 0)
25 localStorage['login'] = f.login.value;
26 else {
27 s.innerHTML = "Error: Login cannot be blank.";
28 new Effect.Highlight(f.login);
29 }
30
31 var update_interval = parseInt(f.update_interval.value);
32
33 if (update_interval > 0)
34 localStorage['update_interval'] = f.update_interval.value;
35 else {
36 s.innerHTML = "Error: Update interval must be greater than zero.";
37 new Effect.Highlight(f.update_interval);
38 }
39
40 localStorage['show_badge'] = (f.show_badge.checked) ? "1" : "0";
41 localStorage['show_fresh'] = (f.show_fresh.checked) ? "1" : "0";
42 localStorage['single_user'] = (f.single_user.checked) ? "1" : "0";
43
44 var d = new Date();
45
46 localStorage["prefs_updated"] = d.getTime();
47
48 Element.show(s);
49
50 return false;
51 }
52
53 function single_user_toggle() {
54 var f = document.forms['options'];
55
56 f.login.disabled = f.single_user.checked;
57 }
58
59 function init() {
60 var f = document.forms['options'];
61
62 if (localStorage['site_url'])
63 f.site_url.value = localStorage['site_url'];
64 else
65 f.site_url.value = "http://example.dom/tt-rss/";
66
67 if (localStorage['login'])
68 f.login.value = localStorage['login'];
69 else
70 f.login.value = "user";
71
72 if (localStorage['update_interval'])
73 f.update_interval.value = localStorage['update_interval'];
74 else
75 f.update_interval.value = '15';
76
77 if (localStorage['show_badge'])
78 f.show_badge.checked = localStorage['show_badge'] == "1";
79 else
80 f.show_badge.checked = true;
81
82 if (localStorage['show_fresh'])
83 f.show_fresh.checked = localStorage['show_fresh'] == "1";
84 else
85 f.show_fresh.checked = false;
86
87 if (localStorage['single_user'])
88 f.single_user.checked = localStorage['single_user'] == "1";
89 else
90 f.single_user.checked = false;
91
92 single_user_toggle();
93
94 var last_updated = $('last_updated');
95
96 var d = new Date();
97
98 d.setTime(localStorage["last_updated"]);
99
100
101 last_updated.innerHTML = d;
102 }
103 </script>
104
105 <style type="text/css">
106 fieldset {
107 border : 0px;
108 margin : 0px;
109 clear : left;
110 line-height : 25px;
111 }
112
113 div#status {
114 font-size : 14px;
115 color : #88b0ff;
116 }
117
118 label {
119 width : 250px;
120 display : block;
121 float : left;
122 text-align : right;
123 padding-right : 1em;
124 }
125
126 p.last-updated {
127 color : gray;
128 }
129 fieldset span.note {
130 color : gray;
131 font-style : italic;
132 }
133
134 </style>
135
136 <body onload="init()">
137 <div class="floatingLogo"><img src="images/ttrss_logo.png"></div>
138
139 <h1>Tiny Tiny RSS Notifier</h1>
140
141 <p class='last-updated'>Last update: <span id="last_updated">N/A</span></p>
142
143 <div style='display : none' id="status"></div>
144
145 <h2>Options</h2>
146
147 <form name="options" id="options" onsubmit="return save()">
148 <fieldset>
149 <label>URL of your Tiny Tiny RSS installation:</label>
150 <input name="site_url" size="60" value=""/>
151 </fieldset>
152
153 <fieldset>
154 <label>Login:</label>
155 <input name="login" size="30" value=""/>
156 </fieldset>
157
158 <fieldset>
159 <label>Single-user mode:</label>
160 <input name="single_user" onchange="single_user_toggle()"
161 type="checkbox" value="1"/>
162 </fieldset>
163
164 <fieldset>
165 <label>Update interval (in minutes):</label>
166 <input name="update_interval" size="30" value=""/>
167 </fieldset>
168
169 <fieldset>
170 <label>Show badge:</label>
171 <input name="show_badge" type="checkbox" value="1"/>
172 </fieldset>
173
174 <fieldset>
175 <label>Badge shows fresh articles:</label>
176 <input name="show_fresh" type="checkbox" value="1"/>
177 <span class="note">(requires Tiny Tiny RSS 1.4.1 or trunk)</span>
178 </fieldset>
179
180 <input type="submit" value="Save"/>
181 </form>
182
183 <p>Copyright &copy; 2010
184 <a target="_blank" href="http://tt-rss.org">Andrew Dolgov</a>.
185 Licensed under GNU GPL version 2.</p>
186
187 </body>