-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
77 lines (67 loc) · 2.97 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Index</title>
<script src="js/jquery-1.6.2.min.js"></script>
<script src="js/base64.js"></script>
<script src="js/config.js"></script>
<script type="text/javascript">
/*
* Make JSON safe for IE6
* https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/JSON#Browser_compatibility
*/
if (!window.JSON) {
window.JSON = {
parse: function (sJSON) {
/*jslint evil: true */
return eval("(" + sJSON + ")");
},
stringify: function (vContent) {
var sOutput = "",
nId,
sProp
;
if (vContent instanceof Object) {
if (vContent.constructor === Array) {
for (nId = 0; nId < vContent.length; nId += 1) {
sOutput += this.stringify(vContent[nId]) + ",";
}
return "[" + sOutput.substr(0, sOutput.length - 1) + "]";
}
if (vContent.toString !== Object.prototype.toString) { return "\"" + vContent.toString().replace(/"/g, "\\$&") + "\""; }
for (sProp in vContent) {
if (vContent.hasOwnProperty(sProp)) {
sOutput += "\"" + sProp.replace(/"/g, "\\$&") + "\":" + this.stringify(vContent[sProp]) + ",";
}
}
return "{" + sOutput.substr(0, sOutput.length - 1) + "}";
}
return typeof vContent === "string" ? "\"" + vContent.replace(/"/g, "\\$&") + "\"" : String(vContent);
}
};
}
$(document).ready(function(){
var PROTOTYPE_SHOW_CONFIG_INFO = true;
var PROTOTYPE_DEFAULT_NAME = Config.actor.name[0];
var PROTOTYPE_DEFAULT_MBOX = Config.actor.mbox[0];
var PROTOTYPE_ENDPOINT = Config.endpoint;
var PROTOTYPE_AUTH = 'Basic ' + Base64.encode(Config.authUser + ':' + Config.authPassword);
$('#test').click(function(){
var actor = Config.actor;
var em = actor.mbox[0];
var mbox = (em.indexOf('mailto:') == 0) ? em : 'mailto:' + em;
actor.mbox = [mbox];
$(this).attr('href',$(this).attr('baseref')
+ "endpoint=" + encodeURIComponent(PROTOTYPE_ENDPOINT)
+ "&auth=" + encodeURIComponent(PROTOTYPE_AUTH)
+ "&actor=" +encodeURIComponent(JSON.stringify(actor)));
return true;
});
});
</script>
</head>
<body>
<a id="test" href="" target="_blank" baseref="testing.html?">Star!</a>
</body>
</html>