Template talk:Documentation/Archive 8: Difference between revisions

Content deleted Content added
m Archiving 1 discussion(s) from Template talk:Documentation) (bot
m Fixed Lint errors on this page (missing end tags)
 
(3 intermediate revisions by 2 users not shown)
Line 79:
 
[[Special:Contributions/90.222.250.124|90.222.250.124]] ([[User talk:90.222.250.124|talk]]) 10:40, 11 January 2013 (UTC)
:{{done}}. <big>[[User:-- -- --|<span style="color: #6633cc">'''--'''</span>]] [[User talk:-- -- --|<span style="color: #6633cc">'''--'''</span>]] [[Special:Contributions/-- -- --|<span style="color: #6633cc">'''--'''</span>]]</big> 04:38, 16 January 2013 (UTC)
 
{{Collapse top|title=List of interwiki links}}
Line 212:
 
Thank you. – '''[[User:PartTimeGnome|PartTimeGnome]]''' <span style="font-size:79%;">([[User talk:PartTimeGnome|talk]]&#160;&#124; [[Special:Contributions/PartTimeGnome|contribs]])</span> 20:42, 20 June 2013 (UTC)
:[[File:Pictogram voting question.svg|20px|link=|alt=]] '''Question:'''<!-- Template:EP --> I've just tried viewing some template doc pages when logged out - and they all look normal: there is [[:File:Template-info.png|an image]] and the heading "Template documentation" at the left, then a gap, then "[view] [edit] [history] [purge]" at right. The relevant styling is <sourcesyntaxhighlight lang=css>.mw-content-ltr .editsection, .mw-content-rtl .mw-content-ltr .editsection { float: right; margin-left: 5px; }</sourcesyntaxhighlight> Do you have any custom CSS that is moving the links? --[[User:Redrose64|<span style="color:#a80000; background:#ffeeee; text-decoration:inherit">Red</span>rose64]] ([[User talk:Redrose64|talk]]) 20:56, 20 June 2013 (UTC)
::The links are showing wrong (left of the heading) for me, too. Sandbox looks fine. Changing the class name to "mw-editsection" also allows to float the links right (default behavior before the MediaWiki change) instead of next to the heading with some custom CSS (also provided as Gadget here on enwiki). --[[User:Patrick87|Patrick87]] ([[User talk:Patrick87|talk]]) 21:26, 20 June 2013 (UTC)
:::{{done}} -- [[User:WOSlinker|WOSlinker]] ([[User talk:WOSlinker|talk]]) 21:31, 20 June 2013 (UTC)
Line 407:
:::::I don't think we should have a hack that only works for modules. If this is the desired behaviour, how about putting it into the module proper so that it will work this way for templates and other pages too? — '''''[[User:Mr. Stradivarius|<span style="color: #194D00; font-family: Palatino, Times, serif">Mr. Stradivarius</span>]]''''' <sup>[[User talk:Mr. Stradivarius|♪ talk ♪]]</sup> 01:31, 8 February 2014 (UTC)
::::::Yes, I think that would be desirable. [[User:Johnuniq|Johnuniq]] ([[User talk:Johnuniq|talk]]) 02:22, 8 February 2014 (UTC)
 
== Line 402 (protectionlevel) ==
{{Edit protected|ans=yes}}
In line 402 of Module:Documentation an lua protectionlevel function - mw.title.new("text").protectionLevels["action"], should be used instead of the parser function "protectionlevel". See also [[mw:Extension:Scribunto/Lua_reference_manual#Title_objects]], where the Lua function protectionLevels is documented.--[[User:Snaevar|Snaevar]] ([[User talk:Snaevar|talk]]) 16:56, 28 February 2014 (UTC)
* {{Ping|Mr. Stradivarius|Jackmcbarn|Anomie}} as I know you are all Lua geniuses and competent with protection level stuffs... — <span class="nowrap">&#123;&#123;U&#124;[[User:Technical 13|Technical 13]]&#125;&#125;</span> <sup>([[User talk:Technical 13|t]] • [[Special:EmailUser/Technical 13|e]] • [[Special:Contribs/Technical 13|c]])</sup> 01:19, 13 March 2014 (UTC)
::I'll take a look at it. — '''''[[User:Mr. Stradivarius|<span style="color: #194D00; font-family: Palatino, Times, serif">Mr. Stradivarius</span>]]''''' <sup>[[User talk:Mr. Stradivarius|♪ talk ♪]]</sup> 01:22, 13 March 2014 (UTC)
:::{{ping|Jackmcbarn}} I see that <code>title.protectionLevels</code> gives a table like this:
<syntaxhighlight lang="lua">
{
["edit"] = {
"sysop"
},
["move"] = {
"sysop"
}
}
</syntaxhighlight>
:::Why not just like this?
<syntaxhighlight lang="lua">
{
["edit"] = "sysop",
["move"] = "sysop"
}
</syntaxhighlight>
:::Can there be more than one protection level for each protection type? And am I always guaranteed to find the highest protection level by using <code>title.protectionLevels.edit[1]</code>? Enquiring minds need to know. :) — '''''[[User:Mr. Stradivarius|<span style="color: #194D00; font-family: Palatino, Times, serif">Mr. Stradivarius</span>]]''''' <sup>[[User talk:Mr. Stradivarius|♪ talk ♪]]</sup> 02:21, 13 March 2014 (UTC)
::::For now, yes, just use [1]. In the future, an update to MediaWiki could allow multiple protection levels on the same action. (Beware that if the page is unprotected, the return value may be {}, not always { edit = {} } as you might expect. [[User:Jackmcbarn|Jackmcbarn]] ([[User talk:Jackmcbarn|talk]]) 02:50, 13 March 2014 (UTC)
:::::Thanks, that helps a lot. I've now updated the module to use protectionLevels, so I guess we can consider this request answered. — '''''[[User:Mr. Stradivarius|<span style="color: #194D00; font-family: Palatino, Times, serif">Mr. Stradivarius</span>]]''''' <sup>[[User talk:Mr. Stradivarius|♪ talk ♪]]</sup> 04:08, 13 March 2014 (UTC)
 
== Lua error in Module:Documentation at line 409: attempt to index local 'protectionLevels' (a nil value). ==
 
I've exported a few modules and templates from MediaWiki and imported them into my own wiki and as soon as I open a template (e.g. Template:Documentation, Template:Divbox, Template:Ombox), I get the following script error:
 
<pre>
Lua error in Module:Documentation at line 409: attempt to index local 'protectionLevels' (a nil value).
 
Backtrace:
 
(tail call): ?
Module:Documentation:409: in function "protectionTemplate"
Module:Documentation:132: ?
(tail call): ?
mw.lua:553: ?
(tail call): ?
[C]: in function "xpcall"
MWServer.lua:73: in function "handleCall"
MWServer.lua:266: in function "dispatch"
MWServer.lua:33: in function "execute"
mw_main.lua:7: in main chunk
[C]: ?
</pre>
 
I searched for hours on Google to find a solution, but no luck. Any help would be highly appreciated. [[User:Tessus|Tessus]] ([[User talk:Tessus|talk]]) 23:07, 18 March 2014 (UTC)
:This module relies on features new to MediaWiki 1.23 and/or the latest git version of [[mw:Extension:Scribunto]]. [[User:Jackmcbarn|Jackmcbarn]] ([[User talk:Jackmcbarn|talk]]) 00:01, 19 March 2014 (UTC)
::I've fixed the module so that it won't produce a script error if protectionLevels is not present. However, if you don't have protectionLevels on your wiki you might want to use [https://en.wikipedia.org/w/index.php?title=Module:Documentation&oldid=598387866 this version] of the module which uses the <code><nowiki>{{PROTECTIONLEVEL}}</nowiki></code> parser function, as otherwise the protection icons in the top-hand-corner of the page won't work. — '''''[[User:Mr. Stradivarius|<span style="color: #194D00; font-family: Palatino, Times, serif">Mr. Stradivarius</span>]]''''' <sup>[[User talk:Mr. Stradivarius|♪ talk ♪]]</sup> 00:54, 19 March 2014 (UTC)
:::Thanks, but I have no idea what you are suggesting. I have installed MediaWiki 1.22.4, I have no clue why/how I should or should not have protectionLevels on my wiki. I'm not entirely sure what I shall do now. Shall I use the old version or your fixed version? [[User:Tessus|Tessus]] ([[User talk:Tessus|talk]]) 01:06, 19 March 2014 (UTC)
::::Either upgrade your Scribunto extension to the latest version available, or use the version of the module that Mr. Stradivarius showed you. [[User:Jackmcbarn|Jackmcbarn]] ([[User talk:Jackmcbarn|talk]]) 01:13, 19 March 2014 (UTC)
:::::I tried the latest version of Scibunto, but it didn't help. Then I tried the latest Module:Documentation and it seems to work. But I'm still missing all the images which the templates depend on. Also the background of the template documentation is green on wikipedia, white on my wiki. Well, it's not really an issue, just a difference. Do you know, if there is a way to grab all the necessary images from wikipedia (e.g. Imbox_notice.png) which are necessary for a template? [[User:Tessus|Tessus]] ([[User talk:Tessus|talk]]) 01:26, 19 March 2014 (UTC)
::::::Not sure about the images. For the green background, you also need to import [[MediaWiki:Common.css]]. — '''''[[User:Mr. Stradivarius|<span style="color: #194D00; font-family: Palatino, Times, serif">Mr. Stradivarius</span>]]''''' <sup>[[User talk:Mr. Stradivarius|♪ talk ♪]]</sup> 03:22, 19 March 2014 (UTC)
:::::::Yep, did that, or at least parts of it. I guess I was not thorough enough. Thx for all your help. [[User:Tessus|Tessus]] ([[User talk:Tessus|talk]]) 05:16, 19 March 2014 (UTC)
::::::::The important class from Common.css is the <code>template-documentation</code> class. It looks like you also need to import [[MediaWiki:Common.js/IEFixes.js]] to make the <code>iezoomfix</code> class work properly, but that only matters if you are interested in supporting Internet Explorer 8. — '''''[[User:Mr. Stradivarius|<span style="color: #194D00; font-family: Palatino, Times, serif">Mr. Stradivarius</span>]]''''' <sup>[[User talk:Mr. Stradivarius|♪ talk ♪]]</sup> 05:36, 19 March 2014 (UTC)
:::::::::Info for using images from Wikimedia Commons - [[mw:Manual:$wgUseInstantCommons]] and [[mw:InstantCommons]]--[[User:Lam-ang|Lam-ang]] ([[User talk:Lam-ang|talk]]) 06:03, 19 March 2014 (UTC)
::::::::::Thanks for all your help and info. [[User:Tessus|Tessus]] ([[User talk:Tessus|talk]]) 05:17, 20 March 2014 (UTC)