Page Menu
Home
Code
Search
Configure Global Search
Log In
Files
F947787
xip_client.html
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
2 KB
Subscribers
None
xip_client.html
View Options
<!--
/*
Copyright (c) 2004-2008, The Dojo Foundation
All Rights Reserved.
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
http://dojotoolkit.org/community/licensing.shtml
*/
-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<
html
xmlns
=
"http://www.w3.org/1999/xhtml"
xml:lang
=
"en"
lang
=
"en"
>
<
head
>
<
title
></
title
>
<
meta
http-equiv
=
"Content-Type"
content
=
"text/html; charset=utf-8"
></
meta
>
<!-- Security protection: uncomment the start and end script tags to enable. -->
<!-- script type="text/javascript" -->
//
<!--
function pollHash(){
//Can't use location.hash because at least Firefox does a decodeURIComponent on it.
var urlParts = window.location.href.split("#");
if(urlParts.length == 2){
var newHash = urlParts[1];
if(newHash != xipCurrentHash){
try{
callMaster(xipStateId, newHash);
}catch(e){
//Make sure to not keep processing the error hash value.
xipCurrentHash = newHash;
throw e;
}
xipCurrentHash = newHash;
}
}
}
function unpackMessage(encodedMessage){
var parts = encodedMessage.split(":");
var command = parts[1];
encodedMessage = parts[2] || "";
var config = null;
if(command == "init"){
var configParts = encodedMessage.split("&");
config = {};
for(var i = 0; i < configParts.length; i++){
var nameValue = configParts[i].split("=");
config[decodeURIComponent(nameValue[0])] = decodeURIComponent(nameValue[1]);
}
}
return {command: command, message: encodedMessage, config: config};
}
//************** Init **************************
xipCurrentHash = "";
//Decode the init params
var fragId = window.location.href.split("#")[1];
var config = unpackMessage(fragId).config;
xipStateId = config.id;
xipMasterFrame = parent.parent;
//Set up an HTML5 messaging publisher if postMessage exists.
//As of this writing, this is only useful to get Opera 9.25+ to work.
if(typeof document.postMessage != "undefined"){
callMaster = function(stateId, message){
xipMasterFrame.document.postMessage(stateId + "#" + message);
}
}else{
var parts = config.callback.split(".");
xipCallbackObject = xipMasterFrame;
for(var i = 0; i < parts.length - 1; i++){
xipCallbackObject = xipCallbackObject[parts[i]];
}
xipCallback = parts[parts.length - 1];
callMaster = function(stateId, message){
xipCallbackObject[xipCallback](stateId + "#" + message);
}
}
//Call the master frame to let it know it is OK to start sending.
callMaster(xipStateId, "0:loaded");
//Start counter to inspect hash value.
setInterval(pollHash, 10);
// -->
<!-- </script> -->
</
head
>
<
body
>
<
h4
>
The Dojo Toolkit -- xip_client.html
</
h4
>
<
p
>
This file is used for Dojo's XMLHttpRequest Iframe Proxy. This is the "client" file used
internally by dojox.io.proxy.xip.
</
p
>
</
body
>
</
html
>
File Metadata
Details
Attached
Mime Type
text/html
Expires
Sat, Apr 26, 13:24 (1 d, 2 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
25130
Default Alt Text
xip_client.html (2 KB)
Attached To
rZED Zed
Event Timeline
Log In to Comment