Keep textarea active after message is sent - textarea

I'm creating a chat application with Angular and I got stuck on the following case:
When a user sent a message he has to click the chat area (it is a textarea) again to send a new message.
How can I keep the textarea active when a message is sent and the client to be able to write instantly after that without click the textarea again?
I tried to simulate a click (el.click()) on the textarea after the message is sent but it doesn't help. I tried also with el.focus().

If anyone else stuck on a similar case here is the solution:
el.focus()
should be done in
ngAfterViewInit()

Related

Slack - Executing code (client) on click of Slack Message Title

I have Slack message posted using postMessage & Attachment. It has Title and Title Link which opens the External URL. I wanted to capture the link click event when User click on it. Is it possible to wire click event and handle it?
No. The Slack API does not provide any means to "capture" the click event and do anything else then open an external link in the browser.

Intercom icon does not appear after login (Intercom-rails)

I am trying to use 'intercom-rails' in my app. I followed the installation from here : https://github.com/intercom/intercom-rails. Now Im able to see the chat icon and chat.
However, if I login, the chat icon disappears. It does not appear even after logging out.
Any help ?
It probably means something is causing the Intercom JavaScript code to crash or not report the needed information to be activated.
First, check your browser JavaScript console for errors. If there is something wrong when rendering the Intercom widget, it will show up there.
Then, I suggest that you look into your HTML code using the "View Source" function on your browser and take a look at how the Intercom Javascript code is being rendered when the chat icon does not appear.
You should see something like this:

Add message to chat component(react.js) via websockets

Context:
I am developing a Ruby On Rails application and I started using React.js to manage my javascript components.
My application provides a facebook-like chat: several chats are displayed at the bottom of the page.
Problem
I have a ChatList component that renders the chats. A chat is made of its messages and its form. When this form is submitted, an AJAX call is made to the server to POST the message and the message is added to the current chat.
this.setState({messages: this.state.messages.concat([newMessage])});
The server then broadcast Javascript code to the receiver.
This is where I'm stuck. How can I add the message to the correct chat? How can I select my React.js component and change its 'props'?
When I was not using react, I used to broadcast this code to the other user:
$("#chat-<%= chat.id %>").append("<%= message.content" %>);
I guess I have to find a way to select the React component (the chat instance) and change its property "messages". How?
Thank you for your help! :)
EDIT: I'm going to add more information, just in case:
My ChatList is a global variable that takes an array of Chats.
Each Chat takes an array of Message and a form.
When I submit the form of a chat, it adds the message to the Chat (locally and it also posts the new message to the server). When the server receives the POST event, it can render javascript code to the other user.
This code should add the message to the correct Chat for the correct user. There are two pieces missing:
I don't know how I can "select" the Chat.
I don't know how I can add a message to the "messages" array of this Chat.
You'll want to have your chat component listen to a WebSocket event for a new message and then call setState when a message is received.
The standard approach with Chatrooms is to use "channels" that each chat room subscribes to. That way it only hears about incoming messages from the conversation it cares about.
Check out Socket.io and its example on making a chat application. Even if you don't use Socket.io the example will be illustrative.
The solution, in my Chat class:
componentDidMount: function(){
this.props.privateChannel.bind('message.new', this.receiveMessage);
},
receiveMessage: function(message) {
if(message.user.id == this.props.recipient.id){
this.setState({messages: this.state.messages.concat([message])});
this.startBlink();
}
},

Launch App from eMail with URL-Sheme

Hello I have a custom URL to open an app with a link. It works in the browser. But I want to send an email that another user can click the link in the email and the app will be started. Does anybody know a solution?
It is not possible to send an email with the link (myApp://). It always shows the the link as blank text.
Or does anyone know another solution to transfer data between an app to a other users app?
I think you need to write the link in href html tag
i.e. open my app
another solution is to try to add any text after the double slash i.e. myApp://open

how to stop to show Remember Password

I make Application with webview to my Application. when i want to Login some pages and i want to login saites the confirm Message is displayed.and it says that do you want the browser to remember this password. I don't want to show this Message and i dont want to click on never
what should I do to stop showing this Message and what should i do to Not displayed this Message
you can see the see screenshot
http://i.stack.imgur.com/1kulj.jpg
You can turn this behavior off with the WebSettings.setSavePassword() API. Please see http://developer.android.com/reference/android/webkit/WebSettings.html#setSavePassword(boolean)

Resources