Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

save methode im filemanager angebunden

  • Loading branch information...
commit 828af8bc80f4cc94747a886499d43bcfd91399fc 1 parent 1d4d5a3
Stephan authored
View
16 app/modules/localeEdit/localeEdit.js
@@ -82,6 +82,22 @@ function(app, jquery, Views ) {
// Default views
Localeedit.Views = Views;
+ Localeedit.SaveLocales = function(data) {
+ var dataAsJson = JSON.stringify(data);
+ console.log(dataAsJson);
+
+ $.ajax({
+ url: '/api/savelocales',
+ type: 'POST',
+ data: {
+ Locales: dataAsJson
+ }
+
+ }).success(function(data) {
+ console.log('Saved successfully');
+ })
+
+ };
Localeedit.InitFileListUi = function() {
$('.file-list-wrapper').html('');
View
8 app/modules/localeEdit/views.js
@@ -1,10 +1,10 @@
define([
'app',
- // Libs
+ 'LocaleEdit',
'backbone'
],
-function(app, Backbone) {
+function(app, LocaleEdit, Backbone) {
var Views = {};
@@ -96,8 +96,8 @@ Views.EditList = Backbone.View.extend({
this.collection.reset()
},
save: function() {
- //localStorage.setItem(this.name, JSON.stringify(this.data));
- console.log(JSON.stringify(this.collection);
+ //localStorage.setItem(this.name, JSON.stringify(this.data));
+ LocaleEdit.SaveLocales(this.collection);
},
renderList : function(task){
console.log(task);
View
5 localeEditFileManager.js
@@ -73,6 +73,11 @@ exports.GetUserFiles = function(req, res) {
};
+exports.SaveLocales = function(req, res) {
+ var data = req.body.Locales;
+
+}
+
exports.DeleteUserFile = function(req, res) {
var dirName = getUserFolder(req);
console.log('Retrieving UserFiles: ');
View
2  server.js
@@ -175,6 +175,8 @@ app.get('/api/currentfiles', filemanager.GetUserFiles);
//get the locales as json array of locale objects
app.get('/api/getworkinglocales', filemanager.GetCurrentWorkingLocales);
app.post('/api/deleteUserFile',express.bodyParser(), filemanager.DeleteUserFile);
+app.post('/api/savelocales',express.bodyParser(), filemanager.SaveLocales);
+
app.get('/vendor/*', staticRequest);
app.get('/app/*', staticRequest);
View
8 vendor/jam/require.config.js
@@ -63,12 +63,14 @@ var jam = {
"name": "bootstrap",
"location": "../vendor/jam",
"main": "bootstrap.min.js"
- }
-
- ,{
+ },{
"name": "bootstrap-image-gallery",
"location": "../vendor/jam",
"main": "bootstrap-image-gallery.min.js"
+ },{
+ "name": "LocaleEdit",
+ "location": "../app/modules/localeEdit",
+ "main": "localeEdit.js"
}

0 comments on commit 828af8b

Please sign in to comment.
Something went wrong with that request. Please try again.