diff --git a/dark.css b/dark.css index 2cdd6884..0b762196 100644 --- a/dark.css +++ b/dark.css @@ -149,6 +149,8 @@ body.ffz-dark, border-color: #32323e !important; } +.ffz-dark .balloon, +.ffz-dark .balloon:after, .ffz-dark .conversation-settings-menu, .ffz-dark .ember-chat .chat-interface .ffz-ui-popup.emoticon-selector .emoticon-selector-box, .ffz-dark .card:not(#passport_modal), @@ -173,6 +175,8 @@ body.ffz-dark, box-shadow: rgba(255,255,255,0.2) 0 0 0 1px inset; } +.ffz-dark .balloon:after { box-shadow: none } + .ffz-dark .st-autocomplete-sidebar .label, .ffz-dark .st-autocomplete-small .label, .ffz-dark .st-autocomplete .label, @@ -1113,113 +1117,44 @@ body.ffz-dark, } -/*.ffz-dark .ignore-cta { - background-color: #333; - box-shadow: 0 3px 0 #000; +/* Activity Feeds */ + +.ffz-dark .pill { background-color: rgba(255,255,255,0.2) } + +.ffz-dark .activity-list-end svg { fill: #474747 } + +.ffz-dark .activity-meta:before { background-color: #474747 } + +.ffz-dark .activity-react__like:hover { + border-color: #d5d5d5; + background-color: #242424; } -.ffz-dark .ignore-cta .conversation-system-message { - color: #ccc; +.ffz-dark .activity-react__like svg.endorse-icon #head__base { fill: #fff } + +.ffz-dark .activity-create__actions { + background-color: #191919; + box-shadow: 0 -1px 0 #474747; } -.ffz-dark .conversations-list-icon { - background: #19191f; - color: #8c8c9c; - border-color: #19191f +.ffz-dark .activity-create, +.ffz-dark .activity-react__like { + border-color: #474747; + color: #fff !important; + background-color: #191919; } -.ffz-dark .conversations-list-icon:hover { - color: #fff +.ffz-dark .activity-meta:before, +.ffz-dark .activity-card { + border-color: #474747; } -.ffz-dark .conversations-list { - background: #19191f; - border: 1px solid #32323e; - color: #fff +.ffz-dark .activity-card__status { + background-color: #191919; } -.ffz-dark .conversations-list:after { - border-color: rgba(25,25,31,0); - border-top-color: #19191f; - border-width: 10px; - margin-left: -10px +.ffz-dark .activity-meta { + box-shadow: inset 0 -1px 0 #474747; } -.ffz-dark .conversations-list:before { - right: 9px; - border-color: rgba(50,50,62,0); - border-top-color: #32323e -} - -.ffz-dark .conversations-list .conversations-list-header { - background: #121218; - border-bottom: 1px solid #32323e; - color: #fff -} - -.ffz-dark .conversations-list .conversation-preview-line { - color: #8c8c9c -} - -.ffz-dark .conversations-list .conversations-list-item { - border-bottom: 1px solid #32323e -} - -.ffz-dark .conversations-list .conversations-list-item:hover { - background-color: #121218; -} - -.ffz-dark .conversation-window { - background: #19191f; - box-shadow: none; - color: #8c8c9c; -} - -.ffz-dark .conversations-list-icon, -.ffz-dark .conversation-window { - border: 1px solid rgba(255,255,255,0.2); - border-bottom: none; -} - -.ffz-dark .conversation-header { - background: #121217; - box-shadow: none; -} - -.ffz-dark .conversation-window:not(.collapsed) .conversation-header { - border-bottom: 1px solid rgba(255,255,255,0.2); -} - -.ffz-dark .conversation-input-bar textarea { - border-color: rgba(255,255,255,0.1); - background-color: rgba(255,255,255,0.05); - color: #b6b6b6 -} - -.ffz-dark .conversation-input-actions .button, -.ffz-dark .conversation-input-actions .follow-button:not(.ember-follow) .follow { - background-color: #444 -} - -.ffz-dark .conversation-window.has-focus .conversation-header { - background-color: #121217 -} - -.ffz-dark .conversation-window.has-focus .conversation-header-name { - color: #fff -} - -.ffz-dark .conversation-window.has-focus .conversation-input-bar textarea:focus { - border-color: rgba(255,255,255,0.2) -} - -.ffz-dark .conversation-window.has-focus .conversation-input-actions .button, -.ffz-dark .conversation-window.has-focus .conversation-input-actions .follow-button:not(.ember-follow) .follow { - background-color: #6441a5 -} - -.ffz-dark .conversation-window .timestamp-line span, -.ffz-dark .conversation-window .new-message-divider span { background: transparent; } - -.ffz-dark .conversation-window .timestamp-line:after, -.ffz-dark .conversation-window .new-message-divider:after { display: none; }*/ \ No newline at end of file +.ffz-dark a.balloon__link:hover { color: #fff !important } \ No newline at end of file diff --git a/src/ember/channel.js b/src/ember/channel.js index 9351c6e1..24a2ec31 100644 --- a/src/ember/channel.js +++ b/src/ember/channel.js @@ -224,6 +224,23 @@ FFZ.prototype._modify_cindex = function(view) { 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); + } + }*/ + + this.ffzFixTitle(); this.ffzUpdateUptime(); this.ffzUpdateChatters(); diff --git a/src/ember/chatview.js b/src/ember/chatview.js index 80833f0d..c90599b6 100644 --- a/src/ember/chatview.js +++ b/src/ember/chatview.js @@ -514,6 +514,11 @@ FFZ.prototype._modify_cview = function(view) { ffzInit: function() { f._chatv = this; + var room_id = this.get('controller.currentRoom.id'), + el = this.get('element'); + + el && el.setAttribute('data-room', room_id || ""); + this.$('.textarea-contain').append(f.build_ui_link(this)); this.$('.chat-messages').find('.html-tooltip').tipsy({live: true, html: true, gravity: utils.tooltip_placement(2*constants.TOOLTIP_DISTANCE, 'n')}); this.$('.chat-messages').find('.ffz-tooltip').tipsy({live: true, html: true, title: f.render_tooltip(), gravity: utils.tooltip_placement(2*constants.TOOLTIP_DISTANCE, 'n')}); @@ -589,6 +594,7 @@ FFZ.prototype._modify_cview = function(view) { var room = this.get('controller.currentRoom'), room_id = room && room.get('id'), + el = this.get('element'), was_unread = room_id && this.ffz_unread[room_id], update_height = false; @@ -597,6 +603,7 @@ FFZ.prototype._modify_cview = function(view) { room.ffz_last_view = Date.now(); } + el && el.setAttribute('data-room', room_id || ""); if ( room && room._ffz_tab ) { var was_hidden = room._ffz_tab.classList.contains('hidden'), diff --git a/src/emoticons.js b/src/emoticons.js index 0e261442..d7c15adb 100644 --- a/src/emoticons.js +++ b/src/emoticons.js @@ -413,6 +413,8 @@ FFZ.prototype._load_set_json = function(set_id, callback, data) { if ( this._inputv ) Ember.propertyDidChange(this._inputv, 'ffz_emoticons'); + this.rerender_feed_cards(); + if ( callback ) callback(true, data); } \ No newline at end of file diff --git a/src/ext/betterttv.js b/src/ext/betterttv.js index 9a389ade..943f1467 100644 --- a/src/ext/betterttv.js +++ b/src/ext/betterttv.js @@ -49,6 +49,7 @@ FFZ.prototype.setup_bttv = function(delay) { } document.body.classList.add('ffz-bttv'); + document.body.classList.toggle('ffz-bttv-dark', BetterTTV.settings.get('darkenedMode')); // Disable Chat Tabs if ( this._chatv ) { diff --git a/src/main.js b/src/main.js index 81f0f253..b862ec78 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: 151, + major: 3, minor: 5, revision: 152, toString: function() { return [VER.major, VER.minor, VER.revision].join(".") + (VER.extra || ""); } @@ -153,6 +153,7 @@ require('./ember/chat-input'); //require('./ember/teams'); require('./ember/directory'); require('./ember/following'); +require('./ember/feed-card'); require('./debug'); @@ -180,6 +181,7 @@ require('./ui/about_page'); require('./commands'); require('./ext/api'); +//require('./memes'); // --------------- @@ -415,6 +417,7 @@ FFZ.prototype.init_ember = function(delay) { this.setup_chat_input(); this.setup_directory(); this.setup_profile_following(); + this.setup_feed_cards(); //this.setup_teams(); @@ -433,6 +436,8 @@ 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/tokenize.js b/src/tokenize.js index e2e83134..9b5a15a8 100644 --- a/src/tokenize.js +++ b/src/tokenize.js @@ -622,115 +622,162 @@ FFZ.prototype.tokenize_line = function(user, room, message, no_emotes, no_emoji) } +FFZ.prototype.tokenize_feed_body = function(message, emotes, user_id) { + "use strict"; + + if ( typeof message === "string" ) + message = [{type: "text", text: message}]; + + if ( helpers && helpers.linkifyMessage ) + message = helpers.linkifyMessage(message); + + if ( helpers && helpers.emoticonizeMessage ) + message = helpers.emoticonizeMessage(message, emotes); + + // Tokenize Lines + var tokens = [], token; + + for(var i = 0; i < message.length; i++) { + token = message[i]; + if ( ! token ) + continue; + + if ( typeof token !== "string" ) + if ( token.type === "text" ) + token = token.text; + else { + tokens.push(token); + continue; + } + + var segments = token.split(/\n/g); + while(segments.length) { + tokens.push({type: "text", text: segments.shift()}); + if ( segments.length ) + tokens.push({type: "raw", html: "
"});
+ }
+ }
+
+ tokens = this.tokenize_emotes(user_id, user_id, tokens)
+
+ if ( this.settings.parse_emoji )
+ tokens = this.tokenize_emoji(tokens);
+
+ return tokens;
+}
+
+
+FFZ.prototype.render_token = function(render_links, warn_links, token) {
+ if ( ! token )
+ return "";
+
+ if ( token.hidden )
+ return "";
+
+ else if ( token.type === "raw" )
+ return token.html;
+
+ else if ( token.type === "emoticon" ) {
+ var src = token.imgSrc, srcset, cls, extra;
+ if ( token.ffzEmote ) {
+ var emote_set = this.emote_sets && this.emote_sets[token.ffzEmoteSet],
+ emote = emote_set && emote_set.emoticons && emote_set.emoticons[token.ffzEmote];
+
+ srcset = emote ? emote.srcSet : token.srcSet;
+ //extra = (emote ? ` data-ffz-emote="${emote.id}"` : '') + (emote_set ? ` data-ffz-set="${emote_set.id}"` : '');
+ extra = (emote ? ' data-ffz-emote="' + emote.id + '"' : '') + (emote_set ? ' data-ffz-set="' + emote_set.id + '"' : '')
+
+ } else if ( token.ffzEmoji ) {
+ var setting = this.settings.parse_emoji;
+ if ( setting === 0 || (setting === 1 && ! token.tw) || (setting === 2 && ! token.noto) || (setting === 3 && ! token.one) )
+ return token.altText;
+
+ src = setting === 3 ? token.one_src : (setting === 2 ? token.noto_src : token.tw_src);
+ //extra = ` data-ffz-emoji="${token.ffzEmoji}" height="18px"`;
+ extra = ' data-ffz-emoji="' + token.ffzEmoji + '" height="18px"';
+ cls = ' emoji';
+
+ } else {
+ var id = FFZ.src_to_id(src),
+ replacement = this.settings.replace_bad_emotes && constants.EMOTE_REPLACEMENTS[id];
+
+ //extra = ` data-emote="${id}" onerror="FrankerFaceZ._emote_mirror_swap(this)"`;
+ extra = ' data-emote="' + id + '" onerror="FrankerFaceZ._emote_mirror_swap(this)"';
+
+ if ( replacement ) {
+ src = constants.EMOTE_REPLACEMENT_BASE + replacement;
+ srcset = '';
+ } else
+ srcset = utils.build_srcset(id);
+ }
+
+ //return ``;
+ return '
';
+ }
+
+ else if ( token.type === "link" ) {
+ var text = token.title || (token.isLong && '
`;
- return '
';
- }
-
- else if ( token.type === "link" ) {
- var text = token.title || (token.isLong && '