Commit 40ce98990085093b03795627ad3f98b10091f41e

Fix JS config and path relate issues
  • Diff rendering mode:
  • inline
  • side by side

mouchak/server.py

95 return flask.jsonify(error=res['err'], status='error')95 return flask.jsonify(error=res['err'], status='error')
9696
9797
98#@app.route('/menu', methods=['POST'])
99#def insertMenu():
100# newmenu = flask.request.json
101# print newmenu
102# res = siteMenu.insert(newmenu)
103# print res
104# return flask.jsonify(status='success')#, content=getContent())
105#
98@app.route('/menu', methods=['POST'])
99def insertMenu():
100 #newmenu = flask.request.json
101 #print newmenu
102 #res = siteMenu.insert(newmenu)
103 #print res
104 #return flask.jsonify(status='success')#, content=getContent())
105 return '200 OK'
106
106107
107@app.route('/menu/<_id>', methods=['PUT'])108@app.route('/menu/<_id>', methods=['PUT'])
108def updateMenu(_id):109def updateMenu(_id):

mouchak/static/js/editor.js

9191
92 var Pages = Backbone.Collection.extend({92 var Pages = Backbone.Collection.extend({
93 model: M.types.model.Page,93 model: M.types.model.Page,
94 url: M.PageURL()
94 url: M.PageURL() + '/'
95 });95 });
9696
97 /* view to manage each page and their properties - change page properties,97 /* view to manage each page and their properties - change page properties,

mouchak/static/js/models.js

117 customMenu: false117 customMenu: false
118 },118 },
119 url: function() {119 url: function() {
120 return M.MenuURL() + this.id;
120 return M.MenuURL() + '/' + this.id;
121 },121 },
122 initialize: function() {122 initialize: function() {
123 this.id = this.get('id');123 this.id = this.get('id');

mouchak/templates/editor.html

38 <script>38 <script>
39 // initialize editor39 // initialize editor
40 window.M = window.M || {};40 window.M = window.M || {};
41 M.MenuURL = function() { return "{{ url_for('updateMenu') }}"};
41 M.MenuURL = function() { return "{{ url_for('insertMenu') }}"};
42 M.PageURL = function() { return "{{ url_for('insertPage') }}"};42 M.PageURL = function() { return "{{ url_for('insertPage') }}"};
43 M.site_content = {{ content|tojson|safe }};43 M.site_content = {{ content|tojson|safe }};
44 window.onload = function() {44 window.onload = function() {

mouchak/templates/index.html

34 <script>34 <script>
35 //Code to initialize the framework35 //Code to initialize the framework
36 window.M = window.M || {};36 window.M = window.M || {};
37 M.MenuURL = function() { return "{{ url_for('updateMenu') }}"};
37 M.MenuURL = function() { return "{{ url_for('insertMenu') }}"};
38 M.PageURL = function() { return "{{ url_for('insertPage') }}"; };38 M.PageURL = function() { return "{{ url_for('insertPage') }}"; };
39 M.site_content = {{ content|tojson|safe }};39 M.site_content = {{ content|tojson|safe }};
40 window.onload = function() {40 window.onload = function() {