Buildtask to copy files; start_url correction; Install button
This commit is contained in:
@ -10,29 +10,28 @@
|
||||
|
||||
var fs = require('fs');
|
||||
var copydir = require('copy-dir');
|
||||
var copyfiles = require('copy-files');
|
||||
var copyfile = require('fs-copy-file');
|
||||
|
||||
var version = fs.readFileSync("VERSION.md", "utf8");
|
||||
version = version.replace(/\r?\n?/g, '').trim();
|
||||
var build = Math.floor(Date.now() / 1000);
|
||||
console.log('Building version '+version+' ('+build+')');
|
||||
|
||||
copyfiles(
|
||||
{
|
||||
files: {
|
||||
'service-worker.js': 'src/service-worker.js',
|
||||
'manifest.json': 'src/manifest.json'
|
||||
},
|
||||
dest: 'mopidy_iris/static/'
|
||||
}, function(error){
|
||||
if (error){
|
||||
console.log('Build failed, could not copy service worker', error);
|
||||
return false;
|
||||
} else {
|
||||
console.log('Copied service worker');
|
||||
}
|
||||
copyfile('src/service-worker.js', 'mopidy_iris/static/service-worker.js', function(error){
|
||||
if (error){
|
||||
console.log('Build failed, could not copy service-worker.js', error);
|
||||
return false;
|
||||
}
|
||||
);
|
||||
console.log('Copied service-worker.js');
|
||||
});
|
||||
|
||||
copyfile('src/manifest.json', 'mopidy_iris/static/manifest.json', function(error){
|
||||
if (error){
|
||||
console.log('Build failed, could not copy manifest.json', error);
|
||||
return false;
|
||||
}
|
||||
console.log('Copied manifest.json');
|
||||
});
|
||||
|
||||
copydir('src/assets', 'mopidy_iris/static/assets', function(error){
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
6
mopidy_iris/static/app.min.js
vendored
6
mopidy_iris/static/app.min.js
vendored
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -60,12 +60,13 @@
|
||||
}
|
||||
#app-loading-text {
|
||||
position: fixed;
|
||||
top: 60vh;
|
||||
top: 55vh;
|
||||
text-align: center;
|
||||
width: 70vw;
|
||||
margin: 0 15vw;
|
||||
color: rgba(255,255,255,0.3);
|
||||
font-size: 16px;
|
||||
font-family: Arial, Helvetica, sans-serif;
|
||||
}
|
||||
</style>
|
||||
|
||||
@ -97,7 +98,7 @@
|
||||
|
||||
// Release details
|
||||
// These are automatically injected to built HTML
|
||||
var build = "1532291631";
|
||||
var build = "1532336125";
|
||||
var version = "3.22.0";
|
||||
|
||||
// Construct the script tag
|
||||
@ -119,18 +120,18 @@
|
||||
|
||||
// Test mode, use un-minified code
|
||||
if (test_mode){
|
||||
js.src = '/iris/app.js?v='+build;
|
||||
css.href = '/iris/app.css?v='+build;
|
||||
js.src = '/iris/app.js?v='+build;
|
||||
|
||||
// Production-grade, minified app
|
||||
} else {
|
||||
js.src = '/iris/app.min.js?v='+build;
|
||||
css.href = '/iris/app.min.css?v='+build;
|
||||
js.src = '/iris/app.min.js?v='+build;
|
||||
}
|
||||
|
||||
// And finally inject our CSS/JS tags
|
||||
document.body.appendChild(js);
|
||||
document.body.appendChild(css);
|
||||
document.body.appendChild(js);
|
||||
|
||||
</script>
|
||||
|
||||
|
||||
@ -1,8 +1,7 @@
|
||||
{
|
||||
"manifest_version": 2.5,
|
||||
"version": 22.0,
|
||||
"name": "Iris",
|
||||
"short_name": "Iris",
|
||||
"name": "Iris",
|
||||
"icons": [
|
||||
{
|
||||
"src": "/iris/assets/logo-app-192.png",
|
||||
@ -20,7 +19,7 @@
|
||||
"sizes": "512x512"
|
||||
}
|
||||
],
|
||||
"start_url": "/iris/index.html",
|
||||
"start_url": "/iris/#/",
|
||||
"background_color": "#08d58f",
|
||||
"theme_color": "#181818",
|
||||
"display": "fullscreen",
|
||||
|
||||
3
mopidy_iris/static/service-worker.js
Normal file → Executable file
3
mopidy_iris/static/service-worker.js
Normal file → Executable file
@ -0,0 +1,3 @@
|
||||
self.addEventListener('fetch', (event) => {
|
||||
// Nothing doing!
|
||||
});
|
||||
@ -17,7 +17,7 @@
|
||||
"babel-preset-stage-0": "^6.24.1",
|
||||
"babel-preset-stage-2": "^6.22.0",
|
||||
"copy-dir": "^0.3.0",
|
||||
"copy-files": "0.1.0",
|
||||
"fs-copy-file": "2.1.2",
|
||||
"css-loader": "^0.28.11",
|
||||
"expose-loader": "0.7.3",
|
||||
"extract-text-webpack-plugin": "3.0.0",
|
||||
|
||||
@ -120,18 +120,18 @@
|
||||
|
||||
// Test mode, use un-minified code
|
||||
if (test_mode){
|
||||
js.src = '/iris/app.js?v='+build;
|
||||
css.href = '/iris/app.css?v='+build;
|
||||
js.src = '/iris/app.js?v='+build;
|
||||
|
||||
// Production-grade, minified app
|
||||
} else {
|
||||
js.src = '/iris/app.min.js?v='+build;
|
||||
css.href = '/iris/app.min.css?v='+build;
|
||||
js.src = '/iris/app.min.js?v='+build;
|
||||
}
|
||||
|
||||
// And finally inject our CSS/JS tags
|
||||
document.body.appendChild(js);
|
||||
document.body.appendChild(css);
|
||||
document.body.appendChild(js);
|
||||
|
||||
</script>
|
||||
|
||||
|
||||
@ -367,7 +367,7 @@ class Settings extends React.Component {
|
||||
</div>
|
||||
|
||||
<div className="field">
|
||||
{this.props.ui.install_prompt ? <button onClick={e => this.props.ui.install_prompt.prompt()}>Install as App</button> : null}
|
||||
<button onClick={e => this.props.ui.install_prompt.prompt()} disabled={this.props.ui.install_prompt ? false : true}>Install as App</button>
|
||||
{upgrade_button}
|
||||
<button className={"destructive"+(this.props.mopidy.restarting ? ' working' : '')} onClick={e => this.props.pusherActions.restart()}>{this.props.mopidy.restarting ? 'Restarting...' : 'Restart server'}</button>
|
||||
<ConfirmationButton className="destructive" content="Reset all settings" confirmingContent="Are you sure?" onConfirm={() => this.resetAllSettings()} />
|
||||
|
||||
@ -0,0 +1,3 @@
|
||||
self.addEventListener('fetch', (event) => {
|
||||
// Nothing doing!
|
||||
});
|
||||
Reference in New Issue
Block a user