From b84d94861125f9f8d25eef5659f7f8d26db5370e Mon Sep 17 00:00:00 2001 From: Alexandre Aubin Date: Wed, 6 Nov 2019 22:11:34 +0100 Subject: [PATCH] Button for the 'share with yunopaste' thing --- src/js/yunohost/controllers/diagnosis.js | 8 ++++++++ src/views/diagnosis/diagnosis_show.ms | 4 ++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/src/js/yunohost/controllers/diagnosis.js b/src/js/yunohost/controllers/diagnosis.js index d08cf03f..807e2cb9 100644 --- a/src/js/yunohost/controllers/diagnosis.js +++ b/src/js/yunohost/controllers/diagnosis.js @@ -64,6 +64,14 @@ // Render and display the view c.view('diagnosis/diagnosis_show', data, function() { + // Configure share with yunopaste button + $("button[data-action='share']").click(function() { + c.api('GET', '/diagnosis/show?share', {}, function(data) { + c.hideLoader(); + window.open(data.url, '_blank'); + }); + }); + // Configure 'rerun diagnosis' button behavior $("button[data-action='rerun-diagnosis']").click(function() { var category = $(this).data("category"); diff --git a/src/views/diagnosis/diagnosis_show.ms b/src/views/diagnosis/diagnosis_show.ms index f48ea67e..4a904b48 100644 --- a/src/views/diagnosis/diagnosis_show.ms +++ b/src/views/diagnosis/diagnosis_show.ms @@ -4,9 +4,9 @@
- +