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
c728d0a8
Commit
c728d0a8
authored
Jun 15, 2016
by
Cédric Le Ninivin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
erp5_xhtml_style: Update RenderJS to 0.8.2
parent
60674e0e
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
104 additions
and
79 deletions
+104
-79
product/ERP5/bootstrap/erp5_xhtml_style/SkinTemplateItem/portal_skins/erp5_xhtml_style/renderjs.js.js
...TemplateItem/portal_skins/erp5_xhtml_style/renderjs.js.js
+96
-79
product/ERP5/bootstrap/erp5_xhtml_style/SkinTemplateItem/portal_skins/erp5_xhtml_style/renderjs.js.xml
...emplateItem/portal_skins/erp5_xhtml_style/renderjs.js.xml
+8
-0
No files found.
product/ERP5/bootstrap/erp5_xhtml_style/SkinTemplateItem/portal_skins/erp5_xhtml_style/renderjs.js.js
View file @
c728d0a8
...
@@ -1687,7 +1687,11 @@ if (typeof document.contains !== 'function') {
...
@@ -1687,7 +1687,11 @@ if (typeof document.contains !== 'function') {
notifyDeclareMethod
,
notifyDeclareMethod
,
gadget_ready
=
false
,
gadget_ready
=
false
,
iframe_top_gadget
,
iframe_top_gadget
,
last_acquisition_gadget
;
last_acquisition_gadget
,
declare_method_list_waiting
=
[],
gadget_failed
=
false
,
gadget_error
,
connection_ready
=
false
;
// Create the gadget class for the current url
// Create the gadget class for the current url
if
(
gadget_model_dict
.
hasOwnProperty
(
url
))
{
if
(
gadget_model_dict
.
hasOwnProperty
(
url
))
{
...
@@ -1746,28 +1750,45 @@ if (typeof document.contains !== 'function') {
...
@@ -1746,28 +1750,45 @@ if (typeof document.contains !== 'function') {
setAqParent
(
root_gadget
,
last_acquisition_gadget
);
setAqParent
(
root_gadget
,
last_acquisition_gadget
);
}
else
{
}
else
{
// Create the communication channel
embedded_channel
=
Channel
.
build
({
window
:
window
.
parent
,
origin
:
"
*
"
,
scope
:
"
renderJS
"
});
// Create the root gadget instance and put it in the loading stack
// Create the root gadget instance and put it in the loading stack
tmp_constructor
=
RenderJSEmbeddedGadget
;
tmp_constructor
=
RenderJSEmbeddedGadget
;
tmp_constructor
.
__ready_list
=
RenderJSGadget
.
__ready_list
.
slice
();
tmp_constructor
.
__ready_list
=
RenderJSGadget
.
__ready_list
.
slice
();
tmp_constructor
.
__service_list
=
RenderJSGadget
.
__service_list
.
slice
();
tmp_constructor
.
__service_list
=
RenderJSGadget
.
__service_list
.
slice
();
tmp_constructor
.
prototype
.
__path
=
url
;
tmp_constructor
.
prototype
.
__path
=
url
;
root_gadget
=
new
RenderJSEmbeddedGadget
();
root_gadget
=
new
RenderJSEmbeddedGadget
();
setAqParent
(
root_gadget
,
last_acquisition_gadget
);
// Create the communication channel
// Notify parent about gadget instanciation
embedded_channel
=
Channel
.
build
({
notifyReady
=
function
()
{
window
:
window
.
parent
,
if
((
declare_method_count
===
0
)
&&
(
gadget_ready
===
true
))
{
origin
:
"
*
"
,
embedded_channel
.
notify
({
method
:
"
ready
"
});
scope
:
"
renderJS
"
,
}
onReady
:
function
()
{
var
k
;
iframe_top_gadget
=
false
;
//Default: Define __aq_parent to inform parent window
root_gadget
.
__aq_parent
=
tmp_constructor
.
prototype
.
__aq_parent
=
function
(
method_name
,
argument_list
,
time_out
)
{
return
new
RSVP
.
Promise
(
function
(
resolve
,
reject
)
{
embedded_channel
.
call
({
method
:
"
acquire
"
,
params
:
[
method_name
,
argument_list
],
success
:
function
(
s
)
{
resolve
(
s
);
},
error
:
function
(
e
)
{
reject
(
e
);
},
timeout
:
time_out
});
});
};
};
// Inform parent gadget about declareMethod calls here.
// Channel is ready, so now declare Function
notifyDeclareMethod
=
function
(
name
)
{
notifyDeclareMethod
=
function
(
name
)
{
declare_method_count
+=
1
;
declare_method_count
+=
1
;
embedded_channel
.
call
({
embedded_channel
.
call
({
...
@@ -1782,6 +1803,56 @@ if (typeof document.contains !== 'function') {
...
@@ -1782,6 +1803,56 @@ if (typeof document.contains !== 'function') {
}
}
});
});
};
};
for
(
k
=
0
;
k
<
declare_method_list_waiting
.
length
;
k
+=
1
)
{
notifyDeclareMethod
(
declare_method_list_waiting
[
k
]);
}
declare_method_list_waiting
=
[];
// If Gadget Failed Notify Parent
if
(
gadget_failed
)
{
embedded_channel
.
notify
({
method
:
"
failed
"
,
params
:
gadget_error
});
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
//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
);
});
})
.
fail
(
function
(
error
)
{
throw
error
;
});
}
});
// Notify parent about gadget instanciation
notifyReady
=
function
()
{
if
((
declare_method_count
===
0
)
&&
(
gadget_ready
===
true
))
{
embedded_channel
.
notify
({
method
:
"
ready
"
});
}
};
// Inform parent gadget about declareMethod calls here.
notifyDeclareMethod
=
function
(
name
)
{
declare_method_list_waiting
.
push
(
name
);
};
notifyDeclareMethod
(
"
getInterfaceList
"
);
notifyDeclareMethod
(
"
getInterfaceList
"
);
notifyDeclareMethod
(
"
getRequiredCSSList
"
);
notifyDeclareMethod
(
"
getRequiredCSSList
"
);
...
@@ -1806,26 +1877,7 @@ if (typeof document.contains !== 'function') {
...
@@ -1806,26 +1877,7 @@ if (typeof document.contains !== 'function') {
tmp_constructor
.
allowPublicAcquisition
=
tmp_constructor
.
allowPublicAcquisition
=
RenderJSGadget
.
allowPublicAcquisition
;
RenderJSGadget
.
allowPublicAcquisition
;
//Default: Define __aq_parent to inform parent window
iframe_top_gadget
=
true
;
tmp_constructor
.
prototype
.
__aq_parent
=
function
(
method_name
,
argument_list
,
time_out
)
{
return
new
RSVP
.
Promise
(
function
(
resolve
,
reject
)
{
embedded_channel
.
call
({
method
:
"
acquire
"
,
params
:
[
method_name
,
argument_list
],
success
:
function
(
s
)
{
resolve
(
s
);
},
error
:
function
(
e
)
{
reject
(
e
);
},
timeout
:
time_out
});
});
};
}
}
tmp_constructor
.
prototype
.
__acquired_method_dict
=
{};
tmp_constructor
.
prototype
.
__acquired_method_dict
=
{};
...
@@ -1950,45 +2002,6 @@ if (typeof document.contains !== 'function') {
...
@@ -1950,45 +2002,6 @@ if (typeof document.contains !== 'function') {
return
root_gadget
;
return
root_gadget
;
}
}
if
(
window
.
top
!==
window
.
self
)
{
//checking channel should be done before sub gadget's declaration
//__ready_list:
//0: clearGadgetInternalParameters
//1: loadSubGadgetDOMDeclaration
//.....
tmp_constructor
.
__ready_list
.
splice
(
1
,
0
,
function
()
{
return
root_gadget
.
__aq_parent
(
'
getTopURL
'
,
[],
100
)
.
then
(
function
(
topURL
)
{
var
base
=
document
.
createElement
(
'
base
'
);
base
.
href
=
topURL
;
base
.
target
=
"
_top
"
;
document
.
head
.
appendChild
(
base
);
//the channel is ok
//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
);
});
})
.
fail
(
function
(
error
)
{
if
(
error
===
"
timeout_error
"
)
{
//the channel fail
//we consider current gadget is parent gadget
//redifine last acquisition gadget
iframe_top_gadget
=
true
;
setAqParent
(
root_gadget
,
last_acquisition_gadget
);
}
else
{
throw
error
;
}
});
});
}
tmp_constructor
.
ready
(
function
(
g
)
{
tmp_constructor
.
ready
(
function
(
g
)
{
return
startService
(
g
);
return
startService
(
g
);
});
});
...
@@ -2013,11 +2026,15 @@ if (typeof document.contains !== 'function') {
...
@@ -2013,11 +2026,15 @@ if (typeof document.contains !== 'function') {
loading_gadget_promise
loading_gadget_promise
.
then
(
function
()
{
.
then
(
function
()
{
gadget_ready
=
true
;
gadget_ready
=
true
;
if
(
connection_ready
)
{
notifyReady
();
notifyReady
();
}
})
})
.
fail
(
function
(
e
)
{
.
fail
(
function
(
e
)
{
//top gadget in iframe
//top gadget in iframe
if
(
iframe_top_gadget
)
{
if
(
iframe_top_gadget
)
{
gadget_failed
=
true
;
gadget_error
=
e
.
toString
();
letsCrash
(
e
);
letsCrash
(
e
);
}
else
{
}
else
{
embedded_channel
.
notify
({
method
:
"
failed
"
,
params
:
e
.
toString
()});
embedded_channel
.
notify
({
method
:
"
failed
"
,
params
:
e
.
toString
()});
...
...
product/ERP5/bootstrap/erp5_xhtml_style/SkinTemplateItem/portal_skins/erp5_xhtml_style/renderjs.js.xml
View file @
c728d0a8
...
@@ -10,6 +10,10 @@
...
@@ -10,6 +10,10 @@
<key>
<string>
_Cacheable__manager_id
</string>
</key>
<key>
<string>
_Cacheable__manager_id
</string>
</key>
<value>
<string>
http_cache
</string>
</value>
<value>
<string>
http_cache
</string>
</value>
</item>
</item>
<item>
<key>
<string>
_EtagSupport__etag
</string>
</key>
<value>
<string>
ts65978087.08
</string>
</value>
</item>
<item>
<item>
<key>
<string>
__name__
</string>
</key>
<key>
<string>
__name__
</string>
</key>
<value>
<string>
renderjs.js
</string>
</value>
<value>
<string>
renderjs.js
</string>
</value>
...
@@ -22,6 +26,10 @@
...
@@ -22,6 +26,10 @@
<key>
<string>
precondition
</string>
</key>
<key>
<string>
precondition
</string>
</key>
<value>
<string></string>
</value>
<value>
<string></string>
</value>
</item>
</item>
<item>
<key>
<string>
size
</string>
</key>
<value>
<int>
77916
</int>
</value>
</item>
<item>
<item>
<key>
<string>
title
</string>
</key>
<key>
<string>
title
</string>
</key>
<value>
<string></string>
</value>
<value>
<string></string>
</value>
...
...
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