Index: trunk/extensions/ClickTracking/modules/jquery.clickTracking.js |
— | — | @@ -21,7 +21,7 @@ |
22 | 22 | } |
23 | 23 | /** |
24 | 24 | * Performs click tracking API call |
25 | | - * |
| 25 | + * |
26 | 26 | * @param {string} id event identifier |
27 | 27 | */ |
28 | 28 | $.trackAction = function( id ) { |
— | — | @@ -49,8 +49,7 @@ |
50 | 50 | }, options); |
51 | 51 | |
52 | 52 | if ( ! options.id ) { |
53 | | - $.error("You must specify an event ID"); |
54 | | - return; |
| 53 | + throw new Error("You must specify an event ID"); |
55 | 54 | } |
56 | 55 | |
57 | 56 | var data = { |
— | — | @@ -60,15 +59,15 @@ |
61 | 60 | 'token': options.token |
62 | 61 | }; |
63 | 62 | |
64 | | - if ( typeof options.namespace != 'undefined' ) { |
| 63 | + if ( options.namespace === undefined ) { |
65 | 64 | data.namespacenumber = options.namespace; |
66 | 65 | } |
67 | 66 | |
68 | | - if ( typeof options.info != 'undefined' ) { |
| 67 | + if ( options.info === undefined ) { |
69 | 68 | data.additional = options.info; |
70 | 69 | } |
71 | 70 | |
72 | | - $.post( mw.config.get( 'wgScriptPath' ) + '/api.php', data); |
| 71 | + $.post( mw.util.wikiScript( 'api' ), data); |
73 | 72 | }; |
74 | 73 | |
75 | 74 | /** |