1) Stylesheet changes:
authorErik Moeller <erik@users.mediawiki.org>
Mon, 21 Jul 2003 07:36:52 +0000 (07:36 +0000)
committerErik Moeller <erik@users.mediawiki.org>
Mon, 21 Jul 2003 07:36:52 +0000 (07:36 +0000)
   - smaller headlines in standard skin
   - slightly smaller font for menu links
   - headlines have thin gray underline
   - thinner borders
   - footer in blue box
2) Skin changes:
   - changed default color for non-article pages
   - removed "Special pages" dropdown -- takes space,
     causes display bugs and is hardly used
3) Preferences:
   - put all checkbox prefs in a table so they are
     properly aligned
4) Section editing:
   - new option for editing sections by right clicking
     titles (onContextMenu); works in Mozilla & IE
   - new functionality for appending text to pages, currently
     displayed only for Talk pages as "Post a comment"
     (summary field becomes comment subject)

includes/Article.php
includes/OutputPage.php
includes/Skin.php
includes/SkinStandard.php
includes/SpecialPreferences.php
languages/Language.php
stylesheets/wikistandard.css

index c7dfdce..e7819ef 100644 (file)
@@ -78,6 +78,7 @@ class Article {
                        else {                          
                                if($action=="edit") {
                                        if($section!="") {
+                                               if($section=="new") { return ""; }
 
                                                $secs=preg_split("/(^=+.*?=+|^<h[1-6].*?>.*?<\/h[1-6].*?>)/mi",
                                                 $this->mContent, -1,
@@ -467,7 +468,13 @@ class Article {
                        $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();
@@ -504,6 +511,7 @@ class Article {
                $action = wfEscapeHTML( wfLocalUrl( $wgTitle->getPrefixedURL(), $q ) );
 
                $summary = wfMsg( "summary" );          
+               $subject = wfMsg("subject");
                $minor = wfMsg( "minoredit" );
                $watchthis = wfMsg ("watchthis");
                $save = wfMsg( "savearticle" );
@@ -555,16 +563,27 @@ class Article {
                        }
                        $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\">
@@ -654,12 +673,18 @@ name=\"wpSummary\" maxlength=200 size=60><br>
 
                // 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; }          
index 1b1f105..e96860e 100644 (file)
@@ -1350,13 +1350,31 @@ return $r ;
                $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];
@@ -1412,6 +1430,9 @@ return $r ;
                         .$headline
                         ."</a>"
                         ."</H".$level.">";
+                       if($esr && !isset($wpPreview)) {
+                               $head[$c]=$sk->editSectionScript($c+1,$head[$c]);       
+                       }
                        $numbering="";
                        $c++;
                        $dot=0;
@@ -1430,11 +1451,14 @@ return $r ;
 
 
                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;
                        }
 
index cf4a492..9164caa 100644 (file)
@@ -119,7 +119,7 @@ class Skin {
                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")
@@ -499,7 +499,8 @@ class Skin {
                        $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;
        }
@@ -591,9 +592,10 @@ class Skin {
                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()
@@ -607,16 +609,14 @@ class Skin {
                }
                // 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");
@@ -659,6 +659,11 @@ class Skin {
                        
                        }
                        
+
+                       if( $tns%2 && $action!="edit" && !$wpPreview) {
+                               $s.="<br>".$this->makeKnownLink($wgTitle->getPrefixedText(),wfMsg("postcomment"),"action=edit&section=new");
+                       }
+
                        /*
                        watching could cause problems in edit mode:
                        if user edits article, then loads "watch this article" in background and then saves
@@ -699,7 +704,7 @@ class Skin {
                                        }
                                }
                        }
-                       $s .= "\n<hr>";
+                       $s .= "\n<br><hr class='sep'>";
                } 
                
                if ( 0 != $wgUser->getID() ) {
@@ -708,7 +713,7 @@ class Skin {
                $s .= $this->specialLink( "specialpages" )
                  . $sep . $this->bugReportsLink();
 
-               $s .= "\n</div>\n";
+               $s .= "\n<br></div>\n";
                wfProfileOut();
                return $s;
        }
@@ -1723,19 +1728,28 @@ class Skin {
        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&section=$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="&section={$section}";         
+               $editurl="&section={$section}";
                $url=$this->makeKnownLink($wgTitle->getPrefixedText(),wfMsg("editsection"),"action=edit".$editurl);
                return "<div style=\"float:right;margin-left:5px;\"><small>[".$url."]</small></div>";
 
index ee309d4..6f788b8 100644 (file)
@@ -40,7 +40,7 @@ class SkinStandard extends Skin {
                          "#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;
index 0712d5a..778ad29 100644 (file)
@@ -292,16 +292,17 @@ value=\"$i\"$checked> {$skins[$i]}</label><br>\n" );
        } 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
        #
index 2595d0c..16f4d73 100644 (file)
@@ -25,7 +25,7 @@
        "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
 );
 
@@ -61,11 +61,12 @@ this</a> (alternative: like this<a href=\"\" class=\"internal\">?</a>).",
        "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",
@@ -339,6 +340,7 @@ this</a> (alternative: like this<a href=\"\" class=\"internal\">?</a>).",
 "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",
@@ -493,6 +495,7 @@ Please log in again after you receive it.",
 # Edit pages
 #
 "summary"              => "Summary",
+"subject"              => "Subject/headline",
 "minoredit"            => "This is a minor edit",
 "watchthis"            => "Watch this article",
 "savearticle"  => "Save page",
@@ -517,6 +520,7 @@ If you are here by mistake, just click your browser's '''back''' button.",
 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.
@@ -703,7 +707,7 @@ See also the [http://meta.wikipedia.org/wiki/Special:Recentchanges recent meta d
 "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=\"" .
@@ -840,9 +844,9 @@ That comes to <b>$5</b> average edits per page, and <b>$6</b> views per edit.",
 "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\")",
index 5b6cc04..1ebdf85 100644 (file)
@@ -1,13 +1,13 @@
 #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; }
@@ -15,14 +15,16 @@ a.stub { color:#772233; text-decoration:none; }
 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; }