-
Notifications
You must be signed in to change notification settings - Fork 0
/
Default_CSH.htm
91 lines (72 loc) · 2.61 KB
/
Default_CSH.htm
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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
<!DOCTYPE html>
<html data-mc-runtime-file-type="CSH">
<head>
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta charset="utf-8" /><title></title>
<script src="Resources/Scripts/jquery.min.js">
</script>
<script src="Resources/Scripts/MadCapAll.js" defer="defer">
</script>
<script>
//<![CDATA[
$(Init);
function Init()
{
var cshid = null;
var skinName = null;
var searchQuery = null;
var firstPick = null;
if (document.location.hash.length > 0)
{
var hash = document.location.hash.substring(1);
var parts = hash.split("|");
cshid = parts[0];
if (parts.length == 2)
skinName = parts[1];
}
if (document.location.search.length > 0)
{
var search = document.location.search.substring(1);
var parts = search.split("|");
searchQuery = parts[0];
if (parts.length == 2)
firstPick = parts[1];
}
var url = new MadCap.Utilities.Url(document.location.href);
var urlName = url.Name.substring(0, url.Name.length - "_CSH".length);
url = url.ToFolder().AddFile(urlName + "." + url.Extension);
var path = url.PlainPath;
var isFirst = true;
if (!MadCap.String.IsNullOrEmpty(cshid))
{
if (isFirst)
path += "#";
isFirst = false;
path += "cshid=" + cshid;
}
if (!MadCap.String.IsNullOrEmpty(skinName)) {
if (isFirst)
path += "#";
else
path += "&";
isFirst = false;
path += "skinName=" + skinName;
}
if (!MadCap.String.IsNullOrEmpty(searchQuery))
{
if (isFirst)
path += "#";
else
path += "&";
path += "searchQuery=" + searchQuery;
if (!MadCap.String.IsNullOrEmpty(firstPick))
path += "&firstPick=true";
}
document.location.replace(MadCap.Utilities.Url.EnsureUrlSafety(path));
}
//]]></script>
</head>
<body>
</body>
</html>