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
Yusei Tahara
erp5
Commits
b88a0489
Commit
b88a0489
authored
Jun 15, 2018
by
Romain Courteaud
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[erp5_gadget_interface_validator] Do not reimplement jio ajax
parent
29224500
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
33 additions
and
55 deletions
+33
-55
bt5/erp5_gadget_interface_validator/PathTemplateItem/web_page_module/gadget_interface_html.html
...thTemplateItem/web_page_module/gadget_interface_html.html
+1
-0
bt5/erp5_gadget_interface_validator/PathTemplateItem/web_page_module/gadget_interface_html.xml
...athTemplateItem/web_page_module/gadget_interface_html.xml
+2
-2
bt5/erp5_gadget_interface_validator/PathTemplateItem/web_page_module/gadget_interface_js.js
...r/PathTemplateItem/web_page_module/gadget_interface_js.js
+28
-51
bt5/erp5_gadget_interface_validator/PathTemplateItem/web_page_module/gadget_interface_js.xml
.../PathTemplateItem/web_page_module/gadget_interface_js.xml
+2
-2
No files found.
bt5/erp5_gadget_interface_validator/PathTemplateItem/web_page_module/gadget_interface_html.html
View file @
b88a0489
...
...
@@ -7,6 +7,7 @@
<script
src=
"rsvp.js"
type=
"text/javascript"
></script>
<script
src=
"renderjs.js"
type=
"text/javascript"
></script>
<script
src=
"jiodev.js"
type=
"text/javascript"
></script>
<!-- custom script -->
<script
src=
"gadget_interface.js"
type=
"text/javascript"
></script>
...
...
bt5/erp5_gadget_interface_validator/PathTemplateItem/web_page_module/gadget_interface_html.xml
View file @
b88a0489
...
...
@@ -234,7 +234,7 @@
</item>
<item>
<key>
<string>
serial
</string>
</key>
<value>
<string>
9
46.45949.24044.35191
</string>
</value>
<value>
<string>
9
68.5552.51560.44322
</string>
</value>
</item>
<item>
<key>
<string>
state
</string>
</key>
...
...
@@ -252,7 +252,7 @@
</tuple>
<state>
<tuple>
<float>
1
445940328.0
5
</float>
<float>
1
529075051.2
5
</float>
<string>
UTC
</string>
</tuple>
</state>
...
...
bt5/erp5_gadget_interface_validator/PathTemplateItem/web_page_module/gadget_interface_js.js
View file @
b88a0489
/*jslint nomen: true, indent: 2, maxerr: 30, maxlen: 80 */
/*global DOMParser, document, XMLHttpRequest, rJS, renderJS, RSVP, window*/
/*global DOMParser, document, rJS, renderJS, RSVP, window,
jIO*/
/*
* DOMParser HTML extension
* 2012-09-04
...
...
@@ -45,52 +46,19 @@
};
}(
DOMParser
,
document
));
(
function
(
window
,
rJS
,
RSVP
,
DOMParser
,
XMLHttpRequest
,
renderJS
)
{
(
function
(
window
,
rJS
,
RSVP
,
DOMParser
,
renderJS
,
jIO
)
{
"
use strict
"
;
function
ajax
(
url
)
{
var
xhr
;
function
resolver
(
resolve
,
reject
)
{
function
handler
()
{
try
{
if
(
xhr
.
readyState
===
0
)
{
// UNSENT
reject
(
xhr
);
}
else
if
(
xhr
.
readyState
===
4
)
{
// DONE
if
((
xhr
.
status
<
200
)
||
(
xhr
.
status
>=
300
))
{
reject
(
xhr
);
}
else
{
resolve
(
xhr
);
}
}
}
catch
(
e
)
{
reject
(
e
);
}
}
xhr
=
new
XMLHttpRequest
();
xhr
.
open
(
"
GET
"
,
url
);
xhr
.
onreadystatechange
=
handler
;
xhr
.
setRequestHeader
(
'
Accept
'
,
'
text/html
'
);
xhr
.
withCredentials
=
true
;
xhr
.
send
();
}
function
canceller
()
{
if
((
xhr
!==
undefined
)
&&
(
xhr
.
readyState
!==
xhr
.
DONE
))
{
xhr
.
abort
();
}
}
return
new
RSVP
.
Promise
(
resolver
,
canceller
);
}
function
fetchAppcacheData
(
appcache_url
)
{
return
new
RSVP
.
Queue
()
.
push
(
function
()
{
return
ajax
(
appcache_url
);
return
jIO
.
util
.
ajax
({
url
:
appcache_url
,
dataType
:
'
text
'
});
})
.
push
(
function
(
xhr
)
{
return
xhr
.
responseText
.
split
(
'
\n
'
);
.
push
(
function
(
evt
)
{
return
evt
.
target
.
responseText
.
split
(
'
\n
'
);
});
}
...
...
@@ -133,11 +101,14 @@
function
getInterfaceListFromURL
(
gadget_url
)
{
return
new
RSVP
.
Queue
()
.
push
(
function
()
{
return
ajax
(
gadget_url
);
return
jIO
.
util
.
ajax
({
url
:
gadget_url
,
dataType
:
'
text
'
});
})
.
push
(
function
(
xhr
)
{
.
push
(
function
(
evt
)
{
var
document_element
=
(
new
DOMParser
()).
parseFromString
(
xhr
.
responseText
,
evt
.
target
.
responseText
,
'
text/html
'
),
interface_list
=
[],
...
...
@@ -169,10 +140,13 @@
"
One or more required tags are missing.
"
;
return
new
RSVP
.
Queue
()
.
push
(
function
()
{
return
ajax
(
interface_url
);
return
jIO
.
util
.
ajax
({
url
:
interface_url
,
dataType
:
'
text
'
});
})
.
push
(
function
(
xhr
)
{
var
doc
=
(
new
DOMParser
()).
parseFromString
(
xhr
.
responseText
,
.
push
(
function
(
evt
)
{
var
doc
=
(
new
DOMParser
()).
parseFromString
(
evt
.
target
.
responseText
,
'
text/html
'
).
body
,
dl_list
=
doc
.
getElementsByTagName
(
'
dl
'
),
next_element
=
dl_list
[
0
].
firstElementChild
,
...
...
@@ -413,10 +387,13 @@
};
return
new
RSVP
.
Queue
()
.
push
(
function
()
{
return
ajax
(
interface_url
);
return
jIO
.
util
.
ajax
({
url
:
interface_url
,
dataType
:
'
text
'
});
})
.
push
(
function
(
xhr
)
{
var
doc
=
(
new
DOMParser
()).
parseFromString
(
xhr
.
responseText
,
.
push
(
function
(
evt
)
{
var
doc
=
(
new
DOMParser
()).
parseFromString
(
evt
.
target
.
responseText
,
'
text/html
'
).
body
,
dl_list
=
doc
.
querySelectorAll
(
'
dl
'
),
dt_list
=
doc
.
querySelectorAll
(
'
dt
'
),
...
...
@@ -658,4 +635,4 @@
});
});
}(
window
,
rJS
,
RSVP
,
DOMParser
,
XMLHttpRequest
,
renderJS
));
\ No newline at end of file
}(
window
,
rJS
,
RSVP
,
DOMParser
,
renderJS
,
jIO
));
\ No newline at end of file
bt5/erp5_gadget_interface_validator/PathTemplateItem/web_page_module/gadget_interface_js.xml
View file @
b88a0489
...
...
@@ -230,7 +230,7 @@
</item>
<item>
<key>
<string>
serial
</string>
</key>
<value>
<string>
968.15
557.27071.42905
</string>
</value>
<value>
<string>
968.15
689.53377.56541
</string>
</value>
</item>
<item>
<key>
<string>
state
</string>
</key>
...
...
@@ -248,7 +248,7 @@
</tuple>
<state>
<tuple>
<float>
15290
69154.34
</float>
<float>
15290
77165.39
</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