From 45cafcd2898831be6432d3ee4c1daff587a05cbf Mon Sep 17 00:00:00 2001 From: j0be Date: Thu, 12 Jan 2017 14:46:32 -0500 Subject: [PATCH] Getting to V1.1 in alpha --- powerdeletesuitealpha.js | 369 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 369 insertions(+) diff --git a/powerdeletesuitealpha.js b/powerdeletesuitealpha.js index 8b13789..d4939d9 100644 --- a/powerdeletesuitealpha.js +++ b/powerdeletesuitealpha.js @@ -1 +1,370 @@ +var pdApp = { + init: function () { + document.title = $('#header-bottom-right .user a').first().text()+' | Power Delete Suite'; + console.log('init'); + if (window.pd_processing !== true) { + if (document.location.href.match('/user/') && $('.titlebox h1').first().text() === $('#header-bottom-right .user a').first().text()) { + pdApp.config = { + uh : $('#config').innerHTML ? + $('#config').innerHTML.replace(/.*?modhash.{1}: .{1}/,'').replace(/[^a-z0-9].*/,'') : + $('#config')[0].innerHTML.replace(/.*?modhash.{1}: .{1}/,'').replace(/[^a-z0-9].*/,''), + user : $('#header-bottom-right .user a').first().text() + }; + pdApp.setup.prepDom(); + pdApp.getSettings(); + } else { + if (confirm('This script is designed to be run from your own user profile. Would you like to navigate there?')) { + document.location = 'http://reddit.com/u/'+ $('#header-bottom-right .user a').first().text(); + } + } + } + }, + setup: { + prepDom: function () { + $('.sitetable,.neverEndingReddit').remove(); + $('#pd__central,#pd__style').html(''); /*Debugging*/ + if ($('#pd__central').length === 0) { + $('body>.content[role=\'main\']').append('
'); + } + if ($('#pd__style').length === 0) { + $('head').first().append('