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
1a032115
Commit
1a032115
authored
May 10, 2019
by
Roque
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
erp5_officejs: gadgets cleanup
parent
3f82e201
Changes
11
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
8 additions
and
1613 deletions
+8
-1613
bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_erp5_page_ojs_add_post_html.html
...e_module/gadget_officejs_erp5_page_ojs_add_post_html.html
+0
-18
bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_erp5_page_ojs_add_post_html.xml
...ge_module/gadget_officejs_erp5_page_ojs_add_post_html.xml
+0
-357
bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_erp5_page_ojs_add_post_js.js
..._page_module/gadget_officejs_erp5_page_ojs_add_post_js.js
+0
-54
bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_erp5_page_ojs_add_post_js.xml
...page_module/gadget_officejs_erp5_page_ojs_add_post_js.xml
+0
-353
bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_erp5_page_post_list_html.html
...page_module/gadget_officejs_erp5_page_post_list_html.html
+0
-19
bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_erp5_page_post_list_html.xml
..._page_module/gadget_officejs_erp5_page_post_list_html.xml
+0
-363
bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_erp5_page_post_list_js.js
...web_page_module/gadget_officejs_erp5_page_post_list_js.js
+0
-83
bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_erp5_page_post_list_js.xml
...eb_page_module/gadget_officejs_erp5_page_post_list_js.xml
+0
-359
bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_page_action_officejs_js.js
...eb_page_module/gadget_officejs_page_action_officejs_js.js
+4
-3
bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_page_action_officejs_js.xml
...b_page_module/gadget_officejs_page_action_officejs_js.xml
+2
-2
bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_page_handle_action_js.xml
...web_page_module/gadget_officejs_page_handle_action_js.xml
+2
-2
No files found.
bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_erp5_page_ojs_add_post_html.html
deleted
100644 → 0
View file @
3f82e201
<!doctype html>
<html>
<head>
<meta
charset=
"utf-8"
>
<meta
name=
"viewport"
content=
"width=device-width, initial-scale=1"
>
<title>
OfficeJS Add Post Document
</title>
<script
src=
"rsvp.js"
></script>
<script
src=
"renderjs.js"
></script>
<script
src=
"gadget_erp5_page_ojs_add_post.js"
></script>
</head>
<body>
</body>
</html>
bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_erp5_page_ojs_add_post_html.xml
deleted
100644 → 0
View file @
3f82e201
This diff is collapsed.
Click to expand it.
bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_erp5_page_ojs_add_post_js.js
deleted
100644 → 0
View file @
3f82e201
/*global window, rJS, RSVP */
/*jslint nomen: true, indent: 2, maxerr: 3 */
(
function
(
window
,
rJS
,
RSVP
,
Blob
)
{
"
use strict
"
;
rJS
(
window
)
/////////////////////////////////////////////////////////////////
// Acquired methods
/////////////////////////////////////////////////////////////////
.
declareAcquiredMethod
(
"
updateHeader
"
,
"
updateHeader
"
)
.
declareAcquiredMethod
(
"
getSetting
"
,
"
getSetting
"
)
.
declareAcquiredMethod
(
"
jio_putAttachment
"
,
"
jio_putAttachment
"
)
.
declareAcquiredMethod
(
"
redirect
"
,
"
redirect
"
)
.
declareAcquiredMethod
(
"
jio_post
"
,
"
jio_post
"
)
/////////////////////////////////////////////////////////////////
// declared methods
/////////////////////////////////////////////////////////////////
.
declareMethod
(
"
render
"
,
function
(
options
)
{
var
gadget
=
this
,
doc_id
;
return
RSVP
.
Queue
()
.
push
(
function
()
{
return
RSVP
.
all
([
gadget
.
getSetting
(
'
portal_type
'
),
gadget
.
getSetting
(
'
parent_relative_url
'
)
]);
})
.
push
(
function
(
result
)
{
var
doc
=
{
title
:
"
Untitled Document
"
,
portal_type
:
result
[
0
],
parent_relative_url
:
result
[
1
]
},
key
,
doc_key
;
for
(
key
in
options
)
{
if
(
options
.
hasOwnProperty
(
key
))
{
if
(
key
.
startsWith
(
"
my_
"
))
{
doc_key
=
key
.
replace
(
"
my_
"
,
""
);
doc
[
doc_key
]
=
options
[
key
];
}
}
}
return
gadget
.
jio_post
(
doc
);
})
.
push
(
function
(
id
)
{
return
gadget
.
redirect
({
command
:
'
display
'
,
options
:
{
jio_key
:
id
,
editable
:
true
}
});
});
});
}(
window
,
rJS
,
RSVP
,
Blob
));
bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_erp5_page_ojs_add_post_js.xml
deleted
100644 → 0
View file @
3f82e201
This diff is collapsed.
Click to expand it.
bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_erp5_page_post_list_html.html
deleted
100644 → 0
View file @
3f82e201
<!doctype html>
<html>
<head>
<meta
charset=
"utf-8"
>
<meta
name=
"viewport"
content=
"width=device-width, initial-scale=1"
>
<title>
OfficeJS Posts List
</title>
<script
src=
"rsvp.js"
></script>
<script
src=
"renderjs.js"
></script>
<script
src=
"gadget_erp5_page_ojs_post_list.js"
></script>
</head>
<body>
<div
data-gadget-url=
"gadget_erp5_pt_form_list.html"
data-gadget-scope=
"form_list"
></div>
</body>
</html>
bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_erp5_page_post_list_html.xml
deleted
100644 → 0
View file @
3f82e201
This diff is collapsed.
Click to expand it.
bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_erp5_page_post_list_js.js
deleted
100644 → 0
View file @
3f82e201
/*global window, document, rJS, RSVP */
/*jslint nomen: true, indent: 2, maxerr: 3 */
(
function
(
window
,
document
,
rJS
,
RSVP
)
{
"
use strict
"
;
//TODO rename this gadget as "front or main" gadget
//check if this can be done by the controller and use that gadget instead
rJS
(
window
)
/////////////////////////////////////////////////////////////////
// Acquired methods
/////////////////////////////////////////////////////////////////
.
declareAcquiredMethod
(
"
updateHeader
"
,
"
updateHeader
"
)
.
declareAcquiredMethod
(
"
getUrlParameter
"
,
"
getUrlParameter
"
)
.
declareAcquiredMethod
(
"
isDesktopMedia
"
,
"
isDesktopMedia
"
)
.
declareAcquiredMethod
(
"
getUrlForList
"
,
"
getUrlForList
"
)
.
declareAcquiredMethod
(
"
getSetting
"
,
"
getSetting
"
)
/////////////////////////////////////////////////////////////////
// declared methods
/////////////////////////////////////////////////////////////////
.
declareMethod
(
"
render
"
,
function
(
options
)
{
var
gadget
=
this
,
default_view
=
"
jio_view
"
,
common_utils_gadget_url
=
"
gadget_officejs_common_utils.html
"
,
child_gadget_url
=
'
gadget_erp5_pt_form_list.html
'
,
portal_type
,
//In a future, the post list will be within a thread. For now:
fake_thread_uid
=
"
thread-
"
+
(
"
0000
"
+
((
Math
.
random
()
*
Math
.
pow
(
36
,
4
))
|
0
).
toString
(
36
)).
slice
(
-
4
);
return
RSVP
.
Queue
()
.
push
(
function
()
{
return
RSVP
.
all
([
gadget
.
getSetting
(
'
parent_portal_type
'
),
gadget
.
declareGadget
(
"
gadget_officejs_common_utils.html
"
)
]);
})
.
push
(
function
(
result
)
{
portal_type
=
result
[
0
];
return
result
[
1
].
getFormDefinition
(
result
[
0
],
default_view
,
{
source_reference
:
fake_thread_uid
});
})
.
push
(
function
(
form_definition
)
{
return
gadget
.
changeState
({
jio_key
:
options
.
jio_key
,
portal_type
:
portal_type
,
//TODO child_gadget_url should be decided in utils.getFormDefinition based on form type
child_gadget_url
:
child_gadget_url
,
form_definition
:
form_definition
,
form_type
:
'
list
'
,
editable
:
false
,
view
:
default_view
,
front_page
:
true
});
});
})
.
onStateChange
(
function
()
{
var
fragment
=
document
.
createElement
(
'
div
'
),
gadget
=
this
,
options
;
while
(
this
.
element
.
firstChild
)
{
this
.
element
.
removeChild
(
this
.
element
.
firstChild
);
}
this
.
element
.
appendChild
(
fragment
);
return
gadget
.
declareGadget
(
"
gadget_officejs_form_view.html
"
,
{
element
:
fragment
,
scope
:
'
form_view
'
})
.
push
(
function
(
form_view_gadget
)
{
return
form_view_gadget
.
render
(
gadget
.
state
);
});
})
.
declareMethod
(
"
triggerSubmit
"
,
function
()
{
var
argument_list
=
arguments
;
return
this
.
getDeclaredGadget
(
'
form_view
'
)
.
push
(
function
(
view_gadget
)
{
return
view_gadget
.
getDeclaredGadget
(
'
fg
'
);
})
.
push
(
function
(
gadget
)
{
return
gadget
.
triggerSubmit
.
apply
(
gadget
,
argument_list
);
});
});
}(
window
,
document
,
rJS
,
RSVP
));
\ No newline at end of file
bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_erp5_page_post_list_js.xml
deleted
100644 → 0
View file @
3f82e201
This diff is collapsed.
Click to expand it.
bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_page_action_officejs_js.js
View file @
1a032115
...
...
@@ -83,7 +83,7 @@
});
})
.
declareMethod
(
"
getAllActions
"
,
function
(
portal_type
,
action_category
)
{
.
declareMethod
(
"
getAllActions
"
,
function
(
portal_type
,
action_category
,
options
)
{
var
gadget
=
this
,
action_info_dict
=
{
views
:
{},
actions
:
{}},
query
=
'
portal_type: "Action Information" AND parent_relative_url: "portal_types/
'
+
portal_type
+
'
"
'
;
...
...
@@ -108,6 +108,7 @@
}
action_settings_list
.
push
({
page
:
page
,
jio_key
:
options
.
jio_key
,
title
:
action_doc
.
title
,
action
:
action_doc
.
reference
,
reference
:
action_doc
.
reference
,
...
...
@@ -128,7 +129,7 @@
}
//if portal_type has both view and jio_view, remove classic 'view'
//TODO use action type instead of reference
//is the 'classic view' action needed at all here? -maybe
don't add it
in appcache manifest
//is the 'classic view' action needed at all here? -maybe
it shouldn't be added
in appcache manifest
if
(
action_info_dict
.
views
.
hasOwnProperty
(
"
view
"
)
&&
action_info_dict
.
views
.
hasOwnProperty
(
"
jio_view
"
))
{
delete
action_info_dict
.
views
.
view
;
}
...
...
@@ -148,7 +149,7 @@
return
options
.
portal_type
;
})
.
push
(
function
(
portal_type
)
{
return
gadget
.
getAllActions
(
portal_type
,
view_categories
[
0
]);
return
gadget
.
getAllActions
(
portal_type
,
view_categories
[
0
]
,
options
);
})
.
push
(
function
(
action_info_dict
)
{
return
RSVP
.
all
([
...
...
bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_page_action_officejs_js.xml
View file @
1a032115
...
...
@@ -228,7 +228,7 @@
</item>
<item>
<key>
<string>
serial
</string>
</key>
<value>
<string>
975.
39736.64982.1476
2
</string>
</value>
<value>
<string>
975.
40561.441.848
2
</string>
</value>
</item>
<item>
<key>
<string>
state
</string>
</key>
...
...
@@ -246,7 +246,7 @@
</tuple>
<state>
<tuple>
<float>
15574
89660.39
</float>
<float>
15574
99265.0
</float>
<string>
UTC
</string>
</tuple>
</state>
...
...
bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_page_handle_action_js.xml
View file @
1a032115
...
...
@@ -269,7 +269,7 @@
</item>
<item>
<key>
<string>
serial
</string>
</key>
<value>
<string>
975.40
675.7475.8960
</string>
</value>
<value>
<string>
975.40
721.35496.30668
</string>
</value>
</item>
<item>
<key>
<string>
state
</string>
</key>
...
...
@@ -287,7 +287,7 @@
</tuple>
<state>
<tuple>
<float>
1557
496526.16
</float>
<float>
1557
500271.45
</float>
<string>
UTC
</string>
</tuple>
</state>
...
...
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