Skip to content

Commit

Permalink
WIP: working!
Browse files Browse the repository at this point in the history
  • Loading branch information
NicolasRannou committed Dec 2, 2011
1 parent 580455c commit d3f5f91
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 54 deletions.
53 changes: 0 additions & 53 deletions js/ajax.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,32 +50,8 @@ function UpdateCurrentImage(filename)
xmlHttp.send(null);
}

function RequestImage(filename)
{
var xmlHttp = getXMLHttp();

xmlHttp.onreadystatechange = function()
{
if(xmlHttp.readyState == 4)
{
HandleResponse(xmlHttp.responseText, filename);
}
}

xmlHttp.open("GET", "ajax.php?var1=value1&var2=value2", true);
xmlHttp.send(null);
}

function HandleUpdateCurrentImage(response, filename)
{
//document.getElementById('preview').innerHTML = ag.concat("/>\"");
//document.getElementById('ajaxecho').innerHTML = response;
}

function HandleResponse(response, filename)
{
//document.getElementById('preview').innerHTML = ag.concat("/>\"");
document.getElementById('filtered').innerHTML = response;
}

function UpdateImageIfAny()
Expand All @@ -101,23 +77,19 @@ function RequestUpdateImageIfAny()

function HandleResponseUpdateImageIfAny(response)
{
//document.getElementById('preview').innerHTML = ag.concat("/>\"");
//document.getElementById('ajaxecho').innerHTML = response;
var im = "<img id=\"myimage\" src=";
var ag = im.concat(file.substring(6));
document.getElementById('preview').innerHTML = ag.concat(" height=\"200\" width=\"200\" />");
}

function openFile(file) {
//document.getElementById('preview').innerHTML = "<img src=bank/rannou/25696c5.jpg>";
var im = "<img id=\"myimage\" src=";
var ag = im.concat(file.substring(6));
document.getElementById('preview').innerHTML = ag.concat(" height=\"200\" width=\"200\" />");
UpdateCurrentImage(file.substring(6));
}

function testCommand(file) {
//document.getElementById('ajaxecho').innerHTML = file;
UpdateTestCommand(file);
}

Expand All @@ -142,9 +114,6 @@ function UpdateTestCommand(file)

function HandleResponseUpdateTestCommand(response)
{
//document.getElementById('preview').innerHTML = ag.concat("/>\"");
//document.getElementById('ajaxecho').innerHTML = response;

document.getElementById('ajaxecho').innerHTML = response;

images = response.split(" ");
Expand All @@ -153,26 +122,4 @@ function HandleResponseUpdateTestCommand(response)
var im = "<img id=\"myimage\" src=";
var ag = im.concat(images[1]);
document.getElementById('filtered').innerHTML = ag.concat(" height=\"200\" width=\"200\" />");
}

function preview(file) {
var getvalue=document.getElementById("myimage").getAttribute("value");

document.getElementById('filtered').innerHTML = file;
//RequestImage();
// get image name
// get filter
// server process
// server sends new image location
}

function clicked() {
var getvalue=document.getElementById("command").getAttribute("value");

//document.getElementById('ajaxecho').innerHTML = getvalue;
//RequestImage();
// get image name
// get filter
// server process
// server sends new image location
}
2 changes: 1 addition & 1 deletion upload.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php
session_start();
$image = $_SESSION["myusername"];
$image = $_SESSION["myemail"];

$target = "bank/".$image."/original/";

Expand Down

0 comments on commit d3f5f91

Please sign in to comment.