##// END OF EJS Templates
Check plugins updates using https (#17722)....
Jean-Philippe Lang -
r13632:3ef00ddb58e1
parent child
Show More
@@ -1,63 +1,63
1 1 <%= title l(:label_plugins) %>
2 2
3 3 <% if @plugins.any? %>
4 4 <table class="list plugins">
5 5 <% @plugins.each do |plugin| %>
6 6 <tr id="plugin-<%= plugin.id %>" class="<%= cycle('odd', 'even') %>">
7 7 <td class="name"><span class="name"><%=h plugin.name %></span>
8 8 <%= content_tag('span', h(plugin.description), :class => 'description') unless plugin.description.blank? %>
9 9 <%= content_tag('span', link_to(h(plugin.url), plugin.url), :class => 'url') unless plugin.url.blank? %>
10 10 </td>
11 11 <td class="author"><%= plugin.author_url.blank? ? h(plugin.author) : link_to(h(plugin.author), plugin.author_url) %></td>
12 12 <td class="version"><span class="icon"><%= plugin.version %></span></td>
13 13 <td class="configure"><%= link_to(l(:button_configure), plugin_settings_path(plugin)) if plugin.configurable? %></td>
14 14 </tr>
15 15 <% end %>
16 16 </table>
17 17 <p><a href="#" id="check-for-updates"><%= l(:label_check_for_updates) %></a></p>
18 18 <% else %>
19 19 <p class="nodata"><%= l(:label_no_data) %></p>
20 20 <% end %>
21 21
22 22 <%= javascript_tag do %>
23 23 $(document).ready(function(){
24 24 $("#check-for-updates").click(function(e){
25 25 e.preventDefault();
26 26 $.ajax({
27 27 dataType: "jsonp",
28 url: "http://www.redmine.org/plugins/check_updates",
28 url: "https://www.redmine.org/plugins/check_updates",
29 29 data: <%= raw_json plugin_data_for_updates(@plugins) %>,
30 30 timeout: 3000,
31 31 beforeSend: function(){
32 32 $('#ajax-indicator').show();
33 33 },
34 34 success: function(data){
35 35 $('#ajax-indicator').hide();
36 36 $("table.plugins td.version span").addClass("unknown");
37 37 $.each(data, function(plugin_id, plugin_data){
38 38 var s = $("tr#plugin-"+plugin_id+" td.version span");
39 39 s.removeClass("icon-checked icon-warning unknown");
40 40 if (plugin_data.url) {
41 41 if (s.parent("a").length>0) {
42 42 s.unwrap();
43 43 }
44 44 s.addClass("found");
45 45 s.wrap($("<a></a>").attr("href", plugin_data.url).attr("target", "_blank"));
46 46 }
47 47 if (plugin_data.c == s.text()) {
48 48 s.addClass("icon-checked");
49 49 } else if (plugin_data.c) {
50 50 s.addClass("icon-warning");
51 51 s.attr("title", "<%= escape_javascript l(:label_latest_compatible_version) %>: "+plugin_data.c);
52 52 }
53 53 });
54 54 $("table.plugins td.version span.unknown").addClass("icon-help").attr("title", "<%= escape_javascript l(:label_unknown_plugin) %>");
55 55 },
56 56 error: function(){
57 57 $('#ajax-indicator').hide();
58 58 alert("Unable to retrieve plugin informations from www.redmine.org");
59 59 }
60 60 });
61 61 });
62 62 });
63 63 <% end if @plugins.any? %>
General Comments 0
You need to be logged in to leave comments. Login now