This repository has been archived by the owner. It is now read-only.
Permalink
Browse files

allow theory to run with a URL prefix.

	modified:   development.ini
	modified:   server.ini
	modified:   theory/controllers/main.py
	modified:   theory/model/albumart.py
	modified:   theory/public/css/fullscreen.css
	modified:   theory/public/css/styles.css
	modified:   theory/public/css/ui.slider.css
	modified:   theory/public/js/theory.js
	modified:   theory/templates/albums.html
	modified:   theory/templates/fullscreen.html
	modified:   theory/templates/genres.html
	modified:   theory/templates/index.html
	modified:   theory/templates/letters.html
	modified:   theory/templates/playlist.html
	modified:   theory/templates/stats.html
	modified:   theory/templates/tracks.html
  • Loading branch information...
1 parent 92d7d67 commit 5cfb8d117b8be5f4d8d78b4751d7d870ba9bfadd neoice committed Apr 15, 2011
View
@@ -17,6 +17,7 @@ port = 9099
[app:main]
use = egg:theory
+filter-with = proxy-prefix
full_stack = true
cache_dir = %(here)s/data
beaker.session.key = theory
@@ -69,3 +70,7 @@ formatter = generic
[formatter_generic]
format = %(asctime)s,%(msecs)03d %(levelname)-5.5s [%(name)s] %(message)s
datefmt = %H:%M:%S
+
+[filter:proxy-prefix]
+use = egg:PasteDeploy#prefix
+prefix = /s/mpd
View
@@ -17,6 +17,7 @@ port = 9099
[app:main]
use = egg:theory
+filter-with = proxy-prefix
full_stack = true
cache_dir = %(here)s/data
beaker.session.key = theory
@@ -61,3 +62,7 @@ formatter = generic
[formatter_generic]
format = %(asctime)s,%(msecs)03d %(levelname)-5.5s [%(name)s] %(message)s
datefmt = %H:%M:%S
+
+[filter:proxy-prefix]
+use = egg:PasteDeploy#prefix
+prefix = /s/mpd
@@ -69,7 +69,7 @@ def artists(self):
return render('/null.html')
c.artists = self.m.artists()
- return render('/artists.html')
+ return render('./artists.html')
def albums(self):
""" controller for the albums frame """
View
@@ -39,7 +39,7 @@ class AlbumArt:
def __init__(self):
self.logger = logging.getLogger(__name__)
- self.www_root = '/img/art/'
+ self.www_root = './img/art/'
self.disk_root = 'theory/public/img/art/'
def album_fetch(self,artist,album):
@@ -64,7 +64,7 @@ body {
#progress-img {
height:9px;
/* set the following color to change the fullscreen progress bar color */
- background:limegreen url(/img/progress-trans.png) repeat-x;
+ background:limegreen url(../img/progress-trans.png) repeat-x;
vertical-align:baseline;
}
@@ -274,7 +274,7 @@ ul#playlist li a img {
}
div.playlist-tooltip {
- background:transparent url('/img/libg.png');
+ background:transparent url('../img/libg.png');
width:200px;
margin-top:-15px;
right:0px;
@@ -420,7 +420,7 @@ a#aWiki,a#aLyrics {
div#widget-tooltip {
width:100%;
- background:transparent url('/img/libg.png');
+ background:transparent url('../img/libg.png');
color:white;
font-size:10px;
}
@@ -35,5 +35,5 @@
width: 15px;
height: 16px;
/*background: #447897 url(images/447897_40x100_textures_02_glass_25.png) 0 50% repeat-x;*/
- background:url(/img/handle.horizontal.png);
+ background:url(../img/handle.horizontal.png);
}
View
@@ -21,14 +21,14 @@ function getStatus() {
debug('loading status (' + window.statusloads + ')');
// load the status data from the server
- $.getJSON('/mpdcontrol/status',
+ $.getJSON('./mpdcontrol/status',
function(data) {
// change the icon displayed on the controls
if (data.status.state == 'play') {
- $('#imgPlay').attr('src','../img/pause.png');
+ $('#imgPlay').attr('src','./img/pause.png');
}
else if (data.status.state == 'stop' || data.status.state == 'pause') {
- $('#imgPlay').attr('src','../img/play.png');
+ $('#imgPlay').attr('src','./img/play.png');
}
// check to see if the playlist was updated
@@ -38,7 +38,7 @@ function getStatus() {
window.trackremoved = false;
}
else {
- $('#frmplaylist').attr('src','/playlist')
+ $('#frmplaylist').attr('src','./playlist')
}
$('#playlistid').val(data.status.playlist);
@@ -134,16 +134,16 @@ function getStatus() {
$('#currentid').val('');
$('#title').html(data.track.file);
$('#wiki').hide();
- $('#currentart').attr('src','/img/50trans.gif');
- $('#currentartmask').attr('src','/img/50trans.gif');
+ $('#currentart').attr('src','./img/50trans.gif');
+ $('#currentartmask').attr('src','./img/50trans.gif');
}
$('#aWiki').attr('href','http://www.google.com/search?btnI=I\'m+Feeling+Lucky&q=site:en.wikipedia.org%20' + data.track.artist);
$('#wiki').show();
- var arturl = '/fetchart?artist=' + data.track.artist + '&album=' + data.track.album
+ var arturl = './fetchart?artist=' + data.track.artist + '&album=' + data.track.album
$('#currentartlink').attr('href',arturl)
$('#currentart').attr('src',arturl)
- $('#currentartmask').attr('src','/img/albumart_mask.png');
+ $('#currentartmask').attr('src','./img/albumart_mask.png');
$('#currentartlink').lightBox();
if (data.track.artist && data.track.title)
@@ -178,8 +178,8 @@ function getStatus() {
$('#currentid').val('');
$('#title').html('not playing');
$('#wiki').hide();
- $('#currentart').attr('src','/img/50trans.gif');
- $('#currentartmask').attr('src','/img/50trans.gif');
+ $('#currentart').attr('src','./img/50trans.gif');
+ $('#currentartmask').attr('src','./img/50trans.gif');
}
}
@@ -251,7 +251,7 @@ function setVolume(val) {
// check to see if the slider was simply updated by status() if so, don't update MPD
if (!window.ignorevolumeslide)
- $.get('/mpdcontrol/setvolume/' + val);
+ $.get('./mpdcontrol/setvolume/' + val);
window.ignorevolumeslide = false;
}
@@ -260,7 +260,7 @@ function seek(id,pos) {
// check to see if the slider was simply updated by status() if so, don't update MPD
if (!window.ignorepositionslide)
- $.get('/mpdcontrol/seek/' + id + '/' + pos);
+ $.get('./mpdcontrol/seek/' + id + '/' + pos);
window.ignorepositionslide = false;
}
@@ -292,16 +292,16 @@ function formatTime(seconds)
}
function cmd(v) {
- $.get('/mpdcontrol/' + v);
+ $.get('./mpdcontrol/' + v);
getStatus();
}
function artistAlbums(artist,album) {
if (!album)
album = '';
- window.parent.$('#frmalbums').attr('src','/albums?artist=' + encodeURIComponent(artist) + '&album=' + encodeURIComponent(album))
- window.parent.$('#frmtracks').attr('src','/tracks?artist=' + encodeURIComponent(artist) + '&album=' + encodeURIComponent(album))
+ window.parent.$('#frmalbums').attr('src','./albums?artist=' + encodeURIComponent(artist) + '&album=' + encodeURIComponent(album))
+ window.parent.$('#frmtracks').attr('src','./tracks?artist=' + encodeURIComponent(artist) + '&album=' + encodeURIComponent(album))
$('#list li:odd a',window.parent.frames['frmartists'].document).removeClass('activerow').addClass('oddrow');
@@ -313,7 +313,7 @@ function artistAlbums(artist,album) {
}
);
- if (window.location.pathname != '/artists') {
+ if (window.location.pathname != './artists') {
if (artist.charCodeAt(0) < 65)
jumpa = '#';
else
@@ -357,21 +357,21 @@ function resizeIframes() {
}
function addToPlaylist(file) {
- var url = '/mpdcontrol/addtoplaylist';
+ var url = './mpdcontrol/addtoplaylist';
$.ajax({
url: url,
type: 'POST',
cache: false,
data: 'file=' + file,
success: function() {
- window.parent.$('#frmplaylist').attr('src','/playlist')
+ window.parent.$('#frmplaylist').attr('src','./playlist')
}
});
}
function removeTrack(el,id) {
- var url = '/mpdcontrol/removetrack/' + id
+ var url = './mpdcontrol/removetrack/' + id
window.parent.trackremoved = true;
$.ajax({
url: url,
@@ -388,7 +388,7 @@ function removeTrack(el,id) {
}
function removeMultipleTracks() {
- var url = '/mpdcontrol/removemultipletracks/'
+ var url = './mpdcontrol/removemultipletracks/'
var all_ids = Array();
var iter = 0;
@@ -435,7 +435,7 @@ function setPlaylistColors(scope,force) {
}
function playNow(id) {
- var url = '/mpdcontrol/playnow/' + id;
+ var url = './mpdcontrol/playnow/' + id;
$.ajax({
url: url,
type: 'GET',
@@ -447,26 +447,26 @@ function playNow(id) {
}
function addAlbum(artist,album) {
- var url = '/mpdcontrol/addalbumtoplaylist?artist=' + encodeURIComponent(artist) + '&album=' + encodeURIComponent(album);
+ var url = './mpdcontrol/addalbumtoplaylist?artist=' + encodeURIComponent(artist) + '&album=' + encodeURIComponent(album);
$.ajax({
url: url,
type: 'GET',
cache: false,
success: function() {
- $('#frmplaylist').attr('src','/playlist')
+ $('#frmplaylist').attr('src','./playlist')
getStatus()
}
});
}
function addAllArtistAlbums(artist) {
- var url = '/mpdcontrol/addartistalbums?artist=' + encodeURIComponent(artist);
+ var url = './mpdcontrol/addartistalbums?artist=' + encodeURIComponent(artist);
$.ajax({
url: url,
type: 'GET',
cache: false,
success: function() {
- $('#frmplaylist').attr('src','/playlist')
+ $('#frmplaylist').attr('src','./playlist')
getStatus()
}
});
@@ -499,7 +499,7 @@ function hideConfig(reloadframes,reloadpage) {
}
function playlistAjax(func) {
- var url = '/mpdcontrol/' + func;
+ var url = './mpdcontrol/' + func;
$.ajax({
url: url,
type: 'GET',
@@ -527,7 +527,7 @@ function loadPlaylist() {
return;
}
- var url = '/playlist/load?name=' + playlist;
+ var url = './playlist/load?name=' + playlist;
$.ajax({
url: url,
type: 'GET',
@@ -550,7 +550,7 @@ function deletePlaylist() {
if (!confirm('Are you sure you want to delete this playlist?'))
return;
- var url = '/playlist/delete?name=' + playlist;
+ var url = './playlist/delete?name=' + playlist;
$.ajax({
url: url,
type: 'GET',
@@ -562,7 +562,7 @@ function deletePlaylist() {
}
function fsStatus() {
- $.getJSON('/mpdcontrol/fs_status',
+ $.getJSON('./mpdcontrol/fs_status',
function (data) {
var begin_id = $('#currentid').html();
@@ -583,7 +583,7 @@ function fsStatus() {
$('#currentalbum').html(data.current.album);
}
- var arturl = '/fetchart?artist=' + data.current.artist + '&album=' + data.current.album
+ var arturl = './fetchart?artist=' + data.current.artist + '&album=' + data.current.album
$('#albumart-container a').attr('href',arturl)
$('#albumart').attr('src',arturl)
$('#albumart-container a').lightBox();
@@ -655,7 +655,7 @@ function editStream(name,url) {
}
function playNext(id) {
- var url = '/mpdcontrol/playnext/' + id;
+ var url = './mpdcontrol/playnext/' + id;
$.ajax({
url: url,
type: 'GET',
@@ -667,15 +667,15 @@ function playNext(id) {
}
function addPathToPlaylist(path) {
- var url = '/mpdcontrol/addpathtoplaylist';
+ var url = './mpdcontrol/addpathtoplaylist';
$.ajax({
url: url,
type: 'POST',
cache: false,
data: 'path=' + path,
success: function() {
- window.parent.$('#frmplaylist').attr('src','/playlist')
+ window.parent.$('#frmplaylist').attr('src','./playlist')
}
});
}
@@ -687,7 +687,7 @@ function setSearchType(s) {
function performSearch() {
var q = $('#search input[name=q]').val();
var searchtype = $('#searchtype').val()
- $('#searchresults').load('/search?searchtype=' + searchtype + '&q=' + q,undefined,function(){
+ $('#searchresults').load('./search?searchtype=' + searchtype + '&q=' + q,undefined,function(){
$('#searchresults').show('slide',{direction:'down'},1500);
});
}
@@ -8,7 +8,7 @@
albumimgs.each(function(i) {
var offset = $(this).offset();
var id = 'mask_' + i;
- $(this).after('<img id="' + id + '" src="/img/albumart_mask_45.png">');
+ $(this).after('<img id="' + id + '" src="./img/albumart_mask_45.png">');
$('#' + id).css('position','absolute').css('top',offset.top).css('left',offset.left);
});
}
@@ -23,7 +23,7 @@
}
</style>
-<h2>${c.artist} <a onclick="addAllArtistAlbums('${h.escape_js(c.artist)}')" style="cursor:pointer" title="add all albums"><img src="/img/add.png" /></a></h2>
+<h2>${c.artist} <a onclick="addAllArtistAlbums('${h.escape_js(c.artist)}')" style="cursor:pointer" title="add all albums"><img src="./img/add.png" /></a></h2>
<div id="artistalbumart">
% if len(c.album_imgs) > 0:
@@ -43,7 +43,7 @@ <h2>${c.artist} <a onclick="addAllArtistAlbums('${h.escape_js(c.artist)}')" styl
else:
addclass = ''
%>
- <li><a onclick="window.parent.addAlbum('${h.escape_js(c.artist)}','${h.escape_js(album_utf8)}')"><img src="/img/add.png" title="queue entire album" style="float:left;margin-right:5px;" /></a><a ${addclass} onclick="albumTracks('${h.escape_js(c.artist)}','${h.escape_js(album_utf8)}')">${album_utf8}</a></li>
+ <li><a onclick="window.parent.addAlbum('${h.escape_js(c.artist)}','${h.escape_js(album_utf8)}')"><img src="./img/add.png" title="queue entire album" style="float:left;margin-right:5px;" /></a><a ${addclass} onclick="albumTracks('${h.escape_js(c.artist)}','${h.escape_js(album_utf8)}')">${album_utf8}</a></li>
% endfor
</ul>
</div>
@@ -1,6 +1,6 @@
<%inherit file="/body.html"/>
<style>
- @import '/css/fullscreen.css';
+ @import './css/fullscreen.css';
</style>
<script language="javascript">
$(document).ready(function() {
@@ -17,7 +17,7 @@
<div id="container-tracks">
<ul id="list">
% for g in c.genres:
- <li><a href="/genre?genre=${h.html.url_escape(g)}">${g}</a></li>
+ <li><a href="./genre?genre=${h.html.url_escape(g)}">${g}</a></li>
% endfor
</ul>
</div>
Oops, something went wrong.

0 comments on commit 5cfb8d1

Please sign in to comment.