r90777 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r90776‎ | r90777 | r90778 >
Date:18:00, 25 June 2011
Author:kipcool
Status:deferred
Tags:
Comment:
Replaced the h2, h3, h4 (h5) headers with div class.
Modified paths:
  • /trunk/extensions/Wikidata/OmegaWiki/Editor.php (modified) (history)
  • /trunk/extensions/Wikidata/OmegaWiki/tables.css (modified) (history)

Diff [purge]

Index: trunk/extensions/Wikidata/OmegaWiki/tables.css
@@ -102,6 +102,36 @@
103103 width: auto;
104104 }
105105
 106+
 107+.level2 {
 108+ font-size:150% ;
 109+ background-color: #ffe0eb;
 110+ border-style:solid;
 111+ border-width:1px;
 112+ border-color:grey;
 113+ margin-top:10px;
 114+ padding:5px;
 115+}
 116+
 117+.level3 {
 118+ font-size:120% ;
 119+ font-weight: bold;
 120+ background-color: #e0ffff;
 121+ margin-top:10px;
 122+ padding:5px;
 123+}
 124+
 125+.level4 {
 126+ font-size:110% ;
 127+ font-weight: bold;
 128+ padding:5px;
 129+}
 130+
 131+.level5 {
 132+ font-weight: bold;
 133+ padding:5px;
 134+}
 135+
106136 td.add {
107137 text-align: center;
108138 }
Index: trunk/extensions/Wikidata/OmegaWiki/Editor.php
@@ -1030,8 +1030,7 @@
10311031 }
10321032
10331033 public function getInputValue( $id ) {
1034 - global
1035 - $wgRequest;
 1034+ global $wgRequest;
10361035
10371036 return $wgRequest->getInt( $id );
10381037 }
@@ -1108,7 +1107,6 @@
11091108 $definition = getDefinedMeaningDefinition( $value );
11101109 $definedMeaningAsLink = definedMeaningAsLink( $value );
11111110 $escapedDefinition = htmlspecialchars( $definition );
1112 -
11131111 if ( $this->truncate && strlen( $definition ) > $this->truncateAt )
11141112 $escapedDefinition = '<span title="' . $escapedDefinition . '">' . htmlspecialchars( mb_substr( $definition, 0, $this->truncateAt ) ) . wfMsg( 'ellipsis' ) . '</span>' . EOL;
11151113
@@ -1677,11 +1675,11 @@
16781676 public function add( IdStack $idPath ) {
16791677 return $this->addEditors( $idPath, $this->getEditors(), $this->htmlTag );
16801678 }
1681 -
 1679+
