diff options
| author | dumpfmprod <dumpfmprod@ubuntu.(none)> | 2010-07-19 03:08:05 -0400 |
|---|---|---|
| committer | dumpfmprod <dumpfmprod@ubuntu.(none)> | 2010-07-19 03:08:05 -0400 |
| commit | 0f24f0a4186e2ce298ec9a4a1ce74c4566c6d5c8 (patch) | |
| tree | dd3830001ffee0dca8319b53842de68fbeffa784 | |
| parent | 4e50a860ebed89cd59b53bac7a5af16f4b59e941 (diff) | |
took out cookie deleter... added middle click to open search results
| -rw-r--r-- | static/js/pichat.js | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/static/js/pichat.js b/static/js/pichat.js index 38e5405..b700eb2 100644 --- a/static/js/pichat.js +++ b/static/js/pichat.js @@ -1,10 +1,10 @@ -function deleteCookie(name) { +/*function deleteCookie(name) { // Only deletes non-wildcard cookies document.cookie = name + "=;expires=Thu, 01-Jan-1970 00:00:01 GMT"; } deleteCookie('compojure-session'); deleteCookie('login-token'); - +*/ var cache = {} var PendingMessages = {} @@ -795,6 +795,7 @@ var Search = { $("#search-query").val("search dump.fm") }) $("#search-query").keydown(ifEnter(Search.doSearch)) + $("#search-results-images a").live("mouseup", Search.click) }, 'addScript': function(term) { @@ -841,7 +842,7 @@ var Search = { var imageCounter = 0 for(var i = start; i < Search.images.length; i++){ if(imageCounter > Search.imagesPerPage) break; - contentString += '<a href="'+Search.images[i]+'" target="_blank" onclick="return Search.addToChatBoxIfPossible(this)"><img src="'+Search.images[i]+'"></a>' + contentString += '<a href="'+Search.images[i]+'" target="_blank" onclick="return false"><img src="'+Search.images[i]+'"></a>' imageCounter += 1 } contentString += '<br><br><div id="search-commands">' @@ -863,6 +864,14 @@ var Search = { Search.setContent(contentString) }, + 'click': function(e){ + if (e.which == 1) // left click + if (Search.addToChatBoxIfPossible(this)) + window.open(this.href) + else if (e.which == 2) // middle click + window.open(this.href) + }, + 'addToChatBoxIfPossible': function(img){ var chatBoxExists = $("#msgInput").length if (chatBoxExists) { |
