Permalink
Browse files

Added loading “news” from gh-pages. Requires new permissions.

  • Loading branch information...
1 parent 08b51a9 commit a688ec18f192db24c8c20c5b2d96563ee8fce706 @swege committed Jul 18, 2013
Showing with 20 additions and 18 deletions.
  1. +4 −1 manifest.json
  2. +5 −0 popup.css
  3. +4 −1 popup.html
  4. +7 −16 popup.js
View
@@ -16,7 +16,10 @@
"permissions": [
"webRequest",
"webRequestBlocking",
- "*://*.facebook.com/*"
+ "*://*.facebook.com/*",
+ "*://swege.github.com/*",
+ "*://swege.github.io/*"
+ // "*://localhost/*"
],
"browser_action": {
"default_icon": "icon48.png",
View
@@ -1,3 +1,8 @@
body {
width: 200px;
}
+
+a:focus, a:active {
+ border: none;
+ outline: none;
+}
View
@@ -4,9 +4,12 @@
<title>Quick disable</title>
<link rel="stylesheet" type="text/css" href="popup.css">
<script src="fancy-settings/source/lib/store.js"></script>
- <script src="http://swege.github.io/fb-unseen/popup.js"></script>
+ <script src="jquery.js"></script>
<script src="popup.js"></script>
</head>
<body>
+ <div id="message"></div>
+ <hr />
+ <div id="news"></div>
</body>
</html>
View
@@ -17,7 +17,6 @@ document.addEventListener('DOMContentLoaded', function() {
// TODO
// 'block_group_seen': false
})
- var p = document.createElement('p');
if (settings.get('block_chat_seen')) {
chrome.browserAction.setIcon({path: 'icon48.disabled.png'})
settings.set('block_chat_seen', false)
@@ -29,20 +28,12 @@ document.addEventListener('DOMContentLoaded', function() {
_gaq.push(['_trackEvent', 'Popup', 'quickToggle', 'enabled'])
var text = document.createTextNode('FB unseen enabled. Your friends will not be notified when you read their messages.')
}
- p.appendChild(text);
- p.appendChild(document.createElement('hr'))
- div = document.createElement('div');
- var external_html = external_html || ''
- div.innerHTML = external_html;
- p.appendChild(div);
- document.body.appendChild(p);
+ $('#message').html(text);
- var small = document.createElement('small');
- var a = document.createElement('a');
- var text = document.createTextNode('Support me?')
- a.appendChild(text);
- a.href = 'http://swege.github.io/fb-unseen/support.html'
- a.target = '_blank'
- small.appendChild(a);
- document.body.appendChild(small);
+ $.get('http://swege.github.io/fb-unseen/popup_news.html', function(data) {
+ $('#news').html(data);
+ $('#news a').click(function() {
+ _gaq.push(['_trackEvent', 'Popup', 'newsLinkClicked', $(this).text() + ' - ' + $(this).attr('href')]);
+ });
+ });
})

0 comments on commit a688ec1

Please sign in to comment.