mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/CategoryTree
synced 2024-11-15 03:43:55 +00:00
Remove dead code, tweak comments, related to JavaScript
* Small doc tweak to reflect it no longer uses raw script tags * Remove getOptionsAsJsString (dead) * Remove various references to $load and unreachable code that does something if it is truthy (there is no way it can be truthy). Also, part of this unreachable code calls categoryTreeExpandNode, which was removed earlier. Change-Id: Iacf681f62ffb46554243926e02176e451e5668fd
This commit is contained in:
parent
97735a869b
commit
b0c9947349
|
@ -229,7 +229,7 @@ class CategoryTree {
|
|||
}
|
||||
|
||||
/**
|
||||
* Set the script tags in an OutputPage object
|
||||
* Add ResourceLoader modules to the OutputPage object
|
||||
* @param OutputPage $outputPage
|
||||
*/
|
||||
static function setHeaders( $outputPage ) {
|
||||
|
@ -312,14 +312,6 @@ class CategoryTree {
|
|||
return $s;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param $depth null
|
||||
* @return String
|
||||
*/
|
||||
function getOptionsAsJsString( $depth = null ) {
|
||||
return Xml::escapeJsString( $this->getOptionsAsJsStructure( $depth ) );
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
|
@ -630,7 +622,6 @@ class CategoryTree {
|
|||
*/
|
||||
function renderNodeInfo( $title, $cat, $children = 0 ) {
|
||||
$mode = $this->getOption( 'mode' );
|
||||
$load = false;
|
||||
|
||||
$ns = $title->getNamespace();
|
||||
$key = $title->getDBkey();
|
||||
|
@ -716,9 +707,6 @@ class CategoryTree {
|
|||
$attr['class'] = 'CategoryTreeEmptyBullet';
|
||||
} else {
|
||||
$linkattr = array( );
|
||||
if ( $load ) {
|
||||
$linkattr[ 'id' ] = $load;
|
||||
}
|
||||
|
||||
$linkattr[ 'class' ] = "CategoryTreeToggle";
|
||||
$linkattr['style'] = 'display: none;'; // Unhidden by JS
|
||||
|
@ -820,14 +808,6 @@ class CategoryTree {
|
|||
$s .= Xml::closeElement( 'div' );
|
||||
$s .= Xml::closeElement( 'div' );
|
||||
|
||||
if ( $load ) {
|
||||
$s .= "\n\t\t";
|
||||
$s .= Xml::openElement( 'script', array( 'type' => 'text/javascript' ) );
|
||||
$s .= 'categoryTreeExpandNode("' . Xml::escapeJsString( $key ) . '", '
|
||||
. $this->getOptionsAsJsStructure( $children ) . ', document.getElementById("' . $load . '"));';
|
||||
$s .= Xml::closeElement( 'script' );
|
||||
}
|
||||
|
||||
$s .= "\n\t\t";
|
||||
|
||||
return $s;
|
||||
|
|
Loading…
Reference in a new issue