golden hour
/var/softaculous/sitepad/editor/site-admin/js
⬆️ Go Up
Upload
File/Folder
Size
Actions
accordion.js
2.89 KB
Del
OK
accordion.min.js
835 B
Del
OK
admin-custom.js
5.28 KB
Del
OK
bootstrap.min.js
56.71 KB
Del
OK
code-editor.js
11.32 KB
Del
OK
code-editor.min.js
3.09 KB
Del
OK
color-picker.js
9.59 KB
Del
OK
color-picker.min.js
3.44 KB
Del
OK
comment.js
2.73 KB
Del
OK
comment.min.js
1.22 KB
Del
OK
common.js
41.77 KB
Del
OK
common.min.js
15.02 KB
Del
OK
custom-background.js
3.27 KB
Del
OK
custom-background.min.js
1.12 KB
Del
OK
customize-controls.js
283.99 KB
Del
OK
customize-controls.min.js
109.36 KB
Del
OK
customize-nav-menus.js
106.46 KB
Del
OK
customize-nav-menus.min.js
45.38 KB
Del
OK
edit-comments.js
27.89 KB
Del
OK
edit-comments.min.js
14.72 KB
Del
OK
editor-expand.js
41.48 KB
Del
OK
editor-expand.min.js
13.2 KB
Del
OK
editor.js
44.25 KB
Del
OK
editor.min.js
13.12 KB
Del
OK
gallery.js
5.51 KB
Del
OK
gallery.min.js
3.75 KB
Del
OK
image-edit.js
28.61 KB
Del
OK
image-edit.min.js
9.99 KB
Del
OK
inline-edit-post.js
15.93 KB
Del
OK
inline-edit-post.min.js
7.16 KB
Del
OK
inline-edit-tax.js
7.52 KB
Del
OK
inline-edit-tax.min.js
2.82 KB
Del
OK
iris.min.js
23.05 KB
Del
OK
language-chooser.js
875 B
Del
OK
language-chooser.min.js
374 B
Del
OK
link.js
3.79 KB
Del
OK
link.min.js
1.61 KB
Del
OK
media-gallery.js
1.19 KB
Del
OK
media-gallery.min.js
537 B
Del
OK
media-upload.js
3.38 KB
Del
OK
media-upload.min.js
1.1 KB
Del
OK
media.js
5.11 KB
Del
OK
media.min.js
1.82 KB
Del
OK
nav-menu.js
41.48 KB
Del
OK
nav-menu.min.js
20.75 KB
Del
OK
password-strength-meter.js
3.1 KB
Del
OK
password-strength-meter.min.js
769 B
Del
OK
post.js
36.51 KB
Del
OK
post.min.js
17.88 KB
Del
OK
postbox.js
11.49 KB
Del
OK
postbox.min.js
4.09 KB
Del
OK
revisions.js
33 KB
Del
OK
revisions.min.js
17.51 KB
Del
OK
set-post-thumbnail.js
843 B
Del
OK
set-post-thumbnail.min.js
533 B
Del
OK
svg-painter.js
5.39 KB
Del
OK
svg-painter.min.js
2.35 KB
Del
OK
tags-box.js
10.83 KB
Del
OK
tags-box.min.js
3.07 KB
Del
OK
tags-suggest.js
5.12 KB
Del
OK
tags-suggest.min.js
2.12 KB
Del
OK
tags.js
4.25 KB
Del
OK
tags.min.js
1.67 KB
Del
OK
theme.js
53.11 KB
Del
OK
theme.min.js
25.99 KB
Del
OK
trail.js
4.39 KB
Del
OK
updates.js
78.62 KB
Del
OK
updates.min.js
34.96 KB
Del
OK
user-profile.js
11.96 KB
Del
OK
user-profile.min.js
6.17 KB
Del
OK
user-suggest.js
2.27 KB
Del
OK
user-suggest.min.js
679 B
Del
OK
word-count.js
7.51 KB
Del
OK
word-count.min.js
1.47 KB
Del
OK
wp-fullscreen-stub.js
680 B
Del
OK
wp-fullscreen-stub.min.js
331 B
Del
OK
xfn.js
7.53 KB
Del
OK
xfn.min.js
3.42 KB
Del
OK
Edit: word-count.js
/** * Word or character counting functionality. Count words or characters in a * provided text string. * * @namespace wp.utils * @since 2.6.0 * @output site-admin/js/word-count.js */ ( function() { /** * Word counting utility * * @namespace wp.utils.wordcounter * @memberof wp.utils * * @class * * @param {Object} settings Optional. Key-value object containing overrides for * settings. * @param {RegExp} settings.HTMLRegExp Optional. Regular expression to find HTML elements. * @param {RegExp} settings.HTMLcommentRegExp Optional. Regular expression to find HTML comments. * @param {RegExp} settings.spaceRegExp Optional. Regular expression to find irregular space * characters. * @param {RegExp} settings.HTMLEntityRegExp Optional. Regular expression to find HTML entities. * @param {RegExp} settings.connectorRegExp Optional. Regular expression to find connectors that * split words. * @param {RegExp} settings.removeRegExp Optional. Regular expression to find remove unwanted * characters to reduce false-positives. * @param {RegExp} settings.astralRegExp Optional. Regular expression to find unwanted * characters when searching for non-words. * @param {RegExp} settings.wordsRegExp Optional. Regular expression to find words by spaces. * @param {RegExp} settings.characters_excluding_spacesRegExp Optional. Regular expression to find characters which * are non-spaces. * @param {RegExp} settings.characters_including_spacesRegExp Optional. Regular expression to find characters * including spaces. * @param {RegExp} settings.shortcodesRegExp Optional. Regular expression to find shortcodes. * @param {Object} settings.l10n Optional. Localization object containing specific * configuration for the current localization. * @param {String} settings.l10n.type Optional. Method of finding words to count. * @param {Array} settings.l10n.shortcodes Optional. Array of shortcodes that should be removed * from the text. * * @return void */ function WordCounter( settings ) { var key, shortcodes; // Apply provided settings to object settings. if ( settings ) { for ( key in settings ) { // Only apply valid settings. if ( settings.hasOwnProperty( key ) ) { this.settings[ key ] = settings[ key ]; } } } shortcodes = this.settings.l10n.shortcodes; // If there are any localization shortcodes, add this as type in the settings. if ( shortcodes && shortcodes.length ) { this.settings.shortcodesRegExp = new RegExp( '\\[\\/?(?:' + shortcodes.join( '|' ) + ')[^\\]]*?\\]', 'g' ); } } // Default settings. WordCounter.prototype.settings = { HTMLRegExp: /<\/?[a-z][^>]*?>/gi, HTMLcommentRegExp: /<!--[\s\S]*?-->/g, spaceRegExp: / | /gi, HTMLEntityRegExp: /&\S+?;/g, // \u2014 = em-dash connectorRegExp: /--|\u2014/g, // Characters to be removed from input text. removeRegExp: new RegExp( [ '[', // Basic Latin (extract) '\u0021-\u0040\u005B-\u0060\u007B-\u007E', // Latin-1 Supplement (extract) '\u0080-\u00BF\u00D7\u00F7', /* * The following range consists of: * General Punctuation * Superscripts and Subscripts * Currency Symbols * Combining Diacritical Marks for Symbols * Letterlike Symbols * Number Forms * Arrows * Mathematical Operators * Miscellaneous Technical * Control Pictures * Optical Character Recognition * Enclosed Alphanumerics * Box Drawing * Block Elements * Geometric Shapes * Miscellaneous Symbols * Dingbats * Miscellaneous Mathematical Symbols-A * Supplemental Arrows-A * Braille Patterns * Supplemental Arrows-B * Miscellaneous Mathematical Symbols-B * Supplemental Mathematical Operators * Miscellaneous Symbols and Arrows */ '\u2000-\u2BFF', // Supplemental Punctuation '\u2E00-\u2E7F', ']' ].join( '' ), 'g' ), // Remove UTF-16 surrogate points, see https://en.wikipedia.org/wiki/UTF-16#U.2BD800_to_U.2BDFFF astralRegExp: /[\uD800-\uDBFF][\uDC00-\uDFFF]/g, wordsRegExp: /\S\s+/g, characters_excluding_spacesRegExp: /\S/g, /* * Match anything that is not a formatting character, excluding: * \f = form feed * \n = new line * \r = carriage return * \t = tab * \v = vertical tab * \u00AD = soft hyphen * \u2028 = line separator * \u2029 = paragraph separator */ characters_including_spacesRegExp: /[^\f\n\r\t\v\u00AD\u2028\u2029]/g, l10n: window.wordCountL10n || {} }; /** * Counts the number of words (or other specified type) in the specified text. * * @since 2.6.0 * @memberof wp.utils.wordcounter * * @param {String} text Text to count elements in. * @param {String} type Optional. Specify type to use. * * @return {Number} The number of items counted. */ WordCounter.prototype.count = function( text, type ) { var count = 0; // Use default type if none was provided. type = type || this.settings.l10n.type; // Sanitize type to one of three possibilities: 'words', 'characters_excluding_spaces' or 'characters_including_spaces'. if ( type !== 'characters_excluding_spaces' && type !== 'characters_including_spaces' ) { type = 'words'; } // If we have any text at all. if ( text ) { text = text + '\n'; // Replace all HTML with a new-line. text = text.replace( this.settings.HTMLRegExp, '\n' ); // Remove all HTML comments. text = text.replace( this.settings.HTMLcommentRegExp, '' ); // If a shortcode regular expression has been provided use it to remove shortcodes. if ( this.settings.shortcodesRegExp ) { text = text.replace( this.settings.shortcodesRegExp, '\n' ); } // Normalize non-breaking space to a normal space. text = text.replace( this.settings.spaceRegExp, ' ' ); if ( type === 'words' ) { // Remove HTML Entities. text = text.replace( this.settings.HTMLEntityRegExp, '' ); // Convert connectors to spaces to count attached text as words. text = text.replace( this.settings.connectorRegExp, ' ' ); // Remove unwanted characters. text = text.replace( this.settings.removeRegExp, '' ); } else { // Convert HTML Entities to "a". text = text.replace( this.settings.HTMLEntityRegExp, 'a' ); // Remove surrogate points. text = text.replace( this.settings.astralRegExp, 'a' ); } // Match with the selected type regular expression to count the items. text = text.match( this.settings[ type + 'RegExp' ] ); // If we have any matches, set the count to the number of items found. if ( text ) { count = text.length; } } return count; }; // Add the WordCounter to the WP Utils. window.wp = window.wp || {}; window.wp.utils = window.wp.utils || {}; window.wp.utils.WordCounter = WordCounter; } )();
Save