diff --git a/README.md b/README.md index d67033f..4c45dd4 100644 --- a/README.md +++ b/README.md @@ -8,10 +8,10 @@ The second one is a singleton to register different Ext.ux.WebSocket and it prov ## ExtJS 5 The new version of ExtJS 5 has requested to make a new major version of `ExtJS-WebSocket`. -Now, this new major version **v1.0.0** is located on the master branch. +Now, this new major version **v1.0.1** is located on the master branch. ## ExtJS 4 & Sencha Touch 2 -It's possible to work either with ExtJS 4 and Sencha Touch 2 with previous version **v0.0.5** +It's possible to work either with ExtJS 4 and Sencha Touch 2 with previous version **v0.0.6** ## Install via Bower First of all, install [**Bower**](http://bower.io/). @@ -22,10 +22,10 @@ Then install `Ext.ux.WebSocket` (version v1.x.x for ExtJS 5): $ bower install ext.ux.websocket ``` -Or install `Ext.ux.WebSocket` (version v0.0.5 for ExtJS 4 & Sencha Touch 2): +Or install `Ext.ux.WebSocket` (version v0.0.6 for ExtJS 4 & Sencha Touch 2): ```bash -$ bower install ext.ux.websocket#0.0.5 +$ bower install ext.ux.websocket#0.0.6 ``` Now, you got the extension at the following path: *YOUR_PROJECT_PATH/bower_components/ext.ux.websocket/* @@ -285,7 +285,7 @@ It will make the documentation into docs dir and it will be visible at: http://l ## License The MIT License (MIT) -Copyright (c) 2013 Vincenzo Ferrari +Copyright (c) 2015 Vincenzo Ferrari Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: diff --git a/WebSocket.js b/WebSocket.js index 06e71f9..d685bbc 100644 --- a/WebSocket.js +++ b/WebSocket.js @@ -221,6 +221,8 @@ Ext.define('Ext.ux.WebSocket', { constructor: function (cfg) { var me = this; + me.messageQueue = (cfg.messageQueue || []).slice(); + // Raises an error if no url is given if (Ext.isEmpty(cfg)) { Ext.Error.raise('URL for the websocket is required!'); diff --git a/bower.json b/bower.json index c5997f4..c67a5e8 100644 --- a/bower.json +++ b/bower.json @@ -1,6 +1,6 @@ { "name": "Ext.ux.WebSocket", - "version": "v1.0.0", + "version": "v1.0.1", "homepage": "https://github.com/wilk/ExtJS-WebSocket", "authors": [ "Vincenzo (Wilk) Ferrari " diff --git a/demo/demo.js b/demo/demo.js index 176c590..2373369 100644 --- a/demo/demo.js +++ b/demo/demo.js @@ -22,13 +22,18 @@ Ext.define ('DEMO.view.OpenConnection', { url: url , listeners: { open: function (ws) { - if (Ext.get(ws.url)) Ext.get(ws.url).dom.innerHTML += '> WebSocket just open!
'; + var container = Ext.ComponentQuery.query('panel[title="' + url + '"] > container#messageCt')[0]; + var messageBox = container.getEl().dom.getElementsByClassName("messageBox")[0]; + messageBox.innerHTML += '> WebSocket just open!
'; } , message: function (ws, data) { - Ext.get(ws.url).dom.innerHTML += '> ' + data + '
'; + var container = Ext.ComponentQuery.query('panel[title="' + url + '"] > container#messageCt')[0]; + var messageBox = container.getEl().dom.getElementsByClassName("messageBox")[0]; + messageBox.innerHTML += '> ' + data + '
'; + messageBox.scrollTop = messageBox.scrollHeight; } , close: function (ws) { - var panel = Ext.getCmp ('panel' + ws.url); + var panel = Ext.ComponentQuery.query('panel[title="' + url + '"]')[0]; if ((panel != null) || (panel != undefined)) { panel.destroy (); @@ -41,7 +46,6 @@ Ext.define ('DEMO.view.OpenConnection', { var panel = Ext.create ('Ext.panel.Panel', { title: url , ws: ws , - id: 'panel' + url , layout: 'anchor' , @@ -50,7 +54,8 @@ Ext.define ('DEMO.view.OpenConnection', { items: [{ xtype: 'container' , - html: 'Incoming from the server:
' + html: 'Incoming from the server:
' , + itemId: 'messageCt' } , { xtype: 'textarea' , labelAlign: 'top' , @@ -106,6 +111,7 @@ Ext.define ('DEMO.view.OpenConnection', { xtype: 'textfield' , anchor: '100%' , fieldLabel: 'URL' , + value: 'ws://localhost:9001' , labelAlign: 'top' , listeners: { specialKey: function (tf, evt) { diff --git a/demo/index.html b/demo/index.html index 3d812f5..fe10cca 100644 --- a/demo/index.html +++ b/demo/index.html @@ -3,8 +3,9 @@ ExtJS WebSocket - - + + + diff --git a/package.json b/package.json index 4c561c4..28497e5 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "Ext.ux.WebSocket", - "version": "0.0.0", + "version": "1.0.1", "description": "Ext.ux.WebSocket is an extension to manage HTML5 WebSocket with ExtJS and SenchaTouch", "main": "WebSocket.js", "scripts": {