User talk:Pyrospirit/metadata

From Wikipedia, the free encyclopedia

When reporting bugs for this script, please include all of the following:

  • Your browser, including version number.
  • Which version of this script you were using when you saw the bug, gadget or directly installed.
  • What page or pages the bug occurs on.
  • What sort of bug occurs. For example, does it give the wrong assessment, no assessment, displays in the wrong place, has the wrong text or color, or something else?

Contents

[edit] Notes

Section merged from User talk:Pyrospirit/metadata.js.

(diff): it has to be

(skin == "modern")

(double equal sign); personally, I would write

var noneColor = (skin == "modern") ? "#FFFFFF" : "#000000"

AlexSm 00:50, 12 March 2008 (UTC)

Oops, kinda missed this page. Yeah, I figured it out on my own eventually. Thanks for the advice. Pyrospirit (talk · contribs) 23:41, 15 March 2008 (UTC)

[edit] var names

Section merged from User talk:Pyrospirit/metadata.js.

Another concern: variables and functions names seem to be too simple. If some other userscript would use color or update or begin, the gadget will likely to break (since userscripts are called a bit later). There are two approaches here:

  • adding short unique prefix to each global function or variable
  • enclosing everything inside one big function

AlexSm 18:18, 21 March 2008 (UTC)

I see what you mean, that could be an issue. I'll fix this. Pyrospirit (talk · contribs) 18:39, 21 March 2008 (UTC)

[edit] Bug in description text

Resolved. Used string explicitly instead of getting it from a tag.

When I visit any article, instead of texts like "A Featured Article from Wikipedia, the free encyclopedia", I get "A Featured Article wikipedia". If I visit a Good Article that was a former Featured Article, I get "A Good Article wikipedia. A former Featured Article", and so on. It's as if the part of the string that's supposed to say "from Wikipedia, the free encyclopedia" is simply replaced by "wikipedia". I'm guessing this could be due to my Wikipedia locale, which is set to Swedish. I'm using a Firefox 3 pre-beta 5 build and this functionality as a "gadget" set in my user preferences. — Northgrove 01:34, 28 March 2008 (UTC)

Now having switched to the default English locale, I indeed get the proper description texts. Additionally, my HotCat gadget started working too, so this one isn't alone with having locale problems. I think I'll just keep using Wikipedia with the English locale then, but think these sorts of locale problems should generally be mentioned more prominently. — Northgrove 01:40, 28 March 2008 (UTC)
That's very odd. I don't have Firefox 3, so I'm not sure what could be causing this. Here's the piece of code that generates the tagline:
function updateAssessment(headerColor, slogan, info) {
document.getElementsByTagName("h1")[0].style.cssText = "color: " + headerColor + ";";
t = document.getElementById("siteSub").innerHTML;
document.getElementById("siteSub").innerHTML = "<i>" + slogan + "</i> " + t.charAt(0).toLowerCase() + t.substring(1) + info;
}
It basically takes the element containing the siteSub and turns the first letter to lowercase, adding the article information to the beginning and end. The only explanation I can think of at the moment is that when your locale is set to Swedish, the siteSub tag is structured differently. I'll try to fix it, but if I can't figure out how, I'll mention it in the documentation. Thanks for letting me know about this. Pyrospirit (talk · contribs) 15:16, 28 March 2008 (UTC)
Ok, I think it's because your siteSub element is being taken from the Swedish Wikipedia, where it is Wikipedia rather than From Wikipedia, the free encyclopedia. I think I can fix this by explicitly using that string rather than generating it automatically from the previous siteSub content. Does this fix the problem when you set your locale to Swedish? Pyrospirit (talk · contribs) 15:34, 28 March 2008 (UTC)
Just remembered that I have to get the gadget version updated separately, so you won't see the change quite yet. You can either run it from my userspace version or just wait a little for an admin to update the gadget version. Pyrospirit (talk · contribs) 15:39, 28 March 2008 (UTC)

[edit] Tibet is incorrectly classified

Resolved. Fixed malformed template on article.

When I look at Tibet, this script says the article is a Good Article, when in fact it is a B-class article and there is no evidence that points to it being a GA on the Talk page. Gary King (talk) 21:21, 31 March 2008 (UTC)

The script was detecting a duplicate, outdated currentstatus parameter in its {{ArticleHistory}} template. I've removed the extra parameter from the talk page, and it is now displaying properly as B-class. Pyrospirit (talk · contribs) 22:29, 31 March 2008 (UTC)

[edit] Flag of Canada is not a former featured article

