r62342 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r62341‎ | r62342 | r62343 >
Date:23:18, 11 February 2010
Author:werdna
Status:ok
Tags:
Comment:
LiquidThreads alpha updates: Merge r62114-62229. Merging r62230 separately as it is primarily whitespace/formatting changes.
Modified paths:
  • /branches/wmf-deployment/extensions/LiquidThreads_alpha (modified) (history)
  • /branches/wmf-deployment/extensions/LiquidThreads_alpha/api/ApiFeedLQTThreads.php (modified) (history)
  • /branches/wmf-deployment/extensions/LiquidThreads_alpha/api/ApiThreadAction.php (modified) (history)
  • /branches/wmf-deployment/extensions/LiquidThreads_alpha/classes/Dispatch.php (modified) (history)
  • /branches/wmf-deployment/extensions/LiquidThreads_alpha/classes/LogFormatter.php (modified) (history)
  • /branches/wmf-deployment/extensions/LiquidThreads_alpha/classes/NewMessagesController.php (modified) (history)
  • /branches/wmf-deployment/extensions/LiquidThreads_alpha/classes/View.php (modified) (history)
  • /branches/wmf-deployment/extensions/LiquidThreads_alpha/i18n/Lqt.i18n.php (modified) (history)
  • /branches/wmf-deployment/extensions/LiquidThreads_alpha/lqt.css (modified) (history)
  • /branches/wmf-deployment/extensions/LiquidThreads_alpha/lqt.js (modified) (history)
  • /branches/wmf-deployment/extensions/LiquidThreads_alpha/lqt.sql (modified) (history)
  • /branches/wmf-deployment/extensions/LiquidThreads_alpha/newmessages.js (modified) (history)

Diff [purge]

Index: branches/wmf-deployment/extensions/LiquidThreads_alpha/i18n/Lqt.i18n.php
@@ -1474,10 +1474,6 @@
14751475 'lqt-new-messages' => '✒ Для Вас ёсьць новыя паведамленьні.',
14761476 'lqt-email-info-undo' => 'Вярнуць галіну якую Вы толькі што прапусьцілі.',
14771477 'lqt-date-info' => 'Спасылка была адключана, таму што Вы праглядаеце галіны з любымі датамі.',
1478 - 'lqt_rc_new_discussion' => 'Новае абмеркаваньне «$1» на $2. • напісанае $3:',
1479 - 'lqt_rc_new_reply' => 'Адказ ў «$1» на $2. • напісаны $3:',
1480 - 'lqt_rc_author_original' => '(пачатковы аўтар)',
1481 - 'lqt_rc_author_others' => '(не аўтар)',
14821478 'lqt-newmessages-context' => 'Поўная галіна',
14831479 'lqt-thread-created' => 'Створаная',
14841480 'lqt-history-time' => 'Час',
@@ -1509,6 +1505,8 @@
15101506 'lqt-newmessages-from' => 'Ад $1',
15111507 'lqt-hot-topics' => 'Папулярныя тэмы',
15121508 'lqt-add-reply' => 'Дадаць адказ',
 1509+ 'lqt_rc_new_discussion' => 'Новае абмеркаваньне «$1» на $2. • напісанае $3:',
 1510+ 'lqt_rc_new_reply' => 'Адказ ў «$1» на $2. • напісаны $3:',
15131511 'right-lqt-split' => 'падзел галінаў',
15141512 'right-lqt-merge' => "аб'яднаньне галінаў",
15151513 'lqt-thread-merge' => "Аб'яднаць у іншую галіну",
@@ -1521,6 +1519,11 @@
15221520 'lqt-log-name' => 'Журнал галінаў абмеркаваньняў',
15231521 'lqt-log-header' => 'Гэты журнал утрымлівае дэталі дзеяньняў, якія адбываюцца ў галінах абмеркаваньняў.',
15241522 'lqt-log-action-move' => 'перанесеная [[$1]] з [[$2]] у [[$3]].',
 1523+ 'lqt-log-action-split' => 'выдзеленая [[$1]] з [[$3]], з новай тэмай «$2».',
 1524+ 'lqt-log-action-merge-across' => 'перанесеная [[$1]] з [[$2]] у [[$3]].',
 1525+ 'lqt-log-action-merge-down' => "аб'яднаная [[$1]] у [[$3]]",
 1526+ 'lqt-log-action-subjectedit' => 'зьмененая тэма [[$1]] з «$2» на «$3»',
 1527+ 'lqt-log-action-resort' => 'зьмененая сартаваньне [[$1]]. Зьменены ключа сартаваньня з $2 на $3.',
