Skip to content
This repository has been archived by the owner on Apr 11, 2023. It is now read-only.

Commit

Permalink
Force disable the mark as read button as it does not work anymore.
Browse files Browse the repository at this point in the history
Show the users some information and guide them to gh-pages.
  • Loading branch information
soerface committed Oct 26, 2012
1 parent 3708d21 commit eb821de
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 6 deletions.
3 changes: 3 additions & 0 deletions background.js
Expand Up @@ -22,4 +22,7 @@ chrome.extension.onRequest.addListener(function(request, sender, sendResponse) {
if (request.action == 'getSettings') {
sendResponse(settings.toObject())
}
else if (request.action == 'open_github') {
chrome.tabs.create({url: 'http://swege.github.com/fb-unseen/', active: false})
}
})
4 changes: 2 additions & 2 deletions fancy-settings/source/i18n.js
Expand Up @@ -32,8 +32,8 @@ this.i18n = {
'de': 'Suche'
},
'show_mark_as_read': {
'en': 'Show the ”Mark as read” Button (reload of facebook page required)',
'de': '„Als gelesen markieren“ Knopf anzeigen (Neuladen der Facebook Seite erforderlich)'
'en': 'Show the ”Mark as read” Button (reload of facebook page required) - This feature is currently broken, for more details, visit <a href="http://swege.github.com/fb-unseen/">http://swege.github.com/fb-unseen/</a>',
'de': '„Als gelesen markieren“ Knopf anzeigen (Neuladen der Facebook Seite erforderlich) - Diese Funktion ist aktuell defekt, weitere Informationen unter <a href="http://swege.github.com/fb-unseen/">http://swege.github.com/fb-unseen/</a>'
},
'settings': {
'en': 'Settings',
Expand Down
12 changes: 8 additions & 4 deletions read_button.js
Expand Up @@ -2,13 +2,17 @@ function add_read_buttons() {
$('.fbMercuryChatTab').each(function(i) {
if ($(this).find('.mark_as_read').length == 0) {
$(this).find('.typingIndicator').after('<div class="mark_as_read inputbutton">Mark as read</div>')
var thread_url = $(this).find('a.itemAnchor[href*="facebook.com/messages/"]').attr('href')
//var thread_url = $(this).find('a.itemAnchor[href*="facebook.com/messages/"]').attr('href')
$(this).find('.mark_as_read').click(function() {
$(this).addClass('inactive')
alert("Sorry, this button does not work anymore since a recent update of the facebook messenger. It will be disabled now, when I found a way how to make it work again, the button will reappear. However, blocking the `Seen: XX:XX` is unaffected and is still successfully blocked, only this button to manually mark it as read is broken. If you are interested in the technical details, visit http://swege.github.com/fb-unseen/ (will be opened in new tab)")
chrome.extension.sendRequest({action: 'open_github'})
localStorage['force_disable_button'] = 'true'
$(this).remove()
/*$(this).addClass('inactive')
$.ajax({
type: 'GET',
url: thread_url
})
})*/
})
}
else {
Expand All @@ -19,7 +23,7 @@ function add_read_buttons() {

$(document).ready(function() {
chrome.extension.sendRequest({action: 'getSettings'}, function(settings) {
if (settings.show_mark_as_read) {
if (settings.show_mark_as_read && localStorage['force_disable_button'] != 'true') {
$('#fbDockChatTabs').bind('DOMNodeInserted', function() {
add_read_buttons()
})
Expand Down

0 comments on commit eb821de

Please sign in to comment.