PluginProbe
TablePress – Tables in WordPress made easy / 3.3.2
TablePress – Tables in WordPress made easy v3.3.2
3.3.4 3.3.3 3.3.2 3.3.1 trunk 1.12 1.14 1.9.2 2.0.4 2.1.7 2.1.8 2.2 2.2.1 2.2.2 2.2.3 2.2.4 2.2.5 2.3 2.3.1 2.3.2 2.4 2.4.1 2.4.2 2.4.3 2.4.4 All 44 releases
tablepress / admin / js / common / functions.js

functions.js in TablePress – Tables in WordPress made easy 3.3.2, at admin/js/common/functions.js

17 lines 686 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 /**
2 * Common functions that are used in TablePress JS.
3 *
4 * @package TablePress
5 * @subpackage Views JavaScript
6 * @author Tobias Bäthge
7 * @since 2.0.0
8 */
9
10 /**
11 * Alias for document.getElementById and document.querySelectorAll, depending on the first character of the passed selector string. Resembles jQuery.
12 *
13 * @param {string} selector Selector string. If it starts with #, a single ID is selected, all matching selectors otherwise.
14 * @return {Element|NodeList} A single DOM Element or a DOM NodeList matching the selector.
15 */
16 export const $ = ( selector ) => ( '#' === selector[0] ? document.getElementById( selector.slice( 1 ) ) : document.querySelectorAll( selector ) );
17