mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/CategoryTree
synced 2024-11-15 03:43:55 +00:00
Basic ResourceLoader conversion, jQuery conversion and API use will come soon
This commit is contained in:
parent
79b921f942
commit
e77ae5449b
Notes:
John Du Hart
2011-09-30 02:51:53 +00:00
|
@ -64,9 +64,6 @@ $wgCategoryTreeMaxDepth = array( CT_MODE_PAGES => 1, CT_MODE_ALL => 1, CT_MODE_C
|
|||
$wgCategoryTreeForceHeaders = false;
|
||||
$wgCategoryTreeSidebarRoot = null;
|
||||
$wgCategoryTreeHijackPageCategories = false; # EXPERIMENTAL! NOT YET FOR PRODUCTION USE! Main problem is general HTML/CSS layout cruftiness.
|
||||
|
||||
$wgCategoryTreeExtPath = '/extensions/CategoryTree';
|
||||
$wgCategoryTreeVersion = '6'; # NOTE: bump this when you change the CSS or JS files!
|
||||
$wgCategoryTreeUseCategoryTable = true;
|
||||
|
||||
$wgCategoryTreeOmitNamespace = CT_HIDEPREFIX_CATEGORIES;
|
||||
|
@ -139,6 +136,16 @@ $wgHooks['ArticleFromTitle'][] = 'efCategoryTreeArticleFromTitle';
|
|||
*/
|
||||
$wgAjaxExportList[] = 'efCategoryTreeAjaxWrapper';
|
||||
|
||||
/**
|
||||
* Register ResourceLoader modules
|
||||
*/
|
||||
$wgResourceModules['ext.categoryTree'] = array(
|
||||
'localBasePath' => dirname( __FILE__ ) . '/modules',
|
||||
'remoteExtPath' => 'CategoryTree/modules',
|
||||
'styles' => 'ext.categoryTree.css',
|
||||
'scripts' => 'ext.categoryTree.js',
|
||||
);
|
||||
|
||||
/**
|
||||
* Hook it up
|
||||
*/
|
||||
|
|
|
@ -1,12 +0,0 @@
|
|||
/*
|
||||
* Stylesheet to fix the RTL view of the category tree.
|
||||
*/
|
||||
|
||||
.CategoryTreeChildren {
|
||||
margin-left: 0px;
|
||||
margin-right: 1.5ex;
|
||||
}
|
||||
|
||||
.CategoryTreeSection {
|
||||
direction: rtl;
|
||||
}
|
|
@ -164,39 +164,8 @@ class CategoryTree {
|
|||
global $wgJsMimeType, $wgScriptPath, $wgContLang;
|
||||
global $wgCategoryTreeHijackPageCategories, $wgCategoryTreeExtPath, $wgCategoryTreeVersion;
|
||||
|
||||
# Register css file for CategoryTree
|
||||
$outputPage->addLink(
|
||||
array(
|
||||
'rel' => 'stylesheet',
|
||||
'type' => 'text/css',
|
||||
'href' => "$wgScriptPath$wgCategoryTreeExtPath/CategoryTree.css?$wgCategoryTreeVersion",
|
||||
)
|
||||
);
|
||||
|
||||
if ( $wgCategoryTreeHijackPageCategories ) {
|
||||
# Register MSIE quirks
|
||||
$outputPage->addScript(
|
||||
"<!--[if IE]><link rel=\"stylesheet\" type=\"text/css\" src=\"{$wgScriptPath}{$wgCategoryTreeExtPath}/CategoryTreeIE.css?{$wgCategoryTreeVersion}\"/><![endif]-->
|
||||
\n"
|
||||
);
|
||||
}
|
||||
|
||||
# Register css RTL file for CategoryTree
|
||||
if ( $wgContLang->isRTL() ) {
|
||||
$outputPage->addLink(
|
||||
array(
|
||||
'rel' => 'stylesheet',
|
||||
'type' => 'text/css',
|
||||
'href' => "$wgScriptPath$wgCategoryTreeExtPath/CategoryTree.rtl.css?$wgCategoryTreeVersion"
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
# Register main js file for CategoryTree
|
||||
$outputPage->addScript(
|
||||
"<script type=\"{$wgJsMimeType}\" src=\"{$wgScriptPath}{$wgCategoryTreeExtPath}/CategoryTree.js?{$wgCategoryTreeVersion}\">" .
|
||||
"</script>\n"
|
||||
);
|
||||
# Add the module
|
||||
$outputPage->addModules( 'ext.categoryTree' );
|
||||
|
||||
# Add messages
|
||||
$outputPage->addScript(
|
||||
|
|
|
@ -1,4 +0,0 @@
|
|||
/* Hack for using inline-block with MSIE */
|
||||
html .CategoryTreePretendInlineMSIE {
|
||||
display: inline;
|
||||
}
|
|
@ -68,6 +68,9 @@ div.CategoryTreeInlineNode div {
|
|||
margin:-0.5ex 0 0 1ex; /* why is the -0.5ex needed? */
|
||||
padding:0;
|
||||
vertical-align: top;
|
||||
/* IE6-7 Hack for display: inline-block */
|
||||
zoom: 1;
|
||||
*display: inline;
|
||||
}
|
||||
|
||||
.CategoryTreeSection {
|
|
@ -159,4 +159,4 @@ function categoryTreeShowToggles() {
|
|||
}
|
||||
|
||||
// Re-show the CategoryTreeToggles
|
||||
addOnloadHook(categoryTreeShowToggles);
|
||||
jQuery( categoryTreeShowToggles );
|
Loading…
Reference in a new issue