integrity: sha256-2Kok7MbOyxpgUVvAk/HJ2jigOSYS2auK4Pfzbm7uH60=
dest: jquery.js
-# TODO: jquery.chosen
+jquery.chosen:
+ type: multi-file
+ files:
+ LICENSE:
+ src: https://raw.githubusercontent.com/harvesthq/chosen/v1.8.2/LICENSE.md
+ integrity: sha384-hxUqOVbJZTd9clMlf9yV18PjyKQ2rUOCXLgFNYlV/blpyeCyiUCpmVjAmNP0yc8M
+ README.md:
+ src: https://raw.githubusercontent.com/harvesthq/chosen/v1.8.2/README.md
+ integrity: sha384-ps8fQiOF1anPibj6QMNii4OcAbZNcy+dkmdJUZzqBgmfjaPth9YDe0TRIk89lfID
+ # Following files taken from CDN because they're built, and don't exist in the repo
+ chosen-sprite.png:
+ src: https://cdnjs.cloudflare.com/ajax/libs/chosen/1.8.2/chosen-sprite.png
+ integrity: sha384-QL0lDMjIhfcd5uzKEIPehkhx7l0gHWxFo1taNsY2hdDuYdGAadNhiwKueQ91R8KW
+ chosen-sprite@2x.png:
+ src: https://cdnjs.cloudflare.com/ajax/libs/chosen/1.8.2/chosen-sprite%402x.png
+ integrity: sha384-MSDzP+ofFO+lRrCZQn3dztHS/GdR8Ai907bxrRZeuGSi87G8XffEKTxxM99GTvr1
+ chosen.css:
+ src: https://cdnjs.cloudflare.com/ajax/libs/chosen/1.8.2/chosen.css
+ integrity: sha384-VeNz/jFhcqEG5UB40sPZW8Bg8sdtbtXW1038aqBPAZy/z/6j1XsSQjRUJ7NEM3nE
+ chosen.jquery.js:
+ src: https://cdnjs.cloudflare.com/ajax/libs/chosen/1.8.2/chosen.jquery.js
+ integrity: sha384-EzfvMGW4mwDo/InJrmR/UvtxTUUYUA0cfybfS8aqPG1ItoAQYYYDImWl1gaBzMfQ
jquery.client:
type: tar
* @return {mw.Title|null} A valid Title object or null if the input cannot be turned into a valid title
*/
Title.newFromUserInput = function ( title, defaultNamespaceOrOptions, options ) {
- var namespace, m, id, ext, parts,
+ var namespace, m, id, ext, lastDot,
defaultNamespace;
// defaultNamespace is optional; check whether options moves up
namespace === NS_MEDIA ||
( options.forUploading && ( namespace === NS_FILE ) )
) {
-
title = sanitize( title, [ 'generalRule', 'fileRule' ] );
// Operate on the file extension
// Although it is possible having spaces between the name and the ".ext" this isn't nice for
// operating systems hiding file extensions -> strip them later on
- parts = title.split( '.' );
-
- if ( parts.length > 1 ) {
-
- // Get the last part, which is supposed to be the file extension
- ext = parts.pop();
+ lastDot = title.lastIndexOf( '.' );
- // Remove whitespace of the name part (that W/O extension)
- title = parts.join( '.' ).trim();
-
- // Cut, if too long and append file extension
- title = trimFileNameToByteLength( title, ext );
+ // No or empty file extension
+ if ( lastDot === -1 || lastDot >= title.length - 1 ) {
+ return null;
+ }
- } else {
+ // Get the last part, which is supposed to be the file extension
+ ext = title.slice( lastDot + 1 );
- // Missing file extension
- title = parts.join( '.' ).trim();
+ // Remove whitespace of the name part (that without extension)
+ title = title.slice( 0, lastDot ).trim();
- // Name has no file extension and a fallback wasn't provided either
- return null;
- }
+ // Cut, if too long and append file extension
+ title = trimFileNameToByteLength( title, ext );
} else {
-
title = sanitize( title, [ 'generalRule' ] );
// Cut titles exceeding the TITLE_MAX_BYTES byte size limit