forked from erikdubbelboer/phpRedisAdmin
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathframe.js
29 lines (23 loc) · 901 Bytes
/
frame.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
$(function() {
if (history.replaceState) {
window.parent.history.replaceState({}, '', document.location.href.replace('?', '&').replace(/([a-z]*)\.php/, '?$1'));
}
$('#type').change(function(e) {
$('#hkeyp' ).css('display', e.target.value == 'hash' ? 'block' : 'none');
$('#indexp').css('display', e.target.value == 'list' ? 'block' : 'none');
$('#scorep').css('display', e.target.value == 'zset' ? 'block' : 'none');
}).change();
$('.delkey, .delval').click(function(e) {
e.preventDefault();
if (confirm($(this).hasClass('delkey') ? 'Are you sure you want to delete this key and all it\'s values?' : 'Are you sure you want to delete this value?')) {
$.ajax({
type: "POST",
url: this.href,
data: 'post=1',
success: function(url) {
top.location.href = top.location.pathname+url;
}
});
}
});
});