From 18a0fd14dc240ab43a54e59daeb92f62eeb74c2a Mon Sep 17 00:00:00 2001 From: Telepenin Nikolay Date: Mon, 8 Sep 2014 19:52:16 +0400 Subject: [PATCH 1/5] Update WebSocket.js For [Issue](https://github.com/wilk/Ext.ux.data.proxy.WebSocket/issues/21) --- WebSocket.js | 2 ++ 1 file changed, 2 insertions(+) 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!'); From 3e9e171097d8e324f8785a8b8c38a8791193d46d Mon Sep 17 00:00:00 2001 From: Richard van Dijk Date: Mon, 28 Sep 2015 14:51:09 +0200 Subject: [PATCH 2/5] stop using websocket URL as panel id (fix wilk/ExtJS-WebSocket#12) It is incompatible with later versions of Ext JS. --- demo/demo.js | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/demo/demo.js b/demo/demo.js index 176c590..5568707 100644 --- a/demo/demo.js +++ b/demo/demo.js @@ -22,13 +22,17 @@ 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 + '
'; } , 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 +45,6 @@ Ext.define ('DEMO.view.OpenConnection', { var panel = Ext.create ('Ext.panel.Panel', { title: url , ws: ws , - id: 'panel' + url , layout: 'anchor' , @@ -50,7 +53,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' , From c4471093b2bf1dc4a98f7dcb3a5e34687eb0dcd0 Mon Sep 17 00:00:00 2001 From: Richard van Dijk Date: Mon, 28 Sep 2015 14:52:41 +0200 Subject: [PATCH 3/5] scroll messages to bottom + fill in default websocket URL For convenience. --- demo/demo.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/demo/demo.js b/demo/demo.js index 5568707..2373369 100644 --- a/demo/demo.js +++ b/demo/demo.js @@ -30,6 +30,7 @@ Ext.define ('DEMO.view.OpenConnection', { 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.ComponentQuery.query('panel[title="' + url + '"]')[0]; @@ -110,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) { From ca9bf6cfd1ecaa1004d34240972a3c6e8f605f26 Mon Sep 17 00:00:00 2001 From: Richard van Dijk Date: Mon, 28 Sep 2015 16:44:45 +0200 Subject: [PATCH 4/5] update demo to Ext JS 5.1.0 --- demo/index.html | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) 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 - - + + + From 07901139315cb8cce5a350854e21f4a4d8d46ff0 Mon Sep 17 00:00:00 2001 From: Richard van Dijk Date: Mon, 28 Sep 2015 16:45:21 +0200 Subject: [PATCH 5/5] bump version to v1.0.1 --- README.md | 10 +++++----- bower.json | 2 +- package.json | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) 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/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/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": {