Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
O
officejs_fs2erp5_gadget
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
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Boris Kocherov
officejs_fs2erp5_gadget
Commits
cd69c10b
Commit
cd69c10b
authored
Sep 08, 2017
by
Boris Kocherov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix template_path_list generation; add svg,eot,woff,woff2
parent
dc2f94f6
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
39 additions
and
16 deletions
+39
-16
jio_fs2erp5storage.js
jio_fs2erp5storage.js
+39
-16
No files found.
jio_fs2erp5storage.js
View file @
cd69c10b
...
...
@@ -298,7 +298,7 @@
context
.
path_prefix_file
=
'
/
'
+
context
.
_options
.
name
+
'
/PathTemplateItem/
'
;
context
.
_id_dict
[
context
.
path_prefix_meta
]
=
bt_folder
;
context
.
_
path_templates
=
{};
context
.
_
template_path_list
=
{};
scopes
=
context
.
_options
.
scopes
||
{};
for
(
i
=
0
;
i
<
scopes
.
length
;
i
+=
1
)
{
size
++
;
...
...
@@ -306,13 +306,21 @@
for
(
x
=
0
;
x
<
scope
.
paths
.
length
;
x
+=
1
)
{
path
=
scope
.
paths
[
x
];
context
.
_paths
[
path
]
=
scope
;
// prepare to template_path_list generation
path
=
scope
.
prefix
+
path
;
context
.
_path_templates
[
context
.
_options
.
id_prefix
+
path
.
split
(
"
/
"
).
join
(
"
_
"
).
split
(
"
.
"
).
join
(
"
_
"
)
+
"
*
"
]
=
1
;
if
(
scope
.
delete_path_part
)
{
path
=
path
.
replace
(
scope
.
delete_path_part
,
""
);
}
path
=
path
.
split
(
"
/
"
).
join
(
"
_
"
).
split
(
"
.
"
).
join
(
"
_
"
);
if
(
path
[
path
.
length
-
1
]
===
"
_
"
)
{
path
=
path
+
"
*
"
;
}
context
.
_template_path_list
[
context
.
_options
.
id_prefix
+
path
]
=
1
;
}
}
if
(
size
===
0
)
{
context
.
_
path_templates
[
context
.
_options
.
id_prefix
+
"
*
"
]
=
1
;
context
.
_
template_path_list
[
context
.
_options
.
id_prefix
+
"
*
"
]
=
1
;
}
add_metafile
(
"
title
"
,
context
.
_options
.
name
);
add_metafile
(
"
version
"
,
context
.
_options
.
version
);
...
...
@@ -325,7 +333,7 @@
})
.
push
(
function
(
result
)
{
var
id
,
path
,
last_index
,
filename
,
ext
,
i
,
size
,
xmldoc
,
bt_links
=
{},
path_templates
=
[],
xmldoc
,
bt_links
=
{},
template_path_list
=
[],
generated_appcache
=
[],
document_publication_wfl
;
for
(
id
in
result
)
{
if
(
...
...
@@ -409,26 +417,41 @@
case
"
png
"
:
case
"
gif
"
:
case
"
jpg
"
:
case
"
svg
"
:
path
=
"
image_module
"
;
xmldoc
.
portal_type
=
"
Image
"
;
xmldoc
.
title
=
filename
;
xmldoc
.
filename
=
filename
;
xmldoc
.
content_type
=
"
image/
"
+
ext
;
switch
(
ext
)
{
case
"
svg
"
:
xmldoc
.
content_type
=
"
image/svg+xml
"
;
break
;
default
:
xmldoc
.
content_type
=
"
image/
"
+
ext
;
}
document_publication_wfl
.
action
=
"
publish
"
;
document_publication_wfl
.
validation_state
=
"
published
"
;
break
;
case
"
json
"
:
xmldoc
.
portal_type
=
"
File
"
;
xmldoc
.
content_type
=
"
application/json
"
;
break
;
case
"
eot
"
:
xmldoc
.
content_type
=
"
application/vnd.ms-fontobject
"
;
break
;
case
"
ttf
"
:
xmldoc
.
portal_type
=
"
File
"
;
xmldoc
.
content_type
=
"
font/truetype
"
;
break
;
case
"
woff
"
:
xmldoc
.
content_type
=
"
application/x-font-woff
"
;
break
;
case
"
woff2
"
:
xmldoc
.
content_type
=
"
font/woff2
"
;
break
;
default
:
continue
;
}
if
(
xmldoc
.
portal_type
===
"
File
"
)
{
if
(
!
xmldoc
.
portal_type
)
{
xmldoc
.
portal_type
=
"
File
"
;
path
=
"
document_module
"
;
xmldoc
.
title
=
filename
;
document_publication_wfl
.
action
=
"
publish
"
;
...
...
@@ -436,9 +459,9 @@
}
if
(
!
bt_links
.
hasOwnProperty
(
path
))
{
bt_links
[
path
]
=
1
;
for
(
i
in
context
.
_
path_templates
)
{
if
(
context
.
_
path_templates
.
hasOwnProperty
(
i
))
{
path_templates
.
push
(
path
+
'
/
'
+
i
);
for
(
i
in
context
.
_
template_path_list
)
{
if
(
context
.
_
template_path_list
.
hasOwnProperty
(
i
))
{
template_path_list
.
push
(
path
+
'
/
'
+
i
);
}
}
}
...
...
@@ -453,11 +476,11 @@
context
.
_id_dict
[
path
][
xmldoc
.
id
+
'
.xml
'
]
=
xmldoc
;
}
}
path_templates
=
string2blob
(
path_templates
.
join
(
"
\n
"
));
bt_folder
.
template_path_list
=
path_templates
;
bt_folder
.
template_keep_workflow_path_list
=
path_templates
;
template_path_list
=
string2blob
(
template_path_list
.
join
(
"
\n
"
));
bt_folder
.
template_path_list
=
template_path_list
;
bt_folder
.
template_keep_workflow_path_list
=
template_path_list
;
bt_folder
.
template_keep_last_workflow_history_only_path_list
=
path_templates
;
template_path_list
;
// generate appcache as list of all packaged files
xmldoc
=
{
...
...
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