From: Erik Moeller Date: Mon, 21 Jul 2003 07:36:52 +0000 (+0000) Subject: 1) Stylesheet changes: X-Git-Tag: 1.1.0~381 X-Git-Url: http://git.cyclocoop.org/%22%20.%20generer_url_ecrire%28%22auteur_infos%22%2C%20%22id_auteur=%24id%22%29%20.%20%22?a=commitdiff_plain;h=98c8698ddb5eba93143f0c74b35591cbd476ee0c;p=lhc%2Fweb%2Fwiklou.git 1) Stylesheet changes: - 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) --- diff --git a/includes/Article.php b/includes/Article.php index c7dfdce5f1..e7819ef409 100644 --- a/includes/Article.php +++ b/includes/Article.php @@ -78,6 +78,7 @@ class Article { else { if($action=="edit") { if($section!="") { + if($section=="new") { return ""; } $secs=preg_split("/(^=+.*?=+|^.*?<\/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( "
\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}:
"; + } else { + + $editsummary="{$summary}:
"; + } + $wgOut->addHTML( "
-
-{$summary}:
+ +
{$editsummary} {$checkboxhtml} @@ -654,12 +673,18 @@ name=\"wpSummary\" maxlength=200 size=60>
// 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].*?>)/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].*?>)/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; } diff --git a/includes/OutputPage.php b/includes/OutputPage.php index 1b1f105e25..e96860eab8 100644 --- a/includes/OutputPage.php +++ b/includes/OutputPage.php @@ -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]>/i",$text,$matches); + # Get all headlines for numbering them and adding funky stuff like [edit] + # links + preg_match_all("/)(.*?)<\/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 ."" .""; + 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="".$full.$toc; } diff --git a/includes/Skin.php b/includes/Skin.php index cf4a49206c..9164caaa34 100644 --- a/includes/Skin.php +++ b/includes/Skin.php @@ -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
"; - $s .= "\n" . $this->logoText() . "\n
"; + $s .= "\n" . $this->logoText() . "\n
"; $sep = "\n
"; $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
"; + $s .= "\n

"; $articleExists = $wgTitle->getArticleId(); if ( $wgOut->isArticle() || $action =="edit" || $action =="history" || $wpPreview) { if($wgOut->isArticle()) { $s .= "" . $this->editThisPage() . ""; } 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.="
".$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 @@ -699,7 +704,7 @@ class Skin { } } } - $s .= "\n
"; + $s .= "\n

"; } if ( 0 != $wgUser->getID() ) { @@ -708,7 +713,7 @@ class Skin { $s .= $this->specialLink( "specialpages" ) . $sep . $this->bugReportsLink(); - $s .= "\n
\n"; + $s .= "\n
\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 - "" ); # Math setting # diff --git a/languages/Language.php b/languages/Language.php index 2595d0c2aa..16f4d73671 100644 --- a/languages/Language.php +++ b/languages/Language.php @@ -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 (alternative: like this?).", "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
on section titles (JavaScript)", + "showtoc"=>"Show table of contents
(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 (alternative: like this?).", "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 logged in to upload files.", -"uploadfile" => "Upload file", +"uploadfile" => "Upload images, sounds, documents etc.", "uploaderror" => "Upload error", "uploadtext" => "STOP! Before you upload here, make sure to read and follow Wikipedia's $5 average edits per page, and $6 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\")", diff --git a/stylesheets/wikistandard.css b/stylesheets/wikistandard.css index 5b6cc04c17..1ebdf85870 100644 --- a/stylesheets/wikistandard.css +++ b/stylesheets/wikistandard.css @@ -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; }
\n". + "

\n". "".wfMsg("toc")."" . " " . "
\n". $toc."

\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 "{$head}"; + } + 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 "

[".$url."]
"; diff --git a/includes/SkinStandard.php b/includes/SkinStandard.php index ee309d4e65..6f788b8308 100644 --- a/includes/SkinStandard.php +++ b/includes/SkinStandard.php @@ -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; diff --git a/includes/SpecialPreferences.php b/includes/SpecialPreferences.php index 0712d5a142..778ad29929 100644 --- a/includes/SpecialPreferences.php +++ b/includes/SpecialPreferences.php @@ -292,16 +292,17 @@ value=\"$i\"$checked> {$skins[$i]}
\n" ); } else { $wgOut->addHTML( "
\n" ); } + $wgOut->addHTML(""); foreach ( $togs as $tname => $ttext ) { if ( 1 == $wgUser->getOption( $tname ) ) { $checked = " checked"; } else { $checked = ""; - } - $wgOut->addHTML( "
\n" ); + } + $wgOut->addHTML( "\n" ); } - $wgOut->addHTML( "" ); + $wgOut->addHTML( "