From b8db8427882f01a373cba4530257418270466773 Mon Sep 17 00:00:00 2001 From: zadam Date: Sun, 10 Nov 2019 19:34:15 +0100 Subject: [PATCH] added frontend API methods to refresh tabs --- docs/backend_api/BackendScriptApi.html | 43 +--- .../services_backend_script_api.js.html | 3 +- docs/frontend_api/FrontendScriptApi.html | 238 +++++++++++++++++- .../services_frontend_script_api.js.html | 16 ++ .../services/frontend_script_api.js | 16 ++ 5 files changed, 269 insertions(+), 47 deletions(-) diff --git a/docs/backend_api/BackendScriptApi.html b/docs/backend_api/BackendScriptApi.html index e4dc8c372..eec8511d8 100644 --- a/docs/backend_api/BackendScriptApi.html +++ b/docs/backend_api/BackendScriptApi.html @@ -396,7 +396,7 @@ the backend.
Source:
@@ -1533,7 +1533,7 @@ the backend.
Source:
@@ -4249,7 +4249,7 @@ if some action needs to happen on only one specific instance. -

setNoteToParent(noteId, prefix, parentNoteIdopt)

+

setNoteToParent(noteId, prefix, parentNoteId)

@@ -4284,8 +4284,6 @@ This method looks similar to toggleNoteInParent() but differs because we're look Type - Attributes - @@ -4311,14 +4309,6 @@ This method looks similar to toggleNoteInParent() but differs because we're look - - - - - - - - @@ -4342,14 +4332,6 @@ This method looks similar to toggleNoteInParent() but differs because we're look - - - - - - - - @@ -4367,22 +4349,15 @@ This method looks similar to toggleNoteInParent() but differs because we're look string +| + +null - - - <optional>
- - - - - - - @@ -4415,6 +4390,8 @@ This method looks similar to toggleNoteInParent() but differs because we're look +
Deprecated:
+ @@ -4427,7 +4404,7 @@ This method looks similar to toggleNoteInParent() but differs because we're look
Source:
@@ -4935,7 +4912,7 @@ transactional by default.
Source:
diff --git a/docs/backend_api/services_backend_script_api.js.html b/docs/backend_api/services_backend_script_api.js.html index 52e7f3546..eb68860b6 100644 --- a/docs/backend_api/services_backend_script_api.js.html +++ b/docs/backend_api/services_backend_script_api.js.html @@ -310,9 +310,10 @@ function BackendScriptApi(currentNote, apiParams) { * This method looks similar to toggleNoteInParent() but differs because we're looking up branch by prefix. * * @method + * @deprecated - this method is pretty confusing and serves specialized purpose only * @param {string} noteId * @param {string} prefix - * @param {string} [parentNoteId] + * @param {string|null} parentNoteId */ this.setNoteToParent = treeService.setNoteToParent; diff --git a/docs/frontend_api/FrontendScriptApi.html b/docs/frontend_api/FrontendScriptApi.html index 3fd3adc2b..dc8fc5a64 100644 --- a/docs/frontend_api/FrontendScriptApi.html +++ b/docs/frontend_api/FrontendScriptApi.html @@ -1366,7 +1366,7 @@
Source:
@@ -1546,7 +1546,7 @@
Source:
@@ -1785,7 +1785,7 @@
Source:
@@ -1891,7 +1891,7 @@
Source:
@@ -2050,7 +2050,7 @@
Source:
@@ -2312,7 +2312,7 @@ if some action needs to happen on only one specific instance.
Source:
@@ -2775,7 +2775,7 @@ otherwise (by e.g. createNoteLink())
Source:
@@ -2930,7 +2930,7 @@ otherwise (by e.g. createNoteLink())
Source:
@@ -3039,7 +3039,7 @@ note.
Source:
@@ -3194,7 +3194,7 @@ note.
Source:
@@ -3433,7 +3433,7 @@ note.
Source:
@@ -3463,6 +3463,218 @@ note. + + + + + + +

refreshActiveTab() → {Promise.<void>}

+ + + + + + +
+ Refresh active tab +
+ + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +Promise.<void> + + +
+
+ + + + + + + + + + + + + +

refreshAllTabs() → {Promise.<void>}

+ + + + + + +
+ Refresh current tab +
+ + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +Promise.<void> + + +
+
+ + + + + + + @@ -4308,7 +4520,7 @@ Internally this serializes the anonymous function into string and sends it to ba
Source:
@@ -4459,7 +4671,7 @@ Internally this serializes the anonymous function into string and sends it to ba
Source:
diff --git a/docs/frontend_api/services_frontend_script_api.js.html b/docs/frontend_api/services_frontend_script_api.js.html index 60cc942ba..5d9104316 100644 --- a/docs/frontend_api/services_frontend_script_api.js.html +++ b/docs/frontend_api/services_frontend_script_api.js.html @@ -293,6 +293,22 @@ function FrontendScriptApi(startNote, currentNote, originEntity = null, tabConte */ this.refreshTree = treeService.reload; + /** + * Refresh active tab + * + * @method + * @returns {Promise<void>} + */ + this.refreshActiveTab = noteDetailService.reload; + + /** + * Refresh current tab + * + * @method + * @returns {Promise<void>} + */ + this.refreshAllTabs = noteDetailService.reloadAllTabs; + /** * Create note link (jQuery object) for given note. * diff --git a/src/public/javascripts/services/frontend_script_api.js b/src/public/javascripts/services/frontend_script_api.js index e90921677..7ff5e85f5 100644 --- a/src/public/javascripts/services/frontend_script_api.js +++ b/src/public/javascripts/services/frontend_script_api.js @@ -265,6 +265,22 @@ function FrontendScriptApi(startNote, currentNote, originEntity = null, tabConte */ this.refreshTree = treeService.reload; + /** + * Refresh active tab + * + * @method + * @returns {Promise} + */ + this.refreshActiveTab = noteDetailService.reload; + + /** + * Refresh current tab + * + * @method + * @returns {Promise} + */ + this.refreshAllTabs = noteDetailService.reloadAllTabs; + /** * Create note link (jQuery object) for given note. *