Latest repo

This commit is contained in:
Marc
2025-06-02 16:42:16 +00:00
parent 53ddf1a329
commit cde5fae175
27907 changed files with 3875388 additions and 1 deletions

80
node_modules/globalize/examples/browser/browser.css generated vendored Normal file
View File

@@ -0,0 +1,80 @@
body {
font-family: Arial
}
a {
color: #6D929B;
}
input {
width: 100px;
margin: 5px;
}
.results {
border-collapse: collapse;
}
.results td {
border: 1px solid #C1DAD7;
padding: 2px 2px 2px 2px;
color: #6D929B;
font-size: x-small;
white-space: nowrap;
text-align: center;
}
.results th {
border: 1px solid #C1DAD7;
letter-spacing: 2px;
text-align: center;
padding: 6px 6px 6px 12px;
white-space: nowrap;
}
table {
width: 100%;
}
fieldset.info {
width: 45%;
float: left;
}
.info td {
font-size: x-small;
}
.tab {
margin-top: 5px;
margin-right: 5px;
padding: 2px;
cursor: pointer;
background-color: #EEEEEE;
}
.active {
border: 1px solid black;
float: left;
}
.inactive {
float: left;
}
.tab.active {
font-weight: bold;
border: 1px solid black;
float: left;
}
div.inactive {
display: none;
}
div.active {
clear: both;
min-width: 100%;
}
.pane {
margin-top: 10px;
clear: both;
}
#intro {
font-size: x-small;
margin-bottom: 10px;
}

115
node_modules/globalize/examples/browser/browser.js generated vendored Normal file
View File

@@ -0,0 +1,115 @@
(function( $ ) {
$(function() {
// setup sample data
window.numbers = [
0, 1, 10, 100, 1000, 10000, 0.1, 0.12, 0.123, 0.1234, 0.12345, 1000.123, 10000.12345,
-1, -10, -100, -1000, -10000, -0.1, -0.12, -0.123, -0.1234, -0.12345, -1000.123, -10000.12345
];
window.formats = [
"n", "n1", "n3", "d", "d2", "d3", "p", "p1", "p3", "c", "c0"
];
window.dates = $.map([
"Jan 1, 1970 1:34 PM", "Dec 31, 1970 1:34 PM", "Apr 1, 1999 1:34 PM", "Dec 31, 1999 1:34 PM", "Jan 1, 2000 1:34 PM", "Nov 5, 1955 1:34 PM"
], function(d) { return d instanceof Date ? d : new Date(Date.parse(d)); } );
window.dateFormats = [
"d", "D", "f", "F", "M", "S", "t", "T", "Y"
];
// add template extensions to format numbers and dates declaratively
$.extend( $.tmplcmd, {
demoFormat: {
_default: [0,0],
prefix: "_.push(Globalize.format(numbers[$2],formats[$1]));"
},
demoDateFormat: {
_default: [0,0],
prefix: "_.push(Globalize.format(dates[$2],typeof $1 === 'number' ? dateFormats[$1] : $1));"
}
});
// activate tabs
$(".tab").click(function() {
$(".active").removeClass("active").addClass("inactive");
$("#" + this.id + "content").removeClass("inactive").addClass("active");
$(this).removeClass("inactive").addClass("active");
});
// fill cultures dropdown with the available cultures
$.each(sortByName(Globalize.cultures), function(i, culture) {
$("<option/>", {
value: culture.name,
text: culture.name + ": " + culture.englishName + " (" + culture.nativeName + ")"
}).appendTo("#cultures");
});
// re-render templates after selecting a culture
$("#cultures").bind("change keyup", selectCulture)
// set default culture to Japanese in Japan
.val("ja-JP");
// re-render templates after selecting a calendar
var calendars = $("#calendars").bind("change keyup", function() {
Globalize.culture().calendar = Globalize.culture().calendars[calendars.val()] || Globalize.culture().calendars.standard;
render();
});
$("#parseDate").change(function() {
$("#parseDateResult").text(Globalize.parseDate($(this).val()).toString());
});
$("#parseNumber").change(function() {
$("#parseNumberResult").text(Globalize.parseFloat($(this).val()).toString());
});
function sortByName(map) {
// converts a dictionary into a sorted dictionary based on obj.name
var arr = [];
$.each(map, function(name, value) {
arr.push(value);
});
arr.sort(function(a, b) {
return a.name < b.name ? -1 : 1;
});
return arr;
}
function selectCulture() {
// sets the current culture to the value specified in the cultures dropdown,
// populates the calendars dropdown with that cultures calendars,
// and renders the formatting templates.
Globalize.culture($("#cultures").val());
calendars.empty();
$.each(sortByName(Globalize.culture().calendars), function(i, cal) {
$("<option/>", { value: cal.name, text: cal.name }).appendTo(calendars);
});
calendars.val(Globalize.culture().calendar.name);
render();
}
function render() {
$("#dateformat").empty();
$("#dateformattmpl").render({}).appendTo("#dateformat");
$("#format").empty();
$("#formattmpl").render({}).appendTo("#format");
$("#englishName").text(Globalize.culture().englishName);
$("#nativeName").text(Globalize.culture().nativeName);
$("#isRTL").text(Globalize.culture().isRTL ? "YES" : "no");
$("#infonumber").empty();
$("#infonumbertmpl").render(Globalize.culture().numberFormat).appendTo("#infonumber");
$("#infodate").empty();
$("#infodatetmpl").render(Globalize.culture().calendar).appendTo("#infodate");
}
// initial rendering
selectCulture();
});
}( jQuery ));

