<% if @require_external_user %>
  Juvia.root_url = '<%= Settings.juvia_comment.url %>';
<% end %>

<% if @require_external_user %>
  Juvia.use_my_user = 'true';
<% end %>

<% if @user_logged_in %> 
  Juvia.user_logged_in = true;
  Juvia.username = '<%= @username%>';
  Juvia.user_email = '<%= @user_email%>';
<% end %>

<% if @restrict_comment_length %> 
  Juvia.restrict_comment_length = true;
<% end %>

  Juvia.site_key = '<%= @site_key%>';
  Juvia.topic_key = '<%= @topic_key%>';
  Juvia.topic_url = '<%= @topic_url%>';
  Juvia.topic_title = '<%= escape_javascript(@topic_title) %>';

<%
  options = { 
    :action    => 'LoadTopic',
    :container => @container,
    :html      => render(:partial => 'topic.html', :locals => { :topic => @topic })
  }
%>
<%= juvia_handle_response(options) %>
<%= juvia_reinstall_behavior %>


if(Juvia.get_cookie('sorting_order') !== null){
  Juvia.sorting_order = Juvia.get_cookie('sorting_order');
  Juvia.$("#juvia-sort-select").val(Juvia.sorting_order);
}

Juvia.reqLoadComment();

<% if @require_external_user %>
  Juvia.root_url = '<%= Settings.juvia_comment.url %>';
<% end %>

<% if @require_external_user %>
  Juvia.use_my_user = 'true';
<% end %>

<% if @user_logged_in %> 
  Juvia.user_logged_in = true;
  Juvia.username = '<%= @username%>';
  Juvia.user_email = '<%= @user_email%>';
<% end %>

<% if @restrict_comment_length %> 
  Juvia.restrict_comment_length = true;
<% end %>

  Juvia.site_key = '<%= @site_key%>';
  Juvia.topic_key = '<%= @topic_key%>';
  Juvia.topic_url = '<%= @topic_url%>';
  Juvia.topic_title = '<%= escape_javascript(@topic_title) %>';

<%
  options = { 
    :action    => 'LoadTopic',
    :container => @container,
    :html      => render(:partial => 'topic', :formats => [:html], :locals => { :topic => @topic })
  }
%>
<%= juvia_handle_response(options) %>
<%= juvia_reinstall_behavior %>


if(Juvia.get_cookie('sorting_order') !== null){
  Juvia.sorting_order = Juvia.get_cookie('sorting_order');
  Juvia.$("#juvia-sort-select").val(Juvia.sorting_order);
}

Juvia.reqLoadComment();

Fix deprecation warning for html format
Fix deprecation warning for html format
