@@ -756,17 +756,23 @@ function loadSearchResult(ev) {
756756function addSearchLinks ( ) {
757757 let orig_url = window . location . pathname ;
758758 let orig_url_ar = orig_url . split ( '/' ) ;
759- $ ( '.add-search-link' ) . each ( function ( ) {
760- let link_ar = this . getAttribute ( 'href' ) . split ( '/' ) ;
761- let new_url_ar = [ ...orig_url_ar ] ;
762- new_url_ar [ 1 ] = link_ar [ 1 ] ;
763- new_url_ar [ 5 ] = link_ar [ 3 ] ;
764- let new_url = new_url_ar . join ( '/' ) ;
765- this . setAttribute ( 'href' , new_url + window . location . search ) ;
766- this . setAttribute ( 'data-dict' , link_ar [ 1 ] ) ;
767- this . setAttribute ( 'data-entryid' , link_ar [ 3 ] ) ;
768- this . setAttribute ( 'onclick' , 'return loadSearchResult(this)' ) ;
769- } )
759+ if ( ! orig_url . includes ( '/show/' ) ) {
760+ $ ( '.add-search-link,.video-link' ) . each ( function ( ) {
761+ if ( this . getAttribute ( 'href' ) != '' && this . getAttribute ( 'href' ) . includes ( '/show/' ) ) {
762+ let link_ar = this . getAttribute ( 'href' ) . split ( '/' ) ;
763+ let new_url_ar = [ ...orig_url_ar ] ;
764+ new_url_ar [ 1 ] = link_ar [ 1 ] ;
765+ new_url_ar [ 5 ] = link_ar [ 3 ] ;
766+ let new_url = new_url_ar . join ( '/' ) ;
767+ this . setAttribute ( 'href' , new_url + window . location . search ) ;
768+ this . setAttribute ( 'data-dict' , link_ar [ 1 ] ) ;
769+ this . setAttribute ( 'data-entryid' , link_ar [ 3 ] ) ;
770+ if ( ! $ ( this ) . hasClass ( 'video-link' ) ) {
771+ this . setAttribute ( 'onclick' , 'return loadSearchResult(this)' ) ;
772+ }
773+ }
774+ } )
775+ }
770776}
771777
772778// run translation on document load
0 commit comments