install.js 795 B

1234567891011121314151617181920212223242526272829
  1. (function($,History){
  2. var State = History.getState();
  3. $(document).ready(function(){
  4. if($.isEmptyObject(State.data)){
  5. History.pushState({
  6. type: 'install',
  7. id: 'config'
  8. },'Bugs','config');
  9. }
  10. $(window).on('statechange',function(){
  11. State = History.getState();
  12. $.get('api.php',State.data,function(d){
  13. $('body').html(d);
  14. $('#install').click(function(){
  15. $('#install').attr('disabled','disabled');
  16. $.get('api.php?'+$("#config").serialize()+'&dbtemplate=install&type=install&id=run',function(d){
  17. if(d != "pass"){
  18. alert(d);
  19. $('#install').removeAttr('disabled');
  20. }else{
  21. alert('Installation successful!');
  22. location = '..';
  23. }
  24. },'text')
  25. });
  26. },'html');
  27. }).trigger('statechange');
  28. });
  29. })(jQuery,History);