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
Titouan Soulard
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
Show 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') {
* http://www.renderjs.org/documentation
*/
(
function
(
document
,
window
,
RSVP
,
DOMParser
,
Channel
,
MutationObserver
,
Node
,
FileReader
,
Blob
)
{
Node
,
FileReader
,
Blob
,
navigator
,
Event
)
{
"
use strict
"
;
function
readBlobAsDataURL
(
blob
)
{
...
...
@@ -737,7 +737,19 @@ if (typeof document.contains !== 'function') {
renderJS
,
Monitor
,
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
...
...
@@ -751,23 +763,107 @@ if (typeof document.contains !== 'function') {
}
function
letsCrash
(
e
)
{
if
(
e
.
constructor
===
XMLHttpRequest
)
{
e
=
{
readyState
:
e
.
readyState
,
status
:
e
.
status
,
statusText
:
e
.
statusText
,
response_headers
:
e
.
getAllResponseHeaders
()
var
i
,
body
,
container
,
paragraph
,
link
,
error
;
if
(
is_page_unloaded
)
{
/*global console*/
console
.
info
(
'
-- Error dropped, as page is unloaded
'
);
console
.
info
(
e
);
return
;
}
error_list
.
push
(
e
);
// Add error handling stack
error_list
.
push
(
new
Error
(
'
stopping renderJS
'
));
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
(
e
.
constructor
===
Array
||
e
.
constructor
===
String
||
e
.
constructor
===
Object
)
{
}
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
{
e
=
JSON
.
stringify
(
e
);
error
=
JSON
.
stringify
(
error
);
}
catch
(
ignore
)
{
}
}
document
.
getElementsByTagName
(
'
body
'
)[
0
].
textContent
=
e
;
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
);
}
// XXX Do not crash the application if it fails
// Where to write the error?
/*global console*/
...
...
@@ -1273,7 +1369,13 @@ if (typeof document.contains !== 'function') {
iframe_loading_deferred
.
promise
,
// Timeout to prevent non renderJS embeddable gadget
// 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') {
last_acquisition_gadget
=
new
RenderJSGadget
();
last_acquisition_gadget
.
__acquired_method_dict
=
{
getTopURL
:
function
()
{
return
url
;
},
reportServiceError
:
function
(
param_list
)
{
letsCrash
(
param_list
[
0
]);
}
...
...
@@ -1815,13 +1914,6 @@ if (typeof document.contains !== 'function') {
});
return
;
}
// Get Top URL
return
tmp_constructor
.
prototype
.
__aq_parent
(
'
getTopURL
'
,
[])
.
then
(
function
(
topURL
)
{
var
base
=
document
.
createElement
(
'
base
'
);
base
.
href
=
topURL
;
base
.
target
=
"
_top
"
;
document
.
head
.
appendChild
(
base
);
connection_ready
=
true
;
notifyReady
();
//the channel is ok
...
...
@@ -1835,10 +1927,6 @@ if (typeof document.contains !== 'function') {
});
trans
.
delayReturn
(
true
);
});
})
.
fail
(
function
(
error
)
{
throw
error
;
});
}
});
...
...
@@ -2047,4 +2135,4 @@ if (typeof document.contains !== 'function') {
bootstrap
();
}(
document
,
window
,
RSVP
,
DOMParser
,
Channel
,
MutationObserver
,
Node
,
FileReader
,
Blob
));
\ No newline at end of file
FileReader
,
Blob
,
navigator
,
Event
));
\ 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 @@
</item>
<item>
<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>
<key>
<string>
state
</string>
</key>
...
...
@@ -248,7 +248,7 @@
</tuple>
<state>
<tuple>
<float>
146
4706675.31
</float>
<float>
146
9783555.9
</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