From 0bf9cd8b2576f2fac025668ec90dea0c35884b5f Mon Sep 17 00:00:00 2001 From: M-- Date: Mon, 5 May 2025 03:05:59 -0400 Subject: [PATCH] Change the target room temporarily * Temporarily change the target room Addresses https://github.com/SO-Close-Vote-Reviewers/UserScripts/issues/160 * Refactoring the changes: Refactoring to follow the same coding convention as the rest of the script Removing default room selection from temp room dropdown --- SECloseVoteRequestGenerator.user.js | 43 +++++++++++++++++++++++++++-- 1 file changed, 40 insertions(+), 3 deletions(-) diff --git a/SECloseVoteRequestGenerator.user.js b/SECloseVoteRequestGenerator.user.js index 0e9e25e..03a6a35 100644 --- a/SECloseVoteRequestGenerator.user.js +++ b/SECloseVoteRequestGenerator.user.js @@ -1,7 +1,7 @@ // ==UserScript== -// @name Stack Exchange CV Request Generator +// @name _Stack Exchange CV Request Generator // @namespace https://github.com/SO-Close-Vote-Reviewers/ -// @version 2.0.4 +// @version 2.1.0 // @description This script generates formatted close-/delete-/reopen-/undelete-vote requests, spam/offensive flag requests, Smoke Detector reports, and approve-/reject-pls requests for suggested edits, then sends them to a specified chat room. // @author @TinyGiant @Makyen // @contributor @rene @Tunaki @@ -1000,6 +1000,14 @@ callback = function() {}; // eslint-disable-line no-empty-function } RoomList.getRoom(function(room) { + //Temporary target room if selected + var tempRoomUrl = $('#cvrgTempTargetRoom').val(); + if (tempRoomUrl) { + var tempRoom = RoomList.url(tempRoomUrl); + if (tempRoom) { + room = tempRoom; + } + } function displayRequestText(requestText, message) { message += '' + '

' + @@ -1736,6 +1744,10 @@ ' opacity: .4;' + ' pointer-events: none;' + ' }' + + ' .cvrgTempRoomSelect {' + + ' margin-left: 5px;' + + ' margin-top: 10px;' + + ' }' + ' .cvrgCVPopupSDAndNatoWithFake {' + ' display: inline-block;' + ' position: relative;' + @@ -1813,6 +1825,12 @@ ' NATO' + ' ' + ' ' + + '
' + + ' Temporary Target Room: ' + + ' ' + + '
' + ' ' + '