Last active
January 7, 2016 19:40
Revisions
-
mogsdad revised this gist
Jan 7, 2016 . 1 changed file with 1 addition and 2 deletions.There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -4,7 +4,7 @@ // @version 0.2 // @description Display a notice at top of questions with their status wrt close votes. // @author Mogsdad // @include /^https?:\/\/\w*.?(stackoverflow|stackexchange|serverfault|superuser|askubuntu|stackapps)\.com\/(questions|posts|review)\/\d+\/.*/ // @grant none // ==/UserScript== /* jshint -W097 */ @@ -15,7 +15,6 @@ var logoWidth = $('#hlogo').width(); var navWidth = $('#hmenus').width(); var availableWidth = headerWidth - (logoWidth + navWidth); var noticeHolder = $('<div/>').css({'position':'absolute','left':logoWidth + 'px','font-size':'2em','font-weight':'bold','line-height':'75px','width':availableWidth + 'px','text-align':'center'}); $('#hmenus').before(noticeHolder); -
mogsdad revised this gist
Jan 7, 2016 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -4,7 +4,7 @@ // @version 0.2 // @description Display a notice at top of questions with their status wrt close votes. // @author Mogsdad // @include /^https?:\/\/\w*.?(stackoverflow|stackexchange|serverfault|superuser|askubuntu|stackapps)\.com\/(questions|posts|review)\/\d+/* // @grant none // ==/UserScript== /* jshint -W097 */ -
mogsdad revised this gist
Jan 7, 2016 . 1 changed file with 2 additions and 1 deletion.There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -4,7 +4,7 @@ // @version 0.2 // @description Display a notice at top of questions with their status wrt close votes. // @author Mogsdad // @include /^https?:\/\/\w*.?(stackoverflow|stackexchange|serverfault|superuser|askubuntu|stackapps)\.com\/(questions|posts|review)/\d+/* // @grant none // ==/UserScript== /* jshint -W097 */ @@ -15,6 +15,7 @@ var logoWidth = $('#hlogo').width(); var navWidth = $('#hmenus').width(); var availableWidth = headerWidth - (logoWidth + navWidth); console.log('hi'); var noticeHolder = $('<div/>').css({'position':'absolute','left':logoWidth + 'px','font-size':'2em','font-weight':'bold','line-height':'75px','width':availableWidth + 'px','text-align':'center'}); $('#hmenus').before(noticeHolder); -
mogsdad revised this gist
Jan 4, 2016 . 1 changed file with 3 additions and 3 deletions.There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -40,12 +40,12 @@ msg = '<span style="color:green">Needs __more__</span>' .replace("__more__",needsN); } else if ($( ".question-status:contains('deleted')" ).length) { msg = '<span style="color:maroon">Question deleted.</span>'; } else if ($( ".question-status:contains('closed'),.question-status:contains('put on hold')" ).length) { msg = '<span style="color:maroon">Question closed.</span>'; } else { //msg = '<span style="color:green">Nevermind</span>'; } -
mogsdad revised this gist
Jan 2, 2016 . 1 changed file with 2 additions and 1 deletion.There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -37,7 +37,8 @@ } else if ($( ".close-question-link[title~='more']" ).length) { var needsN = $( ".close-question-link" ).attr("title").match(/[\d]+ more/i); msg = '<span style="color:green">Needs __more__</span>' .replace("__more__",needsN); } else if ($( ".question-status:contains('closed'),.question-status:contains('put on hold')" ).length) { msg = '<span style="color:maroon">Question closed.</span>'; -
mogsdad revised this gist
Jan 2, 2016 . 1 changed file with 17 additions and 6 deletions.There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -2,7 +2,7 @@ // @name Close Vote Reminder // @namespace https://gist.github.com/mogsdad/767f8adc04d1d5c732c9 // @version 0.2 // @description Display a notice at top of questions with their status wrt close votes. // @author Mogsdad // @include /^https?://\w*.?(stackoverflow|stackexchange|serverfault|superuser|askubuntu|stackapps)\.com/(questions|posts|review)/\d+/* // @grant none @@ -18,16 +18,26 @@ var noticeHolder = $('<div/>').css({'position':'absolute','left':logoWidth + 'px','font-size':'2em','font-weight':'bold','line-height':'75px','width':availableWidth + 'px','text-align':'center'}); $('#hmenus').before(noticeHolder); $(document).ready(function(){ updateNotice(); }); $(document).ajaxComplete(function () { updateNotice(); }); //$(document).ajaxComplete(function() { function updateNotice() { var msg = ""; if ($( ".close-question-link[title^='You voted']" ).length) { var needsN = $( ".close-question-link" ).attr("title").match(/[\d]+ more/i); msg = '<span style="color:maroon">You voted. (__more__)</span>' .replace("__more__",needsN); } else if ($( ".close-question-link[title~='more']" ).length) { var needsN = $( ".close-question-link" ).attr("title").match(/[\d]+ more/i); msg = '<span style="color:green">Needs '+needsN+'</span>'; } else if ($( ".question-status:contains('closed'),.question-status:contains('put on hold')" ).length) { msg = '<span style="color:maroon">Question closed.</span>'; @@ -39,5 +49,6 @@ //msg = '<span style="color:green">Nevermind</span>'; } noticeHolder.html( msg ); } })(); -
mogsdad revised this gist
Jan 2, 2016 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,6 +1,6 @@ // ==UserScript== // @name Close Vote Reminder // @namespace https://gist.github.com/mogsdad/767f8adc04d1d5c732c9 // @version 0.2 // @description Display a notice at top of questions, showing whether you've already close-voted. // @author Mogsdad -
mogsdad revised this gist
Jan 2, 2016 . 1 changed file with 11 additions and 8 deletions.There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,7 +1,7 @@ // ==UserScript== // @name Close Vote Reminder // @namespace http://thisisnotafish.net/ // @version 0.2 // @description Display a notice at top of questions, showing whether you've already close-voted. // @author Mogsdad // @include /^https?://\w*.?(stackoverflow|stackexchange|serverfault|superuser|askubuntu|stackapps)\.com/(questions|posts|review)/\d+/* @@ -22,18 +22,21 @@ //$(document).ajaxComplete(function() { $(document).ready(function() { var msg = ""; if ($( ".close-question-link[title^='You voted']" ).length) { msg = '<span style="color:maroon">Previously voted.</span>'; } else if ($( ".close-question-link[title~='more']" ).length) { var needsN = $( ".close-question-link" ).attr("title").match(/[\d]+.*votes?/i); msg = '<span style="color:green">'+needsN+'</span>'; } else if ($( ".question-status:contains('closed'),.question-status:contains('put on hold')" ).length) { msg = '<span style="color:maroon">Question closed.</span>'; } else if ($( ".question-status:contains('deleted')" ).length) { msg = '<span style="color:maroon">Question deleted.</span>'; } else { //msg = '<span style="color:green">Nevermind</span>'; } noticeHolder.html( msg ); }); -
mogsdad revised this gist
Jan 1, 2016 . 1 changed file with 3 additions and 3 deletions.There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,10 +1,10 @@ // ==UserScript== // @name Close Vote Reminder // @namespace http://thisisnotafish.net/ // @version 0.1 // @description Display a notice at top of questions, showing whether you've already close-voted. // @author Mogsdad // @include /^https?://\w*.?(stackoverflow|stackexchange|serverfault|superuser|askubuntu|stackapps)\.com/(questions|posts|review)/\d+/* // @grant none // ==/UserScript== /* jshint -W097 */ -
mogsdad revised this gist
Jan 1, 2016 . 1 changed file with 18 additions and 9 deletions.There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,10 +1,11 @@ // ==UserScript== // @name Close Vote Reminder // @namespace https://gist.github.com/mogsdad/767f8adc04d1d5c732c9 // @version 1.0 // @description Display a notice at top of questions, showing whether you've already close-voted. // @author Mogsdad // @include /^https?://\w*.?(stackoverflow|stackexchange|serverfault|superuser|askubuntu|stackapps)\.com/(questions|posts|review)/* // @grant none // ==/UserScript== /* jshint -W097 */ 'use strict'; @@ -18,14 +19,22 @@ var noticeHolder = $('<div/>').css({'position':'absolute','left':logoWidth + 'px','font-size':'2em','font-weight':'bold','line-height':'75px','width':availableWidth + 'px','text-align':'center'}); $('#hmenus').before(noticeHolder); //$(document).ajaxComplete(function() { $(document).ready(function() { var msg = ""; var alreadyvoted = $( ".close-question-link[title^='You voted']" ); //console.log( "alreadyvoted:"+alreadyvoted.length ); var closed = $( ".question-status:contains('put on hold')" ); //console.log( "closed:"+closed.length ); if (alreadyvoted.length) { msg = '<span style="color:maroon">Previously voted.</span>'; } else if (closed.length) { msg = '<span style="color:maroon">Question closed.</span>'; } else { msg = '<span style="color:green">Please vote!</span>'; } noticeHolder.html( msg ); }); })(); -
mogsdad revised this gist
Dec 31, 2015 . 1 changed file with 1 addition and 2 deletions.There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -4,8 +4,7 @@ // @version 0.1 // @description Display a notice at top of questions, showing whether you've already close-voted. // @author Mogsdad // @include /^https?://\w*.?(stackoverflow|stackexchange|serverfault|superuser|askubuntu|stackapps)\.com/(questions|posts|review)/*// @grant none // ==/UserScript== /* jshint -W097 */ 'use strict'; -
mogsdad created this gist
Dec 31, 2015 .There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,32 @@ // ==UserScript== // @name Close Vote Reminder // @namespace http://thisisnotafish.net/ // @version 0.1 // @description Display a notice at top of questions, showing whether you've already close-voted. // @author Mogsdad // @match http*://stackoverflow.com/questions/* // @grant none // ==/UserScript== /* jshint -W097 */ 'use strict'; (function(){ var headerWidth = $('#header').width(); var logoWidth = $('#hlogo').width(); var navWidth = $('#hmenus').width(); var availableWidth = headerWidth - (logoWidth + navWidth); var noticeHolder = $('<div/>').css({'position':'absolute','left':logoWidth + 'px','font-size':'2em','font-weight':'bold','line-height':'75px','width':availableWidth + 'px','text-align':'center'}); $('#hmenus').before(noticeHolder); $(document).ajaxComplete(function() { var alreadyvoted = $( ".close-question-link[title^='You voted']" ); console.log( alreadyvoted.length ); if (alreadyvoted.length) { noticeHolder.html(alreadyvoted.length ? '<span style="color:maroon">Previously voted.</span>' : '<span style="color:green">Please vote!</span>'); //alert( 'You already voted.' ); } }); //<a href="#" class="close-question-link" title="You voted to close as 'too broad'. 2 more votes from other users are needed to close this question." data-questionid="34221041" data-isclosed="false">close <span class="existing-flag-count">3</span></a> })();