use Ox.localStorage

This commit is contained in:
j 2011-12-31 02:17:40 +05:30
parent 691b1e98cc
commit 90a36cfa17
5 changed files with 22 additions and 20 deletions

View file

@ -47,6 +47,7 @@ class Command(BaseCommand):
for s in models.Stream.objects.exclude(format=format, resolution=resolution).filter(source=None):
s.source = models.Stream.objects.get(file=s.file, resolution=resolution, format=format)
s.save()
print "update streams"
for s in models.Stream.objects.filter(source=None):
if not glob("%s*"%s.timeline_prefix):
s.make_timeline()

View file

@ -10,8 +10,8 @@
<meta name="application-url" content="{{base_url}}"/>
<link rel="search" type="application/opensearchdescription+xml" href="/opensearch.xml" title="{{settings.SITENAME}}" />
<script>
if (localStorage && !localStorage.OxTheme)
localStorage.OxTheme = '{{settings.CONFIG.user.ui.theme}}';
if (localStorage && !localStorage['Ox.theme'])
localStorage['Ox.theme'] = '"{{settings.CONFIG.user.ui.theme}}"';
</script>
<script type="text/javascript" src="/static/oxjs/build/Ox.js"></script>
<script type="text/javascript" src="/static/js/pandora.js"></script>

View file

@ -31,8 +31,9 @@ appPanel
} catch(e) {}
};
var debug = localStorage && localStorage.pandoraDebug,
theme = localStorage && localStorage.OxTheme || 'modern';
var debug = localStorage && localStorage['pandora.debug'],
theme = localStorage && localStorage['Ox.theme']
&& JSON.parse(localStorage['Ox.theme']) || 'modern';
loadImages(function(images) {
loadScreen(images);
@ -143,7 +144,10 @@ appPanel
}
function loadPandora(browserSupported) {
window.pandora = Ox.App({url: '/api/'}).bindEvent({
window.pandora = Ox.App({
name: 'pandora',
url: '/api/',
}).bindEvent({
load: function(data) {
data.browserSupported = browserSupported;
Ox.extend(pandora, {
@ -152,11 +156,12 @@ appPanel
});
loadPandoraFiles(function() {
initPandora(data);
if (localStorage && localStorage.pandoraLocal) {
if (pandora.localStorage('local')) {
var url = pandora.localStorage('local');
window.pandora.local = Ox.API({
'url': localStorage.pandoraLocal + '/api/'
'url': url + '/api/'
}, function() {
pandora.site.site.videoprefix = localStorage.pandoraLocal;
pandora.site.site.videoprefix = url;
});
}
});
@ -166,7 +171,7 @@ appPanel
function loadPandoraFiles(callback) {
var prefix = '/static/';
if (localStorage && localStorage.pandoraDebug) {
if (localStorage && localStorage['pandora.debug']) {
Ox.getJSON(prefix + 'json/pandora.json', function(files) {
var promises = [];
files.forEach(function(file) {
@ -268,12 +273,6 @@ appPanel
videoFormat: Ox.UI.getVideoFormat(pandora.site.video.formats)
});
/* disabled
if (data.user.level == 'guest' && $.browser.mozilla && !localStorage.OxTheme) {
pandora.user.ui.theme = 'classic';
}
*/
// set up url controller
pandora.URL.init().parse(function() {

View file

@ -144,7 +144,7 @@ pandora.ui.mainMenu = function() {
{ id: 'clearcache', title: 'Clear Cache'},
{ id: 'reloadapplication', title: 'Reload Application'},
{ id: 'resetui', title: 'Reset UI Settings'},
{ id: 'debug', title: (localStorage.pandoraDebug?'Disable':'Enable')+' Debug Mode'},
{ id: 'debug', title: (pandora.localStorage('debug')?'Disable':'Enable')+' Debug Mode'},
{ id: 'triggererror', title: 'Trigger JavaScript Error'},
] }
]
@ -293,12 +293,12 @@ pandora.ui.mainMenu = function() {
pandora.$ui.appPanel.reload();
});
} else if (data.id == 'debug') {
if(localStorage.pandoraDebug) {
delete localStorage.pandoraDebug;
if(pandora.localStorage('debug')) {
pandora.localStorage.delete('debug');
} else {
localStorage.pandoraDebug = 1;
pandora.localStorage('debug', true);
}
that.setItemTitle('debug', (localStorage.pandoraDebug ? 'Disable' : 'Enable') + ' Debug Mode');
that.setItemTitle('debug', (pandora.localStorage('debug') ? 'Disable' : 'Enable') + ' Debug Mode');
} else if (data.id == 'triggererror') {
var e = error;
}

View file

@ -32,6 +32,8 @@ sudo vmbuilder vbox ubuntu --suite=oneiric \
--addpkg python-numpy \
--addpkg python-psycopg2 \
--addpkg python-simplejson \
--addpkg python-lxml \
--addpkg python-html5lib \
--addpkg oxtimeline \
--addpkg oxframe \
--addpkg mkvtoolnix \