From f4d99bdcb30e408396d322f1bd872f9c355f0610 Mon Sep 17 00:00:00 2001
From: rlx <0x0073@0x2620.org>
Date: Wed, 24 Aug 2011 21:21:25 +0000
Subject: [PATCH] new files
---
static/js/pandora/ui/home.js | 2 +-
static/js/pandora/ui/preferencesDialog.js | 62 +++++++++++++++++++++
static/js/pandora/ui/siteDialog.js | 68 +++++++++++++++++++++++
3 files changed, 131 insertions(+), 1 deletion(-)
create mode 100644 static/js/pandora/ui/preferencesDialog.js
create mode 100644 static/js/pandora/ui/siteDialog.js
diff --git a/static/js/pandora/ui/home.js b/static/js/pandora/ui/home.js
index aa91b05..615bdf6 100644
--- a/static/js/pandora/ui/home.js
+++ b/static/js/pandora/ui/home.js
@@ -79,7 +79,7 @@ pandora.ui.home = function() {
})
.bindEvent({
submit: function(data) {
- pandora.URL.set('/?find=' + data.value);
+ data.value && pandora.URL.set('/?find=' + data.value);
that.fadeOutScreen();
}
})
diff --git a/static/js/pandora/ui/preferencesDialog.js b/static/js/pandora/ui/preferencesDialog.js
new file mode 100644
index 0000000..3dc6cd7
--- /dev/null
+++ b/static/js/pandora/ui/preferencesDialog.js
@@ -0,0 +1,62 @@
+pandora.ui.preferencesDialog = function() {
+
+ var tabs = [
+ {id: 'account', title: 'Account', selected: true},
+ {id: 'settings', title: 'Settings'}
+ ];
+ var $tabPanel = Ox.TabPanel({
+ content: function(id) {
+ return Ox.SplitPanel({
+ elements: [
+ {
+ element: Ox.Element()
+ .css({padding: '16px'})
+ .append(
+ $('')
+ .attr({src: '/static/png/logo256.png'})
+ .css({width: '128px'})
+ ),
+ size: 144
+ },
+ {
+ element: Ox.Element()
+ .css({padding: '16px', overflowY: 'auto'})
+ .html(Ox.repeat(Ox.getObjectById(tabs, id).title + ' ', 200))
+ }
+ ],
+ orientation: 'horizontal'
+ });
+ },
+ tabs: tabs
+ })
+ .bindEvent({
+ change: function(data) {
+ $dialog.options({
+ title: Ox.getObjectById(tabs, data.selected).title
+ });
+ }
+ });
+ var $dialog = Ox.Dialog({
+ buttons: [
+ Ox.Button({
+ id: 'close',
+ title: 'Close'
+ }).bindEvent({
+ click: function() {
+ $dialog.close();
+ }
+ })
+ ],
+ //closeButton: true,
+ content: $tabPanel,
+ height: Math.round((window.innerHeight - 24) * 0.75),
+ //maximizeButton: true,
+ minHeight: 256,
+ minWidth: 640,
+ title: 'Preferences',
+ width: Math.round(window.innerWidth * 0.75),
+ });
+
+ return $dialog;
+
+};
\ No newline at end of file
diff --git a/static/js/pandora/ui/siteDialog.js b/static/js/pandora/ui/siteDialog.js
new file mode 100644
index 0000000..5d9c443
--- /dev/null
+++ b/static/js/pandora/ui/siteDialog.js
@@ -0,0 +1,68 @@
+pandora.ui.siteDialog = function(section) {
+
+ var tabs = [
+ {id: 'about', title: 'About'},
+ {id: 'news', title: 'News'},
+ {id: 'tour', title: 'Take a Tour'},
+ {id: 'faq', title: 'Frequently Asked Questions'},
+ {id: 'tos', title: 'Terms of Service'},
+ {id: 'contact', title: 'Contact'},
+ {id: 'software', title: 'Software'}
+ ];
+ Ox.getObjectById(tabs, section).selected = true;
+ var $tabPanel = Ox.TabPanel({
+ content: function(id) {
+ return Ox.SplitPanel({
+ elements: [
+ {
+ element: Ox.Element()
+ .css({padding: '16px'})
+ .append(
+ $('')
+ .attr({src: '/static/png/logo256.png'})
+ .css({width: '128px'})
+ ),
+ size: 144
+ },
+ {
+ element: Ox.Element()
+ .css({padding: '16px', overflowY: 'auto'})
+ .html(Ox.repeat(Ox.getObjectById(tabs, id).title + ' ', 200))
+ }
+ ],
+ orientation: 'horizontal'
+ });
+ },
+ tabs: tabs
+ })
+ .bindEvent({
+ change: function(data) {
+ $dialog.options({
+ title: Ox.getObjectById(tabs, data.selected).title
+ });
+ }
+ });
+ var $dialog = Ox.Dialog({
+ buttons: [
+ Ox.Button({
+ id: 'close',
+ title: 'Close'
+ }).bindEvent({
+ click: function() {
+ $dialog.close();
+ }
+ })
+ ],
+ //closeButton: true,
+ content: $tabPanel,
+ height: Math.round((window.innerHeight - 24) * 0.75),
+ //maximizeButton: true,
+ minHeight: 256,
+ minWidth: 640,
+ title: 'About',
+ width: Math.round(window.innerWidth * 0.75),
+ });
+
+ return $dialog;
+
+};
\ No newline at end of file