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

officejs task app: setup appcache for planning widget

parent 31b87a7c
......@@ -7,15 +7,17 @@
<title>OfficeJS Planning</title>
<script src="rsvp.js"></script>
<script src="renderjs.js"></script>
<script src="gadget_officejs_page_planning.js"></script>
<script src="rsvp.js" type="text/javascript"></script>
<script src="renderjs.js" type="text/javascript"></script>
<script src="gadget_officejs_page_planning.js" type="text/javascript"></script>
</head>
<body>
<div class="planning-error-message"></div>
<div class='document-content'></div>
</body>
</html>
......@@ -3,6 +3,7 @@
(function (window, RSVP, rJS) {
"use strict";
var PLANNING_WIDGET_GADGET_URL = "planning/";
rJS(window)
.ready(function (g) {
g.props = {};
......@@ -96,7 +97,7 @@
})
.push(function () {
return gadget.declareGadget(
"gadget_officejs_widget_planning.html",
PLANNING_WIDGET_GADGET_URL,
{
scope: "planning",
sandbox: "iframe",
......@@ -113,6 +114,9 @@
text_gadget = planning_gadget;
return planning_gadget.render({
search_page: 'planning',
mapping: {title: 'title',
start: 'start_date',
stop: 'stop_date'},
column_list: [{
select: 'title',
title: 'Title'
......@@ -136,13 +140,30 @@
query: 'portal_type:("' + gadget.props.portal_type + '")',
select_list: ['title', 'reference', 'start_date',
'description', 'stop_date', 'modification_date'],
limit: [0, 30],
sort_on: [["modification_date", "descending"]]
limit: [0, 30]
}
});
})
.push(function () {
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
gadget_officejs_jio_web_page_view.js\n
gadget_officejs_jio_web_illustration_view.html\n
gadget_officejs_jio_web_illustration_view.js\n
vis.js\n
vis.css\n
gadget_officejs_widget_planning.html/vis.js\n
planning/\n
NETWORK:\n
*\n
\n
\n
\n
]]></string> </value>
......@@ -321,7 +323,7 @@ NETWORK:\n
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>954.15732.8858.46950</string> </value>
<value> <string>954.22799.4754.34713</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -339,7 +341,7 @@ NETWORK:\n
</tuple>
<state>
<tuple>
<float>1475152619.1</float>
<float>1475503324.09</float>
<string>UTC</string>
</tuple>
</state>
......
<!DOCTYPE html>
<html>
<html manifest="gadget_officejs_planning_widget.appcache">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, user-scalable=no" />
......@@ -13,17 +13,16 @@
<!-- custom script -->
<script src="gadget_officejs_widget_planning.js" type="text/javascript"></script>
<div class="planning-widget"></div>
<link rel="stylesheet" href="vis.css">
</head>
<body>
<div class="custom-grid-wrap">
<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>
</body>
</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