educoder/app/views/avatar/upload.js.erb

20 lines
918 B
Plaintext

<% if @is_direct == '1' && (@source_type=='User'|| @source_type == 'Course' || @source_type == 'Project' || @source_type == 'Organization'|| @source_type == 'Contest') %>
var imgSpan = $("img[nhname='avatar_image']");
imgSpan.attr({"src":'<%= "#{@urlfile.to_s}?#{Time.now.to_i}" %>'});
<% elsif @is_direct == '1' && @source_type == 'UserAuthentication' %>
<% if @auth_type == "ID" %>
var imgSpan = $("#nh_source_id");
$("#upload_img_pro_sign").val(1);
<% else %>
var imgSpan = $("#nh_source_pro");
$("#upload_img_id_sign").val(1);
<% end %>
imgSpan.attr({"src":'<%= "#{@urlfile.to_s}?#{Time.now.to_i}" %>'});
<% else %>
<% if @source_type=='User' %>
var imgSpan = jQuery('#nh_user_logo');
<% else %>
var imgSpan = jQuery('#avatar_image');
<% end %>
imgSpan.attr({"src":'<%= "#{@urlfile.to_s}?#{Time.now.to_i}" %>'});
<% end %>