Fixes to run from sub-directory.

This commit is contained in:
Oleg Sh
2019-06-29 18:10:07 +02:00
parent 2394894f72
commit 5e9431f33a
5 changed files with 34 additions and 13 deletions

View File

@@ -163,7 +163,7 @@ BaseAlgorithmEx.prototype.CalculateAlgorithm = function(queryString, resultCallb
$.ajax({
type: "POST",
url: "/cgi-bin/GraphCGI.exe?" + queryString,
url: "/" + SiteDir + "cgi-bin/GraphCGI.exe?" + queryString,
data: xml,
dataType: "text",
})

View File

@@ -497,7 +497,7 @@ Application.prototype.FindPath = function(graph1, graph2)
$.ajax({
type: "POST",
url: "/cgi-bin/GraphCGI.exe?dsp=cgiInput&start=" + graph1.id + "&finish=" + graph2.id + "&report=xml",
url: "/" + SiteDir + "cgi-bin/GraphCGI.exe?dsp=cgiInput&start=" + graph1.id + "&finish=" + graph2.id + "&report=xml",
data: creator.GetXMLString(),
dataType: "text"
})
@@ -778,7 +778,7 @@ Application.prototype.SetAdjacencyMatrix = function (matrix, separator)
var c = {};
if (!this.TestAdjacencyMatrix(matrix, r, c, separator))
{
$.get( "/cgi-bin/addFailedMatrix.php?text=adjacency&matrix=" + encodeURIComponent(matrix), function( data ) {;});
$.get( "/" + SiteDir + "cgi-bin/addFailedMatrix.php?text=adjacency&matrix=" + encodeURIComponent(matrix), function( data ) {;});
res = false;
}
@@ -806,7 +806,7 @@ Application.prototype.SetIncidenceMatrix = function (matrix)
var c = {};
if (!this.TestIncidenceMatrix(matrix, r, c))
{
$.get( "/cgi-bin/addFailedMatrix.php?text=incidence&matrix=" + encodeURIComponent(matrix), function( data ) {;});
$.get( "/" + SiteDir + "cgi-bin/addFailedMatrix.php?text=incidence&matrix=" + encodeURIComponent(matrix), function( data ) {;});
res = false;
}
@@ -880,7 +880,7 @@ Application.prototype.SaveGraphOnDisk = function ()
var app = this;
$.ajax({
type: "POST",
url: "/cgi-bin/saveGraph.php?name=" + this.savedGraphName,
url: "/" + SiteDir + "cgi-bin/saveGraph.php?name=" + this.savedGraphName,
data: graphAsString,
dataType: "text"
})
@@ -918,7 +918,7 @@ Application.prototype.SaveGraphImageOnDisk = function (showDialogCallback)
$.ajax({
type: "POST",
url: "/cgi-bin/saveImage.php?name=" + imageName + rectParams,
url: "/" + SiteDir + "cgi-bin/saveImage.php?name=" + imageName + rectParams,
data: {
base64data : imageBase64Data
},
@@ -947,7 +947,7 @@ Application.prototype.SaveFullGraphImageOnDisk = function (showDialogCallback, f
$.ajax({
type: "POST",
url: "/cgi-bin/saveImage.php?name=" + imageName + rectParams,
url: "/" + SiteDir + "cgi-bin/saveImage.php?name=" + imageName + rectParams,
data: {
base64data : imageBase64Data
},
@@ -977,7 +977,7 @@ Application.prototype.LoadGraphFromDisk = function (graphName)
$.ajax({
type: "GET",
url: "/cgi-bin/loadGraph.php?name=" + graphName
url: "/" + SiteDir + "cgi-bin/loadGraph.php?name=" + graphName
})
.done(function( msg )
{

View File

@@ -1,3 +1,6 @@
var SiteDir = "";
var application = new Application(document, window);
var waitCounter = false;
@@ -548,7 +551,7 @@ function postLoadPage()
console.log("Vote" + this["voteIndex"]);
$.ajax({
type: "GET",
url: "/cgi-bin/vote.php?index=" + this["voteIndex"],
url: "/" + SiteDir + "cgi-bin/vote.php?index=" + this["voteIndex"],
dataType: "text"
});
$("#voteDialog").dialog('close');
@@ -572,7 +575,7 @@ function postLoadPage()
// Get algorithms list and load it.
$.get( "/cgi-bin/getPluginsList.php",
$.get( "/" + SiteDir + "cgi-bin/getPluginsList.php",
function( data )
{
var scriptList = JSON.parse(data);
@@ -586,7 +589,7 @@ function postLoadPage()
else
{
var script = document.createElement('script');
script.src = scriptList[0];
script.src = "/" + SiteDir + "script/" + scriptList[0];
scriptList.shift();
script.onload = loadOneScript;
script.onerror = loadOneScript;

View File

@@ -69,7 +69,7 @@ NeedAlgorithm.prototype.result = function(resultCallback)
console.log("Vote" + this["voteIndex"]);
$.ajax({
type: "GET",
url: "/cgi-bin/vote.php?index=" + this["voteIndex"],
url: "/" + SiteDir + "cgi-bin/vote.php?index=" + this["voteIndex"],
dataType: "text"
});
$("#voteDialog").dialog('close');