2018-04-08 23:26:01 +00:00
|
|
|
/* global extDependencyMap */
|
2018-08-29 04:46:30 +00:00
|
|
|
( function () {
|
2024-06-11 12:43:19 +00:00
|
|
|
$( () => {
|
2024-10-04 13:30:47 +00:00
|
|
|
let $label = null, labelText = null;
|
2010-12-06 23:13:35 +00:00
|
|
|
|
2012-09-04 19:47:20 +00:00
|
|
|
function syncText() {
|
2024-09-10 09:54:08 +00:00
|
|
|
let value = $( this ).val()
|
2017-07-18 13:02:42 +00:00
|
|
|
.replace( /[\[\]{}|#<>%+? ]/g, '_' ) // eslint-disable-line no-useless-escape
|
2012-09-04 19:47:20 +00:00
|
|
|
.replace( /&/, '&' )
|
|
|
|
|
.replace( /__+/g, '_' )
|
|
|
|
|
.replace( /^_+/, '' )
|
|
|
|
|
.replace( /_+$/, '' );
|
Use String#slice instead of String#substr or String#substring
Quite a few reasons:
* There is a bug in IE 8 and below where the startIndex argument
does not support negative values, contrary to the ECMAScript
spec and implementations in other browsers.
IE8:
'faux'.substr( -1 ); // "faux"
Standards:
'faux'.substr( -1 ); // "x"
Code written for ES5 (and using the es5-shim) works as expected
since the shim repairs this method.
* String#substr and String#substring both exist but have
different signatures which are easily mixed up.
String.prototype.substr( start [, length] )
> Supports negative start, but not in IE8 and below.
> Takes length, *not* second index. E.g. `substr( 2, 3 )`
returns `slice( 2, 5 )`.
String.prototype.substring( indexA [, indexB] )
> Doesn't support negative indices.
> If indexA is larger than indexB, they are silently swapped!
String.prototype.slice( start [, end] )
> Supports negative indices.
'faux'.substr( 0, 2 ); // "fa"
'faux'.substring( 0, 2 ); // "fa"
'faux'.slice( 0, 2 ); // "fa"
'faux'.substr( -2 ); // "ux"
'faux'.substring( -2 ); // "faux"
'faux'.slice( -2 ); // "ux"
'faux'.substr( 1, 2 ); // "au"
'faux'.substring( 1, 2 ); // "a"
'faux'.slice( 1, 2 ); // "a"
'faux'.substr( 1, -1 ); // ""
'faux'.substring( 1, -1 ); // "f"
'faux'.slice( 1, -1 ); // "au"
'faux'.substr( 2, 1 ); // "u"
'faux'.substring( 2, 1 ); // "a"
'faux'.slice( 2, 1 ); // ""
* String#slice works the same way as Array#slice and slice
methods elsewhere (jQuery, PHP, ..).
* Also simplify calls:
- Omit second argument where it explicitly calculated the length
and passed it as is (default behaviour)
- Pass negative values instead of length - x.
- Use chatAt to extract a single character.
* Change:
- Replace all uses of substring() with slice().
- Replace all uses of substr() with slice() where only one
parameter is passed or where the first parameter is 0.
- Using substr()'s unique behaviour (length instead of endIndex)
is fine, though there's only one instances of that, in
mediawiki.jqueryMsg.js
Change-Id: I9b6dd682a64fa28c7ea0da1846ccd3b42f9430cf
2014-09-03 15:19:41 +00:00
|
|
|
value = value.charAt( 0 ).toUpperCase() + value.slice( 1 );
|
2012-09-04 19:47:20 +00:00
|
|
|
$label.text( labelText.replace( '$1', value ) );
|
|
|
|
|
}
|
2010-12-06 23:13:35 +00:00
|
|
|
|
2010-05-07 12:25:01 +00:00
|
|
|
// Show/hide code for DB-specific options
|
|
|
|
|
// FIXME: Do we want slow, fast, or even non-animated (instantaneous) showing/hiding here?
|
2012-09-04 19:47:20 +00:00
|
|
|
$( '.dbRadio' ).each( function () {
|
2015-09-03 20:13:33 +00:00
|
|
|
$( document.getElementById( $( this ).attr( 'rel' ) ) ).hide();
|
2012-09-04 19:47:20 +00:00
|
|
|
} );
|
|
|
|
|
$( document.getElementById( $( '.dbRadio:checked' ).attr( 'rel' ) ) ).show();
|
2024-06-11 12:43:19 +00:00
|
|
|
$( '.dbRadio' ).on( 'click', () => {
|
2024-09-10 09:54:08 +00:00
|
|
|
const $checked = $( '.dbRadio:checked' ),
|
2012-09-04 19:47:20 +00:00
|
|
|
$wrapper = $( document.getElementById( $checked.attr( 'rel' ) ) );
|
2019-07-05 19:38:29 +00:00
|
|
|
// eslint-disable-next-line no-jquery/no-sizzle
|
2012-09-04 19:47:20 +00:00
|
|
|
if ( $wrapper.is( ':hidden' ) ) {
|
2019-01-08 17:40:11 +00:00
|
|
|
// FIXME: Use CSS transition
|
2019-02-20 22:53:09 +00:00
|
|
|
// eslint-disable-next-line no-jquery/no-animate-toggle
|
2010-05-07 12:25:01 +00:00
|
|
|
$( '.dbWrapper' ).hide( 'slow' );
|
2019-02-20 22:53:09 +00:00
|
|
|
// eslint-disable-next-line no-jquery/no-animate-toggle
|
2010-05-07 12:25:01 +00:00
|
|
|
$wrapper.show( 'slow' );
|
|
|
|
|
}
|
|
|
|
|
} );
|
2013-08-24 15:06:25 +00:00
|
|
|
|
2010-05-07 12:25:01 +00:00
|
|
|
// Scroll to the bottom of upgrade log
|
2012-09-04 19:47:20 +00:00
|
|
|
$( '#config-live-log' ).children( 'textarea' ).each( function () {
|
|
|
|
|
this.scrollTop = this.scrollHeight;
|
|
|
|
|
} );
|
2013-08-24 15:06:25 +00:00
|
|
|
|
2010-05-07 12:25:01 +00:00
|
|
|
// Show/hide random stuff (email, upload)
|
2019-01-08 17:40:11 +00:00
|
|
|
$( '.showHideRadio' ).on( 'click', function () {
|
2024-09-10 09:54:08 +00:00
|
|
|
const $wrapper = $( '#' + $( this ).attr( 'rel' ) );
|
2015-09-03 20:13:33 +00:00
|
|
|
if ( $( this ).is( ':checked' ) ) {
|
2019-01-08 17:40:11 +00:00
|
|
|
// FIXME: Use CSS transition
|
2019-02-20 22:53:09 +00:00
|
|
|
// eslint-disable-next-line no-jquery/no-animate-toggle
|
2010-05-07 12:25:01 +00:00
|
|
|
$wrapper.show( 'slow' );
|
|
|
|
|
} else {
|
2019-02-20 22:53:09 +00:00
|
|
|
// eslint-disable-next-line no-jquery/no-animate-toggle
|
2010-05-07 12:25:01 +00:00
|
|
|
$wrapper.hide( 'slow' );
|
|
|
|
|
}
|
|
|
|
|
} );
|
2019-01-08 17:40:11 +00:00
|
|
|
$( '.hideShowRadio' ).on( 'click', function () {
|
2024-09-10 09:54:08 +00:00
|
|
|
const $wrapper = $( '#' + $( this ).attr( 'rel' ) );
|
2015-09-03 20:13:33 +00:00
|
|
|
if ( $( this ).is( ':checked' ) ) {
|
2019-01-08 17:40:11 +00:00
|
|
|
// FIXME: Use CSS transition
|
2019-02-20 22:53:09 +00:00
|
|
|
// eslint-disable-next-line no-jquery/no-animate-toggle
|
2010-05-07 12:25:01 +00:00
|
|
|
$wrapper.hide( 'slow' );
|
|
|
|
|
} else {
|
2019-02-20 22:53:09 +00:00
|
|
|
// eslint-disable-next-line no-jquery/no-animate-toggle
|
2010-05-07 12:25:01 +00:00
|
|
|
$wrapper.show( 'slow' );
|
|
|
|
|
}
|
|
|
|
|
} );
|
2010-11-23 00:40:45 +00:00
|
|
|
|
|
|
|
|
// Hide "other" textboxes by default
|
|
|
|
|
// Should not be done in CSS for javascript disabled compatibility
|
2018-04-27 14:27:39 +00:00
|
|
|
if ( !$( '#config__NamespaceType_other' ).is( ':checked' ) ) {
|
|
|
|
|
$( '.enabledByOther' ).closest( '.config-block' ).hide();
|
|
|
|
|
}
|
2010-11-23 00:40:45 +00:00
|
|
|
|
2010-05-07 12:25:01 +00:00
|
|
|
// Enable/disable "other" textboxes
|
2019-01-08 17:40:11 +00:00
|
|
|
$( '.enableForOther' ).on( 'click', function () {
|
2024-09-10 09:54:08 +00:00
|
|
|
const $textbox = $( document.getElementById( $( this ).attr( 'rel' ) ) );
|
2012-09-04 19:47:20 +00:00
|
|
|
// FIXME: Ugh, this is ugly
|
2015-09-03 20:13:33 +00:00
|
|
|
if ( $( this ).val() === 'other' ) {
|
2019-01-08 17:40:11 +00:00
|
|
|
// FIXME: Use CSS transition
|
2019-02-20 22:53:09 +00:00
|
|
|
// eslint-disable-next-line no-jquery/no-slide
|
2018-04-06 23:02:49 +00:00
|
|
|
$textbox.prop( 'readonly', false ).closest( '.config-block' ).slideDown( 'fast' );
|
2010-05-07 12:25:01 +00:00
|
|
|
} else {
|
2019-02-20 22:53:09 +00:00
|
|
|
// eslint-disable-next-line no-jquery/no-slide
|
Use .prop instead of .attr where appropriate
* Although jQuery covers for us in most cases (since .prop didn't exist before jQuery 1.6 and many people abused .attr in laziness of doing their own loop and setting the property manually). It's better to know what we're doing and call the function we intend to call. Both because jQuery may decide to stop rerouting common mistakes to .prop and because it makes code more readable.
* Aside from switching to prop, for boolean properties also replacing null/undefined with false and 'propname' with true. This is no longer being covered by jQuery when using prop directly (as it shouldn't). When an element is created the HTML specification says that the attribute should be set to it's name (ie. '<foo selected="selected">'), the properties however must remain boolean.
* Changing the attribute value for a boolean property (ie. checkbox.setAttribute( 'checked', 'checked' ) does not make the checkbox enabled. All it does is set the attribute. The reason this works with jQuery's attr() is because jQuery calls .prop internally after a bunch of checking inside attr().
-- Reference --
The list of keys that .attr and .removeAttr jQuery is currently (as of jQuery 1.6.1) remapping to use .prop and .removeProp can be found here:
https://github.com/jquery/jquery/blob/b22c9046529852c7ce567df13397849e11e2b9cc/src/attributes.js#L425
{
tabindex: "tabIndex",
readonly: "readOnly",
"for": "htmlFor",
"class": "className",
maxlength: "maxLength",
cellspacing: "cellSpacing",
cellpadding: "cellPadding",
rowspan: "rowSpan",
colspan: "colSpan",
usemap: "useMap",
frameborder: "frameBorder",
contenteditable: "contentEditable"
}
In addition to those, jQuery also maps these boolean properties to .prop when they are passed to .attr:
rboolean = /^(?:autofocus|autoplay|async|checked|controls|defer|disabled|hidden|loop|multiple|open|readonly|required|scoped|selected)$/i,
(source: https://github.com/jquery/jquery/blob/b22c9046529852c7ce567df13397849e11e2b9cc/src/attributes.js#L9 )
2011-08-12 21:19:45 +00:00
|
|
|
$textbox.prop( 'readonly', true ).closest( '.config-block' ).slideUp( 'fast' );
|
2010-05-07 12:25:01 +00:00
|
|
|
}
|
|
|
|
|
} );
|
2013-08-24 15:06:25 +00:00
|
|
|
|
2010-05-07 12:25:01 +00:00
|
|
|
// Synchronize radio button label for sitename with textbox
|
2018-04-18 02:14:30 +00:00
|
|
|
$label = $( 'label[for="config__NamespaceType_site-name"]' );
|
2010-05-07 12:25:01 +00:00
|
|
|
labelText = $label.text();
|
|
|
|
|
$label.text( labelText.replace( '$1', '' ) );
|
2012-09-04 19:47:20 +00:00
|
|
|
$( '#config_wgSitename' ).on( 'keyup change', syncText ).each( syncText );
|
2010-05-20 22:24:46 +00:00
|
|
|
|
|
|
|
|
// Show/Hide memcached servers when needed
|
2024-06-11 12:43:19 +00:00
|
|
|
$( 'input[name$="config__MainCacheType"]' ).on( 'change', () => {
|
2024-09-10 09:54:08 +00:00
|
|
|
const $memc = $( '#config-memcachewrapper' );
|
2015-10-23 21:29:38 +00:00
|
|
|
if ( $( 'input[name$="config__MainCacheType"]:checked' ).val() === 'memcached' ) {
|
2019-01-08 17:40:11 +00:00
|
|
|
// FIXME: Use CSS transition
|
2019-02-20 22:53:09 +00:00
|
|
|
// eslint-disable-next-line no-jquery/no-animate-toggle
|
2010-05-20 22:24:46 +00:00
|
|
|
$memc.show( 'slow' );
|
|
|
|
|
} else {
|
2019-02-20 22:53:09 +00:00
|
|
|
// eslint-disable-next-line no-jquery/no-animate-toggle
|
2010-05-20 22:24:46 +00:00
|
|
|
$memc.hide( 'slow' );
|
|
|
|
|
}
|
|
|
|
|
} );
|
2018-04-08 23:26:01 +00:00
|
|
|
|
|
|
|
|
function areReqsSatisfied( name ) {
|
2024-09-10 09:54:08 +00:00
|
|
|
let i, ext, skin, node;
|
2018-04-08 23:26:01 +00:00
|
|
|
if ( !extDependencyMap[ name ] ) {
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if ( extDependencyMap[ name ].extensions ) {
|
|
|
|
|
for ( i in extDependencyMap[ name ].extensions ) {
|
|
|
|
|
ext = extDependencyMap[ name ].extensions[ i ];
|
|
|
|
|
node = document.getElementById( 'config_ext-' + ext );
|
|
|
|
|
if ( !node || !node.checked ) {
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if ( extDependencyMap[ name ].skins ) {
|
|
|
|
|
for ( i in extDependencyMap[ name ].skins ) {
|
|
|
|
|
skin = extDependencyMap[ name ].skins[ i ];
|
|
|
|
|
node = document.getElementById( 'config_skin-' + skin );
|
|
|
|
|
if ( !node || !node.checked ) {
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Disable checkboxes if the extension has dependencies
|
|
|
|
|
$( '.mw-ext-with-dependencies input' ).prop( 'disabled', true );
|
2024-06-11 12:43:19 +00:00
|
|
|
$( '.config-ext-input[data-name]' ).on( 'change', () => {
|
2018-04-08 23:26:01 +00:00
|
|
|
$( '.mw-ext-with-dependencies input' ).each( function () {
|
2024-09-10 09:54:08 +00:00
|
|
|
const name = this.getAttribute( 'data-name' );
|
2018-04-08 23:26:01 +00:00
|
|
|
if ( areReqsSatisfied( name ) ) {
|
2018-04-18 02:14:30 +00:00
|
|
|
// Re-enable it!
|
|
|
|
|
this.disabled = false;
|
2018-04-08 23:26:01 +00:00
|
|
|
} else {
|
2018-04-18 02:14:30 +00:00
|
|
|
// Uncheck and disable the checkbox
|
|
|
|
|
this.checked = false;
|
|
|
|
|
this.disabled = true;
|
2018-04-08 23:26:01 +00:00
|
|
|
}
|
|
|
|
|
} );
|
|
|
|
|
} );
|
2022-02-10 00:37:10 +00:00
|
|
|
|
2024-09-10 09:54:08 +00:00
|
|
|
const base = window.location.pathname.split( '/mw-config' )[ 0 ];
|
2022-02-10 00:37:10 +00:00
|
|
|
function getLogoPath( src ) {
|
|
|
|
|
return src.replace( '$wgResourceBasePath', base );
|
|
|
|
|
}
|
|
|
|
|
|
2024-09-10 09:54:08 +00:00
|
|
|
const nodes = {
|
2022-02-10 00:37:10 +00:00
|
|
|
sidebar: 'config__Logo1x',
|
|
|
|
|
icon: 'config__LogoIcon',
|
|
|
|
|
wordmark: 'config__LogoWordmark',
|
|
|
|
|
tagline: 'config__LogoTagline'
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
// setup live preview of logos
|
|
|
|
|
function getLogoData() {
|
2024-09-10 09:54:08 +00:00
|
|
|
const data = {};
|
2024-06-11 12:43:19 +00:00
|
|
|
Object.keys( nodes ).forEach( ( key ) => {
|
2024-09-10 09:54:08 +00:00
|
|
|
const input = document.getElementById( nodes[ key ] );
|
2022-02-10 00:37:10 +00:00
|
|
|
if ( input ) {
|
|
|
|
|
data[ key ] = getLogoPath( input.value );
|
|
|
|
|
}
|
|
|
|
|
} );
|
|
|
|
|
return data;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Render the logo based on the current input field values.
|
|
|
|
|
*
|
|
|
|
|
* @param {jQuery} $preview
|
|
|
|
|
*/
|
|
|
|
|
function renderLogo( $preview ) {
|
2024-09-10 09:54:08 +00:00
|
|
|
const data = getLogoData();
|
|
|
|
|
const $sidebar = $( '<div>' );
|
2022-02-10 00:37:10 +00:00
|
|
|
$sidebar.addClass( 'sidebar' );
|
2024-09-10 09:54:08 +00:00
|
|
|
const sidebarLogo = data.sidebar || data.icon;
|
2022-02-10 00:37:10 +00:00
|
|
|
if ( sidebarLogo ) {
|
2024-09-10 09:54:08 +00:00
|
|
|
const $sidebarCard = $( '<span>' ).addClass( 'cdx-card' ).css( 'display', 'inline-block' ).append(
|
2024-01-24 19:37:29 +00:00
|
|
|
$( '<span>' ).addClass( 'cdx-card__thumbnail cdx-thumbnail' ).html(
|
|
|
|
|
$( '<img>' ).attr( 'src', sidebarLogo ).addClass( 'logo-sidebar' )
|
|
|
|
|
)
|
|
|
|
|
).appendTo( $sidebar );
|
2022-02-10 00:37:10 +00:00
|
|
|
|
2024-09-10 09:54:08 +00:00
|
|
|
const $menu = $( '<span>' ).addClass( 'cdx-card__text' ).append(
|
2024-01-24 19:37:29 +00:00
|
|
|
$( '<span>' ).addClass( 'cdx-card__text__title' ).append(
|
|
|
|
|
$( '<a>' ).attr( 'href', '#' ).text( $preview.data( 'main-page' ) )
|
2022-02-10 00:37:10 +00:00
|
|
|
)
|
|
|
|
|
);
|
2024-01-24 19:37:29 +00:00
|
|
|
$menu.appendTo( $sidebarCard );
|
2022-02-10 00:37:10 +00:00
|
|
|
}
|
2024-09-10 09:54:08 +00:00
|
|
|
const $main = $( '<span>' ).addClass( 'logo-main' ).addClass( 'cdx-card' );
|
2022-02-10 00:37:10 +00:00
|
|
|
if ( data.icon ) {
|
2024-01-24 19:37:29 +00:00
|
|
|
$( '<span>' ).addClass( 'cdx-card__thumbnail cdx-thumbnail' ).html(
|
|
|
|
|
$( '<img>' ).attr( 'src', data.icon ).addClass( 'logo-icon' )
|
|
|
|
|
).appendTo( $main );
|
2022-02-10 00:37:10 +00:00
|
|
|
}
|
2024-09-10 09:54:08 +00:00
|
|
|
const $container = $( '<span>' ).addClass( 'cdx-card__text' ).appendTo( $main );
|
2022-02-10 00:37:10 +00:00
|
|
|
|
2024-09-10 09:54:08 +00:00
|
|
|
const fallback = {
|
2022-02-10 00:37:10 +00:00
|
|
|
wordmark: $( '[name=config_LogoSiteName]' ).val()
|
|
|
|
|
};
|
2024-06-11 12:43:19 +00:00
|
|
|
[ 'wordmark', 'tagline' ].forEach( ( key ) => {
|
2024-09-10 09:54:08 +00:00
|
|
|
const src = data[ key ];
|
|
|
|
|
const $el = src ?
|
2022-02-10 00:37:10 +00:00
|
|
|
$( '<img>' ).attr( 'src', src ) :
|
|
|
|
|
$( '<div>' ).text( fallback[ key ] );
|
|
|
|
|
|
|
|
|
|
// The following classes are used here:
|
|
|
|
|
// * logo-wordmark
|
|
|
|
|
// * logo-tagline
|
|
|
|
|
$el.addClass( 'logo-' + key ).appendTo( $container );
|
|
|
|
|
} );
|
2023-02-14 08:17:04 +00:00
|
|
|
$preview.empty().append( $sidebar, $main );
|
2022-02-10 00:37:10 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Adds file droppers
|
|
|
|
|
*
|
|
|
|
|
* @param {jQuery} $preview
|
|
|
|
|
* @param {string} tooltip
|
|
|
|
|
*/
|
|
|
|
|
function addDroppers( $preview, tooltip ) {
|
2024-06-11 12:43:19 +00:00
|
|
|
Object.keys( nodes ).forEach( ( key ) => {
|
2024-09-10 09:54:08 +00:00
|
|
|
const dropper = document.createElement( 'div' );
|
|
|
|
|
const input = document.getElementById( nodes[ key ] );
|
2022-02-10 00:37:10 +00:00
|
|
|
dropper.textContent = tooltip;
|
|
|
|
|
input.parentNode.insertBefore( dropper, input.nextSibling );
|
|
|
|
|
dropper.classList.add( 'logo-dropper' );
|
2024-06-11 12:43:19 +00:00
|
|
|
dropper.addEventListener( 'dragover', ( ev ) => {
|
2022-02-10 00:37:10 +00:00
|
|
|
ev.preventDefault();
|
|
|
|
|
} );
|
|
|
|
|
dropper.addEventListener( 'drop', function ( ev ) {
|
|
|
|
|
// Prevent default behavior (Prevent file from being opened)
|
|
|
|
|
ev.preventDefault();
|
2024-09-10 09:54:08 +00:00
|
|
|
const d = this;
|
|
|
|
|
const item = ev.dataTransfer.items[ 0 ];
|
2022-02-10 00:37:10 +00:00
|
|
|
// Only allow images.
|
|
|
|
|
if ( item && item.type.indexOf( 'image/' ) === 0 ) {
|
2024-09-10 09:54:08 +00:00
|
|
|
const blob = item.getAsFile();
|
|
|
|
|
const reader = new FileReader();
|
2022-02-10 00:37:10 +00:00
|
|
|
reader.readAsDataURL( blob );
|
|
|
|
|
reader.onloadend = function () {
|
2024-09-10 09:54:08 +00:00
|
|
|
const base64data = reader.result;
|
2022-02-10 00:37:10 +00:00
|
|
|
d.previousSibling.value = base64data;
|
|
|
|
|
renderLogo( $preview );
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
} );
|
|
|
|
|
} );
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// setup preview area to respond to changes.
|
2024-09-10 09:54:08 +00:00
|
|
|
const $pOptions = $( '.config-personalization-options' );
|
2022-02-10 00:37:10 +00:00
|
|
|
if ( $pOptions.length ) {
|
2024-09-10 09:54:08 +00:00
|
|
|
const $previewArea = $pOptions.find( '.logo-preview-area' );
|
2024-06-11 12:43:19 +00:00
|
|
|
$pOptions.find( ' input' ).on( 'input', () => {
|
2022-02-10 00:37:10 +00:00
|
|
|
renderLogo( $previewArea );
|
|
|
|
|
} );
|
|
|
|
|
addDroppers( $previewArea, $previewArea.data( 'filedrop' ) );
|
|
|
|
|
renderLogo( $previewArea );
|
|
|
|
|
}
|
2023-12-11 19:21:51 +00:00
|
|
|
|
|
|
|
|
$( 'a.config-help-field-hint' ).on( 'click', function () {
|
|
|
|
|
// eslint-disable-next-line no-jquery/no-class-state
|
|
|
|
|
$( this )
|
|
|
|
|
.siblings( 'div.config-help-field-content' )
|
|
|
|
|
.toggleClass( 'config-help-field-content-hidden' );
|
|
|
|
|
} );
|
2010-05-07 12:25:01 +00:00
|
|
|
} );
|
2018-08-29 04:46:30 +00:00
|
|
|
}() );
|