@@ -5,7 +5,8 @@ var drawingArea;
55var width ;
66var height ;
77var volume = 0.6 ;
8- var ULTIMATE_DREAM_KILLER = false ;
8+ var ULTIMATE_DREAM_KILLER = false ; // https://github.com/debugger22/github-audio/pull/19
9+ var orgRepoFilterNames ;
910
1011var scale_factor = 6 ,
1112 note_overlap = 2 ,
@@ -22,8 +23,7 @@ var svg_background_color_online = '#0288D1',
2223 pull_request_color = 'rgb(46, 204, 113)' ,
2324 comment_color = 'rgb(46, 204, 113)'
2425 edit_color = '#fff' ,
25- total_sounds = 51 ,
26- total_edits = 0 ;
26+ total_sounds = 51 ;
2727
2828 var celesta = [ ] ,
2929 clav = [ ] ,
@@ -37,7 +37,16 @@ socket.on('github', function (data) {
3737 $ ( '.online-users-count' ) . html ( data . connected_users ) ;
3838 data . data . forEach ( function ( event ) {
3939 if ( ! isEventInQueue ( event ) ) {
40- eventQueue . push ( event ) ;
40+ // Filter out events only specified by the user
41+ if ( orgRepoFilterNames != null && orgRepoFilterNames != [ ] ) {
42+ // Don't consider pushes to github.io repos when org filter is on
43+ if ( new RegExp ( orgRepoFilterNames . join ( "|" ) ) . test ( event . repo_name )
44+ && event . repo_name . indexOf ( 'github.io' ) == - 1 ) {
45+ eventQueue . push ( event ) ;
46+ }
47+ } else {
48+ eventQueue . push ( event ) ;
49+ }
4150 }
4251 } ) ;
4352 // Don't let the eventQueue grow more than 1000
@@ -123,12 +132,6 @@ $(function(){
123132 }
124133 } ) ;
125134
126- $ ( '#eventConsumptionSlider' ) . slider ( {
127- 'min' : 1 ,
128- 'max' : 100
129- } ) ;
130-
131-
132135 // Main drawing area
133136 svg = d3 . select ( "#area" ) . append ( "svg" ) ;
134137 svg . attr ( { width : width , height : height } ) ;
@@ -192,6 +195,11 @@ $(function(){
192195 // Make header and footer visible
193196 $ ( 'body' ) . css ( 'visibility' , 'visible' ) ;
194197
198+ $ ( '#org-repo-filter-name' ) . on ( 'input' , function ( ) {
199+ orgRepoFilterNames = $ ( '#org-repo-filter-name' ) . val ( ) . split ( ' ' ) ;
200+ eventQueue = [ ] ;
201+ } ) ;
202+
195203} ) ;
196204
197205
@@ -238,8 +246,8 @@ function playFromQueueExchange1(){
238246 var event = eventQueue . shift ( ) ;
239247 if ( event != null && event . message != null && ! shouldEventBeIgnored ( event ) && svg != null ) {
240248 playSound ( event . message . length * 1.1 , event . type ) ;
241- if ( ! document . hidden )
242- drawEvent ( event , svg ) ;
249+ // if(!document.hidden)
250+ drawEvent ( event , svg ) ;
243251 }
244252 setTimeout ( playFromQueueExchange1 , Math . floor ( Math . random ( ) * 1000 ) + 500 ) ;
245253 $ ( '.events-remaining-value' ) . html ( eventQueue . length ) ;
@@ -249,8 +257,8 @@ function playFromQueueExchange2(){
249257 var event = eventQueue . shift ( ) ;
250258 if ( event != null && event . message != null && ! shouldEventBeIgnored ( event ) && svg != null ) {
251259 playSound ( event . message . length , event . type ) ;
252- if ( ! document . hidden )
253- drawEvent ( event , svg ) ;
260+ // if(!document.hidden)
261+ drawEvent ( event , svg ) ;
254262 }
255263 setTimeout ( playFromQueueExchange2 , Math . floor ( Math . random ( ) * 800 ) + 500 ) ;
256264 $ ( '.events-remaining-value' ) . html ( eventQueue . length ) ;
0 commit comments