}
function getHeadScripts() {
- $r = "
-<SCRIPT TYPE=\"text/javascript\">
-function toggleVisibility( _levelId, _otherId, _linkId) {
- var thisLevel = document.getElementById( _levelId );
- var otherLevel = document.getElementById( _otherId );
- var linkLevel = document.getElementById( _linkId );
- if ( thisLevel.style.display == 'none' ) {
- thisLevel.style.display = 'block';
- otherLevel.style.display = 'none';
- linkLevel.style.display = 'inline';
- } else {
- thisLevel.style.display = 'none';
- otherLevel.style.display = 'inline';
- linkLevel.style.display = 'none';
- }
- }
-</SCRIPT>
- " ;
+ global $wgStyleSheetPath;
+ $r = "<script type=\"text/javascript\" src=\"{$wgStyleSheetPath}/wikibits.js\"></script>\n";
return $r;
}
$ltz = wfMsg( "localtime" );
$tzt = wfMsg( "timezonetext" );
$tzo = wfMsg( "timezoneoffset" );
+ $tzGuess = wfMsg( "guesstimezone" );
+ $tzServerTime = wfMsg( "servertime" );
$yem = wfMsg( "youremail" );
$emf = wfMsg( "emailflag" );
$ynn = wfMsg( "yournick" );
$scc = wfMsg( "contextchars" );
$rcc = wfMsg( "recentchangescount" );
- $wgOut->addHTML( "<form id=\"preferences\" action=\"$action\"
+ $wgOut->addHTML( "<form id=\"preferences\" name=\"preferences\" action=\"$action\"
method=\"post\"><table border=\"1\"><tr><td valign=top nowrap><b>$qb:</b><br>\n" );
# Quickbar setting
# Textbox rows, cols
#
+ $nowlocal = $wgLang->time( $now = wfTimestampNow(), true );
+ $nowserver = $wgLang->time( $now, false );
$wgOut->addHTML( "<td valign=top nowrap><b>$tbs:</b><br>
$tbr: <input type=text name=\"wpRows\" value=\"{$wpRows}\" size=6><br>
$tbc: <input type=text name=\"wpCols\" value=\"{$wpCols}\" size=6><br><br>
-<b>$ltz</b><br>
-$tzo*: <input type=text name=\"wpHourDiff\" value=\"{$wpHourDiff}\" size=6>
+<b>$tzServerTime:</b> $nowserver<br />
+<b>$ltz:</b> $nowlocal<br />
+$tzo*: <input type=text name=\"wpHourDiff\" value=\"{$wpHourDiff}\" size=6><br />
+<input type=\"button\" value=\"$tzGuess\" onClick=\"javascript:guessTimezone()\" />
</td>" );
# Email, etc.
"cols" => 80, "rows" => 25, "searchlimit" => 20,
"contextlines" => 5, "contextchars" => 50,
"skin" => 0, "math" => 1, "rcdays" => 7, "rclimit" => 50,
- "highlightbroken" => 1, "stubthreshold" => 0
+ "highlightbroken" => 1, "stubthreshold" => 0,
+ "previewontop" => 1
);
/* private */ $wgQuickbarSettingsEn = array(
"editondblclick" => "Edit pages on double click (JavaScript)",
"watchdefault" => "Watch new and modified articles",
"minordefault" => "Mark all edits minor by default",
- "previewontop" => "Show preview before edit box and not after it"
+ "previewontop" => "Show preview before edit box and not after it",
+ "nocache" => "Disable page caching"
);
/* private */ $wgBookstoreListEn = array(
"savedprefs" => "Your preferences have been saved.",
"timezonetext" => "Enter number of hours your local time differs
from server time (UTC).",
-"localtime" => "Local time",
+"localtime" => "Local time display",
"timezoneoffset" => "Offset",
+"servertime" => "Server time is now",
+"guesstimezone" => "Fill in from browser",
"emailflag" => "Disable e-mail from other users",
# Recent changes
document.write( junk[0] + "UTC" + tzString + junk[1] );
}
}
+
+// in [-][H]H format...
+// won't yet work with non-even tzs
+function fetchTimezone() {
+ var localclock = new Date();
+ // returns negative offset from GMT in minutes
+ var tzRaw = localclock.getTimezoneOffset();
+ var tzHour = Math.floor( Math.abs(tzRaw) / 60);
+ var tzString = ((tzRaw >= 0) ? "-" : "") + ((tzHour < 10) ? "" : "0") + tzHour;
+ return tzString;
+}
+
+function guessTimezone(box) {
+ document.preferences.wpHourDiff.value = fetchTimezone();
+}