MediaWiki talk:Common.js

From Guild Wars 2 Wiki
Jump to navigationJump to search
Manuals

demarcateDialogue[edit]

Could this auto formatting be extended to support a few more listed on GW2W:DIALOGUE? It was also requested at [1]. Thanks. --BryghtShadow (talk) 03:32, 20 August 2016 (UTC)

Sometimes breaking[edit]

So i had a look at this a while ago as to why this sometimes beaks and doesn't load and if i'm not mistaken it seems that it falls at least to a race condition, sometimes attempting to access $ before it's defined right in the first line, preventing everything thereafter from executing. Since what's handling it is suppressing all errors would it be possible for someone that can edit this page to wrapp it in e.g. try { ... } catch (err) { console.info(err); } and then have a look at the console every once in a while if it didn't load again, as is e.g. the case when the links at the top for the website, forum and support don't appear to see if that's the case. If i did everything correct one error this should report should be that $ is not defined. Nightsky (talk) 04:21, 3 April 2021 (UTC)

this edit added it. I can't remember where exactly I got that snippet from but I think poke suggested it. I'm not even 100% sure whether it is still required or not since I can't find any related issues on SMW github.
Also similarly removed "semanticGalleryCleanup" since that issue looks like it was resolved about 3 years ago... -Chieftain AlexUser Chieftain Alex sig.png 11:08, 3 April 2021 (UTC)
I suppose i phrased that wrong. I meant the wrapping to refer to the page as a whole as i didn't test any further after running into the $ is not defined error because it was really anyoing to spam the debug console with the replacement setup before it loaded the script so that it would load the script through that and not normaly. So i don't know if there might not be something other than $ being undefined as well but i do think that one of the errors that eventually could occur would be that, though there might be more; except when the only thing wrapped is the first line i guess. Could you please put the catch at the end? Nightsky (talk) 11:36, 3 April 2021 (UTC)
The phrasing was ambiguous yes ;) Moved. Poke suggested the $.support thing is legacy jquery that was deprecated as of jquery 1.9 so happy to delete that too tbh. -Chieftain AlexUser Chieftain Alex sig.png 11:58, 3 April 2021 (UTC)
Well.. Special:Random redirected me to a page with it still not loading fully (no masthead, no feedback button, no dialogue style) but nothing in the console. (And as if that wasn't enough editing here also had no masthead. (And if even that wasn't enough it reset this on preview again, luckily had it copied though.)) So unfortunatelly this doesn't seem to be it. Guess you can remove it again. Thanks for adding it. Nightsky (talk) 13:13, 3 April 2021 (UTC)

Dialogue and text with the mobile skin[edit]

It seems the method demarcateDialogue breaks the collapsible behaviour of the level two section headers with the mobile skin; keeping them hidden but the expandable option not active. See bugged (No arrow next to the Dialogue section. No content beneath it either. The section header not reacting to attempts at expanding/collapsing it.) vs. normal appearance/behaviour. Nightsky (talk) 02:04, 10 August 2021 (UTC)

Hmm. A desktop only bug for mobile skin, appears to work OK with a mobile device. So the CSS isn't loading but the JS is. -Chieftain AlexUser Chieftain Alex sig.png 23:05, 10 August 2021 (UTC)

mw.loader.using( [ 'mediawiki.util' ] )[edit]

Looking at this snippet, I don't know if we actually need that "using" line, as I think it probably does nothing... mw.config and mw.loader.load seem to be the only mediawiki functions there. For the time being I've removed it from my own personal JS sheet to see what happens. Depending on the outcome, I might remove it both here and on Mobile.js. -Chieftain AlexUser Chieftain Alex sig.png 18:59, 8 December 2022 (UTC)

tradingPostPrices and (Template:Tp) is misleading on API failures[edit]

So, with the imminence of the API going down I wondered about a thing and went to check. When API is unreachable (either client or server side) it defaults to show Copper coin with the tooltip saying "No buy or sell orders found". I just came to realize it might be very misleading, it could lead people to thing there is no actual orders for the item instead it being a failure. May I suggest changing it to show like "N/A" and the tooltip like "There was an issue retrieving the orders" or something? That way it would make it clear there was an issue and would hint people to try again later or with a different browser/device. I believe it's an easy change, like:

this.elem.innerHTML = 'N/A';
this.elem.title = 'Failed to retrieve data.'

Txonä Atan - (talk) 23:42, 17 August 2023 (UTC)

Good idea! Changed it to show “? Copper coin” instead and adjusted the message to explain that this is an error. poke | talk 10:38, 20 August 2023 (UTC)