|
18 | 18 | crossorigin="anonymous" |
19 | 19 | ></script> |
20 | 20 | <script src="https://authlib.topcoder-dev.com/country.js"></script> |
21 | | - <script> |
22 | | - var formAction = "https://topcoder-dev.auth0.com/continue"; |
23 | | - var apiServerUrl = "https://api.topcoder-dev.com/v3/users"; |
24 | | - var qs = (function (a) { |
25 | | - if (a == "") return {}; |
26 | | - var b = {}; |
27 | | - for (var i = 0; i < a.length; ++i) { |
28 | | - var p = a[i].split("=", 2); |
29 | | - if (p.length == 1) b[p[0]] = ""; |
30 | | - else b[p[0]] = decodeURIComponent(p[1].replace(/\+/g, " ")); |
31 | | - } |
32 | | - return b; |
33 | | - })(window.location.search.substr(1).split("&")); |
34 | | - </script> |
35 | | - <script> |
36 | | - $(document).ready(function () { |
37 | | - $.each(countryObjs, function () { |
38 | | - $("#country").append( |
39 | | - $("<option></option>").text(this.name).val(JSON.stringify(this)) |
40 | | - ); |
41 | | - }); |
42 | | - $("#continueBtn").click(function () { |
43 | | - var handle = $("#handle").val(); |
44 | | - var country = $("#country").val(); |
45 | | - $.ajax({ |
46 | | - url: apiServerUrl + "/validateHandle?handle=" + handle, |
47 | | - xhrFields: { |
48 | | - withCredentials: true, |
49 | | - }, |
50 | | - success: function (result) { |
51 | | - if ( |
52 | | - result.result.status === 200 && |
53 | | - !result.result.content.valid |
54 | | - ) { |
55 | | - $("#error").html("Error: " + result.result.content.reason); |
56 | | - $("#error").closest(".message").fadeIn(); |
57 | | - } |
58 | | - if (result.result.status === 200 && result.result.content.valid) { |
59 | | - $("#error").closest(".message").fadeOut(); |
60 | | - $("#error").html(""); |
61 | | - document.getElementById("signup").action = formAction; |
62 | | - document.getElementById("state").value = qs["state"]; |
63 | | - document.getElementById("source").value = qs["source"] || null; |
64 | | - document.getElementById("signup").submit(); |
65 | | - } |
66 | | - }, |
67 | | - }); |
68 | | - return false; |
69 | | - }); |
70 | | - |
71 | | - /** |
72 | | - * Script for field placeholder |
73 | | - **/ |
74 | | - $(".messages .close-error").on("click", function () { |
75 | | - $(this).closest(".message").fadeOut(); |
76 | | - }); |
77 | | - var inputObj = $(".input-field .input-text"), |
78 | | - continueBtnDisable = false; |
79 | | - inputObj |
80 | | - .on("focus", function () { |
81 | | - $(this).parent().addClass("active focussed"); |
82 | | - }) |
83 | | - .on("blur", function () { |
84 | | - var parentObj = $(this).parent(); |
85 | | - if ($(this).val() === "") { |
86 | | - parentObj.removeClass("active"); |
87 | | - } |
88 | | - parentObj.removeClass("focussed"); |
89 | | - }) |
90 | | - .on("change", function () { |
91 | | - var disableStatus = false; |
92 | | - inputObj.each(function (index, element) { |
93 | | - if ($(element).val() === "") { |
94 | | - disableStatus = true; |
95 | | - return; |
96 | | - } |
97 | | - }); |
98 | | - setContinueButtonDisabledStatus(disableStatus); |
99 | | - }) |
100 | | - .each(function (index, element) { |
101 | | - var parentObj = $(element).parent(); |
102 | | - if ($(element).val() !== "") { |
103 | | - parentObj.addClass("active"); |
104 | | - } else { |
105 | | - parentObj.removeClass("active"); |
106 | | - } |
107 | | - |
108 | | - if ($(element).val() === "" && continueBtnDisable === false) { |
109 | | - continueBtnDisable = true; |
110 | | - } |
111 | | - |
112 | | - setContinueButtonDisabledStatus(continueBtnDisable); |
113 | | - }); |
114 | | - }); |
115 | | - function setContinueButtonDisabledStatus(status) { |
116 | | - var continueBtnObj = $("#continueBtn"); |
117 | | - if (status) { |
118 | | - continueBtnObj.attr("disabled", true); |
119 | | - } else { |
120 | | - continueBtnObj.removeAttr("disabled"); |
121 | | - } |
122 | | - } |
123 | | - </script> |
| 21 | + <script type="text/javascript" src="signup.js"></script> |
124 | 22 | </head> |
125 | | - |
126 | 23 | <body class="center-align-card"> |
127 | 24 | <!-- Page Wrapper --> |
128 | 25 | <div class="page-wrapper"> |
@@ -166,6 +63,26 @@ <h1 id="page-title-heading" class="page-title-heading clip-me"> |
166 | 63 | autocomplete="off" |
167 | 64 | /> |
168 | 65 | </div> |
| 66 | + <div id="fn" class="input-field active"> |
| 67 | + <label for="firstName">Enter your First Name</label> |
| 68 | + <input |
| 69 | + id="firstName" |
| 70 | + name="firstName" |
| 71 | + size="43" |
| 72 | + class="input-text" |
| 73 | + autocomplete="off" |
| 74 | + /> |
| 75 | + </div> |
| 76 | + <div id="ln" class="input-field active"> |
| 77 | + <label for="lastName">Enter your Last Name</label> |
| 78 | + <input |
| 79 | + id="lastName" |
| 80 | + name="lastName" |
| 81 | + size="43" |
| 82 | + class="input-text" |
| 83 | + autocomplete="off" |
| 84 | + /> |
| 85 | + </div> |
169 | 86 | <div id="cc" class="input-field active custom-dropdowm-arrow"> |
170 | 87 | <label for="country">Select your country </label> |
171 | 88 | <select id="country" name="country" class="input-text"></select> |
@@ -194,5 +111,6 @@ <h1 id="page-title-heading" class="page-title-heading clip-me"> |
194 | 111 | > |
195 | 112 | </footer> |
196 | 113 | </div> |
| 114 | + |
197 | 115 | </body> |
198 | 116 | </html> |
0 commit comments