@@ -46,57 +46,7 @@ define(['./windowChannel', './runtime'], (WindowChannel, Runtime) => {
46
46
return JSON . parse ( decodeURIComponent ( this . rootWindow . frameElement . getAttribute ( 'data-params' ) ) ) ;
47
47
}
48
48
49
- // render(ko) {
50
- // this.rootViewModel = new RootViewModel({
51
- // runtime: this.runtime,
52
- // hostChannel: this.hostChannel,
53
- // authorized: this.authorized,
54
- // authorization: this.authorization,
55
- // pluginParams: this.pluginParams
56
- // });
57
- // this.container.innerHTML = div(
58
- // {
59
- // style: {
60
- // flex: '1 1 0px',
61
- // display: 'flex',
62
- // flexDirection: 'column'
63
- // }
64
- // // dataBind: {
65
- // // component: {
66
- // // name: MainComponent.quotedName(),
67
- // // params: {
68
- // // runtime: 'runtime',
69
- // // bus: 'bus',
70
- // // authorization: 'authorization',
71
- // // pluginParams: 'pluginParams'
72
- // // }
73
- // // }
74
- // // }
75
- // },
76
- // gen.if(
77
- // 'ready',
78
- // gen.component({
79
- // name: MainComponent.name(),
80
- // params: {
81
- // runtime: 'runtime',
82
- // bus: 'bus',
83
- // authorization: 'authorization',
84
- // pluginParams: 'pluginParams'
85
- // }
86
- // })
87
- // )
88
- // );
89
- // ko.applyBindings(this.rootViewModel, this.container);
90
- // }
91
-
92
- showHelp ( ) {
93
- this . rootViewModel . bus . send ( 'help' ) ;
94
- }
95
-
96
49
start ( ) {
97
- // return knockoutLoader.load().then((ko) => {
98
- // ko.options.deferUpdates = true;
99
- // ko.options.createChildContextWithAs = true;
100
50
this . channel . start ( ) ;
101
51
102
52
this . channel . on ( 'start' , ( payload ) => {
@@ -111,34 +61,7 @@ define(['./windowChannel', './runtime'], (WindowChannel, Runtime) => {
111
61
this . config = config ;
112
62
this . authorized = token ? true : false ;
113
63
114
- this . runtime = new runtime . Runtime ( { config, token, username, realname, email } ) ;
115
- // this.render(ko);
116
-
117
- this . rootViewModel . bus . on ( 'set-plugin-params' , ( { pluginParams } ) => {
118
- this . hostChannel . send ( 'set-plugin-params' , { pluginParams } ) ;
119
- } ) ;
120
-
121
- this . channel . on ( 'show-help' , ( ) => {
122
- this . showHelp ( ) ;
123
- } ) ;
124
-
125
- // this.channel.on('loggedin', ({ token, username, realname, email }) => {
126
- // this.runtime.auth({ token, username, realname, email });
127
- // this.rootViewModel.authorized(true);
128
- // this.rootViewModel.authorization({ token, username, realname, email });
129
- // // really faked for now.
130
- // // this.runtime.service('session').
131
- // });
132
-
133
- // this.channel.on('loggedout', () => {
134
- // this.runtime.unauth();
135
- // this.rootViewModel.authorized(false);
136
- // this.rootViewModel.authorization(null);
137
- // });
138
-
139
- // this.rootViewModel.bus.on('instrumentation', (payload) => {
140
- // this.hostChannel.send('send-instrumentation', payload);
141
- // });
64
+ this . runtime = new Runtime ( { config, token, username, realname, email } ) ;
142
65
} ) ;
143
66
144
67
window . document . addEventListener ( 'click' , ( ) => {
@@ -151,11 +74,10 @@ define(['./windowChannel', './runtime'], (WindowChannel, Runtime) => {
151
74
// on the same channel, with control via the channel id. However, there is a risk
152
75
// the the channels will listen on for the same message ... unlikely though.
153
76
// Still, it would be odd for one window to listen for messages on another...
154
- this . hostChannel . send ( 'ready' , {
77
+ this . channel . send ( 'ready' , {
155
78
channelId : this . channel . id ,
156
79
channelHost : this . channel . host
157
80
} ) ;
158
- // });
159
81
}
160
82
161
83
stop ( ) { }
0 commit comments