From 7fc0c9f2c94f090d9f743798cd9ef835757dcbc2 Mon Sep 17 00:00:00 2001 From: jordan Date: Thu, 24 Mar 2011 13:59:14 +0000 Subject: [PATCH] #SPLUNK-91, modifying the permanent link tool, adding an option to copy to the clipboard if the users clicks the Ok button and just closing the AJAX popup if the user is clicking the Cancel button. git-svn-id: http://svn.osqa.net/svnroot/osqa/trunk@886 0cfe37f9-358a-4d5e-be75-b63607b5c754 --- forum/skins/default/media/js/jquery.copy.js | 1 + forum/skins/default/media/js/jquery.copy.swf | Bin 0 -> 109 bytes forum/skins/default/media/js/osqa.main.js | 4 ++++ forum/skins/default/templates/base_content.html | 1 + .../default/templates/node/permanent_link.html | 10 +++++++++- forum/views/commands.py | 13 +++++++++++-- 6 files changed, 26 insertions(+), 3 deletions(-) create mode 100644 forum/skins/default/media/js/jquery.copy.js create mode 100644 forum/skins/default/media/js/jquery.copy.swf diff --git a/forum/skins/default/media/js/jquery.copy.js b/forum/skins/default/media/js/jquery.copy.js new file mode 100644 index 0000000..93e8475 --- /dev/null +++ b/forum/skins/default/media/js/jquery.copy.js @@ -0,0 +1 @@ +jQuery.copy=function(data){return jQuery.fn.copy.call({},data);};jQuery.fn.copy=function(delimiter){var me=this,flashcopier=(function(fid){return document.getElementById(fid)||(function(){var divnode=document.createElement('div');divnode.id=fid;document.body.appendChild(divnode);return divnode;})();})('_flash_copier'),data=jQuery.map(me,function(bit){return typeof bit==='object'? bit.value||bit.innerHTML.replace(/<.+>/g,''):'';}).join(delimiter||'').replace(/^\s+|\s+$/g,'')||delimiter,divinfo='';flashcopier.innerHTML=divinfo;return this;}; diff --git a/forum/skins/default/media/js/jquery.copy.swf b/forum/skins/default/media/js/jquery.copy.swf new file mode 100644 index 0000000000000000000000000000000000000000..2cfe37185b27a7abf2db96f1ed2d6d15d7f601f8 GIT binary patch literal 109 zcmV-z0FwVhS5pUh0001ZoU349jb~usU%=9Emx)0FCc@6Z&ImM#g9$9j P93;-*0OSGyce)t=rY|(Z literal 0 HcmV?d00001 diff --git a/forum/skins/default/media/js/osqa.main.js b/forum/skins/default/media/js/osqa.main.js index d95e4e0..147cf54 100644 --- a/forum/skins/default/media/js/osqa.main.js +++ b/forum/skins/default/media/js/osqa.main.js @@ -125,6 +125,10 @@ var response_commands = { set_subscription_status: function(text) { $('.subscription-status').html(text); + }, + + copy_url: function(url) { + $.copy(url); } } diff --git a/forum/skins/default/templates/base_content.html b/forum/skins/default/templates/base_content.html index 021437c..19a6d73 100644 --- a/forum/skins/default/templates/base_content.html +++ b/forum/skins/default/templates/base_content.html @@ -47,6 +47,7 @@ /* ]] */ + {% if user_messages %}