Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
erp5
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Merge Requests
133
Merge Requests
133
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Jobs
Commits
Open sidebar
nexedi
erp5
Commits
c5d06b50
Commit
c5d06b50
authored
Apr 11, 2018
by
Vincent Bechu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[erp5_officejs] Add conversion feature in officejs layout
parent
a2568823
Changes
25
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
25 changed files
with
3496 additions
and
102 deletions
+3496
-102
gadget_officejs_erp5_page_document_list_html.xml
...e_module/gadget_officejs_erp5_page_document_list_html.xml
+4
-6
gadget_officejs_erp5_page_document_list_js.js
...page_module/gadget_officejs_erp5_page_document_list_js.js
+9
-3
gadget_officejs_erp5_page_document_list_js.xml
...age_module/gadget_officejs_erp5_page_document_list_js.xml
+11
-12
gadget_officejs_erp5_page_ojs_add_document_html.xml
...odule/gadget_officejs_erp5_page_ojs_add_document_html.xml
+4
-6
gadget_officejs_erp5_page_ojs_add_document_js.xml
..._module/gadget_officejs_erp5_page_ojs_add_document_js.xml
+4
-6
gadget_officejs_page_sync_html.html
...eItem/web_page_module/gadget_officejs_page_sync_html.html
+12
-16
gadget_officejs_page_sync_html.xml
...teItem/web_page_module/gadget_officejs_page_sync_html.xml
+9
-3
gadget_officejs_page_sync_js.js
...plateItem/web_page_module/gadget_officejs_page_sync_js.js
+35
-47
gadget_officejs_page_sync_js.xml
...lateItem/web_page_module/gadget_officejs_page_sync_js.xml
+9
-3
ojs_gadget_cloudooo_html.html
...emplateItem/web_page_module/ojs_gadget_cloudooo_html.html
+19
-0
ojs_gadget_cloudooo_html.xml
...TemplateItem/web_page_module/ojs_gadget_cloudooo_html.xml
+363
-0
ojs_gadget_cloudooo_js.js
...athTemplateItem/web_page_module/ojs_gadget_cloudooo_js.js
+88
-0
ojs_gadget_cloudooo_js.xml
...thTemplateItem/web_page_module/ojs_gadget_cloudooo_js.xml
+359
-0
ojs_gadget_erp5_page_ojs_download_convert_html.html
...odule/ojs_gadget_erp5_page_ojs_download_convert_html.html
+29
-0
ojs_gadget_erp5_page_ojs_download_convert_html.xml
...module/ojs_gadget_erp5_page_ojs_download_convert_html.xml
+334
-0
ojs_gadget_erp5_page_ojs_download_convert_js.js
...ge_module/ojs_gadget_erp5_page_ojs_download_convert_js.js
+178
-0
ojs_gadget_erp5_page_ojs_download_convert_js.xml
...e_module/ojs_gadget_erp5_page_ojs_download_convert_js.xml
+332
-0
ojs_gadget_erp5_page_ojs_upload_convert_html.html
..._module/ojs_gadget_erp5_page_ojs_upload_convert_html.html
+27
-0
ojs_gadget_erp5_page_ojs_upload_convert_html.xml
...e_module/ojs_gadget_erp5_page_ojs_upload_convert_html.xml
+332
-0
ojs_gadget_erp5_page_ojs_upload_convert_js.js
...page_module/ojs_gadget_erp5_page_ojs_upload_convert_js.js
+177
-0
ojs_gadget_erp5_page_ojs_upload_convert_js.xml
...age_module/ojs_gadget_erp5_page_ojs_upload_convert_js.xml
+334
-0
ojs_gadget_ojs_cloudooo_html.html
...ateItem/web_page_module/ojs_gadget_ojs_cloudooo_html.html
+18
-0
ojs_gadget_ojs_cloudooo_html.xml
...lateItem/web_page_module/ojs_gadget_ojs_cloudooo_html.xml
+363
-0
ojs_gadget_ojs_cloudooo_js.js
...emplateItem/web_page_module/ojs_gadget_ojs_cloudooo_js.js
+87
-0
ojs_gadget_ojs_cloudooo_js.xml
...mplateItem/web_page_module/ojs_gadget_ojs_cloudooo_js.xml
+359
-0
No files found.
bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_erp5_page_document_list_html.xml
View file @
c5d06b50
...
...
@@ -63,9 +63,7 @@
<item>
<key>
<string>
categories
</string>
</key>
<value>
<tuple>
<string>
contributor/person_module/1
</string>
</tuple>
<tuple/>
</value>
</item>
<item>
...
...
@@ -260,7 +258,7 @@
</item>
<item>
<key>
<string>
actor
</string>
</key>
<value>
<string>
zope
</string>
</value>
<value>
<string>
P0
</string>
</value>
</item>
<item>
<key>
<string>
comment
</string>
</key>
...
...
@@ -274,7 +272,7 @@
</item>
<item>
<key>
<string>
serial
</string>
</key>
<value>
<string>
96
1.341.55275.50397
</string>
</value>
<value>
<string>
96
9.7413.51643.45056
</string>
</value>
</item>
<item>
<key>
<string>
state
</string>
</key>
...
...
@@ -292,7 +290,7 @@
</tuple>
<state>
<tuple>
<float>
15
01149490.23
</float>
<float>
15
33639716.54
</float>
<string>
UTC
</string>
</tuple>
</state>
...
...
bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_erp5_page_document_list_js.js
View file @
c5d06b50
...
...
@@ -124,15 +124,21 @@
.
push
(
function
()
{
return
RSVP
.
all
([
gadget
.
getUrlFor
({
command
:
"change"
,
options
:
{
"page"
:
"ojs_add_document"
}}),
gadget
.
getSetting
(
'document_title_plural'
)
gadget
.
getSetting
(
'document_title_plural'
),
gadget
.
getUrlFor
({
command
:
"change"
,
options
:
{
"page"
:
"ojs_upload_convert"
}}),
gadget
.
getSetting
(
'conversion_dict'
,
false
)
]);
})
.
push
(
function
(
result
)
{
return
gadget
.
updateHeader
(
{
var
header
=
{
page_title
:
result
[
1
],
filter_action
:
true
,
add_url
:
result
[
0
]
});
};
if
(
result
[
3
])
{
header
.
upload_url
=
result
[
2
];
}
return
gadget
.
updateHeader
(
header
);
});
});
}(
window
,
rJS
,
RSVP
));
\ No newline at end of file
bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_erp5_page_document_list_js.xml
View file @
c5d06b50
...
...
@@ -16,7 +16,6 @@
<string>
Associate
</string>
<string>
Auditor
</string>
<string>
Manager
</string>
<string>
Owner
</string>
</tuple>
</value>
</item>
...
...
@@ -24,6 +23,7 @@
<key>
<string>
_Add_portal_content_Permission
</string>
</key>
<value>
<tuple>
<string>
Assignee
</string>
<string>
Assignor
</string>
<string>
Manager
</string>
</tuple>
...
...
@@ -42,6 +42,8 @@
<key>
<string>
_Modify_portal_content_Permission
</string>
</key>
<value>
<tuple>
<string>
Assignee
</string>
<string>
Assignor
</string>
<string>
Manager
</string>
</tuple>
</value>
...
...
@@ -56,16 +58,13 @@
<string>
Associate
</string>
<string>
Auditor
</string>
<string>
Manager
</string>
<string>
Owner
</string>
</tuple>
</value>
</item>
<item>
<key>
<string>
categories
</string>
</key>
<value>
<tuple>
<string>
contributor/person_module/1
</string>
</tuple>
<tuple/>
</value>
</item>
<item>
...
...
@@ -199,11 +198,11 @@
<dictionary>
<item>
<key>
<string>
action
</string>
</key>
<value>
<string>
publish
</string>
</value>
<value>
<string>
publish
_alive
</string>
</value>
</item>
<item>
<key>
<string>
actor
</string>
</key>
<value>
<string>
zope
</string>
</value>
<value>
<string>
P1
</string>
</value>
</item>
<item>
<key>
<string>
comment
</string>
</key>
...
...
@@ -225,7 +224,7 @@
</tuple>
<state>
<tuple>
<float>
1
495446491.04
</float>
<float>
1
528899467.3
</float>
<string>
UTC
</string>
</tuple>
</state>
...
...
@@ -234,7 +233,7 @@
</item>
<item>
<key>
<string>
validation_state
</string>
</key>
<value>
<string>
published
</string>
</value>
<value>
<string>
published
_alive
</string>
</value>
</item>
</dictionary>
</list>
...
...
@@ -256,7 +255,7 @@
</item>
<item>
<key>
<string>
actor
</string>
</key>
<value>
<string>
vincent
</string>
</value>
<value>
<string>
P0
</string>
</value>
</item>
<item>
<key>
<string>
comment
</string>
</key>
...
...
@@ -270,7 +269,7 @@
</item>
<item>
<key>
<string>
serial
</string>
</key>
<value>
<string>
96
6.41210.1237.18158
</string>
</value>
<value>
<string>
96
9.27633.19787.19507
</string>
</value>
</item>
<item>
<key>
<string>
state
</string>
</key>
...
...
@@ -288,7 +287,7 @@
</tuple>
<state>
<tuple>
<float>
15
23022228.16
</float>
<float>
15
33639709.89
</float>
<string>
UTC
</string>
</tuple>
</state>
...
...
bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_erp5_page_ojs_add_document_html.xml
View file @
c5d06b50
...
...
@@ -63,9 +63,7 @@
<item>
<key>
<string>
categories
</string>
</key>
<value>
<tuple>
<string>
contributor/person_module/1
</string>
</tuple>
<tuple/>
</value>
</item>
<item>
...
...
@@ -260,7 +258,7 @@
</item>
<item>
<key>
<string>
actor
</string>
</key>
<value>
<string>
vincent
</string>
</value>
<value>
<string>
P0
</string>
</value>
</item>
<item>
<key>
<string>
comment
</string>
</key>
...
...
@@ -274,7 +272,7 @@
</item>
<item>
<key>
<string>
serial
</string>
</key>
<value>
<string>
96
3.7730.44194.269
6
</string>
</value>
<value>
<string>
96
9.7413.51643.4505
6
</string>
</value>
</item>
<item>
<key>
<string>
state
</string>
</key>
...
...
@@ -292,7 +290,7 @@
</tuple>
<state>
<tuple>
<float>
15
09969877.35
</float>
<float>
15
33639737.77
</float>
<string>
UTC
</string>
</tuple>
</state>
...
...
bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_erp5_page_ojs_add_document_js.xml
View file @
c5d06b50
...
...
@@ -63,9 +63,7 @@
<item>
<key>
<string>
categories
</string>
</key>
<value>
<tuple>
<string>
contributor/person_module/1
</string>
</tuple>
<tuple/>
</value>
</item>
<item>
...
...
@@ -256,7 +254,7 @@
</item>
<item>
<key>
<string>
actor
</string>
</key>
<value>
<string>
zope
</string>
</value>
<value>
<string>
P0
</string>
</value>
</item>
<item>
<key>
<string>
comment
</string>
</key>
...
...
@@ -270,7 +268,7 @@
</item>
<item>
<key>
<string>
serial
</string>
</key>
<value>
<string>
96
6.50085.12569.53742
</string>
</value>
<value>
<string>
96
9.27633.19787.19507
</string>
</value>
</item>
<item>
<key>
<string>
state
</string>
</key>
...
...
@@ -288,7 +286,7 @@
</tuple>
<state>
<tuple>
<float>
15
23363107.8
9
</float>
<float>
15
33639731.0
9
</float>
<string>
UTC
</string>
</tuple>
</state>
...
...
bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_page_sync_html.html
View file @
c5d06b50
...
...
@@ -8,27 +8,23 @@
<script
src=
"rsvp.js"
></script>
<script
src=
"renderjs.js"
></script>
<script
src=
"handlebars.js"
></script>
<script
src=
"gadget_global.js"
></script>
<script
id=
"page-template"
type=
"text/x-handlebars-template"
>
<
center
class
=
"ui-content ui-body-c"
>
<
section
class
=
"ui-content-header-plain"
>
<
h3
class
=
"ui-content-title ui-body-c"
>
<
span
class
=
"ui-icon ui-icon-custom ui-icon-refresh"
>&
nbsp
;
<
/span
>
Synchronize
your
data
<
/h3
>
<
/section
>
<
section
class
=
"ui-body-c ui-content-section"
>
<
div
class
=
"ui-icon-spinner ui-btn-icon-notext first-loader"
><
/div
>
<
/section
>
<
/center
>
</script>
<script
src=
"gadget_erp5_page_ojs_sync.js"
></script>
</head>
<body>
<center
class=
"ui-content ui-body-c"
>
<section
class=
"ui-content-header-plain"
>
<h3
class=
"ui-content-title ui-body-c"
>
<span
class=
"ui-icon ui-icon-custom ui-icon-refresh"
>
</span>
Synchronize your data
</h3>
</section>
<section
class=
"ui-body-c ui-content-section"
>
<div
class=
"ui-icon-spinner ui-btn-icon-notext first-loader"
></div>
</section>
</center>
<div
class=
"cloudooo"
></div>
</body>
</html>
\ No newline at end of file
bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_page_sync_html.xml
View file @
c5d06b50
...
...
@@ -63,6 +63,12 @@
</tuple>
</value>
</item>
<item>
<key>
<string>
categories
</string>
</key>
<value>
<tuple/>
</value>
</item>
<item>
<key>
<string>
content_md5
</string>
</key>
<value>
...
...
@@ -228,7 +234,7 @@
</item>
<item>
<key>
<string>
actor
</string>
</key>
<value>
<string>
zope
</string>
</value>
<value>
<string>
P0
</string>
</value>
</item>
<item>
<key>
<string>
comment
</string>
</key>
...
...
@@ -242,7 +248,7 @@
</item>
<item>
<key>
<string>
serial
</string>
</key>
<value>
<string>
96
0.57151.51816.16622
</string>
</value>
<value>
<string>
96
9.27633.19787.19507
</string>
</value>
</item>
<item>
<key>
<string>
state
</string>
</key>
...
...
@@ -260,7 +266,7 @@
</tuple>
<state>
<tuple>
<float>
15
01081969.62
</float>
<float>
15
33639762.74
</float>
<string>
UTC
</string>
</tuple>
</state>
...
...
bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_page_sync_js.js
View file @
c5d06b50
/*globals window, RSVP, rJS
, promiseEventListener, Handlebars
*/
/*globals window, RSVP, rJS*/
/*jslint indent: 2, maxlen: 80, nomen: true*/
(
function
(
window
,
RSVP
,
rJS
,
promiseEventListener
,
Handlebars
)
{
(
function
(
window
,
RSVP
,
rJS
)
{
"use strict"
;
var
gadget_klass
=
rJS
(
window
),
templater
=
gadget_klass
.
__template_element
,
template
=
Handlebars
.
compile
(
templater
.
getElementById
(
"page-template"
).
innerHTML
);
var
gadget_klass
=
rJS
(
window
);
function
repair_and_redirect
(
gadget
)
{
return
new
RSVP
.
Queue
()
.
push
(
function
()
{
return
gadget
.
getSetting
(
'sync_reload'
,
false
);
})
.
push
(
function
(
sync_reload
)
{
.
push
(
function
(
sync_reload
)
{
if
(
sync_reload
)
{
return
gadget
.
setSetting
(
'sync_reload'
,
false
)
.
push
(
function
()
{
...
...
@@ -22,12 +17,17 @@
});
}
return
gadget
.
repair
()
.
push
(
function
(
result
)
{
if
(
result
!==
undefined
&&
result
.
hasOwnProperty
(
'redirect'
))
{
return
gadget
.
redirect
({
command
:
"display"
,
options
:
result
.
redirect
});
.
push
(
function
()
{
if
(
gadget
.
state
.
cloudooo
)
{
return
gadget
.
getDeclaredGadget
(
'cloudooo'
)
.
push
(
function
(
cloudooo
)
{
return
cloudooo
.
repair
();
});
}
})
.
push
(
function
()
{
if
(
gadget
.
state
.
redirect
)
{
return
gadget
.
redirect
(
window
.
JSON
.
parse
(
gadget
.
state
.
redirect
));
}
return
gadget
.
redirect
({
command
:
"display"
});
});
...
...
@@ -35,32 +35,32 @@
}
gadget_klass
.
ready
(
function
(
g
)
{
g
.
props
=
{};
g
.
props
.
auto_repair
=
false
;
return
g
.
getElement
()
.
push
(
function
(
element
)
{
g
.
props
.
element
=
element
;
});
})
.
declareAcquiredMethod
(
"updateHeader"
,
"updateHeader"
)
.
declareAcquiredMethod
(
"translateHtml"
,
"translateHtml"
)
.
declareMethod
(
"render"
,
function
()
{
.
declareMethod
(
"render"
,
function
(
options
)
{
var
gadget
=
this
;
return
gadget
.
getSetting
(
'conversion_dict'
,
false
)
.
push
(
function
(
result
)
{
return
gadget
.
changeState
({
auto_repair
:
options
.
auto_repair
,
redirect
:
options
.
redirect
,
cloudooo
:
result
&&
true
});
});
})
.
onStateChange
(
function
(
modification_dict
)
{
var
gadget
=
this
;
if
(
arguments
[
0
].
auto_repair
===
"true"
)
{
gadget
.
props
.
auto_repair
=
true
;
}
return
gadget
.
updateHeader
({
title
:
"Synchronize"
})
.
push
(
function
()
{
return
gadget
.
translateHtml
(
template
());
})
.
push
(
function
(
html
)
{
gadget
.
props
.
element
.
innerHTML
=
html
;
if
(
modification_dict
.
cloudooo
)
{
return
gadget
.
declareGadget
(
'gadget_cloudooo.html'
,
{
element
:
gadget
.
element
.
querySelector
(
'.cloudooo'
),
scope
:
"cloudooo"
});
}
});
})
...
...
@@ -73,21 +73,9 @@
.
declareService
(
function
()
{
var
gadget
=
this
;
if
(
gadget
.
props
.
auto_repair
===
true
)
{
if
(
gadget
.
state
.
auto_repair
)
{
return
repair_and_redirect
(
gadget
);
}
return
new
RSVP
.
Queue
()
.
push
(
function
()
{
return
promiseEventListener
(
gadget
.
props
.
element
.
querySelector
(
'form.synchro-form'
),
'submit'
,
false
);
})
.
push
(
function
()
{
return
repair_and_redirect
(
gadget
);
});
});
}(
window
,
RSVP
,
rJS
,
promiseEventListener
,
Handlebars
));
\ No newline at end of file
}(
window
,
RSVP
,
rJS
));
\ No newline at end of file
bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_page_sync_js.xml
View file @
c5d06b50
...
...
@@ -63,6 +63,12 @@
</tuple>
</value>
</item>
<item>
<key>
<string>
categories
</string>
</key>
<value>
<tuple/>
</value>
</item>
<item>
<key>
<string>
content_md5
</string>
</key>
<value>
...
...
@@ -224,7 +230,7 @@
</item>
<item>
<key>
<string>
actor
</string>
</key>
<value>
<string>
zope
</string>
</value>
<value>
<string>
P0
</string>
</value>
</item>
<item>
<key>
<string>
comment
</string>
</key>
...
...
@@ -238,7 +244,7 @@
</item>
<item>
<key>
<string>
serial
</string>
</key>
<value>
<string>
96
0.3847.13096.46165
</string>
</value>
<value>
<string>
96
9.27633.19787.19507
</string>
</value>
</item>
<item>
<key>
<string>
state
</string>
</key>
...
...
@@ -256,7 +262,7 @@
</tuple>
<state>
<tuple>
<float>
15
00474952.22
</float>
<float>
15
33639756.16
</float>
<string>
UTC
</string>
</tuple>
</state>
...
...
bt5/erp5_officejs/PathTemplateItem/web_page_module/ojs_gadget_cloudooo_html.html
0 → 100644
View file @
c5d06b50
<!doctype html>
<html>
<head>
<meta
charset=
"utf-8"
>
<meta
name=
"viewport"
content=
"width=device-width, initial-scale=1"
>
<title>
OfficeJS Text Editor List
</title>
<script
src=
"rsvp.js"
></script>
<script
src=
"renderjs.js"
></script>
<script
src=
"gadget_cloudooo.js"
></script>
</head>
<body>
<div
data-gadget-scope=
"jio"
data-gadget-url=
"gadget_jio.html"
></div>
</body>
</html>
bt5/erp5_officejs/PathTemplateItem/web_page_module/ojs_gadget_cloudooo_html.xml
0 → 100644
View file @
c5d06b50
This diff is collapsed.
Click to expand it.
bt5/erp5_officejs/PathTemplateItem/web_page_module/ojs_gadget_cloudooo_js.js
0 → 100644
View file @
c5d06b50
/*global window, rJS, jIO, RSVP */
/*jslint nomen: true, indent: 2, maxerr: 3 */
(
function
(
window
,
rJS
,
jIO
,
RSVP
)
{
"use strict"
;
rJS
(
window
)
.
ready
(
function
(
g
)
{
g
.
getDeclaredGadget
(
"jio"
)
.
push
(
function
(
jio_gadget
)
{
return
jio_gadget
.
createJio
({
type
:
"cloudooo"
,
url
:
"https://cloudooo.erp5.net/"
,
sub_storage
:
{
type
:
"memory"
}
});
});
})
/////////////////////////////////////////////////////////////////
// Acquired methods
/////////////////////////////////////////////////////////////////
.
declareAcquiredMethod
(
"jio_getAttachment"
,
"jio_getAttachment"
)
.
declareAcquiredMethod
(
"jio_putAttachment"
,
"jio_putAttachment"
)
.
declareAcquiredMethod
(
"jio_allDocs"
,
"jio_allDocs"
)
.
declareAcquiredMethod
(
"jio_put"
,
"jio_put"
)
.
declareAcquiredMethod
(
"jio_get"
,
"jio_get"
)
/////////////////////////////////////////////////////////////////
// declared methods
/////////////////////////////////////////////////////////////////
.
declareMethod
(
"convertFromOperation"
,
function
(
id
)
{
var
gadget
=
this
;
return
gadget
.
jio_get
(
id
)
.
push
(
function
(
doc
)
{
return
gadget
.
convert
(
doc
.
id
,
doc
.
name
,
doc
.
from
,
doc
.
to
)
.
push
(
function
()
{
doc
.
status
=
"converted"
;
return
gadget
.
jio_put
(
id
,
doc
);
},
function
(
error
)
{
if
(
error
instanceof
jIO
.
util
.
jIOError
)
{
doc
.
status
=
"error"
;
doc
.
error
=
jIO
.
util
.
stringify
(
error
);
return
gadget
.
jio_put
(
id
,
doc
);
}
throw
error
;
});
});
})
.
declareMethod
(
"convert"
,
function
(
id
,
name
,
from
,
to
)
{
var
gadget
=
this
,
jio_gadget
;
return
gadget
.
getDeclaredGadget
(
"jio"
)
.
push
(
function
(
sub_gadget
)
{
jio_gadget
=
sub_gadget
;
return
RSVP
.
all
([
gadget
.
jio_getAttachment
(
id
,
name
),
jio_gadget
.
put
(
id
,
{
from
:
from
,
to
:
to
})
]);
})
.
push
(
function
(
result
)
{
return
jio_gadget
.
putAttachment
(
id
,
name
,
result
[
0
]);
})
.
push
(
function
()
{
return
jio_gadget
.
getAttachment
(
id
,
name
);
})
.
push
(
function
(
converted_blob
)
{
return
gadget
.
jio_putAttachment
(
id
,
to
,
converted_blob
);
});
})
.
declareMethod
(
'repair'
,
function
()
{
var
gadget
=
this
;
function
convertAndPush
(
rows
,
i
)
{
if
(
i
===
-
1
)
{
return
new
RSVP
.
Queue
();
}
return
convertAndPush
(
rows
,
i
-
1
)
.
push
(
function
()
{
return
gadget
.
convertFromOperation
(
rows
[
i
].
id
);
});
}
return
gadget
.
jio_allDocs
({
'query'
:
'status: "convert"'
})
.
push
(
function
(
result
)
{
var
i
=
result
.
data
.
total_rows
-
1
;
return
convertAndPush
(
result
.
data
.
rows
,
i
);
});
});
}(
window
,
rJS
,
jIO
,
RSVP
));
\ No newline at end of file
bt5/erp5_officejs/PathTemplateItem/web_page_module/ojs_gadget_cloudooo_js.xml
0 → 100644
View file @
c5d06b50
This diff is collapsed.
Click to expand it.
bt5/erp5_officejs/PathTemplateItem/web_page_module/ojs_gadget_erp5_page_ojs_download_convert_html.html
0 → 100644
View file @
c5d06b50
<!doctype html>
<html>
<head>
<meta
charset=
"utf-8"
>
<meta
name=
"viewport"
content=
"width=device-width, initial-scale=1"
>
<title>
Gadget OnlyOffice Upload
</title>
<script
src=
"rsvp.js"
></script>
<script
src=
"renderjs.js"
></script>
<script
src=
"gadget_erp5_page_ojs_download_convert.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_pt_form_dialog.html"
data-gadget-scope=
"form_view"
data-gadget-sandbox=
"public"
>
</div>
</form>
<div
data-gadget-url=
"gadget_ojs_cloudooo.html"
data-gadget-scope=
"ojs_cloudooo"
data-gadget-sandbox=
"public"
>
</div>
</body>
</html>
\ No newline at end of file
bt5/erp5_officejs/PathTemplateItem/web_page_module/ojs_gadget_erp5_page_ojs_download_convert_html.xml
0 → 100644
View file @
c5d06b50
This diff is collapsed.
Click to expand it.
bt5/erp5_officejs/PathTemplateItem/web_page_module/ojs_gadget_erp5_page_ojs_download_convert_js.js
0 → 100644
View file @
c5d06b50
/*global window, rJS, RSVP, jIO */
/*jslint nomen: true, indent: 2, maxerr: 3 */
(
function
(
window
,
rJS
,
RSVP
,
jIO
)
{
"use strict"
;
var
ATT_NAME
=
"data"
;
function
downloadFromBlob
(
gadget
,
blob
,
format
)
{
var
element
=
gadget
.
element
,
a
=
window
.
document
.
createElement
(
"a"
),
url
=
window
.
URL
.
createObjectURL
(
blob
),
name_list
=
gadget
.
state
.
doc
.
filename
.
split
(
'.'
);
name_list
[
name_list
.
length
-
1
]
=
format
;
element
.
appendChild
(
a
);
a
.
style
=
"display: none"
;
a
.
href
=
url
;
a
.
download
=
name_list
.
join
(
'.'
);
a
.
click
();
element
.
removeChild
(
a
);
window
.
URL
.
revokeObjectURL
(
url
);
}
rJS
(
window
)
/////////////////////////////////////////////////////////////////
// Acquired methods
/////////////////////////////////////////////////////////////////
.
declareAcquiredMethod
(
"getUrlFor"
,
"getUrlFor"
)
.
declareAcquiredMethod
(
"redirect"
,
"redirect"
)
.
declareAcquiredMethod
(
"updateHeader"
,
"updateHeader"
)
.
declareAcquiredMethod
(
"getSetting"
,
"getSetting"
)
.
declareAcquiredMethod
(
"jio_get"
,
"jio_get"
)
.
declareAcquiredMethod
(
"jio_getAttachment"
,
"jio_getAttachment"
)
.
declareAcquiredMethod
(
"notifySubmitting"
,
"notifySubmitting"
)
.
declareAcquiredMethod
(
"notifySubmitted"
,
"notifySubmitted"
)
/////////////////////////////////////////////////////////////////
// declared methods
/////////////////////////////////////////////////////////////////
.
allowPublicAcquisition
(
'submitContent'
,
function
()
{
var
gadget
=
this
,
format
;
return
gadget
.
notifySubmitting
()
.
push
(
function
()
{
return
gadget
.
getDeclaredGadget
(
'form_view'
);
})
.
push
(
function
(
form_gadget
)
{
return
form_gadget
.
getContent
();
})
.
push
(
function
(
result
)
{
format
=
result
.
format
;
if
(
format
===
gadget
.
state
.
format
)
{