Обсуждение MediaWiki:Gadget-markblocked.js: различия между версиями

Материал из Википедии — свободной энциклопедии
Перейти к навигации Перейти к поиску
Содержимое удалено Содержимое добавлено
→‎mw.util.$content: :::{{re|TheDJ}} What are those dependencies, and how can we simulate loading as a true gadget from another project? ~~~~
Строка 85: Строка 85:
::Correct on the first part, less sure about the conclusion you make. Again, i'm not entirely sure what that block is trying to achieve (why does it have to listen for content to begin with ?), making it harder to give the right advise. It also would be wise to wrap that mw.util.addPortletlink with mw.loader.using( 'mediawiki.util'). Several people seem to make use of this gadget by direct loading of this file, instead of using it as a gadget, so they don't receive the dependencies that are delivered when you use this as a true Gadget. [[У:TheDJ|TheDJ]] ([[ОУ:TheDJ|обс.]]) 10:07, 12 июля 2017 (UTC)
::Correct on the first part, less sure about the conclusion you make. Again, i'm not entirely sure what that block is trying to achieve (why does it have to listen for content to begin with ?), making it harder to give the right advise. It also would be wise to wrap that mw.util.addPortletlink with mw.loader.using( 'mediawiki.util'). Several people seem to make use of this gadget by direct loading of this file, instead of using it as a gadget, so they don't receive the dependencies that are delivered when you use this as a true Gadget. [[У:TheDJ|TheDJ]] ([[ОУ:TheDJ|обс.]]) 10:07, 12 июля 2017 (UTC)
:::{{re|TheDJ}} What are those dependencies, and how can we simulate loading as a true gadget from another project? &nbsp; — <font size="4">[[User:Jeff G.|Jeff]] [[User:Jeff G./talk|G. ツ]]</font> 02:47, 11 апреля 2018 (UTC)
:::{{re|TheDJ}} What are those dependencies, and how can we simulate loading as a true gadget from another project? &nbsp; — <font size="4">[[User:Jeff G.|Jeff]] [[User:Jeff G./talk|G. ツ]]</font> 02:47, 11 апреля 2018 (UTC)
::::{{re|Jeff G.}} You simulate by having the same gadget definition. See [[en:MediaWiki:Gadgets-definition]]. If you don't include that same information for your own gadget, you often get unexpected behaviour. [[У:TheDJ|TheDJ]] ([[ОУ:TheDJ|обс.]]) 07:49, 11 апреля 2018 (UTC)


== Globally locked and blocked users ==
== Globally locked and blocked users ==

Версия от 07:49, 11 апреля 2018

See also: Bug 22705.

Перевод сообщения на япоский

Доброе утро! Меня зовут Was_a_bee. Я сделал переводе на японский язык. Как насчет добавить? --Was a bee 23:47, 16 августа 2010 (UTC)[ответить]

'ja': ' $2 により $1 までの期限でブロック: $3', // ja:User:Was_a_bee

— Эта реплика добавлена участником Was a bee (ов)

Большое спасибо дополнение! --Was a bee 00:17, 17 августа 2010 (UTC)[ответить]

{{Editprotected}}

Здравствуйте. Извините. Я хочу спросить повторно исправить всплывающей подсказке перевода. Я обнаружил, что прошлой версии иногда странным синтаксисом.
'ja': '($2によるブロック。期限:$1 理由:$3)',
--Was a bee 14:47, 5 ноября 2010 (UTC)[ответить]
✔ Сделано --Obersachse 22:52, 27 ноября 2010 (UTC)[ответить]
Большое спасибо. --Was a bee 10:05, 9 декабря 2010 (UTC)[ответить]

Korean translation

{{editprotected}}

Please add Korean translation.

'ko': '(차단: $2, 기한: $1, 이유: $3)',

-- ChongDae 12:58, 17 февраля 2011 (UTC)[ответить]

German translation

{{editprotected}}

Please add German translation.

'de': '(von $2 für die Zeitdauer $1 gesperrt: $3)',

Thanks! --Church of emacs 17:21, 6 июня 2011 (UTC)[ответить]

Script not working in MW 1.18

Hey. Sorry for writing in English; I don't know Russian. Since 1.18 rolled out, it seems this script is broken. The notes about the release ( http://svn.wikimedia.org/svnroot/mediawiki/branches/REL1_18/phase3/RELEASE-NOTES-1.18 ) mention a change to wgServer. It seems that wgServer no longer starts with http://, but rather just //. As such, the return on line 45 - if (link.href.replace(wgServer, ).match(/^http:/)) return - is always returning now. If you comment this out the script works better, though it still does not function properly. Anyway, I thought I'd bring this up. Please contact me at en:User:HelloAnnyong about this. Thanks. HelloAnnyong 02:15, 29 сентября 2011 (UTC)[ответить]

Following this latest edit it seems to be working again. Thank you (also for rewriting it!) HelloAnnyong 23:39, 29 сентября 2011 (UTC)[ответить]
Is there any way to get a working copy of this for MW 1.15.5 ? Werieth 00:01, 26 августа 2012 (UTC)[ответить]

Errors in webconsole - jQuery deprecation

Hi, I'm getting a lot of deprecation errors in webconsole:

"Use of "wgAction" is deprecated. Use mw.config instead."
"Use of "wgArticlePath" is deprecated. Use mw.config instead."
"Use of "wgScript" is deprecated. Use mw.config instead."
"Use of "wgNamespaceIds" is deprecated. Use mw.config instead."

That last one dozens of times.

I think that mw:Manual:Interface/JavaScript#mw.config explains what needs to be fixed, but I'm not sure.

(I asked in IRC, and a dev says that these things can mostly all be fixed by replacing, e.g.

wgTitle => mw.config.get( 'wgTitle' )

Hope that helps. Quiddity 21:11, 8 января 2015 (UTC)[ответить]

вектор

Я была проблема на en.wp с замерзает браузера и кипятят его до этого сценария.Единственное, что я могу думать о вся документация, я видел, говорит, что это для MonoBook. Я использую его на некоторое время, но только пару месяцев назад я начал получать браузера замораживания и сообщения об ошибках, Снимок экрана сообщения об ошибке надеюсь, кто-то может помочь. Я не знаю, русский язык, используемый Google Translate, жаль, если это перепутались. Мой дом страница обсуждения здесь Спасибо, Mlpearc 05:43, 26 марта 2015 (UTC)[ответить]

Not working?

Appears to not be working, or is that just on my end? Cirt 12:25, 14 октября 2015 (UTC)[ответить]

mw.util.$content

С mw.util.$content есть вот такая дурость: на некоторых страницах это на самом деле не <div id="content">, а нечто другое. Например, Special:CX. И тогда этот гаджет не работает, и портит всю страницу.

Предлагаю добавить в начале функции что-нибудь такое:

if ( !mw.util.$content.is( '#content' ) ) {
    return;
}

Благодарю! --Amir E. Aharoni 06:46, 12 апреля 2016 (UTC)[ответить]

@Amire80: Можно посмотреть пример такой страницы? — putnik 08:27, 12 апреля 2016 (UTC)[ответить]
Как я написал, Special:CX. --Amir E. Aharoni 08:27, 12 апреля 2016 (UTC)[ответить]
@Amire80: Готово. Только пришлось проверять на .mw-body, потому что в Modern'е не #content. — putnik 10:30, 12 апреля 2016 (UTC)[ответить]
Спасибо! --Amir E. Aharoni 10:31, 12 апреля 2016 (UTC)[ответить]

ping User:Amire80. can we prefix usage of mw.util.$content, with a check that the variable actually exists ? It's a lazy loaded variable, so sometimes, it has not been filled yet, upon document.ready (depending on execution order). It would be even better if we can find a replacement for it. I'm not sure I understand what it is for, so ... TheDJ (обс.) 22:06, 11 июля 2017 (UTC)[ответить]

@TheDJ: Do I get it right that given the code in mediawiki.util.js and page/startup.js, the success of $content usage in this gadget is determined by the fact whether mediawiki.util.js (where $content is initialized inside $()) is executed earlier than page/startup.js (where wikipage.content hook is fired inside $())? This way mw.hook( 'wikipage.content' ).add() code in this gadget, which $content usage is wrapped in, could run with $content initialized, as far as I can see. If this is correct, I guess we could change mw.hook( 'wikipage.content' ).add() to just $() to ensure $content is always initialized before the run. — Джек, который построил дом (обс.) 00:55, 12 июля 2017 (UTC)[ответить]
Correct on the first part, less sure about the conclusion you make. Again, i'm not entirely sure what that block is trying to achieve (why does it have to listen for content to begin with ?), making it harder to give the right advise. It also would be wise to wrap that mw.util.addPortletlink with mw.loader.using( 'mediawiki.util'). Several people seem to make use of this gadget by direct loading of this file, instead of using it as a gadget, so they don't receive the dependencies that are delivered when you use this as a true Gadget. TheDJ (обс.) 10:07, 12 июля 2017 (UTC)[ответить]
@TheDJ: What are those dependencies, and how can we simulate loading as a true gadget from another project?   — Jeff G. ツ 02:47, 11 апреля 2018 (UTC)[ответить]
@Jeff G.: You simulate by having the same gadget definition. See en:MediaWiki:Gadgets-definition. If you don't include that same information for your own gadget, you often get unexpected behaviour. TheDJ (обс.) 07:49, 11 апреля 2018 (UTC)[ответить]

Globally locked and blocked users

Hi. Can this script be made to show globally locked and blocked users, as well as locally blocked users?   — Jeff G. ツ 02:44, 11 апреля 2018 (UTC)[ответить]