Commit 35598f74 authored by Olga Brani's avatar Olga Brani
Browse files

astakos: Api token view firefox bug fix

Auth url and API token in API access page are disabled html inputs.
On firefox, these inputs  are replaced by <span> elements  to allow them to 
be selected on user click.
parent b9d48c83
......@@ -119,7 +119,9 @@ h2 .header-actions { float: right; font-size: 0.8em;}
font-size: 0.8em;
}
.api-access-view div.detail input {
.api-access-view div.detail .dummy-input,
.api-access-view div.detail input
{
border: none;
text-decoration: none;
width: 80%;
......@@ -129,6 +131,8 @@ h2 .header-actions { float: right; font-size: 0.8em;}
cursor: pointer;
}
.api-access-view div.detail .dummy-input { display: none;}
.api-access-view div.detail {
display: block;
position: relative;
......
......@@ -87,11 +87,26 @@ if (navigator.userAgent.match(/iPhone/i)) {
$(document).ready(function() {
var is_firefox = navigator.userAgent.toLowerCase().indexOf('firefox') > -1;
/* api access */
$(".token-view .detail").click(function() {
$(this).find("input").select();
});
$('#dummy_auth_token').html( $('.token-view input[name="auth_token"]').val());
$('#dummy_token_url').html( $('.token-view input[name="token_url"]').val())
if (is_firefox ){
$('.dummy-input').show();
$('.dummy-input').next('input').css('visibility','hidden');
}
/* api access test
*/
setContainerMinHeight('.container .wrapper');
//tableFixedCols('my-projects', 25);
......
......@@ -45,14 +45,16 @@
and API token:<br /><br />
</p>
<div class="token-view">
<div class="detail small clearfix">
<div class="detail small clearfix">
<span class="title">Authentication URL</span>
<input type="text" value="{{ token_url }}" disabled />
<span id="dummy_token_url" class="dummy-input">&nbsp;</span>
<input value="{{ token_url }}" type="text" name="token_url" disabled />
</div>
<div class="detail clearfix">
<div class="facts clearfix">
<span class="title">API Token</span>
<input type="text" value="{{ request.user.auth_token }}" disabled />
<span id="dummy_auth_token" class="dummy-input">&nbsp;</span>
<input value="{{ request.user.auth_token }}" type="text" name="auth_token" disabled/>
<span class="expires">
<span class="date">
expires in {{ request.user.auth_token_expires|timeuntil }}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment