HTTPS and sync bookmark versions

This commit is contained in:
Ronald Troyer 2019-12-30 16:43:56 -05:00
parent f181cc9724
commit 2e19d46f81
2 changed files with 13 additions and 13 deletions

View file

@ -15,7 +15,7 @@ javascript: (function() {
alert('Error retreiving PowerDeleteSuite from github'); alert('Error retreiving PowerDeleteSuite from github');
}); });
} else if (confirm('This script can only be run from your own user profile on reddit. Would you like to go there now?')) { } else if (confirm('This script can only be run from your own user profile on reddit. Would you like to go there now?')) {
document.location = 'http://old.reddit.com/u/me/overview'; document.location = 'https://old.reddit.com/u/me/overview';
} else { } else {
alert('Please go to your reddit profile before running this script'); alert('Please go to your reddit profile before running this script');
} }

View file

@ -1,6 +1,6 @@
var pd = { var pd = {
version: '1.4.8', version: '1.4.8',
bookmarkver: '1.3', bookmarkver: '1.4',
init : function() { init : function() {
pd.checks.versions(); pd.checks.versions();
if (window.pd_processing !== true) { if (window.pd_processing !== true) {
@ -10,8 +10,8 @@ var pd = {
pd.setup.basicSettings(); pd.setup.basicSettings();
pd.setup.applyDom(); pd.setup.applyDom();
} else { } else {
if (confirm('This script is designed to be run from your own user profile. Would you like to navigate there?')) { if (confirm('This script can only be run from your own user profile on reddit. Would you like to go there now?')) {
document.location = 'http://old.reddit.com/u/me/overview'; document.location = 'https://old.reddit.com/u/me/overview';
} }
} }
} }
@ -21,7 +21,7 @@ var pd = {
function checkBookmarkletVersion() { function checkBookmarkletVersion() {
if (typeof window.bookmarkver === 'undefined' || window.bookmarkver !== pd.bookmarkver) { if (typeof window.bookmarkver === 'undefined' || window.bookmarkver !== pd.bookmarkver) {
if (confirm('There\'s been an update to the bookmarklet. Would you like to go to the Github repo in order to get the latest version?')) { if (confirm('There\'s been an update to the bookmarklet. Would you like to go to the Github repo in order to get the latest version?')) {
alert('Scroll down to the "Install PowerDeleteSuite" button on the github page. Replace your CURRENT bookmark with the one found there to upgrade.'); alert('Sadly, there]\'s no way to automatically update the bookmark. :/\nScroll down to the "Install PowerDeleteSuite" button on the github page. Replace your CURRENT bookmark with the one found there to install the latest bookmark.');
document.location.href = 'https://github.com/j0be/PowerDeleteSuite'; document.location.href = 'https://github.com/j0be/PowerDeleteSuite';
return false; return false;
} }
@ -34,9 +34,9 @@ var pd = {
if (pd.version !== pd.prevRunVersion) { if (pd.version !== pd.prevRunVersion) {
if (confirm('You\'ve gotten the latest update! You are now running PowerDeleteSuite v'+pd.version+'. Would you like to open the changelog in a new tab?')) { if (confirm('You\'ve gotten the latest update! You are now running PowerDeleteSuite v'+pd.version+'. Would you like to open the changelog in a new tab?')) {
$.ajax({url: '/r/PowerDeleteSuite/new.json'}).then(function(data) { $.ajax({url: '/r/PowerDeleteSuite/new.json'}).then(function(data) {
window.open('http://reddit.com'+data.data.children[0].data.permalink); window.open('https://reddit.com'+data.data.children[0].data.permalink);
}, function() { }, function() {
window.open('http://reddit.com/r/PowerDeleteSuite'); window.open('https://reddit.com/r/PowerDeleteSuite');
}); });
} }
} }
@ -454,8 +454,8 @@ var pd = {
str += pd.helpers.csvCell(pd.helpers.csvEscape(item.data.title ? item.data.title : '')); str += pd.helpers.csvCell(pd.helpers.csvEscape(item.data.title ? item.data.title : ''));
str += pd.helpers.csvCell(pd.helpers.csvEscape(item.data.body ? item.data.body : (item.data.selftext ? item.data.selftext : ''))); str += pd.helpers.csvCell(pd.helpers.csvEscape(item.data.body ? item.data.body : (item.data.selftext ? item.data.selftext : '')));
str += pd.helpers.csvCell(item.data.permalink ? str += pd.helpers.csvCell(item.data.permalink ?
'http://reddit.com'+item.data.permalink : 'https://reddit.com'+item.data.permalink :
'http://reddit.com/r/'+item.data.subreddit+'/comments/'+(item.data.link_id.replace(/^t\d_/,''))+'/x/'+item.data.id+'?context=3' 'https://reddit.com/r/'+item.data.subreddit+'/comments/'+(item.data.link_id.replace(/^t\d_/,''))+'/x/'+item.data.id+'?context=3'
); );
str+= pd.helpers.csvCell(item.data.score); str+= pd.helpers.csvCell(item.data.score);
str+= pd.helpers.csvCell(item.data.created_utc); str+= pd.helpers.csvCell(item.data.created_utc);