mediawiki.Uri: Use extended RegExps through templates
authorBartosz Dziewoński <matma.rex@gmail.com>
Tue, 25 Aug 2015 07:43:38 +0000 (09:43 +0200)
committerBartosz Dziewoński <matma.rex@gmail.com>
Tue, 1 Sep 2015 12:19:39 +0000 (14:19 +0200)
commit225719993a7b355dbfde5f0a49e6f161d6f75e41
treece2561927ee5493c15c63aae54c0b1bcc53bca97
parent86c701f290485ac94879fec0305eae65f621f147
mediawiki.Uri: Use extended RegExps through templates

JavaScript does not support the 'x' RegExp option for 'extended'
RegExps, or named capturing groups, which makes it impossible to write
large RegExps in a readable way. OR DOES IT?!?

Cons:
* Small runtime performance loss to convert to regular RegExp
* Worse minification due to unminifiable whitespace
    (Both of these problems could probably me resolved
     if we moved the processing server-side somehow,
     but there's no support for it in ResourceLoader now)

Pros:
* You can actually somewhat understand the bloody things if you care
  to, unlike before.

YMMV:
* The actual regexps are in different files

Change-Id: I41630bf20cdb5c2936d85d9f831f2aa7bb8cfef1
resources/Resources.php
resources/src/mediawiki/mediawiki.Uri.js
resources/src/mediawiki/mediawiki.Uri.loose.regexp [new file with mode: 0644]
resources/src/mediawiki/mediawiki.Uri.strict.regexp [new file with mode: 0644]
resources/src/mediawiki/mediawiki.template.regexp.js [new file with mode: 0644]