New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

gitbook-plugin-lock

Package Overview
Dependencies
Maintainers
1
Versions
84
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

gitbook-plugin-lock - npm Package Compare versions

Comparing version 0.0.55 to 0.0.56

16

assets/lock.js

@@ -11,8 +11,8 @@ require(['gitbook', 'jQuery'], function(gitbook, $) {

function insertPageLock() {
function insertPageLock(e) {
let s = e.page.context.toString().search("%pageLock%")
console.log(s,e.page.toString())
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) {

@@ -83,13 +83,9 @@ return true;

thisValue = verificationCode[rand]["value"]
console.log(rand,"+",thisCode,"+",thisValue)
// console.log(rand,"+",thisCode,"+",thisValue)
// insertPageLock();
});
gitbook.events.bind('page.change', function(e,config) {
insertPageLock();
gitbook.events.bind('page.change', function(e) {
insertPageLock(e);
});
});

@@ -10,3 +10,25 @@ module.exports = {

]
},
hooks: {
page: formater
}
};
function formater (page) {
const html = `<div id="read-more-wrap" style="position: absolute; bottom: 0; z-index: 9999; width: 100%; margin-top: -100px; font-family: PingFangSC-Regular, sans-serif;"><div id="read-more-mask" style="position: relative; height: 200px; background: -webkit-gradient(linear, 0 0%, 0 100%, from(rgba(255, 255, 255, 0)), to(rgb(255, 255, 255)));"></div><div class="info" style="position: absolute;left: 50%;top: 70%;bottom: 30px;transform: translate(-50%, -50%);font-size: 15px;text-align: center;background: -webkit-gradient(linear, 0 0%, 0 100%, from(rgba(255, 255, 255, 0)), to(rgb(255, 255, 255)));">\n <div>扫码或搜索:<span style="color: #E9405A; font-weight: bold;">${wechatName}</span></div>\n <div>\n <span>发送 </span><span class="token" style="color: #e9415a; font-weight: bold; font-size: 17px; margin-bottom: 45px;">${thisCode}</span>\n </div>\n <div>\n 即可<span style="color: #e9415a; font-weight: bold;">立即永久</span>解锁本站全部文章\n </div>\n <div id="btw-modal-input-code" style="margin-top: 20px; background: rgb(255, 255, 255);"><input id="btw-modal-input" type="text" maxLength="10" placeholder="请输入验证码" style="width: 160px; height: 32px; line-height: 32px; padding: 0 10px; margin: 0 10px; font-size: 13px; text-rendering: auto; text-transform: none; cursor: text; outline: none; box-sizing: border-box; border: 1px solid rgb(221, 221, 221); appearance: textfield; background-color: white; -webkit-rtl-ordering: logical;"> <button onclick="bc()" id="btw-submit-btn" style="padding: 0 20px; height: 32px; font-size: 14px; outline: none; border: none; color: rgb(255, 255, 255); background: rgb(222, 104, 109); cursor: pointer;">提 交 </button></div>\n <div>\n <img class="code-img" style="width: 300px;display:unset" src="${wechatQr}">\n </div>\n</div></div>`;
let authToken= localStorage.getItem(lockTokenKey)
if (authToken!==isNaN(0)||authToken!==""||authToken!==undefined) {
for (let i in verificationCode) {
if (verificationCode[i]["value"] === authToken) {
return true;
}
}
}
page.content = page.content
.replace(new RegExp('%pageLock%', "g"),
html
);
return page;
};
{
"name": "gitbook-plugin-lock",
"version": "0.0.55",
"version": "0.0.56",
"description": "Gitbook 页面加锁",

@@ -5,0 +5,0 @@ "main": "index.js",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc