mirror of
https://gitlab.silvrtree.co.uk/martind2000/nci.git
synced 2025-03-12 18:09:59 +00:00
show names of loaded projects on the client
This commit is contained in:
parent
21941d4ca9
commit
637ad82f5c
@ -1,15 +1,20 @@
|
|||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
define([
|
define([
|
||||||
'react', 'socketio', 'dataio'
|
'underscore', 'react', 'socketio', 'dataio'
|
||||||
], function(
|
], function(
|
||||||
React, socketio, dataio
|
_, React, socketio, dataio
|
||||||
) {
|
) {
|
||||||
|
var contentEl = window.document.getElementById('content');
|
||||||
|
|
||||||
// console.log(React, socketio, dataio);
|
// console.log(React, socketio, dataio);
|
||||||
var connect = dataio(socketio.connect());
|
var connect = dataio(socketio.connect());
|
||||||
|
|
||||||
var projects = connect.resource('projects');
|
var projects = connect.resource('projects');
|
||||||
projects.sync('read', function(err, projects) {
|
projects.sync('read', function(err, projects) {
|
||||||
console.log('>>> err, projects = ', err, projects)
|
contentEl.innerHTML = (
|
||||||
|
(err && err.message) ||
|
||||||
|
('Loaded projects: ' + _(projects).pluck('name').join(', '))
|
||||||
|
);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
@ -3,6 +3,7 @@
|
|||||||
require.config({
|
require.config({
|
||||||
baseUrl: '/js/',
|
baseUrl: '/js/',
|
||||||
paths: {
|
paths: {
|
||||||
|
underscore: 'libs/underscore/underscore',
|
||||||
react: 'libs/react/react-with-addons',
|
react: 'libs/react/react-with-addons',
|
||||||
dataio: '/data.io',
|
dataio: '/data.io',
|
||||||
socketio: '/socket.io/socket.io.js'
|
socketio: '/socket.io/socket.io.js'
|
||||||
|
@ -8,3 +8,5 @@ html
|
|||||||
|
|
||||||
body
|
body
|
||||||
h1 hello world
|
h1 hello world
|
||||||
|
|
||||||
|
#content
|
||||||
|
Loading…
Reference in New Issue
Block a user