Friendica Communications Platform (please note that this is a clone of the repository at github, issues are handled there) https://friendi.ca
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

99 lines
2.6 KiB

  1. <script src="include/jquery.htmlstream.js"></script>
  2. <script>
  3. /* ajax updater */
  4. function updateEnd(data){
  5. //$("#updatepopup .panel_text").html(data);
  6. $("#remoteupdate_form").find("input").removeAttr('disabled');
  7. $(".panel_action_close").fadeIn()
  8. }
  9. function updateOn(data){
  10. var patt=/§([^§]*)§/g;
  11. var matches = data.match(patt);
  12. $(matches).each(function(id,data){
  13. data = data.replace(/§/g,"");
  14. d = data.split("@");
  15. console.log(d);
  16. elm = $("#updatepopup .panel_text #"+d[0]);
  17. html = "<div id='"+d[0]+"' class='progress'>"+d[1]+"<span>"+d[2]+"</span></div>";
  18. if (elm.length==0){
  19. $("#updatepopup .panel_text").append(html);
  20. } else {
  21. $(elm).replaceWith(html);
  22. }
  23. });
  24. }
  25. $(function(){
  26. $("#remoteupdate_form").submit(function(){
  27. var data={};
  28. $(this).find("input").each(function(i, e){
  29. name = $(e).attr('name');
  30. value = $(e).val();
  31. e.disabled = true;
  32. data[name]=value;
  33. });
  34. $("#updatepopup .panel_text").html("");
  35. $("#updatepopup").show();
  36. $("#updatepopup .panel").hide().slideDown(500);
  37. $(".panel_action_close").hide().click(function(){
  38. $("#updatepopup .panel").slideUp(500, function(){
  39. $("#updatepopup").hide();
  40. });
  41. });
  42. $.post(
  43. $(this).attr('action'),
  44. data,
  45. updateEnd,
  46. 'text',
  47. updateOn
  48. );
  49. return false;
  50. })
  51. });
  52. </script>
  53. <div id="updatepopup" class="popup">
  54. <div class="background"></div>
  55. <div class="panel">
  56. <div class="panel_in">
  57. <h1>Friendika Update</h1>
  58. <div class="panel_text"></div>
  59. <div class="panel_actions">
  60. <input type="button" value="$close" class="panel_action_close">
  61. </div>
  62. </div>
  63. </div>
  64. </div>
  65. <div id="adminpage">
  66. <dl> <dt>Your version:</dt><dd>$localversion</dd> </dl>
  67. {{ if $needupdate }}
  68. <dl> <dt>New version:</dt><dd>$remoteversion</dd> </dl>
  69. <form id="remoteupdate_form" method="POST" action="$baseurl/admin/update">
  70. <input type="hidden" name="$remotefile.0" value="$remotefile.2">
  71. {{ if $canwrite }}
  72. <div class="submit"><input type="submit" name="remoteupdate" value="$submit" /></div>
  73. {{ else }}
  74. <h3>Your friendika installation is not writable by web server.</h3>
  75. {{ if $canftp }}
  76. <p>You can try to update via FTP</p>
  77. {{ inc field_input.tpl with $field=$ftphost }}{{ endinc }}
  78. {{ inc field_input.tpl with $field=$ftppath }}{{ endinc }}
  79. {{ inc field_input.tpl with $field=$ftpuser }}{{ endinc }}
  80. {{ inc field_password.tpl with $field=$ftppwd }}{{ endinc }}
  81. <div class="submit"><input type="submit" name="remoteupdate" value="$submit" /></div>
  82. {{ endif }}
  83. {{ endif }}
  84. </form>
  85. {{ else }}
  86. <h4>No updates</h4>
  87. {{ endif }}
  88. </div>