style: convert var to let/const

ES6 syntax
This commit is contained in:
curben 2019-04-10 20:18:45 +09:30
parent 43bf50dac5
commit 55f5f11c2f
2 changed files with 6 additions and 6 deletions

View File

@ -21,7 +21,7 @@
"hexo-renderer-marked": "^0.3.2",
"hexo-renderer-stylus": "^0.3.3",
"hexo-server": "^0.3.3",
"hexo-yam": "^1.0.4"
"hexo-yam": "^1.2.0"
},
"devDependencies": {
"renovate": "^14.42.2",

View File

@ -5,7 +5,7 @@
// Don't insert fancybox element to cloudinary's cld-responsive img class
if ($(this).hasClass('cld-responsive') || $(this).parent().hasClass('fancybox')) return
var alt = this.alt
const alt = this.alt
if (alt) {
$(this).after('<span class="caption">' + alt + '</span>')
@ -24,10 +24,10 @@
}
// Add "Copy" button to code snippet
var code = document.getElementsByClassName('code')
const code = document.getElementsByClassName('code')
for (var i = 0; i < code.length; i++) {
var button = document.createElement('button')
for (let i = 0; i < code.length; i++) {
const button = document.createElement('button')
button.className = 'copy-button'
button.textContent = 'Copy'
@ -36,7 +36,7 @@
$(document).ready(function () {
// Add copy to clipboard button for code snippet
var copyCode = new ClipboardJS('.copy-button', {
const copyCode = new ClipboardJS('.copy-button', {
target: function (trigger) {
return trigger.previousElementSibling
}