From 8532c880976217c4192497c78535cbcd994c1c25 Mon Sep 17 00:00:00 2001 From: echarp Date: Thu, 17 Jul 2014 16:45:12 +0200 Subject: [PATCH] Le chargement de tinymce et des webshims est maintenant fonctionnel, y compris avec turbolinks. Ajout d'un spinner pour indiquer le chargement --- README.creole | 3 - app/assets/javascripts/application.js.coffee | 28 +- app/assets/stylesheets/all.css.sass | 14 +- app/views/events/_form.html.haml | 2 +- app/views/layouts/application.html.haml | 2 + public/webshims/extras/modernizr-custom.js | 511 ++ public/webshims/polyfiller.js | 1357 +++ .../webshims/shims/FlashCanvas/canvas2png.js | 47 + .../webshims/shims/FlashCanvas/flashcanvas.js | 54 + .../shims/FlashCanvas/flashcanvas.swf | Bin 0 -> 21623 bytes public/webshims/shims/FlashCanvas/proxy.php | 94 + public/webshims/shims/FlashCanvas/save.php | 55 + .../shims/FlashCanvasPro/canvas2png.js | 47 + .../shims/FlashCanvasPro/flash10canvas.swf | Bin 0 -> 32159 bytes .../shims/FlashCanvasPro/flash9canvas.swf | Bin 0 -> 32334 bytes .../shims/FlashCanvasPro/flashcanvas.js | 57 + .../webshims/shims/FlashCanvasPro/proxy.php | 94 + public/webshims/shims/FlashCanvasPro/save.php | 55 + public/webshims/shims/color-picker.js | 2414 ++++++ public/webshims/shims/combos/1.js | 1075 +++ public/webshims/shims/combos/10.js | 3810 ++++++++ public/webshims/shims/combos/11.js | 2598 ++++++ public/webshims/shims/combos/12.js | 1638 ++++ public/webshims/shims/combos/13.js | 1415 +++ public/webshims/shims/combos/14.js | 1140 +++ public/webshims/shims/combos/15.js | 2944 +++++++ public/webshims/shims/combos/16.js | 3703 ++++++++ public/webshims/shims/combos/17.js | 3215 +++++++ public/webshims/shims/combos/18.js | 739 ++ public/webshims/shims/combos/2.js | 2584 ++++++ public/webshims/shims/combos/21.js | 2460 ++++++ public/webshims/shims/combos/22.js | 1027 +++ public/webshims/shims/combos/23.js | 759 ++ public/webshims/shims/combos/25.js | 2927 +++++++ public/webshims/shims/combos/26.js | 7702 +++++++++++++++++ public/webshims/shims/combos/27.js | 1701 ++++ public/webshims/shims/combos/28.js | 2033 +++++ public/webshims/shims/combos/29.js | 828 ++ public/webshims/shims/combos/3.js | 1840 ++++ public/webshims/shims/combos/30.js | 2137 +++++ public/webshims/shims/combos/31.js | 1825 ++++ public/webshims/shims/combos/33.js | 914 ++ public/webshims/shims/combos/34.js | 2091 +++++ public/webshims/shims/combos/4.js | 1524 ++++ public/webshims/shims/combos/5.js | 3426 ++++++++ public/webshims/shims/combos/6.js | 3723 ++++++++ public/webshims/shims/combos/7.js | 2896 +++++++ public/webshims/shims/combos/8.js | 2599 ++++++ public/webshims/shims/combos/9.js | 4107 +++++++++ public/webshims/shims/combos/97.js | 1052 +++ public/webshims/shims/combos/98.js | 1433 +++ public/webshims/shims/combos/99.js | 828 ++ public/webshims/shims/details.js | 148 + public/webshims/shims/dom-extend.js | 1212 +++ public/webshims/shims/es5.js | 1529 ++++ public/webshims/shims/es6.js | 1887 ++++ public/webshims/shims/excanvas.js | 939 ++ public/webshims/shims/filereader.js | 469 + public/webshims/shims/form-combat.js | 158 + public/webshims/shims/form-core.js | 316 + public/webshims/shims/form-datalist-lazy.js | 561 ++ public/webshims/shims/form-datalist.js | 297 + public/webshims/shims/form-fixrangechange.js | 137 + public/webshims/shims/form-inputmode.js | 52 + public/webshims/shims/form-message.js | 312 + public/webshims/shims/form-native-extend.js | 211 + public/webshims/shims/form-number-date-api.js | 617 ++ public/webshims/shims/form-number-date-ui.js | 1978 +++++ public/webshims/shims/form-shim-extend.js | 807 ++ public/webshims/shims/form-shim-extend2.js | 1232 +++ public/webshims/shims/form-validation.js | 1022 +++ public/webshims/shims/form-validators.js | 527 ++ public/webshims/shims/forms-picker.js | 1682 ++++ public/webshims/shims/geolocation.js | 187 + public/webshims/shims/i18n/formcfg-ar.js | 64 + public/webshims/shims/i18n/formcfg-ch-CN.js | 65 + public/webshims/shims/i18n/formcfg-cs.js | 112 + public/webshims/shims/i18n/formcfg-de.js | 127 + public/webshims/shims/i18n/formcfg-el.js | 65 + public/webshims/shims/i18n/formcfg-en.js | 130 + public/webshims/shims/i18n/formcfg-es.js | 65 + public/webshims/shims/i18n/formcfg-fa.js | 130 + public/webshims/shims/i18n/formcfg-fr.js | 76 + public/webshims/shims/i18n/formcfg-he.js | 65 + public/webshims/shims/i18n/formcfg-hi.js | 65 + public/webshims/shims/i18n/formcfg-hu.js | 65 + public/webshims/shims/i18n/formcfg-it.js | 65 + public/webshims/shims/i18n/formcfg-ja.js | 65 + public/webshims/shims/i18n/formcfg-lt.js | 78 + public/webshims/shims/i18n/formcfg-nl.js | 126 + public/webshims/shims/i18n/formcfg-pl.js | 109 + public/webshims/shims/i18n/formcfg-pt-BR.js | 71 + public/webshims/shims/i18n/formcfg-pt-PT.js | 66 + public/webshims/shims/i18n/formcfg-pt.js | 66 + public/webshims/shims/i18n/formcfg-ru.js | 65 + public/webshims/shims/i18n/formcfg-sv.js | 73 + public/webshims/shims/i18n/formcfg-zh-CN.js | 65 + public/webshims/shims/i18n/formcfg-zh-TW.js | 130 + public/webshims/shims/jajax.js | 1262 +++ public/webshims/shims/jme/_icons.scss | 189 + public/webshims/shims/jme/alternate-media.js | 184 + public/webshims/shims/jme/base.js | 447 + public/webshims/shims/jme/controls.css | 608 ++ public/webshims/shims/jme/controls.scss | 711 ++ public/webshims/shims/jme/jme.eot | Bin 0 -> 5152 bytes public/webshims/shims/jme/jme.svg | 36 + public/webshims/shims/jme/jme.ttf | Bin 0 -> 5004 bytes public/webshims/shims/jme/jme.woff | Bin 0 -> 3692 bytes .../webshims/shims/jme/mediacontrols-lazy.js | 1527 ++++ public/webshims/shims/jme/mediacontrols.js | 381 + public/webshims/shims/jme/playlist.js | 605 ++ public/webshims/shims/jpicker/ChangeLog.txt | 121 + public/webshims/shims/jpicker/ReadMe.txt | 47 + .../shims/jpicker/images/AlphaBar.png | Bin 0 -> 2195 bytes public/webshims/shims/jpicker/images/Bars.png | Bin 0 -> 1503 bytes public/webshims/shims/jpicker/images/Maps.png | Bin 0 -> 92014 bytes .../webshims/shims/jpicker/images/NoColor.png | Bin 0 -> 552 bytes .../shims/jpicker/images/bar-opacity.png | Bin 0 -> 162 bytes .../shims/jpicker/images/map-opacity.png | Bin 0 -> 214 bytes .../shims/jpicker/images/mappoint.gif | Bin 0 -> 93 bytes .../webshims/shims/jpicker/images/picker.gif | Bin 0 -> 146 bytes .../shims/jpicker/images/preview-opacity.png | Bin 0 -> 135 bytes .../shims/jpicker/images/rangearrows.gif | Bin 0 -> 76 bytes public/webshims/shims/jpicker/jpicker.css | 267 + public/webshims/shims/matchMedia.js | 122 + public/webshims/shims/mediaelement-core.js | 536 ++ public/webshims/shims/mediaelement-debug.js | 833 ++ public/webshims/shims/mediaelement-jaris.js | 1246 +++ .../webshims/shims/mediaelement-native-fix.js | 164 + public/webshims/shims/mediaelement-yt.js | 767 ++ .../webshims/shims/moxie/flash/Moxie.cdn.swf | Bin 0 -> 29378 bytes .../webshims/shims/moxie/flash/Moxie.min.swf | Bin 0 -> 13897 bytes public/webshims/shims/moxie/js/moxie.js | 7233 ++++++++++++++++ .../shims/moxie/silverlight/Moxie.cdn.xap | Bin 0 -> 62648 bytes .../shims/moxie/silverlight/Moxie.min.xap | Bin 0 -> 16930 bytes public/webshims/shims/picture.js | 617 ++ .../shims/plugins/jquery.ui.position.js | 497 ++ public/webshims/shims/promise.js | 684 ++ public/webshims/shims/range-ui.js | 620 ++ public/webshims/shims/sizzle.js | 2047 +++++ public/webshims/shims/styles/color-picker.png | Bin 0 -> 475 bytes public/webshims/shims/styles/forms-ext.css | 614 ++ public/webshims/shims/styles/forms-picker.css | 441 + public/webshims/shims/styles/progress.gif | Bin 0 -> 35832 bytes public/webshims/shims/styles/progress.png | Bin 0 -> 542 bytes .../shims/styles/scss/_api-forms-ext.scss | 219 + .../webshims/shims/styles/scss/_api-shim.scss | 115 + .../webshims/shims/styles/scss/_extends.scss | 17 + .../webshims/shims/styles/scss/forms-ext.scss | 608 ++ .../shims/styles/scss/forms-picker.scss | 476 + .../webshims/shims/styles/scss/shim-ext.scss | 2 + public/webshims/shims/styles/scss/shim.scss | 738 ++ public/webshims/shims/styles/shim-ext.css | 1311 +++ public/webshims/shims/styles/shim.css | 696 ++ public/webshims/shims/styles/transparent.png | Bin 0 -> 140 bytes public/webshims/shims/styles/widget.eot | Bin 0 -> 1700 bytes public/webshims/shims/styles/widget.svg | 12 + public/webshims/shims/styles/widget.ttf | Bin 0 -> 1540 bytes public/webshims/shims/styles/widget.woff | Bin 0 -> 1740 bytes public/webshims/shims/swf/JarisFLVPlayer.swf | Bin 0 -> 25363 bytes public/webshims/shims/swfmini-embed.js | 136 + public/webshims/shims/swfmini.js | 223 + public/webshims/shims/track-ui.js | 366 + public/webshims/shims/track.js | 879 ++ 164 files changed, 126406 insertions(+), 13 deletions(-) create mode 100644 public/webshims/extras/modernizr-custom.js create mode 100644 public/webshims/polyfiller.js create mode 100644 public/webshims/shims/FlashCanvas/canvas2png.js create mode 100644 public/webshims/shims/FlashCanvas/flashcanvas.js create mode 100644 public/webshims/shims/FlashCanvas/flashcanvas.swf create mode 100644 public/webshims/shims/FlashCanvas/proxy.php create mode 100644 public/webshims/shims/FlashCanvas/save.php create mode 100644 public/webshims/shims/FlashCanvasPro/canvas2png.js create mode 100644 public/webshims/shims/FlashCanvasPro/flash10canvas.swf create mode 100644 public/webshims/shims/FlashCanvasPro/flash9canvas.swf create mode 100644 public/webshims/shims/FlashCanvasPro/flashcanvas.js create mode 100644 public/webshims/shims/FlashCanvasPro/proxy.php create mode 100644 public/webshims/shims/FlashCanvasPro/save.php create mode 100644 public/webshims/shims/color-picker.js create mode 100644 public/webshims/shims/combos/1.js create mode 100644 public/webshims/shims/combos/10.js create mode 100644 public/webshims/shims/combos/11.js create mode 100644 public/webshims/shims/combos/12.js create mode 100644 public/webshims/shims/combos/13.js create mode 100644 public/webshims/shims/combos/14.js create mode 100644 public/webshims/shims/combos/15.js create mode 100644 public/webshims/shims/combos/16.js create mode 100644 public/webshims/shims/combos/17.js create mode 100644 public/webshims/shims/combos/18.js create mode 100644 public/webshims/shims/combos/2.js create mode 100644 public/webshims/shims/combos/21.js create mode 100644 public/webshims/shims/combos/22.js create mode 100644 public/webshims/shims/combos/23.js create mode 100644 public/webshims/shims/combos/25.js create mode 100644 public/webshims/shims/combos/26.js create mode 100644 public/webshims/shims/combos/27.js create mode 100644 public/webshims/shims/combos/28.js create mode 100644 public/webshims/shims/combos/29.js create mode 100644 public/webshims/shims/combos/3.js create mode 100644 public/webshims/shims/combos/30.js create mode 100644 public/webshims/shims/combos/31.js create mode 100644 public/webshims/shims/combos/33.js create mode 100644 public/webshims/shims/combos/34.js create mode 100644 public/webshims/shims/combos/4.js create mode 100644 public/webshims/shims/combos/5.js create mode 100644 public/webshims/shims/combos/6.js create mode 100644 public/webshims/shims/combos/7.js create mode 100644 public/webshims/shims/combos/8.js create mode 100644 public/webshims/shims/combos/9.js create mode 100644 public/webshims/shims/combos/97.js create mode 100644 public/webshims/shims/combos/98.js create mode 100644 public/webshims/shims/combos/99.js create mode 100644 public/webshims/shims/details.js create mode 100644 public/webshims/shims/dom-extend.js create mode 100644 public/webshims/shims/es5.js create mode 100755 public/webshims/shims/es6.js create mode 100644 public/webshims/shims/excanvas.js create mode 100644 public/webshims/shims/filereader.js create mode 100644 public/webshims/shims/form-combat.js create mode 100644 public/webshims/shims/form-core.js create mode 100644 public/webshims/shims/form-datalist-lazy.js create mode 100644 public/webshims/shims/form-datalist.js create mode 100644 public/webshims/shims/form-fixrangechange.js create mode 100644 public/webshims/shims/form-inputmode.js create mode 100644 public/webshims/shims/form-message.js create mode 100644 public/webshims/shims/form-native-extend.js create mode 100644 public/webshims/shims/form-number-date-api.js create mode 100644 public/webshims/shims/form-number-date-ui.js create mode 100644 public/webshims/shims/form-shim-extend.js create mode 100644 public/webshims/shims/form-shim-extend2.js create mode 100644 public/webshims/shims/form-validation.js create mode 100644 public/webshims/shims/form-validators.js create mode 100644 public/webshims/shims/forms-picker.js create mode 100644 public/webshims/shims/geolocation.js create mode 100644 public/webshims/shims/i18n/formcfg-ar.js create mode 100644 public/webshims/shims/i18n/formcfg-ch-CN.js create mode 100644 public/webshims/shims/i18n/formcfg-cs.js create mode 100644 public/webshims/shims/i18n/formcfg-de.js create mode 100644 public/webshims/shims/i18n/formcfg-el.js create mode 100644 public/webshims/shims/i18n/formcfg-en.js create mode 100644 public/webshims/shims/i18n/formcfg-es.js create mode 100644 public/webshims/shims/i18n/formcfg-fa.js create mode 100644 public/webshims/shims/i18n/formcfg-fr.js create mode 100644 public/webshims/shims/i18n/formcfg-he.js create mode 100644 public/webshims/shims/i18n/formcfg-hi.js create mode 100644 public/webshims/shims/i18n/formcfg-hu.js create mode 100644 public/webshims/shims/i18n/formcfg-it.js create mode 100644 public/webshims/shims/i18n/formcfg-ja.js create mode 100644 public/webshims/shims/i18n/formcfg-lt.js create mode 100644 public/webshims/shims/i18n/formcfg-nl.js create mode 100644 public/webshims/shims/i18n/formcfg-pl.js create mode 100644 public/webshims/shims/i18n/formcfg-pt-BR.js create mode 100644 public/webshims/shims/i18n/formcfg-pt-PT.js create mode 100644 public/webshims/shims/i18n/formcfg-pt.js create mode 100644 public/webshims/shims/i18n/formcfg-ru.js create mode 100644 public/webshims/shims/i18n/formcfg-sv.js create mode 100644 public/webshims/shims/i18n/formcfg-zh-CN.js create mode 100644 public/webshims/shims/i18n/formcfg-zh-TW.js create mode 100644 public/webshims/shims/jajax.js create mode 100644 public/webshims/shims/jme/_icons.scss create mode 100644 public/webshims/shims/jme/alternate-media.js create mode 100644 public/webshims/shims/jme/base.js create mode 100644 public/webshims/shims/jme/controls.css create mode 100644 public/webshims/shims/jme/controls.scss create mode 100755 public/webshims/shims/jme/jme.eot create mode 100755 public/webshims/shims/jme/jme.svg create mode 100755 public/webshims/shims/jme/jme.ttf create mode 100755 public/webshims/shims/jme/jme.woff create mode 100644 public/webshims/shims/jme/mediacontrols-lazy.js create mode 100644 public/webshims/shims/jme/mediacontrols.js create mode 100644 public/webshims/shims/jme/playlist.js create mode 100644 public/webshims/shims/jpicker/ChangeLog.txt create mode 100644 public/webshims/shims/jpicker/ReadMe.txt create mode 100644 public/webshims/shims/jpicker/images/AlphaBar.png create mode 100644 public/webshims/shims/jpicker/images/Bars.png create mode 100644 public/webshims/shims/jpicker/images/Maps.png create mode 100644 public/webshims/shims/jpicker/images/NoColor.png create mode 100644 public/webshims/shims/jpicker/images/bar-opacity.png create mode 100644 public/webshims/shims/jpicker/images/map-opacity.png create mode 100644 public/webshims/shims/jpicker/images/mappoint.gif create mode 100644 public/webshims/shims/jpicker/images/picker.gif create mode 100644 public/webshims/shims/jpicker/images/preview-opacity.png create mode 100644 public/webshims/shims/jpicker/images/rangearrows.gif create mode 100644 public/webshims/shims/jpicker/jpicker.css create mode 100755 public/webshims/shims/matchMedia.js create mode 100644 public/webshims/shims/mediaelement-core.js create mode 100644 public/webshims/shims/mediaelement-debug.js create mode 100644 public/webshims/shims/mediaelement-jaris.js create mode 100644 public/webshims/shims/mediaelement-native-fix.js create mode 100644 public/webshims/shims/mediaelement-yt.js create mode 100644 public/webshims/shims/moxie/flash/Moxie.cdn.swf create mode 100644 public/webshims/shims/moxie/flash/Moxie.min.swf create mode 100644 public/webshims/shims/moxie/js/moxie.js create mode 100644 public/webshims/shims/moxie/silverlight/Moxie.cdn.xap create mode 100644 public/webshims/shims/moxie/silverlight/Moxie.min.xap create mode 100644 public/webshims/shims/picture.js create mode 100644 public/webshims/shims/plugins/jquery.ui.position.js create mode 100644 public/webshims/shims/promise.js create mode 100644 public/webshims/shims/range-ui.js create mode 100644 public/webshims/shims/sizzle.js create mode 100644 public/webshims/shims/styles/color-picker.png create mode 100644 public/webshims/shims/styles/forms-ext.css create mode 100644 public/webshims/shims/styles/forms-picker.css create mode 100644 public/webshims/shims/styles/progress.gif create mode 100644 public/webshims/shims/styles/progress.png create mode 100644 public/webshims/shims/styles/scss/_api-forms-ext.scss create mode 100644 public/webshims/shims/styles/scss/_api-shim.scss create mode 100644 public/webshims/shims/styles/scss/_extends.scss create mode 100644 public/webshims/shims/styles/scss/forms-ext.scss create mode 100644 public/webshims/shims/styles/scss/forms-picker.scss create mode 100644 public/webshims/shims/styles/scss/shim-ext.scss create mode 100644 public/webshims/shims/styles/scss/shim.scss create mode 100644 public/webshims/shims/styles/shim-ext.css create mode 100644 public/webshims/shims/styles/shim.css create mode 100644 public/webshims/shims/styles/transparent.png create mode 100755 public/webshims/shims/styles/widget.eot create mode 100755 public/webshims/shims/styles/widget.svg create mode 100755 public/webshims/shims/styles/widget.ttf create mode 100755 public/webshims/shims/styles/widget.woff create mode 100644 public/webshims/shims/swf/JarisFLVPlayer.swf create mode 100644 public/webshims/shims/swfmini-embed.js create mode 100644 public/webshims/shims/swfmini.js create mode 100644 public/webshims/shims/track-ui.js create mode 100644 public/webshims/shims/track.js diff --git a/README.creole b/README.creole index e8dd82bc..1801ce8c 100644 --- a/README.creole +++ b/README.creole @@ -41,9 +41,6 @@ Puis lancez rails: ~ $ bundle exec rails s }}} -En production, dans le répertoire source, vous devez aussi: -~ rake webshims:update_public - Vous pouvez finalement accéder à l'agenda dans un navigateur à l'URL suivante: http://localhost:3000 diff --git a/app/assets/javascripts/application.js.coffee b/app/assets/javascripts/application.js.coffee index 219d8950..5e6624f9 100644 --- a/app/assets/javascripts/application.js.coffee +++ b/app/assets/javascripts/application.js.coffee @@ -14,7 +14,7 @@ #= require jquery_ujs #= require jquery.turbolinks #= require turbolinks -#= require tinymce +#= require tinymce-jquery #= require modernizr #= require webshims/polyfiller #= require_tree . @@ -22,25 +22,37 @@ # Setup polyfills, so that older browsers can also take advanage of html5! #$.webshims.setOptions('basePath', '/assets/webshims/shims/') $.webshims.setOptions('basePath', '/webshims/shims/') -$.webshims.polyfill('es5 forms forms-ext mediaelement') +$.webshims.polyfill('forms forms-ext') -$(document).ready -> +$(document).on 'page:fetch submit', -> + $('em#loading').fadeIn('slow') +$(document).on 'page:receive', -> + $('em#loading').fadeOut('slow') + +$(document).on 'page:load', -> + # Reload polyfill when turbolinks loads a new page $(this).updatePolyfill() - tinyMCE.init { +$(document).on 'page:receive', -> + # Delete existing tinymce editors, very important in the turbolinks context! + tinymce.remove() + +$(document).ready -> + tinyMCE.init selector: 'textarea', - language: 'fr_FR', menubar : false, + schema: 'html5', + add_unload_trigger: true, + browser_spellcheck: true, toolbar: [ ' bold italic strikethrough | bullist numlist outdent indent | alignleft aligncenter alignright alignjustify | link media insertdatetime charmap table | undo redo - | searchreplace spellchecker + | searchreplace | code visualblocks preview fullscreen' ], plugins: 'lists, advlist, autolink, link, charmap, paste, print, preview, table, fullscreen, searchreplace, media, insertdatetime, visualblocks, - visualchars, wordcount, contextmenu, code, spellchecker' - } + visualchars, wordcount, contextmenu, code' diff --git a/app/assets/stylesheets/all.css.sass b/app/assets/stylesheets/all.css.sass index c872a037..7e5adb6c 100644 --- a/app/assets/stylesheets/all.css.sass +++ b/app/assets/stylesheets/all.css.sass @@ -7,7 +7,6 @@ max-width: 100% box-sizing: border-box line-height: 1em - @include transition-duration(0.5s) html color: black @@ -23,6 +22,9 @@ body text-align: center border-bottom: 0px background-color: white + header, main, footer + * + @include transition-duration(0.5s) a:link, a:visited color: #258 @@ -177,3 +179,13 @@ footer.bottom nav color: black content: '- ' font-weight: normal + +#loading + top: 45% + left: 45% + color: gray + display: none + position: fixed + font-size: 10vw + vertical-align: baseline + @include text-shadow(0 0 4px gray) diff --git a/app/views/events/_form.html.haml b/app/views/events/_form.html.haml index 5e34ace0..980ee623 100644 --- a/app/views/events/_form.html.haml +++ b/app/views/events/_form.html.haml @@ -33,7 +33,7 @@ :markdown #{t '.description_helper'} = f.label :description - = f.text_area :description, required: true, rows: 29, cols: 80 + = f.text_area :description, required: true, rows: 25, cols: 90 .field = f.label :city diff --git a/app/views/layouts/application.html.haml b/app/views/layouts/application.html.haml index 8a10bae7..82a9c192 100644 --- a/app/views/layouts/application.html.haml +++ b/app/views/layouts/application.html.haml @@ -67,3 +67,5 @@ = link_to t('.stats'), stats_regions_url = link_to t('.contact'), application_contact_url = link_to t('.moderation'), moderations_url + + %em#loading.fa.fa-spin.fa-circle-o-notch diff --git a/public/webshims/extras/modernizr-custom.js b/public/webshims/extras/modernizr-custom.js new file mode 100644 index 00000000..faae2ae5 --- /dev/null +++ b/public/webshims/extras/modernizr-custom.js @@ -0,0 +1,511 @@ +/* Modernizr 2.7.1 (Custom Build) | MIT & BSD + * Build: http://modernizr.com/download/#-canvas-audio-video-input-inputtypes-geolocation-shiv-addtest-prefixed-testprop-testallprops-prefixes-domprefixes + */ +; + + + +window.Modernizr = (function( window, document, undefined ) { + + var version = '2.7.1', + + Modernizr = {}, + + + docElement = document.documentElement, + + mod = 'modernizr', + modElem = document.createElement(mod), + mStyle = modElem.style, + + inputElem = document.createElement('input') , + + smile = ':)', + + toString = {}.toString, + + prefixes = ' -webkit- -moz- -o- -ms- '.split(' '), + + + + omPrefixes = 'Webkit Moz O ms', + + cssomPrefixes = omPrefixes.split(' '), + + domPrefixes = omPrefixes.toLowerCase().split(' '), + + + tests = {}, + inputs = {}, + attrs = {}, + + classes = [], + + slice = classes.slice, + + featureName, + + + + _hasOwnProperty = ({}).hasOwnProperty, hasOwnProp; + + if ( !is(_hasOwnProperty, 'undefined') && !is(_hasOwnProperty.call, 'undefined') ) { + hasOwnProp = function (object, property) { + return _hasOwnProperty.call(object, property); + }; + } + else { + hasOwnProp = function (object, property) { + return ((property in object) && is(object.constructor.prototype[property], 'undefined')); + }; + } + + + if (!Function.prototype.bind) { + Function.prototype.bind = function bind(that) { + + var target = this; + + if (typeof target != "function") { + throw new TypeError(); + } + + var args = slice.call(arguments, 1), + bound = function () { + + if (this instanceof bound) { + + var F = function(){}; + F.prototype = target.prototype; + var self = new F(); + + var result = target.apply( + self, + args.concat(slice.call(arguments)) + ); + if (Object(result) === result) { + return result; + } + return self; + + } else { + + return target.apply( + that, + args.concat(slice.call(arguments)) + ); + + } + + }; + + return bound; + }; + } + + function setCss( str ) { + mStyle.cssText = str; + } + + function setCssAll( str1, str2 ) { + return setCss(prefixes.join(str1 + ';') + ( str2 || '' )); + } + + function is( obj, type ) { + return typeof obj === type; + } + + function contains( str, substr ) { + return !!~('' + str).indexOf(substr); + } + + function testProps( props, prefixed ) { + for ( var i in props ) { + var prop = props[i]; + if ( !contains(prop, "-") && mStyle[prop] !== undefined ) { + return prefixed == 'pfx' ? prop : true; + } + } + return false; + } + + function testDOMProps( props, obj, elem ) { + for ( var i in props ) { + var item = obj[props[i]]; + if ( item !== undefined) { + + if (elem === false) return props[i]; + + if (is(item, 'function')){ + return item.bind(elem || obj); + } + + return item; + } + } + return false; + } + + function testPropsAll( prop, prefixed, elem ) { + + var ucProp = prop.charAt(0).toUpperCase() + prop.slice(1), + props = (prop + ' ' + cssomPrefixes.join(ucProp + ' ') + ucProp).split(' '); + + if(is(prefixed, "string") || is(prefixed, "undefined")) { + return testProps(props, prefixed); + + } else { + props = (prop + ' ' + (domPrefixes).join(ucProp + ' ') + ucProp).split(' '); + return testDOMProps(props, prefixed, elem); + } + } + + + + tests['canvas'] = function() { + var elem = document.createElement('canvas'); + return !!(elem.getContext && elem.getContext('2d')); + }; tests['geolocation'] = function() { + return 'geolocation' in navigator; + }; + + + tests['video'] = function() { + var elem = document.createElement('video'), + bool = false; + + try { + if ( bool = !!elem.canPlayType ) { + bool = new Boolean(bool); + bool.ogg = elem.canPlayType('video/ogg; codecs="theora"') .replace(/^no$/,''); + + bool.h264 = elem.canPlayType('video/mp4; codecs="avc1.42E01E"') .replace(/^no$/,''); + + bool.webm = elem.canPlayType('video/webm; codecs="vp8, vorbis"').replace(/^no$/,''); + } + + } catch(e) { } + + return bool; + }; + + tests['audio'] = function() { + var elem = document.createElement('audio'), + bool = false; + + try { + if ( bool = !!elem.canPlayType ) { + bool = new Boolean(bool); + bool.ogg = elem.canPlayType('audio/ogg; codecs="vorbis"').replace(/^no$/,''); + bool.mp3 = elem.canPlayType('audio/mpeg;') .replace(/^no$/,''); + + bool.wav = elem.canPlayType('audio/wav; codecs="1"') .replace(/^no$/,''); + bool.m4a = ( elem.canPlayType('audio/x-m4a;') || + elem.canPlayType('audio/aac;')) .replace(/^no$/,''); + } + } catch(e) { } + + return bool; + }; function webforms() { + Modernizr['input'] = (function( props ) { + for ( var i = 0, len = props.length; i < len; i++ ) { + attrs[ props[i] ] = !!(props[i] in inputElem); + } + if (attrs.list){ + attrs.list = !!(document.createElement('datalist') && window.HTMLDataListElement); + } + return attrs; + })('autocomplete autofocus list placeholder max min multiple pattern required step'.split(' ')); + Modernizr['inputtypes'] = (function(props) { + + for ( var i = 0, bool, inputElemType, defaultView, len = props.length; i < len; i++ ) { + + inputElem.setAttribute('type', inputElemType = props[i]); + bool = inputElem.type !== 'text'; + + if ( bool ) { + + inputElem.value = smile; + inputElem.style.cssText = 'position:absolute;visibility:hidden;'; + + if ( /^range$/.test(inputElemType) && inputElem.style.WebkitAppearance !== undefined ) { + + docElement.appendChild(inputElem); + defaultView = document.defaultView; + + bool = defaultView.getComputedStyle && + defaultView.getComputedStyle(inputElem, null).WebkitAppearance !== 'textfield' && + (inputElem.offsetHeight !== 0); + + docElement.removeChild(inputElem); + + } else if ( /^(search|tel)$/.test(inputElemType) ){ + } else if ( /^(url|email)$/.test(inputElemType) ) { + bool = inputElem.checkValidity && inputElem.checkValidity() === false; + + } else { + bool = inputElem.value != smile; + } + } + + inputs[ props[i] ] = !!bool; + } + return inputs; + })('search tel url email datetime date month week time datetime-local number range color'.split(' ')); + } + for ( var feature in tests ) { + if ( hasOwnProp(tests, feature) ) { + featureName = feature.toLowerCase(); + Modernizr[featureName] = tests[feature](); + + classes.push((Modernizr[featureName] ? '' : 'no-') + featureName); + } + } + + Modernizr.input || webforms(); + + + Modernizr.addTest = function ( feature, test ) { + if ( typeof feature == 'object' ) { + for ( var key in feature ) { + if ( hasOwnProp( feature, key ) ) { + Modernizr.addTest( key, feature[ key ] ); + } + } + } else { + + feature = feature.toLowerCase(); + + if ( Modernizr[feature] !== undefined ) { + return Modernizr; + } + + test = typeof test == 'function' ? test() : test; + + if (typeof enableClasses !== "undefined" && enableClasses) { + docElement.className += ' ' + (test ? '' : 'no-') + feature; + } + Modernizr[feature] = test; + + } + + return Modernizr; + }; + + + setCss(''); + modElem = inputElem = null; + + ;(function(window, document) { + var version = '3.7.0'; + + var options = window.html5 || {}; + + var reSkip = /^<|^(?:button|map|select|textarea|object|iframe|option|optgroup)$/i; + + var saveClones = /^(?:a|b|code|div|fieldset|h1|h2|h3|h4|h5|h6|i|label|li|ol|p|q|span|strong|style|table|tbody|td|th|tr|ul)$/i; + + var supportsHtml5Styles; + + var expando = '_html5shiv'; + + var expanID = 0; + + var expandoData = {}; + + var supportsUnknownElements; + + (function() { + try { + var a = document.createElement('a'); + a.innerHTML = ''; + supportsHtml5Styles = ('hidden' in a); + + supportsUnknownElements = a.childNodes.length == 1 || (function() { + (document.createElement)('a'); + var frag = document.createDocumentFragment(); + return ( + typeof frag.cloneNode == 'undefined' || + typeof frag.createDocumentFragment == 'undefined' || + typeof frag.createElement == 'undefined' + ); + }()); + } catch(e) { + supportsHtml5Styles = true; + supportsUnknownElements = true; + } + + }()); + + function addStyleSheet(ownerDocument, cssText) { + var p = ownerDocument.createElement('p'), + parent = ownerDocument.getElementsByTagName('head')[0] || ownerDocument.documentElement; + + p.innerHTML = 'x'; + return parent.insertBefore(p.lastChild, parent.firstChild); + } + + function getElements() { + var elements = html5.elements; + return typeof elements == 'string' ? elements.split(' ') : elements; + } + + function getExpandoData(ownerDocument) { + var data = expandoData[ownerDocument[expando]]; + if (!data) { + data = {}; + expanID++; + ownerDocument[expando] = expanID; + expandoData[expanID] = data; + } + return data; + } + + function createElement(nodeName, ownerDocument, data){ + if (!ownerDocument) { + ownerDocument = document; + } + if(supportsUnknownElements){ + return ownerDocument.createElement(nodeName); + } + if (!data) { + data = getExpandoData(ownerDocument); + } + var node; + + if (data.cache[nodeName]) { + node = data.cache[nodeName].cloneNode(); + } else if (saveClones.test(nodeName)) { + node = (data.cache[nodeName] = data.createElem(nodeName)).cloneNode(); + } else { + node = data.createElem(nodeName); + } + + return node.canHaveChildren && !reSkip.test(nodeName) && !node.tagUrn ? data.frag.appendChild(node) : node; + } + + function createDocumentFragment(ownerDocument, data){ + if (!ownerDocument) { + ownerDocument = document; + } + if(supportsUnknownElements){ + return ownerDocument.createDocumentFragment(); + } + data = data || getExpandoData(ownerDocument); + var clone = data.frag.cloneNode(), + i = 0, + elems = getElements(), + l = elems.length; + for(;i 1) { + webCFG[name] = (!$.isPlainObject(opts)) ? opts : $.extend(true, webCFG[name] || {}, opts); + } else if (typeof name == 'object') { + $.extend(true, webCFG, name); + } + }, + getLazyFn: function(fn, modules){ + var load = function(){ + loadList(modules); + }; + onReady('WINDOWLOAD', load); + return function(){ + var args = arguments; + var obj = this; + load(); + onReady(modules, function(){ + obj[fn].apply(obj, args); + }); + }; + }, + _getAutoEnhance: getAutoEnhance, + addPolyfill: function(name, cfg){ + cfg = cfg || {}; + var feature = cfg.f || name; + if (!webshimsFeatures[feature]) { + webshimsFeatures[feature] = []; + webshims.featureList.push(feature); + webCFG[feature] = {}; + } + + webshimsFeatures[feature].push(name); + cfg.options = $.extend(webCFG[feature], cfg.options); + + addModule(name, cfg); + if (cfg.methodNames) { + $.each(cfg.methodNames, function(i, methodName){ + webshims.addMethodName(methodName); + }); + } + }, + polyfill: (function(){ + var loaded = {}; + return function(features){ + if(!features){ + features = webshims.featureList; + WSDEBUG && webshims.warn('loading all features without specifing might be bad for performance'); + } + + if (typeof features == 'string') { + features = features.split(' '); + } + + if(WSDEBUG){ + for(var i = 0; i < features.length; i++){ + if(loaded[features[i]]){ + webshims.error(features[i] +' already loaded, you might want to use updatePolyfill instead? see: bit.ly/12BtXX3'); + } + loaded[features[i]] = true; + } + } + return webshims._polyfill(features); + }; + })(), + _polyfill: function(features){ + var toLoadFeatures = []; + var hasFormsExt; + + if(!firstRun.run){ + hasFormsExt = $.inArray('forms-ext', features) !== -1; + firstRun(); + if(hasFormsExt && $.inArray('forms', features) == -1){ + features.push('forms'); + if(WSDEBUG){ + webshims.error('need to load forms feature to use forms-ext feature.'); + } + } + if(webCFG.loadStyles){ + loader.loadCSS('styles/shim'+((hasFormsExt && !modules["form-number-date-ui"].test()) ? '-ext' : '')+'.css'); + } + } + + + if (webCFG.waitReady) { + $.readyWait++; + onReady(features, function(){ + $.ready(true); + }); + } + + $.each(features, function(i, feature){ + if(feature == 'xhr2'){ + feature = 'filereader'; + } + if(feature == 'promise'){ + feature = 'es6'; + } + if(!webshimsFeatures[feature]){ + WSDEBUG && webshims.error("could not find webshims-feature (aborted): "+ feature); + isReady(feature, true); + return; + } + if (feature !== webshimsFeatures[feature][0]) { + onReady(webshimsFeatures[feature], function(){ + isReady(feature, true); + }); + } + toLoadFeatures = toLoadFeatures.concat(webshimsFeatures[feature]); + }); + + loadList(toLoadFeatures); + + + $.each(features, function(i, feature){ + var o = webCFG[feature]; + if(!o){return;} + if(feature == 'mediaelement' && (o.replaceUI = getAutoEnhance(o.replaceUI))){ + o.plugins.unshift('mediacontrols'); + } + if(o.plugins && o.plugins.length){ + loadList(webCFG[feature].plugins); + } + }); + }, + + /* + * handle ready modules + */ + reTest: (function(){ + var resList; + var reTest = function(i, name){ + var module = modules[name]; + var readyName = name+'Ready'; + if(module && !module.loaded && !( (module.test && $.isFunction(module.test) ) ? module.test([]) : module.test )){ + if(special[readyName]){ + delete special[readyName]; + } + webshimsFeatures[module.f]; + + resList.push(name); + } + }; + return function(moduleNames){ + if(typeof moduleNames == 'string'){ + moduleNames = moduleNames.split(' '); + } + resList = []; + $.each(moduleNames, reTest); + loadList(resList); + }; + })(), + isReady: function(name, _set){ + + name = name + 'Ready'; + if (_set) { + if (special[name] && special[name].add) { + return true; + } + + special[name] = $.extend(special[name] || {}, { + add: function(details){ + details.handler.call(this, name); + } + }); + $(document).triggerHandler(name); + } + return !!(special[name] && special[name].add) || false; + }, + ready: function(events, fn /*, _created*/){ + var _created = arguments[2]; + if (typeof events == 'string') { + events = events.split(' '); + } + + if (!_created) { + events = $.map($.grep(events, function(evt){ + return !isReady(evt); + }), function(evt){ + return evt + 'Ready'; + }); + } + if (!events.length) { + fn($, webshims, window, document); + return; + } + var readyEv = events.shift(), readyFn = function(){ + onReady(events, fn, true); + }; + + $(document).one(readyEv, readyFn); + }, + + /* + * basic DOM-/jQuery-Helpers + */ + + + capturingEvents: function(names, _maybePrevented){ + if (!document.addEventListener) { + return; + } + if (typeof names == 'string') { + names = [names]; + } + $.each(names, function(i, name){ + var handler = function(e){ + e = $.event.fix(e); + if (_maybePrevented && webshims.capturingEventPrevented) { + webshims.capturingEventPrevented(e); + } + return $.event.dispatch.call(this, e); + }; + special[name] = special[name] || {}; + if (special[name].setup || special[name].teardown) { + return; + } + $.extend(special[name], { + setup: function(){ + this.addEventListener(name, handler, true); + }, + teardown: function(){ + this.removeEventListener(name, handler, true); + } + }); + }); + }, + register: function(name, fn){ + var module = modules[name]; + if (!module) { + webshims.error("can't find module: " + name); + return; + } + module.loaded = true; + var ready = function(){ + fn($, webshims, window, document, undefined, module.options); + isReady(name, true); + }; + if (module.d && module.d.length) { + onReady(module.d, ready); + } else { + ready(); + } + + }, + c: {}, + /* + * loader + */ + loader: { + + addModule: function(name, ext){ + modules[name] = ext; + ext.name = ext.name || name; + if(!ext.c){ + ext.c = []; + } + $.each(ext.c, function(i, comboname){ + if(!webshims.c[comboname]){ + webshims.c[comboname] = []; + } + webshims.c[comboname].push(name); + }); + }, + loadList: (function(){ + + var loadedModules = []; + var loadScript = function(src, names){ + if (typeof names == 'string') { + names = [names]; + } + $.merge(loadedModules, names); + loader.loadScript(src, false, names); + }; + + var noNeedToLoad = function(name, list){ + if (isReady(name) || $.inArray(name, loadedModules) != -1) { + return true; + } + var module = modules[name]; + var supported; + if (module) { + supported = (module.test && $.isFunction(module.test)) ? module.test(list) : module.test; + if (supported) { + isReady(name, true); + return true; + } else { + return false; + } + } + return true; + }; + + var setDependencies = function(module, list){ + if (module.d && module.d.length) { + var addDependency = function(i, dependency){ + if (!noNeedToLoad(dependency, list) && $.inArray(dependency, list) == -1) { + list.push(dependency); + } + }; + $.each(module.d, function(i, dependency){ + if (modules[dependency]) { + if(!modules[dependency].loaded){ + addDependency(i, dependency); + } + } + else + if (webshimsFeatures[dependency]) { + $.each(webshimsFeatures[dependency], addDependency); + onReady(webshimsFeatures[dependency], function(){ + isReady(dependency, true); + }); + } + }); + if (!module.noAutoCallback) { + module.noAutoCallback = true; + } + } + }; + + return function(list){ + var module; + var loadCombos = []; + var i; + var len; + var foundCombo; + var loadCombo = function(j, combo){ + foundCombo = combo; + $.each(webshims.c[combo], function(i, moduleName){ + if($.inArray(moduleName, loadCombos) == -1 || $.inArray(moduleName, loadedModules) != -1){ + foundCombo = false; + return false; + } + }); + if(foundCombo){ + loadScript('combos/'+foundCombo, webshims.c[foundCombo]); + return false; + } + }; + + //length of list is dynamically + for (i = 0; i < list.length; i++) { + module = modules[list[i]]; + if (!module || noNeedToLoad(module.name, list)) { + if (WSDEBUG && !module) { + webshims.warn('could not find: ' + list[i]); + } + continue; + } + if (module.css && webCFG.loadStyles) { + loader.loadCSS(module.css); + } + + if (module.loadInit) { + module.loadInit(); + } + + + setDependencies(module, list); + if(!module.loaded){ + loadCombos.push(module.name); + } + module.loaded = true; + } + + for(i = 0, len = loadCombos.length; i < len; i++){ + foundCombo = false; + + module = loadCombos[i]; + + if($.inArray(module, loadedModules) == -1){ + if(webCFG.debug != 'noCombo'){ + $.each(modules[module].c, loadCombo); + } + if(!foundCombo){ + loadScript(modules[module].src || module, module); + } + } + } + }; + })(), + + makePath: function(src){ + if (src.indexOf('//') != -1 || src.indexOf('/') === 0) { + return src; + } + + if (src.indexOf('.') == -1) { + src += '.js'; + } + if (webCFG.addCacheBuster) { + src += webCFG.addCacheBuster; + } + return webCFG.basePath + src; + }, + + loadCSS: (function(){ + var parent, loadedSrcs = {}; + return function(src){ + src = this.makePath(src); + if (loadedSrcs[src]) { + return; + } + parent = parent || $('link, style')[0] || $('script')[0]; + loadedSrcs[src] = 1; + $('').insertBefore(parent).attr({ + href: src + }); + }; + })(), + + loadScript: (function(){ + var loadedSrcs = {}; + return function(src, callback, name, noShimPath){ + if(!noShimPath){ + src = loader.makePath(src); + } + if (loadedSrcs[src]) {return;} + var complete = function(){ + + if (callback) { + callback(); + } + + if (name) { + if (typeof name == 'string') { + name = name.split(' '); + } + $.each(name, function(i, name){ + if (!modules[name]) { + return; + } + if (modules[name].afterLoad) { + modules[name].afterLoad(); + } + isReady(!modules[name].noAutoCallback ? name : name + 'FileLoaded', true); + }); + + } + }; + + loadedSrcs[src] = 1; + webCFG.loadScript(src, complete, $.noop); + }; + })() + } + }); + + /* + * shortcuts + */ + + + var webCFG = webshims.cfg; + var webshimsFeatures = webshims.features; + var isReady = webshims.isReady; + var onReady = webshims.ready; + var addPolyfill = webshims.addPolyfill; + var modules = webshims.modules; + var loader = webshims.loader; + var loadList = loader.loadList; + var addModule = loader.addModule; + var bugs = webshims.bugs; + var removeCombos = []; + var importantLogs = { + warn: 1, + error: 1 + }; + var $fn = $.fn; + + webshims.addMethodName = function(name){ + name = name.split(':'); + var prop = name[1]; + if (name.length == 1) { + prop = name[0]; + name = name[0]; + } else { + name = name[0]; + } + + $fn[name] = function(){ + return this.callProp(prop, arguments); + }; + }; + + $fn.callProp = function(prop, args){ + var ret; + if(!args){ + args = []; + } + this.each(function(){ + var fn = $.prop(this, prop); + + if (fn && fn.apply) { + ret = fn.apply(this, args); + if (ret !== undefined) { + return false; + } + } else { + webshims.warn(prop+ " is not a method of "+ this); + } + }); + return (ret !== undefined) ? ret : this; + }; + + + + webshims.activeLang = (function(){ + + if(!('language' in navigator)){ + navigator.language = navigator.browserLanguage || ''; + } + var curLang = $.attr(document.documentElement, 'lang') || navigator.language; + onReady('webshimLocalization', function(){ + webshims.activeLang(curLang); + }); + return function(lang){ + if(lang){ + if (typeof lang == 'string' ) { + curLang = lang; + } else if(typeof lang == 'object'){ + var args = arguments; + var that = this; + onReady('webshimLocalization', function(){ + webshims.activeLang.apply(that, args); + }); + } + } + return curLang; + }; + })(); + + webshims.errorLog = []; + $.each(['log', 'error', 'warn', 'info'], function(i, fn){ + webshims[fn] = function(message){ + if( (importantLogs[fn] && webCFG.debug !== false) || webCFG.debug){ + webshims.errorLog.push(message); + if(window.console && console.log){ + console[(console[fn]) ? fn : 'log'](message); + } + } + }; + }); + + if(WSDEBUG){ + if(!webshims._curScript.wsFoundCurrent){ + webshims.error('Could not detect currentScript! Use basePath to set script path.'); + } + } + + /* + * jQuery-plugins for triggering dom updates can be also very usefull in conjunction with non-HTML5 DOM-Changes (AJAX) + * Example: + * $.webshims.addReady(function(context, insertedElement){ + * $('div.tabs', context).add(insertedElement.filter('div.tabs')).tabs(); + * }); + * + * $.ajax({ + * success: function(html){ + * $('#main').htmlPolyfill(html); + * } + * }); + */ + + (function(){ + //Overwrite DOM-Ready and implement a new ready-method + $.isDOMReady = $.isReady; + var onReady = function(){ + + $.isDOMReady = true; + isReady('DOM', true); + setTimeout(function(){ + isReady('WINDOWLOAD', true); + }, 9999); + }; + + firstRun = function(){ + if(!firstRun.run){ + + if(webCFG.debug || (!('crossDomain' in webCFG.ajax) && location.protocol.indexOf('http'))){ + webCFG.ajax.crossDomain = true; + } + + if(WSDEBUG && $.mobile && ($.mobile.textinput || $.mobile.rangeslider || $.mobile.button)){ + webshims.info('jQM textinput/rangeslider/button detected waitReady was set to false. Use webshims.ready("featurename") to script against polyfilled methods/properties'); + + if(!webCFG.readyEvt){ + webshims.error('in a jQuery mobile enviroment: you should change the readyEvt to "pageinit".'); + } + + if(webCFG.waitReady){ + webshims.error('in a jQuery mobile enviroment: you should change the waitReady to false.') + } + } + + if (WSDEBUG && webCFG.waitReady && $.isReady) { + webshims.warn('Call webshims.polyfill before DOM-Ready or set waitReady to false.'); + } + + if(!$.isDOMReady && webCFG.waitReady){ + var $Ready = $.ready; + $.ready = function(unwait){ + if(unwait !== true && document.body){ + onReady(); + } + return $Ready.apply(this, arguments); + }; + $.ready.promise = $Ready.promise; + } + if(webCFG.readyEvt){ + $(document).one(webCFG.readyEvt, onReady); + } else { + $(onReady); + } + } + firstRun.run = true; + }; + + $(window).on('load', function(){ + onReady(); + setTimeout(function(){ + isReady('WINDOWLOAD', true); + }, 9); + }); + + var readyFns = []; + var eachTrigger = function(){ + if(this.nodeType == 1){ + webshims.triggerDomUpdate(this); + } + }; + $.extend(webshims, { + addReady: function(fn){ + var readyFn = function(context, elem){ + webshims.ready('DOM', function(){fn(context, elem);}); + }; + readyFns.push(readyFn); + + if(webCFG.wsdoc){ + readyFn(webCFG.wsdoc, emptyJ); + } + }, + triggerDomUpdate: function(context){ + if(!context || !context.nodeType){ + if(context && context.jquery){ + context.each(function(){ + webshims.triggerDomUpdate(this); + }); + } + return; + } + var type = context.nodeType; + if(type != 1 && type != 9){return;} + var elem = (context !== document) ? $(context) : emptyJ; + $.each(readyFns, function(i, fn){ + fn(context, elem); + }); + } + }); + + $fn.clonePolyfill = $fn.clone; + + $fn.htmlPolyfill = function(a){ + if(!arguments.length){ + return $(this.clonePolyfill()).html(); + } + var ret = $fn.html.call(this, a); + if(ret === this && $.isDOMReady){ + this.each(eachTrigger); + } + return ret; + }; + + $fn.jProp = function(){ + return this.pushStack($($fn.prop.apply(this, arguments) || [])); + }; + + $.each(['after', 'before', 'append', 'prepend', 'replaceWith'], function(i, name){ + $fn[name+'Polyfill'] = function(a){ + a = $(a); + $fn[name].call(this, a); + if($.isDOMReady){ + a.each(eachTrigger); + } + return this; + }; + + }); + + $.each(['insertAfter', 'insertBefore', 'appendTo', 'prependTo', 'replaceAll'], function(i, name){ + $fn[name.replace(/[A-Z]/, function(c){return "Polyfill"+c;})] = function(){ + $fn[name].apply(this, arguments); + if($.isDOMReady){ + webshims.triggerDomUpdate(this); + } + return this; + }; + }); + + $fn.updatePolyfill = function(){ + if($.isDOMReady){ + webshims.triggerDomUpdate(this); + } + return this; + }; + + $.each(['getNativeElement', 'getShadowElement', 'getShadowFocusElement'], function(i, name){ + $fn[name] = function(){ + return this.pushStack(this); + }; + }); + + })(); + + + if(WSDEBUG){ + webCFG.debug = true; + } + + if(Object.create){ + webshims.objectCreate = function(proto, props, opts){ + if(WSDEBUG && props){ + webshims.error('second argument for webshims.objectCreate is only available with DOM support'); + } + var o = Object.create(proto); + if(opts){ + o.options = $.extend(true, {}, o.options || {}, opts); + opts = o.options; + } + if(o._create && $.isFunction(o._create)){ + o._create(opts); + } + return o; + }; + } + + + + + /* + * Start Features + */ + + /* general modules */ + /* change path $.webshims.modules[moduleName].src */ + + + addModule('swfmini', { + test: function(){ + if(window.swfobject && !window.swfmini){ + window.swfmini = window.swfobject; + } + return ('swfmini' in window); + }, + c: [16, 7, 2, 8, 1, 12, 23] + }); + modules.swfmini.test(); + + addModule('sizzle', {test: $.expr.filters}); + addModule('jajax', {test: $.ajax && $.ajaxSettings.xhr}); + /* + * polyfill-Modules + */ + + // webshims lib uses a of http://github.com/kriskowal/es5-shim/ to implement + addPolyfill('es5', { + test: !!(support.ES5 && Function.prototype.bind), + d: ['sizzle'] + }); + + addPolyfill('dom-extend', { + f: DOMSUPPORT, + noAutoCallback: true, + d: ['es5'], + c: [16, 7, 2, 15, 30, 3, 8, 4, 9, 10, 25, 31, 34] + }); + + // + + // + + // + + // + + // + + + //