]>
Commit | Line | Data |
---|---|---|
f0ea2da5 AD |
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 | ||
01701654 | 40 | localStorage['show_badge'] = (f.show_badge.checked) ? "1" : "0"; |
fa7c9e65 | 41 | localStorage['show_fresh'] = (f.show_fresh.checked) ? "1" : "0"; |
36d146f8 | 42 | localStorage['single_user'] = (f.single_user.checked) ? "1" : "0"; |
a689cd47 | 43 | localStorage['update_feeds'] = (f.update_feeds.checked) ? "1" : "0"; |
01701654 | 44 | |
f0ea2da5 AD |
45 | var d = new Date(); |
46 | ||
47 | localStorage["prefs_updated"] = d.getTime(); | |
48 | ||
49 | Element.show(s); | |
50 | ||
51 | return false; | |
52 | } | |
53 | ||
36d146f8 AD |
54 | function single_user_toggle() { |
55 | var f = document.forms['options']; | |
56 | ||
57 | f.login.disabled = f.single_user.checked; | |
58 | } | |
59 | ||
f0ea2da5 AD |
60 | function init() { |
61 | var f = document.forms['options']; | |
62 | ||
63 | if (localStorage['site_url']) | |
64 | f.site_url.value = localStorage['site_url']; | |
65 | else | |
66 | f.site_url.value = "http://example.dom/tt-rss/"; | |
67 | ||
68 | if (localStorage['login']) | |
69 | f.login.value = localStorage['login']; | |
70 | else | |
71 | f.login.value = "user"; | |
72 | ||
73 | if (localStorage['update_interval']) | |
74 | f.update_interval.value = localStorage['update_interval']; | |
75 | else | |
76 | f.update_interval.value = '15'; | |
77 | ||
01701654 AD |
78 | if (localStorage['show_badge']) |
79 | f.show_badge.checked = localStorage['show_badge'] == "1"; | |
80 | else | |
81 | f.show_badge.checked = true; | |
82 | ||
fa7c9e65 AD |
83 | if (localStorage['show_fresh']) |
84 | f.show_fresh.checked = localStorage['show_fresh'] == "1"; | |
85 | else | |
86 | f.show_fresh.checked = false; | |
87 | ||
36d146f8 AD |
88 | if (localStorage['single_user']) |
89 | f.single_user.checked = localStorage['single_user'] == "1"; | |
90 | else | |
91 | f.single_user.checked = false; | |
92 | ||
a689cd47 AD |
93 | if (localStorage['update_feeds']) |
94 | f.update_feeds.checked = localStorage['update_feeds'] == "1"; | |
95 | else | |
96 | f.update_feeds.checked = false; | |
97 | ||
36d146f8 AD |
98 | single_user_toggle(); |
99 | ||
f0ea2da5 AD |
100 | var last_updated = $('last_updated'); |
101 | ||
102 | var d = new Date(); | |
103 | ||
104 | d.setTime(localStorage["last_updated"]); | |
105 | ||
f0ea2da5 | 106 | last_updated.innerHTML = d; |
a689cd47 AD |
107 | |
108 | var feeds_last_updated = $('feeds-last-updated'); | |
109 | ||
110 | d.setTime(localStorage["last_feeds_updated"]); | |
111 | ||
112 | feeds_last_updated.innerHTML = d; | |
f0ea2da5 AD |
113 | } |
114 | </script> | |
115 | ||
116 | <style type="text/css"> | |
117 | fieldset { | |
118 | border : 0px; | |
119 | margin : 0px; | |
120 | clear : left; | |
121 | line-height : 25px; | |
122 | } | |
123 | ||
124 | div#status { | |
125 | font-size : 14px; | |
126 | color : #88b0ff; | |
127 | } | |
128 | ||
129 | label { | |
130 | width : 250px; | |
131 | display : block; | |
132 | float : left; | |
133 | text-align : right; | |
134 | padding-right : 1em; | |
135 | } | |
136 | ||
137 | p.last-updated { | |
138 | color : gray; | |
139 | } | |
fa7c9e65 AD |
140 | fieldset span.note { |
141 | color : gray; | |
142 | font-style : italic; | |
143 | } | |
144 | ||
f0ea2da5 AD |
145 | </style> |
146 | ||
147 | <body onload="init()"> | |
9de4bb48 | 148 | <div class="floatingLogo"><img src="images/icon_128.png"></div> |
f0ea2da5 AD |
149 | |
150 | <h1>Tiny Tiny RSS Notifier</h1> | |
151 | ||
152 | <p class='last-updated'>Last update: <span id="last_updated">N/A</span></p> | |
153 | ||
154 | <div style='display : none' id="status"></div> | |
155 | ||
156 | <h2>Options</h2> | |
157 | ||
158 | <form name="options" id="options" onsubmit="return save()"> | |
159 | <fieldset> | |
160 | <label>URL of your Tiny Tiny RSS installation:</label> | |
161 | <input name="site_url" size="60" value=""/> | |
162 | </fieldset> | |
163 | ||
164 | <fieldset> | |
165 | <label>Login:</label> | |
166 | <input name="login" size="30" value=""/> | |
167 | </fieldset> | |
168 | ||
36d146f8 AD |
169 | <fieldset> |
170 | <label>Single-user mode:</label> | |
171 | <input name="single_user" onchange="single_user_toggle()" | |
172 | type="checkbox" value="1"/> | |
173 | </fieldset> | |
174 | ||
f0ea2da5 AD |
175 | <fieldset> |
176 | <label>Update interval (in minutes):</label> | |
177 | <input name="update_interval" size="30" value=""/> | |
178 | </fieldset> | |
179 | ||
01701654 AD |
180 | <fieldset> |
181 | <label>Show badge:</label> | |
182 | <input name="show_badge" type="checkbox" value="1"/> | |
183 | </fieldset> | |
184 | ||
fa7c9e65 AD |
185 | <fieldset> |
186 | <label>Badge shows fresh articles:</label> | |
187 | <input name="show_fresh" type="checkbox" value="1"/> | |
188 | <span class="note">(requires Tiny Tiny RSS 1.4.1 or trunk)</span> | |
189 | </fieldset> | |
190 | ||
a689cd47 AD |
191 | <fieldset> |
192 | <label>Periodically try to update tt-rss feeds:</label> | |
193 | <input name="update_feeds" type="checkbox" value="1"/> | |
194 | <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> | |
195 | </fieldset> | |
196 | ||
f0ea2da5 AD |
197 | <input type="submit" value="Save"/> |
198 | </form> | |
199 | ||
a689cd47 | 200 | <p>Copyright © 2010-2012 |
fdf47b9d AD |
201 | <a target="_blank" href="http://tt-rss.org">Andrew Dolgov</a>. |
202 | Licensed under GNU GPL version 2.</p> | |
f0ea2da5 AD |
203 | |
204 | </body> |