File tree 2 files changed +28
-50
lines changed
2 files changed +28
-50
lines changed Original file line number Diff line number Diff line change 4
4
5
5
require ( './start/setup.js' ) ;
6
6
require ( './start/plugins.js' ) ;
7
-
8
- // -----
9
- // Create UI
10
- //
11
- // TODO
12
- // - move all of this out of index.js into a ./start/
13
- // file and setup ui/input from there. It was just
14
- // in index.js here for easy testing purposes.
15
- //
16
- // -----
17
-
18
- window = require ( './lib/ui/window.js' ) ;
19
- strokes = require ( './lib/input/strokes.js' ) ;
20
-
21
-
22
- var irc = require ( "irc" ) ;
23
-
24
- var con = {
25
- nick :"utterbot"
26
- , server :"irc.hypeirc.net"
27
- , channels :[ "#utter" ]
28
- } ;
29
-
30
- con . nect = function ( ) {
31
- return new irc . Client ( con . server , con . nick , { channels :con . channels } ) ;
32
- } ;
33
-
34
- var client = con . nect ( ) ;
35
-
36
- client . addListener ( 'error' , function ( message ) {
37
- console . error ( 'ERROR: %s: %s' , message . command , message . args . join ( ' ' ) ) ;
38
- } ) ;
39
-
40
- client . addListener ( 'message' , function ( from , to , message ) {
41
- window . BODY . content += '\n[00:00:00] <' + from + '> ' + message ;
42
- window . render ( ) ;
43
- } ) ;
44
-
45
-
46
- window . render ( ) ;
47
- strokes . init ( {
48
- display : function ( ) {
49
- window . INPUT . content = strokes . currentBufferText ( ) ;
50
- window . render ( ) ;
51
- }
52
- , send : function ( msg ) {
53
- window . BODY . content += "\n[00:00:00] <@username> " + msg ;
54
- client . say ( '#utter' , msg ) ;
55
- }
56
- } ) ;
7
+ require ( './start/ui.js' ) ;
Original file line number Diff line number Diff line change
1
+ // -----
2
+ // Load our window and keystrokes
3
+ // -----
4
+
5
+ window = require ( '../lib/ui/window.js' ) ;
6
+ strokes = require ( '../lib/input/strokes.js' ) ;
7
+
8
+ // -----
9
+ // Initialize our keystrokes and add our basic
10
+ // functionality.
11
+ // -----
12
+
13
+ strokes . init ( {
14
+ display : function ( ) {
15
+ window . INPUT . content = strokes . currentBufferText ( ) ;
16
+ window . render ( ) ;
17
+ }
18
+ , send : function ( msg ) {
19
+ window . BODY . content += "\n[00:00:00] <@username> " + msg ;
20
+ }
21
+ } ) ;
22
+
23
+ // -----
24
+ // Render the initial window
25
+ // -----
26
+
27
+ window . render ( ) ;
You can’t perform that action at this time.
0 commit comments