Commit c8f3e826 authored by Romain Courteaud's avatar Romain Courteaud

[erp5_web_jabber_client] Use erp5_launcher as top gadget

Split each page into a separate gadget.
Stop using patched renderjs.
parent 4c986964
...@@ -99,14 +99,27 @@ ...@@ -99,14 +99,27 @@
</item> </item>
<item> <item>
<key> <string>text_content</string> </key> <key> <string>text_content</string> </key>
<value> <string>CACHE MANIFEST\n <value> <string encoding="cdata"><![CDATA[
CACHE MANIFEST\n
# generated on Mon, 2 Mar 2016 09:00:00 +0000\n
\n \n
CACHE:\n CACHE:\n
https://netdna.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css\n
https://netdna.bootstrapcdn.com/font-awesome/4.2.0/fonts/fontawesome-webfont.eot?v=4.2.0\n
https://netdna.bootstrapcdn.com/font-awesome/4.2.0/fonts/fontawesome-webfont.eot?#iefix&v=4.2.0\n
https://netdna.bootstrapcdn.com/font-awesome/4.2.0/fonts/fontawesome-webfont.woff?v=4.2.0\n
https://netdna.bootstrapcdn.com/font-awesome/4.2.0/fonts/fontawesome-webfont.ttf?v=4.2.0\n
https://netdna.bootstrapcdn.com/font-awesome/4.2.0/fonts/fontawesome-webfont.svg?v=4.2.0#fontawesomeregular\n
URI.js\n
i18next.js\n
gadget_translation.html\n
gadget_translation.js\n
gadget_translation_data.js\n
erp5_launcher.html\n
erp5_launcher.js\n
gadget_erp5.css\n
gadget_global.js\n gadget_global.js\n
gadget_jabberclient.js\n
gadget_jabberclient.html\n
gadget_jabberconnection.html\n
gadget_jabberconnection.js\n
gadget_jio.js\n gadget_jio.js\n
gadget_jio.html\n gadget_jio.html\n
handlebars.js\n handlebars.js\n
...@@ -116,9 +129,38 @@ jquerymobile.css\n ...@@ -116,9 +129,38 @@ jquerymobile.css\n
jquerymobile.js\n jquerymobile.js\n
renderjs.js\n renderjs.js\n
rsvp.js\n rsvp.js\n
\n gadget_erp5_editor_panel.html\n
gadget_erp5_editor_panel.js\n
gadget_erp5_form.html\n
gadget_erp5_form.js\n
gadget_erp5_header.html\n
gadget_erp5_header.js\n
gadget_erp5_field_string.html\n
gadget_erp5_field_string.js\n
gadget_erp5_field_password.html\n
gadget_erp5_field_password.js\n
gadget_jabberclient_page_dialog.html\n
gadget_jabberclient_page_dialog.js\n
gadget_jabberclient_router.html\n
gadget_jabberclient_router.js\n
gadget_jabberclient_page_password.html\n
gadget_jabberclient_page_password.js\n
gadget_jabberclient_page_connect.html\n
gadget_jabberclient_page_connect.js\n
gadget_jabberclient_page_subscribe.js\n
gadget_jabberclient_page_subscribe.html\n
gadget_jabberclient_panel.html\n
gadget_jabberclient_panel.js\n
gadget_jabberclient_page_contact.js\n
gadget_jabberclient_page_contact.html\n
gadget_jabberclient_jio.html\n
gadget_jabberclient_jio.js\n
favicon.ico\n
connection/\n
NETWORK:\n NETWORK:\n
*</string> </value> *
]]></string> </value>
</item> </item>
<item> <item>
<key> <string>title</string> </key> <key> <string>title</string> </key>
...@@ -239,7 +281,7 @@ NETWORK:\n ...@@ -239,7 +281,7 @@ NETWORK:\n
</item> </item>
<item> <item>
<key> <string>actor</string> </key> <key> <string>actor</string> </key>
<value> <string>normie</string> </value> <value> <string>zope</string> </value>
</item> </item>
<item> <item>
<key> <string>comment</string> </key> <key> <string>comment</string> </key>
...@@ -253,7 +295,7 @@ NETWORK:\n ...@@ -253,7 +295,7 @@ NETWORK:\n
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>945.44005.30137.52718</string> </value> <value> <string>949.35452.57030.13636</string> </value>
</item> </item>
<item> <item>
<key> <string>state</string> </key> <key> <string>state</string> </key>
...@@ -271,7 +313,7 @@ NETWORK:\n ...@@ -271,7 +313,7 @@ NETWORK:\n
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1442825498.81</float> <float>1456907697.62</float>
<string>UTC</string> <string>UTC</string>
</tuple> </tuple>
</state> </state>
......
...@@ -104,7 +104,7 @@ ...@@ -104,7 +104,7 @@
<value> <string encoding="cdata"><![CDATA[ <value> <string encoding="cdata"><![CDATA[
<!doctype html>\n <!doctype html>\n
<html>\n <html manifest="gadget_jabberconnection.appcache">\n
<head>\n <head>\n
<meta charset="utf-8">\n <meta charset="utf-8">\n
<title>Connection</title>\n <title>Connection</title>\n
...@@ -242,7 +242,7 @@ ...@@ -242,7 +242,7 @@
</item> </item>
<item> <item>
<key> <string>actor</string> </key> <key> <string>actor</string> </key>
<value> <string>romain</string> </value> <value> <string>zope</string> </value>
</item> </item>
<item> <item>
<key> <string>comment</string> </key> <key> <string>comment</string> </key>
...@@ -256,7 +256,7 @@ ...@@ -256,7 +256,7 @@
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>939.33860.38910.29713</string> </value> <value> <string>949.35389.52548.34798</string> </value>
</item> </item>
<item> <item>
<key> <string>state</string> </key> <key> <string>state</string> </key>
...@@ -274,8 +274,8 @@ ...@@ -274,8 +274,8 @@
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1418214410.97</float> <float>1456847737.11</float>
<string>GMT</string> <string>UTC</string>
</tuple> </tuple>
</state> </state>
</object> </object>
......
...@@ -101,8 +101,8 @@ ...@@ -101,8 +101,8 @@
<key> <string>text_content</string> </key> <key> <string>text_content</string> </key>
<value> <string encoding="cdata"><![CDATA[ <value> <string encoding="cdata"><![CDATA[
/*jslint nomen: true*/\n
/*global window, rJS, Strophe, $iq, $pres, $msg, RSVP*/\n /*global window, rJS, Strophe, $iq, $pres, $msg, RSVP*/\n
/*jslint indent: 2, maxerr: 3, nomen: true */\n
\n \n
(function (window, rJS, Strophe, $iq, $pres, $msg, RSVP) {\n (function (window, rJS, Strophe, $iq, $pres, $msg, RSVP) {\n
"use strict";\n "use strict";\n
...@@ -117,7 +117,7 @@ ...@@ -117,7 +117,7 @@
this.errors += 1;\n this.errors += 1;\n
Strophe.warn("request errored, status: " + reqStatus +\n Strophe.warn("request errored, status: " + reqStatus +\n
", number of errors: " + this.errors);\n ", number of errors: " + this.errors);\n
if (this.errors > 4) {\n if (this.errors > 2) {\n
this._onDisconnectTimeout();\n this._onDisconnectTimeout();\n
this._conn._changeConnectStatus(\n this._conn._changeConnectStatus(\n
Strophe.Status.ERROR,\n Strophe.Status.ERROR,\n
...@@ -222,9 +222,9 @@ ...@@ -222,9 +222,9 @@
result = gadget.notifyXMPPAttached();\n result = gadget.notifyXMPPAttached();\n
} else {\n } else {\n
if (status === Strophe.Status.ERROR) {\n if (status === Strophe.Status.ERROR) {\n
throw new Error("XMPP Connection Error");\n result = gadget.notifyXMPPConnectionError();\n
}\n }\n
throw new Error("Unknown connection status: " + status);\n result = gadget.notifyXMPPError(status);\n
}\n }\n
return result;\n return result;\n
});\n });\n
...@@ -302,6 +302,10 @@ ...@@ -302,6 +302,10 @@
\'notifyXMPPDisconnected\')\n \'notifyXMPPDisconnected\')\n
.declareAcquiredMethod(\'notifyXMPPDisconnecting\',\n .declareAcquiredMethod(\'notifyXMPPDisconnecting\',\n
\'notifyXMPPDisconnecting\')\n \'notifyXMPPDisconnecting\')\n
.declareAcquiredMethod(\'notifyXMPPConnectionError\',\n
\'notifyXMPPConnectionError\')\n
.declareAcquiredMethod(\'notifyXMPPError\',\n
\'notifyXMPPError\')\n
.declareAcquiredMethod(\'notifyXMPPAttached\',\n .declareAcquiredMethod(\'notifyXMPPAttached\',\n
\'notifyXMPPAttached\')\n \'notifyXMPPAttached\')\n
.declareAcquiredMethod(\'notifyXMPPMessageTextReceived\',\n .declareAcquiredMethod(\'notifyXMPPMessageTextReceived\',\n
...@@ -348,68 +352,68 @@ ...@@ -348,68 +352,68 @@
})\n })\n
\n \n
.declareMethod(\'fetchRoster\', function () {\n .declareMethod(\'fetchRoster\', function () {\n
var defer = RSVP.defer();\n var defer = RSVP.defer();\n
function jsonifyResponse(domElt) {\n function jsonifyResponse(domElt) {\n
try {\n try {\n
var result = [],\n var result = [],\n
elt,\n elt,\n
json_elt,\n json_elt,\n
len,\n len,\n
i,\n i,\n
len2,\n len2,\n
j,\n j,\n
item_list = domElt.querySelectorAll("item");\n item_list = domElt.querySelectorAll("item");\n
len = item_list.length;\n len = item_list.length;\n
for (i = 0; i < len; i += 1) {\n for (i = 0; i < len; i += 1) {\n
elt = item_list[i];\n elt = item_list[i];\n
len2 = elt.attributes.length;\n len2 = elt.attributes.length;\n
json_elt = {};\n json_elt = {};\n
for (j = 0; j < len2; j += 1) {\n for (j = 0; j < len2; j += 1) {\n
json_elt[elt.attributes[j].name] = elt.attributes[j].value;\n json_elt[elt.attributes[j].name] = elt.attributes[j].value;\n
}\n
result.push(json_elt);\n
}\n }\n
defer.resolve(result);\n result.push(json_elt);\n
} catch (error) {\n
defer.reject(error);\n
}\n }\n
}\n defer.resolve(result);\n
this.props.connection.sendIQ(\n } catch (error) {\n
$iq({type: "get"}).c("query", {xmlns: Strophe.NS.ROSTER}),\n defer.reject(error);\n
jsonifyResponse,\n }\n
defer.reject\n }\n
);\n this.props.connection.sendIQ(\n
return defer.promise;\n $iq({type: "get"}).c("query", {xmlns: Strophe.NS.ROSTER}),\n
})\n jsonifyResponse,\n
defer.reject\n
);\n
return defer.promise;\n
})\n
\n \n
.declareMethod(\'resetPassword\', function (server, new_passwd) {\n .declareMethod(\'resetPassword\', function (server, new_passwd) {\n
var defer = RSVP.defer();\n var defer = RSVP.defer(),\n
function jsonifyResponse(domElt) {\n uid;\n
try {\n function jsonifyResponse(domElt) {\n
var result = [],\n try {\n
type = domElt.getAttribute(\'type\');\n var result = [],\n
if(type === "result") {\n type = domElt.getAttribute(\'type\');\n
result.push("Password Reset Success.");\n if (type === "result") {\n
}\n result.push("Password Reset Success.");\n
else {\n } else {\n
throw new Error("Password Reset Failure.");\n throw new Error("Password Reset Failure.");\n
}\n
defer.resolve(result);\n
} catch (error) {\n
defer.reject(error);\n
}\n }\n
defer.resolve(result);\n
} catch (error) {\n
defer.reject(error);\n
}\n }\n
var uid = this.props.jid.split(\'@\')[0];\n }\n
this.props.connection.sendIQ(\n uid = this.props.jid.split(\'@\')[0];\n
$iq({to: server, type: "set"})\n this.props.connection.sendIQ(\n
$iq({to: server, type: "set"})\n
.c("query", {xmlns: "jabber:iq:register"})\n .c("query", {xmlns: "jabber:iq:register"})\n
.c("username").t(uid).up()\n .c("username").t(uid).up()\n
.c("password").t(new_passwd).up(),\n .c("password").t(new_passwd).up(),\n
jsonifyResponse,\n jsonifyResponse,\n
defer.reject\n defer.reject\n
);\n );\n
return defer.promise;\n return defer.promise;\n
})\n })\n
.declareMethod(\'sendPresence\', function () {\n .declareMethod(\'sendPresence\', function () {\n
this.props.connection.send(\n this.props.connection.send(\n
$pres().tree()\n $pres().tree()\n
...@@ -583,7 +587,7 @@ ...@@ -583,7 +587,7 @@
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>944.7242.54723.60006</string> </value> <value> <string>949.35404.19073.41659</string> </value>
</item> </item>
<item> <item>
<key> <string>state</string> </key> <key> <string>state</string> </key>
...@@ -601,8 +605,8 @@ ...@@ -601,8 +605,8 @@
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1436191748.38</float> <float>1456844917.63</float>
<string>GMT</string> <string>UTC</string>
</tuple> </tuple>
</state> </state>
</object> </object>
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment