From: jordan Date: Thu, 24 Mar 2011 13:59:14 +0000 (+0000) Subject: #SPLUNK-91, modifying the permanent link tool, adding an option to copy to the clipbo... X-Git-Tag: live~399 X-Git-Url: https://git.openstreetmap.org./osqa.git/commitdiff_plain/7fc0c9f2c94f090d9f743798cd9ef835757dcbc2?ds=sidebyside #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 --- 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 0000000..2cfe371 Binary files /dev/null and b/forum/skins/default/media/js/jquery.copy.swf differ 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 %}