Fix broken URLs from last commit

This commit is contained in:
calzoneman 2013-05-17 18:56:11 -04:00
parent 6dc0a33bda
commit 886834e822
5 changed files with 9 additions and 8 deletions

View File

@ -53,7 +53,7 @@ Then, follow these instructions to install CyTube:
3. Install your distribution's `libmysqlclient` package.
3. Install dependencies: `npm install`
4. Edit `config.js` and input your database details and connection port
5. Edit `www/assets/js/iourl.js` and change the value of `IO_URL` to `yourhostname:port` where `port` is the port defined in `config.js`
5. Edit `www/assets/js/iourl.js` and change the value of `IO_URL` to `yourhostname:port` where `port` is the port defined in `config.js`. Also change `WEB_URL` to `yourhostname:web_port` where `web_port` is the websocket port you defined in `config.js`
Running
-------

View File

@ -10,6 +10,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
*/
var IO_URL = "http://localhost:1337";
var WEB_URL = "http://localhost:8080";
$.getScript(IO_URL+"/socket.io/socket.io.js", function() {
try {

View File

@ -50,7 +50,7 @@
var uname = readCookie("sync_uname") || "";
var p = "";
if(uname && session) {
$.getJSON(IO_URL+"/api/json/login?name="+uname+"&session="+session+"&callback=?", function(data) {
$.getJSON(WEB_URL+"/api/json/login?name="+uname+"&session="+session+"&callback=?", function(data) {
if(data.success) {
$(".loginform").remove();
createCookie("sync_uname", uname, 7);
@ -65,7 +65,7 @@
$("#login").click(function() {
uname = $("#name").val();
q = "name=" + $("#name").val() + "&pw=" + $("#pw").val();
$.getJSON(IO_URL+"/api/json/login?"+q+"&callback=?", function(data) {
$.getJSON(WEB_URL+"/api/json/login?"+q+"&callback=?", function(data) {
if(data.success) {
$(".loginform").remove();
session = data.session;
@ -109,7 +109,7 @@
return entry;
}
function refresh() {
$.getJSON(IO_URL+"/api/json/listloaded?"+p+"&callback=?", function(data) {
$.getJSON(WEB_URL+"/api/json/listloaded?"+p+"&callback=?", function(data) {
var host = document.location + "";
host = host.substring(0, host.indexOf("/widget.html"));
if(data.error) {

View File

@ -126,7 +126,7 @@
return entry;
}
function refresh() {
$.getJSON(IO_URL+"/api/json/listloaded?filter=public&callback=?", function(data) {
$.getJSON(WEB_URL+"/api/json/listloaded?filter=public&callback=?", function(data) {
$("#channeldata").find("tbody").remove();
data.sort(function(a, b) {
var x = a.usercount;

View File

@ -86,7 +86,7 @@
window.addEventListener("message", respond, false);
$("#login").click(function() {
$.getJSON(IO_URL+"/api/json/login?name="+$("#username").val()+"&pw="+$("#pw").val()+"&callback=?", function(data) {
$.getJSON(WEB_URL+"/api/json/login?name="+$("#username").val()+"&pw="+$("#pw").val()+"&callback=?", function(data) {
data.uname = $("#username").val();
source.postMessage("cytube-login:"+JSON.stringify(data), document.location);
});
@ -100,7 +100,7 @@
$("#confirm").addClass("text-error");
return;
}
$.getJSON(IO_URL+"/api/json/register?name="+$("#username").val()+"&pw="+$("#pw").val()+"&callback=?", function(data) {
$.getJSON(WEB_URL+"/api/json/register?name="+$("#username").val()+"&pw="+$("#pw").val()+"&callback=?", function(data) {
console.log(data);
data.uname = $("#username").val();
source.postMessage("cytube-login:"+JSON.stringify(data), document.location);
@ -116,7 +116,7 @@
$("#confirm").addClass("text-error");
return;
}
$.getJSON(IO_URL+"/api/json/changepass?name="+$("#username").val()+"&oldpw="+$("#pw").val()+"&newpw="+$("#newpass").val()+"&callback=?", function(data) {
$.getJSON(WEB_URL+"/api/json/changepass?name="+$("#username").val()+"&oldpw="+$("#pw").val()+"&newpw="+$("#newpass").val()+"&callback=?", function(data) {
if(data.success) {
$("#newpassdiv").css("display", "none");
$("#pw2div").css("display", "none");