aboutsummaryrefslogtreecommitdiffhomepage
path: root/app/Resources/static/themes
diff options
context:
space:
mode:
authoradev <adev2000@gmail.com>2017-05-07 17:21:30 +0200
committeradev <adev2000@gmail.com>2017-06-04 11:38:29 +0200
commit2c3e148b0029a094431622feac79fafcd0d43fc8 (patch)
treef59d3d2088af87f3898b4c4de28639b70efbe4b4 /app/Resources/static/themes
parenta687c8d915276eee0c0494156700f7d0c0606735 (diff)
downloadwallabag-2c3e148b0029a094431622feac79fafcd0d43fc8.tar.gz
wallabag-2c3e148b0029a094431622feac79fafcd0d43fc8.tar.zst
wallabag-2c3e148b0029a094431622feac79fafcd0d43fc8.zip
Displays an error with an annotation with a too long quote
Fix #2762
Diffstat (limited to 'app/Resources/static/themes')
-rw-r--r--app/Resources/static/themes/_global/index.js16
1 files changed, 15 insertions, 1 deletions
diff --git a/app/Resources/static/themes/_global/index.js b/app/Resources/static/themes/_global/index.js
index 3fdcaa3d..3ec26488 100644
--- a/app/Resources/static/themes/_global/index.js
+++ b/app/Resources/static/themes/_global/index.js
@@ -34,7 +34,21 @@ $(document).ready(() => {
34 app.registry.registerUtility(authorization, 'authorizationPolicy'); 34 app.registry.registerUtility(authorization, 'authorizationPolicy');
35 35
36 const x = JSON.parse($('#annotationroutes').html()); 36 const x = JSON.parse($('#annotationroutes').html());
37 app.include(annotator.storage.http, x); 37 app.include(annotator.storage.http, $.extend({}, x, {
38 onError(msg, xhr) {
39 if (!Object.prototype.hasOwnProperty.call(xhr, 'responseJSON')) {
40 annotator.notification.banner('An error occurred', 'error');
41 return;
42 }
43 $.each(xhr.responseJSON.children, (k, v) => {
44 if (v.errors) {
45 $.each(v.errors, (n, errorText) => {
46 annotator.notification.banner(errorText, 'error');
47 });
48 }
49 });
50 },
51 }));
38 52
39 app.start().then(() => { 53 app.start().then(() => {
40 app.annotations.load({ entry: x.entryId }); 54 app.annotations.load({ entry: x.entryId });