mirror of
https://github.com/status-im/codimd.git
synced 2025-01-28 06:54:49 +00:00
refactor: fix lint on public/js/slide.js
Signed-off-by: BoHong Li <raccoon@hackmd.io>
This commit is contained in:
parent
3505dcb1c8
commit
d3fc6f58e3
@ -26,7 +26,7 @@ function extend () {
|
|||||||
|
|
||||||
for (const source of arguments) {
|
for (const source of arguments) {
|
||||||
for (const key in source) {
|
for (const key in source) {
|
||||||
if (source.hasOwnProperty(key)) {
|
if (Object.hasOwnProperty.call(source, key)) {
|
||||||
target[key] = source[key]
|
target[key] = source[key]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -74,17 +74,17 @@ const defaultOptions = {
|
|||||||
const meta = JSON.parse($('#meta').text())
|
const meta = JSON.parse($('#meta').text())
|
||||||
var options = meta.slideOptions || {}
|
var options = meta.slideOptions || {}
|
||||||
|
|
||||||
if (options.hasOwnProperty('spotlight')) {
|
if (Object.hasOwnProperty.call(options, 'spotlight')) {
|
||||||
defaultOptions.dependencies.push({
|
defaultOptions.dependencies.push({
|
||||||
src: `${serverurl}/build/reveal.js/plugin/spotlight/spotlight.js`
|
src: `${serverurl}/build/reveal.js/plugin/spotlight/spotlight.js`
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
if (options.hasOwnProperty('allottedTime') || options.hasOwnProperty('allottedMinutes')) {
|
if (Object.hasOwnProperty.call(options, 'allottedTime') || Object.hasOwnProperty.call(options, 'allottedMinutes')) {
|
||||||
defaultOptions.dependencies.push({
|
defaultOptions.dependencies.push({
|
||||||
src: `${serverurl}/build/reveal.js/plugin/elapsed-time-bar/elapsed-time-bar.js`
|
src: `${serverurl}/build/reveal.js/plugin/elapsed-time-bar/elapsed-time-bar.js`
|
||||||
})
|
})
|
||||||
if (options.hasOwnProperty('allottedMinutes')) {
|
if (Object.hasOwnProperty.call(options, 'allottedMinutes')) {
|
||||||
options.allottedTime = options.allottedMinutes * 60 * 1000
|
options.allottedTime = options.allottedMinutes * 60 * 1000
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -123,14 +123,14 @@ window.viewAjaxCallback = () => {
|
|||||||
function renderSlide (event) {
|
function renderSlide (event) {
|
||||||
if (window.location.search.match(/print-pdf/gi)) {
|
if (window.location.search.match(/print-pdf/gi)) {
|
||||||
const slides = $('.slides')
|
const slides = $('.slides')
|
||||||
let title = document.title
|
const title = document.title
|
||||||
finishView(slides)
|
finishView(slides)
|
||||||
document.title = title
|
document.title = title
|
||||||
Reveal.layout()
|
Reveal.layout()
|
||||||
} else {
|
} else {
|
||||||
const markdown = $(event.currentSlide)
|
const markdown = $(event.currentSlide)
|
||||||
if (!markdown.attr('data-rendered')) {
|
if (!markdown.attr('data-rendered')) {
|
||||||
let title = document.title
|
const title = document.title
|
||||||
finishView(markdown)
|
finishView(markdown)
|
||||||
markdown.attr('data-rendered', 'true')
|
markdown.attr('data-rendered', 'true')
|
||||||
document.title = title
|
document.title = title
|
||||||
|
Loading…
x
Reference in New Issue
Block a user