From ea761673b7a971e10eeaa7658dd7c79f9c68b48b Mon Sep 17 00:00:00 2001 From: Brian Dukes Date: Mon, 21 Jan 2013 09:45:18 -0600 Subject: [PATCH 1/2] Clear inputs after sending email. Addresses #1 (though there's a lot of cleanup that could go on here...) --- JavaScript/taf.bundle.js | 2 +- JavaScript/taf.debug.js | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/JavaScript/taf.bundle.js b/JavaScript/taf.bundle.js index 32196cc..b980067 100644 --- a/JavaScript/taf.bundle.js +++ b/JavaScript/taf.bundle.js @@ -61,4 +61,4 @@ throw new SyntaxError('JSON.parse');};}})(); (function($,window){"use strict";$.fn.engageTellAFriend=function(options){var opts=$.extend({},$.fn.engageTellAFriend.defaults,options),$tafWrap=$(this);function taf_displayMessage($tafFormWrap,successful){$tafFormWrap.find(".taf-progress-icon").hide();if(successful){$tafFormWrap.find(".taf-success").show();$tafFormWrap.find(".taf-error").hide();} else{$tafFormWrap.find(".taf-error").show();$tafFormWrap.find(".taf-success").hide();}} $(function(){$tafWrap.find('.taf-submit a').click(function(event){var $tafFormWrap=$(this).closest('.taf-form-wrap'),validationResult,tafData,$tafForm,page_ClientValidate=window.Page_ClientValidate;event.preventDefault();if($.isFunction(page_ClientValidate)){validationResult=page_ClientValidate(opts.validationGroup);if(validationResult){$tafFormWrap.find(".taf-progress-icon").show();$tafForm=$tafFormWrap.find('.taf-form');tafData={localResourceFile:opts.localResourceFile,siteUrl:opts.siteUrl,portalName:opts.portalName,friendName:$tafForm.find('input:eq(0)').val(),friendsEmail:$tafForm.find('input:eq(1)').val(),senderName:$tafForm.find('input:eq(2)').val(),senderEmail:$tafForm.find('input:eq(3)').val(),message:$tafForm.find('textarea').val()||'',portalEmail:opts.portalEmail,currentCulture:opts.currentCulture,tabId:opts.tabId,moduleId:opts.moduleId};$.ajax({type:"POST",url:opts.webMethodUrl,data:JSON.stringify(tafData),dataType:"text",contentType:"application/json; charset=utf-8",dataFilter:function(data){var msg=JSON.parse(data);if(msg.hasOwnProperty('d')){return msg.d;} -else{return msg;}},success:function(msg){taf_displayMessage($tafFormWrap,msg==='');},error:function(){taf_displayMessage($tafFormWrap,false);}});}}});$tafWrap.find('.taf-anchor a').click(function(event){event.preventDefault();$(this).closest('.taf-wrap').find('.taf-form-wrap').modal({persist:true});});});};$.fn.engageTellAFriend.defaults={siteUrl:location.href,localResourceFile:'/DesktopModules/EngageTellAFriend/App_LocalResources/ViewTellAFriend.ascx.resx',portalId:0,portalName:'',portalEmail:'',webMethodUrl:'/DesktopModules/EngageTellAFriend/WebMethods.asmx/SendEmail',currentCulture:'en-US',validationGroup:'EngageTellAFriend'};}(jQuery,this)); \ No newline at end of file +else{return msg;}},success:function(msg){taf_displayMessage($tafFormWrap,msg==='');$tafForm.find('input:eq(0)').val('');$tafForm.find('input:eq(1)').val('');$tafForm.find('textarea').val('');},error:function(){taf_displayMessage($tafFormWrap,false);}});}}});$tafWrap.find('.taf-anchor a').click(function(event){event.preventDefault();$(this).closest('.taf-wrap').find('.taf-form-wrap').modal({persist:true});});});};$.fn.engageTellAFriend.defaults={siteUrl:location.href,localResourceFile:'/DesktopModules/EngageTellAFriend/App_LocalResources/ViewTellAFriend.ascx.resx',portalId:0,portalName:'',portalEmail:'',webMethodUrl:'/DesktopModules/EngageTellAFriend/WebMethods.asmx/SendEmail',currentCulture:'en-US',validationGroup:'EngageTellAFriend'};}(jQuery,this)); \ No newline at end of file diff --git a/JavaScript/taf.debug.js b/JavaScript/taf.debug.js index 33921c1..ff51ae4 100644 --- a/JavaScript/taf.debug.js +++ b/JavaScript/taf.debug.js @@ -70,6 +70,9 @@ }, success: function (msg) { taf_displayMessage($tafFormWrap, msg === ''); + $tafForm.find('input:eq(0)').val(''); + $tafForm.find('input:eq(1)').val(''); + $tafForm.find('textarea').val(''); }, error: function (/*XMLHttpRequest, textStatus, errorThrown*/) { taf_displayMessage($tafFormWrap, false); From c14aa30bb8826e0d7bdfb655dc962f771db34426 Mon Sep 17 00:00:00 2001 From: Brian Dukes Date: Fri, 5 Apr 2013 16:11:45 -0500 Subject: [PATCH 2/2] Clear fields after sending message. Closes #1 --- ReleaseNotes_1.3.0.htm | 1 + ViewTellAFriend.ascx.cs | 9 +++++++++ 2 files changed, 10 insertions(+) diff --git a/ReleaseNotes_1.3.0.htm b/ReleaseNotes_1.3.0.htm index 4c023e0..6cea57d 100644 --- a/ReleaseNotes_1.3.0.htm +++ b/ReleaseNotes_1.3.0.htm @@ -1,6 +1,7 @@ 

Change Log

Known Issues