File tree 1 file changed +29
-0
lines changed
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">
167
167
} ) ;
168
168
}
169
169
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
+
170
183
angular . module ( "clippy" , [ ] )
171
184
. filter ( 'markdown' , function ( $sce ) {
172
185
return function ( text ) {
@@ -223,6 +236,11 @@ <h4 class="list-group-item-heading">
223
236
return result ;
224
237
} , { } ) ;
225
238
239
+ var selectedGroup = getQueryVariable ( "sel" ) ;
240
+ if ( selectedGroup ) {
241
+ selectGroup ( $scope , selectedGroup . toLowerCase ( ) ) ;
242
+ }
243
+
226
244
scrollToLintByURL ( $scope ) ;
227
245
} )
228
246
. error ( function ( data ) {
@@ -243,6 +261,17 @@ <h4 class="list-group-item-heading">
243
261
} , false ) ;
244
262
} ) ;
245
263
} ) ( ) ;
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
+ }
246
275
</ script >
247
276
</ body >
248
277
</ html >
You can’t perform that action at this time.
0 commit comments