// ==UserScript== // @name Stack Exchange Deleted Question Viewer // @version 1.3.65535.0 // @description Allows you to view some deleted questions on Stack Exchange. // @namespace http://jeremybanks.ca/ // @include http://stackoverflow.com/questions/* // @include http://*.stackoverflow.com/questions/* // @include http://superuser.com/questions/* // @include http://*.superuser.com/questions/* // @include http://serverfault.com/questions/* // @include http://*.serverfault.com/questions/* // @include http://stackexchange.com/questions/* // @include http://*.stackexchange.com/questions/* // @include http://answers.onstartups.com/questions/* // ==/UserScript== ; var inject; var __hasProp = Object.prototype.hasOwnProperty; inject = function(f) { var script; script = document.createElement('script'); script.textContent = "(" + f + ")();"; return document.body.appendChild(script); }; inject(function() { var answerFrame, continueWithjQuery, markdownLoaded, start; start = function() { var script; if (!(location.pathname.match(/^\/questions\/\d+[\/$]/) && document.title.match(/^Page Not Found - /) && document.querySelector(".revision-comment"))) { return; } console.log('Deleted question detected, attempting to retrieve...'); if (typeof $ !== "undefined" && $ !== null) { return continueWithjQuery(); } else { script = document.createElement('script'); script.src = 'http://ajax.googleapis.com/ajax/libs/jquery/1.5.2/jquery.min.js'; script.addEventListener('load', continueWithjQuery); return document.body.appendChild(script); } }; markdownLoaded = void 0; answerFrame = null; continueWithjQuery = function() { var submitForm; submitForm = function(url, data, method) { var addData, form; if (method == null) method = 'POST'; form = $('
').attr({ method: method, action: url }).css({ display: 'none' }); addData = function(name, data) { var key, value, _i, _len; if ($.isArray(data)) { for (_i = 0, _len = data.length; _i < _len; _i++) { value = data[_i]; addData("" + name + "[]", value); } } else if (typeof value === 'object') { for (key in data) { if (!__hasProp.call(data, key)) continue; value = data[key]; addData("" + name + "[" + key + "]", value); } } else { form.append($('').attr({ type: 'hidden', name: String(name), value: String(data) })); } return; }; addData('', data); return form.appendTo('body').submit(); }; return submitForm("/questions/" + (location.pathname.match(/^\/questions\/(\d+)[\/$]/)[1]) + "/answer/submit", { 'post-text': 'Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.', 'display-name': 'nobody', 'm-address': 'example@example.com', 'home-page': 'http://example.com/' }); }; return start(); });