forked from oyvindkinsey/easyXDM
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added support for relative paths to hash.html. Removed the version string when referencing hash.html. The developer should use different names to differentiate between versions.
- Loading branch information
1 parent
17eb625
commit 9e0e9d6
Showing
13 changed files
with
214 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
artifacts/ | ||
build/ | ||
dist/ | ||
docs/ | ||
|
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
{ | ||
"glossary": { | ||
"title": "example glossary", | ||
"GlossDiv": { | ||
"title": "S", | ||
"GlossList": { | ||
"GlossEntry": { | ||
"ID": "SGML", | ||
"SortAs": "SGML", | ||
"GlossTerm": "Standard Generalized Markup Language", | ||
"Acronym": "SGML", | ||
"Abbrev": "ISO 8879:1986", | ||
"GlossDef": { | ||
"para": "A meta-markup language, used to create markup languages such as DocBook.", | ||
"GlossSeeAlso": ["GML", "XML"] | ||
}, | ||
"GlossSee": "markup" | ||
} | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,84 @@ | ||
<!doctype html> | ||
<html> | ||
<head> | ||
<title>easyXDM</title> | ||
<script type="text/javascript" src="../easyXDM.debug.js"> | ||
</script> | ||
<script type="text/javascript"> | ||
/** | ||
* Request the use of the JSON object | ||
*/ | ||
easyXDM.DomHelper.requiresJSON("../json2.js"); | ||
</script> | ||
<script type="text/javascript"> | ||
var remote; | ||
window.onload = function(){ | ||
/** | ||
* When the window is finished loading start setting up the interface | ||
*/ | ||
remote = new easyXDM.Interface(/** The channel configuration */{ | ||
/** | ||
* Register the url to hash.html, this must be an absolute path | ||
* or a path relative to the root. | ||
* @field | ||
*/ | ||
local: "../hash.html", | ||
/** | ||
* Register the url to the remote interface | ||
* @field | ||
*/ | ||
remote: "http://provider.easyxdm.net/example/xhr_remote.html", | ||
/** | ||
* Register the DOMElement that the generated IFrame should be inserted into | ||
*/ | ||
container: document.getElementById("embedded") | ||
}, /** The interface configuration */ { | ||
remote: { | ||
getGlossary: {}, | ||
ajax: {} | ||
} | ||
},/**The onReady handler*/ function(){ | ||
|
||
|
||
}); | ||
} | ||
function getGlossary(){ | ||
remote.getGlossary(function(json){ | ||
alert(json.glossary.title); | ||
}); | ||
} | ||
|
||
function getGlossaryUsingAjax(){ | ||
remote.ajax("glossary.json", { | ||
name: "sometitle" | ||
}, function(json){ | ||
alert(json.glossary.title); | ||
}); | ||
} | ||
</script> | ||
<style type="text/css"> | ||
#embedded { | ||
height: 200px; | ||
} #embedded iframe { | ||
width: 100%; | ||
height: 100%; | ||
} | ||
</style> | ||
</head> | ||
<body> | ||
<script type="text/javascript"> | ||
document.write("Domain: " + location.host); | ||
</script> | ||
<!-- easyXDM.Debug.trace(msg) will output its messages to any element with the id "log" --> | ||
<div id="log" style="height:100px;border:1px dotted black;overflow:auto"> | ||
</div> | ||
<div id="embedded"> | ||
</div> | ||
<div> | ||
<input type="button" onclick="getGlossary()" value="Call getGlossary using the exposed method"/> | ||
<br/> | ||
<input type="button" onclick="getGlossaryUsingAjax()" value="Call getGlossary using the exposed ajax wraper"/> | ||
|
||
</div> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
<!doctype html> | ||
<html> | ||
<head> | ||
<title>easyXDM</title> | ||
<script type="text/javascript" src="../easyXDM.debug.js"> | ||
</script> | ||
<script type="text/javascript"> | ||
/** | ||
* Request the use of the JSON object | ||
*/ | ||
easyXDM.DomHelper.requiresJSON("../json2.js"); | ||
</script> | ||
<script type="text/javascript" src="../jquery-1.3.2.min.js"> | ||
</script> | ||
<script type="text/javascript"> | ||
|
||
var remote; | ||
/** | ||
* When the window is finished loading start setting up the channel | ||
*/ | ||
window.onload = function(){ | ||
|
||
/** | ||
* When the channel is ready we create the interface | ||
*/ | ||
remote = new easyXDM.Interface(/** The channel configuration*/{}, /** The configuration */ { | ||
local: { | ||
getGlossary: { | ||
isAsync: true, | ||
method: function(fn){ | ||
$.get('glossary.json', null, function(json){ | ||
fn(json); | ||
}, "json"); | ||
} | ||
}, | ||
/** | ||
* This method will in effect give access to all json services on the domain | ||
* @param {String} url the url to the service | ||
* @param {Object} data Name/value pairs | ||
* @param {Function} callback The callback | ||
*/ | ||
ajax: { | ||
isAsync: true, | ||
method: function(url, data, callback){ | ||
$.get(url, data, function(json){ | ||
callback(json); | ||
}, "json"); | ||
} | ||
} | ||
} | ||
}); | ||
} | ||
</script> | ||
</head> | ||
<body> | ||
<script type="text/javascript"> | ||
document.write("Domain: " + location.host); | ||
</script> | ||
<!-- easyXDM.Debug.trace(msg) will output its messages to any element with the id "log" --> | ||
<div id="log" style="height:100px;border:1px dotted black;overflow:auto"> | ||
</div> | ||
</body> | ||
</html> |
Large diffs are not rendered by default.
Oops, something went wrong.