forked from cezarsa/silver_bird
-
Notifications
You must be signed in to change notification settings - Fork 0
/
options.html
executable file
·633 lines (576 loc) · 28.6 KB
/
options.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" type="text/css" href="css/options.css" />
<link rel="stylesheet" type="text/css" href="css/colorpicker/colorpicker.css" />
<script type="text/javascript" src="lib/3rdparty/jquery.js"></script>
<script type="text/javascript" src="lib/3rdparty/colorpicker.js"></script>
<script type="text/javascript" src="lib/math_utils.js"></script>
<script type="text/javascript" src="lib/shortener_lib.js"></script>
<script type="text/javascript" src="lib/options/options.js"></script>
<title>Silver Bird Options</title>
<script type="text/javascript">
var LocaleTable = chrome.extension.getBackgroundPage().LocaleTable;
var ImageService = chrome.extension.getBackgroundPage().ImageService;
var IconCreator = chrome.extension.getBackgroundPage().IconCreator;
var tweetManager = chrome.extension.getBackgroundPage().TweetManager.instance;
chrome.i18n.getMessage = chrome.extension.getBackgroundPage().chrome.i18n.getMessage;
var twitterBackend = tweetManager.twitterBackend;
var options = new Options();
var imgEl = null;
function paintIcon(canvas, color) {
if(!imgEl) {
var img = $('<img>').attr('src', 'img/icon19.png');
img.load(function() {
imgEl = img[0];
var imgData = IconCreator.paintIcon(imgEl, color);
canvas.getContext("2d").putImageData(imgData, 0, 0);
});
} else {
var imgData = IconCreator.paintIcon(imgEl, color);
canvas.getContext("2d").putImageData(imgData, 0, 0);
}
}
var hourlyLimit = 150;
$(function() {
$("input.i18n").each(function() {
$(this).val(chrome.i18n.getMessage(this.id));
});
$(".i18n").not("input .htmlSafe").each(function() {
$(this).text(chrome.i18n.getMessage(this.id));
});
$(".i18n.htmlSafe").each(function() {
$(this).html(chrome.i18n.getMessage(this.id));
});
var resetDateObj = new Date();
if(twitterBackend) {
var hitsInfo = twitterBackend.remainingHitsInfo();
$(".twitter_hits_left").text(hitsInfo[0]);
resetDateObj.setTime(parseInt(hitsInfo[1], 10) * 1000);
$(".twitter_hits_reset").text(resetDateObj.toLocaleDateString() + " " + resetDateObj.toLocaleTimeString());
if(hitsInfo[2]) {
hourlyLimit = parseInt(hitsInfo[2], 10);
}
}
$(".__hourly_limit").text(hourlyLimit);
$("select[name='default_locale']").append($("<option>").attr('value', 'auto').text(chrome.i18n.getMessage('automatic')));
for(var localeCode in LocaleTable.instance.locales) {
$("select[name='default_locale']").append($("<option>").attr('value', localeCode).text(localeCode));
}
for(var key in SHORTENERS_BACKEND) {
var desc = SHORTENERS_BACKEND[key].desc;
$("select[name='url_shortener']").append($("<option>").attr('value', key).text(desc));
}
for(var i = 0, len = ImageService.services.length; i < len; ++i) {
var service = ImageService.services[i];
if(service.hasUpload()) {
$("select[name='image_upload_service']").append($("<option>").attr('value', service.domain).text(service.domain));
}
}
var onShortenerChange = function() {
$("#shortener_opts").hide();
$("#yourls_opts").hide();
$("#googl_opts").hide();
var shortenerSelect = $("select[name='url_shortener']")[0];
if(shortenerSelect.value == 'bitly' || shortenerSelect.value == 'jmp' || shortenerSelect.value == 'karmacracy') {
$("#shortener_opts").show();
} else if(shortenerSelect.value == 'yourls') {
$("#yourls_opts").show();
} else if(shortenerSelect.value == 'googl') {
$("#googl_opts").show();
}
};
var onShortenerAcctClick = function() {
if($("input[name='shortener_acct']").is(':checked')) {
$("input[name='shortener_login']").removeAttr('disabled');
$("input[name='shortener_key']").removeAttr('disabled');
} else {
$("input[name='shortener_login']").val('').attr('disabled', 'disabled');
$("input[name='shortener_key']").val('').attr('disabled', 'disabled');
}
};
$("select[name='url_shortener']").change(onShortenerChange);
$("input[name='shortener_acct']").click(onShortenerAcctClick);
var onSigningUrlCheck = function() {
var $check = $("input[name='same_signing_urls']");
if($check.is(':checked')) {
$("input[name='base_signing_url'], input[name='base_oauth_signing_url']").attr('disabled', 'disabled');
$("input[name='base_signing_url']").val($("input[name='base_url']").val());
$("input[name='base_oauth_signing_url']").val($("input[name='base_oauth_url']").val());
$("input[name='base_url']").bind('keyup blur', function() {
$("input[name='base_signing_url']").val($(this).val());
});
$("input[name='base_oauth_url']").bind('keyup blur', function() {
$("input[name='base_oauth_signing_url']").val($(this).val());
});
} else {
$("input[name='base_signing_url'], input[name='base_oauth_signing_url']").removeAttr('disabled');
$("input[name='base_url']").unbind('keyup blur');
$("input[name='base_oauth_url']").unbind('keyup blur');
}
};
$("input[name='same_signing_urls']").click(onSigningUrlCheck);
$('canvas.color_selector').ColorPicker({
onChange: function (hsb, hex, rgb, rgbaStr) {
var canvas = this.data('colorpicker').el;
$(canvas).attr('strColor', rgbaStr);
paintIcon(canvas, rgb);
}
});
$('div.color_selector').ColorPicker({
onChange: function (hsb, hex, rgb, rgbaStr) {
var div = this.data('colorpicker').el;
$(div).attr('strColor', rgbaStr);
$(div).css('backgroundColor', rgbaStr);
}
});
options.onload(function() {
onShortenerChange();
onShortenerAcctClick();
onSigningUrlCheck();
});
options.onsaveChangedOption(function(optionName, oldValue, newValue) {
var idx, templateId;
if((idx = optionName.indexOf('_visible')) != -1) {
templateId = optionName.substring(0, idx);
if(newValue) {
tweetManager.showTimelineTemplate(templateId, true);
} else {
tweetManager.hideTimelineTemplate(templateId);
}
} else if((idx = optionName.indexOf('_include_unified')) != -1) {
templateId = optionName.substring(0, idx);
tweetManager.toggleUnified(templateId, newValue);
} else if(optionName == 'trending_topics_woeid') {
tweetManager.cachedTrendingTopics = null;
}
});
options.onsave(function() {
if($("#noti_desktop").is(":checked")) {
try {
var notificationCenter = window.notifications || window.webkitNotifications;
if(!notificationCenter) {
throw 'out';
}
var authStatus = notificationCenter.checkPermission();
if(authStatus == 1 || authStatus == 2) { // Not allowed or Denied
notificationCenter.requestPermission(function() {
var authStatus = notificationCenter.checkPermission();
if(authStatus !== 0) { // Permission denied
$("#noti_on_page").click();
options.save();
}
});
}
} catch(boom) {
$("#noti_on_page").click();
options.save();
}
}
});
options.load();
var createTTSelect = function(ttLocales) {
$("select[name='trending_topics_woeid']").empty();
$.each(ttLocales, function(i, locale){
$("select[name='trending_topics_woeid']").append($("<option>").attr('value', locale.woeid).text(locale.name));
});
$("select[name='trending_topics_woeid']").val(OptionsBackend.get('trending_topics_woeid'));
};
var woeids = tweetManager.retrieveTrendingRegions(function(woeids) {
createTTSelect(woeids);
});
createTTSelect(woeids);
updatePredictedHitsCount();
$('table.timelines input, table.timelines select').
keyup(updatePredictedHitsCount).
blur(updatePredictedHitsCount).
click(updatePredictedHitsCount).
change(updatePredictedHitsCount);
$("input[name='microblogging_service'],label[for='service_twitter'],label[for='service_identica']").mousedown(function(e) {
var el = $(e.target);
if(el.is('label')) {
el = $('#' + el.attr('for'));
}
if(!el.is(':checked')) {
var proceed = confirm("This will reset any custom API URL configuration. Proceed?");
if(proceed) {
el.click();
var sameSigningEl = $("input[name='same_signing_urls']");
var baseUrlEl = $("input[name='base_url']");
var baseOauthUrlEl = $("input[name='base_oauth_url']");
if(el.val() == 'twitter') {
baseUrlEl.val('http://api.twitter.com/1/');
baseOauthUrlEl.val('https://twitter.com/oauth/');
} else if(el.val() == 'identica') {
baseUrlEl.val('http://identi.ca/api/');
baseOauthUrlEl.val('https://identi.ca/api/oauth/');
}
baseUrlEl.blur();
baseOauthUrlEl.blur();
if(!sameSigningEl.is(':checked')) {
sameSigningEl.attr('checked', true).click().attr('checked', true);
}
}
}
return true;
});
$("#nerds_link").click(function() {
var $canvas = $("#nerds");
$canvas.toggle();
if($canvas.is(":visible")) {
var points = chrome.extension.getBackgroundPage().TweetManager.instance.apiHitsStates;
Math.generateTendencyGraph($canvas[0], points, resetDateObj.getTime());
}
});
});
function updatePredictedHitsCount() {
var totalHits = 0;
var unifiedVisible = $('input[name="unified_visible"]').is(':checked');
TimelineTemplate.eachTimelineTemplate(function(template) {
if(template.id == TimelineTemplate.UNIFIED) {
return true;
}
var inputUnifiedEl = $('input[name="' + template.id + '_include_unified"]');
if(!unifiedVisible) {
inputUnifiedEl.attr('disabled', 'disabled');
} else {
inputUnifiedEl.removeAttr('disabled');
}
if(template.id == TimelineTemplate.SEARCH) {
return true;
}
var inputVisibleEl = $('input[name="' + template.id + '_visible"]');
if(!inputVisibleEl.is(':checked') && !(unifiedVisible && inputUnifiedEl.is(':checked'))) {
return true;
}
var inputRefreshEl = $('input[name="' + template.id + '_refresh_interval"]');
var intVal = parseInt(inputRefreshEl.val(), 10);
var timelineHits = (60 * 60) / intVal;
var timelineCount = 1;
if(template.id == TimelineTemplate.DMS) {
timelineCount = 2;
} else {
var userData = template.getUserData();
if(userData && userData.length > 0) {
timelineCount = userData.length;
}
}
totalHits += timelineHits * timelineCount;
return true;
});
totalHits += (60 * 60) / parseInt($('input[name="blockedusers_refresh_interval"]').val(), 10);
totalHits = parseInt(totalHits, 10);
$('#predicted_hits_count').text(totalHits);
if(totalHits >= hourlyLimit) {
$('#predicted_hits_count').css('backgroundColor', 'red');
} else if(totalHits >= hourlyLimit * 0.85) {
$('#predicted_hits_count').css('backgroundColor', 'yellow');
} else {
$('#predicted_hits_count').css('backgroundColor', 'white');
}
return totalHits;
}
</script>
</head>
<body>
<h1 class="i18n" id="options_title">Silver Bird Options</h1>
<div id="saved_notice">
<span class="i18n" id="conf_saved">Your configuration has been successfully saved!</span>
<div id="restart_notice">
<span class="i18n" id="changes_restart">
However, some of your changes require the extension to be restarted. Would you like to do it now?<br>
(This will reset your unread tweets count.)
</span>
<br>
<input type="button" onclick="options.confirmRestart();" class="i18n" id="Yes" value="Yes">
<input type="button" onclick="options.denyRestart();" class="i18n" id="No" value="No">
</div>
</div>
<div id="main_area">
<p>
<span class="i18n" id="remaining_api_hits">Remaining Twitter API Hits: </span><span class="twitter_hits_left"></span><br>
<span class="i18n" id="rate_limit_reset">Rate Limit Reset: </span><span class="twitter_hits_reset"></span>
<a id="nerds_link" href="#" class="i18n">API Hits stats (for nerds)</a>
<canvas id="nerds" width="650" height="500" style="display: none;"></canvas>
</p>
<fieldset>
<legend id="g_ui" class="i18n">UI</legend>
<label for="name_attribute" id="l_name_attribute" class="i18n">Name in tweets:</label>
<select name="name_attribute">
<option value="screen_name" id="o_screen_name" class="i18n">Screen name (nickname)</option>
<option value="name" id="o_name" class="i18n">Real name</option>
<option value="both" id="o_both" class="i18n">Both names</option>
</select><br>
<label for="compose_position" id="l_compose_position" class="i18n">Compose area position:</label>
<select name="compose_position">
<option value="top" id="o_top" class="i18n">Top</option>
<option value="bottom" id="o_bottom" class="i18n">Bottom</option>
</select><br>
<label for="theme" id="l_theme" class="i18n">UI Theme:</label>
<select name="theme">
<option value="css/chromified.css,css/chromified-theme/jquery-ui-1.7.2.custom.css">Chromified</option>
<option value="css/whisper.css,css/whisper-theme/jquery-ui-1.7.2.custom.css">Whispers</option>
<option value="css/darkness-theme/jquery-ui-1.7.2.custom.css,css/darkness.css">Darkness</option>
</select><br>
<label for="font_size" id="l_font_size" class="i18n">Font Size:</label>
<select name="font_size">
<option value="0.8em" id="o_small" class="i18n">Small</option>
<option value="1.0em" id="o_normal" class="i18n">Normal</option>
<option value="1.2em" id="o_large" class="i18n">Large</option>
<option value="1.4em" id="o_extra_large" class="i18n">Extra Large</option>
</select><br>
<label for="default_locale" class="i18n" id="l_default_locale">Default Locale:</label>
<select name="default_locale"></select><br>
<label for="font_family" id="l_font_family" class="i18n">Font Family:</label>
<input type="text" style="width: 20em"; name="font_family" validator="required"><br>
<label for="hover_timeout" class="i18n" id="l_hover_timeout">Hover to read time (ms):</label>
<input type="text" name="hover_timeout" validator="required,number,positive"><br>
<label for="show_expanded_urls" class="i18n" id="l_show_expanded_urls">Expand shortened URLs:</label>
<input type="checkbox" id="show_expanded_urls" name="show_expanded_urls" /><br>
<label for="reply_all" class="i18n" id="l_reply_all">Reply to all mentioned:</label>
<input type="checkbox" id="reply_all" name="reply_all" /><br/>
<label for="show_hits_in_popup" class="i18n" id="l_show_hits_in_popup">Show API hits count:</label>
<input type="checkbox" id="show_hits_in_popup" name="show_hits_in_popup" /><br/>
<label for="show_user_autocomplete" class="i18n" id="l_show_user_autocomplete">Autocomplete usernames:</label>
<input type="checkbox" style="margin-bottom: 7px;" id="show_user_autocomplete" name="show_user_autocomplete" /><br/>
<label id="l_icon_color" class="i18n">Icon color:</label>
<canvas name="idle_color" width="19" height="19" class="color_selector" must_restart></canvas><br/>
<label for="tweets_color_only_unified" id="l_tweets_color_only_unified" class="i18n">Colors only in unified:</label>
<input type="checkbox" name="tweets_color_only_unified" /><br/>
<table class="tweet_color">
<tr>
<th></th>
<th class="i18n" id="w_Home">Home</th>
<th class="i18n" id="w_Mentions">Mentions</th>
<th class="i18n" id="w_DM">DMs</th>
<th class="i18n" id="w_Lists">Lists</th>
<th class="i18n" id="w_Favorites">Favorites</th>
<th class="i18n" id="w_Search">Search</th>
<tr>
<td class="label i18n" id="l_tweet_color">Tweet color:</td>
<td>
<div class="color_selector checkerboard"></div>
<div name="home_tweets_color" class="color_selector"></div>
</td>
<td>
<div class="color_selector checkerboard"></div>
<div name="mentions_tweets_color" class="color_selector"></div>
</td>
<td>
<div class="color_selector checkerboard"></div>
<div name="dms_tweets_color" class="color_selector"></div>
</td>
<td>
<div class="color_selector checkerboard"></div>
<div name="lists_tweets_color" class="color_selector"></div>
</td>
<td>
<div class="color_selector checkerboard"></div>
<div name="favorites_tweets_color" class="color_selector"></div>
</td>
<td>
<div class="color_selector checkerboard"></div>
<div name="search_tweets_color" class="color_selector"></div>
</td>
</tr>
</table><br>
<input type="button" value="Reset Popup Size" class="i18n" id="btn_reset_popup_size" onclick="Persistence.popupSize().remove();">
</fieldset>
<fieldset>
<legend class="i18n" id="g_notifications">Notifications</legend>
<table class="notifications">
<tr>
<th></th>
<th class="i18n" id="l_tweet_notificacion">Tweet Notification</th>
<th class="i18n" id="l_change_icon">Change Icon</th>
<th class="i18n" id="l_icon_color_column">Icon Color</th>
<tr>
<td class="label i18n" id="notif_home">Home:</td>
<td><input type="checkbox" name="home_on_page"></td>
<td><input type="checkbox" name="home_icon"></td>
<td><canvas name="home_color" width="19" height="19" class="color_selector"></canvas></td>
</tr>
<tr>
<td class="label i18n" id="notif_mentions">Mentions:</td>
<td><input type="checkbox" name="mentions_on_page"></td>
<td><input type="checkbox" name="mentions_icon"></td>
<td><canvas name="mentions_color" width="19" height="19" class="color_selector"></canvas></td>
</tr>
<tr>
<td class="label i18n" id="notif_dms">DMs:</td>
<td><input type="checkbox" name="dms_on_page"></td>
<td><input type="checkbox" name="dms_icon"></td>
<td><canvas name="dms_color" width="19" height="19" class="color_selector"></canvas></td>
</tr>
<tr>
<td class="label i18n" id="notif_lists">Lists:</td>
<td><input type="checkbox" name="lists_on_page"></td>
<td><input type="checkbox" name="lists_icon"></td>
<td><canvas name="lists_color" width="19" height="19" class="color_selector"></canvas></td>
</tr>
<tr>
<td class="label i18n" id="notif_search">Search:</td>
<td><input type="checkbox" name="search_on_page"></td>
<td><input type="checkbox" name="search_icon"></td>
<td><canvas name="search_color" width="19" height="19" class="color_selector"></canvas></td>
</tr>
</table><br>
<label for="tweets_notification_style" class="i18n" id="l_tweets_notification_style">Notification Style:</label>
<input type="radio" name="tweets_notification_style" value="on_page" id="noti_on_page"> <label for="noti_on_page" class="radio_opt i18n" id="l_noti_on_page">Notify on Page</label>
<input type="radio" name="tweets_notification_style" value="desktop" id="noti_desktop"> <label for="noti_desktop" class="radio_opt i18n" id="l_noti_desktop">Desktop Notifications</label><br>
<label for="notification_fade_timeout" class="i18n" id="l_notification_fade_timeout">Notification Timeout (s):</label>
<input type="text" name="notification_fade_timeout" validator="required,number,positive" converter="RefreshInterval"><br>
<label for="notification_max_popups" class="i18n" id="l_notification_max_popups">Notifications at once (-1: all):</label>
<input type="text" name="notification_max_popups" validator="required,number"><br>
<label for="notify_retweets" class="i18n" id="l_notify_retweets">Notify retweets of my tweets?</label>
<input type="radio" name="notify_retweets" value="always" id="notify_rt_always"> <label for="notify_rt_always" class="radio_opt i18n" id="l_notify_rt_always">Always</label>
<input type="radio" name="notify_retweets" value="only_first" id="notify_rt_only_first"> <label for="notify_rt_only_first" class="radio_opt i18n" id="l_notify_rt_only_first">First One Only</label>
<input type="radio" name="notify_retweets" value="never" id="notify_rt_never"> <label for="notify_rt_never" class="radio_opt i18n" id="l_notify_rt_never">Never</label><br>
</fieldset>
<fieldset>
<legend class="i18n" id="g_shortener">Shortener</legend>
<label for="url_shortener" class="i18n" id="l_url_shortener">URL Shortener:</label>
<select name="url_shortener"></select><br>
<p id="shortener_opts">
<label for="shortener_acct" class="i18n" id="l_shortener_acct">Use Personal Account?</label>
<input type="checkbox" name="shortener_acct"><br>
<label for="shortener_login" class="i18n" id="l_shortener_login">API Login:</label>
<input type="text" name="shortener_login"><br>
<label for="shortener_key" class="i18n" id="l_shortener_key">API Key:</label>
<input type="text" name="shortener_key">
</p>
<p id="yourls_opts">
<label for="shortener_yourls_service">Service URL:</label>
<input type="text" name="shortener_service_url"> (http://yoursite.com/yourls-api.php)<br>
<label for="yourls_key">Signature token:</label>
<input type="text" name="yourls_key">
</p>
<p id="googl_opts">
<label for="googl_personal_account" class="i18n" id="l_shortener_oauth">Use personal account authentication:</label>
<input type="checkbox" name="shortener_oauth"><br/>
</p>
<label for="share_include_title" class="i18n" id="l_share_include_title">Include page title (sharing):</label>
<input type="checkbox" name="share_include_title"><br>
</fieldset>
<fieldset>
<legend class="i18n" id="g_image_service">Image Service</legend>
<label for="url_shortener" class="i18n" id="l_image_up_service">Image Upload Service:</label>
<select name="image_upload_service"></select>
</fieldset>
<fieldset>
<legend class="i18n" id="g_trending_topics">Trending Topics</legend>
<label for="trending_topics_woeid" class="i18n" id="l_trending_topics_woeid">Trending Topics Locale:</label>
<select name="trending_topics_woeid"></select>
</fieldset>
<fieldset>
<legend class="i18n" id="g_timelines">Timelines</legend>
<p class="notice i18n htmlSafe" style="text-align: center; color: black;" id="notice_api_hits">
You should keep API hits <span style="color: red;">below <span class="__hourly_limit"></span></span>! Otherwise Silver Bird will stop working properly and timelines won't update anymore.<br>
<span style="color: red;">Remember</span> that if you're using multiple Twitter clients you'll need to keep your API hits even lower.
</p>
<p class="hits_notice">
<span class="i18n" id="l_hits_notice">API hits per hour: </span><span id="predicted_hits_count"></span> / <span class="__hourly_limit"></span>
</p>
<table class="timelines">
<tr>
<th></th>
<th id="l_visible" class="i18n">Visible</th>
<th id="l_refresh_interval" class="i18n">Refresh Interval (s)</th>
<th id="l_include_in_unified" class="i18n">Include in unified timeline</th>
<tr>
<td class="label i18n" id="l_unified_timeline">Unified Timeline:</td>
<td><input type="checkbox" name="unified_visible" validator="unifiedValidator"></td>
<td>-</td>
<td>-</td>
</tr>
<tr>
<td class="label i18n" id="notif_home">Home:</td>
<td><input type="checkbox" name="home_visible"></td>
<td><input type="text" name="home_refresh_interval" validator="required,number,minRefresh" converter="RefreshInterval"></td>
<td><input type="checkbox" name="home_include_unified"></td>
</tr>
<tr>
<td class="label i18n" id="notif_mentions">Mentions:</td>
<td><input type="checkbox" name="mentions_visible"></td>
<td><input type="text" name="mentions_refresh_interval" validator="required,number,minRefresh" converter="RefreshInterval"></td>
<td><input type="checkbox" name="mentions_include_unified"></td>
</tr>
<tr>
<td class="label i18n" id="notif_dms">DM:</td>
<td><input type="checkbox" name="dms_visible"></td>
<td><input type="text" name="dms_refresh_interval" validator="required,number,minRefresh" converter="RefreshInterval"></td>
<td><input type="checkbox" name="dms_include_unified"></td>
</tr>
<tr>
<td class="label i18n" id="notif_lists">Lists:</td>
<td><input type="checkbox" name="lists_visible"></td>
<td><input type="text" name="lists_refresh_interval" validator="required,number,minRefresh" converter="RefreshInterval"></td>
<td><input type="checkbox" name="lists_include_unified"></td>
</tr>
<tr>
<td class="label i18n" id="notif_search">Search:</td>
<td><input type="checkbox" name="search_visible"></td>
<td><input type="text" name="search_refresh_interval" validator="required,number,minRefresh" converter="RefreshInterval"></td>
<td><input type="checkbox" name="search_include_unified"></td>
</tr>
<tr>
<td class="label i18n" id="tml_favorites">Favorites:</td>
<td><input type="checkbox" name="favorites_visible"></td>
<td><input type="text" name="favorites_refresh_interval" validator="required,number,minRefresh" converter="RefreshInterval"></td>
<td><input type="checkbox" name="favorites_include_unified"></td>
</tr>
<tr>
<td class="label i18n" id="l_blocked_users">Blocked Users:</td>
<td>-</td>
<td><input type="text" name="blockedusers_refresh_interval" validator="required,number,minRefresh" converter="RefreshInterval"></td>
<td>-</td>
</tr>
</table>
<p id="notice_right_click_change" class="notice i18n" style="color: black;">
* Hey, now you can use the right-click context menu to change most of this settings directly into the popup window. Just get
out of here! :)
</p>
</fieldset>
<fieldset>
<legend class="i18n" id="g_timelines">Timelines</legend>
<label for="tweets_per_page" class="i18n" id="l_tweets_per_page">Tweets per Page:</label>
<input type="text" name="tweets_per_page" validator="required,number,positive" must_restart><br>
<label for="max_cached_tweets" class="i18n" id="l_max_cached_tweets">Max Shown Tweets:</label>
<input type="text" name="max_cached_tweets" validator="required,number,positive" must_restart><br>
</fieldset>
<fieldset>
<legend class="i18n" id="g_microblogging_service">Microblogging Service</legend>
<input type="radio" name="microblogging_service" value="twitter" id="service_twitter" must_restart> <label for="service_twitter" class="radio_opt">Twitter</label>
<input type="radio" name="microblogging_service" value="identica" id="service_identica" must_restart> <label for="service_identica" class="radio_opt">identi.ca</label>
</fieldset>
<fieldset>
<legend class="i18n" id="g_advanced">Advanced</legend>
<label for="request_timeout" class="i18n" id="l_request_timeout">Request Timeout (ms):</label>
<input type="text" name="request_timeout" validator="required,number,positive" must_restart><br>
<label for="base_url" class="i18n" id="l_base_url">Twitter's API URL:</label>
<input type="text" name="base_url" style="width: 300px;" validator="required,url" must_restart><br>
<label for="base_oauth_url" class="i18n" id="l_base_oauth_url">OAuth URL:</label>
<input type="text" name="base_oauth_url" style="width: 300px;" validator="required,url" must_restart><br>
<label for="same_signing_urls" class="i18n" id="l_same_signing_urls">Same signing URLs:</label>
<input type="checkbox" name="same_signing_urls"><br>
<label for="base_signing_url" class="i18n" id="l_base_signing_url">API Signing URL:</label>
<input type="text" name="base_signing_url" style="width: 300px;" validator="required,url" must_restart><br>
<label for="base_oauth_signing_url" class="i18n" id="l_base_oauth_signing_url">OAuth Signing URL:</label>
<input type="text" name="base_oauth_signing_url" style="width: 300px;" validator="required,url" must_restart><br>
<label for="base_search_url" class="i18n" id="l_base_search_url">Search API URL:</label>
<input type="text" name="base_search_url" style="width: 300px;" validator="required,url" must_restart><br>
<label for="use_streaming_api" class="i18n" id="l_use_streaming_api">Use streaming API:</label>
<input type="checkbox" name="use_streaming_api" must_restart><br>
<label for="user_stream_url" class="i18n" id="l_user_stream_url">User Stream URL:</label>
<input type="text" name="user_stream_url" style="width: 300px;" validator="required,url" must_restart><br>
</fieldset>
<br>
<div id="buttons_area">
<input type="button" class="i18n" value="Save" id="btn_save" onclick="options.save();">
<input type="button" class="i18n" value="Reset" id="btn_reset" onclick="options.load();">
<input type="button" class="i18n" value="Reset to default" id="btn_default" onclick="options.loadDefaults();">
</div>
</div>
<a class="locales_report" href="locales.html">Locales Report</a>
</body>
</html>