Edit File by line

Deprecated: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in /home/sportsfever/public_html/filemanger/function.php on line 93

Warning: Undefined array key "page_file_edit_line" in /home/sportsfever/public_html/filemanger/edit_text_line.php on line 32
/home/sportsfe.../httpdocs/wp-admin/js
File: customize-controls.js
[2000] Fix | Delete
// Collapse any sibling sections/panels.
[2001] Fix | Delete
api.section.each( function ( otherSection ) {
[2002] Fix | Delete
var searchTerm;
[2003] Fix | Delete
[2004] Fix | Delete
if ( otherSection !== section ) {
[2005] Fix | Delete
[2006] Fix | Delete
// Try to sync the current search term to the new section.
[2007] Fix | Delete
if ( 'themes' === otherSection.params.type ) {
[2008] Fix | Delete
searchTerm = otherSection.contentContainer.find( '.wp-filter-search' ).val();
[2009] Fix | Delete
section.contentContainer.find( '.wp-filter-search' ).val( searchTerm );
[2010] Fix | Delete
[2011] Fix | Delete
// Directly initialize an empty remote search to avoid a race condition.
[2012] Fix | Delete
if ( '' === searchTerm && '' !== section.term && 'local' !== section.params.filter_type ) {
[2013] Fix | Delete
section.term = '';
[2014] Fix | Delete
section.initializeNewQuery( section.term, section.tags );
[2015] Fix | Delete
} else {
[2016] Fix | Delete
if ( 'remote' === section.params.filter_type ) {
[2017] Fix | Delete
section.checkTerm( section );
[2018] Fix | Delete
} else if ( 'local' === section.params.filter_type ) {
[2019] Fix | Delete
section.filterSearch( searchTerm );
[2020] Fix | Delete
}
[2021] Fix | Delete
}
[2022] Fix | Delete
otherSection.collapse( { duration: args.duration } );
[2023] Fix | Delete
}
[2024] Fix | Delete
}
[2025] Fix | Delete
});
[2026] Fix | Delete
[2027] Fix | Delete
section.contentContainer.addClass( 'current-section' );
[2028] Fix | Delete
container.scrollTop();
[2029] Fix | Delete
[2030] Fix | Delete
container.on( 'scroll', _.throttle( section.renderScreenshots, 300 ) );
[2031] Fix | Delete
container.on( 'scroll', _.throttle( section.loadMore, 300 ) );
[2032] Fix | Delete
[2033] Fix | Delete
if ( args.completeCallback ) {
[2034] Fix | Delete
args.completeCallback();
[2035] Fix | Delete
}
[2036] Fix | Delete
section.updateCount(); // Show this section's count.
[2037] Fix | Delete
}
[2038] Fix | Delete
[2039] Fix | Delete
if ( expanded ) {
[2040] Fix | Delete
if ( section.panel() && api.panel.has( section.panel() ) ) {
[2041] Fix | Delete
api.panel( section.panel() ).expand({
[2042] Fix | Delete
duration: args.duration,
[2043] Fix | Delete
completeCallback: expand
[2044] Fix | Delete
});
[2045] Fix | Delete
} else {
[2046] Fix | Delete
expand();
[2047] Fix | Delete
}
[2048] Fix | Delete
} else {
[2049] Fix | Delete
section.contentContainer.removeClass( 'current-section' );
[2050] Fix | Delete
[2051] Fix | Delete
// Always hide, even if they don't exist or are already hidden.
[2052] Fix | Delete
section.headerContainer.find( '.filter-details' ).slideUp( 180 );
[2053] Fix | Delete
[2054] Fix | Delete
container.off( 'scroll' );
[2055] Fix | Delete
[2056] Fix | Delete
if ( args.completeCallback ) {
[2057] Fix | Delete
args.completeCallback();
[2058] Fix | Delete
}
[2059] Fix | Delete
}
[2060] Fix | Delete
},
[2061] Fix | Delete
[2062] Fix | Delete
/**
[2063] Fix | Delete
* Return the section's content element without detaching from the parent.
[2064] Fix | Delete
*
[2065] Fix | Delete
* @since 4.9.0
[2066] Fix | Delete
*
[2067] Fix | Delete
* @return {jQuery}
[2068] Fix | Delete
*/
[2069] Fix | Delete
getContent: function() {
[2070] Fix | Delete
return this.container.find( '.control-section-content' );
[2071] Fix | Delete
},
[2072] Fix | Delete
[2073] Fix | Delete
/**
[2074] Fix | Delete
* Load theme data via Ajax and add themes to the section as controls.
[2075] Fix | Delete
*
[2076] Fix | Delete
* @since 4.9.0
[2077] Fix | Delete
*
[2078] Fix | Delete
* @return {void}
[2079] Fix | Delete
*/
[2080] Fix | Delete
loadThemes: function() {
[2081] Fix | Delete
var section = this, params, page, request;
[2082] Fix | Delete
[2083] Fix | Delete
if ( section.loading ) {
[2084] Fix | Delete
return; // We're already loading a batch of themes.
[2085] Fix | Delete
}
[2086] Fix | Delete
[2087] Fix | Delete
// Parameters for every API query. Additional params are set in PHP.
[2088] Fix | Delete
page = Math.ceil( section.loaded / 100 ) + 1;
[2089] Fix | Delete
params = {
[2090] Fix | Delete
'nonce': api.settings.nonce.switch_themes,
[2091] Fix | Delete
'wp_customize': 'on',
[2092] Fix | Delete
'theme_action': section.params.action,
[2093] Fix | Delete
'customized_theme': api.settings.theme.stylesheet,
[2094] Fix | Delete
'page': page
[2095] Fix | Delete
};
[2096] Fix | Delete
[2097] Fix | Delete
// Add fields for remote filtering.
[2098] Fix | Delete
if ( 'remote' === section.params.filter_type ) {
[2099] Fix | Delete
params.search = section.term;
[2100] Fix | Delete
params.tags = section.tags;
[2101] Fix | Delete
}
[2102] Fix | Delete
[2103] Fix | Delete
// Load themes.
[2104] Fix | Delete
section.headContainer.closest( '.wp-full-overlay' ).addClass( 'loading' );
[2105] Fix | Delete
section.loading = true;
[2106] Fix | Delete
section.container.find( '.no-themes' ).hide();
[2107] Fix | Delete
request = wp.ajax.post( 'customize_load_themes', params );
[2108] Fix | Delete
request.done(function( data ) {
[2109] Fix | Delete
var themes = data.themes;
[2110] Fix | Delete
[2111] Fix | Delete
// Stop and try again if the term changed while loading.
[2112] Fix | Delete
if ( '' !== section.nextTerm || '' !== section.nextTags ) {
[2113] Fix | Delete
if ( section.nextTerm ) {
[2114] Fix | Delete
section.term = section.nextTerm;
[2115] Fix | Delete
}
[2116] Fix | Delete
if ( section.nextTags ) {
[2117] Fix | Delete
section.tags = section.nextTags;
[2118] Fix | Delete
}
[2119] Fix | Delete
section.nextTerm = '';
[2120] Fix | Delete
section.nextTags = '';
[2121] Fix | Delete
section.loading = false;
[2122] Fix | Delete
section.loadThemes();
[2123] Fix | Delete
return;
[2124] Fix | Delete
}
[2125] Fix | Delete
[2126] Fix | Delete
if ( 0 !== themes.length ) {
[2127] Fix | Delete
[2128] Fix | Delete
section.loadControls( themes, page );
[2129] Fix | Delete
[2130] Fix | Delete
if ( 1 === page ) {
[2131] Fix | Delete
[2132] Fix | Delete
// Pre-load the first 3 theme screenshots.
[2133] Fix | Delete
_.each( section.controls().slice( 0, 3 ), function( control ) {
[2134] Fix | Delete
var img, src = control.params.theme.screenshot[0];
[2135] Fix | Delete
if ( src ) {
[2136] Fix | Delete
img = new Image();
[2137] Fix | Delete
img.src = src;
[2138] Fix | Delete
}
[2139] Fix | Delete
});
[2140] Fix | Delete
if ( 'local' !== section.params.filter_type ) {
[2141] Fix | Delete
wp.a11y.speak( api.settings.l10n.themeSearchResults.replace( '%d', data.info.results ) );
[2142] Fix | Delete
}
[2143] Fix | Delete
}
[2144] Fix | Delete
[2145] Fix | Delete
_.delay( section.renderScreenshots, 100 ); // Wait for the controls to become visible.
[2146] Fix | Delete
[2147] Fix | Delete
if ( 'local' === section.params.filter_type || 100 > themes.length ) {
[2148] Fix | Delete
// If we have less than the requested 100 themes, it's the end of the list.
[2149] Fix | Delete
section.fullyLoaded = true;
[2150] Fix | Delete
}
[2151] Fix | Delete
} else {
[2152] Fix | Delete
if ( 0 === section.loaded ) {
[2153] Fix | Delete
section.container.find( '.no-themes' ).show();
[2154] Fix | Delete
wp.a11y.speak( section.container.find( '.no-themes' ).text() );
[2155] Fix | Delete
} else {
[2156] Fix | Delete
section.fullyLoaded = true;
[2157] Fix | Delete
}
[2158] Fix | Delete
}
[2159] Fix | Delete
if ( 'local' === section.params.filter_type ) {
[2160] Fix | Delete
section.updateCount(); // Count of visible theme controls.
[2161] Fix | Delete
} else {
[2162] Fix | Delete
section.updateCount( data.info.results ); // Total number of results including pages not yet loaded.
[2163] Fix | Delete
}
[2164] Fix | Delete
section.container.find( '.unexpected-error' ).hide(); // Hide error notice in case it was previously shown.
[2165] Fix | Delete
[2166] Fix | Delete
// This cannot run on request.always, as section.loading may turn false before the new controls load in the success case.
[2167] Fix | Delete
section.headContainer.closest( '.wp-full-overlay' ).removeClass( 'loading' );
[2168] Fix | Delete
section.loading = false;
[2169] Fix | Delete
});
[2170] Fix | Delete
request.fail(function( data ) {
[2171] Fix | Delete
if ( 'undefined' === typeof data ) {
[2172] Fix | Delete
section.container.find( '.unexpected-error' ).show();
[2173] Fix | Delete
wp.a11y.speak( section.container.find( '.unexpected-error' ).text() );
[2174] Fix | Delete
} else if ( 'undefined' !== typeof console && console.error ) {
[2175] Fix | Delete
console.error( data );
[2176] Fix | Delete
}
[2177] Fix | Delete
[2178] Fix | Delete
// This cannot run on request.always, as section.loading may turn false before the new controls load in the success case.
[2179] Fix | Delete
section.headContainer.closest( '.wp-full-overlay' ).removeClass( 'loading' );
[2180] Fix | Delete
section.loading = false;
[2181] Fix | Delete
});
[2182] Fix | Delete
},
[2183] Fix | Delete
[2184] Fix | Delete
/**
[2185] Fix | Delete
* Loads controls into the section from data received from loadThemes().
[2186] Fix | Delete
*
[2187] Fix | Delete
* @since 4.9.0
[2188] Fix | Delete
* @param {Array} themes - Array of theme data to create controls with.
[2189] Fix | Delete
* @param {number} page - Page of results being loaded.
[2190] Fix | Delete
* @return {void}
[2191] Fix | Delete
*/
[2192] Fix | Delete
loadControls: function( themes, page ) {
[2193] Fix | Delete
var newThemeControls = [],
[2194] Fix | Delete
section = this;
[2195] Fix | Delete
[2196] Fix | Delete
// Add controls for each theme.
[2197] Fix | Delete
_.each( themes, function( theme ) {
[2198] Fix | Delete
var themeControl = new api.controlConstructor.theme( section.params.action + '_theme_' + theme.id, {
[2199] Fix | Delete
type: 'theme',
[2200] Fix | Delete
section: section.params.id,
[2201] Fix | Delete
theme: theme,
[2202] Fix | Delete
priority: section.loaded + 1
[2203] Fix | Delete
} );
[2204] Fix | Delete
[2205] Fix | Delete
api.control.add( themeControl );
[2206] Fix | Delete
newThemeControls.push( themeControl );
[2207] Fix | Delete
section.loaded = section.loaded + 1;
[2208] Fix | Delete
});
[2209] Fix | Delete
[2210] Fix | Delete
if ( 1 !== page ) {
[2211] Fix | Delete
Array.prototype.push.apply( section.screenshotQueue, newThemeControls ); // Add new themes to the screenshot queue.
[2212] Fix | Delete
}
[2213] Fix | Delete
},
[2214] Fix | Delete
[2215] Fix | Delete
/**
[2216] Fix | Delete
* Determines whether more themes should be loaded, and loads them.
[2217] Fix | Delete
*
[2218] Fix | Delete
* @since 4.9.0
[2219] Fix | Delete
* @return {void}
[2220] Fix | Delete
*/
[2221] Fix | Delete
loadMore: function() {
[2222] Fix | Delete
var section = this, container, bottom, threshold;
[2223] Fix | Delete
if ( ! section.fullyLoaded && ! section.loading ) {
[2224] Fix | Delete
container = section.container.closest( '.customize-themes-full-container' );
[2225] Fix | Delete
[2226] Fix | Delete
bottom = container.scrollTop() + container.height();
[2227] Fix | Delete
// Use a fixed distance to the bottom of loaded results to avoid unnecessarily
[2228] Fix | Delete
// loading results sooner when using a percentage of scroll distance.
[2229] Fix | Delete
threshold = container.prop( 'scrollHeight' ) - 3000;
[2230] Fix | Delete
[2231] Fix | Delete
if ( bottom > threshold ) {
[2232] Fix | Delete
section.loadThemes();
[2233] Fix | Delete
}
[2234] Fix | Delete
}
[2235] Fix | Delete
},
[2236] Fix | Delete
[2237] Fix | Delete
/**
[2238] Fix | Delete
* Event handler for search input that filters visible controls.
[2239] Fix | Delete
*
[2240] Fix | Delete
* @since 4.9.0
[2241] Fix | Delete
*
[2242] Fix | Delete
* @param {string} term - The raw search input value.
[2243] Fix | Delete
* @return {void}
[2244] Fix | Delete
*/
[2245] Fix | Delete
filterSearch: function( term ) {
[2246] Fix | Delete
var count = 0,
[2247] Fix | Delete
visible = false,
[2248] Fix | Delete
section = this,
[2249] Fix | Delete
noFilter = ( api.section.has( 'wporg_themes' ) && 'remote' !== section.params.filter_type ) ? '.no-themes-local' : '.no-themes',
[2250] Fix | Delete
controls = section.controls(),
[2251] Fix | Delete
terms;
[2252] Fix | Delete
[2253] Fix | Delete
if ( section.loading ) {
[2254] Fix | Delete
return;
[2255] Fix | Delete
}
[2256] Fix | Delete
[2257] Fix | Delete
// Standardize search term format and split into an array of individual words.
[2258] Fix | Delete
terms = term.toLowerCase().trim().replace( /-/g, ' ' ).split( ' ' );
[2259] Fix | Delete
[2260] Fix | Delete
_.each( controls, function( control ) {
[2261] Fix | Delete
visible = control.filter( terms ); // Shows/hides and sorts control based on the applicability of the search term.
[2262] Fix | Delete
if ( visible ) {
[2263] Fix | Delete
count = count + 1;
[2264] Fix | Delete
}
[2265] Fix | Delete
});
[2266] Fix | Delete
[2267] Fix | Delete
if ( 0 === count ) {
[2268] Fix | Delete
section.container.find( noFilter ).show();
[2269] Fix | Delete
wp.a11y.speak( section.container.find( noFilter ).text() );
[2270] Fix | Delete
} else {
[2271] Fix | Delete
section.container.find( noFilter ).hide();
[2272] Fix | Delete
}
[2273] Fix | Delete
[2274] Fix | Delete
section.renderScreenshots();
[2275] Fix | Delete
api.reflowPaneContents();
[2276] Fix | Delete
[2277] Fix | Delete
// Update theme count.
[2278] Fix | Delete
section.updateCountDebounced( count );
[2279] Fix | Delete
},
[2280] Fix | Delete
[2281] Fix | Delete
/**
[2282] Fix | Delete
* Event handler for search input that determines if the terms have changed and loads new controls as needed.
[2283] Fix | Delete
*
[2284] Fix | Delete
* @since 4.9.0
[2285] Fix | Delete
*
[2286] Fix | Delete
* @param {wp.customize.ThemesSection} section - The current theme section, passed through the debouncer.
[2287] Fix | Delete
* @return {void}
[2288] Fix | Delete
*/
[2289] Fix | Delete
checkTerm: function( section ) {
[2290] Fix | Delete
var newTerm;
[2291] Fix | Delete
if ( 'remote' === section.params.filter_type ) {
[2292] Fix | Delete
newTerm = section.contentContainer.find( '.wp-filter-search' ).val();
[2293] Fix | Delete
if ( section.term !== newTerm.trim() ) {
[2294] Fix | Delete
section.initializeNewQuery( newTerm, section.tags );
[2295] Fix | Delete
}
[2296] Fix | Delete
}
[2297] Fix | Delete
},
[2298] Fix | Delete
[2299] Fix | Delete
/**
[2300] Fix | Delete
* Check for filters checked in the feature filter list and initialize a new query.
[2301] Fix | Delete
*
[2302] Fix | Delete
* @since 4.9.0
[2303] Fix | Delete
*
[2304] Fix | Delete
* @return {void}
[2305] Fix | Delete
*/
[2306] Fix | Delete
filtersChecked: function() {
[2307] Fix | Delete
var section = this,
[2308] Fix | Delete
items = section.container.find( '.filter-group' ).find( ':checkbox' ),
[2309] Fix | Delete
tags = [];
[2310] Fix | Delete
[2311] Fix | Delete
_.each( items.filter( ':checked' ), function( item ) {
[2312] Fix | Delete
tags.push( $( item ).prop( 'value' ) );
[2313] Fix | Delete
});
[2314] Fix | Delete
[2315] Fix | Delete
// When no filters are checked, restore initial state. Update filter count.
[2316] Fix | Delete
if ( 0 === tags.length ) {
[2317] Fix | Delete
tags = '';
[2318] Fix | Delete
section.contentContainer.find( '.feature-filter-toggle .filter-count-0' ).show();
[2319] Fix | Delete
section.contentContainer.find( '.feature-filter-toggle .filter-count-filters' ).hide();
[2320] Fix | Delete
} else {
[2321] Fix | Delete
section.contentContainer.find( '.feature-filter-toggle .theme-filter-count' ).text( tags.length );
[2322] Fix | Delete
section.contentContainer.find( '.feature-filter-toggle .filter-count-0' ).hide();
[2323] Fix | Delete
section.contentContainer.find( '.feature-filter-toggle .filter-count-filters' ).show();
[2324] Fix | Delete
}
[2325] Fix | Delete
[2326] Fix | Delete
// Check whether tags have changed, and either load or queue them.
[2327] Fix | Delete
if ( ! _.isEqual( section.tags, tags ) ) {
[2328] Fix | Delete
if ( section.loading ) {
[2329] Fix | Delete
section.nextTags = tags;
[2330] Fix | Delete
} else {
[2331] Fix | Delete
if ( 'remote' === section.params.filter_type ) {
[2332] Fix | Delete
section.initializeNewQuery( section.term, tags );
[2333] Fix | Delete
} else if ( 'local' === section.params.filter_type ) {
[2334] Fix | Delete
section.filterSearch( tags.join( ' ' ) );
[2335] Fix | Delete
}
[2336] Fix | Delete
}
[2337] Fix | Delete
}
[2338] Fix | Delete
},
[2339] Fix | Delete
[2340] Fix | Delete
/**
[2341] Fix | Delete
* Reset the current query and load new results.
[2342] Fix | Delete
*
[2343] Fix | Delete
* @since 4.9.0
[2344] Fix | Delete
*
[2345] Fix | Delete
* @param {string} newTerm - New term.
[2346] Fix | Delete
* @param {Array} newTags - New tags.
[2347] Fix | Delete
* @return {void}
[2348] Fix | Delete
*/
[2349] Fix | Delete
initializeNewQuery: function( newTerm, newTags ) {
[2350] Fix | Delete
var section = this;
[2351] Fix | Delete
[2352] Fix | Delete
// Clear the controls in the section.
[2353] Fix | Delete
_.each( section.controls(), function( control ) {
[2354] Fix | Delete
control.container.remove();
[2355] Fix | Delete
api.control.remove( control.id );
[2356] Fix | Delete
});
[2357] Fix | Delete
section.loaded = 0;
[2358] Fix | Delete
section.fullyLoaded = false;
[2359] Fix | Delete
section.screenshotQueue = null;
[2360] Fix | Delete
[2361] Fix | Delete
// Run a new query, with loadThemes handling paging, etc.
[2362] Fix | Delete
if ( ! section.loading ) {
[2363] Fix | Delete
section.term = newTerm;
[2364] Fix | Delete
section.tags = newTags;
[2365] Fix | Delete
section.loadThemes();
[2366] Fix | Delete
} else {
[2367] Fix | Delete
section.nextTerm = newTerm; // This will reload from loadThemes() with the newest term once the current batch is loaded.
[2368] Fix | Delete
section.nextTags = newTags; // This will reload from loadThemes() with the newest tags once the current batch is loaded.
[2369] Fix | Delete
}
[2370] Fix | Delete
if ( ! section.expanded() ) {
[2371] Fix | Delete
section.expand(); // Expand the section if it isn't expanded.
[2372] Fix | Delete
}
[2373] Fix | Delete
},
[2374] Fix | Delete
[2375] Fix | Delete
/**
[2376] Fix | Delete
* Render control's screenshot if the control comes into view.
[2377] Fix | Delete
*
[2378] Fix | Delete
* @since 4.2.0
[2379] Fix | Delete
*
[2380] Fix | Delete
* @return {void}
[2381] Fix | Delete
*/
[2382] Fix | Delete
renderScreenshots: function() {
[2383] Fix | Delete
var section = this;
[2384] Fix | Delete
[2385] Fix | Delete
// Fill queue initially, or check for more if empty.
[2386] Fix | Delete
if ( null === section.screenshotQueue || 0 === section.screenshotQueue.length ) {
[2387] Fix | Delete
[2388] Fix | Delete
// Add controls that haven't had their screenshots rendered.
[2389] Fix | Delete
section.screenshotQueue = _.filter( section.controls(), function( control ) {
[2390] Fix | Delete
return ! control.screenshotRendered;
[2391] Fix | Delete
});
[2392] Fix | Delete
}
[2393] Fix | Delete
[2394] Fix | Delete
// Are all screenshots rendered (for now)?
[2395] Fix | Delete
if ( ! section.screenshotQueue.length ) {
[2396] Fix | Delete
return;
[2397] Fix | Delete
}
[2398] Fix | Delete
[2399] Fix | Delete
section.screenshotQueue = _.filter( section.screenshotQueue, function( control ) {
[2400] Fix | Delete
var $imageWrapper = control.container.find( '.theme-screenshot' ),
[2401] Fix | Delete
$image = $imageWrapper.find( 'img' );
[2402] Fix | Delete
[2403] Fix | Delete
if ( ! $image.length ) {
[2404] Fix | Delete
return false;
[2405] Fix | Delete
}
[2406] Fix | Delete
[2407] Fix | Delete
if ( $image.is( ':hidden' ) ) {
[2408] Fix | Delete
return true;
[2409] Fix | Delete
}
[2410] Fix | Delete
[2411] Fix | Delete
// Based on unveil.js.
[2412] Fix | Delete
var wt = section.$window.scrollTop(),
[2413] Fix | Delete
wb = wt + section.$window.height(),
[2414] Fix | Delete
et = $image.offset().top,
[2415] Fix | Delete
ih = $imageWrapper.height(),
[2416] Fix | Delete
eb = et + ih,
[2417] Fix | Delete
threshold = ih * 3,
[2418] Fix | Delete
inView = eb >= wt - threshold && et <= wb + threshold;
[2419] Fix | Delete
[2420] Fix | Delete
if ( inView ) {
[2421] Fix | Delete
control.container.trigger( 'render-screenshot' );
[2422] Fix | Delete
}
[2423] Fix | Delete
[2424] Fix | Delete
// If the image is in view return false so it's cleared from the queue.
[2425] Fix | Delete
return ! inView;
[2426] Fix | Delete
} );
[2427] Fix | Delete
},
[2428] Fix | Delete
[2429] Fix | Delete
/**
[2430] Fix | Delete
* Get visible count.
[2431] Fix | Delete
*
[2432] Fix | Delete
* @since 4.9.0
[2433] Fix | Delete
*
[2434] Fix | Delete
* @return {number} Visible count.
[2435] Fix | Delete
*/
[2436] Fix | Delete
getVisibleCount: function() {
[2437] Fix | Delete
return this.contentContainer.find( 'li.customize-control:visible' ).length;
[2438] Fix | Delete
},
[2439] Fix | Delete
[2440] Fix | Delete
/**
[2441] Fix | Delete
* Update the number of themes in the section.
[2442] Fix | Delete
*
[2443] Fix | Delete
* @since 4.9.0
[2444] Fix | Delete
*
[2445] Fix | Delete
* @return {void}
[2446] Fix | Delete
*/
[2447] Fix | Delete
updateCount: function( count ) {
[2448] Fix | Delete
var section = this, countEl, displayed;
[2449] Fix | Delete
[2450] Fix | Delete
if ( ! count && 0 !== count ) {
[2451] Fix | Delete
count = section.getVisibleCount();
[2452] Fix | Delete
}
[2453] Fix | Delete
[2454] Fix | Delete
displayed = section.contentContainer.find( '.themes-displayed' );
[2455] Fix | Delete
countEl = section.contentContainer.find( '.theme-count' );
[2456] Fix | Delete
[2457] Fix | Delete
if ( 0 === count ) {
[2458] Fix | Delete
countEl.text( '0' );
[2459] Fix | Delete
} else {
[2460] Fix | Delete
[2461] Fix | Delete
// Animate the count change for emphasis.
[2462] Fix | Delete
displayed.fadeOut( 180, function() {
[2463] Fix | Delete
countEl.text( count );
[2464] Fix | Delete
displayed.fadeIn( 180 );
[2465] Fix | Delete
} );
[2466] Fix | Delete
wp.a11y.speak( api.settings.l10n.announceThemeCount.replace( '%d', count ) );
[2467] Fix | Delete
}
[2468] Fix | Delete
},
[2469] Fix | Delete
[2470] Fix | Delete
/**
[2471] Fix | Delete
* Advance the modal to the next theme.
[2472] Fix | Delete
*
[2473] Fix | Delete
* @since 4.2.0
[2474] Fix | Delete
*
[2475] Fix | Delete
* @return {void}
[2476] Fix | Delete
*/
[2477] Fix | Delete
nextTheme: function () {
[2478] Fix | Delete
var section = this;
[2479] Fix | Delete
if ( section.getNextTheme() ) {
[2480] Fix | Delete
section.showDetails( section.getNextTheme(), function() {
[2481] Fix | Delete
section.overlay.find( '.right' ).focus();
[2482] Fix | Delete
} );
[2483] Fix | Delete
}
[2484] Fix | Delete
},
[2485] Fix | Delete
[2486] Fix | Delete
/**
[2487] Fix | Delete
* Get the next theme model.
[2488] Fix | Delete
*
[2489] Fix | Delete
* @since 4.2.0
[2490] Fix | Delete
*
[2491] Fix | Delete
* @return {wp.customize.ThemeControl|boolean} Next theme.
[2492] Fix | Delete
*/
[2493] Fix | Delete
getNextTheme: function () {
[2494] Fix | Delete
var section = this, control, nextControl, sectionControls, i;
[2495] Fix | Delete
control = api.control( section.params.action + '_theme_' + section.currentTheme );
[2496] Fix | Delete
sectionControls = section.controls();
[2497] Fix | Delete
i = _.indexOf( sectionControls, control );
[2498] Fix | Delete
if ( -1 === i ) {
[2499] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function