<!DOCTYPE html>
<html>
<head>
<script type="text/javascript" src="http://api.webfan.de/api-d/4/js-api/library.js"></script>
<script type="text/javascript" src="http://frdl.webfan.de/cdn/frdl/flow/components/frdl/intent/webintents.js"></script>
<script type="text/javascript" src="http://webfan.de/cdn/frdl/flow/components/webfan/webfat/js/intents.js"></script>
</head>
<body>
<b>TestMock service...</b>
<script type="text/javascript">
/*
var attachEventListener = function(obj, type, func, capture) {
var objs = obj instanceof Array || obj instanceof NodeList ? obj : [obj];
for(var i in objs) {
if(!!objs[i].addEventListener) {
objs[i].addEventListener(type, func, capture);
}
else if(!!objs[i].attachEvent) {
objs[i].attachEvent("on" + type, func);
}
}
};
attachEventListener(window, "message", function(ev) {
if(!intent)return;
intent.postResult("Test result from service");
window.opener.focus();
setTimeout(function(){
alert('Resolved testIntent (response was posted back to client): ' + JSON.stringify(intent) + ' EventData: '+ JSON.stringify(ev.data) + ' Event: '+ JSON.stringify(ev));
window.close();
},1500);
}, false);
*/
setTimeout(function(){
frdl.when(function(){
return ( 'undefined'!==typeof frdl.frdl$intentService);
},
function(){
frdl.frdl$intentService.register('text/uri-list', 'com.webfan.intents.test',
function(_intent,config,appData){
var r = {
code : 200,
replyTo : _intent._id,
message : 'Testantwort',
error : null,
data : {
message : 'Testantwort'
}
};
return r;
},
function(){
console.log('initFn') ;
},
{}, {})
.run()
;
},
{},
function(_intent){console.log('Failed to register action server');},
1);
},10000);
</script>
<!-- -->
<!--
<intent
action="http://webintents.org/shorten"
type="text/uri-list"
href="http://examples.webintents.org/intents/shorten/shorten_action.html"
title="Kinlan's Link Shortener" />
attachEventListener(window, "load", function() {
var output = document.getElementById("output");
setText(output, intent.data);
intent.postResult("http://kin.ly/A");
}, false);
http://examples.webintents.org/intents/shorten/shorten_action.html
window.navigator.startActivity(new Intent(
"http://webintents.org/shorten",
"text/uri-list",
'http://example.com'),
function (data) {
alert(data);
});
-->
</body>
</html>
|