Skip to content

Commit

Permalink
massive massive massive reorganization ... things are getting pretty …
Browse files Browse the repository at this point in the history
…close to working, so that's cool
  • Loading branch information
Kevin Murphy committed Aug 5, 2018
1 parent 459ac1d commit 0262c13
Show file tree
Hide file tree
Showing 159 changed files with 5,092 additions and 172,488 deletions.
78 changes: 78 additions & 0 deletions client/app.js
@@ -0,0 +1,78 @@
'use strict';

const _ = require('underscore');
const utils = require('./utils');
const nx = require('notatrix');

const CollaborationInterface = require('./collaboration');
const config = require('./config');
const Corpus = require('./corpus');
const Graph = require('./graph');
const GUI = require('./gui');
const Server = require('./server');
const Socket = require('./socket');


class App {
constructor() {

this.nx = nx;

this.initialized = false;
this.server = new Server(this);
this.socket = new Socket(this);
this.collab = new CollaborationInterface(this);
this.gui = new GUI(this);
this.corpus = new Corpus(this);
this.graph = new Graph(this);
this.initialized = true;

this.gui.refresh();
this.server.connect();

}

save() {

if (!this.initialized)
return;

// save local preference stuff
this.gui.save();
this.graph.save();

// save the treebank
let serial = this.corpus.serialize();
serial = JSON.stringify(serial);
if (this.server.is_running) {
this.server.save(serial)
} else {
utils.storage.save(serial);
}

console.log('saved');
}

load(serial) {

serial = JSON.parse(serial);
this.corpus = new Corpus(this, serial);
this.gui.refresh();

}

discard() {

console.log('discard');

}

download() {

console.log('download');

}
}


module.exports = App;
181 changes: 0 additions & 181 deletions client/browser-logger.js

This file was deleted.

2 changes: 1 addition & 1 deletion client/collaboration.js → client/collaboration/collab.js
Expand Up @@ -2,7 +2,7 @@

const $ = require('jquery');
const _ = require('underscore');
const funcs = require('./funcs');
const utils = require('../utils');


function getTableRow(selfid, userid, user) {
Expand Down
16 changes: 16 additions & 0 deletions client/collaboration/index.js
@@ -0,0 +1,16 @@
'use strict';

const _ = require('underscore');
const utils = require('../utils');


class CollaborationInterface {
constructor(app) {

this.app = app;

}
}


module.exports = CollaborationInterface;
File renamed without changes.
File renamed without changes.
21 changes: 0 additions & 21 deletions client/config.js

This file was deleted.

19 changes: 19 additions & 0 deletions client/config/index.js
@@ -0,0 +1,19 @@
const _ = require('underscore');
const utils = require('../utils');


var _config = {

version: '0.0.0',
localStorageKey: '__ud_annotatrix_prefs',
treebank_id: utils.getTreebankId(),

corpus: require('../corpus/config'),
graph: require('../graph/config'),
gui: require('../gui/config'),

};

const prefs = utils.storage.load_preferences();

module.exports = _config;
27 changes: 27 additions & 0 deletions client/corpus/config.js
@@ -0,0 +1,27 @@
'use strict';

const _ = require('underscore');
const utils = require('../utils');

var _corpus = {

default_filename: 'ud-annotatrix-corpus',
format_preferences: [
'CoNLL-U',
'CG3',
'SD',
'plain text',
'Brackets',
],

set: params => {
_.each((value, key) => {
if (_corpus[key] !== undefined)
_corpus[key] = value;
});
},

};


module.exports = _corpus;

0 comments on commit 0262c13

Please sign in to comment.