Skip to content

Commit b305977

Browse files
committedOct 19, 2020
v2.7.0 merge
* Fix bugs in various features (thanks @double-beep for many of these!) * Add feature to copy markdown for comments * Add feature to add scrolling to room list in usercards in chat * Only run SOX on HTTPS * Deprecate "add timeline button" feature (now natively implemented! * Deprecate "show question state in suggested edit review queue" (now native!)
2 parents 3ddb4a7 + 6299283 commit b305977

10 files changed

+547
-435
lines changed
 

‎README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[![Join the chat at https://gitter.im/soscripted/sox](https://badges.gitter.im/soscripted/sox.svg)](https://gitter.im/soscripted/sox?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
22

3-
### SOX v2.6.0
3+
### SOX v2.7.0
44

55
Stack Overflow Extras (*SOX*) is a project that stemmed from the [Stack Overflow Optional Features (SOOF)](https://github.com/shu8/Stack-Overflow-Optional-Features) project.
66

@@ -22,7 +22,7 @@ Note: This project has no relation to Stack Overflow or Stack Exchange; it is si
2222

2323
2. Install the script. Clicking on 'install' below will make Tampermonkey prompt you automatically to install it.
2424

25-
- Official Version: <kbd>[install](https://github.com/soscripted/sox/raw/v2.6.0/sox.user.js)</kbd>. <kbd>[view source](https://github.com/soscripted/sox/blob/v2.6.0/sox.user.js)</kbd>
25+
- Official Version: <kbd>[install](https://github.com/soscripted/sox/raw/v2.7.0/sox.user.js)</kbd>. <kbd>[view source](https://github.com/soscripted/sox/blob/v2.7.0/sox.user.js)</kbd>
2626
- Development Version: <kbd>[install](https://github.com/soscripted/sox/raw/dev/sox.user.js)</kbd>. <kbd>[view source](https://github.com/soscripted/sox/blob/dev/sox.user.js)</kbd>
2727

2828
3. Go to any site in the Stack Exchange Network (e.g. [Super User](http://superuser.com/) or [Stack Overflow](http://stackoverflow.com/)). You will automatically be asked to choose and save your settings. A toggle button (gears icon) will be added to your topbar where you can change these later on:

‎icons/sox_search.svg

+1-1
Loading

‎sox.common.js

+2
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,7 @@
171171
sitename,
172172
filter,
173173
limit,
174+
page,
174175
featureId,
175176
cacheDuration = 3, // Minutes to cache data for
176177
} = details;
@@ -197,6 +198,7 @@
197198
if (filter) queryParams.push(`filter=${filter}`);
198199
if (order) queryParams.push(`order=${order}`);
199200
if (limit) queryParams.push(`pagesize=${limit}`);
201+
if (page) queryParams.push(`page=${page}`);
200202
queryParams.push(`sort=${sort}`);
201203
queryParams.push(`site=${sitename}`);
202204
queryParams.push(`key=${sox.info.apikey}`);

‎sox.css

+70-11
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
}
2020

2121
#sox-settings-dialog .modal-content {
22-
/* max-height: calc(100vh - 175px); */
2322
max-height: none;
2423
min-height: inherit;
2524
}
@@ -35,6 +34,8 @@
3534

3635
#sox-settings-dialog #search-container {
3736
min-height: 0;
37+
width: 570px;
38+
left: 10px;
3839
}
3940

4041
#sox-settings-dialog #search-container .sox-sprite-search {
@@ -54,12 +55,11 @@
5455
}
5556

5657
#sox-settings-dialog #search-container #search {
57-
width: 490px;
58-
text-indent: 20px;
58+
max-width: 90%;
5959
}
6060

6161
#sox-settings-dialog-features {
62-
/* padding: 0 10px 10px 10px; */
62+
padding: 0 10px 10px 10px;
6363
overflow-y: scroll;
6464
height: calc(100vh - 250px);
6565
}
@@ -70,7 +70,7 @@
7070
}
7171

7272
#sox-settings-dialog-features .modal-content div:hover {
73-
background-color: #f7f8f8;
73+
background-color: var(--black-075);
7474
}
7575

7676
#sox-settings-dialog-features .modal-content label>input {
@@ -89,7 +89,7 @@
8989

9090
#sox-settings-dialog-actions .action {
9191
float: right;
92-
padding: 11px;
92+
padding: 13px 11px;
9393
}
9494

9595
#sox-settings-dialog .sox-new-version-item {
@@ -109,10 +109,6 @@
109109
height: 24px !important;
110110
}
111111

112-
.sox-settings-button:hover {
113-
color: #999;
114-
}
115-
116112
#sox-settings-dialog-check-toggle>i {
117113
padding: 14px 0;
118114
}
@@ -128,7 +124,7 @@
128124

