From 2b9f9fcd0e59bd8331c962807ecbbab754664987 Mon Sep 17 00:00:00 2001 From: Kerrick Long Date: Thu, 14 Jul 2011 09:48:22 -0500 Subject: [PATCH] Stale posts can now be shown without changing preferences. --- js/common.js | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/js/common.js b/js/common.js index c787235..9f5a4e4 100644 --- a/js/common.js +++ b/js/common.js @@ -642,7 +642,7 @@ Popup.prototype.createListHTML = function (url) { listHTML += '' if (staleCounter > 0) { - listHTML += '
Hiding ' + staleCounter.toString() + ' stale posts. Visit the options page to change your Fresh Content preferences.
'; + listHTML += '
Hiding ' + staleCounter.toString() + ' stale posts. Show them now, or visit the options page to change your Fresh Content preferences.
'; } return listHTML; @@ -659,3 +659,20 @@ Popup.prototype.createListHTML = function (url) { Popup.prototype.createSubmitForm = function (url) { return 'Submit form not yet programmed.'; } + +/** + * Show stale posts. + * @alias Popup.showStalePosts() + * @return {Boolean} Returns true. + * @method + */ +Popup.prototype.showStalePosts = function () { + var stalePosts; + + stalePosts = document.getElementsByClassName('stale'); + document.getElementById('information').innerHTML = 'Showing stale posts. Visit the options page to change your Fresh Content preferences.'; + + while (stalePosts.length > 0) { + stalePosts[0].className = 'stale-shown'; + } +};