Index: trunk/extensions/ArticleFeedback/modules/jquery.articleFeedback/jquery.articleFeedback.css |
— | — | @@ -320,7 +320,7 @@ |
321 | 321 | } |
322 | 322 | |
323 | 323 | .articleFeedback-expertise-options label { |
324 | | - line-height: 1.6em; |
| 324 | + line-height: 1.6em; |
325 | 325 | } |
326 | 326 | |
327 | 327 | .articleFeedback-expertise-options .articleFeedback-helpimprove-email { |
Index: trunk/extensions/ClickTracking/modules/ext.clickTracking.special.js |
— | — | @@ -3,40 +3,18 @@ |
4 | 4 | */ |
5 | 5 | |
6 | 6 | ( function( $ ) { |
7 | | - /* Very limited JSON encoder */ |
8 | | - $.json_encode = function( js_obj ) { |
9 | | - var returnstr = "{ "; |
10 | 7 | |
11 | | - // trailing commas and json don't mix |
12 | | - var propertynum = 0; |
13 | | - for ( property in js_obj ) { |
14 | | - if ( propertynum > 0 ) { |
15 | | - returnstr += ", "; |
16 | | - } |
17 | | - returnstr += "\"" + property + "\"" + " : "; |
18 | | - if ( typeof js_obj[property] == 'object' ) { |
19 | | - returnstr += $.json_encode( js_obj[property] ); |
20 | | - } else { |
21 | | - returnstr += "\"" + js_obj[property] + "\" "; |
22 | | - } |
23 | | - propertynum++; |
24 | | - } |
25 | | - |
26 | | - returnstr += " }"; |
27 | | - return returnstr; |
28 | | - }; |
29 | | - |
30 | 8 | $.getUserDefsFromDialog = function() { |
31 | | - var currUserDefs = new Array(); |
| 9 | + var currUserDefs = []; |
32 | 10 | if ( $( '#anon_users_checkbox' ).is( ':checked' ) ) { |
33 | | - currUserDefs['anonymous'] = 1; |
| 11 | + currUserDefs.anonymous = 1; |
34 | 12 | } else { |
35 | | - currUserDefs['anonymous'] = 0; |
| 13 | + currUserDefs.anonymous = 0; |
36 | 14 | } |
37 | 15 | |
38 | 16 | var getCheckBoxData = function( contribName ) { |
39 | 17 | if ( $( '#' + contribName + '_checkbox' ).is( ':checked' ) ) { |
40 | | - currUserDefs[contribName] = new Array(); |
| 18 | + currUserDefs[contribName] = []; |
41 | 19 | } else { |
42 | 20 | return; |
43 | 21 | } |
— | — | @@ -47,25 +25,25 @@ |
48 | 26 | if ( $( '#' + contribName + '_' + i + '_checkbox' ).is( ':checked' ) ) { |
49 | 27 | $( '#' + contribName + '_' + i + '_ltgt' ).children().each( function() { |
50 | 28 | if ( $( this ).is( ':selected' ) ) { |
51 | | - var currentCond = new Array(); |
| 29 | + var currentCond = []; |
52 | 30 | switch ( $( this ).attr( "value" ) ) { |
53 | 31 | case 'lt': |
54 | | - currentCond['operation'] = '<'; |
| 32 | + currentCond.operation = '<'; |
55 | 33 | break; |
56 | 34 | case 'lteq': |
57 | | - currentCond['operation'] = '<='; |
| 35 | + currentCond.operation = '<='; |
58 | 36 | break; |
59 | 37 | case 'gt': |
60 | | - currentCond['operation'] = '>'; |
| 38 | + currentCond.operation = '>'; |
61 | 39 | break; |
62 | 40 | case 'gteq': |
63 | | - currentCond['operation'] = '>='; |
| 41 | + currentCond.operation = '>='; |
64 | 42 | break; |
65 | 43 | default: |
66 | | - currentCond['operation'] = '<'; |
| 44 | + currentCond.operation = '<'; |
67 | 45 | break; |
68 | 46 | } |
69 | | - currentCond['value'] = $( '#' + contribName + '_' + i + '_text' ).val(); |
| 47 | + currentCond.value = $( '#' + contribName + '_' + i + '_text' ).val(); |
70 | 48 | currUserDefs[contribName].push( currentCond ); |
71 | 49 | } |
72 | 50 | } ); |
— | — | @@ -128,7 +106,7 @@ |
129 | 107 | cOpt1.addClass( 'number_select_ltgt_opt' ); |
130 | 108 | cOpt1.attr( 'value', 'lt' ); |
131 | 109 | cOpt1.text( '<' ); |
132 | | - if ( condition['operation'] == '<' ) { |
| 110 | + if ( condition.operation == '<' ) { |
133 | 111 | cOpt1.attr( 'selected', true ); |
134 | 112 | } |
135 | 113 | |
— | — | @@ -136,7 +114,7 @@ |
137 | 115 | cOpt2.addClass( 'number_select_ltgt_opt' ); |
138 | 116 | cOpt2.attr( 'value', 'gt' ); |
139 | 117 | cOpt2.text( '>' ); |
140 | | - if ( condition['operation'] == '>' ) { |
| 118 | + if ( condition.operation == '>' ) { |
141 | 119 | cOpt2.attr( 'selected', true ); |
142 | 120 | } |
143 | 121 | |
— | — | @@ -144,7 +122,7 @@ |
145 | 123 | cOpt3.addClass( 'number_select_ltgt_opt' ); |
146 | 124 | cOpt3.attr( 'value', 'lteq' ); |
147 | 125 | cOpt3.text( '<=' ); |
148 | | - if ( condition['operation'] == '<=' ) { |
| 126 | + if ( condition.operation == '<=' ) { |
149 | 127 | cOpt3.attr( 'selected', true ); |
150 | 128 | } |
151 | 129 | |
— | — | @@ -152,7 +130,7 @@ |
153 | 131 | cOpt4.addClass( 'number_select_ltgt_opt' ); |
154 | 132 | cOpt4.attr( 'value', 'gteq' ); |
155 | 133 | cOpt4.text( '>=' ); |
156 | | - if ( condition['operation'] == '>=' ) { |
| 134 | + if ( condition.operation == '>=' ) { |
157 | 135 | cOpt4.attr( 'selected', true ); |
158 | 136 | } |
159 | 137 | |
— | — | @@ -164,7 +142,7 @@ |
165 | 143 | |
166 | 144 | cTextInput = $( '<input></input>' ).attr( 'id', contribName + '_' + counter + '_text' ); |
167 | 145 | cTextInput.addClass( 'number_select_text' ); |
168 | | - cTextInput.attr( 'value', condition['value'] ); |
| 146 | + cTextInput.attr( 'value', condition.value ); |
169 | 147 | conditionDiv.append( cTextInput ); |
170 | 148 | |
171 | 149 | return conditionDiv; |
— | — | @@ -188,9 +166,9 @@ |
189 | 167 | var totalConds = initDiv.data( 'totalConditions' ); |
190 | 168 | totalConds++; |
191 | 169 | initDiv.data( 'totalConditions', totalConds ); |
192 | | - var tmpCond = new Array(); |
193 | | - tmpCond['operation'] = ' '; |
194 | | - tmpCond['value'] = ' '; |
| 170 | + var tmpCond = []; |
| 171 | + tmpCond.operation = ' '; |
| 172 | + tmpCond.value = ' '; |
195 | 173 | |
196 | 174 | buildConditionDiv( tmpCond, totalConds ).insertBefore( $( this ) ); |
197 | 175 | initDiv.data( 'totalConditions', totalConds, false ); |
— | — | @@ -201,7 +179,7 @@ |
202 | 180 | |
203 | 181 | // check anonymous |
204 | 182 | var anon = false; |
205 | | - if ( parseInt( userDef['anonymous'] ) == 1 ) { |
| 183 | + if ( parseInt( userDef.anonymous ) == 1 ) { |
206 | 184 | anon = true; |
207 | 185 | } |
208 | 186 | $( '#anon_users_checkbox' ).attr( 'checked', anon ); |
— | — | @@ -212,7 +190,7 @@ |
213 | 191 | var setup_set_contribs = function( contribName ) { |
214 | 192 | var current_contribs = userDef[contribName]; |
215 | 193 | if ( current_contribs == undefined ) { |
216 | | - current_contribs = new Array(); |
| 194 | + current_contribs = []; |
217 | 195 | } |
218 | 196 | $( '#contrib_opts_container' ).append( setContribs( current_contribs, contribName ) ); |
219 | 197 | }; |
— | — | @@ -250,15 +228,15 @@ |
251 | 229 | return retval; |
252 | 230 | }; |
253 | 231 | |
254 | | - max1 = getMax( data['datapoints']['expert'] ); |
255 | | - max2 = getMax( data['datapoints']['intermediate'] ); |
256 | | - max3 = getMax( data['datapoints']['basic'] ); |
| 232 | + max1 = getMax( data.datapoints.expert ); |
| 233 | + max2 = getMax( data.datapoints.intermediate ); |
| 234 | + max3 = getMax( data.datapoints.basic ); |
257 | 235 | max = Math.max( max3, Math.max( max1, max2 ) ); |
258 | 236 | chartURL = 'http://chart.apis.google.com/chart?' + 'chs=400x400&' + 'cht=lc&' |
259 | 237 | + 'chco=FF0000,0000FF,00FF00&' + 'chtt=' + event_name + ' from ' + $( '#start_date' ).val() |
260 | 238 | + ' to ' + $( '#end_date' ).val() + '&' + 'chdl=' + 'Expert|Intermediate|Beginner' + '&' |
261 | | - + 'chxt=x,y&' + 'chd=t:' + data['datapoints']['expert'].join( ',' ) + '|' |
262 | | - + data['datapoints']['intermediate'].join( ',' ) + '|' + data['datapoints']['basic'].join( ',' ) |
| 239 | + + 'chxt=x,y&' + 'chd=t:' + data.datapoints.expert.join( ',' ) + '|' |
| 240 | + + data.datapoints.intermediate.join( ',' ) + '|' + data.datapoints.basic.join( ',' ) |
263 | 241 | + '&' + 'chds=0,' + max + ',0,' + max + ',0,' + max; |
264 | 242 | $( '#chart_img' ).attr( 'src', chartURL ); |
265 | 243 | }; |
— | — | @@ -281,7 +259,7 @@ |
282 | 260 | 'increment' : $( '#chart_increment' ).val(), |
283 | 261 | 'startdate' : start_date, |
284 | 262 | 'enddate' : end_date, |
285 | | - 'userdefs' : $.json_encode( wgClickTrackUserDefs ) |
| 263 | + 'userdefs' : $.toJSON( wgClickTrackUserDefs ) |
286 | 264 | }, processChartJSON, 'json' ); |
287 | 265 | }; |
288 | 266 | |
— | — | @@ -341,21 +319,27 @@ |
342 | 320 | var bval = rval; |
343 | 321 | rgbString = 'rgb(' + parseInt( rval ) + ',' + parseInt( gval ) + ',' + parseInt( bval ) + ')'; |
344 | 322 | $( this ).data( 'rgb', rgbString ); |
345 | | - $( this ).css( 'color', rgbString ); |
346 | | - $( this ).css( 'background-color', rgbString ); |
| 323 | + $( this ).css( { |
| 324 | + 'color': rgbString, |
| 325 | + 'background-color': rgbString |
| 326 | + } ); |
347 | 327 | } ); |
348 | 328 | |
349 | 329 | // I wanted to do this with classes, but the element's style rule wins over class rule |
350 | 330 | // and each element has its own alternative color |
351 | 331 | $( '.event_data' ).mouseover( function() { |
352 | | - $( this ).css( 'color', '#000000' ); |
353 | | - $( this ).css( 'background-color', '#FFFFFF' ); |
| 332 | + $( this ).css( { |
| 333 | + 'color': '#000000', |
| 334 | + 'background-color': '#FFFFFF' |
| 335 | + } ); |
354 | 336 | } ); |
355 | 337 | |
356 | 338 | $( '.event_data' ).mouseout( function() { |
357 | 339 | rgbString = $( this ).data( 'rgb' ); |
358 | | - $( this ).css( 'color', rgbString ); |
359 | | - $( this ).css( 'background-color', rgbString ); |
| 340 | + $( this ).css( { |
| 341 | + 'color': rgbString, |
| 342 | + 'background-color': rgbString |
| 343 | + } ); |
360 | 344 | } ); |
361 | 345 | |
362 | 346 | }; // colorize |
— | — | @@ -363,22 +347,21 @@ |
364 | 348 | $.updateTable = function() { |
365 | 349 | var processTableJSON = function( data, status ) { |
366 | 350 | // clear |
367 | | - $( '.table_data_row' ).each( function() { |
368 | | - $( this ).remove(); |
369 | | - } ); |
| 351 | + $( '.table_data_row' ).remove(); |
370 | 352 | |
371 | 353 | var row_count = 0; |
372 | | - for ( var row_iter in data['tablevals']['vals'] ) { |
373 | | - var row = data['tablevals']['vals'][row_iter]; // really, JS? |
| 354 | + for ( var row_iter in data.tablevals.vals ) { |
| 355 | + var row = data.tablevals.vals[row_iter]; // really, JS? |
374 | 356 | row_count++; |
375 | 357 | |
376 | 358 | var outputRow = $( '<tr></tr>' ); |
377 | 359 | outputRow.addClass( 'table_data_row' ); |
378 | 360 | |
379 | 361 | var cell = $( '<td></td>' ).attr( 'id', 'event_name_' + row_count ); |
380 | | - cell.addClass( 'event_name' ); |
381 | | - cell.attr( 'value', row['event_id'] ); |
382 | | - cell.text( row['event_name'] ); |
| 362 | + cell |
| 363 | + .addClass( 'event_name' ) |
| 364 | + .attr( 'value', row.event_id ) |
| 365 | + .text( row.event_name ); |
383 | 366 | outputRow.append( cell ); |
384 | 367 | |
385 | 368 | var createClassCell = function( userclass ) { |
— | — | @@ -419,7 +402,7 @@ |
420 | 403 | 'increment' : $( '#chart_increment' ).val(), |
421 | 404 | 'startdate' : start_date, |
422 | 405 | 'enddate' : end_date, |
423 | | - 'userdefs' : $.json_encode( wgClickTrackUserDefs ), |
| 406 | + 'userdefs' : $.toJSON( wgClickTrackUserDefs ), |
424 | 407 | 'tabledata' : 1 |
425 | 408 | }, processTableJSON, 'json' ); |
426 | 409 | |
— | — | @@ -496,11 +479,12 @@ |
497 | 480 | |
498 | 481 | // Change user/intermediate/expert dialogs |
499 | 482 | var loadHeaderInfo = function( headerName ) { |
500 | | - $( '#' + headerName + '_header' ).css( 'cursor', 'pointer' ); |
501 | | - $( '#' + headerName + '_header' ).click( function() { |
502 | | - $.renderUserDefDialogWith( wgClickTrackUserDefs[headerName], headerName ); |
503 | | - $( '#user_def_dialog' ).dialog( 'open' ); |
504 | | - } ); |
| 483 | + $( '#' + headerName + '_header' ) |
| 484 | + .css( 'cursor', 'pointer' ) |
| 485 | + .click( function() { |
| 486 | + $.renderUserDefDialogWith( wgClickTrackUserDefs[headerName], headerName ); |
| 487 | + $( '#user_def_dialog' ).dialog( 'open' ); |
| 488 | + } ); |
505 | 489 | }; // headername |
506 | 490 | |
507 | 491 | loadHeaderInfo( 'basic' ); |
— | — | @@ -509,21 +493,22 @@ |
510 | 494 | }; |
511 | 495 | |
512 | 496 | $.changeDataLinks = function() { |
513 | | - $( '.event_name' ).each( function() { |
514 | | - $( this ).css( 'cursor', 'pointer' ); |
515 | | - |
516 | | - $( this ).click( function() { |
| 497 | + $( '.event_name' ) |
| 498 | + .css( 'cursor', 'pointer' ) |
| 499 | + .click( function() { |
517 | 500 | $( '#chart_img' ).data( 'eventid', $( this ).attr( 'value' ) ); |
518 | 501 | $( '#chart_img' ).data( 'event_name', $( this ).text() ); |
519 | 502 | $.updateChart(); |
520 | 503 | } ); // click |
521 | | - } ); // each |
522 | 504 | }; // addlink |
523 | 505 | |
524 | | - return $( this ); |
525 | | -} )( jQuery ); |
| 506 | + // @FIXME: Where is this supposed to return to -- Krinkle 2011-04-27 |
| 507 | + // - commented out for now. |
| 508 | + //return $( this ); |
526 | 509 | |
527 | 510 | // colorize the table on document.ready |
528 | | -$( document ).ready( $.colorizeTable ); |
529 | | -$( document ).ready( $.changeDataLinks ); |
530 | | -$( document ).ready( $.setUIControls ); |
\ No newline at end of file |
| 511 | +$( $.colorizeTable ); |
| 512 | +$( $.changeDataLinks ); |
| 513 | +$( $.setUIControls ); |
| 514 | + |
| 515 | +} )( jQuery ); |
Index: trunk/extensions/ClickTracking/modules/ext.clickTracking.js |
— | — | @@ -2,16 +2,14 @@ |
3 | 3 | * JavaScript for ClickTracking extension |
4 | 4 | */ |
5 | 5 | |
6 | | -( function( $ ) { |
| 6 | +jQuery( function( $ ) { |
7 | 7 | // Add click tracking hooks to the sidebar |
8 | | - $( document ).ready( function() { |
9 | | - $( '#p-logo a, #p-navigation a, #p-interaction a, #p-tb a' ).each( function() { |
10 | | - var href = $( this ).attr( 'href' ); |
11 | | - // Only modify local URLs |
12 | | - if ( href.length > 0 && href[0] == '/' && ( href.length == 1 || href[1] != '/' ) ) { |
13 | | - var id = 'leftnav-' + skin + '-' + ( $( this ).attr( 'id' ) || $( this ).parent().attr( 'id' ) ); |
14 | | - $( this ).attr( 'href', $.trackActionURL( href, id ) ); |
15 | | - } |
16 | | - } ); |
| 8 | + $( '#p-logo a, #p-navigation a, #p-interaction a, #p-tb a' ).each( function() { |
| 9 | + var $el = $(this), href = $el.attr( 'href' ); |
| 10 | + // Only modify local URLs |
| 11 | + if ( href.length > 0 && href[0] == '/' && ( href.length == 1 || href[1] != '/' ) ) { |
| 12 | + var id = 'leftnav-' + skin + '-' + ( $el.attr( 'id' ) || $el.parent().attr( 'id' ) ); |
| 13 | + $el.attr( 'href', $.trackActionURL( href, id ) ); |
| 14 | + } |
17 | 15 | } ); |
18 | | -} )( jQuery ); |
\ No newline at end of file |
| 16 | +} )(); |
\ No newline at end of file |
Index: trunk/extensions/ClickTracking/ClickTracking.php |
— | — | @@ -85,7 +85,7 @@ |
86 | 86 | $wgResourceModules['ext.clickTracking.special'] = array( |
87 | 87 | 'scripts' => 'ext.clickTracking.special.js', |
88 | 88 | 'styles' => 'ext.clickTracking.special.css', |
89 | | - 'dependencies' => array( 'jquery.ui.datepicker', 'jquery.ui.dialog' ), |
| 89 | + 'dependencies' => array( 'jquery.json.js', 'jquery.ui.datepicker', 'jquery.ui.dialog' ), |
90 | 90 | ) + $ctResourceTemplate; |
91 | 91 | $wgResourceModules['ext.UserBuckets'] = array( |
92 | 92 | 'scripts' => 'ext.UserBuckets.js', |