mirror of
https://github.com/nextcloud/server.git
synced 2026-04-29 18:11:41 -04:00
Try to correct query string url for search in bookmark
This commit is contained in:
parent
52717d2a1b
commit
fa4a52260f
1 changed files with 8 additions and 1 deletions
|
|
@ -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<len; ++i ){
|
||||
if(tags[i] != '')
|
||||
taglist = taglist + '<a class="bookmark_tag" href="?tag=' + encodeURIComponent(tags[i]) + '">' + tags[i] + '</a> ';
|
||||
taglist = taglist + '<a class="bookmark_tag" href="'+replaceQueryString( String(window.location), 'tag', encodeURIComponent(tags[i])) + '">' + tags[i] + '</a> ';
|
||||
}
|
||||
if(!hasProtocol(bookmark.url)) {
|
||||
bookmark.url = 'http://' + bookmark.url;
|
||||
|
|
|
|||
Loading…
Reference in a new issue