mirror of
https://github.com/janeczku/calibre-web
synced 2025-10-26 12:57:40 +00:00
Always use bootstrap datepicker
This commit is contained in:
@@ -21,57 +21,26 @@ if ($(".tiny_editor").length) {
|
||||
});
|
||||
}
|
||||
|
||||
if (!Modernizr.inputtypes.date) {
|
||||
$("#pubdate").datepicker({
|
||||
format: "yyyy-mm-dd",
|
||||
language: language
|
||||
}).on("change", function () {
|
||||
// Show localized date over top of the standard YYYY-MM-DD date
|
||||
var pubDate;
|
||||
var results = /(\d{4})[-\/\\](\d{1,2})[-\/\\](\d{1,2})/.exec(this.value); // YYYY-MM-DD
|
||||
if (results) {
|
||||
pubDate = new Date(results[1], parseInt(results[2], 10) - 1, results[3]) || new Date(this.value);
|
||||
$("#fake_pubdate")
|
||||
.val(pubDate.toLocaleDateString(language))
|
||||
.removeClass("hidden");
|
||||
}
|
||||
}).trigger("change");
|
||||
}
|
||||
$(".datepicker").datepicker({
|
||||
format: "yyyy-mm-dd",
|
||||
language: language
|
||||
}).on("change", function () {
|
||||
// Show localized date over top of the standard YYYY-MM-DD date
|
||||
var pubDate;
|
||||
var results = /(\d{4})[-\/\\](\d{1,2})[-\/\\](\d{1,2})/.exec(this.value); // YYYY-MM-DD
|
||||
if (results) {
|
||||
pubDate = new Date(results[1], parseInt(results[2], 10) - 1, results[3]) || new Date(this.value);
|
||||
$(this).next('input')
|
||||
.val(pubDate.toLocaleDateString(language))
|
||||
.removeClass("hidden");
|
||||
}
|
||||
}).trigger("change");
|
||||
|
||||
|
||||
if (!Modernizr.inputtypes.date) {
|
||||
$("#Publishstart").datepicker({
|
||||
format: "yyyy-mm-dd",
|
||||
language: language
|
||||
}).on("change", function () {
|
||||
// Show localized date over top of the standard YYYY-MM-DD date
|
||||
var pubDate;
|
||||
var results = /(\d{4})[-\/\\](\d{1,2})[-\/\\](\d{1,2})/.exec(this.value); // YYYY-MM-DD
|
||||
if (results) {
|
||||
pubDate = new Date(results[1], parseInt(results[2], 10) - 1, results[3]) || new Date(this.value);
|
||||
$("#fake_Publishstart")
|
||||
.val(pubDate.toLocaleDateString(language))
|
||||
.removeClass("hidden");
|
||||
}
|
||||
}).trigger("change");
|
||||
}
|
||||
|
||||
if (!Modernizr.inputtypes.date) {
|
||||
$("#Publishend").datepicker({
|
||||
format: "yyyy-mm-dd",
|
||||
language: language
|
||||
}).on("change", function () {
|
||||
// Show localized date over top of the standard YYYY-MM-DD date
|
||||
var pubDate;
|
||||
var results = /(\d{4})[-\/\\](\d{1,2})[-\/\\](\d{1,2})/.exec(this.value); // YYYY-MM-DD
|
||||
if (results) {
|
||||
pubDate = new Date(results[1], parseInt(results[2], 10) - 1, results[3]) || new Date(this.value);
|
||||
$("#fake_Publishend")
|
||||
.val(pubDate.toLocaleDateString(language))
|
||||
.removeClass("hidden");
|
||||
}
|
||||
}).trigger("change");
|
||||
}
|
||||
$(".datepicker_delete").click(function() {
|
||||
var inputs = $(this).parent().siblings('input');
|
||||
$(inputs[0]).data('datepicker').clearDates();
|
||||
$(inputs[1]).addClass('hidden');
|
||||
});
|
||||
|
||||
|
||||
/*
|
||||
|
||||
5
cps/static/js/libs/plugins.js
vendored
5
cps/static/js/libs/plugins.js
vendored
@@ -1,8 +1,3 @@
|
||||
/* Function to select for custom build: form input types
|
||||
/*! modernizr 3.6.0 (Custom Build) | MIT *
|
||||
* https://modernizr.com/download/?-inputtypes-setclasses !*/
|
||||
!function(e,t,n){function a(e,t){return typeof e===t}function s(){var e,t,n,s,i,o,c;for(var u in r)if(r.hasOwnProperty(u)){if(e=[],t=r[u],t.name&&(e.push(t.name.toLowerCase()),t.options&&t.options.aliases&&t.options.aliases.length))for(n=0;n<t.options.aliases.length;n++)e.push(t.options.aliases[n].toLowerCase());for(s=a(t.fn,"function")?t.fn():t.fn,i=0;i<e.length;i++)o=e[i],c=o.split("."),1===c.length?Modernizr[c[0]]=s:(!Modernizr[c[0]]||Modernizr[c[0]]instanceof Boolean||(Modernizr[c[0]]=new Boolean(Modernizr[c[0]])),Modernizr[c[0]][c[1]]=s),l.push((s?"":"no-")+c.join("-"))}}function i(e){var t=u.className,n=Modernizr._config.classPrefix||"";if(f&&(t=t.baseVal),Modernizr._config.enableJSClass){var a=new RegExp("(^|\\s)"+n+"no-js(\\s|$)");t=t.replace(a,"$1"+n+"js$2")}Modernizr._config.enableClasses&&(t+=" "+n+e.join(" "+n),f?u.className.baseVal=t:u.className=t)}function o(){return"function"!=typeof t.createElement?t.createElement(arguments[0]):f?t.createElementNS.call(t,"http://www.w3.org/2000/svg",arguments[0]):t.createElement.apply(t,arguments)}var l=[],r=[],c={_version:"3.6.0",_config:{classPrefix:"",enableClasses:!0,enableJSClass:!0,usePrefixes:!0},_q:[],on:function(e,t){var n=this;setTimeout(function(){t(n[e])},0)},addTest:function(e,t,n){r.push({name:e,fn:t,options:n})},addAsyncTest:function(e){r.push({name:null,fn:e})}},Modernizr=function(){};Modernizr.prototype=c,Modernizr=new Modernizr;var u=t.documentElement,f="svg"===u.nodeName.toLowerCase(),p=o("input"),d="search tel url email datetime date month week time datetime-local number range color".split(" "),m={};Modernizr.inputtypes=function(e){for(var a,s,i,o=e.length,l="1)",r=0;o>r;r++)p.setAttribute("type",a=e[r]),i="text"!==p.type&&"style"in p,i&&(p.value=l,p.style.cssText="position:absolute;visibility:hidden;",/^range$/.test(a)&&p.style.WebkitAppearance!==n?(u.appendChild(p),s=t.defaultView,i=s.getComputedStyle&&"textfield"!==s.getComputedStyle(p,null).WebkitAppearance&&0!==p.offsetHeight,u.removeChild(p)):/^(search|tel)$/.test(a)||(i=/^(url|email)$/.test(a)?p.checkValidity&&p.checkValidity()===!1:p.value!=l)),m[e[r]]=!!i;return m}(d),s(),i(l),delete c.addTest,delete c.addAsyncTest;for(var h=0;h<Modernizr._q.length;h++)Modernizr._q[h]();e.Modernizr=Modernizr}(window,document);
|
||||
|
||||
/*!
|
||||
* @fileOverview TouchSwipe - jQuery Plugin
|
||||
* @version 1.6.18
|
||||
|
||||
Reference in New Issue
Block a user