Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

noch mehr kleine Änderungen

  • Loading branch information...
commit e1b3ce16df5f9b22c44f8a28c6fcb6c84fad7213 1 parent 5f1f119
Stephan authored
View
15 app/modules/localeEdit/localeEdit.js
@@ -77,6 +77,7 @@ function(app, jquery, Views ) {
Localeedit.InitFileListUi = function() {
+ $('.file-list-wrapper').html('');
var $fileListWrapper = $('.file-list-wrapper')
return $.ajax({
url: '/api/currentfiles'
@@ -98,18 +99,16 @@ function(app, jquery, Views ) {
}).appendTo($fileWrapper);
$btnDelete.html('Löschen');
$btnDelete.click(function(){
- $.ajax({ url: '/api/delete/'+value.name
+ $.ajax({ url: '/api/deleteUserFile/',
+ type: 'POST',
+ data: {
+ Filename: value.name
+ }
}).success(function(data){
- console.log(data);
+ Localeedit.InitFileListUi();
});
});
- var $btn = $('<button>', {
- type : "button",
- 'class' : "pull-right btn btn-primary",
- 'data-toggle' : "button"
- }).appendTo($fileWrapper);
- $btn.html('Fuer Bearbeitung übernemmen');
})
View
8 app/router.js
@@ -64,9 +64,11 @@ function(app,LocaleEdit,jquery) {
.done(function(){
jquery('ul.nav li').removeClass('active');
jquery('ul.nav a[href="#edit"]').parent().addClass('active');
-
- });
- collection.fetch();
+ }).done(function(){
+
+ collection.fetch();
+ });
+
}
View
2  app/styles/style.css
@@ -11,7 +11,7 @@
*/
body{
- padding-top: 60px;
+ /*padding-top: 60px;*/
}
.locale-list{
View
20 localeEditFileManager.js
@@ -72,6 +72,26 @@ exports.GetUserFiles = function(req, res) {
};
+exports.DeleteUserFile = function(req, res) {
+ var dirName = getUserFolder(req);
+ console.log('Retrieving UserFiles: ');
+
+ var fileToDelete =req.body.Filename;
+
+ fs.unlink(dirName + '/' + fileToDelete, function (err) {
+ if (err) {
+ res.writeHead(200, { 'Content-Type': 'application/json' });
+ res.write(JSON.stringify( { state: 'error'}));
+ res.end();
+ } else {
+ res.writeHead(200, { 'Content-Type': 'application/json' });
+ res.write(JSON.stringify( { state: 'success'}));
+ res.end();
+ }
+ });
+
+};
+
function parseLocaleJs (array) {
var nameSpace = '';
var entries = [];
View
4 server.js
@@ -146,6 +146,7 @@ io.sockets.on('connection', function(socket){
server.get('/', indexRequest);
+server.get('/index', indexRequest);
server.get('/edit', indexRequest);
server.get('/overview', indexRequest);
@@ -201,6 +202,9 @@ server.get('/api/currentfiles', filemanager.GetUserFiles);
//get the locales as json array of locale objects
server.get('/api/getworkinglocales', filemanager.GetCurrentWorkingLocales);
+//
+server.post('/api/deleteUserFile',express.bodyParser(), filemanager.DeleteUserFile);
+
server.get('/vendor/*', staticRequest);
server.get('/app/*', staticRequest);
server.get('/app/img', staticRequest);
Please sign in to comment.
Something went wrong with that request. Please try again.