r58221 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r58220‎ | r58221 | r58222 >
Date:21:14, 27 October 2009
Author:nimishg
Status:deferred
Tags:
Comment:
changed JQuery node creation method; changed date types back from timestamp to int in clicktracking api
Modified paths:
  • /trunk/extensions/UsabilityInitiative/ClickTracking/ApiSpecialClickTracking.php (modified) (history)
  • /trunk/extensions/UsabilityInitiative/ClickTracking/SpecialClickTracking.js (modified) (history)
  • /trunk/extensions/UsabilityInitiative/ClickTracking/SpecialClickTracking.php (modified) (history)

Diff [purge]

Index: trunk/extensions/UsabilityInitiative/ClickTracking/SpecialClickTracking.php
@@ -34,8 +34,8 @@
3535 $this->user_defs["intermediate"] = array(
3636 "anonymous" => "0",
3737 "total_contribs" => array(
38 - array("operation" => "<", "value" => "400"),
39 - array("operation" => ">", "value" => "10"),
 38+ array("operation" => "<", "value" => "10"),
 39+ array("operation" => ">", "value" => "400"),
4040 ),
4141 );
4242
@@ -202,14 +202,14 @@
203203 $control .= Xml::openElement("form", array("id" => "user_definition_form", "class" => "user_def_form"));
204204 $control .= Xml::openElement("fieldset", array("id" => "user_def_alter_fieldset"));
205205 $control .= Xml::openElement("legend", array("id" => "user_def_alter_legend"));
206 - $control .= wfMsg( "editing" );
 206+ $control .= wfMsg( "ct-editing" );
207207 $control .= Xml::closeElement("legend");
208208
209209 //[] anonymous users?
210210 $control .= Xml::openElement("div", array("id" => "anon_users_div", "class" => "checkbox_div control_div"));
211211 $control .= Xml::openElement("input", array("type" => "checkbox", "id" => "anon_users_checkbox", "class" => "user_def_checkbox"));
212212 $control .= Xml::closeElement("input");
213 - $control .= wfMsg("anon-users");
 213+ $control .= wfMsg("ct-anon-users");
214214 $control .= Xml::closeElement("div");
215215
216216 // ----------------
@@ -221,7 +221,7 @@
222222 $control .= Xml::openElement("div", array("id" => "total_users_contrib_div", "class" => "checkbox_div control_div"));
223223 $control .= Xml::openElement("input", array("type" => "checkbox", "id" => "contrib_checkbox", "class" => "user_def_checkbox"));
224224 $control .= Xml::closeElement("input");
225 - $control .= wfMsg("user-contribs");
 225+ $control .= wfMsg("ct-user-contribs");
226226
227227
228228 $control .= Xml::closeElement("div");
@@ -232,7 +232,7 @@
233233 $control .= Xml::openElement("div", array("id" => "contrib_span_1_text_div", "class" => "checkbox_div"));
234234 $control .= Xml::openElement("input", array("type" => "checkbox", "id" => "contrib_span_1_checkbox", "class" => "user_def_checkbox"));
235235 $control .= Xml::closeElement("input");
236 - $control .= wfMsg("user-span") . " 1";
 236+ $control .= wfMsg("ct-user-span") . " 1";
237237 $control .= Xml::closeElement("div");
238238 $control .= Xml::closeElement("div");
239239
@@ -242,7 +242,7 @@
243243 $control .= Xml::openElement("div", array("id" => "contrib_span_2_text_div", "class" => "checkbox_div"));
244244 $control .= Xml::openElement("input", array("type" => "checkbox", "id" => "contrib_span_2_checkbox", "class" => "user_def_checkbox"));
245245 $control .= Xml::closeElement("input");
246 - $control .= wfMsg("user-span") . " 2";
 246+ $control .= wfMsg("ct-user-span") . " 2";
247247 $control .= Xml::closeElement("div");
248248 $control .= Xml::closeElement("div");
249249
@@ -252,7 +252,7 @@
253253 $control .= Xml::openElement("div", array("id" => "contrib_span_3_text_div", "class" => "checkbox_div"));
254254 $control .= Xml::openElement("input", array("type" => "checkbox", "id" => "contrib_span_3_checkbox", "class" => "user_def_checkbox"));
255255 $control .= Xml::closeElement("input");
256 - $control .= wfMsg("user-span") . " 3";
 256+ $control .= wfMsg("ct-user-span") . " 3";
