From 5d1c8ca68b24b3d0986cd3c9d5279acf1030c0cc Mon Sep 17 00:00:00 2001 From: Simon Smith Date: Tue, 2 Apr 2024 23:36:05 +0100 Subject: [PATCH] add open web link to mobile ui (#5985) Signed-off-by: si458 --- views/default-mobile.handlebars | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/views/default-mobile.handlebars b/views/default-mobile.handlebars index 916366bd..593dae4e 100644 --- a/views/default-mobile.handlebars +++ b/views/default-mobile.handlebars @@ -926,6 +926,7 @@
    +  
@@ -3940,6 +3941,22 @@ }, "Start chat session?"); } + function deviceUrlFunction() { + if (xxdialogMode) return; + setDialogMode(2, "Open Page on Device", 3, deviceUrlFunctionEx, ''); + Q('d2devurl').focus(); + deviceUrlFunctionValidate(); + } + + function deviceUrlFunctionValidate() { + var x = Q('d2devurl').value.toLowerCase(); + QE('idx_dlgOkButton', ((x.startsWith('http://') && (x.length > 7)) || (x.startsWith('https://') && (x.length > 8)))); + } + + function deviceUrlFunctionEx() { + meshserver.send({ action: 'msg', type: 'openUrl', nodeid: currentNode._id, url: Q('d2devurl').value }); + } + // Look to see if we need to update the device timeline function updateDeviceTimeline() { if ((meshserver.State != 2) || (powerTimelineNode == null) || (powerTimelineUpdate == null) || (currentNode == null) || (currentNode.mtype == 3)) return;