Index: branches/wmf/1.18wmf1/extensions/ArticleFeedbackv5/modules/jquery.articleFeedbackv5/jquery.articleFeedbackv5.js |
— | — | @@ -2030,7 +2030,7 @@ |
2031 | 2031 | // When the tool is visible, load the form |
2032 | 2032 | $.articleFeedbackv5.$holder.appear( function () { |
2033 | 2033 | if ( !$.articleFeedbackv5.isLoaded ) { |
2034 | | - $.articleFeedbackv5.load(); |
| 2034 | + $.articleFeedbackv5.load( 'auto', 'bottom' ); |
2035 | 2035 | } |
2036 | 2036 | } ); |
2037 | 2037 | // Keep track of links that must be removed after a successful submission |
— | — | @@ -2321,11 +2321,12 @@ |
2322 | 2322 | /** |
2323 | 2323 | * Loads the tool onto the page |
2324 | 2324 | * |
2325 | | - * @param display string "form" or "cta" |
| 2325 | + * @param display string what to load ("form", "cta", or "auto") |
| 2326 | + * @param from string from whence came the request ("bottom" or "overlay") |
2326 | 2327 | */ |
2327 | | - $.articleFeedbackv5.load = function ( display ) { |
| 2328 | + $.articleFeedbackv5.load = function ( display, from ) { |
2328 | 2329 | |
2329 | | - if ( display ) { |
| 2330 | + if ( display && 'auto' != display ) { |
2330 | 2331 | $.articleFeedbackv5.toDisplay = ( display == 'cta' ? 'cta' : 'form' ); |
2331 | 2332 | } |
2332 | 2333 | |
— | — | @@ -2339,7 +2340,7 @@ |
2340 | 2341 | return; |
2341 | 2342 | } |
2342 | 2343 | $.articleFeedbackv5.loadContainers(); |
2343 | | - $.articleFeedbackv5.showForm(); |
| 2344 | + $.articleFeedbackv5.showForm( from ); |
2344 | 2345 | } |
2345 | 2346 | |
2346 | 2347 | else if ( 'cta' == $.articleFeedbackv5.toDisplay ) { |
— | — | @@ -2349,7 +2350,7 @@ |
2350 | 2351 | return; |
2351 | 2352 | } |
2352 | 2353 | $.articleFeedbackv5.loadContainers(); |
2353 | | - $.articleFeedbackv5.showCTA(); |
| 2354 | + $.articleFeedbackv5.showCTA( from ); |
2354 | 2355 | } |
2355 | 2356 | |
2356 | 2357 | $.articleFeedbackv5.isLoaded = true; |
— | — | @@ -2431,8 +2432,10 @@ |
2432 | 2433 | |
2433 | 2434 | /** |
2434 | 2435 | * Builds the form and loads it into the document |
| 2436 | + * |
| 2437 | + * @param from string from whence came the request ("bottom" or "overlay") |
2435 | 2438 | */ |
2436 | | - $.articleFeedbackv5.showForm = function () { |
| 2439 | + $.articleFeedbackv5.showForm = function ( from ) { |
2437 | 2440 | |
2438 | 2441 | // Build the form |
2439 | 2442 | var bucket = $.articleFeedbackv5.currentBucket(); |
— | — | @@ -2467,11 +2470,7 @@ |
2468 | 2471 | } |
2469 | 2472 | |
2470 | 2473 | // Track the event |
2471 | | - if ( $.articleFeedbackv5.inDialog ) { |
2472 | | - $.articleFeedbackv5.trackClick( $.articleFeedbackv5.bucketName() + '-impression-overlay' ); |
2473 | | - } else { |
2474 | | - $.articleFeedbackv5.trackClick( $.articleFeedbackv5.bucketName() + '-impression-bottom' ); |
2475 | | - } |
| 2474 | + $.articleFeedbackv5.trackClick( $.articleFeedbackv5.bucketName() + '-impression-' + from ); |
2476 | 2475 | |
2477 | 2476 | $.articleFeedbackv5.nowShowing = 'form'; |
2478 | 2477 | }; |
— | — | @@ -2537,7 +2536,7 @@ |
2538 | 2537 | $.articleFeedbackv5.feedbackId = data.articlefeedbackv5.feedback_id; |
2539 | 2538 | $.articleFeedbackv5.selectCTA( data.articlefeedbackv5.cta_id ); |
2540 | 2539 | $.articleFeedbackv5.unlockForm(); |
2541 | | - $.articleFeedbackv5.showCTA(); |
| 2540 | + $.articleFeedbackv5.showCTA( $.articleFeedbackv5.inDialog ? 'overlay' : 'bottom' ); |
2542 | 2541 | // Drop a cookie for a successful submit |
2543 | 2542 | $.cookie( $.articleFeedbackv5.prefix( 'submitted' ), 'true', { 'expires': 365, 'path': '/' } ); |
2544 | 2543 | // Clear out anything that needs removing (usually feedback links) |
— | — | @@ -2603,8 +2602,10 @@ |
2604 | 2603 | |
2605 | 2604 | /** |
2606 | 2605 | * Shows a CTA |
| 2606 | + * |
| 2607 | + * @param from string from whence came the request ("bottom" or "overlay") |
2607 | 2608 | */ |
2608 | | - $.articleFeedbackv5.showCTA = function () { |
| 2609 | + $.articleFeedbackv5.showCTA = function ( from ) { |
2609 | 2610 | |
2610 | 2611 | // Build the cta |
2611 | 2612 | var cta = $.articleFeedbackv5.currentCTA(); |
— | — | @@ -2668,8 +2669,7 @@ |
2669 | 2670 | |
2670 | 2671 | // Track the event |
2671 | 2672 | $.articleFeedbackv5.trackClick( $.articleFeedbackv5.bucketName() + '-' + |
2672 | | - $.articleFeedbackv5.ctaName() + '-impression-' + |
2673 | | - ( $.articleFeedbackv5.inDialog ? 'overlay' : 'bottom' ) ); |
| 2673 | + $.articleFeedbackv5.ctaName() + '-impression-' + from ); |
2674 | 2674 | |
2675 | 2675 | $.articleFeedbackv5.nowShowing = 'cta'; |
2676 | 2676 | }; |
— | — | @@ -2896,7 +2896,7 @@ |
2897 | 2897 | // $.articleFeedbackv5.clear(); |
2898 | 2898 | } |
2899 | 2899 | if ( !$.articleFeedbackv5.isLoaded ) { |
2900 | | - $.articleFeedbackv5.load(); |
| 2900 | + $.articleFeedbackv5.load( 'auto', 'overlay' ); |
2901 | 2901 | } |
2902 | 2902 | if ( !$.articleFeedbackv5.inDialog ) { |
2903 | 2903 | $.articleFeedbackv5.setDialogDimensions(); |
Property changes on: branches/wmf/1.18wmf1/extensions/ArticleFeedbackv5 |
___________________________________________________________________ |
Modified: svn:mergeinfo |
2904 | 2904 | Merged /trunk/extensions/ArticleFeedbackv5:r108701 |
Property changes on: branches/wmf/1.18wmf1/extensions |
___________________________________________________________________ |
Modified: svn:mergeinfo |
2905 | 2905 | Merged /trunk/extensions:r108701 |