From c1ff4185a8d98ea757412cdce73b55265e491cc1 Mon Sep 17 00:00:00 2001 From: j Date: Thu, 26 Feb 2026 12:51:11 +0100 Subject: [PATCH 1/2] simple home page --- static/js/home.bakma.js | 178 ++-------------------------------------- 1 file changed, 9 insertions(+), 169 deletions(-) diff --git a/static/js/home.bakma.js b/static/js/home.bakma.js index b592ddd..7b235d6 100644 --- a/static/js/home.bakma.js +++ b/static/js/home.bakma.js @@ -27,40 +27,6 @@ pandora.ui.home = function() { margin: '0 auto 0 auto' }) .appendTo(that); - /* - - $reflectionImage = $('') - .attr({src: '/static/png/logo.png'}) - .css({ - position: 'absolute', - left: 0, - top: '80px', - right: 0, - bottom: 0, - width: '320px', - height: 'auto', - margin: '0 auto 0 auto', - MozTransform: 'scaleY(-1)', - MsTransform: 'scaleY(-1)', - OTransform: 'scaleY(-1)', - WebkitTransform: 'scaleY(-1)' - }) - .appendTo($box), - - $reflectionGradient = $('
') - .addClass('OxReflection') - .css({ - position: 'absolute', - left: 0, - top: '80px', - right: 0, - width: '320px', - height: '160px', - margin: '0 auto 0 auto', - }) - .appendTo($box), - */ - var $logo = Ox.Element({ element: '', tooltip: function() { @@ -87,98 +53,10 @@ pandora.ui.home = function() { }) .appendTo($box), - $findInput = Ox.Input({ - width: 252 - }) - .css({ - position: 'absolute', - left: 0, - top: '104px', - right: '260px', - bottom: 0, - margin: '0 auto 0 auto', - opacity: 0 - }) - .on({ - click: function(e) { - // fixme: why? - e.stopPropagation(); - } - }) - .bindEvent({ - submit: function(data) { - if (data.value) { - $findButton.triggerEvent('click'); - } else { - $browseButton.triggerEvent('click'); - } - } - }) - .appendTo($box), - - $findButton = Ox.Button({ - title: Ox._('Find'), - width: 122 - }) - .css({ - position: 'absolute', - left: '130px', - top: '104px', - right: 0, - bottom: 0, - margin: '0 auto 0 auto', - opacity: 0 - }) - .bindEvent({ - click: function() { - var folder = pandora.getListData().folder, - value = $findInput.value(); - folder && pandora.$ui.folderList[folder].options({selected: []}); - that.fadeOutScreen(); - pandora.UI.set({ - page: '', - find: { - conditions: value === '' - ? [] - : [{key: '*', value: value, operator: '='}], - operator: '&' - }, - section: 'items' - }); - pandora.$ui.findSelect && pandora.$ui.findSelect.value('*'); - pandora.$ui.findInput && pandora.$ui.findInput.value(value); - } - }) - .appendTo($box), - - $browseButton = Ox.Button({ - title: Ox._('Browse'), - width: 122 - }) - .css({ - position: 'absolute', - left: '390px', - top: '104px', - right: 0, - bottom: 0, - margin: '0 auto 0 auto', - opacity: 0 - }) - .bindEvent({ - click: function() { - pandora.UI.set({ - page: pandora.user.ui.page == 'home' ? '' : pandora.user.ui.page, - section: 'items' - }); - that.fadeOutScreen(); - } - }) - .appendTo($box), - $footer = Ox.Element().css({ clear: 'both', height: '64px', - paddingTop: '12px' + textAlign: 'center' }), $signupButton = Ox.Button({ @@ -210,7 +88,7 @@ pandora.ui.home = function() { $preferencesButton = Ox.Button({ title: Ox._('Türkçe'), - width: 252 + width: 128 }) .css({ }) @@ -221,9 +99,7 @@ pandora.ui.home = function() { locale: value, page: '', find: { - conditions: value === '' - ? [] - : [{key: '*', value: value, operator: '='}], + conditions: [], operator: '&' }, section: 'items' @@ -237,7 +113,7 @@ pandora.ui.home = function() { $aboutButton = Ox.Button({ title: Ox._('English'), - width: 252 + width: 128 }) .css({ marginLeft: '8px' @@ -249,9 +125,7 @@ pandora.ui.home = function() { locale: value, page: '', find: { - conditions: value === '' - ? [] - : [{key: '*', value: value, operator: '='}], + conditions: [], operator: '&' }, section: 'items' @@ -268,7 +142,7 @@ pandora.ui.home = function() { .css({ position: 'absolute', left: 0, - top: '152px', + top: '100px', right: 0, bottom: 0, width: '512px', @@ -285,12 +159,7 @@ pandora.ui.home = function() { $('
').html('“Bu websitesi Sivil Düşün AB Programı Aktivist Desteği kapsamında Avrupa Birliği desteği ile hazırlanmıştır.” “Bu websitesi içeriğinin sorumluluğu tamamıyla Koza Görsel Kültür ve Sanat Derneği\'ne aittir ve AB\'nin görüşlerini yansıtmamaktadır.”') ); - if (pandora.user.level == 'guest') { - $signupButton.appendTo($footer); - $signinButton.appendTo($footer); - } else { - $preferencesButton.appendTo($footer); - } + $preferencesButton.appendTo($footer); $aboutButton.appendTo($footer); function getVideos(clips, resolution) { @@ -356,41 +225,13 @@ pandora.ui.home = function() { loadEdit() function showFeatures() { - pandora.api.getHomeItems({active: true}, function(result) { - var items = result.data.items.filter(pandora.isCompleteHomeItem), - $texts; - $features.empty(); - if (items.length) { - $texts = Ox.Element().appendTo($features); - items.forEach(function(item) { - var $item = pandora.renderHomeItem({ - data: item - }).css({ - minHeight: "128px", - borderRadius: "16px", - background: "rgba(0,0,0,0.2)", - border: "5px rgba(0,0,0, 0.01) solid" - }).appendTo($texts); - $item.find('.OxEditableContent').css({ - color: "rgb(240, 240, 240)", - }) - - }); - } else { - $features.css({ - top: '132px' - }); - } - $features.append($footer); - //$features.append($support); - $features.animate({opacity: 1}, 250); - }); + $features.append($footer); + $features.animate({opacity: 1}, 250); } that.fadeInScreen = function() { that.appendTo(Ox.$body).animate({opacity: 1}, 500, function() { that.find('*').animate({opacity: 1}, 250, function() { - $findInput.focusInput(true); showFeatures(); }); }); @@ -411,7 +252,6 @@ pandora.ui.home = function() { var $elements = that.find('*'), count = 0; $box.css({top: window.innerHeight / 2 - 80 + 'px'}); that.css({opacity: 1}).appendTo(Ox.$body); - $findInput.focusInput(true); $box.animate({top: '80px'}, 500, function() { $elements.animate({opacity: 1}, 250, function() { if (++count == $elements.length) { From cb4d10d5bee9b4063e850f724fc1223ad8a76cf4 Mon Sep 17 00:00:00 2001 From: j Date: Thu, 26 Feb 2026 16:30:28 +0100 Subject: [PATCH 2/2] load featured items(again) --- static/js/home.bakma.js | 32 +++++++++++++++++++++++++++++--- 1 file changed, 29 insertions(+), 3 deletions(-) diff --git a/static/js/home.bakma.js b/static/js/home.bakma.js index 7b235d6..14d6348 100644 --- a/static/js/home.bakma.js +++ b/static/js/home.bakma.js @@ -186,7 +186,6 @@ pandora.ui.home = function() { operator: '+' }] }, result => { - console.log('!!', result) edit.clips.forEach(function(clip) { clip.sort = result.data.clips.indexOf(clip.id); }); @@ -225,8 +224,35 @@ pandora.ui.home = function() { loadEdit() function showFeatures() { - $features.append($footer); - $features.animate({opacity: 1}, 250); + pandora.api.getHomeItems({active: true}, function(result) { + var items = result.data.items.filter(pandora.isCompleteHomeItem), + $texts; + $features.empty(); + if (items.length) { + $texts = Ox.Element().appendTo($features); + items.forEach(function(item) { + var $item = pandora.renderHomeItem({ + data: item + }).css({ + minHeight: "128px", + borderRadius: "16px", + background: "rgba(0,0,0,0.2)", + border: "5px rgba(0,0,0, 0.01) solid" + }).appendTo($texts); + $item.find('.OxEditableContent').css({ + color: "rgb(240, 240, 240)", + }) + + }); + } else { + $features.css({ + top: '132px' + }); + } + $features.append($footer); + $features.animate({opacity: 1}, 250); + }); + } that.fadeInScreen = function() {