Skip to content
This repository has been archived by the owner on Jun 27, 2019. It is now read-only.

Commit

Permalink
Remove save file period
Browse files Browse the repository at this point in the history
The file will not be saved by period of time, anymore.
The file is saved file or when the window is closed or
it is opened another file. This behavior should change to
be more controllable.

Signed-off-by: Bruno Bottazzini <bruno.bottazzini@intel.com>
  • Loading branch information
Bruno Bottazzini committed Oct 16, 2015
1 parent bac173d commit eed8984
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 30 deletions.
4 changes: 0 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -163,10 +163,6 @@ If no argument is provided it will get the default server configuration file.
The refresh period of the fbp runer service status, in miliseconds.
Default 1000 ms

save_file_period:
Period that it will save your file when editing it
Default: 5000 ms

run_dialog_refresh_period:
The refresh period of the output dialog, where stdout/stderr of
running fbp file is displayed.
Expand Down
28 changes: 2 additions & 26 deletions client/js/controllers/editor.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,7 @@
function ($compile, $scope, $http, $interval, $document, broadcastService,
FetchFileFactory, usSpinnerService, svConf) {
var isRunningSyntax = false;
var isRunningSave = false;
var promiseCheckSyntax;
var promiseSaveFile;
var promiseRunViewer;
var markId;
var diag;
Expand All @@ -46,7 +44,6 @@
var isLeaf;
var rootTree;
var dataTree;
$scope.saveFilePeriod = 5000;
$scope.syntaxCheckRefreshPeriod = 1100;
$scope.runConf = false;
$scope.loginConf = false;
Expand All @@ -57,7 +54,6 @@
$scope.runJournal = data.journal_access;
$scope.runDialogRefreshPeriod = parseInt(data.run_dialog_refresh_period);
$scope.syntaxCheckRefreshPeriod = parseInt(data.syntax_check_refresh_period);
$scope.saveFilePeriod = parseInt(data.save_file_period);
var refreshPeriod = parseInt(data.fbp_service_status_refresh_period);
if ($scope.runJournal === true) {
$scope.getServiceStatus();
Expand Down Expand Up @@ -485,10 +481,6 @@
}, $scope.syntaxCheckRefreshPeriod);
};

$scope.saveFileStop = function() {
$interval.cancel(promiseSaveFile);
};

$scope.saveFile = function(path, body) {
if (body && path && isLeaf) {
var repo = path.split("repos/")[1].split("/")[0];
Expand All @@ -499,34 +491,18 @@
"file_body": body
}
});
$scope.saveFileStop();
}
}
};

$scope.saveFileStart = function() {
$scope.saveFileStop();
promiseSaveFile = $interval(
function () {
var fbpCode = editor.getSession().getValue();
if (fbpCode && filePath && isLeaf) {
$scope.saveFile(filePath, fbpCode);
}
}, $scope.saveFilePeriod);
};

$scope.editorChanged = function (e) {
// Lets put some interfaces like * that will warn user
//the file has changed
if (isRunningSyntax === false) {
isRunningSyntax = true;
$scope.checkSyntaxStart();
isRunningSyntax = false;
}

if (isRunningSave === false) {
isRunningSave = true;
$scope.saveFileStart();
isRunningSave = false;
}
};

function sure_dialog(title, description, callback) {
Expand Down

0 comments on commit eed8984

Please sign in to comment.