Resolved. Fixed bug in regex.

Even though this script says so. It was nominated as a WP:FAC but failed, meaning it was never a WP:FA. Gary King (talk) 22:37, 31 March 2008 (UTC)

Fixed. It was a small bug in the regex for FFAs that made it detect FFACs as well. Thanks for letting me know about this. Pyrospirit (talk · contribs) 23:20, 31 March 2008 (UTC)

[edit] War (card game)

Resolved. Fixed bug in regex.

War (card game) is considered a disambiguation page by this script. It is not a disambiguation page. Gary King (talk) 18:27, 1 April 2008 (UTC)

Mission: Impossible is not a disambiguation page even though the script says so, too. Gary King (talk) 18:45, 1 April 2008 (UTC)
I have absolutely no idea what could be causing this. The same is occurring for me, even after purging the pages and clearing my browser cache. I have checked both pages manually for the pieces of code that the script detects as signaling a disambiguation page, and neither page has these. Also, testing for the required conditions by running the necessary JavaScript after the page loads detects as false for all these conditions! I'm going to post this at WP:VPT and see if anyone else can explain this. Pyrospirit (talk · contribs) 23:31, 1 April 2008 (UTC)
Ok, it's now fixed. Turns out I had misinterpreted what the | symbol did in regex and had miscoded something as a result. Pyrospirit (talk · contribs) 00:36, 2 April 2008 (UTC)

[edit] Featured Lists

Resolved. Added feature.

Would it be possible for this script to differentiate between Featured Articles and Featured Lists? Right now, when I am viewing a Featured List, the script still calls it a Featured Article. Shouldn't it be able to tell the difference considering, the term 'article' is not mentioned anywhere for a Featured List? (On the article page, for instance, it uses {{featured list}}, and on the Talk page, it uses "article is a featured list." Thanks! Gary King (talk) 16:15, 4 April 2008 (UTC)

