@ -19,7 +19,7 @@ import initTableSort from './features/tablesort.js';
import ActivityTopAuthors from './components/ActivityTopAuthors.vue' ;
import { initNotificationsTable , initNotificationCount } from './features/notification.js' ;
import { createCodeEditor } from './features/codeeditor.js' ;
import { svgs } from './svg.js' ;
import { svg , svg s} from './svg.js' ;
const { AppSubUrl , StaticUrlPrefix , csrf } = window . config ;
@ -2017,23 +2017,18 @@ function initCodeView() {
}
} ) . trigger ( 'hashchange' ) ;
}
$ ( '.fold-code' ) . on ( 'click' , ( { target } ) => {
const box = target . closest ( '.file-content' ) ;
$ ( document ) . on ( 'click' , '.fold-file' , ( { curren tT arget} ) => {
const box = curren tT arget. closest ( '.file-content' ) ;
const folded = box . dataset . folded !== 'true' ;
target . classList . add ( ` fa-chevron- ${ folded ? 'right' : 'down' } ` ) ;
target . classList . remove ( ` fa-chevron- ${ folded ? 'down' : 'right' } ` ) ;
currentTarget . innerHTML = svg ( ` octicon-chevron- ${ folded ? 'right' : 'down' } ` , 18 ) ;
box . dataset . folded = String ( folded ) ;
} ) ;
function insertBlobExcerpt ( e ) {
const $blob = $ ( e . currentTarget ) ;
const $row = $blob . parent ( ) . parent ( ) ;
$ . get ( ` ${ $blob . data ( 'url' ) } ? ${ $blob . data ( 'query' ) } &anchor= ${ $blob . data ( 'anchor' ) } ` , ( blob ) => {
$row . replaceWith ( blob ) ;
$ ( ` [data-anchor=" ${ $blob . data ( 'anchor' ) } "] ` ) . on ( 'click' , ( e ) => { insertBlobExcerpt ( e ) } ) ;
$ ( document ) . on ( 'click' , '.blob-excerpt' , async ( { currentTarget } ) => {
const { url , query , anchor } = currentTarget . dataset ;
const blob = await $ . get ( ` ${ url } ? ${ query } &anchor= ${ anchor } ` ) ;
currentTarget . closest ( 'tr' ) . outerHTML = blob ;
} ) ;
}
$ ( '.ui.blob-excerpt' ) . on ( 'click' , ( e ) => { insertBlobExcerpt ( e ) } ) ;
}
function initU2FAuth ( ) {
if ( $ ( '#wait-for-key' ) . length === 0 ) {