15251528 'lqt-preference-notify-talk' => 'Дасылаць мне электронныя лісты ў выпадках адказаў у галіне, за якой я назіраю',
15261529 'lqt-preference-watch-threads' => 'Дадаваць у мой сьпіс назіраньня галіны, якія я буду ствараць альбо на якія я буду адказваць',
15271530 'prefs-lqt' => 'Галіны абмеркаваньняў',
@@ -5271,11 +5274,6 @@
52725275 'lqt-new-messages' => '✒ Vous avez de nouveaux messages.',
52735276 'lqt-email-info-undo' => 'Rétablir le fil que vous venez juste d’enlever.',
52745277 'lqt-date-info' => 'Ce lien est désactivé parce que vous êtes en train de voir les fils à partir de toutes les dates.',
5275 - 'lqt_rc_new_discussion' => 'Nouvelle discussion « $1 » sur $2. • $3 écrit :',
5276 - 'lqt_rc_new_reply' => 'Répondre à « $1 » sur $2 • $3 écrit :',
5277 - 'lqt_rc_ellipsis' => '...',
5278 - 'lqt_rc_author_original' => '(auteur original)',
5279 - 'lqt_rc_author_others' => '(n’est pas l’auteur)',
52805278 'lqt-newmessages-context' => 'Fil complet',
52815279 'lqt-thread-created' => 'Créé',
52825280 'lqt-history-time' => 'Date',
@@ -5307,6 +5305,8 @@
53085306 'lqt-newmessages-from' => 'Depuis $1',
53095307 'lqt-hot-topics' => 'Sujets brûlants',
53105308 'lqt-add-reply' => 'Ajouter une réponse',
 5309+ 'lqt_rc_new_discussion' => 'Nouvelle discussion « $1 » sur $2. • $3 écrit :',
 5310+ 'lqt_rc_new_reply' => 'Répondre à « $1 » sur $2 • $3 écrit :',
53115311 'right-lqt-split' => 'Scinder les fils de discussion',
53125312 'right-lqt-merge' => 'Fusionner les fils de discussion',
53135313 'lqt-thread-merge' => 'Fusionner dans un autre fil',
@@ -5319,6 +5319,11 @@
53205320 'lqt-log-name' => 'Journal des fils de discussion',
53215321 'lqt-log-header' => 'Ce journal détaille les actions faites sur les fils de discussion.',
53225322 'lqt-log-action-move' => 'a déplacé [[$1]] de [[$2]] vers [[$3]].',
 5323+ 'lqt-log-action-split' => 'a scindé [[$1]] sous [[$3]], avec le nouveau sujet « $2 ».',
 5324+ 'lqt-log-action-merge-across' => 'a déplacé [[$1]] depuis sous [[$2]] à sous [[$3]].',
 5325+ 'lqt-log-action-merge-down' => 'a fusionné [[$1]] au dessous de [[$3]]',
 5326+ 'lqt-log-action-subjectedit' => 'a modifié le sujet de [[$1]] de « $2 » à « $3 »',
 5327+ 'lqt-log-action-resort' => "a modifié l'ordre de tri de [[$1]]. La clé de tri a été changée de « $2 » à « $3 ».",
53235328 'lqt-preference-notify-talk' => "M’avertir par couriel lors d'une réponse sur un sujet que je suis",
53245329 'lqt-preference-watch-threads' => 'Suivre les fils de discussion que je crée ou auxquels je participe',
53255330 'prefs-lqt' => 'Discussions en fil',
@@ -9328,10 +9333,6 @@
93299334 'lqt-new-messages' => '✒ Имате нови пораки.',
93309335 'lqt-email-info-undo' => 'Врати ја штотуку отфрлената нишка.',
93319336 'lqt-date-info' => 'Оваа врска е оневозможена бидејќи прегледувате нишки од сите датуми.',
9332 - 'lqt_rc_new_discussion' => 'Нов разговор за „$1“ на $2 • $3 пишува:',
9333 - 'lqt_rc_new_reply' => 'Одговор на „$1“ на $2 • $3 пишува:',
9334 - 'lqt_rc_author_original' => '(првичен автор)',
9335 - 'lqt_rc_author_others' => '(не е авторот)',
93369337 'lqt-newmessages-context' => 'Цела нишка',
93379338 'lqt-thread-created' => 'Создадено',
93389339 'lqt-history-time' => 'Време',
@@ -9363,6 +9364,8 @@
93649365 'lqt-newmessages-from' => 'Од $1',
93659366 'lqt-hot-topics' => 'Актуелни теми',
93669367 'lqt-add-reply' => 'Додај одговор',
 9368+ 'lqt_rc_new_discussion' => 'Нов разговор за „$1“ на $2 • $3 пишува:',
 9369+ 'lqt_rc_new_reply' => 'Одговор на „$1“ на $2 • $3 пишува:',
