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

Content deleted Content added
Shadowbot3 (talk | contribs)
m Automated archival of 2 sections from MediaWiki talk:Common.js
 
(4 intermediate revisions by 4 users not shown)
Line 1:
 
<span id="63300674247" ></span>
== Tooltip for dismiss watchlist link ==
 
Line 10:
 
: Admins tend to tweak the message several times while it is displayed so that approach would likely not be very effective. Adding a unique id/class for each different message might work, though. —''[[User:Ruud Koot|Ruud]]'' 16:37, 31 March 2007 (UTC)
<span id="63301303375" ></span>
== Query strings ==
{{tl|editprotected}}
Line 136:
::: That are only the static CSS and JS files, not ones editable on-wiki. No idea if those significantly contribute to the bandwidth usage as well? —''[[User:Ruud Koot|Ruud]]'' 21:02, 1 April 2007 (UTC)
What does it do? At first glance it doesn't seem to have any use outside of other user-scipts (which can just as easily import it themselves.) —''[[User:Ruud Koot|Ruud]]'' 21:02, 1 April 2007 (UTC)
:Also, does <ttcode>Common.js</ttcode> really need [[Object-oriented programming|OOP]] techniques? The smaller is the better, imho — [[User:Alex Smotrov|Alex Smotrov]] 21:29, 1 April 2007 (UTC)
::That's just a minor thing, the idea first is to only parse the query string once. second point is to use correct encoding, as some has been using wrong function for that (window.escape()), and to do it transparent. <sub>→[[User:AzaToth|<span style="color:#773">Aza</span>]][[User_talk:AzaToth|<span style="color:#359">Toth</span>]]</sub> 21:34, 1 April 2007 (UTC)
:::For something unlikely to be used often, wouldn't it be just as well to put the burden on the client side (extra parsing) rather than on the servers (extra bandwidth for longer code)? See below (obviously just an example). --[[User:Splarka|Splarka]] ([[User_talk:Splarka|rant]]) 07:18, 2 April 2007 (UTC)
Line 153:
</pre>
}}
The above is basically from Lupin's popups, no? Or somewhere else before that, given the nature of much javascript code. Now, my opinion really doesn't matter here (not really that professional a javascript coder), but it might be useful to have one standardized function related to query strings, since a lot of scripts need them, and said scripts have their own query functions. So if those scripts are used together, you have (possibly) three or four query string functions altogether, which doesn't strike me as that efficient. Creating and getting query strings sounds useful; the rest, not as much. [[User:Gracenotes|<fontspan colorstyle="color:#960;">Grace</fontspan><fontspan colorstyle="color:#000;">notes</fontspan>]]<sup>[[User talk:Gracenotes|<fontsup colorstyle="color:#960;">T</fontsup>]]</sup> § 14:29, 2 April 2007 (UTC)
 
As [[WP:TW]] is probably the only script as of yet using QueryString (by some freak coincident), the number of calls to QueryString as of yet is 59 times. <sub>→[[User:AzaToth|<span style="color:#773">Aza</span>]][[User_talk:AzaToth|<span style="color:#359">Toth</span>]]</sub> 14:45, 2 April 2007 (UTC)
 
:I have added an {{tl|editprotected}} to the top of the page. So, which parts of this are we going to implement? All of it? Static? Object? Certain methods, and not others? [[User:Gracenotes|<fontspan colorstyle="color:#960;">Grace</fontspan><fontspan colorstyle="color:#000;">notes</fontspan>]]<sup>[[User talk:Gracenotes|<fontsup colorstyle="color:#960;">T</fontsup>]]</sup> § 19:37, 4 April 2007 (UTC)
 