129125
.sox-feature-info,
130126
.sox-feature-settings {
131-
background-color: whitesmoke;
127+
background-color: var(--black-025);
132128
border-radius: 9px;
133129
margin-left: 20px;
134130
padding: 8px;
@@ -170,6 +166,7 @@
170166
padding: 10px;
171167
border-radius: 9px;
172168
background-color: lightgrey;
169+
color: #3c4146; /* dark mode compatibility */
173170
cursor: pointer;
174171
}
175172

@@ -460,6 +457,15 @@
460457
background: black;
461458
}
462459

460+
/* spoilerTip -- for the red 'hover to show spoiler' text */
461+
462+
.isSpoiler {
463+
color: red;
464+
font-size: smaller;
465+
float: right;
466+
opacity: 1 !important;
467+
}
468+
463469
/*commentReplies -- for the reply buttons*/
464470

465471
.soxReplyLink {
@@ -589,6 +595,7 @@
589595
padding: 2px;
590596
margin: 2px;
591597
border: 1px dotted black;
598+
display: block;
592599
}
593600

594601
/* editComment -- for the dialog and checkboxes shown when editing */
@@ -618,6 +625,11 @@
618625
color: white;
619626
}
620627

628+
#currentValues section {
629+
display: inline-block !important;
630+
padding: 0px 10px;
631+
}
632+
621633
/* customMagicLinks -- for the settings table in the dialog */
622634
.sox-customMagicLinks-settings-table {
623635
margin-bottom: 10px;
@@ -651,6 +663,11 @@
651663
margin-right: 5px;
652664
}
653665

666+
.sox-quickAuthorInfo-unregistered {
667+
margin-left: 5px;
668+
font-size: smaller;
669+
}
670+
654671
/* markEmployees -- for the SE icon */
655672
.sox-markEmployees-logo {
656673
margin-left: 5px;
@@ -665,3 +682,45 @@
665682
font-weight: bold;
666683
font-style: italic;
667684
}
685+
686+
/* sox-scrollChatRoomsList -- for the user popup and sidebar scrollbar */
687+
.sox-scrollChatRoomsList-user-popup {
688+
max-height: calc(100vh - 90px);
689+
}
690+
691+
.sox-scrollChatRoomsList-user-popup ul.no-bullets {
692+
max-height: calc(100vh - 500px);
693+
overflow-y: auto;
694+
}
695+
696+
.sox-scrollChatRoomsList-sidebar {
697+
max-height: calc(40vh);
698+
overflow: auto;
699+
}
700+
701+
.sox-scrollChatRoomsList-sidebar > #my-rooms {
702+
height: 100%;
703+
overflow: auto;
704+
}
705+
706+
/* tabularReviewerStats -- for the table with user's stats */
707+
.sox-tabularReviewerStats-table tr,
708+
.sox-tabularReviewerStats-table th,
709+
.sox-tabularReviewerStats-table td:not(:first-child) {
710+
border: 1px solid #cccccc;
711+
border-collapse: collapse;
712+
}
713+
714+
.sox-tabularReviewerStats-table th, .sox-tabularReviewerStats-table td {
715+
padding: 4px;
716+
}
717+
718+
/* stickyVoteButtons -- for the vote buttons on the left of the post */
719+
.sox-stickyVoteButtons > .js-voting-container {
720+
position: -webkit-sticky;
721+
position: sticky;
722+
}
723+
724+
.sox-stickyVoteButtons .s-popover {
725+
width: max-content;
726+
}

‎sox.dialog.html