93679370 'right-lqt-split' => 'Раздели нишки',
93689371 'right-lqt-merge' => 'Спојување нишки',
93699372 'lqt-thread-merge' => 'Спој со друга нишка',
@@ -9375,6 +9378,11 @@
93769379 'lqt-log-name' => 'Дневник на нанижани разговори',
93779380 'lqt-log-header' => 'Во овој дневник се запишуваат дејствата направени во разговорните нишки.',
93789381 'lqt-log-action-move' => '[[$1]] е преместен од [[$2]] на [[$3]].',
 9382+ 'lqt-log-action-split' => 'раздвоена [[$1]] од под [[$3]], со нов наслов „$2“.',
 9383+ 'lqt-log-action-merge-across' => 'преместена [[$1]] од под [[$2]]. Сега е под [[$3]].',
 9384+ 'lqt-log-action-merge-down' => '[[$1]] ставена (споена) под [[$3]]',
 9385+ 'lqt-log-action-subjectedit' => 'изменет насловот на [[$1]] од „$2“ на „$3“',
 9386+ 'lqt-log-action-resort' => 'изменет редоследот на сортирање на [[$1]]. Клучот за сортирање изменет од $2 на $3.',
93799387 'lqt-preference-notify-talk' => 'Испрати ми е-пошта кога некој ќе одговори на нишка која ја набљудувам',
93809388 'lqt-preference-watch-threads' => 'Набљудувај ги нишките кои ги создавам или на кои одговарам',
93819389 'prefs-lqt' => 'Нанижан разговор',
@@ -13133,10 +13141,6 @@
1313413142 'lqt-new-messages' => '✒ Du har nya meddelanden.',
1313513143 'lqt-email-info-undo' => 'Ta tillbaka tråden du precis tog bort.',
1313613144 'lqt-date-info' => 'Denna länk är avaktiverad eftersom du ser trådar från alla datum.',
13137 - 'lqt_rc_new_discussion' => 'Ny diskussion "$1" på $2 • $3 skriver:',
13138 - 'lqt_rc_new_reply' => 'Svar till "$1" på $2 • $3 skriver:',
13139 - 'lqt_rc_author_original' => '(ursprunglig författare)',
13140 - 'lqt_rc_author_others' => '(inte författaren)',
1314113145 'lqt-newmessages-context' => 'Hela tråden',
1314213146 'lqt-thread-created' => 'Skapad',
1314313147 'lqt-history-time' => 'Tid',
@@ -13168,6 +13172,8 @@
1316913173 'lqt-newmessages-from' => 'Från $1',
1317013174 'lqt-hot-topics' => 'Heta ämnen',
1317113175 'lqt-add-reply' => 'Lägg till ett svar',
 13176+ 'lqt_rc_new_discussion' => 'Ny diskussion "$1" på $2 • $3 skriver:',
 13177+ 'lqt_rc_new_reply' => 'Svar till "$1" på $2 • $3 skriver:',
1317213178 'right-lqt-split' => 'Delade trådar',
1317313179 'right-lqt-merge' => 'Slå ihop trådar',
1317413180 'lqt-thread-merge' => 'Slå ihop in i en annan tråd.',
@@ -13180,6 +13186,11 @@
1318113187 'lqt-log-name' => 'Diskussionssidor i trådform',
1318213188 'lqt-log-header' => 'Den här loggen visar händelser i diskussionstrådor.',
1318313189 'lqt-log-action-move' => 'flyttade [[$1]] från [[$2]] till [[$3]].',
 13190+ 'lqt-log-action-split' => 'delade [[$1]] från under [[$3]], med det nya ämnet "$2".',
 13191+ 'lqt-log-action-merge-across' => 'flyttade [[$1]] från under [[$2]] till under [[$3]].',
 13192+ 'lqt-log-action-merge-down' => 'slog samman [[$1]] till under [[$3]]',
 13193+ 'lqt-log-action-subjectedit' => 'ändrade ämnet för [[$1]] från "$2" till "$3"',
 13194+ 'lqt-log-action-resort' => 'modifierade sorderingsordningen för [[$1]]. Ändrade sorderingsnyckel från $2 till $3.',
