mirror of
https://github.com/nottinghamtec/PyRIGS.git
synced 2026-01-17 05:22:16 +00:00
Remove flatpickr polyfill
Firefox now supports it natively...finally! Closes #475
This commit is contained in:
@@ -20,8 +20,6 @@
|
||||
<script src="{% static 'js/autocompleter.js' %}"></script>
|
||||
<script src="{% static 'js/tooltip.js' %}"></script>
|
||||
|
||||
{% include 'partials/datetime-fix.html' %}
|
||||
|
||||
<script>
|
||||
$(document).ready(function () {
|
||||
$('button[data-action=add]').on('click', function (event) {
|
||||
|
||||
@@ -23,8 +23,6 @@
|
||||
<script src="{% static 'js/interaction.js' %}"></script>
|
||||
<script src="{% static 'js/tooltip.js' %}"></script>
|
||||
|
||||
{% include 'partials/datetime-fix.html' %}
|
||||
|
||||
<script>
|
||||
const matches = window.matchMedia("(prefers-reduced-motion: reduce)").matches || window.matchMedia("(update: slow)").matches;
|
||||
$(document).ready(function () {
|
||||
|
||||
@@ -27,7 +27,6 @@ function styles(done) {
|
||||
'node_modules/fullcalendar/main.css',
|
||||
'node_modules/bootstrap-select/dist/css/bootstrap-select.css',
|
||||
'node_modules/ajax-bootstrap-select/dist/css/ajax-bootstrap-select.css',
|
||||
'node_modules/flatpickr/dist/flatpickr.css',
|
||||
'node_modules/simplemde/dist/simplemde.min.css'
|
||||
])
|
||||
.pipe(sourcemaps.init())
|
||||
@@ -60,7 +59,6 @@ function scripts() {
|
||||
'node_modules/marked/marked.min.js',
|
||||
'node_modules/html5sortable/dist/html5sortable.min.js',
|
||||
'node_modules/clipboard/dist/clipboard.min.js',
|
||||
'node_modules/flatpickr/dist/flatpickr.min.js',
|
||||
'node_modules/moment/moment.js',
|
||||
'node_modules/fullcalendar/main.js',
|
||||
'node_modules/bootstrap-select/dist/js/bootstrap-select.js',
|
||||
|
||||
11
package-lock.json
generated
11
package-lock.json
generated
@@ -17,7 +17,6 @@
|
||||
"bootstrap-select": "^1.13.17",
|
||||
"clipboard": "^2.0.8",
|
||||
"cssnano": "^5.0.13",
|
||||
"flatpickr": "^4.6.6",
|
||||
"fullcalendar": "^5.10.1",
|
||||
"gulp": "^4.0.2",
|
||||
"gulp-concat": "^2.6.1",
|
||||
@@ -2744,11 +2743,6 @@
|
||||
"node": ">= 0.10"
|
||||
}
|
||||
},
|
||||
"node_modules/flatpickr": {
|
||||
"version": "4.6.9",
|
||||
"resolved": "https://registry.npmjs.org/flatpickr/-/flatpickr-4.6.9.tgz",
|
||||
"integrity": "sha512-F0azNNi8foVWKSF+8X+ZJzz8r9sE1G4hl06RyceIaLvyltKvDl6vqk9Lm/6AUUCi5HWaIjiUbk7UpeE/fOXOpw=="
|
||||
},
|
||||
"node_modules/flush-write-stream": {
|
||||
"version": "1.1.1",
|
||||
"resolved": "https://registry.npmjs.org/flush-write-stream/-/flush-write-stream-1.1.1.tgz",
|
||||
@@ -11183,11 +11177,6 @@
|
||||
"resolved": "https://registry.npmjs.org/flagged-respawn/-/flagged-respawn-1.0.1.tgz",
|
||||
"integrity": "sha512-lNaHNVymajmk0OJMBn8fVUAU1BtDeKIqKoVhk4xAALB57aALg6b4W0MfJ/cUE0g9YBXy5XhSlPIpYIJ7HaY/3Q=="
|
||||
},
|
||||
"flatpickr": {
|
||||
"version": "4.6.9",
|
||||
"resolved": "https://registry.npmjs.org/flatpickr/-/flatpickr-4.6.9.tgz",
|
||||
"integrity": "sha512-F0azNNi8foVWKSF+8X+ZJzz8r9sE1G4hl06RyceIaLvyltKvDl6vqk9Lm/6AUUCi5HWaIjiUbk7UpeE/fOXOpw=="
|
||||
},
|
||||
"flush-write-stream": {
|
||||
"version": "1.1.1",
|
||||
"resolved": "https://registry.npmjs.org/flush-write-stream/-/flush-write-stream-1.1.1.tgz",
|
||||
|
||||
@@ -14,7 +14,6 @@
|
||||
"bootstrap-select": "^1.13.17",
|
||||
"clipboard": "^2.0.8",
|
||||
"cssnano": "^5.0.13",
|
||||
"flatpickr": "^4.6.6",
|
||||
"fullcalendar": "^5.10.1",
|
||||
"gulp": "^4.0.2",
|
||||
"gulp-concat": "^2.6.1",
|
||||
|
||||
@@ -1,34 +0,0 @@
|
||||
{% load static %}
|
||||
<script>
|
||||
function initDatetime() {
|
||||
$('input[type=datetime-local]').not(':disabled').flatpickr({
|
||||
dateFormat: 'Y-m-dTH:m',
|
||||
enableTime: true,
|
||||
allowInput: true,
|
||||
altInput: true,
|
||||
altFormat: "d/m/y H:m",
|
||||
});
|
||||
}
|
||||
$(document).ready(function () {
|
||||
function supportsDateTime() {
|
||||
var input = document.createElement('input');
|
||||
input.setAttribute('type','datetime-local');
|
||||
return input.type !== "text";
|
||||
}
|
||||
//Firefox reports support for datetime-local without properly supporting it. Bah.
|
||||
if(!supportsDateTime() || navigator.userAgent.toLowerCase().indexOf('firefox') > -1){
|
||||
$('<link>')
|
||||
.appendTo('head')
|
||||
.attr({type : 'text/css', rel : 'stylesheet'})
|
||||
.attr('href', '{% static "css/flatpickr.css" %}');
|
||||
$.when(
|
||||
$.getScript( '{% static "js/flatpickr.min.js" %}' ),
|
||||
$.Deferred(function(deferred){
|
||||
$(deferred.resolve);
|
||||
})
|
||||
).done(function(){
|
||||
initDatetime();
|
||||
});
|
||||
}
|
||||
});
|
||||
</script>
|
||||
Reference in New Issue
Block a user