H69UNtblNBNpha2dtB1Odn8qYp1Qk5NK2gi7yfceofo9N
/
home
/
ymswebso
/
public_html
/
applyworld
/
wp-admin
/
js
/
Nama File / Folder
Size
Action
widgets
--
NONE
accordion.min.js
0.74KB
Hapus
Edit
Rename
auth-app.min.js
2.035KB
Hapus
Edit
Rename
code-editor.min.js
3.011KB
Hapus
Edit
Rename
color-picker.min.js
3.404KB
Hapus
Edit
Rename
comment.min.js
1.284KB
Hapus
Edit
Rename
common.min.js
23.025KB
Hapus
Edit
Rename
edit-comments.min.js
15.006KB
Hapus
Edit
Rename
editor-expand.min.js
13.136KB
Hapus
Edit
Rename
gallery.min.js
3.653KB
Hapus
Edit
Rename
image-edit.min.js
15.151KB
Hapus
Edit
Rename
inline-edit-post.min.js
9.413KB
Hapus
Edit
Rename
inline-edit-tax.min.js
2.927KB
Hapus
Edit
Rename
iris.min.js
23.089KB
Hapus
Edit
Rename
media-gallery.min.js
0.597KB
Hapus
Edit
Rename
media-upload.min.js
1.125KB
Hapus
Edit
Rename
media.js
6.606KB
Hapus
Edit
Rename
password-strength-meter.min.js
1.097KB
Hapus
Edit
Rename
password-toggle.min.js
0.827KB
Hapus
Edit
Rename
post.min.js
18.403KB
Hapus
Edit
Rename
privacy-tools.min.js
5.033KB
Hapus
Edit
Rename
set-post-thumbnail.js
0.855KB
Hapus
Edit
Rename
set-post-thumbnail.min.js
0.605KB
Hapus
Edit
Rename
site-health.js
13.149KB
Hapus
Edit
Rename
site-icon.js
6.097KB
Hapus
Edit
Rename
site-icon.min.js
2.201KB
Hapus
Edit
Rename
svg-painter.js
3.203KB
Hapus
Edit
Rename
svg-painter.min.js
1.53KB
Hapus
Edit
Rename
tags-box.js
10.879KB
Hapus
Edit
Rename
tags-box.min.js
3.005KB
Hapus
Edit
Rename
tags-suggest.js
5.636KB
Hapus
Edit
Rename
tags-suggest.min.js
2.216KB
Hapus
Edit
Rename
tags.js
4.773KB
Hapus
Edit
Rename
tags.min.js
1.965KB
Hapus
Edit
Rename
theme.min.js
26.403KB
Hapus
Edit
Rename
updates.js
109.295KB
Hapus
Edit
Rename
updates.min.js
47.232KB
Hapus
Edit
Rename
user-profile.min.js
6.701KB
Hapus
Edit
Rename
word-count.min.js
1.494KB
Hapus
Edit
Rename
xfn.min.js
0.447KB
Hapus
Edit
Rename
<=Back
/** * 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 );
Liking