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