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
1
Issues
1
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
Roque
erp5
Commits
438ff676
Commit
438ff676
authored
Apr 22, 2019
by
Roque
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
erp5_post: gadget for new post action
parent
1cb14e11
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
179 additions
and
2 deletions
+179
-2
bt5/erp5_post/SkinTemplateItem/portal_skins/erp5_post/PostModule_newHTMLPost/gadget_field_action_js_script.xml
.../PostModule_newHTMLPost/gadget_field_action_js_script.xml
+2
-2
bt5/erp5_post/SkinTemplateItem/portal_skins/erp5_post/gadget_field_new_action_js_script.html.html
...ins/erp5_post/gadget_field_new_action_js_script.html.html
+19
-0
bt5/erp5_post/SkinTemplateItem/portal_skins/erp5_post/gadget_field_new_action_js_script.html.xml
...kins/erp5_post/gadget_field_new_action_js_script.html.xml
+28
-0
bt5/erp5_post/SkinTemplateItem/portal_skins/erp5_post/gadget_field_new_action_js_script.js.js
...l_skins/erp5_post/gadget_field_new_action_js_script.js.js
+102
-0
bt5/erp5_post/SkinTemplateItem/portal_skins/erp5_post/gadget_field_new_action_js_script.js.xml
..._skins/erp5_post/gadget_field_new_action_js_script.js.xml
+28
-0
No files found.
bt5/erp5_post/SkinTemplateItem/portal_skins/erp5_post/PostModule_newHTMLPost/gadget_field_action_js_script.xml
View file @
438ff676
...
@@ -209,11 +209,11 @@
...
@@ -209,11 +209,11 @@
</item>
</item>
<item>
<item>
<key>
<string>
gadget_url
</string>
</key>
<key>
<string>
gadget_url
</string>
</key>
<value>
<string></string>
</value>
<value>
<string>
gadget_field_new_action_js_script.html
</string>
</value>
</item>
</item>
<item>
<item>
<key>
<string>
hidden
</string>
</key>
<key>
<string>
hidden
</string>
</key>
<value>
<int>
1
</int>
</value>
<value>
<int>
0
</int>
</value>
</item>
</item>
<item>
<item>
<key>
<string>
js_sandbox
</string>
</key>
<key>
<string>
js_sandbox
</string>
</key>
...
...
bt5/erp5_post/SkinTemplateItem/portal_skins/erp5_post/gadget_field_new_action_js_script.html.html
0 → 100644
View file @
438ff676
<!doctype html>
<html>
<head>
<meta
charset=
"utf-8"
>
<meta
name=
"viewport"
content=
"width=device-width, initial-scale=1"
>
<title>
OfficeJS NEW HTML Post Action
</title>
<script
src=
"rsvp.js"
></script>
<script
src=
"renderjs.js"
></script>
<script
src=
"gadget_field_new_action_js_script.js"
></script>
</head>
<body>
NEW HTML Post Action GADGET FIELD HTML!
</body>
</html>
\ No newline at end of file
bt5/erp5_post/SkinTemplateItem/portal_skins/erp5_post/gadget_field_new_action_js_script.html.xml
0 → 100644
View file @
438ff676
<?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>
gadget_field_new_action_js_script.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_post/SkinTemplateItem/portal_skins/erp5_post/gadget_field_new_action_js_script.js.js
0 → 100644
View file @
438ff676
/*global window, rJS, RSVP */
/*jslint nomen: true, indent: 2, maxerr: 3 */
(
function
(
window
,
rJS
,
RSVP
)
{
"
use strict
"
;
var
gadget_utils
;
rJS
(
window
)
/////////////////////////////////////////////////////////////////
// Acquired methods
/////////////////////////////////////////////////////////////////
.
declareAcquiredMethod
(
"
jio_get
"
,
"
jio_get
"
)
.
declareAcquiredMethod
(
"
jio_put
"
,
"
jio_put
"
)
.
declareAcquiredMethod
(
"
getSetting
"
,
"
getSetting
"
)
.
declareAcquiredMethod
(
'
getUrlParameter
'
,
'
getUrlParameter
'
)
.
declareAcquiredMethod
(
"
notifySubmitted
"
,
'
notifySubmitted
'
)
.
declareAcquiredMethod
(
"
notifySubmitting
"
,
"
notifySubmitting
"
)
.
declareAcquiredMethod
(
"
redirect
"
,
"
redirect
"
)
/////////////////////////////////////////////////////////////////
// declared methods
/////////////////////////////////////////////////////////////////
.
declareMethod
(
"
render
"
,
function
(
options
)
{
console
.
log
(
"
GADGET FIELD RENDER METHOD!!!
"
);
return
;
})
.
declareMethod
(
"
handleRender
"
,
function
(
gadget
,
gadget_utils
,
options
,
action_reference
,
parent_portal_type
,
form_definition
)
{
console
.
log
(
"
GADGET FIELD handleRender METHOD!!!
"
);
var
child_gadget_url
=
'
gadget_erp5_pt_form_view_editable.html
'
;
return
RSVP
.
Queue
()
.
push
(
function
()
{
return
RSVP
.
all
([
gadget
.
getUrlParameter
(
'
portal_type
'
),
gadget
.
getUrlParameter
(
'
parent_relative_url
'
),
gadget
.
getSetting
(
'
portal_type
'
),
gadget
.
getSetting
(
'
parent_relative_url
'
)
]);
})
.
push
(
function
(
result
)
{
if
(
result
[
0
]
!==
undefined
)
{
options
.
portal_type
=
result
[
0
];
}
else
{
options
.
portal_type
=
result
[
2
];
}
if
(
result
[
1
]
!==
undefined
)
{
options
.
parent_relative_url
=
result
[
1
];
}
else
{
options
.
parent_relative_url
=
result
[
3
];
}
return
gadget_utils
.
getFormDefinition
(
parent_portal_type
,
action_reference
)
.
push
(
function
(
result
)
{
form_definition
=
result
;
return
gadget_utils
.
createDocument
(
options
);
})
.
push
(
function
(
jio_key
)
{
return
gadget
.
jio_get
(
jio_key
)
.
push
(
function
(
new_document
)
{
return
gadget
.
changeState
({
jio_key
:
jio_key
,
doc
:
new_document
,
child_gadget_url
:
child_gadget_url
,
form_definition
:
form_definition
,
view
:
action_reference
,
editable
:
true
,
has_more_views
:
false
,
has_more_actions
:
true
,
is_form_list
:
false
});
});
});
});
})
.
declareMethod
(
"
handleSubmit
"
,
function
(
gadget
,
gadget_utils
,
jio_key
,
content_dict
)
{
console
.
log
(
"
GADGET FIELD handleSubmit METHOD!!!
"
);
return
gadget
.
notifySubmitting
()
.
push
(
function
()
{
return
gadget
.
jio_get
(
jio_key
);
})
.
push
(
function
(
document
)
{
var
property
;
for
(
property
in
content_dict
)
{
if
(
content_dict
.
hasOwnProperty
(
property
))
{
document
[
property
]
=
content_dict
[
property
];
}
}
return
gadget
.
jio_put
(
jio_key
,
document
);
})
.
push
(
function
()
{
return
gadget
.
notifySubmitted
({
message
:
'
Data Updated
'
,
status
:
'
success
'
});
})
.
push
(
function
()
{
return
gadget
.
redirect
({
command
:
'
display
'
,
options
:
{
jio_key
:
jio_key
,
editable
:
true
}
});
});
});
/*.onStateChange(function () {
return gadget_utils.renderGadget(this);
});*/
}(
window
,
rJS
,
RSVP
));
\ No newline at end of file
bt5/erp5_post/SkinTemplateItem/portal_skins/erp5_post/gadget_field_new_action_js_script.js.xml
0 → 100644
View file @
438ff676
<?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>
gadget_field_new_action_js_script.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