From 4cf3564d28dc8e4d08a3e64f09ad045ffbde97ae Mon Sep 17 00:00:00 2001 From: ArthurHoaro Date: Fri, 25 Sep 2020 13:29:36 +0200 Subject: Add a setting to retrieve bookmark metadata asynchrounously - There is a new standalone script (metadata.js) which requests a new controller to get bookmark metadata and fill the form async - This feature is enabled with the new setting: general.enable_async_metadata (enabled by default) - general.retrieve_description is now enabled by default - A small rotating loader animation has a been added to bookmark inputs when metadata is being retrieved (default template) - Custom JS htmlentities has been removed and mathiasbynens/he library is used instead Fixes #1563 --- tpl/default/editlink.html | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) (limited to 'tpl/default/editlink.html') diff --git a/tpl/default/editlink.html b/tpl/default/editlink.html index 568545bd..7ab7e1fe 100644 --- a/tpl/default/editlink.html +++ b/tpl/default/editlink.html @@ -12,6 +12,8 @@ action="{$base_path}/admin/shaare" class="page-form pure-u-lg-3-5 pure-u-22-24 page-form page-form-light" > + {$asyncLoadClass=$link_is_new && $async_metadata && empty($link.title) ? 'loading-input' : ''} +

{if="!$link_is_new"}{'Edit Shaare'|t}{else}{'New Shaare'|t}{/if}

@@ -28,21 +30,32 @@
-
- +
+ +
+ +
-
+
+
+ +
-
+
+
+ +
@@ -88,5 +101,6 @@
{include="page.footer"} + {if="$link_is_new && $async_metadata"}{/if} -- cgit v1.2.3 From 5d8de7587d67b5c3e5d1fed8562d9b87ecde80c1 Mon Sep 17 00:00:00 2001 From: ArthurHoaro Date: Sat, 10 Oct 2020 17:40:26 +0200 Subject: Feature: bulk creation of bookmarks This changes creates a new form in addlink page allowing to create multiple bookmarks at once more easily. It focuses on re-using as much existing code and template component as possible. These changes includes: - a new form in addlink (hidden behind a button by default), containing a text area for URL, and tags/private status to apply to created links - this form displays a new template called editlink.batch, itself including editlink template multiple times - User interation in this new templates are handle by a new JS script (shaare-batch.js) making AJAX requests, and therefore does not need page reloading - ManageShaareController has been split into 3 distinct controllers: + ShaareAdd: displays addlink template + ShaareManage: various operation applied on existing shaares (change visibility, pin, deletion, etc.) + ShaarePublish: handles creation/edit forms and saving Shaare's form - Updated translations Fixes #137 --- tpl/default/editlink.html | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'tpl/default/editlink.html') diff --git a/tpl/default/editlink.html b/tpl/default/editlink.html index 7ab7e1fe..980b2b8e 100644 --- a/tpl/default/editlink.html +++ b/tpl/default/editlink.html @@ -1,3 +1,4 @@ +{if="empty($batch_mode)"} @@ -5,6 +6,10 @@ {include="page.header"} +{else} + {ignore}Lil hack: when included in a loop in batch mode, `$value` is assigned by RainTPL with template vars.{/ignore} + {function="extract($value) ? '' : ''"} +{/if} + +{if="empty($batch_mode)"} {include="page.footer"} {if="$link_is_new && $async_metadata"}{/if} +{/if} -- cgit v1.2.3 From 25e90d8d75382721ff7473fa1686090fcfeb46ff Mon Sep 17 00:00:00 2001 From: ArthurHoaro Date: Sun, 11 Oct 2020 13:34:38 +0200 Subject: Bulk creation: fix private status based on the first form --- tpl/default/editlink.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'tpl/default/editlink.html') diff --git a/tpl/default/editlink.html b/tpl/default/editlink.html index 980b2b8e..83e541fd 100644 --- a/tpl/default/editlink.html +++ b/tpl/default/editlink.html @@ -65,7 +65,7 @@
  -- cgit v1.2.3