Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
E
erp5_rtl_support
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Romain Courteaud
erp5_rtl_support
Commits
8ef46249
Commit
8ef46249
authored
Aug 04, 2015
by
Vivek
Committed by
Kazuhiko Shiozaki
Aug 10, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
jabberclient: added auto-reconnect after disconnection, updated error handling.
parent
0363c0e8
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
54 additions
and
54 deletions
+54
-54
bt5/erp5_web_jabber_client/PathTemplateItem/web_page_module/jabber_gadget_jabberclient_html.xml
...eItem/web_page_module/jabber_gadget_jabberclient_html.xml
+4
-4
bt5/erp5_web_jabber_client/PathTemplateItem/web_page_module/jabber_gadget_jabberclient_js.xml
...ateItem/web_page_module/jabber_gadget_jabberclient_js.xml
+48
-48
bt5/erp5_web_jabber_client/PathTemplateItem/web_page_module/jabber_gadget_jabberconnection_js.xml
...tem/web_page_module/jabber_gadget_jabberconnection_js.xml
+2
-2
No files found.
bt5/erp5_web_jabber_client/PathTemplateItem/web_page_module/jabber_gadget_jabberclient_html.xml
View file @
8ef46249
...
...
@@ -200,6 +200,7 @@
</div>
\n
<input
data-inline=
"true"
type=
"submit"
value=
"Log In"
data-theme=
"b"
>
\n
</form>
\n
<pre
style=
"white-space: pre-wrap;"
>
{{message}}
</pre>
\n
</div>
\n
<div
class=
"ui-block-c"
></div>
\n
</div>
\n
...
...
@@ -249,7 +250,6 @@
\n
<script
class=
"history-template"
type=
"text/x-handlebars-template"
><pre
style=
"white-space: pre-wrap;"
>
{{text}}
</pre></script>
\n
\n
<script
class=
"error-template"
type=
"text/x-handlebars-template"
><pre
style=
"white-space: pre-wrap;"
>
{{error_message}}
</pre></script>
\n
<script
class=
"header-template"
type=
"text/x-handlebars-template"
>
\n
{{#if left_url}}\n
<a
href=
"{{left_url}}"
class=
"ui-btn-left ui-btn ui-btn-inline ui-mini ui-corner-all"
>
{{left_title}}
</a>
\n
...
...
@@ -407,7 +407,7 @@
</item>
<item>
<key>
<string>
actor
</string>
</key>
<value>
<string>
zope
</string>
</value>
<value>
<string>
zope
1
</string>
</value>
</item>
<item>
<key>
<string>
comment
</string>
</key>
...
...
@@ -421,7 +421,7 @@
</item>
<item>
<key>
<string>
serial
</string>
</key>
<value>
<string>
944.5
553.6477.32460
</string>
</value>
<value>
<string>
944.5
4830.54261.27972
</string>
</value>
</item>
<item>
<key>
<string>
state
</string>
</key>
...
...
@@ -439,7 +439,7 @@
</tuple>
<state>
<tuple>
<float>
143
5739472.1
</float>
<float>
143
8695309.09
</float>
<string>
GMT
</string>
</tuple>
</state>
...
...
bt5/erp5_web_jabber_client/PathTemplateItem/web_page_module/jabber_gadget_jabberclient_js.xml
View file @
8ef46249
...
...
@@ -239,7 +239,7 @@
var prefix,\n
date = new Date(),\n
timestamp = date.getFullYear() + "-" +\n
zfill(date.getMonth(), 2) + "-" +\n
zfill(date.getMonth()
+ 1
, 2) + "-" +\n
zfill(date.getDate(), 2) + " " +\n
date.toTimeString();\n
if (is_incomming) {\n
...
...
@@ -413,25 +413,6 @@
$(gadget.props.element).trigger("create");\n
});\n
}\n
\n
function renderErrorPage(gadget, error) {\n
var error_text = error;\n
return RSVP.Queue()\n
.push(function () {\n
return gadget.aq_pleasePublishMyState({page: PAGE_CONNECTION});\n
})\n
.push(function (connection_url) {\n
gadget.props.header_element.innerHTML = gadget.props.header_template({\n
left_url: connection_url,\n
left_title: "Login",\n
title: "Error Message"\n
});\n
gadget.props.content_element.innerHTML = gadget.props.error_template({\n
error_message: error_text\n
});\n
$(gadget.props.element).trigger("create");\n
});\n
}\n
\n
function renderDialogPage(gadget, connection_gadget) {\n
var jid,\n
...
...
@@ -487,10 +468,13 @@
});\n
}\n
\n
function renderConnectPage(gadget) {\n
function renderConnectPage(gadget
, display_message
) {\n
// Always flush the contact list\n
gadget.props.contact_dict = {};\n
gadget.props.my_server = \'\',\n
gadget.props.my_jid = \'\';\n
gadget.props.my_password = \'\';\n
gadget.props.connected = false;\n
// Always kill the previous connection gadget to ensure disconnection\n
gadget.props.connection_element.innerHTML = "";\n
return gadget.dropGadget(CONNECTION_GADGET_SCOPE)\n
...
...
@@ -510,7 +494,9 @@
title: "Connect"\n
});\n
gadget.props.content_element.innerHTML =\n
gadget.props.login_template({});\n
gadget.props.login_template({\n
message: display_message || ""\n
});\n
$(gadget.props.element).trigger("create");\n
gadget.props.content_element.querySelector("input[name=jid]")\n
.focus();\n
...
...
@@ -531,15 +517,14 @@
.push(function (result_list) {\n
var connection_gadget = result_list[0],\n
submit_event = result_list[1];\n
gadget.props.my_server = submit_event.target[0].value; \n
gadget.props.my_jid = submit_event.target[1].value;\n
gadget.props.my_password = submit_event.target[2].value;\n
return connection_gadget.connect(\n
submit_event.target[0].value,\n
submit_event.target[1].value,\n
submit_event.target[2].value\n
);\n
})\n
.push(function () {\n
return redirectToDefaultPage(gadget);\n
});\n
}\n
\n
...
...
@@ -582,10 +567,8 @@
});\n
}\n
\n
function renderResetPasswordPage(gadget, connection_gadget, status) {\n
if(!status) {\n
status = "";\n
}\n
function renderResetPasswordPage(gadget, connection_gadget, display_message) {\n
var new_password = \'\';\n
return new RSVP.Queue()\n
.push(function () {\n
return gadget.aq_pleasePublishMyState({page: PAGE_CONTACT});\n
...
...
@@ -598,7 +581,7 @@
});\n
gadget.props.content_element.innerHTML =\n
gadget.props.reset_password_template({\n
message:
status
\n
message:
display_message || ""
\n
});\n
$(gadget.props.element).trigger("create");\n
gadget.props.content_element.querySelector("input[type=submit]")\n
...
...
@@ -617,6 +600,7 @@
})\n
.push(function (submit_event) {\n
var matched = false;\n
new_password = submit_event.target[1].value;\n
gadget.props.content_element.querySelector("input[type=submit]")\n
.disabled = true;\n
matched = validatePassword(\n
...
...
@@ -629,6 +613,7 @@
submit_event.target[1].value\n
)\n
.push(function (status) {\n
gadget.props.my_password = new_password;\n
return renderResetPasswordPage(gadget, connection_gadget, status);\n
}, function (error) {\n
var message = "Password Reset Failed.";\n
...
...
@@ -667,9 +652,6 @@
g.props.history_template = Handlebars.compile(\n
document.querySelector(".history-template").innerHTML\n
);\n
g.props.error_template = Handlebars.compile(\n
document.querySelector(".error-template").innerHTML\n
);\n
g.props.reset_password_template = Handlebars.compile(\n
document.querySelector(".reset-password-template").innerHTML\n
);\n
...
...
@@ -691,7 +673,11 @@
//////////////////////////////////////////\n
.allowPublicAcquisition("notifyXMPPConnected", function () {\n
var gadget = this;\n
return gadget.getDeclaredGadget(CONNECTION_GADGET_SCOPE)\n
gadget.props.connected = true;\n
return redirectToDefaultPage(gadget)\n
.push(function() {\n
return gadget.getDeclaredGadget(CONNECTION_GADGET_SCOPE);\n
})\n
.push(function (connection_gadget) {\n
return connection_gadget.sendPresence();\n
})\n
...
...
@@ -707,8 +693,8 @@
initializeContact(gadget, all_contacts[key].jid);\n
}\n
}, function (error) {\n
var error_text = "
Roster Fetching Failed
";\n
return render
Error
Page(gadget, error_text);\n
var error_text = "
Fetching Contact List Failed. Please login again.
";\n
return render
Connect
Page(gadget, error_text);\n
});\n
})\n
.allowPublicAcquisition("notifyXMPPConnecting", function () {\n
...
...
@@ -788,23 +774,37 @@
\n
.allowPublicAcquisition("notifyXMPPConnectingFail", function () {\n
var gadget = this,\n
error_text = \'
XMPPConnectingFail
\';\n
return render
Error
Page(gadget, error_text);\n
error_text = \'
Connection Failed. Please login again.
\';\n
return render
Connect
Page(gadget, error_text);\n
})\n
.allowPublicAcquisition("notifyXMPPDisconnecting", function () {\n
var gadget = this,\n
error_text = \'XMPPDisconnecting\';\n
return renderErrorPage(gadget, error_text);\n
return;\n
})\n
.allowPublicAcquisition("notifyXMPPDisconnected", function () {\n
var gadget = this,\n
error_text = \'XMPPDisconnected\';\n
return renderErrorPage(gadget, error_text);\n
error_text = \'Session Disconnected. Please login again.\';\n
if(!gadget.props.connected) {\n
return renderConnectPage(gadget, error_text);\n
} else {\n
gadget.props.connected = false;\n
gadget.props.contact_dict = {};\n
return gadget.getDeclaredGadget(CONNECTION_GADGET_SCOPE)\n
.push(function (connection_gadget) {\n
return connection_gadget.connect(\n
gadget.props.my_server, \n
gadget.props.my_jid,\n
gadget.props.my_password\n
);\n
})\n
.push(function () {\n
return redirectToDefaultPage(gadget);\n
});\n
}\n
})\n
.allowPublicAcquisition("notifyXMPPAuthenticatingFailed", function (error_data) {\n
var gadget = this,\n
error_text = \'
XMPPAuthenticatingFailed
\';\n
return render
Error
Page(gadget, error_text);\n
error_text = \'
Authentication Failed. Please try again.
\';\n
return render
Connect
Page(gadget, error_text);\n
})\n
.declareService(function () {\n
\n
...
...
@@ -998,7 +998,7 @@
</item>
<item>
<key>
<string>
actor
</string>
</key>
<value>
<string>
zope
</string>
</value>
<value>
<string>
zope
1
</string>
</value>
</item>
<item>
<key>
<string>
comment
</string>
</key>
...
...
@@ -1012,7 +1012,7 @@
</item>
<item>
<key>
<string>
serial
</string>
</key>
<value>
<string>
944.5
545.36219.41881
</string>
</value>
<value>
<string>
944.5
4834.23868.16998
</string>
</value>
</item>
<item>
<key>
<string>
state
</string>
</key>
...
...
@@ -1030,7 +1030,7 @@
</tuple>
<state>
<tuple>
<float>
143
5744547.72
</float>
<float>
143
8696276.38
</float>
<string>
GMT
</string>
</tuple>
</state>
...
...
bt5/erp5_web_jabber_client/PathTemplateItem/web_page_module/jabber_gadget_jabberconnection_js.xml
View file @
8ef46249
...
...
@@ -583,7 +583,7 @@
</item>
<item>
<key>
<string>
serial
</string>
</key>
<value>
<string>
944.
5651.30805.18688
</string>
</value>
<value>
<string>
944.
7242.54723.60006
</string>
</value>
</item>
<item>
<key>
<string>
state
</string>
</key>
...
...
@@ -601,7 +601,7 @@
</tuple>
<state>
<tuple>
<float>
143
5744650.
8
</float>
<float>
143
6191748.3
8
</float>
<string>
GMT
</string>
</tuple>
</state>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment