Difference between revisions of "NationStates:Login"

From NSWiki
Jump to: navigation, search
m (add login note)
(Edit button styles and error message)
Line 1: Line 1:
<shtml version="2" keyname="afforess" hash="c243c2a34c333ca80ea938949242cb399d8eac3a266645c41c4edd4d9ca380aa"><input id='nation_name' placeholder='Nation Name' type='text' style='width:350px;height:24px;'></input><button class='btn' style='margin-left:5px;margin-top: -3px;' id='nation_enter'>Locate Nation</button>
+
<shtml version="2" keyname="afforess" hash="85ba72b8c3f25d92bf74146c0d3d2ce063e55918f79e473c20192bd85eb90d2c"><input id='nation_name' placeholder='Nation Name' type='text' style='width:350px;height:24px;'></input><button class='btn btn-primary' style='margin-left:5px;margin-top: -3px;' id='nation_enter'>Locate Nation</button>
 
<p><i>(Ensure you are logged into the same NationStates nation you wish to login with to NSWiki! If not, go to NationStates.net and switch your nation.</i></p>
 
<p><i>(Ensure you are logged into the same NationStates nation you wish to login with to NSWiki! If not, go to NationStates.net and switch your nation.</i></p>
 
<p id='login_error' style='color:red; font-weight:bold; display:none;'>An Error Occured</p>
 
<p id='login_error' style='color:red; font-weight:bold; display:none;'>An Error Occured</p>
Line 6: Line 6:
 
<div id='advanced' style='display:none; float:left;'>
 
<div id='advanced' style='display:none; float:left;'>
 
<input id='nation_verify_login' placeholder='Your Login Verification Code' type='text' style='width:450px;height:24px;'></input>
 
<input id='nation_verify_login' placeholder='Your Login Verification Code' type='text' style='width:450px;height:24px;'></input>
<button class='btn' style='margin-left:5px;margin-top: -3px;' id='nation_verify'>Verify Nation</button>
+
<button class='btn btn-primary' style='margin-left:5px;margin-top: -3px;' id='nation_verify'>Verify Nation</button>
 
<iframe frameborder="0" style='float: left; height:450px; width:750px;' data-src='http://embed.nationstates.net/page=verify_login'></iframe>
 
<iframe frameborder="0" style='float: left; height:450px; width:750px;' data-src='http://embed.nationstates.net/page=verify_login'></iframe>
 
</div>
 
</div>
Line 23: Line 23:
 
$("#nation_verify").click();
 
$("#nation_verify").click();
 
});
 
});
    var ampersand = "&"[0];
+
var ampersand = "&"[0];
console.log(ampersand);
+
 
$("#nation_enter").on("click", function(event) {
 
$("#nation_enter").on("click", function(event) {
 
event.preventDefault();
 
event.preventDefault();
Line 36: Line 35:
 
$("#advanced").show();
 
$("#advanced").show();
 
}).fail(function() {
 
}).fail(function() {
$("#login_error").html("No Nationstates Nation named " + + $("#nation_name").val() + ".").show();
+
$("#login_error").html("No Nationstates Nation named " + $("#nation_name").val() + ".").show();
 
$("#nation_enter").removeAttr("disabled");
 
$("#nation_enter").removeAttr("disabled");
 
});
 
});
Line 59: Line 58:
 
window.location.href = "http://nswiki.org";
 
window.location.href = "http://nswiki.org";
 
}).fail(function(jqXHR, textStatus, errorThrown) {
 
}).fail(function(jqXHR, textStatus, errorThrown) {
$("#login_error").html(jqXHR.responseText).show();
+
console.log(jqXHR.responseText);
 +
$("#login_error").html("Login Failed. Try again or report the error to an administrator.").show();
 
$("#nation_verify").removeAttr("disabled");
 
$("#nation_verify").removeAttr("disabled");
 
$("#login_status").hide();
 
$("#login_status").hide();

Revision as of 20:54, 16 February 2014

(Ensure you are logged into the same NationStates nation you wish to login with to NSWiki! If not, go to NationStates.net and switch your nation.