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
Labels
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
Romain Courteaud
erp5
Commits
91bfa49d
Commit
91bfa49d
authored
Oct 11, 2016
by
Romain Courteaud
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[erp5_web_renderjs_ui] Use onStateChange method
parent
03253e2b
Changes
30
Hide whitespace changes
Inline
Side-by-side
Showing
30 changed files
with
95 additions
and
156 deletions
+95
-156
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_form_js.js
...thTemplateItem/web_page_module/rjs_gadget_erp5_form_js.js
+1
-1
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_form_js.xml
...hTemplateItem/web_page_module/rjs_gadget_erp5_form_js.xml
+2
-2
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_label_field_js.js
...ateItem/web_page_module/rjs_gadget_erp5_label_field_js.js
+1
-1
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_label_field_js.xml
...teItem/web_page_module/rjs_gadget_erp5_label_field_js.xml
+2
-2
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_launcher_js.js
...mplateItem/web_page_module/rjs_gadget_erp5_launcher_js.js
+1
-1
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_launcher_js.xml
...plateItem/web_page_module/rjs_gadget_erp5_launcher_js.xml
+2
-2
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_pt_form_dialog_js.js
...Item/web_page_module/rjs_gadget_erp5_pt_form_dialog_js.js
+1
-1
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_pt_form_dialog_js.xml
...tem/web_page_module/rjs_gadget_erp5_pt_form_dialog_js.xml
+2
-2
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_pt_form_list_js.js
...teItem/web_page_module/rjs_gadget_erp5_pt_form_list_js.js
+1
-1
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_pt_form_list_js.xml
...eItem/web_page_module/rjs_gadget_erp5_pt_form_list_js.xml
+2
-2
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_pt_form_view_editable_js.js
...b_page_module/rjs_gadget_erp5_pt_form_view_editable_js.js
+1
-1
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_pt_form_view_editable_js.xml
..._page_module/rjs_gadget_erp5_pt_form_view_editable_js.xml
+2
-2
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_pt_form_view_js.js
...teItem/web_page_module/rjs_gadget_erp5_pt_form_view_js.js
+1
-1
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_pt_form_view_js.xml
...eItem/web_page_module/rjs_gadget_erp5_pt_form_view_js.xml
+1
-1
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_pt_formpage_js.js
...ateItem/web_page_module/rjs_gadget_erp5_pt_formpage_js.js
+1
-1
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_pt_formpage_js.xml
...teItem/web_page_module/rjs_gadget_erp5_pt_formpage_js.xml
+2
-2
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_pt_report_view_js.js
...Item/web_page_module/rjs_gadget_erp5_pt_report_view_js.js
+1
-1
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_pt_report_view_js.xml
...tem/web_page_module/rjs_gadget_erp5_pt_report_view_js.xml
+2
-2
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_searchfield_js.js
...ateItem/web_page_module/rjs_gadget_erp5_searchfield_js.js
+1
-1
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_searchfield_js.xml
...teItem/web_page_module/rjs_gadget_erp5_searchfield_js.xml
+2
-2
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_stringfield_js.js
...ateItem/web_page_module/rjs_gadget_erp5_stringfield_js.js
+51
-112
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_stringfield_js.xml
...teItem/web_page_module/rjs_gadget_erp5_stringfield_js.xml
+2
-2
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_textareafield_js.js
...eItem/web_page_module/rjs_gadget_erp5_textareafield_js.js
+1
-1
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_textareafield_js.xml
...Item/web_page_module/rjs_gadget_erp5_textareafield_js.xml
+2
-2
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_html5_element_js.js
...mplateItem/web_page_module/rjs_gadget_html5_element_js.js
+1
-1
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_html5_element_js.xml
...plateItem/web_page_module/rjs_gadget_html5_element_js.xml
+2
-2
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_html5_input_js.js
...TemplateItem/web_page_module/rjs_gadget_html5_input_js.js
+2
-2
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_html5_input_js.xml
...emplateItem/web_page_module/rjs_gadget_html5_input_js.xml
+2
-2
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_html5_textarea_js.js
...plateItem/web_page_module/rjs_gadget_html5_textarea_js.js
+1
-1
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_html5_textarea_js.xml
...lateItem/web_page_module/rjs_gadget_html5_textarea_js.xml
+2
-2
No files found.
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_form_js.js
View file @
91bfa49d
...
...
@@ -93,7 +93,7 @@
});
})
.
declareMethod
(
'
updateDOM
'
,
function
(
modification_dict
)
{
.
onStateChange
(
function
(
modification_dict
)
{
var
i
,
erp5_document
=
this
.
state
.
erp5_document
,
form_definition
=
this
.
state
.
form_definition
,
...
...
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_form_js.xml
View file @
91bfa49d
...
...
@@ -230,7 +230,7 @@
</item>
<item>
<key>
<string>
serial
</string>
</key>
<value>
<string>
954.273
20.12986.5102
9
</string>
</value>
<value>
<string>
954.273
30.54941.2914
9
</string>
</value>
</item>
<item>
<key>
<string>
state
</string>
</key>
...
...
@@ -248,7 +248,7 @@
</tuple>
<state>
<tuple>
<float>
147
5762090.29
</float>
<float>
147
6193992.94
</float>
<string>
UTC
</string>
</tuple>
</state>
...
...
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_label_field_js.js
View file @
91bfa49d
...
...
@@ -32,7 +32,7 @@
return
this
.
changeState
(
state_dict
);
})
.
declareMethod
(
'
updateDOM
'
,
function
(
modification_dict
)
{
.
onStateChange
(
function
(
modification_dict
)
{
var
gadget
=
this
;
if
(
modification_dict
.
hasOwnProperty
(
'
label_text
'
))
{
this
.
state
.
label_text_element
.
textContent
=
this
.
state
.
label_text
;
...
...
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_label_field_js.xml
View file @
91bfa49d
...
...
@@ -230,7 +230,7 @@
</item>
<item>
<key>
<string>
serial
</string>
</key>
<value>
<string>
954.2594
0.33315.42837
</string>
</value>
<value>
<string>
954.2594
1.22930.26914
</string>
</value>
</item>
<item>
<key>
<string>
state
</string>
</key>
...
...
@@ -248,7 +248,7 @@
</tuple>
<state>
<tuple>
<float>
147
5678720
.94
</float>
<float>
147
6194017
.94
</float>
<string>
UTC
</string>
</tuple>
</state>
...
...
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_launcher_js.js
View file @
91bfa49d
...
...
@@ -446,7 +446,7 @@
.
allowPublicAcquisition
(
"
renderApplication
"
,
function
(
param_list
)
{
return
this
.
render
.
apply
(
this
,
param_list
);
})
.
declareMethod
(
'
updateDOM
'
,
function
(
modification_dict
)
{
.
onStateChange
(
function
(
modification_dict
)
{
var
gadget
=
this
,
route_result
=
gadget
.
state
;
if
(
modification_dict
.
hasOwnProperty
(
'
url
'
))
{
...
...
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_launcher_js.xml
View file @
91bfa49d
...
...
@@ -230,7 +230,7 @@
</item>
<item>
<key>
<string>
serial
</string>
</key>
<value>
<string>
954.
23080.38606.35464
</string>
</value>
<value>
<string>
954.
34539.19221.9523
</string>
</value>
</item>
<item>
<key>
<string>
state
</string>
</key>
...
...
@@ -248,7 +248,7 @@
</tuple>
<state>
<tuple>
<float>
147
5507095.45
</float>
<float>
147
6198512.38
</float>
<string>
UTC
</string>
</tuple>
</state>
...
...
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_pt_form_dialog_js.js
View file @
91bfa49d
...
...
@@ -42,7 +42,7 @@
return
this
.
changeState
(
state_dict
);
})
.
declareMethod
(
'
updateDOM
'
,
function
()
{
.
onStateChange
(
function
()
{
var
form_gadget
=
this
,
icon
,
selector
=
form_gadget
.
element
.
querySelector
(
"
h3
"
),
...
...
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_pt_form_dialog_js.xml
View file @
91bfa49d
...
...
@@ -230,7 +230,7 @@
</item>
<item>
<key>
<string>
serial
</string>
</key>
<value>
<string>
954.559
3.38130.32665
</string>
</value>
<value>
<string>
954.559
4.14865.13670
</string>
</value>
</item>
<item>
<key>
<string>
state
</string>
</key>
...
...
@@ -248,7 +248,7 @@
</tuple>
<state>
<tuple>
<float>
147
4544293.54
</float>
<float>
147
6194100.02
</float>
<string>
UTC
</string>
</tuple>
</state>
...
...
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_pt_form_list_js.js
View file @
91bfa49d
...
...
@@ -33,7 +33,7 @@
});
})
.
declareMethod
(
'
updateDOM
'
,
function
()
{
.
onStateChange
(
function
()
{
var
form_gadget
=
this
;
// render the erp5 form
...
...
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_pt_form_list_js.xml
View file @
91bfa49d
...
...
@@ -230,7 +230,7 @@
</item>
<item>
<key>
<string>
serial
</string>
</key>
<value>
<string>
954.
5675.50023.58965
</string>
</value>
<value>
<string>
954.
34605.28227.45721
</string>
</value>
</item>
<item>
<key>
<string>
state
</string>
</key>
...
...
@@ -248,7 +248,7 @@
</tuple>
<state>
<tuple>
<float>
147
4549231.17
</float>
<float>
147
6198578.1
</float>
<string>
UTC
</string>
</tuple>
</state>
...
...
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_pt_form_view_editable_js.js
View file @
91bfa49d
...
...
@@ -43,7 +43,7 @@
return
this
.
changeState
(
state_dict
);
})
.
declareMethod
(
'
updateDOM
'
,
function
()
{
.
onStateChange
(
function
()
{
var
form_gadget
=
this
;
// render the erp5 form
...
...
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_pt_form_view_editable_js.xml
View file @
91bfa49d
...
...
@@ -230,7 +230,7 @@
</item>
<item>
<key>
<string>
serial
</string>
</key>
<value>
<string>
954.2582
0.35404.6229
</string>
</value>
<value>
<string>
954.2582
1.46431.41233
</string>
</value>
</item>
<item>
<key>
<string>
state
</string>
</key>
...
...
@@ -248,7 +248,7 @@
</tuple>
<state>
<tuple>
<float>
147
5671542.46
</float>
<float>
147
6194167.31
</float>
<string>
UTC
</string>
</tuple>
</state>
...
...
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_pt_form_view_js.js
View file @
91bfa49d
...
...
@@ -25,7 +25,7 @@
return
this
.
changeState
(
state_dict
);
})
.
declareMethod
(
'
updateDOM
'
,
function
()
{
.
onStateChange
(
function
()
{
var
gadget
=
this
;
// render the erp5 form
...
...
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_pt_form_view_js.xml
View file @
91bfa49d
...
...
@@ -248,7 +248,7 @@
</tuple>
<state>
<tuple>
<float>
147
4546509.43
</float>
<float>
147
6194151.17
</float>
<string>
UTC
</string>
</tuple>
</state>
...
...
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_pt_formpage_js.js
View file @
91bfa49d
...
...
@@ -88,7 +88,7 @@
});
});
})
.
declareMethod
(
'
updateDOM
'
,
function
(
modification_dict
)
{
.
onStateChange
(
function
(
modification_dict
)
{
var
queue
,
gadget
=
this
,
options
=
this
.
state
.
options
,
...
...
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_pt_formpage_js.xml
View file @
91bfa49d
...
...
@@ -230,7 +230,7 @@
</item>
<item>
<key>
<string>
serial
</string>
</key>
<value>
<string>
954.
15904.46164.40277
</string>
</value>
<value>
<string>
954.
23027.11225.50944
</string>
</value>
</item>
<item>
<key>
<string>
state
</string>
</key>
...
...
@@ -248,7 +248,7 @@
</tuple>
<state>
<tuple>
<float>
147
5503870.23
</float>
<float>
147
6194208.6
</float>
<string>
UTC
</string>
</tuple>
</state>
...
...
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_pt_report_view_js.js
View file @
91bfa49d
...
...
@@ -69,7 +69,7 @@
form_gadget_url
:
form_gadget_url
});
})
.
declareMethod
(
'
updateDOM
'
,
function
(
modification_dict
)
{
.
onStateChange
(
function
(
modification_dict
)
{
var
gadget
=
this
,
form_gadget
,
section_container_element
=
document
.
createElement
(
'
div
'
),
...
...
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_pt_report_view_js.xml
View file @
91bfa49d
...
...
@@ -230,7 +230,7 @@
</item>
<item>
<key>
<string>
serial
</string>
</key>
<value>
<string>
954.2591
7.62680.11605
</string>
</value>
<value>
<string>
954.2591
9.63902.23893
</string>
</value>
</item>
<item>
<key>
<string>
state
</string>
</key>
...
...
@@ -248,7 +248,7 @@
</tuple>
<state>
<tuple>
<float>
147
5677438.49
</float>
<float>
147
6194238.38
</float>
<string>
UTC
</string>
</tuple>
</state>
...
...
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_searchfield_js.js
View file @
91bfa49d
...
...
@@ -15,7 +15,7 @@
return
this
.
changeState
(
state_dict
);
})
.
declareMethod
(
'
updateDOM
'
,
function
()
{
.
onStateChange
(
function
()
{
var
gadget
=
this
;
return
gadget
.
getDeclaredGadget
(
'
input
'
)
.
push
(
function
(
input_gadget
)
{
...
...
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_searchfield_js.xml
View file @
91bfa49d
...
...
@@ -230,7 +230,7 @@
</item>
<item>
<key>
<string>
serial
</string>
</key>
<value>
<string>
954.1733
1.42805.2906
4
</string>
</value>
<value>
<string>
954.1733
6.1268.5507
4
</string>
</value>
</item>
<item>
<key>
<string>
state
</string>
</key>
...
...
@@ -248,7 +248,7 @@
</tuple>
<state>
<tuple>
<float>
147
5248801.1
</float>
<float>
147
6194269.08
</float>
<string>
UTC
</string>
</tuple>
</state>
...
...
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_stringfield_js.js
View file @
91bfa49d
/*global window, rJS
, RSVP, loopEventListener, document
*/
/*global window, rJS */
/*jslint indent: 2, maxerr: 3 */
(
function
(
window
,
rJS
,
RSVP
,
loopEventListener
,
document
)
{
(
function
(
window
,
rJS
)
{
"
use strict
"
;
rJS
(
window
)
.
ready
(
function
(
gadget
)
{
return
gadget
.
getElement
()
.
push
(
function
(
element
)
{
gadget
.
props
=
{};
gadget
.
element
=
element
;
});
})
.
declareAcquiredMethod
(
"
notifyValid
"
,
"
notifyValid
"
)
.
declareAcquiredMethod
(
"
notifyInvalid
"
,
"
notifyInvalid
"
)
.
declareAcquiredMethod
(
"
notifyChange
"
,
"
notifyChange
"
)
.
declareMethod
(
'
getTextContent
'
,
function
()
{
return
this
.
props
.
value
;
.
setState
({
tag
:
'
p
'
})
.
declareMethod
(
'
render
'
,
function
(
options
)
{
var
element
,
field_json
=
options
.
field_json
||
{},
created
=
false
;
this
.
props
.
value
=
field_json
.
value
||
field_json
.
default
||
""
;
this
.
props
.
editable
=
field_json
.
editable
;
if
(
field_json
.
editable
)
{
element
=
this
.
element
.
querySelector
(
'
input
'
);
if
(
element
===
null
)
{
element
=
document
.
createElement
(
'
input
'
);
element
.
setAttribute
(
"
type
"
,
"
text
"
);
created
=
true
;
}
element
.
setAttribute
(
'
value
'
,
this
.
props
.
value
);
element
.
setAttribute
(
'
name
'
,
field_json
.
key
);
element
.
setAttribute
(
'
title
'
,
field_json
.
title
);
if
(
field_json
.
required
===
1
)
{
element
.
setAttribute
(
'
required
'
,
'
required
'
);
}
else
{
element
.
removeAttribute
(
'
required
'
);
}
if
(
field_json
.
disabled
)
{
element
.
setAttribute
(
"
disabled
"
,
"
disabled
"
);
var
field_json
=
options
.
field_json
||
{},
state_dict
=
{
value
:
field_json
.
value
||
field_json
.
default
||
""
,
editable
:
field_json
.
editable
,
required
:
field_json
.
required
,
name
:
field_json
.
key
,
title
:
field_json
.
title
};
state_dict
.
text_content
=
state_dict
.
value
;
return
this
.
changeState
(
state_dict
);
})
.
onStateChange
(
function
(
modification_dict
)
{
var
element
=
this
.
element
,
gadget
=
this
,
url
,
result
;
if
(
modification_dict
.
hasOwnProperty
(
'
editable
'
))
{
if
(
gadget
.
state
.
editable
)
{
url
=
'
gadget_html5_input.html
'
;
}
else
{
element
.
removeAttribute
(
'
disabled
'
)
;
url
=
'
gadget_html5_element.html
'
;
}
result
=
this
.
declareGadget
(
url
,
{
scope
:
'
sub
'
})
.
push
(
function
(
input
)
{
// Clear first to DOM, append after to reduce flickering/manip
while
(
element
.
firstChild
)
{
element
.
removeChild
(
element
.
firstChild
);
}
element
.
appendChild
(
input
.
element
);
return
input
;
});
}
else
{
element
=
this
.
element
.
querySelector
(
'
p
'
);
if
(
element
===
null
)
{
element
=
document
.
createElement
(
"
p
"
);
element
.
setAttribute
(
"
class
"
,
"
ui-content-non-editable
"
);
created
=
true
;
}
element
.
textContent
=
this
.
props
.
value
;
}
if
(
created
)
{
this
.
element
.
innerHTML
=
''
;
this
.
element
.
appendChild
(
element
);
result
=
this
.
getDeclaredGadget
(
'
sub
'
);
}
return
result
.
push
(
function
(
input
)
{
return
input
.
render
(
gadget
.
state
);
});
})
.
declareMethod
(
'
getContent
'
,
function
()
{
var
input
,
re
sult
=
{};
if
(
this
.
props
.
editable
)
{
input
=
this
.
element
.
querySelector
(
'
input
'
);
result
[
input
.
getAttribute
(
'
name
'
)]
=
input
.
value
;
if
(
this
.
state
.
editable
)
{
re
turn
this
.
getDeclaredGadget
(
'
sub
'
)
.
push
(
function
(
gadget
)
{
return
gadget
.
getContent
(
);
})
;
}
return
result
;
return
{}
;
})
.
declareMethod
(
'
checkValidity
'
,
function
()
{
var
result
;
if
(
!
this
.
props
.
editable
)
{
return
true
;
}
result
=
this
.
element
.
querySelector
(
'
input
'
).
checkValidity
();
if
(
result
)
{
return
this
.
notifyValid
()
.
push
(
function
()
{
return
result
;
if
(
this
.
state
.
editable
)
{
return
this
.
getDeclaredGadget
(
'
sub
'
)
.
push
(
function
(
gadget
)
{
return
gadget
.
checkValidity
();
});
}
return
result
;
})
.
declareService
(
function
()
{
////////////////////////////////////
// Check field validity when the value changes
////////////////////////////////////
var
field_gadget
=
this
;
if
(
!
field_gadget
.
props
.
editable
)
{
return
;
}
function
notifyChange
()
{
return
RSVP
.
all
([
field_gadget
.
checkValidity
(),
field_gadget
.
notifyChange
()
]);
}
// Listen to input change
return
loopEventListener
(
field_gadget
.
element
.
querySelector
(
'
input
'
),
'
change
'
,
false
,
notifyChange
);
})
.
declareService
(
function
()
{
////////////////////////////////////
// Inform when the field input is invalid
////////////////////////////////////
var
field_gadget
=
this
;
if
(
!
field_gadget
.
props
.
editable
)
{
return
;
}
function
notifyInvalid
(
evt
)
{
return
field_gadget
.
notifyInvalid
(
evt
.
target
.
validationMessage
);
}
// Listen to input change
return
loopEventListener
(
field_gadget
.
element
.
querySelector
(
'
input
'
),
'
invalid
'
,
false
,
notifyInvalid
);
return
true
;
});
}(
window
,
rJS
,
RSVP
,
loopEventListener
,
document
));
\ No newline at end of file
}(
window
,
rJS
));
\ No newline at end of file
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_stringfield_js.xml
View file @
91bfa49d
...
...
@@ -230,7 +230,7 @@
</item>
<item>
<key>
<string>
serial
</string>
</key>
<value>
<string>
95
3.643.50676.9335
</string>
</value>
<value>
<string>
95
4.34570.5720.55227
</string>
</value>
</item>
<item>
<key>
<string>
state
</string>
</key>
...
...
@@ -248,7 +248,7 @@
</tuple>
<state>
<tuple>
<float>
147
0315124.05
</float>
<float>
147
6197972.06
</float>
<string>
UTC
</string>
</tuple>
</state>
...
...
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_textareafield_js.js
View file @
91bfa49d
...
...
@@ -19,7 +19,7 @@
return
this
.
changeState
(
state_dict
);
})
.
declareMethod
(
'
updateDOM
'
,
function
(
modification_dict
)
{
.
onStateChange
(
function
(
modification_dict
)
{
var
element
=
this
.
element
,
gadget
=
this
,
url
,
...
...
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_textareafield_js.xml
View file @
91bfa49d
...
...
@@ -236,7 +236,7 @@
</item>
<item>
<key>
<string>
serial
</string>
</key>
<value>
<string>
954.
15897.25014.42086
</string>
</value>
<value>
<string>
954.
34595.10317.3037
</string>
</value>
</item>
<item>
<key>
<string>
state
</string>
</key>
...
...
@@ -254,7 +254,7 @@
</tuple>
<state>
<tuple>
<float>
147
5764759.74
</float>
<float>
147
6198249.72
</float>
<string>
UTC
</string>
</tuple>
</state>
...
...
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_html5_element_js.js
View file @
91bfa49d
...
...
@@ -17,7 +17,7 @@
return
this
.
changeState
(
state_dict
);
})
.
declareMethod
(
'
updateDOM
'
,
function
()
{
.
onStateChange
(
function
()
{
var
element
=
this
.
element
,
new_element
=
document
.
createElement
(
this
.
state
.
tag
);
new_element
.
textContent
=
this
.
state
.
text_content
;
...
...
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_html5_element_js.xml
View file @
91bfa49d
...
...
@@ -230,7 +230,7 @@
</item>
<item>
<key>
<string>
serial
</string>
</key>
<value>
<string>
954.22958.
17507.4778
</string>
</value>
<value>
<string>
954.22958.
59420.56644
</string>
</value>
</item>
<item>
<key>
<string>
state
</string>
</key>
...
...
@@ -248,7 +248,7 @@
</tuple>
<state>
<tuple>
<float>
147
5499774.36
</float>
<float>
147
6194334.9
</float>
<string>
UTC
</string>
</tuple>
</state>
...
...
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_html5_input_js.js
View file @
91bfa49d
...
...
@@ -25,7 +25,7 @@
return
this
.
changeState
(
state_dict
);
})
.
declareMethod
(
'
updateDOM
'
,
function
()
{
.
onStateChange
(
function
()
{
var
textarea
=
this
.
element
.
querySelector
(
'
input
'
);
textarea
.
setAttribute
(
'
value
'
,
this
.
state
.
value
);
textarea
.
value
=
this
.
state
.
value
;
...
...
@@ -99,6 +99,6 @@
.
onEvent
(
'
invalid
'
,
function
(
evt
)
{
// invalid event does not bubble
return
this
.
notifyInvalid
(
evt
.
target
.
validationMessage
);
},
true
,
tru
e
);
},
true
,
fals
e
);
}(
window
,
rJS
,
RSVP
));
\ No newline at end of file
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_html5_input_js.xml
View file @
91bfa49d
...
...
@@ -230,7 +230,7 @@
</item>
<item>
<key>
<string>
serial
</string>
</key>
<value>
<string>
954.
22957.21991.6673
</string>
</value>
<value>
<string>
954.
34535.18115.52548
</string>
</value>
</item>
<item>
<key>
<string>
state
</string>
</key>
...
...
@@ -248,7 +248,7 @@
</tuple>
<state>
<tuple>
<float>
147
5511138.87
</float>
<float>
147
6198804.5
</float>
<string>
UTC
</string>
</tuple>
</state>
...
...
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_html5_textarea_js.js
View file @
91bfa49d
...
...
@@ -31,7 +31,7 @@
return
this
.
changeState
(
state_dict
);
})
.
declareMethod
(
'
updateDOM
'
,
function
()
{
.
onStateChange
(
function
()
{
var
textarea
=
this
.
element
.
querySelector
(
'
textarea
'
);
// textarea.setAttribute('value', this.state.value);
textarea
.
value
=
this
.
state
.
value
;
...
...
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_html5_textarea_js.xml
View file @
91bfa49d
...
...
@@ -230,7 +230,7 @@
</item>
<item>
<key>
<string>
serial
</string>
</key>
<value>
<string>
954.27
370.32393.51592
</string>
</value>
<value>
<string>
954.27
455.2029.68
</string>
</value>
</item>
<item>
<key>
<string>
state
</string>
</key>
...
...
@@ -248,7 +248,7 @@
</tuple>
<state>
<tuple>
<float>
147
5769541.61
</float>
<float>
147
6194310.55
</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