::I think this is the sort of thing that is more appropriate for [[WP:US]]. Maybe I'm missing the point, but I don't see why this needs to be in the site-wide js, unless it is likely to be used by a general reader or editor. [[User:CMummert|CMummert]] · <small>[[User talk:CMummert|talk]]</small> 16:55, 5 April 2007 (UTC)
::: I agree with this. —''[[User:Ruud Koot|Ruud]]'' 20:41, 5 April 2007 (UTC)
:::: Sorry, I was away a bit. My only problem with this is that I need query string scripts, so I'll have to include my own. And if someone else needs to include them, they'll have to include their own. And all these functions for doing the same thing need to load, rather than having one standardized function. No matter, eh. [[User:Gracenotes|<fontspan colorstyle="color:#960;">Grace</fontspan><fontspan colorstyle="color:#000;">notes</fontspan>]]<sup>[[User talk:Gracenotes|<fontsup colorstyle="color:#960;">T</fontsup>]]</sup> § 22:53, 7 April 2007 (UTC)
::::: No, <code>importScrtipt</code> will only load a script once, even if it is included multiple times. —''[[User:Ruud Koot|Ruud]]'' 11:17, 8 April 2007 (UTC)
:::::: Do you know of a library that has this code? [[User:Gracenotes|<fontspan colorstyle="color:#960;">Grace</fontspan><fontspan colorstyle="color:#000;">notes</fontspan>]]<sup>[[User talk:Gracenotes|<fontsup colorstyle="color:#960;">T</fontsup>]]</sup> § 19:24, 8 April 2007 (UTC)
::::::: Uhh... AzaToth just wrote the code? He now only has to locate it somewhere (in his userspace or at [[WP:US]] for example) in list it at [[WP:US]]. —''[[User:Ruud Koot|Ruud]]'' 19:46, 8 April 2007 (UTC)
::::::: Yeah, it doesn't exist now. [[User:Gracenotes|<fontspan colorstyle="color:#960;">Grace</fontspan><fontspan colorstyle="color:#000;">notes</fontspan>]]<sup>[[User talk:Gracenotes|<fontsup colorstyle="color:#960;">T</fontsup>]]</sup> § 22:45, 8 April 2007 (UTC)
 
As to show you why it's so "complicated", I'm using it for example to create things like this (though I'm usually tries to make it asyncronus, it's syncrone here for the ease of typing):
Line 214:
 
:I think that it looks like a very useful script for [[WP:US]]. I don't see how it would help to have it in the sitewide monobook.js, since it seems that the only people who will use it will do so from scripts they are already adding to their personal monobook.js. If there were some function coded into a standard template that required it, that would be an argument in favor. Of course there is also the magic word <nowiki>{{urlencode}}</nowiki> built into mediawiki. [[User:CMummert|CMummert]] · <small>[[User talk:CMummert|talk]]</small> 23:22, 8 April 2007 (UTC)
<span id="63301527077" ></span>
== Better search engine ==
 
Line 247:
It doesn't help that PMartin76's English isn't the best, and that I was feeling sickly all weekend. If this is inappropriate, revert it. [[User:DragonflySixtyseven|DS]] 13:31, 11 April 2007 (UTC)
 
<span id="63301608737" ></span>
==Sorting==
I plan to add a bug fix for sorting tables, like I have done on Meta, to allow sorting of numbers with more than one thousands separator, see [[m:MediaWiki:Common.js]]. Any comments?--[[User:Patrick|Patrick]] 13:47, 11 April 2007 (UTC)
Line 254:
 
:I added it.--[[User:Patrick|Patrick]] 12:12, 12 April 2007 (UTC)
<span id="63301799690" ></span>
== Proposal: Short button captions for collapse tables ==
 
Can you add a shorter caption version of the collapse buttons? Maybe [+/-] instead of [show/hide]? [[User:Geva Zeichner|Geva Zeichner]] 12:52, 14 April 2007 (UTC)
 
: No, it's not intuitive and the TOC uses show/hide as well. Most people prefer show/hide (there was a shorter version in the past.) —''[[User:Ruud Koot|Ruud]]'' 14:40, 14 April 2007 (UTC)
 
:: Is it possible to make it as an option (for those crowded places)? [[User:Geva Zeichner|Geva Zeichner]] 17:14, 14 April 2007 (UTC)
 
Also, why is ''Button.style.width = "6em"'' so wide? it takes also a lot of space. [[User:Geva Zeichner|Geva Zeichner]] 13:29, 14 April 2007 (UTC)
 
: This is a safe upperbound on the maximum length a six character label can take up. Is it causing a problem somewhere? —''[[User:Ruud Koot|Ruud]]'' 13:51, 14 April 2007 (UTC)
 
:: Please have a look at my [[User:Geva_Zeichner/Sandbox|sandbox]]. As you can see, the show/hide button that I'm trying to put in the template, takes too much space. [[User:Geva Zeichner|Geva Zeichner]] 14:05, 14 April 2007 (UTC)
 
::: I didn't really design this with infoboxes in mind. I could make some changes to make it work better with those. You should seriously consider if you really want to put that much information in an infobox though. In a lot of situations ''all'' the information is shown (when printing an article, when using text-to-speech software, when using browser that doesn't fully support CSS or JavaScript, ...) so the fact that it ''can'' be hidden shouldn't be part of that consideration at all. —''[[User:Ruud Koot|Ruud]]'' 14:40, 14 April 2007 (UTC)
 
:::: I didn't think about it until now. But still, I am convinced that the option should exist. For some public figures that amount of information isn't too much at all. And for those, printing it all out actually sounds just right. When necessary, the information could be simply not included at all.<br />It would be great if you can make the changes to better the button's look in infoboxes. [[User:Geva Zeichner|Geva Zeichner]] 17:11, 14 April 2007 (UTC)