{{editprotected}} Looks like developers did the same thing for global JS/CSS files as they already did before for personal js/css files: now the whole page is shown inside <pre class="mw-code mw-js"> tag, which means nothing is going to work inside and we can remove all templates (e.g. {{Interwiki-all}} in MediaWiki:Monobook.css and MediaWiki:Common.css), [[User:]] links, headings, <pre> tags and so on. However, there is still one little reason to keep <source> tag: you can trasclude the file on another page and then still enjoy it with syntax highlighting ∴ Alex Smotrov 22:29, 27 June 2007 (UTC)
Now it <pre> with syntax highlighting, which is nice. Still, no markup works inside, so it's better to remove it ∴ Alex Smotrov 16:15, 29 June 2007 (UTC)
If you still want to see it with all the bells and whistles (parsed wikicode), try a diff, like: &oldid=141424535&diff=. --Splarka (rant) 07:05, 30 June 2007 (UTC)
{{editprotected}} There are a few things that I would like to propose for en: when uploading files. Most of these are not original ideas. I could provide a link to where they were first proposed but I don't think it's that important. I think they can be done with js of some kind.
This same message went trough the Village Pump (Make "Upload file" more like on Commons) without anyone noticing. So I thought I'd add it here. --Steinninn 16:03, 4 July 2007 (UTC)
I have just reverted Martinp23's addition of the search engine images. Adding images like these violates our fair use policy and may be interpreted as ads. Sean William 22:46, 19 May 2007 (UTC)
onloadFuncts.splice(onloadFuncts.indexOf(SpecialSearchEnhanced3), 1)
. GracenotesT § 19:41, 20 May 2007 (UTC)/** Search page improvements ****************************************************** * Amélioration de la page de recherche v3 * Auteur : Marc Mongenet * Sous licence GFDL & GPL<nowiki> * Improvement to search page * Authour: Marc Mongenet (from fr.wiki) * Licensed GFDL and GPL * Modified for en-wiki by Martinp23 */ function SpecialSearchEnhanced3() { function SearchForm(search_action_url, engine_url, engine_name, search_field_name, search_field_value, site_field_name, site_field_value) { var span = document.createElement("div"); span.style.marginRight = "1em"; span.style.width="100%"; span.style.whiteSpace = "nowrap"; var form = document.createElement("form"); form.method = "get"; form.action = search_action_url; form.style.display = "inline"; span.appendChild(form); var input = document.createElement("input"); input.type = "hidden"; input.name = search_field_name; form.appendChild(input); var site = document.createElement("input"); site.type = "hidden"; site.name = site_field_name; site.value = site_field_value; form.appendChild(site); form.onsubmit = function() { input.value = document.getElementById("lsearchbox").value; } var submit = document.createElement("input"); submit.type = "submit"; submit.style.margin = "3px"; submit.value = "Use " + engine_name + " search"; form.appendChild(submit); return span; } if (typeof SpecialSearchEnhanced3Disabled != 'undefined') return; if (wgPageName != "Special:Search") return; var mainNode = document.getElementsByTagName("form"); if (!mainNode) return; mainNode = mainNode[0]; mainNode.appendChild(document.createElement("center")); mainNode = mainNode.lastChild; var searchValue = document.getElementById("lsearchbox").value; var engine; engine = SearchForm("http://www.google.com/search", "http://www.google.com/", "Google", "q", searchValue, "as_sitesearch", "en.wikipedia.org"); mainNode.appendChild(engine); engine = SearchForm("http://www.wikiwix.com/", "http://www.wikiwix.com/", "Wikiwix", "action", searchValue, "lang", "en"); mainNode.appendChild(engine); engine = SearchForm("http://search.live.com/results.aspx", "http://search.live.com/", "Windows Live", "q", searchValue, "q1", "site:http://en.wikipedia.org"); mainNode.appendChild(engine); engine = SearchForm("http://en.search.yahoo.com/search", "http://en.search.yahoo.com/", "Yahoo!", "p", searchValue, "vs", "en.wikipedia.org"); mainNode.appendChild(engine); } addOnloadHook(SpecialSearchEnhanced3); /* End of search page */
{{editprotected}}
Hm... could we possibly keep the buttons down to a minumum? Mere links would be good, I think. I mean... I dislike them: too large, and too many of them. GracenotesT § 19:23, 20 May 2007 (UTC)
This code might work, if anyone's in favor of it, and if it works on all browsers:
if (wgPageName == "Special:Search") { var searchEngines = []; addOnloadHook(SpecialSearchEnhanced); } function SpecialSearchEnhanced() { var createOption = function(site, action, mainQ, addQ, addV) { var opt = document.createElement('option'); opt.appendChild(document.createTextNode(site)); searchEngines[searchEngines.length] = [action, mainQ, addQ, addV]; return opt; } var searchForm = document.forms['search']; var selectBox = document.createElement('select'); selectBox.id = 'searchEngine'; searchForm.onsubmit = function() { var optSelected = searchEngines[document.getElementById('searchEngine').selectedIndex]; searchForm.action = optSelected[0]; searchForm.lsearchbox.name = optSelected[1]; searchForm.title.value = optSelected[3]; searchForm.title.name = optSelected[2]; } selectBox.appendChild(createOption('MediaWiki search', '/w/index.php', 'search', 'title', 'Special:Search')); selectBox.appendChild(createOption('Google', 'http://www.google.com/search', 'q', 'as_sitesearch', 'en.wikipedia.org')); selectBox.appendChild(createOption('Yahoo', 'http://search.yahoo.com/search', 'p', 'vs', 'en.wikipedia.org')); selectBox.appendChild(createOption('Windows Live', 'http://search.live.com/results.aspx', 'q', 'q1', 'site:http://en.wikipedia.org')); selectBox.appendChild(createOption('Wikiwix', 'http://www.wikiwix.com/', 'action', 'lang', 'en')); searchForm.lsearchbox.style.marginLeft = '0px'; var lStat = document.getElementById('loadStatus'); lStat.parentNode.insertBefore(selectBox, lStat); }
The only problem is that "fulltext=search" is submitted as part of the query, since that's the name/value of the submit button. GracenotesT § 02:32, 23 May 2007 (UTC)
The code for Mediawiki search fails when using the secure server. It brings up secure.wikimedia.org/w/index.php which leads to a "Wiki does not exist" message. Can someone make the script check for secure.wikimedia.org and change the Mediawiki search URL accordingly? Resurgent insurgent 01:25, 26 May 2007 (UTC)
'/w/index.php'
should be changed to wgScriptPath + '/index.php'
. Mike Dillon 01:40, 26 May 2007 (UTC)
{{editprotected}}
Is it all right if someone changes "as_sitesearch" to "sitesearch" for the Google drop-down item in this script, which produces this search rather than this one? The former is a bit cleaner, and less confusing for people who are less familiar with Google. Thank you, GracenotesT § 00:40, 9 June 2007 (UTC)
There's some problems when searching some terms including the CJK characters when searching using the Yahoo! option. And I've found out that a field name and a value is required in addition of the existing search term that using the Yahoo! sarch engine. i.e. the [ei=utf-8] is required when a Yahoo! search engine is selected. Any idea how to solve this issue? Shinjiman ⇔ ♨ 13:46, 9 July 2007 (UTC)
vs=en.wikipedia.org
. The code would have to be changed to add a hidden element to the form for the ei
parameter on submit, which would significantly alter the structure of the code. Mike Dillon 02:24, 10 July 2007 (UTC)
{{editprotected}}
The definitions of importScript
and importStylesheet
call page.replace( ' ', '_' )
, but this will only replace the first space in page
, without touching the rest.
This is not a big deal, because Wikipedia generates a 301 Moved Permanently for the spaced URL, but the code should probably be corrected to page.replace(/_/g, ' ')
, for neatness and efficiency. --Piet Delport 01:42, 5 July 2007 (UTC)
page.replace(/ /g, '_')
(or page.replace(/\s/g, '_')
). GracenotesT § 04:13, 5 July 2007 (UTC)
Has anyone ever thought about using a JavaScript framework (ex. jQuery) to make it easer for people to create plugins for MediaWiki? It would also make this page allot nicer and easer to read. — 12.65.6.217 22:19, 7 July 2007 (UTC)
Another sudden addition to global JS file… please please stop doing that. I'm starting to feel that some pages need to be protected from admins. How secure is it to have the code executed from someone's toolserver account? As far as I understand, there is no even "edit history" there. Also, will toolserver handle the load? And even after looking, I can't find where this was discussed ∴ Alex Smotrov 05:31, 14 July 2007 (UTC)
wgCanonicalSpecialPageName
instead of wgPageName
to allow the code to be the same everywhere (since I assume no amount of bitching will result in there actually being a discussion about this). Mike Dillon 14:55, 14 July 2007 (UTC)Hope this doesn't break the toolserver, Brion did a study once showing the average user views about two pages per CSS reload. —Ruud 16:02, 14 July 2007 (UTC)
Looks like this was causing the watchlist page load to take a really long time for at least one user. See WP:VPT#watchlist and tools.wikimedia.de. Mike Dillon 18:12, 14 July 2007 (UTC)
I trust Gmaxwell's programming skillz and Kat's judgment, but as the change may be causing difficulties (folks on IRC are confirming that those difficulties left when I rv'd). And I'm (personally) not a fan of the garish meetup notice, but that's ultimately not my decision, of course - just wondering if it was discussed anywhere. --Jeffrey O. Gustafson - Shazaam! - <*> 19:45, 14 July 2007 (UTC)
Why was this change reverted? I do not see any concrete explanation for the change in the above text. I checked on IRC and no one is complaining about anything there. As far as garish notices go, the notice is only displayed to users which geolocate to a region along the eastern US, and the notice can easily be dismissed with a single click. I have a native mediawiki implementation... but wouldn't you agree that it would be useful to test the usefulness of a feature before making it a permanent part of the site and codebase? I am not sure of the value of this feature, which is exactly why I put in a partial implementation before outright forcing it on you.
Speaking as root on toolserver, there is no load issue there. The notice is only resulting in about 10,000 pageviews per day.
I'd be very interested in knowing how this caused a problem for anyone: The external page isn't loaded until the watchlist is loaded, and I tested it with toolserver blackholed with no impact in load time.
Pardon my irritation and disgust but I consider this to be an example of how English Wikipedia is socially ill: Most any movement away from the status-quo is reverted, based not on fact, but instead on pure conjecture and an apparent infantile response to authority which happens here most of the time when any change hasn't been personally approved by any of hundreds of people of have the access needed to revert it. Consensus doesn't mean "I must personally approve every change", and anyone who thinks otherwise is a harm to our community. I have to say that, as a developer, the English Wikipedia community is by far the least satisfying to work with of all the Wikimedia communities. Your needlessly confrontational responses to all concerns makes me feel like I'm wasting my time doing anything to help.--Gmaxwell 00:54, 15 July 2007 (UTC)
So, we've now had hours of discussion... and no one has brought up any concrete examples of problems. Would some third party be interested in restoring my faith in English Wikipedia by restoring the code so that I can continue to learn useful things about its performance? Thanks. --Gmaxwell 06:38, 15 July 2007 (UTC)
Has anyone considered how freaked out some users might get if they see a box on their watchlist saying "come to the meetup in Washington DC blah blah blah" and they have no idea how Wikipedia knows where they live? Does the notice explain how this is being done? --- RockMFR 08:43, 15 July 2007 (UTC)
Reverted; see my summary (in the history [1]) for more information. Cbrown1023 talk 17:51, 15 July 2007 (UTC)
So I suppose I should leave a comment, since I added it in the first place. I note that this wasn't a "foundation insider" action or anything, just a normal action on behalf of a legit user since the page is only editable by admins.
I don't see anything wrong with the feature. (OK, actually, I think it's a cool idea, and I mentioned it at the meetup I was at yesterday -- the sort of audience to which it is targeted -- and they thought it was pretty cool also.) There's no privacy issues beyond normal operation: no one is able to associate a user with an IP from it; I suppose you do have to trust that toolserver is not evil (as you do with anything on toolserver), but toolserver is administered by people who are all personally known to WMF and trusted not to abuse that access, in the same way that core WMF server admins are.
I also admit that I think we need a cultural shift toward people being more accepting of just trying things and seeing what happens. (Especially changes that only affect users who are already active and informed, like something that only appears on a watchlist.) I kind of miss the project I joined several years ago, which was somewhat more open to that.
I haven't heard reports of anyone having issues with it from people whose user .js isn't borked... it's probably useful for those people to find out that they need to fix their user .js! Toolserver load is not significant.
And I do see a benefit to the users who see it. Certainly it looks like it had an effect on the page it was tested on. It's hard to target users who might be in a particular area, who don't think to list themselves in a category or who don't watch the meetup page; I think with the recent discussions about more local chapters and what the right regions are for those, this could have a good effect on letting people know what's out there off the wiki and getting people involved in local initiatives.
So I don't have any interest in getting into a huge war over this; it's not a pastime I enjoy. But I think it's a really cool feature with a lot of potential, and I am disappointed at the response here being as negative as it is when I've seen almost no negative response from the people targeted by the notices. Kat Walsh (spill your mind?) 18:09, 15 July 2007 (UTC)
Smotrov 15:21, 16 July 2007 (UTC)
if (!document.cookie.match('hidedcn=1')){
insertsub=document.getElementById("contentSub")
insertsub.innerHTML = insertsub.innerHTML +
'<div class="plainlinks" id="WN_DCN" style="width:98%; margin:5px auto 0; background:transparent; text-align:right;"><font size="+1" color="#000000">The next <a href="http://en.wikipedia.orghttps://demo.azizisearch.com/lite/wikipedia/page/Wikipedia:Meetup/DC_2">Washington DC meetup</a> is Saturday the 21st.<br/></font><i>You\'re invited! [<a href="#" onClick="var date = new Date(); date.setTime(date.getTime()+86400000);document.cookie = \'hidedcn=1; expires=\' + date.toGMTString() + \'; path=/\';document.getElementById(\'WN_DCN\').style.visibility = \'hidden\';return false">hide</a>]</i></div>'
}
The "Technical restrictions" title fix can be removed due to the new magicword {{DISPLAYTITLE:correct page name}}
. It functions exactly the same as the "Technical restrictions" title fix does (it only displays as long as the displayed title is a valid link to that page). We need a bot to update all the pages to use this instead of the js class and then we can remove it from here. 81.34.54.162 18:24, 17 July 2007 (UTC)
{{DISPLAYTITLE:{{{1}}}}}
into the relevant templates. Mike Dillon 20:21, 17 July 2007 (UTC){{DISPLAYTITLE:}}
∴ Alex Smotrov 16:20, 18 July 2007 (UTC)
Perhaps we should create MediaWiki:Administrator.js which can contain various scripts only useful for admins, which is then loaded from here only if the user has the sysop flag set in wgUserGroups. THat would allow us to add features less or not useful for normal readers and editors without burdening them interface or bandwidth-wise. —Ruud 10:21, 28 May 2007 (UTC)
I went ahead and implemented this, the file is at MediaWiki:Sysop.js. ^demon[omg plz] 15:13, 24 July 2007 (UTC)
if("sysop" in wgUserGroups)
really work&ctype=text/javascript
is not required … && !window.disableSysopJS
)for ( var g in wgUserGroups ) if ( wgUserGroups[g] == "sysop" && !window.disableSysopJS ) importScript( "MediaWiki:Sysop.js" );
var wgUserGroups = null
and all 3 browsers report Javascript error. This needs to be fixed asap.if (wgUserGroups)
in the beginning to speed it up for anons a little ∴ Alex Smotrov 17:15, 24 July 2007 (UTC)javascript:alert("user" in wgUserGroups)
(in browser address field) shows false in all browsers I tried. if (wgUserGroups && (wgUserGroups[0] == "sysop" ) && !window.disableSysopJS)
. Advantages: most simple and efficient; works right now; if it stops working, people who notice will be able to fix it :) ∴ Alex Smotrov 03:49, 25 July 2007 (UTC)wgUserGroups.join(' ').indexOf('sysop')
. --Splarka (rant) 07:16, 25 July 2007 (UTC){{editprotected}}
I found the instructions that all changes to Common.js must be discussed on the Village Pump, so I have moved this request there. All discussion should take place there. ←BenB4 01:35, 25 July 2007 (UTC)