forked from cezarsa/silver_bird
-
Notifications
You must be signed in to change notification settings - Fork 1
/
tweets_notifier.html
executable file
·58 lines (48 loc) · 2 KB
/
tweets_notifier.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
<!DOCTYPE html>
<html>
<head>
<script type="text/javascript" src="lib/3rdparty/jquery.js"></script>
<script type='text/javascript' src='lib/3rdparty/jquery.tipsy.js'></script>
<script type="text/javascript" src="lib/any_click.js"></script>
<script type="text/javascript" src="lib/tweet_transforms.js"></script>
<script type="text/javascript" src="lib/timeline_template.js"></script>
<script type="text/javascript" src="lib/tweets_assembler.js"></script>
<link rel="stylesheet" type="text/css" href="css/injectedTweets.css" />
<link rel="stylesheet" type="text/css" href="css/desktopTweets.css" />
<link rel="stylesheet" type="text/css" href="css/tipsy.css" />
<base target="_blank">
<script>
var OptionsBackend = chrome.extension.getBackgroundPage().OptionsBackend;
var urlExpander = chrome.extension.getBackgroundPage().urlExpander;
var tweetManager = chrome.extension.getBackgroundPage().TweetManager.instance;
var ImageService = chrome.extension.getBackgroundPage().ImageService;
chrome.i18n.getMessage = chrome.extension.getBackgroundPage().chrome.i18n.getMessage;
$(function() {
var fadeTimeout = OptionsBackend.get('notification_fade_timeout');
try {
var tweet = tweetManager.injectTweets.shift();
Renderer.setContext('desktop');
$(document.body).prepend(Renderer.renderTweet(tweet, false, OptionsBackend.get('name_attribute')));
} catch(e) {
console.log(e);
window.close();
}
setTimeout(function() {
$("#progress").text(chrome.i18n.getMessage("preventClosing"));
$('#progress').show().css('bottom', '0px').css('width', '100%').
animate({width: '0px'}, fadeTimeout, 'linear', function() {
// Tell manager that this tweet shouldn't be marked as read
tweetManager.shouldNotReadMap[tweet.id] = true;
window.close();
});
$(document.body).click(function() {
$('#progress').stop().hide();
});
}, 100);
});
</script>
</head>
<body>
<div id="progress"></div>
</body>
</html>