Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // ==UserScript==
- // @name Qt Developer Network - Mark Thread As Read
- // @namespace developer.qt.nokia.com/markasread
- // @description Adds a button to mark posts as read without having to open them.
- // @match http://developer.qt.nokia.com/forums/search_results/*
- // @match https://developer.qt.nokia.com/forums/search_results/*
- // @version 0.11
- // ==/UserScript==
- $ = unsafeWindow.jQuery;
- $('.forum_main_wrap').each(function(i) {
- var row = $(this);
- var threadUrl = $('a', row).attr('href');
- var button = $('<button>Mark as read</button>')
- .addClass('jqueryui-button')
- .css('white-space', 'nowrap');
- var buttonDiv = $('<div></div>')
- .addClass('forum_main_right mark_as_read')
- .append(button)
- .hide();
- button.click(function() {
- $(this).attr('disabled', 'disabled');
- $.ajax({
- url: threadUrl,
- cache: false,
- success: function(html) {
- row.fadeOut('fast');
- }
- });
- });
- row.mouseenter(function() { buttonDiv.fadeIn('fast'); });
- row.mouseleave(function() { buttonDiv.fadeOut('fast'); });
- $('.forum_main_body', row).before(buttonDiv);
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement