Skip to content

Commit 67750fe

Browse files
author
root
committed
Fixes #17
1 parent 162eab8 commit 67750fe

File tree

4 files changed

+39
-4
lines changed

4 files changed

+39
-4
lines changed

appinfo/info.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<name>Cookbook</name>
66
<summary>An integrated cookbook using schema.org JSON files as recipes</summary>
77
<description><![CDATA[A library for all your recipes. It uses JSON files following the schema.org recipe format. To add a recipe to the collection, you can paste in the URL of the recipe, and the provided web page will be parsed and downloaded to whichever folder you specify in the app settings.]]></description>
8-
<version>0.3.1</version>
8+
<version>0.3.2</version>
99
<licence>agpl</licence>
1010
<author mail="[email protected]" >Jeppe Zapp</author>
1111
<namespace>Cookbook</namespace>

css/style.css

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -210,3 +210,30 @@
210210
margin-left: auto;
211211
display: block;
212212
}
213+
214+
/**
215+
* Print
216+
*/
217+
@media print {
218+
#header,
219+
#app-navigation,
220+
.recipe-toolbar {
221+
display: none !important;
222+
}
223+
224+
#content,
225+
#app-content-wrapper {
226+
display: block !important;
227+
padding: 0 !important;
228+
overflow: visible !important;
229+
}
230+
231+
#app-content {
232+
margin-left: 0 !important;
233+
}
234+
235+
a:link:after,
236+
a:visited:after {
237+
content:" [" attr(href) "] ";
238+
}
239+
}

js/script.js

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,8 @@ var Content = function (cookbook) {
149149
$('#app-content-wrapper form').off('submit');
150150
$('#app-content-wrapper form').submit(self.onUpdateRecipe);
151151

152-
$('#app-content-wrapper .icon-delete').click(self.onDeleteRecipe);
152+
$('#print-recipe').click(self.onPrintRecipe);
153+
$('#delete-recipe').click(self.onDeleteRecipe);
153154

154155
self.updateListItems();
155156

@@ -192,6 +193,12 @@ var Content = function (cookbook) {
192193
});
193194
};
194195

196+
/**
197+
* Event: Print recipe
198+
*/
199+
self.onPrintRecipe = function(e) {
200+
window.print();
201+
};
195202

196203
/**
197204
* Updates all lists items with click events

templates/content/recipe.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,9 @@
66
<?php } ?>
77

88
<div class="recipe-toolbar">
9-
<a href="#<?php echo $_['id']; ?>|edit" class="button svg action icon-rename" title="<?php p($l->t('Edit recipe')); ?>"></a>
10-
<button class="button svg action icon-delete" data-id="<?php echo $_['id']; ?>" title="<?php p($l->t('Delete recipe')); ?>"></button>
9+
<a id="edit-recipe" href="#<?php echo $_['id']; ?>|edit" class="button svg action icon-rename" title="<?php p($l->t('Edit recipe')); ?>"></a>
10+
<button id="print-recipe" class="button svg action icon-category-office" title="<?php p($l->t('Print recipe')); ?>"></button>
11+
<button id="delete-recipe" class="button svg action icon-delete" data-id="<?php echo $_['id']; ?>" title="<?php p($l->t('Delete recipe')); ?>"></button>
1112
</div>
1213

1314
<h2><?php echo $_['name']; ?></h2>

0 commit comments

Comments
 (0)