Skip to content

Commit df51f33

Browse files
authored
Merge pull request #131 from makyen/Mak-update-deleted-check-for-MS-response
FIRE 1.0.31
2 parents d6d5ae7 + 2c7a36a commit df51f33

File tree

3 files changed

+19
-3
lines changed

3 files changed

+19
-3
lines changed

fire/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ To open the reported post on it's site:
7272

7373
|1.0 ||
7474
| --- |---
75+
|1.0.31 |Remove display of weight. Adjust probably deleted detection when flagging via MS. Keypress block (again).
7576
|1.0.30 |Prevent keypress from affecting chat input when the popup is open. Add chat rooms.
7677
|1.0.29 |Update MS API filters due to MS changes.
7778
|1.0.28 |Adapt to new SmokeDetector report URL format.

fire/fire.meta.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
// @description FIRE adds a button to SmokeDetector reports that allows you to provide feedback & flag, all from chat.
55
// @author Cerbrus
66
// @attribution Michiel Dommerholt (https://github.com/Cerbrus)
7-
// @version 1.0.30
7+
// @version 1.0.31
88
// @icon https://raw.githubusercontent.com/Ranks/emojione-assets/master/png/32/1f525.png
99
// @updateURL https://raw.githubusercontent.com/Charcoal-SE/Userscripts/master/fire/fire.meta.js
1010
// @downloadURL https://raw.githubusercontent.com/Charcoal-SE/Userscripts/master/fire/fire.user.js

fire/fire.user.js

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
// @description FIRE adds a button to SmokeDetector reports that allows you to provide feedback & flag, all from chat.
55
// @author Cerbrus
66
// @attribution Michiel Dommerholt (https://github.com/Cerbrus)
7-
// @version 1.0.30
7+
// @version 1.0.31
88
// @icon https://raw.githubusercontent.com/Ranks/emojione-assets/master/png/32/1f525.png
99
// @updateURL https://raw.githubusercontent.com/Charcoal-SE/Userscripts/master/fire/fire.meta.js
1010
// @downloadURL https://raw.githubusercontent.com/Charcoal-SE/Userscripts/master/fire/fire.user.js
@@ -904,6 +904,19 @@
904904
callback();
905905
}
906906

907+
/**
908+
* stopPropagationIfTargetBody - If the target of the event is the body, then stop propagation.
909+
*
910+
* @private
911+
* @memberof module:fire
912+
*
913+
* @param {object} event An event
914+
*/
915+
function stopPropagationIfTargetBody(event) {
916+
if (event.target === document.body)
917+
event.stopPropagation();
918+
}
919+
907920
/**
908921
* keyboardShortcuts - Handle keypress events for the popup.
909922
*
@@ -1242,6 +1255,7 @@
12421255
'.fire-popup-body pre',
12431256
({currentTarget}) => $(currentTarget).toggleClass('fire-expanded')
12441257
);
1258+
document.addEventListener('keypress', stopPropagationIfTargetBody, true);
12451259
}
12461260

12471261
/**
@@ -1404,6 +1418,7 @@
14041418
$(document)
14051419
.off('keydown', keyboardShortcuts)
14061420
.off('click', '.fire-popup-body pre');
1421+
document.removeEventListener('keypress', stopPropagationIfTargetBody, true);
14071422

14081423
$('#container').removeClass('fire-blur');
14091424

@@ -1566,7 +1581,7 @@
15661581
response = {message: jqXHR.responseText};
15671582
}
15681583

1569-
if (response.message === 'Spam flag option not present') {
1584+
if (response.message === 'Flag option not present') {
15701585
toastr.info('This post could not be flagged.<br />' +
15711586
'It is probably deleted already.');
15721587
closePopup();

0 commit comments

Comments
 (0)