Merge pull request #1150 from SISheogorath/fix/speakerdeck
Remove broken speakerdeck embedding
This commit is contained in:
commit
5274247790
3 changed files with 9 additions and 34 deletions
|
@ -222,9 +222,6 @@ When you’re a carpenter making a beautiful chest of drawers, you’re not goin
|
||||||
### SlideShare
|
### SlideShare
|
||||||
{%slideshare briansolis/26-disruptive-technology-trends-2016-2018-56796196 %}
|
{%slideshare briansolis/26-disruptive-technology-trends-2016-2018-56796196 %}
|
||||||
|
|
||||||
### Speakerdeck
|
|
||||||
{%speakerdeck sugarenia/xxlcss-how-to-scale-css-and-keep-your-sanity %}
|
|
||||||
|
|
||||||
### PDF
|
### PDF
|
||||||
**Caution: this might be blocked by your browser if not using an `https` URL.**
|
**Caution: this might be blocked by your browser if not using an `https` URL.**
|
||||||
{%pdf https://papers.nips.cc/paper/5346-sequence-to-sequence-learning-with-neural-networks.pdf %}
|
{%pdf https://papers.nips.cc/paper/5346-sequence-to-sequence-learning-with-neural-networks.pdf %}
|
||||||
|
|
|
@ -459,34 +459,13 @@ export function finishView (view) {
|
||||||
// speakerdeck
|
// speakerdeck
|
||||||
view.find('div.speakerdeck.raw').removeClass('raw')
|
view.find('div.speakerdeck.raw').removeClass('raw')
|
||||||
.each((key, value) => {
|
.each((key, value) => {
|
||||||
const url = `https://speakerdeck.com/oembed.json?url=https%3A%2F%2Fspeakerdeck.com%2F${encodeURIComponent($(value).attr('data-speakerdeckid'))}`
|
const url = `https://speakerdeck.com/${$(value).attr('data-speakerdeckid')}`
|
||||||
// use yql because speakerdeck not support jsonp
|
const inner = $('<a>Speakerdeck</a>')
|
||||||
$.ajax({
|
inner.attr('href', url)
|
||||||
url: 'https://query.yahooapis.com/v1/public/yql',
|
inner.attr('rel', 'noopener noreferrer')
|
||||||
data: {
|
inner.attr('target', '_blank')
|
||||||
q: `select * from json where url ='${url}'`,
|
$(value).append(inner)
|
||||||
format: 'json'
|
})
|
||||||
},
|
|
||||||
dataType: 'jsonp',
|
|
||||||
success (data) {
|
|
||||||
if (!data.query || !data.query.results) return
|
|
||||||
const json = data.query.results.json
|
|
||||||
const html = json.html
|
|
||||||
var ratio = json.height / json.width
|
|
||||||
$(value).html(html)
|
|
||||||
const iframe = $(value).children('iframe')
|
|
||||||
const src = iframe.attr('src')
|
|
||||||
if (src.indexOf('//') === 0) { iframe.attr('src', `https:${src}`) }
|
|
||||||
const inner = $('<div class="inner"></div>').append(iframe)
|
|
||||||
const height = iframe.attr('height')
|
|
||||||
const width = iframe.attr('width')
|
|
||||||
ratio = (height / width) * 100
|
|
||||||
inner.css('padding-bottom', `${ratio}%`)
|
|
||||||
$(value).html(inner)
|
|
||||||
if (window.viewAjaxCallback) window.viewAjaxCallback()
|
|
||||||
}
|
|
||||||
})
|
|
||||||
})
|
|
||||||
// pdf
|
// pdf
|
||||||
view.find('div.pdf.raw').removeClass('raw')
|
view.find('div.pdf.raw').removeClass('raw')
|
||||||
.each(function (key, value) {
|
.each(function (key, value) {
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
/* eslint-env browser, jquery */
|
/* eslint-env browser, jquery */
|
||||||
/* global CodeMirror, Cookies, moment, editor, ui, Spinner,
|
/* global CodeMirror, Cookies, moment, Spinner, Idle, serverurl,
|
||||||
modeType, Idle, serverurl, key, gapi, Dropbox, FilePicker
|
key, Dropbox, ot, hex2rgb, Visibility */
|
||||||
ot, MediaUploader, hex2rgb, num_loaded, Visibility */
|
|
||||||
|
|
||||||
require('../vendor/showup/showup')
|
require('../vendor/showup/showup')
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue