Chandra

 view release on metacpan or  search on metacpan

examples/dragdrop_example.pl  view on Meta::CPAN

    width  => 600,
    height => 500,
    debug  => 1,
);

# ---- Global file drop handler ----

$app->on_file_drop(sub {
    my ($files) = @_;
    my $count = scalar @$files;
    my $names = join ', ', map { (split m{/}, $_)[-1] } @$files;
    $app->eval(
        "document.getElementById('drop-log').innerHTML += "
        . "'<div class=\"entry\">Dropped $count file(s): $names</div>';"
    );
});

# ---- Zone-specific handler ----

$app->drop_zone('#upload-zone', sub {
    my ($files, $target) = @_;



( run in 0.453 second using v1.01-cache-2.11-cpan-71847e10f99 )