User:Jack who built the house/convenientDiscussions.js.LICENSE.js
Jump to navigation
Jump to search
Note: After saving, you have to bypass your browser's cache to see the changes. Internet Explorer: press Ctrl-F5, Mozilla: hold down Shift while clicking Reload (or press Ctrl-Shift-R), Opera/Konqueror: press F5, Safari: hold down Shift + Alt while clicking Reload, Chrome: hold down Shift while clicking Reload.
This user script seems to have a documentation page at User:Jack who built the house/convenientDiscussions.js.LICENSE. |
/**
* Get a regexp that matches timestamps (without timezone at the end) generated using the given date
* format.
*
* This only supports format characters that are used by the default date format in any of
* MediaWiki's languages, namely: D, d, F, G, H, i, j, l, M, n, Y, xg, xkY (and escape characters),
* and only dates when MediaWiki existed, let's say 2000 onwards (Thai dates before 1941 are
* complicated).
*
* @param {'content'|'user'} language
* @returns {string} Pattern to be a part of a regular expression.
* @private
* @author Bartosz Dziewoński <matma.rex@gmail.com>
* @author Jack who built the house
* @license MIT
*/
/**
* Get codes of date components for the function that parses timestamps in the local date format
* based on the result of matching the regexp set by `setTimestampRegexps()`.
*
* @param {string} format
* @returns {string[]}
* @private
* @author Bartosz Dziewoński <matma.rex@gmail.com>
* @author Jack who built the house
* @license MIT
*/
/**
* Get date tokens used in a format (to load only needed tokens).
*
* @param {string} format
* @returns {string[]}
* @private
* @author Bartosz Dziewoński <matma.rex@gmail.com>
* @license MIT
*/
/**
* Like
* {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/charAt String#charAt},
* but returns the pair of UTF-16 surrogates for characters outside of BMP.
*
* Borrowed from
* https://phabricator.wikimedia.org/source/mediawiki/browse/master/resources/src/mediawiki.String.js;af9bbfe40f34c187c091230312273808028d990a$61.
*
* @param {string} string
* @param {number} offset
* @param {boolean} backwards
* @returns {string}
* @author Bartosz Dziewoński <matma.rex@gmail.com>
* @license MIT
* @private
*/
/**
* Parse a timestamp, accepting a regexp match and returning a date.
*
* @param {string[]} match Regexp match data.
* @param {string|number} [timezone] Timezone standard name or offset in minutes. If set, it is
* implied that the timestamp is in the user (interface) language, not in the content language.
* @returns {Date}
* @author Bartosz Dziewoński <matma.rex@gmail.com>
* @author Jack who built the house
* @license MIT
*/
/**
* Tribute.js
* Native ES6 JavaScript @mention Plugin
* Improved and adapted for use in the Convenient Discussions script. (There shoudln't be
* any hardcode related to CD here.)
*
* @license
* The MIT License (MIT)
*
* Copyright (c) 2020 Jack who built the house
* Copyright (c) 2017-2020 ZURB, Inc.
* Copyright (c) 2014 Jeff Collins
* Copyright (c) 2012 Matt York
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software
* and associated documentation files (the "Software"), to deal in the Software without
* restriction, including without limitation the rights to use, copy, modify, merge, publish,
* distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all copies or
* substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
* BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
* DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
**/