@ -11,12 +11,12 @@ import './vendor/semanticdropdown.js';
import { svg } from './utils.js' ;
import { svg } from './utils.js' ;
import initContextPopups from './features/contextpopup.js' ;
import initContextPopups from './features/contextpopup.js' ;
import initHighlight from './features/highlight.js' ;
import initGitGraph from './features/gitgraph.js' ;
import initGitGraph from './features/gitgraph.js' ;
import initClipboard from './features/clipboard.js' ;
import initClipboard from './features/clipboard.js' ;
import initUserHeatmap from './features/userheatmap.js' ;
import initUserHeatmap from './features/userheatmap.js' ;
import initDateTimePicker from './features/datetimepicker.js' ;
import initDateTimePicker from './features/datetimepicker.js' ;
import createDropzone from './features/dropzone.js' ;
import createDropzone from './features/dropzone.js' ;
import highlight from './features/highlight.js' ;
import ActivityTopAuthors from './components/ActivityTopAuthors.vue' ;
import ActivityTopAuthors from './components/ActivityTopAuthors.vue' ;
const { AppSubUrl , StaticUrlPrefix , csrf } = window . config ;
const { AppSubUrl , StaticUrlPrefix , csrf } = window . config ;
@ -29,7 +29,6 @@ let previewFileModes;
let simpleMDEditor ;
let simpleMDEditor ;
const commentMDEditors = { } ;
const commentMDEditors = { } ;
let codeMirrorEditor ;
let codeMirrorEditor ;
let hljs ;
// Silence fomantic's error logging when tabs are used without a target content element
// Silence fomantic's error logging when tabs are used without a target content element
$ . fn . tab . settings . silent = true ;
$ . fn . tab . settings . silent = true ;
@ -49,7 +48,7 @@ function initCommentPreviewTab($form) {
$previewPanel . html ( data ) ;
$previewPanel . html ( data ) ;
emojify . run ( $previewPanel [ 0 ] ) ;
emojify . run ( $previewPanel [ 0 ] ) ;
$ ( 'pre code' , $previewPanel [ 0 ] ) . each ( function ( ) {
$ ( 'pre code' , $previewPanel [ 0 ] ) . each ( function ( ) {
hljs . h ighlightBlock ( this ) ;
highlight ( this ) ;
} ) ;
} ) ;
} ) ;
} ) ;
} ) ;
} ) ;
@ -75,7 +74,7 @@ function initEditPreviewTab($form) {
$previewPanel . html ( data ) ;
$previewPanel . html ( data ) ;
emojify . run ( $previewPanel [ 0 ] ) ;
emojify . run ( $previewPanel [ 0 ] ) ;
$ ( 'pre code' , $previewPanel [ 0 ] ) . each ( function ( ) {
$ ( 'pre code' , $previewPanel [ 0 ] ) . each ( function ( ) {
hljs . h ighlightBlock ( this ) ;
highlight ( this ) ;
} ) ;
} ) ;
} ) ;
} ) ;
} ) ;
} ) ;
@ -1011,7 +1010,7 @@ async function initRepository() {
$renderContent . html ( data . content ) ;
$renderContent . html ( data . content ) ;
emojify . run ( $renderContent [ 0 ] ) ;
emojify . run ( $renderContent [ 0 ] ) ;
$ ( 'pre code' , $renderContent [ 0 ] ) . each ( function ( ) {
$ ( 'pre code' , $renderContent [ 0 ] ) . each ( function ( ) {
hljs . h ighlightBlock ( this ) ;
highlight ( this ) ;
} ) ;
} ) ;
}
}
const $content = $segment . parent ( ) ;
const $content = $segment . parent ( ) ;
@ -1337,7 +1336,7 @@ function initWikiForm() {
preview . innerHTML = ` <div class="markdown ui segment"> ${ data } </div> ` ;
preview . innerHTML = ` <div class="markdown ui segment"> ${ data } </div> ` ;
emojify . run ( $ ( '.editor-preview' ) [ 0 ] ) ;
emojify . run ( $ ( '.editor-preview' ) [ 0 ] ) ;
$ ( preview ) . find ( 'pre code' ) . each ( ( _ , e ) => {
$ ( preview ) . find ( 'pre code' ) . each ( ( _ , e ) => {
hljs . h ighlightBlock ( e ) ;
highlight ( e ) ;
} ) ;
} ) ;
} ) ;
} ) ;
} ;
} ;
@ -2633,8 +2632,8 @@ $(document).ready(async () => {
} ) ;
} ) ;
// parallel init of lazy-loaded features
// parallel init of lazy-loaded features
[ hljs ] = await Promise . all ( [
initHighlight ( ) ,
await Promise . all ( [
highlight ( document . querySelectorAll ( 'pre code' ) ) ,
initGitGraph ( ) ,
initGitGraph ( ) ,
initClipboard ( ) ,
initClipboard ( ) ,
initUserHeatmap ( ) ,
initUserHeatmap ( ) ,