Index: branches/REL1_17/extensions/Vector/modules/ext.vector.collapsibleNav.css |
— | — | @@ -1,39 +1,26 @@ |
2 | 2 | /* Prototype code to show collapsing left nav options */ |
3 | 3 | #mw-panel.collapsible-nav div.portal { |
4 | 4 | /* @embed */ |
5 | | - background-image:url(images/portal-break.png?1); |
| 5 | + background-image:url(images/portal-break.png); |
6 | 6 | background-position:left top; |
7 | 7 | background-repeat:no-repeat; |
8 | 8 | padding: 0.25em 0 !important; |
9 | 9 | margin: -11px 9px 10px 11px; |
10 | 10 | } |
11 | | -body.rtl #mw-panel.collapsible-nav div.portal { |
12 | | - background-position: right top; |
13 | | - margin: -11px 11px 10px 9px; |
14 | | -} |
15 | 11 | #mw-panel.collapsible-nav div.portal h5 { |
16 | 12 | color: #4D4D4D; |
17 | 13 | font-weight: normal; |
18 | 14 | /* @embed */ |
19 | | - background: url(images/arrow-down.png?1) 0 50% no-repeat; |
| 15 | + background: url(images/open.png) left center no-repeat; |
20 | 16 | padding: 4px 0 3px 1.5em; |
21 | 17 | margin-bottom: 0px; |
22 | 18 | } |
23 | | -body.rtl #mw-panel.collapsible-nav div.portal h5 { |
24 | | - /* @embed */ |
25 | | - background: url(images/arrow-down.png?1) 100% 50% no-repeat; |
26 | | - padding: 4px 1.5em 3px 0; |
27 | | -} |
28 | 19 | #mw-panel.collapsible-nav div.collapsed h5 { |
29 | 20 | color: #0645AD; |
30 | 21 | /* @embed */ |
31 | | - background: url(images/arrow-right.png?1) 0 50% no-repeat; |
| 22 | + background: url(images/closed-ltr.png) left center no-repeat; |
32 | 23 | margin-bottom: 0px; |
33 | 24 | } |
34 | | -body.rtl #mw-panel.collapsible-nav div.collapsed h5 { |
35 | | - /* @embed */ |
36 | | - background: url(images/arrow-left.png?1) 100% 50% no-repeat; |
37 | | -} |
38 | 25 | #mw-panel.collapsible-nav div h5:hover { |
39 | 26 | cursor: pointer; |
40 | 27 | text-decoration: none; |
— | — | @@ -66,8 +53,4 @@ |
67 | 54 | } |
68 | 55 | #mw-panel.collapsible-nav div.persistent div.body { |
69 | 56 | margin-left: 0.5em; |
70 | | -} |
71 | | -body.rtl #mw-panel.collapsible-nav div.persistent div.body { |
72 | | - margin-left: 0; |
73 | | - margin-right: 0.5em; |
74 | | -} |
| 57 | +} |
\ No newline at end of file |
Index: branches/REL1_17/extensions/Vector/modules/images/arrow-down.png |
Cannot display: file marked as a binary type. |
svn:mime-type = image/png |
Index: branches/REL1_17/extensions/Vector/modules/images/arrow-left.png |
Cannot display: file marked as a binary type. |
svn:mime-type = image/png |
Index: branches/REL1_17/extensions/Vector/modules/images/arrow-right.png |
Cannot display: file marked as a binary type. |
svn:mime-type = image/png |
Index: branches/REL1_17/extensions/Vector/modules/images/open.png |
Cannot display: file marked as a binary type. |
svn:mime-type = image/png |
Property changes on: branches/REL1_17/extensions/Vector/modules/images/open.png |
___________________________________________________________________ |
Added: svn:mime-type |
75 | 58 | + image/png |
Index: branches/REL1_17/extensions/Vector/modules/images/closed-ltr.png |
Cannot display: file marked as a binary type. |
svn:mime-type = image/png |
Property changes on: branches/REL1_17/extensions/Vector/modules/images/closed-ltr.png |
___________________________________________________________________ |
Added: svn:mime-type |
76 | 59 | + image/png |
Index: branches/REL1_17/extensions/Vector/modules/images/closed-rtl.png |
Cannot display: file marked as a binary type. |
svn:mime-type = image/png |
Property changes on: branches/REL1_17/extensions/Vector/modules/images/closed-rtl.png |
___________________________________________________________________ |
Added: svn:mime-type |
77 | 60 | + image/png |
Property changes on: branches/REL1_17/extensions/Vector/modules/ext.vector.simpleSearch.js |
___________________________________________________________________ |
Modified: svn:mergeinfo |
78 | 61 | Merged /trunk/extensions/Vector/modules/ext.vector.simpleSearch.js:r78161,78511 |
Property changes on: branches/REL1_17/extensions/Vector/modules/ext.vector.collapsibleTabs.js |
___________________________________________________________________ |
Modified: svn:mergeinfo |
79 | 62 | Merged /trunk/extensions/Vector/modules/ext.vector.collapsibleTabs.js:r78161,78511 |
Index: branches/REL1_17/extensions/CheckUser/CheckUser_body.php |
— | — | @@ -115,7 +115,7 @@ |
116 | 116 | } |
117 | 117 | # Add CIDR calculation convenience form |
118 | 118 | $this->addJsCIDRForm(); |
119 | | - $this->addStyles(); |
| 119 | + $wgOut->addModules( 'ext.checkUser' ); // JS |
120 | 120 | } |
121 | 121 | |
122 | 122 | /** |
— | — | @@ -204,16 +204,6 @@ |
205 | 205 | } |
206 | 206 | |
207 | 207 | /** |
208 | | - * Add CSS/JS |
209 | | - */ |
210 | | - protected function addStyles() { |
211 | | - global $wgScriptPath, $wgCheckUserStyleVersion, $wgOut; |
212 | | - // FIXME, use Html:: |
213 | | - $encJSFile = htmlspecialchars( "$wgScriptPath/extensions/CheckUser/checkuser.js?$wgCheckUserStyleVersion" ); |
214 | | - $wgOut->addScript( "<script type=\"text/javascript\" src=\"$encJSFile\"></script>" ); |
215 | | - } |
216 | | - |
217 | | - /** |
218 | 208 | * Get a selector of time period options |
219 | 209 | * @param int $selected, selected level |
220 | 210 | */ |
Index: branches/REL1_17/extensions/CheckUser/CheckUser.php |
— | — | @@ -61,7 +61,6 @@ |
62 | 62 | $wgCheckUserStyleVersion = 5; |
63 | 63 | |
64 | 64 | # Recent changes data hook |
65 | | -global $wgHooks; |
66 | 65 | $wgHooks['RecentChange_save'][] = 'efUpdateCheckUserData'; |
67 | 66 | $wgHooks['EmailUser'][] = 'efUpdateCUEmailData'; |
68 | 67 | $wgHooks['User::mailPasswordInternal'][] = 'efUpdateCUPasswordResetData'; |
— | — | @@ -71,6 +70,15 @@ |
72 | 71 | $wgHooks['LoadExtensionSchemaUpdates'][] = 'efCheckUserSchemaUpdates'; |
73 | 72 | $wgHooks['ContributionsToolLinks'][] = 'efLoadCheckUserLink'; |
74 | 73 | |
| 74 | +$wgResourceModules['ext.checkUser'] = array( |
| 75 | + 'scripts' => 'checkuser.js', |
| 76 | + 'dependencies' => array( 'mediawiki.legacy.block' ), // IP stuff |
| 77 | + 'localBasePath' => dirname( __FILE__ ), |
| 78 | + 'remoteExtPath' => 'CheckUser', |
| 79 | +); |
| 80 | + |
| 81 | +// TODO: move hooks to CheckUser.hooks.php |
| 82 | + |
75 | 83 | /** |
76 | 84 | * Hook function for RecentChange_save |
77 | 85 | * Saves user data into the cu_changes table |
Index: branches/REL1_17/extensions/CheckUser/checkuser.js |
— | — | @@ -6,7 +6,7 @@ |
7 | 7 | * This function calculates the common range of a list of |
8 | 8 | * IPs. It should be set to update on keyUp. |
9 | 9 | */ |
10 | | -function updateCIDRresult() { |
| 10 | +window.updateCIDRresult = function() { |
11 | 11 | var form = document.getElementById( 'mw-checkuser-cidrform' ); |
12 | 12 | if( !form ) { |
13 | 13 | return; // no JS form |
— | — | @@ -20,7 +20,7 @@ |
21 | 21 | // Each line should have one IP or range |
22 | 22 | if( text.indexOf("\n") != -1 ) { |
23 | 23 | var ips = text.split("\n"); |
24 | | - // Try some other delimiters too |
| 24 | + // Try some other delimiters too... |
25 | 25 | } else if( text.indexOf("\t") != -1 ) { |
26 | 26 | var ips = text.split("\t"); |
27 | 27 | } else if( text.indexOf(",") != -1 ) { |
— | — | @@ -35,24 +35,29 @@ |
36 | 36 | var bin_prefix = 0; |
37 | 37 | var prefix_cidr = 0; |
38 | 38 | var prefix = new String( '' ); |
| 39 | + var foundV4 = false; |
| 40 | + var foundV6 = false; |
39 | 41 | // Go through each IP in the list, get its binary form, and |
40 | 42 | // track the largest binary prefix among them... |
41 | 43 | for( var i = 0; i < ips.length; i++ ) { |
42 | 44 | var invalid = false; |
43 | 45 | // ...in the spirit of block.js, call this "addy" |
44 | | - var addy = ips[i]; |
45 | | - // @TODO: get some core JS IP functions |
| 46 | + var addy = ips[i].replace(/^\s*|\s*$/, '' ); // trim |
46 | 47 | // Match the first IP in each list (ignore other garbage) |
47 | | - var ipV4 = addy.match(/(^|\b)(\d+\.\d+\.\d+\.\d+)(\/\d+)?\b/); |
48 | | - // Regexp has 3 cases: (starts with '::',ends with '::',neither) |
49 | | - var ipV6 = !addy.match(/::.*::/) // not ambiguous |
50 | | - && addy.match(/(^|\b)(:(:[0-9A-Fa-f]{1,4}){1,7}|[0-9A-Fa-f]{1,4}(::?[0-9A-Fa-f]{1,4}){0,6}::|[0-9A-Fa-f]{1,4}(::?[0-9A-Fa-f]{1,4}){1,7})(\/\d+)?\b/); |
| 48 | + var ipV4 = isIPv4Address( addy, true ); // from block.js |
| 49 | + var ipV6 = isIPv6Address( addy, true ); // from block.js |
| 50 | + var ip_cidr = addy.match(/^(.*)(?:\/(\d+))?$/); |
51 | 51 | // Binary form |
52 | 52 | var bin = new String( '' ); |
53 | 53 | // Convert the IP to binary form: IPv4 |
54 | 54 | if( ipV4 ) { |
55 | | - var ip = ipV4[2]; |
56 | | - var cidr = ipV4[3]; // CIDR, if it exists |
| 55 | + foundV4 = true; |
| 56 | + if ( foundV6 ) { // disjoint address space |
| 57 | + prefix = ''; |
| 58 | + break; |
| 59 | + } |
| 60 | + var ip = ip_cidr[1]; |
| 61 | + var cidr = ip_cidr[2] ? ip_cidr[2] : null; // CIDR, if it exists |
57 | 62 | // Get each quad integer |
58 | 63 | var blocs = ip.split('.'); |
59 | 64 | // IANA 1.0.0.0/8, 2.0.0.0/8 |
— | — | @@ -77,7 +82,6 @@ |
78 | 83 | prefix = ''; // Rebuild formatted bin_prefix for each IP |
79 | 84 | // Apply any valid CIDRs |
80 | 85 | if( cidr ) { |
81 | | - cidr = cidr.match( /\d+$/ )[0]; // get rid of slash |
82 | 86 | bin = bin.substring( 0, cidr ); // truncate bin |
83 | 87 | } |
84 | 88 | // Init bin_prefix |
— | — | @@ -122,14 +126,15 @@ |
123 | 127 | } |
124 | 128 | // Convert the IP to binary form: IPv6 |
125 | 129 | } else if( ipV6 ) { |
126 | | - var ip = ipV6[2]; |
127 | | - var cidr = ipV6[0].match( /\/\d+$/ ); |
128 | | - cidr = cidr ? cidr[0] : false; |
129 | | - var abbrevs = ip.match( /::/g ); |
130 | | - if( abbrevs && abbrevs.length > 1 ) { |
131 | | - continue; // bad IP! |
| 130 | + foundV6 = true; |
| 131 | + if ( foundV4 ) { // disjoint address space |
| 132 | + prefix = ''; |
| 133 | + break; |
132 | 134 | } |
| 135 | + var ip = ip_cidr[1]; |
| 136 | + var cidr = ip_cidr[2] ? ip_cidr[2] : null; // CIDR, if it exists |
133 | 137 | // Expand out "::"s |
| 138 | + var abbrevs = ip.match( /::/g ); |
134 | 139 | if( abbrevs && abbrevs.length > 0 ) { |
135 | 140 | var colons = ip.match( /:/g ); |
136 | 141 | var needed = 7 - ( colons.length - 2 ); // 2 from "::" |
— | — | @@ -139,7 +144,8 @@ |
140 | 145 | needed--; |
141 | 146 | } |
142 | 147 | ip = ip.replace( '::', insert + ':' ); |
143 | | - // For IPs that start with "::", correct the final IP so that it starts with '0' and not ':' |
| 148 | + // For IPs that start with "::", correct the final IP |
| 149 | + // so that it starts with '0' and not ':' |
144 | 150 | if( ip[0] == ':' ) { |
145 | 151 | ip = '0' + ip; |
146 | 152 | } |
— | — | @@ -165,7 +171,6 @@ |
166 | 172 | prefix = ''; // Rebuild formatted bin_prefix for each IP |
167 | 173 | // Apply any valid CIDRs |
168 | 174 | if( cidr ) { |
169 | | - cidr = cidr.match( /\d+$/ )[0]; // get rid of slash |
170 | 175 | bin = bin.substring( 0, cidr ); // truncate bin |
171 | 176 | } |
172 | 177 | // Init bin_prefix |
— | — | @@ -228,7 +233,7 @@ |
229 | 234 | addOnloadHook( updateCIDRresult ); |
230 | 235 | |
231 | 236 | // Utility function to convert hex to integers |
232 | | -function hex2int( hex ) { |
| 237 | +window.hex2int = function( hex ) { |
233 | 238 | hex = new String( hex ); |
234 | 239 | hex = hex.toLowerCase(); |
235 | 240 | var intform = 0; |