else {
if($action=="edit") {
if($section!="") {
+ if($section=="new") { return ""; }
$secs=preg_split("/(^=+.*?=+|^<h[1-6].*?>.*?<\/h[1-6].*?>)/mi",
$this->mContent, -1,
$s = str_replace( "$1", $wgTitle->getPrefixedText(),
wfMsg( "editing" ) );
- if($section!="") { $s.=wfMsg("sectionedit");}
+ if($section!="") {
+ if($section=="new") {
+ $s.=wfMsg("commentedit");
+ } else {
+ $s.=wfMsg("sectionedit");
+ }
+ }
$wgOut->setPageTitle( $s );
if ( $oldid ) {
$this->setOldSubtitle();
$action = wfEscapeHTML( wfLocalUrl( $wgTitle->getPrefixedURL(), $q ) );
$summary = wfMsg( "summary" );
+ $subject = wfMsg("subject");
$minor = wfMsg( "minoredit" );
$watchthis = wfMsg ("watchthis");
$save = wfMsg( "savearticle" );
}
$wgOut->addHTML( "<br clear=\"all\" />\n" );
}
+
+ # if this is a comment, show a subject line at the top, which is also the edit summary.
+ # Otherwise, show a summary field at the bottom
+ if($section=="new") {
+
+ $commentsubject="{$subject}: <input tabindex=1 type=text value=\"{$wpSummary}\" name=\"wpSummary\" maxlength=200 size=60><br>";
+ } else {
+
+ $editsummary="{$summary}: <input tabindex=3 type=text value=\"{$wpSummary}\" name=\"wpSummary\" maxlength=200 size=60><br>";
+ }
+
$wgOut->addHTML( "
<form id=\"editform\" name=\"editform\" method=\"post\" action=\"$action\"
enctype=\"application/x-www-form-urlencoded\">
-<textarea tabindex=1 name=\"wpTextbox1\" rows={$rows}
+{$commentsubject}
+<textarea tabindex=2 name=\"wpTextbox1\" rows={$rows}
cols={$cols}{$ew} wrap=\"virtual\">" .
$wgLang->recodeForEdit( $wpTextbox1 ) .
"
-</textarea><br>
-{$summary}: <input tabindex=2 type=text value=\"{$wpSummary}\"
-name=\"wpSummary\" maxlength=200 size=60><br>
+</textarea>
+<br>{$editsummary}
{$checkboxhtml}
<input tabindex=5 type=submit value=\"{$save}\" name=\"wpSave\">
<input tabindex=6 type=submit value=\"{$prev}\" name=\"wpPreview\">
// insert updated section into old text if we have only edited part
// of the article
- if ($section != "") {
+ if ($section != "") {
$oldtext=$this->getContent();
- $secs=preg_split("/(^=+.*?=+|^<h[1-6].*?>.*?<\/h[1-6].*?>)/mi",$oldtext,-1,PREG_SPLIT_DELIM_CAPTURE);
- $secs[$section*2]=$text."\n\n"; // replace with edited
- if($section) { $secs[$section*2-1]=""; } // erase old headline
- $text=join("",$secs);
+ if($section=="new") {
+ if($summary) $summary="== {$summary} ==\n\n";
+ $text=$oldtext."\n\n".$summary.$text;
+ } else {
+ $secs=preg_split("/(^=+.*?=+|^<h[1-6].*?>.*?<\/h[1-6].*?>)/mi",
+ $oldtext,-1,PREG_SPLIT_DELIM_CAPTURE);
+ $secs[$section*2]=$text."\n\n"; // replace with edited
+ if($section) { $secs[$section*2-1]=""; } // erase old headline
+ $text=join("",$secs);
+ }
}
if ( $this->mMinorEdit ) { $me1 = 1; } else { $me1 = 0; }
if ( $minor ) { $me2 = 1; } else { $me2 = 0; }
$nh=$wgUser->getOption( "numberheadings" );
$st=$wgUser->getOption( "showtoc" );
$es=$wgUser->getID() && $wgUser->getOption( "editsection" );
+ $esr=$wgUser->getID() && $wgUser->getOption( "editsectiononrightclick" );
+
+ # if the string __NOTOC__ (not case-sensitive) occurs in the HTML, do not
+ # add TOC
+ if($st && preg_match("/__NOTOC__/i",$text)) {
+ $text=preg_replace("/__NOTOC__/i","",$text);
+ $st=0;
+ }
+
+ # never add the TOC to the Main Page. This is an entry page that should not
+ # be more than 1-2 screens large anyway
if($wgTitle->getPrefixedText()==wfMsg("mainpage")) {$st=0;}
+ # We need this to perform operations on the HTML
$sk=$wgUser->getSkin();
- preg_match_all("/<H([1-6])(.*?>)(.*?)<\/H[1-6]>/i",$text,$matches);
+ # Get all headlines for numbering them and adding funky stuff like [edit]
+ # links
+ preg_match_all("/<H([1-6])(.*?>)(.*?)<\/H[1-6]>/i",$text,$matches);
+
+ # headline counter
$c=0;
+ # Ugh .. the TOC should have neat indentation levels which can be
+ # passed to the skin functions. These are determined here
foreach($matches[3] as $headline) {
if($level) { $prevlevel=$level;}
$level=$matches[1][$c];
.$headline
."</a>"
."</H".$level.">";
+ if($esr && !isset($wpPreview)) {
+ $head[$c]=$sk->editSectionScript($c+1,$head[$c]);
+ }
$numbering="";
$c++;
$dot=0;
foreach($blocks as $block) {
- if($es && !isset($wpPreview) && $c>0 && $i==0) {
+ if(($es || $esr) && !isset($wpPreview) && $c>0 && $i==0) {
+ # This is the [edit] link that appears for the top block of text when
+ # section editing is enabled
$full.=$sk->editSectionLink(0);
}
$full.=$block;
if($st && $toclines>3 && !$i) {
+ # Let's add a top anchor just in case we want to link to the top of the page
$full="<a name=\"top\"></a>".$full.$toc;
}
global $wgUser, $wgTitle, $wgNamespaceBackgrounds, $wgOut, $oldid, $redirect, $diff,$action;
if ( 0 != $wgTitle->getNamespace() ) {
- $a = array( "bgcolor" => "#FFFFDD" );
+ $a = array( "bgcolor" => "#f7f7ff" );
}
else $a = array( "bgcolor" => "#FFFFFF" );
if($wgOut->isArticle() && $wgUser->getOption("editondblclick")
$s .= $sep . $this->editThisPage()
. $sep . $this->historyLink();
}
- $s .= $sep . $this->specialPagesList();
+ # Many people don't like this dropdown box
+ #$s .= $sep . $this->specialPagesList();
return $s;
}
global $wgOut, $wgTitle, $wgUser, $action, $wgLang;
global $wpPreview;
wfProfileIn( "Skin::quickBar" );
+ $tns=$wgTitle->getNamespace();
$s = "\n<div id='quickbar'>";
- $s .= "\n" . $this->logoText() . "\n<hr>";
+ $s .= "\n" . $this->logoText() . "\n<hr class='sep'>";
$sep = "\n<br>";
$s .= $this->mainPageLink()
}
// only show watchlist link if logged in
if ( wfMsg ( "currentevents" ) != "-" ) $s .= $sep . $this->makeKnownLink( wfMsg( "currentevents" ), "" ) ;
- $s .= "\n<hr>";
+ $s .= "\n<br><hr class='sep'>";
$articleExists = $wgTitle->getArticleId();
if ( $wgOut->isArticle() || $action =="edit" || $action =="history" || $wpPreview) {
if($wgOut->isArticle()) {
$s .= "<strong>" . $this->editThisPage() . "</strong>";
} else { # backlink to the article in edit or history mode
-
if($articleExists){ # no backlink if no article
- $tns=$wgTitle->getNamespace();
switch($tns) {
case 0:
$text = wfMsg("articlepage");
}
+
+ if( $tns%2 && $action!="edit" && !$wpPreview) {
+ $s.="<br>".$this->makeKnownLink($wgTitle->getPrefixedText(),wfMsg("postcomment"),"action=edit§ion=new");
+ }
+
/*
watching could cause problems in edit mode:
if user edits article, then loads "watch this article" in background and then saves
}
}
}
- $s .= "\n<hr>";
+ $s .= "\n<br><hr class='sep'>";
}
if ( 0 != $wgUser->getID() ) {
$s .= $this->specialLink( "specialpages" )
. $sep . $this->bugReportsLink();
- $s .= "\n</div>\n";
+ $s .= "\n<br></div>\n";
wfProfileOut();
return $s;
}
function tocTable($toc) {
// note to CSS fanatics: putting this in a div does not works -- div won't auto-expand
return
- "<table border=\"0\" align=\"center\" id=\"toc\"><tr><td align=\"center\">\n".
+ "<p><table border=\"0\" id=\"toc\"><tr><td align=\"center\">\n".
"<b>".wfMsg("toc")."</b>" .
" <script type='text/javascript'>showTocToggle(\"" . wfMsg("showtoc") . "\",\"" . wfMsg("hidetoc") . "\")</script>" .
"</td></tr><tr id='tocinside'><td align=\"left\">\n".
$toc."</td></tr></table><P>\n";
}
+ function editSectionScript($section,$head) {
+
+ global $wgTitle,$wgUser,$oldid;
+ if($wgTitle->isProtected() && !$wgUser->isSysop()) return $head;
+ if($oldid) return $head;
+ $url = wfLocalUrlE($wgTitle->getPrefixedText(),"action=edit§ion=$section");
+ return "<span onContextMenu='document.location=\"".$url."\";return false;'>{$head}</span>";
+ }
+
function editSectionLink($section) {
global $wgTitle,$wgUser,$oldid;
if($wgTitle->isProtected() && !$wgUser->isSysop()) return "";
if($oldid) return "";
- $editurl="§ion={$section}";
+ $editurl="§ion={$section}";
$url=$this->makeKnownLink($wgTitle->getPrefixedText(),wfMsg("editsection"),"action=edit".$editurl);
return "<div style=\"float:right;margin-left:5px;\"><small>[".$url."]</small></div>";
"#article { margin-left: 4px; margin-right: 152px; }\n";
} else if ( 1 == $qb || 3 == $qb ) {
$s .= "#quickbar { position: absolute; top: 4px; left: 4px; " .
- "border-right: 2px solid #000000; }\n" .
+ "border-right: 1px solid gray; }\n" .
"#article { margin-left: 152px; margin-right: 4px; }\n";
}
return $s;
} else {
$wgOut->addHTML( "</td><td rowspan=2 valign=top nowrap>\n" );
}
+ $wgOut->addHTML("<table border=0>");
foreach ( $togs as $tname => $ttext ) {
if ( 1 == $wgUser->getOption( $tname ) ) {
$checked = " checked";
} else {
$checked = "";
- }
- $wgOut->addHTML( "<label><input type=checkbox value=\"1\" "
- . "name=\"wpOp$tname\"$checked>$ttext</label><br>\n" );
+ }
+ $wgOut->addHTML( "<tr valign=\"top\"><td><input type=checkbox value=\"1\" "
+ . "id=\"$tname\" name=\"wpOp$tname\"$checked></td><td><label for=\"$tname\">$ttext</label></td></tr>\n" );
}
- $wgOut->addHTML( "</td>" );
+ $wgOut->addHTML( "</table></td>" );
# Math setting
#
"contextlines" => 5, "contextchars" => 50,
"skin" => 0, "math" => 1, "rcdays" => 7, "rclimit" => 50,
"highlightbroken" => 1, "stubthreshold" => 0,
- "previewontop" => 1, "editsection"=>1, "showtoc"=>1,
+ "previewontop" => 1, "editsection"=>1,"editsectiononrightclick"=>0, "showtoc"=>1,
"date" => 0
);
"hideminor" => "Hide minor edits in recent changes",
"usenewrc" => "Enhanced recent changes (not for all browsers)",
"numberheadings" => "Auto-number headings",
- "editsection"=>"Show links for editing individual sections",
- "showtoc"=>"Show table of contents for articles with more than 3 headings",
+ "editondblclick" => "Edit pages on double click (JavaScript)",
+ "editsection"=>"Enable section editing via [edit] links",
+ "editsectiononrightclick"=>"Enable section editing by right clicking<br> on section titles (JavaScript)",
+ "showtoc"=>"Show table of contents<br>(for articles with more than 3 headings)",
"rememberpassword" => "Remember password across sessions",
"editwidth" => "Edit box has full width",
- "editondblclick" => "Edit pages on double click (JavaScript)",
"watchdefault" => "Add pages you edit to your watchlist",
"minordefault" => "Mark all edits minor by default",
"previewontop" => "Show preview before edit box and not after it",
"unprotectthispage" => "Unprotect this page",
"newpage" => "New page",
"talkpage" => "Discuss this page",
+"postcomment" => "Post a comment",
"articlepage" => "View article",
"subjectpage" => "View subject", # For compatibility
"userpage" => "View user page",
# Edit pages
#
"summary" => "Summary",
+"subject" => "Subject/headline",
"minoredit" => "This is a minor edit",
"watchthis" => "Watch this article",
"savearticle" => "Save page",
text editing area as it will appear if you choose to save.",
"editing" => "Editing $1",
"sectionedit" => " (section)",
+"commentedit" => " (comment)",
"editconflict" => "Edit conflict: $1",
"explainconflict" => "Someone else has changed this page since you
started editing it.
"uploadnologintext" => "You must be <a href=\"" .
wfLocalUrl( "Special:Userlogin" ) . "\">logged in</a>
to upload files.",
-"uploadfile" => "Upload file",
+"uploadfile" => "Upload images, sounds, documents etc.",
"uploaderror" => "Upload error",
"uploadtext" => "<strong>STOP!</strong> Before you upload here,
make sure to read and follow Wikipedia's <a href=\"" .
"longpages" => "Long pages",
"listusers" => "User list",
"specialpages" => "Special pages",
-"spheading" => "Special pages",
-"sysopspheading" => "Special pages for sysop use",
-"developerspheading" => "Special pages for developer use",
+"spheading" => "Special pages for all users",
+"sysopspheading" => "For sysop use only",
+"developerspheading" => "For developer use only",
"protectpage" => "Protect page",
"recentchangeslinked" => "Related changes",
"rclsub" => "(to pages linked from \"$1\")",
#article { padding: 4px; }
#content { margin: 0; padding: 0; }
-#footer { padding: 4px; }
+#footer { padding: 4px;font-size:95%; }
#pagestats { font-size: 9pt; }
#powersearch {
background: #DDEEFF; border-style: solid; border-width: 1px; padding: 2px;
}
-#quickbar { width: 140px; padding: 4px; visibility: visible; z-index: 99; }
-#topbar { padding: 4px; }
-#toc { border:1px solid #8888aa; background-color:#f3f3ff;padding:5px;font-size:90%; }
+#quickbar { width: 140px; padding: 4px; visibility: visible; z-index:99;font-size:95%;}
+#topbar { padding: 4px;font-size:95%; }
+#toc { border:1px solid #8888aa; background-color:#f7f8ff;padding:5px;font-size:95%; }
.bodytext { }
a.interwiki, a.external { color: #3366BB; }
a.printable { text-decoration: underline; }
a.stub { color:#772233; text-decoration:none; }
body { margin: 0px; padding: 4px; }
form.inline { display: inline; }
-h1.pagetitle { padding-top: 0; margin-top: 0; padding-bottom: 0; margin-bottom: 0; }
-h2 { font-size: 125%; }
-h2, h3, h4, h5, h6 { margin-bottom: 0; }
-h3 { font-size: 112.5%; }
-h4 { font-size: 106.25%; }
-h5 { font-size: 103.125%; }
-h6 { font-size: 100%; }
+h1.pagetitle { padding-top: 0; margin-top: 0; padding-bottom: 0; margin-bottom: 0;
+font-size:125%; }
+h2 { font-size: 112.5%; }
+h2, h3, h4, h5, h6 { margin-bottom: 0;border-bottom:1px dotted #dddddd; }
+h3 { font-size: 106.25%; }
+h4 { font-size: 103.125%; }
+h5 { font-size: 100%; }
+h6 { font-size: 95%; }
+hr.sep { color:gray;height:1px;background-color:gray;}
p.subpages { font-size:small;}
-p.subtitle { padding-top: 0; margin-top: 0; }
-td.bottom { border-top: 2px solid #000000; }
-td.top { border-bottom: 2px solid #000000; }
+p.subtitle { padding-top: 0; margin-top: 0;}
+td.bottom { border: 1px solid gray;background-color:#f4f4ff; }
+td.top { border-bottom: 1px solid gray; }