Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
renderjs
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
nexedi
renderjs
Commits
f759db1d
Commit
f759db1d
authored
Jun 03, 2013
by
Sven Franck
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
replaced sender domain with sending domain in postMessage
parent
1f0e5ce0
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
14 deletions
+5
-14
renderjs.js
renderjs.js
+5
-14
No files found.
renderjs.js
View file @
f759db1d
...
...
@@ -568,23 +568,19 @@
"
type
"
:
"
reply
"
,
"
result
"
:
event
.
data
.
result
,
"
callback
"
:
event
.
data
.
callbackId
,
},
window
.
location
.
href
.
split
(
"
?
"
)[
0
]
);
},
event
.
origin
);
};
// => run a service and post the result
priv
.
runService
=
function
(
event
)
{
var
result
=
window
[
event
.
data
.
service
].
apply
(
this
,
event
.
data
.
parameters
),
foreign
=
priv
.
isForeignUrl
(
event
.
origin
);
var
result
=
window
[
event
.
data
.
service
].
apply
(
this
,
event
.
data
.
parameters
);
window
.
top
.
postMessage
({
"
type
"
:
"
result
"
,
"
result
"
:
result
,
"
trackingId
"
:
event
.
data
.
trackingId
,
"
callbackId
"
:
event
.
data
.
callbackId
,
// "*" is not recommended, but when using localhost, this seems
// to be the only way to get the message to domain1...?
// make sure this works with window.location.href in production
},
foreign
?
"
*
"
:
window
.
location
.
href
.
split
(
"
?
"
)[
0
]);
},
event
.
origin
);
};
// => request a service provided by a gadget
...
...
@@ -594,8 +590,7 @@
event
.
data
.
type
.
split
(
"
/
"
)[
1
]
),
selector
,
targetWindow
,
foreign
;
targetWindow
;
if
(
callService
)
{
// services are stored by URL (not id), so we need to find the service
...
...
@@ -620,7 +615,6 @@
if
(
selector
.
length
===
0
)
{
targetWindow
=
window
;
}
else
{
foreign
=
selector
[
selector
.
length
-
1
][
1
];
try
{
targetWindow
=
selector
.
reduce
(
function
(
tgt
,
o
)
{
return
tgt
&&
o
[
1
]
?
...
...
@@ -639,10 +633,7 @@
"
callbackId
"
:
event
.
data
.
callbackId
,
"
service
"
:
event
.
data
.
service
,
"
parameters
"
:
event
.
data
.
parameters
// "*" is not recommended, but when using localhost, this seems
// to be the only way to get the message to domain1...?
// make sure this works with window.location.href in production
},
foreign
?
"
*
"
:
window
.
location
.
href
);
},
event
.
origin
);
}
};
...
...
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