2013-02-21 10:48:56 +00:00
|
|
|
'use strict';
|
|
|
|
|
2013-03-09 03:49:15 +00:00
|
|
|
// FIXME: rename to embedView
|
2013-03-01 11:24:33 +00:00
|
|
|
|
2013-02-18 10:17:19 +00:00
|
|
|
pandora.ui.embedPanel = function() {
|
2013-02-20 04:39:12 +00:00
|
|
|
|
2013-03-01 11:24:33 +00:00
|
|
|
var that,
|
2013-02-20 08:58:15 +00:00
|
|
|
ui = pandora.user.ui,
|
2013-03-01 11:24:33 +00:00
|
|
|
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);
|
2013-07-11 18:57:40 +00:00
|
|
|
} else if (view == 'video') {
|
|
|
|
that = pandora.ui.videoView(true);
|
2013-03-01 11:24:33 +00:00
|
|
|
} else if (Ox.contains(['map', 'calendar'], view)) {
|
|
|
|
that = pandora.ui.embedNavigation(view);
|
2013-02-20 12:38:51 +00:00
|
|
|
}
|
|
|
|
} else {
|
2013-03-01 11:24:33 +00:00
|
|
|
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);
|
|
|
|
}
|
2013-02-20 10:07:58 +00:00
|
|
|
}
|
|
|
|
}
|
2013-03-01 11:24:33 +00:00
|
|
|
if (!that) {
|
|
|
|
that = pandora.ui.embedError();
|
2013-02-20 08:58:15 +00:00
|
|
|
}
|
|
|
|
|
2013-02-18 10:17:19 +00:00
|
|
|
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;
|
|
|
|
};
|
2013-02-20 04:39:12 +00:00
|
|
|
|
2013-02-22 02:27:13 +00:00
|
|
|
that.reloadPanel = function() {
|
2013-02-22 02:30:39 +00:00
|
|
|
that.setElement(pandora.$ui.embedPanel = pandora.ui.embedPanel());
|
2013-03-01 11:24:33 +00:00
|
|
|
return that;
|
2013-02-22 02:27:13 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
that.bindEvent({
|
|
|
|
pandora_item: that.reloadPanel,
|
|
|
|
pandora_itemview: that.reloadPanel,
|
|
|
|
pandora_videopoints: that.reloadPanel,
|
|
|
|
pandora_hash: that.reloadPanel
|
2013-02-20 12:38:51 +00:00
|
|
|
});
|
|
|
|
|
2013-02-18 10:17:19 +00:00
|
|
|
return that;
|
2013-02-20 04:39:12 +00:00
|
|
|
|
2013-02-20 10:46:24 +00:00
|
|
|
};
|