Commit 8050b000 authored by Laurent S's avatar Laurent S

[erp5_officejs] : Updates for notebook

parent 2eabf96b
......@@ -236,5 +236,19 @@
"application_category":"Projects",
"application_title_i18n":"application.custom.hr.title",
"application_description_i18n":"application.custom.hr.description"
},
{
"int_index": "71",
"application_image_type": "image",
"application_image_url": "notebook_logo.svg",
"application_toc_accept": true,
"application_published":"21/05/2018",
"application_submitted":"21/05/2018",
"application_description":"In-browser python/js notebooks",
"application_url":"https://notebook.app.officejs.com",
"application_title":"Notebooks",
"application_category":"Documents",
"application_title_i18n":"application.custom.notebook.title",
"application_description_i18n":"application.custom.notebook.description"
}
]
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>OfficeJS Jio Notebook View</title>
<script src="rsvp.js"></script>
<script src="renderjs.js"></script>
<script src="handlebars.js"></script>
<script src="gadget_officejs_jio_notebook_view.js"></script>
</head>
<body>
<form class="save_form ui-body-c" novalidate>
<button type="submit" class="ui-btn ui-btn-b ui-btn-inline
ui-icon-edit ui-btn-icon-right ui-screen-hidden"></button>
<div data-gadget-url="gadget_erp5_form.html"
data-gadget-scope="form_view"
data-gadget-sandbox="public">
</div>
</form>
</body>
</html>
/*global window, rJS, RSVP */
/*jslint nomen: true, indent: 2, maxerr: 3 */
(function (window, rJS, RSVP) {
"use strict";
rJS(window)
/////////////////////////////////////////////////////////////////
// Acquired methods
/////////////////////////////////////////////////////////////////
.declareAcquiredMethod("updateHeader", "updateHeader")
.declareAcquiredMethod("getUrlParameter", "getUrlParameter")
.declareAcquiredMethod("getUrlFor", "getUrlFor")
.declareAcquiredMethod("updateDocument", "updateDocument")
.declareAcquiredMethod("notifySubmitting", "notifySubmitting")
.declareAcquiredMethod("notifySubmitted", 'notifySubmitted')
/////////////////////////////////////////////////////////////////
// declared methods
/////////////////////////////////////////////////////////////////
.declareMethod("render", function (options) {
return this.changeState({
jio_key: options.jio_key,
doc: options.doc
});
})
.onEvent('submit', function () {
var gadget = this;
return gadget.notifySubmitting()
.push(function () {
return gadget.getDeclaredGadget('form_view');
})
.push(function (form_gadget) {
return form_gadget.getContent();
})
.push(function (content) {
return gadget.updateDocument(content);
})
.push(function () {
return gadget.notifySubmitted({message: 'Data Updated', status: 'success'});
});
})
.declareMethod("triggerSubmit", function () {
return this.element.querySelector('button[type="submit"]').click();
})
.onStateChange(function () {
var gadget = this;
return gadget.getDeclaredGadget('form_view')
.push(function (form_gadget) {
return form_gadget.render({
erp5_document: {
"_embedded": {"_view": {
"my_title": {
"description": "",
"title": "Title",
"default": gadget.state.doc.title,
"css_class": "",
"required": 1,
"editable": 1,
"key": "title",
"hidden": 0,
"type": "StringField"
},
"my_reference": {
"description": "",
"title": "Reference",
"default": gadget.state.doc.reference,
"css_class": "",
"required": 0,
"editable": 1,
"key": "reference",
"hidden": 0,
"type": "StringField"
},
"my_version": {
"description": "",
"title": "Version",
"default": gadget.state.doc.version,
"css_class": "",
"required": 0,
"editable": 1,
"key": "version",
"hidden": 0,
"type": "StringField"
},
"my_language": {
"description": "",
"title": "Language",
"default": gadget.state.doc.language,
"css_class": "",
"required": 0,
"editable": 1,
"key": "language",
"hidden": 0,
"type": "StringField"
},
"my_description": {
"description": "",
"title": "Description",
"default": gadget.state.doc.description,
"css_class": "",
"required": 0,
"editable": 1,
"key": "description",
"hidden": 0,
"type": "TextAreaField"
},
"my_content": {
"default": gadget.state.doc.text_content,
"css_class": "",
"required": 0,
"editable": 1,
"key": "text_content",
"hidden": 0,
"type": "GadgetField",
"url": "gadget_editor.html",
"sandbox": "public",
"renderjs_extra": '{"editor": "notebook_editor", "maximize": true}'
}
}},
"_links": {
"type": {
// form_list display portal_type in header
name: ""
}
}
},
form_definition: {
group_list: [[
"left",
[["my_title"], ["my_reference"]]
], [
"right",
[["my_version"], ["my_language"]]
], [
"center",
[["my_description"]]
], [
"bottom",
[["my_content"]]
]]
}
});
})
.push(function () {
return RSVP.all([
gadget.getUrlFor({command: 'history_previous'}),
gadget.getUrlFor({command: 'selection_previous'}),
gadget.getUrlFor({command: 'selection_next'})
]);
})
.push(function (url_list) {
return gadget.updateHeader({
page_title: gadget.state.doc.title,
save_action: true,
selection_url: url_list[0],
previous_url: url_list[1],
next_url: url_list[2]
});
});
});
}(window, rJS, RSVP));
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width, user-scalable=no" />
<title>OfficeJS Router Gadget</title>
<!-- renderjs -->
<script src="rsvp.js" type="text/javascript"></script>
<script src="renderjs.js" type="text/javascript"></script>
<!-- custom script -->
<script src="gadget_officejs_router.js" type="text/javascript"></script>
</head>
<body>
<script data-renderjs-configuration="portal_type" type="text/x-renderjs-configuration">Notebook</script>
<script data-renderjs-configuration="document_title" type="text/x-renderjs-configuration">Notebook</script>
<script data-renderjs-configuration="document_title_plural" type="text/x-renderjs-configuration">Notebooks</script>
<script data-renderjs-configuration="parent_relative_url" type="text/x-renderjs-configuration">notebook_module</script>
<script data-renderjs-configuration="erp5_attachment_synchro" type="text/x-renderjs-configuration"></script>
<script data-renderjs-configuration="dropbox_app_key" type="text/x-renderjs-configuration">n692ixxhyg9zhqs</script>
<div data-gadget-url="gadget_erp5_router.html" data-gadget-scope="erp5_router"></div>
</body>
</html>
\ No newline at end of file
......@@ -53,6 +53,7 @@
<option>Drive App</option>
<option>Jabber Client</option>
<option>Travel Expense</option>
<option>Notebook</option>
</select>
</div>
</div>
......
......@@ -15,6 +15,10 @@
"url": "officejs_media_player/",
"cache": "gadget_officejs_media_player.appcache"
},
"Notebook": {
"url": "officejs_notebook/",
"cache": "gadget_officejs_notebook.appcache"
},
"Illustration Editor": {
"url": "officejs_svg_editor/",
"cache": "gadget_officejs_illustration.appcache"
......
var languagePluginLoader = new Promise((resolve, reject) => {
let baseURL = "";
let wasmURL = `${baseURL}pyodide.asm.wasm`;
let wasmXHR = new XMLHttpRequest();
wasmXHR.open('GET', wasmURL, true);
wasmXHR.responseType = 'arraybuffer';
wasmXHR.onload = function() {
let Module = {};
if (wasmXHR.status === 200 || wasmXHR.status === 0) {
Module.wasmBinary = wasmXHR.response;
} else {
console.warn(
`Couldn't download the pyodide.asm.wasm binary. Response was ${wasmXHR.status}`);
reject();
}
Module.baseURL = baseURL;
Module.postRun = () => {
resolve();
}
let script = document.createElement('script');
script.src = `pyodide.asm.js`;
script.onload = () => {
window.pyodide = pyodide(Module);
};
document.body.appendChild(script);
};
wasmXHR.send(null);
});
languagePluginLoader
\ No newline at end of file
<svg width="48" height="45" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<defs>
<linearGradient id="lg1">
<stop stop-color="#3778ae" offset="0"/>
<stop stop-color="#366c99" offset="1"/>
</linearGradient>
<linearGradient id="lg2">
<stop stop-color="#fff" offset="0"/>
<stop stop-color="#fff" stop-opacity="0.165" offset="1"/>
</linearGradient>
<linearGradient id="lg3">
<stop stop-color="#ffe253" offset="0"/>
<stop stop-color="#ffca1c" offset="1"/>
</linearGradient>
<linearGradient id="lg4">
<stop stop-color="#000" offset="0"/>
<stop stop-color="#000" stop-opacity="0" offset="1"/>
</linearGradient>
<linearGradient x1="0.42161" y1="0.89928" x2="0.42161" y2="0.06188" id="lg5" xlink:href="#lg2"/>
<linearGradient x1="-0.00001" y1="0.50003" x2="1" y2="0.50003" id="lg6" xlink:href="#lg1"/>
<linearGradient x1="0.41851" y1="0.90652" x2="0.41851" y2="0.05827" id="lg7" xlink:href="#lg2"/>
<linearGradient x1="0.36794" y1="0" x2="0.34114" y2="0.95941" id="lg8" xlink:href="#lg3"/>
<radialGradient cx="15.115" cy="63.965" r="12.289" fx="15.115" fy="63.965" id="rg1" xlink:href="#lg4" gradientUnits="userSpaceOnUse" gradientTransform="matrix(1.6,0,0,0.551754,-0.183975,4.83575)"/>
</defs>
<g>
<title>background</title>
<rect x="-1" y="-1" width="50" height="47" id="canvas_background" fill="none"/>
</g>
<g>
<title>Layer 1</title>
<path d="m43.6618,40.1289a19.6618,6.7805 0 0 1 -39.3236,0a19.6618,6.7805 0 1 1 39.3236,0z" fill="url(#rg1)" id="svg_1"/>
<path d="m34.0804,37.5795c0,2.7319 -2.371,4.1156 -4.7774,4.8057c-3.6202,1.0404 -6.5255,0.8811 -9.5511,0c-2.5268,-0.7362 -4.7774,-2.2402 -4.7774,-4.8057l0,-9.0132c0,-2.594 2.1621,-4.8092 4.7774,-4.8092l9.3984,-0.6111c3.1814,0 5.2606,-1.9858 5.2606,-5.245l0.8655,-4.3569l3.5813,0c2.7814,0 4.0909,2.0667 4.7774,4.8056c0.9555,3.8043 0.9978,6.6495 0,9.615c-0.9661,2.8805 -2,4.8056 -4.7774,4.8056l-4.7773,0l-9.5512,0l0,-0.02c8.2424,0.02 9.5512,-3.3164 9.5512,4.8281l0,0.0011z" fill="url(#lg8)" id="svg_2"/>
<path d="m28.1104,38.1776c0,-0.9944 0.8033,-1.8013 1.7906,-1.8013c1,0 1.7906,0.8069 1.7906,1.8013c0,0.9979 -0.7997,1.8047 -1.7906,1.8047c-0.9873,0 -1.7906,-0.8068 -1.7906,-1.8047z" fill="#fff" id="svg_3"/>
<path d="m35.2662,13.5436l0,4.2265c-3.4111,5.9969 -9.8912,6.0086 -15.3272,6.0086l-2.017,0.2052c-2.8342,2.4364 -2.9244,6.3463 -2.9223,9.7756c6.2502,-6.9742 12.9174,-7.5004 16.2436,-7.4854c6.6377,0.029 9.7638,-1.6029 12.9339,-5.1939c-0.016,-0.07 0.016,-0.132 0,-0.2037c-0.1222,-0.8 -0.3362,-1.6544 -0.5601,-2.546c-0.3218,-1.2839 -0.7428,-2.4141 -1.4257,-3.2589c-0.016,-0.016 -0.038,-0.034 -0.051,-0.05c0,0 -0.042,0 -0.05,0c-0.023,-0.028 -0.028,-0.075 -0.05,-0.1011c-0.047,-0.034 -0.052,-0.07 -0.101,-0.101c-0.016,-0.016 -0.039,0.016 -0.05,0c-0.7241,-0.4693 -1.6036,-0.8195 -2.4952,-0.9676c-0.8081,-0.1336 -1.6192,-0.2354 -2.4442,-0.3055l-0.5092,0l-1.1711,0l-0.0035,-0.0028z" opacity="0.837" fill="url(#lg7)" id="svg_4"/>
<path d="m34.559,37.579c0,2.732 -2.8497,4.116 -5.256,4.806c-3.62,1.04 -6.525,0.881 -9.551,0c-2.527,-0.736 -4.801,-2.24 -4.805,-4.805l-0.016,-9.258c-0.01,-3.073 2.302,-5.01 4.849,-5l8.4667,0.015c3.25,0 6.41,-3.3 6.401,-6.55l0,-3.237l4.21,0c2.7814,0 4.09,2.067 4.777,4.806c0.956,3.804 1,6.649 0,9.615c-0.966,2.88 -2,5.1476 -4.777,5.148l-4.3,0l-10.03,0l0,-0.02l10.03,0.034l0.0013,4.446z" fill="none" stroke="#bb9400" stroke-width="1.63" id="svg_5"/>
<path d="m35.4653,14.3584l0,2.3933c0,3.7245 -3.4965,7.3757 -7.4809,7.3757l-8.2491,0c-2.8506,0 -4.0184,2.1569 -4.0042,4.4379l0.056,9.0129c0.01,1.0446 0.4,1.8235 1.148,2.4951c0.748,0.6715 1.8726,1.183 3.0553,1.5277c2.9164,0.8492 5.576,1.0022 9.0638,0c1.1327,-0.3248 2.6394,-0.9401 3.3976,-1.5964c0.7581,-0.6565 1.3077,-1.2961 1.3077,-2.4264l0,-3.6298l-10.052,0l0,-1.6795l15.1743,0.05c1.2008,0 1.788,-0.4724 2.3844,-1.1633c0.5964,-0.691 1.1149,-2.0469 1.5874,-3.456c0.9456,-2.8096 0.9336,-5.4491 0,-9.1658c-0.3252,-1.2978 -0.7976,-2.3461 -1.4257,-3.0552c-0.628,-0.7091 -1.357,-1.1202 -2.5461,-1.1202l-3.4165,0zm1.6294,1.6294l1.7867,0c0.5202,0 1.1993,0.4194 1.324,0.5602c0.3625,0.4093 0.78,1.2386 1.0694,2.3932c0.8895,3.5416 0.8915,5.7515 0.05,8.2491c-0.4517,1.347 -0.9205,2.6142 -1.2729,3c-0.3184,0.3395 -1,0.5093 -1.1713,0.5093l-4.7865,-0.051l-12.0173,0l0,4.9384l10.052,0l0,2c0,0.727 -0.9733,1.1789 -1.1408,1.3239c-0.4872,0.4219 -1.3508,0.8359 -2.3423,1.1202c-3.223,0.9264 -5.5,0.7859 -8.1984,0c-1.0211,-0.2975 -1.9061,-0.7339 -2.4069,-1.1595c-0.5008,-0.4256 -0.5316,-0.7741 -0.6238,-1.285l-0.056,-9.0129c-0.013,-2.0224 0.6457,-2.8084 2.3748,-2.8084l8.2491,0c4.9233,0 9.1103,-4.3502 9.1103,-9.0052c0.0001,-0.2574 -0.0001,-0.5149 -0.0001,-0.7723z" opacity="0.384" fill="#fff" id="svg_6"/>
<path d="m13.9847,7.3199c0,-2.7319 0.7324,-4.2182 4.7772,-4.926c2.7462,-0.4813 6.2673,-0.5414 9.5513,0c2.5939,0.4282 4.7774,2.3604 4.7774,4.926l0,9.0134c0,2.6434 -2.1198,4.8091 -4.7774,4.8091l-8.6621,0.4788c-3.2414,0 -6.589,2.8321 -6.589,5.957l-0.2736,3.777l-3.284,0c-2.7779,0 -4.3951,-2.0029 -5.0745,-4.8056c-0.9166,-3.7651 -0.8776,-6.0088 0,-9.6147c0.7608,-3.1461 3.192,-4.8058 5.7,-4.8058l3.5848,0c0,0 8.9448,-0.035 0,-0.032l0,-4.7771l0,0l0.2699,-0.0001z" fill="url(#lg6)" id="svg_7"/>
<path d="m16.3733,6.7218c0,-1 0.8,-1.8048 1.7906,-1.8048c0.9873,0 1.7907,0.8068 1.7907,1.8048c0,0.9944 -0.8034,1.8012 -1.7907,1.8012c-0.9908,0 -1.7906,-0.8068 -1.7906,-1.8012z" fill="#fff" id="svg_8"/>
<path d="m22.7173,1.9955c-1.4134,0.0342 -2.7704,0.1968 -3.9718,0.4073c-4.0448,0.7078 -4.7355,2.2074 -4.7355,4.9393l-0.2952,4.787l-3.3203,-0.0003c-2.7779,0 -5.1968,1.6406 -5.9576,4.7864c-0.5165,2.1225 -0.7504,3.7842 -0.6621,5.5504c6.2924,-7.1319 13.0442,-7.6531 16.3965,-7.638c6.6376,0.029 9.7637,-1.6029 12.9338,-5.1939l0,-2.2914c0,-2.5655 -2.1926,-4.511 -4.7865,-4.9392c-1.8472,-0.3048 -3.7841,-0.4516 -5.6013,-0.4076z" opacity="0.377" fill="url(#lg5)" id="svg_9"/>
<path d="m18.696,2.6271c3.6201,-1.0404 6.5255,-0.8811 9.551,0c2.5268,0.7361 4.7787,2.24 4.7774,4.8057l0,9.7315c0,1.3662 -1.9746,4.5293 -4.7726,4.5293l-8.8988,0c-2.4983,0 -5.997,2.7217 -5.997,5.981l0,3.7937l-4.21,0c-2.7815,0 -4.0909,-2.0667 -4.7774,-4.8058c-0.9555,-3.8041 -1,-6.6493 0,-9.6148c0.9661,-2.8806 2,-5.1477 4.7774,-5.1477l4.2985,0l10.03,0l0,0.019l-10.03,-0.034l0.019,-4.8733c-0.026,-1.9965 2.4146,-3.5524 5.2323,-4.3845l0.0002,-0.0001z" fill="none" stroke="#274e70" stroke-width="1.63" id="svg_10"/>
<path d="m12.5337,30.6538l0,-2.796c0,-3.7246 3.3953,-7.0287 7.0461,-7.0287l8.6839,0c2.1549,0 4.024,-2.2411 4.0042,-4.3821l-0.0834,-9.013c-0.0097,-1.0445 -0.3722,-1.8235 -1.1203,-2.4951c-0.7479,-0.6716 -1.8726,-1.1831 -3.0552,-1.5276c-2.9166,-0.8494 -5.5762,-1.0023 -9.0639,0c-1.1326,0.3248 -2.6396,0.94 -3.3976,1.5964c-0.7582,0.6564 -1.3076,1.296 -1.3076,2.4263l0,3.6298l10.0519,0l0,1.6804l-15.1743,-0.051c-1.2,0 -1.788,0.4724 -2.3844,1.1634c-0.5964,0.6908 -1.1149,2.0467 -1.5874,3.4559c-0.9456,2.8096 -0.9335,5.449 0,9.1657c0.3252,1.2978 0.7976,2.3461 1.4258,3.0552c0.628,0.7092 1.357,1.1203 2.546,1.1203l3.4162,0l0,0.0001zm-1.6295,-1.6295l-1.7867,0c-0.52,0 -1.2,-0.4194 -1.3239,-0.56c-0.3626,-0.4094 -0.7801,-1.2388 -1.0695,-2.3934c-0.8895,-3.5415 -0.8914,-5.7513 -0.0505,-8.2491c0.4517,-1.3468 0.9205,-2.6141 1.273,-2.9899c0.3184,-0.3393 0.9909,-0.5092 1.1712,-0.5092l16.8038,0.051l0,-4.9394l-10.0519,0l0,-2c0,-0.727 0.9732,-1.1789 1.1407,-1.3239c0.4873,-0.4219 1.3509,-0.8359 2.3424,-1.12c3.2229,-0.9262 5.5,-0.7858 8.1983,0c1.0212,0.2975 1.9061,0.7339 2.3932,1.1712c0.1733,0.1352 0.2646,0.2973 0.4078,0.4582c0.1987,0.237 0.1552,0.55023 0.2011,0.8147l0,9.013c0,1.2357 -1.0565,2.7527 -2.2913,2.7527l-8.6839,0c-4.5897,0 -8.6756,4.0029 -8.6756,8.6581c0,0.3875 0,1.166 0,1.166l0.0018,0z" opacity="0.165" fill="#fff" id="svg_11"/>
<!-- Created with Method Draw - http://github.com/duopixel/Method-Draw/ -->
<defs>
<filter id="svg_23" x="-50%" y="-50%" width="200%" height="200%">
<feGaussianBlur stdDeviation="0"/>
</filter>
</defs>
<g stroke="null" id="svg_34">
<g stroke="null" transform="matrix(0.0014719104090191533,0,0,0.001255531008996896,-0.2527617940085989,-0.15460855846828453) " id="svg_31">
<title stroke="null" transform="translate(-18396.873046875,-11607.55078125) translate(31247.5,0) translate(0,31337.498046875) ">background</title>
<rect stroke="null" x="12849.626953" y="19728.947266" width="582" height="402" id="svg_29" fill="#fff"/>
<g stroke="null" id="svg_28" display="none">
<rect stroke="null" id="svg_32" width="48" height="48" x="12850.626953" y="19729.947266" stroke-width="0" fill="url(#gridpattern)"/>
</g>
</g>
<g stroke="null" transform="matrix(0.12055810649276012,0,0,0.11753820127871953,-3752.8712969371604,-3669.8940508247842) " id="svg_33">
<title stroke="null" transform="translate(-224.6099395751953,-123.99066162109375) translate(31247.5,0) translate(0,31337.498046875) ">Layer 1</title>
<g stroke="null" id="svg_22" opacity="0.32" filter="url(#svg_23)">
<ellipse stroke="#444444" fill="none" stroke-width="11.5" cx="31328.890048" cy="31414.007381" id="svg_27" rx="196.899703" ry="188.999962"/>
<ellipse stroke="#444444" fill="none" stroke-width="11.5" stroke-opacity="null" fill-opacity="null" cx="31328.890048" cy="31414.007388" id="svg_26" rx="51.025838" ry="188.425523"/>
<ellipse stroke="#444444" fill="none" stroke-width="11.5" stroke-opacity="null" fill-opacity="null" cx="31328.890052" cy="31414.007368" id="svg_25" rx="130.866262" ry="187.851057"/>
<ellipse stroke="#444444" fill="none" stroke-width="11.5" stroke-opacity="null" fill-opacity="null" cx="31328.890033" cy="31414.00737" id="svg_24" rx="197.499992" ry="38.48936"/>
</g>
</g>
</g>
</g>
</svg>
\ No newline at end of file
......@@ -26,6 +26,8 @@ web_site_module/officejs_cribjs/**
web_site_module/officejs_drive_app
web_site_module/officejs_drive_app/**
web_site_module/officejs_export
web_site_module/officejs_notebook
web_site_module/officejs_notebook/**
web_site_module/officejs_pdf_viewer
web_site_module/officejs_pdf_viewer/**
web_site_module/officejs_svg_editor
......
......@@ -26,6 +26,8 @@ web_site_module/officejs_cribjs/**
web_site_module/officejs_drive_app
web_site_module/officejs_drive_app/**
web_site_module/officejs_export
web_site_module/officejs_notebook
web_site_module/officejs_notebook/**
web_site_module/officejs_pdf_viewer
web_site_module/officejs_pdf_viewer/**
web_site_module/officejs_svg_editor
......
......@@ -27,6 +27,8 @@ web_site_module/officejs_drive_app/**
web_site_module/officejs_export
web_site_module/officejs_media_player
web_site_module/officejs_media_player/**
web_site_module/officejs_notebook
web_site_module/officejs_notebook/**
web_site_module/officejs_pdf_viewer
web_site_module/officejs_pdf_viewer/**
web_site_module/officejs_svg_editor
......
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