From 756c03d8eff11c30681dec17a5c59186ef1afba4 Mon Sep 17 00:00:00 2001 From: Brice Maron Date: Tue, 8 May 2012 16:22:35 +0000 Subject: [PATCH] Try to correct query string url for search in bookmark --- js/bookmarks.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/js/bookmarks.js b/js/bookmarks.js index b1eebaa5..73986e49 100644 --- a/js/bookmarks.js +++ b/js/bookmarks.js @@ -120,13 +120,20 @@ function showBookmark(event) { }, 500); } +function replaceQueryString(url,param,value) { + var re = new RegExp("([?|&])" + param + "=.*?(&|$)","i"); + if (url.match(re)) + return url.replace(re,'$1' + param + "=" + value + '$2'); + else + return url + '&' + param + "=" + value; +} function updateBookmarksList(bookmark) { var tags = encodeEntities(bookmark.tags).split(' '); var taglist = ''; for ( var i=0, len=tags.length; i' + tags[i] + ' '; + taglist = taglist + '' + tags[i] + ' '; } if(!hasProtocol(bookmark.url)) { bookmark.url = 'http://' + bookmark.url;