mirror of
https://github.com/FrankerFaceZ/FrankerFaceZ.git
synced 2025-07-24 19:48:30 +00:00
3.5.185. Fixes for Twitch changes.
This commit is contained in:
parent
11164648e9
commit
574d627f79
3 changed files with 58 additions and 7 deletions
|
@ -608,14 +608,14 @@ FFZ.prototype.setup_line = function() {
|
||||||
|
|
||||||
|
|
||||||
this.log("Hooking the Ember Message Line component.");
|
this.log("Hooking the Ember Message Line component.");
|
||||||
var MLine = utils.ember_resolve('component:message-line');
|
var MLine = utils.ember_resolve('component:chat/message-line');
|
||||||
if ( MLine )
|
if ( MLine )
|
||||||
this._modify_chat_subline(MLine);
|
this._modify_chat_subline(MLine);
|
||||||
else
|
else
|
||||||
this.error("Couldn't find the Message Line component.");
|
this.error("Couldn't find the Message Line component.");
|
||||||
|
|
||||||
this.log("Hooking the Ember Whisper Line component.");
|
this.log("Hooking the Ember Whisper Line component.");
|
||||||
var WLine = utils.ember_resolve('component:whisper-line');
|
var WLine = utils.ember_resolve('component:chat/whisper-line');
|
||||||
if ( WLine )
|
if ( WLine )
|
||||||
this._modify_chat_subline(WLine);
|
this._modify_chat_subline(WLine);
|
||||||
else
|
else
|
||||||
|
|
|
@ -9,6 +9,7 @@ var FFZ = window.FrankerFaceZ,
|
||||||
|
|
||||||
keycodes = {
|
keycodes = {
|
||||||
ESC: 27,
|
ESC: 27,
|
||||||
|
R: 82,
|
||||||
P: 80,
|
P: 80,
|
||||||
B: 66,
|
B: 66,
|
||||||
T: 84,
|
T: 84,
|
||||||
|
@ -355,7 +356,7 @@ FFZ.settings_info.mod_buttons = {
|
||||||
f.settings.set('mod_buttons', final);
|
f.settings.set('mod_buttons', final);
|
||||||
|
|
||||||
// Update existing chat lines.
|
// Update existing chat lines.
|
||||||
var CL = utils.ember_resolve('component:chat-line'),
|
var CL = utils.ember_resolve('component:chat/chat-line'),
|
||||||
views = CL ? utils.ember_views() : [];
|
views = CL ? utils.ember_views() : [];
|
||||||
|
|
||||||
for(var vid in views) {
|
for(var vid in views) {
|
||||||
|
@ -498,14 +499,14 @@ FFZ.prototype.setup_mod_card = function() {
|
||||||
return orig_stop(e, element, combo);
|
return orig_stop(e, element, combo);
|
||||||
}
|
}
|
||||||
|
|
||||||
Mousetrap.bind("up up down down left right left right b a enter", function() {
|
Mousetrap.bind("up up down down left right left right b a", function() {
|
||||||
var el = document.querySelector(".app-main") || document.querySelector(".ember-chat-container");
|
var el = document.querySelector(".app-main") || document.querySelector(".ember-chat-container");
|
||||||
el && el.classList.toggle('ffz-flip');
|
el && el.classList.toggle('ffz-flip');
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
this.log("Hooking the Ember Moderation Card view.");
|
this.log("Hooking the Ember Moderation Card view.");
|
||||||
var Card = utils.ember_resolve('component:moderation-card'),
|
var Card = utils.ember_resolve('component:chat/moderation-card'),
|
||||||
f = this;
|
f = this;
|
||||||
|
|
||||||
Card.reopen({
|
Card.reopen({
|
||||||
|
@ -595,6 +596,21 @@ FFZ.prototype.setup_mod_card = function() {
|
||||||
|
|
||||||
this.ffz_room_id = room_id;
|
this.ffz_room_id = room_id;
|
||||||
|
|
||||||
|
|
||||||
|
// Action Override
|
||||||
|
if ( this._actions ) {
|
||||||
|
this._actions.banUser = function(e) {
|
||||||
|
var room = utils.ember_lookup('controller:chat').get('currentRoom');
|
||||||
|
room.send("/ban " + e + ban_reason(), true);
|
||||||
|
}
|
||||||
|
|
||||||
|
this._actions.timeoutUser = function(e) {
|
||||||
|
var room = utils.ember_lookup('controller:chat').get('currentRoom');
|
||||||
|
room.send("/timeout " + e + " 600" + ban_reason(), true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// Alias Display
|
// Alias Display
|
||||||
if ( alias ) {
|
if ( alias ) {
|
||||||
var name = el.querySelector('h3.name'),
|
var name = el.querySelector('h3.name'),
|
||||||
|
@ -717,6 +733,19 @@ FFZ.prototype.setup_mod_card = function() {
|
||||||
else if ( is_mod && key == keycodes.U )
|
else if ( is_mod && key == keycodes.U )
|
||||||
room.send("/unban " + user_id, true);
|
room.send("/unban " + user_id, true);
|
||||||
|
|
||||||
|
else if ( is_mod && ban_reasons && key == keycodes.R ) {
|
||||||
|
var event = document.createEvent('MouseEvents');
|
||||||
|
event.initMouseEvent('mousedown', true, true, window);
|
||||||
|
ban_reasons.focus();
|
||||||
|
ban_reasons.dispatchEvent(event);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
else if ( key == keycodes.ESC && e.target === ban_reasons ) {
|
||||||
|
el.focus();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
else if ( key != keycodes.ESC )
|
else if ( key != keycodes.ESC )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
@ -780,7 +809,7 @@ FFZ.prototype.setup_mod_card = function() {
|
||||||
if ( f.settings.mod_card_reasons && f.settings.mod_card_reasons.length ) {
|
if ( f.settings.mod_card_reasons && f.settings.mod_card_reasons.length ) {
|
||||||
// Moderation Reasons
|
// Moderation Reasons
|
||||||
line = utils.createElement('div', 'extra-interface interface clearfix');
|
line = utils.createElement('div', 'extra-interface interface clearfix');
|
||||||
ban_reasons = utils.createElement('select', 'ffz-ban-reasons', '<option value="">Select a Ban Reason</option>');
|
ban_reasons = utils.createElement('select', 'ffz-ban-reasons', '<option value="">Select a Ban (R)eason</option>');
|
||||||
line.appendChild(ban_reasons);
|
line.appendChild(ban_reasons);
|
||||||
|
|
||||||
for(var i=0; i < f.settings.mod_card_reasons.length; i++) {
|
for(var i=0; i < f.settings.mod_card_reasons.length; i++) {
|
||||||
|
|
24
src/main.js
24
src/main.js
|
@ -37,7 +37,7 @@ FFZ.msg_commands = {};
|
||||||
|
|
||||||
// Version
|
// Version
|
||||||
var VER = FFZ.version_info = {
|
var VER = FFZ.version_info = {
|
||||||
major: 3, minor: 5, revision: 183,
|
major: 3, minor: 5, revision: 185,
|
||||||
toString: function() {
|
toString: function() {
|
||||||
return [VER.major, VER.minor, VER.revision].join(".") + (VER.extra || "");
|
return [VER.major, VER.minor, VER.revision].join(".") + (VER.extra || "");
|
||||||
}
|
}
|
||||||
|
@ -129,6 +129,28 @@ FFZ.prototype.get_user = function(force_reload) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
FFZ.prototype.get_user_editor_of = function() {
|
||||||
|
var f = this;
|
||||||
|
return new Promise(function(succeed,fail) {
|
||||||
|
var user = f.get_user();
|
||||||
|
if ( ! user || ! user.login )
|
||||||
|
return fail('not logged in');
|
||||||
|
|
||||||
|
jQuery.get("/" + user.login + "/dashboard/permissions").done(function(data) {
|
||||||
|
var el = document.createElement('div');
|
||||||
|
el.innerHTML = data;
|
||||||
|
|
||||||
|
var links = _.pluck(el.querySelectorAll('#editable .label'), 'href');
|
||||||
|
succeed(_.map(links, function(e) { return e.substr(e.lastIndexOf('/') + 1) }));
|
||||||
|
|
||||||
|
}).fail(function(e) {
|
||||||
|
f.error("Failed to load User Editor State", e);
|
||||||
|
fail('failed to load dashboard');
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// -------------------
|
// -------------------
|
||||||
// Import Everything!
|
// Import Everything!
|
||||||
// -------------------
|
// -------------------
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue