Group
Extension

Matches 5

Amon2 ( T/TO/TOKUHIROM/Amon2-6.16.tar.gz, TOKUHIROM, 2022; MetaCPAN )
Amon2/lib/Amon2/Plugin/Web/JSON.pm ( view source; MetaCPAN )
package Amon2::Plugin::Web::JSON;
use strict;
use warnings;
use JSON 2 qw/encode_json/;
use Amon2::Util ();

my $_JSON = JSON->new()->ascii(1);

my %_ESCAPE = (
    '+' => '\\u002b', # do not eval as 
) = @_;
    unless ($c->can('render_json')) {
        Amon2::Util::add_method($c, 'render_json', sub {
            my ($c, $stuff) = @_;

            # for IE7 JSON venularity.
            # see http:
//www.atmarkit.co.jp/fcoding/articles/webapp/05/webapp05a.html
            my $output = $_JSON->canonical( $conf->{canonical} ? 1 : 0 )->encode($stuff);
            $output =~ s!([+<>])!$_ESCAPE{$1}!g
Amon2 ( T/TO/TOKUHIROM/Amon2-6.16.tar.gz, TOKUHIROM, 2022; MetaCPAN )
Amon2/share/flavor/Basic/lib/__PATH__/Web.pm ( view source; MetaCPAN )
ot generated");
}

# load plugins
__PACKAGE__->load_plugins(
    'Web::FillInFormLite',
    'Web::JSON',
    '+<% $module %>::Web::Plugin::Session',
);

# setup view
use <% $module %>::Web::View;
{
  
Amon2 ( T/TO/TOKUHIROM/Amon2-6.16.tar.gz, TOKUHIROM, 2022; MetaCPAN )
Amon2/lib/Amon2/Setup/Asset/jQuery.pm ( view source; MetaCPAN )
(n=e.getAttribute(r))){try{n="true"===(i=n)||"false"!==i&&("null"===i?null:i===+i+""?+i:J.test(i)?JSON.parse(i):i)}catch(e){}Q.set(e,t,n)}else n=void 0;return n}S.extend({hasData:function(e){return Q.
l, text/xml",json:"application/json, text/javascript"},contents:{xml:/\\bxml\\b/,html:/\\bhtml/,json:/\\bjson\\b/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters
:{"* text":String,"text html":!0,"text json":JSON.parse,"text xml":S.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(e,t){return t?Bt(Bt(e,S.ajaxSettings),t):Bt(S.ajaxSettings,e)},ajaxPr
Amon2 ( T/TO/TOKUHIROM/Amon2-6.16.tar.gz, TOKUHIROM, 2022; MetaCPAN )
Amon2/lib/Amon2/Plugin/Web/Streaming.pm ( view source; MetaCPAN )
|| $c, 'streaming', \&_streaming);
    Amon2::Util::add_method(ref $c || $c, 'streaming_json', \&_streaming_json);
}

sub _streaming {
    my ($self, $code) = @_;
    
    return Amon2::Web::Response:
:Callback->new(
        code => sub {
            $code->(@_);
        }
    );
}

sub _streaming_json {
    my ($self, $code) = @_;

    return Amon2::Web::Response::Callback->new(
        code => su
   my $respond = shift;
            my $writer = $respond->([200, ['Content-Type' => 'application/json;charset=utf-8']]);

            my $longpoll_ctx = Amon2::Plugin::Web::Streaming::Writer->new(
  
Amon2 ( T/TO/TOKUHIROM/Amon2-6.16.tar.gz, TOKUHIROM, 2022; MetaCPAN )
Amon2/lib/Amon2/Setup/Flavor/Basic.pm ( view source; MetaCPAN )
ece'                     => '1.20',
        'Plack::Middleware::ReverseProxy' => '0.09',
        'JSON'                            => '2.50',
        'Teng'                            => '0.18',
     

Powered by Groonga
Maintained by Kenichi Ishigaki <ishigaki@cpan.org>. If you find anything, submit it on GitHub.