--- /dev/null
+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;
--- /dev/null
+Run script/ndweb_server.pl to test the application.
+++ /dev/null
-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;
-}
+++ /dev/null
-function toggleVisibility(id) {
- var obj=document.getElementById(id);
- if (obj.style.display=='none') {
- obj.style.display='';
- }
- else {
- obj.style.display='none';
- }
-}
+++ /dev/null
-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)*)</targetlist");
- if(re.test(HTTP.responseText))
- obj.innerHTML = RegExp.$1;
- }
- }
- }
- HTTP.send(null);
- }
-}
-
-function clearObject(obj){
- while (obj.hasChildNodes()){
- obj.removeChild(obj.firstChild);
- }
-}
-
-function listTargets(dataSource){
- var http = getHTTPObject();
- http.open("GET",dataSource+'&cmd=gettargets' + '&rand='+ Math.random(),true);
- http.onreadystatechange = function(){
- if (http.readyState == 4 &&
- http.status == 200) {
- var obj = document.getElementById("targets");
- if (obj){
- clearObject(obj);
- var re = new RegExp("targetlist>((.|\\n)*)</targetlist");
- if(re.test(http.responseText))
- obj.innerHTML = RegExp.$1;
- }
- }
- }
- http.send(null);
-}
-
-function update(dataSource){
- var HTTP = getHTTPObject();
- if(HTTP) {
- HTTP.open("GET",dataSource+"&cmd=update&from="+modified + '&rand='+ Math.random(),true);
- HTTP.onreadystatechange = function(){
- if (HTTP.readyState == 4 &&
- HTTP.status == 200) {
- updateClaims(dataSource,HTTP.responseXML,true);
- }
- }
- HTTP.send(null);
- }
-}
-
-function updateClaims(dataSource,xmlthingy,timestamp){
- var targets = xmlthingy.getElementsByTagName("target");
- for (var i = 0; i < targets.length; i++){
- var target = targets[i].attributes.getNamedItem("id").nodeValue;
- var obj = document.getElementById("claim"+target);
- if (!obj)
- continue;
- //obj.innerHTML = '';
- clearObject(obj);
- var waves = targets[i].getElementsByTagName("wave");;
- for (var j = 0; j < waves.length; j++){
- var command = waves[j].getElementsByTagName("command")[0];
- var claimers = waves[j].getElementsByTagName("claimers")[0];
- var joinable = waves[j].getElementsByTagName("joinable")[0];
- var wave = waves[j].attributes.getNamedItem("id").nodeValue;
- command = command.firstChild.nodeValue;
- if(claimers.firstChild){
- claimers = '('+claimers.firstChild.nodeValue+')';
- }else
- claimers = '';
- joinable = joinable.firstChild.nodeValue;
-
- if (command == 'none'){
- var s = document.createElement("b");
- s.appendChild(document.createTextNode("Claimed by "+claimers));
- obj.appendChild(s);
- }else{
- var b = document.createElement("input");
- b.type = 'button';
- b.setAttribute("class", command);
- b.value = command +' wave '+wave+' '+claimers;
- b.setAttribute("onclick", "claim('"+dataSource+"',"+target+","+wave+",'"+command+"');");
- /*b.onclick = function(){
- claim(dataSource,t,wave,command);
- }*/
- obj.appendChild(b);
- }
- if (command == 'Unclaim'){
- var b = document.createElement("input");
- b.type = 'button';
- b.value = 'J';
- b.title = 'Make target joinable';
- command = 'set&joinable=TRUE';
- if (joinable == 1){
- b.value = 'N';
- b.title = 'Disable join';
- command = 'set&joinable=FALSE';
- }
- b.setAttribute("onclick", "claim('"+dataSource+"',"+target+","+wave+",'"+command+"');");
- obj.appendChild(b);
- }
- /*@cc_on
- obj.innerHTML = obj.innerHTML; // IE doesn't understand unless you tell it twice
- @*/
- }
- /*
- obj = document.getElementById("coords"+target);
- var coords = targets[i].getElementsByTagName("coords");;
- if (obj)
- obj.innerHTML = coords[0].firstChild.nodeValue;
- */
- }
- if (timestamp){
- timestamp = xmlthingy.getElementsByTagName("timestamp");
- if (timestamp)
- modified = timestamp[0].firstChild.nodeValue;
- }
-}
+++ /dev/null
-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;
-}
+++ /dev/null
-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;
-}
+++ /dev/null
-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;
-}
+++ /dev/null
-@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;
-}
-
+++ /dev/null
-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;
-}
--- /dev/null
+package NDWeb;
+
+use strict;
+use warnings;
+
+use Catalyst::Runtime '5.70';
+
+# Set flags and add plugins for the application
+#
+# -Debug: activates the debug mode for very useful log messages
+# ConfigLoader: will load the configuration from a YAML file in the
+# application's home directory
+# Static::Simple: will serve static files from the application's root
+# directory
+
+use parent qw/Catalyst/;
+
+our $VERSION = '0.01';
+
+# Configure the application.
+#
+# Note that settings in ndweb.yml (or other external
+# configuration file that you set up manually) take precedence
+# over this when using ConfigLoader. Thus configuration
+# details given here can function as a default configuration,
+# with a external configuration file acting as an override for
+# local deployment.
+
+__PACKAGE__->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<NDWeb::Controller::Root>, L<Catalyst>
+
+=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;
--- /dev/null
+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;
--- /dev/null
+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<NDWeb>
+
+=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;
+
--- /dev/null
+---
+name: NDWeb
--- /dev/null
+[% # 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';
+
+-%]
--- /dev/null
+[% base = c.req.base;
+
+ site.url = {
+ base = base
+ }
+-%]
--- /dev/null
+<!-- BEGIN site/footer -->
+<div id="copyright">© [% site.copyright %]</div>
+<!-- END site/footer -->
--- /dev/null
+<!-- BEGIN site/header -->
+<h1 class="title">[% template.title or site.title %]</h1>
+<!-- END site/header -->
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head>
+ <title>[% template.title or site.title %]</title>
+ <meta http-equiv="Content-Type" content="application/xhtml+xml;charset=UTF-8"/>
+ <link rel="stylesheet" type="text/css" href="/static/default.css"/>
+ <link rel="stylesheet" type="text/css" href="/static/css/[% user.css or "black" %].css"/>
+ <link rel="icon" type="image/ico" href="/favicon.ico"/>
+ <script type="text/javascript" src="/static/js/raid.js"></script>
+ <script type="text/javascript" src="/static/js/misc.js"></script>
+ <TMPL_VAR NAME=HEADER>
+</head>
+ <body>
+[% content %]
+</body>
--- /dev/null
+<div id="leftbar">[% PROCESS site/leftbar.tt2 %]</div>
+<div id="header">[%# PROCESS site/header.tt2 %]</div>
+
+<div id="body">
+[% content %]
+</div>
+
+<div id="footer">[%# PROCESS site/footer.tt2 %]</div>
--- /dev/null
+<ul class="linkbar">
+ <li><a href="/main">Main page</a></li>
+ <li><a href="/settings">Settings</a></li>
+ <li><a href="/forum">Forum</a></li>
+[% IF user %]
+ <li><a href="/forum/allUnread">New posts [% IF user.forum.unread %](<span class="[% user.newposts or "unreadposts"%]">[% user.forum.unread %]</span>)[% END %]</a></li>
+[% END %]
+ <li><a href="/forum/search">Forum search</a></li>
+</ul> <p>Tick: [% game.tick %]</p>
+[% IF user.isMember %]
+ [% IF user.isAttacker %]
+<p>Member menu</p>
+<ul class="linkbar">
+ <li><a href="/points">Top members</a></li>
+ <li><a href="/addintel">Add intel/scans</a></li>
+ <li><a href="/launchConfirmation">Launch confirmation</a></li>
+ <li><a href="/covop">CovOp targets</a></li>
+ <li><a href="/covop?list=distwhores">Distwhores</a></li>
+ <li><a href="/planetrankings">Planet Rankings</a></li>
+ <li><a href="/alliancerankings">Alliance Rankings</a></li>
+ <li><a href="/galaxyrankings">Galaxy Rankings</a></li>
+ <li><a href="/defrequest">Request defense</a></li>
+</ul>
+ [% ELSE %]
+ [% IF user.planet %]
+ <p><b>Update your fleet to see member menu</b></p>
+ [% ELSE %]
+ <form action="/main" method="post">
+ <p>We need your planet's coordinates:
+ <input type="text" name="planet" value=""/>
+ <input type="submit" value="Submit"/>
+ </p>
+ </form>
+ [% END %]
+ [% END %]
+[% END %]
+[% IF user.isAttacker %]
+<p>Attack menu</p>
+<ul class="linkbar">
+ <li><form action="/check" method="post"><p>
+ <input type="hidden" name="page" value="check"/>
+ <input class="coordsinput" type="text" name="coords" value="<TMPL_VAR NAME=Coords>"/>
+ <input class="coordsbutton" type="submit" value="Check"/>
+ </p></form></li>
+ <li><a href="/raids">Web raids</a></li>
+</ul>
+<div id="targets"><TMPL_VAR NAME=Targets></div>
+[% END %]
+[% IF user.isBC %]
+<p>BC menu</p>
+<ul class="linkbar">
+ <li><a href="/editRaid">Create raid</a></li>
+</ul>
+[% END %]
+[% IF user.isDC %]
+<p>DC menu</p>
+<ul class="linkbar">
+ <li><a href="/defLeeches">Def Leeches</a></li>
+ <li><a href="/calls">Defense calls</a></li>
+ <li><a href="/calls?show=uncovered">Not covered calls</a></li>
+ <li><a href="/calls?show=covered">Covered calls</a></li>
+ <li><a href="/calls?show=all">All calls</a></li>
+</ul>
+[% END %]
+[% IF user.isHC %]
+<p>HC menu</p>
+<ul class="linkbar">
+ <li><a href="/users">List users</a></li>
+ <li><a href="/intel">Intel</a></li>
+ <li><a href="/alliances">Alliances</a></li>
+ <li><a href="/hostileAlliances">Hostile Alliances</a></li>
+ <li><a href="/memberIntel">Member Intel</a></li>
+ <li><a href="/resources">Alliance resources</a></li>
+ <li><a href="/planetNaps">Planet Naps</a></li>
+ <li><a href="/mail">Mail</a></li>
+</ul>
+[% ELSE %]
+ [% IF user.isIntel %]
+<p>Intel menu</p>
+<ul class="linkbar">
+ <li><a href="intel">Intel</a></li>
+</ul>
+ [% END %]
+[% END %]
--- /dev/null
+[% 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;
+-%]
--- /dev/null
+[% META title = 'Catalyst/TT Error' %]
+<p>
+ 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...
+</p>
+<p>
+ Here's the error message, on the off-chance that it means something
+ to you: <span class="error">[% error %]</span>
+</p>
--- /dev/null
+[% META title = 'Catalyst/TT View!' %]
+<p>
+ Yay! You're looking at a page generated by the Catalyst::View::TT
+ plugin module.
+</p>
+<p>
+ This is the welcome page. Why not try the equally-exciting
+</p>
--- /dev/null
+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;
+}
--- /dev/null
+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;
+}
--- /dev/null
+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;
+}
--- /dev/null
+@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;
+}
+
--- /dev/null
+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;
+}
--- /dev/null
+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;
+}
--- /dev/null
+function toggleVisibility(id) {
+ var obj=document.getElementById(id);
+ if (obj.style.display=='none') {
+ obj.style.display='';
+ }
+ else {
+ obj.style.display='none';
+ }
+}
--- /dev/null
+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)*)</targetlist");
+ if(re.test(HTTP.responseText))
+ obj.innerHTML = RegExp.$1;
+ }
+ }
+ }
+ HTTP.send(null);
+ }
+}
+
+function clearObject(obj){
+ while (obj.hasChildNodes()){
+ obj.removeChild(obj.firstChild);
+ }
+}
+
+function listTargets(dataSource){
+ var http = getHTTPObject();
+ http.open("GET",dataSource+'&cmd=gettargets' + '&rand='+ Math.random(),true);
+ http.onreadystatechange = function(){
+ if (http.readyState == 4 &&
+ http.status == 200) {
+ var obj = document.getElementById("targets");
+ if (obj){
+ clearObject(obj);
+ var re = new RegExp("targetlist>((.|\\n)*)</targetlist");
+ if(re.test(http.responseText))
+ obj.innerHTML = RegExp.$1;
+ }
+ }
+ }
+ http.send(null);
+}
+
+function update(dataSource){
+ var HTTP = getHTTPObject();
+ if(HTTP) {
+ HTTP.open("GET",dataSource+"&cmd=update&from="+modified + '&rand='+ Math.random(),true);
+ HTTP.onreadystatechange = function(){
+ if (HTTP.readyState == 4 &&
+ HTTP.status == 200) {
+ updateClaims(dataSource,HTTP.responseXML,true);
+ }
+ }
+ HTTP.send(null);
+ }
+}
+
+function updateClaims(dataSource,xmlthingy,timestamp){
+ var targets = xmlthingy.getElementsByTagName("target");
+ for (var i = 0; i < targets.length; i++){
+ var target = targets[i].attributes.getNamedItem("id").nodeValue;
+ var obj = document.getElementById("claim"+target);
+ if (!obj)
+ continue;
+ //obj.innerHTML = '';
+ clearObject(obj);
+ var waves = targets[i].getElementsByTagName("wave");;
+ for (var j = 0; j < waves.length; j++){
+ var command = waves[j].getElementsByTagName("command")[0];
+ var claimers = waves[j].getElementsByTagName("claimers")[0];
+ var joinable = waves[j].getElementsByTagName("joinable")[0];
+ var wave = waves[j].attributes.getNamedItem("id").nodeValue;
+ command = command.firstChild.nodeValue;
+ if(claimers.firstChild){
+ claimers = '('+claimers.firstChild.nodeValue+')';
+ }else
+ claimers = '';
+ joinable = joinable.firstChild.nodeValue;
+
+ if (command == 'none'){
+ var s = document.createElement("b");
+ s.appendChild(document.createTextNode("Claimed by "+claimers));
+ obj.appendChild(s);
+ }else{
+ var b = document.createElement("input");
+ b.type = 'button';
+ b.setAttribute("class", command);
+ b.value = command +' wave '+wave+' '+claimers;
+ b.setAttribute("onclick", "claim('"+dataSource+"',"+target+","+wave+",'"+command+"');");
+ /*b.onclick = function(){
+ claim(dataSource,t,wave,command);
+ }*/
+ obj.appendChild(b);
+ }
+ if (command == 'Unclaim'){
+ var b = document.createElement("input");
+ b.type = 'button';
+ b.value = 'J';
+ b.title = 'Make target joinable';
+ command = 'set&joinable=TRUE';
+ if (joinable == 1){
+ b.value = 'N';
+ b.title = 'Disable join';
+ command = 'set&joinable=FALSE';
+ }
+ b.setAttribute("onclick", "claim('"+dataSource+"',"+target+","+wave+",'"+command+"');");
+ obj.appendChild(b);
+ }
+ /*@cc_on
+ obj.innerHTML = obj.innerHTML; // IE doesn't understand unless you tell it twice
+ @*/
+ }
+ /*
+ obj = document.getElementById("coords"+target);
+ var coords = targets[i].getElementsByTagName("coords");;
+ if (obj)
+ obj.innerHTML = coords[0].firstChild.nodeValue;
+ */
+ }
+ if (timestamp){
+ timestamp = xmlthingy.getElementsByTagName("timestamp");
+ if (timestamp)
+ modified = timestamp[0].firstChild.nodeValue;
+ }
+}
--- /dev/null
+#!/usr/bin/perl -w
+
+BEGIN { $ENV{CATALYST_ENGINE} ||= 'CGI' }
+
+use strict;
+use warnings;
+use FindBin;
+use lib "$FindBin::Bin/../lib";
+use NDWeb;
+
+NDWeb->run;
+
+1;
+
+=head1 NAME
+
+ndweb_cgi.pl - Catalyst CGI
+
+=head1 SYNOPSIS
+
+See L<Catalyst::Manual>
+
+=head1 DESCRIPTION
+
+Run a Catalyst application as a cgi script.
+
+=head1 AUTHOR
+
+Sebastian Riedel, C<sri@oook.de>
+
+=head1 COPYRIGHT
+
+
+This library is free software, you can redistribute it and/or modify
+it under the same terms as Perl itself.
+
+=cut
--- /dev/null
+#!/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<sri@oook.de>
+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
--- /dev/null
+#!/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<sri@oook.de>
+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
--- /dev/null
+#!/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<sri@oook.de>
+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
--- /dev/null
+#!/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<sri@oook.de>
+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
--- /dev/null
+use strict;
+use warnings;
+use Test::More tests => 2;
+
+BEGIN { use_ok 'Catalyst::Test', 'NDWeb' }
+
+ok( request('/')->is_success, 'Request should succeed' );
--- /dev/null
+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();
--- /dev/null
+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();
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
- <title>NewDawn: <TMPL_VAR NAME=TITLE></title>
- <meta http-equiv="Content-Type" content="application/xhtml+xml;charset=UTF-8"/>
- <link rel="stylesheet" type="text/css" href="/default.css"/>
- <link rel="stylesheet" type="text/css" href="/stylesheets/<TMPL_IF CSS><TMPL_VAR NAME=CSS><TMPL_ELSE>black</TMPL_IF>.css"/>
- <link rel="icon" type="image/ico" href="/favicon.ico"/>
- <script type="text/javascript" src="/raid.js"></script>
- <script type="text/javascript" src="/misc.js"></script>
- <TMPL_VAR NAME=HEADER>
-</head>
-<body>
-<div id="leftbar">
- <ul class="linkbar">
- <li><a href="/main">Main page</a></li>
- <li><a href="/settings">Settings</a></li>
- <li><a href="/forum">Forum</a></li>
- <li><a href="/forum/allUnread">New posts <TMPL_IF UnreadPosts>(<span class="<TMPL_IF NewPosts>newposts<TMPL_ELSE>unreadposts</TMPL_IF>"><TMPL_VAR NAME=UnreadPosts></span>)</TMPL_IF></a></li>
- <li><a href="/forum/search">Forum search</a></li>
- </ul> <p>Tick: <TMPL_VAR NAME=TICK></p>
- <TMPL_IF isMEMBER>
- <TMPL_IF isATTACKER>
- <p>Member menu</p>
- <ul class="linkbar">
- <li><a href="/points">Top members</a></li>
- <li><a href="/addintel">Add intel/scans</a></li>
- <li><a href="/launchConfirmation">Launch confirmation</a></li>
- <li><a href="/covop">CovOp targets</a></li>
- <li><a href="/covop?list=distwhores">Distwhores</a></li>
- <li><a href="/planetrankings">Planet Rankings</a></li>
- <li><a href="/alliancerankings">Alliance Rankings</a></li>
- <li><a href="/galaxyrankings">Galaxy Rankings</a></li>
- <li><a href="/defrequest">Request defense</a></li>
- </ul>
- <TMPL_ELSE>
- <TMPL_IF Planet>
- <p><b>Update your fleet to see member menu</b></p>
- <TMPL_ELSE>
- <form action="/main" method="post">
- <p>We need your planet's coordinates:
- <input type="text" name="planet" value=""/>
- <input type="submit" value="Submit"/>
- </p>
- </form>
- </TMPL_IF>
- </TMPL_IF>
- </TMPL_IF>
- <TMPL_IF isATTACKER>
- <p>Attack menu</p>
- <ul class="linkbar">
- <li><form action="/check" method="post"><p>
- <input type="hidden" name="page" value="check"/>
- <input class="coordsinput" type="text" name="coords" value="<TMPL_VAR NAME=Coords>"/>
- <input class="coordsbutton" type="submit" value="Check"/>
- </p></form></li>
- <li><a href="/raids">Web raids</a></li>
- </ul>
- <div id="targets"><TMPL_VAR NAME=Targets></div>
- </TMPL_IF>
- <TMPL_IF isBC>
- <p>BC menu</p>
- <ul class="linkbar">
- <li><a href="/editRaid">Create raid</a></li>
- </ul>
- </TMPL_IF>
- <TMPL_IF isDC>
- <p>DC menu</p>
- <ul class="linkbar">
- <li><a href="/defLeeches">Def Leeches</a></li>
- <li><a href="/calls">Defense calls</a></li>
- <li><a href="/calls?show=uncovered">Not covered calls</a></li>
- <li><a href="/calls?show=covered">Covered calls</a></li>
- <li><a href="/calls?show=all">All calls</a></li>
- </ul>
- </TMPL_IF>
- <TMPL_IF isHC>
- <p>HC menu</p>
- <ul class="linkbar">
- <li><a href="/users">List users</a></li>
- <li><a href="/intel">Intel</a></li>
- <li><a href="/alliances">Alliances</a></li>
- <li><a href="/hostileAlliances">Hostile Alliances</a></li>
- <li><a href="/memberIntel">Member Intel</a></li>
- <li><a href="/resources">Alliance resources</a></li>
- <li><a href="/planetNaps">Planet Naps</a></li>
- <li><a href="/mail">Mail</a></li>
- </ul>
- <TMPL_ELSE>
- <TMPL_IF isIntel>
- <p>Intel menu</p>
- <ul class="linkbar">
- <li><a href="intel">Intel</a></li>
- </ul>
- </TMPL_IF>
- </TMPL_IF>
- <TMPL_VAR NAME=LEFTBAR>
-</div>
-<div id="body">
-<TMPL_VAR NAME=Error>
-<TMPL_VAR NAME=BODY>
-</div>
-</body>
-</html>