Beagle
view release on metacpan or search on metacpan
lib/Beagle/Web/Router.pm view on Meta::CPAN
use Beagle::Util;
use Lingua::EN::Inflect 'A';
use Beagle::Web::Form;
use Beagle::Web::Router::Util;
use List::MoreUtils 'first_index';
get '/' => sub {
render 'index', entries => handle()->entries;
};
get '/fragment/menu' => sub {
render 'menu';
};
get '/fragment/entry/:id' => sub {
my %vars = @_;
my $i = $vars{id};
my @ret = resolve_id( $i, handle => handle() );
return unless @ret == 1;
render 'entry', entry => $ret[0]->{entry};
};
get '/fragment/tag/:tag' => sub {
my %vars = @_;
my $tag = decode_utf8 $vars{tag};
my $entries = Beagle::Web->tags( handle() )->{$tag} || [];
render '_list', entries => $entries, disable_page => 1;
};
get '/fragment/archive/{year:[0-9]+}' => sub {
my %vars = @_;
my $year = $vars{year};
render '_list',
entries => [
map { @{ Beagle::Web->archives( handle() )->{$year}{$_} } }
keys %{ Beagle::Web->archives( handle() )->{$year} || {} }
],
disable_page => 1;
};
get '/fragment/archive/{year:[0-9]+}/{month:[0-9]{2}}' => sub {
my %vars = @_;
my $year = $vars{year};
my $month = $vars{month};
my $entries = Beagle::Web->archives( handle() )->{$year}{$month} || [];
render '_list', entries => $entries, disable_page => 1;
};
get '/tag/:tag' => sub {
my %vars = @_;
my $tag = decode_utf8 $vars{tag};
share/public/js/base/beagle-admin.js view on Meta::CPAN
if ( window.location.pathname.match(/admin\/entries/ ) ) {
e.closest('li').remove();
beagleContrast(e.closest('ul'));
}
else if ( window.location.pathname.match(/admin\/entry/ ) ) {
window.location = beaglePrefix+'admin/entries';
}
else {
$('#'+id).remove();
if ( json.redraw_menu ) {
$('#menu').load(beaglePrefix + 'fragment/menu', function () {
beagleContrast('#menu');
} );
}
beagleContrast(e.closest('div.comments'));
}
}
}
} );
return false;
}
share/public/js/base/beagle.js view on Meta::CPAN
function beagleHoverTag ( ) {
$('td.hover.tag' ).hoverIntent(
{
timeout: 500,
over: function () {
var glance = $(this).children( 'div.glance' ).first();
if ( glance ) {
if ( glance.text() == '' ) {
var name = $(this).find('a').first().attr('name');
if ( name ) {
$.get(beaglePrefix + 'fragment/tag/' + name, function ( data ) {
glance.html(data);
glance.find('div.list > div').css('margin-top', '0.25em');
glance.show();
return;
} );
}
}
else {
glance.show();
}
share/public/js/base/beagle.js view on Meta::CPAN
function beagleHoverArchive ( ) {
$('td.hover.archive, div.hover.archive' ).hoverIntent(
{
timeout: 500,
over: function () {
var glance = $(this).children( 'div.glance' ).first();
if ( glance ) {
if ( glance.text() == '' ) {
var name = $(this).find('a').first().attr('name');
if ( name ) {
$.get(beaglePrefix + 'fragment/archive/' + name, function ( data ) {
glance.html(data);
glance.find('div.list > div').css('margin-top', '0.25em');
glance.show();
return;
} );
}
}
else {
glance.show();
}
share/public/js/base/jquery.js view on Meta::CPAN
* Dual licensed under the MIT or GPL Version 2 licenses.
* http://jquery.org/license
*
* Includes Sizzle.js
* http://sizzlejs.com/
* Copyright 2011, The Dojo Foundation
* Released under the MIT, BSD, and GPL Licenses.
*
* Date: Thu Jun 30 14:16:56 2011 -0400
*/
(function(a,b){function cv(a){return f.isWindow(a)?a:a.nodeType===9?a.defaultView||a.parentWindow:!1}function cs(a){if(!cg[a]){var b=c.body,d=f("<"+a+">").appendTo(b),e=d.css("display");d.remove();if(e==="none"||e===""){ch||(ch=c.createElement("ifram...
shift(),i.sort());if(!!e&&!f.event.customEvent[h]||!!f.event.global[h]){c=typeof c=="object"?c[f.expando]?c:new f.Event(h,c):new f.Event(h),c.type=h,c.exclusive=j,c.namespace=i.join("."),c.namespace_re=new RegExp("(^|\\.)"+i.join("\\.(?:.*\\.)?")+"(\...
)}return this.pushStack(d,a,e.selector)}}),f.extend({clone:function(a,b,c){var d=a.cloneNode(!0),e,g,h;if((!f.support.noCloneEvent||!f.support.noCloneChecked)&&(a.nodeType===1||a.nodeType===11)&&!f.isXMLDoc(a)){bi(a,d),e=bj(a),g=bj(d);for(h=0;e[h];++...
( run in 1.545 second using v1.01-cache-2.11-cpan-364913b4093 )