From: Michael Andreen Date: Mon, 26 May 2008 12:58:11 +0000 (+0200) Subject: Initial commit of catalyst files X-Git-Url: https://ruin.nu/git/?p=ndwebbie.git;a=commitdiff_plain;h=3fc40135d773a95ede229e71efb48e07fdf3c418 Initial commit of catalyst files --- diff --git a/Makefile.PL b/Makefile.PL new file mode 100644 index 0000000..1b1b886 --- /dev/null +++ b/Makefile.PL @@ -0,0 +1,17 @@ +use inc::Module::Install; + +name 'NDWeb'; +all_from 'lib/NDWeb.pm'; + +requires 'Catalyst::Runtime' => '5.7013'; +requires 'Catalyst::Plugin::ConfigLoader'; +requires 'Catalyst::Plugin::Static::Simple'; +requires 'Catalyst::Action::RenderView'; +requires 'parent'; +requires 'YAML'; # This should reflect the config file format you've chosen + # See Catalyst::Plugin::ConfigLoader for supported formats +catalyst; + +install_script glob('script/*.pl'); +auto_install; +WriteAll; diff --git a/README b/README new file mode 100644 index 0000000..1cea057 --- /dev/null +++ b/README @@ -0,0 +1 @@ +Run script/ndweb_server.pl to test the application. diff --git a/htdocs/default.css b/htdocs/default.css deleted file mode 100644 index 6affe18..0000000 --- a/htdocs/default.css +++ /dev/null @@ -1,230 +0,0 @@ -body,html { - color: black; - background-color: #D9D9D9; - font-family: sans-serif; -} -#body { - padding-left: 15em; - /*padding-right: 12em;*/ -} -#leftbar,#rightbar{ - padding: 0; - margin: 0; - position: absolute; - width: 14em; - top: 1em; -} -#leftbar{ - left: 1em; -} -#rightbar{ - right: 1em; -} - -legend { - color: black; - background: white; - border-style: solid; - border-width: 1px; - padding: 1px; -} -table.boards td { - /*border-style: solid; - border-width: 1px;*/ - padding: 2px; - border-collapse: separate; - border-spacing: 15pt; - font-size: larger; -} -table.boards td.sticky { - font-weight: bold; -} -table.boards{ - border-collapse: separate; - border-spacing: 5px; -} -table.boards th { - font-size: larger; -} - -table.boards a, table.stats a { - text-decoration: none; - width: 100%; - display: block; -} -fieldset.forum-post { - width: 40em; - padding: 5px; -} -fieldset.forum-post legend b { - font-size: larger; -} -div.leftinfo{ - float: left; - padding-right: 2em; -} - -fieldset { - display: block; - clear: left; -} -p.claimlinks{ - clear: both; -} - -ul.linkbar { - list-style-type: none; - width: 13.5em; - padding: 0; - margin: 0; -} -ul.linkbar li { - background: white; - color: black; - margin: 0.5em 0; - padding: 0.3em; - /*border-right: 1em solid black;*/ -} -ul.linkbar a { - text-decoration: none; - width: 100%; - display: block; -} -input.coordsinput { - width: 4em; -} -input.small { - width: 1.7em; -} -tr.odd { - background: white; - color: black; -} -tr.total { - background: black; - color: red; -} - -td.ingal{ - background: blue; - color: black; -} -td.Defend{ - background: green; - color: black; -} -td.AllyDef{ - background: #00FF00; - color: black; -} -td.Attack{ - background: red; - color: black; -} - -a.Unclaim{ - color: green; -} -input.Unclaim{ - background: green; -} -a.Claim{ - color: blue; -} -a.Join{ - color: #00AAAA; -} -input.Join{ - background: #00AAAA; -} - -td.Friendly{ - background: green; - color: black; -} -td.Friendly a{ - color: yellow; - background: green; -} -td.Hostile{ - background: red; - color: black; -} -td.NAP{ - background: blue; - color: white; -} -td.NAP a{ - color: yellow; - background: blue; -} - -td.OLD{ - background: red; - color: black; -} -table.old{ - border: outset 1pt; - border-collapse: separate; - border-color: red; -} - -table.closedPlanet{ - border: outset 2pt; - border-collapse: separate; - border-color: red; -} -li.bash{ - color: #FF9933; -} -div.clear { - clear: both; - height: 0; - margin: 0; - padding: 0; - line-height: 0.0; - font-size: 1px; -} - -table.stats tr td{ - padding-left: 0.5em; -} - -td.LowestPrio{ - background: red; - color: black; -} -td.MediumPrio{ - background: yellow; - color: black; -} -td.MediumPrio a{ - background: yellow; - color: black; -} -td.HighestPrio{ - background: green; - color: black; -} -span.newposts,span.unreadposts { - font-weight: bold; -} -span.newposts { - color: red; -} - -div.bbcode-quote,div.bbcode-code { - border: solid; - border-width: 1px; - MARGIN: 5px 15px 15px 15px; PADDING: 8px; - line-height: 1.4; -} -div.bbcode-quote-head,div.bbcode-code-head { - font-weight: bold; -} - -fieldset.incluster { - border: solid; - border-width: 2px; - border-color: red; -} diff --git a/htdocs/images/down.png b/htdocs/images/down.png deleted file mode 100644 index 69663f9..0000000 Binary files a/htdocs/images/down.png and /dev/null differ diff --git a/htdocs/images/stay.png b/htdocs/images/stay.png deleted file mode 100644 index e428243..0000000 Binary files a/htdocs/images/stay.png and /dev/null differ diff --git a/htdocs/images/up.png b/htdocs/images/up.png deleted file mode 100644 index 698a42a..0000000 Binary files a/htdocs/images/up.png and /dev/null differ diff --git a/htdocs/misc.js b/htdocs/misc.js deleted file mode 100644 index a21f365..0000000 --- a/htdocs/misc.js +++ /dev/null @@ -1,9 +0,0 @@ -function toggleVisibility(id) { - var obj=document.getElementById(id); - if (obj.style.display=='none') { - obj.style.display=''; - } - else { - obj.style.display='none'; - } -} diff --git a/htdocs/raid.js b/htdocs/raid.js deleted file mode 100644 index 8bec240..0000000 --- a/htdocs/raid.js +++ /dev/null @@ -1,158 +0,0 @@ -function getHTTPObject() { - var xmlhttp; - /*@cc_on - @if (@_jscript_version >= 5) - try { - xmlhttp = new ActiveXObject("Msxml2.XMLHTTP"); - } catch (e) { - try { - xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); - } catch (E) { - xmlhttp = false; - } - } - @else - xmlhttp = false; - @end @*/ - - if (!xmlhttp && typeof XMLHttpRequest != 'undefined') { - try { - xmlhttp = new XMLHttpRequest(); - } catch (e) { - xmlhttp = false; - } - } - return xmlhttp; -} - -var modified = '_'; - -function claim(dataSource, target, wave,cmd){ - var HTTP = getHTTPObject(); - if(HTTP) { - var url = dataSource + '&cmd='+cmd+'&target=' + target + '&wave=' + wave + '&rand='+ Math.random(); - //obj.innerHTML = "test"; - HTTP.open("GET", url,true); - HTTP.onreadystatechange = function(){ - if (HTTP.readyState == 4 && - HTTP.status == 200) { - updateClaims(dataSource,HTTP.responseXML,false); - var obj = document.getElementById("targets"); - if (obj){ - clearObject(obj); - var re = new RegExp("targetlist>((.|\\n)*)config( name => 'NDWeb' ); + +# Start the application +__PACKAGE__->setup(qw/-Debug ConfigLoader Static::Simple/); + + +=head1 NAME + +NDWeb - Catalyst based application + +=head1 SYNOPSIS + + script/ndweb_server.pl + +=head1 DESCRIPTION + +[enter your description here] + +=head1 SEE ALSO + +L, L + +=head1 AUTHOR + +Catalyst developer + +=head1 LICENSE + +This library is free software, you can redistribute it and/or modify +it under the same terms as Perl itself. + +=cut + +1; diff --git a/lib/NDWeb/Controller/Root.pm b/lib/NDWeb/Controller/Root.pm new file mode 100644 index 0000000..4657f7a --- /dev/null +++ b/lib/NDWeb/Controller/Root.pm @@ -0,0 +1,62 @@ +package NDWeb::Controller::Root; + +use strict; +use warnings; +use parent 'Catalyst::Controller'; + +# +# Sets the actions in this controller to be registered with no prefix +# so they function identically to actions created in MyApp.pm +# +__PACKAGE__->config->{namespace} = ''; + +=head1 NAME + +NDWeb::Controller::Root - Root Controller for NDWeb + +=head1 DESCRIPTION + +[enter your description here] + +=head1 METHODS + +=cut + +=head2 default + +=cut + +sub index : Local Path Args(0) { + my ( $self, $c ) = @_; + + # Hello World + #$c->response->body( $c->welcome_message ); +} + +sub default : Path { + my ( $self, $c ) = @_; + $c->response->body( 'Page not found' ); + $c->response->status(404); + +} + +=head2 end + +Attempt to render a view, if needed. + +=cut + +sub end : ActionClass('RenderView') {} + +=head1 AUTHOR + +Catalyst developer + +=head1 LICENSE + +This library is free software, you can redistribute it and/or modify +it under the same terms as Perl itself. + +=cut + +1; diff --git a/lib/NDWeb/View/TT.pm b/lib/NDWeb/View/TT.pm new file mode 100644 index 0000000..fc22bae --- /dev/null +++ b/lib/NDWeb/View/TT.pm @@ -0,0 +1,43 @@ +package NDWeb::View::TT; + +use strict; +use base 'Catalyst::View::TT'; + +__PACKAGE__->config({ + INCLUDE_PATH => [ + NDWeb->path_to( 'root', 'src' ), + NDWeb->path_to( 'root', 'lib' ) + ], + PRE_PROCESS => 'config/main.tt2', + WRAPPER => 'site/wrapper.tt2', + ERROR => 'error.tt2', + TIMER => 0, + #DEBUG => 'undef', + TEMPLATE_EXTENSION => '.tt2', +}); + +=head1 NAME + +NDWeb::View::TT - Catalyst TTSite View + +=head1 SYNOPSIS + +See L + +=head1 DESCRIPTION + +Catalyst TTSite View. + +=head1 AUTHOR + +A clever guy + +=head1 LICENSE + +This library is free software, you can redistribute it and/or modify +it under the same terms as Perl itself. + +=cut + +1; + diff --git a/ndweb.yml b/ndweb.yml new file mode 100644 index 0000000..bd6aeb6 --- /dev/null +++ b/ndweb.yml @@ -0,0 +1,2 @@ +--- +name: NDWeb diff --git a/root/lib/config/main.tt2 b/root/lib/config/main.tt2 new file mode 100644 index 0000000..fe70a5e --- /dev/null +++ b/root/lib/config/main.tt2 @@ -0,0 +1,26 @@ +[% # config/main + # + # This is the main configuration template which is processed before + # any other page, by virtue of it being defined as a PRE_PROCESS + # template. This is the place to define any extra template variables, + # macros, load plugins, and perform any other template setup. + + IF c.debug; + # define a debug() macro directed to Catalyst's log + MACRO debug(message) CALL Catalyst.log.debug(message); + END; + + # define a data structure to hold sitewide data + site = { + title => 'NewDawn', + copyright => '2008 harv', + }; + + # load up any other configuration items + PROCESS config/url.tt2; + + # set defaults for variables, etc. + DEFAULT + message = 'There is no message'; + +-%] diff --git a/root/lib/config/url.tt2 b/root/lib/config/url.tt2 new file mode 100644 index 0000000..d789db6 --- /dev/null +++ b/root/lib/config/url.tt2 @@ -0,0 +1,6 @@ +[% base = c.req.base; + + site.url = { + base = base + } +-%] diff --git a/root/lib/site/footer.tt2 b/root/lib/site/footer.tt2 new file mode 100644 index 0000000..d16739b --- /dev/null +++ b/root/lib/site/footer.tt2 @@ -0,0 +1,3 @@ + + + diff --git a/root/lib/site/header.tt2 b/root/lib/site/header.tt2 new file mode 100644 index 0000000..35159db --- /dev/null +++ b/root/lib/site/header.tt2 @@ -0,0 +1,3 @@ + +

