Index: branches/wmf-deployment/extensions/LiquidThreads/jquery/jquery.autogrow.js |
— | — | @@ -0,0 +1,133 @@ |
| 2 | +/* |
| 3 | + * Auto Expanding Text Area (1.2.2) |
| 4 | + * by Chrys Bader (www.chrysbader.com) |
| 5 | + * chrysb@gmail.com |
| 6 | + * |
| 7 | + * Special thanks to: |
| 8 | + * Jake Chapa - jake@hybridstudio.com |
| 9 | + * John Resig - jeresig@gmail.com |
| 10 | + * |
| 11 | + * Copyright (c) 2008 Chrys Bader (www.chrysbader.com) |
| 12 | + * Dual licensed under the MIT (MIT-LICENSE.txt) |
| 13 | + * and GPL (GPL-LICENSE.txt) licenses. |
| 14 | + * |
| 15 | + * |
| 16 | + * NOTE: This script requires jQuery to work. Download jQuery at www.jquery.com |
| 17 | + * |
| 18 | + */ |
| 19 | + |
| 20 | +(function($) { |
| 21 | + |
| 22 | + var self = null; |
| 23 | + |
| 24 | + $.fn.autogrow = function(o) |
| 25 | + { |
| 26 | + return this.each(function() { |
| 27 | + new $.autogrow(this, o); |
| 28 | + }); |
| 29 | + }; |
| 30 | + |
| 31 | + |
| 32 | + /** |
| 33 | + * The autogrow object. |
| 34 | + * |
| 35 | + * @constructor |
| 36 | + * @name $.autogrow |
| 37 | + * @param Object e The textarea to create the autogrow for. |
| 38 | + * @param Hash o A set of key/value pairs to set as configuration properties. |
| 39 | + * @cat Plugins/autogrow |
| 40 | + */ |
| 41 | + |
| 42 | + $.autogrow = function (e, o) |
| 43 | + { |
| 44 | + this.options = o || {}; |
| 45 | + this.dummy = null; |
| 46 | + this.interval = null; |
| 47 | + this.line_height = this.options.lineHeight || parseInt($(e).css('line-height')); |
| 48 | + this.min_height = this.options.minHeight || parseInt($(e).css('min-height')); |
| 49 | + this.max_height = this.options.maxHeight || parseInt($(e).css('max-height'));; |
| 50 | + this.textarea = $(e); |
| 51 | + |
| 52 | + if(this.line_height == NaN) |
| 53 | + this.line_height = 0; |
| 54 | + |
| 55 | + // Only one textarea activated at a time, the one being used |
| 56 | + this.init(); |
| 57 | + }; |
| 58 | + |
| 59 | + $.autogrow.fn = $.autogrow.prototype = { |
| 60 | + autogrow: '1.2.2' |
| 61 | + }; |
| 62 | + |
| 63 | + $.autogrow.fn.extend = $.autogrow.extend = $.extend; |
| 64 | + |
| 65 | + $.autogrow.fn.extend({ |
| 66 | + |
| 67 | + init: function() { |
| 68 | + var self = this; |
| 69 | + this.textarea.css({overflow: 'hidden', display: 'block'}); |
| 70 | + this.textarea.bind('focus', function() { self.startExpand() } ).bind('blur', function() { self.stopExpand() }); |
| 71 | + this.checkExpand(); |
| 72 | + }, |
| 73 | + |
| 74 | + startExpand: function() { |
| 75 | + var self = this; |
| 76 | + this.interval = window.setInterval(function() {self.checkExpand()}, 400); |
| 77 | + }, |
| 78 | + |
| 79 | + stopExpand: function() { |
| 80 | + clearInterval(this.interval); |
| 81 | + }, |
| 82 | + |
| 83 | + checkExpand: function() { |
| 84 | + |
| 85 | + if (this.dummy == null) |
| 86 | + { |
| 87 | + this.dummy = $('<div></div>'); |
| 88 | + this.dummy.css({ |
| 89 | + 'font-size' : this.textarea.css('font-size'), |
| 90 | + 'font-family': this.textarea.css('font-family'), |
| 91 | + 'width' : this.textarea.css('width'), |
| 92 | + 'padding' : this.textarea.css('padding'), |
| 93 | + 'line-height': this.line_height + 'px', |
| 94 | + 'overflow-x' : 'hidden', |
| 95 | + 'position' : 'absolute', |
| 96 | + 'top' : 0, |
| 97 | + 'left' : -9999 |
| 98 | + }).appendTo('body'); |
| 99 | + } |
| 100 | + |
| 101 | + // Strip HTML tags |
| 102 | + var html = this.textarea.val().replace(/(<|>)/g, ''); |
| 103 | + |
| 104 | + // IE is different, as per usual |
| 105 | + if ($.browser.msie) |
| 106 | + { |
| 107 | + html = html.replace(/\n/g, '<BR>new'); |
| 108 | + } |
| 109 | + else |
| 110 | + { |
| 111 | + html = html.replace(/\n/g, '<br>new'); |
| 112 | + } |
| 113 | + |
| 114 | + if (this.dummy.html() != html) |
| 115 | + { |
| 116 | + this.dummy.html(html); |
| 117 | + |
| 118 | + if (this.max_height > 0 && (this.dummy.height() + this.line_height > this.max_height)) |
| 119 | + { |
| 120 | + this.textarea.css('overflow-y', 'auto'); |
| 121 | + } |
| 122 | + else |
| 123 | + { |
| 124 | + this.textarea.css('overflow-y', 'hidden'); |
| 125 | + if (this.textarea.height() < this.dummy.height() + this.line_height || (this.dummy.height() < this.textarea.height())) |
| 126 | + { |
| 127 | + this.textarea.animate({height: (this.dummy.height() + this.line_height) + 'px'}, 100); |
| 128 | + } |
| 129 | + } |
| 130 | + } |
| 131 | + } |
| 132 | + |
| 133 | + }); |
| 134 | +})(jQuery); |
\ No newline at end of file |
Property changes on: branches/wmf-deployment/extensions/LiquidThreads/jquery/jquery.autogrow.js |
___________________________________________________________________ |
Name: svn:eol-style |
1 | 135 | + native |
Name: svn:executable |
2 | 136 | + * |
Index: branches/wmf-deployment/extensions/LiquidThreads/lqt.css |
— | — | @@ -1,4 +1,10 @@ |
2 | 2 | |
| 3 | +#wpTextbox1 { |
| 4 | + /* Textareas in lqt use auto-sizing based on these properties */ |
| 5 | + height: 5em; |
| 6 | + max-height: 10em; |
| 7 | + min-height: 5em; |
| 8 | +} |
3 | 9 | .lqt_watchlist_messages_notice { |
4 | 10 | background-color: #eee; |
5 | 11 | border: 1px solid #ddd; |
— | — | @@ -132,14 +138,13 @@ |
133 | 139 | list-style-type: none; |
134 | 140 | padding-right: 0.6em; |
135 | 141 | } |
136 | | - |
137 | 142 | #lqt_subject_field { |
138 | 143 | margin-top: 0.7em; |
139 | 144 | margin-bottom: 0.5em; |
140 | 145 | width: 80%; |
141 | 146 | } |
142 | 147 | |
143 | | -li#ca-nstab-thread { |
| 148 | +body.skin-monobook li#ca-nstab-thread { |
144 | 149 | /* from #ca-talk */ |
145 | 150 | margin-right: 1.6em; |
146 | 151 | } |
— | — | @@ -230,9 +235,8 @@ |
231 | 236 | } |
232 | 237 | |
233 | 238 | .lqt-thread-actions-trigger { |
234 | | - padding: 0.5em; |
235 | 239 | margin-top: 8px; |
236 | | - border: 1px transparent solid; |
| 240 | + border: none; |
237 | 241 | color: #002BB8; |
238 | 242 | } |
239 | 243 | |
— | — | @@ -249,15 +253,14 @@ |
250 | 254 | list-style: none; |
251 | 255 | padding: 0; |
252 | 256 | z-index: 10; |
253 | | - margin-top: 8px; |
| 257 | + margin-top: 0px; |
254 | 258 | |
255 | 259 | } |
256 | | - |
257 | 260 | .lqt-thread-toolbar-command-list li { |
258 | 261 | padding-left: 0.5em; |
259 | 262 | padding-right: 0.5em; |
260 | | - margin-top: 0; |
261 | | - margin-bottom: 0; |
| 263 | + margin-top: 0; |
| 264 | + margin-bottom: 0; |
262 | 265 | list-style-type: none; |
263 | 266 | list-style-image: none; |
264 | 267 | display: block; |
— | — | @@ -274,16 +277,14 @@ |
275 | 278 | } |
276 | 279 | |
277 | 280 | .lqt-thread-actions-icon { |
| 281 | + display: block; |
| 282 | + width: 1.5em; |
| 283 | + height: 2em; |
| 284 | + padding-left: 0.5em; |
278 | 285 | background-image: url('icons/arrow-down-icon.png'); |
279 | | - background-position: center-bottom; |
| 286 | + background-position: center center; |
280 | 287 | background-repeat: no-repeat; |
281 | | - height: 80%; |
282 | | - width: 1em; |
283 | | - height: 2em; |
284 | | - padding-bottom: 0.2em; |
285 | | - padding-left: 26px; |
286 | 288 | } |
287 | | - |
288 | 289 | .lqt-talkpage-search { |
289 | 290 | /*float: left;*/ |
290 | 291 | display: inline-block; |
— | — | @@ -308,6 +309,8 @@ |
309 | 310 | height: 1px; |
310 | 311 | padding: 0; |
311 | 312 | margin: 0; |
| 313 | + margin-left: 1em; |
| 314 | + margin-bottom: -1px; |
312 | 315 | background-image: url(images/break.png); |
313 | 316 | background-position: bottom; |
314 | 317 | background-repeat: repeat-x; |
— | — | @@ -321,7 +324,7 @@ |
322 | 325 | } |
323 | 326 | |
324 | 327 | .lqt-thread-replies { |
325 | | - margin-left: 2em; |
| 328 | + margin-left: 1em; |
326 | 329 | } |
327 | 330 | |
328 | 331 | .lqt-thread-topmost, |
— | — | @@ -341,10 +344,12 @@ |
342 | 345 | background-image: url(images/corner.png); |
343 | 346 | background-repeat: no-repeat; |
344 | 347 | background-position: bottom left; |
| 348 | + /* The space is caused by the use of a non-breaking space, so we need to use line-height here */ |
| 349 | + line-height: 1em; |
345 | 350 | } |
346 | 351 | |
347 | 352 | .lqt-post-wrapper { |
348 | | - padding: 0.5em; |
| 353 | + padding: 0.5em 1em; |
349 | 354 | } |
350 | 355 | |
351 | 356 | .lqt-thread-info-panel { |
— | — | @@ -383,74 +388,54 @@ |
384 | 389 | background-repeat: no-repeat; |
385 | 390 | padding-right: 8px; |
386 | 391 | } |
387 | | - |
388 | | -.lqt-thread-toolbar-commands > .lqt-command > a { |
389 | | - height: 1.25em; |
390 | | - background-repeat: no-repeat; |
391 | | - background-position: center; |
| 392 | +.lqt-command { |
| 393 | + margin-top: 8px; |
| 394 | + padding: 0; |
392 | 395 | } |
393 | | - |
394 | | -.lqt-thread-toolbar-commands { |
395 | | - height: 30px; |
396 | | -} |
397 | | - |
398 | | -.lqt-command-reply { |
399 | | - margin-right: 8px; |
400 | | -} |
401 | | - |
402 | 396 | .lqt-thread-toolbar .lqt-command > a { |
403 | 397 | display: block; |
404 | 398 | } |
405 | 399 | |
406 | | -.lqt-thread-toolbar-commands > .lqt-command-edit a { |
407 | | - background-image: url(icons/edit.png); |
408 | | - padding-left: 26px; |
| 400 | +.lqt-command-link a { |
| 401 | + margin-left: 1em; |
| 402 | + height: 2em; |
| 403 | + width: 2em; |
| 404 | + background-image: url(icons/link.png) !important; |
| 405 | + background-repeat: no-repeat; |
409 | 406 | } |
410 | | - |
411 | | -.lqt-thread-toolbar-commands > .lqt-command-reply a { |
| 407 | +.lqt-command-reply a { |
| 408 | + margin-left: 1em; |
| 409 | + height: 2em; |
412 | 410 | background-image: url(icons/reply.png); |
413 | | - background-position: left; |
| 411 | + background-position: left center !important; |
| 412 | + background-repeat: no-repeat; |
414 | 413 | padding-left: 26px; |
415 | | - margin-left: 8px; |
| 414 | + line-height: 2em; |
416 | 415 | } |
417 | | - |
418 | | -.lqt-thread-toolbar-commands > .lqt-command-history { |
419 | | - margin-left: 8px; |
420 | | -} |
421 | | - |
422 | 416 | .lqt-command-quote a { |
| 417 | + margin-left: 1em; |
| 418 | + height: 2em; |
423 | 419 | background-image: url(icons/quote.png); |
424 | | - margin-left: 8px; |
425 | | - padding-left: 26px; |
426 | 420 | background-position: left center !important; |
427 | | -} |
428 | | - |
429 | | -.lqt-command-merge-to { |
430 | | - margin-left: 8px; |
431 | | -} |
432 | | - |
433 | | -.lqt-command-link a { |
434 | | - background-image: url(icons/link.png) !important; |
| 421 | + background-repeat: no-repeat; |
435 | 422 | padding-left: 26px; |
| 423 | + line-height: 2em; |
436 | 424 | } |
437 | | - |
438 | | -ul.lqt-thread-toolbar-commands { |
| 425 | +.lqt-thread-toolbar-menu { |
| 426 | + margin-top: 8px; |
| 427 | + height: 2em; |
| 428 | +} |
| 429 | +.lqt-thread-toolbar-commands { |
439 | 430 | list-style: none; |
440 | 431 | padding: 0; |
441 | 432 | margin: 0; |
442 | 433 | line-height: 1em; |
| 434 | + height: 1em; |
443 | 435 | } |
444 | | - |
445 | 436 | .lqt-thread-toolbar-commands > .lqt-command, |
446 | 437 | .lqt-thread-toolbar-menu { |
447 | 438 | float: left; |
448 | 439 | } |
449 | | - |
450 | | -.lqt-command { |
451 | | - margin-top: 8px; |
452 | | - padding: 0; |
453 | | -} |
454 | | - |
455 | 440 | .lqt-thread-toolbar * { |
456 | 441 | text-decoration: none !important; |
457 | 442 | } |
Index: branches/wmf-deployment/extensions/LiquidThreads/classes/View.php |
— | — | @@ -631,15 +631,16 @@ |
632 | 632 | 'href' => $thread->title()->getFullURL(), |
633 | 633 | 'enabled' => true, 'icon' => 'link.png', |
634 | 634 | 'tooltip' => wfMsgExt( 'lqt_permalink', 'parseinline' ) ); |
635 | | - |
| 635 | + /* |
636 | 636 | if ( $thread->root()->getTitle()->quickUserCan( 'edit' ) ) { |
637 | 637 | $commands['edit'] = array( |
638 | 638 | 'label' => wfMsgExt( 'edit', 'parseinline' ), |
639 | 639 | 'href' => $this->talkpageUrl( $this->title, 'edit', $thread, |
640 | | - true /* include fragment */, $this->request ), |
| 640 | + true, $this->request ), |
641 | 641 | 'enabled' => true, 'icon' => 'edit.png', |
642 | 642 | 'tooltip' => wfMsgExt( 'edit', 'parseinline' ) ); |
643 | 643 | } |
| 644 | + */ |
644 | 645 | |
645 | 646 | return $commands; |
646 | 647 | } |
— | — | @@ -702,6 +703,8 @@ |
703 | 704 | $wgOut->addExtensionStyle( "{$wgScriptPath}/extensions/LiquidThreads/jquery/jquery-ui-1.7.2.css" ); |
704 | 705 | } |
705 | 706 | |
| 707 | + $wgOut->addScriptFile( "{$wgScriptPath}/extensions/LiquidThreads/jquery/jquery.autogrow.js" ); |
| 708 | + |
706 | 709 | $wgOut->addScriptFile( "{$wgScriptPath}/extensions/LiquidThreads/lqt.js" ); |
707 | 710 | $wgOut->addExtensionStyle( "{$wgScriptPath}/extensions/LiquidThreads/lqt.css?{$wgStyleVersion}" ); |
708 | 711 | |
— | — | @@ -770,7 +773,7 @@ |
771 | 774 | $commands = $this->threadCommands( $thread ); |
772 | 775 | $menuHTML = Xml::tags( 'ul', array( 'class' => 'lqt-thread-toolbar-command-list' ), |
773 | 776 | $this->listItemsForCommands( $commands ) ); |
774 | | - |
| 777 | + |
775 | 778 | $triggerText = Xml::tags( 'span', array( 'class' => 'lqt-thread-actions-icon' ), |
776 | 779 | ' ' ); |
777 | 780 | $dropDownTrigger = Xml::tags( 'div', |
— | — | @@ -783,7 +786,7 @@ |
784 | 787 | array( 'class' => 'lqt-thread-toolbar-menu' ), |
785 | 788 | $dropDownTrigger ); |
786 | 789 | } |
787 | | - |
| 790 | + |
788 | 791 | $html .= implode( ' ', $headerParts ); |
789 | 792 | |
790 | 793 | $html = Xml::tags( 'ul', array( 'class' => 'lqt-thread-toolbar-commands' ), $html ); |
Index: branches/wmf-deployment/extensions/LiquidThreads/lqt.js |
— | — | @@ -64,8 +64,8 @@ |
65 | 65 | // Buffer at the top, roughly enough to see the heading and one line |
66 | 66 | targetOffset -= 100; |
67 | 67 | $j('html,body').animate({scrollTop: targetOffset}, 'slow'); |
68 | | - |
69 | | - $j(container).find('#wpTextbox1').focus(); |
| 68 | + // Auto-focus and set to auto-grow as well |
| 69 | + $j(container).find('#wpTextbox1').focus().autogrow(); |
70 | 70 | // Focus the subject field if there is one. Overrides previous line. |
71 | 71 | $j(container).find('#lqt_subject_field').focus(); |
72 | 72 | } |
— | — | @@ -227,30 +227,25 @@ |
228 | 228 | toolbar.hide(); |
229 | 229 | |
230 | 230 | post.hover( |
231 | | - function() { |
232 | | - toolbar.fadeIn(100); |
233 | | - liquidThreads.currentToolbar = toolbar; |
234 | | - } /* over */, |
235 | | - function() { |
236 | | - if ( liquidThreads.currentToolbar && |
237 | | - liquidThreads.currentToolbar.is(toolbar) ) { |
238 | | - liquidThreads.currentToolbar = null; |
239 | | - } |
240 | | - |
241 | | - toolbar.fadeOut(20); |
242 | | - }/*out */ ); |
| 231 | + function() { |
| 232 | + toolbar.fadeIn(100); |
| 233 | + liquidThreads.currentToolbar = toolbar; |
| 234 | + }, |
| 235 | + function() { |
| 236 | + if ( liquidThreads.currentToolbar && |
| 237 | + liquidThreads.currentToolbar.is(toolbar) ) { |
| 238 | + liquidThreads.currentToolbar = null; |
| 239 | + } |
| 240 | + toolbar.fadeOut(20); |
| 241 | + } |
| 242 | + ); |
243 | 243 | |
244 | 244 | var menu = post.find('.lqt-thread-toolbar-command-list'); |
245 | 245 | var menuContainer = post.find( '.lqt-thread-toolbar-menu' ); |
246 | 246 | menu.remove().appendTo( menuContainer ); |
247 | 247 | menuContainer.find('.lqt-thread-toolbar-command-list').hide(); |
248 | | - |
249 | | - var menuTrigger = menuContainer.find( '.lqt-thread-actions-trigger' ); |
250 | | - |
251 | | - menuTrigger.hover( function() { menu.fadeIn(); } ); |
252 | | - toolbar.hover( function() {}, function() { menu.fadeOut(); } ); |
253 | | - |
254 | | - menuTrigger.show(); |
| 248 | + menuContainer.hover( function() { menu.fadeIn(); }, function() { menu.fadeOut(); } ); |
| 249 | + menuContainer.find( '.lqt-thread-actions-trigger' ).show(); |
255 | 250 | }, |
256 | 251 | |
257 | 252 | 'checkForUpdates' : function() { |
— | — | @@ -612,5 +607,8 @@ |
613 | 608 | |
614 | 609 | // Set up periodic update checking |
615 | 610 | setInterval( liquidThreads.checkForUpdates, 60000 ); |
| 611 | + |
| 612 | + // Autogrowing textarea - this only affects the new-topic page |
| 613 | + $j('#wpTextbox1').autogrow(); |
616 | 614 | } ); |
617 | 615 | |
Index: branches/wmf-deployment/extensions/LiquidThreads/icons/edit-desat.png |
Cannot display: file marked as a binary type. |
svn:mime-type = image/png |
Index: branches/wmf-deployment/extensions/LiquidThreads/icons/quote.svg |
Cannot display: file marked as a binary type. |
svn:mime-type = image/svg+xml |
Index: branches/wmf-deployment/extensions/LiquidThreads/icons/link-desat.png |
Cannot display: file marked as a binary type. |
svn:mime-type = image/png |
Index: branches/wmf-deployment/extensions/LiquidThreads/icons/link.png |
Cannot display: file marked as a binary type. |
svn:mime-type = image/png |
Index: branches/wmf-deployment/extensions/LiquidThreads/icons/quote.png |
Cannot display: file marked as a binary type. |
svn:mime-type = image/png |
Index: branches/wmf-deployment/extensions/LiquidThreads/icons/edit.png |
Cannot display: file marked as a binary type. |
svn:mime-type = image/png |
Index: branches/wmf-deployment/extensions/LiquidThreads/icons/reply.png |
— | — | @@ -1,5 +1,5 @@ |
2 | 2 | �PNG
|
3 | 3 | |
4 | 4 |
-IHDR �j� tEXtSoftware Adobe ImageReadyq�e< |