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
Titouan Soulard
erp5
Commits
8dcf1a14
Commit
8dcf1a14
authored
Jul 28, 2020
by
Ludovic Kiefer
Committed by
Romain Courteaud
Sep 01, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
erp5_run_my_doc: SlideshowEditor Gadget: remove metadata section, move both inputs to text section
parent
6cc5651e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
37 additions
and
79 deletions
+37
-79
bt5/erp5_run_my_doc/SkinTemplateItem/portal_skins/erp5_run_my_doc/slideeditor.gadget.js.js
...tem/portal_skins/erp5_run_my_doc/slideeditor.gadget.js.js
+37
-79
No files found.
bt5/erp5_run_my_doc/SkinTemplateItem/portal_skins/erp5_run_my_doc/slideeditor.gadget.js.js
View file @
8dcf1a14
...
@@ -7,7 +7,6 @@
...
@@ -7,7 +7,6 @@
DISPLAY_SLIDE
=
'
display_slide
'
,
DISPLAY_SLIDE
=
'
display_slide
'
,
DIALOG_SLIDE
=
'
dialog_slide
'
,
DIALOG_SLIDE
=
'
dialog_slide
'
,
DIALOG_COMMENT
=
'
dialog_comment
'
,
DIALOG_COMMENT
=
'
dialog_comment
'
,
DIALOG_METADATA
=
'
dialog_metadata
'
,
FORMBOX_SCOPE
=
'
formbox
'
,
FORMBOX_SCOPE
=
'
formbox
'
,
TRANSLATABLE_WORD_LIST
=
[
TRANSLATABLE_WORD_LIST
=
[
'
Slides
'
,
'
Slides
'
,
...
@@ -15,7 +14,6 @@
...
@@ -15,7 +14,6 @@
'
New Slide
'
,
'
New Slide
'
,
'
Slide
'
,
'
Slide
'
,
'
Delete
'
,
'
Delete
'
,
'
Metadata
'
,
'
Text
'
,
'
Text
'
,
'
Comments
'
,
'
Comments
'
,
'
Previous
'
,
'
Previous
'
,
...
@@ -159,8 +157,6 @@
...
@@ -159,8 +157,6 @@
if
(
gadget
.
state
.
display_index
!==
null
)
{
if
(
gadget
.
state
.
display_index
!==
null
)
{
element_list
.
push
(
element_list
.
push
(
'
'
+
(
gadget
.
state
.
display_index
+
1
)
'
'
+
(
gadget
.
state
.
display_index
+
1
)
// domsugar('label', {'class': 'page-number',
// text: gadget.state.display_index})
);
);
}
}
return
domsugar
(
'
h1
'
,
element_list
);
return
domsugar
(
'
h1
'
,
element_list
);
...
@@ -175,12 +171,6 @@
...
@@ -175,12 +171,6 @@
'
class
'
:
'
dialog-delete ui-icon-trash-o ui-btn-icon-left
'
,
'
class
'
:
'
dialog-delete ui-icon-trash-o ui-btn-icon-left
'
,
text
:
translation_dict
.
Delete
text
:
translation_dict
.
Delete
}),
}),
domsugar
(
'
button
'
,
{
type
:
'
button
'
,
disabled
:
(
slide_dialog
===
DIALOG_METADATA
),
'
class
'
:
'
dialog-metadata ui-icon-info-circle ui-btn-icon-left
'
,
text
:
translation_dict
.
Metadata
}),
domsugar
(
'
button
'
,
{
domsugar
(
'
button
'
,
{
type
:
'
button
'
,
type
:
'
button
'
,
disabled
:
(
slide_dialog
===
DIALOG_SLIDE
),
disabled
:
(
slide_dialog
===
DIALOG_SLIDE
),
...
@@ -217,8 +207,8 @@
...
@@ -217,8 +207,8 @@
///////////////////////////////////////////////////
///////////////////////////////////////////////////
// Page view handling
// Page view handling
///////////////////////////////////////////////////
///////////////////////////////////////////////////
function
getCKEditorJSON
(
translation_dict
,
key
,
value
)
{
function
getCKEditorJSON
(
translation_dict
,
key
,
value
,
title_html
,
type
)
{
return
{
var
ck_editor_json
=
{
erp5_document
:
{
erp5_document
:
{
"
_embedded
"
:
{
"
_embedded
"
:
{
"
_view
"
:
{
"
_view
"
:
{
...
@@ -251,66 +241,42 @@
...
@@ -251,66 +241,42 @@
]
]
}
}
};
};
}
// Show chapter_title and slide_type inputs only during slide editing
if
(
title_html
!==
null
&&
type
!==
null
)
{
ck_editor_json
.
erp5_document
.
_embedded
.
_view
.
your_chapter_title
=
{
"
title
"
:
translation_dict
[
"
Chapter Title
"
],
"
type
"
:
"
StringField
"
,
"
editable
"
:
1
,
"
required
"
:
1
,
"
key
"
:
"
title_html
"
,
"
value
"
:
title_html
};
function
getMetadataJSON
(
translation_dict
,
title_html
,
type
)
{
ck_editor_json
.
erp5_document
.
_embedded
.
_view
.
your_slide_type
=
{
return
{
"
title
"
:
translation_dict
[
"
Type of Slide
"
],
erp5_document
:
{
"
type
"
:
"
ListField
"
,
"
_embedded
"
:
{
"
editable
"
:
1
,
"
_view
"
:
{
"
key
"
:
"
type
"
,
"
your_chapter_title
"
:
{
items
:
[[
""
,
""
],
"
title
"
:
translation_dict
[
"
Chapter Title
"
],
"
type
"
:
"
StringField
"
,
"
editable
"
:
1
,
"
required
"
:
1
,
"
key
"
:
"
title_html
"
,
"
value
"
:
title_html
},
"
your_slide_type
"
:
{
"
title
"
:
translation_dict
[
"
Type of Slide
"
],
"
type
"
:
"
ListField
"
,
"
editable
"
:
1
,
"
key
"
:
"
type
"
,
items
:
[[
""
,
""
],
[
translation_dict
.
Chapter
,
"
chapter
"
],
[
translation_dict
.
Chapter
,
"
chapter
"
],
[
translation_dict
.
Screenshot
,
"
screenshot
"
],
[
translation_dict
.
Screenshot
,
"
screenshot
"
],
[
translation_dict
.
Illustration
,
"
illustration
"
],
[
translation_dict
.
Illustration
,
"
illustration
"
],
[
translation_dict
.
Code
,
"
code
"
],
[
translation_dict
.
Code
,
"
code
"
],
[
translation_dict
.
Master
,
"
master
"
]
[
translation_dict
.
Master
,
"
master
"
]
],
],
value
:
type
value
:
type
/*
};
},
"your_tested": {
"title": "XXX Does it Contain a Test?",
"type": "CheckBoxField",
"editable": 1,
"key": "field_your_tested",
"default": "eee",
"required": 0,
"hidden": 0
*/
}
}
},
"
_links
"
:
{
"
type
"
:
{
// form_list display portal_type in header
name
:
""
}
}
},
form_definition
:
{
group_list
:
[
[
"
left
"
,
[
[
"
your_chapter_title
"
],
[
"
your_slide_type
"
]
// ["your_tested"]
]]
]
}
};
ck_editor_json
.
form_definition
.
group_list
=
[
[
"
left
"
,
[
[
"
your_chapter_title
"
],
[
"
your_slide_type
"
]
]]
].
concat
(
ck_editor_json
.
form_definition
.
group_list
);
}
return
ck_editor_json
;
}
}
function
renderSlideDialog
(
gadget
,
translation_dict
,
slide_dialog
,
function
renderSlideDialog
(
gadget
,
translation_dict
,
slide_dialog
,
...
@@ -327,17 +293,18 @@
...
@@ -327,17 +293,18 @@
render_dict
=
getCKEditorJSON
(
render_dict
=
getCKEditorJSON
(
translation_dict
,
translation_dict
,
"
slide_html
"
,
"
slide_html
"
,
slide_dict
.
slide_html
slide_dict
.
slide_html
,
slide_dict
.
title_html
,
slide_dict
.
type
);
);
}
else
if
(
slide_dialog
===
DIALOG_COMMENT
)
{
}
else
if
(
slide_dialog
===
DIALOG_COMMENT
)
{
render_dict
=
getCKEditorJSON
(
render_dict
=
getCKEditorJSON
(
translation_dict
,
translation_dict
,
"
comment_html
"
,
"
comment_html
"
,
slide_dict
.
comment_html
slide_dict
.
comment_html
,
null
,
null
);
);
}
else
if
(
slide_dialog
===
DIALOG_METADATA
)
{
render_dict
=
getMetadataJSON
(
translation_dict
,
slide_dict
.
title_html
,
slide_dict
.
type
);
}
else
{
}
else
{
// Ease developper work by raising for not handled cases
// Ease developper work by raising for not handled cases
throw
new
Error
(
'
Unhandled dialog:
'
+
slide_dialog
);
throw
new
Error
(
'
Unhandled dialog:
'
+
slide_dialog
);
...
@@ -578,15 +545,6 @@
...
@@ -578,15 +545,6 @@
});
});
}
}
if
(
evt
.
target
.
className
.
indexOf
(
"
dialog-metadata
"
)
!==
-
1
)
{
return
queue
.
push
(
function
()
{
return
gadget
.
changeState
({
slide_dialog
:
DIALOG_METADATA
});
});
}
if
(
evt
.
target
.
className
.
indexOf
(
"
dialog-comment
"
)
!==
-
1
)
{
if
(
evt
.
target
.
className
.
indexOf
(
"
dialog-comment
"
)
!==
-
1
)
{
return
queue
return
queue
.
push
(
function
()
{
.
push
(
function
()
{
...
...
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