Commit 23d55cdb authored by Eugene Shen's avatar Eugene Shen

Add chat_disconnect page and Rusha hashing module

Add gadget_erp5_page_chat_disconnect to clear settings and redirect;
remove line breaks and prepend "chat-" to chat-specific classes;
and add Rusha in preparation of future hash-related adventures.
parent 62f0bebc
...@@ -9,20 +9,18 @@ ...@@ -9,20 +9,18 @@
<script src="gadget_erp5_page_chat_connect.js"></script> <script src="gadget_erp5_page_chat_connect.js"></script>
</head> </head>
<body> <body>
<form class="connect-form"> <form class="chat-connect-form">
<label>E-mail Address:</label> <label>E-mail Address:</label>
<input type="email" name="user_email" required="required" /> <input type="email" name="user_email" required="required" />
<label>Default Shared Storage Type:</label> <label>Default Shared Storage Type:</label>
<br />
<input type="radio" name="default_jio_type" value="erp5">ERP5</input> <input type="radio" name="default_jio_type" value="erp5">ERP5</input>
<input type="radio" name="default_jio_type" value="dav">WebDAV</input> <input type="radio" name="default_jio_type" value="dav">WebDAV</input>
<input type="radio" name="default_jio_type" value="custom">Custom jIO Configuration</input> <input type="radio" name="default_jio_type" value="custom">Custom jIO Configuration</input>
<br />
<label>Default ERP5 URL:</label> <label>Default ERP5 URL:</label>
<input type="text" name="default_erp5_url", placeholder="https://softinst75770.host.vifib.net/erp5/web_site_module/hateoas" /> <input type="text" name="default_erp5_url", placeholder="https://softinst75770.host.vifib.net/erp5/web_site_module/hateoas" />
<label>Default WebDAV URL:</label> <label>Default WebDAV URL:</label>
<input type="text" name="default_dav_url", placeholder="https://softinst75722.host.vifib.net/share" /> <input type="text" name="default_dav_url", placeholder="https://softinst75722.host.vifib.net/share" />
<input type="submit" /> <input class="chat-submit" type="submit" />
</form> </form>
</body> </body>
</html> </html>
\ No newline at end of file
...@@ -236,7 +236,7 @@ ...@@ -236,7 +236,7 @@
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>958.41727.25173.10461</string> </value> <value> <string>958.50026.15443.4590</string> </value>
</item> </item>
<item> <item>
<key> <string>state</string> </key> <key> <string>state</string> </key>
...@@ -254,7 +254,7 @@ ...@@ -254,7 +254,7 @@
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1492008933.86</float> <float>1492526915.55</float>
<string>UTC</string> <string>UTC</string>
</tuple> </tuple>
</state> </state>
......
...@@ -5,6 +5,7 @@ ...@@ -5,6 +5,7 @@
/* Settings modified: /* Settings modified:
* - user_email * - user_email
* - jio_storage_description
* - default_jio_type * - default_jio_type
* - default_erp5_url * - default_erp5_url
* - default_dav_url * - default_dav_url
...@@ -22,7 +23,7 @@ ...@@ -22,7 +23,7 @@
.declareAcquiredMethod("setSetting", "setSetting") .declareAcquiredMethod("setSetting", "setSetting")
// Update header, page_title to "Connect to Chat". // updateHeader: "Connect to Chat".
.declareMethod("render", function () { .declareMethod("render", function () {
var gadget = this; var gadget = this;
......
...@@ -232,7 +232,7 @@ ...@@ -232,7 +232,7 @@
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>958.41792.51911.46677</string> </value> <value> <string>958.51484.28325.28842</string> </value>
</item> </item>
<item> <item>
<key> <string>state</string> </key> <key> <string>state</string> </key>
...@@ -250,7 +250,7 @@ ...@@ -250,7 +250,7 @@
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1492014982.95</float> <float>1492594366.77</float>
<string>UTC</string> <string>UTC</string>
</tuple> </tuple>
</state> </state>
......
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
<title>OfficeJS Chat Disconnect</title>
<script src="rsvp.js"></script>
<script src="renderjs.js"></script>
<script src="gadget_erp5_page_chat_disconnect.js"></script>
</head>
<body>
</body>
</html>
\ No newline at end of file
/*jslint nomen: true, indent: 2, maxerr: 3, maxlen: 80 */
/*global window, RSVP, rJS */
(function (window, RSVP, rJS) {
"use strict";
/* Settings modified:
* - user_email, to undefined
* - jio_storage_description, to undefined
* - jio_storage_name, to undefined
* - default_jio_type, to undefined
* - default_erp5_url, to undefined
* - default_dav_url, to undefined
* - redirect_after_reload, to: undefined
*/
rJS(window)
// Neither state to set nor ready to initialize.
// The following functions are all acquired from erp5_launcher_nojqm.js
.declareAcquiredMethod("updateHeader", "updateHeader")
.declareAcquiredMethod("redirect", "redirect")
.declareAcquiredMethod("reload", "reload")
.declareAcquiredMethod("setSetting", "setSetting")
.declareAcquiredMethod("getSetting", "getSetting")
/* Render the gadget.
* Effects:
* - redirect if redirect_after_reload is set
* - updateHeader: "Disconnect from Chat"
* - reset all settings set by chat_connect
* - if successful, update body to "You have successfully logged out."
* - setSetting: redirect_after_reload
* - reload, then redirect to the front page
*/
.declareMethod("render", function () {
var gadget = this;
return gadget.getSetting("redirect_after_reload")
.push(function (redirect) {
if (redirect) {
return gadget.setSetting("redirect_after_reload", undefined)
.push(function () {
return gadget.redirect(redirect);
});
}
gadget.element.innerHTML = "You have successfully logged out.";
return gadget.updateHeader({page_title: "Disconnect from Chat"})
.push(function () {
var i, queue = new RSVP.Queue(),
fields = ["user_email", "default_jio_type",
"default_erp5_url", "default_dav_url",
"jio_storage_name", "jio_storage_description"],
callSetting = function (setting) {
return function () {
return gadget.setSetting(setting, undefined);
};
};
// must declare queue inside a queue to avoid ResolvedQueueError
for (i = 0; i < fields.length; i += 1) {
queue.push(callSetting(fields[i]));
}
return queue
.push(function () {
gadget.setSetting("redirect_after_reload", {
command: "display"
});
})
.push(function () {
return gadget.reload();
});
});
});
});
}(window, RSVP, rJS));
\ No newline at end of file
This diff is collapsed.
...@@ -13,6 +13,8 @@ web_page_module/gadget_erp5_page_chat_box_html ...@@ -13,6 +13,8 @@ web_page_module/gadget_erp5_page_chat_box_html
web_page_module/gadget_erp5_page_chat_box_js web_page_module/gadget_erp5_page_chat_box_js
web_page_module/gadget_erp5_page_chat_connect_html web_page_module/gadget_erp5_page_chat_connect_html
web_page_module/gadget_erp5_page_chat_connect_js web_page_module/gadget_erp5_page_chat_connect_js
web_page_module/gadget_erp5_page_chat_disconnect_html
web_page_module/gadget_erp5_page_chat_disconnect_js
web_page_module/gadget_erp5_page_jio_configurator_html web_page_module/gadget_erp5_page_jio_configurator_html
web_page_module/gadget_erp5_page_jio_configurator_js web_page_module/gadget_erp5_page_jio_configurator_js
web_page_module/gadget_erp5_page_jio_dav_configurator_html web_page_module/gadget_erp5_page_jio_dav_configurator_html
...@@ -25,4 +27,5 @@ web_page_module/gadget_erp5_page_sync_js ...@@ -25,4 +27,5 @@ web_page_module/gadget_erp5_page_sync_js
web_page_module/handlebars_js web_page_module/handlebars_js
web_page_module/jio_mappingstorage_js web_page_module/jio_mappingstorage_js
web_page_module/officejs_chat_launcher_html web_page_module/officejs_chat_launcher_html
web_page_module/rusha_js
web_site_module/officejs_chat web_site_module/officejs_chat
\ No newline at end of file
...@@ -13,6 +13,8 @@ web_page_module/gadget_erp5_page_chat_box_html ...@@ -13,6 +13,8 @@ web_page_module/gadget_erp5_page_chat_box_html
web_page_module/gadget_erp5_page_chat_box_js web_page_module/gadget_erp5_page_chat_box_js
web_page_module/gadget_erp5_page_chat_connect_html web_page_module/gadget_erp5_page_chat_connect_html
web_page_module/gadget_erp5_page_chat_connect_js web_page_module/gadget_erp5_page_chat_connect_js
web_page_module/gadget_erp5_page_chat_disconnect_html
web_page_module/gadget_erp5_page_chat_disconnect_js
web_page_module/gadget_erp5_page_jio_configurator_html web_page_module/gadget_erp5_page_jio_configurator_html
web_page_module/gadget_erp5_page_jio_configurator_js web_page_module/gadget_erp5_page_jio_configurator_js
web_page_module/gadget_erp5_page_jio_dav_configurator_html web_page_module/gadget_erp5_page_jio_dav_configurator_html
...@@ -24,4 +26,5 @@ web_page_module/gadget_erp5_page_sync_html ...@@ -24,4 +26,5 @@ web_page_module/gadget_erp5_page_sync_html
web_page_module/gadget_erp5_page_sync_js web_page_module/gadget_erp5_page_sync_js
web_page_module/jio_mappingstorage_js web_page_module/jio_mappingstorage_js
web_page_module/officejs_chat_launcher_html web_page_module/officejs_chat_launcher_html
web_page_module/rusha_js
web_site_module/officejs_chat web_site_module/officejs_chat
\ No newline at end of file
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