Skip to content

Commit 5274247

Browse files
authored
Merge pull request #1150 from SISheogorath/fix/speakerdeck
Remove broken speakerdeck embedding
2 parents 0d88707 + 1f0fb12 commit 5274247

File tree

3 files changed

+9
-34
lines changed

3 files changed

+9
-34
lines changed

public/docs/features.md

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -222,9 +222,6 @@ When you’re a carpenter making a beautiful chest of drawers, you’re not goin
222222
### SlideShare
223223
{%slideshare briansolis/26-disruptive-technology-trends-2016-2018-56796196 %}
224224

225-
### Speakerdeck
226-
{%speakerdeck sugarenia/xxlcss-how-to-scale-css-and-keep-your-sanity %}
227-
228225
### PDF
229226
**Caution: this might be blocked by your browser if not using an `https` URL.**
230227
{%pdf https://papers.nips.cc/paper/5346-sequence-to-sequence-learning-with-neural-networks.pdf %}

public/js/extra.js

Lines changed: 7 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -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) {

public/js/index.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
/* eslint-env browser, jquery */
2-
/* global CodeMirror, Cookies, moment, editor, ui, Spinner,
3-
modeType, Idle, serverurl, key, gapi, Dropbox, FilePicker
4-
ot, MediaUploader, hex2rgb, num_loaded, Visibility */
2+
/* global CodeMirror, Cookies, moment, Spinner, Idle, serverurl,
3+
key, Dropbox, ot, hex2rgb, Visibility */
54

65
require('../vendor/showup/showup')
76

0 commit comments

Comments
 (0)