5
5
$ ( document ) . ready ( ( ) => {
6
6
const socket = socketio . connect ( '..' , '/pluginfw/installer' ) ;
7
7
socket . on ( 'disconnect' , ( reason ) => {
8
+ window . console . log ( 'socket disconnect' , new Date ( ) ) ;
8
9
// The socket.io client will automatically try to reconnect for all reasons other than "io
9
10
// server disconnect".
10
11
if ( reason === 'io server disconnect' ) socket . connect ( ) ;
@@ -133,6 +134,7 @@ $(document).ready(() => {
133
134
} else {
134
135
installed . progress . show ( plugin , 'Updating' ) ;
135
136
}
137
+ window . console . log ( 'before emit install' , new Date ( ) )
136
138
socket . emit ( 'install' , plugin , version ) ;
137
139
installed . messages . hide ( 'nothing-installed' ) ;
138
140
} ) ;
@@ -141,6 +143,7 @@ $(document).ready(() => {
141
143
$ ( '.do-uninstall' ) . unbind ( 'click' ) . click ( ( e ) => {
142
144
const $row = $ ( e . target ) . closest ( 'tr' ) ;
143
145
const pluginName = $row . data ( 'plugin' ) ;
146
+ window . console . log ( 'before emit uninstall' , new Date ( ) )
144
147
socket . emit ( 'uninstall' , pluginName ) ;
145
148
installed . progress . show ( pluginName , 'Uninstalling' ) ;
146
149
installed . list = installed . list . filter ( ( plugin ) => plugin . name !== pluginName ) ;
@@ -170,7 +173,7 @@ $(document).ready(() => {
170
173
search . messages . hide ( 'fetching' ) ;
171
174
$ ( '#search-query' ) . removeAttr ( 'disabled' ) ;
172
175
173
- console . log ( 'got search results' , data ) ;
176
+ window . console . log ( 'got search results' , data ) ;
174
177
175
178
// add to results
176
179
search . results = search . results . concat ( data . results ) ;
@@ -198,6 +201,7 @@ $(document).ready(() => {
198
201
} ) ;
199
202
200
203
socket . on ( 'results:installed' , ( data ) => {
204
+ window . console . log ( 'socket results:installed' , new Date ( ) ) ;
201
205
installed . messages . hide ( 'fetching' ) ;
202
206
installed . messages . hide ( 'nothing-installed' ) ;
203
207
@@ -214,13 +218,15 @@ $(document).ready(() => {
214
218
215
219
if ( installed . list . length > 0 ) {
216
220
displayPluginList ( installed . list , $ ( '#installed-plugins' ) , $ ( '#installed-plugin-template' ) ) ;
221
+ window . console . log ( 'before emit checkUpdates' , new Date ( ) )
217
222
socket . emit ( 'checkUpdates' ) ;
218
223
} else {
219
224
installed . messages . show ( 'nothing-installed' ) ;
220
225
}
221
226
} ) ;
222
227
223
228
socket . on ( 'results:updatable' , ( data ) => {
229
+ window . console . log ( 'socket results:updatable' , new Date ( ) ) ;
224
230
data . updatable . forEach ( ( plugin ) => {
225
231
const { name, version} = plugin ;
226
232
const actions = $ ( `#installed-plugins > tr.${ name } .actions` ) ;
@@ -233,6 +239,7 @@ $(document).ready(() => {
233
239
} ) ;
234
240
235
241
socket . on ( 'finished:install' , ( data ) => {
242
+ window . console . log ( 'socket finished:install' , new Date ( ) ) ;
236
243
if ( data . error ) {
237
244
if ( data . code === 'EPEERINVALID' ) {
238
245
alert ( "This plugin requires that you update Etherpad so it can operate in it's true glory" ) ;
@@ -241,6 +248,7 @@ $(document).ready(() => {
241
248
$ ( `#installed-plugins .${ data . plugin } ` ) . remove ( ) ;
242
249
}
243
250
251
+ window . console . log ( 'before emit getInstalled' , new Date ( ) )
244
252
socket . emit ( 'getInstalled' ) ;
245
253
246
254
// update search results
@@ -250,13 +258,15 @@ $(document).ready(() => {
250
258
} ) ;
251
259
252
260
socket . on ( 'finished:uninstall' , ( data ) => {
261
+ window . console . log ( 'socket finished:uninstall' , new Date ( ) ) ;
253
262
if ( data . error ) {
254
263
alert ( `An error occurred while uninstalling the ${ data . plugin } \n${ data . error } ` ) ;
255
264
}
256
265
257
266
// remove plugin from installed list
258
267
$ ( `#installed-plugins .${ data . plugin } ` ) . remove ( ) ;
259
268
269
+ window . console . log ( 'before emit getInstalled' , new Date ( ) )
260
270
socket . emit ( 'getInstalled' ) ;
261
271
262
272
// update search results
@@ -266,7 +276,9 @@ $(document).ready(() => {
266
276
} ) ;
267
277
268
278
socket . on ( 'connect' , ( ) => {
279
+ window . console . log ( 'socket connect' , new Date ( ) ) ;
269
280
updateHandlers ( ) ;
281
+ window . console . log ( 'before emit getInstalled' , new Date ( ) )
270
282
socket . emit ( 'getInstalled' ) ;
271
283
search . searchTerm = null ;
272
284
search ( $ ( '#search-query' ) . val ( ) ) ;
0 commit comments