Sha256: 9ba14caaacb8de0de7660958574f84e26fd06f985444e7eac9fddc1a9e3743bc

Contents?: true

Size: 1.82 KB

Versions: 6

Compression:

Stored size: 1.82 KB

Contents

<% if current_subject.subject_type=="User" %>
	
	<% content_for :headers do %>
	  <%= stylesheet_link_tag "chat.css", :media => "screen, projection" %>
	  <%= javascript_include_tag 'jquery-ui-1.8.14.custom.min'%>
	  <%= javascript_include_tag 'jquery.ui.chatbox'%>
	  <%= javascript_include_tag 'jquery.tools.min'%>
	  <%= javascript_include_tag 'strophe'%>
	  <%= javascript_include_tag 'xmpp_client'%>
		<%= javascript_include_tag 'store'%>
  <% end %>
	
		
	<script type="text/javascript">
			
		//Global variables
		var BOSH_SERVICE = '<%= SocialStream::Presence.bosh_service || root_url + "http-bind/" %>';
		var domain = '<%=SocialStream::Presence.domain%>';
    var user_name = '<%=current_user.name%>';
		var user_slug = '<%=current_user.slug%>';
    var user_jid = '<%=current_user.slug%>'+"@"+domain;
		var sound_path = "/assets/audio/chat/onMessage"

    function connectToServer(chatPassword){
		  <%unless current_user.nil? %>
				
				//Get Password
				if ((chatPassword!=null)&&(chatPassword!="")){
					var password = chatPassword;
				} else if ((window.sessionStorage)&&(sessionStorage.getItem("ss_user_pass") != null)) {
          var password = sessionStorage.getItem("ss_user_pass");
        } else {
					return false;
				}
				
				try {
            //Connect actual user to the chat
            connection = new Strophe.Connection(BOSH_SERVICE);
            connection.connect(user_jid, password, onConnect);
        } catch (err) {
            //"Handle errors"
						return false;
        }

				return true;
      <%end%>
		}

		$(document).ready(function () {	
			if (connectToServer(null)==false){
				refreshChatWindow();
			}
			initialTimer = setTimeout("updateChatWindow()", 15000);
      initAudio();
		});
		
	</script>
			
	<div id="chat_partial">		
	  <%= render :partial => 'xmpp/chat_connecting' %>
	</div>
	
<% end %>

Version data entries

6 entries across 6 versions & 2 rubygems

Version Path
social_stream-0.12.1 presence/app/views/xmpp/_chat.html.erb
social_stream-presence-0.0.13 app/views/xmpp/_chat.html.erb
social_stream-0.12.0 presence/app/views/xmpp/_chat.html.erb
social_stream-presence-0.0.12 app/views/xmpp/_chat.html.erb
social_stream-presence-0.0.10 app/views/xmpp/_chat.html.erb
social_stream-presence-0.0.9 app/views/xmpp/_chat.html.erb