aboutsummaryrefslogtreecommitdiffstats
path: root/app/assets/javascripts/plugins
diff options
context:
space:
mode:
authorLuc Donnet2014-08-12 15:27:20 +0200
committerLuc Donnet2014-08-12 15:27:20 +0200
commit2a5190da6ae7608041e6adec970fb1190d866b5c (patch)
tree0c16364366ee30443f3490533f70ccf5d0a6982a /app/assets/javascripts/plugins
parent739d0b9da83ece992f26813a20052839545930f8 (diff)
downloadchouette-core-2a5190da6ae7608041e6adec970fb1190d866b5c.tar.bz2
Add javascript loading for specific controller and action with jquery.readyselector
Diffstat (limited to 'app/assets/javascripts/plugins')
-rw-r--r--app/assets/javascripts/plugins/jquery.readyselector.js17
-rw-r--r--app/assets/javascripts/plugins/jquery.ui.datepicker-i18n.js2
2 files changed, 18 insertions, 1 deletions
diff --git a/app/assets/javascripts/plugins/jquery.readyselector.js b/app/assets/javascripts/plugins/jquery.readyselector.js
new file mode 100644
index 000000000..ea75e1230
--- /dev/null
+++ b/app/assets/javascripts/plugins/jquery.readyselector.js
@@ -0,0 +1,17 @@
+(function ($) {
+ var ready = $.fn.ready;
+ $.fn.ready = function (fn) {
+ if (this.context === undefined) {
+ // The $().ready(fn) case.
+ ready(fn);
+ } else if (this.selector) {
+ ready($.proxy(function(){
+ $(this.selector, this.context).each(fn);
+ }, this));
+ } else {
+ ready($.proxy(function(){
+ $(this).each(fn);
+ }, this));
+ }
+ }
+})(jQuery);
diff --git a/app/assets/javascripts/plugins/jquery.ui.datepicker-i18n.js b/app/assets/javascripts/plugins/jquery.ui.datepicker-i18n.js
index ef2bfb631..fb152408a 100644
--- a/app/assets/javascripts/plugins/jquery.ui.datepicker-i18n.js
+++ b/app/assets/javascripts/plugins/jquery.ui.datepicker-i18n.js
@@ -1,6 +1,6 @@
/* French initialisation for the jQuery UI date picker plugin. */
/* Written by Keith Wood (kbwood{at}iinet.com.au) and Stéphane Nahmani (sholby@sholby.net). */
-jQuery(function($){
+$(function() {
$.datepicker.regional['fr'] = {
closeText: 'Fermer',