gwtbootstrap/gwt-bootstrap

DatePicker adds unlimited tags to HEAD

Opened this issue · 1 comments

Similar to #500 but in the HEAD of the HTML Page.
When I navigate around in my project the script entries in the HEAD part of the HTML Page get more and more.

They all look the same:

<script type="text/javascript" charset="UTF-8">
/**
 * German translation for bootstrap-datetimepicker
 * Sam Zurcher <sam@orelias.ch>
 */
;(function($){
    $.fn.datetimepicker.dates['de'] = {
        days: ["Sonntag", "Montag", "Dienstag", "Mittwoch", "Donnerstag", "Freitag", "Samstag", "Sonntag"],
        daysShort: ["Son", "Mon", "Die", "Mit", "Don", "Fre", "Sam", "Son"],
        daysMin: ["So", "Mo", "Di", "Mi", "Do", "Fr", "Sa", "So"],
        months: ["Januar", "Februar", "März", "April", "Mai", "Juni", "Juli", "August", "September", "Oktober", "November", "Dezember"],
        monthsShort: ["Jan", "Feb", "Mär", "Apr", "Mai", "Jun", "Jul", "Aug", "Sep", "Okt", "Nov", "Dez"],
        today: "Heute",
        suffix: [],
        meridiem: [],
        weekStart: 1,
        format: "dd.mm.yyyy"
    };
}(jQuery));
</script>

For my own project I made a change. Now it is checked if the script is already injected. @0bc436330dd0fa8e38a5b5fa869dc56c23b1ed1b
My solution doesn't look good but works for me, maybe you can do better.