מדיה ויקי:CD-config.js – הבדלי גרסאות

תוכן שנמחק תוכן שנוסף
אין תקציר עריכה
אין תקציר עריכה
שורה 9:
 
(function () {
 
function unique(item, pos, arr) {
return arr.indexOf(item) === pos;
}
 
function getStrings() {
const langrequests = [mw.config.get('wgUserLanguage');, mw.config.get('wgContentLanguage')]
.filter(unique)
return new Promise((resolve) => {
if.filter(function (lang === 'en') {
return lang !== 'en';
// English strings are already in the script.
resolve(});
.map((lang) => mw.loader.getScript('https://commons.wikimedia.org/w/index.php?title=User:Jack_who_built_the_house/convenientDiscussions-i18n/' + lang + '.js&action=raw&ctype=text/javascript'));
} else {
// We assume it's OK to fall back to English if the translation is unavailable for any reason.
mw.loader.getScript('https://commons.wikimedia.org/w/index.php?title=User:Jack_who_built_the_house/convenientDiscussions-i18n/' + lang + '.js&action=raw&ctype=text/javascript')
return Promise.all(requests).catch(function () {});
// We assume it's OK to fall back to English if the translation is unavailable for any
// reason.
.always(resolve);
}
});
}
 
window.convenientDiscussions = window.convenientDiscussions || {};
if (convenientDiscussions.config) return;
 
 
שורה 123 ⟵ 124:
* Here, `''` is not a part of the signature.
*
* End the regexp with "`$"`.
*
* @type {RegExp}
* @default /(?:\s+>+)?(?:[·•\-–—―~/→⇒\s]|—|–|→|·| | )*\(?'*$/
*/
// signaturePrefixRegexp: /(?:\s+>+)?(?:[·•\-–—―~/→⇒\s]|—|–|→|·| | )*\(?'*$/,
שורה 132 ⟵ 133:
/**
* Unchangable text (usually user talk page link) at the end of Mediawiki:Signature (visible text,
* not wikitext). End the regexp with "`$"`.
*
* @type {?RegExp}
שורה 141 ⟵ 142:
tagName: 'דיונים נוחים',
 
/**
* Script code name. ForUsed, for example, for the `source` parameter of the thank request: {@link
* https://www.mediawiki.org/wiki/Extension:Thanks#API_documentation}.
*
שורה 181 ⟵ 182:
// ],
 
blockSmallTemplatesmallDivTemplate: null,
 
paragraphTemplates: ['ש'],
שורה 189 ⟵ 190:
/**
* Blocks with classes listed here wont't be considered legit comment timestamp containers. They
* can still be parts of comments; for athe way to prevent certain elements from becoming comment
* parts, see {@link module:defaultConfig.checkForCustomForeignComponents}.
When it comes to the*
* When it comes to the wikitext, all lines containing these classes are ignored.
*
* @type {string[]}
שורה 204 ⟵ 206:
* wikitext.
*
* @type {stringRegExp[]}
* @default []
*/
שורה 211 ⟵ 213:
/**
* Regexps for strings that should be cut out of comment beginnings (not considered parts of
* them). This is in an addition to {@link module:cd~convenientDiscussions.g.BAD_COMMENT_BEGINNINGS}.
* module:cd~convenientDiscussions.g.BAD_COMMENT_BEGINNINGS}. They begin with `^` and usually end with ` *\n*` or ` *\n*(?=[*:#])`.
* with ` *\n*` or ` *\n*(?=[*:#])`.
*
* @type {RegExp[]}
שורה 249 ⟵ 250:
* correctly. You can also add the `cd-floating` class to such elements. You can also add the
* `cd-ignoreFloating` class to floating elements that never intersect comments but end up in
* `cdconvenientDiscussions.g.specialElements.floating` to help performance.
*
* @type {string[]}
שורה 255 ⟵ 256:
*/
// customFloatingElementsSelectors: [],
 
/**
* Names of the closed discussion templates. They can be single templates like {@link
* https://en.wikipedia.org/wiki/Template:Closed} or pair templates like {@link
* https://ru.wikipedia.org/wiki/Template:Закрыто} / {@link
* https://ru.wikipedia.org/wiki/Template:Конец_закрытой_секции}. Include the closing part of the
* pair templates in the second array, and the rest of the templates in the first array. These
* templates are ignored when searching for a place to insert a comment in the wikitext.
}*
* @type {Array.<Array.<string>>}
* @default <pre class="prettyprint source"><code>[
* [],
* [],
* ]</code></pre>
*/
// closedDiscussionTemplates: [
// [],
// [],
// *],
 
/**
שורה 262 ⟵ 282:
* @default []
*/
// closedDiscussionsClassesclosedDiscussionClasses: [],
 
/**
שורה 318 ⟵ 338:
 
/**
* Comment having howHow many characters should a comment have to be considered long. Comments having more characters
* characters will need confirmation to be sent.
*
* @type {number}
שורה 327 ⟵ 347:
 
/**
* HowLower manylimit bytesof needthe number of bytes to be added to the page to deem an edit a new comment.
*
* @type {number}
שורה 335 ⟵ 355:
 
/**
* HowUpper longlimit aof commentthe canlength beof a comment to put its whole contextcontent in the edit summary.
*
* @type {number}
שורה 343 ⟵ 363:
 
/**
* Regular expression matching the names of the pages where an sending empty comment shouldn't be
* confirmed (e.g., voting pages).
*
* @type {?RegExp}
שורה 362 ⟵ 382:
 
/**
* Reaction, i.e. an objectObject specifying messages to be displayed when the user enters text that matches a pattern.
* matches a pattern.
*
* @typedef {object[]} Reaction
* @property {RegExp} pattern Pattern to match.
* @property {string} message Message displayed to the user.
* @property {string} classname Latin letters, digits, `-`.
* @property {string} [type='notice'] For example, `notice`.
* @property {Function} [checkFunc] If the function returns false, no message is displayed.
שורה 389 ⟵ 408:
 
/**
* Load these modules on comment form creation,. optionallySee if{@link themodule:defaultConfig~Module} condition specified insidefor the
* object structure. If `checkFunc` functionis set, the module will be loaded if the condition is met.
*
* @type {Module[]}
שורה 396 ⟵ 415:
*/
// customCommentFormModules: [],
 
/**
* Whether to show a placeholder in a comment input.
*
* If gender is needed to output the comment input placeholder, it could be better to set the
* value to `false` to avoid displaying the placeholder altogether (a gender request would need
* time to proceed hampering user experience).
*
* @type {boolean}
* @default true
*/
// showCommentInputPlaceholder: true,
 
/**
שורה 506 ⟵ 513:
convenientDiscussions.getStringsPromise = getStrings();
mw.loader.getScript('https://commons.wikimedia.org/w/index.php?title=User:Jack_who_built_the_house/convenientDiscussions.js&action=raw&ctype=text/javascript')
.catch(function (e) => {
console.warn('Couldn\'t load Convenient Discussions.', e);
});