[% template.title or site.title %]

+ diff --git a/root/lib/site/html.tt2 b/root/lib/site/html.tt2 new file mode 100644 index 0000000..f7236e7 --- /dev/null +++ b/root/lib/site/html.tt2 @@ -0,0 +1,17 @@ + + + + + [% template.title or site.title %] + + + + + + + + + +[% content %] + diff --git a/root/lib/site/layout.tt2 b/root/lib/site/layout.tt2 new file mode 100644 index 0000000..ec17e5f --- /dev/null +++ b/root/lib/site/layout.tt2 @@ -0,0 +1,8 @@ +
[% PROCESS site/leftbar.tt2 %]
+ + +
+[% content %] +
+ + diff --git a/root/lib/site/leftbar.tt2 b/root/lib/site/leftbar.tt2 new file mode 100644 index 0000000..a5bfb75 --- /dev/null +++ b/root/lib/site/leftbar.tt2 @@ -0,0 +1,84 @@ +

Tick: [% game.tick %]

+[% IF user.isMember %] + [% IF user.isAttacker %] +

Member menu

+ + [% ELSE %] + [% IF user.planet %] +

Update your fleet to see member menu

+ [% ELSE %] +
+

We need your planet's coordinates: + + +

+
+ [% END %] + [% END %] +[% END %] +[% IF user.isAttacker %] +

