frame.js 901 B

1234567891011121314151617181920212223242526272829
  1. $(function() {
  2. if (history.replaceState) {
  3. window.parent.history.replaceState({}, '', document.location.href.replace('?', '&').replace(/([a-z]*)\.php/, '?$1'));
  4. }
  5. $('#type').change(function(e) {
  6. $('#hkeyp' ).css('display', e.target.value == 'hash' ? 'block' : 'none');
  7. $('#indexp').css('display', e.target.value == 'list' ? 'block' : 'none');
  8. $('#scorep').css('display', e.target.value == 'zset' ? 'block' : 'none');
  9. }).change();
  10. $('.delkey, .delval').click(function(e) {
  11. e.preventDefault();
  12. 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?')) {
  13. $.ajax({
  14. type: "POST",
  15. url: this.href,
  16. data: 'post=1',
  17. success: function(url) {
  18. top.location.href = top.location.pathname+url;
  19. }
  20. });
  21. }
  22. });
  23. });