diff --git a/mopidy_iris/static/.htaccess b/mopidy_iris/static/.htaccess index e44f19be..7f146c2a 100755 --- a/mopidy_iris/static/.htaccess +++ b/mopidy_iris/static/.htaccess @@ -1,15 +1,15 @@ RewriteEngine On -RewriteBase / +RewriteBase /iris/ # Handle Mopidy-Images requests # TODO: Look to move this into the Thumbnail component RewriteRule ^images/(.*)$ http://%{HTTP_HOST}:6680/images/$1 [NC,L] -# Rewrite /iris subfolder +# Rewrite iris subfolder +# This is required so our HTML file can use /iris/ as baseURL for mopidy-styled domain (ie localhost:6680/iris/index.html) RewriteRule ^iris/(.*)$ /$1 [NC,L] -# All nont-file requests go to React RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /index.html [L] diff --git a/package.json b/package.json index 096d4106..8bbb4551 100755 --- a/package.json +++ b/package.json @@ -35,8 +35,8 @@ "react-fontawesome": "*" }, "scripts": { - "dev": "./build.sh & NODE_ENV=development webpack & sass src/scss/app.scss public_html/app.css", - "prod": "NODE_ENV=production webpack" + "dev": "./build.sh & NODE_ENV=development webpack", + "prod": "./build.sh & NODE_ENV=production webpack" }, "author": "James Barnsley", "license": "ISC" diff --git a/src/.htaccess b/src/.htaccess index aeead89e..7f146c2a 100755 --- a/src/.htaccess +++ b/src/.htaccess @@ -6,6 +6,10 @@ RewriteBase /iris/ # TODO: Look to move this into the Thumbnail component RewriteRule ^images/(.*)$ http://%{HTTP_HOST}:6680/images/$1 [NC,L] +# Rewrite iris subfolder +# This is required so our HTML file can use /iris/ as baseURL for mopidy-styled domain (ie localhost:6680/iris/index.html) +RewriteRule ^iris/(.*)$ /$1 [NC,L] + RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /index.html [L] diff --git a/src/js/components/GridItem.js b/src/js/components/GridItem.js index 0930a1af..ac8ff435 100755 --- a/src/js/components/GridItem.js +++ b/src/js/components/GridItem.js @@ -1,6 +1,6 @@ import React, { PropTypes } from 'react' -import { Link, browserHistory } from 'react-router' +import { Router, Link, hashHistory } from 'react-router' import FontAwesome from 'react-fontawesome' import Thumbnail from './Thumbnail' @@ -14,7 +14,7 @@ export default class GridItem extends React.Component{ handleClick(e){ if( e.target.tagName.toLowerCase() !== 'a' ){ - browserHistory.push( this.props.link ); + hashHistory.push(this.props.link) } } diff --git a/src/js/components/List.js b/src/js/components/List.js index 78707a9f..97c38498 100755 --- a/src/js/components/List.js +++ b/src/js/components/List.js @@ -1,6 +1,6 @@ import React, { PropTypes } from 'react' -import { Link, browserHistory } from 'react-router' +import { Link, hashHistory } from 'react-router' import FontAwesome from 'react-fontawesome' import ArtistSentence from './ArtistSentence' @@ -17,7 +17,7 @@ export default class List extends React.Component{ // make sure we haven't clicked a nested link (ie Artist name) if( e.target.tagName.toLowerCase() !== 'a' ){ - browserHistory.push( this.props.link_prefix + encodeURIComponent(uri) ); + hashHistory.push( this.props.link_prefix + encodeURIComponent(uri) ); } } diff --git a/src/js/index.js b/src/js/index.js index 173cf4a5..0c763991 100755 --- a/src/js/index.js +++ b/src/js/index.js @@ -6,7 +6,7 @@ import React, { PropTypes } from 'react'; import ReactDOM from 'react-dom'; import { Provider } from 'react-redux' import { createStore } from 'redux' -import { Router, Route, Link, IndexRoute, browserHistory } from 'react-router' +import { Router, Route, Link, IndexRoute, hashHistory } from 'react-router' import store from './bootstrap.js' @@ -37,11 +37,11 @@ import LibraryLocalArtists from './views/library/LibraryLocalArtists' import LibraryLocalAlbums from './views/library/LibraryLocalAlbums' import LibraryLocalDirectory from './views/library/LibraryLocalDirectory' -global.baseURL = '/iris/' +global.baseURL = '/' ReactDOM.render( - + diff --git a/src/js/views/library/LibraryLocal.js b/src/js/views/library/LibraryLocal.js index c58bf987..bb8d5d40 100755 --- a/src/js/views/library/LibraryLocal.js +++ b/src/js/views/library/LibraryLocal.js @@ -19,17 +19,17 @@ export default class LibraryLocal extends React.Component{ { name: 'Artists', link: global.baseURL+'library/local/artists', - icons: ['/assets/backgrounds/category-artists.jpg'] + icons: ['assets/backgrounds/category-artists.jpg'] }, { name: 'Albums', link: global.baseURL+'library/local/albums', - icons: ['/assets/backgrounds/category-albums.jpg'] + icons: ['assets/backgrounds/category-albums.jpg'] }, { name: 'Folders', link: global.baseURL+'library/local/directory/local:directory', - icons: ['/assets/backgrounds/category-folders.jpg'] + icons: ['assets/backgrounds/category-folders.jpg'] } ]