Revision 2271,
1021 bytes
checked in by alexandrecorreia, 15 years ago
(diff) |
Ticket #986 - Reimplementar interface mais leve para o IM, sem a necessidades de plugins adicionais.
|
-
Property svn:executable set to
*
|
Rev | Line | |
---|
[2271] | 1 | /* flXHR plugin |
---|
| 2 | ** |
---|
| 3 | ** This plugin implements cross-domain XmlHttpRequests via an invisible |
---|
| 4 | ** Flash plugin. |
---|
| 5 | ** |
---|
| 6 | ** In order for this to work, the BOSH service *must* serve a |
---|
| 7 | ** crossdomain.xml file that allows the client access. |
---|
| 8 | ** |
---|
| 9 | ** flXHR.js should be loaded before this plugin. |
---|
| 10 | */ |
---|
| 11 | |
---|
| 12 | Strophe.addConnectionPlugin('flxhr', { |
---|
| 13 | init: function () { |
---|
| 14 | // replace Strophe.Request._newXHR with new flXHR version |
---|
| 15 | // if flXHR is detected |
---|
| 16 | if (flensed && flensed.flXHR) { |
---|
| 17 | Strophe.Request.prototype._newXHR = function () { |
---|
| 18 | var xhr = new flensed.flXHR({ |
---|
| 19 | autoUpdatePlayer: true, |
---|
| 20 | instancePooling: true, |
---|
| 21 | noCacheHeader: false}); |
---|
| 22 | xhr.onreadystatechange = this.func.prependArg(this); |
---|
| 23 | |
---|
| 24 | return xhr; |
---|
| 25 | }; |
---|
| 26 | } else { |
---|
| 27 | Strophe.error("flXHR plugin loaded, but flXHR not found." + |
---|
| 28 | " Falling back to native XHR implementation."); |
---|
| 29 | } |
---|
| 30 | } |
---|
| 31 | }); |
---|
Note: See
TracBrowser
for help on using the repository browser.