Skip to content

Commit

Permalink
Merge branch 'master' into grid
Browse files Browse the repository at this point in the history
  • Loading branch information
jzaefferer committed Nov 18, 2011
2 parents 19738d1 + 66f9e12 commit 121a2ea
Show file tree
Hide file tree
Showing 32 changed files with 322 additions and 74 deletions.
2 changes: 1 addition & 1 deletion build/build.xml
Expand Up @@ -320,7 +320,7 @@
<echo message="Comparing file size with previous build" />
<exec executable="bash">
<arg value="-c" />
<arg value="wc -c ${size.dir}/* | `which node nodejs` build/sizer.js" />
<arg value="wc -c ${size.dir}/* | `which node nodejs 2>/dev/null` build/sizer.js" />
</exec>
<delete dir="${size.dir}" />
</target>
Expand Down
2 changes: 1 addition & 1 deletion build/build/minify-js.sh
@@ -1,3 +1,3 @@
#!/bin/bash
dir=$(dirname $0)
`which node nodejs` $dir/uglify.js $1 > $2
`which node nodejs 2> /dev/null` $dir/uglify.js $1 > $2
2 changes: 1 addition & 1 deletion demos/accordion/custom-icons.html
Expand Up @@ -20,7 +20,7 @@
icons: icons
});
$( "#toggle" ).button().toggle(function() {
$( "#accordion" ).accordion( "option", "icons", false );
$( "#accordion" ).accordion( "option", "icons", null );
}, function() {
$( "#accordion" ).accordion( "option", "icons", icons );
});
Expand Down
2 changes: 1 addition & 1 deletion demos/accordion/hoverintent.html
Expand Up @@ -29,7 +29,6 @@
$( this ).unbind( "mouseover", jQuery.event.special.hoverintent.handler );
},
handler: function( event ) {
event.type = "hoverintent";
var self = this,
args = arguments,
target = $( event.target ),
Expand All @@ -50,6 +49,7 @@
function handler() {
if ( ( Math.abs( pX - cX ) + Math.abs( pY - cY ) ) < cfg.sensitivity ) {
clear();
event.type = "hoverintent";
jQuery.event.handle.apply( self, args );
} else {
pX = cX;
Expand Down
8 changes: 8 additions & 0 deletions demos/datepicker/localization.html
Expand Up @@ -16,6 +16,7 @@
<script src="../../ui/i18n/jquery.ui.datepicker-bs.js"></script>
<script src="../../ui/i18n/jquery.ui.datepicker-ca.js"></script>
<script src="../../ui/i18n/jquery.ui.datepicker-cs.js"></script>
<script src="../../ui/i18n/jquery.ui.datepicker-cy-GB.js"></script>
<script src="../../ui/i18n/jquery.ui.datepicker-da.js"></script>
<script src="../../ui/i18n/jquery.ui.datepicker-de.js"></script>
<script src="../../ui/i18n/jquery.ui.datepicker-el.js"></script>
Expand All @@ -42,11 +43,14 @@
<script src="../../ui/i18n/jquery.ui.datepicker-ja.js"></script>
<script src="../../ui/i18n/jquery.ui.datepicker-kk.js"></script>
<script src="../../ui/i18n/jquery.ui.datepicker-ko.js"></script>
<script src="../../ui/i18n/jquery.ui.datepicker-lb.js"></script>
<script src="../../ui/i18n/jquery.ui.datepicker-lt.js"></script>
<script src="../../ui/i18n/jquery.ui.datepicker-lv.js"></script>
<script src="../../ui/i18n/jquery.ui.datepicker-mk.js"></script>
<script src="../../ui/i18n/jquery.ui.datepicker-ml.js"></script>
<script src="../../ui/i18n/jquery.ui.datepicker-ms.js"></script>
<script src="../../ui/i18n/jquery.ui.datepicker-nl.js"></script>
<script src="../../ui/i18n/jquery.ui.datepicker-nl-BE.js"></script>
<script src="../../ui/i18n/jquery.ui.datepicker-no.js"></script>
<script src="../../ui/i18n/jquery.ui.datepicker-pl.js"></script>
<script src="../../ui/i18n/jquery.ui.datepicker-pt.js"></script>
Expand Down Expand Up @@ -103,6 +107,7 @@
<option value="hr">Croatian (Hrvatski jezik)</option>
<option value="cs">Czech (&#269;e&#353;tina)</option>
<option value="da">Danish (Dansk)</option>
<option value="nl-BE">Dutch (Belgium)</option>
<option value="nl">Dutch (Nederlands)</option>
<option value="en-AU">English/Australia</option>
<option value="en-NZ">English/New Zealand</option>
Expand All @@ -127,6 +132,8 @@
<option value="ko">Korean (&#54620;&#44397;&#50612;)</option>
<option value="lv">Latvian (Latvie&ouml;u Valoda)</option>
<option value="lt">Lithuanian (lietuviu kalba)</option>
<option value="lb">Luxembourgish</option>
<option value="mk">Macedonian</option>
<option value="ml">Malayalam</option>
<option value="ms">Malaysian (Bahasa Malaysia)</option>
<option value="no">Norwegian (Norsk)</option>
Expand All @@ -148,6 +155,7 @@
<option value="tr">Turkish (T&uuml;rk&ccedil;e)</option>
<option value="uk">Ukranian (&#1059;&#1082;&#1088;&#1072;&#1111;&#1085;&#1089;&#1100;&#1082;&#1072;)</option>
<option value="vi">Vietnamese (Ti&#7871;ng Vi&#7879;t)</option>
<option value="cy-GB">Welsh/UK (Cymraeg)</option>
</select></p>

</div><!-- End demo -->
Expand Down
4 changes: 4 additions & 0 deletions demos/index.html
Expand Up @@ -52,6 +52,7 @@
<script src="../ui/i18n/jquery.ui.datepicker-bg.js"></script>
<script src="../ui/i18n/jquery.ui.datepicker-ca.js"></script>
<script src="../ui/i18n/jquery.ui.datepicker-cs.js"></script>
<script src="../ui/i18n/jquery.ui.datepicker-cy-GB.js"></script>
<script src="../ui/i18n/jquery.ui.datepicker-da.js"></script>
<script src="../ui/i18n/jquery.ui.datepicker-de.js"></script>
<script src="../ui/i18n/jquery.ui.datepicker-el.js"></script>
Expand All @@ -78,11 +79,14 @@
<script src="../ui/i18n/jquery.ui.datepicker-ja.js"></script>
<script src="../ui/i18n/jquery.ui.datepicker-kk.js"></script>
<script src="../ui/i18n/jquery.ui.datepicker-ko.js"></script>
<script src="../ui/i18n/jquery.ui.datepicker-lb.js"></script>
<script src="../ui/i18n/jquery.ui.datepicker-lt.js"></script>
<script src="../ui/i18n/jquery.ui.datepicker-lv.js"></script>
<script src="../ui/i18n/jquery.ui.datepicker-mk.js"></script>
<script src="../ui/i18n/jquery.ui.datepicker-ml.js"></script>
<script src="../ui/i18n/jquery.ui.datepicker-ms.js"></script>
<script src="../ui/i18n/jquery.ui.datepicker-nl.js"></script>
<script src="../ui/i18n/jquery.ui.datepicker-nl-BE.js"></script>
<script src="../ui/i18n/jquery.ui.datepicker-no.js"></script>
<script src="../ui/i18n/jquery.ui.datepicker-pl.js"></script>
<script src="../ui/i18n/jquery.ui.datepicker-pt.js"></script>
Expand Down
4 changes: 1 addition & 3 deletions demos/spinner/currency.html
Expand Up @@ -17,9 +17,7 @@
<script>
$(function() {
$( "#currency" ).change(function() {
var current = $( "#spinner" ).spinner( "value" );
Globalize.culture( $(this).val() );
$( "#spinner" ).spinner( "value", current );
$( "#spinner" ).spinner( "option", "culture", $( this ).val() );
});

$( "#spinner" ).spinner({
Expand Down
111 changes: 111 additions & 0 deletions demos/tooltip/custom-style.html
@@ -0,0 +1,111 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>jQuery UI Tooltip - Default functionality</title>
<link rel="stylesheet" href="../../themes/base/jquery.ui.tooltip.css">
<script src="../../jquery-1.7.js"></script>
<script src="../../ui/jquery.ui.core.js"></script>
<script src="../../ui/jquery.ui.widget.js"></script>
<script src="../../ui/jquery.ui.position.js"></script>
<script src="../../ui/jquery.ui.tooltip.js"></script>
<link rel="stylesheet" href="../demos.css">
<script>
$(function() {
$( ".demo" ).tooltip({
open: function(event, ui) {
$("<div>").addClass("arrow").appendTo(ui.tooltip);
},
position: {
my: "center bottom",
at: "center top",
offset: "0 -20px"
}
});
});
</script>
<style>
label {
display: inline-block;
width: 5em;
}
.demo {
margin: 10em 0 0 10em;
}
.ui-tooltip, .arrow:after {
background: black;
border: 2px solid white;
}
.ui-tooltip {
display: inline-block;
position: relative;
padding: 10px 20px;
color: white;
border-radius: 20px;
text-align: center;
font: bold 14px "Helvetica Neue", Sans-Serif;
font-stretch: condensed;
text-decoration: none;
text-transform: uppercase;
box-shadow: 0 0 7px black;
}
.arrow {
width: 70px;
height: 16px;
overflow: hidden;
position: absolute;
left: 50%;
margin-left: -35px;
bottom: -16px;
}
.arrow:after {
content: "";
position: absolute;
left: 20px;
top: -20px;
width: 25px;
height: 25px;
-webkit-box-shadow: 6px 5px 9px -9px black,
5px 6px 9px -9px black;
-moz-box-shadow: 6px 5px 9px -9px black,
5px 6px 9px -9px black;
box-shadow: 6px 5px 9px -9px black,
5px 6px 9px -9px black;
-webkit-transform: rotate(45deg);
-moz-transform: rotate(45deg);
-ms-transform: rotate(45deg);
-o-transform: rotate(45deg);
}
div[data-tooltip].active {
opacity: 1;
margin-top: 6px;
}
div[data-tooltip].out {
opacity: 0;
margin-top: -20px;
}
</style>
</head>
<body>

<div class="demo">

<p><a href="#" title="That's what this widget is">Tooltips</a> can be attached to any element. When you hover
the element with your mouse, the title attribute is displayed in a little box next to the element, just like a native tooltip.</p>
<p>But as it's not a native tooltip, it can be styled. Any themes built with
<a href="http://themeroller.com" title="ThemeRoller: jQuery UI's theme builder application">ThemeRoller</a>
will also style tooltips accordingly.</p>
<p>Tooltips are also useful for form elements, to show some additional information in the context of each field.</p>
<p><label for="age">Your age:</label><input id="age" title="We ask for your age only for statistical purposes."></p>
<p>Hover the field to see the tooltip.</p>

</div><!-- End demo -->



<div class="demo-description">
<p>Hover the links above or use the tab key to cycle the focus on each element.</p>
</div><!-- End demo-description -->

</body>
</html>
1 change: 1 addition & 0 deletions demos/tooltip/index.html
Expand Up @@ -11,6 +11,7 @@
<h4>Examples</h4>
<ul>
<li class="demo-config-on"><a href="default.html">Default functionality</a></li>
<li><a href="custom-style.html">Custom style with arrow</a></li>
<li><a href="forms.html">Forms with tooltips</a></li>
<li><a href="tracking.html">Track the mouse</a></li>
<li><a href="custom-animation.html">Custom animation</a></li>
Expand Down
4 changes: 2 additions & 2 deletions demos/widget/default.html
Expand Up @@ -106,7 +106,7 @@
// always refresh when changing options
_setOptions: function() {
// _super and _superApply handle keeping the right this-context
this._superApply( "_setOptions", arguments );
this._superApply( arguments );
this._refresh();
},

Expand All @@ -116,7 +116,7 @@
if ( /red|green|blue/.test(key) && (value < 0 || value > 255) ) {
return;
}
this._super( "_setOption", key, value );
this._super( key, value );
}
});

Expand Down
19 changes: 19 additions & 0 deletions tests/unit/spinner/spinner_options.js
Expand Up @@ -96,6 +96,14 @@ test( "numberFormat, currency", function() {
equal( element.val(), "$1.00", "formatted after step" );
});

test( "numberFormat, change", function() {
expect( 2 );
var element = $( "#spin" ).val( 5 ).spinner({ numberFormat: "n1" });
equal( element.val(), "5.0", "formatted on init" );
element.spinner( "option", "numberFormat", "c" );
equal( element.val(), "$5.00", "formatted after change" );
});

test( "culture, null", function() {
expect( 2 );
Globalize.culture( "ja-JP" );
Expand All @@ -119,6 +127,17 @@ test( "currency, ja-JP", function() {
equal( element.val(), "¥1", "formatted after step" );
});

test( "currency, change", function() {
expect( 2 );
var element = $( "#spin" ).val( 5 ).spinner({
numberFormat: "C",
culture: "ja-JP"
});
equal( element.val(), "¥5", "formatted on init" );
element.spinner( "option", "culture", "en" );
equal( element.val(), "$5.00", "formatted after change" );
});

test( "max", function() {
expect( 3 );
var element = $( "#spin" ).val( 1000 ).spinner({ max: 100 });
Expand Down
10 changes: 5 additions & 5 deletions tests/unit/widget/widget_core.js
Expand Up @@ -346,15 +346,15 @@ test( "._super()", function() {
same( this, instance, "this is correct in testWidget2" );
same( a, 5, "parameter passed to testWidget2" );
same( b, 10, "parameter passed to testWidget2" );
return this._super( "method", a, b*2 );
return this._super( a, b*2 );
}
});

$.widget( "ui.testWidget3", $.ui.testWidget2, {
method: function( a ) {
same( this, instance, "this is correct in testWidget3" );
same( a, 5, "parameter passed to testWidget3" );
var ret = this._super( "method", a, a*2 );
var ret = this._super( a, a*2 );
same( ret, 25, "super returned value" );
}
});
Expand Down Expand Up @@ -382,7 +382,7 @@ test( "._superApply()", function() {
same( this, instance, "this is correct in testWidget2" );
same( a, 5, "parameter passed to testWidget2" );
same( b, 10, "second parameter passed to testWidget2" );
return this._superApply( "method", arguments );
return this._superApply( arguments );
}
});

Expand All @@ -391,7 +391,7 @@ test( "._superApply()", function() {
same( this, instance, "this is correct in testWidget3" );
same( a, 5, "parameter passed to testWidget3" );
same( b, 10, "second parameter passed to testWidget3" );
var ret = this._superApply( "method", arguments );
var ret = this._superApply( arguments );
same( ret, 15, "super returned value" );
}
});
Expand Down Expand Up @@ -1031,7 +1031,7 @@ test( "redefine", function() {
$.widget( "ui.testWidget", $.ui.testWidget, {
method: function( str ) {
equal( str, "foo", "new invoked with correct parameter" );
this._super( "method", "bar" );
this._super();
}
});

Expand Down
26 changes: 13 additions & 13 deletions ui/i18n/jquery.ui.datepicker-ca.js
@@ -1,23 +1,23 @@
/* Inicialització en català per a l'extenció 'calendar' per jQuery. */
/* Inicialització en català per a l'extensió 'UI date picker' per jQuery. */
/* Writers: (joan.leon@gmail.com). */
jQuery(function($){
$.datepicker.regional['ca'] = {
closeText: 'Tancar',
prevText: '&#x3C;Ant',
nextText: 'Seg&#x3E;',
closeText: 'Tanca',
prevText: 'Anterior',
nextText: 'Següent',
currentText: 'Avui',
monthNames: ['Gener','Febrer','Mar&#xE7;','Abril','Maig','Juny',
'Juliol','Agost','Setembre','Octubre','Novembre','Desembre'],
monthNamesShort: ['Gen','Feb','Mar','Abr','Mai','Jun',
'Jul','Ago','Set','Oct','Nov','Des'],
dayNames: ['Diumenge','Dilluns','Dimarts','Dimecres','Dijous','Divendres','Dissabte'],
dayNamesShort: ['Dug','Dln','Dmt','Dmc','Djs','Dvn','Dsb'],
dayNamesMin: ['Dg','Dl','Dt','Dc','Dj','Dv','Ds'],
weekHeader: 'Sm',
monthNames: ['gener','febrer','març','abril','maig','juny',
'juliol','agost','setembre','octubre','novembre','desembre'],
monthNamesShort: ['gen','feb','març','abr','maig','juny',
'jul','ag','set','oct','nov','des'],
dayNames: ['diumenge','dilluns','dimarts','dimecres','dijous','divendres','dissabte'],
dayNamesShort: ['dg','dl','dt','dc','dj','dv','ds'],
dayNamesMin: ['dg','dl','dt','dc','dj','dv','ds'],
weekHeader: 'Set',
dateFormat: 'dd/mm/yy',
firstDay: 1,
isRTL: false,
showMonthAfterYear: false,
yearSuffix: ''};
$.datepicker.setDefaults($.datepicker.regional['ca']);
});
});
23 changes: 23 additions & 0 deletions ui/i18n/jquery.ui.datepicker-cy-GB.js
@@ -0,0 +1,23 @@
/* Welsh/UK initialisation for the jQuery UI date picker plugin. */
/* Written by William Griffiths. */
jQuery(function($){
$.datepicker.regional['cy-GB'] = {
closeText: 'Done',
prevText: 'Prev',
nextText: 'Next',
currentText: 'Today',
monthNames: ['Ionawr','Chwefror','Mawrth','Ebrill','Mai','Mehefin',
'Gorffennaf','Awst','Medi','Hydref','Tachwedd','Rhagfyr'],
monthNamesShort: ['Ion', 'Chw', 'Maw', 'Ebr', 'Mai', 'Meh',
'Gor', 'Aws', 'Med', 'Hyd', 'Tac', 'Rha'],
dayNames: ['Dydd Sul', 'Dydd Llun', 'Dydd Mawrth', 'Dydd Mercher', 'Dydd Iau', 'Dydd Gwener', 'Dydd Sadwrn'],
dayNamesShort: ['Sul', 'Llu', 'Maw', 'Mer', 'Iau', 'Gwe', 'Sad'],
dayNamesMin: ['Su','Ll','Ma','Me','Ia','Gw','Sa'],
weekHeader: 'Wy',
dateFormat: 'dd/mm/yy',
firstDay: 1,
isRTL: false,
showMonthAfterYear: false,
yearSuffix: ''};
$.datepicker.setDefaults($.datepicker.regional['cy-GB']);
});

0 comments on commit 121a2ea

Please sign in to comment.