Removing old history pushes
This commit is contained in:
15
mopidy_iris/static/.htaccess
Executable file
15
mopidy_iris/static/.htaccess
Executable file
@ -0,0 +1,15 @@
|
||||
<IfModule mod_rewrite.c>
|
||||
|
||||
RewriteEngine On
|
||||
|
||||
# Remove /iris/ from all requests (except /ws) to accommodate the
|
||||
# ./mopidy/{extension} webserver format
|
||||
RewriteCond %{REQUEST_URI} !^/ws/
|
||||
RewriteRule ^iris/(.*)$ /$1 [NC,L]
|
||||
|
||||
# Rewrite all non-file URLs to our React index.html
|
||||
# This is essential for React Router to handle page refreshers
|
||||
RewriteCond %{REQUEST_URI} ^(.*)$
|
||||
RewriteCond %{REQUEST_FILENAME} !-f
|
||||
RewriteRule .* index.html [L]
|
||||
</IfModule>
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -98,7 +98,7 @@
|
||||
|
||||
// Release details
|
||||
// These are automatically injected to built HTML
|
||||
var build = "1547017245";
|
||||
var build = "1547109095";
|
||||
var version = "3.31.8";
|
||||
|
||||
// Construct the script tag
|
||||
|
||||
1
mopidy_iris/static/iris2/app.js
Executable file
1
mopidy_iris/static/iris2/app.js
Executable file
@ -0,0 +1 @@
|
||||
test
|
||||
@ -10,6 +10,7 @@
|
||||
},
|
||||
"main": "app.js",
|
||||
"dependencies": {
|
||||
"history": "^4.7.2",
|
||||
"jquery": "^3",
|
||||
"mopidy": "^0.5"
|
||||
},
|
||||
|
||||
101
src/js/App.js
101
src/js/App.js
@ -142,11 +142,11 @@ class App extends React.Component{
|
||||
|
||||
// When we have navigated to a new route
|
||||
if (this.props.location !== prevProps.location){
|
||||
|
||||
|
||||
// Log our pageview
|
||||
if (this.props.allow_reporting){
|
||||
ReactGA.set({ page: window.location });
|
||||
ReactGA.pageview(window.location);
|
||||
ReactGA.set({ page: this.props.location.pathname });
|
||||
ReactGA.pageview(this.props.location.pathname);
|
||||
}
|
||||
|
||||
// Scroll to top of <main>
|
||||
@ -368,51 +368,62 @@ class App extends React.Component{
|
||||
<div className={className}>
|
||||
|
||||
<div className="body">
|
||||
<Sidebar />
|
||||
<PlaybackControls />
|
||||
<main id="main" className="smooth-scroll">
|
||||
<Switch>
|
||||
<ErrorBoundary>
|
||||
<Route exact path="/" component={Queue} />
|
||||
|
||||
<Route path="/initial-setup" component={InitialSetup} />
|
||||
<Route path="/kiosk-mode" component={KioskMode} />
|
||||
<Route path="/add-to-playlist/:uris" component={AddToPlaylist} />
|
||||
<Route path="/image-zoom" component={ImageZoom} />
|
||||
<Route path="/share-configuration" component={ShareConfiguration} />
|
||||
<Route path="/edit-command/:id?" component={EditCommand} />
|
||||
|
||||
<Route path="/queue" component={Queue} />
|
||||
<Route path="/queue/history" component={QueueHistory} />
|
||||
<Route path="/queue/radio" component={EditRadio} />
|
||||
<Route path="/queue/add-uri" component={AddToQueue} />
|
||||
<Route path="/settings/debug" component={Debug} />
|
||||
<Route path="/settings/service/:sub_view?" component={Settings} />
|
||||
|
||||
<Route path="/search/:type/:term?" component={Search} />
|
||||
<Route path="/album/:uri" component={Album} />
|
||||
<Route path="/artist/:uri/:sub_view?" component={Artist} />
|
||||
<Route path="/playlist/create" component={CreatePlaylist} />
|
||||
<Route path="/playlist/:uri" component={Playlist} />
|
||||
<Route path="/playlist/:uri/edit" component={EditPlaylist} />
|
||||
<Route path="/user/:uri" component={User} />
|
||||
<Route path="/track/:uri" component={Track} />
|
||||
|
||||
<Route path="/discover/recommendations/:seeds?" component={DiscoverRecommendations} />
|
||||
<Route path="/discover/featured" component={DiscoverFeatured} />
|
||||
<Route path="/discover/categories" component={DiscoverCategories} />
|
||||
<Route path="/discover/categories/:id" component={DiscoverCategory} />
|
||||
<Route path="/discover/new-releases" component={DiscoverNewReleases} />
|
||||
<Switch>
|
||||
<Route path="/initial-setup" component={InitialSetup} />
|
||||
<Route path="/kiosk-mode" component={KioskMode} />
|
||||
<Route path="/add-to-playlist/:uris" component={AddToPlaylist} />
|
||||
<Route path="/image-zoom" component={ImageZoom} />
|
||||
<Route path="/share-configuration" component={ShareConfiguration} />
|
||||
<Route path="/edit-command/:id?" component={EditCommand} />
|
||||
|
||||
<Route path="/queue/radio" component={EditRadio} />
|
||||
<Route path="/queue/add-uri" component={AddToQueue} />
|
||||
<Route path="/playlist/create" component={CreatePlaylist} />
|
||||
<Route path="/playlist/:uri/edit" component={EditPlaylist} />
|
||||
|
||||
<Route path="/library/artists" component={LibraryArtists} />
|
||||
<Route path="/library/albums" component={LibraryAlbums} />
|
||||
<Route path="/library/tracks" component={LibraryTracks} />
|
||||
<Route path="/library/playlists" component={LibraryPlaylists} />
|
||||
<Route path="/library/browse/:uri?" component={LibraryBrowse} />
|
||||
<Route>
|
||||
<div>
|
||||
<Sidebar />
|
||||
<PlaybackControls />
|
||||
<main id="main" className="smooth-scroll">
|
||||
<Switch>
|
||||
<Route exact path="/" component={Queue} />
|
||||
|
||||
</ErrorBoundary>
|
||||
</Switch>
|
||||
</main>
|
||||
<Route path="/queue" component={Queue} />
|
||||
<Route path="/queue/history" component={QueueHistory} />
|
||||
<Route path="/settings/debug" component={Debug} />
|
||||
<Route path="/settings/service/:sub_view?" component={Settings} />
|
||||
|
||||
<Route path="/search/:type/:term?" component={Search} />
|
||||
<Route path="/album/:uri" component={Album} />
|
||||
<Route path="/artist/:uri/:sub_view?" component={Artist} />
|
||||
<Route path="/playlist/:uri" component={Playlist} />
|
||||
<Route path="/user/:uri" component={User} />
|
||||
<Route path="/track/:uri" component={Track} />
|
||||
|
||||
<Route path="/discover/recommendations/:seeds?" component={DiscoverRecommendations} />
|
||||
<Route path="/discover/featured" component={DiscoverFeatured} />
|
||||
<Route path="/discover/categories" component={DiscoverCategories} />
|
||||
<Route path="/discover/categories/:id" component={DiscoverCategory} />
|
||||
<Route path="/discover/new-releases" component={DiscoverNewReleases} />
|
||||
|
||||
<Route path="/library/artists" component={LibraryArtists} />
|
||||
<Route path="/library/albums" component={LibraryAlbums} />
|
||||
<Route path="/library/tracks" component={LibraryTracks} />
|
||||
<Route path="/library/playlists" component={LibraryPlaylists} />
|
||||
<Route path="/library/browse/:uri?" component={LibraryBrowse} />
|
||||
|
||||
<Route>
|
||||
<h1>I'm lost</h1>
|
||||
</Route>
|
||||
|
||||
</Switch>
|
||||
</main>
|
||||
</div>
|
||||
</Route>
|
||||
</Switch>
|
||||
|
||||
</div>
|
||||
|
||||
<ContextMenu />
|
||||
|
||||
@ -3,7 +3,7 @@ import React, { PropTypes } from 'react'
|
||||
import { connect } from 'react-redux'
|
||||
import { createStore, bindActionCreators } from 'redux'
|
||||
|
||||
|
||||
import history from './history';
|
||||
import * as helpers from '../helpers'
|
||||
import * as uiActions from '../services/ui/actions'
|
||||
import GridItem from './GridItem'
|
||||
@ -44,7 +44,7 @@ class AlbumGrid extends React.Component{
|
||||
type="album"
|
||||
item={album}
|
||||
show_source_icon={this.props.show_source_icon}
|
||||
onClick={e => {this.props.history.push(global.baseURL+'album/'+encodeURIComponent(album.uri))}}
|
||||
onClick={e => {history.push(global.baseURL+'album/'+encodeURIComponent(album.uri))}}
|
||||
onContextMenu={e => this.handleContextMenu(e,album)}
|
||||
/>
|
||||
)}
|
||||
|
||||
@ -3,6 +3,8 @@ import React, { PropTypes } from 'react';
|
||||
import { connect } from 'react-redux';
|
||||
import { bindActionCreators } from 'redux';
|
||||
|
||||
//import { Link } from 'react-router-dom';
|
||||
|
||||
import Link from './Link';
|
||||
import Icon from './Icon';
|
||||
import Dropzones from './Fields/Dropzones';
|
||||
|
||||
@ -386,7 +386,7 @@ class TrackList extends React.Component{
|
||||
|
||||
|
||||
render(){
|
||||
if (!this.props.tracks || Object.prototype.toString.call(this.props.tracks) !== '[object Array]' ){
|
||||
if (!this.props.tracks || Object.prototype.toString.call(this.props.tracks) !== '[object Array]'){
|
||||
return null;
|
||||
}
|
||||
|
||||
@ -449,4 +449,6 @@ const mapDispatchToProps = (dispatch) => {
|
||||
}
|
||||
}
|
||||
|
||||
export default connect(mapStateToProps, mapDispatchToProps)(TrackList)
|
||||
export default TrackList
|
||||
//export default connect(mapStateToProps, mapDispatchToProps)(TrackList)
|
||||
|
||||
|
||||
5
src/js/components/history.js
Executable file
5
src/js/components/history.js
Executable file
@ -0,0 +1,5 @@
|
||||
|
||||
import createBrowserHistory from 'history/createBrowserHistory'
|
||||
|
||||
const customHistory = createBrowserHistory()
|
||||
export default customHistory;
|
||||
Reference in New Issue
Block a user