diff --git a/dark.css b/dark.css index 0b762196..89ded21a 100644 --- a/dark.css +++ b/dark.css @@ -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 } diff --git a/src/commands.js b/src/commands.js index 811272ca..78d8d6a8 100644 --- a/src/commands.js +++ b/src/commands.js @@ -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) { diff --git a/src/ember/channel.js b/src/ember/channel.js index 24a2ec31..a2882702 100644 --- a/src/ember/channel.js +++ b/src/ember/channel.js @@ -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 = 'Subscribe$599.99'; - - 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(); diff --git a/src/ember/feed-card.js b/src/ember/feed-card.js new file mode 100644 index 00000000..a8bccaaf --- /dev/null +++ b/src/ember/feed-card.js @@ -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 = '

' + output + '

'; + + 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')}); + } + }); +} \ No newline at end of file diff --git a/src/ember/room.js b/src/ember/room.js index 5a15dbb6..7da44031 100644 --- a/src/ember/room.js +++ b/src/ember/room.js @@ -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); } diff --git a/src/emoticons.js b/src/emoticons.js index d7c15adb..6bb83ed3 100644 --- a/src/emoticons.js +++ b/src/emoticons.js @@ -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); diff --git a/src/main.js b/src/main.js index b862ec78..cf259318 100644 --- a/src/main.js +++ b/src/main.js @@ -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(); diff --git a/src/socket.js b/src/socket.js index 7a58c9fa..3644427a 100644 --- a/src/socket.js +++ b/src/socket.js @@ -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 ) { diff --git a/src/tokenize.js b/src/tokenize.js index 9b5a15a8..d247e7be 100644 --- a/src/tokenize.js +++ b/src/tokenize.js @@ -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 ? `` : ''; image = preview_url ? '' : ''; - 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); diff --git a/src/ui/menu.js b/src/ui/menu.js index 912f9a90..7b563d88 100644 --- a/src/ui/menu.js +++ b/src/ui/menu.js @@ -406,13 +406,13 @@ FFZ.prototype._ui_change_page = function(view, inner, menu, container, page) { var subpages = []; 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)))) ) - continue; - } catch(err) { - this.error("menu_pages " + page + " subpage " + key + " visible: " + err); - continue; - } + try { + 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); + continue; + } subpages.push([subpage.sort_order || 0, key, subpage]); } diff --git a/src/ui/my_emotes.js b/src/ui/my_emotes.js index aac547fd..80cec9c2 100644 --- a/src/ui/my_emotes.js +++ b/src/ui/my_emotes.js @@ -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) { diff --git a/style.css b/style.css index fb67f826..9996bda9 100644 --- a/style.css +++ b/style.css @@ -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 */ @@ -2721,90 +2721,4 @@ 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 } \ No newline at end of file +} \ No newline at end of file