update jquery/jquery-ui; fininshed api_key editing (needs a bit more validating); added PhpSettings-Unit-test
Signed-off-by: Michael Kaufmann <michael.kaufmann@aixit.com>
This commit is contained in:
9
templates/Sparkle/api_keys/keys_key.tpl
vendored
9
templates/Sparkle/api_keys/keys_key.tpl
vendored
@@ -1,12 +1,12 @@
|
||||
<tr <if $isMyKey>class="primary-entry"</if>>
|
||||
<tr <if $isMyKey>class="primary-entry"</if> id="apikey-{$row['id']}" data-id="{$row['id']}" title="{$lng['apikeys']['clicktoview']}">
|
||||
<td>
|
||||
{$adminCustomerLink}
|
||||
</td>
|
||||
<td>
|
||||
<span id="apikey-{$row['id']}" data-id="{$row['id']}" title="{$lng['apikeys']['clicktoview']}">{$row['_apikey']}</span>
|
||||
<span>{$row['_apikey']}</span>
|
||||
</td>
|
||||
<td>
|
||||
<span id="secret-{$row['id']}" data-id="{$row['id']}" title="{$lng['apikeys']['clicktoview']}">{$row['_secret']}</span>
|
||||
<span>{$row['_secret']}</span>
|
||||
</td>
|
||||
<td>
|
||||
{$row['allowed_from']}
|
||||
@@ -17,9 +17,6 @@
|
||||
<if !$isValid></span></strong></if>
|
||||
</td>
|
||||
<td>
|
||||
<a href="{$linker->getLink(array('section' => 'index', 'page' => $page, 'action' => 'edit', 'id' => $row['id']))}">
|
||||
<img src="templates/{$theme}/assets/img/icons/edit.png" alt="{$lng['panel']['edit']}" title="{$lng['panel']['edit']}" />
|
||||
</a>
|
||||
<a href="{$linker->getLink(array('section' => 'index', 'page' => $page, 'action' => 'delete', 'id' => $row['id']))}">
|
||||
<img src="templates/{$theme}/assets/img/icons/delete.png" alt="{$lng['panel']['delete']}" title="{$lng['panel']['delete']}" />
|
||||
</a>
|
||||
|
||||
52
templates/Sparkle/assets/js/apikey.js
vendored
52
templates/Sparkle/assets/js/apikey.js
vendored
@@ -2,6 +2,21 @@
|
||||
*
|
||||
*/
|
||||
$(document).ready(function() {
|
||||
|
||||
var getUrlParameter = function getUrlParameter(sParam) {
|
||||
var sPageURL = decodeURIComponent(window.location.search.substring(1)),
|
||||
sURLVariables = sPageURL.split('&'),
|
||||
sParameterName,
|
||||
i;
|
||||
|
||||
for (i = 0; i < sURLVariables.length; i++) {
|
||||
sParameterName = sURLVariables[i].split('=');
|
||||
|
||||
if (sParameterName[0] === sParam) {
|
||||
return sParameterName[1] === undefined ? true : sParameterName[1];
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
function editApikey(id) {
|
||||
var sid = getUrlParameter('s');
|
||||
@@ -11,11 +26,17 @@ $(document).ready(function() {
|
||||
var allowed_from = $('#dialog-' + id + ' input[name="allowed_from"]').val();
|
||||
var valid_until = $('#dialog-' + id + ' input[name="valid_until"]').val();
|
||||
|
||||
// convert datepicker yy-mm-dd to Timestamp
|
||||
var s = 0;
|
||||
if (valid_until.length > 0) {
|
||||
s = $('#dialog-' + id + ' input[name="valid_until"]').datepicker("getDate").getTime() / 1000 + 3600;
|
||||
}
|
||||
|
||||
$.ajax({
|
||||
url: "admin_index.php?s="+sid+"&page="+page+"&action=jqEditApiKey",
|
||||
type: "POST",
|
||||
data: {
|
||||
id: apikey_id, allowed_from: allowed_from, valid_until: valid_until
|
||||
id: apikey_id, allowed_from: allowed_from, valid_until: s
|
||||
},
|
||||
dataType: "json",
|
||||
success: function(json) {
|
||||
@@ -28,17 +49,24 @@ $(document).ready(function() {
|
||||
});
|
||||
}
|
||||
|
||||
$("span[id|='apikey'], span[id|='secret']").click(function() {
|
||||
var id = $(this).attr('data-id');
|
||||
$('#dialog-' + id).dialog({
|
||||
modal : true,
|
||||
buttons : {
|
||||
Ok : function() {
|
||||
editApikey(id);
|
||||
$(this).dialog("close");
|
||||
}
|
||||
},
|
||||
width : 800
|
||||
$("tr[id|='apikey']").each(function() {
|
||||
$(this).css('cursor', 'pointer').hover(function() {
|
||||
$(this).addClass('active');
|
||||
}, function() {
|
||||
$(this).removeClass('active');
|
||||
}).click(function() {
|
||||
var id = $(this).attr('data-id');
|
||||
$('input[name="valid_until"]').datepicker({'dateFormat': 'yy-mm-dd'});
|
||||
$('#dialog-' + id).dialog({
|
||||
modal : true,
|
||||
buttons : {
|
||||
Ok : function() {
|
||||
editApikey(id);
|
||||
$(this).dialog("close");
|
||||
}
|
||||
},
|
||||
width : 800
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
15
templates/Sparkle/assets/js/domains.js
vendored
15
templates/Sparkle/assets/js/domains.js
vendored
@@ -1,5 +1,20 @@
|
||||
$(document).ready(function() {
|
||||
|
||||
var getUrlParameter = function getUrlParameter(sParam) {
|
||||
var sPageURL = decodeURIComponent(window.location.search.substring(1)),
|
||||
sURLVariables = sPageURL.split('&'),
|
||||
sParameterName,
|
||||
i;
|
||||
|
||||
for (i = 0; i < sURLVariables.length; i++) {
|
||||
sParameterName = sURLVariables[i].split('=');
|
||||
|
||||
if (sParameterName[0] === sParam) {
|
||||
return sParameterName[1] === undefined ? true : sParameterName[1];
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* disable unusable php-configuration by customer settings
|
||||
*/
|
||||
|
||||
15
templates/Sparkle/assets/js/main.js
vendored
15
templates/Sparkle/assets/js/main.js
vendored
@@ -6,21 +6,6 @@ function twoDigits(value) {
|
||||
}
|
||||
$(document).ready(function() {
|
||||
|
||||
var getUrlParameter = function getUrlParameter(sParam) {
|
||||
var sPageURL = decodeURIComponent(window.location.search.substring(1)),
|
||||
sURLVariables = sPageURL.split('&'),
|
||||
sParameterName,
|
||||
i;
|
||||
|
||||
for (i = 0; i < sURLVariables.length; i++) {
|
||||
sParameterName = sURLVariables[i].split('=');
|
||||
|
||||
if (sParameterName[0] === sParam) {
|
||||
return sParameterName[1] === undefined ? true : sParameterName[1];
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
// Scroll to top
|
||||
$(window).scroll(function() {
|
||||
if ($(this).scrollTop() > 100) {
|
||||
|
||||
Reference in New Issue
Block a user