gitbook-plugin-lock
Advanced tools
Comparing version 0.0.54 to 0.0.55
@@ -9,7 +9,10 @@ require(['gitbook', 'jQuery'], function(gitbook, $) { | ||
const lockTokenKey = "lock-token" | ||
function insertPageLock() { | ||
let authToken= localStorage.getItem("lock-token") | ||
let authToken= localStorage.getItem(lockTokenKey) | ||
if (authToken!==isNaN(0)||authToken!==""||authToken!==undefined) { | ||
for (let i in verificationCode) { | ||
console.log(i,verificationCode[i]["value"],"---->") | ||
if (verificationCode[i]["value"] === authToken) { | ||
@@ -22,11 +25,5 @@ return true; | ||
const cla = document.getElementById("book-search-results"); | ||
// console.log(cla,"看看cla是啥") | ||
// 文章的实际高度 | ||
const article = cla, height = article.scrollHeight; | ||
// console.log(article,"看看",height) | ||
// 文章隐藏后的高度 | ||
const halfHeight = height * 0.5; | ||
// console.log("看看---->",halfHeight) | ||
cla.style.height= halfHeight + 'px'; | ||
@@ -64,3 +61,3 @@ cla.style.overflow = 'hidden' | ||
const val = document.getElementById('btw-modal-input').value | ||
alert(val+typeof val+thisValue) | ||
// alert(val+typeof val+thisValue) | ||
if (val === thisValue) { | ||
@@ -71,2 +68,5 @@ cla.style.height= height + 'px'; | ||
rm.parentNode.removeChild(rm) | ||
localStorage.setItem(lockTokenKey,thisValue) | ||
} else { | ||
alert("验证码不正确!") | ||
} | ||
@@ -73,0 +73,0 @@ } |
{ | ||
"name": "gitbook-plugin-lock", | ||
"version": "0.0.54", | ||
"version": "0.0.55", | ||
"description": "Gitbook 页面加锁", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
7260
112