Index: trunk/extensions/ArticleFeedbackv5/modules/jquery.articleFeedbackv5/jquery.articleFeedbackv5.css |
— | — | @@ -469,7 +469,6 @@ |
470 | 470 | font-weight: bold; |
471 | 471 | } |
472 | 472 | .articleFeedbackv5-tooltip-wrap { |
473 | | - float: right; |
474 | 473 | position: relative; |
475 | 474 | } |
476 | 475 | .articleFeedbackv5-tooltip-wrap:after { |
— | — | @@ -478,7 +477,7 @@ |
479 | 478 | .articleFeedbackv5-tooltip { |
480 | 479 | position: absolute; |
481 | 480 | z-index: 15; |
482 | | - top: -160px; |
| 481 | + top: -450px; |
483 | 482 | right: -105px; |
484 | 483 | font-size: 12px; |
485 | 484 | width: 234px; |
— | — | @@ -518,6 +517,13 @@ |
519 | 518 | height: 26px; |
520 | 519 | } |
521 | 520 | |
| 521 | +.articleFeedbackv5-tooltip-trigger-wrap { |
| 522 | + float: right; |
| 523 | + position: relative; |
| 524 | +} |
| 525 | +.articleFeedbackv5-tooltip-trigger-wrap:after { |
| 526 | + clear: both; |
| 527 | +} |
522 | 528 | .articleFeedbackv5-tooltip-trigger { |
523 | 529 | display: block; |
524 | 530 | float: left; |
— | — | @@ -798,6 +804,15 @@ |
799 | 805 | padding-bottom: .17em; |
800 | 806 | } |
801 | 807 | |
| 808 | +.articleFeedbackv5-dialog.ui-dialog .articleFeedbackv5-tooltip-wrap { |
| 809 | + position: static; |
| 810 | +} |
| 811 | + |
| 812 | +.articleFeedbackv5-dialog.ui-dialog .articleFeedbackv5-tooltip { |
| 813 | + top: -195px; |
| 814 | + right: -53px; |
| 815 | +} |
| 816 | + |
802 | 817 | body .ui-dialog .ui-icon-closethick { |
803 | 818 | text-indent: -90000px; |
804 | 819 | width: 23px; |
Index: trunk/extensions/ArticleFeedbackv5/modules/jquery.articleFeedbackv5/jquery.articleFeedbackv5.js |
— | — | @@ -140,12 +140,12 @@ |
141 | 141 | * The feedback ID (collected on submit, for use in tracking edits) |
142 | 142 | */ |
143 | 143 | $.articleFeedbackv5.feedbackId = 0; |
144 | | - |
145 | | - /** |
146 | | - * Currently displayed placeholder text for option 2. This is a workaround for Chrome/FF |
147 | | - * behavior overlays. |
148 | | - */ |
149 | | - $.currentDefaultText = ""; |
| 144 | + |
| 145 | + /** |
| 146 | + * Currently displayed placeholder text for option 2. This is a workaround for Chrome/FF |
| 147 | + * behavior overlays. |
| 148 | + */ |
| 149 | + $.currentDefaultText = ""; |
150 | 150 | |
151 | 151 | // }}} |
152 | 152 | // {{{ Templates |
— | — | @@ -158,7 +158,21 @@ |
159 | 159 | <div class="articleFeedbackv5-title-wrap">\ |
160 | 160 | <h2 class="articleFeedbackv5-title"></h2>\ |
161 | 161 | </div>\ |
162 | | - <div class="articleFeedbackv5-ui" />\ |
| 162 | + <div class="articleFeedbackv5-ui">\ |
| 163 | + <div class="articleFeedbackv5-ui-inner"></div>\ |
| 164 | + <div class="articleFeedbackv5-tooltip-wrap">\ |
| 165 | + <div class="articleFeedbackv5-tooltip">\ |
| 166 | + <div class="tooltip-top"></div>\ |
| 167 | + <div class="tooltip-repeat">\ |
| 168 | + <h3><html:msg key="help-tooltip-title" /></h3><span class="articleFeedbackv5-tooltip-close">X</span>\ |
| 169 | + <div class="clear"></div>\ |
| 170 | + <p class="articleFeedbackv5-tooltip-info"><html:msg key="help-tooltip-info" /></p>\ |
| 171 | + <p><a target="_blank" class="articleFeedbackv5-tooltip-link"><html:msg key="help-tooltip-linktext" /> >></a></p>\ |
| 172 | + </div>\ |
| 173 | + <div class="tooltip-bottom"></div>\ |
| 174 | + </div>\ |
| 175 | + </div>\ |
| 176 | + </div>\ |
163 | 177 | </div>\ |
164 | 178 | <div class="articleFeedbackv5-error"><div class="articleFeedbackv5-error-message"></div></div>\ |
165 | 179 | <div style="clear:both;"></div>\ |
— | — | @@ -174,21 +188,7 @@ |
175 | 189 | </div>\ |
176 | 190 | ', |
177 | 191 | |
178 | | - helpToolTip: '\ |
179 | | - <div class="articleFeedbackv5-tooltip-wrap">\ |
180 | | - <a class="articleFeedbackv5-tooltip-trigger"></a>\ |
181 | | - <div class="articleFeedbackv5-tooltip">\ |
182 | | - <div class="tooltip-top"></div>\ |
183 | | - <div class="tooltip-repeat">\ |
184 | | - <h3><html:msg key="help-tooltip-title" /></h3><span class="articleFeedbackv5-tooltip-close">X</span>\ |
185 | | - <div class="clear"></div>\ |
186 | | - <p class="articleFeedbackv5-tooltip-info"><html:msg key="help-tooltip-info" /></p>\ |
187 | | - <p><a target="_blank" class="articleFeedbackv5-tooltip-link"><html:msg key="help-tooltip-linktext" /> >></a></p>\ |
188 | | - </div>\ |
189 | | - <div class="tooltip-bottom"></div>\ |
190 | | - </div>\ |
191 | | - </div>\ |
192 | | - ', |
| 192 | + helpToolTipTrigger: '<div class="articleFeedbackv5-tooltip-trigger-wrap"><a class="articleFeedbackv5-tooltip-trigger"></a></div>', |
193 | 193 | |
194 | 194 | clear: '<div class="clear"></div>' |
195 | 195 | |
— | — | @@ -543,7 +543,7 @@ |
544 | 544 | // Add the tags from the options |
545 | 545 | $block.find( '.articleFeedbackv5-tags ul' ).each( function () { |
546 | 546 | var info = $.articleFeedbackv5.currentBucket().tagInfo; |
547 | | - var tabIndex = 1; |
| 547 | + var tabIndex = 1; |
548 | 548 | for ( var i in info ) { |
549 | 549 | var key = info[i]; |
550 | 550 | var comm_def_msg = 'articlefeedbackv5-bucket2-' + key + '-comment-default'; |
— | — | @@ -554,7 +554,7 @@ |
555 | 555 | $tag.attr( 'rel', key ); |
556 | 556 | $tag.find( '.articleFeedbackv5-tag-input' ) |
557 | 557 | .attr( 'id', tag_id ) |
558 | | - .attr( 'tabindex', tabIndex++) |
| 558 | + .attr( 'tabindex', tabIndex++) |
559 | 559 | .val( key ); |
560 | 560 | $tag.find( '.articleFeedbackv5-tag-label' ) |
561 | 561 | .addClass( 'articleFeedbackv5-bucket2-' + key + '-label' ) |
— | — | @@ -616,7 +616,6 @@ |
617 | 617 | $block.find( '.articleFeedbackv5-comment textarea' ) |
618 | 618 | .focus( function () { |
619 | 619 | if ( $( this ).val() == $.currentDefaultText ) { |
620 | | - console.log('in if'); |
621 | 620 | $( this ).val( '' ); |
622 | 621 | $(this).addClass( 'active' ); |
623 | 622 | } |
— | — | @@ -689,8 +688,8 @@ |
690 | 689 | } |
691 | 690 | if ( empty ) { |
692 | 691 | $c.val( $.articleFeedbackv5.currentBucket().commentDefault[key] ); |
693 | | - // Store default text, workaround for overlay bug in Chrome/FF |
694 | | - $.currentDefaultText = $.articleFeedbackv5.currentBucket().commentDefault[key]; |
| 692 | + // Store default text, workaround for overlay bug in Chrome/FF |
| 693 | + $.currentDefaultText = $.articleFeedbackv5.currentBucket().commentDefault[key]; |
695 | 694 | } |
696 | 695 | } else { |
697 | 696 | // Clear checked |
— | — | @@ -1839,10 +1838,10 @@ |
1840 | 1839 | |
1841 | 1840 | // Start up the block to return |
1842 | 1841 | var $block = $( $.articleFeedbackv5.currentCTA().templates.block ); |
1843 | | - |
1844 | | - // Fill in the tutorial link |
1845 | | - $block.find( '.articleFeedbackv5-confirmation-learnHow a' ) |
1846 | | - .attr( 'href', mw.msg( 'articlefeedbackv5-cta1-learn-how-url' ) ); |
| 1842 | + |
| 1843 | + // Fill in the tutorial link |
| 1844 | + $block.find( '.articleFeedbackv5-confirmation-learnHow a' ) |
| 1845 | + .attr( 'href', mw.msg( 'articlefeedbackv5-cta1-learn-how-url' ) ); |
1847 | 1846 | |
1848 | 1847 | // Fill in the link |
1849 | 1848 | $block.find( '.articleFeedbackv5-edit-cta-link' ) |
— | — | @@ -2041,13 +2040,13 @@ |
2042 | 2041 | * @param state bool true to enable; false to disable |
2043 | 2042 | */ |
2044 | 2043 | $.articleFeedbackv5.enableSubmission = function ( state ) { |
2045 | | - // this is actually required to resolve jQuery behavior of not triggering the |
2046 | | - // click event when .blur() occurs on the textarea and .click() is supposed to |
2047 | | - // be triggered on the button. |
2048 | | - if($.articleFeedbackv5.submissionEnabled == state ) { |
2049 | | - return; |
2050 | | - } |
2051 | | - |
| 2044 | + // this is actually required to resolve jQuery behavior of not triggering the |
| 2045 | + // click event when .blur() occurs on the textarea and .click() is supposed to |
| 2046 | + // be triggered on the button. |
| 2047 | + if($.articleFeedbackv5.submissionEnabled == state ) { |
| 2048 | + return; |
| 2049 | + } |
| 2050 | + |
2052 | 2051 | if ( state ) { |
2053 | 2052 | $.articleFeedbackv5.find( '.articleFeedbackv5-submit' ).button( 'enable' ); |
2054 | 2053 | } else { |
— | — | @@ -2105,27 +2104,33 @@ |
2106 | 2105 | // Wrap it in a panel |
2107 | 2106 | var $wrapper = $( $.articleFeedbackv5.templates.panelOuter ); |
2108 | 2107 | $wrapper.find( '.articleFeedbackv5-ui' ) |
2109 | | - .addClass( 'articleFeedbackv5-option-' + $.articleFeedbackv5.bucketId ) |
| 2108 | + .addClass( 'articleFeedbackv5-option-' + $.articleFeedbackv5.bucketId ); |
| 2109 | + $wrapper.find( '.articleFeedbackv5-ui-inner' ) |
2110 | 2110 | .append( $block ); |
2111 | 2111 | |
| 2112 | + // Set up the help tooltip |
| 2113 | + $wrapper.find( '.articleFeedbackv5-tooltip-link' ) |
| 2114 | + .attr( 'href', mw.msg( 'articlefeedbackv5-help-tooltip-linkurl' ) ) |
| 2115 | + .click( function ( e ) { |
| 2116 | + e.preventDefault(); |
| 2117 | + window.open( $( e.target ).attr( 'href' ) ); |
| 2118 | + } ); |
| 2119 | + $wrapper.find( '.articleFeedbackv5-tooltip-close' ).click( function () { |
| 2120 | + $.articleFeedbackv5.find( '.articleFeedbackv5-tooltip' ).toggle(); |
| 2121 | + } ); |
| 2122 | + $wrapper.find( '.articleFeedbackv5-tooltip' ).hide(); |
| 2123 | + |
2112 | 2124 | // Set the title |
2113 | 2125 | if ( 'getTitle' in bucket ) { |
2114 | 2126 | $wrapper.find( '.articleFeedbackv5-title' ).html( bucket.getTitle() ); |
2115 | 2127 | } |
2116 | 2128 | |
2117 | | - // Set up the tooltip for the panel version |
2118 | | - $wrapper.find( '.articleFeedbackv5-title-wrap' ).append( $.articleFeedbackv5.templates.helpToolTip ); |
2119 | | - $wrapper.find( '.articleFeedbackv5-tooltip-link' ) |
2120 | | - .attr( 'href', mw.msg( 'articlefeedbackv5-help-tooltip-linkurl' ) ); |
2121 | | - $wrapper.find( '.articleFeedbackv5-tooltip' ).hide(); |
| 2129 | + // Set up the tooltip trigger for the panel version |
| 2130 | + $wrapper.find( '.articleFeedbackv5-title-wrap' ).append( $.articleFeedbackv5.templates.helpToolTipTrigger ); |
2122 | 2131 | $wrapper.find( '.articleFeedbackv5-tooltip-trigger' ).click( function () { |
2123 | | - $.articleFeedbackv5.$holder.find( '.articleFeedbackv5-tooltip' ).toggle(); |
| 2132 | + $.articleFeedbackv5.find( '.articleFeedbackv5-tooltip' ).toggle(); |
2124 | 2133 | } ); |
2125 | 2134 | |
2126 | | - $wrapper.find( '.articleFeedbackv5-tooltip-close' ).click( function () { |
2127 | | - $.articleFeedbackv5.$holder.find( '.articleFeedbackv5-tooltip' ).toggle(); |
2128 | | - } ); |
2129 | | - |
2130 | 2135 | // Localize |
2131 | 2136 | $wrapper.localize( { 'prefix': 'articlefeedbackv5-' } ); |
2132 | 2137 | |
— | — | @@ -2144,7 +2149,7 @@ |
2145 | 2150 | height: 300, |
2146 | 2151 | dialogClass: 'articleFeedbackv5-dialog', |
2147 | 2152 | resizable: false, |
2148 | | - draggable: false, |
| 2153 | + draggable: true, |
2149 | 2154 | title: $.articleFeedbackv5.currentBucket().getTitle(), |
2150 | 2155 | modal: true, |
2151 | 2156 | autoOpen: false, |
— | — | @@ -2156,13 +2161,10 @@ |
2157 | 2162 | var $titlebar = $title.parent(); |
2158 | 2163 | $title.addClass( 'articleFeedbackv5-title' ); |
2159 | 2164 | |
2160 | | - // Set up the tooltip for the dialoag |
2161 | | - $titlebar.append( $.articleFeedbackv5.templates.helpToolTip ); |
2162 | | - $titlebar.find( '.articleFeedbackv5-tooltip' ).hide(); |
2163 | | - $titlebar.find( '.articleFeedbackv5-tooltip-link' ) |
2164 | | - .attr( 'href', mw.msg( 'articlefeedbackv5-help-tooltip-linkurl' ) ); |
| 2165 | + // Set up the tooltip trigger for the dialoag |
| 2166 | + $titlebar.append( $.articleFeedbackv5.templates.helpToolTipTrigger ); |
2165 | 2167 | $titlebar.find( '.articleFeedbackv5-tooltip-trigger' ).click( function ( e ) { |
2166 | | - $( e.target ).next( '.articleFeedbackv5-tooltip' ).toggle(); |
| 2168 | + $.articleFeedbackv5.find( '.articleFeedbackv5-tooltip' ).toggle(); |
2167 | 2169 | } ); |
2168 | 2170 | $titlebar.localize( { 'prefix': 'articlefeedbackv5-' } ); |
2169 | 2171 | |
— | — | @@ -2518,6 +2520,7 @@ |
2519 | 2521 | var x = 'center'; |
2520 | 2522 | // var y = o.top - h - 20; |
2521 | 2523 | var y = 'center'; |
| 2524 | + $.articleFeedbackv5.$holder.find( '.articleFeedbackv5-tooltip' ).hide(); |
2522 | 2525 | $inner = $.articleFeedbackv5.$holder.find( '.articleFeedbackv5-ui' ).detach(); |
2523 | 2526 | $.articleFeedbackv5.$dialog.append( $inner ); |
2524 | 2527 | $.articleFeedbackv5.$dialog.dialog( 'option', 'width', w + 25 ); |
— | — | @@ -2542,6 +2545,7 @@ |
2543 | 2546 | $.articleFeedbackv5.closeAsModal = function () { |
2544 | 2547 | if ( $.articleFeedbackv5.inDialog ) { |
2545 | 2548 | $.articleFeedbackv5.setLinkId( '0' ); |
| 2549 | + $.articleFeedbackv5.$dialog.find( '.articleFeedbackv5-tooltip' ).hide(); |
2546 | 2550 | $inner = $.articleFeedbackv5.$dialog.find( '.articleFeedbackv5-ui' ).detach(); |
2547 | 2551 | $.articleFeedbackv5.$holder.find( '.articleFeedbackv5-buffer' ).append( $inner ); |
2548 | 2552 | $.articleFeedbackv5.$holder.show(); |