@@ -459,34 +459,13 @@ export function finishView (view) {
459459 // speakerdeck
460460 view . find ( 'div.speakerdeck.raw' ) . removeClass ( 'raw' )
461461 . each ( ( key , value ) => {
462- const url = `https://speakerdeck.com/oembed.json?url=https%3A%2F%2Fspeakerdeck.com%2F${ encodeURIComponent ( $ ( value ) . attr ( 'data-speakerdeckid' ) ) } `
463- // use yql because speakerdeck not support jsonp
464- $ . ajax ( {
465- url : 'https://query.yahooapis.com/v1/public/yql' ,
466- data : {
467- q : `select * from json where url ='${ url } '` ,
468- format : 'json'
469- } ,
470- dataType : 'jsonp' ,
471- success ( data ) {
472- if ( ! data . query || ! data . query . results ) return
473- const json = data . query . results . json
474- const html = json . html
475- var ratio = json . height / json . width
476- $ ( value ) . html ( html )
477- const iframe = $ ( value ) . children ( 'iframe' )
478- const src = iframe . attr ( 'src' )
479- if ( src . indexOf ( '//' ) === 0 ) { iframe . attr ( 'src' , `https:${ src } ` ) }
480- const inner = $ ( '<div class="inner"></div>' ) . append ( iframe )
481- const height = iframe . attr ( 'height' )
482- const width = iframe . attr ( 'width' )
483- ratio = ( height / width ) * 100
484- inner . css ( 'padding-bottom' , `${ ratio } %` )
485- $ ( value ) . html ( inner )
486- if ( window . viewAjaxCallback ) window . viewAjaxCallback ( )
487- }
488- } )
489- } )
462+ const url = `https://speakerdeck.com/${ $ ( value ) . attr ( 'data-speakerdeckid' ) } `
463+ const inner = $ ( '<a>Speakerdeck</a>' )
464+ inner . attr ( 'href' , url )
465+ inner . attr ( 'rel' , 'noopener noreferrer' )
466+ inner . attr ( 'target' , '_blank' )
467+ $ ( value ) . append ( inner )
468+ } )
490469 // pdf
491470 view . find ( 'div.pdf.raw' ) . removeClass ( 'raw' )
492471 . each ( function ( key , value ) {
0 commit comments