diff --git a/powerdeletesuite.js b/powerdeletesuite.js new file mode 100644 index 0000000..282bfbb --- /dev/null +++ b/powerdeletesuite.js @@ -0,0 +1,431 @@ +var pdApp; +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.prepDom(); + pdApp.bindUI(); + pdApp.parseSettings(); + } 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(); + } + } + } + }, + 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('