build static, move js files

This commit is contained in:
j 2011-10-23 04:29:20 +02:00
commit 7586f2746a
65 changed files with 146 additions and 116 deletions

View file

@ -29,7 +29,7 @@ Ox.load({
hideScreen: false,
loadImages: true,
showScreen: true,
theme: 'modern'
theme: localStorage?localStorage.theme:'modern'
},
Geo: {}
}, function(browserSupported) {
@ -54,7 +54,7 @@ Ox.load({
ui: {}
});
loadResources('/static/json/pandora.json', function() {
loadResources(function() {
Ox.print('Ox.App load', data);
@ -144,34 +144,33 @@ Ox.load({
});
}, '/static/'); // fixme: why does loadResources have an argument after callback????
});
}
});
function loadResources(json, callback, prefix) {
prefix = prefix || '';
$.getJSON(json, function(files) {
var promises = [];
files.forEach(function(file) {
// fixme: opera doesnt fire onload for svgs
// (but neither do we support opera nor do we have svgs)
if ($.browser.opera && Ox.endsWith(file, '.svg')) {
return;
}
var dfd = new $.Deferred();
promises.push(dfd.promise());
Ox.loadFile(prefix + file, function() {
dfd.resolve();
function loadResources(callback) {
var prefix = '/static/';
if(localStorage && localStorage.debug) {
Ox.getJSON(prefix + 'json/pandora.json', function(files) {
var promises = [];
files.forEach(function(file) {
var dfd = new $.Deferred();
promises.push(dfd.promise());
Ox.loadFile(prefix + file, function() {
dfd.resolve();
});
});
$.when.apply(null, promises)
.done(function() {
callback();
})
.fail(function() {
throw new Error('File not found.');
});
});
$.when.apply(null, promises)
.done(function() {
callback();
})
.fail(function() {
throw new Error('File not found.')
});
});
} else {
Ox.loadFile(prefix + 'js/pandora.js', callback);
}
}
});

View file

@ -28,6 +28,7 @@ pandora.ui.item = function() {
}*/
if (['video', 'timeline'].indexOf(pandora.user.ui.itemView) > -1) {
// fixme: layers have value, subtitles has text?
var subtitles = result.data.layers.subtitles
? result.data.layers.subtitles.map(function(subtitle) {
return {'in': subtitle['in'], out: subtitle.out, text: subtitle.value};
@ -54,7 +55,19 @@ pandora.ui.item = function() {
};
})
)
: [{'in': 0, out: result.data.duration}];
: [{'in': 0, out: result.data.duration}],
layers = [],
video = {};
pandora.site.layers.forEach(function(layer, i) {
layers[i] = Ox.extend({}, layer, {items: result.data.layers[layer.id]});
});
pandora.site.video.resolutions.forEach(function(resolution) {
video[resolution] = Ox.range(result.data.parts).map(function(i) {
return '/' + pandora.user.ui.item + '/'
+ resolution + 'p' + (i + 1) + '.' + pandora.user.videoFormat;
});
});
}
if (!result.data.rendered && [
@ -64,7 +77,7 @@ pandora.ui.item = function() {
Ox.Element()
.css({marginTop: '32px', fontSize: '12px', textAlign: 'center'})
.html(
'Sorry, <i>' + result.data.title
'Sorry, <i>' + result.data.title
+ '</i> currently doesn\'t have a '
+ pandora.user.ui.itemView + ' view.'
)
@ -135,18 +148,7 @@ pandora.ui.item = function() {
} else if (pandora.user.ui.itemView == 'video') {
// fixme: duplicated
var clipsQuery = pandora.getClipsQuery(),
isClipsQuery = !!clipsQuery.conditions.length,
layers = [],
video = {};
pandora.site.layers.forEach(function(layer, i) {
layers[i] = Ox.extend({}, layer, {items: result.data.layers[layer.id]});
});
pandora.site.video.resolutions.forEach(function(resolution) {
video[resolution] = Ox.range(result.data.parts).map(function(i) {
return '/' + pandora.user.ui.item + '/'
+ resolution + 'p' + (i + 1) + '.' + pandora.user.videoFormat;
});
});
isClipsQuery = !!clipsQuery.conditions.length;
//
pandora.$ui.contentPanel.replaceElement(1, pandora.$ui.player = Ox.VideoPanelPlayer({
annotationsSize: pandora.user.ui.annotationsSize,
@ -200,18 +202,7 @@ pandora.ui.item = function() {
} else if (pandora.user.ui.itemView == 'timeline') {
var clipsQuery = pandora.getClipsQuery(),
isClipsQuery = !!clipsQuery.conditions.length,
layers = [],
video = {};
pandora.site.layers.forEach(function(layer) {
layers.push(Ox.extend({items: result.data.layers[layer.id]}, layer));
});
pandora.site.video.resolutions.forEach(function(resolution) {
video[resolution] = Ox.range(result.data.parts).map(function(i) {
return '/' + pandora.user.ui.item + '/'
+ resolution + 'p' + (i + 1) + '.' + pandora.user.videoFormat;
});
});
isClipsQuery = !!clipsQuery.conditions.length;
pandora.$ui.contentPanel.replaceElement(1, pandora.$ui.editor = Ox.VideoEditor({
annotationsSize: pandora.user.ui.annotationsSize,
censored: censored,
@ -237,7 +228,6 @@ pandora.ui.item = function() {
posterFrame: parseInt(video.duration / 2),
showAnnotations: pandora.user.ui.showAnnotations,
showLargeTimeline: true,
// fixme: layers have value, subtitles has text?
subtitles: subtitles,
tooltips: true,
video: video,

View file

@ -1,60 +1,60 @@
[
"js/pandora/Query.js",
"js/pandora/UI.js",
"js/pandora/URL.js",
"js/pandora/autovalidate.js",
"js/pandora/utils.js",
"js/pandora/ui/filesView.js",
"js/pandora/ui/account.js",
"js/pandora/ui/appPanel.js",
"js/pandora/ui/backButton.js",
"js/pandora/ui/browser.js",
"js/pandora/ui/clipList.js",
"js/pandora/ui/contentPanel.js",
"js/pandora/ui/contactForm.js",
"js/pandora/ui/deleteListDialog.js",
"js/pandora/ui/editor.js",
"js/pandora/ui/eventsDialog.js",
"js/pandora/ui/titlesDialog.js",
"js/pandora/ui/filter.js",
"js/pandora/ui/filterDialog.js",
"js/pandora/ui/findElement.js",
"js/pandora/ui/folderBrowser.js",
"js/pandora/ui/folderBrowserBar.js",
"js/pandora/ui/folderBrowserList.js",
"js/pandora/ui/folderList.js",
"js/pandora/ui/folders.js",
"js/pandora/ui/group.js",
"js/pandora/ui/home.js",
"js/pandora/ui/homePage.js",
"js/pandora/ui/info.js",
"js/pandora/ui/infoView.js",
"js/pandora/ui/item.js",
"js/pandora/ui/itemClips.js",
"js/pandora/ui/leftPanel.js",
"js/pandora/ui/list.js",
"js/pandora/ui/listDialog.js",
"js/pandora/ui/mainPanel.js",
"js/pandora/ui/mediaView.js",
"js/pandora/ui/menu.js",
"js/pandora/ui/namesDialog.js",
"js/pandora/ui/navigationView.js",
"js/pandora/ui/orderButton.js",
"js/pandora/ui/placesDialog.js",
"js/pandora/ui/preferencesDialog.js",
"js/pandora/ui/publicLists.js",
"js/pandora/ui/rightPanel.js",
"js/pandora/ui/sectionButtons.js",
"js/pandora/ui/sectionSelect.js",
"js/pandora/ui/sectionbar.js",
"js/pandora/ui/siteDialog.js",
"js/pandora/ui/sortSelect.js",
"js/pandora/ui/status.js",
"js/pandora/ui/statusbar.js",
"js/pandora/ui/toolbar.js",
"js/pandora/ui/usersDialog.js",
"js/pandora/ui/videoPreview.js",
"js/pandora/ui/viewSelect.js",
"js/pandora/ui/helpDialog.js",
"js/pandora/ui/clipPlayer.js"
]
"js/pandora/Query.js",
"js/pandora/UI.js",
"js/pandora/URL.js",
"js/pandora/account.js",
"js/pandora/appPanel.js",
"js/pandora/autovalidate.js",
"js/pandora/backButton.js",
"js/pandora/browser.js",
"js/pandora/clipList.js",
"js/pandora/clipPlayer.js",
"js/pandora/contactForm.js",
"js/pandora/contentPanel.js",
"js/pandora/deleteListDialog.js",
"js/pandora/editor.js",
"js/pandora/eventsDialog.js",
"js/pandora/filesView.js",
"js/pandora/filter.js",
"js/pandora/filterDialog.js",
"js/pandora/findElement.js",
"js/pandora/folderBrowser.js",
"js/pandora/folderBrowserBar.js",
"js/pandora/folderBrowserList.js",
"js/pandora/folderList.js",
"js/pandora/folders.js",
"js/pandora/group.js",
"js/pandora/helpDialog.js",
"js/pandora/home.js",
"js/pandora/homePage.js",
"js/pandora/info.js",
"js/pandora/infoView.js",
"js/pandora/item.js",
"js/pandora/itemClips.js",
"js/pandora/leftPanel.js",
"js/pandora/list.js",
"js/pandora/listDialog.js",
"js/pandora/mainPanel.js",
"js/pandora/mediaView.js",
"js/pandora/menu.js",
"js/pandora/namesDialog.js",
"js/pandora/navigationView.js",
"js/pandora/orderButton.js",
"js/pandora/placesDialog.js",
"js/pandora/preferencesDialog.js",
"js/pandora/publicLists.js",
"js/pandora/rightPanel.js",
"js/pandora/sectionButtons.js",
"js/pandora/sectionSelect.js",
"js/pandora/sectionbar.js",
"js/pandora/siteDialog.js",
"js/pandora/sortSelect.js",
"js/pandora/status.js",
"js/pandora/statusbar.js",
"js/pandora/titlesDialog.js",
"js/pandora/toolbar.js",
"js/pandora/usersDialog.js",
"js/pandora/utils.js",
"js/pandora/videoPreview.js",
"js/pandora/viewSelect.js"
]