diff --git a/powerdeletesuitealpha.js b/powerdeletesuitealpha.js deleted file mode 100644 index e4e49e6..0000000 --- a/powerdeletesuitealpha.js +++ /dev/null @@ -1,353 +0,0 @@ -var pdApp = { - version: '1.2.0', - init : function() { - /* version alerts */ - pdApp.prevRunVersion = localStorage.getItem('pd_ver') ? localStorage.getItem('pd_ver') : '0'; - localStorage.setItem('pd_ver',pdApp.version); - if (pdApp.version !== pdApp.prevRunVersion) { - if (confirm('You\'ve gotten the latest update! You are now running PowerDeleteSuite v'+pdApp.version+'. Would you like to open the changelog in a new tab?')) { - window.open('https://www.reddit.com/r/PowerDeleteSuite/'); - } - } - - if (window.pd_processing !== true) { - document.title = $('#header-bottom-right .user a').first().text()+' | Power Delete Suite'; - console.log('init'); - 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(); - } 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/me'; - } - } - setTimeout(pdApp.helpers.restoreSettings,500); - return pdApp.version; - } else { - return 'PowerDeleteSuite is already running'; - } - }, - setup: { - prepDom: function () { - $('.sitetable,.neverEndingReddit').remove(); - $('#pd__central,#pd__style').remove(''); /*Debugging*/ - if ($('#pd__central').length === 0) { - $('body>.content[role=\'main\']').append('
'); - } - if ($('#pd__style').length === 0) { - $('head').first().append(''); - } - pdApp.setup.prepStyles(); - pdApp.setup.prepCentral(); - }, - prepStyles: function () { - $.ajax({ - url: 'https://www.reddit.com/r/PowerDeleteSuite/about/stylesheet/.json', - context: $('#pd__style') - }).then(function(data) { - $(this)[0].innerHTML = data.data.stylesheet; - $('#pd__central').show(); - }, function() { - alert('Error retreiving CSS from /r/PowerDeleteSuite'); - }); - }, - prepCentral: function () { - $.ajax({ - url: 'https://www.reddit.com/r/PowerDeleteSuite/wiki/centralform.json', - context: $('#pd__central') - }).then(function(data) { - $(this).html($("").html(data.data.content_md).text()); - if ($('#pd__stlye').html() === '') { - $(this).hide(); - } - $(this).find('h2').first().text('Power Delete Suite v'+pdApp.version); - pdApp.setup.prepSubs(); - pdApp.setup.bindUI(); - }, function() { - alert('Error retreiving markup from /r/PowerDeleteSuite'); - }); - }, - prepSubs: function () { - var sub_arr = [], i, sid; - $('#per-sr-karma tbody th').each(function () { - sub_arr.push($(this).text()); - }); - sub_arr = sub_arr.sort(function (a, b) { - return a.toLowerCase().localeCompare(b.toLowerCase()); - }); - $('#pd__sub-list').append(''); - for (i=0;iCompleted after making '+pdApp.process.ajaxCalls+' calls to the reddit servers.
'+ - (pdApp.process.edited > 0 ? 'If you need to re run the script, just click the bookmarklet again!
' - ); - document.title = $('#header-bottom-right .user a').first().text()+' | Power Delete Suite'; - } - }, - filters: {}, -}; -pdApp.init();