<scriptedContentFragments>
	<scriptedContentFragment name="Greeter UI" version="9.0.0.0" description="Sample UI corresponding to the Greeter Socket Plugin Demo" instanceIdentifier="b6261cfed4f4466591e39743c153725e" theme="" isCacheable="false" varyCacheByUser="false" showHeaderByDefault="true" cssClass="">
		<contentScript><![CDATA[## set up some unique ids for interface elements
#set($recipientInputId = $core_v2_widget.UniqueId('recipient'))
#set($sendLinkId = $core_v2_widget.UniqueId('greet'))

## basic interface
<input type="text" id="$recipientInputId" />
<a href="#" id="$sendLinkId">Greet</a>

<script type="text/javascript">
// Wait for socket to be connected
jQuery.telligent.evolution.messaging.subscribe('socket.connected', function() {

	// when 'Greet' is clicked, send a message to be delivered to the recipient
	jQuery('#$sendLinkId').on('click', function(e) {
		e.preventDefault();

		jQuery.telligent.evolution.sockets.greeter.send('greet', {
			Recipient: jQuery('#$recipientInputId').val()
		});
	});

	// when a 'greet' message is received from the socket, display it as an alert
	jQuery.telligent.evolution.sockets.greeter.on('greet', function(data){
		alert(data.Message);
	});
});
</script>]]></contentScript>
	</scriptedContentFragment>
</scriptedContentFragments>