??????????????
??????????????
??????????????
??????????????
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/turanoil.kz/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
—
2025-03-17 15:33
📜 accordion.js
js
2.9 KB
2024-10-13 23:09
📜 accordion.min.js
js
758 B
2024-10-13 23:09
📜 application-passwords.js
js
6.2 KB
2023-09-18 02:51
📜 application-passwords.min.js
js
3 KB
2023-09-18 02:51
📜 auth-app.js
js
5.7 KB
2021-02-24 00:45
📜 auth-app.min.js
js
2 KB
2022-04-09 00:07
📜 code-editor.js
js
17.5 KB
2026-05-21 04:46
📜 code-editor.min.js
js
3.5 KB
2026-05-21 04:46
📜 color-picker.js
js
9.5 KB
2021-03-18 23:01
📜 color-picker.min.js
js
3.4 KB
2022-04-09 00:07
📜 comment.js
js
2.9 KB
2024-02-12 00:14
📜 comment.min.js
js
1.3 KB
2022-04-09 00:07
📜 common.js
js
61.3 KB
2026-05-21 04:46
📜 common.min.js
js
23.2 KB
2026-05-21 04:46
📜 custom-background.js
js
3.4 KB
2021-03-18 23:01
📜 custom-background.min.js
js
1.2 KB
2021-03-18 23:01
📜 custom-header.js
js
2 KB
2021-02-24 00:45
📜 customize-controls.js
js
288.4 KB
2025-12-03 04:15
📜 customize-controls.min.js
js
109.7 KB
2025-12-03 04:15
📜 customize-nav-menus.js
js
111.5 KB
2025-12-03 04:15
📜 customize-nav-menus.min.js
js
47.1 KB
2025-12-03 04:15
📜 customize-widgets.js
js
70 KB
2024-06-21 22:17
📜 customize-widgets.min.js
js
27.4 KB
2025-04-16 03:36
📜 dashboard.js
js
27 KB
2025-04-16 03:36
📜 dashboard.min.js
js
8.7 KB
2025-04-16 03:36
📜 edit-comments.js
js
37.2 KB
2026-05-21 04:46
📜 edit-comments.min.js
js
15.2 KB
2026-05-21 04:46
📜 editor-expand.js
js
41.6 KB
2024-04-12 21:47
📜 editor-expand.min.js
js
13.1 KB
2024-06-27 16:55
📜 editor.js
js
44 KB
2025-12-03 04:15
📜 editor.min.js
js
12.8 KB
2025-12-03 04:15
📜 farbtastic.js
js
7.7 KB
2023-07-18 02:03
📜 gallery.js
js
5.4 KB
2023-10-10 01:31
📜 gallery.min.js
js
3.7 KB
2023-10-10 01:31
📜 image-edit.js
js
40 KB
2024-08-28 20:45
📜 image-edit.min.js
js
15.2 KB
2024-08-28 20:45
📜 inline-edit-post.js
js
20.2 KB
2026-05-21 04:46
📜 inline-edit-post.min.js
js
9.4 KB
2026-05-21 04:46
📜 inline-edit-tax.js
js
7.6 KB
2021-03-18 23:01
📜 inline-edit-tax.min.js
js
2.9 KB
2021-03-18 23:01
📜 iris.min.js
js
23.1 KB
2021-11-03 23:40
📜 language-chooser.js
js
890 B
2021-02-24 00:45
📜 language-chooser.min.js
js
423 B
2021-02-24 00:45
📜 link.js
js
4.8 KB
2026-05-21 04:46
📜 link.min.js
js
2.3 KB
2026-05-21 04:46
📜 media-gallery.js
js
1.3 KB
2021-02-24 00:45
📜 media-gallery.min.js
js
611 B
2022-04-09 00:07
📜 media-upload.js
js
3.4 KB
2021-01-22 17:32
📜 media-upload.min.js
js
1.1 KB
2023-02-02 21:36
📜 media.js
js
6.6 KB
2024-10-07 06:49
📜 media.min.js
js
2.4 KB
2024-10-07 06:49
📜 nav-menu.js
js
61.1 KB
2025-12-03 04:15
📜 nav-menu.min.js
js
30.1 KB
2025-12-03 04:15
📜 password-strength-meter.js
js
4.1 KB
2021-01-22 17:32
📜 password-strength-meter.min.js
js
1.1 KB
2021-01-22 17:32
📜 password-toggle.js
js
1.3 KB
2023-06-24 03:09
📜 password-toggle.min.js
js
847 B
2023-06-24 03:09
📜 plugin-install.js
js
6.9 KB
2021-03-18 23:01
📜 plugin-install.min.js
js
2.3 KB
2023-02-02 21:36
📜 post.js
js
39.5 KB
2026-05-21 04:46
📜 post.min.js
js
19 KB
2026-05-21 04:46
📜 postbox.js
js
18.5 KB
2025-04-16 03:36
📜 postbox.min.js
js
6.6 KB
2025-04-16 03:36
📜 privacy-tools.js
js
10.7 KB
2024-06-21 22:17
📜 privacy-tools.min.js
js
5 KB
2024-06-21 22:17
📜 revisions.js
js
33.9 KB
2024-10-14 00:49
📜 revisions.min.js
js
18 KB
2024-10-14 00:49
📜 set-post-thumbnail.js
js
876 B
2020-07-07 22:55
📜 set-post-thumbnail.min.js
js
620 B
2020-07-07 22:55
📜 site-health.js
js
13.6 KB
2026-05-21 04:46
📜 site-health.min.js
js
6.3 KB
2026-05-21 04:46
📜 site-icon.js
js
6.1 KB
2024-08-24 02:47
📜 site-icon.min.js
js
2.2 KB
2024-08-24 02:47
📜 svg-painter.js
js
3.2 KB
2024-09-08 02:44
📜 svg-painter.min.js
js
1.5 KB
2024-09-08 02:44
📜 tags-box.js
js
10.9 KB
2021-03-18 23:01
📜 tags-box.min.js
js
3 KB
2023-02-02 21:36
📜 tags-suggest.js
js
5.6 KB
2024-02-19 03:16
📜 tags-suggest.min.js
js
2.2 KB
2024-02-19 03:16
📜 tags.js
js
6 KB
2025-12-03 04:15
📜 tags.min.js
js
2.4 KB
2025-12-03 04:15
📜 theme-plugin-editor.js
js
25.6 KB
2026-05-21 04:46
📜 theme-plugin-editor.min.js
js
11.8 KB
2026-05-21 04:46
📜 theme.js
js
54.9 KB
2025-12-03 04:15
📜 theme.min.js
js
26.5 KB
2025-12-03 04:15
📜 updates.js
js
109.4 KB
2025-12-03 04:15
📜 updates.min.js
js
47.3 KB
2025-12-03 04:15
📜 user-profile.js
js
17.9 KB
2025-12-03 04:15
📜 user-profile.min.js
js
7.8 KB
2025-12-03 04:15
📜 user-suggest.js
js
2.2 KB
2021-03-18 23:01
📜 user-suggest.min.js
js
676 B
2021-03-18 23:01
📜 widgets.js
js
22.6 KB
2021-03-18 23:01
📜 widgets.min.js
js
12.3 KB
2023-02-02 21:36
📜 word-count.js
js
7.5 KB
2020-07-28 03:35
📜 word-count.min.js
js
1.5 KB
2023-02-02 21:36
📜 xfn.js
js
740 B
2021-03-18 23:01
📜 xfn.min.js
js
458 B
2021-03-18 23:01