Commit 8cd4d1b3 authored by Sebastien Robin's avatar Sebastien Robin

officejs task app: setup appcache for planning widget

parent 31b87a7c
...@@ -7,15 +7,17 @@ ...@@ -7,15 +7,17 @@
<title>OfficeJS Planning</title> <title>OfficeJS Planning</title>
<script src="rsvp.js"></script> <script src="rsvp.js" type="text/javascript"></script>
<script src="renderjs.js"></script> <script src="renderjs.js" type="text/javascript"></script>
<script src="gadget_officejs_page_planning.js"></script> <script src="gadget_officejs_page_planning.js" type="text/javascript"></script>
</head> </head>
<body> <body>
<div class="planning-error-message"></div>
<div class='document-content'></div> <div class='document-content'></div>
</body> </body>
</html> </html>
...@@ -3,6 +3,7 @@ ...@@ -3,6 +3,7 @@
(function (window, RSVP, rJS) { (function (window, RSVP, rJS) {
"use strict"; "use strict";
var PLANNING_WIDGET_GADGET_URL = "planning/";
rJS(window) rJS(window)
.ready(function (g) { .ready(function (g) {
g.props = {}; g.props = {};
...@@ -96,7 +97,7 @@ ...@@ -96,7 +97,7 @@
}) })
.push(function () { .push(function () {
return gadget.declareGadget( return gadget.declareGadget(
"gadget_officejs_widget_planning.html", PLANNING_WIDGET_GADGET_URL,
{ {
scope: "planning", scope: "planning",
sandbox: "iframe", sandbox: "iframe",
...@@ -113,6 +114,9 @@ ...@@ -113,6 +114,9 @@
text_gadget = planning_gadget; text_gadget = planning_gadget;
return planning_gadget.render({ return planning_gadget.render({
search_page: 'planning', search_page: 'planning',
mapping: {title: 'title',
start: 'start_date',
stop: 'stop_date'},
column_list: [{ column_list: [{
select: 'title', select: 'title',
title: 'Title' title: 'Title'
...@@ -136,13 +140,30 @@ ...@@ -136,13 +140,30 @@
query: 'portal_type:("' + gadget.props.portal_type + '")', query: 'portal_type:("' + gadget.props.portal_type + '")',
select_list: ['title', 'reference', 'start_date', select_list: ['title', 'reference', 'start_date',
'description', 'stop_date', 'modification_date'], 'description', 'stop_date', 'modification_date'],
limit: [0, 30], limit: [0, 30]
sort_on: [["modification_date", "descending"]]
} }
}); });
}) })
.push(function () { .push(function () {
return text_gadget.getElement(); return text_gadget.getElement();
})
.fail(function (error) {
console.log("LOADing error, error", error);
var display_error_element;
if (error.message.startsWith("Timeout") === true) {
display_error_element =
gadget.props.element.querySelector(
".planning-error-message"
);
display_error_element.innerHTML =
'<br/><p style="color: red"></p><br/><br/>';
display_error_element.querySelector('p').textContent =
"TIMEOUT: The editor gadget is taking too long to load but is" +
" currently being cached, please wait for the page to load" +
" (check your browser loading icon) and then refresh.";
} else {
throw error;
}
}); });
}); });
......
...@@ -179,11 +179,13 @@ gadget_officejs_jio_web_page_view.html\n ...@@ -179,11 +179,13 @@ gadget_officejs_jio_web_page_view.html\n
gadget_officejs_jio_web_page_view.js\n gadget_officejs_jio_web_page_view.js\n
gadget_officejs_jio_web_illustration_view.html\n gadget_officejs_jio_web_illustration_view.html\n
gadget_officejs_jio_web_illustration_view.js\n gadget_officejs_jio_web_illustration_view.js\n
vis.js\n gadget_officejs_widget_planning.html/vis.js\n
vis.css\n planning/\n
NETWORK:\n NETWORK:\n
*\n *\n
\n \n
\n
\n
]]></string> </value> ]]></string> </value>
...@@ -321,7 +323,7 @@ NETWORK:\n ...@@ -321,7 +323,7 @@ NETWORK:\n
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>954.15732.8858.46950</string> </value> <value> <string>954.22799.4754.34713</string> </value>
</item> </item>
<item> <item>
<key> <string>state</string> </key> <key> <string>state</string> </key>
...@@ -339,7 +341,7 @@ NETWORK:\n ...@@ -339,7 +341,7 @@ NETWORK:\n
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1475152619.1</float> <float>1475503324.09</float>
<string>UTC</string> <string>UTC</string>
</tuple> </tuple>
</state> </state>
......
<!DOCTYPE html> <!DOCTYPE html>
<html> <html manifest="gadget_officejs_planning_widget.appcache">
<head> <head>
<meta charset="utf-8" /> <meta charset="utf-8" />
<meta name="viewport" content="width=device-width, user-scalable=no" /> <meta name="viewport" content="width=device-width, user-scalable=no" />
...@@ -13,17 +13,16 @@ ...@@ -13,17 +13,16 @@
<!-- custom script --> <!-- custom script -->
<script src="gadget_officejs_widget_planning.js" type="text/javascript"></script> <script src="gadget_officejs_widget_planning.js" type="text/javascript"></script>
<div class="planning-widget"></div>
<link rel="stylesheet" href="vis.css"> <link rel="stylesheet" href="vis.css">
</head> </head>
<body> <body>
<div class="custom-grid-wrap"> <div class="custom-grid-wrap">
<div class="custom-grid ui-corner-all ui-body-inherit ui-shadow ui-corner-all"> <div class="custom-grid ui-corner-all ui-body-inherit ui-shadow ui-corner-all">
<div class="ui-body-c ui-corner-all"></div> <div class="ui-body-c ui-corner-all planning-widget"></div>
</div> </div>
</div> </div>
</body> </body>
</html> </html>
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