MediaWiki talk:Base.js

From Wikisource
Jump to navigation Jump to search

Error[edit]

There is an error at 142nd line (function OptionText) on Russian subdomain (e.g. in ru:s:Мы топчем головки цветов полевых (Гейне/Чюмина)/ДО):

OptionStyle = SpanElem.firstChild.getAttribute('style');

The message is:

Сведения об ошибке на веб-странице

Агент пользователя: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; InfoPath.1)
штамп времени: Wed, 6 Oct 2010 10:11:01 UTC


Сообщение: Объект не поддерживает это свойство или метод (English: The object does not support this property or method)
Строка: 142
Символ: 11
Код: 0
URI-код: http://wikisource.org/w/index.php?title=MediaWiki:Base.js&action=raw&ctype=text/javascript

I have a IE 8.7600.16385 on Windows 7.

In my humble opinion SpanElem.firstChild returns null. What's wrong? What's purpose of OptionText() function? -- Sergey kudryavtsev 10:27, 6 October 2010 (UTC)[reply]

yes, there seems to be a problem with the template that you are using to display the page number (Страница). did you modify it recently ? I suppose there should be one more level of nesting. ThomasV 18:17, 6 October 2010 (UTC)[reply]
No — last edit is in April 1. But s:ru:Шаблон:Страница is used rare and it's possible that we are take no notice on this error in past... I can add one more level of nesting, but tell me first — what's purpose of OptionText() function? To show / hide page numbers marks? -- Sergey kudryavtsev 13:57, 7 October 2010 (UTC)[reply]
I removed class="OptionText" from s:ru:Шаблон:Страница (see diff) to fix this error, like in English subdomain (see s:en:Wikisource:Scriptorium/Archives/2009-12#Something weird happening). -- Sergey kudryavtsev 12:14, 8 October 2010 (UTC)[reply]

Error 2[edit]

There is an error at 208th line (function easy_lst) on Russian subdomain (e.g. in ru:s:Страница:Vremya 1861 09-10.pdf/358, while editing):

title = a[i*2+1];

The message is:

Сведения об ошибке на веб-странице

Агент пользователя: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; InfoPath.1)
штамп времени: Mon, 15 Nov 2010 09:33:11 UTC


Сообщение: Объект не поддерживает это свойство или метод
Строка: 208
Символ: 13
Код: 0
URI-код: http://wikisource.org/w/index.php?title=MediaWiki:Base.js&action=raw&ctype=text/javascript

I have a IE 8.7600.16385 on Windows 7.

In my humble opinion the local variables (search, a, s, ok, i, title, content and so forth) should be explicitly difined! -- Sergey kudryavtsev 09:45, 15 November 2010 (UTC)[reply]

done; please let me know if it works ThomasV 15:00, 16 November 2010 (UTC)[reply]
Thanks, now script works fine. -- Sergey kudryavtsev 21:56, 12 December 2010 (UTC)[reply]


There is an error again in same function easy_lst, 216th line (e.g. while editing of ru:s:Страница:Vremya 1861 09-10.pdf/358):

var m2 = content.match(r2);
Сведения об ошибке на веб-странице

Агент пользователя: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; InfoPath.1)
штамп времени: Thu, 23 Dec 2010 11:09:49 UTC


Сообщение: 'undefined' -  есть null или не является объектом
Строка: 216
Символ: 13
Код: 0
URI-код: http://wikisource.org/w/index.php?title=MediaWiki:Base.js&action=raw&ctype=text/javascript

The error message is translated as "undefined is null or isn't an object".

I have a IE 8.7600.16385 on Windows 7.

The "content" may be null, indeed? -- Sergey kudryavtsev 11:53, 23 December 2010 (UTC)[reply]

index_ns_prefixes for Vietnamese[edit]

Please add 'vi': 'Mục_lục', to index_ns_prefixes. Thanks. – Minh Nguyễn (talk, blog) 04:29, 4 December 2011 (UTC)[reply]

Done Candalua 13:49, 4 December 2011 (UTC)[reply]

be & be-tarask for be.wikisource.org[edit]

Please add the next rows:

'be':'Старонка',
'be-tarask':'Старонка', // both to page_ns_prefixes

'be':'Індэкс',
'be-tarask':'Індэкс', // both to index_ns_prefixes

Thank you very much! Wizardist (talk) 14:55, 7 July 2012 (UTC)[reply]

Done — Phe 20:22, 7 July 2012 (UTC)[reply]

Broken style[edit]

I am tagging interface administrators @Ankry, Koavf: Starting from line 37. I'm guessing recent changes in MediaWiki software or Vector, causes some style breaking changes that need to be fixed. Iff the user is using Vector, that element (line 37 onwards) needs to be a $nav, and also needs the classes vector-menu and vector-menu-portal. Thanks in advance, --Ignacio Rodríguez (talk) 02:14, 29 August 2020 (UTC)[reply]

@Ignacio Rodríguez: Row 37 is var displayOptions = document.createElement("div");. What needs to be changed? —Justin (koavf)TCM 02:16, 29 August 2020 (UTC)[reply]
@Koavf: Excuse me, I didn't get the notification! That element should be a "nav" instead of a div but only if skin is vector.. Also, at line 39 you should add "vector-menu vector-menu-portal" to the "portal collapsed" classes. I would replace lines 37 to 44 with:
if (mw.config.get('skin')==='vector') {
	var displayOptions = document.createElement("nav");
	displayOptions.className = "vector-menu vector-menu-portal portal collapsed";
	cl="body";
} else {
	var displayOptions = document.createElement("div");
	displayOptions.className = "portlet";
	cl="pBody";
}

.

I think that would do the trick. Regards, --Ignacio Rodríguez (talk) 03:47, 31 August 2020 (UTC)[reply]

@Ignacio Rodríguez: Gracias. I don't use the Vector skin: let me know how it looks. Also, it threw up an error but I don't think it actually matters in terms of functionality. —Justin (koavf)TCM 05:12, 31 August 2020 (UTC)[reply]
@Koavf: Now it's working fine. Thanks! --Ignacio Rodríguez (talk) 05:23, 31 August 2020 (UTC)[reply]
De na. Gracias a ti, amigo. —Justin (koavf)TCM 05:29, 31 August 2020 (UTC)[reply]