File tree Expand file tree Collapse file tree 1 file changed +29
-0
lines changed Expand file tree Collapse file tree 1 file changed +29
-0
lines changed Original file line number Diff line number Diff line change @@ -167,6 +167,19 @@ <h4 class="list-group-item-heading">
167167 } ) ;
168168 }
169169
170+ function selectGroup ( $scope , selectedGroup ) {
171+ var groups = $scope . groups ;
172+ for ( var group in groups ) {
173+ if ( groups . hasOwnProperty ( group ) ) {
174+ if ( group === selectedGroup ) {
175+ groups [ group ] = true ;
176+ } else {
177+ groups [ group ] = false ;
178+ }
179+ }
180+ }
181+ }
182+
170183 angular . module ( "clippy" , [ ] )
171184 . filter ( 'markdown' , function ( $sce ) {
172185 return function ( text ) {
@@ -223,6 +236,11 @@ <h4 class="list-group-item-heading">
223236 return result ;
224237 } , { } ) ;
225238
239+ var selectedGroup = getQueryVariable ( "sel" ) ;
240+ if ( selectedGroup ) {
241+ selectGroup ( $scope , selectedGroup . toLowerCase ( ) ) ;
242+ }
243+
226244 scrollToLintByURL ( $scope ) ;
227245 } )
228246 . error ( function ( data ) {
@@ -243,6 +261,17 @@ <h4 class="list-group-item-heading">
243261 } , false ) ;
244262 } ) ;
245263 } ) ( ) ;
264+
265+ function getQueryVariable ( variable ) {
266+ var query = window . location . search . substring ( 1 ) ;
267+ var vars = query . split ( '&' ) ;
268+ for ( var i = 0 ; i < vars . length ; i ++ ) {
269+ var pair = vars [ i ] . split ( '=' ) ;
270+ if ( decodeURIComponent ( pair [ 0 ] ) == variable ) {
271+ return decodeURIComponent ( pair [ 1 ] ) ;
272+ }
273+ }
274+ }
246275 </ script >
247276</ body >
248277</ html >
You can’t perform that action at this time.
0 commit comments