mirror of
https://git.tt-rss.org/git/tt-rss.git
synced 2025-12-20 13:21:31 +00:00
upgrade Dojo to 1.6.1
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
Copyright (c) 2004-2010, The Dojo Foundation All Rights Reserved.
|
||||
Copyright (c) 2004-2011, The Dojo Foundation All Rights Reserved.
|
||||
Available via Academic Free License >= 2.1 OR the modified BSD license.
|
||||
see: http://dojotoolkit.org/license for details
|
||||
*/
|
||||
@@ -8,12 +8,12 @@
|
||||
if(!dojo._hasResource["dojo.number"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
|
||||
dojo._hasResource["dojo.number"] = true;
|
||||
dojo.provide("dojo.number");
|
||||
|
||||
dojo.require("dojo.i18n");
|
||||
dojo.requireLocalization("dojo.cldr", "number", null, "ROOT,ar,ca,cs,da,de,el,en,en-au,en-gb,es,fi,fr,he,hu,it,ja,ko,nb,nl,pl,pt,pt-pt,ru,sk,sl,sv,th,tr,zh");
|
||||
dojo.requireLocalization("dojo.cldr", "number", null, "ROOT,ar,ca,cs,da,de,el,en,en-au,en-gb,es,fi,fr,fr-ch,he,hu,it,ja,ko,nb,nl,pl,pt,pt-pt,ro,ru,sk,sl,sv,th,tr,zh,zh-hant,zh-hk");
|
||||
dojo.require("dojo.string");
|
||||
dojo.require("dojo.regexp");
|
||||
|
||||
dojo.getObject("number", true, dojo);
|
||||
|
||||
/*=====
|
||||
dojo.number = {
|
||||
@@ -118,7 +118,7 @@ dojo.number._applyPattern = function(/*Number*/value, /*String*/pattern, /*dojo.
|
||||
if(options.fractional === false){ options.places = 0; }
|
||||
return pattern.replace(numberPatternRE,
|
||||
dojo.number._formatAbsolute(value, numberPattern[0], {decimal: decimal, group: group, places: options.places, round: options.round}));
|
||||
}
|
||||
};
|
||||
|
||||
dojo.number.round = function(/*Number*/value, /*Number?*/places, /*Number?*/increment){
|
||||
// summary:
|
||||
@@ -144,7 +144,7 @@ dojo.number.round = function(/*Number*/value, /*Number?*/places, /*Number?*/incr
|
||||
// 10.75
|
||||
var factor = 10 / (increment || 10);
|
||||
return (factor * +value).toFixed(places) / factor; // Number
|
||||
}
|
||||
};
|
||||
|
||||
if((0.9).toFixed() == 0){
|
||||
// (isIE) toFixed() bug workaround: Rounding fails on IE when most significant digit
|
||||
@@ -157,7 +157,7 @@ if((0.9).toFixed() == 0){
|
||||
d = 0;
|
||||
}
|
||||
return round(v, p, m) + (v > 0 ? d : -d);
|
||||
}
|
||||
};
|
||||
})();
|
||||
}
|
||||
|
||||
@@ -180,7 +180,7 @@ dojo.number.__FormatAbsoluteOptions = function(){
|
||||
=====*/
|
||||
|
||||
dojo.number._formatAbsolute = function(/*Number*/value, /*String*/pattern, /*dojo.number.__FormatAbsoluteOptions?*/options){
|
||||
// summary:
|
||||
// summary:
|
||||
// Apply numeric pattern to absolute value using options. Gives no
|
||||
// consideration to local customs.
|
||||
// value:
|
||||
@@ -295,7 +295,7 @@ dojo.number.regexp = function(/*dojo.number.__RegexpOptions?*/options){
|
||||
// Returns regular expression with positive and negative match, group
|
||||
// and decimal separators
|
||||
return dojo.number._parseInfo(options).regexp; // String
|
||||
}
|
||||
};
|
||||
|
||||
dojo.number._parseInfo = function(/*Object?*/options){
|
||||
options = options || {};
|
||||
@@ -383,7 +383,7 @@ dojo.number._parseInfo = function(/*Object?*/options){
|
||||
|
||||
// normalize whitespace and return
|
||||
return {regexp: re.replace(/[\xa0 ]/g, "[\\s\\xa0]"), group: group, decimal: decimal, factor: factor}; // Object
|
||||
}
|
||||
};
|
||||
|
||||
/*=====
|
||||
dojo.number.__ParseOptions = function(){
|
||||
@@ -494,10 +494,10 @@ dojo.number._realNumberRegexp = function(/*dojo.number.__RealNumberRegexpFlags?*
|
||||
var re = "";
|
||||
if(q && (flags.places!==0)){
|
||||
re = "\\" + flags.decimal;
|
||||
if(flags.places == Infinity){
|
||||
re = "(?:" + re + "\\d+)?";
|
||||
if(flags.places == Infinity){
|
||||
re = "(?:" + re + "\\d+)?";
|
||||
}else{
|
||||
re += "\\d{" + flags.places + "}";
|
||||
re += "\\d{" + flags.places + "}";
|
||||
}
|
||||
}
|
||||
return re;
|
||||
@@ -506,9 +506,9 @@ dojo.number._realNumberRegexp = function(/*dojo.number.__RealNumberRegexpFlags?*
|
||||
);
|
||||
|
||||
var exponentRE = dojo.regexp.buildGroupRE(flags.exponent,
|
||||
function(q){
|
||||
function(q){
|
||||
if(q){ return "([eE]" + dojo.number._integerRegexp({ signed: flags.eSigned}) + ")"; }
|
||||
return "";
|
||||
return "";
|
||||
}
|
||||
);
|
||||
|
||||
@@ -540,7 +540,7 @@ dojo.number.__IntegerRegexpFlags = function(){
|
||||
=====*/
|
||||
|
||||
dojo.number._integerRegexp = function(/*dojo.number.__IntegerRegexpFlags?*/flags){
|
||||
// summary:
|
||||
// summary:
|
||||
// Builds a regular expression that matches an integer
|
||||
|
||||
// assign default values to missing parameters
|
||||
@@ -579,6 +579,6 @@ dojo.number._integerRegexp = function(/*dojo.number.__IntegerRegexpFlags?*/flags
|
||||
);
|
||||
|
||||
return signRE + numberRE; // String
|
||||
}
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user