r104929 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r104928‎ | r104929 | r104930 >
Date:00:35, 2 December 2011
Author:rsterbin
Status:deferred
Tags:
Comment:
Bug fixes in jquery plugin:
- Removed addHelpButton() and all calls to it
- Option 4 was broken because the block template needs to be a single
element with everything inside it in order for it to find the big edit
button
- Ditto for the edit CTA
- Made the dialog open/close instead of create/destroy; I was wrong about
position not being editable in my message with r104913
Modified paths:
  • /trunk/extensions/ArticleFeedbackv5/modules/jquery.articleFeedbackv5/jquery.articleFeedbackv5.js (modified) (history)

Diff [purge]

Index: trunk/extensions/ArticleFeedbackv5/modules/jquery.articleFeedbackv5/jquery.articleFeedbackv5.js
@@ -267,9 +267,6 @@
268268 // Start up the block to return
269269 var $block = $( $.articleFeedbackv5.currentBucket().templates.block );
270270
271 - // Add the help button
272 - $.articleFeedbackv5.addHelpButton( $block );
273 -
274271 // Fill in the disclosure text
275272 $block.find( '.articlefeedbackv5-shared-on-feedback' )
276273 .html( $.articleFeedbackv5.buildLink(
@@ -534,9 +531,6 @@
535532 $( $.articleFeedbackv5.templates.clear ).appendTo( $( this ) );
536533 } );
537534
538 - // Add the help button
539 - $.articleFeedbackv5.addHelpButton( $block );
540 -
541535 // Fill in the disclosure text
542536 $block.find( '.articlefeedbackv5-shared-on-feedback' )
543537 .html( $.articleFeedbackv5.buildLink(
@@ -788,9 +782,6 @@
789783 // Start up the block to return
790784 var $block = $( $.articleFeedbackv5.currentBucket().templates.block );
791785
792 - // Add the help button
793 - $.articleFeedbackv5.addHelpButton( $block );
794 -
795786 // Fill in the rating clear title
796787 var clear_msg = mw.msg( 'articlefeedbackv5-bucket3-clear-rating' );
797788 $block.find( '.articleFeedback-rating-clear' )
@@ -1008,16 +999,18 @@
10091000 * The template for the whole block
10101001 */
10111002 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"> &gt;&gt;</a></p>\
 1011+ </div>\
 1012+ <a class="articleFeedbackv5-submit"><html:msg key="bucket4-form-submit" /></a>\
 1013+ <div class="clear"></div>\
10161014 </div>\
1017 - <div class="articleFeedbackv5-disclosure">\
1018 - <p><a class="articleFeedbackv5-learn-to-edit" target="_blank"><html:msg key="bucket4-learn-to-edit"> &gt;&gt;</a></p>\
1019 - </div>\
1020 - <a class="articleFeedbackv5-submit"><html:msg key="bucket4-form-submit" /></a>\
1021 - <div class="clear"></div>\
10221015 '
10231016
10241017 },
@@ -1047,9 +1040,6 @@
10481041 // Start up the block to return
10491042 var $block = $( $.articleFeedbackv5.currentBucket().templates.block );
10501043
1051 - // Add the help button
1052 - $.articleFeedbackv5.addHelpButton( $block );
1053 -
10541044 // Fill in the learn to edit link
10551045 $block.find( '.articleFeedbackv5-learn-to-edit' )
10561046 .attr( 'href', mw.config.get( 'wgArticleFeedbackv5LearnToEdit' ) );
@@ -1789,8 +1779,10 @@
17901780 * The template for the whole block
17911781 */
17921782 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>\
17951787 '
17961788
17971789 },
@@ -1962,17 +1954,6 @@
19631955 };
19641956
19651957 // }}}
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 - // }}}
19771958 // {{{ buildLink
19781959
19791960 /**
@@ -2097,6 +2078,32 @@
20982079 $.articleFeedbackv5.$dialog = $( '<div id="articleFeedbackv5-dialog-wrap"></div>' );
20992080 $.articleFeedbackv5.$holder.after( $.articleFeedbackv5.$dialog );
21002081
 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+
21012108 // Set loaded
21022109 $.articleFeedbackv5.isLoaded = true;
21032110
@@ -2325,32 +2332,12 @@
23262333 var y = 'center';
23272334 $inner = $.articleFeedbackv5.$holder.find( '.articleFeedbackv5-ui' ).detach();
23282335 $.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' );
23292340 $.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' );
23462341
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 -
23552342 // Hide the panel
23562343 $.articleFeedbackv5.$holder.hide();
23572344
@@ -2369,7 +2356,6 @@
23702357 $.articleFeedbackv5.setLinkId( '0' );
23712358 $inner = $.articleFeedbackv5.$dialog.find( '.articleFeedbackv5-ui' ).detach();
23722359 $.articleFeedbackv5.$holder.find( '.articleFeedbackv5-buffer' ).append( $inner );
2373 - $.articleFeedbackv5.$dialog.dialog( 'destroy' );
23742360 $.articleFeedbackv5.$holder.show();
23752361 $.articleFeedbackv5.inDialog = false;
23762362 }

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r104913Overlay no longer grabs the whole panel; instead, each form option has a title...rsterbin23:04, 1 December 2011

Status & tagging log