https://www.mediawiki.org/wiki/Special:Code/MediaWiki/109186

Revision: 109186
Author:   reedy
Date:     2012-01-17 19:20:03 +0000 (Tue, 17 Jan 2012)
Log Message:
-----------
MFT r108701

Modified Paths:
--------------
    
branches/wmf/1.18wmf1/extensions/ArticleFeedbackv5/modules/jquery.articleFeedbackv5/jquery.articleFeedbackv5.js

Property Changed:
----------------
    branches/wmf/1.18wmf1/extensions/
    branches/wmf/1.18wmf1/extensions/ArticleFeedbackv5/


Property changes on: branches/wmf/1.18wmf1/extensions
___________________________________________________________________
Modified: svn:mergeinfo
   - /branches/REL1_15/phase3/extensions:51646
/branches/REL1_17/phase3/extensions:81445,81448
/branches/REL1_18/extensions:101758,103190
/branches/new-installer/phase3/extensions:43664-66004
/branches/sqlite/extensions:58211-58321
/trunk/extensions:95614,99592,99653,100092,100419,100516,100686,100692,100699,103260,103315,103378,103382,103669,104337,104736,104862-104863,104865,104971,105275,105902,105908,107043,107050,107337,107783,107816,107818,108789
/trunk/phase3/extensions:92580,92634,92713,92762,92765,92791,92854,92884,92886-92887,92894,92898,92907,92932,92958,93141,93149,93151,93233-93234,93258,93266,93303,93516-93518,93520,93818-93822,93847,93858,93891,93935-93936,94058,94062,94068,94107,94155,94235,94277,94346,94372,94422,94425,94444,94448,94456,94498,94517,94601,94630,94728,94738,94825,94862,94995-94997,95023,95042,95072-95073,95155,95327,95332,95410,95422,95426,95442,95468,95601,95812,98578,98598,98656
   + /branches/REL1_15/phase3/extensions:51646
/branches/REL1_17/phase3/extensions:81445,81448
/branches/REL1_18/extensions:101758,103190
/branches/new-installer/phase3/extensions:43664-66004
/branches/sqlite/extensions:58211-58321
/trunk/extensions:95614,99592,99653,100092,100419,100516,100686,100692,100699,103260,103315,103378,103382,103669,104337,104736,104862-104863,104865,104971,105275,105902,105908,107043,107050,107337,107783,107816,107818,108701,108789
/trunk/phase3/extensions:92580,92634,92713,92762,92765,92791,92854,92884,92886-92887,92894,92898,92907,92932,92958,93141,93149,93151,93233-93234,93258,93266,93303,93516-93518,93520,93818-93822,93847,93858,93891,93935-93936,94058,94062,94068,94107,94155,94235,94277,94346,94372,94422,94425,94444,94448,94456,94498,94517,94601,94630,94728,94738,94825,94862,94995-94997,95023,95042,95072-95073,95155,95327,95332,95410,95422,95426,95442,95468,95601,95812,98578,98598,98656


Property changes on: branches/wmf/1.18wmf1/extensions/ArticleFeedbackv5
___________________________________________________________________
Modified: svn:mergeinfo
   - /branches/REL1_18/extensions/ArticleFeedback:97350
/trunk/extensions/ArticleFeedbackv5:106201-106322,106324-106426,106428-106682,106685-106686,106688-106693,106695-106698,106700-106793,106795-108652,108658-108665
   + /branches/REL1_18/extensions/ArticleFeedback:97350
/trunk/extensions/ArticleFeedbackv5:106201-106322,106324-106426,106428-106682,106685-106686,106688-106693,106695-106698,106700-106793,106795-108652,108658-108665,108701

Modified: 
branches/wmf/1.18wmf1/extensions/ArticleFeedbackv5/modules/jquery.articleFeedbackv5/jquery.articleFeedbackv5.js
===================================================================
--- 
branches/wmf/1.18wmf1/extensions/ArticleFeedbackv5/modules/jquery.articleFeedbackv5/jquery.articleFeedbackv5.js
     2012-01-17 19:00:17 UTC (rev 109185)
+++ 
branches/wmf/1.18wmf1/extensions/ArticleFeedbackv5/modules/jquery.articleFeedbackv5/jquery.articleFeedbackv5.js
     2012-01-17 19:20:03 UTC (rev 109186)
@@ -2030,7 +2030,7 @@
                // When the tool is visible, load the form
                $.articleFeedbackv5.$holder.appear( function () {
                        if ( !$.articleFeedbackv5.isLoaded ) {
-                               $.articleFeedbackv5.load();
+                               $.articleFeedbackv5.load( 'auto', 'bottom' );
                        }
                } );
                // Keep track of links that must be removed after a successful 
