This commit is contained in:
mrzapp 2019-03-16 06:09:51 +01:00
Родитель 0102952e1e
Коммит 6f7da0037d
6 изменённых файлов: 14 добавлений и 130 удалений

Просмотреть файл

@ -18,6 +18,7 @@
<navigation>
<name>Cookbook</name>
<route>cookbook.page.index</route>
<icon>app.svg</icon>
</navigation>
</navigations>
</info>

Просмотреть файл

@ -23,6 +23,13 @@
background-position: 50% 50%;
}
/* For some reason, some images would disappear below 30px width if they were displayed inline */
#app-navigation > ul > li > a:first-child img {
display: block;
float: left;
margin-top: 12px;
}
#app-settings {}
#app-settings .button {
width: 93%;

Просмотреть файл

@ -1,56 +1,2 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
height="32"
width="32"
version="1"
viewBox="0 0 32 32"
id="svg4"
sodipodi:docname="app.svg"
inkscape:version="0.92.1 r">
<metadata
id="metadata10">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
</cc:Work>
</rdf:RDF>
</metadata>
<defs
id="defs8" />
<sodipodi:namedview
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1"
objecttolerance="10"
gridtolerance="10"
guidetolerance="10"
inkscape:pageopacity="0"
inkscape:pageshadow="2"
inkscape:window-width="789"
inkscape:window-height="480"
id="namedview6"
showgrid="false"
inkscape:zoom="7.375"
inkscape:cx="-8.3389831"
inkscape:cy="16"
inkscape:window-x="0"
inkscape:window-y="27"
inkscape:window-maximized="0"
inkscape:current-layer="svg4" />
<path
d="M13.733 0a.915.915 0 0 0-.933.934V3.6c-1.182.304-2.243.794-3.267 1.4L7.6 3.068a.93.93 0 0 0-1.334 0l-3.2 3.2a.93.93 0 0 0 0 1.334L5 9.535c-.607 1.024-1.097 2.085-1.4 3.267H.933a.915.915 0 0 0-.933.934v4.533c0 .53.403.934.933.934H3.6c.303 1.182.793 2.243 1.4 3.267l-1.934 1.935a.93.93 0 0 0 0 1.333l3.2 3.2a.93.93 0 0 0 1.333 0L9.532 27c1.024.61 2.085 1.097 3.266 1.4v2.667c0 .53.402.933.932.933h4.534c.53 0 .933-.403.933-.935V28.4c1.18-.305 2.24-.795 3.265-1.4L24.4 28.93a.93.93 0 0 0 1.332 0l3.2-3.2a.93.93 0 0 0 0-1.333L27 22.465c.607-1.024 1.096-2.085 1.4-3.266h2.665a.915.915 0 0 0 .935-.933v-4.534a.915.915 0 0 0-.934-.933H28.4c-.304-1.182-.792-2.243-1.4-3.267L28.932 7.6a.93.93 0 0 0 0-1.334l-3.2-3.2a.93.93 0 0 0-1.333 0L22.465 5c-1.024-.607-2.084-1.097-3.266-1.4V.933A.915.915 0 0 0 18.267 0zM16 8.87A7.134 7.134 0 0 1 23.13 16 7.134 7.134 0 0 1 16 23.133c-3.936 0-7.13-3.196-7.13-7.132S12.063 8.87 16 8.87z"
display="block"
fill="#fff"
id="path2"
style="fill:#ffffff" />
</svg>
<?xml version="1.0" encoding="utf-8"?>
<svg width="1792" height="1792" viewBox="0 0 1792 1792" xmlns="http://www.w3.org/2000/svg"><path d="M832 64v640q0 61-35.5 111t-92.5 70v779q0 52-38 90t-90 38h-128q-52 0-90-38t-38-90v-779q-57-20-92.5-70t-35.5-111v-640q0-26 19-45t45-19 45 19 19 45v416q0 26 19 45t45 19 45-19 19-45v-416q0-26 19-45t45-19 45 19 19 45v416q0 26 19 45t45 19 45-19 19-45v-416q0-26 19-45t45-19 45 19 19 45zm768 0v1600q0 52-38 90t-90 38h-128q-52 0-90-38t-38-90v-512h-224q-13 0-22.5-9.5t-9.5-22.5v-800q0-132 94-226t226-94h256q26 0 45 19t19 45z" fill="#fff"/></svg>

До

Ширина:  |  Высота:  |  Размер: 2.4 KiB

После

Ширина:  |  Высота:  |  Размер: 574 B

Просмотреть файл

@ -176,7 +176,7 @@ View.prototype = {
.replace(/{{name}}/g, recipe.name);
});
$('#app-navigation ul#recipes').html(html);
$('#app-navigation #recipes').html(html);
// change recipe folder
$('#recipe-folder').click(function(e) {
@ -223,7 +223,7 @@ View.prototype = {
});
// load a recipe
$('#app-navigation ul a').click(function (e) {
$('#app-navigation #recipes a').click(function (e) {
var id = parseInt($(this).data('id'));
self._cookbook.load(id);
self.render();

Просмотреть файл

@ -286,7 +286,8 @@ class RecipeService {
if($size === 'thumb') {
$img = new \OC_Image();
$img->loadFromData($recipe_image_data);
$img->resize(64);
$img->resize(128);
$img->centerCrop();
$recipe_image_data = $img->data();
}

Просмотреть файл

@ -1,71 +0,0 @@
<?php
namespace OCA\Cookbook\Service;
use OCP\AppFramework\Controller;
use OCP\IConfig;
use OCP\IRequest;
use OCP\IUserManager;
use OCP\IUserSession;
use OCP\AppFramework\Http\JSONResponse;
class SettingsService
{
private $config;
/* Default values */
private $defaults = [
"folder" => "/Recipes"
];
public function __construct(
IConfig $config
) {
$this->config = $config;
}
/**
* @throws \OCP\PreConditionNotMetException
*/
public function set($uid, $settings) {
// remove illegal, empty and default settings
foreach($settings as $name => $value) {
if(!array_key_exists($name, $this->defaults)
|| empty($value)
|| $value === $this->defaults[$name]
) {
unset($settings[$name]);
}
}
$this->config->setUserValue($uid, 'cookbook', 'settings', json_encode($settings));
}
public function getAll($uid) {
$settings = json_decode($this->config->getUserValue($uid, 'notes', 'settings'));
if(is_object($settings)) {
// use default for empty settings
foreach($this->defaults as $name => $defaultValue) {
if(!property_exists($settings, $name) || empty($settings->{$name})) {
$settings->{$name} = $defaultValue;
}
}
} else {
$settings = (object)$this->defaults;
}
return $settings;
}
/**
* @throws \OCP\PreConditionNotMetException
*/
public function get($uid, $name) {
$settings = $this->getAll($uid);
if(property_exists($settings, $name)) {
return $settings->{$name};
} else {
throw new \OCP\PreConditionNotMetException('Setting '.$name.' not found for user '.$uid.'.');
}
}
}
?>