Feature #5953 » fixed-5953.patch
| app/views/my/_sidebar.html.erb | ||
|---|---|---|
|
<h4><%= l(:label_api_access_key) %></h4>
|
||
|
<div>
|
||
|
<%= link_to l(:button_show), my_api_key_path, :remote => true %>
|
||
|
<%= link_to_function l(:button_copy), "copyTextToClipboard('api-access-key')", :id => 'copy-api-access-key', :class => ['icon', 'icon-copy'] %>
|
||
|
<pre id='api-access-key' class='autoscroll'></pre>
|
||
|
</div>
|
||
|
<%= javascript_tag("$('#api-access-key').hide();") %>
|
||
|
<%= javascript_tag("$('#api-access-key, #copy-api-access-key').hide();") %>
|
||
|
<p>
|
||
|
<% if @user.api_token %>
|
||
|
<%= l(:label_api_access_key_created_on, distance_of_time_in_words(Time.now, @user.api_token.created_on)) %>
|
||
| app/views/my/show_api_key.js.erb | ||
|---|---|---|
|
$('#api-access-key').html('<%= escape_javascript @user.api_key %>').toggle();
|
||
|
$('#copy-api-access-key').toggle();
|
||
| public/javascripts/application.js | ||
|---|---|---|
|
return key;
|
||
|
}
|
||
|
function copyTextToClipboard(id) {
|
||
|
var target = document.getElementById(id);
|
||
|
if (target) {
|
||
|
var temp = document.createElement('textarea');
|
||
|
temp.value = target.innerText;
|
||
|
document.body.appendChild(temp);
|
||
|
temp.select();
|
||
|
document.execCommand('copy');
|
||
|
if (temp.parentNode) {
|
||
|
temp.parentNode.removeChild(temp);
|
||
|
}
|
||
|
}
|
||
|
return false;
|
||
|
}
|
||
|
function updateIssueFrom(url, el) {
|
||
|
$('#all_attributes input, #all_attributes textarea, #all_attributes select').each(function(){
|
||
|
$(this).data('valuebeforeupdate', $(this).val());
|
||
| public/stylesheets/application.css | ||
|---|---|---|
|
#sidebar ul li, ul.flat li {list-style-type:none;margin: 0px 2px 0px 0px; padding: 0px 0px 0px 0px;}
|
||
|
#sidebar div.wiki ul {margin:inherit; padding-left:40px;}
|
||
|
#sidebar div.wiki ul li {list-style-type:inherit;}
|
||
|
#sidebar #copy-api-access-key {float:right;}
|
||
|
#content { flex-grow: 1; background-color: #fff; margin: 0px; padding: 6px 10px 10px 10px; overflow-x: auto;}
|
||
|
html>body #content { min-height: 600px; }
|
||