16821680 protected function childHeader( Editor $editor, Attribute $attribute, $class, $attributeId ) {
16831681 $expansionPrefix = $this->getExpansionPrefix( $class, $attributeId );
16841682 $this->setExpansionByEditor( $editor, $class );
1685 - return '<h' . $this->headerLevel . '><span id="collapse-' . $attributeId . '" class="toggle ' . addCollapsablePrefixToClass( $class ) . '" onclick="toggle(this, event);">' . $expansionPrefix . '&#160;' . $attribute->name . '</span></h' . $this->headerLevel . '>' . EOL;
 1683+ return '<div class="level' . $this->headerLevel . '"><span id="collapse-' . $attributeId . '" class="toggle ' . addCollapsablePrefixToClass( $class ) . '" onclick="toggle(this, event);">' . $expansionPrefix . '&#160;' . $attribute->name . '</span></div>' . EOL;
16861684 }
16871685
16881686 protected function viewChild( Editor $editor, IdStack $idPath, $value, Attribute $attribute, $class, $attributeId ) {
@@ -1908,8 +1906,7 @@
19091907 $this->setExpansion( $this->childrenExpanded, $valueClass );
19101908
19111909 $idPath->pushAttribute( $captionAttribute );
1912 - $result .= '<li>' .
1913 - '<h' . $this->headerLevel . '><span id="collapse-' . $recordId . '" class="toggle ' . addCollapsablePrefixToClass( $captionClass ) . '" onclick="toggle(this, event);">' . $captionExpansionPrefix . '&#160;' . $this->captionEditor->view( $idPath, $record->getAttributeValue( $captionAttribute ) ) . '</span></h' . $this->headerLevel . '>';
 1910+ $result .= '<li><div class="level' . $this->headerLevel . '"><span id="collapse-' . $recordId . '" class="toggle ' . addCollapsablePrefixToClass( $captionClass ) . '" onclick="toggle(this, event);">' . $captionExpansionPrefix . '&#160;' . $this->captionEditor->view( $idPath, $record->getAttributeValue( $captionAttribute ) ) . '</span></div>';
19141911 $idPath->popAttribute();
19151912
19161913 $idPath->pushAttribute( $valueAttribute );
@@ -1952,8 +1949,7 @@
19531950 $this->setExpansion( $this->childrenExpanded, $valueClass );
19541951
19551952 $idPath->pushAttribute( $captionAttribute );
1956 - $result .= '<li>' .
1957 - '<h' . $this->headerLevel . '><span id="collapse-' . $recordId . '" class="toggle ' . addCollapsablePrefixToClass( $captionClass ) . '" onclick="toggle(this, event);">' . $captionExpansionPrefix . '&#160;' . $this->captionEditor->edit( $idPath, $record->getAttributeValue( $captionAttribute ) ) . '</span></h' . $this->headerLevel . '>' . EOL;
 1953+ $result .= '<li><div class=level"' . $this->headerLevel . '"><span id="collapse-' . $recordId . '" class="toggle ' . addCollapsablePrefixToClass( $captionClass ) . '" onclick="toggle(this, event);">' . $captionExpansionPrefix . '&#160;' . $this->captionEditor->edit( $idPath, $record->getAttributeValue( $captionAttribute ) ) . '</span></div>' . EOL;
19581954 $idPath->popAttribute();
19591955
19601956 $idPath->pushAttribute( $valueAttribute );
@@ -1970,10 +1966,8 @@
19711967 $class = $idPath->getClass();
19721968
19731969 $this->setExpansion( true, $class );
1974 -
1975 - # For which class is this add?
1976 - $result .= '<li>' .
1977 - '<h' . $this->headerLevel . '><span id="collapse-' . $recordId . '" class="toggle ' . addCollapsablePrefixToClass( $class ) . '" onclick="toggle(this, event);">' . $this->getExpansionPrefix( $idPath->getClass(), $idPath->getId() ) . ' <img src="' . $wgScriptPath . '/extensions/Wikidata/Images/Add.png" title="Enter new list item to add" alt="Add" onclick="addEmptyRow(this.parentNode.parentNode.id);"/>' . $this->captionEditor->add( $idPath ) . '</span></h' . $this->headerLevel . '>' . EOL;
 1970+
 1971+ $result .= '<li><div class="level' . $this->headerLevel . '">' . '<span id="collapse-' . $recordId . '" class="toggle ' . addCollapsablePrefixToClass( $class ) . '" onclick="toggle(this, event);">' . $this->getExpansionPrefix( $idPath->getClass(), $idPath->getId() ) . $this->captionEditor->add( $idPath ) . '</div></span>' . EOL;
19781972 $idPath->popAttribute();
19791973
19801974 $idPath->pushAttribute( $valueAttribute );
@@ -2002,8 +1996,7 @@
20031997
20041998 $this->setExpansion( true, $class );
20051999
2006 - $result .= '<li>' .
2007 - '<h' . $this->headerLevel . '><span id="collapse-' . $recordId . '" class="toggle ' . addCollapsablePrefixToClass( $class ) . '" onclick="toggle(this, event);">' . $this->getExpansionPrefix( $idPath->getClass(), $idPath->getId() ) . '&#160;' . $this->captionEditor->add( $idPath ) . '</span></h' . $this->headerLevel . '>' . EOL;
 2000+ $result .= '<li><div class="level' . $this->headerLevel . '"><span id="collapse-' . $recordId . '" class="toggle ' . addCollapsablePrefixToClass( $class ) . '" onclick="toggle(this, event);">' . $this->getExpansionPrefix( $idPath->getClass(), $idPath->getId() ) . '&#160;' . $this->captionEditor->add( $idPath ) . '</span></div>' . EOL;
20082001 $idPath->popAttribute();
20092002
20102003 $idPath->pushAttribute( $valueAttribute );

Status & tagging log