mirror of
https://github.com/Doodle3D/Doodle3D-API
synced 2025-01-05 11:03:49 +01:00
updated paths for local imports
This commit is contained in:
parent
2b7cedfcf6
commit
376731722d
23
config.js
23
config.js
@ -1,5 +1,6 @@
|
|||||||
System.config({
|
System.config({
|
||||||
"baseURL": "/",
|
"baseURL": "/",
|
||||||
|
"defaultJSExtensions": true,
|
||||||
"transpiler": "babel",
|
"transpiler": "babel",
|
||||||
"babelOptions": {
|
"babelOptions": {
|
||||||
"optional": [
|
"optional": [
|
||||||
@ -7,31 +8,23 @@ System.config({
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
"paths": {
|
"paths": {
|
||||||
"*": "*.js",
|
"github:*": "jspm_packages/github/*",
|
||||||
"github:*": "jspm_packages/github/*.js",
|
"npm:*": "jspm_packages/npm/*"
|
||||||
"npm:*": "jspm_packages/npm/*.js"
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
System.config({
|
System.config({
|
||||||
"map": {
|
"map": {
|
||||||
"config-API": "src/configapi",
|
"babel": "npm:babel-core@5.7.4",
|
||||||
"doodle3d-API": "src/doodle3dapi",
|
"babel-runtime": "npm:babel-runtime@5.7.0",
|
||||||
"info-API": "src/infoapi",
|
|
||||||
"network-API": "src/networkapi",
|
|
||||||
"printer-API": "src/printerapi",
|
|
||||||
"rest-API": "src/restapi",
|
|
||||||
"sketch-API": "src/sketchapi",
|
|
||||||
"system-API": "src/systemapi",
|
|
||||||
"update-API": "src/updateapi",
|
|
||||||
"babel": "npm:babel-core@5.6.20",
|
|
||||||
"babel-runtime": "npm:babel-runtime@5.6.20",
|
|
||||||
"core-js": "npm:core-js@0.9.18",
|
"core-js": "npm:core-js@0.9.18",
|
||||||
"jquery": "github:components/jquery@2.1.4",
|
"jquery": "github:components/jquery@2.1.4",
|
||||||
|
"traceur": "github:jmcriffey/bower-traceur@0.0.90",
|
||||||
|
"traceur-runtime": "github:jmcriffey/bower-traceur-runtime@0.0.90",
|
||||||
"github:jspm/nodelibs-process@0.1.1": {
|
"github:jspm/nodelibs-process@0.1.1": {
|
||||||
"process": "npm:process@0.10.1"
|
"process": "npm:process@0.10.1"
|
||||||
},
|
},
|
||||||
"npm:babel-runtime@5.6.20": {
|
"npm:babel-runtime@5.7.0": {
|
||||||
"process": "github:jspm/nodelibs-process@0.1.1"
|
"process": "github:jspm/nodelibs-process@0.1.1"
|
||||||
},
|
},
|
||||||
"npm:core-js@0.9.18": {
|
"npm:core-js@0.9.18": {
|
||||||
|
@ -1,11 +1,12 @@
|
|||||||
import Doodle3DAPI from 'doodle3d-API';
|
import Doodle3DAPI from 'src/doodle3dapi.js';
|
||||||
import rest from 'rest-API';
|
import rest from 'src/restapi.js';
|
||||||
|
|
||||||
var api = 'http://connect.doodle3d.com/api/';
|
var api = 'http://connect.doodle3d.com/api/';
|
||||||
|
|
||||||
|
var addBox = (function () {
|
||||||
var known = [];
|
var known = [];
|
||||||
|
|
||||||
function addBox (boxData) {
|
return function (boxData) {
|
||||||
|
|
||||||
if (known.indexOf(boxData.localip) === -1) {
|
if (known.indexOf(boxData.localip) === -1) {
|
||||||
known.push(boxData.localip);
|
known.push(boxData.localip);
|
||||||
|
|
||||||
@ -49,7 +50,6 @@ function addBox (boxData) {
|
|||||||
row.style.color = 'gray';
|
row.style.color = 'gray';
|
||||||
};
|
};
|
||||||
doodle3DAPI.onupdate = function (data) {
|
doodle3DAPI.onupdate = function (data) {
|
||||||
console.log(data);
|
|
||||||
state.innerHTML = data.state;
|
state.innerHTML = data.state;
|
||||||
if (data.state !== 'disconnected' && data.state !== 'connecting' && data.state !== 'unknown') {
|
if (data.state !== 'disconnected' && data.state !== 'connecting' && data.state !== 'unknown') {
|
||||||
bed.innerHTML = data.bed;
|
bed.innerHTML = data.bed;
|
||||||
@ -63,11 +63,21 @@ function addBox (boxData) {
|
|||||||
totalLines.innerHTML = data.total_lines;
|
totalLines.innerHTML = data.total_lines;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
bed.innerHTML = '';
|
||||||
|
bedTarget.innerHTML = '';
|
||||||
|
bufferedLines.innerHTML = '';
|
||||||
|
currentLine.innerHTML = '';
|
||||||
|
hasControl.innerHTML = '';
|
||||||
|
hotend.innerHTML = '';
|
||||||
|
hotendTarget.innerHTML = '';
|
||||||
|
state.innerHTML = '';
|
||||||
|
totalLines.innerHTML = '';
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
doodle3DAPI.startUpdateLoop();
|
doodle3DAPI.startUpdateLoop();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
})();
|
||||||
|
|
||||||
function searchBoxes () {
|
function searchBoxes () {
|
||||||
rest.get(api + 'list.php', function (error, boxes) {
|
rest.get(api + 'list.php', function (error, boxes) {
|
||||||
@ -83,12 +93,11 @@ function searchBoxes () {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
setInterval(searchBoxes, 5000);
|
setInterval(searchBoxes, 5000);
|
||||||
searchBoxes();
|
searchBoxes();
|
||||||
|
|
||||||
addBox({
|
addBox({
|
||||||
localip: window.location.host + ':3000',
|
localip: '127.0.0.1:3000',
|
||||||
wifiboxid: 'Node Server'
|
wifiboxid: 'Node Server'
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -17,7 +17,7 @@
|
|||||||
<script type="text/javascript" src="../config.js"></script>
|
<script type="text/javascript" src="../config.js"></script>
|
||||||
|
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
System.import('example/app');
|
System.import('example/app.js');
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
</head>
|
</head>
|
||||||
|
17
package.json
17
package.json
@ -1,7 +1,6 @@
|
|||||||
{
|
{
|
||||||
"jspm": {
|
"jspm": {
|
||||||
"format": "es6",
|
"main": "./doodle3dapi",
|
||||||
"main": "doodle3dapi.js",
|
|
||||||
"directories": {
|
"directories": {
|
||||||
"lib": "src"
|
"lib": "src"
|
||||||
},
|
},
|
||||||
@ -11,17 +10,9 @@
|
|||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"babel": "npm:babel-core@^5.1.13",
|
"babel": "npm:babel-core@^5.1.13",
|
||||||
"babel-runtime": "npm:babel-runtime@^5.1.13",
|
"babel-runtime": "npm:babel-runtime@^5.1.13",
|
||||||
"core-js": "npm:core-js@^0.9.4"
|
"core-js": "npm:core-js@^0.9.4",
|
||||||
},
|
"traceur": "github:jmcriffey/bower-traceur@0.0.90",
|
||||||
"map": {
|
"traceur-runtime": "github:jmcriffey/bower-traceur-runtime@0.0.90"
|
||||||
"config-API": "src/configapi",
|
|
||||||
"info-API": "src/infoapi",
|
|
||||||
"network-API": "src/networkapi",
|
|
||||||
"printer-API": "src/printerapi",
|
|
||||||
"rest-API": "src/restapi",
|
|
||||||
"sketch-API": "src/sketchapi",
|
|
||||||
"system-API": "src/systemapi",
|
|
||||||
"update-API": "src/updateapi"
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import rest from 'rest-API';
|
import rest from './restapi.js';
|
||||||
|
|
||||||
export default class {
|
export default class {
|
||||||
constructor (localIP) {
|
constructor (localIP) {
|
||||||
|
@ -1,11 +1,11 @@
|
|||||||
import rest from 'rest-API';
|
import rest from './restapi.js';
|
||||||
import ConfigAPI from 'config-API';
|
import ConfigAPI from './configapi.js';
|
||||||
import InfoAPI from 'info-API';
|
import InfoAPI from './infoapi.js';
|
||||||
import NetworkAPI from 'network-API';
|
import NetworkAPI from './networkapi.js';
|
||||||
import PrinterAPI from 'printer-API';
|
import PrinterAPI from './printerapi.js';
|
||||||
import SketchAPI from 'sketch-API';
|
import SketchAPI from './sketchapi.js';
|
||||||
import SystemAPI from 'system-API';
|
import SystemAPI from './systemapi.js';
|
||||||
import UpdateAPI from 'update-API';
|
import UpdateAPI from './updateapi.js';
|
||||||
|
|
||||||
export default class {
|
export default class {
|
||||||
constructor (localIP) {
|
constructor (localIP) {
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import rest from 'rest-API';
|
import rest from './restapi.js';
|
||||||
|
|
||||||
export default class {
|
export default class {
|
||||||
constructor (localIP) {
|
constructor (localIP) {
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import rest from 'rest-API';
|
import rest from './restapi.js';
|
||||||
|
|
||||||
export default class {
|
export default class {
|
||||||
constructor (localIP) {
|
constructor (localIP) {
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import rest from 'rest-API';
|
import rest from './restapi.js';
|
||||||
|
|
||||||
export default class {
|
export default class {
|
||||||
constructor (localIP) {
|
constructor (localIP) {
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import rest from 'rest-API';
|
import rest from './restapi.js';
|
||||||
|
|
||||||
export default class {
|
export default class {
|
||||||
constructor (localIP) {
|
constructor (localIP) {
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import rest from 'rest-API';
|
import rest from './restapi.js';
|
||||||
|
|
||||||
export default class {
|
export default class {
|
||||||
constructor (localIP) {
|
constructor (localIP) {
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import rest from 'rest-API';
|
import rest from './restapi.js';
|
||||||
|
|
||||||
export default class {
|
export default class {
|
||||||
constructor (localIP) {
|
constructor (localIP) {
|
||||||
|
Loading…
Reference in New Issue
Block a user