view release on metacpan or search on metacpan
lib/App/I18N/Web/View.pm view on Meta::CPAN
div { { id is 'current-message' }
div { { class is 'navbar' }
input { { type is 'button' , class is 'prev-message' , value is 'Previous' } };
input { { type is 'button' , class is 'skip-message' , value is 'Next' } };
input { { type is 'button' , class is 'next-message' , value is 'Save and Next' } };
}
div { { id is 'message-content' }
div { { id is 'current-lang' } }
div { { id is 'current-msgid' } }
textarea { { id is 'current-msgstr' , rows is 6 , cols is 60 , tabindex is 1 } }
};
div { { class is 'navbar' }
input { { type is 'button' , class is 'prev-message' , value is 'Previous' , tabindex is 4 } };
input { { type is 'button' , class is 'skip-message' , value is 'Next' , tabindex is 3 } };
input { { type is 'button' , class is 'next-message' , value is 'Save and Next' , tabindex is 2 } };
}
}
};
template '/' => page {
my ( $class, $handler ) = @_;
my $po_opts = $handler->application->options;
my $podir = $po_opts->{podir};
maketext/l10n.php view on Meta::CPAN
if( $localedir == null )
$localedir = $this->localedir;
if( $localedir == null )
$localedir = dirname(__FILE__) . '/' . 'locale';
$lang = $this->cur_lang;
putenv("LANG=$lang");
setlocale(LC_MESSAGES, $lang );
bindtextdomain( $textdomain, $localedir );
bind_textdomain_codeset( $textdomain, 'UTF-8');
textdomain( $textdomain );
return $this;
}
}
function l10n()
{
global $l10n;
if( $l10n == null ) {
$l10n = new L10N();
share/static/Stream.js view on Meta::CPAN
},
readyStateNanny: function() {
if(this.req.readyState == 3 && this.pong == null) {
var contentTypeHeader = this.req.getResponseHeader("Content-Type");
if(contentTypeHeader.indexOf("multipart/mixed") == -1) {
this.req.onreadystatechange = function() {
throw new Error('Send it as multipart/mixed, genius.');
this.req.onreadystatechange = function() {};
}.bind(this);
} else {
this.boundary = '--' + contentTypeHeader.split('"')[1];
//Start pinging
this.pong = window.setInterval(this.ping.bind(this), 15);
}
}
if(this.req.readyState == 4) {
//var contentTypeHeader = this.req.getResponseHeader("Content-Type");
//Stop the insanity!
clearInterval(this.pong);
//One last ping to clean up
share/static/Stream.js view on Meta::CPAN
}
if(typeof callback != 'undefined' && callback.constructor == Function) {
this.listeners[mime].push(callback);
}
}
});
})(jQuery);
//Yep, I still use this. So what? You wanna fight about it?
Function.prototype.bind = function() {
var __method = this, object = arguments[0], args = [];
for(i = 1; i < arguments.length; i++)
args.push(arguments[i]);
return function() {
return __method.apply(object, args);
}
}
share/static/app.js view on Meta::CPAN
g_el_text = g_el.find('div.text');
}
if( typeof google != "undefined" ) {
google.language.translate( entry.msgid , "", lang , function(result) {
if( result.error ) {
g_el_text.html( "Error:" + result.error.message );
$.jGrowl( result.error.message , { header: 'Google Translation' , theme: 'error' , sticky: 1 } );
} else {
g_el_text.html( result.translation );
var apply = $('<a/>').attr( { href: '#', tabindex: 5 } ).html( 'Apply' ).addClass('apply').click( function(e) {
$('#current-msgstr').val( result.translation );
g_el.fadeOut('slow');
});
g_el_text.append( apply );
}
});
}
$('#current-msgstr').focus( );
share/static/jquery-1.4.2.js view on Meta::CPAN
// Execute a callback for every element in the matched set.
// (You can seed the arguments with an array of args, but this is
// only used internally.)
each: function( callback, args ) {
return jQuery.each( this, callback, args );
},
ready: function( fn ) {
// Attach the listeners
jQuery.bindReady();
// If the DOM is already ready
if ( jQuery.isReady ) {
// Execute the function immediately
fn.call( document, jQuery );
// Otherwise, remember the function for later
} else if ( readyList ) {
// Add the function to the wait list
readyList.push( fn );
share/static/jquery-1.4.2.js view on Meta::CPAN
readyList = null;
}
// Trigger any bound ready events
if ( jQuery.fn.triggerHandler ) {
jQuery( document ).triggerHandler( "ready" );
}
}
},
bindReady: function() {
if ( readyBound ) {
return;
}
readyBound = true;
// Catch cases where $(document).ready() is called after the
// browser event has already occurred.
if ( document.readyState === "complete" ) {
return jQuery.ready();
share/static/jquery-1.4.2.js view on Meta::CPAN
})();
jQuery.props = {
"for": "htmlFor",
"class": "className",
readonly: "readOnly",
maxlength: "maxLength",
cellspacing: "cellSpacing",
rowspan: "rowSpan",
colspan: "colSpan",
tabindex: "tabIndex",
usemap: "useMap",
frameborder: "frameBorder"
};
var expando = "jQuery" + now(), uuid = 0, windowData = {};
jQuery.extend({
cache: {},
expando:expando,
share/static/jquery-1.4.2.js view on Meta::CPAN
elem[ name ] = value;
}
// browsers index elements by id/name on forms, give priority to attributes.
if ( jQuery.nodeName( elem, "form" ) && elem.getAttributeNode(name) ) {
return elem.getAttributeNode( name ).nodeValue;
}
// elem.tabIndex doesn't always return the correct value when it hasn't been explicitly set
// http://fluidproject.org/blog/2008/01/09/getting-setting-and-removing-tabindex-values-with-javascript/
if ( name === "tabIndex" ) {
var attributeNode = elem.getAttributeNode( "tabIndex" );
return attributeNode && attributeNode.specified ?
attributeNode.value :
rfocusable.test( elem.nodeName ) || rclickable.test( elem.nodeName ) && elem.href ?
0 :
undefined;
}
share/static/jquery-1.4.2.js view on Meta::CPAN
}
// Make sure that the function being executed has a unique ID
if ( !handler.guid ) {
handler.guid = jQuery.guid++;
}
// Init the element's event structure
var elemData = jQuery.data( elem );
// If no elemData is found then we must be trying to bind to one of the
// banned noData elements
if ( !elemData ) {
return;
}
var events = elemData.events = elemData.events || {},
eventHandle = elemData.handle, eventHandle;
if ( !eventHandle ) {
elemData.handle = eventHandle = function() {
share/static/jquery-1.4.2.js view on Meta::CPAN
jQuery.event.handle.apply( eventHandle.elem, arguments ) :
undefined;
};
}
// Add elem as a property of the handle function
// This is to prevent a memory leak with non-native events in IE.
eventHandle.elem = elem;
// Handle multiple events separated by a space
// jQuery(...).bind("mouseover mouseout", fn);
types = types.split(" ");
var type, i = 0, namespaces;
while ( (type = types[ i++ ]) ) {
handleObj = handleObjIn ?
jQuery.extend({}, handleObjIn) :
{ handler: handler, data: data };
// Namespaced event handlers
share/static/jquery-1.4.2.js view on Meta::CPAN
if ( !elemData || !events ) {
return;
}
// types is actually an event object here
if ( types && types.type ) {
handler = types.handler;
types = types.type;
}
// Unbind all events for the element
if ( !types || typeof types === "string" && types.charAt(0) === "." ) {
types = types || "";
for ( type in events ) {
jQuery.event.remove( elem, type + types );
}
return;
}
// Handle multiple events separated by a space
// jQuery(...).unbind("mouseover mouseout", fn);
types = types.split(" ");
while ( (type = types[ i++ ]) ) {
origType = type;
handleObj = null;
all = type.indexOf(".") < 0;
namespaces = [];
if ( !all ) {
// Namespaced event handlers
share/static/jquery-1.4.2.js view on Meta::CPAN
// Deprecated, use jQuery.guid instead
guid: 1E8,
// Deprecated, use jQuery.proxy instead
proxy: jQuery.proxy,
special: {
ready: {
// Make sure the ready event is setup
setup: jQuery.bindReady,
teardown: jQuery.noop
},
live: {
add: function( handleObj ) {
jQuery.event.add( this, handleObj.origType, jQuery.extend({}, handleObj, {handler: liveHandler}) );
},
remove: function( handleObj ) {
var remove = true,
share/static/jquery-1.4.2.js view on Meta::CPAN
};
function returnFalse() {
return false;
}
function returnTrue() {
return true;
}
// jQuery.Event is based on DOM3 Events as specified by the ECMAScript Language Binding
// http://www.w3.org/TR/2003/WD-DOM-Level-3-Events-20030331/ecma-script-binding.html
jQuery.Event.prototype = {
preventDefault: function() {
this.isDefaultPrevented = returnTrue;
var e = this.originalEvent;
if ( !e ) {
return;
}
// if preventDefault exists run it on the original event
share/static/jquery-1.4.2.js view on Meta::CPAN
}
},
teardown: function( namespaces ) {
jQuery.event.remove( this, ".specialSubmit" );
}
};
}
// change delegation, happens here so we have bind.
if ( !jQuery.support.changeBubbles ) {
var formElems = /textarea|input|select/i,
changeFilters,
getVal = function( elem ) {
var type = elem.type, val = elem.value;
if ( type === "radio" || type === "checkbox" ) {
share/static/jquery-1.4.2.js view on Meta::CPAN
};
function handler( e ) {
e = jQuery.event.fix( e );
e.type = fix;
return jQuery.event.handle.call( this, e );
}
});
}
jQuery.each(["bind", "one"], function( i, name ) {
jQuery.fn[ name ] = function( type, data, fn ) {
// Handle object literals
if ( typeof type === "object" ) {
for ( var key in type ) {
this[ name ](key, data, type[key], fn);
}
return this;
}
if ( jQuery.isFunction( data ) ) {
fn = data;
data = undefined;
}
var handler = name === "one" ? jQuery.proxy( fn, function( event ) {
jQuery( this ).unbind( event, handler );
return fn.apply( this, arguments );
}) : fn;
if ( type === "unload" && name !== "one" ) {
this.one( type, data, fn );
} else {
for ( var i = 0, l = this.length; i < l; i++ ) {
jQuery.event.add( this[i], type, handler, data );
}
}
return this;
};
});
jQuery.fn.extend({
unbind: function( type, fn ) {
// Handle object literals
if ( typeof type === "object" && !type.preventDefault ) {
for ( var key in type ) {
this.unbind(key, type[key]);
}
} else {
for ( var i = 0, l = this.length; i < l; i++ ) {
jQuery.event.remove( this[i], type, fn );
}
}
return this;
},
delegate: function( selector, types, data, fn ) {
return this.live( types, data, fn, selector );
},
undelegate: function( selector, types, fn ) {
if ( arguments.length === 0 ) {
return this.unbind( "live" );
} else {
return this.die( types, null, fn, selector );
}
},
trigger: function( type, data ) {
return this.each(function() {
jQuery.event.trigger( type, data, this );
});
share/static/jquery-1.4.2.js view on Meta::CPAN
event.stopPropagation();
jQuery.event.trigger( event, data, this[0] );
return event.result;
}
},
toggle: function( fn ) {
// Save reference to arguments for access in closure
var args = arguments, i = 1;
// link all the functions, so any of them can unbind this click handler
while ( i < args.length ) {
jQuery.proxy( fn, args[ i++ ] );
}
return this.click( jQuery.proxy( fn, function( event ) {
// Figure out which function to execute
var lastToggle = ( jQuery.data( this, "lastToggle" + fn.guid ) || 0 ) % i;
jQuery.data( this, "lastToggle" + fn.guid, lastToggle + 1 );
// Make sure that clicks stop
share/static/jquery-1.4.2.js view on Meta::CPAN
if ( type === "focus" || type === "blur" ) {
types.push( liveMap[ type ] + namespaces );
type = type + namespaces;
} else {
type = (liveMap[ type ] || type) + namespaces;
}
if ( name === "live" ) {
// bind live handler
context.each(function(){
jQuery.event.add( this, liveConvert( type, selector ),
{ data: data, selector: selector, handler: fn, origType: type, origHandler: fn, preType: preType } );
});
} else {
// unbind live handler
context.unbind( liveConvert( type, selector ), fn );
}
}
return this;
}
});
function liveHandler( event ) {
var stop, elems = [], selectors = [], args = arguments,
related, match, handleObj, elem, j, i, l, data,
share/static/jquery-1.4.2.js view on Meta::CPAN
}
function liveConvert( type, selector ) {
return "live." + (type && type !== "*" ? type + "." : "") + selector.replace(/\./g, "`").replace(/ /g, "&");
}
jQuery.each( ("blur focus focusin focusout load resize scroll unload click dblclick " +
"mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave " +
"change select submit keydown keypress keyup error").split(" "), function( i, name ) {
// Handle event binding
jQuery.fn[ name ] = function( fn ) {
return fn ? this.bind( name, fn ) : this.trigger( name );
};
if ( jQuery.attrFn ) {
jQuery.attrFn[ name ] = true;
}
});
// Prevent memory leaks in IE
// Window isn't included so as not to unbind existing unload events
// More info:
// - http://isaacschlueter.com/2006/10/msie-memory-leaks/
if ( window.attachEvent && !window.addEventListener ) {
window.attachEvent("onunload", function() {
for ( var id in jQuery.cache ) {
if ( jQuery.cache[ id ].handle ) {
// Try/Catch is to handle iframes being unloaded, see #4280
try {
jQuery.event.remove( jQuery.cache[ id ].handle.elem );
} catch(e) {}
share/static/jquery-1.4.2.js view on Meta::CPAN
return { name: elem.name, value: val };
}) :
{ name: elem.name, value: val };
}).get();
}
});
// Attach a bunch of functions for handling common AJAX events
jQuery.each( "ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "), function( i, o ) {
jQuery.fn[o] = function( f ) {
return this.bind(o, f);
};
});
jQuery.extend({
get: function( url, data, callback, type ) {
// shift arguments if data argument was omited
if ( jQuery.isFunction( data ) ) {
type = type || callback;
callback = data;
share/static/jquery.jgrowl.js view on Meta::CPAN
var self = this;
var message = notification.message;
var o = notification.options;
var notification = $(
'<div class="jGrowl-notification ui-state-highlight ui-corner-all' +
((o.group != undefined && o.group != '') ? ' ' + o.group : '') + '">' +
'<div class="close">' + o.closeTemplate + '</div>' +
'<div class="header">' + o.header + '</div>' +
'<div class="message">' + message + '</div></div>'
).data("jGrowl", o).addClass(o.theme).children('div.close').bind("click.jGrowl", function() {
$(this).parent().trigger('jGrowl.close');
}).parent();
/** Notification Actions **/
$(notification).bind("mouseover.jGrowl", function() {
$('div.jGrowl-notification', self.element).data("jGrowl.pause", true);
}).bind("mouseout.jGrowl", function() {
$('div.jGrowl-notification', self.element).data("jGrowl.pause", false);
}).bind('jGrowl.beforeOpen', function() {
if ( o.beforeOpen.apply( notification , [notification,message,o,self.element] ) != false ) {
$(this).trigger('jGrowl.open');
}
}).bind('jGrowl.open', function() {
if ( o.open.apply( notification , [notification,message,o,self.element] ) != false ) {
if ( o.glue == 'after' ) {
$('div.jGrowl-notification:last', self.element).after(notification);
} else {
$('div.jGrowl-notification:first', self.element).before(notification);
}
$(this).animate(o.animateOpen, o.speed, o.easing, function() {
// Fixes some anti-aliasing issues with IE filters.
if ($.browser.msie && (parseInt($(this).css('opacity'), 10) === 1 || parseInt($(this).css('opacity'), 10) === 0))
this.style.removeAttribute('filter');
$(this).data("jGrowl").created = new Date();
});
}
}).bind('jGrowl.beforeClose', function() {
if ( o.beforeClose.apply( notification , [notification,message,o,self.element] ) != false )
$(this).trigger('jGrowl.close');
}).bind('jGrowl.close', function() {
// Pause the notification, lest during the course of animation another close event gets called.
$(this).data('jGrowl.pause', true);
$(this).animate(o.animateClose, o.speed, o.easing, function() {
$(this).remove();
var close = o.close.apply( notification , [notification,message,o,self.element] );
if ( $.isFunction(close) )
close.apply( notification , [notification,message,o,self.element] );
});
}).trigger('jGrowl.beforeOpen');
/** Optional Corners Plugin **/
if ( $.fn.corner != undefined ) $(notification).corner( o.corners );
/** Add a Global Closer if more than one notification exists **/
if ( $('div.jGrowl-notification:parent', self.element).size() > 1 &&
$('div.jGrowl-closer', self.element).size() == 0 && this.defaults.closer != false ) {
$(this.defaults.closerTemplate).addClass('jGrowl-closer ui-state-highlight ui-corner-all').addClass(this.defaults.theme)
.appendTo(self.element).animate(this.defaults.animateOpen, this.defaults.speed, this.defaults.easing)
.bind("click.jGrowl", function() {
$(this).siblings().children('div.close').trigger("click.jGrowl");
if ( $.isFunction( self.defaults.closer ) ) {
self.defaults.closer.apply( $(this).parent()[0] , [$(this).parent()[0]] );
}
});
};
},
/** Update the jGrowl Container, removing old jGrowl notifications **/