MediaWiki talk:Common.js/Archive 17: Difference between revisions
Content deleted Content added
m Replaced deprecated <source> tags with <syntaxhighlight> (via WP:JWB) |
Substituted template per Wikipedia:Templates for discussion/Log/2022 October 11#Template:Site JS editnotice. |
||
(One intermediate revision by one other user not shown) | |||
Line 27:
Following the 2008 discussion [[MediaWiki talk:Common.js/Archive 14#Functional breakdown by size|Functional breakdown by size]] when <samp>edits.js</samp> etc. were created, I'm wondering if it's possible to move some other code into separate modules. Particularly, ''"IPv6 AAAA connectivity testing"'' code which is used about 1 out of 100 page views, and ''"Mobile browser helper link"'' which is used, I would estimate, by less than 1% of visitors. — [[user:Alex Smotrov|AlexSm]] 15:46, 24 June 2009 (UTC)
:Yeah, I don't see why not. I personally think Common.js should simply be a list of imports, that can be enabled or disabled as required, but that could just be me. For the IPv6, I presume you are suggesting that the contents of the main conditional simply be moved to another page and replaced by the import? If no one objects here in the near future, I'll go ahead and move that to (following the existing naming scheme, which I like) [[MediaWiki:Common.js/IPv6.js]]. I'd possibly suggest talking to the maintainers of the mobile redirect, as I know they are actively developing that based on MediaWiki changes and changes to the mobile site. [[User:Ale_jrb|<
::I agree about the IPv6 code, and the mobile device code should also be moved to a subpage. Moving ''all'' the scripts to subpages is probably not a good idea--some scripts are simply needed too often to justify splitting them off. —[[User:Remember the dot|Remember the dot]] <sup>([[User talk:Remember the dot|talk]])</sup> 05:37, 26 June 2009 (UTC)
Line 38:
:To me, the problem is that we use way too much JavaScript. [[MediaWiki:Common.js/search.js|The Special:Search code]], the IPv6 test, and the main page fixes should be implemented in PHP and not in JavaScript at all. Also, JavaScript commonly used across many projects should be made part of MediaWiki's standard JavaScript features. While the Squid servers effectively prevent a PHP solution for the mobile devices code, if we eliminated all the other extraneous JavaScript then our site JavaScript as a whole wouldn't be so bad. —[[User:Remember the dot|Remember the dot]] <sup>([[User talk:Remember the dot|talk]])</sup> 02:04, 9 July 2009 (UTC)
::I moved the IPv6 code to another page, as there seemed to be no big issues with doing so. Common.js now stands at around 15Kb. [[User:Ale_jrb|<
:::The IPv6 code was broken for Vector and other skins not compatible with Monobook. I have [http://en.wikipedia.org/w/index.php?title=MediaWiki%3ACommon.js%2FIPv6.js&diff=301855502&oldid=301160829 repaired this]. Mark is currently looking as to why the [http://ipv6and4.labs.wikimedia.org/ statistics pages] are not OK. Instant update, disk space on the server apparently ran out. I'll keep an eye out for when it gets fixed, and will try to leave a note here after it's repaired again. —[[User:TheDJ|Th<span style="color: green">e</span>DJ]] ([[User talk:TheDJ|talk]] • [[Special:Contributions/TheDJ|contribs]]) 13:34, 13 July 2009 (UTC)
Line 66:
: Perhaps the warning that appears when you try to edit this page should be tweaked to encourage a little more though before making a bold edit and state the possible consequences of introducing errors on this page (e.g. popping up an error box for 75% of all visitors.) And maybe be it should be red and blinking as well :p —''[[User:Ruud Koot|Ruud]]'' 22:48, 14 July 2009 (UTC)
::How about
{{fmbox
| image = [[File:Finger pointing.jpg|60px]]
| text = There is no such thing as a 'trivial' or 'unnoticeable' change to the site JavaScript. Test the ''exact'' change on IE, Firefox, Safari and Chrome, ''twice'' (since you'll have forgotten to get the recached files the first time), because [[sod's law]] says you'll break something if you don't. Save yourself the [[Wikipedia:Whacking with a Wet Trout|embarrassment]] and [[Wikipedia:Village stocks|humiliation]]. Discuss your changes on the [[{{TALKPAGENAME}}|talk page]] before implementing them.
}}
::?? [[User:Happy-melon|<b color="forestgreen">Happy</b>]]‑[[User talk:Happy-melon|<b color="darkorange">melon</b>]] 12:53, 17 July 2009 (UTC)
:::I like it; it's slightly amusing yet clearly serious. I'd put the whole first sentence in bold, personally, as that's the really important part. [[User:Ale_jrb|<
::::Same here. Give me a minute, and I'll tweak the wording, too. =) <span style=white-space:nowrap>「[[User:Dinoguy1000|<span style=color:#00f>ダイノ</span><span style=color:#080>ガイ</span>]][[Special:Contributions/Dinoguy1000|<span style=color:#F90>千?!</span>]]」<sup>[[Help:IJP|?]] · [[User talk:Dinoguy1000#top|Talk⇒Dinoguy1000]]</sup></span> 18:52, 17 July 2009 (UTC)
== border="1" in tables ==
Line 275 ⟶ 279:
:: Any opinions against adding these few lines of code to Common.js? [[User:Cacycle|Cacycle]] ([[User talk:Cacycle|talk]]) 12:31, 20 October 2009 (UTC)
:::I had a read through, checked the code. It all looks fine to me, and I would have no issue with the code being added. [[User:Ale_jrb|<
:::: I will go ahead and add this code if nobody objects. I will also go ahead and document the new functionality on the relevant pages. [[User:Cacycle|Cacycle]] ([[User talk:Cacycle|talk]]) 21:58, 29 October 2009 (UTC)
::::: Added. [[User:Cacycle|Cacycle]] ([[User talk:Cacycle|talk]]) 16:30, 31 October 2009 (UTC)
Line 480 ⟶ 484:
Code untested. I think you use wgIsArticle instead of wgAction == "view" since things like purge renders a fully viewed page. You should be using wgServer + wgScriptPath, not all SVGs are at commons. We probably should be picking common screen resolutions like 1024x768, 1280x960, 1920x1080, 2048x1536. — [[User:Dispenser|Dispenser]] 21:06, 25 November 2009 (UTC)
:I fixed the paths immediately, I think that was kinda important. —[[User:TheDJ|Th<span style="color: green">e</span>DJ]] ([[User talk:TheDJ|talk]] • [[Special:Contributions/TheDJ|contribs]]) 21:14, 25 November 2009 (UTC)
::The list of appends is messy. Put them in an array and iterate? [[User:Ale_jrb|<
::By that I mean the size, in case it isn't obvious. :) [[User:Ale_jrb|<
:::I doubt it will matter much in terms of efficiency, readability or speed. Now using a svgAltSize() function to at least keep the link generation a bit cleaner. —[[User:TheDJ|Th<span style="color: green">e</span>DJ]] ([[User talk:TheDJ|talk]] • [[Special:Contributions/TheDJ|contribs]]) 21:40, 25 November 2009 (UTC)
::::No, it doesn't matter much. Significantly better practise though. Meh. :) [[User:Ale_jrb|<
:@Dispenser, the problem with "screen sizes" is of course that the width x height defined here, are the limits, not the dimensions of the ouput. Although I agree that other sizes might be more useful than the current ones. I tried to fix the path issue, just not really sure about a good identification method for commons atm (wgServer doesn't work, is always en.wp) —[[User:TheDJ|Th<span style="color: green">e</span>DJ]] ([[User talk:TheDJ|talk]] • [[Special:Contributions/TheDJ|contribs]]) 21:52, 25 November 2009 (UTC)
|