@@ -169,6 +169,7 @@ function allIncluded(){
169169 <br>" + nextWeekUl + "<br><br>\
170170 <b>3. What is stopping me from doing my work?</b>\
171171 <p> " + userReason + "</p>" ;
172+ scrumBody . dispatchEvent ( new Event ( "paste" , { bubbles : true } ) ) ;
172173 } ) ;
173174 }
174175
@@ -202,7 +203,8 @@ function allIncluded(){
202203 date = "0" + date ;
203204 var dateCode = year . toString ( ) + month . toString ( ) + date . toString ( ) ;
204205 scrumSubject . value = "[Scrum] " + name + " - " + project + " - " + dateCode + " - False" ;
205- } , 2000 ) ;
206+ scrumSubject . dispatchEvent ( new Event ( "input" , { bubbles : true } ) ) ;
207+ } ) ;
206208 }
207209
208210 // write PRs Reviewed
@@ -320,44 +322,34 @@ function allIncluded(){
320322 }
321323 //check for scrum body loaded
322324 var intervalBody = setInterval ( function ( ) {
323- var scrumBody0 = document . getElementById ( "p-b-0" ) ;
324- var scrumBody1 = document . getElementById ( "p-b-1" ) ;
325- var scrumBody2 = document . getElementById ( "p-b-2" ) ;
326- if ( scrumBody0 ) {
327- clearInterval ( intervalBody ) ;
328- scrumBody = document . getElementById ( "p-b-0" ) ;
329- writeScrumBody ( ) ;
330- }
331- if ( scrumBody1 ) {
325+ var bodies = [
326+ document . getElementById ( "p-b-0" ) ,
327+ document . getElementById ( "p-b-1" ) ,
328+ document . getElementById ( "p-b-2" ) ,
329+ document . querySelector ( "c-wiz [aria-label='Compose a message'][role=textbox]" ) ] ;
330+ for ( var body of bodies ) {
331+ if ( ! body )
332+ continue ;
332333 clearInterval ( intervalBody ) ;
333- scrumBody = document . getElementById ( "p-b-1" ) ;
334- writeScrumBody ( ) ;
335- }
336- if ( scrumBody2 ) {
337- clearInterval ( intervalBody ) ;
338- scrumBody = document . getElementById ( "p-b-2" ) ;
334+ scrumBody = body ;
339335 writeScrumBody ( ) ;
340336 }
341337 } , 500 ) ;
342338
343339 //check for subject loaded
344340 var intervalSubject = setInterval ( function ( ) {
345- var scrumSubject0 = document . getElementById ( "p-s-0" ) ;
346- var scrumSubject1 = document . getElementById ( "p-s-1" ) ;
347- var scrumSubject2 = document . getElementById ( "p-s-2" ) ;
348- if ( scrumSubject0 && githubUserData ) {
349- clearInterval ( intervalSubject ) ;
350- scrumSubject = document . getElementById ( "p-s-0" ) ;
351- scrumSubjectLoaded ( ) ;
352- }
353- else if ( scrumSubject1 && githubUserData ) {
354- clearInterval ( intervalSubject ) ;
355- scrumSubject = document . getElementById ( "p-s-1" ) ;
356- scrumSubjectLoaded ( ) ;
357- }
358- else if ( scrumSubject2 && githubUserData ) {
341+ if ( ! githubUserData )
342+ return ;
343+ var subjects = [
344+ document . getElementById ( "p-s-0" ) ,
345+ document . getElementById ( "p-s-1" ) ,
346+ document . getElementById ( "p-s-2" ) ,
347+ document . querySelector ( "c-wiz input[aria-label=Subject]" ) ] ;
348+ for ( var subject of subjects ) {
349+ if ( ! subject )
350+ continue ;
359351 clearInterval ( intervalSubject ) ;
360- scrumSubject = document . getElementById ( "p-s-2" ) ;
352+ scrumSubject = subject ;
361353 scrumSubjectLoaded ( ) ;
362354 }
363355 } , 500 ) ;
@@ -399,4 +391,8 @@ function allIncluded(){
399391 allIncluded ( ) ;
400392 }
401393}
402- allIncluded ( ) ;
394+ allIncluded ( ) ;
395+
396+ $ ( "button>span:contains(New conversation)" ) . parent ( "button" ) . click ( function ( ) {
397+ allIncluded ( ) ;
398+ } ) ;
0 commit comments