Last modified: 2008-04-13 18:31:56 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T15731, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 13731 - MediaWiki:Common.js not loaded for anonymous users
MediaWiki:Common.js not loaded for anonymous users
Status: RESOLVED WORKSFORME
Product: Wikimedia
Classification: Unclassified
Site requests (Other open bugs)
unspecified
All All
: Normal normal (vote)
: ---
Assigned To: Nobody - You can work on this!
http://vo.wikibooks.org
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2008-04-13 18:25 UTC by Malafaya
Modified: 2008-04-13 18:31 UTC (History)
1 user (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Malafaya 2008-04-13 18:25:39 UTC
I have been trying to force preview for anonymous users in vo.wikibooks. Despite the fact that the piece of code inserted into Common.js works fine in the vo.wikipedia, it was not working in vo.wikibooks. After some tests, I realized the inserted function gets executed when a user is logged in. Although, for IPs, the function doesn't get executed (tested by forcing button caption change on function entry which didn't have any effect when not logged in). This led me to believe Common.js is not being loaded for unregistered users.
Comment 1 Malafaya 2008-04-13 18:28:42 UTC
A user at #wikimedia-tech mentioned MediaWiki:Common.js not being loaded for anons but then esporadically it seemed to load.

As a side note, it may be relevant to mention that the MediaWiki namespace is called Sitanuns in vo.wb.
Comment 2 Aryeh Gregor (not reading bugmail, please e-mail directly) 2008-04-13 18:31:56 UTC
Looking at the page source, not logged in, I see this line:

<script type="text/javascript" src="/w/index.php?title=-&amp;action=raw&amp;gen=js&amp;useskin=monobook"><!-- site js --></script>

Following the URL, I find this content:

---------------------------------------------------------------------

/* generated javascript */
var skin = 'monobook';
var stylepath = '/skins-1.5';

/* MediaWiki:Common.js */
/* El JavaScript isik alseimik pogebon pro gebans valik pö padilogam valik. */

/** Müt büologeda ***********************************************************************
 *  Bepenam: müton gebanis no peregistarölis ad logedön padalogoti labü redakots onsik bü dakip.
 ********************************************************************************************/

// Müton eli IP ad büologön votükamis bü dakip onsik.
// Copyright Marc Mongenet, 2006
function forcePreview()
{
  if (wgUserName != null || wgAction != "edit") return;
  saveButton = document.getElementById("wpSave");
  if (!saveButton) return;
  saveButton.disabled = true;
  saveButton.style.fontWeight = "normal";
  document.getElementById("wpPreview").style.fontWeight = "bold";
}

addOnloadHook(forcePreview);

/* MediaWiki:Monobook.js (deprecated; migrate to Common.js!) */
/* Deprecated; use [[MediaWiki:common.js]] */

---------------------------------------------------------------------

Which is exactly as expected.  Firebug shows that the script is loaded.  Moreover, when I attempt to edit a page, the "Save page" button is grayed out, as expected.  WORKSFORME.  Make sure JavaScript is enabled in your browser, and that caches are cleared.

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links