@ -96,16 +96,9 @@ app.views.EntryPage = class EntryPage extends app.View {
return content ;
return content ;
}
}
const links = ( ( ) => {
const links = Object . entries ( this . entry . doc . links ) . map ( ( [ link , url ] ) => {
const result = [ ] ;
return ` <a href=" ${ url } " class="_links-link"> ${ EntryPage . LINKS [ link ] } </a> ` ;
for ( var link in this . entry . doc . links ) {
} ) ;
var url = this . entry . doc . links [ link ] ;
result . push (
` <a href=" ${ url } " class="_links-link"> ${ EntryPage . LINKS [ link ] } </a> ` ,
) ;
}
return result ;
} ) ( ) ;
return ` <p class="_links"> ${ links . join ( "" ) } </p> ${ content } ` ;
return ` <p class="_links"> ${ links . join ( "" ) } </p> ${ content } ` ;
}
}
@ -203,8 +196,8 @@ app.views.EntryPage = class EntryPage extends app.View {
}
}
restore ( ) {
restore ( ) {
let path ;
const path = this . entry . filePath ( ) ;
if ( this . cacheMap [ (path = this . entry . filePath ( ) ) ] ) {
if ( this . cacheMap [ [path ] ] ) {
this . render ( this . cacheMap [ path ] , true ) ;
this . render ( this . cacheMap [ path ] , true ) ;
return true ;
return true ;
}
}
@ -217,18 +210,17 @@ app.views.EntryPage = class EntryPage extends app.View {
this . load ( ) ;
this . load ( ) ;
} else if ( target . classList . contains ( "_pre-clip" ) ) {
} else if ( target . classList . contains ( "_pre-clip" ) ) {
$ . stopEvent ( event ) ;
$ . stopEvent ( event ) ;
target . classList . add (
navigator . clipboard . writeText ( target . parentNode . textContent ) . then (
$ . copyToClipboard ( target . parentNode . textContent )
( ) => target . classList . add ( "_pre-clip-success" ) ,
? "_pre-clip-success"
( ) => target . classList . add ( "_pre-clip-error" ) ,
: "_pre-clip-error" ,
) ;
) ;
setTimeout ( ( ) => ( target . className = "_pre-clip" ) , 2000 ) ;
setTimeout ( ( ) => ( target . className = "_pre-clip" ) , 2000 ) ;
}
}
}
}
onAltC ( ) {
onAltC ( ) {
let link ;
const link = this . find ( "._attribution:last-child ._attribution-link" ) ;
if ( ! ( link = this . find ( "._attribution:last-child ._attribution-link" ) ) ) {
if ( ! link ) {
return ;
return ;
}
}
console . log ( link . href + location . hash ) ;
console . log ( link . href + location . hash ) ;
@ -236,8 +228,8 @@ app.views.EntryPage = class EntryPage extends app.View {
}
}
onAltO ( ) {
onAltO ( ) {
let link ;
const link = this . find ( "._attribution:last-child ._attribution-link" ) ;
if ( ! ( link = this . find ( "._attribution:last-child ._attribution-link" ) ) ) {
if ( ! link ) {
return ;
return ;
}
}
this . delay ( ( ) => $ . popup ( link . href + location . hash ) ) ;
this . delay ( ( ) => $ . popup ( link . href + location . hash ) ) ;