Index: trunk/extensions/CategoryTree/CategoryTreeIE.css |
— | — | @@ -1,4 +0,0 @@ |
2 | | -/* Hack for using inline-block with MSIE */ |
3 | | -html .CategoryTreePretendInlineMSIE { |
4 | | - display: inline; |
5 | | -} |
Index: trunk/extensions/CategoryTree/CategoryTree.css |
— | — | @@ -1,75 +0,0 @@ |
2 | | -/* |
3 | | - * Stylesheet for the CategoryTree extension, an AJAX based gadget |
4 | | - * to display the category structure of a wiki |
5 | | - * |
6 | | - * @file |
7 | | - * @ingroup Extensions |
8 | | - * @author Daniel Kinzler, brightbyte.de |
9 | | - * @copyright © 2006 Daniel Kinzler |
10 | | - * @licence GNU General Public Licence 2.0 or later |
11 | | - * |
12 | | - * NOTE: if you change this, increment $wgCategoryTreeVersion |
13 | | - * in CategoryTree.php to avoid users getting stale copies from cache. |
14 | | -*/ |
15 | | - |
16 | | -.CategoryTreeChildren { |
17 | | - margin-left: 1.5ex; |
18 | | -} |
19 | | - |
20 | | - |
21 | | -.CategoryTreeBullet { |
22 | | - cursor: pointer; |
23 | | - cursor: hand; /* hack for MSIE 5.0 and 5.5 */ |
24 | | -} |
25 | | -.CategoryTreeEmptyBullet { |
26 | | - cursor: default; |
27 | | -} |
28 | | - |
29 | | -.CategoryTreeBullet a, |
30 | | -.CategoryTreeBullet a:link, |
31 | | -.CategoryTreeBullet a:active, |
32 | | -.CategoryTreeBullet a:visited { |
33 | | - text-decoration: none; |
34 | | - color: inherit; |
35 | | - speak: none; |
36 | | -} |
37 | | - |
38 | | -.CategoryTreeLabelPage { |
39 | | - font-style: italic; |
40 | | -} |
41 | | - |
42 | | -.CategoryTreeParents { |
43 | | - margin-top: 1.5ex; |
44 | | - font-style: italic; |
45 | | -} |
46 | | - |
47 | | -.CategoryTreeResult { |
48 | | - margin-top: 1.5ex; |
49 | | -} |
50 | | - |
51 | | -.CategoryTreeTag { |
52 | | - margin-top: 0.5ex; |
53 | | - margin-bottom: 0.5ex; |
54 | | -} |
55 | | - |
56 | | -.CategoryTreeNotice { |
57 | | - font-style: italic; |
58 | | -} |
59 | | - |
60 | | -/* |
61 | | -div.CategoryTreeInlineNode, |
62 | | -div.CategoryTreeInlineNode div { |
63 | | - display: table-cell; |
64 | | -} |
65 | | -*/ |
66 | | - |
67 | | -.CategoryTreeCategoryBarItem { |
68 | | - display:-moz-inline-box; display:inline-block; /* yes, specify display twice! quirk for FF2 */ |
69 | | - margin:-0.5ex 0 0 1ex; /* why is the -0.5ex needed? */ |
70 | | - padding:0; |
71 | | - vertical-align: top; |
72 | | -} |
73 | | - |
74 | | -.CategoryTreeSection { |
75 | | - direction: ltr; |
76 | | -} |
\ No newline at end of file |
Index: trunk/extensions/CategoryTree/CategoryTree.rtl.css |
— | — | @@ -1,12 +0,0 @@ |
2 | | -/* |
3 | | - * Stylesheet to fix the RTL view of the category tree. |
4 | | - */ |
5 | | - |
6 | | -.CategoryTreeChildren { |
7 | | - margin-left: 0px; |
8 | | - margin-right: 1.5ex; |
9 | | -} |
10 | | - |
11 | | -.CategoryTreeSection { |
12 | | - direction: rtl; |
13 | | -} |
\ No newline at end of file |
Index: trunk/extensions/CategoryTree/CategoryTree.js |
— | — | @@ -1,162 +0,0 @@ |
2 | | -/* |
3 | | - * JavaScript functions for the CategoryTree extension, an AJAX based gadget |
4 | | - * to display the category structure of a wiki |
5 | | - * |
6 | | - * @file |
7 | | - * @ingroup Extensions |
8 | | - * @author Daniel Kinzler, brightbyte.de |
9 | | - * @copyright © 2006 Daniel Kinzler |
10 | | - * @licence GNU General Public Licence 2.0 or later |
11 | | - * |
12 | | - * NOTE: if you change this, increment $wgCategoryTreeVersion |
13 | | - * in CategoryTree.php to avoid users getting stale copies from cache. |
14 | | - */ |
15 | | - |
16 | | -// Default messages if new code loaded with old cached page |
17 | | -var categoryTreeErrorMsg = "Problem loading data."; |
18 | | -var categoryTreeRetryMsg = "Please wait a moment and try again."; |
19 | | - |
20 | | -function categoryTreeNextDiv(e) { |
21 | | - var n= e.nextSibling; |
22 | | - while ( n && ( n.nodeType != 1 || n.nodeName != 'DIV') ) { |
23 | | - //alert('nodeType: ' + n.nodeType + '; nodeName: ' + n.nodeName); |
24 | | - n= n.nextSibling; |
25 | | - } |
26 | | - |
27 | | - return n; |
28 | | -} |
29 | | - |
30 | | -function categoryTreeExpandNode(cat, options, lnk) { |
31 | | - var div= categoryTreeNextDiv( lnk.parentNode.parentNode ); |
32 | | - |
33 | | - div.style.display= 'block'; |
34 | | - lnk.innerHTML= categoryTreeCollapseBulletMsg; |
35 | | - lnk.title= categoryTreeCollapseMsg; |
36 | | - lnk.onclick= function() { categoryTreeCollapseNode(cat, options, lnk) }; |
37 | | - |
38 | | - if (!lnk.className.match(/(^| )CategoryTreeLoaded($| )/)) { |
39 | | - categoryTreeLoadNode(cat, options, lnk, div); |
40 | | - } |
41 | | -} |
42 | | - |
43 | | -function categoryTreeCollapseNode(cat, options, lnk) { |
44 | | - var div= categoryTreeNextDiv( lnk.parentNode.parentNode ); |
45 | | - |
46 | | - div.style.display= 'none'; |
47 | | - lnk.innerHTML= categoryTreeExpandBulletMsg; |
48 | | - lnk.title= categoryTreeExpandMsg; |
49 | | - lnk.onclick= function() { categoryTreeExpandNode(cat, options, lnk) } |
50 | | -} |
51 | | - |
52 | | -function categoryTreeLoadNode(cat, options, lnk, div) { |
53 | | - div.style.display= 'block'; |
54 | | - lnk.className= 'CategoryTreeLoaded'; |
55 | | - lnk.innerHTML= categoryTreeCollapseBulletMsg; |
56 | | - lnk.title= categoryTreeCollapseMsg; |
57 | | - lnk.onclick= function() { categoryTreeCollapseNode(cat, options, lnk) }; |
58 | | - |
59 | | - categoryTreeLoadChildren(cat, options, div) |
60 | | -} |
61 | | - |
62 | | -// FIXME Why can't this just use uneval()? |
63 | | -function categoryTreeEncodeValue(value) { |
64 | | - switch (typeof value) { |
65 | | - case 'function': |
66 | | - throw new Error("categoryTreeEncodeValue encountered a function"); |
67 | | - break; |
68 | | - case 'string': |
69 | | - s = '"' + value.replace(/([\\"'])/g, "\\$1") + '"'; |
70 | | - break; |
71 | | - case 'number': |
72 | | - case 'boolean': |
73 | | - case 'null': |
74 | | - s = String(value); |
75 | | - break; |
76 | | - case 'object': |
77 | | - if ( !value ) { |
78 | | - s = 'null'; |
79 | | - } else if (typeof value.length === 'number' && !(value.propertyIsEnumerable('length'))) { |
80 | | - s = ''; |
81 | | - for (i = 0; i<value.length; i++) { |
82 | | - v = value[i]; |
83 | | - if ( s!='' ) s += ', '; |
84 | | - s += categoryTreeEncodeValue( v ); |
85 | | - } |
86 | | - s = '[' + s + ']'; |
87 | | - } else { |
88 | | - s = ''; |
89 | | - for (k in value) { |
90 | | - v = value[k]; |
91 | | - if ( s!='' ) s += ', '; |
92 | | - s += categoryTreeEncodeValue( k ); |
93 | | - s += ': '; |
94 | | - s += categoryTreeEncodeValue( v ); |
95 | | - } |
96 | | - s = '{' + s + '}'; |
97 | | - } |
98 | | - break; |
99 | | - default: |
100 | | - throw new Error("categoryTreeEncodeValue encountered strange variable type " + (typeof value)); |
101 | | - } |
102 | | - |
103 | | - return s; |
104 | | -} |
105 | | - |
106 | | -function categoryTreeLoadChildren(cat, options, div) { |
107 | | - div.innerHTML= '<i class="CategoryTreeNotice">' + categoryTreeLoadingMsg + '</i>'; |
108 | | - |
109 | | - if ( typeof options == "string" ) { //hack for backward compatibility |
110 | | - options = { mode : options }; |
111 | | - } |
112 | | - |
113 | | - function f( request ) { |
114 | | - if (request.status != 200) { |
115 | | - div.innerHTML = '<i class="CategoryTreeNotice">' + categoryTreeErrorMsg + ' </i>'; |
116 | | - var retryLink = document.createElement('a'); |
117 | | - retryLink.innerHTML = categoryTreeRetryMsg; |
118 | | - retryLink.onclick = function() { |
119 | | - categoryTreeLoadChildren(cat, options, div, enc); |
120 | | - }; |
121 | | - div.appendChild(retryLink); |
122 | | - return; |
123 | | - } |
124 | | - |
125 | | - result= request.responseText; |
126 | | - result= result.replace(/^\s+|\s+$/, ''); |
127 | | - |
128 | | - if ( result == '' ) { |
129 | | - result= '<i class="CategoryTreeNotice">'; |
130 | | - |
131 | | - if ( options.mode == 0 ) { |
132 | | - result= categoryTreeNoSubcategoriesMsg; |
133 | | - } else if ( options.mode == 10 ) { |
134 | | - result= categoryTreeNoPagesMsg; |
135 | | - } else if ( options.mode == 100 ) { |
136 | | - result= categoryTreeNoParentCategoriesMsg; |
137 | | - } else { |
138 | | - result= categoryTreeNothingFoundMsg; |
139 | | - } |
140 | | - |
141 | | - result+= '</i>'; |
142 | | - } |
143 | | - |
144 | | - result = result.replace(/##LOAD##/g, categoryTreeExpandMsg); |
145 | | - div.innerHTML= result; |
146 | | - |
147 | | - categoryTreeShowToggles(); |
148 | | - } |
149 | | - |
150 | | - var opt = categoryTreeEncodeValue(options); |
151 | | - sajax_do_call( "efCategoryTreeAjaxWrapper", [cat, opt, 'json'] , f ); |
152 | | -} |
153 | | - |
154 | | -function categoryTreeShowToggles() { |
155 | | - var toggles = getElementsByClassName( document, 'span', 'CategoryTreeToggle' ); |
156 | | - |
157 | | - for( var i = 0; i<toggles.length; ++i ) { |
158 | | - toggles[i].style.display = 'inline'; |
159 | | - } |
160 | | -} |
161 | | - |
162 | | -// Re-show the CategoryTreeToggles |
163 | | -addOnloadHook(categoryTreeShowToggles); |
Index: trunk/extensions/CategoryTree/CategoryTree.php |
— | — | @@ -64,9 +64,6 @@ |
65 | 65 | $wgCategoryTreeForceHeaders = false; |
66 | 66 | $wgCategoryTreeSidebarRoot = null; |
67 | 67 | $wgCategoryTreeHijackPageCategories = false; # EXPERIMENTAL! NOT YET FOR PRODUCTION USE! Main problem is general HTML/CSS layout cruftiness. |
68 | | - |
69 | | -$wgCategoryTreeExtPath = '/extensions/CategoryTree'; |
70 | | -$wgCategoryTreeVersion = '6'; # NOTE: bump this when you change the CSS or JS files! |
71 | 68 | $wgCategoryTreeUseCategoryTable = true; |
72 | 69 | |
73 | 70 | $wgCategoryTreeOmitNamespace = CT_HIDEPREFIX_CATEGORIES; |
— | — | @@ -140,6 +137,16 @@ |
141 | 138 | $wgAjaxExportList[] = 'efCategoryTreeAjaxWrapper'; |
142 | 139 | |
143 | 140 | /** |
| 141 | + * Register ResourceLoader modules |
| 142 | + */ |
| 143 | +$wgResourceModules['ext.categoryTree'] = array( |
| 144 | + 'localBasePath' => dirname( __FILE__ ) . '/modules', |
| 145 | + 'remoteExtPath' => 'CategoryTree/modules', |
| 146 | + 'styles' => 'ext.categoryTree.css', |
| 147 | + 'scripts' => 'ext.categoryTree.js', |
| 148 | +); |
| 149 | + |
| 150 | +/** |
144 | 151 | * Hook it up |
145 | 152 | */ |
146 | 153 | function efCategoryTree() { |
Index: trunk/extensions/CategoryTree/modules/ext.categoryTree.css |
— | — | @@ -0,0 +1,78 @@ |
| 2 | +/* |
| 3 | + * Stylesheet for the CategoryTree extension, an AJAX based gadget |
| 4 | + * to display the category structure of a wiki |
| 5 | + * |
| 6 | + * @file |
| 7 | + * @ingroup Extensions |
| 8 | + * @author Daniel Kinzler, brightbyte.de |
| 9 | + * @copyright © 2006 Daniel Kinzler |
| 10 | + * @licence GNU General Public Licence 2.0 or later |
| 11 | + * |
| 12 | + * NOTE: if you change this, increment $wgCategoryTreeVersion |
| 13 | + * in CategoryTree.php to avoid users getting stale copies from cache. |
| 14 | +*/ |
| 15 | + |
| 16 | +.CategoryTreeChildren { |
| 17 | + margin-left: 1.5ex; |
| 18 | +} |
| 19 | + |
| 20 | + |
| 21 | +.CategoryTreeBullet { |
| 22 | + cursor: pointer; |
| 23 | + cursor: hand; /* hack for MSIE 5.0 and 5.5 */ |
| 24 | +} |
| 25 | +.CategoryTreeEmptyBullet { |
| 26 | + cursor: default; |
| 27 | +} |
| 28 | + |
| 29 | +.CategoryTreeBullet a, |
| 30 | +.CategoryTreeBullet a:link, |
| 31 | +.CategoryTreeBullet a:active, |
| 32 | +.CategoryTreeBullet a:visited { |
| 33 | + text-decoration: none; |
| 34 | + color: inherit; |
| 35 | + speak: none; |
| 36 | +} |
| 37 | + |
| 38 | +.CategoryTreeLabelPage { |
| 39 | + font-style: italic; |
| 40 | +} |
| 41 | + |
| 42 | +.CategoryTreeParents { |
| 43 | + margin-top: 1.5ex; |
| 44 | + font-style: italic; |
| 45 | +} |
| 46 | + |
| 47 | +.CategoryTreeResult { |
| 48 | + margin-top: 1.5ex; |
| 49 | +} |
| 50 | + |
| 51 | +.CategoryTreeTag { |
| 52 | + margin-top: 0.5ex; |
| 53 | + margin-bottom: 0.5ex; |
| 54 | +} |
| 55 | + |
| 56 | +.CategoryTreeNotice { |
| 57 | + font-style: italic; |
| 58 | +} |
| 59 | + |
| 60 | +/* |
| 61 | +div.CategoryTreeInlineNode, |
| 62 | +div.CategoryTreeInlineNode div { |
| 63 | + display: table-cell; |
| 64 | +} |
| 65 | +*/ |
| 66 | + |
| 67 | +.CategoryTreeCategoryBarItem { |
| 68 | + display:-moz-inline-box; display:inline-block; /* yes, specify display twice! quirk for FF2 */ |
| 69 | + margin:-0.5ex 0 0 1ex; /* why is the -0.5ex needed? */ |
| 70 | + padding:0; |
| 71 | + vertical-align: top; |
| 72 | + /* IE6-7 Hack for display: inline-block */ |
| 73 | + zoom: 1; |
| 74 | + *display: inline; |
| 75 | +} |
| 76 | + |
| 77 | +.CategoryTreeSection { |
| 78 | + direction: ltr; |
| 79 | +} |
\ No newline at end of file |
Property changes on: trunk/extensions/CategoryTree/modules/ext.categoryTree.css |
___________________________________________________________________ |
Added: svn:eol-style |
1 | 80 | + native |
Index: trunk/extensions/CategoryTree/modules/ext.categoryTree.js |
— | — | @@ -0,0 +1,162 @@ |
| 2 | +/* |
| 3 | + * JavaScript functions for the CategoryTree extension, an AJAX based gadget |
| 4 | + * to display the category structure of a wiki |
| 5 | + * |
| 6 | + * @file |
| 7 | + * @ingroup Extensions |
| 8 | + * @author Daniel Kinzler, brightbyte.de |
| 9 | + * @copyright © 2006 Daniel Kinzler |
| 10 | + * @licence GNU General Public Licence 2.0 or later |
| 11 | + * |
| 12 | + * NOTE: if you change this, increment $wgCategoryTreeVersion |
| 13 | + * in CategoryTree.php to avoid users getting stale copies from cache. |
| 14 | + */ |
| 15 | + |
| 16 | +// Default messages if new code loaded with old cached page |
| 17 | +var categoryTreeErrorMsg = "Problem loading data."; |
| 18 | +var categoryTreeRetryMsg = "Please wait a moment and try again."; |
| 19 | + |
| 20 | +function categoryTreeNextDiv(e) { |
| 21 | + var n= e.nextSibling; |
| 22 | + while ( n && ( n.nodeType != 1 || n.nodeName != 'DIV') ) { |
| 23 | + //alert('nodeType: ' + n.nodeType + '; nodeName: ' + n.nodeName); |
| 24 | + n= n.nextSibling; |
| 25 | + } |
| 26 | + |
| 27 | + return n; |
| 28 | +} |
| 29 | + |
| 30 | +function categoryTreeExpandNode(cat, options, lnk) { |
| 31 | + var div= categoryTreeNextDiv( lnk.parentNode.parentNode ); |
| 32 | + |
| 33 | + div.style.display= 'block'; |
| 34 | + lnk.innerHTML= categoryTreeCollapseBulletMsg; |
| 35 | + lnk.title= categoryTreeCollapseMsg; |
| 36 | + lnk.onclick= function() { categoryTreeCollapseNode(cat, options, lnk) }; |
| 37 | + |
| 38 | + if (!lnk.className.match(/(^| )CategoryTreeLoaded($| )/)) { |
| 39 | + categoryTreeLoadNode(cat, options, lnk, div); |
| 40 | + } |
| 41 | +} |
| 42 | + |
| 43 | +function categoryTreeCollapseNode(cat, options, lnk) { |
| 44 | + var div= categoryTreeNextDiv( lnk.parentNode.parentNode ); |
| 45 | + |
| 46 | + div.style.display= 'none'; |
| 47 | + lnk.innerHTML= categoryTreeExpandBulletMsg; |
| 48 | + lnk.title= categoryTreeExpandMsg; |
| 49 | + lnk.onclick= function() { categoryTreeExpandNode(cat, options, lnk) } |
| 50 | +} |
| 51 | + |
| 52 | +function categoryTreeLoadNode(cat, options, lnk, div) { |
| 53 | + div.style.display= 'block'; |
| 54 | + lnk.className= 'CategoryTreeLoaded'; |
| 55 | + lnk.innerHTML= categoryTreeCollapseBulletMsg; |
| 56 | + lnk.title= categoryTreeCollapseMsg; |
| 57 | + lnk.onclick= function() { categoryTreeCollapseNode(cat, options, lnk) }; |
| 58 | + |
| 59 | + categoryTreeLoadChildren(cat, options, div) |
| 60 | +} |
| 61 | + |
| 62 | +// FIXME Why can't this just use uneval()? |
| 63 | +function categoryTreeEncodeValue(value) { |
| 64 | + switch (typeof value) { |
| 65 | + case 'function': |
| 66 | + throw new Error("categoryTreeEncodeValue encountered a function"); |
| 67 | + break; |
| 68 | + case 'string': |
| 69 | + s = '"' + value.replace(/([\\"'])/g, "\\$1") + '"'; |
| 70 | + break; |
| 71 | + case 'number': |
| 72 | + case 'boolean': |
| 73 | + case 'null': |
| 74 | + s = String(value); |
| 75 | + break; |
| 76 | + case 'object': |
| 77 | + if ( !value ) { |
| 78 | + s = 'null'; |
| 79 | + } else if (typeof value.length === 'number' && !(value.propertyIsEnumerable('length'))) { |
| 80 | + s = ''; |
| 81 | + for (i = 0; i<value.length; i++) { |
| 82 | + v = value[i]; |
| 83 | + if ( s!='' ) s += ', '; |
| 84 | + s += categoryTreeEncodeValue( v ); |
| 85 | + } |
| 86 | + s = '[' + s + ']'; |
| 87 | + } else { |
| 88 | + s = ''; |
| 89 | + for (k in value) { |
| 90 | + v = value[k]; |
| 91 | + if ( s!='' ) s += ', '; |
| 92 | + s += categoryTreeEncodeValue( k ); |
| 93 | + s += ': '; |
| 94 | + s += categoryTreeEncodeValue( v ); |
| 95 | + } |
| 96 | + s = '{' + s + '}'; |
| 97 | + } |
| 98 | + break; |
| 99 | + default: |
| 100 | + throw new Error("categoryTreeEncodeValue encountered strange variable type " + (typeof value)); |
| 101 | + } |
| 102 | + |
| 103 | + return s; |
| 104 | +} |
| 105 | + |
| 106 | +function categoryTreeLoadChildren(cat, options, div) { |
| 107 | + div.innerHTML= '<i class="CategoryTreeNotice">' + categoryTreeLoadingMsg + '</i>'; |
| 108 | + |
| 109 | + if ( typeof options == "string" ) { //hack for backward compatibility |
| 110 | + options = { mode : options }; |
| 111 | + } |
| 112 | + |
| 113 | + function f( request ) { |
| 114 | + if (request.status != 200) { |
| 115 | + div.innerHTML = '<i class="CategoryTreeNotice">' + categoryTreeErrorMsg + ' </i>'; |
| 116 | + var retryLink = document.createElement('a'); |
| 117 | + retryLink.innerHTML = categoryTreeRetryMsg; |
| 118 | + retryLink.onclick = function() { |
| 119 | + categoryTreeLoadChildren(cat, options, div, enc); |
| 120 | + }; |
| 121 | + div.appendChild(retryLink); |
| 122 | + return; |
| 123 | + } |
| 124 | + |
| 125 | + result= request.responseText; |
| 126 | + result= result.replace(/^\s+|\s+$/, ''); |
| 127 | + |
| 128 | + if ( result == '' ) { |
| 129 | + result= '<i class="CategoryTreeNotice">'; |
| 130 | + |
| 131 | + if ( options.mode == 0 ) { |
| 132 | + result= categoryTreeNoSubcategoriesMsg; |
| 133 | + } else if ( options.mode == 10 ) { |
| 134 | + result= categoryTreeNoPagesMsg; |
| 135 | + } else if ( options.mode == 100 ) { |
| 136 | + result= categoryTreeNoParentCategoriesMsg; |
| 137 | + } else { |
| 138 | + result= categoryTreeNothingFoundMsg; |
| 139 | + } |
| 140 | + |
| 141 | + result+= '</i>'; |
| 142 | + } |
| 143 | + |
| 144 | + result = result.replace(/##LOAD##/g, categoryTreeExpandMsg); |
| 145 | + div.innerHTML= result; |
| 146 | + |
| 147 | + categoryTreeShowToggles(); |
| 148 | + } |
| 149 | + |
| 150 | + var opt = categoryTreeEncodeValue(options); |
| 151 | + sajax_do_call( "efCategoryTreeAjaxWrapper", [cat, opt, 'json'] , f ); |
| 152 | +} |
| 153 | + |
| 154 | +function categoryTreeShowToggles() { |
| 155 | + var toggles = getElementsByClassName( document, 'span', 'CategoryTreeToggle' ); |
| 156 | + |
| 157 | + for( var i = 0; i<toggles.length; ++i ) { |
| 158 | + toggles[i].style.display = 'inline'; |
| 159 | + } |
| 160 | +} |
| 161 | + |
| 162 | +// Re-show the CategoryTreeToggles |
| 163 | +jQuery( categoryTreeShowToggles ); |
Property changes on: trunk/extensions/CategoryTree/modules/ext.categoryTree.js |
___________________________________________________________________ |
Added: svn:eol-style |
1 | 164 | + native |
Index: trunk/extensions/CategoryTree/CategoryTreeFunctions.php |
— | — | @@ -164,40 +164,9 @@ |
165 | 165 | global $wgJsMimeType, $wgScriptPath, $wgContLang; |
166 | 166 | global $wgCategoryTreeHijackPageCategories, $wgCategoryTreeExtPath, $wgCategoryTreeVersion; |
167 | 167 | |
168 | | - # Register css file for CategoryTree |
169 | | - $outputPage->addLink( |
170 | | - array( |
171 | | - 'rel' => 'stylesheet', |
172 | | - 'type' => 'text/css', |
173 | | - 'href' => "$wgScriptPath$wgCategoryTreeExtPath/CategoryTree.css?$wgCategoryTreeVersion", |
174 | | - ) |
175 | | - ); |
| 168 | + # Add the module |
| 169 | + $outputPage->addModules( 'ext.categoryTree' ); |
176 | 170 | |
177 | | - if ( $wgCategoryTreeHijackPageCategories ) { |
178 | | - # Register MSIE quirks |
179 | | - $outputPage->addScript( |
180 | | - "<!--[if IE]><link rel=\"stylesheet\" type=\"text/css\" src=\"{$wgScriptPath}{$wgCategoryTreeExtPath}/CategoryTreeIE.css?{$wgCategoryTreeVersion}\"/><![endif]--> |
181 | | - \n" |
182 | | - ); |
183 | | - } |
184 | | - |
185 | | - # Register css RTL file for CategoryTree |
186 | | - if ( $wgContLang->isRTL() ) { |
187 | | - $outputPage->addLink( |
188 | | - array( |
189 | | - 'rel' => 'stylesheet', |
190 | | - 'type' => 'text/css', |
191 | | - 'href' => "$wgScriptPath$wgCategoryTreeExtPath/CategoryTree.rtl.css?$wgCategoryTreeVersion" |
192 | | - ) |
193 | | - ); |
194 | | - } |
195 | | - |
196 | | - # Register main js file for CategoryTree |
197 | | - $outputPage->addScript( |
198 | | - "<script type=\"{$wgJsMimeType}\" src=\"{$wgScriptPath}{$wgCategoryTreeExtPath}/CategoryTree.js?{$wgCategoryTreeVersion}\">" . |
199 | | - "</script>\n" |
200 | | - ); |
201 | | - |
202 | 171 | # Add messages |
203 | 172 | $outputPage->addScript( |
204 | 173 | " <script type=\"{$wgJsMimeType}\"> |