From f93c5667476b108a71016285ef091f41e46c7c6d Mon Sep 17 00:00:00 2001 From: Caleb Maclennan Date: Sat, 26 Jul 2014 22:30:19 +0300 Subject: [PATCH 1/4] fix for targeted dom element that changed upstream Thanks to @IzzySoft for tracking down the change. Fixes #55. --- src/autoreviewcomments.user.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/autoreviewcomments.user.js b/src/autoreviewcomments.user.js index 4fbc911..98c4c59 100644 --- a/src/autoreviewcomments.user.js +++ b/src/autoreviewcomments.user.js @@ -457,7 +457,7 @@ with_jquery(function ($) { //This is where the real work starts - add the 'auto' link next to each comment 'help' link //use most local root-nodes possible (have to exist on page load) - #questions is for review pages $("#content").delegate(".comments-link", "click", function () { - var divid = $(this).attr('id').replace('-link', ''); + var divid = $(this).parent().attr('id').replace('-link', ''); var posttype = $(this).parents(".question, .answer").attr("class").split(' ')[0]; //slightly fragile if($('#' + divid).find('.comment-auto-link').length > 0) return; //don't create auto link if already there From 066fe87a8f9756b31a844d6210bbcdb519403afb Mon Sep 17 00:00:00 2001 From: Caleb Maclennan Date: Sat, 26 Jul 2014 22:36:49 +0300 Subject: [PATCH 2/4] bump version number to v1.3.3.3 for hotfix release Jumping to v1.3.3.3 even though the master branch is still sporting v1.3.3 because the Firefox extension release used v1.3.3.1 and the Chrome store extension release is past that at v1.3.3.2. --- build.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.properties b/build.properties index 83db80f..fef43fa 100644 --- a/build.properties +++ b/build.properties @@ -1,5 +1,5 @@ @ant-name@=AutoReviewComments @ant-description@=No more re-typing the same comments over and over! -@ant-version@=1.3.3 +@ant-version@=1.3.3.3 @ant-homepage@=https://github.com/Benjol/SE-AutoReviewComments @ant-author@=Benjol From 4252896167ddce8c7cc3fadb961055403cc6affd Mon Sep 17 00:00:00 2001 From: Caleb Maclennan Date: Sat, 26 Jul 2014 22:39:57 +0300 Subject: [PATCH 3/4] add pre-built userscript for v1.3.3.3 --- dist/autoreviewcomments.min.user.js | 6 +++--- dist/autoreviewcomments.user.js | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/dist/autoreviewcomments.min.user.js b/dist/autoreviewcomments.min.user.js index 2aff7f8..1b17f69 100644 --- a/dist/autoreviewcomments.min.user.js +++ b/dist/autoreviewcomments.min.user.js @@ -3,7 +3,7 @@ // ==UserScript== // @name AutoReviewComments // @namespace benjol -// @version 1.3.3 +// @version 1.3.3.3 // @description No more re-typing the same comments over and over! // @homepage https://github.com/Benjol/SE-AutoReviewComments // @grant none @@ -62,12 +62,12 @@ c),b.append(c)}Q(a);ba(a)}function ba(a){a.find("label > span").dblclick(functio function Q(a){a=a.find("ul.action-list li:not(.action-selected) span[id*='desc-']");"hide"==f("hide-desc")?a.hide():a.show()}function H(a,b,d,c){d=d.replace(/\n/g,"
");b=e(ca.replace("$TITLE$",b).replace("$BODY$",d));b.find(".notify-close").click(function(){e(this).parent().fadeOutAndRemove();c()});a.find("h2").before(b)}function da(a,b,d){e.ajax({type:"GET",url:a+"?jsonp=?",dataType:"jsonp",jsonpCallback:"callback",timeout:2E3,success:b,error:d,async:!1})}function R(a,b,d){da(a,function(a){h("commentcount", a.length);p("name-");p("desc-");e.each(a,function(a,b){h("name-"+a,b.name);h("desc-"+a,D(b.description))});b()},d)}function ea(a){var b=a.find("#remote-popup"),d=b.find("#remoteerror1"),c=b.find("#remoteurl"),e=b.find("#remoteauto"),g=b.find("#throbber1");a.find(".popup-actions-remote").click(function(){c.val(f("RemoteUrl"));e.prop("checked","true"==f("AutoRemote"));b.show()});a.find(".remote-cancel").click(function(){g.hide();d.text("");b.hide()});a.find(".remote-save").click(function(){h("RemoteUrl", c.val());h("AutoRemote",e.prop("checked"));b.hide()});a.find(".remote-get").click(function(){g.show();R(c.val(),function(){s(a);g.hide()},function(a,b){d.text(b)})})}function fa(a){var b=a.find("#welcome-popup"),d=b.find("#customwelcome");a.find(".popup-actions-welcome").click(function(){d.val(q);b.show()});a.find(".welcome-cancel").click(function(){b.hide()});a.find(".welcome-force").click(function(){u=!0;s(a);b.hide()});a.find(".welcome-save").click(function(){var a=""==d.val()?"NONE":d.val();h("WelcomeMessage", -a);q=d.val();b.hide()})}var v="1.3.3",F="https://raw.github.com/Benjol/SE-AutoReviewComments/master/dist/autoreviewcomments.user.js",n;for(n in window)if(-1!=n.indexOf("selfUpdaterCallback")){window[n](v);return}if(window.AutoReviewComments_AutoUpdateCallback)window.AutoReviewComments_AutoUpdateCallback(v);else{var w=window.location.hostname;n=document.title.split(" - ");var m=n[n.length-1],B="user",S="OP",A="AutoReviewComments-",z;z=document.getElementsByClassName("profile-me")[0].href.match(/\/users\/(\d+)\/.*/i)? +a);q=d.val();b.hide()})}var v="1.3.3.3",F="https://raw.github.com/Benjol/SE-AutoReviewComments/master/dist/autoreviewcomments.user.js",n;for(n in window)if(-1!=n.indexOf("selfUpdaterCallback")){window[n](v);return}if(window.AutoReviewComments_AutoUpdateCallback)window.AutoReviewComments_AutoUpdateCallback(v);else{var w=window.location.hostname;n=document.title.split(" - ");var m=n[n.length-1],B="user",S="OP",A="AutoReviewComments-",z;z=document.getElementsByClassName("profile-me")[0].href.match(/\/users\/(\d+)\/.*/i)? RegExp.$1:"";"Stack Exchange"==m&&(m=n[n.length-2]);m=m.replace(/ ?Stack Exchange/,"");f("WelcomeMessage")||h("WelcomeMessage","Welcome to "+m+"! ");var q="NONE"==f("WelcomeMessage")?"":f("WelcomeMessage"),u=!1,ca='
x $TITLE$ $BODY$
', aa='
  • ',P=[{Name:"Answers just to say Thanks!",Description:'Please don\'t add "thanks" as answers. Invest some time in the site and you will gain sufficient privileges to upvote answers you like, which is the $SITENAME$ way of saying thank you.'}, {Name:"Nothing but a URL (and isn't spam)",Description:'Whilst this may theoretically answer the question, it would be preferable to include the essential parts of the answer here, and provide the link for reference.'},{Name:"Requests to OP for further information",Description:"This is really a comment, not an answer. With a bit more rep, you will be able to post comments. For the moment I've added the comment for you, and I'm flagging this post for deletion."}, {Name:"OP using an answer for further information",Description:"Please use the Post answer button only for actual answers. You should modify your original question to add additional information."},{Name:"OP adding a new question as an answer",Description:'If you have another question, please ask it by clicking the Ask Question button.'},{Name:"Another user adding a 'Me too!'",Description:'If you have a NEW question, please ask it by clicking the Ask Question button. If you have sufficient reputation, you may upvote the question. Alternatively, "star" it as a favorite and you will be notified of any new answers.'}], -M="Sunday Monday Tuesday Wednesday Thursday Friday Saturday".split(" "),I=60,J=3600,K=86400,L=518400,x=604800,r=2592E3,y=31536E3;e("#content").delegate(".comments-link","click",function(){var a=e(this).attr("id").replace("-link",""),b=e(this).parents(".question, .answer").attr("class").split(" ")[0];if(!(0 | ').add(e('auto').click(function(){var c=e(''); +M="Sunday Monday Tuesday Wednesday Thursday Friday Saturday".split(" "),I=60,J=3600,K=86400,L=518400,x=604800,r=2592E3,y=31536E3;e("#content").delegate(".comments-link","click",function(){var a=e(this).parent().attr("id").replace("-link",""),b=e(this).parents(".question, .answer").attr("class").split(" ")[0];if(!(0 | ').add(e('auto').click(function(){var c=e(''); c.find(".popup-close").click(function(){c.fadeOutAndRemove()});c.posttype=b;u=!1;s(c);c.find(".popup-actions-cancel").click(function(){c.fadeOutAndRemove()});c.find(".popup-actions-reset").click(function(){O();s(c)});c.find(".popup-actions-see").hover(function(){c.fadeTo("fast","0.4").children().not("#close").fadeTo("fast","0.0")},function(){c.fadeTo("fast","1.0").children().not("#close").fadeTo("fast","1.0")});c.find(".popup-actions-impexp").click(function(){Z(c)});c.find(".popup-actions-toggledesc").click(function(){var a= f("hide-desc")||"show";h("hide-desc","show"==a?"hide":"show");Q(c)});ea(c);fa(c);c.find(".popup-submit").click(function(){var b=c.find("input:radio:checked"),b=C(b.parent().find(".action-desc").html()).replace(/\[username\]/g,B).replace(/\[OP\]/g,S);e("#"+a).find("textarea").val(b).focus();b=b.indexOf("[type here]");0<=b&&e("#"+a).find("textarea")[0].setSelectionRange(b,b+11);c.fadeOutAndRemove()});if(!window.VersionChecked&&"true"==f("AutoRemote")){var d=c.find("#throbber2"),g=c.find("#remoteerror2"); d.show();R(f("RemoteUrl"),function(){s(c);d.hide()},function(a,b){g.text(b)})}e("#"+a).append(c);c.center();StackExchange.helpers.bindMovablePopups();var k=V(e(this));X(k,c);S=W();"function"!=typeof G||window.VersionChecked||(G(c),window.VersionChecked=!0)}));setTimeout(function(){e("#"+a).find(".comment-help-link").parent().append(d)},15)}})}})}); diff --git a/dist/autoreviewcomments.user.js b/dist/autoreviewcomments.user.js index 47e810f..651e373 100644 --- a/dist/autoreviewcomments.user.js +++ b/dist/autoreviewcomments.user.js @@ -2,7 +2,7 @@ // ==UserScript== // @name AutoReviewComments // @namespace benjol -// @version 1.3.3 +// @version 1.3.3.3 // @description No more re-typing the same comments over and over! // @homepage https://github.com/Benjol/SE-AutoReviewComments // @grant none @@ -56,7 +56,7 @@ 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.3.3'; +var VERSION = '1.3.3.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 @@ -552,7 +552,7 @@ function CheckForNewVersion(popup) { //This is where the real work starts - add the 'auto' link next to each comment 'help' link //use most local root-nodes possible (have to exist on page load) - #questions is for review pages $("#content").delegate(".comments-link", "click", function () { - var divid = $(this).attr('id').replace('-link', ''); + var divid = $(this).parent().attr('id').replace('-link', ''); var posttype = $(this).parents(".question, .answer").attr("class").split(' ')[0]; //slightly fragile if($('#' + divid).find('.comment-auto-link').length > 0) return; //don't create auto link if already there From b18b5453d67dd6844f915435b75097beaca2ba11 Mon Sep 17 00:00:00 2001 From: Caleb Maclennan Date: Sat, 26 Jul 2014 23:03:12 +0300 Subject: [PATCH 4/4] update readme for latest releases --- README.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/README.md b/README.md index 3478d23..ccaa170 100644 --- a/README.md +++ b/README.md @@ -71,6 +71,12 @@ For more information about user scripts, check out the [tag:script] tag wiki [he (See comments and answers below for details) +**V1.3.3.3** - Hotfix release to adjust for change in Stack Exchange site code that broke this script. + +**V1.3.3.2** - Google Chrome Store realease bumped version number in 'official' release to be newer than the version under the user-contributed account. + +**V1.3.3.1** - First fully reviewed and approved Mozilla Add-Ons release. + **V1.3.3** - 'Service' release to correct the auto-update script (which was 'broken' by having changed script location). Also now supports updating the minified version of the script. **V1.3.2** - New $MYUSERID$ placeholder from [Izzy][51], will be replaced with your user id for the current site. Also, under the covers this version contains all the scaffolding necessary for building browser extensions (hat-tip to Caleb and Oliver Salzburg who did all the heavy lifting)