mirror of
https://github.com/Kenshin/simpread.git
synced 2026-02-01 15:41:29 +00:00
Merge branch 'feature/source-optimize-xvii-2' into develop
This commit is contained in:
commit
bb01ba5120
@ -55,7 +55,7 @@
|
||||
*  全新的 `词法分析引擎`,更智能、更精准的提取正文,辅以精准适配,任意网页均「不在话下」,不仅能自动识别出 Wordpress · Hexo · Ghost · Discuz 等博客 / 论坛的页面,甚至于只要是结构良好的页面,(无需适配)自动生成阅读模式,详细请看 [词法分析引擎](http://ksria.com/simpread/docs/#/词法分析引擎)
|
||||
|
||||
- 站点适配源:
|
||||
包括:`官方(主)适配源` `第三方适配源` `站点集市适配源` `自定义适配源`,详细请看 [站点适配源](http://ksria.com/simpread/docs/#/站点适配源)
|
||||
包括:`官方适配源` `第三方适配源` `站点集市适配源` `自定义适配源`,详细请看 [站点适配源](http://ksria.com/simpread/docs/#/站点适配源)
|
||||
|
||||
- 站点编辑器:
|
||||
页面任意元素,均可隐藏,`可编程,定制化`,详细请看 [站点编辑器](http://ksria.com/simpread/docs/#/站点编辑器)
|
||||
@ -128,7 +128,7 @@
|
||||
|
||||
* 方式3:通过 **新增站点编辑器** 的方式(适合逐一添加单个新站),详细说明 [请看这里](http://ksria.com/simpread/docs/#/站点编辑器?id=如何新增修改);
|
||||
|
||||
* 方式4:通过 **提交适配源** 的方式(适合同时添加多个新站),详细说明请看 [使用自定义适配源](http://ksria.com/simpread/docs/#/站点适配源?id=如何提交到简悦的官方(次)适配源)
|
||||
* 方式4:通过 **提交适配源** 的方式(适合同时添加多个新站),详细说明请看 [使用自定义适配源](http://ksria.com/simpread/docs/#/如何提交第三方适配源);
|
||||
|
||||
* 更多说明请看 [站点编辑器](http://ksria.com/simpread/docs/#/站点编辑器) [站点管理](http://ksria.com/simpread/docs/#/站点管理器) [站点适配源](http://ksria.com/simpread/docs/#/站点适配源);
|
||||
|
||||
|
||||
@ -1,422 +0,0 @@
|
||||
|
||||
/**
|
||||
* Option: Focus/Read mode
|
||||
*/
|
||||
sr-opt-focus,
|
||||
sr-opt-read {
|
||||
display: -webkit-flex;
|
||||
flex-direction:column;
|
||||
|
||||
width: 100%;
|
||||
/*height: 100%;*/
|
||||
}
|
||||
|
||||
sr-opt-gp {
|
||||
display: -webkit-flex;
|
||||
position: relative;
|
||||
|
||||
flex-flow:row nowrap;
|
||||
justify-content:flex-start;
|
||||
|
||||
width: 100%;
|
||||
margin-bottom: 25px;
|
||||
|
||||
font-size: 15px;
|
||||
}
|
||||
|
||||
sr-opt-gp sr-opt-label {
|
||||
display: block;
|
||||
position: absolute;
|
||||
|
||||
margin: -8px 0 0 0;
|
||||
|
||||
font-size: 14px;
|
||||
font-weight: bold;
|
||||
|
||||
color: rgba(0, 137, 123, .8);
|
||||
|
||||
user-select: none;
|
||||
pointer-events: none;
|
||||
|
||||
transform: scale(0.75) translate( 0px, -8px );
|
||||
transform-origin: left top 0px;
|
||||
}
|
||||
|
||||
sr-opt-themes {
|
||||
display: -webkit-flex;
|
||||
flex-flow:row nowrap;
|
||||
justify-content:space-between;
|
||||
|
||||
width: 100%;
|
||||
/*height: 100%;*/
|
||||
|
||||
margin: 8px 0 17px;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
sr-opt-theme {
|
||||
width: 40px;
|
||||
height: 20px;
|
||||
|
||||
cursor: pointer;
|
||||
list-style: none;
|
||||
|
||||
border-radius: 3px;
|
||||
border: 1px solid #212121;
|
||||
box-sizing: border-box;
|
||||
|
||||
opacity: 1;
|
||||
transition: all 500ms opacity 1s cubic-bezier(0.23, 1, 0.32, 1) 0ms;
|
||||
}
|
||||
|
||||
sr-opt-theme:hover {
|
||||
opacity: .2;
|
||||
box-shadow: 0 2px 2px 0 rgba(0,0,0,0.14),0 1px 5px 0 rgba(0,0,0,0.12),0 3px 1px -2px rgba(0,0,0,0.2);
|
||||
}
|
||||
|
||||
sr-opt-theme:not(:first-child) {
|
||||
margin-left: 5px;
|
||||
}
|
||||
|
||||
sr-opt-theme[sr-type="active"] {
|
||||
box-shadow: 0 3px 3px 0 rgba(0,0,0,0.14),0 2px 20px 0 rgba(0,0,0,0.12),0 3px 1px -2px rgba(0,0,0,0.7);
|
||||
}
|
||||
|
||||
/**
|
||||
* Notice bubbles
|
||||
*/
|
||||
.bubbles {
|
||||
position: fixed;
|
||||
bottom: 20px;
|
||||
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-content: center;
|
||||
|
||||
padding: 10px;
|
||||
|
||||
width: 55px;
|
||||
height: 56px;
|
||||
|
||||
border-radius: 50%;
|
||||
|
||||
box-shadow: 0 2px 6px 0 rgba(0,0,0,.4);
|
||||
|
||||
cursor: pointer;
|
||||
transition: all 500ms cubic-bezier(0.23, 1, 0.32, 1) 0ms;
|
||||
}
|
||||
|
||||
.bubbles.notice {
|
||||
right: 94px;
|
||||
background-color: #16666f;
|
||||
}
|
||||
|
||||
.notice:hover {
|
||||
background-color: rgba(22, 102, 111, .8);
|
||||
}
|
||||
|
||||
.bubbles i {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.bubbles em {
|
||||
position: absolute;
|
||||
top: 6px;
|
||||
right: 11px;
|
||||
|
||||
width: 18px;
|
||||
height: 18px;
|
||||
line-height: 18px;
|
||||
|
||||
color: #fff;
|
||||
background-color: #e54545;
|
||||
|
||||
font-weight: bold;
|
||||
text-align: center;
|
||||
font-style: initial;
|
||||
border-radius: 50%;
|
||||
}
|
||||
|
||||
.bubbles em.init {
|
||||
line-height: 9px;
|
||||
}
|
||||
|
||||
.bubbles.effect {
|
||||
animation-name: popup;
|
||||
animation-duration: 1s;
|
||||
}
|
||||
|
||||
/**
|
||||
* Help bubbles
|
||||
*/
|
||||
.bubbles.help {
|
||||
right: 24px;
|
||||
background-color: #607D8B;
|
||||
}
|
||||
|
||||
.help:hover {
|
||||
background-color: rgba(96, 125, 139, .8);
|
||||
}
|
||||
|
||||
@keyframes popup {
|
||||
0% {
|
||||
opacity: 0;
|
||||
-webkit-transform: translateY(20px);
|
||||
transform: translateY(20px)
|
||||
}
|
||||
|
||||
100% {
|
||||
opacity: 1;
|
||||
-webkit-transform: translateY(0);
|
||||
transform: translateY(0)
|
||||
}
|
||||
}
|
||||
|
||||
@keyframes popdown {
|
||||
0% {
|
||||
opacity: 0;
|
||||
transform: translateY(-20px)
|
||||
}
|
||||
|
||||
100% {
|
||||
opacity: 1;
|
||||
transform: translateY(0)
|
||||
}
|
||||
}
|
||||
|
||||
@keyframes popclose {
|
||||
0% {
|
||||
opacity: 1;
|
||||
transform: translateY(0px)
|
||||
}
|
||||
|
||||
100% {
|
||||
opacity: 0;
|
||||
transform: translateY(20px)
|
||||
}
|
||||
}
|
||||
/**
|
||||
* Guide
|
||||
*/
|
||||
.guide-bg {
|
||||
position: fixed;
|
||||
right: 10px;
|
||||
bottom: 90px;
|
||||
|
||||
animation-name: popup;
|
||||
animation-duration: 1s;
|
||||
|
||||
z-index: 2147483647;
|
||||
}
|
||||
|
||||
.guide {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: flex-start;
|
||||
align-content: center;
|
||||
|
||||
width: 350px;
|
||||
height: 400px;
|
||||
|
||||
background-color: #F5F6F6;
|
||||
|
||||
border-radius: 2px;
|
||||
box-shadow: 0 0 2px rgba(0, 0, 0, .12), 0 2px 2px rgba(0, 0, 0, .26);
|
||||
|
||||
overflow-x: hidden;
|
||||
overflow-y: auto;
|
||||
}
|
||||
|
||||
.guide .title,
|
||||
.guide .subtitle {
|
||||
height: 48px;
|
||||
line-height: 48px;
|
||||
|
||||
color: #fff;
|
||||
background-color: #26d07c;
|
||||
|
||||
font-size: 17px;
|
||||
text-align: center;
|
||||
|
||||
border-top-left-radius: 2px;
|
||||
border-top-right-radius: 2px;
|
||||
}
|
||||
|
||||
.guide .title {
|
||||
position: absolute;
|
||||
|
||||
left: 0;
|
||||
right: 15px;
|
||||
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
font-weight: bold;
|
||||
|
||||
z-index: 2;
|
||||
}
|
||||
|
||||
.guide .title span {
|
||||
animation: .1s reverse fadein,235ms cubic-bezier(.4,0,.2,1) popdown;
|
||||
}
|
||||
|
||||
.guide .subtitle {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: flex-start;
|
||||
|
||||
margin-top: 48px;
|
||||
|
||||
min-height: 55px;
|
||||
line-height: initial;
|
||||
|
||||
font-size: 15px;
|
||||
}
|
||||
|
||||
.guide .loading {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
|
||||
margin-bottom: 20px;
|
||||
|
||||
font-weight: 500;
|
||||
font-size: 13px;
|
||||
|
||||
transition : opacity 1s cubic-bezier(0.23, 1, 0.32, 1) 0ms;
|
||||
}
|
||||
|
||||
.guide .loading span {
|
||||
padding: 5px;
|
||||
}
|
||||
|
||||
.guide .group {
|
||||
margin-top: -30px;
|
||||
padding: 10px;
|
||||
}
|
||||
|
||||
guid-card {
|
||||
display: flex;
|
||||
|
||||
margin-bottom: 10px;
|
||||
padding: 20px;
|
||||
|
||||
width: 100%;
|
||||
|
||||
background-color: #ffffff;
|
||||
|
||||
border-radius: 4px;
|
||||
box-shadow: rgba(0, 0, 0, 0.1) 0px 1px 3px 0px, rgba(193, 203, 212, 0.7) 0px 0px 0px 1px inset, rgb(193, 203, 212) 0px -1px 0px 0px inset;
|
||||
transition: all 550ms cubic-bezier(0.23, 1, 0.32, 1) 0s;
|
||||
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
guid-card:hover {
|
||||
box-shadow: rgba(0, 0, 0, 0.1) 0px 1px 3px 0px, rgba(193, 203, 212, 0.7) 0px 0px 0px 1px inset, rgb(193, 203, 212) 0px -1px 0px 0px inset;
|
||||
transform: translate(0px, -2px);
|
||||
}
|
||||
|
||||
guid-card-tips span {
|
||||
margin-left: 5px;
|
||||
font-size: 14px;
|
||||
color: #0B242F;
|
||||
}
|
||||
|
||||
.guide hr {
|
||||
margin: 0;
|
||||
border: 0;
|
||||
|
||||
text-align: center;
|
||||
overflow: visible;
|
||||
}
|
||||
|
||||
.guide hr:before {
|
||||
content: '...';
|
||||
|
||||
position: relative;
|
||||
top: -10px;
|
||||
|
||||
display: inline-block;
|
||||
|
||||
margin-left: .6em;
|
||||
|
||||
color: rgba(0,0,0,.68);
|
||||
|
||||
font-family: medium-content-slab-serif-font,Georgia,Cambria,"Times New Roman",Times,serif;
|
||||
font-weight: 400;
|
||||
font-style: italic;
|
||||
font-size: 30px;
|
||||
letter-spacing: .6em;
|
||||
}
|
||||
|
||||
/*
|
||||
opacity {
|
||||
margin: 8px 0 0 0;
|
||||
|
||||
width: 100%;
|
||||
height: 37px;
|
||||
}
|
||||
|
||||
opacity input[type=range] {
|
||||
width: 100%;
|
||||
|
||||
margin: 6px 0;
|
||||
padding: 0;
|
||||
|
||||
border: none;
|
||||
background-color: transparent;
|
||||
-webkit-appearance: none;
|
||||
}
|
||||
|
||||
opacity input[type=range]:focus {
|
||||
outline: none;
|
||||
}
|
||||
|
||||
opacity input[type=range]::-webkit-slider-runnable-track {
|
||||
width: 100%;
|
||||
height: 1px;
|
||||
|
||||
background: #9e9e9e;
|
||||
|
||||
box-shadow: 0px 0px 0px rgba(0, 0, 0, 0.5), 0px 0px 0px rgba(13, 13, 13, 0.5);
|
||||
border-radius: 1.3px;
|
||||
|
||||
transition: all 0.3s;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
opacity input[type=range]::-webkit-slider-runnable-track:hover {
|
||||
background: #00897B;
|
||||
}
|
||||
|
||||
opacity input[type=range]::-webkit-slider-thumb {
|
||||
height: 20px;
|
||||
width: 20px;
|
||||
|
||||
margin-top: -9px;
|
||||
|
||||
background: rgba(0, 137, 123, 1);
|
||||
|
||||
box-shadow: 1px 1px 1px rgba(0, 0, 0, 0), 0px 0px 1px rgba(13, 13, 13, 0);
|
||||
border: 1px solid rgba(0, 0, 0, 0);
|
||||
border-radius: 50px;
|
||||
|
||||
cursor: pointer;
|
||||
-webkit-appearance: none;
|
||||
transition: all .5s ease-in-out .1s;
|
||||
}
|
||||
|
||||
opacity input[type=range]:focus::-webkit-slider-thumb {
|
||||
background: #00897B;
|
||||
}
|
||||
|
||||
opacity input[type=range]:focus::-webkit-slider-thumb:hover {
|
||||
background: #00695C;
|
||||
}
|
||||
|
||||
opacity input[type=range]:focus::-webkit-slider-runnable-track {
|
||||
background: #00897B;
|
||||
}
|
||||
*/
|
||||
@ -1,3 +1,6 @@
|
||||
/**
|
||||
* Options page style
|
||||
*/
|
||||
|
||||
:root {
|
||||
--text-color: #333;
|
||||
@ -217,7 +220,6 @@ a {
|
||||
/*line-height: 37px;*/
|
||||
|
||||
user-select: none;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
#labs .more .desc {
|
||||
@ -239,6 +241,10 @@ a {
|
||||
background-repeat: no-repeat;
|
||||
}
|
||||
|
||||
/**
|
||||
* Plugins & sites Card
|
||||
*/
|
||||
|
||||
cards {
|
||||
display: flex;
|
||||
flex-flow: row wrap;
|
||||
@ -364,6 +370,9 @@ card-empty a {
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
/**
|
||||
* Account
|
||||
*/
|
||||
.avatar {
|
||||
margin: 10px;
|
||||
padding: 5px;
|
||||
@ -382,3 +391,273 @@ card-empty a {
|
||||
border: 5px solid #fff;
|
||||
box-shadow: 0 10px 20px 0 rgba(168,182,191,0.6);
|
||||
}
|
||||
|
||||
/**
|
||||
* Notice bubbles
|
||||
*/
|
||||
.bubbles {
|
||||
position: fixed;
|
||||
bottom: 20px;
|
||||
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-content: center;
|
||||
|
||||
padding: 10px;
|
||||
|
||||
width: 55px;
|
||||
height: 56px;
|
||||
|
||||
border-radius: 50%;
|
||||
|
||||
box-shadow: 0 2px 6px 0 rgba(0,0,0,.4);
|
||||
|
||||
cursor: pointer;
|
||||
transition: all 500ms cubic-bezier(0.23, 1, 0.32, 1) 0ms;
|
||||
}
|
||||
|
||||
.bubbles.notice {
|
||||
right: 94px;
|
||||
background-color: #16666f;
|
||||
}
|
||||
|
||||
.bubbles.notice:hover {
|
||||
background-color: rgba(22, 102, 111, .8);
|
||||
}
|
||||
|
||||
.bubbles i {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.bubbles em {
|
||||
position: absolute;
|
||||
top: 6px;
|
||||
right: 11px;
|
||||
|
||||
width: 18px;
|
||||
height: 18px;
|
||||
line-height: 18px;
|
||||
|
||||
color: #fff;
|
||||
background-color: #e54545;
|
||||
|
||||
font-weight: bold;
|
||||
text-align: center;
|
||||
font-style: initial;
|
||||
border-radius: 50%;
|
||||
}
|
||||
|
||||
.bubbles em.init {
|
||||
line-height: 9px;
|
||||
}
|
||||
|
||||
.bubbles.effect {
|
||||
animation-name: popup;
|
||||
animation-duration: 1s;
|
||||
}
|
||||
|
||||
/**
|
||||
* Help bubbles
|
||||
*/
|
||||
.bubbles.help {
|
||||
right: 24px;
|
||||
background-color: #607D8B;
|
||||
}
|
||||
|
||||
.help:hover {
|
||||
background-color: rgba(96, 125, 139, .8);
|
||||
}
|
||||
|
||||
@keyframes popup {
|
||||
0% {
|
||||
opacity: 0;
|
||||
-webkit-transform: translateY(20px);
|
||||
transform: translateY(20px)
|
||||
}
|
||||
|
||||
100% {
|
||||
opacity: 1;
|
||||
-webkit-transform: translateY(0);
|
||||
transform: translateY(0)
|
||||
}
|
||||
}
|
||||
|
||||
@keyframes popdown {
|
||||
0% {
|
||||
opacity: 0;
|
||||
transform: translateY(-20px)
|
||||
}
|
||||
|
||||
100% {
|
||||
opacity: 1;
|
||||
transform: translateY(0)
|
||||
}
|
||||
}
|
||||
|
||||
@keyframes popclose {
|
||||
0% {
|
||||
opacity: 1;
|
||||
transform: translateY(0px)
|
||||
}
|
||||
|
||||
100% {
|
||||
opacity: 0;
|
||||
transform: translateY(20px)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Guide
|
||||
*/
|
||||
.guide-bg {
|
||||
position: fixed;
|
||||
right: 10px;
|
||||
bottom: 90px;
|
||||
|
||||
animation-name: popup;
|
||||
animation-duration: 1s;
|
||||
|
||||
z-index: 2147483647;
|
||||
}
|
||||
|
||||
.guide {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: flex-start;
|
||||
align-content: center;
|
||||
|
||||
width: 350px;
|
||||
height: 400px;
|
||||
|
||||
background-color: #F5F6F6;
|
||||
|
||||
border-radius: 2px;
|
||||
box-shadow: 0 0 2px rgba(0, 0, 0, .12), 0 2px 2px rgba(0, 0, 0, .26);
|
||||
|
||||
overflow-x: hidden;
|
||||
overflow-y: auto;
|
||||
}
|
||||
|
||||
.guide .title,
|
||||
.guide .subtitle {
|
||||
height: 48px;
|
||||
line-height: 48px;
|
||||
|
||||
color: #fff;
|
||||
background-color: #26d07c;
|
||||
|
||||
font-size: 17px;
|
||||
text-align: center;
|
||||
|
||||
border-top-left-radius: 2px;
|
||||
border-top-right-radius: 2px;
|
||||
}
|
||||
|
||||
.guide .title {
|
||||
position: absolute;
|
||||
|
||||
left: 0;
|
||||
right: 15px;
|
||||
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
font-weight: bold;
|
||||
|
||||
z-index: 2;
|
||||
}
|
||||
|
||||
.guide .title span {
|
||||
animation: .1s reverse fadein,235ms cubic-bezier(.4,0,.2,1) popdown;
|
||||
}
|
||||
|
||||
.guide .subtitle {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: flex-start;
|
||||
|
||||
margin-top: 48px;
|
||||
|
||||
min-height: 55px;
|
||||
line-height: initial;
|
||||
|
||||
font-size: 15px;
|
||||
}
|
||||
|
||||
.guide .loading {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
|
||||
margin-bottom: 20px;
|
||||
|
||||
font-weight: 500;
|
||||
font-size: 13px;
|
||||
|
||||
transition : opacity 1s cubic-bezier(0.23, 1, 0.32, 1) 0ms;
|
||||
}
|
||||
|
||||
.guide .loading span {
|
||||
padding: 5px;
|
||||
}
|
||||
|
||||
.guide .group {
|
||||
margin-top: -30px;
|
||||
padding: 10px;
|
||||
}
|
||||
|
||||
guid-card {
|
||||
display: flex;
|
||||
|
||||
margin-bottom: 10px;
|
||||
padding: 20px;
|
||||
|
||||
width: 100%;
|
||||
|
||||
background-color: #ffffff;
|
||||
|
||||
border-radius: 4px;
|
||||
box-shadow: rgba(0, 0, 0, 0.1) 0px 1px 3px 0px, rgba(193, 203, 212, 0.7) 0px 0px 0px 1px inset, rgb(193, 203, 212) 0px -1px 0px 0px inset;
|
||||
transition: all 550ms cubic-bezier(0.23, 1, 0.32, 1) 0s;
|
||||
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
guid-card:hover {
|
||||
box-shadow: rgba(0, 0, 0, 0.1) 0px 1px 3px 0px, rgba(193, 203, 212, 0.7) 0px 0px 0px 1px inset, rgb(193, 203, 212) 0px -1px 0px 0px inset;
|
||||
transform: translate(0px, -2px);
|
||||
}
|
||||
|
||||
guid-card-tips span {
|
||||
margin-left: 5px;
|
||||
font-size: 14px;
|
||||
color: #0B242F;
|
||||
}
|
||||
|
||||
.guide hr {
|
||||
margin: 0;
|
||||
border: 0;
|
||||
|
||||
text-align: center;
|
||||
overflow: visible;
|
||||
}
|
||||
|
||||
.guide hr:before {
|
||||
content: '...';
|
||||
|
||||
position: relative;
|
||||
top: -10px;
|
||||
|
||||
display: inline-block;
|
||||
|
||||
margin-left: .6em;
|
||||
|
||||
color: rgba(0,0,0,.68);
|
||||
|
||||
font-family: medium-content-slab-serif-font,Georgia,Cambria,"Times New Roman",Times,serif;
|
||||
font-weight: 400;
|
||||
font-style: italic;
|
||||
font-size: 30px;
|
||||
letter-spacing: .6em;
|
||||
}
|
||||
|
||||
83
src/assets/css/setting.css
Normal file
83
src/assets/css/setting.css
Normal file
@ -0,0 +1,83 @@
|
||||
|
||||
/**
|
||||
* Setting: Focus/Read setting dailog
|
||||
*/
|
||||
|
||||
sr-opt-focus,
|
||||
sr-opt-read {
|
||||
display: -webkit-flex;
|
||||
flex-direction:column;
|
||||
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
sr-opt-gp {
|
||||
display: -webkit-flex;
|
||||
position: relative;
|
||||
|
||||
flex-flow:row nowrap;
|
||||
justify-content:flex-start;
|
||||
|
||||
width: 100%;
|
||||
margin-bottom: 25px;
|
||||
|
||||
font-size: 15px;
|
||||
}
|
||||
|
||||
sr-opt-gp sr-opt-label {
|
||||
display: block;
|
||||
position: absolute;
|
||||
|
||||
margin: -8px 0 0 0;
|
||||
|
||||
font-size: 14px;
|
||||
font-weight: bold;
|
||||
|
||||
color: rgba(0, 137, 123, .8);
|
||||
|
||||
user-select: none;
|
||||
pointer-events: none;
|
||||
|
||||
transform: scale(0.75) translate( 0px, -8px );
|
||||
transform-origin: left top 0px;
|
||||
}
|
||||
|
||||
sr-opt-themes {
|
||||
display: -webkit-flex;
|
||||
flex-flow:row nowrap;
|
||||
justify-content:space-between;
|
||||
|
||||
width: 100%;
|
||||
/*height: 100%;*/
|
||||
|
||||
margin: 8px 0 17px;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
sr-opt-theme {
|
||||
width: 40px;
|
||||
height: 20px;
|
||||
|
||||
cursor: pointer;
|
||||
list-style: none;
|
||||
|
||||
border-radius: 3px;
|
||||
border: 1px solid #212121;
|
||||
box-sizing: border-box;
|
||||
|
||||
opacity: 1;
|
||||
transition: all 500ms opacity 1s cubic-bezier(0.23, 1, 0.32, 1) 0ms;
|
||||
}
|
||||
|
||||
sr-opt-theme:hover {
|
||||
opacity: .2;
|
||||
box-shadow: 0 2px 2px 0 rgba(0,0,0,0.14),0 1px 5px 0 rgba(0,0,0,0.12),0 3px 1px -2px rgba(0,0,0,0.2);
|
||||
}
|
||||
|
||||
sr-opt-theme:not(:first-child) {
|
||||
margin-left: 5px;
|
||||
}
|
||||
|
||||
sr-opt-theme[sr-type="active"] {
|
||||
box-shadow: 0 3px 3px 0 rgba(0,0,0,0.14),0 2px 20px 0 rgba(0,0,0,0.12),0 3px 1px -2px rgba(0,0,0,0.7);
|
||||
}
|
||||
@ -1,5 +1,5 @@
|
||||
/**
|
||||
* Golbal style
|
||||
* SimpRead
|
||||
*/
|
||||
|
||||
.simpread-font {
|
||||
@ -263,11 +263,59 @@ sr-rd-crlbar.controlbar:hover {
|
||||
* Highlight
|
||||
*/
|
||||
.simpread-highlight-selector {
|
||||
background-color: #fafafa;
|
||||
outline: 3px dashed #1976d2;
|
||||
opacity: .8;
|
||||
background-color: #fafafa !important;
|
||||
outline: 3px dashed #1976d2 !important;
|
||||
opacity: .8 !important;
|
||||
cursor: pointer !important;
|
||||
transition: opacity .5s ease !important;
|
||||
}
|
||||
|
||||
.simpread-highlight-controlbar {
|
||||
position: relative !important;
|
||||
background-color: #fafafa !important;
|
||||
outline: 3px dashed #1976d2 !important;
|
||||
opacity: .8 !important;
|
||||
transition: opacity .5s ease !important;
|
||||
}
|
||||
|
||||
|
||||
simpread-highlight {
|
||||
position: fixed;
|
||||
|
||||
top: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
|
||||
padding: 15px;
|
||||
|
||||
height: 50px;
|
||||
|
||||
background-color: rgba(50, 50, 50, .9);
|
||||
box-shadow: 0 2px 5px rgba(0, 0, 0, .26);
|
||||
|
||||
z-index: 2147483640;
|
||||
}
|
||||
|
||||
sr-highlight-ctl {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
|
||||
margin: 0 5px;
|
||||
|
||||
width: 50px;
|
||||
height: 20px;
|
||||
|
||||
color: #fff;
|
||||
background-color: #1976d2;
|
||||
|
||||
border-radius: 4px;
|
||||
box-shadow: 0px 3px 1px -2px rgba(0, 0, 0, 0.2), 0px 2px 2px 0px rgba(0, 0, 0, 0.14), 0px 1px 5px 0px rgba(0,0,0,.12);
|
||||
cursor: pointer;
|
||||
transition: opacity .5s ease;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@ -1,26 +1,27 @@
|
||||
console.log( "=== simpread contentscripts load ===" )
|
||||
|
||||
import './assets/css/simpread.css';
|
||||
import './assets/css/option.css';
|
||||
import './assets/css/setting.css';
|
||||
import 'notify_css';
|
||||
import 'mintooltip';
|
||||
|
||||
import Velocity from 'velocity';
|
||||
import Notify from 'notify';
|
||||
import Velocity from 'velocity';
|
||||
import Notify from 'notify';
|
||||
|
||||
import {focus} from 'focus';
|
||||
import * as read from 'read';
|
||||
import * as modals from 'modals';
|
||||
import * as kbd from 'keyboard';
|
||||
import {focus} from 'focus';
|
||||
import * as read from 'read';
|
||||
import * as setting from 'setting';
|
||||
import * as kbd from 'keyboard';
|
||||
import * as highlight from 'highlight';
|
||||
|
||||
import * as util from 'util';
|
||||
import * as util from 'util';
|
||||
import { storage, STORAGE_MODE as mode } from 'storage';
|
||||
import * as msg from 'message';
|
||||
import {browser} from 'browser';
|
||||
import * as watch from 'watch';
|
||||
import * as msg from 'message';
|
||||
import {browser} from 'browser';
|
||||
import * as watch from 'watch';
|
||||
|
||||
import PureRead from 'puread';
|
||||
import * as puplugin from 'puplugin';
|
||||
import PureRead from 'puread';
|
||||
import * as puplugin from 'puplugin';
|
||||
|
||||
let pr, // pure read object
|
||||
is_blacklist = false,
|
||||
@ -127,8 +128,8 @@ browser.runtime.onMessage.addListener( function( request, sender, sendResponse )
|
||||
new Notify().Render( "配置文件已更新,刷新当前页面后才能生效。", "刷新", ()=>window.location.reload() );
|
||||
} else {
|
||||
if ( storage.option.br_exit ) {
|
||||
modals.Exist() && modals.Exit();
|
||||
!modals.Exist() && read.Exist( false ) ? read.Exit() : readMode();
|
||||
setting.Exist() && setting.Exit();
|
||||
!setting.Exist() && read.Exist( false ) ? read.Exit() : readMode();
|
||||
}
|
||||
else readMode();
|
||||
}
|
||||
@ -174,9 +175,9 @@ function bindShortcuts() {
|
||||
kbd.Bind( [ storage.read.shortcuts.toLowerCase() ], readMode );
|
||||
kbd.ListenESC( combo => {
|
||||
if ( combo == "esc" && storage.option.esc ) {
|
||||
modals.Exist() && modals.Exit();
|
||||
!modals.Exist() && focus.Exist() && focus.Exit();
|
||||
!modals.Exist() && read.Exist() && read.Exit();
|
||||
setting.Exist() && setting.Exit();
|
||||
!setting.Exist() && focus.Exist() && focus.Exit();
|
||||
!setting.Exist() && read.Exist() && read.Exit();
|
||||
}
|
||||
});
|
||||
}
|
||||
@ -232,10 +233,16 @@ function readMode() {
|
||||
} else if ( pr.state == "temp" && pr.dom ) {
|
||||
read.Render();
|
||||
} else {
|
||||
new Notify().Render( "当前并未适配阅读模式,请移动鼠标手动生成 <a href='http://ksria.com/simpread/docs/#/%E4%B8%B4%E6%97%B6%E9%98%85%E8%AF%BB%E6%A8%A1%E5%BC%8F' target='_blank' >临时阅读模式</a>。" );
|
||||
new Notify().Render( "智能感知正文失败,请移动鼠标,并通过 <a href='http://ksria.com/simpread/docs/#/手动框选' target='_blank' >手动框选</a> 的方式生成正文。" );
|
||||
read.Highlight().done( dom => {
|
||||
pr.TempMode( mode.read, dom );
|
||||
read.Render();
|
||||
const rerender = element => {
|
||||
pr.TempMode( mode.read, dom );
|
||||
read.Render();
|
||||
};
|
||||
storage.current.highlight ?
|
||||
highlight.Control( dom ).done( newDom => {
|
||||
rerender( newDom );
|
||||
}) : rerender( dom );
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,18 +1,19 @@
|
||||
console.log( "=== simpread focus controlbar load ===" )
|
||||
|
||||
import * as modals from 'modals';
|
||||
import * as se from 'siteeditor';
|
||||
import * as conf from 'config';
|
||||
import { storage } from 'storage';
|
||||
import * as output from 'output';
|
||||
import * as watch from 'watch';
|
||||
import {browser,br}from 'browser';
|
||||
import * as msg from 'message';
|
||||
import * as setting from 'setting';
|
||||
import * as se from 'siteeditor';
|
||||
|
||||
import * as conf from 'config';
|
||||
import { storage } from 'storage';
|
||||
import * as output from 'output';
|
||||
import * as watch from 'watch';
|
||||
import {browser,br} from 'browser';
|
||||
import * as msg from 'message';
|
||||
import * as highlight from 'highlight';
|
||||
|
||||
import Fab from 'fab';
|
||||
|
||||
let timer, $root, selector, callback;
|
||||
let focusItems, $root, selector, callback;
|
||||
|
||||
const tooltip_options = {
|
||||
target : "name",
|
||||
@ -44,7 +45,7 @@ class FControl extends React.Component {
|
||||
$( "html, body" ).animate({ scrollTop: 0 }, "normal" );
|
||||
break;
|
||||
case "setting":
|
||||
modals.Render( ()=>setTimeout( ()=>se.Render(), 500 ));
|
||||
setting.Render( ()=>setTimeout( ()=>se.Render(), 500 ));
|
||||
break;
|
||||
case "siteeditor":
|
||||
se.Render();
|
||||
@ -80,8 +81,9 @@ class FControl extends React.Component {
|
||||
}
|
||||
|
||||
componentWillMount() {
|
||||
focusItems = $.extend( true, {}, conf.focusItems );
|
||||
if ( storage.current.site.name.startsWith( "metaread::" ) || storage.current.site.name.startsWith( "txtread::" ) ) {
|
||||
delete conf.focusItems.option;
|
||||
delete focusItems.option;
|
||||
}
|
||||
}
|
||||
|
||||
@ -93,7 +95,7 @@ class FControl extends React.Component {
|
||||
render() {
|
||||
return (
|
||||
<sr-rd-crlbar class={ this.props.show ? "" : "controlbar" } style={{ "zIndex": 2147483647 }}>
|
||||
<Fab ref="target" tooltip={ tooltip_options } waves="md-waves-effect md-waves-circle md-waves-float" items={ conf.focusItems } onAction={ (event, type)=>this.onAction(event, type ) } />
|
||||
<Fab ref="target" tooltip={ tooltip_options } waves="md-waves-effect md-waves-circle md-waves-float" items={ focusItems } onAction={ (event, type)=>this.onAction(event, type ) } />
|
||||
</sr-rd-crlbar>
|
||||
)
|
||||
}
|
||||
|
||||
@ -10,7 +10,7 @@
|
||||
"idx": 1,
|
||||
"name": "新手入门可以看这篇文章",
|
||||
"icon": "<i class=\"fas fa-file-word\"></i>",
|
||||
"url": "http://kenshin.wang/blog/#/posts/13"
|
||||
"url": "http://ksria.com/simpread/guide/"
|
||||
},
|
||||
{
|
||||
"idx": 2,
|
||||
|
||||
@ -74,7 +74,7 @@ export default class About extends React.Component {
|
||||
<div style={ style.root }>
|
||||
<image src={browser.runtime.getURL("assets/images/icon128.png")}></image>
|
||||
<div style={ style.title }>简悦 SimpRead</div>
|
||||
<div>让你瞬间进入沉浸式阅读的扩展</div>
|
||||
<div>为你提供「如杂志般沉浸式阅读体验」的扩展</div>
|
||||
<div style={ style.badges }>
|
||||
<a href={ urls.href.version } target="_blank"><img style={ style.img } src={ urls.badges.version }/></a>
|
||||
<a href={ urls.href.website } target="_blank"><img style={ style.img } src={ urls.badges.website }/></a>
|
||||
@ -91,7 +91,7 @@ export default class About extends React.Component {
|
||||
|
||||
<div className="label">帮助</div>
|
||||
<div style={{ 'padding-top': '10px', 'position': 'relative' }} className="lab">
|
||||
<div className="more" style={{cursor: 'default'}}>
|
||||
<div className="more">
|
||||
<div><a style={style.href} target="_blank" href="http://sr.ksria.cn/zhifu_m2.png">如果简悦可以解决你在阅读上痛点,可以请我喝杯咖啡</a></div>
|
||||
<span className="desc">简悦是一个免费且开源的项目</span>
|
||||
<span className="arrow"></span>
|
||||
@ -124,7 +124,7 @@ export default class About extends React.Component {
|
||||
|
||||
<div className="label">其它平台的简悦</div>
|
||||
<div style={{ 'padding-top': '10px', 'position': 'relative' }} className="lab">
|
||||
<div className="more" style={{cursor: 'default'}}>
|
||||
<div className="more">
|
||||
<div><a style={style.href} target="_blank" href="http://ksria.com/simpread/#downloads">简悦已经上线了 Firefox 版,UserScript 版,JSBox 版,总有一款适合你</a></div>
|
||||
<span className="desc">包括但不限于:Chrome · Firefox · Safari · Apple Safari · Microsoft Edge · Opera · iPhone · iPad</span>
|
||||
<span className="arrow"></span>
|
||||
@ -145,8 +145,8 @@ export default class About extends React.Component {
|
||||
</div>
|
||||
</div>
|
||||
<div style={{ 'margin-top': '10px', 'position': 'relative' }} className="lab">
|
||||
<div className="more">
|
||||
<a style={style.href} target="_blank" href="https://twitter.com/wanglei001">可以在 <b>Twitter</b></a> 或 <a style={style.href} target="_blank" href="https://weibo.com/23784148"><b>新浪微博</b></a> 上关注我
|
||||
<div className="more" style={{cursor: 'default'}}>
|
||||
可以在 <a style={style.href} target="_blank" href="https://twitter.com/wanglei001"><b>Twitter</b></a> 或 <a style={style.href} target="_blank" href="https://weibo.com/23784148"><b>新浪微博</b></a> 上关注我
|
||||
<span style={{ bottom: "11px" }} className="arrow"></span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@ -10,6 +10,7 @@ import * as menu from 'menu';
|
||||
import * as watch from 'watch';
|
||||
import * as exp from 'export';
|
||||
import {br} from 'browser';
|
||||
import * as msg from 'message';
|
||||
|
||||
export default class CommonOpt extends React.Component {
|
||||
|
||||
@ -192,6 +193,14 @@ export default class CommonOpt extends React.Component {
|
||||
}
|
||||
}
|
||||
|
||||
oldnewsites() {
|
||||
new Notify().Render( "此功能转移到 <b>站点管理</b> 选项卡里面,3 秒钟后自动切换到此选项卡。" );
|
||||
setTimeout( ()=> {
|
||||
location.href = location.origin + "/options/options.html#labs";
|
||||
window.dispatchEvent( new CustomEvent( msg.MESSAGE_ACTION.turn_tab, { detail: { page: 3 }}));
|
||||
}, 3000 );
|
||||
}
|
||||
|
||||
newsites() {
|
||||
const notify = new Notify().Render({ content: "数据同步中,请稍等...", state: "loading" });
|
||||
storage.GetRemote( "remote", ( result, error ) => {
|
||||
@ -268,12 +277,12 @@ export default class CommonOpt extends React.Component {
|
||||
onClick={ ()=>this.export() } />
|
||||
</div>
|
||||
</div>
|
||||
<div className="version-tips" data-hits="newsites" style={{ display: 'inline-flex', width: '50%' }}>
|
||||
<div className="version-tips" data-hits="oldnewsites" style={{ display: 'inline-flex', width: '50%' }}>
|
||||
<Button type="raised" text="手动同步适配列表" width="100%"
|
||||
icon={ ss.IconPath( "update_icon" ) }
|
||||
color="#fff" backgroundColor="#2196F3"
|
||||
waves="md-waves-effect md-waves-button"
|
||||
onClick={ ()=>this.newsites() } />
|
||||
onClick={ ()=>this.oldnewsites() } />
|
||||
</div>
|
||||
<div className="version-tips" data-hits="clear" style={{ display: 'inline-flex', width: '50%' }}>
|
||||
<Button type="raised" text="清除数据" width="100%"
|
||||
|
||||
@ -26,7 +26,7 @@ export default class URL extends React.Component {
|
||||
if ( url == "" ) {
|
||||
code = -2;
|
||||
this.setState({ error : "当前输入不能为空。" });
|
||||
} else if ( !/^http(s)?:\/\//.test( url ) ) {
|
||||
} else if ( !/^http[s|*]?:\/\//.test( url ) ) {
|
||||
code = -1;
|
||||
this.setState({ error : "请输入有效的 url " });
|
||||
} else if ( location.protocol.startsWith( "http" ) && !minimatch( window.location.href, url ) && url != this.props.url ) {
|
||||
|
||||
@ -224,8 +224,8 @@ export default class LabsOpt extends React.Component {
|
||||
<div className="version-tips" data-hits="highlight">
|
||||
<Switch width="100%" checked={ this.props.read.highlight }
|
||||
thumbedColor="#3F51B5" trackedColor="#7986CB"
|
||||
label="是否启动临时阅读模式?"
|
||||
desc="当页面未适配阅读模式时,才能使用此功能"
|
||||
label="手动框选时是否启动二次确认模式?"
|
||||
desc="二次确认模式能精准的定位需要阅读模式的内容。"
|
||||
onChange={ (s)=>this.onChange(s, "read", "highlight") } />
|
||||
</div>
|
||||
<div className="version-tips" data-hits="toc">
|
||||
@ -245,8 +245,8 @@ export default class LabsOpt extends React.Component {
|
||||
<div className="version-tips" data-hits="readauto">
|
||||
<Switch width="100%" checked={ this.props.read.auto }
|
||||
thumbedColor="#3F51B5" trackedColor="#7986CB"
|
||||
desc="白名单与排除列表功能互斥,当启用「自动进入阅读模式」,白名单即失效。"
|
||||
label="如果当前页面适配阅读模式,是否自动进入阅读模式?"
|
||||
desc="注意:此功能只包含已适配的站点,智能识别出正文的站点无法使用此功能,但仍可通过手动方式进入阅读模式。"
|
||||
label="如果当前页面为适配站点,是否自动进入阅读模式?"
|
||||
onChange={ (s)=>this.onChange(s, "read", "auto") } />
|
||||
|
||||
</div>
|
||||
@ -305,7 +305,7 @@ export default class LabsOpt extends React.Component {
|
||||
</div>
|
||||
<div className="version-tips" data-version="1.1.3" data-hits="lazyload">
|
||||
<div ref="lazyload" style={{ 'padding-top': '10px', 'margin-bottom': '8px;' }}>
|
||||
<div className="label" style={{'margin-bottom':' -15px'}}>预加载排除列表</div>
|
||||
<div className="label" style={{'margin-bottom':' -15px'}}>延迟加载列表</div>
|
||||
<div className="sublabel">加入其中后的网址将不会启用预加载功能。</div>
|
||||
<div className="sublabel">此功能适合「经常使用简悦但又性能不够」的用户、需要动态加载及支持 Mathjax 解析的页面等。</div>
|
||||
<TextField
|
||||
@ -329,7 +329,7 @@ export default class LabsOpt extends React.Component {
|
||||
<div className="version-tips" data-hits="custom">
|
||||
<div className="label">自定义样式</div>
|
||||
<div style={{ 'padding-top': '10px', 'position': 'relative' }} className="lab" onClick={ ()=>this.onClick('custom') }>
|
||||
<div className="more">
|
||||
<div className="more" style={{ 'cursor': 'pointer' }}>
|
||||
<div>增强「中文阅读体验」设置</div>
|
||||
<span className="desc">包括:标题、描述、正文的字间距、行间距、首行缩进等及自定义 CSS。</span>
|
||||
<span className="arrow"></span>
|
||||
@ -347,7 +347,7 @@ export default class LabsOpt extends React.Component {
|
||||
onChange={ (s)=>this.onChange(s, "option", "notice") } />
|
||||
</div>
|
||||
<div style={{ 'padding-top': '10px', 'position': 'relative' }} className="lab" onClick={ ()=>this.onClick('notice') }>
|
||||
<div className="more">
|
||||
<div className="more" style={{ 'cursor': 'pointer' }}>
|
||||
<div>查看全部消息</div>
|
||||
<span className="desc">简悦会不定期发送一些消息,包括:新的插件上线、新的适配站点上线、修复 Bug 等</span>
|
||||
<span className="arrow"></span>
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
console.log( "===== simpread option labs load =====" )
|
||||
console.log( "===== simpread option plugins load =====" )
|
||||
|
||||
import {storage} from 'storage';
|
||||
import * as run from 'runtime';
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
console.log( "=== simpread option modals ===" )
|
||||
console.log( "=== simpread option setting ===" )
|
||||
|
||||
import FocusOpt from 'focusopt';
|
||||
import ReadOpt from 'readopt';
|
||||
@ -25,14 +25,14 @@ let callback;
|
||||
*/
|
||||
class Modals extends React.Component {
|
||||
|
||||
// close modals
|
||||
// close setting
|
||||
close( restore = rollback() ) {
|
||||
dia.Close();
|
||||
}
|
||||
|
||||
// save modals focus option
|
||||
// save setting focus option
|
||||
save() {
|
||||
console.log( "modals click submit button.", storage.current )
|
||||
console.log( "setting click submit button.", storage.current )
|
||||
watch.Verify( ( state, result ) => {
|
||||
if ( state ) {
|
||||
console.log( "watch.Lock()", result );
|
||||
@ -1,4 +1,4 @@
|
||||
console.log( "=== simpread option siteeditor ===" )
|
||||
console.log( "=== simpread option siteeditor load ===" )
|
||||
|
||||
import { storage } from 'storage';
|
||||
import * as watch from 'watch';
|
||||
@ -39,14 +39,7 @@ class SiteEditor extends React.Component {
|
||||
|
||||
delete() {
|
||||
console.log( "siteeditor click delete button.", storage.current.site )
|
||||
/*
|
||||
if ( site.target != "local" ) {
|
||||
new Notify().Render( 2, `只能删除 <a href='http://ksria.com/simpread/docs/#/FAQ#%E6%97%A0%E6%B3%95%E5%88%A0%E9%99%A4%E5%BD%93%E5%89%8D%E7%AB%99%E7%82%B9' target='_blank'>本地站点</a> ,如需要请使用 站点管理器 删除。` );
|
||||
return;
|
||||
}
|
||||
*/
|
||||
new Notify().Render( "是否删除当前适配站点?", "删除", () => {
|
||||
//site.target != "local" ? new Notify().Render( 3, `<a href='http://ksria.com/simpread/docs/#/FAQ#%E6%97%A0%E6%B3%95%E5%88%A0%E9%99%A4%E5%BD%93%E5%89%8D%E7%AB%99%E7%82%B9' target='_blank'>无法删除</a> 当前站点,如不想显示请加入黑名单。` ) :
|
||||
site.name.startsWith( "tempread::" ) ? new Notify().Render( 2, `当前站点为自动识别,无误删除。` ) :
|
||||
storage.pr.Deletesite( storage.current.site.target, site.url, result => {
|
||||
if ( result == -1 ) new Notify().Render( 2, `此站已被删除,请勿重复操作。` );
|
||||
@ -80,7 +73,8 @@ class SiteEditor extends React.Component {
|
||||
} else if ( site.include.trim() == "" ) {
|
||||
new Notify().Render( 2, "高亮区域不能为空。" );
|
||||
} else {
|
||||
storage.pr.Updatesite( storage.current.site.target, storage.current.url, [ site.url, storage.pr.Cleansite(site) ]);
|
||||
// changed storage.current.site.target to 'local'
|
||||
storage.pr.Updatesite( 'local', storage.current.url, [ site.url, storage.pr.Cleansite(site) ]);
|
||||
storage.Writesite( storage.pr.sites, () => {
|
||||
new Notify().Render( 0, "更新成功,页面刷新后生效!" );
|
||||
watch.SendMessage( "site", true );
|
||||
@ -101,8 +95,12 @@ class SiteEditor extends React.Component {
|
||||
|
||||
render() {
|
||||
site = { ...storage.pr.current.site };
|
||||
if ( storage.pr.state == "temp" ) {
|
||||
storage.pr.dom && ( site.include = storage.pr.dom.outerHTML.replace( storage.pr.dom.innerHTML, "" ).replace( /<\/\S+>$/i, "" ));
|
||||
if ( storage.pr.state == "temp" && storage.pr.dom ) {
|
||||
site.name = site.name.replace( "tempread::", "" );
|
||||
let include = storage.pr.Utils().dom2Xpath( storage.pr.dom );
|
||||
if ( include != "" ) {
|
||||
site.include = `[[\`${include}\`]]`;
|
||||
} else site.include = storage.pr.dom.outerHTML.replace( storage.pr.dom.innerHTML, "" ).replace( /<\/\S+>$/i, "" )
|
||||
}
|
||||
return (
|
||||
<dia.Dialog>
|
||||
|
||||
@ -1,13 +1,13 @@
|
||||
console.log( "===== simpread option sites load =====" )
|
||||
|
||||
import {storage} from 'storage';
|
||||
import {browser} from 'browser';
|
||||
import * as msg from 'message';
|
||||
import {storage} from 'storage';
|
||||
import {browser} from 'browser';
|
||||
import * as msg from 'message';
|
||||
import * as watch from 'watch';
|
||||
import * as ss from 'stylesheet';
|
||||
import * as ss from 'stylesheet';
|
||||
|
||||
import TextField from 'textfield';
|
||||
import Button from 'button';
|
||||
import TextField from 'textfield';
|
||||
import Button from 'button';
|
||||
|
||||
class Card extends React.Component {
|
||||
|
||||
@ -103,6 +103,23 @@ class Cards extends React.Component {
|
||||
|
||||
export default class SitesOpts extends React.Component {
|
||||
|
||||
newsites() {
|
||||
const notify = new Notify().Render({ content: "数据同步中,请稍等...", state: "loading" });
|
||||
storage.GetRemote( "remote", ( result, error ) => {
|
||||
notify.complete();
|
||||
if ( !error ) {
|
||||
const count = storage.pr.Addsites( result );
|
||||
storage.Writesite( storage.pr.sites, () => {
|
||||
watch.SendMessage( "site", true );
|
||||
count == 0 ? new Notify().Render( "适配列表已同步至最新版本。" ) : new Notify().Render( 0, `适配列表已同步成功,本次新增 ${ count } 个站点,2 秒后自动自动刷新。` );
|
||||
count > 0 && setTimeout( ()=>location.reload(), 2000 );
|
||||
});
|
||||
} else {
|
||||
new Notify().Render( 3, `同步时发生了一些问题,并不会影响本地配置文件,请稍后再试!` );
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
onClick( state ) {
|
||||
state == "sitemgr" && ( location.href = location.origin + "/options/sitemgr.html" );
|
||||
}
|
||||
@ -308,11 +325,22 @@ export default class SitesOpts extends React.Component {
|
||||
render() {
|
||||
return (
|
||||
<div id="labs" style={{ width: '100%' }}>
|
||||
<div className="version-tips" data-hits="newsites">
|
||||
<div className="label">官方主适配源 <a target="_blank" href="https://simpread.ksria.cn/sites/" style={{ color:' #FF5252', borderBottom: '2px dotted', fontSize: '10px', fontWeight: 'bold', cursor: 'pointer' }}>共计 { storage.simpread.sites.length } 类</a></div>
|
||||
<div className="lab">
|
||||
<Button type="raised" text="手动同步适配列表" width="100%"
|
||||
icon={ ss.IconPath( "update_icon" ) }
|
||||
color="#fff" backgroundColor="rgb(103, 58, 183)"
|
||||
waves="md-waves-effect md-waves-button"
|
||||
onClick={ ()=>this.newsites() } />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div className="label">第三方适配源</div>
|
||||
<div ref="origins" style={{ 'padding-top': '10px', 'margin-bottom': '8px;' }} className="lab">
|
||||
<div className="version-tips" data-hits="customsites">
|
||||
<TextField
|
||||
multi={ true } rows={8}
|
||||
multi={ true } rows={4}
|
||||
placeholder="仅支持 URL 地址,每行一个。"
|
||||
value={ ( this.props.option.origins||[] ).join( "\n" ) }
|
||||
onChange={ ()=>this.changeOrigins() }
|
||||
@ -335,19 +363,10 @@ export default class SitesOpts extends React.Component {
|
||||
onClick={ ()=>this.origins( "clear" ) } />
|
||||
</div>
|
||||
</div>
|
||||
<div className="version-tips" data-hits="sitemgr">
|
||||
<div style={{ 'padding-top': '10px', 'position': 'relative' }} onClick={ ()=>this.onClick('sitemgr') }>
|
||||
<div className="more">
|
||||
<div>站点管理器</div>
|
||||
<span className="desc">可以编辑全部的适配站点,包括:官方适配源、站点集市适配源、第三方适配源、自定义适配源。</span>
|
||||
<span className="arrow" style={{ 'bottom': '13px' }}></span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div className="version-tips" data-hits="personsites">
|
||||
<div className="label">管理</div>
|
||||
<div className="label">站点集市 <a target="_blank" href="https://simpread.ksria.cn/sites/" style={{ color:' #FF5252', borderBottom: '2px dotted', fontSize: '10px', fontWeight: 'bold', cursor: 'pointer' }}>共计 { storage.pr.sites.person.length } 类</a></div>
|
||||
<div className="lab">
|
||||
<div style={{ display: 'inline-flex', width: '100%' }}>
|
||||
<Button type="raised" text="打开「站点集市」" width="100%"
|
||||
@ -361,11 +380,21 @@ export default class SitesOpts extends React.Component {
|
||||
waves="md-waves-effect md-waves-button"
|
||||
onClick={ ()=>this.clear() } />
|
||||
</div>
|
||||
|
||||
<div style={{ 'padding-top': '10px' }}>
|
||||
<Cards onChange={ t=>this.onChange(t) } />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div className="label">已安装</div>
|
||||
<div style={{ 'padding-top': '10px' }} className="lab">
|
||||
<Cards onChange={ t=>this.onChange(t) } />
|
||||
<div className="version-tips" data-hits="sitemgr">
|
||||
<div className="label">站点管理器</div>
|
||||
<div style={{ 'padding-top': '10px', 'position': 'relative' }} className="lab" onClick={ ()=>this.onClick('sitemgr') }>
|
||||
<div className="more" style={{ 'cursor': 'pointer' }}>
|
||||
<div>可以管理全部的适配站点</div>
|
||||
<span className="desc">包括:官方适配源、第三方适配源、站点集市适配源、自定义适配源。</span>
|
||||
<span className="arrow"></span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@ -207,9 +207,9 @@ class Welcome extends React.Component {
|
||||
<img src="http://sr.ksria.cn/welcome-service-v2.png?201806111215" style={ style.img }/>
|
||||
<h2 style={ style.h2 }>连接你的生产力工具</h2>
|
||||
<div style={ style.desc }>
|
||||
支持下载 HTML · PDF · Markdown · PNG · <a target="_blank" href="http://ksria.com/simpread/docs/#/%E5%8F%91%E9%80%81%E5%88%B0-Kindle">Epub</a> 到本地 以及 发送到 <a target="_blank" href="http://ksria.com/simpread/docs/#/%E5%8F%91%E9%80%81%E5%88%B0-Kindle">Kindle</a>。<br/>
|
||||
支持下载 HTML · PDF · Markdown · PNG · <a target="_blank" href="http://ksria.com/simpread/docs/#/发送到-Epub">Epub</a> 到本地 以及 发送到 <a target="_blank" href="http://ksria.com/simpread/docs/#/发送到-Kindle">Kindle</a>。<br/>
|
||||
支持输出到 Dropbox · 印象笔记 · Evernote · Onenote · Google 云端硬盘。<br/>
|
||||
发送页面链接到 Pocket · Instapaper · Linnk,详细 <a target="_blank" href="http://ksria.com/simpread/docs/#/%E6%8E%88%E6%9D%83%E6%9C%8D%E5%8A%A1">请看这里</a> 。
|
||||
发送页面链接到 Pocket · Instapaper · Linnk,详细 <a target="_blank" href="http://ksria.com/simpread/docs/#/授权服务">请看这里</a> 。
|
||||
</div>
|
||||
</section>
|
||||
</div> }
|
||||
@ -220,9 +220,9 @@ class Welcome extends React.Component {
|
||||
<img src={ ss.IconPath( "welcome-custom" )} style={ style.img }/>
|
||||
<h2 style={ style.h2 }>站点编辑器 · 站点适配源 · 站点管理器</h2>
|
||||
<div style={ style.desc }>
|
||||
页面上任意元素均可隐藏,更支持编程,详细请看 <a href="http://ksria.com/simpread/docs/#/%E7%AB%99%E7%82%B9%E7%BC%96%E8%BE%91%E5%99%A8" target="_blank">站点编辑器</a><br/>
|
||||
更灵活、社区化的多种 <a href="http://ksria.com/simpread/docs/#/%E7%AB%99%E7%82%B9%E9%80%82%E9%85%8D%E6%BA%90" target="_blank">站点适配源</a>。<br/>
|
||||
内置了 <a href="http://ksria.com/simpread/docs/#/%E7%AB%99%E7%82%B9%E7%AE%A1%E7%90%86%E5%99%A8" target="_blank">站点管理器</a>,方便管理全部的适配站点。
|
||||
页面上任意元素均可隐藏,更支持编程,详细请看 <a href="http://ksria.com/simpread/docs/#/站点编辑器" target="_blank">站点编辑器</a><br/>
|
||||
更灵活、社区化的多种 <a href="http://ksria.com/simpread/docs/#/站点适配源" target="_blank">站点适配源</a>。<br/>
|
||||
内置了 <a href="http://ksria.com/simpread/docs/#/站点管理器" target="_blank">站点管理器</a>,方便管理全部的适配站点。
|
||||
</div>
|
||||
</section>
|
||||
</div> }
|
||||
@ -246,7 +246,7 @@ class Welcome extends React.Component {
|
||||
<h2 style={ style.h2 }>插件系统</h2>
|
||||
<div style={ style.desc }>
|
||||
<a target="_blank" href="https://simpread.ksria.cn/plugins/details/kw36BtjGu0">字数统计</a> · <a target="_blank" href="https://simpread.ksria.cn/plugins/details/VQOZdNET2d">点击查看大图(Lightbox)</a> · <a target="_blank" href="https://simpread.ksria.cn/plugins/details/ohnTKVHz4a">划词翻译</a> 一个不能少。 <br/>
|
||||
可以使用 JavaScript 编写基于「简悦」的插件了,详细说明请看 <a target="_blank" href="http://ksria.com/simpread/docs/#/%E6%8F%92%E4%BB%B6%E7%B3%BB%E7%BB%9F">说明文档</a><br/>
|
||||
可以使用 JavaScript 编写基于「简悦」的插件了,详细说明请看 <a target="_blank" href="http://ksria.com/simpread/docs/#/插件系统">说明文档</a><br/>
|
||||
现在就安装适合你的插件吧 → <a target="_blank" href="https://simpread.ksria.cn/plugins/">插件中心</a> 。
|
||||
</div>
|
||||
</section>
|
||||
|
||||
@ -11,7 +11,7 @@
|
||||
<div class="property">Property</div>
|
||||
<div class="preview simpread-theme-root">
|
||||
<sr-read>
|
||||
<sr-rd-title>简悦 - 让你瞬间进入沉浸式阅读的扩展</sr-rd-title>
|
||||
<sr-rd-title>简悦 SimpRead - 为你提供「如杂志般沉浸式阅读体验」的扩展</sr-rd-title>
|
||||
<sr-rd-desc>为了达到完美的阅读模式这个小目标 ,我适配了 数百种类型 的网站,因此诞生了简悦。</sr-rd-desc>
|
||||
<sr-rd-content>
|
||||
<sr-blockquote>
|
||||
@ -82,7 +82,7 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="bottom">
|
||||
<span>简悦(SimpRead)- 让你瞬间进入沉浸式阅读的扩展。</span> <span> © 2017 <a href="http://ksria.com/simpread">ksria.com</a> by <a href="http://kenshin.wang" target="_blank">Kenshin Wang</a></span>
|
||||
<span>简悦 SimpRead - 为你提供「如杂志般沉浸式阅读体验」的扩展</span> <span> © 2017 - 2019 <a href="http://ksria.com/simpread">ksria.com</a> by <a href="http://kenshin.wang" target="_blank">Kenshin Wang</a></span>
|
||||
</div>
|
||||
<script src="../bundle/common.js"></script>
|
||||
<script src="../bundle/vendors.js"></script>
|
||||
|
||||
@ -123,7 +123,7 @@ function propertyRender() {
|
||||
<group className="lab">
|
||||
<h1>帮助</h1>
|
||||
<group>
|
||||
<p>如何自定义样式,详细 <a href="http://ksria.com/simpread/docs/#/%E8%87%AA%E5%AE%9A%E4%B9%89%E6%A0%B7%E5%BC%8F" target="_blank">请看这里</a><br/>
|
||||
<p>如何自定义样式,详细 <a href="http://ksria.com/simpread/docs/#/自定义样式" target="_blank">请看这里</a><br/>
|
||||
独乐乐不如众乐乐! <a href="https://github.com/Kenshin/simpread/issues/71" target="_blank">分享你的主题</a></p>
|
||||
</group>
|
||||
</group>
|
||||
|
||||
@ -9,7 +9,7 @@
|
||||
<div class="header"><div class="nav"></div><div class="title">消息中心</div></div>
|
||||
<div class="notice"></div>
|
||||
<div class="bottom">
|
||||
<span>简悦(SimpRead)- 让你瞬间进入沉浸式阅读的扩展。</span> <span> © 2017 <a href="http://ksria.com/simpread">ksria.com</a> by <a href="http://kenshin.wang" target="_blank">Kenshin Wang</a></span>
|
||||
<span>简悦 SimpRead - 为你提供「如杂志般沉浸式阅读体验」的扩展</span> <span> © 2017 - 2019 <a href="http://ksria.com/simpread">ksria.com</a> by <a href="http://kenshin.wang" target="_blank">Kenshin Wang</a></span>
|
||||
</div>
|
||||
<script src="../bundle/common.js"></script>
|
||||
<script src="../bundle/vendors.js"></script>
|
||||
|
||||
@ -3,7 +3,7 @@
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<meta http-equiv="X-UA-Compatible" content="ie=edge">
|
||||
<title>选项页 - 简悦(SimpRead)</title>
|
||||
<title>选项页 - 简悦 SimpRead</title>
|
||||
</head>
|
||||
<body>
|
||||
<div class="sidebar"></div>
|
||||
@ -13,7 +13,7 @@
|
||||
<div class="tabscontainer"></div>
|
||||
</div>
|
||||
<div class="bottom">
|
||||
<span>简悦(SimpRead)- 让你瞬间进入沉浸式阅读的扩展。</span> <span> © 2017 <a href="http://ksria.com/simpread">ksria.com</a> by <a href="http://kenshin.wang" target="_blank">Kenshin Wang</a></span>
|
||||
<span>简悦 SimpRead - 为你提供「如杂志般沉浸式阅读体验」的扩展</span> <span> © 2017 - 2019 <a href="http://ksria.com/simpread">ksria.com</a> by <a href="http://kenshin.wang" target="_blank">Kenshin Wang</a></span>
|
||||
</div>
|
||||
<script src="../bundle/common.js"></script>
|
||||
<script src="../bundle/vendors.js"></script>
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
console.log( "==== simpread options page load ====" )
|
||||
|
||||
import '../assets/css/options_page.css';
|
||||
import '../assets/css/option.css';
|
||||
import '../assets/css/setting.css';
|
||||
import 'notify_css';
|
||||
import 'intro_css';
|
||||
|
||||
@ -183,6 +183,10 @@ function vernotify( first ) {
|
||||
});
|
||||
}
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
// verify and remove old plugins
|
||||
ver.VerifyPlugins( storage.option, version ) && storage.Write( () => {
|
||||
new Notify().Render({ content: `新版升级后,会自动删除一些已失效的插件,详细请看 <a href="http://ksria.com/simpread/welcome/version_${version}.html#badplugins" target="_blank">自定义主题</a>`, state: "holdon" });
|
||||
}, storage.simpread );
|
||||
}
|
||||
website_sync = true;
|
||||
browser.runtime.sendMessage({ type: "track", value: { eventAction: hash.startsWith( "#firstload?ver=" ) ? "install" : "update" , eventCategory: "install", eventLabel: "install && update" } });
|
||||
|
||||
@ -21,7 +21,7 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="bottom">
|
||||
<span>简悦(SimpRead)- 让你瞬间进入沉浸式阅读的扩展。</span> <span> © 2017 <a href="http://ksria.com/simpread">ksria.com</a> by <a href="http://kenshin.wang" target="_blank">Kenshin Wang</a></span>
|
||||
<span>简悦 SimpRead - 为你提供「如杂志般沉浸式阅读体验」的扩展</span> <span> © 2017 - 2019 <a href="http://ksria.com/simpread">ksria.com</a> by <a href="http://kenshin.wang" target="_blank">Kenshin Wang</a></span>
|
||||
</div>
|
||||
<script src="../bundle/common.js"></script>
|
||||
<script src="../bundle/vendors.js"></script>
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
console.log( "==== simpread options page: sitemanager load ====" )
|
||||
|
||||
import '../assets/css/simpread.css';
|
||||
import '../assets/css/option.css';
|
||||
import '../assets/css/setting.css';
|
||||
import '../assets/css/options_page.css';
|
||||
import '../assets/css/options_custom.css';
|
||||
import '../assets/css/options_sitemgr.css';
|
||||
|
||||
@ -20,7 +20,7 @@ import Fab from 'fab';
|
||||
import Fap from 'fap'
|
||||
import * as ttips from 'tooltip';
|
||||
|
||||
let notify;
|
||||
let notify, readItems;
|
||||
const tooltip_options = {
|
||||
target : "name",
|
||||
position : "bottom",
|
||||
@ -55,6 +55,9 @@ export default class ReadCtlbar extends React.Component {
|
||||
kbd.Listen( combo => {
|
||||
this.onAction( undefined, combo )
|
||||
});
|
||||
run.Controlbar( undefined, event => {
|
||||
this.onAction( undefined, event.detail.type );
|
||||
});
|
||||
}
|
||||
|
||||
onAction( event, type ) {
|
||||
@ -134,31 +137,32 @@ export default class ReadCtlbar extends React.Component {
|
||||
}
|
||||
|
||||
componentWillMount() {
|
||||
readItems = $.extend( true, {}, conf.readItems );
|
||||
try {
|
||||
if ( storage.current.fap ) {
|
||||
delete conf.readItems.exit;
|
||||
delete conf.readItems.option.items.setting;
|
||||
delete conf.readItems.fontfamily;
|
||||
delete conf.readItems.fontsize;
|
||||
delete conf.readItems.layout;
|
||||
delete conf.readItems.theme;
|
||||
delete readItems.exit;
|
||||
delete readItems.option.items.setting;
|
||||
delete readItems.fontfamily;
|
||||
delete readItems.fontsize;
|
||||
delete readItems.layout;
|
||||
delete readItems.theme;
|
||||
} else {
|
||||
delete conf.readItems.trigger;
|
||||
delete readItems.trigger;
|
||||
}
|
||||
if ( this.props.type.startsWith( "txtread::" ) && this.props.type.endsWith( "::local" )) {
|
||||
delete conf.readItems.download;
|
||||
delete conf.readItems.readlater;
|
||||
delete conf.readItems.send;
|
||||
delete conf.readItems.share;
|
||||
delete conf.readItems.option;
|
||||
delete readItems.download;
|
||||
delete readItems.readlater;
|
||||
delete readItems.send;
|
||||
delete readItems.share;
|
||||
delete readItems.option;
|
||||
}
|
||||
if ( this.props.type.startsWith( "metaread::" ) || this.props.type.startsWith( "txtread::" ) ) {
|
||||
delete conf.readItems.option;
|
||||
delete readItems.option;
|
||||
}
|
||||
storage.Safe( () => {
|
||||
storage.secret.webdav.forEach( item => {
|
||||
item = JSON.parse( item );
|
||||
conf.readItems.send.items[ "webdav_" + item.name ] = {
|
||||
readItems.send.items[ "webdav_" + item.name ] = {
|
||||
name: item.name,
|
||||
icon: ss.IconPath("webdav_icon"),
|
||||
"color": "#00BCD4",
|
||||
@ -172,22 +176,22 @@ export default class ReadCtlbar extends React.Component {
|
||||
// Add test source
|
||||
if ( plugin.enable != false && ( plugin.trigger == true || plugin.trigger == "true" )) {
|
||||
//if ( plugin.id == "Y7JxbP7B4H" ) {
|
||||
conf.readItems.trigger.items["plugin_" + plugin.id] = {
|
||||
readItems.trigger.items["plugin_" + plugin.id] = {
|
||||
"name" : plugin.name,
|
||||
"fontIcon" : plugin.icon.type,
|
||||
"color" : plugin.icon.bgColor,
|
||||
};
|
||||
}
|
||||
});
|
||||
if ( conf.readItems.trigger && $.isEmptyObject( conf.readItems.trigger.items )) {
|
||||
delete conf.readItems.trigger;
|
||||
if ( readItems.trigger && $.isEmptyObject( readItems.trigger.items )) {
|
||||
delete readItems.trigger;
|
||||
}
|
||||
});
|
||||
} catch ( err ) {
|
||||
// TO-DO
|
||||
}
|
||||
// hack code
|
||||
!/chrome/ig.test( navigator.userAgent ) && ( delete conf.readItems.dyslexia );
|
||||
!/chrome/ig.test( navigator.userAgent ) && ( delete readItems.dyslexia );
|
||||
}
|
||||
|
||||
constructor( props ) {
|
||||
@ -201,12 +205,12 @@ export default class ReadCtlbar extends React.Component {
|
||||
onOpen={ ()=> this.onPop( "open" ) } onClose={ ()=> this.onPop( "close" ) }
|
||||
onAction={ (event, type)=>this.onAction(event, type ) }>
|
||||
<ReadOpt option={ storage.current } onChange={ (t,c)=>this.onChange(t,c)}/>
|
||||
<Actionbar items={ conf.readItems } onAction={ (type)=>this.onAction(undefined, type ) }/>
|
||||
<Actionbar items={ readItems } onAction={ (type)=>this.onAction(undefined, type ) }/>
|
||||
<Sitebar />
|
||||
<Pluginbar />
|
||||
</Fap>
|
||||
:
|
||||
<Fab items={ conf.readItems } tooltip={ tooltip_options } waves="md-waves-effect md-waves-circle md-waves-float" onAction={ (event, type)=>this.onAction(event, type ) } />
|
||||
<Fab items={ readItems } tooltip={ tooltip_options } waves="md-waves-effect md-waves-circle md-waves-float" onAction={ (event, type)=>this.onAction(event, type ) } />
|
||||
return (
|
||||
<sr-rd-crlbar class={ this.props.show ? "" : "controlbar" } style={{ "zIndex": "2" }}>
|
||||
{ Controlbar }
|
||||
|
||||
@ -1,12 +1,12 @@
|
||||
console.log( "=== simpread read load ===" )
|
||||
|
||||
import ProgressBar from 'schedule';
|
||||
import * as spec from 'special';
|
||||
import ReadCtlbar from 'readctlbar';
|
||||
import * as toc from 'toc';
|
||||
import * as modals from 'modals';
|
||||
import * as se from 'siteeditor';
|
||||
import * as kbd from 'keyboard';
|
||||
import ProgressBar from 'schedule';
|
||||
import * as spec from 'special';
|
||||
import ReadCtlbar from 'readctlbar';
|
||||
import * as toc from 'toc';
|
||||
import * as setting from 'setting';
|
||||
import * as se from 'siteeditor';
|
||||
import * as kbd from 'keyboard';
|
||||
|
||||
import { storage, Clone } from 'storage';
|
||||
import th from 'theme';
|
||||
@ -74,9 +74,15 @@ class Read extends React.Component {
|
||||
if ( type == "cancel" ) return;
|
||||
setTimeout( () => {
|
||||
Highlight().done( dom => {
|
||||
load_count++;
|
||||
storage.pr.TempMode( "read", dom );
|
||||
Render();
|
||||
const rerender = element => {
|
||||
load_count++;
|
||||
storage.pr.TempMode( "read", element );
|
||||
Render();
|
||||
};
|
||||
storage.current.highlight ?
|
||||
highlight.Control( dom ).done( newDom => {
|
||||
rerender( newDom );
|
||||
}) : rerender( dom );
|
||||
});
|
||||
}, 200 );
|
||||
}});
|
||||
@ -171,7 +177,7 @@ class Read extends React.Component {
|
||||
this.exit();
|
||||
break;
|
||||
case "setting":
|
||||
modals.Render( ()=>setTimeout( ()=>se.Render(), 500 ));
|
||||
setting.Render( ()=>setTimeout( ()=>se.Render(), 500 ));
|
||||
break;
|
||||
case "siteeditor":
|
||||
$( "panel-bg" ).length > 0 && $( "panel-bg" )[0].click();
|
||||
@ -187,18 +193,37 @@ class Read extends React.Component {
|
||||
storage.Setcur( storage.current.mode );
|
||||
break;
|
||||
case "remove":
|
||||
new Notify().Render( "移动鼠标选择不想显示的内容,只针对本次有效。" );
|
||||
$( "panel-bg" ).length > 0 && $( "panel-bg" ).trigger( "click" );
|
||||
Highlight().done( dom => {
|
||||
new Notify().Render({ content: "移动鼠标选择不想显示的内容,可多次选择,使用 ESC 退出。", delay: 5000 });
|
||||
highlight.Multi( dom => {
|
||||
const path = storage.pr.Utils().dom2Xpath( dom ),
|
||||
site = { ...storage.pr.current.site };
|
||||
site.exclude.push( `[[\`${path}\`]]` );
|
||||
if ( storage.pr.state == "temp" ) {
|
||||
const include = storage.pr.Utils().dom2Xpath( storage.pr.dom );
|
||||
site.include = `[[\`${include}\`]]`;
|
||||
site.name = site.name.replace( "tempread::", "" );
|
||||
}
|
||||
storage.pr.Updatesite( 'local', storage.current.url, [ site.url, storage.pr.Cleansite(site) ]);
|
||||
storage.Writesite( storage.pr.sites, () => {
|
||||
storage.pr.current.site.name = site.name;
|
||||
storage.pr.current.site.include = site.include;
|
||||
});
|
||||
$(dom).remove();
|
||||
});
|
||||
break;
|
||||
case "highlight":
|
||||
new Notify().Render( "移动鼠标选择高亮区域,以便生成阅读模式,将会在页面刷新后失效。" );
|
||||
new Notify().Render( `移动鼠标选择高亮区域,以便生成阅读模式,此模式将会在页面刷新后失效,详细说明请看 <a href="http://ksria.com/simpread/docs/#/重新高亮" target="_blank">重新高亮</a>` );
|
||||
this.exit();
|
||||
Highlight().done( dom => {
|
||||
storage.pr.TempMode( "read", dom );
|
||||
Render();
|
||||
const rerender = element => {
|
||||
storage.pr.TempMode( "read", element );
|
||||
Render();
|
||||
};
|
||||
storage.current.highlight ?
|
||||
highlight.Control( dom ).done( newDom => {
|
||||
rerender( newDom );
|
||||
}) : rerender( dom );
|
||||
});
|
||||
break;
|
||||
/*
|
||||
@ -215,11 +240,11 @@ class Read extends React.Component {
|
||||
}
|
||||
|
||||
render() {
|
||||
const Article = this.props.wrapper.avatar ?
|
||||
const Article = this.props.wrapper.avatar && this.props.wrapper.avatar.length > 0 ?
|
||||
<spec.Multiple include={ this.props.wrapper.include } avatar={ this.props.wrapper.avatar } /> :
|
||||
<sr-rd-content dangerouslySetInnerHTML={{__html: this.props.wrapper.include }} ></sr-rd-content>;
|
||||
|
||||
const Page = this.props.wrapper.paging &&
|
||||
const Page = this.props.wrapper.paging && this.props.wrapper.paging.length > 0 &&
|
||||
<spec.Paging paging={ this.props.wrapper.paging } />;
|
||||
return (
|
||||
<sr-read>
|
||||
@ -277,7 +302,7 @@ function Highlight() {
|
||||
*/
|
||||
function Exist( action ) {
|
||||
if ( $root.find( rdclsjq ).length > 0 ) {
|
||||
action && modals.Render( ()=>setTimeout( ()=>se.Render(), 500 ));
|
||||
action && setting.Render( ()=>setTimeout( ()=>se.Render(), 500 ));
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
@ -307,8 +332,14 @@ function mathJaxMode() {
|
||||
if ( typeof dom == "undefined" ) {
|
||||
new Notify().Render( "智能感知失败,请移动鼠标框选。" );
|
||||
Highlight().done( dom => {
|
||||
storage.pr.TempMode( "read", dom );
|
||||
Render( false );
|
||||
const rerender = element => {
|
||||
storage.pr.TempMode( "read", element );
|
||||
Render( false );
|
||||
};
|
||||
storage.current.highlight ?
|
||||
highlight.Control( dom ).done( newDom => {
|
||||
rerender( newDom );
|
||||
}) : rerender( dom );
|
||||
});
|
||||
} else if ( typeof dom == "string" ) {
|
||||
const html = storage.pr.GetDom( dom, "html" );
|
||||
|
||||
@ -581,9 +581,11 @@ readLabels = [ "白练", "白磁", "卯之花色", "丁子色", "娟鼠", "月
|
||||
* Focus controlbar items
|
||||
*/
|
||||
const focusItems = ( items => {
|
||||
const news = { ...items },
|
||||
dels = [ "theme", "fontfamily", "fontsize", "layout", "dyslexia" ];
|
||||
const news = $.extend( true, {}, items ),
|
||||
dels = [ "theme", "fontfamily", "fontsize", "layout", "dyslexia", "trigger" ];
|
||||
dels.forEach( del => delete news[ del ] );
|
||||
delete news.option.items.fullscreen;
|
||||
delete news.option.items.tempread;
|
||||
news.top = {
|
||||
"name" : "返回顶部",
|
||||
"icon" : ss.IconPath("top_icon"),
|
||||
|
||||
@ -776,7 +776,7 @@ class Onenote {
|
||||
status != "success" && callback( undefined, "error" );
|
||||
}).fail( ( xhr, status, error ) => {
|
||||
console.error( xhr, status, error )
|
||||
callback( undefined, error.toLowerCase() == "unauthorized" ? `${ this.name } 授权过期,请重新授权。` : "error" );
|
||||
callback( undefined, xhr.status == 401 ? `${ this.name } 授权过期,请重新授权。` : "error" );
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@ -25,6 +25,7 @@ function start() {
|
||||
$( "html" ).off( "mousemove", mousemoveEvent );
|
||||
$prev = undefined;
|
||||
dtd.resolve( event.target );
|
||||
return false;
|
||||
});
|
||||
$( "html" ).one( "keydown", event => {
|
||||
if ( event.keyCode == 27 && $prev ) {
|
||||
@ -39,6 +40,40 @@ function start() {
|
||||
return dtd;
|
||||
}
|
||||
|
||||
/**
|
||||
* Multi Highlight
|
||||
*
|
||||
* @return {func} callback
|
||||
*/
|
||||
function multi( callback ) {
|
||||
let $prev;
|
||||
const mousemoveEvent = event => {
|
||||
if ( !$prev ) {
|
||||
$( event.target ).addClass( highlight_class );
|
||||
} else {
|
||||
$prev.removeClass( highlight_class );
|
||||
$( event.target ).addClass( highlight_class );
|
||||
}
|
||||
$prev = $( event.target );
|
||||
},
|
||||
removeDomHander = event => {
|
||||
callback( event.target );
|
||||
return false;
|
||||
};
|
||||
$( "html" ).on( "click", removeDomHander );
|
||||
$( "html" ).on( "keydown", event => {
|
||||
if ( event.keyCode == 27 && $prev ) {
|
||||
$( "html" ).find( `.${highlight_class}` ).removeClass( highlight_class );
|
||||
$( "html" ).off( "mousemove", mousemoveEvent );
|
||||
$( "html" ).off( "click", removeDomHander );
|
||||
$prev = undefined;
|
||||
event.preventDefault();
|
||||
return false;
|
||||
}
|
||||
});
|
||||
$( "html" ).on( "mousemove", mousemoveEvent );
|
||||
}
|
||||
|
||||
function annotate() {
|
||||
const dtd = $.Deferred();
|
||||
$( "html" ).one( "mouseup", event => {
|
||||
@ -60,7 +95,52 @@ function annotate() {
|
||||
return dtd;
|
||||
}
|
||||
|
||||
/**
|
||||
* Highlight and controlbar
|
||||
*
|
||||
* @param {element} dom
|
||||
*/
|
||||
function controlbar( dom ) {
|
||||
let $target = $( dom );
|
||||
const dtd = $.Deferred(),
|
||||
tmpl = `<simpread-highlight>
|
||||
<sr-highlight-ctl class="add"><svg t="1560496884701" viewBox="0 0 1024 1024" version="1.1" width="15" height="15"><defs><style type="text/css"></style></defs><path d="M876.089 439.182h-291.271v-291.271c0-40.268-32.549-72.818-72.818-72.818s-72.818 32.549-72.818 72.818v291.271h-291.271c-40.268 0-72.818 32.549-72.818 72.818s32.549 72.818 72.818 72.818h291.271v291.271c0 40.268 32.549 72.818 72.818 72.818s72.818-32.549 72.818-72.818v-291.271h291.271c40.268 0 72.818-32.549 72.818-72.818s-32.549-72.818-72.818-72.818z" p-id="1998" fill="#ffffff"></path></svg></sr-highlight-ctl>
|
||||
<sr-highlight-ctl class="sub"><svg t="1560496679351" viewBox="0 0 1024 1024" version="1.1" width="15" height="15"><defs><style type="text/css"></style></defs><path d="M127.289058 490.154459l0 43.770899c0 32.338522 27.009144 57.108672 58.774615 58.734706 0 0 132.448568 13.021571 325.936327 13.021571s325.936327-13.021571 325.936327-13.021571c31.765471-1.626034 58.774615-26.396183 58.774615-58.734706l0-43.770899c0-32.338522-26.51591-57.068763-58.774615-58.734706 0 0-128.005372-12.005428-325.942467-12.005428s-325.930187 12.005428-325.930187 12.005428C153.804968 433.085696 127.289058 457.815937 127.289058 490.154459z" p-id="3204" fill="#ffffff"></path></svg></sr-highlight-ctl>
|
||||
<sr-highlight-ctl class="done"><svg t="1560496955945" viewBox="0 0 1024 1024" version="1.1" width="15" height="15"><defs><style type="text/css"></style></defs><path d="M416.832 798.08C400.64 798.08 384.512 791.872 372.16 779.52L119.424 525.76C94.784 500.992 94.784 460.8 119.424 436.032 144.128 411.264 184.128 411.264 208.768 436.032L416.832 644.928 814.4 245.76C839.04 220.928 879.04 220.928 903.744 245.76 928.384 270.528 928.384 310.656 903.744 335.424L461.504 779.52C449.152 791.872 432.96 798.08 416.832 798.08Z" p-id="1755" fill="#ffffff"></path></svg></sr-highlight-ctl>
|
||||
<sr-highlight-ctl class="none"><svg t="1560499513561" viewBox="0 0 1024 1024" version="1.1" width="15" height="15"><defs><style type="text/css"></style></defs><path d="M649.179 512l212.839-212.84c37.881-37.881 37.881-99.298 0-137.179s-99.298-37.881-137.179 0L512 374.821l-212.839-212.84c-37.881-37.881-99.298-37.881-137.179 0s-37.881 99.298 0 137.179L374.821 512 161.982 724.84c-37.881 37.881-37.881 99.297 0 137.179 18.94 18.94 43.765 28.41 68.589 28.41 24.825 0 49.649-9.47 68.589-28.41L512 649.179l212.839 212.84c18.94 18.94 43.765 28.41 68.589 28.41s49.649-9.47 68.59-28.41c37.881-37.882 37.881-99.298 0-137.179L649.179 512z" p-id="1990" fill="#ffffff"></path></svg></sr-highlight-ctl>
|
||||
<sr-highlight-ctl class="help"><svg t="1560573280563" viewBox="0 0 1024 1024" version="1.1" width="15" height="15"><defs><style type="text/css"></style></defs><path d="M512 958.326255c247.255337 0 447.696462-200.441125 447.696462-447.696462s-200.441125-447.696462-447.696462-447.696462-447.696462 200.441125-447.696462 447.696462S264.74364 958.326255 512 958.326255zM512 217.681788c35.32146 0 63.956637 28.635177 63.956637 63.956637 0 35.323507-28.635177 63.956637-63.956637 63.956637s-63.956637-28.633131-63.956637-63.956637C448.043363 246.316965 476.67854 217.681788 512 217.681788zM448.043363 510.629793c0-35.32146 28.635177-63.956637 63.956637-63.956637s63.956637 28.635177 63.956637 63.956637l0 223.848231c0 35.323507-28.635177 63.956637-63.956637 63.956637s-63.956637-28.633131-63.956637-63.956637L448.043363 510.629793z" p-id="1979" fill="#ffffff"></path></svg></sr-highlight-ctl>
|
||||
</simpread-highlight>`;
|
||||
$target.addClass( "simpread-highlight-controlbar" )
|
||||
$("html").append( tmpl );
|
||||
$("html").find( "sr-highlight-ctl" ).on( "click", event => {
|
||||
const cls = $( event.currentTarget ).attr( "class" );
|
||||
if ( cls == "add" ) {
|
||||
$target.removeClass( "simpread-highlight-controlbar" );
|
||||
$target = $target.parent();
|
||||
$target.addClass( "simpread-highlight-controlbar" );
|
||||
} else if ( cls == "sub" ) {
|
||||
$target.removeClass( "simpread-highlight-controlbar" );
|
||||
$target = $($target.children()[0]);
|
||||
$target.addClass( "simpread-highlight-controlbar" );
|
||||
} else if ( cls == "none" ) {
|
||||
$target.removeClass( "simpread-highlight-controlbar" );
|
||||
$( "simpread-highlight" ).remove();
|
||||
} else if ( cls == "help" ) {
|
||||
const $a = $( `<a style="display:none" target="_blank" href="http://ksria.com/simpread/docs/#/手动框选"></a>` ).appendTo( "body" );
|
||||
$a[0].click();
|
||||
$a.remove();
|
||||
} else {
|
||||
$target.removeClass( "simpread-highlight-controlbar" );
|
||||
$( "simpread-highlight" ).remove();
|
||||
dtd.resolve( $target[0] );
|
||||
}
|
||||
});
|
||||
return dtd;
|
||||
}
|
||||
|
||||
export {
|
||||
start as Start,
|
||||
multi as Multi,
|
||||
annotate as Annotate,
|
||||
controlbar as Control,
|
||||
}
|
||||
@ -40,6 +40,7 @@ const action = {
|
||||
// event
|
||||
turn_tab : "turn_tab",
|
||||
welcome_close : "welcome_close",
|
||||
"controlbar" : "simpread-plugin_controlbar",
|
||||
};
|
||||
|
||||
/**
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
console.log( "=== simpread control:action load ===" )
|
||||
console.log( "=== simpread output load ===" )
|
||||
|
||||
import * as util from 'util';
|
||||
import * as exp from 'export';
|
||||
|
||||
@ -5,6 +5,8 @@ import {browser} from 'browser';
|
||||
import {storage, Clone} from 'storage';
|
||||
import * as highlight from 'highlight';
|
||||
|
||||
let is_firstload = true;
|
||||
|
||||
/**
|
||||
* Generate ID
|
||||
*
|
||||
@ -79,13 +81,14 @@ function exec( state, site, plugin ) {
|
||||
function func( source ) {
|
||||
window.Notify = Notify;
|
||||
window.browser = browser;
|
||||
window.current = Clone( storage.pr.current );
|
||||
window.current = Clone( storage.current );
|
||||
window.read = Clone( storage.read );
|
||||
window.highlight = highlight;
|
||||
window.db = Storage;
|
||||
return `( function ( $$version, $read, $title, $desc, $content, $footer, $process, $toc, Notify, $$highlight, browser, $$storage, $$current, $$read ) {
|
||||
window.control = Controlbar;
|
||||
return `( function ( $$version, $read, $title, $desc, $content, $footer, $process, $toc, Notify, $$highlight, browser, $$storage, $$current, $$read, $$control ) {
|
||||
${ source }
|
||||
})( "0.0.2", $( "sr-rd-title" ), $( "sr-read" ), $( "sr-rd-desc" ), $( "sr-rd-content" ), $( "sr-rd-footer" ), $( "read-process" ), $( "toc" ), Notify, highlight, browser, db, current, read );`
|
||||
})( "0.0.2", $( "sr-read" ), $( "sr-rd-title" ), $( "sr-rd-desc" ), $( "sr-rd-content" ), $( "sr-rd-footer" ), $( "read-process" ), $( "toc" ), Notify, highlight, browser, db, current, read, control );`
|
||||
}
|
||||
|
||||
/**
|
||||
@ -107,6 +110,21 @@ function Storage( id, data, callback ) {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Contorlbar setting
|
||||
*
|
||||
* @param {string} controlbar type include: markdown
|
||||
* @param {func} callback
|
||||
*/
|
||||
function Controlbar( type, callback ) {
|
||||
if ( callback ) {
|
||||
is_firstload && window.addEventListener( "simpread-plugin_controlbar", event => {
|
||||
callback( event );
|
||||
});
|
||||
} else window.dispatchEvent( new CustomEvent( "simpread-plugin_controlbar", { detail: { type }}));
|
||||
is_firstload = false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Add style
|
||||
*
|
||||
@ -153,7 +171,7 @@ function testPlugin( style, plugin, trigger ) {
|
||||
$( "sr-read" ), $( "sr-rd-title" ), $( "sr-rd-desc" ), $( "sr-rd-content" ), $( "sr-rd-footer" ), $( "read-process" ), $( "toc" ),
|
||||
Notify, highlight,
|
||||
browser, db,
|
||||
storage.pr.current, storage.read );
|
||||
storage.current, storage.read, control );
|
||||
trigger && addTrigger( trigger() );
|
||||
}
|
||||
|
||||
@ -164,4 +182,5 @@ export {
|
||||
exec as Exec,
|
||||
generateID as ID,
|
||||
dispatch as Event,
|
||||
Controlbar,
|
||||
}
|
||||
@ -116,7 +116,9 @@ const name = "simpread",
|
||||
br_exit : false,
|
||||
secret : false,
|
||||
preload : true,
|
||||
lazyload : [],
|
||||
lazyload : [
|
||||
"baidu.com", "weibo.com", "youtube.com"
|
||||
],
|
||||
uninstall : true,
|
||||
menu : {
|
||||
focus : true,
|
||||
@ -131,7 +133,11 @@ const name = "simpread",
|
||||
origins : [],
|
||||
blacklist : [
|
||||
"google.com",
|
||||
"youtube.com"
|
||||
"youtube.com",
|
||||
"simp.red",
|
||||
"simpread.herokuapp.com",
|
||||
"simpread-test.herokuapp.com",
|
||||
"simpread.ksria.cn"
|
||||
],
|
||||
plugins : [], // plugin id, e.g. kw36BtjGu0
|
||||
},
|
||||
|
||||
@ -27,13 +27,14 @@ function verifyHtml( html ) {
|
||||
- [['text']] // remove '<text>'
|
||||
- [[/regexp/]] // regexp e.g. $("sr-rd-content").find( "*[src='http://ifanr-cdn.b0.upaiyun.com/wp-content/uploads/2016/09/AppSo-qrcode-signature.jpg']" )
|
||||
- [[[juqery code]]] // new Function, e.g. $("xxx").find() return jquery object
|
||||
- [[`xpath`]] // /html[1]/div[1]/sr-read[1]/sr-rd-content[1]/p[1]
|
||||
|
||||
*
|
||||
* @param {string} verify content
|
||||
* @return {boolen} verify result
|
||||
*/
|
||||
function specTest( content ) {
|
||||
return /^(\[\[)[\[{'/]{1}[ \S]+[}'/\]]\]\]{1}($)/g.test( content );
|
||||
return /^(\[\[)[\[{`'/]{1}[ \S]+[}`'/\]]\]\]{1}($)/g.test( content );
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@ -83,11 +83,11 @@ const version = browser.runtime.getManifest().version.replace( /.\d{2,}/, "" ),
|
||||
},
|
||||
{
|
||||
id: 'config',
|
||||
intro: '从 <b>本地导入配置文件</b> 或 <b>导出配置文件到本地</b>。<br>注意:简悦支持导入任意版本的配置文件,但请尽量上传匹配版本的配置文件。',
|
||||
intro: '从 <b>本地导入配置文件</b> 或 <b>导出配置文件到本地</b> 。<br>注意:简悦支持导入任意版本的配置文件,但请尽量上传匹配版本的配置文件。',
|
||||
},
|
||||
{
|
||||
id: 'newsites',
|
||||
intro: '简悦每隔一段时间会自动同步适配列表,你也可以手动同步。<br>什么是适配列表?详细说明 <a target="_blank" href="http://ksria.com/simpread/docs/#/适配站点">请看这里</a>',
|
||||
id: 'oldnewsites',
|
||||
intro: '从 1.1.3 开始,此功能转移到 <b>站点管理</b> 选项卡里面,此功能已废除。',
|
||||
},
|
||||
{
|
||||
id: 'clear',
|
||||
@ -159,7 +159,7 @@ const version = browser.runtime.getManifest().version.replace( /.\d{2,}/, "" ),
|
||||
},
|
||||
{
|
||||
id: 'highlight',
|
||||
intro: '当某些页面未适配或已适配的阅读不符合期望,可以通过 <b>手动框选高亮</b> 的方式重新生成阅读模式,详细说明 <a target="_blank" href="http://ksria.com/simpread/docs/#/手动框选">请看这里</a> 。',
|
||||
intro: '在 <b>手动框选</b> 方式的基础上增加了 <b>二次确认模式</b>,此模式专门针对页面极其复杂的情况,详细说明 <a target="_blank" href="http://ksria.com/simpread/docs/#/手动框选">请看这里</a> 。',
|
||||
},
|
||||
{
|
||||
id: 'toc',
|
||||
@ -167,7 +167,7 @@ const version = browser.runtime.getManifest().version.replace( /.\d{2,}/, "" ),
|
||||
},
|
||||
{
|
||||
id: 'readauto',
|
||||
intro: '简悦会检测当前页面是否符合阅读模式,如果可以生成阅读模式的话,启用此选项后会自动进入到阅读模式,详细说明 <a target="_blank" href="http://ksria.com/simpread/docs/#/目录">请看这里</a> 。<br>注意:此功能仅限 <b>适配列表支持的站点</b> 自动进入。',
|
||||
intro: '如果当前 <a target="_blank" href="http://ksria.com/simpread/docs/#/站点适配源">站点已适配</a> 的话,启用此选项后会自动进入到阅读模式,详细说明 <a target="_blank" href="http://ksria.com/simpread/docs/#/适配站点">请看这里</a> 。',
|
||||
},
|
||||
{
|
||||
id: 'exclusion',
|
||||
@ -211,6 +211,10 @@ const version = browser.runtime.getManifest().version.replace( /.\d{2,}/, "" ),
|
||||
target: 'sites',
|
||||
idx: 2,
|
||||
items: [
|
||||
{
|
||||
id: 'newsites',
|
||||
intro: '简悦每隔一段时间会自动同步适配列表,你也可以手动同步。<br>什么是适配列表?详细说明 <a target="_blank" href="http://ksria.com/simpread/docs/#/适配站点">请看这里</a> 。',
|
||||
},
|
||||
{
|
||||
id: 'customsites',
|
||||
intro: '从 1.1.3 开始,简悦调整了第三方适配的规则:仅针对个人的适配源,关于这部分的详细说明 <a target="_blank" href="http://ksria.com/simpread/docs/#/站点适配源?id=第三方适配源">请看这里</a> 。<br><b>注意:</b> 如果你使用了自己的适配源,请先清除再导入。',
|
||||
@ -221,7 +225,7 @@ const version = browser.runtime.getManifest().version.replace( /.\d{2,}/, "" ),
|
||||
},
|
||||
{
|
||||
id: 'personsites',
|
||||
intro: '简悦用户自行上传且未收录到 <a target="_blank" href="http://ksria.com/simpread/docs/#/站点适配源?id=官方(主)适配源">官方适配源</a> 里面的适配站点,可以在这里对这些站点进行安装,删除,更新等操作,详细说明 <a target="_blank" href="http://ksria.com/simpread/docs/#/站点集市">请看这里</a> 。',
|
||||
intro: '简悦用户自行上传且未收录到 <a target="_blank" href="http://ksria.com/simpread/docs/#/站点适配源?id=官方适配源">官方适配源</a> 里面的适配站点,可以在这里对这些站点进行安装,删除,更新等操作,详细说明 <a target="_blank" href="http://ksria.com/simpread/docs/#/站点集市">请看这里</a> 。',
|
||||
}
|
||||
]
|
||||
},
|
||||
@ -414,7 +418,9 @@ function Verify( curver, data ) {
|
||||
data.option.save_at = "dropbox";
|
||||
data.option.notice = true;
|
||||
data.option.preload = true;
|
||||
data.option.lazyload = [];
|
||||
data.option.lazyload = [
|
||||
"baidu.com", "weibo.com", "youtube.com"
|
||||
];
|
||||
data.option.uninstall = true;
|
||||
|
||||
data.statistics.service.yuque = 0;
|
||||
@ -494,6 +500,31 @@ function FixSubver( patch, target ) {
|
||||
return target;
|
||||
}
|
||||
|
||||
/**
|
||||
* Verify current version plugins
|
||||
*
|
||||
* @param {string} version
|
||||
* @param {object} option
|
||||
*/
|
||||
function VerifyPlugins( ver, option ) {
|
||||
try {
|
||||
if ( option.plugins.length == 0 ) return false;
|
||||
const str = option.plugins.join( "," );
|
||||
if ( ver == "1.1.3" ) {
|
||||
const newStr = str.replace( /(E0j1nYBmDD,?|SumEaxStWE,?|UsayAKSuwe,?)/g, "" );
|
||||
if ( str != newStr ) {
|
||||
option.plugins = newStr.replace( /,$/, "" ).split( "," );
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
} catch( error ) {
|
||||
console.error( "version::VerifyPlugin catch", error )
|
||||
} finally {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
export {
|
||||
version,
|
||||
tips,
|
||||
@ -502,4 +533,5 @@ export {
|
||||
Notify,
|
||||
Compare,
|
||||
FixSubver,
|
||||
VerifyPlugins,
|
||||
}
|
||||
@ -1,4 +1,4 @@
|
||||
console.log( "=== simpread storage load ===" )
|
||||
console.log( "=== simpread watch load ===" )
|
||||
|
||||
import * as msg from 'message';
|
||||
import {br,browser}from 'browser';
|
||||
|
||||
2
src/vender/puread/puplugin.min.js
vendored
2
src/vender/puread/puplugin.min.js
vendored
File diff suppressed because one or more lines are too long
2
src/vender/puread/puread.min.js
vendored
2
src/vender/puread/puread.min.js
vendored
File diff suppressed because one or more lines are too long
@ -138,7 +138,7 @@ const webpack = require( 'webpack' ),
|
||||
'exclude',
|
||||
'name',
|
||||
'url',
|
||||
'modals',
|
||||
'setting',
|
||||
|
||||
// olny options
|
||||
//'welcome',
|
||||
@ -268,7 +268,7 @@ const webpack = require( 'webpack' ),
|
||||
schedule : __dirname + '/src/read/progressbar.jsx',
|
||||
|
||||
keyboard : __dirname + '/src/module/keyboard.js',
|
||||
modals : __dirname + '/src/module/modals.jsx',
|
||||
setting : __dirname + '/src/module/setting.jsx',
|
||||
focusopt : __dirname + '/src/module/focus.jsx',
|
||||
readopt : __dirname + '/src/module/read.jsx',
|
||||
commonopt : __dirname + '/src/module/common.jsx',
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user