Index: trunk/extensions/LiquidThreads/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: trunk/extensions/LiquidThreads/classes/View.php |
— | — | @@ -1673,12 +1673,14 @@ |
1674 | 1674 | $label |
1675 | 1675 | ); |
1676 | 1676 | |
1677 | | - $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() ); |
1678 | 1680 | $edit_link = self::permalink( $t, $edit_text, 'summarize', $t->id() ); |
1679 | 1681 | $links = "[$link]\n[$edit_link]"; |
1680 | 1682 | $html .= Xml::tags( |
1681 | 1683 | 'span', |
1682 | | - array( 'class' => 'lqt_thread_permalink_summary_edit' ), |
| 1684 | + array( 'class' => 'lqt_thread_permalink_summary_actions' ), |
1683 | 1685 | $links |
1684 | 1686 | ); |
1685 | 1687 | |
Index: trunk/extensions/LiquidThreads/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: trunk/extensions/LiquidThreads/lqt.js |
— | — | @@ -284,20 +284,6 @@ |
285 | 285 | return false; |
286 | 286 | }, |
287 | 287 | |
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 | 288 | 'cancelEdit' : function( e ) { |
303 | 289 | if ( typeof e != 'undefined' && typeof e.preventDefault == 'function' ) { |
304 | 290 | e.preventDefault(); |
— | — | @@ -326,10 +312,6 @@ |
327 | 313 | var menuContainer = post.find( '.lqt-thread-toolbar-menu' ); |
328 | 314 | menu.remove().appendTo( menuContainer ); |
329 | 315 | 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 | 316 | |
335 | 317 | // Add handler for reply link |
336 | 318 | var replyLink = menu.find('.lqt-command-reply > a'); |
— | — | @@ -687,15 +669,6 @@ |
688 | 670 | |
689 | 671 | liquidThreads.setupThreadMenu( menu, threadId ); |
690 | 672 | } |
691 | | - |
692 | | - // Check for a "show replies" button |
693 | | - $j(threadContainer).find('a.lqt-show-replies').click( liquidThreads.showReplies ); |
694 | | - |
695 | | - // "Show more posts" link |
696 | | - $j(threadContainer).find('a.lqt-show-more-posts').click( liquidThreads.showMore ); |
697 | | - |
698 | | - // Handler for "Link to this" button |
699 | | - $j(threadContainer).find('.lqt-command-link').click( liquidThreads.showLinkWindow ); |
700 | 673 | }, |
701 | 674 | |
702 | 675 | 'showReplies' : function(e) { |
— | — | @@ -829,19 +802,33 @@ |
830 | 803 | e.preventDefault(); |
831 | 804 | }, |
832 | 805 | |
833 | | - 'showLinkWindow' : function(e) { |
| 806 | + 'showThreadLinkWindow' : function(e) { |
| 807 | + e.preventDefault(); |
834 | 808 | var linkURL = $j(this).find('a').attr('href'); |
835 | 809 | var thread = $j(this).closest('.lqt_thread'); |
836 | 810 | var linkTitle = thread.find('.lqt-thread-title-metadata').val(); |
837 | | - linkTitle = '[[' + linkTitle + ']]'; |
| 811 | + liquidThreads.showLinkWindow( linkTitle, linkURL ); |
| 812 | + }, |
| 813 | + |
| 814 | + 'showSummaryLinkWindow' : function(e) { |
| 815 | + e.preventDefault(); |
| 816 | + var linkURL = $j(this).attr('href'); |
| 817 | + var linkTitle = $j(this).parent().find('input[name=summary-title]').val(); |
| 818 | + liquidThreads.showLinkWindow( linkTitle, linkURL ); |
| 819 | + }, |
| 820 | + |
| 821 | + 'showLinkWindow' : function(linkTitle, linkURL) { |
| 822 | + linkTitle = '[['+linkTitle+']]'; |
838 | 823 | |
839 | 824 | // Build dialog |
840 | 825 | var urlLabel = $j('<th/>').text(wgLqtMessages['lqt-thread-link-url']); |
841 | | - var urlField = $j('<tr/>').text(linkURL).addClass( 'lqt-thread-link-url' ); |
| 826 | + var urlField = $j('<td/>').addClass( 'lqt-thread-link-url' ); |
| 827 | + urlField.text(linkURL); |
842 | 828 | var urlRow = $j('<tr/>').append(urlLabel).append(urlField ); |
843 | 829 | |
844 | 830 | var titleLabel = $j('<th/>').text(wgLqtMessages['lqt-thread-link-title']); |
845 | | - var titleField = $j('<tr/>').text(linkTitle).addClass( 'lqt-thread-link-title' ); |
| 831 | + var titleField = $j('<td/>').addClass( 'lqt-thread-link-title' ); |
| 832 | + titleField.text(linkTitle); |
846 | 833 | var titleRow = $j('<tr/>').append(titleLabel).append(titleField ); |
847 | 834 | |
848 | 835 | var table = $j('<table><tbody></tbody></table>'); |
— | — | @@ -849,7 +836,7 @@ |
850 | 837 | |
851 | 838 | var dialog = $j('<div/>').append(table); |
852 | 839 | |
853 | | - $j(this).prepend(dialog); |
| 840 | + $j('body').prepend(dialog); |
854 | 841 | |
855 | 842 | var dialogOptions = { |
856 | 843 | 'AutoOpen' : true, |
— | — | @@ -857,8 +844,6 @@ |
858 | 845 | }; |
859 | 846 | |
860 | 847 | dialog.dialog( dialogOptions ); |
861 | | - |
862 | | - e.preventDefault(); |
863 | 848 | }, |
864 | 849 | |
865 | 850 | 'getToken' : function( callback ) { |
— | — | @@ -1624,14 +1609,26 @@ |
1625 | 1610 | $j('.lqt-command-watch').live( 'click', liquidThreads.asyncWatch ); |
1626 | 1611 | $j('.lqt-command-unwatch').live( 'click', liquidThreads.asyncWatch ); |
1627 | 1612 | |
1628 | | - // Set up periodic update checking |
1629 | | - setInterval( liquidThreads.checkForUpdates, 60000 ); |
| 1613 | + // Live bind for link window |
| 1614 | + $j('.lqt-command-link').live( 'click', liquidThreads.showThreadLinkWindow ); |
1630 | 1615 | |
1631 | | - // Autogrowing textarea - this only affects the new-topic page |
1632 | | -// $j('#wpTextbox1')//.autogrow(); |
1633 | | - |
| 1616 | + // Live bind for summary links |
| 1617 | + $j('.lqt-summary-link').live( 'click', liquidThreads.showSummaryLinkWindow ); |
| 1618 | + |
| 1619 | + // For "show replies" |
| 1620 | + $j('a.lqt-show-replies').live( 'click', liquidThreads.showReplies ); |
| 1621 | + |
| 1622 | + // "Show more posts" link |
| 1623 | + $j('a.lqt-show-more-posts').live( 'click', liquidThreads.showMore ); |
| 1624 | + |
| 1625 | + // Save handlers |
1634 | 1626 | $j('#wpSave').live( 'click', liquidThreads.handleAJAXSave ); |
1635 | 1627 | $j('#wpTextbox1').live( 'keyup', liquidThreads.onTextboxKeyUp ); |
| 1628 | + |
| 1629 | + // Hide menus when a click happens outside them |
1636 | 1630 | $j(document).click( liquidThreads.handleDocumentClick ); |
| 1631 | + |
| 1632 | + // Set up periodic update checking |
| 1633 | + setInterval( liquidThreads.checkForUpdates, 60000 ); |
1637 | 1634 | } ); |
1638 | 1635 | |