Index: trunk/extensions/MoodBar/SpecialMoodBarFeedback.php |
— | — | @@ -102,6 +102,7 @@ |
103 | 103 | global $wgLang, $wgRequest; |
104 | 104 | $now = wfTimestamp( TS_UNIX ); |
105 | 105 | $list = ''; |
| 106 | + $firstRow = false; // TODO support the "Newer" link with this |
106 | 107 | foreach ( $rows as $row ) { |
107 | 108 | $type = $row->mbf_type; |
108 | 109 | $typeMsg = wfMessage( "moodbar-type-$type" )->escaped(); |
— | — | @@ -139,11 +140,33 @@ |
140 | 141 | // Only show paging stuff if the result is not empty and there are more results |
141 | 142 | $html = "<ul id=\"fbd-list\">$list</ul>"; |
142 | 143 | if ( $lastRow ) { |
143 | | - $offset = wfTimestamp( TS_MW, $lastRow->mbf_timestamp ) . '|' . intval( $lastRow->mbf_id ); |
144 | | - $moreURL = htmlspecialchars( $this->getTitle()->getLinkURL( $this->getQuery( $offset ) ) ); |
145 | 144 | $moreText = wfMessage( 'moodbar-feedback-more' )->escaped(); |
146 | | - $html .= "<div id=\"fbd-list-more\"><a href=\"$moreURL\">More</a></div>"; |
| 145 | + $html .= '<div id="fbd-list-more"><a href="#">' . $moreText . '</a></div>'; |
147 | 146 | } |
| 147 | + |
| 148 | + $olderURL = $newerURL = false; |
| 149 | + if ( $lastRow ) { |
| 150 | + $offset = wfTimestamp( TS_MW, $lastRow->mbf_timestamp ) . '|' . intval( $lastRow->mbf_id ); |
| 151 | + $olderURL = htmlspecialchars( $this->getTitle()->getLinkURL( $this->getQuery( $offset ) ) ); |
| 152 | + } |
| 153 | + if ( $firstRow ) { |
| 154 | + $newerURL = htmlspecialchars( '#' ); // TODO |
| 155 | + } |
| 156 | + $olderText = wfMessage( 'moodbar-feedback-older' )->escaped(); |
| 157 | + $newerText = wfMessage( 'moodbar-feedback-newer' )->escaped(); |
| 158 | + $html .= '<div id="fbd-list-newer-older"><div id="fbd-list-newer">'; |
| 159 | + if ( $newerURL ) { |
| 160 | + $html .= "<a href=\"$newerURL\">$newerText</a>"; |
| 161 | + } else { |
| 162 | + $html .= "<span class=\"fbd-page-disabled\">$newerText</span>"; |
| 163 | + } |
| 164 | + $html .= '</div><div id="fbd-list-older">'; |
| 165 | + if ( $olderURL ) { |
| 166 | + $html .= "<a href=\"$olderURL\">$olderText</a>"; |
| 167 | + } else { |
| 168 | + $html .= "<span class=\"fbd-page-disabled\">$olderText</span>"; |
| 169 | + } |
| 170 | + $html .= '</div><div style="clear: both;"></div></div>'; |
148 | 171 | return $html; |
149 | 172 | } |
150 | 173 | } |
Index: trunk/extensions/MoodBar/MoodBar.i18n.php |
— | — | @@ -84,6 +84,9 @@ |
85 | 85 | 'moodbar-feedback-whatis' => 'What is this feature?', |
86 | 86 | 'moodbar-feedback-permalink' => 'link to here', |
87 | 87 | 'moodbar-feedback-noresults' => 'There are no comments that match your filters.', |
| 88 | + 'moodbar-feedback-more' => 'More', |
| 89 | + 'moodbar-feedback-newer' => 'Newer', |
| 90 | + 'moodbar-feedback-older' => 'Older', |
88 | 91 | // Mood types |
89 | 92 | 'moodbar-type-happy' => 'Happy', |
90 | 93 | 'moodbar-type-sad' => 'Sad', |
Index: trunk/extensions/MoodBar/modules/ext.moodBar.dashboard/page.css |
— | — | @@ -87,22 +87,82 @@ |
88 | 88 | list-style: none; |
89 | 89 | } |
90 | 90 | |
91 | | -#fbd-list-more { |
| 91 | +.client-nojs #fbd-list-more { |
| 92 | + display: none; |
| 93 | +} |
| 94 | + |
| 95 | +.client-js #fbd-list-newer-older { |
| 96 | + display: none; |
| 97 | +} |
| 98 | + |
| 99 | +#fbd-list-more, #fbd-list-newer-older { |
92 | 100 | margin: 1em 0 0 13em; |
93 | 101 | padding: 0.5em; |
94 | 102 | background-color: #e8f2f8; |
| 103 | +} |
| 104 | + |
| 105 | +#fbd-list-more a, #fbd-list-newer a, #fbd-list-older a, |
| 106 | +#fbd-list-newer .fbd-page-disabled, #fbd-list-older .fbd-page-disabled { |
| 107 | + font-size: 1.4em; |
| 108 | + background-repeat: no-repeat; |
| 109 | +} |
| 110 | + |
| 111 | +#fbd-list-more { |
95 | 112 | text-align: center; |
96 | 113 | } |
97 | 114 | |
98 | 115 | #fbd-list-more a { |
99 | | - font-size: 1.4em; |
100 | | - padding-left: 20px; |
101 | 116 | /* @embed */ |
102 | 117 | background-image: url(images/page-more.png); |
103 | 118 | background-position: left center; |
104 | | - background-repeat: no-repeat; |
| 119 | + padding-left: 20px; |
105 | 120 | } |
106 | 121 | |
| 122 | +#fbd-list-newer { |
| 123 | + float: left; |
| 124 | +} |
| 125 | + |
| 126 | +#fbd-list-newer a, #fbd-list-newer .fbd-page-disabled { |
| 127 | + background-position: left center; |
| 128 | + padding-left: 20px; |
| 129 | +} |
| 130 | + |
| 131 | +/* The images here are named -ltr instead of -left and -rtl instead of -right |
| 132 | + * because ResourceLoader flips -ltr and -rtl in URLs, but not -left and -right |
| 133 | + */ |
| 134 | +#fbd-list-newer a { |
| 135 | + /* @embed */ |
| 136 | + background-image: url(images/page-active-ltr.png); |
| 137 | +} |
| 138 | + |
| 139 | +#fbd-list-newer .fbd-page-disabled { |
| 140 | + /* @embed */ |
| 141 | + background-image: url(images/page-disabled-ltr.png); |
| 142 | +} |
| 143 | + |
| 144 | +#fbd-list-older { |
| 145 | + float: right; |
| 146 | +} |
| 147 | + |
| 148 | +#fbd-list-older a, #fbd-list-older .fbd-page-disabled { |
| 149 | + background-position: right center; |
| 150 | + padding-right: 20px; |
| 151 | +} |
| 152 | + |
| 153 | +#fbd-list-older a { |
| 154 | + /* @embed */ |
| 155 | + background-image: url(images/page-active-rtl.png); |
| 156 | +} |
| 157 | + |
| 158 | +#fbd-list-older .fbd-page-disabled { |
| 159 | + /* @embed */ |
| 160 | + background-image: url(images/page-disabled-rtl.png); |
| 161 | +} |
| 162 | + |
| 163 | +.fbd-page-disabled { |
| 164 | + color: #c6c6c6; |
| 165 | +} |
| 166 | + |
107 | 167 | .fbd-item { |
108 | 168 | border-bottom: solid 1px silver; |
109 | 169 | position: relative; |
Index: trunk/extensions/MoodBar/modules/ext.moodBar.dashboard/images/page-disabled-ltr.png |
Cannot display: file marked as a binary type. |
svn:mime-type = image/png |
Property changes on: trunk/extensions/MoodBar/modules/ext.moodBar.dashboard/images/page-disabled-ltr.png |
___________________________________________________________________ |
Added: svn:mime-type |
110 | 170 | + image/png |
Index: trunk/extensions/MoodBar/modules/ext.moodBar.dashboard/images/page-disabled-rtl.png |
Cannot display: file marked as a binary type. |
svn:mime-type = image/png |
Property changes on: trunk/extensions/MoodBar/modules/ext.moodBar.dashboard/images/page-disabled-rtl.png |
___________________________________________________________________ |
Added: svn:mime-type |
111 | 171 | + image/png |
Index: trunk/extensions/MoodBar/modules/ext.moodBar.dashboard/images/page-active-ltr.png |
Cannot display: file marked as a binary type. |
svn:mime-type = image/png |
Property changes on: trunk/extensions/MoodBar/modules/ext.moodBar.dashboard/images/page-active-ltr.png |
___________________________________________________________________ |
Added: svn:mime-type |
112 | 172 | + image/png |
Index: trunk/extensions/MoodBar/modules/ext.moodBar.dashboard/images/page-active-rtl.png |
Cannot display: file marked as a binary type. |
svn:mime-type = image/png |
Property changes on: trunk/extensions/MoodBar/modules/ext.moodBar.dashboard/images/page-active-rtl.png |
___________________________________________________________________ |
Added: svn:mime-type |
113 | 173 | + image/png |