瀏覽代碼

ref(tooltips): remove old tooltips

j8
Leonard Kim 8 年之前
父節點
當前提交
28b4595561
共有 7 個文件被更改,包括 1 次插入164 次删除
  1. 0
    15
      css/_base.scss
  2. 0
    1
      css/_variables.scss
  3. 0
    21
      modules/UI/UI.js
  4. 0
    86
      modules/UI/util/Tooltip.js
  5. 1
    3
      package.json
  6. 0
    3
      react/features/toolbox/actions.web.js
  7. 0
    35
      react/features/toolbox/functions.web.js

+ 0
- 15
css/_base.scss 查看文件

@@ -119,21 +119,6 @@ form {
119 119
     font-size: 12px;
120 120
 }
121 121
 
122
-/**
123
-* Tooltips
124
-**/
125
-.tipsy {
126
-    z-index: $tooltipsZ;
127
-    &-inner {
128
-        background-color: $tooltipBg;
129
-        max-width: 350px;
130
-    }
131
-
132
-    &-arrow {
133
-        border-color: $tooltipBg;
134
-    }
135
-}
136
-
137 122
 /**
138 123
 * Dialogs fade
139 124
 */

+ 0
- 1
css/_variables.scss 查看文件

@@ -28,7 +28,6 @@ $defaultColor: #F1F1F1;
28 28
 $defaultSideBarFontColor: #44A5FF;
29 29
 $defaultSemiDarkColor: #ACACAC;
30 30
 $defaultDarkColor: #2b3d5c;
31
-$tooltipBg: rgba(0,0,0, 0.7);
32 31
 
33 32
 /**
34 33
  * Toolbar

+ 0
- 21
modules/UI/UI.js 查看文件

@@ -10,7 +10,6 @@ import Avatar from "./avatar/Avatar";
10 10
 import SideContainerToggler from "./side_pannels/SideContainerToggler";
11 11
 import messageHandler from "./util/MessageHandler";
12 12
 import UIUtil from "./util/UIUtil";
13
-import { activateTooltips } from './util/Tooltip';
14 13
 import UIEvents from "../../service/UI/UIEvents";
15 14
 import EtherpadManager from './etherpad/Etherpad';
16 15
 import SharedVideoManager from './shared_video/SharedVideo';
@@ -232,8 +231,6 @@ UI.initConference = function () {
232 231
     // to the UI (depending on the moderator role of the local participant) and
233 232
     // (2) APP.conference as means of communication between the participants.
234 233
     followMeHandler = new FollowMe(APP.conference, UI);
235
-
236
-    activateTooltips();
237 234
 };
238 235
 
239 236
 UI.mucJoined = function () {
@@ -249,22 +246,6 @@ UI.mucJoined = function () {
249 246
  */
250 247
 UI.handleToggleFilmstrip = () => UI.toggleFilmstrip();
251 248
 
252
-/**
253
- * Sets tooltip defaults.
254
- *
255
- * @private
256
- */
257
-function _setTooltipDefaults() {
258
-    $.fn.tooltip.defaults = {
259
-        opacity: 1, //defaults to 1
260
-        offset: 1,
261
-        delayIn: 0, //defaults to 500
262
-        hoverable: true,
263
-        hideOnClick: true,
264
-        aria: true
265
-    };
266
-}
267
-
268 249
 /**
269 250
  * Returns the shared document manager object.
270 251
  * @return {EtherpadManager} the shared document manager object
@@ -285,8 +266,6 @@ UI.start = function () {
285 266
     // Set the defaults for prompt dialogs.
286 267
     $.prompt.setDefaults({persistent: false});
287 268
 
288
-    // Set the defaults for tooltips.
289
-    _setTooltipDefaults();
290 269
 
291 270
     SideContainerToggler.init(eventEmitter);
292 271
     Filmstrip.init(eventEmitter);

+ 0
- 86
modules/UI/util/Tooltip.js 查看文件

@@ -1,86 +0,0 @@
1
-/* global $, APP, AJS */
2
-
3
-/**
4
- * Associates tooltip element position (in the terms of
5
- * {@link UIUtil#setTooltip} which do not look like CSS <tt>position</tt>) with
6
- * AUI tooltip <tt>gravity</tt>.
7
- */
8
-const TOOLTIP_POSITIONS = {
9
-    'bottom': 'n',
10
-    'bottom-left': 'ne',
11
-    'bottom-right': 'nw',
12
-    'left': 'e',
13
-    'right': 'w',
14
-    'top': 's',
15
-    'top-left': 'se',
16
-    'top-right': 'sw'
17
-};
18
-
19
-/**
20
- * Sets a global handler for all tooltips. Once invoked, create a new
21
- * tooltip by merely updating a DOM node with the appropriate class (e.g.
22
- * <tt>tooltip-n</tt>) and the attribute <tt>content</tt>.
23
- */
24
-export function activateTooltips() {
25
-    AJS.$('[data-tooltip]').tooltip({
26
-        gravity() {
27
-            return this.getAttribute('data-tooltip');
28
-        },
29
-
30
-        title() {
31
-            return this.getAttribute('content');
32
-        },
33
-
34
-        html: true, // Handle multiline tooltips.
35
-
36
-        // The following two prevent tooltips from being stuck:
37
-        hoverable: false, // Make custom tooltips behave like native ones.
38
-        live: true // Attach listener to document element.
39
-    });
40
-}
41
-
42
-/**
43
- * Sets the tooltip to the given element.
44
- *
45
- * @param element the element to set the tooltip to
46
- * @param key the tooltip data-i18n key
47
- * @param position the position of the tooltip in relation to the element
48
- */
49
-export function setTooltip(element, key, position) {
50
-    if (element) {
51
-        const selector = element.jquery ? element : $(element);
52
-
53
-        selector.attr('data-tooltip', TOOLTIP_POSITIONS[position]);
54
-        selector.attr('data-i18n', `[content]${key}`);
55
-
56
-        APP.translation.translateElement(selector);
57
-    }
58
-}
59
-
60
-/**
61
- * Sets the tooltip to the given element, but instead of using translation
62
- * key uses text value.
63
- *
64
- * @param element the element to set the tooltip to
65
- * @param text the tooltip text
66
- * @param position the position of the tooltip in relation to the element
67
- */
68
-export function setTooltipText(element, text, position) {
69
-    if (element) {
70
-        removeTooltip(element);
71
-
72
-        element.setAttribute('data-tooltip', TOOLTIP_POSITIONS[position]);
73
-        element.setAttribute('content', text);
74
-    }
75
-}
76
-
77
-/**
78
- * Removes the tooltip to the given element.
79
- *
80
- * @param element the element to remove the tooltip from
81
- */
82
-export function removeTooltip(element) {
83
-    element.removeAttribute('data-tooltip', '');
84
-    element.removeAttribute('data-i18n','');
85
-    element.removeAttribute('content','');
86
-}

+ 1
- 3
package.json 查看文件

@@ -121,8 +121,6 @@
121 121
     "aui-experimental-css": "./node_modules/@atlassian/aui/dist/aui/css/aui-experimental.min.css",
122 122
     "autosize": "./node_modules/autosize/build/jquery.autosize.js",
123 123
     "jQuery-Impromptu": "jQuery-Impromptu/src/jquery-impromptu.js",
124
-    "popover": "./node_modules/bootstrap/js/popover.js",
125
-    "strophe-disco": "./node_modules/strophejs-plugins/disco/strophe.disco.js",
126
-    "tooltip": "./node_modules/bootstrap/js/tooltip.js"
124
+    "strophe-disco": "./node_modules/strophejs-plugins/disco/strophe.disco.js"
127 125
   }
128 126
 }

+ 0
- 3
react/features/toolbox/actions.web.js 查看文件

@@ -4,7 +4,6 @@ import Recording from '../../../modules/UI/recording/Recording';
4 4
 import SideContainerToggler
5 5
     from '../../../modules/UI/side_pannels/SideContainerToggler';
6 6
 
7
-import { removeTooltip } from '../../../modules/UI/util/Tooltip';
8 7
 import UIEvents from '../../../service/UI/UIEvents';
9 8
 
10 9
 import {
@@ -272,8 +271,6 @@ export function setProfileButtonUnclickable(unclickable: boolean): Function {
272 271
         dispatch(setToolbarButton(buttonName, {
273 272
             unclickable
274 273
         }));
275
-
276
-        removeTooltip(document.getElementById('toolbar_button_profile'));
277 274
     };
278 275
 }
279 276
 

+ 0
- 35
react/features/toolbox/functions.web.js 查看文件

@@ -3,8 +3,6 @@ import SideContainerToggler
3 3
 
4 4
 import defaultToolbarButtons from './defaultToolbarButtons';
5 5
 
6
-declare var $: Function;
7
-declare var AJS: Object;
8 6
 declare var interfaceConfig: Object;
9 7
 
10 8
 export { abstractMapStateToProps, getButton } from './functions.native';
@@ -107,39 +105,6 @@ export function isButtonEnabled(name) {
107 105
             || interfaceConfig.MAIN_TOOLBAR_BUTTONS.indexOf(name) !== -1;
108 106
 }
109 107
 
110
-/**
111
- * Show custom popup/tooltip for a specified button.
112
- *
113
- * @param {string} popupSelectorID - The selector id of the popup to show.
114
- * @param {boolean} show - True or false/show or hide the popup.
115
- * @param {number} timeout - The time to show the popup.
116
- * @returns {void}
117
- */
118
-export function showCustomToolbarPopup(
119
-        popupSelectorID: string,
120
-        show: boolean,
121
-        timeout: number) {
122
-    AJS.$(popupSelectorID).tooltip({
123
-        gravity: $(popupSelectorID).attr('data-popup'),
124
-        html: true,
125
-        title: 'title',
126
-        trigger: 'manual'
127
-    });
128
-
129
-    if (show) {
130
-        AJS.$(popupSelectorID).tooltip('show');
131
-
132
-        setTimeout(
133
-            () => {
134
-                // hide the tooltip
135
-                AJS.$(popupSelectorID).tooltip('hide');
136
-            },
137
-            timeout);
138
-    } else {
139
-        AJS.$(popupSelectorID).tooltip('hide');
140
-    }
141
-}
142
-
143 108
 /**
144 109
  * Get place for toolbar button. Now it can be in the primary Toolbar or in the
145 110
  * secondary Toolbar.

Loading…
取消
儲存