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