Ver Código Fonte

rename /script/* to /scripts/* for consistency.

with lots of other systems and the future of this system.
Lucas Stadler 12 anos atrás
pai
commit
75aa0c80f4
2 arquivos alterados com 4 adições e 4 exclusões
  1. 2 2
      js/pixl/public/index.html
  2. 2 2
      js/pixl/server.js

+ 2 - 2
js/pixl/public/index.html

@ -240,13 +240,13 @@
240 240
241 241
        pixl.script.save = function(name, scriptObj) {
242 242
            var xhr = new XMLHttpRequest();
243
            xhr.open('POST', '/script/' + name);
243
            xhr.open('POST', '/scripts/' + name);
244 244
            xhr.send(pixl.script.stringify(name, scriptObj));
245 245
        };
246 246
247 247
        pixl.script.load = function(name) {
248 248
            var xhr = new XMLHttpRequest();
249
            xhr.open('GET', '/script/' + name);
249
            xhr.open('GET', '/scripts/' + name);
250 250
            xhr.onreadystatechange = function(ev) {
251 251
                if (xhr.readyState == 4) {
252 252
                    var code = xhr.responseText;

+ 2 - 2
js/pixl/server.js

@ -66,7 +66,7 @@ app.get('/load/:name', function(req, res) {
66 66
	})
67 67
});
68 68
69
app.get('/script/:name', function(req, res) {
69
app.get('/scripts/:name', function(req, res) {
70 70
  var file = req.params.name + '.js';
71 71
  var dir = './public';
72 72
  if (!fs.existsSync(path.join(dir, file))) {
@ -75,7 +75,7 @@ app.get('/script/:name', function(req, res) {
75 75
  res.sendfile(file, {root: dir});
76 76
});
77 77
78
app.post('/script/:name', function(req, res) {
78
app.post('/scripts/:name', function(req, res) {
79 79
  processBody(req, function(err, body) {
80 80
    if (err) {
81 81
      res.send(JSON.stringify({status: "error", error: err}));