mirror of
https://github.com/janeczku/calibre-web
synced 2025-10-26 12:57:40 +00:00
merge changes
This commit is contained in:
@@ -710,7 +710,7 @@ $(".navbar-collapse.collapse.in").before('<div class="sidebar-backdrop"></div>')
|
||||
// Get rid of leading white space
|
||||
recentlyAdded = $("#nav_new a:contains('Recently')").text().trim();
|
||||
$("#nav_new a:contains('Recently')").contents().filter(function () {
|
||||
return this.nodeType == 3
|
||||
return this.nodeType === 3
|
||||
}).each(function () {
|
||||
this.textContent = this.textContent.replace(" Recently Added", recentlyAdded);
|
||||
});
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/**
|
||||
* Created by SpeedProg on 05.04.2015.
|
||||
*/
|
||||
/* global Bloodhound, language, Modernizr, tinymce */
|
||||
/* global Bloodhound, language, Modernizr, tinymce, getPath */
|
||||
|
||||
if ($("#description").length) {
|
||||
tinymce.init({
|
||||
@@ -250,14 +250,14 @@ promisePublishers.done(function() {
|
||||
});
|
||||
|
||||
$("#search").on("change input.typeahead:selected", function(event) {
|
||||
if (event.target.type == "search" && event.target.tagName == "INPUT") {
|
||||
if (event.target.type === "search" && event.target.tagName === "INPUT") {
|
||||
return;
|
||||
}
|
||||
var form = $("form").serialize();
|
||||
$.getJSON( getPath() + "/get_matching_tags", form, function( data ) {
|
||||
$(".tags_click").each(function() {
|
||||
if ($.inArray(parseInt($(this).val(), 10), data.tags) === -1) {
|
||||
if(!$(this).prop("selected")) {
|
||||
if (!$(this).prop("selected")) {
|
||||
$(this).prop("disabled", true);
|
||||
}
|
||||
} else {
|
||||
@@ -265,10 +265,10 @@ $("#search").on("change input.typeahead:selected", function(event) {
|
||||
}
|
||||
});
|
||||
$("#include_tag option:selected").each(function () {
|
||||
$("#exclude_tag").find("[value="+$(this).val()+"]").prop("disabled", true);
|
||||
$("#exclude_tag").find("[value=" + $(this).val() + "]").prop("disabled", true);
|
||||
});
|
||||
$('#include_tag').selectpicker("refresh");
|
||||
$('#exclude_tag').selectpicker("refresh");
|
||||
$("#include_tag").selectpicker("refresh");
|
||||
$("#exclude_tag").selectpicker("refresh");
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
@@ -36,7 +36,6 @@ $("#desc").click(function() {
|
||||
sortBy: "name",
|
||||
sortAscending: true
|
||||
});
|
||||
return;
|
||||
});
|
||||
|
||||
$("#asc").click(function() {
|
||||
@@ -52,19 +51,20 @@ $("#asc").click(function() {
|
||||
sortBy: "name",
|
||||
sortAscending: false
|
||||
});
|
||||
return;
|
||||
});
|
||||
|
||||
$("#all").click(function() {
|
||||
// go through all elements and make them visible
|
||||
$list.isotope({ filter: function() {
|
||||
return true;
|
||||
} })
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
$(".char").click(function() {
|
||||
var character = this.innerText;
|
||||
$list.isotope({ filter: function() {
|
||||
return this.attributes["data-id"].value.charAt(0).toUpperCase() == character;
|
||||
} })
|
||||
return this.attributes["data-id"].value.charAt(0).toUpperCase() === character;
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
@@ -88,7 +88,7 @@ $("#desc").click(function() {
|
||||
// Find count of middle element
|
||||
var count = $(".row:visible").length;
|
||||
if (count > 20) {
|
||||
middle = parseInt(count / 2) + (count % 2);
|
||||
middle = parseInt(count / 2, 10) + (count % 2);
|
||||
|
||||
//var middle = parseInt(count / 2) + (count % 2);
|
||||
// search for the middle of all visible elements
|
||||
@@ -135,7 +135,7 @@ $("#asc").click(function() {
|
||||
// Find count of middle element
|
||||
var count = $(".row:visible").length;
|
||||
if (count > 20) {
|
||||
var middle = parseInt(count / 2) + (count % 2);
|
||||
var middle = parseInt(count / 2, 10) + (count % 2);
|
||||
|
||||
//var middle = parseInt(count / 2) + (count % 2);
|
||||
// search for the middle of all visible elements
|
||||
|
||||
@@ -138,8 +138,8 @@ $(function () {
|
||||
seriesTitle = result.series.title;
|
||||
}
|
||||
var dateFomers = result.pubdate.split("-");
|
||||
var publishedYear = parseInt(dateFomers[0]);
|
||||
var publishedMonth = parseInt(dateFomers[1]);
|
||||
var publishedYear = parseInt(dateFomers[0], 10);
|
||||
var publishedMonth = parseInt(dateFomers[1], 10);
|
||||
var publishedDate = new Date(publishedYear, publishedMonth - 1, 1);
|
||||
|
||||
publishedDate = formatDate(publishedDate);
|
||||
@@ -194,8 +194,8 @@ $(function () {
|
||||
} else {
|
||||
dateFomers = result.date_added.split("-");
|
||||
}
|
||||
var publishedYear = parseInt(dateFomers[0]);
|
||||
var publishedMonth = parseInt(dateFomers[1]);
|
||||
var publishedYear = parseInt(dateFomers[0], 10);
|
||||
var publishedMonth = parseInt(dateFomers[1], 10);
|
||||
var publishedDate = new Date(publishedYear, publishedMonth - 1, 1);
|
||||
|
||||
publishedDate = formatDate(publishedDate);
|
||||
|
||||
@@ -38,10 +38,10 @@ $(document).on("change", "input[type=\"checkbox\"][data-control]", function () {
|
||||
$(document).on("change", "select[data-control]", function() {
|
||||
var $this = $(this);
|
||||
var name = $this.data("control");
|
||||
var showOrHide = parseInt($this.val());
|
||||
var showOrHide = parseInt($this.val(), 10);
|
||||
// var showOrHideLast = $("#" + name + " option:last").val()
|
||||
for (var i = 0; i < $(this)[0].length; i++) {
|
||||
var element = parseInt($(this)[0][i].value);
|
||||
var element = parseInt($(this)[0][i].value, 10);
|
||||
if (element === showOrHide) {
|
||||
$("[data-related^=" + name + "][data-related*=-" + element + "]").show();
|
||||
} else {
|
||||
@@ -55,7 +55,7 @@ $(document).on("change", "select[data-control]", function() {
|
||||
$(document).on("change", "select[data-controlall]", function() {
|
||||
var $this = $(this);
|
||||
var name = $this.data("controlall");
|
||||
var showOrHide = parseInt($this.val());
|
||||
var showOrHide = parseInt($this.val(), 10);
|
||||
if (showOrHide) {
|
||||
$("[data-related=" + name + "]").show();
|
||||
} else {
|
||||
@@ -114,7 +114,7 @@ $(document).ready(function() {
|
||||
}
|
||||
});
|
||||
|
||||
function ConfirmDialog(id, dataValue, yesFn, noFn) {
|
||||
function confirmDialog(id, dataValue, yesFn, noFn) {
|
||||
var $confirm = $("#GeneralDeleteModal");
|
||||
// var dataValue= e.data('value'); // target.data('value');
|
||||
$confirm.modal('show');
|
||||
@@ -481,7 +481,7 @@ $(function() {
|
||||
});
|
||||
|
||||
$("#config_delete_kobo_token").click(function() {
|
||||
ConfirmDialog(
|
||||
confirmDialog(
|
||||
$(this).attr('id'),
|
||||
$(this).data('value'),
|
||||
function (value) {
|
||||
@@ -509,7 +509,7 @@ $(function() {
|
||||
});
|
||||
|
||||
$("#btndeluser").click(function() {
|
||||
ConfirmDialog(
|
||||
confirmDialog(
|
||||
$(this).attr('id'),
|
||||
$(this).data('value'),
|
||||
function(value){
|
||||
@@ -527,7 +527,7 @@ $(function() {
|
||||
});
|
||||
|
||||
$("#delete_shelf").click(function() {
|
||||
ConfirmDialog(
|
||||
confirmDialog(
|
||||
$(this).attr('id'),
|
||||
$(this).data('value'),
|
||||
function(value){
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
*/
|
||||
|
||||
/* exported TableActions, RestrictionActions, EbookActions, responseHandler */
|
||||
/* global getPath, confirmDialog */
|
||||
|
||||
var selections = [];
|
||||
|
||||
@@ -209,7 +210,7 @@ $(function() {
|
||||
striped: false
|
||||
});
|
||||
|
||||
function domain_handle(domainId) {
|
||||
function domainHandle(domainId) {
|
||||
$.ajax({
|
||||
method:"post",
|
||||
url: window.location.pathname + "/../../ajax/deletedomain",
|
||||
@@ -236,12 +237,12 @@ $(function() {
|
||||
}
|
||||
$("#domain-allow-table").on("click-cell.bs.table", function (field, value, row, $element) {
|
||||
if (value === 2) {
|
||||
ConfirmDialog("btndeletedomain", $element.id, domain_handle);
|
||||
confirmDialog("btndeletedomain", $element.id, domainHandle);
|
||||
}
|
||||
});
|
||||
$("#domain-deny-table").on("click-cell.bs.table", function (field, value, row, $element) {
|
||||
if (value === 2) {
|
||||
ConfirmDialog("btndeletedomain", $element.id, domain_handle);
|
||||
confirmDialog("btndeletedomain", $element.id, domainHandle);
|
||||
}
|
||||
});
|
||||
|
||||
@@ -255,12 +256,12 @@ $(function() {
|
||||
$("#h3").addClass("hidden");
|
||||
$("#h4").addClass("hidden");
|
||||
});
|
||||
function startTable(type, user_id) {
|
||||
function startTable(type, userId) {
|
||||
$("#restrict-elements-table").bootstrapTable({
|
||||
formatNoMatches: function () {
|
||||
return "";
|
||||
},
|
||||
url: getPath() + "/ajax/listrestriction/" + type + "/" + user_id,
|
||||
url: getPath() + "/ajax/listrestriction/" + type + "/" + userId,
|
||||
rowStyle: function(row) {
|
||||
// console.log('Reihe :' + row + " Index :" + index);
|
||||
if (row.id.charAt(0) === "a") {
|
||||
@@ -274,13 +275,13 @@ $(function() {
|
||||
$.ajax ({
|
||||
type: "Post",
|
||||
data: "id=" + row.id + "&type=" + row.type + "&Element=" + encodeURIComponent(row.Element),
|
||||
url: getPath() + "/ajax/deleterestriction/" + type + "/" + user_id,
|
||||
url: getPath() + "/ajax/deleterestriction/" + type + "/" + userId,
|
||||
async: true,
|
||||
timeout: 900,
|
||||
success:function() {
|
||||
$.ajax({
|
||||
method:"get",
|
||||
url: getPath() + "/ajax/listrestriction/" + type + "/" + user_id,
|
||||
url: getPath() + "/ajax/listrestriction/" + type + "/" + userId,
|
||||
async: true,
|
||||
timeout: 900,
|
||||
success:function(data) {
|
||||
@@ -296,7 +297,7 @@ $(function() {
|
||||
$("#restrict-elements-table").removeClass("table-hover");
|
||||
$("#restrict-elements-table").on("editable-save.bs.table", function (e, field, row) {
|
||||
$.ajax({
|
||||
url: getPath() + "/ajax/editrestriction/" + type + "/" + user_id,
|
||||
url: getPath() + "/ajax/editrestriction/" + type + "/" + userId,
|
||||
type: "Post",
|
||||
data: row
|
||||
});
|
||||
@@ -304,13 +305,13 @@ $(function() {
|
||||
$("[id^=submit_]").click(function() {
|
||||
$(this)[0].blur();
|
||||
$.ajax({
|
||||
url: getPath() + "/ajax/addrestriction/" + type + "/" + user_id,
|
||||
url: getPath() + "/ajax/addrestriction/" + type + "/" + userId,
|
||||
type: "Post",
|
||||
data: $(this).closest("form").serialize() + "&" + $(this)[0].name + "=",
|
||||
success: function () {
|
||||
$.ajax ({
|
||||
method:"get",
|
||||
url: getPath() + "/ajax/listrestriction/" + type + "/" + user_id,
|
||||
url: getPath() + "/ajax/listrestriction/" + type + "/" + userId,
|
||||
async: true,
|
||||
timeout: 900,
|
||||
success:function(data) {
|
||||
@@ -332,12 +333,12 @@ $(function() {
|
||||
$("#h1").removeClass("hidden");
|
||||
});
|
||||
$("#get_user_column_values").on("click", function() {
|
||||
startTable(3, $(this).data('id'));
|
||||
startTable(3, $(this).data("id"));
|
||||
$("#h4").removeClass("hidden");
|
||||
});
|
||||
|
||||
$("#get_user_tags").on("click", function() {
|
||||
startTable(2, $(this).data('id'));
|
||||
startTable(2, $(this).data("id"));
|
||||
$(this)[0].blur();
|
||||
$("#h3").removeClass("hidden");
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user