Index: trunk/extensions/Wikidata/OmegaWiki/tables.css |
— | — | @@ -102,6 +102,36 @@ |
103 | 103 | width: auto; |
104 | 104 | } |
105 | 105 | |
| 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 | + |
106 | 136 | td.add { |
107 | 137 | text-align: center; |
108 | 138 | } |
Index: trunk/extensions/Wikidata/OmegaWiki/Editor.php |
— | — | @@ -1030,8 +1030,7 @@ |
1031 | 1031 | } |
1032 | 1032 | |
1033 | 1033 | public function getInputValue( $id ) { |
1034 | | - global |
1035 | | - $wgRequest; |
| 1034 | + global $wgRequest; |
1036 | 1035 | |
1037 | 1036 | return $wgRequest->getInt( $id ); |
1038 | 1037 | } |
— | — | @@ -1108,7 +1107,6 @@ |
1109 | 1108 | $definition = getDefinedMeaningDefinition( $value ); |
1110 | 1109 | $definedMeaningAsLink = definedMeaningAsLink( $value ); |
1111 | 1110 | $escapedDefinition = htmlspecialchars( $definition ); |
1112 | | - |
1113 | 1111 | if ( $this->truncate && strlen( $definition ) > $this->truncateAt ) |
1114 | 1112 | $escapedDefinition = '<span title="' . $escapedDefinition . '">' . htmlspecialchars( mb_substr( $definition, 0, $this->truncateAt ) ) . wfMsg( 'ellipsis' ) . '</span>' . EOL; |
1115 | 1113 | |
— | — | @@ -1677,11 +1675,11 @@ |
1678 | 1676 | public function add( IdStack $idPath ) { |
1679 | 1677 | return $this->addEditors( $idPath, $this->getEditors(), $this->htmlTag ); |
1680 | 1678 | } |
1681 | | - |
| 1679 | + |
1682 | 1680 | protected function childHeader( Editor $editor, Attribute $attribute, $class, $attributeId ) { |
1683 | 1681 | $expansionPrefix = $this->getExpansionPrefix( $class, $attributeId ); |
1684 | 1682 | $this->setExpansionByEditor( $editor, $class ); |
1685 | | - return '<h' . $this->headerLevel . '><span id="collapse-' . $attributeId . '" class="toggle ' . addCollapsablePrefixToClass( $class ) . '" onclick="toggle(this, event);">' . $expansionPrefix . ' ' . $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 . ' ' . $attribute->name . '</span></div>' . EOL; |
1686 | 1684 | } |
1687 | 1685 | |
1688 | 1686 | protected function viewChild( Editor $editor, IdStack $idPath, $value, Attribute $attribute, $class, $attributeId ) { |
— | — | @@ -1908,8 +1906,7 @@ |
1909 | 1907 | $this->setExpansion( $this->childrenExpanded, $valueClass ); |
1910 | 1908 | |
1911 | 1909 | $idPath->pushAttribute( $captionAttribute ); |
1912 | | - $result .= '<li>' . |
1913 | | - '<h' . $this->headerLevel . '><span id="collapse-' . $recordId . '" class="toggle ' . addCollapsablePrefixToClass( $captionClass ) . '" onclick="toggle(this, event);">' . $captionExpansionPrefix . ' ' . $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 . ' ' . $this->captionEditor->view( $idPath, $record->getAttributeValue( $captionAttribute ) ) . '</span></div>'; |
1914 | 1911 | $idPath->popAttribute(); |
1915 | 1912 | |
1916 | 1913 | $idPath->pushAttribute( $valueAttribute ); |
— | — | @@ -1952,8 +1949,7 @@ |
1953 | 1950 | $this->setExpansion( $this->childrenExpanded, $valueClass ); |
1954 | 1951 | |
1955 | 1952 | $idPath->pushAttribute( $captionAttribute ); |
1956 | | - $result .= '<li>' . |
1957 | | - '<h' . $this->headerLevel . '><span id="collapse-' . $recordId . '" class="toggle ' . addCollapsablePrefixToClass( $captionClass ) . '" onclick="toggle(this, event);">' . $captionExpansionPrefix . ' ' . $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 . ' ' . $this->captionEditor->edit( $idPath, $record->getAttributeValue( $captionAttribute ) ) . '</span></div>' . EOL; |
1958 | 1954 | $idPath->popAttribute(); |
1959 | 1955 | |
1960 | 1956 | $idPath->pushAttribute( $valueAttribute ); |
— | — | @@ -1970,10 +1966,8 @@ |
1971 | 1967 | $class = $idPath->getClass(); |
1972 | 1968 | |
1973 | 1969 | $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; |
1978 | 1972 | $idPath->popAttribute(); |
1979 | 1973 | |
1980 | 1974 | $idPath->pushAttribute( $valueAttribute ); |
— | — | @@ -2002,8 +1996,7 @@ |
2003 | 1997 | |
2004 | 1998 | $this->setExpansion( true, $class ); |
2005 | 1999 | |
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() ) . ' ' . $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() ) . ' ' . $this->captionEditor->add( $idPath ) . '</span></div>' . EOL; |
2008 | 2001 | $idPath->popAttribute(); |
2009 | 2002 | |
2010 | 2003 | $idPath->pushAttribute( $valueAttribute ); |