This commit is contained in:
grandeljay 2022-06-11 15:28:07 +02:00
parent d341e2b35c
commit 5859dbce10
5 changed files with 18 additions and 18 deletions

View file

@ -444,10 +444,12 @@ $(function () {
$(document).on('click', '.button.wishlist-wish-add', function () {
validateURL = true;
/** Form */
var formAdd = $('.form.wishlist-wish-add');
formAdd.trigger('reset');
formAdd.find('.dropdown').dropdown('restore defaults');
/** Modal */
var modalWishlistWishAdd = $('.ui.modal.wishlist-wish-add');
modalWishlistWishAdd.find('[name="wishlist_id"]').val($('.ui.dropdown.wishlists').dropdown('get value'));
modalWishlistWishAdd
@ -585,8 +587,6 @@ $(function () {
.then(handleFetchError)
.then(handleFetchResponse)
.then(function(response) {
console.log(response);
$('body').toast({ message: text.toast_wish_update });
wishlistsRefresh();
@ -614,8 +614,6 @@ $(function () {
.then(handleFetchError)
.then(handleFetchResponse)
.then(function(response) {
console.log(response);
$('body').toast({ message: text.toast_wish_update });
wishlistsRefresh();

View file

@ -51,7 +51,7 @@ class Embed extends Cache
$info_simplified->favicon = '';
$info_simplified->feeds = array();
$info_simplified->icon = '';
$info_simplified->image = '';
$info_simplified->image = null;
$info_simplified->keywords = array();
$info_simplified->language = '';
$info_simplified->languages = array();
@ -74,7 +74,7 @@ class Embed extends Cache
$info_simplified->favicon = (string) $info->favicon;
$info_simplified->feeds = (array) $info->feeds;
$info_simplified->icon = (string) $info->icon;
$info_simplified->image = isset($info->image) ? (string) $info->image : null;
$info_simplified->image = isset($info->image) && $info->image ? (string) $info->image : null;
$info_simplified->keywords = (array) $info->keywords;
$info_simplified->language = (string) $info->language;
$info_simplified->languages = (array) $info->languages;
@ -116,7 +116,7 @@ class Embed extends Cache
$info_simplified->favicon = $favicon && 200 === $code ? 'data:image/x-icon;base64,' . base64_encode($favicon) : '';
}
/** Repsonse code */
/** Response code */
$ch = curl_init($info_simplified->url);
curl_setopt_array($ch, $ch_options);

View file

@ -13,6 +13,8 @@ class Wish
/**
* Static
*/
public const NO_IMAGE = '/src/assets/img/no-image.svg';
public const STATUS_TEMPORARY = 'temporary';
public const STATUS_TEMPORARY_MINUTES = 30;
public const STATUS_UNAVAILABLE = 'unavailable';
@ -97,7 +99,7 @@ class Wish
}
if (empty($this->image)) {
$this->image = '/src/assets/img/no-image.svg';
$this->image = self::NO_IMAGE;
}
}
}

View file

@ -18,10 +18,10 @@ $scriptPart = '/src/assets/js/parts/wish-add.js';
<div class="ui input">
<input type="text"
name="wish_title"
placeholder="<?= $wish->title ?? '' ?>"
value="<?= $wish->title ?? '' ?>"
maxlength="128"
name="wish_title"
placeholder="<?= $wish->title ?? '' ?>"
value="<?= $wish->title ?? '' ?>"
maxlength="128"
/>
</div>
</div>
@ -30,7 +30,7 @@ $scriptPart = '/src/assets/js/parts/wish-add.js';
<label><?= __('Description') ?></label>
<textarea name="wish_description"
placeholder="<?= $wish->description ?? '' ?>"
placeholder="<?= $wish->description ?? '' ?>"
><?= $wish->description ?? '' ?></textarea>
</div>
@ -42,10 +42,10 @@ $scriptPart = '/src/assets/js/parts/wish-add.js';
<label><?= __('URL') ?></label>
<input type="url"
name="wish_url"
placeholder="<?= $wish->url ?? '' ?>"
value="<?= $wish->url ?? '' ?>"
maxlength="255"
name="wish_url"
placeholder="<?= $wish->url ?? '' ?>"
value="<?= $wish->url ?? '' ?>"
maxlength="255"
/>
</div>

View file

@ -196,8 +196,8 @@ $page->navigation();
<div class="content">
<div class="description">
<form class="ui form wishlist-wish-edit" method="POST">
<input type="hidden" name="wish_id" />
<input type="hidden" name="wishlist_id" />
<input type="hidden" name="wish_id" />
<div class="ui two column grid">
<?php include 'parts/wish-add.php' ?>