stant coffee_files => [];
use constant js_files => [qw(
jquery.js
jquery-ui.js
jquery-json.js
jquery.cookie.js
jquery.jemplate.js
jemplate.js
cog.js
config.js
url-m
ed on url
# Return results or OK
my $self = shift;
$self->env(shift);
$self->read_json;
my $path = $self->env->{PATH_INFO};
my $post_map = $self->config->post_map;
my ($reg
plication/json' ],
[ $self->json->encode($result) ]
];
}
else {
return [ 200, [ 'Content-Type' => 'text/plain' ], [ $result ] ];
}
}
sub response_json {
my
# System singleton object pointers.
my $app;
my $config;
my $maker;
my $runner;
my $webapp;
my $json;
# The config reference must be initialized at startup.
$Cog::Base::initialize = sub {
$app
a set up JSON object
sub json {
$json ||= do {
require JSON;
my $j = JSON->new;
$j->allow_blessed;
$j->convert_blessed;
$j;
};
return $json;
}
1;
my $self = shift;
my $config_path = $self->app->config_file;
my $data = {
json => $self->json->encode(YAML::XS::LoadFile($config_path)),
};
my $build = $self->app->build_root;
rint($javascript);
}
sub make_url_map_js {
my $self = shift;
my $data = {
json => $self->json->encode($self->config->url_map),
};
my $build = $self->app->build_root;
my $j