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
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Carlos Ramos Carreño
erp5
Commits
b6c05716
Commit
b6c05716
authored
Sep 27, 2019
by
Roque
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
erp5_officejs_ooffice: presentation editor uses custom view
parent
a4d9fcc3
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
231 additions
and
7 deletions
+231
-7
bt5/erp5_officejs_ooffice/PathTemplateItem/web_page_module/gadget_ooffice_presentation_appcache.xml
.../web_page_module/gadget_ooffice_presentation_appcache.xml
+4
-3
bt5/erp5_officejs_ooffice/PathTemplateItem/web_page_module/gadget_ooffice_presentation_router_html.html
..._page_module/gadget_ooffice_presentation_router_html.html
+2
-2
bt5/erp5_officejs_ooffice/PathTemplateItem/web_page_module/gadget_ooffice_presentation_router_html.xml
...b_page_module/gadget_ooffice_presentation_router_html.xml
+2
-2
bt5/erp5_officejs_ooffice/SkinTemplateItem/portal_skins/erp5_ooffice_presentation_editor/only_office_document_view.html.html
...e_presentation_editor/only_office_document_view.html.html
+20
-0
bt5/erp5_officejs_ooffice/SkinTemplateItem/portal_skins/erp5_ooffice_presentation_editor/only_office_document_view.html.xml
...ce_presentation_editor/only_office_document_view.html.xml
+28
-0
bt5/erp5_officejs_ooffice/SkinTemplateItem/portal_skins/erp5_ooffice_presentation_editor/only_office_document_view.js.js
...ffice_presentation_editor/only_office_document_view.js.js
+147
-0
bt5/erp5_officejs_ooffice/SkinTemplateItem/portal_skins/erp5_ooffice_presentation_editor/only_office_document_view.js.xml
...fice_presentation_editor/only_office_document_view.js.xml
+28
-0
No files found.
bt5/erp5_officejs_ooffice/PathTemplateItem/web_page_module/gadget_ooffice_presentation_appcache.xml
View file @
b6c05716
...
...
@@ -1246,7 +1246,8 @@ onlyoffice/fonts/ttf/ktwsh55ufijgk35iptozrmuwqtuy.ttf\n
onlyoffice/fonts/ttf/ktwsh55ufirzeamcpft1h7dwca.ttf\n
onlyoffice/fonts/ttf/p7agk5uum7xi6muwqtuy.ttf\n
\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
...
...
@@ -1452,7 +1453,7 @@ NETWORK:\n
</item>
<item>
<key>
<string>
serial
</string>
</key>
<value>
<string>
978.3269
7.38251.187
</string>
</value>
<value>
<string>
978.3269
9.8875.41506
</string>
</value>
</item>
<item>
<key>
<string>
state
</string>
</key>
...
...
@@ -1470,7 +1471,7 @@ NETWORK:\n
</tuple>
<state>
<tuple>
<float>
156
8728028.11
</float>
<float>
156
9595030.55
</float>
<string>
UTC
</string>
</tuple>
</state>
...
...
bt5/erp5_officejs_ooffice/PathTemplateItem/web_page_module/gadget_ooffice_presentation_router_html.html
View file @
b6c05716
...
...
@@ -23,8 +23,8 @@
<script
data-renderjs-configuration=
"app_actions"
type=
"text/x-renderjs-configuration"
>
(
'
Presentation | ooffice_presentation_view
'
,
'
Document Module | ooffice_presentation_view
'
,
'
Document Module | ooffice_upload_document
'
,
'
Presentation | ooffice_download_document
'
)
</script>
<script
data-renderjs-configuration=
"app_allowed_sub_types"
type=
"text/x-renderjs-configuration"
>
(
'
Document Module | Presentation
'
,)
</script>
<script
data-renderjs-configuration=
"app_view_reference"
type=
"text/x-renderjs-configuration"
>
ooffice_presentation_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
"
:
"
Presentations
"
,
"
hide_listbox_buttons
"
:
1
,
"
blob_type
"
:
""
,
"
blob_create_object_url
"
:
0
,
"
only_office
"
:
1
,
"
file_extension
"
:
"
ppty
"
}
</script>
<script
data-renderjs-configuration=
"presentation_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
"
:
"
Presentation
"
,
"
hide_listbox_buttons
"
:
1
,
"
blob_type
"
:
""
,
"
blob_create_object_url
"
:
0
,
"
only_office
"
:
1
,
"
file_extension
"
:
"
ppty
"
}
</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
"
:
"
Presentations
"
,
"
hide_listbox_buttons
"
:
1
,
"
blob_type
"
:
""
,
"
blob_create_object_url
"
:
0
,
"
file_extension
"
:
"
ppty
"
}
</script>
<script
data-renderjs-configuration=
"presentation_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
"
:
"
Presentation
"
,
"
hide_listbox_buttons
"
:
1
,
"
blob_type
"
:
""
,
"
blob_create_object_url
"
:
0
,
"
file_extension
"
:
"
ppty
"
,
"
custom_view_gadget
"
:
"
only_office_document_view.html
"
}
</script>
<script
data-renderjs-configuration=
"dropbox_app_key"
type=
"text/x-renderjs-configuration"
>
tgbv6bt1grf7muu
</script>
<script
data-renderjs-configuration=
"content_type"
type=
"text/x-renderjs-configuration"
>
application
/
x
-
asc
-
presentation
</script>
<script
data-renderjs-configuration=
"file_extension"
type=
"text/x-renderjs-configuration"
>
ppty
</script>
...
...
bt5/erp5_officejs_ooffice/PathTemplateItem/web_page_module/gadget_ooffice_presentation_router_html.xml
View file @
b6c05716
...
...
@@ -241,7 +241,7 @@
</item>
<item>
<key>
<string>
serial
</string>
</key>
<value>
<string>
978.
36906.12318.12834
</string>
</value>
<value>
<string>
978.
47147.36512.64972
</string>
</value>
</item>
<item>
<key>
<string>
state
</string>
</key>
...
...
@@ -259,7 +259,7 @@
</tuple>
<state>
<tuple>
<float>
156
8980466.97
</float>
<float>
156
9594956.42
</float>
<string>
UTC
</string>
</tuple>
</state>
...
...
bt5/erp5_officejs_ooffice/SkinTemplateItem/portal_skins/erp5_ooffice_presentation_editor/only_office_document_view.html.html
0 → 100644
View file @
b6c05716
<!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_presentation_editor/only_office_document_view.html.xml
0 → 100644
View file @
b6c05716
<?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_presentation_editor/only_office_document_view.js.js
0 → 100644
View file @
b6c05716
/*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_presentation_editor/only_office_document_view.js.xml
0 → 100644
View file @
b6c05716
<?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