first commit

This commit is contained in:
编码猿
2024-09-27 01:11:00 +08:00
commit ebaaceaa05
122 changed files with 11359 additions and 0 deletions

24
.gitignore vendored Normal file
View File

@@ -0,0 +1,24 @@
.DS_Store
node_modules
build
dist/node_modules
test
note
# local env files
.env.local
.env.*.local
# Log files
npm-debug.log*
yarn-debug.log*
yarn-error.log*
# Editor directories and files
.idea
.vscode
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?
/.idea/

1
.pydio Normal file
View File

@@ -0,0 +1 @@
1226b7fa-3e0e-4c2a-b938-d1c7984f6abc

201
LICENSE Normal file
View File

@@ -0,0 +1,201 @@
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.
"Licensor" shall mean the copyright owner or entity authorized by
the copyright owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.
"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.
"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.
2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form.
3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.
4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:
(a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and
(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and
(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and
(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.
You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.
5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.
6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.
8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf
of any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.
END OF TERMS AND CONDITIONS
APPENDIX: How to apply the Apache License to your work.
To apply the Apache License to your work, attach the following
boilerplate notice, with the fields enclosed by brackets "[]"
replaced with your own identifying information. (Don't include
the brackets!) The text should be enclosed in the appropriate
comment syntax for the file format. We also recommend that a
file or class name and description of purpose be included on the
same "printed page" as the copyright notice for easier
identification within third-party archives.
Copyright [yyyy] [name of copyright owner]
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

132
README.md Normal file
View File

@@ -0,0 +1,132 @@
<p align="center">
<img src="./buildAssets/icons/pic.png" width="150px" height="150px"/>
</p>
<p align="center">
PutToHtml开发中未正式发布...
</p>
<p align="center">
<a href="https://nodejs.org/en/download/"><img src="https://img.shields.io/badge/node.js-12.13.1-blue.svg"
alt="nodejs"></a>
<a href="https://www.tslang.cn/"><img src="https://img.shields.io/badge/typescript-3.7.2-red.svg"
alt="typescript"></a>
<a href="https://electronjs.org/"><img src="https://img.shields.io/badge/electronjs-7.1.2-yellow.svg" alt="electronjs"></a>
</p>
## 简介
`PugToHtml` 是一款跨平台的`Pug`转换工具,基于`Typescript`, `electron`进行开发。它支持主流的`Linux` / `Mac` / `Windows` 等操作系统在各个系统上具有统一优秀的表现力。界面设计采用简洁扁平大量留白的UI风格遵守简单简约但是功能丰富的设计原则。让用户沉浸在代码的编辑中不受叨扰。同时支持丰富的样式自定义开机自启电量显示实时时间显示等。
> 满足你张扬的个性。
## 已实现功能
- 1: 启动欢迎页
- 2: 实时电量显示
- 3: 实时时间显示
- 4: Html, Pug/Jade 文件本地上传,相互转换
- 5: MacOs TouchBar 快速操作
- 6: 清空输入框
- 7: 主题样式切换
- 8: 字体大小设置
- 9: 自定义主题样式设置
- 10: 开机自启window 上有bugMacOs正常Linux各发行版本未测试
- 11: 检查更新
**项目地址:**
- 1源码地址https://github.com/helpcode/PugToHtml
- 2Mac 下载:[http://static.geekhelp.cn/PugToHtml-1.0.3-mac.7z](http://static.geekhelp.cn/PugToHtml-1.0.3-mac.7z)
- 3Win 下载:[http://static.geekhelp.cn/PugToHtml-1.0.4-win.7z](http://static.geekhelp.cn/PugToHtml-1.0.4-win.7z)
- 4Linux 下载【暂无打包...如果有需要请Github留言】
## 截图欣赏
说得再多无图无真相,不说了,下面先放图!
1MacOs dmg 安装包
<p align="center">
   <img width="90%" height="90%" src="./buildAssets/img/1.png"/>
</p>
2欢迎页面-1
<p align="center">
<img width="90%" height="90%" src="./buildAssets/img/2.png"/>
</p>
3欢迎页面-2
<p align="center">
<img width="90%" height="90%" src="./buildAssets/img/3.png"/>
</p>
4首页-默认主题 默认白
<p align="center">
<img width="90%" height="90%" src="./buildAssets/img/4.png"/>
</p>
5首页-默认主题 默认黑
<p align="center">
<img width="90%" height="90%" src="./buildAssets/img/5.png"/>
</p>
6设置页面-主题切换 治愈绿
<p align="center">
<img width="90%" height="90%" src="./buildAssets/img/6.png"/>
</p>
7设置页面-样式设置
<p align="center">
<img width="90%" height="90%" src="./buildAssets/img/7.png"/>
</p>
8设置页面-关于软件
<p align="center">
<img width="90%" height="90%" src="./buildAssets/img/8.png"/>
</p>
9设置页面-关于PugToHtml
<p align="center">
<img width="90%" height="90%" src="./buildAssets/img/9.png"/>
</p>
## 安装构建
1下载源码
```bash
git clone https://gitee.com/bmycode/HtmlToPug.git
```
2解决依赖
```bash
cnpm i
```
3Ts编译&Gulp编译(开发阶段必须运行)
```bash
npm run dev
```
4查看客户端效果(开发阶段使用)
```bash
npm run el
```
**注意,打包项目发布需要进入`dist`文件夹先执行`cnpm i`,然后在执行下面命令,请一定记住!!!!!**
5MacOs打包
```bash
npm run mac
```
6Window打包
```bash
npm run win
```

1
Website/.pydio Normal file
View File

@@ -0,0 +1 @@
24dfac02-a64a-48e6-8c32-8ac78b05ed5a

28
Website/index.js Normal file
View File

@@ -0,0 +1,28 @@
const express = require('express');
const app = express();
const path = require("path");
let package = require('./package.json');
app.use(express.static(path.join(__dirname, 'static')));
app.get('/checkUpload', (req, res) => {
let updateVersion = package.updateVersion;
let status = null;
updateVersion.forEach((val,index) => {
if(val.version == req.query.v) {
if(index == updateVersion.length -1) {
status = {
code: 200,
result: "当前已是最新版本"
}
} else {
status = updateVersion[updateVersion.length-1]
}
}
});
res.json(status)
});
app.listen(9000, () => {
console.log('Example app listening on port 9000!')
});

30
Website/package.json Normal file
View File

@@ -0,0 +1,30 @@
{
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"updateVersion": [
{
"id": 1,
"version": "1.0.0",
"downUrl": "http://127.0.0.1:9000/PugToHtml-1.0.3-mac.zip",
"introduce": [
{ "id": 1, "text": "项目第一次上传" },
{ "id": 2, "text": "实现核心功能" }
]
},
{
"id": 2,
"version": "1.0.3",
"downUrl": "http://127.0.0.1:9000/PugToHtml-1.0.3-mac.zip",
"introduce": [
{ "id": 1, "text": "实现开机自启" },
{ "id": 2, "text": "实现主题切换" },
{ "id": 3, "text": "实现检查更新功能" },
{ "id": 4, "text": "实现启动欢迎页面" }
]
}
],
"dependencies": {
"express": "^4.17.1"
}
}

1
Website/static/.pydio Normal file
View File

@@ -0,0 +1 @@
2a836718-5e5b-487c-80bd-1e774ad236d8

1
buildAssets/.pydio Normal file
View File

@@ -0,0 +1 @@
de60a048-b576-4f85-98a6-4501efda50a3

1
buildAssets/icons/.pydio Normal file
View File

@@ -0,0 +1 @@
73a1ff6a-1a1a-438d-bb56-85236dac6679

View File

@@ -0,0 +1 @@
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1577734868187" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="5275" xmlns:xlink="http://www.w3.org/1999/xlink" width="80" height="80"><defs><style type="text/css"></style></defs><path d="M511.936 559.104l-169.344 169.344a32 32 0 0 1-22.4 9.6 32 32 0 0 1-22.72-54.72l169.344-169.344-169.344-169.344a32 32 0 0 1 45.12-45.12l169.344 169.312L681.6 299.2a32 32 0 1 1 45.12 45.12l-169.632 169.664 169.632 169.664a32 32 0 0 1-22.4 54.4 32 32 0 0 1-22.72-9.28l-169.664-169.664z" p-id="5276"></path></svg>

After

Width:  |  Height:  |  Size: 684 B

BIN
buildAssets/icons/html.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 53 KiB

BIN
buildAssets/icons/icon.icns Normal file

Binary file not shown.

View File

@@ -0,0 +1 @@
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1577734908119" class="icon" viewBox="0 0 1365 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="6208" xmlns:xlink="http://www.w3.org/1999/xlink" width="106.640625" height="80"><defs><style type="text/css"></style></defs><path d="M1140.982158 0C1171.511117 0 1196.259731 24.748613 1196.259731 55.277574L1196.259731 481.802069C1196.259731 512.331031 1171.511117 537.079644 1140.982158 537.079644 1110.453196 537.079644 1085.704583 512.331031 1085.704583 481.802069L1085.704583 55.277574 1140.982158 110.555148 707.290659 110.555148C676.761697 110.555148 652.013084 85.806535 652.013084 55.277574 652.013084 24.748613 676.761697 0 707.290659 0L1140.982158 0ZM223.896216 1024.028434C193.367257 1024.028434 168.618642 999.279821 168.618642 968.75086L168.618642 542.226364C168.618642 511.697403 193.367257 486.94879 223.896216 486.94879 254.425178 486.94879 279.17379 511.697403 279.17379 542.226364L279.17379 968.75086 223.896216 913.473286 657.587715 913.473286C688.116677 913.473286 712.865289 938.221898 712.865289 968.75086 712.865289 999.279821 688.116677 1024.028434 657.587715 1024.028434L223.896216 1024.028434Z" p-id="6209"></path></svg>

After

Width:  |  Height:  |  Size: 1.3 KiB

View File

@@ -0,0 +1 @@
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1577734892899" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="5735" xmlns:xlink="http://www.w3.org/1999/xlink" width="80" height="80"><defs><style type="text/css"></style></defs><path d="M65.23884 456.152041 958.760137 456.152041l0 111.695918L65.23884 567.847959 65.23884 456.152041z" p-id="5736"></path></svg>

After

Width:  |  Height:  |  Size: 498 B

BIN
buildAssets/icons/pic.ico Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 27 KiB

BIN
buildAssets/icons/pic.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 123 KiB

BIN
buildAssets/icons/pug.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 108 KiB

View File

@@ -0,0 +1 @@
1d26a0ba-284c-41a9-832a-19fdb7dc0cc6

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 31 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 31 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 75 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 75 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 75 KiB

1
buildAssets/img/.pydio Normal file
View File

@@ -0,0 +1 @@
bc9d5074-f4e1-477a-aae3-a8eb470e14c2

BIN
buildAssets/img/1.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 768 KiB

BIN
buildAssets/img/2.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.9 MiB

BIN
buildAssets/img/3.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 MiB

BIN
buildAssets/img/4.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.6 MiB

BIN
buildAssets/img/5.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.7 MiB

BIN
buildAssets/img/6.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.9 MiB

BIN
buildAssets/img/7.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.9 MiB

BIN
buildAssets/img/8.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.9 MiB

BIN
buildAssets/img/9.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.0 MiB

1
buildAssets/mac/.pydio Normal file
View File

@@ -0,0 +1 @@
857ea4b1-dd83-4e2e-a667-c09929f771a1

View File

@@ -0,0 +1 @@
这是许可license.txt

View File

@@ -0,0 +1,2 @@
欢迎使用PugToHtml这是一款个人开发的Pug/Jade和Html相互转换的工具不喜欢用网页版所以自己开发。
欢迎访问项目Github主页https://github.com/helpcode还请点个star鼓励一下本人

1
buildAssets/win/.pydio Normal file
View File

@@ -0,0 +1 @@
a33d507f-914d-4069-bcaa-e9edd92dce92

View File

@@ -0,0 +1,394 @@
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; 头文件
!include "MUI.nsh"
!include "Sections.nsh"
!include "LogicLib.nsh"
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; 宏定义
!define STR_AppName "CuteFoto"
!define STR_Version "2.2.240"
!define STR_Publisher "Yonsm.NET"
!define STR_HomepageUrl "http://Yonsm.zj.com"
!define REG_AppPath "Software\Microsoft\Windows\CurrentVersion\App Paths\${STR_AppName}.exe"
!define REG_Uninstall "Software\Microsoft\Windows\CurrentVersion\Uninstall\${STR_AppName}"
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; MUI 设置
!define MUI_ABORTWARNING
!define MUI_ICON "${NSISDIR}\Contrib\Graphics\Icons\orange-install.ico"
!define MUI_UNICON "${NSISDIR}\Contrib\Graphics\Icons\orange-uninstall.ico"
!define MUI_WELCOMEFINISHPAGE_BITMAP "${NSISDIR}\Contrib\Graphics\Wizard\orange.bmp"
!define MUI_UNWELCOMEFINISHPAGE_BITMAP "${NSISDIR}\Contrib\Graphics\Wizard\orange-uninstall.bmp"
!define MUI_HEADERIMAGE
!define MUI_HEADERIMAGE_BITMAP "${NSISDIR}\Contrib\Graphics\Header\orange.bmp"
!define MUI_HEADERIMAGE_UNBITMAP "${NSISDIR}\Contrib\Graphics\Header\orange-uninstall.bmp"
; 组件页面设置
!define MUI_COMPONENTSPAGE_SMALLDESC
; 完成安装页面设置
!define MUI_FINISHPAGE_RUN "$INSTDIR\${STR_AppName}.exe"
!define MUI_FINISHPAGE_SHOWREADME "$INSTDIR\${STR_AppName}.chm"
!define MUI_FINISHPAGE_SHOWREADME_TEXT "$(LNG_ShowHelp)"
!define MUI_FINISHPAGE_LINK "${STR_AppName} $(LNG_Homepage): ${STR_HomepageUrl}"
!define MUI_FINISHPAGE_LINK_LOCATION "${STR_HomepageUrl}"
; 语言选择设置
!define MUI_LANGDLL_REGISTRY_ROOT "HKLM"
!define MUI_LANGDLL_REGISTRY_KEY "${REG_Uninstall}"
!define MUI_LANGDLL_REGISTRY_VALUENAME "NSIS:Language"
; 安装页面
!insertmacro MUI_PAGE_WELCOME
!insertmacro MUI_PAGE_LICENSE "$(LNG_License)"
!insertmacro MUI_PAGE_COMPONENTS
!insertmacro MUI_PAGE_DIRECTORY
!insertmacro MUI_PAGE_INSTFILES
!insertmacro MUI_PAGE_FINISH
; 卸载页面
!insertmacro MUI_UNPAGE_WELCOME
!insertmacro MUI_UNPAGE_CONFIRM
!insertmacro MUI_UNPAGE_INSTFILES
!insertmacro MUI_UNPAGE_FINISH
; 语言支持
!insertmacro MUI_LANGUAGE "English"
!insertmacro MUI_LANGUAGE "SimpChinese"
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; 语言相关字符串
LicenseLangString LNG_License ${LANG_ENGLISH} "EULA.ENU.rtf"
LangString LNG_BrandingText ${LANG_ENGLISH} "Expert -> Professional -> Absorbedly"
LangString LNG_DefaultInstation ${LANG_ENGLISH} "Default installtion"
LangString LNG_FullInstation ${LANG_ENGLISH} "Full installtion"
LangString LNG_MinimalInstation ${LANG_ENGLISH} "Minimal installtion"
LangString LNG_Help ${LANG_ENGLISH} "Help"
LangString LNG_Homepage ${LANG_ENGLISH} "Homepage"
LangString LNG_Uninstall ${LANG_ENGLISH} "Uninstall"
LangString LNG_ShowHelp ${LANG_ENGLISH} "Show Help"
LangString LNG_ProgramFile ${LANG_ENGLISH} "Program Files"
LangString LNG_LanguageFile ${LANG_ENGLISH} "Language Files"
LangString LNG_CreateShortcut ${LANG_ENGLISH} "Create Shortcut"
LangString LNG_ProgramMenuShortcutGroup ${LANG_ENGLISH} "Program Menu Shortcut Group"
LangString LNG_DesktopShortcut ${LANG_ENGLISH} "Desktop Shortcut"
LangString LNG_ProgramMenuShortcut ${LANG_ENGLISH} "Program Menu Shortcut"
LangString LNG_StartMenuShortcut ${LANG_ENGLISH} "Start Menu Shortcut"
LangString LNG_QuickLaunchShortcut ${LANG_ENGLISH} "Quick Launch Bar Shortcut"
LangString LNG_ProgramFileDesc ${LANG_ENGLISH} "Install ${STR_AppName} program files."
LangString LNG_LanguageFileDesc ${LANG_ENGLISH} "Install ${STR_AppName} language files."
LangString LNG_CreateShortcutDesc ${LANG_ENGLISH} "Create shortcuts to launch the program easy."
LangString LNG_X86AsciiDesc ${LANG_ENGLISH} "ASCII version on WIN32 platform for X86 architecture (The only choice on WIN9X OS for X86 architecture)."
LangString LNG_X86UnicodeDesc ${LANG_ENGLISH} "Unicode version on WIN32 platform for X86 architecture (Preferred on WINNT OS for X86 architecture)."
LangString LNG_X64UnicodeDesc ${LANG_ENGLISH} "Unicode version on WIN64 platform for X64 architecture (Preferred on WIN64 OS for X64 architecture)."
LicenseLangString LNG_License ${LANG_SIMPCHINESE} "EULA.CHS.rtf"
LangString LNG_BrandingText ${LANG_SIMPCHINESE} "专家 -> 专业 -> 专心"
LangString LNG_DefaultInstation ${LANG_SIMPCHINESE} "默认安装"
LangString LNG_FullInstation ${LANG_SIMPCHINESE} "完全安装"
LangString LNG_MinimalInstation ${LANG_SIMPCHINESE} "最小安装"
LangString LNG_Help ${LANG_SIMPCHINESE} "帮助"
LangString LNG_Homepage ${LANG_SIMPCHINESE} "主页"
LangString LNG_Uninstall ${LANG_SIMPCHINESE} "卸载"
LangString LNG_ShowHelp ${LANG_SIMPCHINESE} "查看帮助"
LangString LNG_ProgramFile ${LANG_SIMPCHINESE} "程序文件"
LangString LNG_LanguageFile ${LANG_SIMPCHINESE} "语言文件"
LangString LNG_CreateShortcut ${LANG_SIMPCHINESE} "创建快捷方式"
LangString LNG_ProgramMenuShortcutGroup ${LANG_SIMPCHINESE} "程序菜单快捷方式组"
LangString LNG_DesktopShortcut ${LANG_SIMPCHINESE} "桌面快捷方式"
LangString LNG_ProgramMenuShortcut ${LANG_SIMPCHINESE} "程序菜单快捷方式"
LangString LNG_StartMenuShortcut ${LANG_SIMPCHINESE} "开始菜单快捷方式"
LangString LNG_QuickLaunchShortcut ${LANG_SIMPCHINESE} "快速启动栏快捷方式"
LangString LNG_ProgramFileDesc ${LANG_SIMPCHINESE} "安装 ${STR_AppName} 程序文件。"
LangString LNG_LanguageFileDesc ${LANG_SIMPCHINESE} "安装 ${STR_AppName} 语言文件。"
LangString LNG_CreateShortcutDesc ${LANG_SIMPCHINESE} "创建用于快速访问的快捷方式。"
LangString LNG_X86AsciiDesc ${LANG_SIMPCHINESE} "安装 X86 架构 WIN32 平台上的 ASCII 版本。这是在 X86 架构 WIN9X 类操作系统中的唯一选择。"
LangString LNG_X86UnicodeDesc ${LANG_SIMPCHINESE} "安装 X86 架构 WIN32 平台上的 UNICODE 版本。这是在 X86 架构 WINNT 类操作系统中的优先选择。"
LangString LNG_X64UnicodeDesc ${LANG_SIMPCHINESE} "安装 X64 架构 WIN64 平台上的 UNICODE 版本。这是在 X64 架构 WIN64 类操作系统中的优先选择。"
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; 杂项
Name "${STR_AppName} ${STR_Version}"
OutFile "${STR_AppName}.${STR_Version}.exe"
InstallDir "$PROGRAMFILES\${STR_AppName}"
InstallDirRegKey HKLM "${REG_AppPath}" ""
ShowInstDetails SHOW
ShowUnInstDetails SHOW
BrandingText "$(LNG_BrandingText)"
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; 安装类型
!ifndef NOINSTTYPES
InstType "$(LNG_DefaultInstation)"
InstType "$(LNG_FullInstation)"
InstType "$(LNG_MinimalInstation)"
!endif
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; 程序文件
Section
SectionEnd
SectionGroup /e "$(LNG_ProgramFile)" SEC_ProgramFile
Section "-HelpFile" SEC_HelpFile
SetOutPath "$INSTDIR"
SetOverwrite ON
File "..\Help\CuteFoto.chm"
SectionEnd
Section "X86 ASCII" SEC_X86Ascii
SectionIn 1 2 3
File "..\Release\CuteFoto.exe"
SectionEnd
Section "X86 UNICODE" SEC_X86Unicode
SectionIn 5 RO
File "..\Unicode\Release\CuteFoto.exe"
SectionEnd
Section "X64 UNICODE" SEC_X64Unicode
SectionIn 5 RO
File "..\AMD64\Release\CuteFoto.exe"
SectionEnd
SectionGroupEnd
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; 语言文件
SectionGroup "$(LNG_LanguageFile)" SEC_LanguageFile
Section "English" SEC_English
SectionIn 2
File "..\Release\English.lng"
SectionEnd
Section "CAPITAL ENGLISH" SEC_CapitalEnglish
SectionIn 1 2
File "..\Release\English (Capital).lng"
SectionEnd
Section "简体中文" SEC_SimplifiedChinese
SectionIn 1 2
File "..\Release\Chinese (Simplified).lng"
SectionEnd
SectionGroupEnd
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; 快捷方式
SectionGroup "$(LNG_CreateShortcut)" SEC_Shortcut
SectionGroup "$(LNG_ProgramMenuShortcutGroup)" SEC_ProgramMenuShortcutGroup
Section "${STR_AppName}" SEC_AppNameShortcut
SectionIn 1 2
CreateDirectory "$SMPROGRAMS\${STR_AppName}"
CreateShortCut "$SMPROGRAMS\${STR_AppName}\${STR_AppName}.lnk" "$INSTDIR\${STR_AppName}.exe"
SectionEnd
Section "${STR_AppName} $(LNG_Help)" SEC_HelpShortcut
SectionIn 1 2
CreateDirectory "$SMPROGRAMS\${STR_AppName}"
CreateShortCut "$SMPROGRAMS\${STR_AppName}\${STR_AppName} $(LNG_Help).lnk" "$INSTDIR\${STR_AppName}.chm"
SectionEnd
Section "${STR_AppName} $(LNG_Homepage)" SEC_HomePageShortcut
SectionIn 1 2
CreateDirectory "$SMPROGRAMS\${STR_AppName}"
WriteINIStr "$SMPROGRAMS\${STR_AppName}\${STR_AppName} $(LNG_Homepage).url" "InternetShortcut" "URL" "${STR_HomepageUrl}"
SectionEnd
Section "$(LNG_Uninstall) ${STR_AppName}" SEC_UninstallShortcut
SectionIn 1 2
CreateDirectory "$SMPROGRAMS\${STR_AppName}"
CreateShortCut "$SMPROGRAMS\${STR_AppName}\$(LNG_Uninstall) ${STR_AppName}.lnk" "$INSTDIR\Uninstall ${STR_AppName}.exe"
SectionEnd
SectionGroupEnd
Section "$(LNG_DesktopShortcut)" SEC_DesktopShortcut
SectionIn 1 2
CreateShortCut "$DESKTOP\${STR_AppName}.lnk" "$INSTDIR\${STR_AppName}.exe"
SectionEnd
Section "$(LNG_ProgramMenuShortcut)" SEC_ProgramMenuShortcut
SectionIn 2
CreateShortCut "$SMPROGRAMS\${STR_AppName}.lnk" "$INSTDIR\${STR_AppName}.exe"
SectionEnd
Section "$(LNG_StartMenuShortcut)" SEC_StartMenuShortcut
SectionIn 2
CreateShortCut "$STARTMENU\${STR_AppName}.lnk" "$INSTDIR\${STR_AppName}.exe"
SectionEnd
Section "$(LNG_QuickLaunchShortcut)" SEC_QuickLaunchShortcut
SectionIn 2
CreateShortCut "$QUICKLAUNCH\${STR_AppName}.lnk" "$INSTDIR\${STR_AppName}.exe"
SectionEnd
SectionGroupEnd
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; 完成安装
Section "-PostInstall"
WriteUninstaller "$INSTDIR\Uninstall ${STR_AppName}.exe"
WriteRegStr HKLM "${REG_AppPath}" "" "$INSTDIR\CuteFoto.exe"
WriteRegStr HKLM "${REG_Uninstall}" "DisplayName" "$(^Name)"
WriteRegStr HKLM "${REG_Uninstall}" "UninstallString" "$INSTDIR\Uninstall ${STR_AppName}.exe"
WriteRegStr HKLM "${REG_Uninstall}" "DisplayIcon" "$INSTDIR\CuteFoto.exe"
WriteRegStr HKLM "${REG_Uninstall}" "DisplayVersion" "${STR_Version}"
WriteRegStr HKLM "${REG_Uninstall}" "URLInfoAbout" "${STR_HomepageUrl}"
WriteRegStr HKLM "${REG_Uninstall}" "Publisher" "${STR_Publisher}"
SectionEnd
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; 卸载
Section "Uninstall"
Delete /REBOOTOK "$SMPROGRAMS\${STR_AppName}\${STR_AppName}.lnk"
Delete /REBOOTOK "$SMPROGRAMS\${STR_AppName}\${STR_AppName} $(LNG_Help).lnk"
Delete /REBOOTOK "$SMPROGRAMS\${STR_AppName}\${STR_AppName} $(LNG_Homepage).url"
Delete /REBOOTOK "$SMPROGRAMS\${STR_AppName}\$(LNG_Uninstall) ${STR_AppName}.lnk"
Delete /REBOOTOK "$DESKTOP\${STR_AppName}.lnk"
Delete /REBOOTOK "$SMPROGRAMS\${STR_AppName}.lnk"
Delete /REBOOTOK "$STARTMENU\${STR_AppName}.lnk"
Delete /REBOOTOK "$QUICKLAUNCH\${STR_AppName}.lnk"
Delete /REBOOTOK "$INSTDIR\${STR_AppName}.exe"
Delete /REBOOTOK "$INSTDIR\${STR_AppName}.chm"
Delete /REBOOTOK "$INSTDIR\English.lng"
Delete /REBOOTOK "$INSTDIR\English (Capital).lng"
Delete /REBOOTOK "$INSTDIR\Chinese (Simplified).lng"
Delete /REBOOTOK "$INSTDIR\${STR_AppName}.ini"
Delete /REBOOTOK "$INSTDIR\Uninstall ${STR_AppName}.exe"
RMDir /REBOOTOK "$SMPROGRAMS\${STR_AppName}"
RMDir /REBOOTOK "$INSTDIR"
DeleteRegKey HKLM "${REG_Uninstall}"
DeleteRegKey HKLM "${REG_AppPath}"
SetAutoClose True
SectionEnd
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; 节描述
!insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN
!insertmacro MUI_DESCRIPTION_TEXT ${SEC_ProgramFile} "$(LNG_ProgramFileDesc)"
!insertmacro MUI_DESCRIPTION_TEXT ${SEC_LanguageFile} "$(LNG_LanguageFileDesc)"
!insertmacro MUI_DESCRIPTION_TEXT ${SEC_Shortcut} "$(LNG_CreateShortcutDesc)"
!insertmacro MUI_DESCRIPTION_TEXT ${SEC_X86Ascii} "$(LNG_X86AsciiDesc)"
!insertmacro MUI_DESCRIPTION_TEXT ${SEC_X86Unicode} "$(LNG_X86UnicodeDesc)"
!insertmacro MUI_DESCRIPTION_TEXT ${SEC_X64Unicode} "$(LNG_X64UnicodeDesc)"
!insertmacro MUI_DESCRIPTION_TEXT ${SEC_English} "Install language file: English (For translation only)."
!insertmacro MUI_DESCRIPTION_TEXT ${SEC_CapitalEnglish} "INSTALL LANGUAGE FILE: CAPITAL ENGLISH."
!insertmacro MUI_DESCRIPTION_TEXT ${SEC_SimplifiedChinese} "安装语言文件: 简体中文。"
!insertmacro MUI_DESCRIPTION_TEXT ${SEC_ProgramMenuShortcutGroup} "$(LNG_CreateShortcutDesc)"
!insertmacro MUI_DESCRIPTION_TEXT ${SEC_DesktopShortcut} "$(LNG_CreateShortcutDesc)"
!insertmacro MUI_DESCRIPTION_TEXT ${SEC_ProgramMenuShortcut} "$(LNG_CreateShortcutDesc)"
!insertmacro MUI_DESCRIPTION_TEXT ${SEC_StartMenuShortcut} "$(LNG_CreateShortcutDesc)"
!insertmacro MUI_DESCRIPTION_TEXT ${SEC_QuickLaunchShortcut} "$(LNG_CreateShortcutDesc)"
!insertmacro MUI_DESCRIPTION_TEXT ${SEC_AppNameShortcut} "$(LNG_CreateShortcutDesc)"
!insertmacro MUI_DESCRIPTION_TEXT ${SEC_HelpShortcut} "$(LNG_CreateShortcutDesc)"
!insertmacro MUI_DESCRIPTION_TEXT ${SEC_HomePageShortcut} "$(LNG_CreateShortcutDesc)"
!insertmacro MUI_DESCRIPTION_TEXT ${SEC_UninstallShortcut} "$(LNG_CreateShortcutDesc)"
!insertmacro MUI_FUNCTION_DESCRIPTION_END
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; 初始化回调函数
Function .onInit
StrCpy $1 ${SEC_X86Ascii}
ReadRegStr $0 HKLM "SOFTWARE\Microsoft\Windows NT\CurrentVersion" "CurrentVersion"
${If} $0 != ""
SectionSetInstTypes ${SEC_X86Ascii} 0
!insertmacro UnselectSection ${SEC_X86Ascii}
!insertmacro ClearSectionFlag ${SEC_X86Unicode} ${SF_RO}
ReadRegStr $0 HKLM "SYSTEM\CurrentControlSet\Control\Session Manager\Environment" "PROCESSOR_ARCHITECTURE"
${If} $0 != "AMD64"
SectionSetInstTypes ${SEC_X86Unicode} 7
!insertmacro SelectSection ${SEC_X86Unicode}
StrCpy $1 ${SEC_X86Unicode}
${Else}
SectionSetInstTypes ${SEC_X64Unicode} 7
!insertmacro ClearSectionFlag ${SEC_X64Unicode} ${SF_RO}
!insertmacro SelectSection ${SEC_X64Unicode}
StrCpy $1 ${SEC_X64Unicode}
${EndIf}
${EndIf}
!insertmacro MUI_LANGDLL_DISPLAY
FunctionEnd
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; 选择改变
Function .onSelChange
!insertmacro StartRadioButtons $1
!insertmacro RadioButton ${SEC_X86Ascii}
!insertmacro RadioButton ${SEC_X86Unicode}
!insertmacro RadioButton ${SEC_X64Unicode}
!insertmacro EndRadioButtons
FunctionEnd
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; 卸载初始化
Function un.onInit
!insertmacro MUI_UNGETLANGUAGE
FunctionEnd
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

41
gulpfile.js Normal file
View File

@@ -0,0 +1,41 @@
const gulp = require('gulp')
// 编译jade文件为hrml
const jade = require('gulp-jade')
// gulp 文件监听
const watch = require('gulp-watch')
// 处理gulp错误防止程序报错终止
const plumber = require('gulp-plumber')
const path = require('path')
/**
* 编译jade为html
*/
gulp.task('jade', function () {
return gulp.src("./src/view/main/*.jade")
.pipe(plumber({
errHandler: e => {
gutil.beep()
gutil.log(e)
}
}))
.pipe(jade({
pretty: true
}))
.pipe(gulp.dest("./dist/view/"))
})
gulp.task('copy', function() {
return gulp.src(['src/view/assets/**/*'], { base: 'src/' })
.pipe(gulp.dest('dist/'))
});
/**
* 监听用户在 src/ 的所有文件操作
*/
gulp.task('file', function () {
gulp.watch('src/view/**/*', gulp.parallel('jade'))
gulp.watch('src/view/assets/**/*', gulp.parallel('copy'))
});
gulp.task('default', gulp.series('file'))

8252
package-lock.json generated Normal file

File diff suppressed because it is too large Load Diff

29
package.json Normal file
View File

@@ -0,0 +1,29 @@
{
"name": "HtmlToPug",
"version": "1.0.0",
"description": "个人开发的一款Pug/Jade和Html相互转换的工具不喜欢用网页版所以自己开发。",
"main": "dist/run.js",
"scripts": {
"dev": "concurrently \"gulp\" \"tsc -w\" ",
"el": "electron .",
"mac": "electron-builder --mac --x64"
},
"keywords": [],
"author": "bmy",
"license": "ISC",
"devDependencies": {
"electron": "^7.1.1",
"electron-builder": "^21.2.0",
"gulp": "^4.0.2",
"gulp-jade": "^1.1.0",
"gulp-plumber": "^1.2.1",
"gulp-watch": "^5.0.1",
"gulp-watch-path": "^0.1.0"
},
"dependencies": {
"electron-updater": "^4.2.0",
"html2jade": "^0.8.6",
"pug": "^2.0.4",
"tslib": "^1.10.0"
}
}

1
src/.pydio Normal file
View File

@@ -0,0 +1 @@
b1a3fef0-142b-4575-9e4b-198f7ddd46bd

1
src/config/.pydio Normal file
View File

@@ -0,0 +1 @@
262871cf-fdef-418f-a161-d1f245e0e3bc

77
src/config/index.ts Normal file
View File

@@ -0,0 +1,77 @@
import path from "path";
export class Config {
// 是否为Mac系统
public static isMac: Boolean = process.platform === 'darwin';
// Github主页
public static Github: string = "https://github.com/helpcode";
// 应用升级地址
public static UpdateUrl: string = "http://192.168.0.101:9000/checkUpload?v=";
// 首页
public static StartUpPage: String = path.join(__dirname, "../view/index.html");
// 设置页面
public static SettingPage: String = path.join(__dirname, "../view/setting.html");
// 欢迎页面
public static WelcomePage: String = path.join(__dirname, "../view/welcome.html");
// 用户下载新版应用时候选择的保存路径
public static TemporarySavePath: String;
// 应用的当前版本,每次打包发布前需要改这个地址
public static currentVersion: String = '1.0.3'
// 欢迎页面的窗口配置
public static WelcomeConfig: Object = {
width: 250,
height: 316,
// titleBarStyle: 'hidden',
frame: false,
transparent: true,
webPreferences: {
nodeIntegration: true
}
};
// 首页页面的窗口配置
public static WindowsConfig: Object = {
width: 1200,
height: 760,
frame: false,
transparent: true,
// titleBarStyle: 'hidden',
webPreferences: {
nodeIntegration: true
}
};
// 设置页面页面的窗口配置
public static SettingWindow: Object = {
width: 607,
height: 427,
frame: false,
parent: null,
modal: true,
show: false,
resizable: false,
closable: true,
transparent: true,
webPreferences: {
nodeIntegration: true
}
};
public static FileType: object = {
HtmlFileConfig: {
title: '请选择HTML文件',
filters: [
{ name: 'Html', extensions: ['html', 'htmlx'] }
],
properties: ['openFile']
},
PugFileConfig: {
title: '请选择Pug/jade文件',
filters: [
{ name: 'Pug', extensions: ['jade', 'pug'] }
],
properties: ['openFile']
}
}
}

30
src/main.ts Normal file
View File

@@ -0,0 +1,30 @@
import { BrowserWindow } from "electron";
import { Config } from "./config/index";
import IndexWindow from "./module/ipcMain/IndexWindow";
import CreatedMenu from "./module/menu/menu";
export class createWindow {
public windows: any;
constructor() {
// @ts-ignore
this.windows = new BrowserWindow(Config.WelcomeConfig);
this.Start();
}
public async Start() {
CreatedMenu.buildFromTemplate(this.windows.webContents);
this.SetLoadFile();
this.RegistrationProcess();
}
// 加载启动页面
public SetLoadFile(): void {
this.windows.loadFile(Config.WelcomePage);
}
// 注册IndexWindow的ipc
public RegistrationProcess(): void {
IndexWindow.createdWindow(this.windows);
}
}

1
src/module/.pydio Normal file
View File

@@ -0,0 +1 @@
7c8cbb72-6167-4b36-a68b-5f918f18acf2

View File

@@ -0,0 +1 @@
9142ae4e-fbb4-4e6b-b1de-8bc5fbe9de1b

View File

@@ -0,0 +1,20 @@
import { ipcMain } from "electron";
import utils from "../utils/utils";
import { Config } from "../../config/index";
class FileUpload {
/**
* 文件选择的进程处理
*/
upload() {
ipcMain.on('openFile', async (event, arg) => {
// 决定用哪套配置去选择文件
// @ts-ignore
let params = arg == "html" ? Config.FileType.HtmlFileConfig : Config.FileType.PugFileConfig
// 使用系统自带文件选择对话框选中文件,获取选中文件路径
event.returnValue = await utils.OpenDialog(params)
})
}
}
export default new FileUpload();

View File

@@ -0,0 +1,64 @@
import { ipcMain } from "electron";
import utils from "../utils/utils";
import { Config } from "../../config/index";
import { app, BrowserWindow } from "electron";
import SettingWindow from "../../module/ipcMain/SettingWindow";
import MyTouchBar from "../touchbar/action";
import CreatedMenu from "../menu/menu";
import FileIpc from "./FileUpload";
import ThemeChange from "./ThemeChange";
import LoginStart from "./LoginStart";
import WindowAction from "./WindowAction";
class IndexWindow {
public IndexWin: any;
/**
* 创建主页窗口
* @param welcomeWindow
*/
createdWindow(welcomeWindow: any) {
ipcMain.on('openIndexWindow', async (event, arg) => {
this.IndexWin = new BrowserWindow(Config.WindowsConfig);
this.IndexWin.loadFile(Config.StartUpPage);
// 在打开主页前关闭欢迎页,
// 注册各种Ipc
welcomeWindow.close();
this.RegistrationProcess();
this.IndexWin.once('ready-to-show', () => {
this.IndexWin.show()
});
event.returnValue = "success"
})
}
/**
* 注册首页需要的一些Ipc
* @constructor
*/
public RegistrationProcess(): void {
WindowAction.action(this.IndexWin);
// 文件上传主进程
FileIpc.upload();
// 菜单进程
CreatedMenu.buildFromTemplate(this.IndexWin.webContents);
// touchbar进场
this.IndexWin.setTouchBar(MyTouchBar.getMyTouchBarItem(this.IndexWin.webContents));
/**
* 设置页面
*/
// 文件下载监听
utils.downFile(this.IndexWin)
// 创建设置页面
SettingWindow.createdWindow(this.IndexWin);
// 下载新版 ipc
SettingWindow.downVersion(this.IndexWin);
// 订阅macOS的原生的主题切换通知
ThemeChange.MacOsThemeChange();
// 开机自启
LoginStart.openLoginStart();
}
}
export default new IndexWindow();

View File

@@ -0,0 +1,30 @@
import { app, BrowserWindow, ipcMain } from "electron";
import path from "path";
class LoginStart {
openLoginStart() {
ipcMain.on('settingLoginStart', async (event, arg) => {
const appFolder = path.dirname(process.execPath)
const updateExe = path.resolve(appFolder, '..', 'PugToHtml.app')
const exeName = path.basename(process.execPath)
app.setLoginItemSettings({
openAtLogin: arg,
path: updateExe,
args: [
'--processStart', `"${exeName}"`,
'--process-start-args', `"--hidden"`
]
});
event.returnValue = "success"
})
}
}
export default new LoginStart();

View File

@@ -0,0 +1,87 @@
import { ipcMain } from "electron";
import utils from "../utils/utils";
import { Config } from "../../config/index";
import { app, BrowserWindow } from "electron";
import Net from "../../module/net/net";
class SettingWindow {
public SettingWin: any;
constructor() {
this.closedSetting();
this.check();
this.getVersion();
}
createdWindow(parentWindow: any) {
ipcMain.on('openWindow', async (event, arg) => {
// @ts-ignore
Config.SettingWindow.parent = parentWindow;
this.SettingWin = new BrowserWindow(Config.SettingWindow);
// @ts-ignore
this.SettingWin.loadFile(Config.SettingPage);
this.SettingWin.once('ready-to-show', () => {
this.SettingWin.show()
});
// setting.webContents.openDevTools();
event.returnValue = "success"
})
}
/**
* 下载最新版 被点击
* @param indexWindow
*/
downVersion(indexWindow: any) {
ipcMain.on('downVersion', async (event, arg) => {
let SavePath = await utils.SaveDialog(this.SettingWin, {
title: '下载提示',
message: '请选择软件的保存路径',
filters: [
{ name: 'All', extensions: ['*'] },
],
properties: ['openDirectory']
});
if(!SavePath.canceled) {
Config.TemporarySavePath = SavePath.filePath;
indexWindow.webContents.downloadURL(arg);
}
event.returnValue = "success";
})
}
/**
* 检测更新 被点击
*/
check() {
ipcMain.on('update', async (event, arg) => {
event.returnValue = await Net.get(`${Config.UpdateUrl}${Config.currentVersion}`)
})
}
/**
* 获取客户端默认版本号
*/
getVersion () {
ipcMain.on("getVersion", async (event, arg) => {
event.returnValue = Config.currentVersion;
})
}
/**
* 关闭设置页面
*/
closedSetting() {
ipcMain.on('closedWindow', async (event) => {
this.SettingWin.close();
event.returnValue = "success"
})
}
}
export default new SettingWindow();

View File

@@ -0,0 +1,23 @@
import { systemPreferences, nativeTheme} from "electron"
import {Config} from "@/config";
import { ipcMain } from "electron";
class ThemeChange {
MacOsThemeChange(): void {
ipcMain.on('getCurrentTheme', async (event, arg) => {
event.returnValue = nativeTheme.shouldUseDarkColors
});
// systemPreferences.subscribeNotification(
// 'AppleInterfaceThemeChangedNotification',
// function theThemeHasChanged () {
// console.log("主题切换的时候自动触发: ", nativeTheme.shouldUseDarkColors);
// webContents.send('updateAppTheme', nativeTheme.shouldUseDarkColors)
// }
// );
}
}
export default new ThemeChange()

View File

@@ -0,0 +1,23 @@
import { app, ipcMain} from "electron";
class WindowAction {
/**
* 自定义窗口关闭,最小化,最大化
* @param win
*/
action(win: any) {
ipcMain.on('min', e=> win.minimize());
ipcMain.on('max', e=> {
if (win.isMaximized()) {
win.unmaximize()
} else {
win.maximize()
}
});
ipcMain.on('close', e=> win.close());
}
}
export default new WindowAction();

1
src/module/menu/.pydio Normal file
View File

@@ -0,0 +1 @@
1d19ec12-3481-4e0f-87c5-e95b004cfe00

115
src/module/menu/menu.ts Normal file
View File

@@ -0,0 +1,115 @@
import utils from "../utils/utils";
import { Config} from "../../config";
import {app, Menu, shell} from "electron";
export class CreatedMenu {
private webContents: any;
private templateMenu = [
{
label: app.name,
submenu: [
{ label: `关于 ${app.name}`, role: 'about' },
{ type: 'separator' },
{ label: '服务', role: 'services' },
{ type: 'separator' },
{ label: `隐藏 ${app.name}`, role: 'hide' },
{ role: 'hideothers' },
{ label: '隐藏其他', role: 'unhide' },
{ type: 'separator' },
{ label: `退出${app.name}`, role: 'quit' }
]
},
{
label: '文件',
submenu: [
{
label: '打开Html文件',
role: 'open',
click: async () => {
// @ts-ignore
this.webContents.send('TouchBarHtmlFileChoice', await utils.OpenDialog(Config.FileType.HtmlFileConfig))
}
},
{
label: '打开Pug/Jade文件',
role: 'open',
click: async () => {
// @ts-ignore
this.webContents.send('TouchBarPugFileChoice', await utils.OpenDialog(Config.FileType.PugFileConfig))
}
}
]
},
{
label: '编辑',
submenu: [
{ label: '撤销', role: 'undo' },
{ label: '恢复', role: 'redo' },
{type: 'separator' },
{ label: '剪切', role: 'cut' },
{ label: '复制', role: 'copy' },
{ label: '粘贴', role: 'paste' },
{type: 'separator' },
{ label: '粘贴保留样式', role: 'pasteAndMatchStyle' },
{ label: '删除', role: 'delete' },
{ label: '全选', role: 'selectAll' },
{ type: 'separator' },
{
label: '听写',
submenu: [
{ label: '开始听写', role: 'startspeaking' },
{ label: '停止听写', role: 'stopspeaking' }
]
}
]
},
{
label: '视图',
submenu: [
{ label: '刷新', role: 'reload' },
{ label: '重置', role: 'resetzoom' },
{ label: '放大', role: 'zoomin' },
{ label: '缩小', role: 'zoomout' },
{ type: 'separator' },
{ label: '全屏', role: 'togglefullscreen' },
{ label: '切换开发人员工具', role: 'toggledevtools' },
]
},
{
label: '窗口',
submenu: [
{ label: '最小化', role: 'minimize' },
{ label: '最大化',role: 'zoom' },
{ label: '关闭', role: 'close' }
]
},
{
label: '帮助',
role: 'help',
submenu: [
{
label: '了解更多',
click: async () => {
await shell.openExternal('https://electronjs.org')
}
},
{
label: 'GitHub主页',
click: async () => {
await shell.openExternal(Config.Github)
}
}
]
}
]
buildFromTemplate(webContents: any) {
this.webContents = webContents;
// @ts-ignore
const successMenu = Menu.buildFromTemplate(this.templateMenu)
Config.isMac ? Menu.setApplicationMenu(successMenu) : Menu.setApplicationMenu(null)
}
}
export default new CreatedMenu();

1
src/module/net/.pydio Normal file
View File

@@ -0,0 +1 @@
d2c2d259-d7d0-434f-a815-33788aba5037

32
src/module/net/net.ts Normal file
View File

@@ -0,0 +1,32 @@
import { net } from "electron";
import utils from "../utils/utils";
class Net {
get(Url: string): Promise<any> {
const request = net.request({
method: 'GET',
url: Url
});
return new Promise((resolve, reject) => {
request.on('response', (response) => {
response.on('data', (chunk) => {
resolve(chunk.toString())
});
response.on('error', (error: any) => {
utils.showErrorBox({ title: 'error', content: JSON.stringify(error)});
});
response.on('end', () => {
console.log('No more data in response.')
});
});
request.end();
})
}
}
export default new Net();

View File

@@ -0,0 +1 @@
8ff0f184-659e-4a7b-a9c1-7ff24d6bdd15

View File

@@ -0,0 +1,52 @@
import { app, BrowserWindow, TouchBar, dialog, shell } from "electron";
const { TouchBarLabel, TouchBarButton,TouchBarSpacer } = TouchBar;
import utils from "../utils/utils";
import { Config } from "../../config";
// 主要负责创建 TouchBar 的类
class MyTouchBar {
constructor() {
this.setTouchBarButton()
}
// @ts-ignore
setTouchBarButton(title?: string, callback?: any): TouchBarButton {
return new TouchBarButton({
label: title,
backgroundColor: '#3a3a3c',
click: () => callback()
});
}
/**
* touchbar 触控栏按钮
* @param webContents 主进程传递过来的 webContents
* touchbar上按钮被点击后会调用webContents推送主进程数据到渲染进程
*/
getMyTouchBarItem(webContents: any): TouchBar {
return new TouchBar({
items: [
new TouchBarSpacer({ size: 'small' }),
this.setTouchBarButton("打开HTML文件", async () => {
// @ts-ignore
webContents.send('TouchBarHtmlFileChoice', await utils.OpenDialog(Config.FileType.HtmlFileConfig))
}),
new TouchBarSpacer({ size: 'small' }),
this.setTouchBarButton("打开Pug文件", async () => {
// @ts-ignore
webContents.send('TouchBarPugFileChoice', await utils.OpenDialog(Config.FileType.PugFileConfig))
}),
new TouchBarSpacer({ size: 'small' }),
this.setTouchBarButton("字体设置", function () {
dialog.showErrorBox("字体设置", "内容")
}),
new TouchBarSpacer({ size: 'small' }),
this.setTouchBarButton("关于作者", async () => {
await shell.openExternal(Config.Github)
})
]
});
}
}
export default new MyTouchBar();

1
src/module/utils/.pydio Normal file
View File

@@ -0,0 +1 @@
7bd4b7f8-8e63-4c3c-a494-2a124df7deb0

83
src/module/utils/utils.ts Normal file
View File

@@ -0,0 +1,83 @@
import { dialog, Notification } from "electron";
import { readFile } from "fs";
import { Config } from "../../config/index";
import { join } from "path";
class utils {
/**
* 打开弹窗获取用户选中文件路径
* 并调用 ReadFile 方法获取文件内容
* @param params Object 弹窗的参数配置
* @constructor
*/
async OpenDialog(params: Object): Promise<String>{
return await this.ReadFile((await dialog.showOpenDialog(params)).filePaths[0]);
}
async SaveDialog(parent: any,params: Object): Promise<any> {
return await dialog.showSaveDialog(params);
}
async showErrorBox(params: { title: string, content: string }): Promise<void> {
await dialog.showErrorBox(params.title, params.content);
}
/**
* 读取指定路径的文件内容
* @param path string 路径地址
*/
async ReadFile(path: string): Promise<any> {
if(path != undefined ) {
return new Promise((resolve,reject)=>{
readFile(path, 'utf-8', function (err, data) {
if (err) {
reject(err)
}
resolve(data.toString());
});
})
} else {
this.showErrorBox({ title: '错误', content: '您未选择任何文件,请选择!' })
}
}
downFile(windows: any): void {
windows.webContents.session.on('will-download', (event: any, item: any, webContents: any) => {
item.setSavePath(`${Config.TemporarySavePath}/${item.getFilename()}`);
item.on('updated', (event: any, state: any) => {
if (state === 'interrupted') {
console.log('下载被中断,但可以继续')
} else if (state === 'progressing') {
// 显示进度条
windows.setProgressBar(item.getReceivedBytes() / item.getTotalBytes())
if (item.isPaused()) {
console.log('下载已暂停')
} else {
}
}
});
item.once('done', (event: any, state: any) => {
if (state === 'completed') {
// 下载成功后显示通知
let not = new Notification({
title: '下载提示',
body: `文件 ${item.getFilename()} 已成功下载,请及时安装!!`,
silent: true,
icon: join(__dirname,'../../view/assets/img/pic.png'),
sound: join(__dirname, '../../view/assets/audio/Ping.aiff')
});
not.show();
windows.setProgressBar(-1);
} else {
console.log(`下载失败: ${state}`)
}
})
})
}
}
export default new utils();

13
src/run.ts Normal file
View File

@@ -0,0 +1,13 @@
import { app, ipcMain} from "electron";
import { createWindow } from "./main";
app.on('ready', () => {
new createWindow()
});
app.on('window-all-closed', () => {
if (process.platform !== 'darwin') {
app.quit()
}
});

1
src/view/.pydio Normal file
View File

@@ -0,0 +1 @@
8ca1888f-0437-4bd1-9db9-94dfab248d72

1
src/view/assets/.pydio Normal file
View File

@@ -0,0 +1 @@
53b0dc30-7f25-42b2-abca-8aefda776ffa

View File

@@ -0,0 +1 @@
d8a4d453-11a9-4dfb-a895-fcebd57b2783

Binary file not shown.

View File

@@ -0,0 +1 @@
95c782f9-3a6d-452a-83ea-cc8868e6ae0e

View File

@@ -0,0 +1,22 @@
body {
margin: 0;
padding: 0;
}
h1,h2,h3,h4,h5,h6,p,ul,li,ol {
list-style: none;
margin: 0;
padding: 0;
}
body,html {
width: 100%;
height: 100%;
position: relative;
}
::-webkit-scrollbar {
width: 0px;
height: 0px;
background-color: #F5F5F5;
}

View File

@@ -0,0 +1,58 @@
.header {
position: fixed;
z-index: 9999;
height: 22px;
left: 0;
top: 0;
width: 99%;
-webkit-app-region: drag;
}
.header ul {
display: flex;
justify-content: flex-start;
align-items: center;
height: 100%;
width: 60px;
-webkit-app-region: no-drag;
user-select: none;
}
.header ul li {
width: 12px;
height: 12px;
box-sizing: border-box;
margin-left: 8px;
border-radius: 100%;
text-align: center;
line-height: 6px;
}
.header ul li img {
width: 10px;
display: none;
}
.header ul:hover img{
display: inline-block;
}
.closed-action {
background: #ee6a5e;
border: 1px solid #d14e41;
}
.closed-action img{
}
.minimize-action {
background: #f6bf4f;
border: 1px solid #d7a344;
}
.minimize-action img{
width: 8px !important;
}
.maximization-action {
background: #62c654;
border: 1px solid #53a83e;
}
.maximization-action img {
width: 8px !important;
height: 8px;
}

View File

@@ -0,0 +1,102 @@
.main {
width: 100%;
height: 100%;
}
.left,
.pug{
width: 50%;
height: 100%;
float: left;
box-sizing: border-box;
}
.left {
background: #fff;
display: flex;
flex-direction: column;
border-top-left-radius: 7px;
border-bottom-left-radius: 7px;
}
.pug {
background: #f5f5f5;
border-top-right-radius: 7px;
border-bottom-right-radius: 7px;
}
.html {
width: 100%;
height: 95%;
border-top-left-radius: 7px;
border-bottom-left-radius: 7px;
}
.menu {
width: 100%;
height: 5%;
display: flex;
align-items: center;
justify-content: space-between;
padding: 0 10px;
box-sizing: border-box;
-webkit-app-region: drag;
}
.menu_l {
display: flex;
align-items: center;
}
.menu_r {
font-size: 13px;
display: flex;
}
.menu_r img {
margin-right: 0 !important;
}
.times {
margin-left: 10px;
}
.power {
width: 32px;
height: 16px;
border: 2px solid #e44d26;
box-sizing: border-box;
border-radius: 4px;
position: relative;
background: #fff;
text-align: center;
padding: 1px;
margin-right: 20px;
}
.power_spot {
position: absolute;
width: 4px;
height: 6px;
border-radius: 100%;
background: #e44d26;
left: -4px;
top: 3px;
z-index: 1;
}
.power_quantity {
font-size: 9px;
position: absolute;
left: 50%;
margin-left: -5.5px;
color: #464646;
top: 50%;
margin-top: -6px;
}
.power_fill {
float: right;
height: 100%;
background: #f1bbbb;
border-radius: 1px;
}
.deleteText {
width: 18px !important;
height: 18px !important;
margin-bottom: 2px;
}
.menu img {
width: 22px;
height: 22px;
margin-right: 20px;
}

View File

@@ -0,0 +1,55 @@
.f {
padding-top: 25px;
padding-left: 9px;
box-sizing: border-box;
outline: none;
overflow-y: scroll;
border: none;
resize: none;
margin: 0;
font-size: 15px;
}
.w-item span,
.swiper-button-prev,
.swiper-button-next,
.w-item h2,
.menu img{
cursor: pointer;
-webkit-app-region: no-drag;
}
.dart .left,
.dart .html{
background: #2b2b2b;
}
.dart .menu {
border-top: none;
}
.dart .pug{
background: #2b2b2b;
}
.dart .times {
color: #8d8d8d;
}
.dart .f {
color: #929191;
}
.dart .setting {
background: #2b2b2b;
}
.dart span {
color: #929191;
}
.dart .tabs-title {
border-bottom: 1px solid #3c3a3a;
}
.dart .active-title {
color: #ffffff;
}
.dart .closed {
background: #757371;
}
.dart .about h3 {
color: #929191;
}

View File

@@ -0,0 +1,169 @@
.main {
-webkit-app-region: drag;
}
.setting {
padding: 15px;
width: 100%;
height: 100%;
box-sizing: border-box;
background: #fff;
border-radius: 7px;
user-select: none;
border: 1px solid #dcdcdc;
}
.tabs-title {
display: flex;
height: 45px;
justify-content: space-around;
align-items: center;
border-bottom: 1px solid #efefef;
}
.tabs-title span{
cursor: default;
}
.tabs-content {
margin-top: 20px;
}
.tabs-content .tabs-item {
display: none;
width: 100%;
height: 100%;
}
.tabs-content ul {
display: flex;
justify-content: space-around;
flex-wrap: wrap;
}
.theme-color li {
width: 30%;
height: 120px;
margin-bottom: 18px;
position: relative;
}
.theme-color span {
position: absolute;
right: -8px;
top: -15px;
font-size: 27px;
}
.theme-color .pf {
height: 90px;
}
.theme-color .pf+p{
height: 20px;
width: 100%;
text-align: center;
font-size: 13px;
line-height: 28px;
}
.theme-color li .them{
width: 50%;
height: 100%;
float: left;
}
.font {
padding-top: 2px;
text-align: left;
padding-left: 60px;
}
.s-item {
margin: 15px 0;
}
.s-item input[type="checkbox"] {
vertical-align: sub;
width: 20px;
height: 20px;
}
.active-content {
display: block !important;
}
.active-title {
color: #4b88f6;
}
button.closed {
position: absolute;
right: 27px;
bottom: 20px;
width: 56px;
height: 23px;
border: none;
border-radius: 5px;
outline: none;
background: #4b88f6;
color: #fff;
font-size: 12px;
}
.about {
text-align: center;
padding-top: 26px;
}
.about img {
width: 80px;
}
.about h3 {
margin-bottom: 10px;
color: #545454;
}
.about p {
width: 311px;
margin: 10px auto;
font-size: 14px;
color: #9e9b9b;
}
.about p a{
padding: 0 10px;
color: #9e9b9b;
}
.version_num {
}
.version_check {
margin: 0 15px;
font-size: 15px;
color: #4b88f6;
cursor: pointer;
}
#openUpdate {
text-align: center;
padding: 15px 0;
}
#openUpdate p {
font-size: 15px;
}
#openUpdate ul {
padding: 10px;
max-width: 56%;
margin: 0 auto;
text-align: left;
}
#openUpdate ul li {
padding-bottom: 3px;
color: #9e9e9e;
font-size: 14px;
}
.dowNew {
display: inline-block;
padding: 4px;
border: none;
outline: none;
cursor: pointer;
font-size: 15px;
}
.custom {
margin-top: 10px;
padding-left: 18px;
}
.custom div {
margin-bottom: 5px;
font-size: 14px;
}
.custom input {
width: 20px;
border: none;
outline: none;
vertical-align: sub;
}

View File

@@ -0,0 +1,48 @@
.swiper-container {
width: 100%;
height: 100%;
}
.swiper-button-prev:after,
.swiper-button-next:after {
font-size: 14px !important;
}
.welcome {
-webkit-app-region: drag;
height: 100%;
width: 100%;
background: #fff;
border-radius: 7px;
}
.w-item {
text-align: center;
display: flex;
align-items: center;
justify-content: center;
flex-direction: column;
}
.w-item img{
width: 80px;
}
.w-item h2 {
margin-bottom: 10px;
color: #545454;
font-size: 17px;
}
.del img,
.start img{
width: 80px;
height: 80px;
padding: 8px;
box-sizing: border-box;
}
.w-item p {
font-size: 14px;
color: #9e9b9b;
}
.w-item span {
position: absolute;
right: 7px;
top: 3px;
color: #b1b0b0;
font-size: 12px;
}

View File

@@ -0,0 +1 @@
5178c8e7-3efc-4ff3-96d9-3f34f87e88dc

View File

@@ -0,0 +1 @@
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1577734868187" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="5275" xmlns:xlink="http://www.w3.org/1999/xlink" width="80" height="80"><defs><style type="text/css"></style></defs><path d="M511.936 559.104l-169.344 169.344a32 32 0 0 1-22.4 9.6 32 32 0 0 1-22.72-54.72l169.344-169.344-169.344-169.344a32 32 0 0 1 45.12-45.12l169.344 169.312L681.6 299.2a32 32 0 1 1 45.12 45.12l-169.632 169.664 169.632 169.664a32 32 0 0 1-22.4 54.4 32 32 0 0 1-22.72-9.28l-169.664-169.664z" p-id="5276"></path></svg>

After

Width:  |  Height:  |  Size: 684 B

View File

@@ -0,0 +1 @@
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1577199503932" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="4025" width="30" height="30" xmlns:xlink="http://www.w3.org/1999/xlink"><defs><style type="text/css"></style></defs><path d="M519.620465 0c-103.924093 0-188.511256 82.467721-192.083349 185.820279H85.015814A48.91386 48.91386 0 0 0 36.101953 234.686512a48.91386 48.91386 0 0 0 48.913861 48.866232h54.010046V831.345116c0 102.852465 69.822512 186.844279 155.909954 186.844279h439.200744c86.087442 0 155.909953-83.491721 155.909954-186.844279V284.100465h48.91386a48.91386 48.91386 0 0 0 48.913861-48.890046 48.91386 48.91386 0 0 0-48.913861-48.866233h-227.756651A191.559442 191.559442 0 0 0 519.620465 0z m-107.234232 177.080558c3.548279-49.771163 46.627721-88.540279 99.851907-88.540279 53.224186 0 96.327442 38.745302 99.351813 88.540279h-199.20372z m-111.997024 752.044651c-30.981953 0-65.083535-39.15014-65.083535-95.041488V287.744h575.488v546.839814c0 55.915163-34.077767 95.041488-65.059721 95.041488H300.389209v-0.500093z" fill="#f44336" p-id="4026"></path><path d="M368.116093 796.814884c24.361674 0 44.27014-21.670698 44.27014-48.818605v-278.623256c0-27.147907-19.908465-48.818605-44.27014-48.818604-24.33786 0-44.27014 21.670698-44.27014 48.818604v278.623256c0 27.147907 19.360744 48.818605 44.293954 48.818605z m154.933581 0c24.361674 0 44.293953-21.670698 44.293954-48.818605v-278.623256c0-27.147907-19.932279-48.818605-44.293954-48.818604-24.33786 0-44.27014 21.670698-44.270139 48.818604v278.623256c0 27.147907 19.932279 48.818605 44.293953 48.818605z m132.810419 0c24.33786 0 44.27014-21.670698 44.27014-48.818605v-278.623256c0-27.147907-19.932279-48.818605-44.27014-48.818604s-44.27014 21.670698-44.27014 48.818604v278.623256c0 27.147907 19.360744 48.818605 44.27014 48.818605z" fill="#f44336" p-id="4027"></path></svg>

After

Width:  |  Height:  |  Size: 1.9 KiB

View File

@@ -0,0 +1,2 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg clip-rule="evenodd" stroke-linejoin="round" stroke-miterlimit="1.4142" version="1.1" viewBox="0 0 24 24" xml:space="preserve" xmlns="http://www.w3.org/2000/svg"><path d="m19 20h-15c-1.11 0-2-0.9-2-2v-12c0-1.11 0.89-2 2-2h6l2 2h7c1.097 0 2 0.903 2 2h-17v10l2.14-8h17.07l-2.28 8.5c-0.23 0.87-1.01 1.5-1.93 1.5z" fill="#00acc1"/><path d="m17.293 17.786a2.3076 2.3076 0 0 1 -2.3076 -2.3076 2.3076 2.3076 0 0 1 2.3076 -2.3076 2.3076 2.3076 0 0 1 2.3076 2.3076 2.3076 2.3076 0 0 1 -2.3076 2.3076m4.8988-1.6681c0.02637-0.21098 0.04615-0.42197 0.04615-0.63954 0-0.21758-0.01978-0.43515-0.04615-0.65932l1.3912-1.0747c0.12527-0.0989 0.15824-0.27692 0.07912-0.42197l-1.3186-2.2813c-0.07912-0.14505-0.25714-0.20439-0.40219-0.14505l-1.6417 0.65932c-0.34285-0.25714-0.69888-0.4813-1.1143-0.64614l-0.24395-1.7472c-0.02637-0.15824-0.16483-0.27692-0.32966-0.27692h-2.6373c-0.16483 0-0.30329 0.11868-0.32966 0.27692l-0.24395 1.7472c-0.41537 0.16483-0.77141 0.389-1.1143 0.64614l-1.6417-0.65932c-0.14505-0.05934-0.32307 0-0.40219 0.14505l-1.3186 2.2813c-0.08571 0.14505-0.04615 0.32307 0.07912 0.42197l1.3912 1.0747c-0.02637 0.22417-0.04615 0.44174-0.04615 0.65932s0.01978 0.42856 0.04615 0.63954l-1.3912 1.0945c-0.12527 0.0989-0.16483 0.27692-0.07912 0.42197l1.3186 2.2813c0.07912 0.14505 0.25714 0.1978 0.40219 0.14505l1.6417-0.66592c0.34285 0.26373 0.69888 0.4879 1.1143 0.65273l0.24395 1.7472c0.02637 0.15824 0.16483 0.27692 0.32966 0.27692h2.6373c0.16483 0 0.30329-0.11868 0.32966-0.27692l0.24395-1.7472c0.41537-0.17142 0.77141-0.389 1.1143-0.65273l1.6417 0.66592c0.14505 0.05275 0.32307 0 0.40219-0.14505l1.3186-2.2813c0.07912-0.14505 0.04615-0.32307-0.07912-0.42197z" fill="#80deea" stroke-width=".65932"/></svg>

After

Width:  |  Height:  |  Size: 1.7 KiB

View File

@@ -0,0 +1,3 @@
<svg version="1.1" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
<path d="m8.9803 14.538 3.0197-8.0313 3.007 8.0313m-4.2757-11.419-6.9782 17.763h2.8547l1.421-3.8063h7.9298l1.4337 3.8063h2.8547l-6.9782-17.763z" fill="#f44336" stroke-width="1.2688"/>
</svg>

After

Width:  |  Height:  |  Size: 266 B

View File

@@ -0,0 +1,3 @@
<svg version="1.1" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
<path d="m12 17.56l4.07-1.13.55-6.1h-7.24l-.18-2.03h7.6l.2-1.99h-10l.56 6.01h6.89l-.23 2.58-2.22.6-2.22-.6-.14-1.66h-2l.29 3.19 4.07 1.13m-7.93-14.56h15.86l-1.43 16.2-6.5 1.8-6.5-1.8-1.43-16.2z" fill="#e44d26"/>
</svg>

After

Width:  |  Height:  |  Size: 294 B

View File

@@ -0,0 +1 @@
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1577734908119" class="icon" viewBox="0 0 1365 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="6208" xmlns:xlink="http://www.w3.org/1999/xlink" width="106.640625" height="80"><defs><style type="text/css"></style></defs><path d="M1140.982158 0C1171.511117 0 1196.259731 24.748613 1196.259731 55.277574L1196.259731 481.802069C1196.259731 512.331031 1171.511117 537.079644 1140.982158 537.079644 1110.453196 537.079644 1085.704583 512.331031 1085.704583 481.802069L1085.704583 55.277574 1140.982158 110.555148 707.290659 110.555148C676.761697 110.555148 652.013084 85.806535 652.013084 55.277574 652.013084 24.748613 676.761697 0 707.290659 0L1140.982158 0ZM223.896216 1024.028434C193.367257 1024.028434 168.618642 999.279821 168.618642 968.75086L168.618642 542.226364C168.618642 511.697403 193.367257 486.94879 223.896216 486.94879 254.425178 486.94879 279.17379 511.697403 279.17379 542.226364L279.17379 968.75086 223.896216 913.473286 657.587715 913.473286C688.116677 913.473286 712.865289 938.221898 712.865289 968.75086 712.865289 999.279821 688.116677 1024.028434 657.587715 1024.028434L223.896216 1024.028434Z" p-id="6209"></path></svg>

After

Width:  |  Height:  |  Size: 1.3 KiB

View File

@@ -0,0 +1 @@
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1577734892899" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="5735" xmlns:xlink="http://www.w3.org/1999/xlink" width="80" height="80"><defs><style type="text/css"></style></defs><path d="M65.23884 456.152041 958.760137 456.152041l0 111.695918L65.23884 567.847959 65.23884 456.152041z" p-id="5736"></path></svg>

After

Width:  |  Height:  |  Size: 498 B

BIN
src/view/assets/img/pic.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 123 KiB

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 6.1 KiB

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 13 KiB

View File

@@ -0,0 +1 @@
166b0e15-96aa-4311-89b0-31fe61bc516e

View File

@@ -0,0 +1 @@
c5df572d-5325-460d-b0e1-1b20333ff285

View File

@@ -0,0 +1,14 @@
class Config {
constructor() {
this.themeColor = [
{ id: 1, name: '默认白', left: '#ffffff', right: '#f5f5f5', color: '#000000'},
{ id: 2, name: '默认黑', left: '#2b2b2b', right: '#2b2b2b', color: '#929191'},
{ id: 3, name: '治愈绿', left: '#C5DF56', right: '#96CA00', color: '#e6e6e6'},
{ id: 4, name: '粉戴灰', left: '#B4BAC6', right: '#E5BAB7', color: '#34395F'},
{ id: 5, name: '活力橙', left: '#FEFEFF', right: '#FFA40B', color: '#000000'},
{ id: 6, name: '暗淡灰', left: '#FBDDC1', right: '#FACEA7', color: '#F3BD91'}
]
}
}
window.$config = new Config();

View File

@@ -0,0 +1 @@
8b306168-cf42-49f9-b00d-f9d2184c6337

View File

@@ -0,0 +1 @@
76ba9922-eec8-4260-9034-529649cc85e5

File diff suppressed because one or more lines are too long

2
src/view/assets/js/lib/jquery.min.js vendored Normal file

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1 @@
6c0740ad-17d9-4032-a8ec-fb12eb586144

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

Some files were not shown because too many files have changed in this diff Show More