MediaWiki talk:Common.js/Archive 2: Difference between revisions

Content deleted Content added
BetacommandBot (talk | contribs)
m subst'ing templates per WP:SUBST
pre
 
(2 intermediate revisions by 2 users not shown)
Line 84:
 
fr.wikipedia.org uses a nice hack in [http://fr.wikipedia.org/wiki/MediaWiki:Monobook.js its monobook.js] to add a toolbar button which opens a little popup window to ask for table dimensions, and to insert the table as wikitext into the edit box. Try it out by [http://fr.wikipedia.org/w/index.php?title=Alamans&action=edit editing a page] and clicking the table button (first from the left). Should we copy this idea?--[[User:Eloquence|Eloquence]][[User:Eloquence/CP|*]] 14:14, 25 August 2006 (UTC)
:Well, if there is no objections to this, we should try it out. I do not see any harm in doing this as well. --<fontspan style="background:gold">[[Wikipedia:Esperanza|<fontspan colorstyle="color:green">S</fontspan>]][[User:Siva1979|iva1979]]</fontspan><sup><fontspan style="background:yellow">[[User talk:Siva1979|Talk to me]]</fontspan></sup> 05:25, 26 August 2006 (UTC)
::Actually much of the stuff here[http://en.wikipedia.org/w/index.php?title=User:MarkS/extraeditbuttons.js] would be very useful for basic editing too.'''[[User talk:Voice of All|<fontspan colorstyle="color:blue">Voice</fontspan><fontspan colorstyle="color:darkblue">-of-</fontspan><fontspan colorstyle="color:black">All</fontspan>]]''' 10:12, 26 August 2006 (UTC)
:::I've implemented all of these.'''[[User talk:Voice of All|<fontspan colorstyle="color:blue">Voice</fontspan><fontspan colorstyle="color:darkblue">-of-</fontspan><fontspan colorstyle="color:black">All</fontspan>]]''' 19:13, 24 September 2006 (UTC)
 
== Reference navbar ==
 
See [http://en.wikipedia.org/wiki/User:Voice_of_All/UsefulJS#Google_searching.2Fcommon_spelling_corrections.2Freference_scrollbars.2Fabreviate_.28Requires_Addtab.29]. Within these scripts there is also a simple script ("Reference divs") that makes the auto-generated references appear with a scrollbar so that they won't take up so much room. I'd like to add this here.'''[[User talk:Voice of All|<fontspan colorstyle="color:blue">Voice</fontspan><fontspan colorstyle="color:darkblue">-of-</fontspan><fontspan colorstyle="color:black">All</fontspan>]]''' 10:05, 26 August 2006 (UTC)
 
== Default hide/show for NavFrame ==
 
(following up from [http://en.wikipedia.org/w/index.php?title=Wikipedia:Village%20pump%20%28technical%29&oldid=75982250#Template:Hidden_-_Auto_Show.2FHide Wikipedia:Village pump (technical)/Archive 132#Template:Hidden - Auto Show/Hide])
 
:I coded up a replacement for the <code>createNavigationBarToggleButton</code> function at [[MediaWiki:Monobook.js]] which allows one to specify if the box should be open or closed by default. It can be found at [{{fullurl:User:CesarB/monobook.js|oldid=73420426}}] if you want to check the code. Once it's added to Monobook.js (replacing the function already there), using <code>NavFrameDefaultHide</code> instead of <code>NavFrame</code> will force the box to be hidden by default, and using <code>NavFrameDefaultShow</code> instead of <code>NavFrame</code> will force the box to be shown by default. I intend to add the code to Monobook.js in a few days if nobody complains. --[[User:CesarB|cesarb]] 16:59, 2 September 2006 (UTC)
Line 167:
}
</pre>
**Off course every one can include it in their own script, but it's more tedious, also most people are using code like the one gimmetrow showed, and that's non optimal in at least two ways. First it will need to be reparsed when written, it is much faster to include it directly in the DOM-tree, second, when using document.writeln, the output will be written to the end of the document, generating a non-compatible page (application/xhtml-xml will bail out on such code generally). <sub>→<fontspan style="color:#975612">[[User:AzaToth|A]][[Wikipedia:Esperanza|<fontspan colorstyle="color:green">z</fontspan>]][[User:AzaToth|a]]</fontspan><fontspan style="color:#325596">[[User_talk:AzaToth|Toth]]</fontspan></sub> 23:55, 21 September 2006 (UTC)
== New buttons in edit toolbar ==
 
Please revert the addition of a ton of extra buttons, if a user wants them they can add them themself but that is truely overkill, i also see no visible consensus asking users if they would like them. <small><font facestyle="font-family:Tahoma">'''thanks'''/[[User:MatthewFenton|Fenton, Matthew]] [[User talk:MatthewFenton|Lexic Dark]] [[Special:Contributions/MatthewFenton|52278 Alpha 771]]</font></small> 19:17, 24 September 2006 (UTC)
:This was brought up here a month ago, without objection. For such a visually minor change, I don't see the problem with adding some small buttons to the toolbar (and it is not bleeding over or anything). The ''vast'' majority of people who edit this site do not even know how to just "add them" or that they need an account, and they don't know javascript either. Some of these buttons are badly needed (ie table, which fr. has). Though perhaps a few could be shaved off just for the sake of simplicity.'''[[User talk:Voice of All|<fontspan colorstyle="color:blue">Voice</fontspan><fontspan colorstyle="color:darkblue">-of-</fontspan><fontspan colorstyle="color:black">All</fontspan>]]''' 19:28, 24 September 2006 (UTC)
::[[User:Digital_me|Digital_me]] plans to write a bit of disabling javascript, but I agree with perhaps cutting them down. It is a little mad, and the WYSIWYG will be here reasonably soon. &mdash;[[User:Xyrael|Xyrael]] / 19:30, 24 September 2006 (UTC)
::Well, I don't think most people would know that there was discussion here. I think that this is a pretty major change, and the discussion should be more publicized. I, for one, oppose them, as they are more unnessecary clutter to the already mostly unused edit toolbar.--<b><span style="font-family:Trebuchet MS;">[[User:Digitalme|digital_m]][[User:Digitalme/EA|<span style="color:green;">e</span>]]<sup>([[User_talk:Digitalme|Talk]]•[[Special:Contributions/Digitalme|Contribs]])</sup></span></b> 19:31, 24 September 2006 (UTC)
::I just trimmed down the options. That should make it better for low-res now.'''[[User talk:Voice of All|<fontspan colorstyle="color:blue">Voice</fontspan><fontspan colorstyle="color:darkblue">-of-</fontspan><fontspan colorstyle="color:black">All</fontspan>]]''' 19:36, 24 September 2006 (UTC)
:::To disable the new buttons just add the following to your [[Special:Mypage/monobook.js|monobook.js]], save, and do a hard refresh (ctrl-F5).
:::<pre>mwCustomEditButtons = false;</pre>
:::--<b><span style="font-family:Trebuchet MS;">[[User:Digitalme|digital_m]][[User:Digitalme/EA|<span style="color:green;">e</span>]]<sup>([[User_talk:Digitalme|Talk]]•[[Special:Contributions/Digitalme|Contribs]])</sup></span></b> 19:40, 24 September 2006 (UTC)
:::The table button isn't such a bad idea. But the table code produced by the form popping up needs to be improved. I wouln't want to have newbies entering such ugly defaults for tables. Hey and the template call button wasn't that bad. Too bad it has already been removed again. --[[User:Ligulem|Ligulem]] 19:42, 24 September 2006 (UTC)
::::I suppose we need to keep these for more bread-and-butter kind of tedious tasks, so that had to go.'''[[User talk:Voice of All|<fontspan colorstyle="color:blue">Voice</fontspan><fontspan colorstyle="color:darkblue">-of-</fontspan><fontspan colorstyle="color:black">All</fontspan>]]''' 19:50, 24 September 2006 (UTC)
:::: Theres a transclusion button underneath the edit box ;-) <small><font facestyle="font-family:Tahoma">'''thanks'''/[[User:MatthewFenton|Fenton, Matthew]] [[User talk:MatthewFenton|Lexic Dark]] [[Special:Contributions/MatthewFenton|52278 Alpha 771]]</font></small> 19:45, 24 September 2006 (UTC)
:::::Argh. I forgot my [http://en.wikipedia.org/wiki/User:Ligulem/monobook.css]. Thanks :) --[[User:Ligulem|Ligulem]] 19:49, 24 September 2006 (UTC)
:::::The template button on the top of the edit window is better than the "Wiki-markup" section below the edit window. --[[User:Ligulem|Ligulem]] 19:56, 24 September 2006 (UTC)
Line 186:
:::::::Agree with that. But could be dangerous. I fear hordes of angry Wikipedians piling at VPT :). Removing things is always delicate... --[[User:Ligulem|Ligulem]] 20:07, 24 September 2006 (UTC)
::: Many of the buttons are redundant with the wiki markup section, and do we really need a javascript button just to add a ':' ? [[User_talk:Gimmetrow|''Gimmetrow'']] 19:46, 24 September 2006 (UTC)
::::The ":" thing is now removed.'''[[User talk:Voice of All|<fontspan colorstyle="color:blue">Voice</fontspan><fontspan colorstyle="color:darkblue">-of-</fontspan><fontspan colorstyle="color:black">All</fontspan>]]''' 19:50, 24 September 2006 (UTC)
::::: I'd say it's useful for new editors. On the other hand coloured text (already removed), left-aligned and centered text are not. —''[[User:R._Koot|Ruud]]'' 20:00, 24 September 2006 (UTC)
:::::: The : tab is rarely useful to a new editor in article space. By the time an editor runs across a need, they will have seen it on talk pages. [[User_talk:Gimmetrow|''Gimmetrow'']] 20:03, 24 September 2006 (UTC)
Line 195:
 
*hem* The new JS-code looks a bit bad (I thought VoA knows JS). Look some comments from me [[http://en.wikipedia.org/wiki/User_talk:MarkS#Support#here]] (and my corresponding optimized code [[:de:User:Olliminatore/customToolbar.js|here]], you can also look at the talkpage). I've completly replaced the <code>function marque_tab()</code> for the table button (after all buttons be added) p.s. I've not read any discussion to this relation before, so you can hint me. --[[User:Olliminatore|Olliminatore]] 12:49, 28 September 2006 (UTC)
:I mainly copied these from MarkS and they seemed to be fine. If anything can be optimized, then I'd <nowiki>{{sofixit}}</nowiki>.'''[[User talk:Voice of All|<fontspan colorstyle="color:blue">Voice</fontspan><fontspan colorstyle="color:darkblue">-of-</fontspan><fontspan colorstyle="color:black">All</fontspan>]]''' 15:23, 1 October 2006 (UTC)
:: I can't do that but you can look [[User_talk:MarkS/extraeditbuttons.js|my code]] . Other matter: I think the <tt>{{mono|'''center, left'''</tt>}} text align should not be used in normal articles, so remove them from standard of all (maybe <tt>{{mono|<nowiki><br /></nowiki></tt>}} too). --[[User:Olliminatore|Olliminatore]] 10:18, 3 October 2006 (UTC)
 
== Table button ==
Line 224:
::''Cross post'': Hmm, odd. It was still showing up on my toolbar. After my edit I did a hard refresh and it went away - so unless my cache was two days old (possible) - your commenting might not have been enough. Anyway, no harm done. <span style="font-family: Verdana;">[[User:ed_g2s|ed g2s]] &bull; [[User talk:ed_g2s|talk]]</span> 14:04, 29 September 2006 (UTC)
:::''Cross post'': :Yes, you '''did''' have had an outdated cache, as the button already went away thanks to my edit. I'm going to revert your edit, if you don't mind. We either disable that code on the top-most level (as I did it with my edit), or we remove that stuff completely. Keeping some brain dead code there serves not much purpose. --[[User:Ligulem|Ligulem]] 14:08, 29 September 2006 (UTC)
::First a simple IE detector need to be added. If a user is using IE, then the button should be disabled. As for table appearance, anyone is welcome to fix it with something that looks prettier.'''[[User talk:Voice of All|<fontspan colorstyle="color:blue">Voice</fontspan><fontspan colorstyle="color:darkblue">-of-</fontspan><fontspan colorstyle="color:black">All</fontspan>]]''' 20:01, 30 September 2006 (UTC)
::: My mentioned version has that feature, for IE (Opera too) the button makes only table sample syntax (from MarkS). (p.s. I don't tested IE for window open, because this function also don't works with my expanded function method) --[[User:Olliminatore|Olliminatore]] 20:26, 30 September 2006 (UTC)
::::Ok I simplified the code, and it does not seem to crash IE either. The talble now uses the pretty and simple wikiclasses.'''[[User talk:Voice of All|<fontspan colorstyle="color:blue">Voice</fontspan><fontspan colorstyle="color:darkblue">-of-</fontspan><fontspan colorstyle="color:black">All</fontspan>]]''' 20:33, 30 September 2006 (UTC)
::::: You forgot to remove <nowiki>''' ''' from TABLE CAPTION and |----- to |-</nowiki> --[[User:Olliminatore|Olliminatore]] 10:37, 1 October 2006 (UTC)
::::: It crashed my version of IE (IE 6) about 5 minutes ago. Someone who know how should ''definitely'' disable the button in IE until the problem is fixed. (It doesn't always crash IE, just sometimes; it's worked for me before, so testing it once in IE isn't enough to indicate the end of the problem.) [[User:147.188.147.47|147.188.147.47]]
Line 237:
== Archive ==
 
Just a note to all. I have archived some of the contents of this page. If anyone has any objects over this, please feel free to state your concerns. --<fontspan style="background:gold">[[Wikipedia:Esperanza|<fontspan colorstyle="color:green">S</fontspan>]][[User:Siva1979|iva1979]]</fontspan><sup><fontspan style="background:yellow">[[User talk:Siva1979|Talk to me]]</fontspan></sup> 04:38, 25 September 2006 (UTC)
 
== Page not found ==
Line 266:
 
==Toolbar extras==
The extra buttons in the toolbar, though useful, are causing serious lag in the edit page load time. I first tried adding these extra buttons (stolen from the Hebrew Wikipedia) several months back, and noticed the problem then, as did others. The problem still exists. Currently, for me at least, the toolbar takes 5+ seconds to load. &mdash; <small>[[User:Brian0918|<b><fontspan colorstyle="color:black">BRIAN</fontspan></b>]][[User_talk:Brian0918|<fontspan colorstyle="color:gray">0918</fontspan>]] &bull; 2006-10-11 02:25Z</small>
:I've never had them take 5 seconds, odd.'''[[User talk:Voice of All|<fontspan colorstyle="color:blue">Voice</fontspan><fontspan colorstyle="color:darkblue">-of-</fontspan><fontspan colorstyle="color:black">All</fontspan>]]''' 04:50, 11 October 2006 (UTC)
::Me neither. IIRC I noticed a very minor lag the first time they had to load (but far below 5 seconds). Since then, they are in the cache of my Firefox 1.5.0.7 (Windows XP) and everything loads immediately (I still have them right now even though they have been removed already by Brian0918, because I didn't force a cache update yet). --[[User:Ligulem|Ligulem]] 08:42, 11 October 2006 (UTC)
:::These should ''really'' be added back. The toolbar can be disabled via prefrences. Many other wikipedias, like RU and FR, already have such buttons. I don't see a need to remove a few very useful sitewide buttons due to one user having them take too long to load.'''[[User talk:Voice of All|<fontspan colorstyle="color:blue">Voice</fontspan><fontspan colorstyle="color:darkblue">-of-</fontspan><fontspan colorstyle="color:black">All</fontspan>]]''' 16:21, 15 October 2006 (UTC)
:::: Does the loading of the toolbar prevent editing? If not I don't see a problem with it loading so slowly. Even the standard toolbar can take 2 or 3 seconds to load when I'm running BitTorrent in the background. —''[[User:R._Koot|Ruud]]'' 16:35, 15 October 2006 (UTC)
:::::No, it just loads in the background. Actually, the bar loads near instantly, its the images that take a while sometimes, but it does not hang the page or anything, they just appear one by one.'''[[User talk:Voice of All|<fontspan colorstyle="color:blue">Voice</fontspan><fontspan colorstyle="color:darkblue">-of-</fontspan><fontspan colorstyle="color:black">All</fontspan>]]''' 16:39, 15 October 2006 (UTC)
:::Please restore the extra buttons. They were very helpful. I experienced no delay in the edit box opening, and did not notice any delay in the button graphics being rendered (but a 5-second delay in that, if there was one, would not delay my editing). [[User:Finell|Finell]] [[User_talk:Finell|(Talk)]] 07:22, 16 October 2006 (UTC)
::::I agree: Bring back the buttons! They are very useful, and the only delay present is caused by loading the images. [[User:Albany NY|Albany NY]] 13:22, 16 October 2006 (UTC)
Line 277:
 
There is a strong concensus, in this and another item on this Talk page, for restoring the additional edit toolbar buttons. Will it be done? [[User:Finell|Finell]] [[User_talk:Finell|(Talk)]] 20:57, 26 October 2006 (UTC)
:I'd like for someone to add them back soon.'''[[User talk:Voice of All|<fontspan colorstyle="color:blue">Voice</fontspan><fontspan colorstyle="color:darkblue">-of-</fontspan><fontspan colorstyle="color:black">All</fontspan>]]''' 22:45, 1 November 2006 (UTC)
 
Not a fan. Makes finding the few useful buttons (sig and redirect) harder. But I appear to be in the minority, so how can I remove these from my monobook? Should the "mwCustomEditButtons = false;" thing still work? --[[User:Spangineer|Spangineer]]<sup>[[:wikisource:User:Spangineer|ws]]</sup>&nbsp;[[User talk:Spangineer|<small><font colorstyle="color:brown">[[User talk:Spangineer|(háblame)]]</font></small>]] 22:35, 4 November 2006 (UTC)
 
: Seems to work, except that it doesn't remove the "make table" button. —''[[User:R._Koot|Ruud]]'' 23:22, 5 November 2006 (UTC)
Line 349:
:: I added this to the common.js now. Now everyone should see that pages like [[mod_perl]], [[:Category:x86 microprocessors]], and [[User:rambot]] show up with lowercase and underscores as needed (turn off javascript in your browser to see how they were displayed before). Pages like [[Softimage XSI]] shouldn't have their main title changed, but should have the title at the very top of the browser (or in the tab) changed. --[[User:Interiot|Interiot]] 04:18, 24 November 2006 (UTC)
Do you know how much confusion this has caused? And I'm only talking about myself here; think about all the other people that may have been racking their brains out over this. This thing shouldn't be here without more discussion first; if capital letters aren't technically possible for whatever reason, we shouldn't be making adjustments to make article titles look correct. Did nobody think that four people don't speak for everybody that has an account on Wikipedia? I don't want this; I want to see the {{tl|lowercase}} tags in articles as they should appear. Either revert this change and start a new discussion where more people are likely to comment, or give me a way to make article titles look the way I want them to look. <sub>[[User:J Di|JD]]</sub><sup>[[User talk:J Di|talk]]</sup> 20:38, 29 November 2006 (UTC)
: You can disable this now by adding {{mono|1=<ttspan style="background-color:#cfc">disableRealTitle = 1;</ttspan>}} to your monobook.js. The idea behind hiding {{tl|lowercase}} is that the only reason they're included on articles is because the title displays incorrectly. Once the title displays correctly, the reader doesn't need to be bothered about the internal limitation on that page anymore... is that incorrect? (just to clarify: it still appears on articles that don't have a pasteable title, for instance [[Special:Whatlinkshere/Template:Pipe_in_title|<nowiki>{{pipe in title}}</nowiki>]]) As [[Wikipedia talk:Naming conventions (technical restrictions)#Summary of lower case first letter issue|this discussion]] notes, multiple wikis have taken up this feature before en.wikipedia.org did, and there were a group of people who wanted English Wikipedia to have it earlier. The feature was discussed in numerous places... [http://en.wikipedia.org/w/index.php?title=Wikipedia:Village_pump_%28technical%29&oldid=89177667#Name_technical_restrictions_workaround] [http://en.wikipedia.org/wiki/Template_talk:Lowercase#Redrafting_title_with_a_JavaScript_trick] [http://en.wikipedia.org/wiki/Template_talk:Lowercase-user] but I'd be happy to discuss it [[WP:VPT]] or elsewhere again if you'd like.
: If it's an issue about making sure people are informed, we could update [[:Category:Wrong title templates|the relevant templates]] and/or their talk pages to note the details of how/where this works. --[[User:Interiot|Interiot]] 23:53, 29 November 2006 (UTC)
 
Line 440:
|}
 
'''''[[User:Harryboyles|<fonti colorstyle="color:darkblue">[[User:Harryboyles|Harryboyles]]</fonti>'']]''' 11:13, 5 December 2006 (UTC)
 
: It doesn't happen if you're editing but not previewing the article. But anyway...
: What's the best thing to trigger off of, for the script to know it's in editing mode? Is <tt>{{mono|wgIsArticle</tt>}} appropriate? --[[User:Interiot|Interiot]] 11:17, 5 December 2006 (UTC)
::I suggest checking if document.___location contains <tt>{{mono|/wiki/</tt>}} or <tt>{{mono|/w/</tt>}} at the beginning of the path.
if (document.___location.indexOf(wgServer + wgScriptPath + "/") == 0) { // editing mode
...
Line 450:
...
}
::Monobook emits <tt>{{mono|wgServer</tt>}} and <tt>{{mono|wgScriptPath</tt>}} as global javascript variables; I'm not sure if other skins do the same. It might be better to just hard-wire it to <tt>{{mono|http:</tt><tt>}}{{mono|//en.wikipedia.org/w/</tt>}} in that case. --[[User:DavidHOzAu|DavidH]][[User talk:DavidHOzAu|Oz]][[Special:Contributions/User:DavidHOzAu|Au]] 03:35, 10 December 2006 (UTC)
 
:::That catches a lot more than editing (e.g., history, and even articles themselves if a URL like http://en.wikipedia.org/w/index.php?title=EBay is used). For history and diff pages, wgIsArticle is also set to false. If you want to catch only edit pages, perhaps check for "action=edit" and "action=submit" (the latter for previews) in the URL? -- [[User:Jitse Niesen|Jitse Niesen]] ([[User talk:Jitse Niesen|talk]]) 04:55, 10 December 2006 (UTC)
Line 475:
// rest of code here
::::Or something. --[[User:DavidHOzAu|DavidH]][[User talk:DavidHOzAu|Oz]][[Special:Contributions/User:DavidHOzAu|Au]] 01:23, 11 December 2006 (UTC)
:::::Right, it would be good to keep the code as simple as possible. Yes, <tt>{{mono|wgIsArticle</tt>}}'s value does vary a bit in history/diff/move/protect/delete, but it doesn't matter what its value is under those situations, because true or false, we can't display the RealTitle in those cases anyway. <tt>{{mono|wgIsArticle</tt>}}'s value really only matters when <tt>{{mono|RealTitleBanner</tt>}} is rendered on screen, which is: 1) when viewing an article, and 2) when editing an article, and its value is good in both cases. So <tt>{{mono|wgIsArticle</tt>}} should work fine, I think. --[[User:Interiot|Interiot]] 01:50, 11 December 2006 (UTC)
 
== NavFrame styles limitation ==
Line 671:
#re+cache+onefunc9 x 10000: 150 ms
<table border="1">
<tr><td> Opera 9</td><th>Rate</tdth><th>re+cache</tdth><th>re+cache+onefunc4</tdth><th>re+literal</tdth><th>split</tdth><th>re+cache+onefunc9</th></tr>
<tr><td>re+cache</td><td>38462/s</td><td>--</td><td>-8.3%</td><td>-12.6%</td><td>-36.8%</td><td>-73.3%</td></tr>
<tr style="background-color:#eef"><td>re+cache+onefunc4</td><td>41667/s</td><td>+7.7%</td><td>--</td><td>-3.9%</td><td>-26.3%</td><td>-60%</td></tr>
Line 1,073:
 
Here is a prototype:
<pre>
/** Click on Image ***********************************************************
*
Line 1,103 ⟶ 1,104:
}
});
</pre>
so you would type <code><nowiki><div class="click" title="title to be set after javascript parses URL=http://example.com">[[Image:Myimage]]</div></nowiki></code>
Which would then set the href (url) of the link which contains the image to http://example.com, and link's title to "title to be set after javascript parses".