@nakedcreativity/cee-ms-node 0.3.14 → 0.3.16

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/index.js +6 -4
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -254,13 +254,15 @@ function ceems(config) {
254
254
 
255
255
  //console.log(req.body.page)
256
256
  req.query.edit = true;
257
- this.site = req.body.site
258
- site = this.site
257
+
259
258
  // if this was sent by the iframe, handle it differently
260
259
  if(req.query.iframe != null){
260
+ this.site = JSON.parse(decodeURIComponent(req.body.site))
261
+ site = this.site
261
262
  this.render(req, res, JSON.parse(decodeURIComponent(req.body.page)));
262
263
  }else {
263
-
264
+ this.site = req.body.site
265
+ site = this.site
264
266
  this.render(req, res, req.body.page);
265
267
  }
266
268
 
@@ -283,7 +285,7 @@ ceems.prototype.load = function(req, res){
283
285
  var page = this.site.pages[path]
284
286
 
285
287
  if(page.redirect){
286
- res.redirect(parseInt(page.redirect.type), page.redirect.to)
288
+ res.redirect(301, page.redirect)
287
289
  }
288
290
 
289
291
  var page = JSON.parse(fs.readFileSync('./pages/'+page._id+'.json', 'utf8'));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nakedcreativity/cee-ms-node",
3
- "version": "0.3.14",
3
+ "version": "0.3.16",
4
4
  "description": "Cee.ms for Node.js",
5
5
  "main": "index.js",
6
6
  "scripts": {