I've been considering this, but haven't had time to code it in yet. I'll do that now. Pyrospirit (talk · contribs) 21:06, 8 April 2008 (UTC)
Could you also show that an article is currently a featured list candidate when that is the case, so that it is similar to how the featured article candidate feature works? Gary King (talk) 22:12, 9 April 2008 (UTC)
Good idea. I've done that. Pyrospirit (talk · contribs) 22:57, 9 April 2008 (UTC)
Doesn't appear to be working. Is it searching for {{FLC}}? Gary King (talk) 00:25, 10 April 2008 (UTC)
Yeah, it searches the first section of the talk page for a match to /\{\{flc\}/i. It's working for me. Looking at User:Gary King/monobook.js, I don't see the script there, which means you must be running the gadget version. I currently have an open {{editprotected}} request for an admin to update the script with this feature; I have to do that since I can't edit gadgets in the MediaWiki namespace. You might want to manually install the version I edit at User:Pyrospirit/metadata.js so you can get all changes to the script as soon as I make them. Pyrospirit (talk · contribs) 01:25, 10 April 2008 (UTC)

[edit] System failure?

Resolved. Seemingly fixed itself.

I had this function included in my preferences, and found that, as of a couple of days ago, it no longer functions. I have even specifically checked the right box in "Gadgets" and cleared the cache, only to find that the system does not seem to remain operational. Is there a problem with this function such that it no longer works? John Carter (talk) 13:49, 29 April 2008 (UTC)

The script has not been changed since April 10, and I don't know of any changes to the MediaWiki API that would cause it to break. I logged on to User:Pyrospirit (alt), my alternate account that uses the gadget, and it works just fine for me. If it still isn't working for you, I'll need more information. What browser are you using and what version is it? What gadgets or Greasemonkey scripts do you have installed, if any? Does your error console (in Firefox, Tools -> Error Console) contain any errors relating to this script? If I know these things, it might help me figure out how you can get it to work. Pyrospirit (talk · contribs) 20:17, 1 May 2008 (UTC)
My apologies for having not withdrawn the statement when the system restored itself, which has subsequently done, and now I can see the assessments again. Personally, I have no clue what may have happened, but it seems to have corrected itself, about a day or two after the problem was noticed. I wish I could say more, but I don't know any more. Sorry. John Carter (talk) 20:29, 1 May 2008 (UTC)
Glad it's working again. Computers are funny like that, aren't they? Pyrospirit (talk · contribs) 20:40, 1 May 2008 (UTC)

[edit] Lyme disease incorrect rating displayed

Resolved. Script now detects GA-class before A-class.

Lyme disease is a WP:GA in WikiProject Medicine but the script says it is A-class, presumably because it is confused by the old rating for Version 0.5 that is still listed on the talk page. - Neparis (talk) 17:49, 3 May 2008 (UTC)

Fixed. The script always detects ratings in a specific order; to fix this issue, I made it detect GA-class before A-class. Pyrospirit (talk · contribs) 18:09, 4 May 2008 (UTC)
Thanks, that was fast. What a great script/gadget! - Neparis (talk) 16:38, 5 May 2008 (UTC)

[edit] What about the projects?

WP:MILHIST considers A-Class above GA, and as such our article are frequently both Good Articles and have passed our A-Class review (which has higher standards than GA does). A good example is Montana class battleship. This change is detrimental and seems unnecessary as the A-Class assessment is superior in some projects assessment structure. -MBK004 19:42, 25 May 2008 (UTC)

What do you suggest I do, then? Should A-class always have priority over a GA rating? I can only do one way or the other, and there's some cases where GA is more significant than an A-class assessment from a small or minor WikiProject. Given the ongoing discussion over the assessment scale, I think it might be a better idea to wait until everything settles down before I make too many changes to the script; I'll probably have to rewrite chunks of it anyway. Pyrospirit (talk · contribs) 21:34, 25 May 2008 (UTC)

[edit] Overriding the default colors?

Is there any way I can specify my own color for a class or two, using a userspace js or css? I don't really like the B-Class color, and would prefer a more orangish-gold, about like what you have in your signature. Thanks in advance for your reply. —Scott5114 [EXACT CHANGE ONLY] 07:02, 4 May 2008 (UTC)

Y Done. See User:Pyrospirit/metadata#Customization. Pyrospirit (talk · contribs) 18:14, 4 May 2008 (UTC)
Could any of the customizations be done by CSS, so people using the gadget version could simply make their customizations via their userspace monobook.css? Just a thought... - Neparis (talk) 16:42, 5 May 2008 (UTC)
It would be possible, but it would complicate the script somewhat. I might do this later. Pyrospirit (talk · contribs) 22:02, 5 May 2008 (UTC)

[edit] Assessing articles

Is there anyway this script can be used to assess articles like the outriggr script.--Oneworld25 (talk) 14:11, 19 May 2008 (UTC)

Won't fix. I currently have no plans to add that functionality. This script is designed to display an article's assessment and nothing more. Adding more features would reduce its usability as a gadget since less people would have a use for it and the extra features would clutter up the script and slow it down. However, I have no problem with someone else using its source code to write a script designed to aid article assessment. Pyrospirit (talk · contribs) 19:55, 21 May 2008 (UTC)

[edit] Assessment order

Because the "unassessed" check (no talk page) appears before the "redirect" check in beginAssessment, redirects are never marked as such. Changing

else if ( document.getElementById("ca-talk").className == "new" ) {
        updateAssessment(TitleColor.none, "An " + linkLead + "unassessed</a> article", "");
    }
    else if ( document.getElementById("contentSub").innerHTML == "Redirect page" ) {
        updateAssessment(TitleColor.none, 'A <a style="color:' + TitleColor.link + ';" href="/wiki/Help:Redirect">Redirect page</a>', "");
    }

to

else if ( document.getElementById("contentSub").innerHTML == "Redirect page" ) {
        updateAssessment(TitleColor.none, 'A <a style="color:' + TitleColor.link + ';" href="/wiki/Help:Redirect">Redirect page</a>', "");
    }
    else if ( document.getElementById("ca-talk").className == "new" ) {
        updateAssessment(TitleColor.none, "An " + linkLead + "unassessed</a> article", "");
    }

ought to fix the problem. nneonneo talk 17:17, 26 May 2008 (UTC)

Fixed. Thanks for catching that. Pyrospirit (talk · contribs) 22:27, 26 May 2008 (UTC)
Thanks for the quick fix. Can I also ask if it's possible to define a color for redirects? nneonneo talk 22:50, 26 May 2008 (UTC)
I kept the colors the same by default for redirects, but you can now customize it by defining TitleColor.redir. Pyrospirit (talk · contribs) 23:39, 26 May 2008 (UTC)
Thanks a bunch! nneonneo talk 15:29, 28 May 2008 (UTC)

[edit] C-class?

Why does the script say that Nguyen Van Nhung is a C-class article when on the Talk page it is identified as a Start-class article? The C-class does not even exist yet and is still under discussion. Gary King (talk) 03:18, 12 June 2008 (UTC)