mirror of
https://github.com/FrankerFaceZ/FrankerFaceZ.git
synced 2025-07-24 19:48:30 +00:00
Updated for new emoticon srcSet.
This commit is contained in:
parent
216a82aa5a
commit
e1cfb17081
7 changed files with 21 additions and 17 deletions
16
script.js
16
script.js
|
@ -859,7 +859,6 @@ FFZ.prototype.setup_line = function() {
|
||||||
// Mark that we've checked this message for mentions.
|
// Mark that we've checked this message for mentions.
|
||||||
this.set('context.model.ffz_notified', true);
|
this.set('context.model.ffz_notified', true);
|
||||||
|
|
||||||
|
|
||||||
// Banned Links
|
// Banned Links
|
||||||
var bad_links = el.querySelectorAll('a.deleted-link');
|
var bad_links = el.querySelectorAll('a.deleted-link');
|
||||||
for(var i=0; i < bad_links.length; i++) {
|
for(var i=0; i < bad_links.length; i++) {
|
||||||
|
@ -935,7 +934,7 @@ FFZ.prototype.setup_line = function() {
|
||||||
set_type = (set && set.title) ? "FrankerFaceZ" : "FFZ Channel";
|
set_type = (set && set.title) ? "FrankerFaceZ" : "FFZ Channel";
|
||||||
|
|
||||||
if ( set && f.feature_friday && set.id == f.feature_friday.set )
|
if ( set && f.feature_friday && set.id == f.feature_friday.set )
|
||||||
set_name = "Feature Friday - " + f.feature_friday.channel;
|
set_name = f.feature_friday.title + " - " + f.feature_friday.display_name;
|
||||||
|
|
||||||
img.title = data_to_tooltip({
|
img.title = data_to_tooltip({
|
||||||
code: emote ? (emote.hidden ? "???" : emote.name) : name,
|
code: emote ? (emote.hidden ? "???" : emote.name) : name,
|
||||||
|
@ -1225,7 +1224,7 @@ FFZ.prototype._emoticonize = function(controller, tokens) {
|
||||||
// emoticon.
|
// emoticon.
|
||||||
_.each(emotes, function(emote) {
|
_.each(emotes, function(emote) {
|
||||||
//var eo = {isEmoticon:true, cls: emote.klass};
|
//var eo = {isEmoticon:true, cls: emote.klass};
|
||||||
var eo = {isEmoticon:true, cls: emote.klass, emoticonSrc: emote.url + '" data-ffz-emote="' + encodeURIComponent(JSON.stringify([emote.id, emote.set_id])), altText: (emote.hidden ? "???" : emote.name)};
|
var eo = {isEmoticon:true, cls: emote.klass,srcSet: emote.url + ' 1x', emoticonSrc: emote.url + '" data-ffz-emote="' + encodeURIComponent(JSON.stringify([emote.id, emote.set_id])), altText: (emote.hidden ? "???" : emote.name)};
|
||||||
|
|
||||||
tokens = _.compact(_.flatten(_.map(tokens, function(token) {
|
tokens = _.compact(_.flatten(_.map(tokens, function(token) {
|
||||||
if ( _.isObject(token) )
|
if ( _.isObject(token) )
|
||||||
|
@ -2226,7 +2225,6 @@ FFZ.prototype.setup_bttv = function(delay) {
|
||||||
received_room;
|
received_room;
|
||||||
BetterTTV.chat.handlers.onPrivmsg = function(room, data) {
|
BetterTTV.chat.handlers.onPrivmsg = function(room, data) {
|
||||||
received_room = room;
|
received_room = room;
|
||||||
f.log("Room: " + room);
|
|
||||||
var output = original_handler(room, data);
|
var output = original_handler(room, data);
|
||||||
received_room = null;
|
received_room = null;
|
||||||
return output;
|
return output;
|
||||||
|
@ -2238,7 +2236,6 @@ FFZ.prototype.setup_bttv = function(delay) {
|
||||||
BetterTTV.chat.templates.privmsg = function(highlight, action, server, isMod, data) {
|
BetterTTV.chat.templates.privmsg = function(highlight, action, server, isMod, data) {
|
||||||
try {
|
try {
|
||||||
// Handle badges.
|
// Handle badges.
|
||||||
f.log("Got Message", data);
|
|
||||||
f.bttv_badges(data);
|
f.bttv_badges(data);
|
||||||
|
|
||||||
// Now, do everything else manually because things are hard-coded.
|
// Now, do everything else manually because things are hard-coded.
|
||||||
|
@ -2407,7 +2404,7 @@ FFZ.prototype._emote_menu_enumerator = function() {
|
||||||
title = "FrankerFaceZ Event Emotes";
|
title = "FrankerFaceZ Event Emotes";
|
||||||
|
|
||||||
else if ( this.feature_friday && set.id == this.feature_friday.set )
|
else if ( this.feature_friday && set.id == this.feature_friday.set )
|
||||||
title = "FrankerFaceZ Feature Friday: " + this.feature_friday.channel;
|
title = "FrankerFaceZ " + this.feature_friday.title + ": " + this.feature_friday.display_name;
|
||||||
|
|
||||||
else
|
else
|
||||||
title = "FrankerFaceZ Set: " + FFZ.get_capitalization(set.id);
|
title = "FrankerFaceZ Set: " + FFZ.get_capitalization(set.id);
|
||||||
|
@ -2692,7 +2689,7 @@ FFZ.prototype._feature_friday_ui = function(room_id, parent, view) {
|
||||||
if ( ! this.feature_friday || this.feature_friday.channel == room_id )
|
if ( ! this.feature_friday || this.feature_friday.channel == room_id )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
this._emotes_for_sets(parent, view, [this.feature_friday.set], "Feature Friday");
|
this._emotes_for_sets(parent, view, [this.feature_friday.set], this.feature_friday.title);
|
||||||
|
|
||||||
// Before we add the button, make sure the channel isn't the
|
// Before we add the button, make sure the channel isn't the
|
||||||
// current channel.
|
// current channel.
|
||||||
|
@ -2751,6 +2748,7 @@ FFZ.prototype._load_ff = function(data) {
|
||||||
|
|
||||||
// We have our data! Set it up.
|
// We have our data! Set it up.
|
||||||
this.feature_friday = {set: data.set, channel: data.channel, live: false,
|
this.feature_friday = {set: data.set, channel: data.channel, live: false,
|
||||||
|
title: data.title || "Feature Friday",
|
||||||
display_name: FFZ.get_capitalization(data.channel, this._update_ff_name.bind(this))};
|
display_name: FFZ.get_capitalization(data.channel, this._update_ff_name.bind(this))};
|
||||||
|
|
||||||
// Add the set.
|
// Add the set.
|
||||||
|
@ -3800,6 +3798,7 @@ var FFZ = window.FrankerFaceZ,
|
||||||
"\\:-?D": ":-D",
|
"\\:-?D": ":-D",
|
||||||
"\\:-?(o|O)": ":-O",
|
"\\:-?(o|O)": ":-O",
|
||||||
"\\>\\;\\(": ">(",
|
"\\>\\;\\(": ">(",
|
||||||
|
"Gr(a|e)yFace": "GrayFace"
|
||||||
},
|
},
|
||||||
|
|
||||||
get_emotes = function(ffz) {
|
get_emotes = function(ffz) {
|
||||||
|
@ -3895,6 +3894,9 @@ FFZ.menu_pages.my_emotes = {
|
||||||
var a = (KNOWN_CODES[a.code] ? "000" + KNOWN_CODES[a.code] : a.code).toLowerCase(),
|
var a = (KNOWN_CODES[a.code] ? "000" + KNOWN_CODES[a.code] : a.code).toLowerCase(),
|
||||||
b = (KNOWN_CODES[b.code] ? "000" + KNOWN_CODES[b.code] : b.code).toLowerCase();
|
b = (KNOWN_CODES[b.code] ? "000" + KNOWN_CODES[b.code] : b.code).toLowerCase();
|
||||||
|
|
||||||
|
if ( a == "000grayface" ) a = "grayface";
|
||||||
|
if ( b == "000grayface" ) b = "grayface";
|
||||||
|
|
||||||
if ( a < b ) return -1;
|
if ( a < b ) return -1;
|
||||||
else if ( a > b ) return 1;
|
else if ( a > b ) return 1;
|
||||||
return 0;
|
return 0;
|
||||||
|
|
6
script.min.js
vendored
6
script.min.js
vendored
File diff suppressed because one or more lines are too long
|
@ -327,7 +327,6 @@ FFZ.prototype.setup_line = function() {
|
||||||
// Mark that we've checked this message for mentions.
|
// Mark that we've checked this message for mentions.
|
||||||
this.set('context.model.ffz_notified', true);
|
this.set('context.model.ffz_notified', true);
|
||||||
|
|
||||||
|
|
||||||
// Banned Links
|
// Banned Links
|
||||||
var bad_links = el.querySelectorAll('a.deleted-link');
|
var bad_links = el.querySelectorAll('a.deleted-link');
|
||||||
for(var i=0; i < bad_links.length; i++) {
|
for(var i=0; i < bad_links.length; i++) {
|
||||||
|
@ -403,7 +402,7 @@ FFZ.prototype.setup_line = function() {
|
||||||
set_type = (set && set.title) ? "FrankerFaceZ" : "FFZ Channel";
|
set_type = (set && set.title) ? "FrankerFaceZ" : "FFZ Channel";
|
||||||
|
|
||||||
if ( set && f.feature_friday && set.id == f.feature_friday.set )
|
if ( set && f.feature_friday && set.id == f.feature_friday.set )
|
||||||
set_name = "Feature Friday - " + f.feature_friday.channel;
|
set_name = f.feature_friday.title + " - " + f.feature_friday.display_name;
|
||||||
|
|
||||||
img.title = data_to_tooltip({
|
img.title = data_to_tooltip({
|
||||||
code: emote ? (emote.hidden ? "???" : emote.name) : name,
|
code: emote ? (emote.hidden ? "???" : emote.name) : name,
|
||||||
|
@ -693,7 +692,7 @@ FFZ.prototype._emoticonize = function(controller, tokens) {
|
||||||
// emoticon.
|
// emoticon.
|
||||||
_.each(emotes, function(emote) {
|
_.each(emotes, function(emote) {
|
||||||
//var eo = {isEmoticon:true, cls: emote.klass};
|
//var eo = {isEmoticon:true, cls: emote.klass};
|
||||||
var eo = {isEmoticon:true, cls: emote.klass, emoticonSrc: emote.url + '" data-ffz-emote="' + encodeURIComponent(JSON.stringify([emote.id, emote.set_id])), altText: (emote.hidden ? "???" : emote.name)};
|
var eo = {isEmoticon:true, cls: emote.klass,srcSet: emote.url + ' 1x', emoticonSrc: emote.url + '" data-ffz-emote="' + encodeURIComponent(JSON.stringify([emote.id, emote.set_id])), altText: (emote.hidden ? "???" : emote.name)};
|
||||||
|
|
||||||
tokens = _.compact(_.flatten(_.map(tokens, function(token) {
|
tokens = _.compact(_.flatten(_.map(tokens, function(token) {
|
||||||
if ( _.isObject(token) )
|
if ( _.isObject(token) )
|
||||||
|
|
|
@ -57,7 +57,6 @@ FFZ.prototype.setup_bttv = function(delay) {
|
||||||
received_room;
|
received_room;
|
||||||
BetterTTV.chat.handlers.onPrivmsg = function(room, data) {
|
BetterTTV.chat.handlers.onPrivmsg = function(room, data) {
|
||||||
received_room = room;
|
received_room = room;
|
||||||
f.log("Room: " + room);
|
|
||||||
var output = original_handler(room, data);
|
var output = original_handler(room, data);
|
||||||
received_room = null;
|
received_room = null;
|
||||||
return output;
|
return output;
|
||||||
|
@ -69,7 +68,6 @@ FFZ.prototype.setup_bttv = function(delay) {
|
||||||
BetterTTV.chat.templates.privmsg = function(highlight, action, server, isMod, data) {
|
BetterTTV.chat.templates.privmsg = function(highlight, action, server, isMod, data) {
|
||||||
try {
|
try {
|
||||||
// Handle badges.
|
// Handle badges.
|
||||||
f.log("Got Message", data);
|
|
||||||
f.bttv_badges(data);
|
f.bttv_badges(data);
|
||||||
|
|
||||||
// Now, do everything else manually because things are hard-coded.
|
// Now, do everything else manually because things are hard-coded.
|
||||||
|
|
|
@ -59,7 +59,7 @@ FFZ.prototype._emote_menu_enumerator = function() {
|
||||||
title = "FrankerFaceZ Event Emotes";
|
title = "FrankerFaceZ Event Emotes";
|
||||||
|
|
||||||
else if ( this.feature_friday && set.id == this.feature_friday.set )
|
else if ( this.feature_friday && set.id == this.feature_friday.set )
|
||||||
title = "FrankerFaceZ Feature Friday: " + this.feature_friday.channel;
|
title = "FrankerFaceZ " + this.feature_friday.title + ": " + this.feature_friday.display_name;
|
||||||
|
|
||||||
else
|
else
|
||||||
title = "FrankerFaceZ Set: " + FFZ.get_capitalization(set.id);
|
title = "FrankerFaceZ Set: " + FFZ.get_capitalization(set.id);
|
||||||
|
|
|
@ -47,7 +47,7 @@ FFZ.prototype._feature_friday_ui = function(room_id, parent, view) {
|
||||||
if ( ! this.feature_friday || this.feature_friday.channel == room_id )
|
if ( ! this.feature_friday || this.feature_friday.channel == room_id )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
this._emotes_for_sets(parent, view, [this.feature_friday.set], "Feature Friday");
|
this._emotes_for_sets(parent, view, [this.feature_friday.set], this.feature_friday.title);
|
||||||
|
|
||||||
// Before we add the button, make sure the channel isn't the
|
// Before we add the button, make sure the channel isn't the
|
||||||
// current channel.
|
// current channel.
|
||||||
|
@ -106,6 +106,7 @@ FFZ.prototype._load_ff = function(data) {
|
||||||
|
|
||||||
// We have our data! Set it up.
|
// We have our data! Set it up.
|
||||||
this.feature_friday = {set: data.set, channel: data.channel, live: false,
|
this.feature_friday = {set: data.set, channel: data.channel, live: false,
|
||||||
|
title: data.title || "Feature Friday",
|
||||||
display_name: FFZ.get_capitalization(data.channel, this._update_ff_name.bind(this))};
|
display_name: FFZ.get_capitalization(data.channel, this._update_ff_name.bind(this))};
|
||||||
|
|
||||||
// Add the set.
|
// Add the set.
|
||||||
|
|
|
@ -19,6 +19,7 @@ var FFZ = window.FrankerFaceZ,
|
||||||
"\\:-?D": ":-D",
|
"\\:-?D": ":-D",
|
||||||
"\\:-?(o|O)": ":-O",
|
"\\:-?(o|O)": ":-O",
|
||||||
"\\>\\;\\(": ">(",
|
"\\>\\;\\(": ">(",
|
||||||
|
"Gr(a|e)yFace": "GrayFace"
|
||||||
},
|
},
|
||||||
|
|
||||||
get_emotes = function(ffz) {
|
get_emotes = function(ffz) {
|
||||||
|
@ -114,6 +115,9 @@ FFZ.menu_pages.my_emotes = {
|
||||||
var a = (KNOWN_CODES[a.code] ? "000" + KNOWN_CODES[a.code] : a.code).toLowerCase(),
|
var a = (KNOWN_CODES[a.code] ? "000" + KNOWN_CODES[a.code] : a.code).toLowerCase(),
|
||||||
b = (KNOWN_CODES[b.code] ? "000" + KNOWN_CODES[b.code] : b.code).toLowerCase();
|
b = (KNOWN_CODES[b.code] ? "000" + KNOWN_CODES[b.code] : b.code).toLowerCase();
|
||||||
|
|
||||||
|
if ( a == "000grayface" ) a = "grayface";
|
||||||
|
if ( b == "000grayface" ) b = "grayface";
|
||||||
|
|
||||||
if ( a < b ) return -1;
|
if ( a < b ) return -1;
|
||||||
else if ( a > b ) return 1;
|
else if ( a > b ) return 1;
|
||||||
return 0;
|
return 0;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue