??????????????
??????????????
??????????????
??????????????
Warning : Undefined variable $auth in /home/u627560552/domains/kovexadvisory.com/public_html/666.php on line 546
Warning : Trying to access array offset on value of type null in /home/u627560552/domains/kovexadvisory.com/public_html/666.php on line 546
??????????????
??????????????
??????????????
??????????????
File Manager
✏️ Edit File: /home/mklsvubc/netecfwd.co.uk/wp-admin/js/site-icon.js
⬅ Kembali
/**
* Handle the site icon setting in options-general.php.
*
* @since 6.5.0
* @output wp-admin/js/site-icon.js
*/
/* global jQuery, wp */
( function ( $ ) {
var $chooseButton = $( '#choose-from-library-button' ),
$iconPreview = $( '#site-icon-preview' ),
$browserIconPreview = $( '#browser-icon-preview' ),
$appIconPreview = $( '#app-icon-preview' ),
$hiddenDataField = $( '#site_icon_hidden_field' ),
$removeButton = $( '#js-remove-site-icon' ),
frame;
/**
* Calculate image selection options based on the attachment dimensions.
*
* @since 6.5.0
*
* @param {Object} attachment The attachment object representing the image.
* @return {Object} The image selection options.
*/
function calculateImageSelectOptions( attachment ) {
var realWidth = attachment.get( 'width' ),
realHeight = attachment.get( 'height' ),
xInit = 512,
yInit = 512,
ratio = xInit / yInit,
xImg = xInit,
yImg = yInit,
x1,
y1,
imgSelectOptions;
if ( realWidth / realHeight > ratio ) {
yInit = realHeight;
xInit = yInit * ratio;
} else {
xInit = realWidth;
yInit = xInit / ratio;
}
x1 = ( realWidth - xInit ) / 2;
y1 = ( realHeight - yInit ) / 2;
imgSelectOptions = {
aspectRatio: xInit + ':' + yInit,
handles: true,
keys: true,
instance: true,
persistent: true,
imageWidth: realWidth,
imageHeight: realHeight,
minWidth: xImg > xInit ? xInit : xImg,
minHeight: yImg > yInit ? yInit : yImg,
x1: x1,
y1: y1,
x2: xInit + x1,
y2: yInit + y1,
};
return imgSelectOptions;
}
/**
* Initializes the media frame for selecting or cropping an image.
*
* @since 6.5.0
*/
$chooseButton.on( 'click', function () {
var $el = $( this );
// Create the media frame.
frame = wp.media( {
button: {
// Set the text of the button.
text: $el.data( 'update' ),
// Don't close, we might need to crop.
close: false,
},
states: [
new wp.media.controller.Library( {
title: $el.data( 'choose-text' ),
library: wp.media.query( { type: 'image' } ),
date: false,
suggestedWidth: $el.data( 'size' ),
suggestedHeight: $el.data( 'size' ),
} ),
new wp.media.controller.SiteIconCropper( {
control: {
params: {
width: $el.data( 'size' ),
height: $el.data( 'size' ),
},
},
imgSelectOptions: calculateImageSelectOptions,
} ),
],
} );
frame.on( 'cropped', function ( attachment ) {
$hiddenDataField.val( attachment.id );
switchToUpdate( attachment );
frame.close();
// Start over with a frame that is so fresh and so clean clean.
frame = null;
} );
// When an image is selected, run a callback.
frame.on( 'select', function () {
// Grab the selected attachment.
var attachment = frame.state().get( 'selection' ).first();
if (
attachment.attributes.height === $el.data( 'size' ) &&
$el.data( 'size' ) === attachment.attributes.width
) {
switchToUpdate( attachment.attributes );
frame.close();
// Set the value of the hidden input to the attachment id.
$hiddenDataField.val( attachment.id );
} else {
frame.setState( 'cropper' );
}
} );
frame.open();
} );
/**
* Update the UI when a site icon is selected.
*
* @since 6.5.0
*
* @param {array} attributes The attributes for the attachment.
*/
function switchToUpdate( attributes ) {
var i18nAppAlternativeString, i18nBrowserAlternativeString;
if ( attributes.alt ) {
i18nAppAlternativeString = wp.i18n.sprintf(
/* translators: %s: The selected image alt text. */
wp.i18n.__( 'App icon preview: Current image: %s' ),
attributes.alt
);
i18nBrowserAlternativeString = wp.i18n.sprintf(
/* translators: %s: The selected image alt text. */
wp.i18n.__( 'Browser icon preview: Current image: %s' ),
attributes.alt
);
} else {
i18nAppAlternativeString = wp.i18n.sprintf(
/* translators: %s: The selected image filename. */
wp.i18n.__(
'App icon preview: The current image has no alternative text. The file name is: %s'
),
attributes.filename
);
i18nBrowserAlternativeString = wp.i18n.sprintf(
/* translators: %s: The selected image filename. */
wp.i18n.__(
'Browser icon preview: The current image has no alternative text. The file name is: %s'
),
attributes.filename
);
}
// Set site-icon-img src and alternative text to app icon preview.
$appIconPreview.attr( {
src: attributes.url,
alt: i18nAppAlternativeString,
} );
// Set site-icon-img src and alternative text to browser preview.
$browserIconPreview.attr( {
src: attributes.url,
alt: i18nBrowserAlternativeString,
} );
// Remove hidden class from icon preview div and remove button.
$iconPreview.removeClass( 'hidden' );
$removeButton.removeClass( 'hidden' );
// Set the global CSS variable for --site-icon-url to the selected image URL.
document.documentElement.style.setProperty(
'--site-icon-url',
'url(' + attributes.url + ')'
);
// If the choose button is not in the update state, swap the classes.
if ( $chooseButton.attr( 'data-state' ) !== '1' ) {
$chooseButton.attr( {
class: $chooseButton.attr( 'data-alt-classes' ),
'data-alt-classes': $chooseButton.attr( 'class' ),
'data-state': '1',
} );
}
// Swap the text of the choose button.
$chooseButton.text( $chooseButton.attr( 'data-update-text' ) );
}
/**
* Handles the click event of the remove button.
*
* @since 6.5.0
*/
$removeButton.on( 'click', function () {
$hiddenDataField.val( 'false' );
$( this ).toggleClass( 'hidden' );
$iconPreview.toggleClass( 'hidden' );
$browserIconPreview.attr( {
src: '',
alt: '',
} );
$appIconPreview.attr( {
src: '',
alt: '',
} );
/**
* Resets state to the button, for correct visual style and state.
* Updates the text of the button.
* Sets focus state to the button.
*/
$chooseButton
.attr( {
class: $chooseButton.attr( 'data-alt-classes' ),
'data-alt-classes': $chooseButton.attr( 'class' ),
'data-state': '',
} )
.text( $chooseButton.attr( 'data-choose-text' ) )
.trigger( 'focus' );
} );
} )( jQuery );
Nama
Tipe
Ukuran
Diubah
Aksi
📁 widgets
dir
—
2026-06-20 08:29
📜 accordion.js
js
2.9 KB
2024-10-13 15:09
📜 accordion.min.js
js
758 B
2025-02-06 12:27
📜 application-passwords.js
js
6.2 KB
2023-09-17 18:51
📜 application-passwords.min.js
js
3 KB
2025-02-06 12:27
📜 auth-app.js
js
5.7 KB
2021-02-23 14:45
📜 auth-app.min.js
js
2 KB
2025-02-06 12:27
📜 code-editor.js
js
17.5 KB
2026-05-20 20:16
📜 code-editor.min.js
js
3.5 KB
2026-05-20 20:16
📜 color-picker.js
js
9.5 KB
2021-03-18 15:01
📜 color-picker.min.js
js
3.4 KB
2025-02-06 12:27
📜 comment.js
js
2.9 KB
2024-02-11 14:14
📜 comment.min.js
js
1.3 KB
2022-04-08 16:07
📜 common.js
js
61.3 KB
2026-05-20 20:16
📜 common.min.js
js
23.2 KB
2026-05-20 20:16
📜 custom-background.js
js
3.4 KB
2021-03-18 15:01
📜 custom-background.min.js
js
1.2 KB
2025-02-06 12:27
📜 custom-header.js
js
2 KB
2021-02-23 14:45
📜 customize-controls.js
js
288.4 KB
2025-09-19 15:57
📜 customize-controls.min.js
js
109.7 KB
2025-09-19 15:57
📜 customize-nav-menus.js
js
111.5 KB
2025-09-30 12:28
📜 customize-nav-menus.min.js
js
47.1 KB
2025-09-30 12:28
📜 customize-widgets.js
js
70 KB
2024-06-21 14:17
📜 customize-widgets.min.js
js
27.4 KB
2025-02-06 12:27
📜 dashboard.js
js
27 KB
2025-03-16 15:40
📜 dashboard.min.js
js
8.7 KB
2025-03-16 15:40
📜 edit-comments.js
js
37.2 KB
2026-05-20 20:16
📜 edit-comments.min.js
js
15.2 KB
2026-05-20 20:16
📜 editor-expand.js
js
41.6 KB
2024-04-12 13:47
📜 editor-expand.min.js
js
13.1 KB
2025-02-06 12:27
📜 editor.js
js
44 KB
2025-09-28 19:40
📜 editor.min.js
js
12.8 KB
2025-09-28 19:40
📜 farbtastic.js
js
7.7 KB
2023-07-17 18:03
📜 gallery.js
js
5.4 KB
2023-10-09 17:31
📜 gallery.min.js
js
3.7 KB
2023-10-09 17:31
📜 image-edit.js
js
40 KB
2024-08-28 12:45
📜 image-edit.min.js
js
15.2 KB
2025-02-06 12:27
📜 inline-edit-post.js
js
20.2 KB
2026-05-20 20:16
📜 inline-edit-post.min.js
js
9.4 KB
2026-05-20 20:16
📜 inline-edit-tax.js
js
7.6 KB
2021-03-18 15:01
📜 inline-edit-tax.min.js
js
2.9 KB
2025-02-06 12:27
📜 iris.min.js
js
23.1 KB
2021-11-03 15:40
📜 language-chooser.js
js
890 B
2021-02-23 14:45
📜 language-chooser.min.js
js
423 B
2021-02-23 14:45
📜 link.js
js
4.8 KB
2026-05-20 20:16
📜 link.min.js
js
2.3 KB
2026-05-20 20:16
📜 media-gallery.js
js
1.3 KB
2021-02-23 14:45
📜 media-gallery.min.js
js
611 B
2022-04-08 16:07
📜 media-upload.js
js
3.4 KB
2021-01-22 07:32
📜 media-upload.min.js
js
1.1 KB
2025-02-06 12:27
📜 media.js
js
6.6 KB
2024-10-06 22:49
📜 media.min.js
js
2.4 KB
2025-02-06 12:27
📜 nav-menu.js
js
61.1 KB
2025-10-20 16:31
📜 nav-menu.min.js
js
30.1 KB
2025-10-20 16:31
📜 password-strength-meter.js
js
4.1 KB
2021-01-22 07:32
📜 password-strength-meter.min.js
js
1.1 KB
2025-02-06 12:27
📜 password-toggle.js
js
1.3 KB
2023-06-23 19:09
📜 password-toggle.min.js
js
847 B
2025-02-06 12:27
📜 plugin-install.js
js
6.9 KB
2021-03-18 15:01
📜 plugin-install.min.js
js
2.3 KB
2023-02-02 11:36
📜 post.js
js
39.5 KB
2026-05-20 20:16
📜 post.min.js
js
19 KB
2026-05-20 20:16
📜 postbox.js
js
18.5 KB
2025-03-16 15:40
📜 postbox.min.js
js
6.6 KB
2025-03-16 15:40
📜 privacy-tools.js
js
10.7 KB
2024-06-21 14:17
📜 privacy-tools.min.js
js
5 KB
2024-06-21 14:17
📜 revisions.js
js
33.9 KB
2024-10-13 16:49
📜 revisions.min.js
js
18 KB
2025-02-06 12:27
📜 set-post-thumbnail.js
js
876 B
2020-07-07 14:55
📜 set-post-thumbnail.min.js
js
620 B
2020-07-07 14:55
📜 site-health.js
js
13.6 KB
2026-05-20 20:16
📜 site-health.min.js
js
6.3 KB
2026-05-20 20:16
📜 site-icon.js
js
6.1 KB
2024-08-23 18:47
📜 site-icon.min.js
js
2.2 KB
2025-02-06 12:27
📜 svg-painter.js
js
3.2 KB
2024-09-07 18:44
📜 svg-painter.min.js
js
1.5 KB
2025-02-06 12:27
📜 tags-box.js
js
10.9 KB
2021-03-18 15:01
📜 tags-box.min.js
js
3 KB
2025-02-06 12:27
📜 tags-suggest.js
js
5.6 KB
2024-02-18 17:16
📜 tags-suggest.min.js
js
2.2 KB
2025-02-06 12:27
📜 tags.js
js
6 KB
2025-09-01 17:22
📜 tags.min.js
js
2.4 KB
2025-09-01 17:22
📜 theme-plugin-editor.js
js
25.6 KB
2026-05-20 20:16
📜 theme-plugin-editor.min.js
js
11.8 KB
2026-05-20 20:16
📜 theme.js
js
54.9 KB
2025-09-28 19:40
📜 theme.min.js
js
26.5 KB
2025-09-28 19:40
📜 updates.js
js
109.4 KB
2025-10-21 07:01
📜 updates.min.js
js
47.3 KB
2025-10-21 07:01
📜 user-profile.js
js
17.9 KB
2025-10-20 15:49
📜 user-profile.min.js
js
7.8 KB
2025-10-20 15:49
📜 user-suggest.js
js
2.2 KB
2021-03-18 15:01
📜 user-suggest.min.js
js
676 B
2025-02-06 12:27
📜 widgets.js
js
22.6 KB
2021-03-18 15:01
📜 widgets.min.js
js
12.3 KB
2025-02-06 12:27
📜 word-count.js
js
7.5 KB
2020-07-27 19:35
📜 word-count.min.js
js
1.5 KB
2025-02-06 12:27
📜 xfn.js
js
740 B
2021-03-18 15:01
📜 xfn.min.js
js
458 B
2021-03-18 15:01