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 @@
</item>
<item>
<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
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_jabberclient.js\n
gadget_jabberclient.html\n
gadget_jabberconnection.html\n
gadget_jabberconnection.js\n
gadget_jio.js\n
gadget_jio.html\n
handlebars.js\n
......@@ -116,9 +129,38 @@ jquerymobile.css\n
jquerymobile.js\n
renderjs.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
*</string> </value>
*
]]></string> </value>
</item>
<item>
<key> <string>title</string> </key>
......@@ -239,7 +281,7 @@ NETWORK:\n
</item>
<item>
<key> <string>actor</string> </key>
<value> <string>normie</string> </value>
<value> <string>zope</string> </value>
</item>
<item>
<key> <string>comment</string> </key>
......@@ -253,7 +295,7 @@ NETWORK:\n
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>945.44005.30137.52718</string> </value>
<value> <string>949.35452.57030.13636</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -271,7 +313,7 @@ NETWORK:\n
</tuple>
<state>
<tuple>
<float>1442825498.81</float>
<float>1456907697.62</float>
<string>UTC</string>
</tuple>
</state>
......
......@@ -104,7 +104,7 @@
<value> <string encoding="cdata"><![CDATA[
<!doctype html>\n
<html>\n
<html manifest="gadget_jabberconnection.appcache">\n
<head>\n
<meta charset="utf-8">\n
<title>Connection</title>\n
......@@ -242,7 +242,7 @@
</item>
<item>
<key> <string>actor</string> </key>
<value> <string>romain</string> </value>
<value> <string>zope</string> </value>
</item>
<item>
<key> <string>comment</string> </key>
......@@ -256,7 +256,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>939.33860.38910.29713</string> </value>
<value> <string>949.35389.52548.34798</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -274,8 +274,8 @@
</tuple>
<state>
<tuple>
<float>1418214410.97</float>
<string>GMT</string>
<float>1456847737.11</float>
<string>UTC</string>
</tuple>
</state>
</object>
......
......@@ -101,8 +101,8 @@
<key> <string>text_content</string> </key>
<value> <string encoding="cdata"><![CDATA[
/*jslint nomen: true*/\n
/*global window, rJS, Strophe, $iq, $pres, $msg, RSVP*/\n
/*jslint indent: 2, maxerr: 3, nomen: true */\n
\n
(function (window, rJS, Strophe, $iq, $pres, $msg, RSVP) {\n
"use strict";\n
......@@ -117,7 +117,7 @@
this.errors += 1;\n
Strophe.warn("request errored, status: " + reqStatus +\n
", number of errors: " + this.errors);\n
if (this.errors > 4) {\n
if (this.errors > 2) {\n
this._onDisconnectTimeout();\n
this._conn._changeConnectStatus(\n
Strophe.Status.ERROR,\n
......@@ -222,9 +222,9 @@
result = gadget.notifyXMPPAttached();\n
} else {\n
if (status === Strophe.Status.ERROR) {\n
throw new Error("XMPP Connection Error");\n
result = gadget.notifyXMPPConnectionError();\n
}\n
throw new Error("Unknown connection status: " + status);\n
result = gadget.notifyXMPPError(status);\n
}\n
return result;\n
});\n
......@@ -302,6 +302,10 @@
\'notifyXMPPDisconnected\')\n
.declareAcquiredMethod(\'notifyXMPPDisconnecting\',\n
\'notifyXMPPDisconnecting\')\n
.declareAcquiredMethod(\'notifyXMPPConnectionError\',\n
\'notifyXMPPConnectionError\')\n
.declareAcquiredMethod(\'notifyXMPPError\',\n
\'notifyXMPPError\')\n
.declareAcquiredMethod(\'notifyXMPPAttached\',\n
\'notifyXMPPAttached\')\n
.declareAcquiredMethod(\'notifyXMPPMessageTextReceived\',\n
......@@ -348,68 +352,68 @@
})\n
\n
.declareMethod(\'fetchRoster\', function () {\n
var defer = RSVP.defer();\n
function jsonifyResponse(domElt) {\n
try {\n
var result = [],\n
elt,\n
json_elt,\n
len,\n
i,\n
len2,\n
j,\n
item_list = domElt.querySelectorAll("item");\n
len = item_list.length;\n
for (i = 0; i < len; i += 1) {\n
elt = item_list[i];\n
len2 = elt.attributes.length;\n
json_elt = {};\n
for (j = 0; j < len2; j += 1) {\n
json_elt[elt.attributes[j].name] = elt.attributes[j].value;\n
}\n
result.push(json_elt);\n
var defer = RSVP.defer();\n
function jsonifyResponse(domElt) {\n
try {\n
var result = [],\n
elt,\n
json_elt,\n
len,\n
i,\n
len2,\n
j,\n
item_list = domElt.querySelectorAll("item");\n
len = item_list.length;\n
for (i = 0; i < len; i += 1) {\n
elt = item_list[i];\n
len2 = elt.attributes.length;\n
json_elt = {};\n
for (j = 0; j < len2; j += 1) {\n
json_elt[elt.attributes[j].name] = elt.attributes[j].value;\n
}\n
defer.resolve(result);\n
} catch (error) {\n
defer.reject(error);\n
result.push(json_elt);\n
}\n
}\n
this.props.connection.sendIQ(\n
$iq({type: "get"}).c("query", {xmlns: Strophe.NS.ROSTER}),\n
jsonifyResponse,\n
defer.reject\n
);\n
return defer.promise;\n
})\n
defer.resolve(result);\n
} catch (error) {\n
defer.reject(error);\n
}\n
}\n
this.props.connection.sendIQ(\n
$iq({type: "get"}).c("query", {xmlns: Strophe.NS.ROSTER}),\n
jsonifyResponse,\n
defer.reject\n
);\n
return defer.promise;\n
})\n
\n
.declareMethod(\'resetPassword\', function (server, new_passwd) {\n
var defer = RSVP.defer();\n
function jsonifyResponse(domElt) {\n
try {\n
var result = [],\n
type = domElt.getAttribute(\'type\');\n
if(type === "result") {\n
result.push("Password Reset Success.");\n
}\n
else {\n
throw new Error("Password Reset Failure.");\n
}\n
defer.resolve(result);\n
} catch (error) {\n
defer.reject(error);\n
var defer = RSVP.defer(),\n
uid;\n
function jsonifyResponse(domElt) {\n
try {\n
var result = [],\n
type = domElt.getAttribute(\'type\');\n
if (type === "result") {\n
result.push("Password Reset Success.");\n
} else {\n
throw new Error("Password Reset Failure.");\n
}\n
defer.resolve(result);\n
} catch (error) {\n
defer.reject(error);\n
}\n
var uid = this.props.jid.split(\'@\')[0];\n
this.props.connection.sendIQ(\n
$iq({to: server, type: "set"})\n
}\n
uid = this.props.jid.split(\'@\')[0];\n
this.props.connection.sendIQ(\n
$iq({to: server, type: "set"})\n
.c("query", {xmlns: "jabber:iq:register"})\n
.c("username").t(uid).up()\n
.c("password").t(new_passwd).up(),\n
jsonifyResponse,\n
defer.reject\n
);\n
return defer.promise;\n
})\n
jsonifyResponse,\n
defer.reject\n
);\n
return defer.promise;\n
})\n
.declareMethod(\'sendPresence\', function () {\n
this.props.connection.send(\n
$pres().tree()\n
......@@ -583,7 +587,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>944.7242.54723.60006</string> </value>
<value> <string>949.35404.19073.41659</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -601,8 +605,8 @@
</tuple>
<state>
<tuple>
<float>1436191748.38</float>
<string>GMT</string>
<float>1456844917.63</float>
<string>UTC</string>
</tuple>
</state>
</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