Skip to content

Commit

Permalink
fix history reduant elements 🐛
Browse files Browse the repository at this point in the history
  • Loading branch information
madneal committed Feb 12, 2018
1 parent 1fd2160 commit 22a1f8d
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
8 changes: 8 additions & 0 deletions gulpfile.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
const fs = require('fs')
const zipDir = 'export-to-markdown'

gulp.task('createDir', function() {
fs.mkdirSync(zipDir, 0755)
fs.mkdirSync(zipDir + '/icons', 0755)
fs.mkdirSync(zipDir + '/scripts', 0755)
})
8 changes: 5 additions & 3 deletions scripts/widget.js
Original file line number Diff line number Diff line change
Expand Up @@ -105,9 +105,11 @@ function displayHistory() {
let list = ''
for (const ele in localStorage) {
const title = ele
const url = localStorage.getItem(title)
const str = '* [' + title + '](' + url + ') ![trash](icons/trash-can.png)\n'
list = list + str
if (localStorage.hasOwnProperty(ele)) {
const url = localStorage.getItem(title)
const str = '* [' + title + '](' + url + ') ![trash](icons/trash-can.png)\n'
list = list + str
}
}
rightAreaDiv.innerHTML = snarkdown(list)
rightAreaDiv.querySelector('ul').className = 'history-list'
Expand Down

0 comments on commit 22a1f8d

Please sign in to comment.