+7-7
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@ <h3>
77
<div class="header">
88
<h3>search</h3>
99
</div>
10-
<div class="modal-content" id="search-container">
11-
<input type="text" id="search" placeholder="looking for a specific feature?">
12-
<svg role="img" title="delete" class="sox-sprite sox-sprite-search"> <use xlink:href="#sox_search"> </use> </svg>
10+
<div class="grid--cell ps-relative fl1 modal-content" id="search-container">
11+
<input class="s-input s-input__search js-search-field" type="text" placeholder="looking for a feature?" id="search">
12+
<svg xmlns="http://www.w3.org/2000/svg" class="svg-icon s-input-icon s-input-icon__search iconSearch" aria-hidden="true" viewBox="0 0 18 18" width="18" height="18"><path d="M 18 16.5 l -5.14 -5.18 h -0.35 a 7 7 0 1 0 -1.19 1.19 v 0.35 L 16.5 18 l 1.5 -1.5 Z M 12 7 A 5 5 0 1 1 2 7 a 5 5 0 0 1 10 0 Z" /></svg>
1313
</div>
1414
<div id="sox-settings-dialog-features">
1515
<div id="sox-settings-dialog-features-packs">
@@ -25,10 +25,10 @@ <h3>Feature Packs</h3>
2525
</div>
2626
</div>
2727
<div id="sox-settings-dialog-actions">
28-
<input id="sox-settings-dialog-save" type="submit" value="Save Changes">
29-
<a class="action" id="sox-settings-dialog-reset" title="reset SOX (deletes everything, including your settings and access token)">Reset</a>
30-
<a class="action" id="sox-settings-dialog-report" title="report issue on Github" target="_blank" href="https://github.com/soscripted/sox/issues/new">Report Issue</a>
31-
<a class="action" id="sox-settings-dialog-debugging">Enable Debugging</a>
28+
<input class="s-btn s-btn__primary s-btn__sm" id="sox-settings-dialog-save" type="submit" value="Save Changes">
29+
<a class="action s-btn s-btn__secondary s-btn__sm" id="sox-settings-dialog-reset" title="reset SOX (deletes everything, including your settings and access token)">Reset</a>
30+
<a class="action s-btn s-btn__secondary s-btn__sm" id="sox-settings-dialog-report" title="report issue on Github" target="_blank" href="https://github.com/soscripted/sox/issues/new">Report Issue</a>
31+
<a class="action s-btn s-btn__secondary s-btn__sm" id="sox-settings-dialog-debugging">Enable Debugging</a>
3232
<a class="action" id="sox-settings-dialog-access-token" title="request a new access token">
3333
<svg role="img" class="sox-sprite sox-sprite-key"> <use xlink:href="#sox_key"> </use> </svg>
3434
</a>

‎sox.dialog.js

+14-10
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,12 @@
2727

2828
// Array of HTML strings that will be displayed as `li` items if the user has installed a new version.
2929
const changes = [
30-
'Fix bugs in various features',
31-
'Add feature to open imgur images in a modal on click',
32-
'Update many features to work with recent SE HTML markup/CSS changes',
33-
'Removed dependency on Font Awesome for icons, use SVG sprites instead',
34-
'Add support for StylishThemes/StackOverflow-Dark theme',
30+
'Fix bugs in various features (thanks @double-beep for many of these!)',
31+
'Add feature to copy markdown for comments',
32+
'Add feature to add scrolling to room list in usercards in chat',
33+
'Only run SOX on HTTPS',
34+
'Deprecate "add timeline button" feature (now natively implemented!)',
35+
'Deprecate "show question state in suggested edit review queue" (now native!)'
3536
];
3637

3738
function addCategory(name) {
@@ -46,7 +47,7 @@
4647

4748
const $content = $('<div/>', {
4849
id: name,
49-
class: 'modal-content features',
50+
'class': 'modal-content features',
5051
});
5152
$div.append($h3);
5253

@@ -76,6 +77,7 @@
7677
const $label = $('<label/>');
7778
const $input = $('<input/>', {
7879
id: name,
80+
'class': 's-checkbox',
7981
type: 'checkbox',
8082
}).prop('disabled', blockFeatureSelection);
8183

@@ -110,19 +112,20 @@
110112
for (let i = 0; i < featureSettings.length; i++) {
111113
const currentSetting = featureSettings[i];
112114
$settingsDiv
113-
.append(currentSetting.desc)
114-
.append('<br>')
115115
.append(sox.helpers.newElement(currentSetting.type, { //use newElement helper so the type can be things like 'checkbox' or 'radio'
116116
id: currentSetting.id,
117-
'class': 'featureSetting',
117+
'class': currentSetting.type === 'textarea' ? 'featureSetting s-input' : 'featureSetting s-checkbox',
118+
'style': 'margin-right: 5px',
118119
'checked': (currentSetting.type === 'checkbox' ? JSON.parse(optionalSettings)[currentSetting.id] : false),
119120
value: (optionalSettings === -1 ? '' : JSON.parse(optionalSettings)[currentSetting.id]),
120121
}))
122+
.append(currentSetting.desc)
121123
.append('<br>');
122124
}
123125

124126
const $saveFeatureSettings = $('<a/>', {
125127
id: 'saveSettings-' + name,
128+
'class': 'action s-btn s-btn__secondary s-btn__sm',
126129
text: 'Save Settings',
127130
click: function(e) {
128131
e.preventDefault(); //don't uncheck the checkbox
@@ -277,14 +280,15 @@
277280
// create sox settings button
278281
const $soxSettingsButton = $('<a/>', {
279282
id: 'soxSettingsButton',
280-
class: 'sox-settings-button -link',
283+
'class': 'sox-settings-button -link',
281284
title: 'Change SOX settings',
282285
href: '#',
283286
click: function(e) {
284287
e.preventDefault();
285288
$('#sox-settings-dialog').toggle();
286289
if ($soxSettingsDialog.is(':visible')) {
287290
$(this).addClass('topbar-icon-on');
291+
$soxSettingsDialog.find('#search').focus();
288292
} else {
289293
$(this).removeClass('topbar-icon-on');
290294
}

0 commit comments

Comments
 (0)