Skip to content

Commit

Permalink
Updated so that print functions work
Browse files Browse the repository at this point in the history
Print functions and article id is show on modify figure.
  • Loading branch information
paustian committed Jan 29, 2023
1 parent 28d34bb commit a7d61bb
Show file tree
Hide file tree
Showing 6 changed files with 33 additions and 29 deletions.
6 changes: 3 additions & 3 deletions Controller/UserController.php
Original file line number Diff line number Diff line change
Expand Up @@ -350,16 +350,16 @@ public function displayfigure(Request $request, BookFiguresEntity $figure = null
}
//we look for these parameters in the query string. If they are not there
//they are set to defaults.
if(!($width = $request->query->get('width'))){
if(!($width = (int)$request->query->get('width'))){
$width = 0;
}
if(!($height = $request->query->get('height'))){
if(!($height = (int)$request->query->get('height'))){
$height = 0;
}
if(!($movName = $request->query->get('movName'))){
$movName = 'movieName';
}
if(!($weight = $request->query->get('weight'))){
if(!($weight = (int)$request->query->get('weight'))){
$weight = 101;
}

Expand Down
36 changes: 19 additions & 17 deletions Resources/public/js/book.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,27 +38,29 @@ function getSelectionHtml2() {
return htmlContent;
}


(function($) {
$(document).ready(function () {
//Toggle fullscreen
$("#panel-fullscreen").click(function (e) {
e.preventDefault();

var $this = $(this);

if ($this.children('i').hasClass('fa-expand')) {
$this.children('i').removeClass('fa-expand');
$this.children('i').addClass('fa-compress');
}
else if ($this.children('i').hasClass('fa-compress')) {
$this.children('i').removeClass('fa-compress');
$this.children('i').addClass('fa-expand');
}
$(this).closest('.panel').toggleClass('panel-fullscreen');
});

$("#panel-fullscreen").click(window.doFullScreen);
$("#print-icon").click(window.doFullScreen);
$("#print-icon2").click(window.doFullScreen);
});

window.doFullScreen = function (){
if ( $("#themeLeftColumn").css("display") === "none" || $("#themeLeftColumn").css("visibility") === "hidden"){
$("#themeLeftColumn").show();
$(".navbar").show();
$(".TTM-footer").show();
$(".row").css("display", "flex");
$("#themeMainContent").css("max-width", "");
} else {
$("#themeLeftColumn").hide();
$(".navbar").hide();
$(".TTM-footer").hide();
$(".row").css("display", "contents");
$("#themeMainContent").css("max-width", "4000px");
}
};
/*
This code is toying with the idea of highlighing where the reading spot when the text scrolls. It may be as simple as
having a div in an absolute position on the page and then flashing a highlight color to show the reading spot
Expand Down
5 changes: 4 additions & 1 deletion Resources/public/js/summaryModifier.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@
"aid": aid},
{"success": this.displayNewText.bind(this), method: "POST"}
);

evt.stopPropagation();
},

Expand All @@ -51,6 +50,10 @@
this.cacheDomAndBindEvents();
//reset the sumlevel
this.$summaryLevel.val(result.sumLevel);
$("#panel-fullscreen").click(window.doFullScreen);
$("#print-icon").click(window.doFullScreen);
$("#print-icon2").click(window.doFullScreen);

},

sendAjax: function (url, data, options) {
Expand Down
2 changes: 1 addition & 1 deletion Resources/views/Admin/book_admin_modifyfigure.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
<tbody>
{% endif %}
<tr>
<td>{{ figure.chap_number }} - {{ figure.fig_number }} {{ figure.title }}</td>
<td>{{ figure.chap_number }} - {{ figure.fig_number }} {{ figure.title }} (id: {{ figure.fid }})</td>
<td><a href="{{ path('paustianbookmodule_admin_editfigure') }}/{{ figure.fid }}" class="fas fa-edit"></a>
<a href="{{ path('paustianbookmodule_admin_deletefigure') }}/{{ figure.fid }}" class="fas fa-trash" onclick="return confirm('Are you sure you want to delete this figure?')"></a></td>
</tr>
Expand Down
11 changes: 5 additions & 6 deletions Resources/views/User/book_user_displayarticle.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,10 @@
<p> None <input type="range" min="1" max="{{ max_level }}" value="1" class="slider" id="summaryVal"> Max</p>
</div>
{% endif %}
<p> <a href="{{ path('paustianbookmodule_user_toc', {bid:article.bid}) }}" title="{{ 'Table of Contents' | trans }}" class="fa fa-book"></a>|
<p class="navigation-links">
<a href="{{ path('paustianbookmodule_user_toc', {bid:article.bid}) }}" title="{{ 'Table of Contents' | trans }}" class="fa fa-book"></a>|
<a href="{{ path('paustianbookmodule_user_displaychapter', {cid:article.cid}) }}" title="{{ 'Chapter Article List' | trans }}" class="fa fa-bookmark"></a>|
<a href="{{ path('paustianbookmodule_user_displayarticle', {theme:'Printer', aid:article.aid}) }}" title="{{ 'Printable Version' | trans }}" class="fa fa-print"></a>|
<a href="{{ path('paustianbookmodule_user_displayarticlesinchapter', {theme:'Printer', cid:article.cid}) }}" title="{{ 'Printable Chapter' | trans }}" class="fa fa-bookmark-o"></a>
<span id="print-icon" title="{{ 'Printable Version' | trans }}" class="fa fa-print"></span>
</p>
{% if article.prev !=0 %}
<a href="{{ path('paustianbookmodule_user_displayarticle') }}/{{ article.prev }}" title="{{ 'Previous Article' | trans }}" class="fa fa-arrow-left"></a>
Expand All @@ -70,10 +70,9 @@
<a href="{{ path('paustianbookmodule_user_displayarticle') }}/{{ article.next }}" title="{{ 'Next Article' | trans }}" class="fa fa-arrow-right"></a>
{% endif %}
</p>
<p> <a href="{{ path('paustianbookmodule_user_toc') }}" title="{{ 'Table of Contents' | trans }}" class="fa fa-book"></a>|
<p class="navigation-links"> <a href="{{ path('paustianbookmodule_user_toc') }}" title="{{ 'Table of Contents' | trans }}" class="fa fa-book"></a>|
<a href="{{ path('paustianbookmodule_user_displaychapter') }}/{{ article.cid }}" title="{{ 'Chapter Article List' | trans }}" class="fa fa-bookmark"></a>|
<a href="{{ path('paustianbookmodule_user_displayarticle', {theme:'printer'}) }}/{{ article.aid }}" title="{{ 'Printable Version' | trans }}" class="fa fa-print"></a>|
<a href="{{ path('paustianbookmodule_user_displayarticlesinchapter', {theme:'printer', cid:article.cid}) }}" title="{{ 'Printable Chapter' | trans }}" class="fa fa-bookmark-o"></a>
<span id="print-icon2" title="{{ 'Printable Version' | trans }}" class="fa fa-print"></span>
</p>
{{ notifyDisplayHooks(constant('Paustian\\BookModule\\HookSubscriber\\ArticleUiHookSubscriber::ARTICLE_DISPLAY'), article.aid|default(null), return_url) }}
</div>
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "paustian/book-module",
"version": "5.2.1",
"version": "5.2.2",
"description": "A module for displaying a large structured document, creating figure descriptions for the book, and a glossary.",
"type": "zikula-module",
"license": "LGPL-3.0+",
Expand Down

0 comments on commit a7d61bb

Please sign in to comment.