move js files from js/pandora to js, fixes #1366
This commit is contained in:
parent
b5eda32bbd
commit
a9b7738aa8
104 changed files with 7 additions and 2 deletions
62
static/js/embedPanel.js
Normal file
62
static/js/embedPanel.js
Normal file
|
|
@ -0,0 +1,62 @@
|
|||
'use strict';
|
||||
|
||||
// FIXME: rename to embedView
|
||||
|
||||
pandora.ui.embedPanel = function() {
|
||||
|
||||
var that,
|
||||
ui = pandora.user.ui,
|
||||
view = !ui.item ? ui.listView : ui.itemView;
|
||||
|
||||
if (ui.section != 'texts' && !ui.page) {
|
||||
if (!ui.item) {
|
||||
if (Ox.contains(['grid', 'clip'], view)) {
|
||||
that = pandora.ui.embedError(true);
|
||||
} else if (view == 'video') {
|
||||
that = pandora.ui.videoView(true);
|
||||
} else if (Ox.contains(['map', 'calendar'], view)) {
|
||||
that = pandora.ui.embedNavigation(view);
|
||||
}
|
||||
} else {
|
||||
if (view == 'info') {
|
||||
that = pandora.ui.embedError(true);
|
||||
} else if (Ox.contains(['player', 'editor'], view)) {
|
||||
that = pandora.ui.embedPlayer();
|
||||
} else if (view == 'timeline') {
|
||||
that = pandora.ui.embedError(true);
|
||||
} else if (view == 'clips') {
|
||||
that = pandora.ui.embedError(true);
|
||||
} else if (Ox.contains(['map', 'calendar'], view)) {
|
||||
that = pandora.ui.embedNavigation(view);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!that) {
|
||||
that = pandora.ui.embedError();
|
||||
}
|
||||
|
||||
that.display = function() {
|
||||
// fixme: move animation into Ox.App
|
||||
var animate = $('.OxScreen').length == 0;
|
||||
Ox.Log('', 'ANIMATE?', animate)
|
||||
animate && pandora.$ui.body.css({opacity: 0});
|
||||
that.appendTo(pandora.$ui.body);
|
||||
animate && pandora.$ui.body.animate({opacity: 1}, 1000);
|
||||
return that;
|
||||
};
|
||||
|
||||
that.reloadPanel = function() {
|
||||
that.setElement(pandora.$ui.embedPanel = pandora.ui.embedPanel());
|
||||
return that;
|
||||
};
|
||||
|
||||
that.bindEvent({
|
||||
pandora_item: that.reloadPanel,
|
||||
pandora_itemview: that.reloadPanel,
|
||||
pandora_videopoints: that.reloadPanel,
|
||||
pandora_hash: that.reloadPanel
|
||||
});
|
||||
|
||||
return that;
|
||||
|
||||
};
|
||||
Loading…
Add table
Add a link
Reference in a new issue