From 1216e2aaf5e9bae52abe1ef9dfb9ab34c271c56d Mon Sep 17 00:00:00 2001 From: Rafael Xavier de Souza Date: Wed, 17 Jul 2013 12:10:30 -0300 Subject: All: Wrap I18n files with UMD return exports Ref #9464 Ref gh-1029 --- demos/datepicker/jquery.ui.datepicker-ar.js | 21 +++++++++++++++++---- demos/datepicker/jquery.ui.datepicker-fr.js | 21 +++++++++++++++++---- demos/datepicker/jquery.ui.datepicker-he.js | 21 +++++++++++++++++---- demos/datepicker/jquery.ui.datepicker-zh-TW.js | 21 +++++++++++++++++---- 4 files changed, 68 insertions(+), 16 deletions(-) (limited to 'demos/datepicker') diff --git a/demos/datepicker/jquery.ui.datepicker-ar.js b/demos/datepicker/jquery.ui.datepicker-ar.js index cef0f08fd..fc6d2a883 100644 --- a/demos/datepicker/jquery.ui.datepicker-ar.js +++ b/demos/datepicker/jquery.ui.datepicker-ar.js @@ -1,8 +1,18 @@ /* Arabic Translation for jQuery UI date picker plugin. */ /* Khaled Alhourani -- me@khaledalhourani.com */ /* NOTE: monthNames are the original months names and they are the Arabic names, not the new months name فبراير - يناير and there isn't any Arabic roots for these months */ -jQuery(function($){ - $.datepicker.regional['ar'] = { +(function( factory ) { + if ( typeof define === "function" && define.amd ) { + + // AMD. Register as an anonymous module. + define([ "../jquery.ui.datepicker" ], factory ); + } else { + + // Browser globals + factory( jQuery.datepicker ); + } +}(function( datepicker ) { + datepicker.regional['ar'] = { closeText: 'إغلاق', prevText: '<السابق', nextText: 'التالي>', @@ -19,5 +29,8 @@ jQuery(function($){ isRTL: true, showMonthAfterYear: false, yearSuffix: ''}; - $.datepicker.setDefaults($.datepicker.regional['ar']); -}); + datepicker.setDefaults(datepicker.regional['ar']); + + return datepicker.regional['ar']; + +})); diff --git a/demos/datepicker/jquery.ui.datepicker-fr.js b/demos/datepicker/jquery.ui.datepicker-fr.js index 2d06743a6..33fa80d48 100644 --- a/demos/datepicker/jquery.ui.datepicker-fr.js +++ b/demos/datepicker/jquery.ui.datepicker-fr.js @@ -2,8 +2,18 @@ /* Written by Keith Wood (kbwood{at}iinet.com.au), Stéphane Nahmani (sholby@sholby.net), Stéphane Raimbault */ -jQuery(function($){ - $.datepicker.regional['fr'] = { +(function( factory ) { + if ( typeof define === "function" && define.amd ) { + + // AMD. Register as an anonymous module. + define([ "../jquery.ui.datepicker" ], factory ); + } else { + + // Browser globals + factory( jQuery.datepicker ); + } +}(function( datepicker ) { + datepicker.regional['fr'] = { closeText: 'Fermer', prevText: 'Précédent', nextText: 'Suivant', @@ -21,5 +31,8 @@ jQuery(function($){ isRTL: false, showMonthAfterYear: false, yearSuffix: ''}; - $.datepicker.setDefaults($.datepicker.regional['fr']); -}); + datepicker.setDefaults(datepicker.regional['fr']); + + return datepicker.regional['fr']; + +})); diff --git a/demos/datepicker/jquery.ui.datepicker-he.js b/demos/datepicker/jquery.ui.datepicker-he.js index b9e8deec5..bf58038f5 100644 --- a/demos/datepicker/jquery.ui.datepicker-he.js +++ b/demos/datepicker/jquery.ui.datepicker-he.js @@ -1,7 +1,17 @@ /* Hebrew initialisation for the UI Datepicker extension. */ /* Written by Amir Hardon (ahardon at gmail dot com). */ -jQuery(function($){ - $.datepicker.regional['he'] = { +(function( factory ) { + if ( typeof define === "function" && define.amd ) { + + // AMD. Register as an anonymous module. + define([ "../jquery.ui.datepicker" ], factory ); + } else { + + // Browser globals + factory( jQuery.datepicker ); + } +}(function( datepicker ) { + datepicker.regional['he'] = { closeText: 'סגור', prevText: '<הקודם', nextText: 'הבא>', @@ -19,5 +29,8 @@ jQuery(function($){ isRTL: true, showMonthAfterYear: false, yearSuffix: ''}; - $.datepicker.setDefaults($.datepicker.regional['he']); -}); + datepicker.setDefaults(datepicker.regional['he']); + + return datepicker.regional['he']; + +})); diff --git a/demos/datepicker/jquery.ui.datepicker-zh-TW.js b/demos/datepicker/jquery.ui.datepicker-zh-TW.js index b9105ea50..ebfd73ac5 100644 --- a/demos/datepicker/jquery.ui.datepicker-zh-TW.js +++ b/demos/datepicker/jquery.ui.datepicker-zh-TW.js @@ -1,7 +1,17 @@ /* Chinese initialisation for the jQuery UI date picker plugin. */ /* Written by Ressol (ressol@gmail.com). */ -jQuery(function($){ - $.datepicker.regional['zh-TW'] = { +(function( factory ) { + if ( typeof define === "function" && define.amd ) { + + // AMD. Register as an anonymous module. + define([ "../jquery.ui.datepicker" ], factory ); + } else { + + // Browser globals + factory( jQuery.datepicker ); + } +}(function( datepicker ) { + datepicker.regional['zh-TW'] = { closeText: '關閉', prevText: '<上月', nextText: '下月>', @@ -19,5 +29,8 @@ jQuery(function($){ isRTL: false, showMonthAfterYear: true, yearSuffix: '年'}; - $.datepicker.setDefaults($.datepicker.regional['zh-TW']); -}); + datepicker.setDefaults(datepicker.regional['zh-TW']); + + return datepicker.regional['zh-TW']; + +})); -- cgit v1.2.3