Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

save methode im filemanager angebunden

  • Loading branch information...
commit 828af8bc80f4cc94747a886499d43bcfd91399fc 1 parent 1d4d5a3
Stephan straeger authored
16 app/modules/localeEdit/localeEdit.js
@@ -82,6 +82,22 @@ function(app, jquery, Views ) {
82 82 // Default views
83 83 Localeedit.Views = Views;
84 84
  85 + Localeedit.SaveLocales = function(data) {
  86 + var dataAsJson = JSON.stringify(data);
  87 + console.log(dataAsJson);
  88 +
  89 + $.ajax({
  90 + url: '/api/savelocales',
  91 + type: 'POST',
  92 + data: {
  93 + Locales: dataAsJson
  94 + }
  95 +
  96 + }).success(function(data) {
  97 + console.log('Saved successfully');
  98 + })
  99 +
  100 + };
85 101
86 102 Localeedit.InitFileListUi = function() {
87 103 $('.file-list-wrapper').html('');
8 app/modules/localeEdit/views.js
... ... @@ -1,10 +1,10 @@
1 1 define([
2 2 'app',
3   - // Libs
  3 + 'LocaleEdit',
4 4 'backbone'
5 5 ],
6 6
7   -function(app, Backbone) {
  7 +function(app, LocaleEdit, Backbone) {
8 8
9 9 var Views = {};
10 10
@@ -96,8 +96,8 @@ Views.EditList = Backbone.View.extend({
96 96 this.collection.reset()
97 97 },
98 98 save: function() {
99   - //localStorage.setItem(this.name, JSON.stringify(this.data));
100   - console.log(JSON.stringify(this.collection);
  99 + //localStorage.setItem(this.name, JSON.stringify(this.data));
  100 + LocaleEdit.SaveLocales(this.collection);
101 101 },
102 102 renderList : function(task){
103 103 console.log(task);
5 localeEditFileManager.js
@@ -73,6 +73,11 @@ exports.GetUserFiles = function(req, res) {
73 73 };
74 74
75 75
  76 +exports.SaveLocales = function(req, res) {
  77 + var data = req.body.Locales;
  78 +
  79 +}
  80 +
76 81 exports.DeleteUserFile = function(req, res) {
77 82 var dirName = getUserFolder(req);
78 83 console.log('Retrieving UserFiles: ');
2  server.js
@@ -175,6 +175,8 @@ app.get('/api/currentfiles', filemanager.GetUserFiles);
175 175 //get the locales as json array of locale objects
176 176 app.get('/api/getworkinglocales', filemanager.GetCurrentWorkingLocales);
177 177 app.post('/api/deleteUserFile',express.bodyParser(), filemanager.DeleteUserFile);
  178 +app.post('/api/savelocales',express.bodyParser(), filemanager.SaveLocales);
  179 +
178 180
179 181 app.get('/vendor/*', staticRequest);
180 182 app.get('/app/*', staticRequest);
8 vendor/jam/require.config.js
@@ -63,12 +63,14 @@ var jam = {
63 63 "name": "bootstrap",
64 64 "location": "../vendor/jam",
65 65 "main": "bootstrap.min.js"
66   - }
67   -
68   - ,{
  66 + },{
69 67 "name": "bootstrap-image-gallery",
70 68 "location": "../vendor/jam",
71 69 "main": "bootstrap-image-gallery.min.js"
  70 + },{
  71 + "name": "LocaleEdit",
  72 + "location": "../app/modules/localeEdit",
  73 + "main": "localeEdit.js"
72 74 }
73 75
74 76

0 comments on commit 828af8b

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