265
node_modules/globalize/examples/browser/index.html generated vendored Normal file
View File

@@ -0,0 +1,265 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Globalization Demo</title>
<link type="text/css" rel="Stylesheet" href="browser.css">
<script src="../../lib/globalize.js"></script>
<script src="../../lib/cultures/globalize.cultures.js"></script>
<script src="jquery-1.4.4.js"></script>
<script src="jquery.tmpl.js"></script>
<script src="browser.js"></script>
<script id="formattmpl" type="text/x-jquery-tmpl">
<tr>
<th>Number</th>
{{each formats}}
<th>{{=}}</th>
{{/each}}
</tr>
{{each(i) numbers}}
<tr class="result">
<td>
${numbers[i]}
</td>
{{each(j) formats}}
<td>
{{demoFormat(i) j}}
</td>
{{/each}}
</tr>
{{/each}}
</script>
<script id="dateformattmpl" type="text/x-jquery-tmpl">
<tr>
<th>Date</th>
{{each dateFormats}}
<th>{{=}}</th>
{{/each}}
</tr>
{{each(i) dates}}
<tr class="result">
<td>
{{=}}
</td>
{{each(j) dateFormats}}
<td>
{{demoDateFormat(i) j}}
</td>
{{/each}}
</tr>
{{/each}}
</script>
<script id="infonumbertmpl" type="text/x-jquery-tmpl">
<legend>Number Formatting</legend>
<table class="info">
<tr>
<td>Pattern</td>
<td>${pattern}</td>
<td>Decimals</td>
<td>${decimals} (${$data['.']})</td>
</tr>
<tr>
<td>Grouping</td>
<td>${$data[',']}</td>
<td>Group Size</td>
<td>${groupSizes}</td>
</tr>
<tr>
<td>Positive</td>
<td>${$data['+']}</td>
<td>Negative</td>
<td>${$data['-']}</td>
</tr>
<tr>
<td colspan="4" align="center">Percent (symbol = ${percent.symbol})</td>
</tr>
<tr>
<td>Pattern</td>
<td>${percent.pattern}</td>
<td>Decimals</td>
<td>${percent.decimals} (${percent['.']})</td>
</tr>
<tr>
<td>Grouping</td>
<td>${percent[',']}</td>
<td>Group Size</td>
<td>${percent.groupSizes}</td>
</tr>
<tr>
<td colspan="4" align="center">Currency (symbol = ${currency.symbol})</td>
</tr>
<tr>
<td>Pattern</td>
<td>${currency.pattern}</td>
<td>Decimals</td>
<td>${currency.decimals} (${currency['.']})</td>
</tr>
<tr>
<td>Grouping</td>
<td>${currency[',']}</td>
<td>Group Size</td>
<td>${currency.groupSizes}</td>
</tr>
</table>
</script>
<script id="infodatetmpl" type="text/x-jquery-tmpl">
<legend>Date Formatting</legend>
<table class="info">
<tr>
<td>Name</td>
<td colspan="3">${name}</td>
</tr>
<tr>
<td>AM</td>
<td>${AM}</td>
<td>PM</td>
<td>${PM}</td>
</tr>
<tr>
<td>Eras</td>
<td colspan="3">
<ol>
{{each eras}}
<li>${name} (year offset ${offset})</li>
{{/each}}
</ol>
</td>
</tr>
<tr>
<td>Days</td>
<td colspan="3">
<ol>
{{each days.names}}
<li>{{=}}</li>
{{/each}}
</ol>
</td>
</tr>
<tr>
<td>Days (abbreviated)</td>
<td colspan="3">
<ol>
{{each days.namesAbbr}}
<li>{{=}}</li>
{{/each}}
</ol>
</td>
</tr>
<tr>
<td>Days (shortest)</td>
<td colspan="3">
<ol>
{{each days.namesShort}}
<li>{{=}}</li>
{{/each}}
</ol>
</td>
</tr>
<tr>
<td>Months</td>
<td colspan="3">
<ol>
{{each months.names}}
<li>{{=}}</li>
{{/each}}
</ol>
</td>
</tr>
<tr>
<td>Months (abbreviated)</td>
<td colspan="3">
<ol>
{{each months.namesAbbr}}
<li>{{=}}</li>
{{/each}}
</ol>
</td>
</tr>
{{if typeof monthsGenitive !== 'undefined'}}
<tr>
<td>Months (Genitive)</td>
<td>${monthsGenitive.names}</td>
<td>Months (Abbr. Gen.)</td>
<td>${monthsGenitive.namesAbbr}</td>
</tr>
{{/if}}
<tr>
<td align="center" colspan="4">Patterns</td>
</tr>
{{each(n,v) patterns}}
<tr>
<td>${n}</td>
<td colspan="3">{{=}}</td>
</tr>
{{/each}}
</table>
</script>
</head>
<body>
<div id="intro">
This is a demo of the Globalize library. You can follow the discussion and provide feedback on the planning page, here:
<br/><a href="http://wiki.jqueryui.com/Globalization">Globalization wiki page</a>
<br/>
And you can view the source from here or keep up to date with it on github, here:
<br/><a href="https://github.com/jquery/globalize/">Globalize on GitHub</a>
</div>
<div>
Culture:
<select id="cultures"></select>
</div>
<div>
Calendar:
<select id="calendars"></select>
</div>
<div class="pane">
<span class="tab active" id="dates">Dates</span>
<span class="tab inactive" id="numbers">Numbers</span>
<span class="tab inactive" id="info">Info</span>
<div id="datescontent" class="active">
<table id="dateformat" class="results">
</table>
<b>Parsing:</b> Type a date in one of the culture formats:
<input id="parseDate" type="text" /><span id="parseDateResult"></span>
</div>
<div id="numberscontent" class="inactive">
<table id="format" class="results">
</table>
<b>Parsing:</b> Type a number using the culture group and decimal separators:
<input id="parseNumber" type="text" /><span id="parseNumberResult"></span>
</div>
<div id="infocontent" class="inactive">
<p>
Name (in English) "<span id="englishName"></span>"<br />
Name (in Native Language) "<span id="nativeName"></span>".<br />
Is RTL culture? <span id="isRTL"></span>.
</p>
<fieldset id="infonumber" class="info">
</fieldset>
<fieldset id="infodate" class="info">
</fieldset>
</div>
</div>
<div class="pane">
Interesting cultures to preview:
<ul>
<li>ja-JP: Has an optional calendar that has 4 different eras.</li>
<li>th-TH: Standard calendar has a year offset.</li>
<li>te-IN: Numbers have unequal groupings.</li>
<li>ar-SA: Standard calendar is UmAlQura, a non-gregorian based calendar that requires custom conversion logic.
It also supports the Hijri calendar, and a standard gregorian calendar translated into one of <i>4 languages</i>.
</li>
</ul>
</div>
</body>
</html>

