/** @preserve // ==UserScript== // @name AutoReviewComments // @namespace benjol // @version 1.4.3 // @description No more re-typing the same comments over and over! // @homepage https://github.com/Benjol/SE-AutoReviewComments // @grant none // @include /^https?:\/\/(.*\.)?stackoverflow\.com/.*$/ // @include /^https?:\/\/(.*\.)?serverfault\.com/.*$/ // @include /^https?:\/\/(.*\.)?superuser\.com/.*$/ // @include /^https?:\/\/(.*\.)?stackexchange\.com/.*$/ // @include /^https?:\/\/(.*\.)?askubuntu\.com/.*$/ // @include /^https?:\/\/(.*\.)?mathoverflow\.com/.*$/ // @include /^https?:\/\/discuss\.area51\.stackexchange\.com/.*$/ // @include /^https?:\/\/stackapps\.com/.*$/ // @exclude *://chat.stackexchange.com/* // @exclude *://chat.stackoverflow.com/* // @exclude *://chat.meta.stackexchange.com/* // @downloadURL https://update.greasyfork.icu/scripts/36092/AutoReviewComments.user.js // @updateURL https://update.greasyfork.icu/scripts/36092/AutoReviewComments.meta.js // ==/UserScript== */ function with_jquery(f) { var script = document.createElement("script"); script.type = "text/javascript"; script.textContent = "(" + f.toString() + ")(jQuery)"; document.body.appendChild(script); }; with_jquery(function ($) { StackExchange.ready(function () { //// Self Updating Userscript, see https://gist.github.com/Benjol/874058 // (the first line of this template _must_ be a comment!) var VERSION = '1.4.3'; var URL = "https://raw.github.com/Benjol/SE-AutoReviewComments/master/dist/autoreviewcomments.user.js"; // This hack is necessary to bring people up from the last working auto-uptate gist // release if they manually installed the latest version. (can be removed after some // time has passed and last released version is at least 1.3.4) for (var key in window) { if (key.indexOf('selfUpdaterCallback') != -1) { window[key](VERSION); return; } } // End hack if(window["AutoReviewComments_AutoUpdateCallback"]) { window["AutoReviewComments_AutoUpdateCallback"](VERSION); return; } // Split int based version number strings on dots, zero-pad the arrays to the same length and // compare them in order such that true is returned only if the proposted version is newer function isVersionNewer(proposed, current) { proposed = proposed.split("."); current = current.split("."); while (proposed.length < current.length) proposed.push("0"); while (current.length < proposed.length) current.push("0"); for (var i = 0; i < proposed.length; i++) { if (parseInt(proposed[i]) > parseInt(current[i])) { return true; } if (parseInt(proposed[i]) < parseInt(current[i])) { return false; } } return false; } function updateCheck(notifier) { window["AutoReviewComments_AutoUpdateCallback"] = function (newver) { if(isVersionNewer(newver, VERSION)) notifier(newver, VERSION, URL); } $("