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
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Boris Kocherov
erp5
Commits
3e3bf820
Commit
3e3bf820
authored
Jul 25, 2018
by
Boris Kocherov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
erp5_officejs: schema editor: fix developer_mode switcher
parent
b6b09964
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
47 additions
and
32 deletions
+47
-32
bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_erp5_ojs_schema_panel.html.html
...em/web_page_module/gadget_erp5_ojs_schema_panel.html.html
+1
-1
bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_erp5_ojs_schema_panel.js.js
...teItem/web_page_module/gadget_erp5_ojs_schema_panel.js.js
+46
-31
No files found.
bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_erp5_ojs_schema_panel.html.html
View file @
3e3bf820
...
@@ -37,7 +37,7 @@
...
@@ -37,7 +37,7 @@
<
ul
data
-
role
=
"
listview
"
class
=
"
ui-listview
"
data
-
enhanced
=
"
true
"
><
/ul
>
<
ul
data
-
role
=
"
listview
"
class
=
"
ui-listview
"
data
-
enhanced
=
"
true
"
><
/ul
>
<
div
data
-
gadget
-
url
=
"
gadget_erp5_field_checkbox.html
"
<
div
data
-
gadget
-
url
=
"
gadget_erp5_field_checkbox.html
"
data
-
gadget
-
scope
=
"
editable
_mode
"
data
-
gadget
-
scope
=
"
developer
_mode
"
data
-
gadget
-
sandbox
=
"
public
"
><
/div
>
data
-
gadget
-
sandbox
=
"
public
"
><
/div
>
<
dl
><
/dl
>
<
dl
><
/dl
>
<
/div
>
<
/div
>
...
...
bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_erp5_ojs_schema_panel.js.js
View file @
3e3bf820
...
@@ -34,6 +34,9 @@
...
@@ -34,6 +34,9 @@
.
declareAcquiredMethod
(
"
translateHtml
"
,
"
translateHtml
"
)
.
declareAcquiredMethod
(
"
translateHtml
"
,
"
translateHtml
"
)
.
declareAcquiredMethod
(
"
translate
"
,
"
translate
"
)
.
declareAcquiredMethod
(
"
translate
"
,
"
translate
"
)
.
declareAcquiredMethod
(
"
redirect
"
,
"
redirect
"
)
.
declareAcquiredMethod
(
"
redirect
"
,
"
redirect
"
)
.
declareAcquiredMethod
(
"
updatePanel
"
,
"
updatePanel
"
)
.
declareAcquiredMethod
(
"
getSetting
"
,
"
getSetting
"
)
.
declareAcquiredMethod
(
"
setSetting
"
,
"
setSetting
"
)
.
declareAcquiredMethod
(
"
getUrlParameter
"
,
"
getUrlParameter
"
)
.
declareAcquiredMethod
(
"
getUrlParameter
"
,
"
getUrlParameter
"
)
.
declareAcquiredMethod
(
"
jio_allDocs
"
,
"
jio_allDocs
"
)
.
declareAcquiredMethod
(
"
jio_allDocs
"
,
"
jio_allDocs
"
)
...
@@ -85,18 +88,27 @@
...
@@ -85,18 +88,27 @@
.
push
(
undefined
,
function
()
{
.
push
(
undefined
,
function
()
{
return
"
[]
"
;
return
"
[]
"
;
}),
}),
context
.
getUrlParameter
(
'
editable
'
)
context
.
getSetting
(
'
developer_mode
'
)
.
push
(
undefined
,
function
()
{
return
true
;
})
]);
]);
})
})
.
push
(
function
(
ret
)
{
.
push
(
function
(
ret
)
{
var
schema_list
=
ret
[
0
],
var
schema_list
=
ret
[
0
],
editable
=
ret
[
1
];
developer_mode
=
ret
[
1
];
if
(
developer_mode
===
undefined
)
{
developer_mode
=
true
;
}
if
(
developer_mode
===
"
false
"
)
{
developer_mode
=
false
;
}
return
context
.
changeState
({
return
context
.
changeState
({
workflow_list
:
workflow_list
,
workflow_list
:
workflow_list
,
view_list
:
view_list
,
view_list
:
view_list
,
schema_list
:
schema_list
,
schema_list
:
schema_list
,
global
:
true
,
global
:
true
,
editable
:
options
.
editable
||
editable
||
fals
e
developer_mode
:
developer_mod
e
});
});
});
});
})
})
...
@@ -144,8 +156,8 @@
...
@@ -144,8 +156,8 @@
})
})
.
push
(
function
()
{
.
push
(
function
()
{
return
context
.
declareGadget
(
'
gadget_erp5_field_multicheckbox.html
'
,
{
return
context
.
declareGadget
(
'
gadget_erp5_field_multicheckbox.html
'
,
{
scope
:
"
editable
_mode
"
,
scope
:
"
developer
_mode
"
,
element
:
tmp_element
.
querySelector
(
'
[data-gadget-scope="
editable
_mode"]
'
)
element
:
tmp_element
.
querySelector
(
'
[data-gadget-scope="
developer
_mode"]
'
)
});
});
})
})
.
push
(
function
()
{
.
push
(
function
()
{
...
@@ -155,7 +167,7 @@
...
@@ -155,7 +167,7 @@
}
}
if
(
modification_dict
.
hasOwnProperty
(
"
schema_list
"
)
||
if
(
modification_dict
.
hasOwnProperty
(
"
schema_list
"
)
||
modification_dict
.
hasOwnProperty
(
"
editabl
e
"
))
{
modification_dict
.
hasOwnProperty
(
"
developer_mod
e
"
))
{
queue
queue
.
push
(
function
()
{
.
push
(
function
()
{
function
gen_element
(
element
,
title
,
css
,
accesskey
)
{
function
gen_element
(
element
,
title
,
css
,
accesskey
)
{
...
@@ -173,24 +185,24 @@
...
@@ -173,24 +185,24 @@
row
,
row
,
tasks
=
[],
tasks
=
[],
schema_list
=
JSON
.
parse
(
context
.
state
.
schema_list
);
schema_list
=
JSON
.
parse
(
context
.
state
.
schema_list
);
if
(
context
.
state
.
editabl
e
)
{
if
(
context
.
state
.
developer_mod
e
)
{
tasks
.
push
(
gen_element
({
command
:
'
display
'
,
options
:
{
page
:
"
ojs_schema_document_list
"
}},
tasks
.
push
(
gen_element
({
command
:
'
display
'
,
options
:
{
page
:
"
ojs_schema_document_list
"
}},
"
Schemas
"
,
"
search
"
,
"
s
"
));
"
Schemas
"
,
"
search
"
,
"
s
"
));
}
}
for
(
i
=
0
;
i
<
schema_list
.
length
;
i
+=
1
)
{
for
(
i
=
0
;
i
<
schema_list
.
length
;
i
+=
1
)
{
row
=
schema_list
[
i
];
row
=
schema_list
[
i
];
tasks
.
push
(
gen_element
({
command
:
'
display
'
,
options
:
{
tasks
.
push
(
gen_element
({
command
:
'
display
'
,
options
:
{
page
:
"
ojs_schema_document_list
"
,
page
:
"
ojs_schema_document_list
"
,
portal_type
:
"
JSON Document
"
,
portal_type
:
"
JSON Document
"
,
schema
:
row
.
id
,
schema
:
row
.
id
,
schema_title
:
row
.
value
.
title
schema_title
:
row
.
value
.
title
}},
row
.
value
.
title
,
"
search
"
));
}},
row
.
value
.
title
,
"
search
"
));
}
}
tasks
.
push
(
gen_element
({
command
:
'
display
'
,
options
:
{
page
:
"
ojs_sync
"
,
'
auto_repair
'
:
true
}},
tasks
.
push
(
gen_element
({
command
:
'
display
'
,
options
:
{
page
:
"
ojs_sync
"
,
'
auto_repair
'
:
true
}},
"
Synchronize
"
,
"
refresh
"
));
"
Synchronize
"
,
"
refresh
"
));
tasks
.
push
(
gen_element
({
command
:
'
display
'
,
options
:
{
page
:
"
ojs_configurator
"
}},
tasks
.
push
(
gen_element
({
command
:
'
display
'
,
options
:
{
page
:
"
ojs_configurator
"
}},
"
Storages
"
,
"
dropbox
"
));
"
Storages
"
,
"
dropbox
"
));
if
(
context
.
state
.
editabl
e
)
{
if
(
context
.
state
.
developer_mod
e
)
{
tasks
.
push
(
gen_element
({
command
:
'
index
'
,
options
:
{
page
:
"
ojs_zip_upload
"
}},
tasks
.
push
(
gen_element
({
command
:
'
index
'
,
options
:
{
page
:
"
ojs_zip_upload
"
}},
"
Upload
"
,
"
upload
"
));
"
Upload
"
,
"
upload
"
));
}
}
...
@@ -207,25 +219,25 @@
...
@@ -207,25 +219,25 @@
// Update the checkbox field value
// Update the checkbox field value
return
RSVP
.
all
([
return
RSVP
.
all
([
context
.
getDeclaredGadget
(
"
editable
_mode
"
),
context
.
getDeclaredGadget
(
"
developer
_mode
"
),
context
.
translate
(
"
Developer Mode
"
)
context
.
translate
(
"
Developer Mode
"
)
]);
]);
})
})
.
push
(
function
(
result_list
)
{
.
push
(
function
(
result_list
)
{
var
value
=
[],
var
value
=
[],
search
_gadget
=
result_list
[
0
],
developer_mode
_gadget
=
result_list
[
0
],
title
=
result_list
[
1
];
title
=
result_list
[
1
];
if
(
context
.
state
.
editabl
e
)
{
if
(
context
.
state
.
developer_mod
e
)
{
value
=
[
'
editable
'
];
value
=
[
'
developer
'
];
}
}
return
search
_gadget
.
render
({
field_json
:
{
return
developer_mode
_gadget
.
render
({
field_json
:
{
editable
:
true
,
editable
:
true
,
name
:
'
editable
'
,
name
:
'
developer
'
,
key
:
'
editable
'
,
key
:
'
developer
'
,
hidden
:
false
,
hidden
:
false
,
items
:
[[
title
,
'
editable
'
]],
items
:
[[
title
,
'
developer
'
]],
default
:
value
default
:
value
}});
}});
});
});
}
}
...
@@ -336,18 +348,21 @@
...
@@ -336,18 +348,21 @@
})
})
.
allowPublicAcquisition
(
'
notifyChange
'
,
function
(
argument_list
,
scope
)
{
.
allowPublicAcquisition
(
'
notifyChange
'
,
function
(
argument_list
,
scope
)
{
if
(
scope
===
'
editable_mode
'
)
{
if
(
scope
===
'
developer_mode
'
&&
argument_list
[
0
]
===
"
change
"
)
{
var
context
=
this
;
var
context
=
this
;
return
context
.
getDeclaredGadget
(
'
editable
_mode
'
)
return
context
.
getDeclaredGadget
(
'
developer
_mode
'
)
.
push
(
function
(
gadget
)
{
.
push
(
function
(
gadget
)
{
return
gadget
.
getContent
();
return
gadget
.
getContent
();
})
})
.
push
(
function
(
result
)
{
.
push
(
function
(
result
)
{
var
options
=
{
editable
:
undefined
}
;
var
value
=
"
false
"
;
if
(
result
.
editable
.
length
===
1
)
{
if
(
result
.
developer
.
length
===
1
)
{
options
.
editabl
e
=
true
;
valu
e
=
true
;
}
}
return
context
.
redirect
({
command
:
'
change
'
,
options
:
options
});
return
context
.
setSetting
(
"
developer_mode
"
,
value
);
})
.
push
(
function
()
{
return
context
.
updatePanel
({});
});
});
}
}
// Typing a search query should not modify the header status
// Typing a search query should not modify the header status
...
...
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