MediaWiki:Gadget-replylinks.js: Różnice pomiędzy wersjami

Usunięta treść Dodana treść
podmiana na prośbę Nuxa
Linia 9:
- inserting text given in newsectionname (as PHP param in the location string of the page)
 
Copyright: ©2006-20162017 Maciej Jaros (pl:User:Nux, en:User:EcceNux)
Licencja: GNU General Public License v2
http://opensource.org/licenses/gpl-license.php
Linia 29:
Version
-=-=-=-=-=-=-=-=-=-=-=- */
oRepLinks.version = oRepLinks.ver = '1.6.89';
 
/* -=-=-=-=-=-=-=-=-=-=-=-
Linia 342:
secAbove.id = a[i].id;
// sometimes there could be a link in the header (maybe some more)
secAbove.text = $G.stripSectionNumbering($G.parseSectionText(header.innerHTML));
// should be set only once (as it is always the same), but let's leave it that way
secReplyText = $G.i18n['std prefix'];
Linia 354:
secAbove.id = a[i].id;
// sometimes there could be a link in the header (maybe some more)
secAbove.text = $G.stripSectionNumbering($G.parseSectionText(a[i].innerHTML));
// should be set only once (as it is always the same), but let's leave it that way
secReplyText = $G.i18n['std prefix'];
//header.innerHTML = '['+secAbove.id+'@'+found+']→'+secAbove.text;
}
//
// strip section numering
if (secAbove.text.search(/^[0-9.]+ /) > -1)
{
var isNumbered = true;
if (secAbove.id.search(/^[0-9.]+_/) > -1)
{
if (secAbove.text.replace(/^([0-9. ]+) .*/, '$1').length == secAbove.id.replace(/^([0-9._]+)_.*/, '$1').length)
{
isNumbered = false;
}
}
if (isNumbered)
{
secAbove.text = secAbove.text.replace(/^[0-9.]+ (.*)/, '$1');
}
}
}
Linia 419 ⟶ 402:
html = html.replace(/[ \t]*$/,'').replace(/^[ \t]*/,'');
return html;
};
 
/**
@brief Strips section numbering if present.
 
@param sectionText Text oof the section.
@param sectionId Id of the section.
@returns Stripped text
*/
$G.stripSectionNumbering= function (sectionText, sectionId)
{
// strip section numering
if (secAbove.idsectionText.search(/^[0-9.]+_ /) > -1)
{
var isNumbered = true;
if (secAbove.textsectionId.search(/^[0-9.]+ _/) > -1)
//{
if (secAbove.textsectionText.replace(/^([0-9. ]+) .*/, '$1').length == secAbove.idsectionId.replace(/^([0-9._]+)_.*/, '$1').length)
{
isNumbered = false;
{}
}
if (isNumbered)
{
secAbove.textsectionText = secAbove.textsectionText.replace(/^[0-9.]+ (.*)/, '$1');
}
}
return sectionText;
};