1
0
Fork 0
mirror of https://github.com/FrankerFaceZ/FrankerFaceZ.git synced 2025-06-28 15:27:43 +00:00

3.5.188. Continued bug fixing for Ember internals restructuring. Fixed enhanced following control again. Fixed a bug re-inserting deleted message history into chat.

This commit is contained in:
SirStendec 2016-05-25 01:06:27 -04:00
parent 574d627f79
commit 2cb07d6c78
9 changed files with 45 additions and 28 deletions

View file

@ -303,7 +303,7 @@ FFZ.prototype._modify_cindex = function(view) {
btn.id = 'ffz-ui-host-button';
btn.className = 'button action';
btn.addEventListener('click', this.ffzClickHost.bind(btn, this, false));
btn.addEventListener('click', this.ffzClickHost.bind(this, false));
var before;
try { before = container.querySelector(':scope > .theatre-button'); }
@ -343,7 +343,7 @@ FFZ.prototype._modify_cindex = function(view) {
btn.id = 'ffz-ui-host-button';
btn.className = 'button action';
btn.addEventListener('click', this.ffzClickHost.bind(btn, this, true));
btn.addEventListener('click', this.ffzClickHost.bind(this, true));
var before;
try { before = container.querySelector(':scope > .theatre-button'); }
@ -370,19 +370,20 @@ FFZ.prototype._modify_cindex = function(view) {
}
},
ffzClickHost: function(controller, is_host) {
var target = is_host ? controller.get('controller.hostModeTarget.id') : (controller.get('controller.content.id') || controller.get('controller.id')),
ffzClickHost: function(is_host, e) {
var btn = e.target,
target = is_host ? this.get('controller.hostModeTarget.id') : (this.get('controller.content.id') || this.get('controller.id')),
user = f.get_user(),
room = user && f.rooms && f.rooms[user.login] && f.rooms[user.login].room,
now_hosting = room && room.ffz_host_target;
if ( ! room || controller.get('ffz_host_updating') )
if ( ! room || this.get('ffz_host_updating') )
return;
this.classList.add('disabled');
this.title = 'Updating...';
btn.classList.add('disabled');
btn.title = 'Updating...';
controller.set('ffz_host_updating', true);
this.set('ffz_host_updating', true);
if ( now_hosting === target )
room.send("/unhost", true);
else

View file

@ -616,7 +616,7 @@ FFZ.prototype._modify_cview = function(view) {
// Close mod cards when changing to a new room.
if ( f._mod_card )
f._mod_card.send('close');
f._mod_card.get('closeAction')();
var room = this.get('controller.currentRoom'),
room_id = room && room.get('id'),

View file

@ -174,9 +174,19 @@ FFZ.prototype._modify_display_followed_item = function(component) {
}
},
ffzParentModel: function() {
var x = this.get('parentView');
while(x) {
var model = x.get('model');
if ( model )
return model;
x = x.get('parentView');
}
}.property('parentView'),
ffzInit: function() {
var el = this.get('element'),
channel_id = this.get('parentView.parentView.model.id'),
channel_id = this.get('ffzParentModel.id'), //.get('parentView.parentView.parentView.model.id'),
is_following = document.body.getAttribute('data-current-path').indexOf('.following') !== -1,
user = f.get_user(),

View file

@ -907,13 +907,13 @@ FFZ.prototype._modify_chat_subline = function(component) {
return;
} else if ( cl.contains('ban') )
this.sendAction("banUser", from);
this.sendAction("banUser", {user:from});
else if ( cl.contains('unban') )
this.sendAction("unbanUser", from);
this.sendAction("unbanUser", {user:from});
else if ( cl.contains('timeout') )
this.sendAction("timeoutUser", from);
this.sendAction("timeoutUser", {user:from});
} else if ( cl.contains('badge') ) {
if ( cl.contains('turbo') )

View file

@ -21,7 +21,7 @@ var FFZ = window.FrankerFaceZ,
try {
helpers = window.require && window.require("ember-twitch-chat/helpers/chat-line-helpers");
helpers = window.require && window.require("web-client/helpers/chat/chat-line-helpers");
} catch(err) { }
@ -490,6 +490,11 @@ FFZ.settings_info.mod_card_durations = {
// ----------------
FFZ.prototype.setup_mod_card = function() {
try {
helpers = window.require && window.require("web-client/helpers/chat/chat-line-helpers");
} catch(err) { }
this.log("Modifying Mousetrap stopCallback so we can catch ESC.");
var orig_stop = Mousetrap.stopCallback;
Mousetrap.stopCallback = function(e, element, combo) {
@ -598,17 +603,15 @@ FFZ.prototype.setup_mod_card = function() {
// Action Override
if ( this._actions ) {
this._actions.banUser = function(e) {
this.set('banAction', function(e) {
var room = utils.ember_lookup('controller:chat').get('currentRoom');
room.send("/ban " + e + ban_reason(), true);
}
room.send("/ban " + e.user + ban_reason(), true);
});
this._actions.timeoutUser = function(e) {
this.set('timeoutAction', function(e) {
var room = utils.ember_lookup('controller:chat').get('currentRoom');
room.send("/timeout " + e + " 600" + ban_reason(), true);
}
}
room.send("/timeout " + e.user + " 600 " + ban_reason(), true);
});
// Alias Display
@ -749,7 +752,7 @@ FFZ.prototype.setup_mod_card = function() {
else if ( key != keycodes.ESC )
return;
controller.send('close');
t.get('closeAction')();
});
}

View file

@ -725,7 +725,7 @@ FFZ.prototype._insert_history = function(room_id, data, from_server) {
if ( f.settings.remove_deleted && msg.deleted )
return true;
if ( msg.tags.target && msg.tags.target !== '@@' ) {
if ( msg.tags && msg.tags.target && msg.tags.target !== '@@' ) {
var is_mine = current_user && current_user.login === msg.tags.target;
if ( ! is_mine && ! r.ffzShouldDisplayNotice() )
return true;

View file

@ -37,7 +37,7 @@ FFZ.msg_commands = {};
// Version
var VER = FFZ.version_info = {
major: 3, minor: 5, revision: 185,
major: 3, minor: 5, revision: 188,
toString: function() {
return [VER.major, VER.minor, VER.revision].join(".") + (VER.extra || "");
}

View file

@ -148,7 +148,7 @@ FFZ.prototype.setup_tokenization = function() {
this.load_twitch_emote_data();
try {
helpers = window.require && window.require("ember-twitch-chat/helpers/chat-line-helpers");
helpers = window.require && window.require("web-client/helpers/chat/chat-line-helpers");
} catch(err) { }
if ( ! helpers )

View file

@ -1104,6 +1104,7 @@ body:not(.ffz-bttv) .dropmenu.share { margin-bottom: 0; }
/* Menu Scrollbar */
.activity-react__all::-webkit-scrollbar,
.conversations-list .scroll-container::-webkit-scrollbar,
.chatters-container::-webkit-scrollbar,
.ffz-scrollbar::-webkit-scrollbar,
@ -1119,6 +1120,7 @@ body:not(.ffz-bttv) .dropmenu.share { margin-bottom: 0; }
width: 6px;
}
.activity-react__all::-webkit-scrollbar-thumb,
.conversations-list .scroll-container::-webkit-scrollbar-thumb,
.chatters-container::-webkit-scrollbar-thumb,
.ffz-scrollbar::-webkit-scrollbar-thumb,
@ -1135,6 +1137,7 @@ body:not(.ffz-bttv) .dropmenu.share { margin-bottom: 0; }
box-shadow: 0 0 1px 1px rgba(255,255,255,0.25);
}
.ffz-dark .activity-react__all::-webkit-scrollbar-thumb,
.ffz-dark .conversations-list .scroll-container::-webkit-scrollbar-thumb,
.ffz-dark .ffz-scrollbar::-webkit-scrollbar-thumb,
.ffz-dark .table::-webkit-scrollbar-thumb,