Skip to content

Commit

Permalink
Expermineting to drag results
Browse files Browse the repository at this point in the history
  • Loading branch information
PatrikBuetler committed Jun 17, 2024
1 parent d3b8ad6 commit 00be83f
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 5 deletions.
12 changes: 11 additions & 1 deletion api/ui/results.php
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,17 @@ public function get() {
throw new Exception("Not enough data provided for action 'newplot'!");
}
break;
default:
case 'up':
if(!empty($this->get['uid'])) { /*Add Check if previous is set)*/
$arr[] = $this->get();
foreach ($arr as $key => $value) {
echo('key: ' . $key . ' value: ' . $value . '\n');
}
}

case 'swap_down':

default:
throw new Exception("Unknown action!");
}
}
Expand Down
8 changes: 6 additions & 2 deletions core/api.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,13 @@ public function __construct($getVars) {
* @throws Exception
*/
public function get() {
throw new Exception('The action GET is not defined!');
return $this->data;
//throw new Exception('The action GET is not defined!');
}
public function set($rearrangeddata) {
$this->data = $rearrangeddata;
//throw new Exception('The action SET is not defined!');
}

/**
* @throws Exception
*/
Expand Down
14 changes: 12 additions & 2 deletions views/results/build.php
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,18 @@ function u_btoa(buffer) {
}
function movePlots(direction, id) {
swap(direction, id);
location.reload();
var direction = $(this).data('direction');
var id = $(this).data('id');
$.ajax({
url : '/api/ui/results/uid=' + id + '/type=' + plotType + '/systemId=" . $data['system']->getId() . "/action=up/resultId=" . $data['resultId'] . "',
type: 'GET',
data: {
id: id
},
success: function(response) {
alert(response);
},
});
}
function deletePlot(id){
Expand Down

0 comments on commit 00be83f

Please sign in to comment.