platform compat

This commit is contained in:
cutls 2020-05-06 18:02:14 +09:00
parent a74d0ecf8d
commit 82271f1c17
7 changed files with 69 additions and 49 deletions

View File

@ -9,7 +9,9 @@ body {
height: 100vh; height: 100vh;
color: var(--color); color: var(--color);
} }
.titlebar, .menubar-menu-container, .action-menu-item { .titlebar,
.menubar-menu-container,
.action-menu-item {
background-color: var(--notfbox) !important; background-color: var(--notfbox) !important;
filter: brightness(110%) !important; filter: brightness(110%) !important;
color: var(--color) !important; color: var(--color) !important;
@ -561,17 +563,14 @@ textarea {
font-family: 'Open Sans'; font-family: 'Open Sans';
font-style: normal; font-style: normal;
font-weight: 300; font-weight: 300;
src: local('Open Sans Light'), local('OpenSans-Light'), src: local('Open Sans Light'), local('OpenSans-Light'), url(https://fonts.gstatic.com/s/opensans/v17/mem5YaGs126MiZpBA-UN_r8OUuhp.woff2) format('woff2');
url(https://fonts.gstatic.com/s/opensans/v17/mem5YaGs126MiZpBA-UN_r8OUuhp.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F,
U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
} }
@font-face { @font-face {
font-family: 'Material Icons'; font-family: 'Material Icons';
font-style: normal; font-style: normal;
font-weight: 400; font-weight: 400;
src: url(https://fonts.gstatic.com/s/materialicons/v48/flUhRq6tzZclQEJ-Vdg-IuiaDsNc.woff2) src: url(https://fonts.gstatic.com/s/materialicons/v48/flUhRq6tzZclQEJ-Vdg-IuiaDsNc.woff2) format('woff2');
format('woff2');
} }
.material-icons { .material-icons {
font-family: 'Material Icons'; font-family: 'Material Icons';
@ -588,3 +587,16 @@ textarea {
-webkit-font-feature-settings: 'liga'; -webkit-font-feature-settings: 'liga';
-webkit-font-smoothing: antialiased; -webkit-font-smoothing: antialiased;
} }
.pwaView .pwa,
.pwaView .mac,
.pwaView .win {
display: none;
}
.win32 .mac,
.linux .mac {
display: none;
}
.linux .win,
.darwin .win {
display: none;
}

View File

@ -1,6 +1,7 @@
//バージョンチェッカー //バージョンチェッカー
function verck(ver, jp) { function verck(ver, jp) {
console.log('%c Welcome😊 ' + ver, 'color: red;font-size:200%;') console.log('%c Welcome😊 ' + ver, 'color: red;font-size:200%;')
$('body').addClass(localStorage.getItem('platform'))
var date = new Date() var date = new Date()
var showVer = false var showVer = false
if (localStorage.getItem('ver') != ver && localStorage.getItem('winstore')) { if (localStorage.getItem('ver') != ver && localStorage.getItem('winstore')) {

View File

@ -766,6 +766,7 @@ window.onload = function () {
voiceSettingLoad() voiceSettingLoad()
oksload() oksload()
ctLoad() ctLoad()
$('body').addClass(localStorage.getItem('platform'))
} }
//設定画面で未読マーカーは要らない //設定画面で未読マーカーは要らない
function asReadEnd() { function asReadEnd() {

View File

@ -29,7 +29,7 @@
@@pwa@@ @@pwa@@
</head> </head>
<body id="mainView"> <body id="mainView" class="@@pwaClass@@">
<script type="text/javascript" src="../../@@node_base@@/jquery/dist/jquery.js"></script> <script type="text/javascript" src="../../@@node_base@@/jquery/dist/jquery.js"></script>
<script type="text/javascript" src="../../js/platform/first.js"></script> <script type="text/javascript" src="../../js/platform/first.js"></script>
<script <script
@ -63,12 +63,14 @@
<input type="text" id="url" style="width:70%" placeholder="ex)mstdn.jp" /> <input type="text" id="url" style="width:70%" placeholder="ex)mstdn.jp" />
<div id="ins-suggest"></div> <div id="ins-suggest"></div>
<button class="btn waves-effect" onclick="instance()">Login</button><br /> <button class="btn waves-effect" onclick="instance()">Login</button><br />
<div class="pwa">
@@codesetupwarn@@<br /> @@codesetupwarn@@<br />
<label> <label>
<input type="checkbox" class="filled-in" id="linux" /> <input type="checkbox" class="filled-in" id="linux" />
<span>@@codesetup@@</span> <span>@@codesetup@@</span>
</label> </label>
<br /> <br />
</div>
<label> <label>
<input type="checkbox" class="filled-in" id="misskey" /> <input type="checkbox" class="filled-in" id="misskey" />
<span>@@thisismisskey@@</span> </label <span>@@thisismisskey@@</span> </label
@ -144,5 +146,6 @@
<script type="text/javascript" src="../../js/login/instance.js"></script> <script type="text/javascript" src="../../js/login/instance.js"></script>
<script type="text/javascript" src="../../js/login/manager.js"></script> <script type="text/javascript" src="../../js/login/manager.js"></script>
<script type="text/javascript" src="../../js/tl/date.js"></script> <script type="text/javascript" src="../../js/tl/date.js"></script>
<script>$('body').addClass(localStorage.getItem('platform'))</script>
</body> </body>
</html> </html>

View File

@ -34,7 +34,7 @@
@@comment-end@@ @@pwa@@ @@comment-end@@ @@pwa@@
</head> </head>
<body> <body class="@@pwaClass@@">
<script> <script>
var ver = '@@versionLetter@@' var ver = '@@versionLetter@@'
var gitHash = '@@gitHash@@' var gitHash = '@@gitHash@@'
@ -356,7 +356,7 @@
<a class="waves-effect gray" id="cw" onclick="cw()" title="@@cwDes@@">CW</a> <a class="waves-effect gray" id="cw" onclick="cw()" title="@@cwDes@@">CW</a>
<span <span
><span id="imgup"></span ><span id="imgup"></span
><span id="imgsel" ><span id="imgsel" class="pwa"
><i ><i
class="waves-effect material-icons gray" class="waves-effect material-icons gray"
onclick="fileselect()" onclick="fileselect()"
@ -389,7 +389,7 @@
<span class=" sml mize" <span class=" sml mize"
><span>@@replyMode@@</span>: <span id="rec">@@no@@</span>/<span>@@temp@@</span>: ><span>@@replyMode@@</span>: <span id="rec">@@no@@</span>/<span>@@temp@@</span>:
<span id="mec">@@nothing@@</span> <span id="mec">@@nothing@@</span>
<a onclick="stamp()" class="pointer" title="@@stampWarn@@" <a onclick="stamp()" class="pointer pwa" title="@@stampWarn@@"
>@@stamp@@: <span id="stamp">Off</span></a >@@stamp@@: <span id="stamp">Off</span></a
> >
/@@poll@@:<span id="pollsta">@@no@@</span> /@@poll@@:<span id="pollsta">@@no@@</span>
@ -444,7 +444,7 @@
<li> <li>
<a onclick="nowplaying('spotify');">NowPlaying (Spotify)</a> <a onclick="nowplaying('spotify');">NowPlaying (Spotify)</a>
</li> </li>
<li> <li class="mac">
<a onclick="nowplaying('itunes');">NowPlaying (iTunes macOS)</a> <a onclick="nowplaying('itunes');">NowPlaying (iTunes macOS)</a>
</li> </li>
<li> <li>
@ -1604,7 +1604,7 @@
</div> </div>
</div> </div>
</div> </div>
<a onclick="about()" class="nex waves-effect"> <a onclick="about()" class="nex waves-effect pwa">
<i class="material-icons" style="font-size: 1rem;">info</i>@@about@@ </a <i class="material-icons" style="font-size: 1rem;">info</i>@@about@@ </a
>&nbsp;|&nbsp; >&nbsp;|&nbsp;
<a onclick="bottomReverse()" class="nex waves-effect"> <a onclick="bottomReverse()" class="nex waves-effect">
@ -1653,7 +1653,7 @@
<a href="setting.html" class="nex waves-effect"> <a href="setting.html" class="nex waves-effect">
<i class="material-icons nex" title="@@setting@@(Ctrl+Shift+S)">settings</i> <i class="material-icons nex" title="@@setting@@(Ctrl+Shift+S)">settings</i>
</a> </a>
<a onclick="nano()" class="nex waves-effect"> <a onclick="nano()" class="nex waves-effect pwa">
<i class="material-icons" title="@@nanoDes@@TheDesk Nano" data-trans-title="nano_desp" <i class="material-icons" title="@@nanoDes@@TheDesk Nano" data-trans-title="nano_desp"
>remove_from_queue</i >remove_from_queue</i
> >
@ -1686,7 +1686,7 @@
>access_time</i >access_time</i
> >
</a> </a>
<a onclick="tips('memory')" class="nex waves-effect"> <a onclick="tips('memory')" class="nex waves-effect pwa">
<i class="material-icons nex" title="@@ramTips@@" data-trans-title="memory">memory</i> <i class="material-icons nex" title="@@ramTips@@" data-trans-title="memory">memory</i>
</a> </a>
<a onclick="tips('trend')" class="nex waves-effect imasonly" style="display:none;"> <a onclick="tips('trend')" class="nex waves-effect imasonly" style="display:none;">

View File

@ -147,9 +147,11 @@ function main(ver, basefile, 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>`) <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(/@@node_base@@/g, 'dependencies')
source = source.replace(/@@pwaClass@@/g, 'pwaView')
} else { } else {
source = source.replace(/@@pwa@@/g, '<script>var pwa = false;</script>') source = source.replace(/@@pwa@@/g, '<script>var pwa = false;</script>')
source = source.replace(/@@node_base@@/g, 'node_modules') source = source.replace(/@@node_base@@/g, 'node_modules')
source = source.replace(/@@pwaClass@@/g, '')
} }
fs.writeFileSync(basefile + 'view/' + lang + '/' + pages[i], source) fs.writeFileSync(basefile + 'view/' + lang + '/' + pages[i], source)
} }

View File

@ -32,7 +32,7 @@
@@pwa@@ @@pwa@@
</head> </head>
<body id="mainView" style="overflow-y:scroll"> <body id="mainView" style="overflow-y:scroll" class="@@pwaClass@@">
<script type="text/javascript" src="../../@@node_base@@/jquery/dist/jquery.js"></script> <script type="text/javascript" src="../../@@node_base@@/jquery/dist/jquery.js"></script>
<script type="text/javascript" src="../../js/platform/first.js"></script> <script type="text/javascript" src="../../js/platform/first.js"></script>
<script type="text/javascript" src="../../@@node_base@@/materialize-css/dist/js/materialize.js"></script> <script type="text/javascript" src="../../@@node_base@@/materialize-css/dist/js/materialize.js"></script>
@ -399,7 +399,7 @@
style="width:100%; max-width:200px; background-color:#1ed760;" id="spotify-disable"><i style="width:100%; max-width:200px; background-color:#1ed760;" id="spotify-disable"><i
class="fab fa-spotify left"></i>@@disconnect@@</a> class="fab fa-spotify left"></i>@@disconnect@@</a>
<h5>@@link@@(Last.fm)</h5> <h5>@@link@@(Last.fm)</h5>
@@lastFmWarn@@ @@lastFmWarn@@<br />
<input type="text" style="width:150px" id="lastFmUser"> <input type="text" style="width:150px" id="lastFmUser">
<button onclick="lastFmSet()" class="btn waves-effect" style="width:100px;">@@set@@</button> <button onclick="lastFmSet()" class="btn waves-effect" style="width:100px;">@@set@@</button>
<h5>@@templateedit@@</h5> <h5>@@templateedit@@</h5>
@ -407,8 +407,7 @@
<textarea id="np-temp" class="materialize-textarea" data-length="500">#NowPlaying {song} / {album} / {artist} <textarea id="np-temp" class="materialize-textarea" data-length="500">#NowPlaying {song} / {album} / {artist}
{url}</textarea><br> {url}</textarea><br>
@@template1@@<br> @@template1@@<br>
@@template2@@<br> <span class="mac">>@@template2@@</span><br>
@@template3@@<br>
<button onclick="spotifySave()" class="btn waves-effect" style="width:100px;">@@set@@</button> <button onclick="spotifySave()" class="btn waves-effect" style="width:100px;">@@set@@</button>
<h5>@@postartwork@@</h5> <h5>@@postartwork@@</h5>
<label> <label>
@ -421,6 +420,7 @@
value="no" /> value="no" />
<span>@@no@@</span> <span>@@no@@</span>
</label> </label>
<div class="mac">
<h5>@@searchArtwork@@</h5> <h5>@@searchArtwork@@</h5>
@@searchArtworkWarn@@<br /> @@searchArtworkWarn@@<br />
<label> <label>
@ -435,6 +435,7 @@
</label> </label>
<br> <br>
</div> </div>
</div>
</li> </li>
<li> <li>
<div class="collapsible-header"> <div class="collapsible-header">