From: Michael Prager Date: Tue, 16 Mar 2010 12:26:26 +0000 (+0100) Subject: support for third panel X-Git-Url: https://code.delx.au/comingnext/commitdiff_plain/631bc47f3e5b8f4d65a6c1f0d4d49ae7558427e2 support for third panel --- diff --git a/Readme.txt b/Readme.txt index 26b9416..edf36da 100644 --- a/Readme.txt +++ b/Readme.txt @@ -2,8 +2,8 @@ ComingNext & Coming Next B for N97 ------------------------------------ This widget was originally created by Dr. Cochambre and was extended by -Michael Prager . It will display the next 8 upcoming events -on your N97 homescreen. It consists of two seperate widgets, each displaying +Michael Prager . It will display the next 12 upcoming events +on your N97 homescreen. It consists of tree seperate widgets, each displaying 4 events. For more info or to report bugs, please refere to @@ -184,3 +184,4 @@ Changelog: 1.26 () by Michael Prager - fixed second panel showing the same events as the first panel - mark overdue ToDo events (this feature can be disabled in the settings) + - support for 3 panels diff --git a/build.pl b/build.pl index 467b71a..162e619 100644 --- a/build.pl +++ b/build.pl @@ -13,6 +13,7 @@ use Archive::Zip qw( :ERROR_CODES ); unlink <*.wgz>; unlink <*.zip>; rmtree("ComingNextB"); +rmtree("ComingNextC"); # update version info sed("comingNext/index.html", 'var version = \"(.*?)\";', 'var version = \"'.$version.'\";'); @@ -25,6 +26,12 @@ sed("comingNextB/index.html", 'var panelNum = 0;', 'var panelNum = 1;'); sed("comingNextB/Info.plist", 'DisplayName<\/key>(\s*?)Coming Next (.*?)<\/string>', 'DisplayName<\/key>$1Coming Next B $2<\/string>'); sed("comingNextB/Info.plist", 'Identifier<\/key>(\s*?)(.*?)<\/string>', 'Identifier<\/key>$1$2b<\/string>'); +# add additional widget +copyrecursive("comingNext", "comingNextC"); +sed("comingNextC/index.html", 'var panelNum = 0;', 'var panelNum = 2;'); +sed("comingNextC/Info.plist", 'DisplayName<\/key>(\s*?)Coming Next (.*?)<\/string>', 'DisplayName<\/key>$1Coming Next C $2<\/string>'); +sed("comingNextC/Info.plist", 'Identifier<\/key>(\s*?)(.*?)<\/string>', 'Identifier<\/key>$1$2c<\/string>'); + # package release my $zip = Archive::Zip->new(); $zip->addTree("ComingNext", "ComingNext"); @@ -34,9 +41,14 @@ $zip = Archive::Zip->new(); $zip->addTree("ComingNextB", "ComingNextB"); $zip->writeToFileNamed("comingNextB.wgz"); +$zip = Archive::Zip->new(); +$zip->addTree("ComingNextC", "ComingNextC"); +$zip->writeToFileNamed("comingNextC.wgz"); + $zip = Archive::Zip->new(); $zip->addFile("comingNext.wgz"); $zip->addFile("comingNextB.wgz"); +$zip->addFile("comingNextC.wgz"); $zip->addFile("Readme.txt"); $zip->addFile("License.txt"); $zip->addFile("ComingNext_SkinFetcher_v1.1.sisx"); diff --git a/comingNext/index.html b/comingNext/index.html index ce0d15d..ad66566 100644 --- a/comingNext/index.html +++ b/comingNext/index.html @@ -175,7 +175,7 @@ function isToday(date) function collectLocales() { - var tmpyear = ((panelNum == 0) ? 2000 : 2001); + var tmpyear = 2000 + panelNum; var month = 0; if (months_translated.length > 0) @@ -476,7 +476,7 @@ function updateData() var eventIds = []; var max; if (mode == 0) - max = ((panelNum == 0) ? config['eventsPerWidget'].Value : 2 * config['eventsPerWidget'].Value); + max = (panelNum + 1) * config['eventsPerWidget'].Value; else max = 30; // we can display a lot more events in fullscreen mode @@ -578,7 +578,7 @@ function updateData() } // skip events for the first panel in case this is the second one and we're not in fullscreen mode - if (mode == 0 && panelNum == 1 && counter < config['eventsPerWidget'].Value + 1) { + if (mode == 0 && panelNum > 0 && counter < panelNum * config['eventsPerWidget'].Value + 1) { console.info('skipping (already in first widget) ' + entry.id); continue; }