view release on metacpan or search on metacpan
inc/Module/Install.pm view on Meta::CPAN
# is unreliable on some platforms and requires write permissions)
# for now we should catch this and refuse to run.
if ( -f $0 ) {
my $s = (stat($0))[9];
# If the modification time is only slightly in the future,
# sleep briefly to remove the problem.
my $a = $s - time;
if ( $a > 0 and $a < 5 ) { sleep 5 }
# Too far in the future, throw an error.
my $t = time;
if ( $s > $t ) { die <<"END_DIE" }
Your installer $0 has a modification time in the future ($s > $t).
This is known to create infinite loops in make.
Please correct this, then run $0 again.
END_DIE
lib/App/I18N/I18N.pm view on Meta::CPAN
# no warnings 'uninitialized';
# return $_[0] unless (length $_[0]);
#
# local $@;
# # Force stringification to stop Locale::Maketext from choking on
# # things like DateTime objects.
# my @stringified_args = map {"$_"} @_;
# my $result = eval { ${$dlh}->maketext(@stringified_args) };
# if ($@) {
# warn $@;
# # Sometimes Locale::Maketext fails to localize a string and throws
# # an exception instead. In that case, we just return the input.
# return join(' ', @stringified_args);
# }
# return $result;
# };
#
# {
# no strict 'refs';
# no warnings 'redefine';
# *_ = $loc_method;
share/static/DUI.js view on Meta::CPAN
var ns = {};
ns[name] = temp;
//Put the new class into the current one
this.namespace(ns);
},
//Iterate over a class' members, omitting built-ins
each: function(cb) {
if(!$.isFunction(cb)) {
throw new Error('DUI.Class.each must be called with a function as its first argument.');
}
//Set _this to the current class, not the DUI.Class lib itself
var _this = this;
$.each(this, function(key) {
if(_this._dontEnum.indexOf(key) != -1) return;
cb.apply(this, [key, this]);
});
share/static/DUI.js view on Meta::CPAN
/* Here we're going per-property instead of doing $.extend(extendee, this) so that
* we overwrite each property instead of the whole namespace. Also: we omit the 'namespace'
* helper method that DUI.Class tacks on, as there's no point in storing it as a super */
for(i in this) {
/* If a property is a function (other than our built-in helpers) and it already exists
* in the class, save it as a super. note that this only saves the last occurrence */
if($.isFunction(extendee[i]) && _this._dontEnum.indexOf(i) == -1) {
//since Function.name is almost never set for us, do it manually
this[i].name = extendee[i].name = i;
//throw the existing function into this.supers before it's overwritten
extendee.supers[i] = extendee[i];
}
//Special case! If 'dontEnum' is passed in as an array, add its contents to DUI.Class._dontEnum
if(i == 'dontEnum' && this[i].constructor == Array) {
extendee._dontEnum = $.merge(extendee._dontEnum, this[i]);
}
//extend the current property into our class
extendee[i] = this[i];
share/static/Stream.js view on Meta::CPAN
init: function() {
},
load: function(url) {
//These versions of XHR are known to work with MXHR
try { this.req = new ActiveXObject('MSXML2.XMLHTTP.6.0'); } catch(nope) {
try { this.req = new ActiveXObject('MSXML3.XMLHTTP'); } catch(nuhuh) {
try { this.req = new XMLHttpRequest(); } catch(noway) {
throw new Error('Could not find supported version of XMLHttpRequest.');
}
}
}
//These versions don't support readyState == 3 header requests
//try { this.req = new ActiveXObject('Microsoft.XMLHTTP'); } catch(err) {}
//try { this.req = new ActiveXObject('MSXML2.XMLHTTP.3.0'); } catch(err) {}
this.req.open('GET', url, true);
share/static/Stream.js view on Meta::CPAN
this.req.send(null);
},
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);
}
}
share/static/jquery-1.4.2.js view on Meta::CPAN
},
isEmptyObject: function( obj ) {
for ( var name in obj ) {
return false;
}
return true;
},
error: function( msg ) {
throw msg;
},
parseJSON: function( data ) {
if ( typeof data !== "string" || !data ) {
return null;
}
// Make sure leading/trailing whitespace is removed (IE can't handle it)
data = jQuery.trim( data );
share/static/jquery-1.4.2.js view on Meta::CPAN
usemap: "useMap",
frameborder: "frameBorder"
};
var expando = "jQuery" + now(), uuid = 0, windowData = {};
jQuery.extend({
cache: {},
expando:expando,
// The following elements throw uncatchable exceptions if you
// attempt to add expando properties to them.
noData: {
"embed": true,
"object": true,
"applet": true
},
data: function( elem, name, data ) {
if ( elem.nodeName && jQuery.noData[elem.nodeName.toLowerCase()] ) {
return;
share/static/jquery-1.4.2.js view on Meta::CPAN
var parent = elem.parentNode || elem.ownerDocument;
// Trigger an inline bound script
try {
if ( !(elem && elem.nodeName && jQuery.noData[elem.nodeName.toLowerCase()]) ) {
if ( elem[ "on" + type ] && elem[ "on" + type ].apply( elem, data ) === false ) {
event.result = false;
}
}
// prevent IE from throwing an error for some elements with some event types, see #3533
} catch (e) {}
if ( !event.isPropagationStopped() && parent ) {
jQuery.event.trigger( event, data, parent, true );
} else if ( !event.isDefaultPrevented() ) {
var target = event.target, old,
isClick = jQuery.nodeName(target, "a") && type === "click",
special = jQuery.event.special[ type ] || {};
share/static/jquery-1.4.2.js view on Meta::CPAN
old = target[ "on" + type ];
if ( old ) {
target[ "on" + type ] = null;
}
jQuery.event.triggered = true;
target[ type ]();
}
// prevent IE from throwing an error for some elements with some event types, see #3533
} catch (e) {}
if ( old ) {
target[ "on" + type ] = old;
}
jQuery.event.triggered = false;
}
}
},
share/static/jquery-1.4.2.js view on Meta::CPAN
}
}
old = expr;
}
return curLoop;
};
Sizzle.error = function( msg ) {
throw "Syntax error, unrecognized expression: " + msg;
};
var Expr = Sizzle.selectors = {
order: [ "ID", "NAME", "TAG" ],
match: {
ID: /#((?:[\w\u00c0-\uFFFF-]|\\.)+)/,
CLASS: /\.((?:[\w\u00c0-\uFFFF-]|\\.)+)/,
NAME: /\[name=['"]*((?:[\w\u00c0-\uFFFF-]|\\.)+)['"]*\]/,
ATTR: /\[\s*((?:[\w\u00c0-\uFFFF-]|\\.)+)\s*(?:(\S?=)\s*(['"]*)(.*?)\3|)\s*\]/,
TAG: /^((?:[\w\u00c0-\uFFFF\*-]|\\.)+)/,
share/static/jquery-1.4.2.js view on Meta::CPAN
try {
for ( var i = 0, l = this.length; i < l; i++ ) {
// Remove element nodes and prevent memory leaks
if ( this[i].nodeType === 1 ) {
jQuery.cleanData( this[i].getElementsByTagName("*") );
this[i].innerHTML = value;
}
}
// If using innerHTML throws an exception, use the fallback method
} catch(e) {
this.empty().append( value );
}
} else if ( jQuery.isFunction( value ) ) {
this.each(function(i){
var self = jQuery(this), old = self.html();
self.empty().append(function(){
return value.call( this, i, old );
});
share/static/jquery.ev.js view on Meta::CPAN
*
*/
loop: function(url, handlers) {
var self = this;
if (handlers) {
if (typeof handlers == "object") {
this.handlers = handlers;
} else if (typeof handlers == "function") {
this.run = handlers;
} else {
throw("handlers must be an object or function");
}
}
this.running = true;
this.xhr = $.ajax({
type : 'GET',
dataType : 'json',
url : url,
timeout : self.timeout,
cache : false,
success : function(messages, status) {