7179
node_modules/globalize/examples/browser/jquery-1.4.4.js generated vendored Normal file

File diff suppressed because it is too large Load Diff

131
node_modules/globalize/examples/browser/jquery.tmpl.js generated vendored Normal file
View File

@@ -0,0 +1,131 @@
/*
* jQuery Templating Plugin
* NOTE: Created for demonstration purposes.
* Copyright 2010, John Resig
* Dual licensed under the MIT or GPL Version 2 licenses.
*/
(function(jQuery){
// Override the DOM manipulation function
var oldManip = jQuery.fn.domManip;
jQuery.fn.extend({
render: function( data ) {
return this.map(function(i, tmpl){
return jQuery.render( tmpl, data );
});
},
// This will allow us to do: .append( "template", dataObject )
domManip: function( args ) {
// This appears to be a bug in the appendTo, etc. implementation
// it should be doing .call() instead of .apply(). See #6227
if ( args.length > 1 && args[0].nodeType ) {
arguments[0] = [ jQuery.makeArray(args) ];
}
if ( args.length === 2 && typeof args[0] === "string" && typeof args[1] !== "string" ) {
arguments[0] = [ jQuery.render( args[0], args[1] ) ];
}
return oldManip.apply( this, arguments );
}
});
jQuery.extend({
render: function( tmpl, data ) {
var fn;
// Use a pre-defined template, if available
if ( jQuery.templates[ tmpl ] ) {
fn = jQuery.templates[ tmpl ];
// We're pulling from a script node
} else if ( tmpl.nodeType ) {
var node = tmpl, elemData = jQuery.data( node );
fn = elemData.tmpl || jQuery.tmpl( node.innerHTML );
}
fn = fn || jQuery.tmpl( tmpl );
// We assume that if the template string is being passed directly
// in the user doesn't want it cached. They can stick it in
// jQuery.templates to cache it.
if ( jQuery.isArray( data ) ) {
return jQuery.map( data, function( data, i ) {
return fn.call( data, jQuery, data, i );
});
} else {
return fn.call( data, jQuery, data, 0 );
}
},
// You can stick pre-built template functions here
templates: {},
/*
* For example, someone could do:
* jQuery.templates.foo = jQuery.tmpl("some long templating string");
* $("#test").append("foo", data);
*/
tmplcmd: {
each: {
_default: [ null, "$i" ],
prefix: "jQuery.each($1,function($2){with(this){",
suffix: "}});"
},
"if": {
prefix: "if($1){",
suffix: "}"
},
"else": {
prefix: "}else{"
},
html: {
prefix: "_.push(typeof $1==='function'?$1.call(this):$1);"
},
"=": {
_default: [ "this" ],
prefix: "_.push($.encode(typeof $1==='function'?$1.call(this):$1));"
}
},
encode: function( text ) {
return text != null ? document.createTextNode( text.toString() ).nodeValue : "";
},
tmpl: function(str, data, i) {
// Generate a reusable function that will serve as a template
// generator (and which will be cached).
var fn = new Function("jQuery","$data","$i",
"var $=jQuery,_=[];_.data=$data;_.index=$i;" +
// Introduce the data as local variables using with(){}
"with($data){_.push('" +
// Convert the template into pure JavaScript
str
.replace(/[\r\t\n]/g, " ")
.replace(/\${([^}]*)}/g, "{{= $1}}")
.replace(/{{(\/?)(\w+|.)(?:\((.*?)\))?(?: (.*?))?}}/g, function(all, slash, type, fnargs, args) {
var tmpl = jQuery.tmplcmd[ type ];
if ( !tmpl ) {
throw "Template not found: " + type;
}
var def = tmpl._default;
return "');" + tmpl[slash ? "suffix" : "prefix"]
.split("$1").join(args || (def?def[0]:null))
.split("$2").join(fnargs || (def?def[1]:null)) + "_.push('";
})
+ "');}return $(_.join('')).get();");
// Provide some basic currying to the user
return data ? fn.call( this, jQuery, data, i ) : fn;
}
});
})(jQuery);