Do you need a jQuery chat on your website like you see on Facebook and Gmail? You're in the right place!
This powerful, ready-to-use AJAX chat is easy to insert and adjust ! Try it now ! Demo is very simple, some features is not inlcuded ! If you want the full version then purchase now !
|
menu
Saturday, 27 July 2013
jQuery AJAX Chat Script
Embed instant messaging into your Web App!
ChatJS is a full-featured, lightweight, Facebook style jQuery plugin for instant messaging. ChatJS also comes with a server side implementation for ASP.NET/SignalR out of the box.
Download Leave demo chat
... or visit the project at GitHub.
How it works:
The client part is divided in two JavaScript files. The file jquery.chatjs.jscontains the main jQuery plugin
$.chat()
andjquery.chatjs.signalradapter.js contains the adapter function needed to tell the plug-in how to interact with the server.
Once the server is set up, the client code is quite simple. These are all the options:
$.chat({ // your user information user: { Id: 3, Name: 'John Silver', ProfilePictureUrl: 'http://www.foo.com/avatar/123' }, // text displayed when the other user is typing typingText: ' is typing...', // the title for the user's list window titleText: 'ChatJS demo chat', // text displayed when there's no other users in the room emptyRoomText: "There's no one around here.", // the adapter you are using adapter: new SignalRAdapter() });
Features:
- Real time message sharing (Oh really?).
- Automatically parses URLs and emoticons .
- Automatically remembers opened windows across diferent requests (through cookies).
- Triggers a sound notification when the user receives a message.
- Indicates when the other user is typing.
- Supports multiple chat rooms. If you have a multi-tenancy app you can create a room for each tenancy, for instance.
- Supports multiple browser windows opened with the same session. They all get properly sinchronized.
- Customizable texts. You can easily translate it to your language.
- Both client and server code ready to be used for ASP.NET with SignalR.
Find URLs in Text, Make Links
The basic function of this is to find any URLs in the block of text and turn them into hyperlinks. It will only find URLs if they are properly formatted, meaning they have a http, https, ftp or ftps.
<?php function autolink($str, $attributes=array()) { $attrs = ''; foreach ($attributes as $attribute => $value) { $attrs .= " {$attribute}=\"{$value}\""; } $str = ' ' . $str; $str = preg_replace( '`([^"=\'>])((http|https|ftp)://[^\s<]+[^\s<\.)])`i', '$1<a href="$2"'.$attrs.'>$2</a>', $str ); $str = substr($str, 1); return $str; } ?>
Syntaxe
string autolink ( string $str [, array $attributes = array() ] )Arguments
- str - La chaîne d'entrée.
- attributes - Optionnel. Si spécifié, ce paramètre doit être un tableau associatif de format $arr['attribute'] = $value.
Valeurs de retour
Retourne une copie de la chaîne str dont les urls ont été encapsulées dans des balises <a>.Exemples
Exemple #1 Exemple avec autolink()
<?php
$str
=
'A link : http://example.com/?param=value#anchor.'
;
$str
= autolink(
$str
);
echo
$str
;
// A link : <a href="http://example.com/?param=value#anchor">http://example.com/?param=value#anchor</a>.
?>
Exemple #2 Exemple avec autolink()
<?php
$str
=
'http://example.com/'
;
$str
= autolink(
$str
,
array
(
"target"
=>
"_blank"
,
"rel"
=>
"nofollow"
));
echo
$str
;
// <a href="http://example.com/" target="_blank" rel="nofollow">http://example.com/</a>
?>
Subscribe to:
Posts (Atom)