Use ES5 syntax

pull/298/head
Jonathan Rehm 7 years ago
parent a8b53ab38a
commit 282837c7c5

@ -8,18 +8,17 @@ tinymce.init({
selector: "#description",
branding: false,
menubar: "edit view format",
language
language: language
});
if (!Modernizr.inputtypes.date) {
$("#pubdate").datepicker({
format: "yyyy-mm-dd",
language
language: language
}).on("change", function () {
// Show localized date over top of the standard YYYY-MM-DD date
let pubDate;
const results = /(\d{4})[-\/\\](\d{1,2})[-\/\\](\d{1,2})/.exec(this.value); // YYYY-MM-DD
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);
}
@ -29,6 +28,7 @@ if (!Modernizr.inputtypes.date) {
}).trigger("change");
}
}
/*
Takes a prefix, query typeahead callback, Bloodhound typeahead adapter
and returns the completions it gets from the bloodhound engine prefixed.
@ -43,6 +43,7 @@ function prefixedSource(prefix, query, cb, bhAdapter) {
cb(matches);
});
}
function getPath() {
var jsFileLocation = $("script[src*=edit_books]").attr("src"); // the js file path
jsFileLocation = jsFileLocation.replace("/static/js/edit_books.js", ""); // the js folder path

Loading…
Cancel
Save