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
Show 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 @@
...
@@ -568,23 +568,19 @@
"
type
"
:
"
reply
"
,
"
type
"
:
"
reply
"
,
"
result
"
:
event
.
data
.
result
,
"
result
"
:
event
.
data
.
result
,
"
callback
"
:
event
.
data
.
callbackId
,
"
callback
"
:
event
.
data
.
callbackId
,
},
window
.
location
.
href
.
split
(
"
?
"
)[
0
]
);
},
event
.
origin
);
};
};
// => run a service and post the result
// => run a service and post the result
priv
.
runService
=
function
(
event
)
{
priv
.
runService
=
function
(
event
)
{
var
result
=
window
[
event
.
data
.
service
].
apply
(
this
,
event
.
data
.
parameters
),
var
result
=
window
[
event
.
data
.
service
].
apply
(
this
,
event
.
data
.
parameters
);
foreign
=
priv
.
isForeignUrl
(
event
.
origin
);
window
.
top
.
postMessage
({
window
.
top
.
postMessage
({
"
type
"
:
"
result
"
,
"
type
"
:
"
result
"
,
"
result
"
:
result
,
"
result
"
:
result
,
"
trackingId
"
:
event
.
data
.
trackingId
,
"
trackingId
"
:
event
.
data
.
trackingId
,
"
callbackId
"
:
event
.
data
.
callbackId
,
"
callbackId
"
:
event
.
data
.
callbackId
,
// "*" is not recommended, but when using localhost, this seems
},
event
.
origin
);
// 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
]);
};
};
// => request a service provided by a gadget
// => request a service provided by a gadget
...
@@ -594,8 +590,7 @@
...
@@ -594,8 +590,7 @@
event
.
data
.
type
.
split
(
"
/
"
)[
1
]
event
.
data
.
type
.
split
(
"
/
"
)[
1
]
),
),
selector
,
selector
,
targetWindow
,
targetWindow
;
foreign
;
if
(
callService
)
{
if
(
callService
)
{
// services are stored by URL (not id), so we need to find the service
// services are stored by URL (not id), so we need to find the service
...
@@ -620,7 +615,6 @@
...
@@ -620,7 +615,6 @@
if
(
selector
.
length
===
0
)
{
if
(
selector
.
length
===
0
)
{
targetWindow
=
window
;
targetWindow
=
window
;
}
else
{
}
else
{
foreign
=
selector
[
selector
.
length
-
1
][
1
];
try
{
try
{
targetWindow
=
selector
.
reduce
(
function
(
tgt
,
o
)
{
targetWindow
=
selector
.
reduce
(
function
(
tgt
,
o
)
{
return
tgt
&&
o
[
1
]
?
return
tgt
&&
o
[
1
]
?
...
@@ -639,10 +633,7 @@
...
@@ -639,10 +633,7 @@
"
callbackId
"
:
event
.
data
.
callbackId
,
"
callbackId
"
:
event
.
data
.
callbackId
,
"
service
"
:
event
.
data
.
service
,
"
service
"
:
event
.
data
.
service
,
"
parameters
"
:
event
.
data
.
parameters
"
parameters
"
:
event
.
data
.
parameters
// "*" is not recommended, but when using localhost, this seems
},
event
.
origin
);
// 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
);
}
}
};
};
...
...
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