MediaWiki talk:Common.js/Archive May 2007

message: How about adding a "title" attribute to the dismiss watchlist link to create a tooltip:
 ButtonLink.setAttribute( "title", "Hide watchlist message for one week" );
This way, normal users have a chance of seeing that "dismiss" will hide the message for one week, instead of blindly clicking on it (or avoiding it for fear of permanently dismissing the message). What would be really cool would be to make the message dismiss until the text was changed. This would be pretty easy to do if there was a built-in MD5 function or some other sort of hash or checksum derived from the message that could be used as the value of the cookie instead of "yes". That way the code could tell if the message that was dismissed was the same as the current message. Mike Dillon 14:09, 31 March 2007 (UTC)
replies: text: 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. —Ruud 16:37, 31 March 2007 (UTC)
thread_title:  Tooltip for dismiss watchlist link 

message: I have made a querystring function in my morebits.js, wonder if you think it should be included here? →AzaToth 19:45, 1 April 2007 (UTC)
replies: text: I don't know how much extra load it will generate to just load the script, but it won't execute anything unless used. →AzaToth 20:05, 1 April 2007 (UTC)
replies: text: I was referring to the load from loading it.  It's 2,837 bytes, which means over millions of loads, it starts to add up.  See  for the server breakdown: css and js eat almost as much bandwith as pure article views. —METS501 (talk) 20:10, 1 April 2007 (UTC)
replies: text:  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? —Ruud 21:02, 1 April 2007 (UTC)

text: Also, does Common.js really need OOP techniques? The smaller is the better, imho — Alex Smotrov 21:29, 1 April 2007 (UTC)
replies: text: 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. →AzaToth 21:34, 1 April 2007 (UTC)
replies: text: 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). --Splarka (rant) 07:18, 2 April 2007 (UTC)

text: I have added an  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? GracenotesT § 19:37, 4 April 2007 (UTC)
replies: text: 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. CMummert · talk 16:55, 5 April 2007 (UTC)
replies: text:  I agree with this. —Ruud 20:41, 5 April 2007 (UTC)
replies: text:  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. GracenotesT § 22:53, 7 April 2007 (UTC)
replies: text:  No, importScrtipt will only load a script once, even if it is included multiple times. —Ruud 11:17, 8 April 2007 (UTC)
replies: text:  Do you know of a library that has this code? GracenotesT § 19:24, 8 April 2007 (UTC)
replies: text:  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. —Ruud 19:46, 8 April 2007 (UTC)

text:  Yeah, it doesn't exist now. GracenotesT § 22:45, 8 April 2007 (UTC)

text: 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  built into mediawiki. CMummert · talk 23:22, 8 April 2007 (UTC)
thread_title:  Query strings 

message: 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?--Patrick 13:47, 11 April 2007 (UTC)
replies: text: I added it.--Patrick 12:12, 12 April 2007 (UTC)
thread_title: Sorting

message: Can you add a shorter caption version of the collapse buttons? Maybe [+/-] instead of [show/hide]? Geva Zeichner 12:52, 14 April 2007 (UTC)
replies: text: 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.) —Ruud 14:40, 14 April 2007 (UTC)
replies: text:  Is it possible to make it as an option (for those crowded places)? Geva Zeichner 17:14, 14 April 2007 (UTC)

text: This is a safe upperbound on the maximum length a six character label can take up. Is it causing a problem somewhere? —Ruud 13:51, 14 April 2007 (UTC)
replies: text:  Please have a look at my sandbox. As you can see, the show/hide button that I'm trying to put in the template, takes too much space. Geva Zeichner 14:05, 14 April 2007 (UTC)
replies: text:  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. —Ruud 14:40, 14 April 2007 (UTC)
replies: text:  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.It would be great if you can make the changes to better the button's look in infoboxes. Geva Zeichner 17:11, 14 April 2007 (UTC)
thread_title:  Proposal: Short button captions for collapse tables