Skip to content

Commit

Permalink
urlchange!
Browse files Browse the repository at this point in the history
  • Loading branch information
hoge1e3 committed May 22, 2015
1 parent 0e548fc commit a38314d
Show file tree
Hide file tree
Showing 12 changed files with 32 additions and 50 deletions.
2 changes: 2 additions & 0 deletions js/fs/auth.js
@@ -1,6 +1,7 @@
define(["WebSite"],function (WebSite) {
var auth={};
auth.currentUser=function (onend) {
//TODO: urlchange!
$.ajax({type:"get",url:WebSite.serverTop+"/currentUser",data:{withCsrfToken:true},
success:function (res) {
console.log("auth.currentUser",res);
Expand All @@ -26,6 +27,7 @@ define(["WebSite"],function (WebSite) {
return options.success(user,csrfToken);
}
window.onLoggedIn=options.success;
//TODO: urlchange!
options.showLoginLink(WebSite.serverTop+"/login");
});
};
Expand Down
3 changes: 2 additions & 1 deletion js/fs/blob.js
Expand Up @@ -11,6 +11,7 @@ define(["Auth","WebSite","Util"],function (a,WebSite,Util) {
fd.append("user",user);
fd.append("project",project);
fd.append("fileName",file.name);
//TODO: urlchange!
$.ajax({
type : "get",
url : WebSite.serverTop+"/blobURL",
Expand Down Expand Up @@ -53,7 +54,7 @@ define(["Auth","WebSite","Util"],function (a,WebSite,Util) {
for (var i in bi) data[i]=bi[i];
$.ajax({
type:"get",
url: WebSite.serverTop+"/uploadBlobToExe",
url: WebSite.serverTop+"/uploadBlobToExe", //TODO: urlchange!
data:data,
success: function () {
cnt--;
Expand Down
6 changes: 4 additions & 2 deletions js/fs/requestFragment.js
Expand Up @@ -22,7 +22,8 @@ define(["WebSite"],function (WebSite) {
return p;
}
frags.forEach(function (frag,i) {
$.ajax({type:"post",url:WebSite.top+"/edit/sendFragment",data:addRedir({
//TODO: urlchange!
$.ajax({type:"post",url:WebSite.serverTop+"/sendFragment",data:addRedir({
id:id, seq:i, len:len, content:frag
}),success: function (res) {
console.log("sendFrag",res,i);//,frag);
Expand All @@ -32,7 +33,8 @@ define(["WebSite"],function (WebSite) {
});
});
function runFrag() {
$.ajax({type:"post",url:WebSite.top+"/edit/runFragments",data:addRedir({id:id}),
//TODO: urlchange!
$.ajax({type:"post",url:WebSite.serverTop+"/runFragments",data:addRedir({id:id}),
success: function (res) {
//console.log("runFrag res1=",res,arguments.length);
if (typeof res=="string") {
Expand Down
14 changes: 9 additions & 5 deletions js/fs/sync.js
Expand Up @@ -70,9 +70,10 @@ define(["FS","Shell","requestFragment","WebSite"],function (FS,sh,rf,WebSite) {
function n0() {
var req={base:remote.path(),excludes:JSON.stringify(options.excludes)};
status("getDirInfo", req);
//TODO: urlchange!
$.ajax({
type:"get",
url:WebSite.top+"/edit/getDirInfo",
url:WebSite.serverTop+"/getDirInfo",
data:req,
success:n1,
error:onError
Expand Down Expand Up @@ -102,9 +103,10 @@ define(["FS","Shell","requestFragment","WebSite"],function (FS,sh,rf,WebSite) {

var req={base:remote.path(),paths:JSON.stringify(downloads)};
status("File2LSSync", req);
//TODO: urlchange!
$.ajax({
type:"post",
url:WebSite.top+"/edit/File2LSSync",
url:WebSite.serverTop+"/File2LSSync",
data:req,
success:n2,
error:onError
Expand All @@ -129,11 +131,12 @@ define(["FS","Shell","requestFragment","WebSite"],function (FS,sh,rf,WebSite) {
dlf.metaInfo(d);
}
var req={base:remote.path(),data:JSON.stringify(uploads)};
req.pathInfo="/LS2FileSync";
req.pathInfo="/LS2FileSync";//TODO: urlchange!
status("LS2FileSync", req);
//TODO: urlchange!
rf.ajax({
type:"post",
url:WebSite.top+"/edit/LS2FileSync",
url:WebSite.serverTop+"/LS2FileSync",
data:req,
success:n3,
error:onError
Expand Down Expand Up @@ -172,8 +175,9 @@ define(["FS","Shell","requestFragment","WebSite"],function (FS,sh,rf,WebSite) {
sh.rsh=function () {
var a=[];
for (var i=0; i<arguments.length; i++) a[i]=arguments[i];
//TODO: urlchange!
$.ajax({
url:WebSite.top+"/edit/rsh",
url:WebSite.serverTop+"/rsh",
data:{args:JSON.stringify(a)},
success:function (r) {
sh.echo(r);
Expand Down
7 changes: 5 additions & 2 deletions js/fs/syncProjects.js
Expand Up @@ -4,7 +4,8 @@ requirejs(["Sync", "UI","Util", "Auth","WebSite"],function (Sync,UI,Util,Auth,We

//var user=Util.getQueryString("user");
Auth.currentUser(function (user) {
if (!user) document.location.href="../../edit/login";
//TODO: urlchange!
if (!user) document.location.href=WebSite.serverTop+"/login";
else {
$("#head").text(user+"のファイルを同期中");
Sync.sync(home.rel("Projects/"), FS.get("/home/"+user+"/"), {
Expand All @@ -21,7 +22,9 @@ requirejs(["Sync", "UI","Util", "Auth","WebSite"],function (Sync,UI,Util,Auth,We
"11_Resize/",
"12_Sound/",
"13_DX/",
"14_File/"],
"14_File/",
"15_Box2D/",
"16_Sound2/"],
v:true,onend:onend, onstatus: onstatus,onerror:onerror});
}
});
Expand Down
36 changes: 0 additions & 36 deletions js/help/wikiExporter.js
@@ -1,33 +1,4 @@
requirejs(["Shell","Wiki","FS","requestFragment","WebSite"], function (sh,Wiki,FS,rf,WebSite) {
/*sh.wiki2servSingle=function (path) {
var h=$("<div>");
var home=FS.get(WebSite.tonyuHome);
var base=home.rel("doc/");
var w=Wiki(h,base,{useAnchor:true});
// path=/Tonyu/doc/index.txt
var dst=base.rel("html/").rel(FS.get(path).relPath(base)).path().replace(
/\.txt$/,".html"
);
if (dst!=path) {
w.show(path);
var src="<link rel='stylesheet' href='/css/bootstrap.css'/>\n";
src+="<style>"+
"body{padding-top:20px; margin-left: 20px; margin-right:20px;}"+
"</style>\n";
src+=h.html();
var data={pathInfo:"/edit/LS2FileSync"};
data[FS.get(dst).relPath(base)]=src;
console.log(base.path(), data);
rf.post(data.pathInfo,{
base:base.path() ,
data:JSON.stringify(data)
});
sh.echo("generated ",path,"->",dst);
} else {
sh.echo(dst,":same path");
}
//alert(h.html());
};*/
sh.wiki2serv=function (wikiDirPath,htmlDirPath) {
var h=$("<div>");
var wikiDir=sh.resolve(wikiDirPath);
Expand Down Expand Up @@ -64,13 +35,6 @@ requirejs(["Shell","Wiki","FS","requestFragment","WebSite"], function (sh,Wiki,F
sh.echo("generated ",wikiFile.path(),"->",htmlFile.path());

});

/*console.log(wikiDir.path(), data);
$.post("/edit/LS2FileSync",{
base:wikiDir.path() ,
data:JSON.stringify(data)
});*/

};
sh.wiki2serv.description="wiki2serv ../doc/ ../../../doc/";
});
1 change: 1 addition & 0 deletions js/ide/ImageResEditor.js
Expand Up @@ -212,6 +212,7 @@ define(["FS","Tonyu","UI","ImageList","Blob","Auth","WebSite"
rtf.push(a.fileName);
}
});
//TODO: urlchange!
$.ajax({url:WebSite.serverTop+"/retainBlobs",type:"get",
data:{
user:u,
Expand Down
1 change: 1 addition & 0 deletions js/ide/ResEditor.js
Expand Up @@ -198,6 +198,7 @@ define(["FS","Tonyu","UI","ImageList","Blob","Auth","WebSite"
retainFileNames:JSON.stringify(rtf)
};
console.log("retainBlobs",data);
//TODO: urlchange!
$.ajax({url:WebSite.serverTop+"/retainBlobs",type:"get",
data:data
});
Expand Down
2 changes: 1 addition & 1 deletion js/runtime/WebSite.js
Expand Up @@ -61,7 +61,7 @@ define([], function () {
window.WebSite.serverTop=window.WebSite.top+"/edit";// Fix NetModule.tonyu!!
}
window.WebSite.sampleImg=window.WebSite.top+"/images";
window.WebSite.blobPath=window.WebSite.serverTop+"/serveBlob";
window.WebSite.blobPath=window.WebSite.serverTop+"/serveBlob"; //TODO: urlchange!
window.WebSite.isNW=(typeof process=="object" && process.__node_webkit);
window.WebSite.tonyuHome="/Tonyu/";
if (window.WebSite.isNW) {
Expand Down
6 changes: 4 additions & 2 deletions js/social/exportToExe.js
Expand Up @@ -31,7 +31,8 @@ $(function () {
$(".on-logged-in").show();
$("#prog").val(east(dir));
$.ajax({ type:"get", //redirectTo:"tonyuexe",
url:"../../edit/get-project-info",
//TODO: urlchange!
url: WebSite.serverTop+"/get-project-info",
data:{pathInfo:"/get-project-info", project:name},
success:function (res) {
console.log("get-prj",res);
Expand Down Expand Up @@ -95,8 +96,9 @@ $(function () {
$("#theForm select").each(setData);
$("#theForm textarea").each(setData);
console.log("upload-project data",data);
//TODO: urlchange!
$.ajax({type:"post", redirectTo:"tonyuexe",
url:"../../edit/upload-project",
url:WebSite.serverTop+"/upload-project",
data:data,
success:function (res) {
console.log("upload-prj",res);
Expand Down
3 changes: 2 additions & 1 deletion js/social/forkBlobs.js
Expand Up @@ -14,9 +14,10 @@ define(["Tonyu.Project","Auth","FS","UI","WebSite"],function (TPR,Auth,FS,UI,Web
},
success: function(user) {
prj.convertBlobInfos(user);
//TODO: urlchange!
$.ajax({
type:"GET",
url:"/edit/forkBlobs",
url:WebSite.serverTop+"/forkBlobs",
data:{
srcUser:srcUser, srcProject: srcProject,
dstUser:user, dstProject:prj.getName()},
Expand Down
1 change: 1 addition & 0 deletions js/social/importFromJsdoit.js
Expand Up @@ -17,6 +17,7 @@ requirejs(["FS","Util","NewProjectDialog","ScriptTagFS","UI","forkBlobs","WebSit
window.projectInfoIs=function (s){
$("#prog").val(s);
};
//TODO: urlchange!
$("<script>").attr("src",url+"/exe/fork?user="+user+"&"+"project="+project).appendTo("head");
}
function mode(n) {
Expand Down

0 comments on commit a38314d

Please sign in to comment.