submission
@@ -2321,11 +2321,12 @@
        /**
         * Loads the tool onto the page
         *
-        * @param display string "form" or "cta"
+        * @param display string what to load ("form", "cta", or "auto")
+        * @param from    string from whence came the request ("bottom" or 
"overlay")
         */
-       $.articleFeedbackv5.load = function ( display ) {
+       $.articleFeedbackv5.load = function ( display, from ) {
 
-               if ( display ) {
+               if ( display && 'auto' != display ) {
                        $.articleFeedbackv5.toDisplay = ( display == 'cta' ? 
'cta' : 'form' );
                }
 
@@ -2339,7 +2340,7 @@
                                return;
                        }
                        $.articleFeedbackv5.loadContainers();
-                       $.articleFeedbackv5.showForm();
+                       $.articleFeedbackv5.showForm( from );
                }
 
                else if ( 'cta' == $.articleFeedbackv5.toDisplay ) {
@@ -2349,7 +2350,7 @@
                                return;
                        }
                        $.articleFeedbackv5.loadContainers();
-                       $.articleFeedbackv5.showCTA();
+                       $.articleFeedbackv5.showCTA( from );
                }
 
                $.articleFeedbackv5.isLoaded = true;
@@ -2431,8 +2432,10 @@
 
        /**
         * Builds the form and loads it into the document
+        *
+        * @param from string from whence came the request ("bottom" or 
"overlay")
         */
-       $.articleFeedbackv5.showForm = function () {
+       $.articleFeedbackv5.showForm = function ( from ) {
 
                // Build the form
                var bucket = $.articleFeedbackv5.currentBucket();
@@ -2467,11 +2470,7 @@
                }
 
                // Track the event
-               if ( $.articleFeedbackv5.inDialog ) {
-                       $.articleFeedbackv5.trackClick( 
$.articleFeedbackv5.bucketName() + '-impression-overlay' );
-               } else {
-                       $.articleFeedbackv5.trackClick( 
$.articleFeedbackv5.bucketName() + '-impression-bottom' );
-               }
+               $.articleFeedbackv5.trackClick( 
$.articleFeedbackv5.bucketName() + '-impression-' + from );
 
                $.articleFeedbackv5.nowShowing = 'form';
        };
@@ -2537,7 +2536,7 @@
                                        $.articleFeedbackv5.feedbackId = 
data.articlefeedbackv5.feedback_id;
                                        $.articleFeedbackv5.selectCTA( 
data.articlefeedbackv5.cta_id );
                                        $.articleFeedbackv5.unlockForm();
-                                       $.articleFeedbackv5.showCTA();
+                                       $.articleFeedbackv5.showCTA( 
$.articleFeedbackv5.inDialog ? 'overlay' : 'bottom' );
                                        // Drop a cookie for a successful submit
                                        $.cookie( $.articleFeedbackv5.prefix( 
'submitted' ), 'true', { 'expires': 365, 'path': '/' } );
                                        // Clear out anything that needs 
removing (usually feedback links)
@@ -2603,8 +2602,10 @@
 
        /**
         * Shows a CTA
+        *
+        * @param from string from whence came the request ("bottom" or 
"overlay")
         */
-       $.articleFeedbackv5.showCTA = function () {
+       $.articleFeedbackv5.showCTA = function ( from ) {
 
                // Build the cta
                var cta = $.articleFeedbackv5.currentCTA();
@@ -2668,8 +2669,7 @@
 
                // Track the event
                $.articleFeedbackv5.trackClick( 
$.articleFeedbackv5.bucketName() + '-' +
-                       $.articleFeedbackv5.ctaName() + '-impression-' +
-                       ( $.articleFeedbackv5.inDialog ? 'overlay' : 'bottom' ) 
);
+                       $.articleFeedbackv5.ctaName() + '-impression-' + from );
 
                $.articleFeedbackv5.nowShowing = 'cta';
        };
@@ -2896,7 +2896,7 @@
                        // $.articleFeedbackv5.clear();
                }
                if ( !$.articleFeedbackv5.isLoaded ) {
-                       $.articleFeedbackv5.load();
+                       $.articleFeedbackv5.load( 'auto', 'overlay' );
                }
                if ( !$.articleFeedbackv5.inDialog ) {
                        $.articleFeedbackv5.setDialogDimensions();


_______________________________________________
MediaWiki-CVS mailing list
MediaWiki-CVS@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs

Reply via email to