From 49ff3bfe3eb3cf7e8401f0e30a3334f8d4bdad39 Mon Sep 17 00:00:00 2001 From: j0be Date: Mon, 30 Jan 2017 17:39:26 -0500 Subject: [PATCH] Allowing for versioning alerts on the bookmarklet --- bookmarklet.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bookmarklet.js b/bookmarklet.js index 4fa147e..902cc90 100644 --- a/bookmarklet.js +++ b/bookmarklet.js @@ -1 +1 @@ -javascript:(function () {$.ajax({url: 'https://raw.githubusercontent.com/j0be/PowerDeleteSuite/master/powerdeletesuite.js' }).then(function(data) {var str = ''; if ($('#pd-script').length === 0) {$('head').append(str); } else {$('#pd-script').replaceWith(str); } }, function() {alert('Error retreiving PowerDeleteSuite from github'); }); })(); +javascript:(function() {window.bookmarkver = '1.1'; if (document.location.hostname.split('.').slice(-2).join('.') == 'reddit.com' && typeof $ !== 'undefined') {$.ajax({url: 'https://raw.githubusercontent.com/j0be/PowerDeleteSuite/master/powerdeletesuite.js'}).then(function(data) {var str = ''; if ($('#pd-script').length === 0) {$('head').append(str); } else {$('#pd-script').replaceWith(str); } }, function() {alert('Error retreiving PowerDeleteSuite from github'); }); } else {if(confirm('This script is designed to be run from your user profile on reddit. Would you like to go there now?')) {document.location = 'http://reddit.com/u/me'; } } })();