Basic ResourceLoader conversion, jQuery conversion and API use will come soon

This commit is contained in:
John Du Hart 2011-09-30 02:51:53 +00:00
parent 79b921f942
commit e77ae5449b
Notes: John Du Hart 2011-09-30 02:51:53 +00:00
6 changed files with 16 additions and 53 deletions

View file

@ -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
*/

View file

@ -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;
}

View file

@ -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(

View file

@ -1,4 +0,0 @@
/* Hack for using inline-block with MSIE */
html .CategoryTreePretendInlineMSIE {
display: inline;
}

View file

@ -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 {

View file

@ -159,4 +159,4 @@ function categoryTreeShowToggles() {
}
// Re-show the CategoryTreeToggles
addOnloadHook(categoryTreeShowToggles);
jQuery( categoryTreeShowToggles );