For store only build

This commit is contained in:
cutls 2020-09-09 16:59:18 +09:00
parent bdf2b9be71
commit 051dbb3b1b
7 changed files with 22 additions and 12 deletions

View File

@ -62,6 +62,6 @@ deploy:
skip_cleanup: true
on:
repo: cutls/TheDesk
tags: false
#branches:
# only: "/^v?[0-9\\.]+/"
tags: true
branches:
only: "/^v?[0-9\\.]+/"

View File

@ -143,8 +143,8 @@ function css(mainWindow) {
";--bottom:" + bottom + ";--accent:" + accent + ";" + ";--emphasized:" + emphasized + ";--his-data:" +
hisData +
";--active:" + active + ";--postbox:" + postbox + ";--modalfooter:" +
modalFooter + ";--selected:" + selected + ";--selectedWithShare:" + selectedWithShare + "}" +
"--gray:" + gray + ";" +
modalFooter + ";--selected:" + selected + ";--selectedWithShare:" + selectedWithShare +
"--gray:" + gray + ";}" +
".customtheme #imagemodal{background: url(\"../img/pixel.svg\");}";
} else {
var css = compatibleTheme(json)

View File

@ -1,6 +1,6 @@
{
"name": "thedesk",
"version": "21.1.1",
"version": "21.2.0",
"codename": "Mayu",
"description": "TheDesk is a Mastodon client for PC.",
"repository": "https://github.com/cutls/TheDesk",

View File

@ -26,7 +26,7 @@
</script>
<script type="text/javascript" src="https://cdn.crowdin.com/jipt/jipt.js"></script>
@@comment-end@@
@@pwa@@
@@pwa@@ @@store@@
</head>
<body id="mainView" class="@@pwaClass@@">

View File

@ -31,7 +31,7 @@
_jipt.push(['project', 'thedesk'])
</script>
<script type="text/javascript" src="https://cdn.crowdin.com/jipt/jipt.js"></script>
@@comment-end@@ @@pwa@@
@@comment-end@@ @@pwa@@ @@store@@
</head>
<body class="@@pwaClass@@">

View File

@ -16,8 +16,12 @@ var pwa = false
if (process.argv.indexOf('--pwa') > 0) {
var pwa = true
}
var store = false
if (process.argv.indexOf('--store') > 0) {
var store = true
}
function main(ver, basefile, pwa) {
function main(ver, basefile, pwa, store) {
const execSync = require('child_process').execSync
let gitHash = execSync('git rev-parse HEAD')
.toString()
@ -144,7 +148,7 @@ function main(ver, basefile, pwa) {
source = source.replace(/@@lang@@/g, lang)
source = source.replace(/@@langlist@@/g, langstr)
if(pwa) {
source = source.replace(/@@pwa@@/g, `<link rel="manifest" href="/manifest.json" />
source = source.replace(/@@pwa@@/g, `<link rel="manifest" href="../../manifest.json" />
<script>var pwa = true;"serviceWorker"in navigator&&navigator.serviceWorker.register("/sw.pwa.js").then(e=>{});</script>`)
source = source.replace(/@@node_base@@/g, 'dependencies')
source = source.replace(/@@pwaClass@@/g, 'pwaView')
@ -153,11 +157,16 @@ function main(ver, basefile, pwa) {
source = source.replace(/@@node_base@@/g, 'node_modules')
source = source.replace(/@@pwaClass@@/g, '')
}
if (store) {
source = source.replace(/@@store@@/g, '<script>var store = true;</script>')
} else {
source = source.replace(/@@store@@/g, '<script>var store = false;</script>')
}
fs.writeFileSync(basefile + 'view/' + lang + '/' + pages[i], source)
}
}
}
main(ver, basefile, pwa)
main(ver, basefile, pwa, store)
//if --watch, to yarn dev
if (process.argv.indexOf('--watch') !== -1) {

View File

@ -31,6 +31,7 @@
}
</style>
@@pwa@@
@@store@@
</head>
<body id="mainView" style="overflow-y:scroll" class="@@pwaClass@@">
@ -107,7 +108,7 @@
<br>
</div>
</li>
<li>
<li class="pwa">
<div class="collapsible-header">
<i class="material-icons">color_lens</i>@@theme@@
</div>