257257 $control .= Xml::closeElement("div");
258258 $control .= Xml::closeElement("div");
259259
@@ -419,7 +419,6 @@
420420 $userDefs = json_decode($userDefs, true);
421421 }
422422
423 -
424423 $events = self::getTopEvents($minTime, $maxTime);
425424
426425 $returnArray = array();
@@ -500,7 +499,8 @@
501500 }
502501 else {
503502
504 - return "WHERE `action_time` >= '$minTime' AND `action_time` <= '$maxTime'";
 503+ return "WHERE `action_time` >= '$minTime' AND `action_time` <= '$maxTime'";
 504+
505505 }
506506
507507 }
@@ -524,10 +524,9 @@
525525 $normalize = "(select distinct session_id, event_id from click_tracking $time_constraint_statement) as t1";
526526 $time_constraint = "";
527527 }
528 - $join = " ";
529528 $sql = "select count(event_id) as totalevtid, event_id,event_name from $normalize" .
530529 " LEFT JOIN click_tracking_events ON event_id=click_tracking_events.id".
531 - " $time_constraint group by event_id order by totalevtid desc";
 530+ " $time_constraint group by event_id order by totalevtid desc";
532531
533532 //returns count(event_id),event_id, event_name, top one first
534533 $dbr = wfGetDB( DB_SLAVE );
Index: trunk/extensions/UsabilityInitiative/ClickTracking/SpecialClickTracking.js
@@ -81,6 +81,7 @@
8282 $("#user_def_alter_legend").text($("#user_def_alter_legend").data("defaultChangeText") + " " + defName);
8383 $("#user_def_alter_legend").data("currentlyEditing", defName);
8484
 85+
8586 var setContribs = function( conditionArray, contribName ) {
8687 initialDiv = $("<div></div>").attr('id', contribName + '_div');
8788 initialDiv.addClass('checkbox_div');
@@ -106,15 +107,18 @@
107108 conditionDiv.addClass( 'checkbox_div' );
108109 conditionDiv.addClass( 'sub_option_div' );
109110
 111+
110112 //initialDiv.append(conditionDiv);
111 - cCheckbox = $("<input></input>").attr('id', contribName + '_' + counter + '_checkbox');
112 - cCheckbox.attr('type', 'checkbox');
 113+ cCheckbox = $("<input type=\"checkbox\"></input>").attr('id', contribName + '_' + counter + '_checkbox');
 114+ //cCheckbox.attr('type', 'checkbox');
113115 if( isChecked ) {
114116 cCheckbox.attr( 'checked', true );
115117 }
 118+
116119 cCheckbox.addClass( 'number_select_checkbox' );
117120 conditionDiv.append( cCheckbox );
118 -
 121+
 122+
119123 cSelect = $("<select></select>").attr('id', contribName + '_' + counter + '_ltgt');
120124 cSelect.addClass( 'number_select_ltgt' );
121125
@@ -126,6 +130,7 @@
127131 cOpt1.attr( 'selected', true );
128132 }
129133
 134+
130135 cOpt2 = $("<option></option>").attr('id', contribName + '_' + counter + '_gt');
131136 cOpt2.addClass( 'number_select_ltgt_opt' );
132137 cOpt2.attr( 'value', 'gt' );
@@ -160,6 +165,7 @@
161166 cTextInput.addClass( 'number_select_text' );
162167 cTextInput.attr( 'value', condition['value'] );
163168 conditionDiv.append( cTextInput );
 169+
164170 return conditionDiv;
165171 };
166172
@@ -169,6 +175,7 @@
170176 var conditionDiv = buildConditionDiv( conditionArray[condition], i, true );
171177 initialDiv.append( conditionDiv );
172178 } // forloop
 179+
173180 initialDiv.data( 'totalConditions', i );
174181 addConditions = $("<div></div>").attr('id', contribName + '_addbutton');
175182 addConditions.data( 'contribName', contribName );
Index: trunk/extensions/UsabilityInitiative/ClickTracking/ApiSpecialClickTracking.php
@@ -105,10 +105,10 @@
106106 ApiBase::PARAM_MIN => 1
107107 ),
108108 'startdate' => array(
109 - ApiBase::PARAM_TYPE => 'timestamp'
 109+ ApiBase::PARAM_TYPE => 'integer'
110110 ),
111111 'enddate' => array(
112 - ApiBase::PARAM_TYPE => 'timestamp'
 112+ ApiBase::PARAM_TYPE => 'integer'
113113 ),
114114 'increment' => array(
115115 ApiBase::PARAM_TYPE => 'integer',

Status & tagging log