From 429d6c5e76c7039afee99b5c5f8fa8cf56f3fa73 Mon Sep 17 00:00:00 2001 From: rlx <0x0073@0x2620.org> Date: Sat, 4 Jun 2011 04:37:05 +0000 Subject: [PATCH] adding homePage.js --- static/js/pandora/ui/homePage.js | 78 +++++++++++++++++++++++++++++ static/js/pandora/ui/rightPanel.js | 20 +++++--- static/json/pandora.json | 1 + static/png/icon.16.png | Bin 3105 -> 799 bytes 4 files changed, 91 insertions(+), 8 deletions(-) create mode 100644 static/js/pandora/ui/homePage.js diff --git a/static/js/pandora/ui/homePage.js b/static/js/pandora/ui/homePage.js new file mode 100644 index 0000000..b68c52e --- /dev/null +++ b/static/js/pandora/ui/homePage.js @@ -0,0 +1,78 @@ +// vim: et:ts=4:sw=4:sts=4:ft=js + +pandora.ui.homePage = function() { + + var that = Ox.Element() + .css({padding: '8px'}); + + var $left = $('
') + .css({ + float: 'left', + margin: '8px', + background: 'black' + }) + .html('left') + .appendTo(that.$element), + $center = $('
') + .css({ + float: 'left', + margin: '8px' + }) + .appendTo(that.$element), + $right = $('
') + .css({ + float: 'left', + margin: '8px', + background: 'black' + }) + .html('right') + .appendTo(that.$element), + $logo = $('') + .attr({src: '/static/png/logo256.png'}) + .appendTo($center); + // fixme: duplicated + $select = Ox.Select({ + id: 'select', + items: $.merge($.map(app.ui.findKeys, + function(key, i) { + return { + id: key.id, + title: 'Find: ' + key.title + }; + }), [{}, { + id: 'advanced', + title: 'Find: Advanced' + }]), + overlap: 'right', + width: 112 + }) + $input = Ox.Input({}) + .bindEvent({ + change: function() { + + } + }); + $findElement = Ox.FormElementGroup({ + elements: [$select, $input], + }) + .css({marginTop: '16px'}) + .appendTo($center); + $center = $('
') + .css({marginTop: '16px'}) + .html('center') + .appendTo($center); + + that.resize = function() { + var size = Ox.divideInt(window.innerWidth - app.user.ui.showSidebar * app.user.ui.sidebarSize - 1 - 64, 3); + $left.css({width: size[0] + 'px'}); + $center.css({width: size[1] + 'px'}); + $logo.css({width: size[1] + 'px'}); + $input.options({width: size[1] - 112}); + $right.css({width: size[2] + 'px'}); + }; + + that.resize(); + + return that; + +} \ No newline at end of file diff --git a/static/js/pandora/ui/rightPanel.js b/static/js/pandora/ui/rightPanel.js index 2498f5a..937d12f 100644 --- a/static/js/pandora/ui/rightPanel.js +++ b/static/js/pandora/ui/rightPanel.js @@ -2,16 +2,20 @@ pandora.ui.rightPanel = function() { var that; if (app.user.ui.section == 'site') { - that = new Ox.Element() - .html(app.user.ui.sitePage) - .bindEvent({ - resize: function(event, data) { - - } - }); + if (app.user.ui.sitePage == 'home') { + that = pandora.ui.homePage() + .bindEvent({ + resize: function(data) { + that.resize(); + } + }); + } else { + that = new Ox.Element() + .css({padding: '8px'}); pandora.api.getPage(app.user.ui.sitePage, function(result) { - that.html(result.data.body).css({'overflow-y':'auto'}); + that.html(result.data.body).css({overflowY: 'auto'}); }); + } } else if (app.user.ui.section == 'items') { that = new Ox.SplitPanel({ elements: [ diff --git a/static/json/pandora.json b/static/json/pandora.json index 9da403b..6be5004 100644 --- a/static/json/pandora.json +++ b/static/json/pandora.json @@ -5,6 +5,7 @@ "js/pandora/autovalidate.js", "js/pandora/UI.js", "js/pandora/ui/info.js", + "js/pandora/ui/homePage.js", "js/pandora/ui/rightPanel.js", "js/pandora/ui/folderBrowserList.js", "js/pandora/ui/group.js", diff --git a/static/png/icon.16.png b/static/png/icon.16.png index 00dfb035979aff55aa382add9b2cce9ca1b832f8..8762374921db541db60e7ef98ec0916029ad7309 100644 GIT binary patch delta 787 zcmV+u1MK{v7@r1^8Gi-<001BJ|6u?C0_I6XK~#90b(23!YiSV1pLyTcoFpC+5k~38d#jXE{eJ&9k=5{z|8pg_&~8(^nW`$J6x?+{p94N+uPgYiHQjp z$1%M3P}bT{(Xh7GLTinYkr7;8UW$#44Q{nsh~pR!4-Ys!JtZk6X{{lwwJ^r~Lp)6H zJ<>E4XJ==qR4SrgudDO(b00;K1OQ{qpMd{^Xsw}?LZ{QA=jUht`ufUOS63vZgw`6? z+P?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