-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathLoader.aspx
105 lines (78 loc) · 2.86 KB
/
Loader.aspx
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
92
93
94
95
96
97
98
99
100
101
102
103
104
105
<%@ Page Title="" Language="C#" MasterPageFile="~/_master/Loader.Master" AutoEventWireup="true" %>
<%--<%@ OutputCache Duration="3600000" VaryByCustom="l" VaryByParam="title,url,l" %>
title is not changed when cached.
--%>
<%@ Register Assembly="nilnul._web_._CTR_" Namespace="nilnul._web_._CTR_.enCn_" TagPrefix="cc1" %>
<asp:Content ID="Content11" ContentPlaceHolderID="titleContent" runat="server">
<%=Request.QueryString["title4weixin"]??Request.QueryString["title"]??(""+(Request.QueryString["url"]??"Nilnul")) %>
</asp:Content>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
<div id="dock" runat="server">
<cc1:enCn__PerModule ID="EnCn__PerModule1" runat="server">
<asp:View ID="View1" runat="server">Loading Contents, please wait...<br />If the loading is not completed in a long time, please contact us.</asp:View>
<asp:View ID="View2" runat="server">正在加载内容,请等待...<br />如果长时间没有加载完成,请联系网站维护人员</asp:View>
</cc1:enCn__PerModule>
</div>
<%-- the script takes in the clientId; that is an old way to do the job; --%>
<script>
(function (dock) {
//get the ascx url
$dock = $(dock);
var url = nilnul.queryString("url");
if (typeof (url) == "undefined" || url === null || url === "") {
$(dock).text("url?不存在的!");
return;
}
$(dock).text("nilnul.express正渲染文档格式:" + url + " ...");
$.ready(
$(dock).load(
url,
<%--{},--%>
function (response, status, xhr) {
if (status === "error") {
var msg = "加载出现了错误:";
$(dock).html(msg + xhr.status + " " + xhr.statusText + "<hr/>" + response);
}
else {
var article;
if (
$dock.contents().filter(
function (i, e) {
return this.nodeType === Node.ELEMENT_NODE;
}
).length === 1
) {
var $txts = $dock.contents().filter(
function (i, e) {
return this.nodeType === Node.TEXT_NODE
}
);
if (
$txts.length === $dock.contents().length - 1
) {
if (
Array.prototype.every.call(
$txts, function (c) {
return nilnul.txt.nulable.be_.nulOrWhite(c.nodeValue)
}
)
) {
article = dock.firstElementChild;
}
}
}
<%--MathJax.Hub.Queue(["Typeset", MathJax.Hub, dock]);--%>
nilnul.express.compose(
article||dock,1
);
}
}
)
);
})(
document.getElementById("<%=dock.ClientID%>")
);
</script>
</asp:Content>