Index: trunk/extensions/ArticleFeedbackv5/modules/jquery.articleFeedbackv5/jquery.articleFeedbackv5.js |
— | — | @@ -267,9 +267,6 @@ |
268 | 268 | // Start up the block to return |
269 | 269 | var $block = $( $.articleFeedbackv5.currentBucket().templates.block ); |
270 | 270 | |
271 | | - // Add the help button |
272 | | - $.articleFeedbackv5.addHelpButton( $block ); |
273 | | - |
274 | 271 | // Fill in the disclosure text |
275 | 272 | $block.find( '.articlefeedbackv5-shared-on-feedback' ) |
276 | 273 | .html( $.articleFeedbackv5.buildLink( |
— | — | @@ -534,9 +531,6 @@ |
535 | 532 | $( $.articleFeedbackv5.templates.clear ).appendTo( $( this ) ); |
536 | 533 | } ); |
537 | 534 | |
538 | | - // Add the help button |
539 | | - $.articleFeedbackv5.addHelpButton( $block ); |
540 | | - |
541 | 535 | // Fill in the disclosure text |
542 | 536 | $block.find( '.articlefeedbackv5-shared-on-feedback' ) |
543 | 537 | .html( $.articleFeedbackv5.buildLink( |
— | — | @@ -788,9 +782,6 @@ |
789 | 783 | // Start up the block to return |
790 | 784 | var $block = $( $.articleFeedbackv5.currentBucket().templates.block ); |
791 | 785 | |
792 | | - // Add the help button |
793 | | - $.articleFeedbackv5.addHelpButton( $block ); |
794 | | - |
795 | 786 | // Fill in the rating clear title |
796 | 787 | var clear_msg = mw.msg( 'articlefeedbackv5-bucket3-clear-rating' ); |
797 | 788 | $block.find( '.articleFeedback-rating-clear' ) |
— | — | @@ -1008,16 +999,18 @@ |
1009 | 1000 | * The template for the whole block |
1010 | 1001 | */ |
1011 | 1002 | block: '\ |
1012 | | - <div class="form-row articleFeedbackv5-bucket4-toggle">\ |
1013 | | - <h3><html:msg key="bucket4-subhead"></h3>\ |
1014 | | - <p class="instructions-left"><html:msg key="bucket4-teaser-line1" /><br />\ |
1015 | | - <html:msg key="bucket4-teaser-line2" /></p>\ |
| 1003 | + <div>\ |
| 1004 | + <div class="form-row articleFeedbackv5-bucket4-toggle">\ |
| 1005 | + <h3><html:msg key="bucket4-subhead"></h3>\ |
| 1006 | + <p class="instructions-left"><html:msg key="bucket4-teaser-line1" /><br />\ |
| 1007 | + <html:msg key="bucket4-teaser-line2" /></p>\ |
| 1008 | + </div>\ |
| 1009 | + <div class="articleFeedbackv5-disclosure">\ |
| 1010 | + <p><a class="articleFeedbackv5-learn-to-edit" target="_blank"><html:msg key="bucket4-learn-to-edit"> >></a></p>\ |
| 1011 | + </div>\ |
| 1012 | + <a class="articleFeedbackv5-submit"><html:msg key="bucket4-form-submit" /></a>\ |
| 1013 | + <div class="clear"></div>\ |
1016 | 1014 | </div>\ |
1017 | | - <div class="articleFeedbackv5-disclosure">\ |
1018 | | - <p><a class="articleFeedbackv5-learn-to-edit" target="_blank"><html:msg key="bucket4-learn-to-edit"> >></a></p>\ |
1019 | | - </div>\ |
1020 | | - <a class="articleFeedbackv5-submit"><html:msg key="bucket4-form-submit" /></a>\ |
1021 | | - <div class="clear"></div>\ |
1022 | 1015 | ' |
1023 | 1016 | |
1024 | 1017 | }, |
— | — | @@ -1047,9 +1040,6 @@ |
1048 | 1041 | // Start up the block to return |
1049 | 1042 | var $block = $( $.articleFeedbackv5.currentBucket().templates.block ); |
1050 | 1043 | |
1051 | | - // Add the help button |
1052 | | - $.articleFeedbackv5.addHelpButton( $block ); |
1053 | | - |
1054 | 1044 | // Fill in the learn to edit link |
1055 | 1045 | $block.find( '.articleFeedbackv5-learn-to-edit' ) |
1056 | 1046 | .attr( 'href', mw.config.get( 'wgArticleFeedbackv5LearnToEdit' ) ); |
— | — | @@ -1789,8 +1779,10 @@ |
1790 | 1780 | * The template for the whole block |
1791 | 1781 | */ |
1792 | 1782 | block: '\ |
1793 | | - <p>Eventually this will have a pretty button and some nice messages. For now, though...</p>\ |
1794 | | - <p><a href="" class="articleFeedbackv5-edit-cta-link">EDIT THIS PAGE</a></p>\ |
| 1783 | + <div>\ |
| 1784 | + <p>Eventually this will have a pretty button and some nice messages. For now, though...</p>\ |
| 1785 | + <p><a href="" class="articleFeedbackv5-edit-cta-link">EDIT THIS PAGE</a></p>\ |
| 1786 | + </div>\ |
1795 | 1787 | ' |
1796 | 1788 | |
1797 | 1789 | }, |
— | — | @@ -1962,17 +1954,6 @@ |
1963 | 1955 | }; |
1964 | 1956 | |
1965 | 1957 | // }}} |
1966 | | - // {{{ addHelpButton |
1967 | | - |
1968 | | - /** |
1969 | | - * Utility method: add a help button to the titlebar (with bound event) |
1970 | | - * |
1971 | | - * @param Element $block the form block |
1972 | | - */ |
1973 | | - $.articleFeedbackv5.addHelpButton = function ( $block ) { |
1974 | | - }; |
1975 | | - |
1976 | | - // }}} |
1977 | 1958 | // {{{ buildLink |
1978 | 1959 | |
1979 | 1960 | /** |
— | — | @@ -2097,6 +2078,32 @@ |
2098 | 2079 | $.articleFeedbackv5.$dialog = $( '<div id="articleFeedbackv5-dialog-wrap"></div>' ); |
2099 | 2080 | $.articleFeedbackv5.$holder.after( $.articleFeedbackv5.$dialog ); |
2100 | 2081 | |
| 2082 | + // Set up the dialog |
| 2083 | + $.articleFeedbackv5.$dialog.dialog( { |
| 2084 | + width: 500, |
| 2085 | + height: 300, |
| 2086 | + dialogClass: 'articleFeedbackv5-dialog', |
| 2087 | + resizable: false, |
| 2088 | + draggable: true, |
| 2089 | + title: $.articleFeedbackv5.currentBucket().getTitle(), |
| 2090 | + modal: true, |
| 2091 | + autoOpen: false, |
| 2092 | + close: function ( event, ui ) { |
| 2093 | + $.articleFeedbackv5.closeAsModal(); |
| 2094 | + } |
| 2095 | + } ); |
| 2096 | + var $title = $( '#ui-dialog-title-articleFeedbackv5-dialog-wrap' ); |
| 2097 | + var $titlebar = $title.parent(); |
| 2098 | + $title.addClass( 'articleFeedbackv5-title' ); |
| 2099 | + |
| 2100 | + // Set up the tooltip for the dialoag |
| 2101 | + $titlebar.append( $.articleFeedbackv5.templates.helpToolTip ); |
| 2102 | + $titlebar.find( '.articleFeedbackv5-tooltip' ).hide(); |
| 2103 | + $titlebar.find( '.articleFeedbackv5-tooltip-trigger' ).click( function ( e ) { |
| 2104 | + $( e.target ).next( '.articleFeedbackv5-tooltip' ).toggle(); |
| 2105 | + } ); |
| 2106 | + $titlebar.localize( { 'prefix': 'articlefeedbackv5-' } ); |
| 2107 | + |
2101 | 2108 | // Set loaded |
2102 | 2109 | $.articleFeedbackv5.isLoaded = true; |
2103 | 2110 | |
— | — | @@ -2325,32 +2332,12 @@ |
2326 | 2333 | var y = 'center'; |
2327 | 2334 | $inner = $.articleFeedbackv5.$holder.find( '.articleFeedbackv5-ui' ).detach(); |
2328 | 2335 | $.articleFeedbackv5.$dialog.append( $inner ); |
| 2336 | + $.articleFeedbackv5.$dialog.dialog( 'option', 'width', w + 20 ); |
| 2337 | + $.articleFeedbackv5.$dialog.dialog( 'option', 'height', h + 70 ); |
| 2338 | + $.articleFeedbackv5.$dialog.dialog( 'option', 'position', [ x, y ] ); |
| 2339 | + $.articleFeedbackv5.$dialog.dialog( 'open' ); |
2329 | 2340 | $.articleFeedbackv5.setLinkId( $link.data( 'linkId' ) ); |
2330 | | - $.articleFeedbackv5.$dialog.dialog( { |
2331 | | - width: w + 20, |
2332 | | - height: h + 50, |
2333 | | - position: [ x, y ], |
2334 | | - dialogClass: 'articleFeedbackv5-dialog', |
2335 | | - resizable: false, |
2336 | | - draggable: true, |
2337 | | - title: $.articleFeedbackv5.currentBucket().getTitle(), |
2338 | | - modal: true, |
2339 | | - close: function ( event, ui ) { |
2340 | | - $.articleFeedbackv5.closeAsModal(); |
2341 | | - } |
2342 | | - } ); |
2343 | | - var $title = $( '#ui-dialog-title-articleFeedbackv5-dialog-wrap' ); |
2344 | | - var $titlebar = $title.parent(); |
2345 | | - $title.addClass( 'articleFeedbackv5-title' ); |
2346 | 2341 | |
2347 | | - // Set up the tooltip |
2348 | | - $titlebar.append( $.articleFeedbackv5.templates.helpToolTip ); |
2349 | | - $titlebar.find( '.articleFeedbackv5-tooltip' ).hide(); |
2350 | | - $titlebar.find( '.articleFeedbackv5-tooltip-trigger' ).click( function ( e ) { |
2351 | | - $( e.target ).next( '.articleFeedbackv5-tooltip' ).toggle(); |
2352 | | - } ); |
2353 | | - $titlebar.localize( { 'prefix': 'articlefeedbackv5-' } ); |
2354 | | - |
2355 | 2342 | // Hide the panel |
2356 | 2343 | $.articleFeedbackv5.$holder.hide(); |
2357 | 2344 | |
— | — | @@ -2369,7 +2356,6 @@ |
2370 | 2357 | $.articleFeedbackv5.setLinkId( '0' ); |
2371 | 2358 | $inner = $.articleFeedbackv5.$dialog.find( '.articleFeedbackv5-ui' ).detach(); |
2372 | 2359 | $.articleFeedbackv5.$holder.find( '.articleFeedbackv5-buffer' ).append( $inner ); |
2373 | | - $.articleFeedbackv5.$dialog.dialog( 'destroy' ); |
2374 | 2360 | $.articleFeedbackv5.$holder.show(); |
2375 | 2361 | $.articleFeedbackv5.inDialog = false; |
2376 | 2362 | } |