MediaWiki talk:Common.js/Archive Dec 2007

message: Perhaps there have been more people than me feeling that the field labels on the Special:Log doesn't always fit. I propose following script, that will update the field names according to the wanted action, at the moment, only for block is changed, but it's easy to update for the other actions also. →AzaToth 01:18, 2 November 2007 (UTC)
replies: text: 1) I don't think it's important enough to warrant a script; 2) this would break interface for users with custom language in preferences; 3) stop trying to make Common.js IE-incompatible, you've yet to come back and fix Sysop.js :) ∴ AlexSm 04:22, 2 November 2007 (UTC)

text: Agree with Alex, this adds way to much code for such a minor fix. This sohuld just be fixed in MediaWiki instead. —Ruud 16:32, 2 November 2007 (UTC)
thread_title:  Log page field labels 

message: It has come to light at Wikipedia:Village pump (technical)#One of Wikipedia's built-in scripts causes a JavaScript error that the PngFix workaround for IE6 causes an exception when the security setting "Binary and script behaviors" is set to "Disable". To fix it, I propose that the first line of the PngFix function be changed from:
    if (document.body.filters && !window.PngFixDisabled)
to
    try
    {
        if (!document.body.filters)
        {
            window.PngFixDisabled = true
        }
    }
    catch (e)
    {
        window.PngFixDisabled = true
    }
    if (!window.PngFixDisabled)
This ought to resolve the problem. I don't want to put the entire function body inside a try/catch block because then any errors that occur within the function would become invisible. Any thoughts? —Remember the dot (talk) 00:09, 17 November 2007 (UTC)
replies: text: That would execute a try/catch block for each png image... I'm not sure I like the implications of that. I'm still not sure what exactly causes the exception (haven't found that option yet), but if it's the combination of 'document.body.filters' and 'windows.PNGFixDisabled', we should simply move the document.body.filters check to the version check below.  — Edokter • Talk •  00:21, 17 November 2007 (UTC)
replies: text: That will not execute try/catch for each image. I think the code is okay. Minor note: you don't have to use window.PngFixDisabled first two times, and personally I don't like when { } are used when they are not needed ∴ AlexSm 00:24, 17 November 2007 (UTC)
replies: text: Oops! You're right. But I'd still like to find this option first before doing anything... If a simple switching oprands could fix the problem, we don't need a try/catch at all.  — Edokter • Talk •  00:30, 17 November 2007 (UTC)

text: About using { } when they are not strictly needed: personally, I prefer it, so I'd rather just leave them in. —Remember the dot (talk) 01:14, 17 November 2007 (UTC)

text: We can't combine the document.body.filters check with the browser version check because document.body does not yet exist when the browser check is run. The document.body.filters check must happen later. —Remember the dot (talk) 01:14, 17 November 2007 (UTC)
thread_title:  PngFix change for customized security settings 

message: I've implemented new code that allows the watchlist show/hide function to be able to use multiple messages and be reset when needed. The actual code was written by User:Splarka; the relevant MediaWiki message is MediaWiki:Watchlist-details. The implementation is a little dirty; if any one can improve it, please don't hesitate to do so. --MZMcBride (talk) 18:13, 17 November 2007 (UTC)
thread_title:  Watchlist show/hide code