Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
erp5
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
Romain Courteaud
erp5
Commits
0dde05d0
Commit
0dde05d0
authored
Sep 27, 2019
by
Roque
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
erp5_officejs_ooffice: spreadsheet editor uses custom view
parent
b6c05716
Changes
7
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
231 additions
and
6 deletions
+231
-6
bt5/erp5_officejs_ooffice/PathTemplateItem/web_page_module/gadget_ooffice_spreadsheet_appcache.xml
...m/web_page_module/gadget_ooffice_spreadsheet_appcache.xml
+4
-2
bt5/erp5_officejs_ooffice/PathTemplateItem/web_page_module/gadget_ooffice_spreadsheet_router_html.html
...b_page_module/gadget_ooffice_spreadsheet_router_html.html
+2
-2
bt5/erp5_officejs_ooffice/PathTemplateItem/web_page_module/gadget_ooffice_spreadsheet_router_html.xml
...eb_page_module/gadget_ooffice_spreadsheet_router_html.xml
+2
-2
bt5/erp5_officejs_ooffice/SkinTemplateItem/portal_skins/erp5_ooffice_spreadsheet_editor/only_office_document_view.html.html
...ce_spreadsheet_editor/only_office_document_view.html.html
+20
-0
bt5/erp5_officejs_ooffice/SkinTemplateItem/portal_skins/erp5_ooffice_spreadsheet_editor/only_office_document_view.html.xml
...ice_spreadsheet_editor/only_office_document_view.html.xml
+28
-0
bt5/erp5_officejs_ooffice/SkinTemplateItem/portal_skins/erp5_ooffice_spreadsheet_editor/only_office_document_view.js.js
...office_spreadsheet_editor/only_office_document_view.js.js
+147
-0
bt5/erp5_officejs_ooffice/SkinTemplateItem/portal_skins/erp5_ooffice_spreadsheet_editor/only_office_document_view.js.xml
...ffice_spreadsheet_editor/only_office_document_view.js.xml
+28
-0
No files found.
bt5/erp5_officejs_ooffice/PathTemplateItem/web_page_module/gadget_ooffice_spreadsheet_appcache.xml
View file @
0dde05d0
...
...
@@ -1246,6 +1246,8 @@ onlyoffice/fonts/ttf/ktwsh55ufijgk35iptozrmuwqtuy.ttf\n
onlyoffice/fonts/ttf/ktwsh55ufirzeamcpft1h7dwca.ttf\n
onlyoffice/fonts/ttf/p7agk5uum7xi6muwqtuy.ttf\n
\n
only_office_document_view.html\n
only_office_document_view.js\n
\n
#new approach (storage hateoas requests)\n
gadget_erp5_pt_form_view_editable.html\n
...
...
@@ -1450,7 +1452,7 @@ NETWORK:\n
</item>
<item>
<key>
<string>
serial
</string>
</key>
<value>
<string>
978.3269
2.9728.38877
</string>
</value>
<value>
<string>
978.3269
9.16100.53452
</string>
</value>
</item>
<item>
<key>
<string>
state
</string>
</key>
...
...
@@ -1468,7 +1470,7 @@ NETWORK:\n
</tuple>
<state>
<tuple>
<float>
156
8728034.72
</float>
<float>
156
9595016.24
</float>
<string>
UTC
</string>
</tuple>
</state>
...
...
bt5/erp5_officejs_ooffice/PathTemplateItem/web_page_module/gadget_ooffice_spreadsheet_router_html.html
View file @
0dde05d0
...
...
@@ -22,8 +22,8 @@
<script
data-renderjs-configuration=
"app_actions"
type=
"text/x-renderjs-configuration"
>
(
'
Spreadsheet | ooffice_spreadsheet_view
'
,
'
Document Module | ooffice_spreadsheet_view
'
,
'
Document Module | ooffice_upload_document
'
,
'
Spreadsheet | ooffice_download_document
'
)
</script>
<script
data-renderjs-configuration=
"app_allowed_sub_types"
type=
"text/x-renderjs-configuration"
>
(
'
Document Module | Spreadsheet
'
,)
</script>
<script
data-renderjs-configuration=
"app_view_reference"
type=
"text/x-renderjs-configuration"
>
ooffice_spreadsheet_view
</script>
<script
data-renderjs-configuration=
"document_module_dict"
type=
"text/x-renderjs-configuration"
>
{
"
front_page
"
:
1
,
"
editable
"
:
0
,
"
hide_add_button
"
:
0
,
"
jump_button
"
:
0
,
"
fast_input_button
"
:
0
,
"
export_button
"
:
0
,
"
filter_action
"
:
1
,
"
panel_action
"
:
1
,
"
previous_next_button
"
:
0
,
"
history_previous_link
"
:
0
,
"
title
"
:
"
Spreadsheets
"
,
"
hide_listbox_buttons
"
:
1
,
"
blob_type
"
:
""
,
"
blob_create_object_url
"
:
0
,
"
only_office
"
:
1
,
"
file_extension
"
:
"
xlsy
"
}
</script>
<script
data-renderjs-configuration=
"spreadsheet_dict"
type=
"text/x-renderjs-configuration"
>
{
"
front_page
"
:
0
,
"
editable
"
:
1
,
"
hide_add_button
"
:
0
,
"
jump_button
"
:
0
,
"
fast_input_button
"
:
0
,
"
export_button
"
:
0
,
"
filter_action
"
:
0
,
"
panel_action
"
:
1
,
"
previous_next_button
"
:
1
,
"
history_previous_link
"
:
1
,
"
title
"
:
"
Spreadsheet
"
,
"
hide_listbox_buttons
"
:
1
,
"
blob_type
"
:
""
,
"
blob_create_object_url
"
:
0
,
"
only_office
"
:
1
,
"
file_extension
"
:
"
xlsy
"
}
</script>
<script
data-renderjs-configuration=
"document_module_dict"
type=
"text/x-renderjs-configuration"
>
{
"
front_page
"
:
1
,
"
editable
"
:
0
,
"
hide_add_button
"
:
0
,
"
jump_button
"
:
0
,
"
fast_input_button
"
:
0
,
"
export_button
"
:
0
,
"
filter_action
"
:
1
,
"
panel_action
"
:
1
,
"
previous_next_button
"
:
0
,
"
history_previous_link
"
:
0
,
"
title
"
:
"
Spreadsheets
"
,
"
hide_listbox_buttons
"
:
1
,
"
blob_type
"
:
""
,
"
blob_create_object_url
"
:
0
,
"
file_extension
"
:
"
xlsy
"
}
</script>
<script
data-renderjs-configuration=
"spreadsheet_dict"
type=
"text/x-renderjs-configuration"
>
{
"
front_page
"
:
0
,
"
editable
"
:
1
,
"
hide_add_button
"
:
0
,
"
jump_button
"
:
0
,
"
fast_input_button
"
:
0
,
"
export_button
"
:
0
,
"
filter_action
"
:
0
,
"
panel_action
"
:
1
,
"
previous_next_button
"
:
1
,
"
history_previous_link
"
:
1
,
"
title
"
:
"
Spreadsheet
"
,
"
hide_listbox_buttons
"
:
1
,
"
blob_type
"
:
""
,
"
blob_create_object_url
"
:
0
,
"
file_extension
"
:
"
xlsy
"
,
"
custom_view_gadget
"
:
"
only_office_document_view.html
"
}
</script>
<script
data-renderjs-configuration=
"erp5_attachment_synchro"
type=
"text/x-renderjs-configuration"
>
/
{
+
id
}
/Document_downloadForOnlyOfficeApp
</script>
<script
data-renderjs-configuration=
"dropbox_app_key"
type=
"text/x-renderjs-configuration"
>
hxq0vjiu9v0r4mu
</script>
<script
data-renderjs-configuration=
"content_type"
type=
"text/x-renderjs-configuration"
>
application
/
x
-
asc
-
spreadsheet
</script>
...
...
bt5/erp5_officejs_ooffice/PathTemplateItem/web_page_module/gadget_ooffice_spreadsheet_router_html.xml
View file @
0dde05d0
...
...
@@ -241,7 +241,7 @@
</item>
<item>
<key>
<string>
serial
</string>
</key>
<value>
<string>
978.3690
5.14567.21981
</string>
</value>
<value>
<string>
978.3690
6.26142.38092
</string>
</value>
</item>
<item>
<key>
<string>
state
</string>
</key>
...
...
@@ -259,7 +259,7 @@
</tuple>
<state>
<tuple>
<float>
156
8980463.92
</float>
<float>
156
9594974.27
</float>
<string>
UTC
</string>
</tuple>
</state>
...
...
bt5/erp5_officejs_ooffice/SkinTemplateItem/portal_skins/erp5_ooffice_spreadsheet_editor/only_office_document_view.html.html
0 → 100644
View file @
0dde05d0
<!doctype html>
<html>
<head>
<meta
charset=
"utf-8"
>
<meta
name=
"viewport"
content=
"width=device-width, initial-scale=1"
>
<title>
OfficeJS Document View
</title>
<script
src=
"rsvp.js"
></script>
<script
src=
"renderjs.js"
></script>
<script
src=
"only_office_document_view.js"
></script>
</head>
<body>
<form
class=
"save_form ui-body-c"
novalidate
>
</form>
</body>
</html>
\ No newline at end of file
bt5/erp5_officejs_ooffice/SkinTemplateItem/portal_skins/erp5_ooffice_spreadsheet_editor/only_office_document_view.html.xml
0 → 100644
View file @
0dde05d0
<?xml version="1.0"?>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<global
name=
"File"
module=
"OFS.Image"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
__name__
</string>
</key>
<value>
<string>
only_office_document_view.html
</string>
</value>
</item>
<item>
<key>
<string>
content_type
</string>
</key>
<value>
<string>
text/html
</string>
</value>
</item>
<item>
<key>
<string>
precondition
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
title
</string>
</key>
<value>
<string></string>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
bt5/erp5_officejs_ooffice/SkinTemplateItem/portal_skins/erp5_ooffice_spreadsheet_editor/only_office_document_view.js.js
0 → 100644
View file @
0dde05d0
/*global document, window, rJS, RSVP, jIO, Blob */
/*jslint nomen: true, indent: 2, maxerr: 3 */
(
function
(
document
,
window
,
rJS
,
RSVP
,
jIO
,
Blob
)
{
"
use strict
"
;
rJS
(
window
)
/////////////////////////////////////////////////////////////////
// Acquired methods
/////////////////////////////////////////////////////////////////
.
declareAcquiredMethod
(
"
getSetting
"
,
"
getSetting
"
)
.
declareAcquiredMethod
(
"
notifySubmitted
"
,
"
notifySubmitted
"
)
.
declareAcquiredMethod
(
"
notifySubmitting
"
,
"
notifySubmitting
"
)
.
declareAcquiredMethod
(
"
jio_getAttachment
"
,
"
jio_getAttachment
"
)
.
declareAcquiredMethod
(
"
jio_putAttachment
"
,
"
jio_putAttachment
"
)
/////////////////////////////////////////////////////////////////
// declared methods
/////////////////////////////////////////////////////////////////
.
declareMethod
(
'
render
'
,
function
(
options
)
{
var
gadget
=
this
,
state_dict
=
{
doc
:
options
.
doc
,
form_definition
:
options
.
form_definition
,
child_gadget_url
:
options
.
child_gadget_url
,
options
:
options
},
portal_type_dict
=
options
.
form_definition
.
portal_type_dict
,
form_view_div
=
document
.
createElement
(
'
div
'
),
extension
,
blob
;
return
gadget
.
getSetting
(
"
file_extension
"
)
.
push
(
function
(
file_extension
)
{
if
(
file_extension
.
substring
(
file_extension
.
length
-
1
)
==
"
y
"
)
{
file_extension
=
file_extension
.
replace
(
/.$/
,
"
x
"
);
}
extension
=
file_extension
;
gadget
.
element
.
appendChild
(
form_view_div
);
return
gadget
.
declareGadget
(
"
gadget_officejs_form_view.html
"
,
{
element
:
form_view_div
,
scope
:
'
form_view
'
});
})
.
push
(
function
(
form_view_gadget
)
{
if
(
!
state_dict
.
doc
.
filename
)
{
state_dict
.
doc
.
filename
=
"
default.
"
+
extension
;
}
state_dict
.
mime_type
=
portal_type_dict
.
file_extension
;
if
(
options
.
doc
.
action
)
{
return
form_view_gadget
.
changeState
(
state_dict
);
}
state_dict
.
content_editable
=
options
.
doc
.
content_type
===
undefined
||
options
.
doc
.
content_type
.
indexOf
(
"
application/x-asc
"
)
===
0
;
return
new
RSVP
.
Queue
()
.
push
(
function
()
{
if
(
!
state_dict
.
content_editable
)
{
return
gadget
.
jio_getAttachment
(
options
.
jio_key
,
"
data
"
);
}
return
gadget
.
declareGadget
(
"
gadget_ojs_cloudooo.html
"
)
.
push
(
function
(
ojs_cloudooo
)
{
return
ojs_cloudooo
.
getConvertedBlob
({
jio_key
:
options
.
jio_key
,
format
:
state_dict
.
mime_type
,
filename
:
options
.
doc
.
filename
});
});
})
.
push
(
undefined
,
function
(
error
)
{
if
(
error
instanceof
jIO
.
util
.
jIOError
&&
error
.
status_code
===
404
)
{
return
new
Blob
();
}
throw
error
;
})
.
push
(
function
(
blob
)
{
if
(
state_dict
.
content_editable
)
{
return
jIO
.
util
.
readBlobAsDataURL
(
blob
);
}
return
jIO
.
util
.
readBlobAsText
(
blob
);
})
.
push
(
function
(
result
)
{
state_dict
.
data
=
result
.
target
.
result
;
state_dict
.
blob_type
=
portal_type_dict
.
blob_type
;
return
form_view_gadget
.
changeState
(
state_dict
);
});
});
})
.
declareMethod
(
"
triggerSubmit
"
,
function
()
{
var
argument_list
=
arguments
,
gadget
=
this
,
child_gadget
,
view_gadget
,
content_dict
,
data
,
name_list
;
return
gadget
.
notifySubmitting
()
.
push
(
function
(
view_gadget
)
{
return
gadget
.
getDeclaredGadget
(
'
form_view
'
);
})
.
push
(
function
(
result
)
{
view_gadget
=
result
;
return
view_gadget
.
getDeclaredGadget
(
'
erp5_pt_gadget
'
);
})
.
push
(
function
(
result
)
{
child_gadget
=
result
;
if
(
!
child_gadget
.
state
.
editable
)
{
return
child_gadget
.
triggerSubmit
(
argument_list
);
}
return
child_gadget
.
getContent
();
})
.
push
(
function
(
result
)
{
content_dict
=
result
;
if
(
!
content_dict
)
{
return
;
}
data
=
content_dict
.
text_content
;
delete
content_dict
.
text_content
;
name_list
=
view_gadget
.
state
.
doc
.
filename
.
split
(
'
.
'
);
if
(
name_list
.
pop
()
!==
view_gadget
.
state
.
mime_type
)
{
name_list
.
push
(
view_gadget
.
state
.
mime_type
);
content_dict
.
filename
=
name_list
.
join
(
'
.
'
);
}
return
gadget
.
getSetting
(
"
content_type
"
);
})
.
push
(
function
(
content_type
)
{
content_dict
.
content_type
=
content_type
;
return
child_gadget
.
submitContent
(
child_gadget
.
state
.
jio_key
,
undefined
,
content_dict
);
})
.
push
(
function
()
{
return
gadget
.
jio_putAttachment
(
child_gadget
.
state
.
jio_key
,
'
data
'
,
jIO
.
util
.
dataURItoBlob
(
data
))
.
push
(
function
()
{
return
gadget
.
declareGadget
(
"
gadget_ojs_cloudooo.html
"
);
})
.
push
(
function
(
cloudooo
)
{
return
cloudooo
.
putAllCloudoooConvertionOperation
({
format
:
view_gadget
.
state
.
mime_type
,
jio_key
:
child_gadget
.
state
.
jio_key
});
});
},
function
(
error
)
{
console
.
log
(
error
);
return
gadget
.
notifySubmitted
({
message
:
"
Submit failed
"
,
status
:
"
error
"
});
});
});
}(
document
,
window
,
rJS
,
RSVP
,
jIO
,
Blob
));
\ No newline at end of file
bt5/erp5_officejs_ooffice/SkinTemplateItem/portal_skins/erp5_ooffice_spreadsheet_editor/only_office_document_view.js.xml
0 → 100644
View file @
0dde05d0
<?xml version="1.0"?>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<global
name=
"File"
module=
"OFS.Image"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
__name__
</string>
</key>
<value>
<string>
only_office_document_view.js
</string>
</value>
</item>
<item>
<key>
<string>
content_type
</string>
</key>
<value>
<string>
application/javascript
</string>
</value>
</item>
<item>
<key>
<string>
precondition
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
title
</string>
</key>
<value>
<string></string>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
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