1// STC Functions 2function showAccountPassword() {$jq("#accountpassword").val(''); $jq("#accountverifypassword").val(''); if ($jq("#accountPasswordBlock").is(':visible')) {$jq("#accountPasswordBlock").hide();} else {$jq("#accountPasswordBlock").show();}} 3 4function login() { 5 if ($jq("#loginusername").val().length == 0 || $jq("#loginpassword").val().length == 0) { 6 $jq("#loginerrormessage").html('<p>You must enter a username and password.</p>'); 7 $jq("#loginerrormessage").show(); 8 return; 9 } 10 11 $jq("#loginerrormessage").hide(); 12 13 $jq.ajax({ 14 url: "/stc/global-v1/transactions/loginuser.php?template_dir=" + template_dir + "&loginusername=" + $jq("#loginusername").val() + "&loginpassword=" + $jq("#loginpassword").val(), 15 success:function(result) { 16 if (result == "ok") { 17 $jq("#loginform").hide(); 18 $jq("#thankyoumessage").show(); 19 $jq("#okbutton").focus(); 20 21 } else { 22 $jq("#loginerrormessage").html('<p>' + result + '</p>'); 23 $jq("#loginerrormessage").show(); 24 } 25 } 26 }); 27} 28 29function submitAccountInformation() { 30 var violation = ""; 31 32 if ($jq("#accountFirstName").val().length == 0) {violation += "- First Name is a required field.\n";} 33 if ($jq("#accountLastName").val().length == 0) {violation += "- Last Name is a required field.\n";} 34 if ($jq("#accountUsername").val().length < 6) {violation += "- Username must be at least 6 characters.\n";} 35 if ($jq("#accountPasswordBlock").is(':visible') && $jq("#accountPassword").val().length < 6) {violation += "- Password must be at least 6 characters.\n";} 36 if ($jq("#accountPasswordBlock").is(':visible') && $jq("#accountPassword").val() != $jq("#accountVerifyPassword").val()) {violation += "- Password must match Verify Password.\n";} 37 var phone = $jq("#accountPhone1").val() + $jq("#accountPhone2").val() + $jq("#accountPhone3").val(); 38 if (phone.length != 0 && (phone.length != 10 || isNaN(phone))) {violation += "- Phone is an invalid format. [ex. (555) 555-5555]\n";} 39 40 if ($jq("#accountEmail").val().length == 0) {violation += "- Email is a required field.\n";} 41 else if (!echeck($jq("#accountEmail").val())) {violation += "- Email is an invalid format.\n";} 42 43 if (violation != "") { 44 alert("The following errors occurred on the form:\n\n" + violation); 45 return; 46 } 47 48 $jq("#accounterrormessage").hide(); 49 50 var data = "template_dir=" + template_dir + "&firstName=" + cleanURL($jq("#accountFirstName").val()) + "&lastName=" + cleanURL($jq("#accountLastName").val()) + 51 "&username=" + cleanURL($jq("#accountUsername").val()) + "&password=" + cleanURL($jq("#accountPassword").val()) + "&updatePassword=" + $jq("#accountPasswordBlock").is(':visible') + 52 "&phone=" + phone + "&email=" + cleanURL($jq("#accountEmail").val()); 53 54 $jq.ajax({ 55 url: "/stc/global-v1/transactions/account.php", 56 type: "post", 57 data: data, 58 success:function(result) { 59 var code = result.substring(result.indexOf("<code>") + 6, result.indexOf("</code>")) 60 var message = result.substring(result.indexOf("<message>") + 9, result.indexOf("</message>")) 61 62 if (code == "ok") { 63 $jq("#accountform").hide(); 64 $jq("#accountthankyoumessage").html('<p>' + message + '</p>'); 65 $jq("#thankyoumessage").show(); 66 $jq("#okbutton").focus(); 67 68 } else { 69 $jq("#accounterrormessage").html('<p>' + message + '</p>'); 70 $jq("#accounterrormessage").show(); 71 } 72 } 73 }); 74} 75 76function forgotUsername() { 77 if ($jq("#forgotusernameemail").val().length == 0 || !echeck($jq("#forgotusernameemail").val())) { 78 $jq("#forgotusernameerrormessage").html('<p>You must enter a valid email address.</p>'); 79 $jq("#forgotusernameerrormessage").show(); 80 return; 81 } 82 83 $jq("#forgotusernameerrormessage").hide(); 84 85 $jq.ajax({
86 url: "/stc/global-v1/transactions/forgotusername.php?forgotusernameemail=" + $jq("#forgotusernameemail").val(), 87 success:function(result) { 88 if (result == "ok") { 89 $jq("#forgotusernameform").hide(); 90 $jq("#completemessage").show(); 91 $jq("#okbutton").focus(); 92 93 } else { 94 $jq("#forgotusernameerrormessage").html('<p>' + result + '</p>'); 95 $jq("#forgotusernameerrormessage").show(); 96 } 97 } 98 }); 99} 100 101function forgotPassword() { 102 if ($jq("#forgotpasswordusername").val().length == 0 || $jq("#forgotpasswordemail").val().length == 0 || !echeck($jq("#forgotpasswordemail").val())) { 103 $jq("#forgotpassworderrormessage").html('<p>You must enter a valid username and email address.</p>'); 104 $jq("#forgotpassworderrormessage").show(); 105 return; 106 } 107 108 $jq("#forgotpassworderrormessage").hide(); 109 110 $jq.ajax({ 111 url: "/stc/global-v1/transactions/forgotpassword.php?forgotpasswordusername=" + $jq("#forgotpasswordusername").val() + "&forgotpasswordemail=" + $jq("#forgotpasswordemail").val(), 112 success:function(result) { 113 if (result == "ok") { 114 $jq("#forgotpasswordform").hide(); 115 $jq("#completemessage").show(); 116 $jq("#okbutton").focus(); 117 118 } else { 119 $jq("#forgotpassworderrormessage").html('<p>' + result + '</p>'); 120 $jq("#forgotpassworderrormessage").show(); 121 } 122 } 123 }); 124} 125 126function modifyRecipeBox(recipeID, addFlag) { 127 $jq.ajax({ 128 url: "/stc/global-v1/transactions/modifyrecipebox.php?recipeid=" + recipeID + "&addflag=" + addFlag, 129 success:function(result) { 130 history.go(0); 131 } 132 }); 133} 134// End STC Functions
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.