Browse Source

Fix IPN having the wrong username

Morgan Bazalgette 6 months ago
parent
commit
db120cdbff
Signed by: Morgan Bazalgette <the@howl.moe> GPG Key ID: 40D328300D245DA5
3 changed files with 9 additions and 7 deletions
  1. 1
    1
      static/dist.min.js
  2. 5
    3
      static/ripple.js
  3. 3
    3
      templates/support.html

+ 1
- 1
static/dist.min.js
File diff suppressed because it is too large
View File


+ 5
- 3
static/ripple.js View File

@@ -187,7 +187,7 @@ var singlePageSnippets = {
187 187
           cflags = darkSetting ? +cflags | 1 : +cflags & ~1;
188 188
           document.cookie = "cflags=" + cflags + ";path=/;max-age=31536000";
189 189
         }
190
-      
190
+
191 191
         var obj = formToObject($(this));
192 192
         var ps = 0;
193 193
         $(this)
@@ -202,7 +202,7 @@ var singlePageSnippets = {
202 202
         var f = $(this);
203 203
         api("users/self/settings", obj, function(data) {
204 204
           if (darkSetting != isDark) {
205
-            window.location.reload();            
205
+            window.location.reload();
206 206
             return;
207 207
           }
208 208
           showMessage("success", "Your new settings have been saved.");
@@ -259,7 +259,6 @@ var singlePageSnippets = {
259 259
     });
260 260
     var rates = {};
261 261
     var us = sl.noUiSlider;
262
-    var doneOne = false;
263 262
     $.getJSON("/donate/rates", function(data) {
264 263
       rates = data;
265 264
       us.on('update', function() {
@@ -284,6 +283,9 @@ var singlePageSnippets = {
284 283
         $("#paypal-amt").val(priceEUR.toFixed(2));
285 284
       });
286 285
     });
286
+    $("#username-input").on("input", function() {
287
+      $("#ipn-username").attr("value", "username=" + $(this).val());
288
+    });
287 289
   },
288 290
 
289 291
   "/settings/avatar" : function() {

+ 3
- 3
templates/support.html View File

@@ -58,7 +58,7 @@ AdditionalJS=https://cdnjs.cloudflare.com/ajax/libs/noUiSlider/9.0.0/nouislider.
58 58
 			<h1 class="ui center aligned header">
59 59
 				{{ $.T "So what can you do?" }}
60 60
 				<div class="sub header">
61
-					{{ if .has_donor }}{{ $.T "Well, you can give us even more money." }}{{ else }}{{ $.T "Well, you can give us even more money." }}{{ end }}
61
+					{{ if .has_donor }}{{ $.T "Well, you can give us even more money." }}{{ else }}{{ $.T "Well, you can give us money." }}{{ end }}
62 62
 				</div>
63 63
 			</h1>
64 64
 			<h4 class="ui horizontal divider header">
@@ -128,13 +128,13 @@ AdditionalJS=https://cdnjs.cloudflare.com/ajax/libs/noUiSlider/9.0.0/nouislider.
128 128
 								<input type="hidden" name="option_amount{{ . }}" value="{{ calculateDonorPrice $months }}">
129 129
 							{{ end }}
130 130
 							<input type="hidden" name="on1" value="Ripple user to give donor">
131
-							<input type="hidden" name="custom" value="username={{ $global.User.Username }}">
131
+							<input type="hidden" name="custom" value="username={{ $global.User.Username }}" id="ipn-username">
132 132
 							<input type="hidden" name="amount" value="{{ calculateDonorPrice 1 }}" id="paypal-amt">
133 133
 							<div class="ui fluid labeled action input">
134 134
 								<div class="ui label">
135 135
 									{{ $.T "User:" }}
136 136
 								</div>
137
-								<input name="os1" type="text" placeholder="{{ $.T "User" }}" value="{{ $global.User.Username }}">
137
+								<input name="os1" type="text" placeholder="{{ $.T "User" }}" value="{{ $global.User.Username }}" id="username-input">
138 138
 								<button type="submit" class="ui blue button">{{ $.T "Submit" }}</button>
139 139
 							</div>
140 140
 							{{ $ief }}

Loading…
Cancel
Save