From e18c2d271172bc19f1c999cc9498989c3eb87800 Mon Sep 17 00:00:00 2001 From: "Matteo Nastasi (mop)" Date: Sun, 10 May 2009 16:43:58 +0000 Subject: [PATCH] sideslide added --- web/index.php | 102 +++++++++++++++++++++++++++++++++++++------------- web/room.js | 63 +++++++++++++++++++++++++++++++ 2 files changed, 139 insertions(+), 26 deletions(-) diff --git a/web/index.php b/web/index.php index effe155..ece7b3c 100644 --- a/web/index.php +++ b/web/index.php @@ -191,29 +191,62 @@ function main() $standup .= ''; } - $altout_propag = array( array ( 'id' => 'btn_altout', + $altout_sponsor_arr = array( array ( 'id' => 'btn_altout', 'url' => 'http://www.alternativeoutput.it', 'content' => 'img/altout80x15.png', - 'content_big' => 'img/altout80x15.png'), + 'content_big' => 'img/logotxt_banner.png'), array ( 'id' => 'btn_virtualsky', 'url' => 'http://virtualsky.alternativeoutput.it', 'content' => 'img/virtualsky80x15a.gif', - 'content_big' => 'img/virtualsky_big.png') + 'content_big' => 'img/virtualsky_big.png'), + array ( 'id' => 'btn_dynamica', + 'url' => 'http://www.dynamica.it', + 'content' => 'img/dynamica.png', + 'content_big' => 'img/dynamica_big.png') ); - + + $altout_support_arr = array( array ( 'id' => 'btn_brichi', + 'url' => 'http://www.briscolachiamata.it', + 'content' => 'img/brichi.png', + 'content_big' => 'img/brichi_big.png'), + array ( 'id' => 'btn_foroli', + 'url' => 'http://www.forumolimpia.it', + 'content' => 'img/forumolimpia.gif', + 'content_big' => 'img/forumolimpia_big.png' ) ); + + + + $altout_support = ""; + for ($i = 0 ; $i < 3 ; $i++) { + $ii = ($i < 2 ? $i : 0); + + $altout_support .= sprintf('
', + $i * 20, $altout_support_arr[$ii]['url'], + $altout_support_arr[$ii]['id'], $altout_support_arr[$ii]['content']); + + $altout_support_big .= sprintf('', + $altout_support_arr[$ii]['id'], $altout_support_arr[$ii]['content_big']); + } + + // seed with microseconds since last "whole" second - srand ((double) microtime() * 1000000); - // $randval = rand(0,count($altout_propag)-1); - $randval = 1; - $altout_carousel = sprintf('', - $altout_propag[$randval]['url'], - $altout_propag[$randval]['id'], - $altout_propag[$randval]['content']); - - $altout_carousel_big = sprintf('', - $altout_propag[$randval]['id'], - $altout_propag[$randval]['content_big']); - + // srand ((double) microtime() * 1000000); + // $randval = rand(0,count($altout_sponsor_arr)-1); + $altout_sponsor = ""; + for ($i = 0 ; $i < 4 ; $i++) { + $ii = ($i < 3 ? $i : 0); + + $altout_sponsor .= sprintf('
', + $i * 20, $altout_sponsor_arr[$ii]['url'], + $altout_sponsor_arr[$ii]['id'], $altout_sponsor_arr[$ii]['content']); + + $altout_sponsor_big .= sprintf('', + $altout_sponsor_arr[$ii]['id'], $altout_sponsor_arr[$ii]['content_big']); + } + + + + $brisk_donate = file_get_contents(FTOK_PATH."/brisk_donate.txt"); if ($brisk_donate == FALSE) @@ -411,20 +444,30 @@ $brisk_vertical_menu = '
-sponsored by:

'.$altout_carousel.'
-

+sponsored by:

+
+
'.$altout_sponsor.'
+
+
+'.$altout_sponsor_big.' +
+
supported by:

-
-
-
+
+
'.$altout_support.'
+ +
+
+
+'.$altout_support_big.' +
+ +


%s %s - - - -'.$altout_carousel_big.''; +
'; /* Templates. */ if ($ACTION == 'login') { @@ -457,10 +500,14 @@ supported by:

var topbanner_sfx, topbanner_dx; var g_brow = null; var sess = "not_connected"; - + var spo_slide, sup_slide; + window.onload = function() { // alert(window.onbeforeunload); g_brow = get_browser_agent(); + spo_slide = new sideslide($('spon_caro'), 80, 20); + sup_slide = new sideslide($('supp_caro'), 60, 20); + login_init();
window.onload = function() { g_brow = get_browser_agent(); + spo_slide = new sideslide($('spon_caro'), 80, 20); + sup_slide = new sideslide($('supp_caro'), 60, 20); + diff --git a/web/room.js b/web/room.js index 0e0aed9..85c9275 100644 --- a/web/room.js +++ b/web/room.js @@ -595,3 +595,66 @@ function list_set(what, setco, info) createCookie("CO_list", what, 24*365, cookiepath); } } + +function sideslide(domobj, height, step) +{ + this.st = 'wait'; + this.twait = 5000; + + this.domobj = domobj; + this.height = height; + this.step = step; + + this.start(); +} + +sideslide.prototype = { + id: null, + st: 'wait', + twait: 0, + scroll: 0, + countdown: 0, + + domobj: null, + height: 0, + step: 0, + + start: function() { + var instant = this; + + this.st = 'wait'; + this.id = setTimeout(function () { instant.sideslide_cb(); }, this.twait); + }, + + sideslide_cb: function() { + var instant = this; + + if (this.st == 'wait') { + this.st = 'scroll'; + this.countdown = 10; + this.id = setInterval(function () { instant.sideslide_cb(); }, 100); + } + else if (this.st == 'scroll') { + this.scroll += (this.step / 10); + if (this.scroll >= this.height - this.step) { + this.scroll = 0; + } + this.domobj.scrollTop = this.scroll; + this.countdown--; + if (this.countdown == 0) { + this.stop(); + this.st = 'wait'; + this.id = setTimeout(function () { instant.sideslide_cb(); }, this.twait); + } + } + }, + + + stop: function() { + if (this.id != null) { + clearInterval(this.id); + this.id = null; + } + } + +} -- 2.17.1