mirror of
https://github.com/ajurna/cbwebreader.git
synced 2025-12-06 06:17:17 +00:00
update reveal.js
This commit is contained in:
@@ -153,7 +153,7 @@ CSP_DEFAULT_SRC = ("'none'",)
|
||||
CSP_STYLE_SRC = ("'self'", "'unsafe-inline'")
|
||||
CSP_IMG_SRC = ("'self'", "data:")
|
||||
CSP_FONT_SRC = ("'self'",)
|
||||
CSP_SCRIPT_SRC = ("'self'",)
|
||||
CSP_SCRIPT_SRC = ("'self'", "'sha256-khnq7MWUoC3fJlH98ZjaCbVOvyd5+vnfVyue/ca55JA='")
|
||||
CSP_CONNECT_SRC = ("'self'",)
|
||||
CSP_INCLUDE_NONCE_IN = ['script-src']
|
||||
CSP_SCRIPT_SRC_ATTR = ("'self'", "'unsafe-inline'")
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<nav class="navbar navbar-expand-lg navbar-light bg-light">
|
||||
<nav class="navbar navbar-expand-lg navbar-light bg-light" aria-label="menu">
|
||||
<a class="navbar-brand" href="/"><img src="{% static 'img/logo.svg' %}" class="d-inline-block align-top" height="35px" alt="CB"> Web Reader</a>
|
||||
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarNavAltMarkup" aria-controls="navbarNavAltMarkup" aria-expanded="false" aria-label="Toggle navigation">
|
||||
<span class="navbar-toggler-icon"></span>
|
||||
@@ -61,6 +61,9 @@
|
||||
================================================== -->
|
||||
<!-- Placed at the end of the document so the pages load faster -->
|
||||
{# {% bootstrap_javascript jquery='full' %}#}
|
||||
<script type="text/javascript">
|
||||
globalThis.regeneratorRuntime = undefined;
|
||||
</script>
|
||||
{% sri_static "jquery/dist/jquery.min.js" %}
|
||||
{% sri_static "bootstrap/dist/js/bootstrap.bundle.js" %}
|
||||
{% sri_static "datatables.net/js/jquery.dataTables.min.js" %}
|
||||
|
||||
@@ -82,10 +82,9 @@ def perform_action(request, operation, item_type, selector):
|
||||
return HttpResponse(400)
|
||||
if operation == 'set_classification':
|
||||
form = DirectoryEditForm(request.POST)
|
||||
if form.is_valid() and item_type == 'Directory':
|
||||
pass
|
||||
else:
|
||||
if not (form.is_valid() and item_type == 'Directory'):
|
||||
return HttpResponse(400)
|
||||
|
||||
if item_type == 'ComicBook':
|
||||
book = get_object_or_404(ComicBook, selector=selector_uuid)
|
||||
getattr(book, operation)(request.user)
|
||||
@@ -128,11 +127,6 @@ def recent_comics_json(request):
|
||||
# Ordering
|
||||
if request.POST["order[0][dir]"] == "desc":
|
||||
order_string += "-"
|
||||
if request.POST["order[0][dir]"] == "3":
|
||||
order_string += "date_added"
|
||||
elif request.POST["order[0][dir]"] == "2":
|
||||
order_string += "date_added"
|
||||
else:
|
||||
order_string += "date_added"
|
||||
comics = comics.order_by(order_string)
|
||||
comics = comics.annotate(
|
||||
@@ -235,8 +229,7 @@ def user_config_page(request, user_id):
|
||||
if request.POST:
|
||||
form = EditUserForm(request.POST)
|
||||
if form.is_valid():
|
||||
if "password" in form.cleaned_data:
|
||||
if len(form.cleaned_data["password"]) != 0:
|
||||
if "password" in form.cleaned_data and len(form.cleaned_data["password"]) != 0:
|
||||
user.set_password(form.cleaned_data["password"])
|
||||
success_message.append("Password Updated.")
|
||||
if form.cleaned_data["email"] != user.email:
|
||||
@@ -293,8 +286,7 @@ def read_comic(request, comic_selector):
|
||||
selector = uuid.UUID(bytes=urlsafe_base64_decode(comic_selector))
|
||||
book = get_object_or_404(ComicBook, selector=selector)
|
||||
misc, _ = UserMisc.objects.get_or_create(user=request.user)
|
||||
if book.directory:
|
||||
if book.directory.classification > misc.allowed_to_read:
|
||||
if book.directory and book.directory.classification > misc.allowed_to_read:
|
||||
return redirect('index')
|
||||
|
||||
pages = ComicPage.objects.filter(Comic=book)
|
||||
@@ -341,8 +333,7 @@ def get_image(request, comic_selector, page):
|
||||
selector = uuid.UUID(bytes=urlsafe_base64_decode(comic_selector))
|
||||
book = ComicBook.objects.get(selector=selector)
|
||||
misc, _ = UserMisc.objects.get_or_create(user=request.user)
|
||||
if book.directory:
|
||||
if book.directory.classification > misc.allowed_to_read:
|
||||
if book.directory and book.directory.classification > misc.allowed_to_read:
|
||||
return HttpResponse(status=401)
|
||||
img, content = book.get_image(int(page))
|
||||
return FileResponse(img, content_type=content)
|
||||
@@ -354,8 +345,7 @@ def comic_thumbnail(request, comic_selector):
|
||||
selector = uuid.UUID(bytes=urlsafe_base64_decode(comic_selector))
|
||||
book = ComicBook.objects.get(selector=selector)
|
||||
misc, _ = UserMisc.objects.get_or_create(user=request.user)
|
||||
if book.directory:
|
||||
if book.directory.classification > misc.allowed_to_read:
|
||||
if book.directory and book.directory.classification > misc.allowed_to_read:
|
||||
return HttpResponse(status=401)
|
||||
return redirect(book.get_thumbnail_url())
|
||||
|
||||
|
||||
12
package-lock.json
generated
12
package-lock.json
generated
@@ -156,9 +156,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/reveal.js": {
|
||||
"version": "4.3.0",
|
||||
"resolved": "https://registry.npmjs.org/reveal.js/-/reveal.js-4.3.0.tgz",
|
||||
"integrity": "sha512-KzZxJjj1gmxVNyplY6g9MiGwtDvZJiYkMvG1Qmaita7vWT/8eoTEK+RuIPLvxDeyxOtTz56u2wrOETVO79qL4A==",
|
||||
"version": "4.3.1",
|
||||
"resolved": "https://registry.npmjs.org/reveal.js/-/reveal.js-4.3.1.tgz",
|
||||
"integrity": "sha512-1kyEnWeUkaCdBdX//XXq9dtBK95ppvIlSwlHelrP8/wrX6LcsYp4HT9WTFoFEOUBfVqkm8C2aHQ367o+UKfcxw==",
|
||||
"engines": {
|
||||
"node": ">=10.0.0"
|
||||
}
|
||||
@@ -290,9 +290,9 @@
|
||||
"peer": true
|
||||
},
|
||||
"reveal.js": {
|
||||
"version": "4.3.0",
|
||||
"resolved": "https://registry.npmjs.org/reveal.js/-/reveal.js-4.3.0.tgz",
|
||||
"integrity": "sha512-KzZxJjj1gmxVNyplY6g9MiGwtDvZJiYkMvG1Qmaita7vWT/8eoTEK+RuIPLvxDeyxOtTz56u2wrOETVO79qL4A=="
|
||||
"version": "4.3.1",
|
||||
"resolved": "https://registry.npmjs.org/reveal.js/-/reveal.js-4.3.1.tgz",
|
||||
"integrity": "sha512-1kyEnWeUkaCdBdX//XXq9dtBK95ppvIlSwlHelrP8/wrX6LcsYp4HT9WTFoFEOUBfVqkm8C2aHQ367o+UKfcxw=="
|
||||
},
|
||||
"reveal.js-menu": {
|
||||
"version": "2.1.0",
|
||||
|
||||
Reference in New Issue
Block a user