Attack menu

+ +
+[% END %] +[% IF user.isBC %] +

BC menu

+ +[% END %] +[% IF user.isDC %] +

DC menu

+ +[% END %] +[% IF user.isHC %] +

HC menu

+ +[% ELSE %] + [% IF user.isIntel %] +

Intel menu

+ + [% END %] +[% END %] diff --git a/root/lib/site/wrapper.tt2 b/root/lib/site/wrapper.tt2 new file mode 100644 index 0000000..37674ca --- /dev/null +++ b/root/lib/site/wrapper.tt2 @@ -0,0 +1,8 @@ +[% IF template.name.match('\.(css|js|txt)'); + debug("Passing page through as text: $template.name"); + content; + ELSE; + debug("Applying HTML page layout wrappers to $template.name\n"); + content WRAPPER site/html.tt2 + site/layout.tt2; + END; +-%] diff --git a/root/src/error.tt2 b/root/src/error.tt2 new file mode 100644 index 0000000..2ba47e3 --- /dev/null +++ b/root/src/error.tt2 @@ -0,0 +1,10 @@ +[% META title = 'Catalyst/TT Error' %] +

+ An error has occurred. We're terribly sorry about that, but it's + one of those things that happens from time to time. Let's just + hope the developers test everything properly before release... +

+

+ Here's the error message, on the off-chance that it means something + to you: [% error %] +

diff --git a/root/src/index.tt2 b/root/src/index.tt2 new file mode 100644 index 0000000..c3831a0 --- /dev/null +++ b/root/src/index.tt2 @@ -0,0 +1,8 @@ +[% META title = 'Catalyst/TT View!' %] +

+ Yay! You're looking at a page generated by the Catalyst::View::TT + plugin module. +

+

+ This is the welcome page. Why not try the equally-exciting +

