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
Yoji Takeuchi
erp5
Commits
5cf3d2e6
Commit
5cf3d2e6
authored
Jul 29, 2016
by
Romain Courteaud
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[erp5_web_renderjs_ui] Update renderjs to 0.10.0
parent
2c92a181
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
134 additions
and
46 deletions
+134
-46
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_renderjs_js.js
...js_ui/PathTemplateItem/web_page_module/rjs_renderjs_js.js
+132
-44
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_renderjs_js.xml
...s_ui/PathTemplateItem/web_page_module/rjs_renderjs_js.xml
+2
-2
No files found.
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_renderjs_js.js
View file @
5cf3d2e6
...
@@ -673,7 +673,7 @@ if (typeof document.contains !== 'function') {
...
@@ -673,7 +673,7 @@ if (typeof document.contains !== 'function') {
* http://www.renderjs.org/documentation
* http://www.renderjs.org/documentation
*/
*/
(
function
(
document
,
window
,
RSVP
,
DOMParser
,
Channel
,
MutationObserver
,
(
function
(
document
,
window
,
RSVP
,
DOMParser
,
Channel
,
MutationObserver
,
Node
,
FileReader
,
Blob
)
{
Node
,
FileReader
,
Blob
,
navigator
,
Event
)
{
"
use strict
"
;
"
use strict
"
;
function
readBlobAsDataURL
(
blob
)
{
function
readBlobAsDataURL
(
blob
)
{
...
@@ -737,7 +737,19 @@ if (typeof document.contains !== 'function') {
...
@@ -737,7 +737,19 @@ if (typeof document.contains !== 'function') {
renderJS
,
renderJS
,
Monitor
,
Monitor
,
scope_increment
=
0
,
scope_increment
=
0
,
isAbsoluteOrDataURL
=
new
RegExp
(
'
^(?:[a-z]+:)?//|data:
'
,
'
i
'
);
isAbsoluteOrDataURL
=
new
RegExp
(
'
^(?:[a-z]+:)?//|data:
'
,
'
i
'
),
is_page_unloaded
=
false
,
error_list
=
[];
window
.
addEventListener
(
'
error
'
,
function
(
error
)
{
error_list
.
push
(
error
);
});
window
.
addEventListener
(
'
beforeunload
'
,
function
()
{
// XXX If another listener cancel the page unload,
// it will not restore renderJS crash report
is_page_unloaded
=
true
;
});
/////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////
// Helper functions
// Helper functions
...
@@ -751,23 +763,107 @@ if (typeof document.contains !== 'function') {
...
@@ -751,23 +763,107 @@ if (typeof document.contains !== 'function') {
}
}
function
letsCrash
(
e
)
{
function
letsCrash
(
e
)
{
if
(
e
.
constructor
===
XMLHttpRequest
)
{
var
i
,
e
=
{
body
,
readyState
:
e
.
readyState
,
container
,
status
:
e
.
status
,
paragraph
,
statusText
:
e
.
statusText
,
link
,
response_headers
:
e
.
getAllResponseHeaders
()
error
;
};
if
(
is_page_unloaded
)
{
/*global console*/
console
.
info
(
'
-- Error dropped, as page is unloaded
'
);
console
.
info
(
e
);
return
;
}
}
if
(
e
.
constructor
===
Array
||
e
.
constructor
===
String
||
error_list
.
push
(
e
);
e
.
constructor
===
Object
)
{
// Add error handling stack
try
{
error_list
.
push
(
new
Error
(
'
stopping renderJS
'
));
e
=
JSON
.
stringify
(
e
);
}
catch
(
ignore
)
{
body
=
document
.
getElementsByTagName
(
'
body
'
)[
0
];
while
(
body
.
firstChild
)
{
body
.
removeChild
(
body
.
firstChild
);
}
container
=
document
.
createElement
(
"
section
"
);
paragraph
=
document
.
createElement
(
"
h1
"
);
paragraph
.
textContent
=
'
Unhandled Error
'
;
container
.
appendChild
(
paragraph
);
paragraph
=
document
.
createElement
(
"
p
"
);
paragraph
.
textContent
=
'
Please report this error to the support team
'
;
container
.
appendChild
(
paragraph
);
paragraph
=
document
.
createElement
(
"
p
"
);
paragraph
.
textContent
=
'
Location:
'
;
link
=
document
.
createElement
(
"
a
"
);
link
.
href
=
link
.
textContent
=
window
.
location
.
toString
();
paragraph
.
appendChild
(
link
);
container
.
appendChild
(
paragraph
);
paragraph
=
document
.
createElement
(
"
p
"
);
paragraph
.
textContent
=
'
User-agent:
'
+
navigator
.
userAgent
;
container
.
appendChild
(
paragraph
);
body
.
appendChild
(
container
);
for
(
i
=
0
;
i
<
error_list
.
length
;
i
+=
1
)
{
error
=
error_list
[
i
];
if
(
error
instanceof
Event
)
{
error
=
{
string
:
error
.
toString
(),
message
:
error
.
message
,
type
:
error
.
type
,
target
:
error
.
target
};
if
(
error
.
target
!==
undefined
)
{
error_list
.
splice
(
i
+
1
,
0
,
error
.
target
);
}
}
if
(
error
instanceof
XMLHttpRequest
)
{
error
=
{
message
:
error
.
toString
(),
readyState
:
error
.
readyState
,
status
:
error
.
status
,
statusText
:
error
.
statusText
,
response
:
error
.
response
,
responseUrl
:
error
.
responseUrl
,
response_headers
:
error
.
getAllResponseHeaders
()
};
}
if
(
error
.
constructor
===
Array
||
error
.
constructor
===
String
||
error
.
constructor
===
Object
)
{
try
{
error
=
JSON
.
stringify
(
error
);
}
catch
(
ignore
)
{
}
}
container
=
document
.
createElement
(
"
section
"
);
paragraph
=
document
.
createElement
(
"
h2
"
);
paragraph
.
textContent
=
error
.
message
||
error
;
container
.
appendChild
(
paragraph
);
if
(
error
.
fileName
!==
undefined
)
{
paragraph
=
document
.
createElement
(
"
p
"
);
paragraph
.
textContent
=
'
File:
'
+
error
.
fileName
+
'
:
'
+
error
.
lineNumber
;
container
.
appendChild
(
paragraph
);
}
if
(
error
.
stack
!==
undefined
)
{
paragraph
=
document
.
createElement
(
"
pre
"
);
paragraph
.
textContent
=
'
Stack:
'
+
error
.
stack
;
container
.
appendChild
(
paragraph
);
}
}
body
.
appendChild
(
container
);
}
}
document
.
getElementsByTagName
(
'
body
'
)[
0
].
textContent
=
e
;
// XXX Do not crash the application if it fails
// XXX Do not crash the application if it fails
// Where to write the error?
// Where to write the error?
/*global console*/
/*global console*/
...
@@ -1273,7 +1369,13 @@ if (typeof document.contains !== 'function') {
...
@@ -1273,7 +1369,13 @@ if (typeof document.contains !== 'function') {
iframe_loading_deferred
.
promise
,
iframe_loading_deferred
.
promise
,
// Timeout to prevent non renderJS embeddable gadget
// Timeout to prevent non renderJS embeddable gadget
// XXX Maybe using iframe.onload/onerror would be safer?
// XXX Maybe using iframe.onload/onerror would be safer?
RSVP
.
timeout
(
5000
)
new
RSVP
.
Queue
()
.
push
(
function
()
{
return
RSVP
.
timeout
(
5000
);
})
.
push
(
undefined
,
function
()
{
throw
new
Error
(
'
Timeout while loading:
'
+
url
);
})
]);
]);
}
}
...
@@ -1701,9 +1803,6 @@ if (typeof document.contains !== 'function') {
...
@@ -1701,9 +1803,6 @@ if (typeof document.contains !== 'function') {
last_acquisition_gadget
=
new
RenderJSGadget
();
last_acquisition_gadget
=
new
RenderJSGadget
();
last_acquisition_gadget
.
__acquired_method_dict
=
{
last_acquisition_gadget
.
__acquired_method_dict
=
{
getTopURL
:
function
()
{
return
url
;
},
reportServiceError
:
function
(
param_list
)
{
reportServiceError
:
function
(
param_list
)
{
letsCrash
(
param_list
[
0
]);
letsCrash
(
param_list
[
0
]);
}
}
...
@@ -1815,30 +1914,19 @@ if (typeof document.contains !== 'function') {
...
@@ -1815,30 +1914,19 @@ if (typeof document.contains !== 'function') {
});
});
return
;
return
;
}
}
// Get Top URL
connection_ready
=
true
;
return
tmp_constructor
.
prototype
.
__aq_parent
(
'
getTopURL
'
,
[])
notifyReady
();
.
then
(
function
(
topURL
)
{
//the channel is ok
var
base
=
document
.
createElement
(
'
base
'
);
//so bind calls to renderJS method on the instance
base
.
href
=
topURL
;
embedded_channel
.
bind
(
"
methodCall
"
,
function
(
trans
,
v
)
{
base
.
target
=
"
_top
"
;
root_gadget
[
v
[
0
]].
apply
(
root_gadget
,
v
[
1
])
document
.
head
.
appendChild
(
base
);
.
then
(
function
(
g
)
{
connection_ready
=
true
;
trans
.
complete
(
g
);
notifyReady
();
}).
fail
(
function
(
e
)
{
//the channel is ok
trans
.
error
(
e
.
toString
());
//so bind calls to renderJS method on the instance
embedded_channel
.
bind
(
"
methodCall
"
,
function
(
trans
,
v
)
{
root_gadget
[
v
[
0
]].
apply
(
root_gadget
,
v
[
1
])
.
then
(
function
(
g
)
{
trans
.
complete
(
g
);
}).
fail
(
function
(
e
)
{
trans
.
error
(
e
.
toString
());
});
trans
.
delayReturn
(
true
);
});
});
})
trans
.
delayReturn
(
true
);
.
fail
(
function
(
error
)
{
});
throw
error
;
});
}
}
});
});
...
@@ -2047,4 +2135,4 @@ if (typeof document.contains !== 'function') {
...
@@ -2047,4 +2135,4 @@ if (typeof document.contains !== 'function') {
bootstrap
();
bootstrap
();
}(
document
,
window
,
RSVP
,
DOMParser
,
Channel
,
MutationObserver
,
Node
,
}(
document
,
window
,
RSVP
,
DOMParser
,
Channel
,
MutationObserver
,
Node
,
FileReader
,
Blob
));
FileReader
,
Blob
,
navigator
,
Event
));
\ No newline at end of file
\ No newline at end of file
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_renderjs_js.xml
View file @
5cf3d2e6
...
@@ -230,7 +230,7 @@
...
@@ -230,7 +230,7 @@
</item>
</item>
<item>
<item>
<key>
<string>
serial
</string>
</key>
<key>
<string>
serial
</string>
</key>
<value>
<string>
95
1.36791.31778.27426
</string>
</value>
<value>
<string>
95
2.32884.7041.46523
</string>
</value>
</item>
</item>
<item>
<item>
<key>
<string>
state
</string>
</key>
<key>
<string>
state
</string>
</key>
...
@@ -248,7 +248,7 @@
...
@@ -248,7 +248,7 @@
</tuple>
</tuple>
<state>
<state>
<tuple>
<tuple>
<float>
146
4706675.31
</float>
<float>
146
9783555.9
</float>
<string>
UTC
</string>
<string>
UTC
</string>
</tuple>
</tuple>
</state>
</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