1318413195 'lqt-preference-notify-talk' => 'E-posta mig när någon svarar i en tråd jag bevakar',
1318513196 'lqt-preference-watch-threads' => 'Bevaka trådar jag skapar eller svarar i',
1318613197 'prefs-lqt' => 'Trådad diskussion',
Index: branches/wmf-deployment/extensions/LiquidThreads_alpha/lqt.css
@@ -79,7 +79,7 @@
8080 font-weight: bold;
8181 }
8282
83 -.lqt_thread_permalink_summary_edit {
 83+.lqt_thread_permalink_summary_actions {
8484 float: right;
8585 margin-right: 1em;
8686 font-weight: normal;
Index: branches/wmf-deployment/extensions/LiquidThreads_alpha/newmessages.js
@@ -1,63 +1,64 @@
2 -liquidThreads.markReadDone =
 2+$j.extend( liquidThreads,
33 {
4 - 'one' : function(reply,button,operand) {
5 - var row = $j(button).closest('tr');
6 - var right_col = row.find('td.lqt-newmessages-right');
7 - $j(button).closest('td').empty();
8 -
9 - var msg = wgLqtMessages['lqt-marked-as-read-placeholder'];
10 - var undoMsg = wgLqtMessages['lqt-email-undo'];
11 - // We have to split the message to the part before the
12 - // $1 and the part after the $1
13 - var placeholderIndex = msg.indexOf( '$1' );
14 - var elem = $j('<span class="lqt-read-placeholder"/>');
15 -
16 - if (placeholderIndex >= 0) {
17 - var beforeMsg = msg.substr(0,placeholderIndex);
18 - var afterMsg = msg.substr(placeholderIndex+2);
 4+ 'markReadDone' :
 5+ {
 6+ 'one' : function(reply,button,operand) {
 7+ var row = $j(button).closest('tr');
 8+ var right_col = row.find('td.lqt-newmessages-right');
 9+ $j(button).closest('td').empty();
1910
20 - var beforeText = $j(document.createTextNode(beforeMsg));
21 - elem.append(beforeText);
 11+ var msg = wgLqtMessages['lqt-marked-as-read-placeholder'];
 12+ var undoMsg = wgLqtMessages['lqt-email-undo'];
 13+ // We have to split the message to the part before the
 14+ // $1 and the part after the $1
 15+ var placeholderIndex = msg.indexOf( '$1' );
 16+ var elem = $j('<span class="lqt-read-placeholder"/>');
2217
23 - // Produce the link
24 - var titleSel = '.lqt-thread-topmost > .lqt-thread-title-metadata';
25 - var subject = right_col.find('h3').text();
26 - var title = right_col.find(titleSel).val();
27 - var url = wgArticlePath.replace( '$1', title );
28 - var link = $j('<a/>').attr('href', url).text(subject);
29 - elem.append(link);
 18+ if (placeholderIndex >= 0) {
 19+ var beforeMsg = msg.substr(0,placeholderIndex);
 20+ var afterMsg = msg.substr(placeholderIndex+2);
 21+
 22+ var beforeText = $j(document.createTextNode(beforeMsg));
 23+ elem.append(beforeText);
 24+
 25+ // Produce the link
 26+ var titleSel = '.lqt-thread-topmost > .lqt-thread-title-metadata';
 27+ var subject = right_col.find('h3').text();
 28+ var title = right_col.find(titleSel).val();
 29+ var url = wgArticlePath.replace( '$1', title );
 30+ var link = $j('<a/>').attr('href', url).text(subject);
 31+ elem.append(link);
 32+
 33+ var afterText = $j(document.createTextNode(afterMsg+' '));
 34+ elem.append(afterText);
 35+ } else {
 36+ elem.text(msg);
 37+ }
3038
31 - var afterText = $j(document.createTextNode(afterMsg+' '));
32 - elem.append(afterText);
33 - } else {
34 - elem.text(msg);
35 - }
 39+ // Add the "undo" link.
 40+ var undoURL = wgArticlePath.replace( '$1', wgPageName );
 41+ var query = 'lqt_method=mark_as_unread&lqt_operand='+operand;
 42+ if ( undoURL.indexOf('?') == -1 ) {
 43+ query = '?'+query;
 44+ } else {
 45+ query = '&'+query;
 46+ }
 47+ undoURL += query;
 48+
 49+ var undoLink = $j('<a/>').attr('href', undoURL).text(undoMsg);
 50+ elem.append( undoLink );
 51+
 52+ right_col.empty().append(elem);
 53+ },
3654
37 - // Add the "undo" link.
38 - var undoURL = wgArticlePath.replace( '$1', wgPageName );
39 - var query = 'lqt_method=mark_as_unread&lqt_operand='+operand;
40 - if ( undoURL.indexOf('?') == -1 ) {
41 - query = '?'+query;
42 - } else {
43 - query = '&'+query;
 55+ 'all' : function(reply) {
 56+ var tables = $j('table.lqt-new-messages');
 57+ tables.fadeOut( 'slow',
 58+ function() { tables.remove(); } );
4459 }
45 - undoURL += query;
46 -
47 - var undoLink = $j('<a/>').attr('href', undoURL).text(undoMsg);
48 - elem.append( undoLink );
49 -
50 - right_col.empty().append(elem);
5160 },
5261
53 - 'all' : function(reply) {
54 - var tables = $j('table.lqt-new-messages');
55 - tables.fadeOut( 'slow',
56 - function() { tables.remove(); } );
57 - }
58 -};
59 -
60 -liquidThreads.doMarkRead =
61 - function(e) {
 62+ 'doMarkRead' : function(e) {
6263 e.preventDefault();
6364
6465 var button = $j(this);
@@ -68,45 +69,54 @@
6970
7071 if (!form.length) {
7172 form = button.closest( 'form.lqt_newmessages_read_all_button' );
72 - type = 'all';
 73+ liquidThreads.doMarkAllRead(form);
 74+ } else {
 75+ liquidThreads.doMarkOneRead(form);
7376 }
 77+ },
7478
 79+ 'doMarkOneRead' : function(form) {
7580 var operand = form.find('input[name=lqt_operand]').val();
7681 var threads = operand.replace( /\,/g, '|' );
7782
78 - var getTokenParams =
 83+ var spinner = $j('<div class="mw-ajax-loader"/>');
 84+ $j(form).prepend( spinner );
 85+
 86+ liquidThreads.apiRequest
 87+
 88+ var markReadParameters =
7989 {
80 - 'action' : 'query',
81 - 'prop' : 'info',
82 - 'intoken' : 'edit',
83 - 'titles' : 'Some Title',
84 - 'format' : 'json'
 90+ 'action' : 'threadaction',
 91+ 'threadaction' : 'markread',
 92+ 'format' : 'json',
 93+ 'thread' : threads
8594 };
8695
 96+ liquidThreads.apiRequest( markReadParameters,
 97+ function(e) {
 98+ liquidThreads.markReadDone.one(e,form.find('input[type=submit]'),operand);
 99+ spinner.remove();
 100+ } );
 101+ },
 102+
 103+ 'doMarkAllRead' : function(form) {
87104 var spinner = $j('<div class="mw-ajax-loader"/>');
88 - $j(button).before( spinner );
 105+ $j(form).prepend( spinner );
89106
90 - $j.get( wgScriptPath+'/api'+wgScriptExtension, getTokenParams,
91 - function( data ) {
92 - var token = data.query.pages[-1].edittoken;
 107+ var request = {
 108+ 'action' : 'threadaction',
 109+ 'threadaction' : 'markread',
 110+ 'format' : 'json',
 111+ 'thread' : 'all'
 112+ };
 113+
 114+ liquidThreads.apiRequest( request, function(res) {
 115+ liquidThreads.markReadDone.all(res);
 116+ spinner.remove();
 117+ } );
 118+ }
93119
94 - var markReadParameters =
95 - {
96 - 'action' : 'threadaction',
97 - 'threadaction' : 'markread',
98 - 'format' : 'json',
99 - 'thread' : threads,
100 - 'token' : token
101 - }
102 -
103 - $j.post( wgScriptPath+'/api'+wgScriptExtension,
104 - markReadParameters,
105 - function(e) {
106 - liquidThreads.markReadDone[type](e,button,operand);
107 - spinner.remove();
108 - }, 'json' );
109 - }, 'json' );
110 - };
 120+} );
111121
112122 // Setup
113123 $j( function() {
Index: branches/wmf-deployment/extensions/LiquidThreads_alpha/classes/View.php
@@ -956,7 +956,8 @@
957957 $menuHTML = Xml::tags( 'ul', array( 'class' => 'lqt-thread-toolbar-command-list' ),
958958 $this->listItemsForCommands( $commands ) );
959959
960 - $triggerText = Xml::tags( 'span', array( 'class' => 'lqt-thread-actions-icon' ),
 960+ $triggerText = Xml::tags( 'a', array( 'class' => 'lqt-thread-actions-icon',
 961+ 'href' => '#' ),
961962 wfMsgHTML( 'lqt-menu-trigger' ) );
962963 $dropDownTrigger = Xml::tags( 'div',
963964 array( 'class' => 'lqt-thread-actions-trigger ' .
@@ -1672,12 +1673,14 @@
16731674 $label
16741675 );
16751676
1676 - $link = $sk->link( $t->summary()->getTitle(), $link_text );
 1677+ $link = $sk->link( $t->summary()->getTitle(), $link_text,
 1678+ array( 'class' => 'lqt-summary-link' ) );
 1679+ $link .= Xml::hidden( 'summary-title', $t->summary()->getTitle()->getPrefixedText() );
16771680 $edit_link = self::permalink( $t, $edit_text, 'summarize', $t->id() );
16781681 $links = "[$link]\n[$edit_link]";
16791682 $html .= Xml::tags(
16801683 'span',
1681 - array( 'class' => 'lqt_thread_permalink_summary_edit' ),
 1684+ array( 'class' => 'lqt_thread_permalink_summary_actions' ),
16821685 $links
16831686 );
16841687
Index: branches/wmf-deployment/extensions/LiquidThreads_alpha/classes/Dispatch.php
@@ -107,7 +107,7 @@
108108 in_array( $title->getPrefixedText(), $wgLqtPages );
109109
110110 if ( $title->exists() ) {
111 - $override = self::getUserLqtOverride( $title->getArticleId() );
 111+ $override = self::getUserLqtOverride( $title );
112112 } else {
113113 $override = null;
114114 }
@@ -122,13 +122,12 @@
123123 return $isTalkPage;
124124 }
125125
126 - static function getUserLqtOverride( $article ) {
127 - if ( !is_object( $article ) ) {
128 - $article = Article::newFromId( $article );
 126+ static function getUserLqtOverride( $title ) {
 127+ if ( ! is_object($title) ) {
 128+ return null;
129129 }
130130
131 - $title = $article->getTitle();
132 - $articleid = $article->getId();
 131+ $articleid = $title->getArticleId();
133132
134133 global $wgLiquidThreadsAllowUserControlNamespaces;
135134 global $wgLiquidThreadsAllowUserControl;
Property changes on: branches/wmf-deployment/extensions/LiquidThreads_alpha/classes/LogFormatter.php
___________________________________________________________________
Name: svn:eol-style
136135 + native
Index: branches/wmf-deployment/extensions/LiquidThreads_alpha/classes/NewMessagesController.php
@@ -32,6 +32,24 @@
3333
3434 self::recacheMessageCount( $user_id );
3535 }
 36+
 37+ static function markAllReadByUser( $user ) {
 38+ if ( is_object( $user ) ) {
 39+ $user_id = $user->getID();
 40+ } else if ( is_integer( $user ) ) {
 41+ $user_id = $user;
 42+ } else {
 43+ throw new MWException( __METHOD__." expected User or integer but got $user" );
 44+ }
 45+
 46+ $dbw = wfGetDB( DB_MASTER );
 47+
 48+ $dbw->delete( 'user_message_state',
 49+ array( 'ums_user' => $user_id ),
 50+ __METHOD__ );
 51+
 52+ self::recacheMessageCount( $user_id );
 53+ }
3654
3755 private static function writeUserMessageState( $thread, $user, $timestamp ) {
3856 if ( is_object( $thread ) ) {
Index: branches/wmf-deployment/extensions/LiquidThreads_alpha/lqt.sql
@@ -79,7 +79,7 @@
8080 th_change_comment TINYTEXT NOT NULL,
8181
8282 -- Actual content, stored as a serialised thread row.
83 - th_content BLOB NOT NULL,
 83+ th_content LONGBLOB NOT NULL,
8484
8585 PRIMARY KEY (th_id),
8686 KEY (th_thread,th_timestamp),
Index: branches/wmf-deployment/extensions/LiquidThreads_alpha/api/ApiFeedLQTThreads.php
@@ -41,7 +41,7 @@
4242 }
4343
4444 /**
45 - * Make a nested call to the API to request watchlist items in the last $hours.
 45+ * Make a nested call to the API to request items in the last $hours.
4646 * Wrap the result as an RSS/Atom feed.
4747 */
4848 public function execute() {
Index: branches/wmf-deployment/extensions/LiquidThreads_alpha/api/ApiThreadAction.php
@@ -93,6 +93,9 @@
9494 return;
9595 }
9696
 97+ $allowedAllActions = array( 'markread' );
 98+ $action = $params['threadaction'];
 99+
97100 // Pull the threads from the parameters
98101 $threads = array();
99102 if ( !empty( $params['thread'] ) ) {
@@ -100,6 +103,9 @@
101104 $threadObj = null;
102105 if ( is_numeric( $thread ) ) {
103106 $threadObj = Threads::withId( $thread );
 107+ } elseif ( $thread == 'all' &&
 108+ in_array( $action, $allowedAllActions ) ) {
 109+ $threads = array('all');
104110 } else {
105111 $title = Title::newFromText( $thread );
106112 $article = new Article( $title );
@@ -113,7 +119,6 @@
114120 }
115121
116122 // Find the appropriate module
117 - $action = $params['threadaction'];
118123 $actions = $this->getActions();
119124
120125 $method = $actions[$action];
@@ -126,15 +131,24 @@
127132
128133 $result = array();
129134
130 - foreach( $threads as $t ) {
131 - NewMessages::markThreadAsReadByUser( $t, $wgUser );
132 - $result[] =
133 - array(
134 - 'result' => 'Success',
135 - 'action' => 'markread',
136 - 'id' => $t->id(),
137 - 'title' => $t->title()->getPrefixedText()
138 - );
 135+ if ( in_array( 'all', $threads ) ) {
 136+ NewMessages::markAllReadByUser( $wgUser );
 137+ $result[] = array(
 138+ 'result' => 'Success',
 139+ 'action' => 'markread',
 140+ 'threads' => 'all',
 141+ );
 142+ } else {
 143+ foreach( $threads as $t ) {
 144+ NewMessages::markThreadAsReadByUser( $t, $wgUser );
 145+ $result[] =
 146+ array(
 147+ 'result' => 'Success',
 148+ 'action' => 'markread',
 149+ 'id' => $t->id(),
 150+ 'title' => $t->title()->getPrefixedText()
 151+ );
 152+ }
139153 }
140154
141155 $this->getResult()->setIndexedTagName( $result, 'thread' );
Index: branches/wmf-deployment/extensions/LiquidThreads_alpha/lqt.js
@@ -168,12 +168,6 @@
169169 function() {
170170 currentFocused = this;
171171 } );
172 -
173 - // Check for live preview
174 - if ( $j('#wpLivePreview').length ) {
175 - $j.getScript( stylepath+'/common/preview.js',
176 - function() { setupLivePreview(); } );
177 - }
178172 };
179173
180174 mwEditButtons = [];
@@ -284,20 +278,6 @@
285279 return false;
286280 },
287281
288 - 'addQuoteButton' : function( toolbar ) {
289 - var quoteButton = $j('<li/>' );
290 - quoteButton.addClass('lqt-command');
291 - quoteButton.addClass('lqt-command-quote');
292 -
293 - var link = $j('<a href="#"/>');
294 - link.append( wgLqtMessages['lqt-quote'] );
295 - quoteButton.append( link );
296 -
297 - quoteButton.click( liquidThreads.doQuote );
298 -
299 - $j(toolbar).prepend( quoteButton );
300 - },
301 -
302282 'cancelEdit' : function( e ) {
303283 if ( typeof e != 'undefined' && typeof e.preventDefault == 'function' ) {
304284 e.preventDefault();
@@ -326,10 +306,6 @@
327307 var menuContainer = post.find( '.lqt-thread-toolbar-menu' );
328308 menu.remove().appendTo( menuContainer );
329309 menuContainer.find('.lqt-thread-toolbar-command-list').hide();
330 -
331 - // Add handler for edit link -- Disabled for further tweaking
332 -// var editLink = menu.find('.lqt-command-edit > a');
333 -// editLink.click( liquidThreads.handleEditLink );
334310
335311 // Add handler for reply link
336312 var replyLink = menu.find('.lqt-command-reply > a');
@@ -356,6 +332,7 @@
357333 trigger.click(
358334 function(e) {
359335 e.stopImmediatePropagation();
 336+ e.preventDefault();
360337
361338 // Hide the other menus
362339 $j('.lqt-thread-toolbar-command-list').not(menu).hide('fast');
@@ -686,15 +663,6 @@
687664
688665 liquidThreads.setupThreadMenu( menu, threadId );
689666 }
690 -
691 - // Check for a "show replies" button
692 - $j(threadContainer).find('a.lqt-show-replies').click( liquidThreads.showReplies );
693 -
694 - // "Show more posts" link
695 - $j(threadContainer).find('a.lqt-show-more-posts').click( liquidThreads.showMore );
696 -
697 - // Handler for "Link to this" button
698 - $j(threadContainer).find('.lqt-command-link').click( liquidThreads.showLinkWindow );
699667 },
700668
701669 'showReplies' : function(e) {
@@ -828,19 +796,33 @@
829797 e.preventDefault();
830798 },
831799
832 - 'showLinkWindow' : function(e) {
 800+ 'showThreadLinkWindow' : function(e) {
 801+ e.preventDefault();
833802 var linkURL = $j(this).find('a').attr('href');
834803 var thread = $j(this).closest('.lqt_thread');
835804 var linkTitle = thread.find('.lqt-thread-title-metadata').val();
836 - linkTitle = '[[' + linkTitle + ']]';
 805+ liquidThreads.showLinkWindow( linkTitle, linkURL );
 806+ },
 807+
 808+ 'showSummaryLinkWindow' : function(e) {
 809+ e.preventDefault();
 810+ var linkURL = $j(this).attr('href');
 811+ var linkTitle = $j(this).parent().find('input[name=summary-title]').val();
 812+ liquidThreads.showLinkWindow( linkTitle, linkURL );
 813+ },
 814+
 815+ 'showLinkWindow' : function(linkTitle, linkURL) {
 816+ linkTitle = '[['+linkTitle+']]';
837817
838818 // Build dialog
839819 var urlLabel = $j('<th/>').text(wgLqtMessages['lqt-thread-link-url']);
840 - var urlField = $j('<tr/>').text(linkURL).addClass( 'lqt-thread-link-url' );
 820+ var urlField = $j('<td/>').addClass( 'lqt-thread-link-url' );
 821+ urlField.text(linkURL);
841822 var urlRow = $j('<tr/>').append(urlLabel).append(urlField );
842823
843824 var titleLabel = $j('<th/>').text(wgLqtMessages['lqt-thread-link-title']);
844 - var titleField = $j('<tr/>').text(linkTitle).addClass( 'lqt-thread-link-title' );
 825+ var titleField = $j('<td/>').addClass( 'lqt-thread-link-title' );
 826+ titleField.text(linkTitle);
845827 var titleRow = $j('<tr/>').append(titleLabel).append(titleField );
846828
847829 var table = $j('<table><tbody></tbody></table>');
@@ -848,7 +830,7 @@
849831
850832 var dialog = $j('<div/>').append(table);
851833
852 - $j(this).prepend(dialog);
 834+ $j('body').prepend(dialog);
853835
854836 var dialogOptions = {
855837 'AutoOpen' : true,
@@ -856,8 +838,6 @@
857839 };
858840
859841 dialog.dialog( dialogOptions );
860 -
861 - e.preventDefault();
862842 },
863843
864844 'getToken' : function( callback ) {
@@ -1623,14 +1603,26 @@
16241604 $j('.lqt-command-watch').live( 'click', liquidThreads.asyncWatch );
16251605 $j('.lqt-command-unwatch').live( 'click', liquidThreads.asyncWatch );
16261606
1627 - // Set up periodic update checking
1628 - setInterval( liquidThreads.checkForUpdates, 60000 );
 1607+ // Live bind for link window
 1608+ $j('.lqt-command-link').live( 'click', liquidThreads.showThreadLinkWindow );
16291609
1630 - // Autogrowing textarea - this only affects the new-topic page
1631 -// $j('#wpTextbox1')//.autogrow();
1632 -
 1610+ // Live bind for summary links
 1611+ $j('.lqt-summary-link').live( 'click', liquidThreads.showSummaryLinkWindow );
 1612+
 1613+ // For "show replies"
 1614+ $j('a.lqt-show-replies').live( 'click', liquidThreads.showReplies );
 1615+
 1616+ // "Show more posts" link
 1617+ $j('a.lqt-show-more-posts').live( 'click', liquidThreads.showMore );
 1618+
 1619+ // Save handlers
16331620 $j('#wpSave').live( 'click', liquidThreads.handleAJAXSave );
16341621 $j('#wpTextbox1').live( 'keyup', liquidThreads.onTextboxKeyUp );
 1622+
 1623+ // Hide menus when a click happens outside them
16351624 $j(document).click( liquidThreads.handleDocumentClick );
 1625+
 1626+ // Set up periodic update checking
 1627+ setInterval( liquidThreads.checkForUpdates, 60000 );
16361628 } );
16371629
Property changes on: branches/wmf-deployment/extensions/LiquidThreads_alpha/lqt.js
___________________________________________________________________
Name: svn:mergeinfo
16381630 - /trunk/extensions/LiquidThreads/lqt.js:57390,58990-62113,62158
Property changes on: branches/wmf-deployment/extensions/LiquidThreads_alpha
___________________________________________________________________
Name: svn:mergeinfo
16391631 - /trunk/extensions/LiquidThreads:57390,58990-62113
16401632 + /trunk/extensions/LiquidThreads:57390,58990-62113,62115-62229

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r62114Update LiquidThreads alpha to trunk statewerdna04:22, 8 February 2010
r62230styilize.php, formatting updates, whitespace changessiebrand10:10, 10 February 2010

Status & tagging log