Start updating to new API

This commit is contained in:
Calvin Montgomery 2013-08-11 23:10:55 -04:00
parent 0bf80a375d
commit 4aa0e7a4ef
7 changed files with 63 additions and 314 deletions

View file

@ -66,9 +66,11 @@
window.addEventListener("message", respond, false);
$("#login").click(function() {
var u = encodeURIComponent($("#username").val());
var p = encodeURIComponent($("#pw").val());
$.getJSON(WEB_URL+"/api/json/login?name="+u+"&pw="+p+"&callback=?", function(data) {
var data = {
name: $("#username").val(),
pw: $("#pw").val()
};
$.post(WEB_URL+"/api/login", data, function (data) {
data.uname = $("#username").val();
source.postMessage("cytube-login:"+JSON.stringify(data), document.location);
});