Index: branches/wmf-deployment/extensions/LiquidThreads_alpha/i18n/Lqt.i18n.php |
— | — | @@ -1474,10 +1474,6 @@ |
1475 | 1475 | 'lqt-new-messages' => '✒ Для Вас ёсьць новыя паведамленьні.', |
1476 | 1476 | 'lqt-email-info-undo' => 'Вярнуць галіну якую Вы толькі што прапусьцілі.', |
1477 | 1477 | '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' => '(не аўтар)', |
1482 | 1478 | 'lqt-newmessages-context' => 'Поўная галіна', |
1483 | 1479 | 'lqt-thread-created' => 'Створаная', |
1484 | 1480 | 'lqt-history-time' => 'Час', |
— | — | @@ -1509,6 +1505,8 @@ |
1510 | 1506 | 'lqt-newmessages-from' => 'Ад $1', |
1511 | 1507 | 'lqt-hot-topics' => 'Папулярныя тэмы', |
1512 | 1508 | 'lqt-add-reply' => 'Дадаць адказ', |
| 1509 | + 'lqt_rc_new_discussion' => 'Новае абмеркаваньне «$1» на $2. • напісанае $3:', |
| 1510 | + 'lqt_rc_new_reply' => 'Адказ ў «$1» на $2. • напісаны $3:', |
1513 | 1511 | 'right-lqt-split' => 'падзел галінаў', |
1514 | 1512 | 'right-lqt-merge' => "аб'яднаньне галінаў", |
1515 | 1513 | 'lqt-thread-merge' => "Аб'яднаць у іншую галіну", |
— | — | @@ -1521,6 +1519,11 @@ |
1522 | 1520 | 'lqt-log-name' => 'Журнал галінаў абмеркаваньняў', |
1523 | 1521 | 'lqt-log-header' => 'Гэты журнал утрымлівае дэталі дзеяньняў, якія адбываюцца ў галінах абмеркаваньняў.', |
1524 | 1522 | '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.', |
1525 | 1528 | 'lqt-preference-notify-talk' => 'Дасылаць мне электронныя лісты ў выпадках адказаў у галіне, за якой я назіраю', |
1526 | 1529 | 'lqt-preference-watch-threads' => 'Дадаваць у мой сьпіс назіраньня галіны, якія я буду ствараць альбо на якія я буду адказваць', |
1527 | 1530 | 'prefs-lqt' => 'Галіны абмеркаваньняў', |
— | — | @@ -5271,11 +5274,6 @@ |
5272 | 5275 | 'lqt-new-messages' => '✒ Vous avez de nouveaux messages.', |
5273 | 5276 | 'lqt-email-info-undo' => 'Rétablir le fil que vous venez juste d’enlever.', |
5274 | 5277 | '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)', |
5280 | 5278 | 'lqt-newmessages-context' => 'Fil complet', |
5281 | 5279 | 'lqt-thread-created' => 'Créé', |
5282 | 5280 | 'lqt-history-time' => 'Date', |
— | — | @@ -5307,6 +5305,8 @@ |
5308 | 5306 | 'lqt-newmessages-from' => 'Depuis $1', |
5309 | 5307 | 'lqt-hot-topics' => 'Sujets brûlants', |
5310 | 5308 | '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 :', |
5311 | 5311 | 'right-lqt-split' => 'Scinder les fils de discussion', |
5312 | 5312 | 'right-lqt-merge' => 'Fusionner les fils de discussion', |
5313 | 5313 | 'lqt-thread-merge' => 'Fusionner dans un autre fil', |
— | — | @@ -5319,6 +5319,11 @@ |
5320 | 5320 | 'lqt-log-name' => 'Journal des fils de discussion', |
5321 | 5321 | 'lqt-log-header' => 'Ce journal détaille les actions faites sur les fils de discussion.', |
5322 | 5322 | '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 ».", |
5323 | 5328 | 'lqt-preference-notify-talk' => "M’avertir par couriel lors d'une réponse sur un sujet que je suis", |
5324 | 5329 | 'lqt-preference-watch-threads' => 'Suivre les fils de discussion que je crée ou auxquels je participe', |
5325 | 5330 | 'prefs-lqt' => 'Discussions en fil', |
— | — | @@ -9328,10 +9333,6 @@ |
9329 | 9334 | 'lqt-new-messages' => '✒ Имате нови пораки.', |
9330 | 9335 | 'lqt-email-info-undo' => 'Врати ја штотуку отфрлената нишка.', |
9331 | 9336 | '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' => '(не е авторот)', |
9336 | 9337 | 'lqt-newmessages-context' => 'Цела нишка', |
9337 | 9338 | 'lqt-thread-created' => 'Создадено', |
9338 | 9339 | 'lqt-history-time' => 'Време', |
— | — | @@ -9363,6 +9364,8 @@ |
9364 | 9365 | 'lqt-newmessages-from' => 'Од $1', |
9365 | 9366 | 'lqt-hot-topics' => 'Актуелни теми', |
9366 | 9367 | 'lqt-add-reply' => 'Додај одговор', |
| 9368 | + 'lqt_rc_new_discussion' => 'Нов разговор за „$1“ на $2 • $3 пишува:', |
| 9369 | + 'lqt_rc_new_reply' => 'Одговор на „$1“ на $2 • $3 пишува:', |
9367 | 9370 | 'right-lqt-split' => 'Раздели нишки', |
9368 | 9371 | 'right-lqt-merge' => 'Спојување нишки', |
9369 | 9372 | 'lqt-thread-merge' => 'Спој со друга нишка', |
— | — | @@ -9375,6 +9378,11 @@ |
9376 | 9379 | 'lqt-log-name' => 'Дневник на нанижани разговори', |
9377 | 9380 | 'lqt-log-header' => 'Во овој дневник се запишуваат дејствата направени во разговорните нишки.', |
9378 | 9381 | '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.', |
9379 | 9387 | 'lqt-preference-notify-talk' => 'Испрати ми е-пошта кога некој ќе одговори на нишка која ја набљудувам', |
9380 | 9388 | 'lqt-preference-watch-threads' => 'Набљудувај ги нишките кои ги создавам или на кои одговарам', |
9381 | 9389 | 'prefs-lqt' => 'Нанижан разговор', |
— | — | @@ -13133,10 +13141,6 @@ |
13134 | 13142 | 'lqt-new-messages' => '✒ Du har nya meddelanden.', |
13135 | 13143 | 'lqt-email-info-undo' => 'Ta tillbaka tråden du precis tog bort.', |
13136 | 13144 | '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)', |
13141 | 13145 | 'lqt-newmessages-context' => 'Hela tråden', |
13142 | 13146 | 'lqt-thread-created' => 'Skapad', |
13143 | 13147 | 'lqt-history-time' => 'Tid', |
— | — | @@ -13168,6 +13172,8 @@ |
13169 | 13173 | 'lqt-newmessages-from' => 'Från $1', |
13170 | 13174 | 'lqt-hot-topics' => 'Heta ämnen', |
13171 | 13175 | '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:', |
13172 | 13178 | 'right-lqt-split' => 'Delade trådar', |
13173 | 13179 | 'right-lqt-merge' => 'Slå ihop trådar', |
13174 | 13180 | 'lqt-thread-merge' => 'Slå ihop in i en annan tråd.', |
— | — | @@ -13180,6 +13186,11 @@ |
13181 | 13187 | 'lqt-log-name' => 'Diskussionssidor i trådform', |
13182 | 13188 | 'lqt-log-header' => 'Den här loggen visar händelser i diskussionstrådor.', |
13183 | 13189 | '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.', |
13184 | 13195 | 'lqt-preference-notify-talk' => 'E-posta mig när någon svarar i en tråd jag bevakar', |
13185 | 13196 | 'lqt-preference-watch-threads' => 'Bevaka trådar jag skapar eller svarar i', |
13186 | 13197 | 'prefs-lqt' => 'Trådad diskussion', |
Index: branches/wmf-deployment/extensions/LiquidThreads_alpha/lqt.css |
— | — | @@ -79,7 +79,7 @@ |
80 | 80 | font-weight: bold; |
81 | 81 | } |
82 | 82 | |
83 | | -.lqt_thread_permalink_summary_edit { |
| 83 | +.lqt_thread_permalink_summary_actions { |
84 | 84 | float: right; |
85 | 85 | margin-right: 1em; |
86 | 86 | font-weight: normal; |
Index: branches/wmf-deployment/extensions/LiquidThreads_alpha/newmessages.js |
— | — | @@ -1,63 +1,64 @@ |
2 | | -liquidThreads.markReadDone = |
| 2 | +$j.extend( liquidThreads, |
3 | 3 | { |
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(); |
19 | 10 | |
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"/>'); |
22 | 17 | |
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 | + } |
30 | 38 | |
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 | + }, |
36 | 54 | |
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(); } ); |
44 | 59 | } |
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); |
51 | 60 | }, |
52 | 61 | |
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) { |
62 | 63 | e.preventDefault(); |
63 | 64 | |
64 | 65 | var button = $j(this); |
— | — | @@ -68,45 +69,54 @@ |
69 | 70 | |
70 | 71 | if (!form.length) { |
71 | 72 | form = button.closest( 'form.lqt_newmessages_read_all_button' ); |
72 | | - type = 'all'; |
| 73 | + liquidThreads.doMarkAllRead(form); |
| 74 | + } else { |
| 75 | + liquidThreads.doMarkOneRead(form); |
73 | 76 | } |
| 77 | + }, |
74 | 78 | |
| 79 | + 'doMarkOneRead' : function(form) { |
75 | 80 | var operand = form.find('input[name=lqt_operand]').val(); |
76 | 81 | var threads = operand.replace( /\,/g, '|' ); |
77 | 82 | |
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 = |
79 | 89 | { |
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 |
85 | 94 | }; |
86 | 95 | |
| 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) { |
87 | 104 | var spinner = $j('<div class="mw-ajax-loader"/>'); |
88 | | - $j(button).before( spinner ); |
| 105 | + $j(form).prepend( spinner ); |
89 | 106 | |
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 | + } |
93 | 119 | |
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 | +} ); |
111 | 121 | |
112 | 122 | // Setup |
113 | 123 | $j( function() { |
Index: branches/wmf-deployment/extensions/LiquidThreads_alpha/classes/View.php |
— | — | @@ -956,7 +956,8 @@ |
957 | 957 | $menuHTML = Xml::tags( 'ul', array( 'class' => 'lqt-thread-toolbar-command-list' ), |
958 | 958 | $this->listItemsForCommands( $commands ) ); |
959 | 959 | |
960 | | - $triggerText = Xml::tags( 'span', array( 'class' => 'lqt-thread-actions-icon' ), |
| 960 | + $triggerText = Xml::tags( 'a', array( 'class' => 'lqt-thread-actions-icon', |
| 961 | + 'href' => '#' ), |
961 | 962 | wfMsgHTML( 'lqt-menu-trigger' ) ); |
962 | 963 | $dropDownTrigger = Xml::tags( 'div', |
963 | 964 | array( 'class' => 'lqt-thread-actions-trigger ' . |
— | — | @@ -1672,12 +1673,14 @@ |
1673 | 1674 | $label |
1674 | 1675 | ); |
1675 | 1676 | |
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() ); |
1677 | 1680 | $edit_link = self::permalink( $t, $edit_text, 'summarize', $t->id() ); |
1678 | 1681 | $links = "[$link]\n[$edit_link]"; |
1679 | 1682 | $html .= Xml::tags( |
1680 | 1683 | 'span', |
1681 | | - array( 'class' => 'lqt_thread_permalink_summary_edit' ), |
| 1684 | + array( 'class' => 'lqt_thread_permalink_summary_actions' ), |
1682 | 1685 | $links |
1683 | 1686 | ); |
1684 | 1687 | |
Index: branches/wmf-deployment/extensions/LiquidThreads_alpha/classes/Dispatch.php |
— | — | @@ -107,7 +107,7 @@ |
108 | 108 | in_array( $title->getPrefixedText(), $wgLqtPages ); |
109 | 109 | |
110 | 110 | if ( $title->exists() ) { |
111 | | - $override = self::getUserLqtOverride( $title->getArticleId() ); |
| 111 | + $override = self::getUserLqtOverride( $title ); |
112 | 112 | } else { |
113 | 113 | $override = null; |
114 | 114 | } |
— | — | @@ -122,13 +122,12 @@ |
123 | 123 | return $isTalkPage; |
124 | 124 | } |
125 | 125 | |
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; |
129 | 129 | } |
130 | 130 | |
131 | | - $title = $article->getTitle(); |
132 | | - $articleid = $article->getId(); |
| 131 | + $articleid = $title->getArticleId(); |
133 | 132 | |
134 | 133 | global $wgLiquidThreadsAllowUserControlNamespaces; |
135 | 134 | global $wgLiquidThreadsAllowUserControl; |
Property changes on: branches/wmf-deployment/extensions/LiquidThreads_alpha/classes/LogFormatter.php |
___________________________________________________________________ |
Name: svn:eol-style |
136 | 135 | + native |
Index: branches/wmf-deployment/extensions/LiquidThreads_alpha/classes/NewMessagesController.php |
— | — | @@ -32,6 +32,24 @@ |
33 | 33 | |
34 | 34 | self::recacheMessageCount( $user_id ); |
35 | 35 | } |
| 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 | + } |
36 | 54 | |
37 | 55 | private static function writeUserMessageState( $thread, $user, $timestamp ) { |
38 | 56 | if ( is_object( $thread ) ) { |
Index: branches/wmf-deployment/extensions/LiquidThreads_alpha/lqt.sql |
— | — | @@ -79,7 +79,7 @@ |
80 | 80 | th_change_comment TINYTEXT NOT NULL, |
81 | 81 | |
82 | 82 | -- Actual content, stored as a serialised thread row. |
83 | | - th_content BLOB NOT NULL, |
| 83 | + th_content LONGBLOB NOT NULL, |
84 | 84 | |
85 | 85 | PRIMARY KEY (th_id), |
86 | 86 | KEY (th_thread,th_timestamp), |
Index: branches/wmf-deployment/extensions/LiquidThreads_alpha/api/ApiFeedLQTThreads.php |
— | — | @@ -41,7 +41,7 @@ |
42 | 42 | } |
43 | 43 | |
44 | 44 | /** |
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. |
46 | 46 | * Wrap the result as an RSS/Atom feed. |
47 | 47 | */ |
48 | 48 | public function execute() { |
Index: branches/wmf-deployment/extensions/LiquidThreads_alpha/api/ApiThreadAction.php |
— | — | @@ -93,6 +93,9 @@ |
94 | 94 | return; |
95 | 95 | } |
96 | 96 | |
| 97 | + $allowedAllActions = array( 'markread' ); |
| 98 | + $action = $params['threadaction']; |
| 99 | + |
97 | 100 | // Pull the threads from the parameters |
98 | 101 | $threads = array(); |
99 | 102 | if ( !empty( $params['thread'] ) ) { |
— | — | @@ -100,6 +103,9 @@ |
101 | 104 | $threadObj = null; |
102 | 105 | if ( is_numeric( $thread ) ) { |
103 | 106 | $threadObj = Threads::withId( $thread ); |
| 107 | + } elseif ( $thread == 'all' && |
| 108 | + in_array( $action, $allowedAllActions ) ) { |
| 109 | + $threads = array('all'); |
104 | 110 | } else { |
105 | 111 | $title = Title::newFromText( $thread ); |
106 | 112 | $article = new Article( $title ); |
— | — | @@ -113,7 +119,6 @@ |
114 | 120 | } |
115 | 121 | |
116 | 122 | // Find the appropriate module |
117 | | - $action = $params['threadaction']; |
118 | 123 | $actions = $this->getActions(); |
119 | 124 | |
120 | 125 | $method = $actions[$action]; |
— | — | @@ -126,15 +131,24 @@ |
127 | 132 | |
128 | 133 | $result = array(); |
129 | 134 | |
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 | + } |
139 | 153 | } |
140 | 154 | |
141 | 155 | $this->getResult()->setIndexedTagName( $result, 'thread' ); |
Index: branches/wmf-deployment/extensions/LiquidThreads_alpha/lqt.js |
— | — | @@ -168,12 +168,6 @@ |
169 | 169 | function() { |
170 | 170 | currentFocused = this; |
171 | 171 | } ); |
172 | | - |
173 | | - // Check for live preview |
174 | | - if ( $j('#wpLivePreview').length ) { |
175 | | - $j.getScript( stylepath+'/common/preview.js', |
176 | | - function() { setupLivePreview(); } ); |
177 | | - } |
178 | 172 | }; |
179 | 173 | |
180 | 174 | mwEditButtons = []; |
— | — | @@ -284,20 +278,6 @@ |
285 | 279 | return false; |
286 | 280 | }, |
287 | 281 | |
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 | | - |
302 | 282 | 'cancelEdit' : function( e ) { |
303 | 283 | if ( typeof e != 'undefined' && typeof e.preventDefault == 'function' ) { |
304 | 284 | e.preventDefault(); |
— | — | @@ -326,10 +306,6 @@ |
327 | 307 | var menuContainer = post.find( '.lqt-thread-toolbar-menu' ); |
328 | 308 | menu.remove().appendTo( menuContainer ); |
329 | 309 | 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 ); |
334 | 310 | |
335 | 311 | // Add handler for reply link |
336 | 312 | var replyLink = menu.find('.lqt-command-reply > a'); |
— | — | @@ -356,6 +332,7 @@ |
357 | 333 | trigger.click( |
358 | 334 | function(e) { |
359 | 335 | e.stopImmediatePropagation(); |
| 336 | + e.preventDefault(); |
360 | 337 | |
361 | 338 | // Hide the other menus |
362 | 339 | $j('.lqt-thread-toolbar-command-list').not(menu).hide('fast'); |
— | — | @@ -686,15 +663,6 @@ |
687 | 664 | |
688 | 665 | liquidThreads.setupThreadMenu( menu, threadId ); |
689 | 666 | } |
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 ); |
699 | 667 | }, |
700 | 668 | |
701 | 669 | 'showReplies' : function(e) { |
— | — | @@ -828,19 +796,33 @@ |
829 | 797 | e.preventDefault(); |
830 | 798 | }, |
831 | 799 | |
832 | | - 'showLinkWindow' : function(e) { |
| 800 | + 'showThreadLinkWindow' : function(e) { |
| 801 | + e.preventDefault(); |
833 | 802 | var linkURL = $j(this).find('a').attr('href'); |
834 | 803 | var thread = $j(this).closest('.lqt_thread'); |
835 | 804 | 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+']]'; |
837 | 817 | |
838 | 818 | // Build dialog |
839 | 819 | 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); |
841 | 822 | var urlRow = $j('<tr/>').append(urlLabel).append(urlField ); |
842 | 823 | |
843 | 824 | 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); |
845 | 827 | var titleRow = $j('<tr/>').append(titleLabel).append(titleField ); |
846 | 828 | |
847 | 829 | var table = $j('<table><tbody></tbody></table>'); |
— | — | @@ -848,7 +830,7 @@ |
849 | 831 | |
850 | 832 | var dialog = $j('<div/>').append(table); |
851 | 833 | |
852 | | - $j(this).prepend(dialog); |
| 834 | + $j('body').prepend(dialog); |
853 | 835 | |
854 | 836 | var dialogOptions = { |
855 | 837 | 'AutoOpen' : true, |
— | — | @@ -856,8 +838,6 @@ |
857 | 839 | }; |
858 | 840 | |
859 | 841 | dialog.dialog( dialogOptions ); |
860 | | - |
861 | | - e.preventDefault(); |
862 | 842 | }, |
863 | 843 | |
864 | 844 | 'getToken' : function( callback ) { |
— | — | @@ -1623,14 +1603,26 @@ |
1624 | 1604 | $j('.lqt-command-watch').live( 'click', liquidThreads.asyncWatch ); |
1625 | 1605 | $j('.lqt-command-unwatch').live( 'click', liquidThreads.asyncWatch ); |
1626 | 1606 | |
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 ); |
1629 | 1609 | |
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 |
1633 | 1620 | $j('#wpSave').live( 'click', liquidThreads.handleAJAXSave ); |
1634 | 1621 | $j('#wpTextbox1').live( 'keyup', liquidThreads.onTextboxKeyUp ); |
| 1622 | + |
| 1623 | + // Hide menus when a click happens outside them |
1635 | 1624 | $j(document).click( liquidThreads.handleDocumentClick ); |
| 1625 | + |
| 1626 | + // Set up periodic update checking |
| 1627 | + setInterval( liquidThreads.checkForUpdates, 60000 ); |
1636 | 1628 | } ); |
1637 | 1629 | |
Property changes on: branches/wmf-deployment/extensions/LiquidThreads_alpha/lqt.js |
___________________________________________________________________ |
Name: svn:mergeinfo |
1638 | 1630 | - /trunk/extensions/LiquidThreads/lqt.js:57390,58990-62113,62158 |
Property changes on: branches/wmf-deployment/extensions/LiquidThreads_alpha |
___________________________________________________________________ |
Name: svn:mergeinfo |
1639 | 1631 | - /trunk/extensions/LiquidThreads:57390,58990-62113 |
1640 | 1632 | + /trunk/extensions/LiquidThreads:57390,58990-62113,62115-62229 |