Merge branch 'master' into gh-pages
This commit is contained in:
commit
a7f9667b55
24 changed files with 1070 additions and 915 deletions
|
|
@ -33,7 +33,6 @@ if (NODE) {
|
|||
var http = require("http");
|
||||
var path = require("path");
|
||||
var url = require("url");
|
||||
var Str = require("../../shared/es6/strlib");
|
||||
}
|
||||
|
||||
class Net {
|
||||
|
|
|
|||
|
|
@ -28,9 +28,11 @@
|
|||
|
||||
"use strict";
|
||||
|
||||
var Str = require("../../shared/es6/strlib");
|
||||
var Web = require("../../shared/es6/weblib");
|
||||
var Component = require("../../shared/es6/component");
|
||||
if (NODE) {
|
||||
var Str = require("../../shared/es6/strlib");
|
||||
var Web = require("../../shared/es6/weblib");
|
||||
var Component = require("../../shared/es6/component");
|
||||
}
|
||||
|
||||
/**
|
||||
* savePC(idMachine, sPCJSFile, callback)
|
||||
|
|
|
|||
|
|
@ -28,8 +28,10 @@
|
|||
|
||||
"use strict";
|
||||
|
||||
var Web = require("../../shared/es6/weblib");
|
||||
var Component = require("../../shared/es6/component");
|
||||
if (NODE) {
|
||||
var Web = require("../../shared/es6/weblib");
|
||||
var Component = require("../../shared/es6/component");
|
||||
}
|
||||
|
||||
class State {
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -341,7 +341,19 @@ net.getResource = function(sURL, dataPost, fAsync, done)
|
|||
var nErrorCode = -1, sResource = null, response = null;
|
||||
|
||||
if (net.isRemote(sURL)) {
|
||||
console.log('net.getResource("' + sURL + '"): unimplemented');
|
||||
/*
|
||||
* TODO: This code is nothing more than a band-aid. It assumes the URL uses "http:"
|
||||
* (hence the call to getFile(), which only supports HTTP GET operations), it assumes
|
||||
* the requested data is UTF-8 string data (which is normally the case, because nearly
|
||||
* all our requests are for JSON files), it doesn't deal with dataPost, it assumes
|
||||
* that fAsync is true, and it performs very simplistic error code mapping.
|
||||
*
|
||||
* But, it gets the job done for what little we actually ask of it, when our machines
|
||||
* are running in the Node environment.
|
||||
*/
|
||||
Net.getFile(sURL, "utf8", function(err, status, data) {
|
||||
if (done) done(sURL, data, err? status : 0);
|
||||
});
|
||||
} else {
|
||||
if (!sServerRoot) {
|
||||
sServerRoot = path.join(path.dirname(fs.realpathSync(__filename)), "../../../");
|
||||
|
|
|
|||
Loading…
Reference in a new issue