1
0
Fork 0
mirror of https://github.com/FrankerFaceZ/FrankerFaceZ.git synced 2025-07-25 12:08:30 +00:00

3.5.156. Feed Cards. CSS tweaks. Fixed Golden Kappa's tooltip. Not much here.

This commit is contained in:
SirStendec 2016-04-11 18:57:25 -04:00
parent 9ead660f89
commit 21d1ce0d8f
12 changed files with 130 additions and 127 deletions

View file

@ -1119,6 +1119,9 @@ body.ffz-dark,
/* Activity Feeds */
.button.alert { color: #fff !important }
.ffz-dark .activity-notice { background-color: rgba(24,24,24,0.9) }
.ffz-dark .pill { background-color: rgba(255,255,255,0.2) }
.ffz-dark .activity-list-end svg { fill: #474747 }

View file

@ -41,7 +41,7 @@ FFZ.ffz_commands.reload = function(room, args) {
// Emote Sets
for(var set_id in this.emote_sets) {
var es = this.emote_sets[set_id];
if ( es.hasOwnProperty('source_ext') )
if ( ! es || es.hasOwnProperty('source_ext') )
continue;
promises.push(new Promise(function(done, fail) {

View file

@ -216,30 +216,13 @@ FFZ.prototype._modify_cindex = function(view) {
el.classList.add('ffz-channel');
// Try changing the theater mode tooltip.
/* Deprecated: Theatre button is now in the player.
var tb = this.$('.theatre-button > a'),
opts = tb.data('tipsy');
tb.attr('title', 'Theater Mode (Alt+T)');
if ( opts && opts.options && typeof opts.options.gravity !== "function" )
opts.options.gravity = utils.tooltip_placement(constants.TOOLTIP_DISTANCE, opts.options.gravity || 'n');
/*if ( id === 'memeathon' ) {
var sb = document.createElement('a');
sb.className = 'action button js-sub-button primary subscribe-button meme-sub-button';
sb.id = 'meme-scribe';
sb.innerHTML = '<span class="subscribe-text">Subscribe</span><span class="subscribe-price">$599.99</span>';
var actions = el.querySelector('.channel-actions');
if ( actions ) {
var c = actions.querySelector('.notification-controls') || actions.querySelector('.follow-button');
if ( c )
actions.insertBefore(sb, c.nextSibling);
else
actions.appendChild(sb);
}
}*/
opts.options.gravity = utils.tooltip_placement(constants.TOOLTIP_DISTANCE, opts.options.gravity || 'n');*/
this.ffzFixTitle();
this.ffzUpdateUptime();

98
src/ember/feed-card.js Normal file
View file

@ -0,0 +1,98 @@
var FFZ = window.FrankerFaceZ,
utils = require('../utils'),
constants = require('../constants'),
parse_emotes = function(emotes) {
var output = {};
if ( ! emotes || ! emotes.length )
return output;
for(var i=0; i < emotes.length; i++) {
var emote = emotes[i];
if ( ! emote || ! emote.id )
continue;
var entries = output[emote.id] = output[emote.id] || [];
entries.push([emote.start, emote.end]);
}
return output;
};
FFZ.prototype.setup_feed_cards = function() {
var FeedCard = utils.ember_resolve('component:feed-card');
if ( ! FeedCard )
return;
this._modify_feed_card(FeedCard);
try { FeedCard.create().destroy();
} catch(err) { }
this.rerender_feed_cards();
}
FFZ.prototype.rerender_feed_cards = function(for_set) {
var FeedCard = utils.ember_resolve('component:feed-card'),
views = utils.ember_views();
if ( ! FeedCard )
return;
for(var view_id in views) {
var view = views[view_id];
if ( view instanceof FeedCard ) {
try {
if ( ! view.ffzInit )
this._modify_feed_card(view);
view.ffzInit(for_set);
} catch(err) {
this.error("setup component:feed-card ffzInit: " + err)
}
}
}
}
FFZ.prototype._modify_feed_card = function(component) {
var f = this;
component.reopen({
didInsertElement: function() {
this._super();
try {
this.ffzInit();
} catch(err) {
f.error("component:feed-card ffzInit: " + err);
}
},
ffzInit: function(for_set) {
var el = this.get('element'),
message = this.get('post.body'),
emotes = parse_emotes(this.get('post.emotes')),
user_id = this.get('post.user.login'),
room_id = this.get('channelId'),
pbody = el && el.querySelector('.activity-body');
if ( ! message || ! el || ! pbody )
return;
// If this is for a specific emote set, only rerender if it matters.
if ( for_set && f.rooms && f.rooms[room_id] ) {
var sets = f.getEmotes(user_id, room_id);
if ( sets.indexOf(for_set) === -1 )
return;
}
var tokens = f.tokenize_feed_body(message, emotes, user_id, room_id),
output = f.render_tokens(tokens, true, false);
pbody.innerHTML = '<p>' + output + '</p>';
jQuery('.ffz-tooltip', pbody).tipsy({html: true, title: f.render_tooltip(), gravity: utils.tooltip_placement(2*constants.TOOLTIP_DISTANCE, 'n')});
jQuery('.html-tooltip', pbody).tipsy({html: true, gravity: utils.tooltip_placement(2*constants.TOOLTIP_DISTANCE, 'n')});
}
});
}

View file

@ -917,6 +917,9 @@ FFZ.prototype._load_room_json = function(room_id, callback, data) {
this.update_ui_link();
if ( data.set )
this.rerender_feed_cards(data.set);
if ( callback )
callback(true, data);
}

View file

@ -8,7 +8,7 @@ var FFZ = window.FrankerFaceZ,
if ( ! emote.margins && ! emote.css )
return "";
return 'img[src="' + emote.urls[1] + '"] { ' + (emote.margins ? "margin: " + emote.margins + ";" : "") + (emote.css || "") + " }\n";
return 'img[data-ffz-emote="' + emote.id + '"] { ' + (emote.margins ? "margin: " + emote.margins + ";" : "") + (emote.css || "") + " }\n";
};
@ -413,7 +413,7 @@ FFZ.prototype._load_set_json = function(set_id, callback, data) {
if ( this._inputv )
Ember.propertyDidChange(this._inputv, 'ffz_emoticons');
this.rerender_feed_cards();
this.rerender_feed_cards(set_id);
if ( callback )
callback(true, data);

View file

@ -35,7 +35,7 @@ FFZ.msg_commands = {};
// Version
var VER = FFZ.version_info = {
major: 3, minor: 5, revision: 152,
major: 3, minor: 5, revision: 156,
toString: function() {
return [VER.major, VER.minor, VER.revision].join(".") + (VER.extra || "");
}
@ -181,7 +181,6 @@ require('./ui/about_page');
require('./commands');
require('./ext/api');
//require('./memes');
// ---------------
@ -436,8 +435,6 @@ FFZ.prototype.init_ember = function(delay) {
this.find_bttv(10);
this.find_emote_menu(10);
//this.setup_memes();
//this.check_news();
this.check_ff();
this.refresh_chat();

View file

@ -429,6 +429,7 @@ FFZ.ws_commands.do_authorize = function(data) {
continue;
var r = this.rooms[room_id];
if ( r && r.room && !r.room.get('roomProperties.eventchat') && !r.room.get('isGroupRoom') && r.room.tmiRoom ) {
var c = r.room.tmiRoom._getConnection();
if ( c.isConnected ) {

View file

@ -260,6 +260,9 @@ FFZ.prototype.render_tooltip = function(el) {
var preview_url, width=0, height=0, image, set_id, emote, emote_set,
emote_id = this.getAttribute('data-ffz-emote');
if ( emote_id ) {
if ( emote_id == "93269" )
return '';
set_id = this.getAttribute('data-ffz-set');
emote_set = f.emote_sets[set_id];
emote = emote_set && emote_set.emoticons[emote_id];
@ -305,7 +308,8 @@ FFZ.prototype.render_tooltip = function(el) {
//image = preview_url ? `<img style="height:112px" class="emoticon ffz-image-hover" src="${preview_url}?_=preview">` : '';
image = preview_url ? '<img style="height:112px" class="emoticon ffz-image-hover" src="' + preview_url + '"?_=preview">' : '';
if ( emote_set === "--global--" ) {
// Global OR Golden Kappa
if ( emote_set === "--global--" || emote_id === '80393' ) {
emote_set = "Twitch Global";
set_type = null;
} else if ( emote_set === "--twitch-turbo--" || emote_set === "turbo" || emote_set === "--turbo-faces--" ) {
@ -622,7 +626,7 @@ FFZ.prototype.tokenize_line = function(user, room, message, no_emotes, no_emoji)
}
FFZ.prototype.tokenize_feed_body = function(message, emotes, user_id) {
FFZ.prototype.tokenize_feed_body = function(message, emotes, user_id, room_id) {
"use strict";
if ( typeof message === "string" )
@ -658,7 +662,7 @@ FFZ.prototype.tokenize_feed_body = function(message, emotes, user_id) {
}
}
tokens = this.tokenize_emotes(user_id, user_id, tokens)
tokens = this.tokenize_emotes(user_id, room_id, tokens)
if ( this.settings.parse_emoji )
tokens = this.tokenize_emoji(tokens);

View file

@ -407,7 +407,7 @@ FFZ.prototype._ui_change_page = function(view, inner, menu, container, page) {
for(var key in data.pages) {
var subpage = data.pages[key];
try {
if ( ! subpage || (subpage.hasOwnProperty("visible") && (!subpage.visible || (typeof subpage.visible === "function" && !subpage.visible.call(this, view)))) )
if ( ! subpage || (subpage.hasOwnProperty("visible") && (!subpage.visible || (typeof subpage.visible == "function" && !subpage.visible.call(this, view)))) )
continue;
} catch(err) {
this.error("menu_pages " + page + " subpage " + key + " visible: " + err);

View file

@ -108,7 +108,7 @@ FFZ.menu_pages.myemotes = {
},
visible: function(view) {
return this.settings.emoji_in_menu || FFZ.menu_pages.myemotes.has_sets.apply(this, view);
return this.settings.emoji_in_menu || FFZ.menu_pages.myemotes.has_sets.call(this, view);
},
default_page: function() {
@ -139,7 +139,7 @@ FFZ.menu_pages.myemotes = {
sort_order: 2,
visible: function(view) {
return FFZ.menu_pages.myemotes.has_sets.apply(this, view);
return FFZ.menu_pages.myemotes.has_sets.call(this, view);
},
render: function(view, container) {

View file

@ -1819,9 +1819,9 @@ body.ffz-minimal-chat-input .ember-chat .chat-interface .textarea-contain textar
pointer-events: none;
}
/*.chat-container:not(.chatReplay) .chat-interface .more-messages-indicator.ffz-freeze-indicator {
.chat-container:not(.chatReplay) .chat-interface .more-messages-indicator.ffz-freeze-indicator {
top: 0;
}*/
}
/* Chat History */
@ -2722,89 +2722,3 @@ body:not(.ffz-creative-showcase) .creative-hero,
.ember-chat .chat-interface .suggestions.ffz-suggestions .suggestion.has-image:not(.has-info) {
line-height: 40px;
}
/* Dank */
.big-memes.ffz-channel[data-channel="memeathon"]:after,
.streams .ember-view[data-channel="memeathon"] .stream .thumb:after {
content: "";
position: absolute;
top: 0; bottom: 0;
left: 0; right: 0;
background: url("//cdn.frankerfacez.com/script/wow.gif") no-repeat;
background-size: contain;
background-position: bottom right;
pointer-events: none;
}
.big-memes.ffz-channel[data-channel="memeathon"]:after { background-size: 50% }
.ffz-channel[data-channel="memeathon"] {
margin-top: -30px;
padding-top: 30px;
background-image: linear-gradient(rgba(255,255,255,0.5) 0%, rgba(255,255,255,0.8) 1080px),
url("https://static-cdn.jtvnw.net/jtv_user_pictures/memeathon-channel_offline_image-806e8ad012b1e372-1920x1080.png");
}
.ffz-bttv-dark .ffz-channel[data-channel="memeathon"],
.ffz-dark .ffz-channel[data-channel="memeathon"] {
background-image: linear-gradient(rgba(0,0,0,0.65) 0%, rgba(0,0,0,0.85) 1080px),
url("https://static-cdn.jtvnw.net/jtv_user_pictures/memeathon-channel_offline_image-806e8ad012b1e372-1920x1080.png");
}
.ember-chat[data-room="memeathon"] {
background-position: left center;
background-image: linear-gradient(rgba(242,242,242,0.9) 0%, rgba(242,242,242,0.9) 1%),
url("https://static-cdn.jtvnw.net/jtv_user_pictures/memeathon-channel_offline_image-806e8ad012b1e372-1920x1080.png");
}
.ffz-bttv-dark .ember-chat[data-room="memeathon"],
.theatre .ember-chat[data-room="memeathon"],
.dark .ember-chat[data-room="memeathon"],
.force-dark .ember-chat[data-room="memeathon"] {
background-image: linear-gradient(rgba(25,25,25,0.95) 0%, rgba(25,25,25,0.95) 1%),
url("https://static-cdn.jtvnw.net/jtv_user_pictures/memeathon-channel_offline_image-806e8ad012b1e372-1920x1080.png");
}
.ffz-channel[data-channel="memeathon"] #broadcast-meta .title {
text-shadow: 1px 0 0 #fff, -1px 0 0 #fff, 0 1px 0 #fff, 0 -1px 0 #fff;
}
.theatre .ffz-channel[data-channel="memeathon"] #broadcast-meta .title,
.ffz-dark .ffz-channel[data-channel="memeathon"] #broadcast-meta .title { text-shadow: none; }
.ffz-channel[data-channel="memeathon"] #broadcast-meta,
.ffz-channel[data-channel="memeathon"] #broadcast-meta .title {
transform: scaleX(-1);
}
.ffz-channel[data-channel="memeathon"] #broadcast-meta .profile-photo {
transform: scaleX(-1) rotate(12deg);
}
.player[data-channel="memeathon"] .player-loading-spinner {
background: url("//cdn.frankerfacez.com/script/lanking.png") no-repeat;
width: 188px;
height: 188px;
border: none;
animation: loading-spin 1.5s infinite linear;
}
/* Allow Zalgo */
.chat-line[data-room="memeathon"] { overflow: visible !important }
/* Tilted * /
.tilted.ember-chat[data-room="memeathon"] { transform: rotate(2deg); }
/* Comic Sans * /
.comic-sans.chat-line[data-room="memeathon"] { font-family: "Comic Sans MS"; }
/* BILLY MAYS * /
.billy-mays.chat-line[data-room="memeathon"] { text-transform: uppercase; }
/* Upside Down * /
.upside-down.chat-line[data-room="memeathon"] { transform: scale(-1) }
/* Big Emotes * /
.big-emotes.chat-line[data-room="memeathon"] .emoticon { zoom: 2 }