From: rabuzarus <> Date: Fri, 6 May 2016 00:19:45 +0000 (+0200) Subject: poke: fix poke dialog - js tests now if there is already a questionmark in the url X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=9efc6fb8231312835cc47a0005f95b8ef6104959;p=friendica.git poke: fix poke dialog - js tests now if there is already a questionmark in the url --- diff --git a/js/theme.js b/js/theme.js index 12172291ef..18b6105a02 100644 --- a/js/theme.js +++ b/js/theme.js @@ -292,7 +292,9 @@ function loadModalTitle() { function addToModal(url) { - var url = url + '?mode=modal'; + var char = qOrAmp(url); + + var url = url + char + 'mode=modal'; var modal = $('#modal').modal(); modal @@ -393,6 +395,15 @@ function random_digits(digits) { return rnd; } +// Does we need a ? or a & to append values to a url +function qOrAmp(url) { + if(url.search('\\?') < 0) { + return '?'; + } else { + return '&'; + } +} + function insertFormatting(comment,BBcode,id) { var tmpStr = $("#comment-edit-text-" + id).val();