diff --git a/root/static/css/black.css b/root/static/css/black.css new file mode 100644 index 0000000..f202736 --- /dev/null +++ b/root/static/css/black.css @@ -0,0 +1,124 @@ +body,html,table,div { + font-family: sans-serif; + font-size: 11px; + color: #B2B2B2; + background-color: black; +} + +textarea, input{ + font-size: 11px; +} + +a { + color: white; + text-decoration:underline; +} +a:hover, td.NAP a:hover { + color: black; + background: white; +} + +input,textarea,select { + color: black; + background: #B2B2B2; +} + +img.graph { + background: gray; +} + +td.sticky { + font-weight: bold; +} + + +legend { + color: black; + background: gray; +} + +ul.linkbar li { + background: gray; + color: black; + margin: 0.5em 0; + padding: 0.3em; + /*border-right: 1em solid black;*/ +} + + +tr.even { + background: #B2B2B2; + color: black; +} +tr.odd { + background: gray; + color: black; +} +tr.total { + background: black; + color: red; +} + +tr:hover { + /*color: black; + background: #626262;*/ +} + +td.ingal{ + background: blue; + color: black; +} +td.Defend{ + background: green; + color: black; +} +td.AllyDef{ + background: #00FF00; + color: black; +} +td.Attack{ + background: red; + color: black; +} + +a.Unclaim{ + color: green; +} +input.Unclaim{ + background: green; +} +a.Claim{ + color: blue; +} +a.Join{ + color: #00AAAA; +} +input.Join{ + background: #00AAAA; +} + +td.Friendly{ + background: green; + color: black; +} +td.Friendly a{ + color: yellow; + background: green; +} +td.Hostile{ + background: red; + color: black; +} + +td.LowestPrio{ + background: red; + color: black; +} +td.MediumPrio{ + background: yellow; + color: black; +} +td.HighestPrio{ + background: green; + color: black; +} diff --git a/root/static/css/echoke.css b/root/static/css/echoke.css new file mode 100644 index 0000000..5ffc16b --- /dev/null +++ b/root/static/css/echoke.css @@ -0,0 +1,231 @@ +body,html +{ + font-size: medium; + color: gray; + font-family: Arial; + background-color: #f5f5f5; +} +#leftbar, #rightbar +{ + padding-right: 0px; + padding-left: 0px; + font-weight: bold; + padding-bottom: 0px; + margin: 0px; + width: 14em; + color: olive; + padding-top: 0px; + position: absolute; + top: 1em; +} +#leftbar{ + left: 1em; +} +#rightbar{ + right: 1em; +} + +legend { + color: black; + background: white; + border-style: solid; + border-width: 1px; + padding: 1px; +} +table.boards td +{ + border-right: #990000 thin solid; + padding-right: 2px; + border-top: #990000 thin solid; + padding-left: 2px; + font-size: larger; + padding-bottom: 2px; + border-left: #990000 thin solid; + padding-top: 2px; + border-bottom: #990000 thin solid; + border-collapse: separate; + border-spacing: 15pt; +} +table.boards{ + border-collapse: separate; + border-spacing: 5px; +} +table.boards th +{ + font-weight: bold; + font-size: larger; + color: #990000; +} +table.boards tr.even { + background: white; +} + +table.boards a { + text-decoration: none; + width: 100%; + display: block; +} +fieldset.forum-post { + width: 40em; +} +fieldset.forum-post legend b { + font-size: larger; +} +div.leftinfo{ + float: left; + padding-right: 2em; +} +p.claimlinks{ + clear: both; +} + +ul.linkbar +{ + padding-right: 0px; + padding-left: 0px; + padding-bottom: 0px; + margin: 0px; + width: 13.5em; + color: #000033; + padding-top: 0px; +} +ul.linkbar li { + background: white; + color: black; + margin: 0.5em 0; + padding: 0.3em; + /*border-right: 1em solid black;*/ +} +ul.linkbar a { + text-decoration: none; + width: 100%; + display: block; +} +input.coordsinput { + width: 4em; +} +input.small { + width: 1.7em; +} +tr.odd { + background: white; + color: black; +} +tr.total { + background: black; + color: red; +} + +td.ingal{ + background: blue; + color: black; +} +td.Defend{ + background: green; + color: black; +} +td.AllyDef +{ + background: #ccff00; + color: black; +} +td.Attack +{ + background: tomato; + color: black; +} + +a.Unclaim{ + color: #336666; +} +input.Unclaim{ + background: #336666; +} +a.Claim{ + color: blue; +} +a.Join{ + color: #00AAAA; +} +input.Join{ + background: #00AAAA; +} + +td.Friendly +{ + font-weight: bold; + background: #ccff00; + color: darkolivegreen; +} +td.Friendly a +{ + font-weight: bold; + font-size: larger; + background: #ccff00; + color: white; +} +td.Hostile +{ + font-weight: bold; + background: tomato; + color: black; +} +td.NAP +{ + background: turquoise; + color: white; +} +td.NAP a +{ + font-weight: bold; + font-size: larger; + color: white; + background: turquoise; +} +table.old{ + border: outset 1pt; + border-collapse: separate; + border-color: red; +} + +table.closedPlanet +{ + border-right: maroon 2pt outset; + border-top: maroon 2pt outset; + border-left: maroon 2pt outset; + border-bottom: maroon 2pt outset; + border-collapse: separate; +} +li.bash +{ + color: #336666; +} +div.clear { + clear: both; + height: 0; + margin: 0; + padding: 0; + line-height: 0.0; + font-size: 1px; +} + +td.LowestPrio{ + background: tomato; + color: white; +} +td.MediumPrio +{ + background: #b3b169; + color: white; +} +td.HighestPrio +{ + background: #336666; + color: white; +} +span.newposts,span.unreadposts { + font-weight: bold; +} +span.newposts { + color: red; +} diff --git a/root/static/css/grey.css b/root/static/css/grey.css new file mode 100644 index 0000000..9a7562d --- /dev/null +++ b/root/static/css/grey.css @@ -0,0 +1,178 @@ +body { + font-family: sans-serif; + color: black; + background-color: #D9D9D9; +} + +legend { + color: black; + background: white; + border-style: solid; + border-width: 1px; + padding: 1px; +} +table.boards td { + /*border-style: solid; + border-width: 1px;*/ + padding: 2px; + border-collapse: separate; + border-spacing: 15pt; + font-size: larger; +} +table.boards{ + border-collapse: separate; + border-spacing: 5px; +} +table.boards th { + font-size: larger; +} +table.boards tr.even { + background: white; +} + +table.boards a { + text-decoration: none; + width: 100%; + display: block; +} +fieldset.forum-post { + width: 40em; +} +fieldset.forum-post legend b { + font-size: larger; +} +div.leftinfo{ + float: left; + padding-right: 2em; +} +p.claimlinks{ + clear: both; +} + +ul.linkbar { + list-style-type: none; + width: 13.5em; + padding: 0; + margin: 0; +} +ul.linkbar li { + background: white; + color: black; + margin: 0.5em 0; + padding: 0.3em; + /*border-right: 1em solid black;*/ +} +ul.linkbar a { + text-decoration: none; + width: 100%; + display: block; +} +input.coordsinput { + width: 4em; +} +input.small { + width: 1.7em; +} +tr.odd { + background: white; + color: black; +} +tr.total { + background: black; + color: red; +} + +td.ingal{ + background: blue; + color: black; +} +td.Defend{ + background: green; + color: black; +} +td.AllyDef{ + background: #00FF00; + color: black; +} +td.Attack{ + background: red; + color: black; +} + +a.Unclaim{ + color: green; +} +input.Unclaim{ + background: green; +} +a.Claim{ + color: blue; +} +a.Join{ + color: #00AAAA; +} +input.Join{ + background: #00AAAA; +} + +td.Friendly{ + background: green; + color: black; +} +td.Friendly a{ + color: yellow; + background: green; +} +td.Hostile{ + background: red; + color: black; +} +td.NAP{ + background: blue; + color: white; +} +td.NAP a{ + color: yellow; + background: blue; +} +table.old{ + border: outset 1pt; + border-collapse: separate; + border-color: red; +} + +table.closedPlanet{ + border: outset 2pt; + border-collapse: separate; + border-color: red; +} +li.bash{ + color: #FF9933; +} +div.clear { + clear: both; + height: 0; + margin: 0; + padding: 0; + line-height: 0.0; + font-size: 1px; +} + +td.LowestPrio{ + background: red; + color: black; +} +td.MediumPrio{ + background: yellow; + color: black; +} +td.HighestPrio{ + background: green; + color: black; +} +span.newposts,span.unreadposts { + font-weight: bold; +} +span.newposts { + color: red; +} diff --git a/root/static/css/hedgie.css b/root/static/css/hedgie.css new file mode 100644 index 0000000..bc24793 --- /dev/null +++ b/root/static/css/hedgie.css @@ -0,0 +1,10 @@ +@import "black.css"; +.backgrounds { Code Generated by Backgrounds Archive } +table, tr, td { background-color: transparent; border: none; border-width: 0; } +html,body { + background-image: url('hedgie.jpg'); + background-attachment: scrolling; + background-repeat: repeat; + color: white; +} + diff --git a/root/static/css/hedgie.jpg b/root/static/css/hedgie.jpg new file mode 100644 index 0000000..e796dae Binary files /dev/null and b/root/static/css/hedgie.jpg differ diff --git a/root/static/css/thrackan.css b/root/static/css/thrackan.css new file mode 100644 index 0000000..94a950d --- /dev/null +++ b/root/static/css/thrackan.css @@ -0,0 +1,58 @@ +body,html { + color: white; + background-color: black; + font-family: sans-serif; + font-size: 10px; +} +input, textarea { + font-size: 10px; + background: #003333; + color: white; +} +a:link, a:hover, a:visited { + color: white; + text-decoration: none; +} +legend { + color: white; + background: #660000; + border-style: solid; + border-width: 1px; + border-color: white; + padding: 1px; +} +table.boards td { + /*border-style: solid; + border-width: 1px;*/ + border-color: white; + padding: 2px; + border-collapse: separate; + border-spacing: 15pt; + font-size: 10px; +} +table.boards th { + font-size: 10px; +} +fieldset.forum-post legend b { + font-size: 10px; +} +ul.linkbar li { + background: #000044; + color: white; + margin: 0.5em 0; + padding: 0.3em; + border: 1px solid white; + /*border-right: 1em solid black;*/ +} +tr.odd { + background: #660000; + color: white; +} +table.old{ + border: outset 1pt; + border-collapse: separate; + border-color: grey; +} +img.graph{ + background: #999999; +} diff --git a/root/static/default.css b/root/static/default.css new file mode 100644 index 0000000..9349e08 --- /dev/null +++ b/root/static/default.css @@ -0,0 +1,234 @@ +body,html { + color: black; + background-color: #D9D9D9; + font-family: sans-serif; +} +#body { + padding-left: 15em; + /*padding-right: 12em;*/ +} +#header { + padding-left: 15em; + /*padding-right: 12em;*/ +} +#leftbar,#rightbar{ + padding: 0; + margin: 0; + position: absolute; + width: 14em; + top: 1em; +} +#leftbar{ + left: 1em; +} +#rightbar{ + right: 1em; +} + +legend { + color: black; + background: white; + border-style: solid; + border-width: 1px; + padding: 1px; +} +table.boards td { + /*border-style: solid; + border-width: 1px;*/ + padding: 2px; + border-collapse: separate; + border-spacing: 15pt; + font-size: larger; +} +table.boards td.sticky { + font-weight: bold; +} +table.boards{ + border-collapse: separate; + border-spacing: 5px; +} +table.boards th { + font-size: larger; +} + +table.boards a, table.stats a { + text-decoration: none; + width: 100%; + display: block; +} +fieldset.forum-post { + width: 40em; + padding: 5px; +} +fieldset.forum-post legend b { + font-size: larger; +} +div.leftinfo{ + float: left; + padding-right: 2em; +} + +fieldset { + display: block; + clear: left; +} +p.claimlinks{ + clear: both; +} + +ul.linkbar { + list-style-type: none; + width: 13.5em; + padding: 0; + margin: 0; +} +ul.linkbar li { + background: white; + color: black; + margin: 0.5em 0; + padding: 0.3em; + /*border-right: 1em solid black;*/ +} +ul.linkbar a { + text-decoration: none; + width: 100%; + display: block; +} +input.coordsinput { + width: 4em; +} +input.small { + width: 1.7em; +} +tr.odd { + background: white; + color: black; +} +tr.total { + background: black; + color: red; +} + +td.ingal{ + background: blue; + color: black; +} +td.Defend{ + background: green; + color: black; +} +td.AllyDef{ + background: #00FF00; + color: black; +} +td.Attack{ + background: red; + color: black; +} + +a.Unclaim{ + color: green; +} +input.Unclaim{ + background: green; +} +a.Claim{ + color: blue; +} +a.Join{ + color: #00AAAA; +} +input.Join{ + background: #00AAAA; +} + +td.Friendly{ + background: green; + color: black; +} +td.Friendly a{ + color: yellow; + background: green; +} +td.Hostile{ + background: red; + color: black; +} +td.NAP{ + background: blue; + color: white; +} +td.NAP a{ + color: yellow; + background: blue; +} + +td.OLD{ + background: red; + color: black; +} +table.old{ + border: outset 1pt; + border-collapse: separate; + border-color: red; +} + +table.closedPlanet{ + border: outset 2pt; + border-collapse: separate; + border-color: red; +} +li.bash{ + color: #FF9933; +} +div.clear { + clear: both; + height: 0; + margin: 0; + padding: 0; + line-height: 0.0; + font-size: 1px; +} + +table.stats tr td{ + padding-left: 0.5em; +} + +td.LowestPrio{ + background: red; + color: black; +} +td.MediumPrio{ + background: yellow; + color: black; +} +td.MediumPrio a{ + background: yellow; + color: black; +} +td.HighestPrio{ + background: green; + color: black; +} +span.newposts,span.unreadposts { + font-weight: bold; +} +span.newposts { + color: red; +} + +div.bbcode-quote,div.bbcode-code { + border: solid; + border-width: 1px; + MARGIN: 5px 15px 15px 15px; PADDING: 8px; + line-height: 1.4; +} +div.bbcode-quote-head,div.bbcode-code-head { + font-weight: bold; +} + +fieldset.incluster { + border: solid; + border-width: 2px; + border-color: red; +} diff --git a/root/static/images/down.png b/root/static/images/down.png new file mode 100644 index 0000000..69663f9 Binary files /dev/null and b/root/static/images/down.png differ diff --git a/root/static/images/stay.png b/root/static/images/stay.png new file mode 100644 index 0000000..e428243 Binary files /dev/null and b/root/static/images/stay.png differ diff --git a/root/static/images/up.png b/root/static/images/up.png new file mode 100644 index 0000000..698a42a Binary files /dev/null and b/root/static/images/up.png differ diff --git a/root/static/js/misc.js b/root/static/js/misc.js new file mode 100644 index 0000000..a21f365 --- /dev/null +++ b/root/static/js/misc.js @@ -0,0 +1,9 @@ +function toggleVisibility(id) { + var obj=document.getElementById(id); + if (obj.style.display=='none') { + obj.style.display=''; + } + else { + obj.style.display='none'; + } +} diff --git a/root/static/js/raid.js b/root/static/js/raid.js new file mode 100644 index 0000000..8bec240 --- /dev/null +++ b/root/static/js/raid.js @@ -0,0 +1,158 @@ +function getHTTPObject() { + var xmlhttp; + /*@cc_on + @if (@_jscript_version >= 5) + try { + xmlhttp = new ActiveXObject("Msxml2.XMLHTTP"); + } catch (e) { + try { + xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); + } catch (E) { + xmlhttp = false; + } + } + @else + xmlhttp = false; + @end @*/ + + if (!xmlhttp && typeof XMLHttpRequest != 'undefined') { + try { + xmlhttp = new XMLHttpRequest(); + } catch (e) { + xmlhttp = false; + } + } + return xmlhttp; +} + +var modified = '_'; + +function claim(dataSource, target, wave,cmd){ + var HTTP = getHTTPObject(); + if(HTTP) { + var url = dataSource + '&cmd='+cmd+'&target=' + target + '&wave=' + wave + '&rand='+ Math.random(); + //obj.innerHTML = "test"; + HTTP.open("GET", url,true); + HTTP.onreadystatechange = function(){ + if (HTTP.readyState == 4 && + HTTP.status == 200) { + updateClaims(dataSource,HTTP.responseXML,false); + var obj = document.getElementById("targets"); + if (obj){ + clearObject(obj); + var re = new RegExp("targetlist>((.|\\n)*)run; + +1; + +=head1 NAME + +ndweb_cgi.pl - Catalyst CGI + +=head1 SYNOPSIS + +See L + +=head1 DESCRIPTION + +Run a Catalyst application as a cgi script. + +=head1 AUTHOR + +Sebastian Riedel, C + +=head1 COPYRIGHT + + +This library is free software, you can redistribute it and/or modify +it under the same terms as Perl itself. + +=cut diff --git a/script/ndweb_create.pl b/script/ndweb_create.pl new file mode 100755 index 0000000..35ca6a5 --- /dev/null +++ b/script/ndweb_create.pl @@ -0,0 +1,75 @@ +#!/usr/bin/perl -w + +use strict; +use warnings; +use Getopt::Long; +use Pod::Usage; +use Catalyst::Helper; + +my $force = 0; +my $mech = 0; +my $help = 0; + +GetOptions( + 'nonew|force' => \$force, + 'mech|mechanize' => \$mech, + 'help|?' => \$help + ); + +pod2usage(1) if ( $help || !$ARGV[0] ); + +my $helper = Catalyst::Helper->new( { '.newfiles' => !$force, mech => $mech } ); + +pod2usage(1) unless $helper->mk_component( 'NDWeb', @ARGV ); + +1; + +=head1 NAME + +ndweb_create.pl - Create a new Catalyst Component + +=head1 SYNOPSIS + +ndweb_create.pl [options] model|view|controller name [helper] [options] + + Options: + -force don't create a .new file where a file to be created exists + -mechanize use Test::WWW::Mechanize::Catalyst for tests if available + -help display this help and exits + + Examples: + ndweb_create.pl controller My::Controller + ndweb_create.pl controller My::Controller BindLex + ndweb_create.pl -mechanize controller My::Controller + ndweb_create.pl view My::View + ndweb_create.pl view MyView TT + ndweb_create.pl view TT TT + ndweb_create.pl model My::Model + ndweb_create.pl model SomeDB DBIC::Schema MyApp::Schema create=dynamic\ + dbi:SQLite:/tmp/my.db + ndweb_create.pl model AnotherDB DBIC::Schema MyApp::Schema create=static\ + dbi:Pg:dbname=foo root 4321 + + See also: + perldoc Catalyst::Manual + perldoc Catalyst::Manual::Intro + +=head1 DESCRIPTION + +Create a new Catalyst Component. + +Existing component files are not overwritten. If any of the component files +to be created already exist the file will be written with a '.new' suffix. +This behavior can be suppressed with the C<-force> option. + +=head1 AUTHOR + +Sebastian Riedel, C +Maintained by the Catalyst Core Team. + +=head1 COPYRIGHT + +This library is free software, you can redistribute it and/or modify +it under the same terms as Perl itself. + +=cut diff --git a/script/ndweb_fastcgi.pl b/script/ndweb_fastcgi.pl new file mode 100755 index 0000000..cf0ad8b --- /dev/null +++ b/script/ndweb_fastcgi.pl @@ -0,0 +1,80 @@ +#!/usr/bin/perl -w + +BEGIN { $ENV{CATALYST_ENGINE} ||= 'FastCGI' } + +use strict; +use warnings; +use Getopt::Long; +use Pod::Usage; +use FindBin; +use lib "$FindBin::Bin/../lib"; +use NDWeb; + +my $help = 0; +my ( $listen, $nproc, $pidfile, $manager, $detach, $keep_stderr ); + +GetOptions( + 'help|?' => \$help, + 'listen|l=s' => \$listen, + 'nproc|n=i' => \$nproc, + 'pidfile|p=s' => \$pidfile, + 'manager|M=s' => \$manager, + 'daemon|d' => \$detach, + 'keeperr|e' => \$keep_stderr, +); + +pod2usage(1) if $help; + +NDWeb->run( + $listen, + { nproc => $nproc, + pidfile => $pidfile, + manager => $manager, + detach => $detach, + keep_stderr => $keep_stderr, + } +); + +1; + +=head1 NAME + +ndweb_fastcgi.pl - Catalyst FastCGI + +=head1 SYNOPSIS + +ndweb_fastcgi.pl [options] + + Options: + -? -help display this help and exits + -l -listen Socket path to listen on + (defaults to standard input) + can be HOST:PORT, :PORT or a + filesystem path + -n -nproc specify number of processes to keep + to serve requests (defaults to 1, + requires -listen) + -p -pidfile specify filename for pid file + (requires -listen) + -d -daemon daemonize (requires -listen) + -M -manager specify alternate process manager + (FCGI::ProcManager sub-class) + or empty string to disable + -e -keeperr send error messages to STDOUT, not + to the webserver + +=head1 DESCRIPTION + +Run a Catalyst application as fastcgi. + +=head1 AUTHOR + +Sebastian Riedel, C +Maintained by the Catalyst Core Team. + +=head1 COPYRIGHT + +This library is free software, you can redistribute it and/or modify +it under the same terms as Perl itself. + +=cut diff --git a/script/ndweb_server.pl b/script/ndweb_server.pl new file mode 100755 index 0000000..2a50e5e --- /dev/null +++ b/script/ndweb_server.pl @@ -0,0 +1,115 @@ +#!/usr/bin/perl -w + +BEGIN { + $ENV{CATALYST_ENGINE} ||= 'HTTP'; + $ENV{CATALYST_SCRIPT_GEN} = 31; + require Catalyst::Engine::HTTP; +} + +use strict; +use warnings; +use Getopt::Long; +use Pod::Usage; +use FindBin; +use lib "$FindBin::Bin/../lib"; + +my $debug = 0; +my $fork = 0; +my $help = 0; +my $host = undef; +my $port = $ENV{NDWEB_PORT} || $ENV{CATALYST_PORT} || 3000; +my $keepalive = 0; +my $restart = $ENV{NDWEB_RELOAD} || $ENV{CATALYST_RELOAD} || 0; +my $restart_delay = 1; +my $restart_regex = '(?:/|^)(?!\.#).+(?:\.yml$|\.yaml$|\.pm)$'; +my $restart_directory = undef; +my $follow_symlinks = 0; + +my @argv = @ARGV; + +GetOptions( + 'debug|d' => \$debug, + 'fork' => \$fork, + 'help|?' => \$help, + 'host=s' => \$host, + 'port=s' => \$port, + 'keepalive|k' => \$keepalive, + 'restart|r' => \$restart, + 'restartdelay|rd=s' => \$restart_delay, + 'restartregex|rr=s' => \$restart_regex, + 'restartdirectory=s@' => \$restart_directory, + 'followsymlinks' => \$follow_symlinks, +); + +pod2usage(1) if $help; + +if ( $restart && $ENV{CATALYST_ENGINE} eq 'HTTP' ) { + $ENV{CATALYST_ENGINE} = 'HTTP::Restarter'; +} +if ( $debug ) { + $ENV{CATALYST_DEBUG} = 1; +} + +# This is require instead of use so that the above environment +# variables can be set at runtime. +require NDWeb; + +NDWeb->run( $port, $host, { + argv => \@argv, + 'fork' => $fork, + keepalive => $keepalive, + restart => $restart, + restart_delay => $restart_delay, + restart_regex => qr/$restart_regex/, + restart_directory => $restart_directory, + follow_symlinks => $follow_symlinks, +} ); + +1; + +=head1 NAME + +ndweb_server.pl - Catalyst Testserver + +=head1 SYNOPSIS + +ndweb_server.pl [options] + + Options: + -d -debug force debug mode + -f -fork handle each request in a new process + (defaults to false) + -? -help display this help and exits + -host host (defaults to all) + -p -port port (defaults to 3000) + -k -keepalive enable keep-alive connections + -r -restart restart when files get modified + (defaults to false) + -rd -restartdelay delay between file checks + -rr -restartregex regex match files that trigger + a restart when modified + (defaults to '\.yml$|\.yaml$|\.pm$') + -restartdirectory the directory to search for + modified files, can be set mulitple times + (defaults to '[SCRIPT_DIR]/..') + -follow_symlinks follow symlinks in search directories + (defaults to false. this is a no-op on Win32) + See also: + perldoc Catalyst::Manual + perldoc Catalyst::Manual::Intro + +=head1 DESCRIPTION + +Run a Catalyst Testserver for this application. + +=head1 AUTHOR + +Sebastian Riedel, C +Maintained by the Catalyst Core Team. + +=head1 COPYRIGHT + +This library is free software, you can redistribute it and/or modify +it under the same terms as Perl itself. + +=cut diff --git a/script/ndweb_test.pl b/script/ndweb_test.pl new file mode 100755 index 0000000..a69d3e4 --- /dev/null +++ b/script/ndweb_test.pl @@ -0,0 +1,54 @@ +#!/usr/bin/perl -w + +use strict; +use warnings; +use Getopt::Long; +use Pod::Usage; +use FindBin; +use lib "$FindBin::Bin/../lib"; +use Catalyst::Test 'NDWeb'; + +my $help = 0; + +GetOptions( 'help|?' => \$help ); + +pod2usage(1) if ( $help || !$ARGV[0] ); + +print request($ARGV[0])->content . "\n"; + +1; + +=head1 NAME + +ndweb_test.pl - Catalyst Test + +=head1 SYNOPSIS + +ndweb_test.pl [options] uri + + Options: + -help display this help and exits + + Examples: + ndweb_test.pl http://localhost/some_action + ndweb_test.pl /some_action + + See also: + perldoc Catalyst::Manual + perldoc Catalyst::Manual::Intro + +=head1 DESCRIPTION + +Run a Catalyst action from the command line. + +=head1 AUTHOR + +Sebastian Riedel, C +Maintained by the Catalyst Core Team. + +=head1 COPYRIGHT + +This library is free software, you can redistribute it and/or modify +it under the same terms as Perl itself. + +=cut diff --git a/t/01app.t b/t/01app.t new file mode 100644 index 0000000..0f6e010 --- /dev/null +++ b/t/01app.t @@ -0,0 +1,7 @@ +use strict; +use warnings; +use Test::More tests => 2; + +BEGIN { use_ok 'Catalyst::Test', 'NDWeb' } + +ok( request('/')->is_success, 'Request should succeed' ); diff --git a/t/02pod.t b/t/02pod.t new file mode 100644 index 0000000..251640d --- /dev/null +++ b/t/02pod.t @@ -0,0 +1,9 @@ +use strict; +use warnings; +use Test::More; + +eval "use Test::Pod 1.14"; +plan skip_all => 'Test::Pod 1.14 required' if $@; +plan skip_all => 'set TEST_POD to enable this test' unless $ENV{TEST_POD}; + +all_pod_files_ok(); diff --git a/t/03podcoverage.t b/t/03podcoverage.t new file mode 100644 index 0000000..ae59d4c --- /dev/null +++ b/t/03podcoverage.t @@ -0,0 +1,9 @@ +use strict; +use warnings; +use Test::More; + +eval "use Test::Pod::Coverage 1.04"; +plan skip_all => 'Test::Pod::Coverage 1.04 required' if $@; +plan skip_all => 'set TEST_POD to enable this test' unless $ENV{TEST_POD}; + +all_pod_coverage_ok(); diff --git a/templates/skel.tmpl b/templates/skel.tmpl deleted file mode 100644 index 2b9e527..0000000 --- a/templates/skel.tmpl +++ /dev/null @@ -1,106 +0,0 @@ - - - - - NewDawn: <TMPL_VAR NAME=TITLE> - - - - - - - - - -
-

Tick:

- - -

Member menu

- - - -

Update your fleet to see member menu

- -
-

We need your planet's coordinates: - - -

-
-
-
-
- -

Attack menu

- -
-
- -

BC menu

- -
- -

DC menu

- -
- -

HC menu

- - - -

Intel menu

- -
-
- -
-
- - -
- -