mirror of
https://github.com/FrankerFaceZ/FrankerFaceZ.git
synced 2025-09-17 02:16:54 +00:00
3.5.529. Tooltip stuff.
This commit is contained in:
parent
373f521de8
commit
e0bad1dc10
25 changed files with 549 additions and 97 deletions
|
@ -951,7 +951,7 @@ FFZ.prototype.modify_chat_room_manager = function(component) {
|
|||
tbl.innerHTML = '<thead><tr><th colspan="2">Channels</th><th class="ffz-row-switch" title="Pinning a channel makes it so you always join that channel\'s chat, no matter where you are on Twitch.">Pin</th></tr></thead><tbody></tbody>';
|
||||
room_list.insertBefore(tbl, room_list.firstChild);
|
||||
|
||||
jQuery('.ffz-row-switch', tbl).tipsy({gravity: utils.tooltip_placement(constants.TOOLTIP_DISTANCE, 'se')});
|
||||
jQuery('.ffz-row-switch', tbl).zipsy({gravity: utils.newtip_placement(constants.TOOLTIP_DISTANCE, 'se')});
|
||||
|
||||
chan_table = this._ffz_chan_table = tbl.querySelector('tbody');
|
||||
|
||||
|
@ -1171,7 +1171,7 @@ FFZ.prototype.modify_chat_room_manager = function(component) {
|
|||
link.title = "Chat Room Management";
|
||||
link.innerHTML = '<figure class="icon">' + constants.ROOMS + '</figure><span class="notifications"></span>';
|
||||
|
||||
jQuery(link).tipsy({gravity: "n", offset: 10});
|
||||
jQuery(link).zipsy({gravity: "n", offset: 10});
|
||||
|
||||
link.addEventListener('click', function() {
|
||||
view.set('isShowingList', !view.get('isShowingList'));
|
||||
|
|
|
@ -190,7 +190,7 @@ FFZ.prototype.modify_conversation_window = function(component) {
|
|||
header_name.setAttribute('data-color', raw_color);
|
||||
}
|
||||
|
||||
jQuery('.badge', el).tipsy({gravity: utils.tooltip_placement(constants.TOOLTIP_DISTANCE, 'n')});
|
||||
jQuery('.badge', el).zipsy({gravity: utils.newtip_placement(constants.TOOLTIP_DISTANCE, 'n')});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
|
@ -476,7 +476,7 @@ FFZ.prototype.modify_game_follow_button = function(component) {
|
|||
spoiler.addEventListener('click', click_button('spoiler_games', update_spoiler));
|
||||
el.appendChild(spoiler);
|
||||
|
||||
jQuery('.tooltip', el).tipsy();
|
||||
jQuery('.tooltip', el).zipsy();
|
||||
}
|
||||
})
|
||||
}
|
||||
|
@ -581,7 +581,7 @@ FFZ.prototype.modify_directory_live = function(component, mode) {
|
|||
t_el.appendChild(t_span);
|
||||
t_el.setAttribute('original-title', 'Stream Uptime <nobr>(since ' + up_since.toLocaleString() + ')</nobr>');
|
||||
|
||||
jQuery(t_el).tipsy({html: true, gravity: utils.tooltip_placement(constants.TOOLTIP_DISTANCE, 's')});
|
||||
jQuery(t_el).zipsy({html: true, gravity: utils.newtip_placement(constants.TOOLTIP_DISTANCE, 's')});
|
||||
cont.appendChild(t_el);
|
||||
}
|
||||
|
||||
|
@ -780,7 +780,7 @@ FFZ.prototype.modify_directory_host = function(component) {
|
|||
if ( hosts && hosts.length > 1 ) {
|
||||
title.textContent = utils.number_commas(hosts.length) + ' hosting ' + utils.sanitize(target.display_name);
|
||||
title.title = _.sortBy(hosts, "name").mapBy("display_name").join(", ");
|
||||
jQuery(title).tipsy({gravity: 's'});
|
||||
jQuery(title).zipsy({gravity: 's'});
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -86,9 +86,6 @@ FFZ.prototype.modify_feed_card = function(component) {
|
|||
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')});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
|
@ -121,7 +121,7 @@ FFZ.prototype.modify_twitch_profile_card = function(component) {
|
|||
var el = this.get('element');
|
||||
|
||||
el.classList.add('ffz-processed');
|
||||
jQuery('.aspect', el).tipsy();
|
||||
jQuery('.aspect', el).zipsy();
|
||||
|
||||
if ( ! f.settings.enhance_profile_following )
|
||||
return;
|
||||
|
@ -239,7 +239,7 @@ FFZ.prototype.modify_twitch_profile_card = function(component) {
|
|||
|
||||
el.classList.add('ffz-processed');
|
||||
|
||||
jQuery('.aspect', el).tipsy();
|
||||
jQuery('.aspect', el).zipsy();
|
||||
|
||||
if ( ! data )
|
||||
return false;
|
||||
|
|
|
@ -868,7 +868,8 @@ FFZ.prototype.setup_line = function() {
|
|||
|
||||
// Tipsy Handler
|
||||
jQuery(document.body).on("mouseleave", ".tipsy", function() {
|
||||
this.parentElement.removeChild(this);
|
||||
if ( ! this.classList.contains('zipsy') )
|
||||
this.parentElement.removeChild(this);
|
||||
});
|
||||
|
||||
// Aliases
|
||||
|
|
|
@ -1015,7 +1015,7 @@ FFZ.prototype.modify_moderation_card = function(component) {
|
|||
name.innerHTML = results[0];
|
||||
name.title = results[1] || '';
|
||||
if ( results[1] )
|
||||
jQuery(name).tipsy({html: true, gravity: utils.tooltip_placement(constants.TOOLTIP_DISTANCE, 'n')});
|
||||
jQuery(name).zipsy({html: true, gravity: utils.newtip_placement(constants.TOOLTIP_DISTANCE, 'n')});
|
||||
}
|
||||
});
|
||||
});
|
||||
|
@ -1105,9 +1105,9 @@ FFZ.prototype.modify_moderation_card = function(component) {
|
|||
add_btn_make = function(label, cmd) {
|
||||
var btn = utils.createElement('button', 'button ffz-no-bg', utils.sanitize(label));
|
||||
|
||||
jQuery(btn).tipsy({
|
||||
jQuery(btn).zipsy({
|
||||
html: true,
|
||||
gravity: utils.tooltip_placement(constants.TOOLTIP_DISTANCE, 'n'),
|
||||
gravity: utils.newtip_placement(constants.TOOLTIP_DISTANCE, 'n'),
|
||||
title: function() {
|
||||
var user = t.get('cardInfo.user'),
|
||||
chat_controller = utils.ember_lookup('controller:chat'),
|
||||
|
@ -1169,7 +1169,7 @@ FFZ.prototype.modify_moderation_card = function(component) {
|
|||
else if ( f.settings.mod_card_hotkeys && timeout === 1 )
|
||||
btn.title = "(P)urge - " + btn.title;
|
||||
|
||||
jQuery(btn).tipsy({gravity: utils.tooltip_placement(constants.TOOLTIP_DISTANCE, 'n')});
|
||||
jQuery(btn).zipsy({gravity: utils.newtip_placement(constants.TOOLTIP_DISTANCE, 'n')});
|
||||
|
||||
btn.addEventListener('click', btn_click.bind(this, timeout));
|
||||
return btn;
|
||||
|
@ -1220,7 +1220,7 @@ FFZ.prototype.modify_moderation_card = function(component) {
|
|||
unban_btn.innerHTML = '<figure class="icon">' + CHECK + '</figure>';
|
||||
unban_btn.title = (f.settings.mod_card_hotkeys ? "(U)" : "U") + "nban User";
|
||||
|
||||
jQuery(unban_btn).tipsy({gravity: utils.tooltip_placement(constants.TOOLTIP_DISTANCE, 'n')});
|
||||
jQuery(unban_btn).zipsy({gravity: utils.newtip_placement(constants.TOOLTIP_DISTANCE, 'n')});
|
||||
unban_btn.addEventListener("click", btn_click.bind(this, -1));
|
||||
|
||||
jQuery(ban_btn).after(unban_btn);
|
||||
|
@ -1229,7 +1229,8 @@ FFZ.prototype.modify_moderation_card = function(component) {
|
|||
|
||||
|
||||
// Tooltips for ban and ignore.
|
||||
jQuery("button.ignore, button.ban").tipsy({gravity: utils.tooltip_placement(constants.TOOLTIP_DISTANCE, 'n')});
|
||||
jQuery("button.ignore, button.ban").zipsy({
|
||||
gravity: utils.newtip_placement(constants.TOOLTIP_DISTANCE, 'n')});
|
||||
|
||||
|
||||
// More Fixing Other Buttons
|
||||
|
@ -1245,7 +1246,8 @@ FFZ.prototype.modify_moderation_card = function(component) {
|
|||
// Follow Button
|
||||
var follow_button = el.querySelector(".follow-button");
|
||||
if ( follow_button )
|
||||
jQuery(follow_button).tipsy({title: function() { return follow_button.classList.contains('is-following') ? "Unfollow" : "Follow"}});
|
||||
jQuery(follow_button).zipsy({
|
||||
title: function() { return follow_button.classList.contains('is-following') ? "Unfollow" : "Follow"}});
|
||||
|
||||
|
||||
// Whisper and Message Buttons
|
||||
|
@ -1257,7 +1259,8 @@ FFZ.prototype.modify_moderation_card = function(component) {
|
|||
msg_btn.classList.add('message');
|
||||
|
||||
msg_btn.title = "Whisper User";
|
||||
jQuery(msg_btn).tipsy({gravity: utils.tooltip_placement(constants.TOOLTIP_DISTANCE, 'n')});
|
||||
jQuery(msg_btn).zipsy({
|
||||
gravity: utils.newtip_placement(constants.TOOLTIP_DISTANCE, 'n')});
|
||||
|
||||
|
||||
var real_msg = utils.createElement('button', 'message-button button float-left button--icon-only message html-tooltip');
|
||||
|
@ -1365,7 +1368,9 @@ FFZ.prototype.modify_moderation_card = function(component) {
|
|||
name.innerHTML = results[0];
|
||||
name.title = results[1] || '';
|
||||
if ( results[1] )
|
||||
jQuery(name).tipsy({html: true, gravity: utils.tooltip_placement(constants.TOOLTIP_DISTANCE, 'n')});
|
||||
jQuery(name).zipsy({
|
||||
html: true,
|
||||
gravity: utils.newtip_placement(constants.TOOLTIP_DISTANCE, 'n')});
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -956,7 +956,7 @@ FFZ.prototype.modify_room_component = function(component) {
|
|||
if ( ! badge ) {
|
||||
badge = utils.createElement('span', 'ffz room-state stat float-right', (label || info[0]).charAt(0).toUpperCase() + '<span>' + (label || info[0]).substr(1).toUpperCase() + '</span>');
|
||||
badge.id = id;
|
||||
jQuery(badge).tipsy({html: true, gravity: utils.tooltip_placement(constants.TOOLTIP_DISTANCE, 'se')});
|
||||
jQuery(badge).zipsy({html: true, gravity: utils.newtip_placement(constants.TOOLTIP_DISTANCE, 'se')});
|
||||
container.appendChild(badge);
|
||||
}
|
||||
|
||||
|
|
|
@ -495,13 +495,14 @@ FFZ.prototype.modify_navigation = function(component, is_top_nav) {
|
|||
_initTooltips: function() {
|
||||
this._tipsySelector = this.$("#js-warp a, #small_search button, #small_more button");
|
||||
this._tipsySelector.off("mouseenter").off("mouseleave").teardownTipsy();
|
||||
this._tipsySelector.tipsy({gravity: utils.tooltip_placement(constants.TOOLTIP_DISTANCE, 'w')});
|
||||
this._tipsySelector.zipsy({
|
||||
gravity: utils.newtip_placement(constants.TOOLTIP_DISTANCE, 'w')});
|
||||
|
||||
this.$('a[data-href="following"]').tipsy({
|
||||
this.$('a[data-href="following"]').zipsy({
|
||||
html: true,
|
||||
className: function() { return f.settings.following_count ? 'ffz-wide-tip' : '' },
|
||||
title: function() { return f._build_following_tooltip(this) },
|
||||
gravity: utils.tooltip_placement(constants.TOOLTIP_DISTANCE * 2, 'w')
|
||||
gravity: utils.newtip_placement(constants.TOOLTIP_DISTANCE * 2, 'w')
|
||||
});
|
||||
},
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue