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 00dfb03..8762374 100644 Binary files a/static/png/icon.16.png and b/static/png/icon.16.png differ