<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="IndexGuide.aspx.cs" Inherits="PowerEasy.Module.General.WebSite.Admin.IndexGuide" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head id="Head1" runat="server">
    <title>预编译导航</title>
<style type="text/css"> 
body{ padding: 0; background-image: url(../Admin/Images/Guidebg.jpg);}
p { text-align:center; padding-top:10px;font-size:9pt;color:#660000;}
#msg { background: url(../Admin/Images/Guidekuang.png) no-repeat 0 0; width:665px; height:366px; margin:100px auto auto auto; vertical-align:middle;}
#msg h3 { padding:50px 50px 20px 50px; width:400px; margin:0 auto; font-size:14px; color:#e34120; line-height:24px;text-align:center;}
#msg h3 a{color:#FF0000; font-size:14px; text-decoration:none;font-weight:bold; }
.input_bt{text-align:center;background:url(../Admin/Images/bg08.png) no-repeat;border:none;height:32px;width:103px;line-height:32px; }
.input_bt_Over{text-align:center;background:url(../Admin/Images/bg11.png) no-repeat;border:none;height:32px;width:103px;line-height:32px;}
</style>
</head>
<script language="javascript" type="text/javascript">
    var ajax;
    window.onload=function() {
        var compilerlist = new Array(
    "Accessories/Author.aspx",
    "ADZone/ADGuide.aspx",
    "Analytics/CodeReference.aspx",
    "Blog/Blog.aspx",
    "Collection/CollectionFilter.aspx",
    "CommonModel/Field.aspx",
    "Configuration/Choiceset.aspx",
    "Contents/AddContentToNode.aspx",
    "Crm/AddIncome.aspx",
    "CustomForm/CustomForm.aspx",
    "Government/AdminNameList.aspx",
    "Profile/ChangeManage.aspx",
    "Promotion/Account.aspx",
    "QA/BatchAddQAPoint.aspx",
    "Recruitment/CareersGuide.aspx",
    "Search/SearchGuide.aspx",
    "ServiceCenter/EditQuestion.aspx",
    "Shop/AddProductToNode.aspx",
    "SiteGroup/ShareDataAdd.aspx",
    "SMS/SmsGuid.aspx",
    "Ssms/AdminNameList.aspx",
    "Statistics/SiteCount.aspx",
    "Survey/AnswerList.aspx",
    "Template/CodeSnippet.aspx",
    "User/AddIncome.aspx",
    "Vote/Vote.aspx",
    "Work/Work.aspx");
        var setW = 1;
        ajax = new Array(compilerlist.length);
        for (var i = 0; i < compilerlist.length; i++) {
            ajax[i] = $.ajax({
                type: "GET",
                cache: false,
                url: compilerlist[i],
                error: function(msg) {
                    $("#ProgressBar").css("width", (400 / compilerlist.length * setW) + "px");
                    setW++;
                    if (setW > compilerlist.length) {
                        finishcompiler();
                    }
                },
                success: function(xml) {
                    $("#ProgressBar").css("width", (400 / compilerlist.length * setW) + "px");
                    setW++;
                    if (setW > compilerlist.length) {
                        finishcompiler();
                    }
                }
            });
        }
    };

    function finishcompiler() {
        $.ajax({
            type: "POST",
            cache: false,
            url: '<%=BasePath%>ajax.aspx?HandlerName=AdminAjaxHandler',
            data: "<?xml version='1.0' encoding='utf-8'?><root><type>precompiled</type></root>",
            error: function(msg) {
                 window.location.href = 'index.aspx';
            },
            success: function(msg) {
                 window.location.href = 'index.aspx';
            }
        });
    }

    function StopAjax() {
        for (var i = 0; i < ajax.length; i++) {
            ajax[i].abort();
        }

    }

</script>
<body>
<img src="Images/bg11.png" width=0 height=0 />
<form id="Form1" runat="server">
<div id="msg">
<h3>
   应用程序第一次启动（或重新启动），为了加快请求响应速度，改善用户操作体验，系统正在进行预编译……
</h3>
<div id="ProgressBarSide" style="margin-top: 50px;"> 
 <div style="border:1px  solid; border-color:#000000; width:400px;height:16;margin:0 auto 0 auto;">
    <div id="ProgressBar" align="center" style="height:15px; width:0px; background-color:#00FF00;"></div>
 </div>
</div>
<br />
<p>
<asp:Button ID="BtnAbout" runat="server" Text="关于预编译" OnClientClick="window.open('http://www.powereasy.net/go.aspx?uid=10001')" CssClass="input_bt" onmouseover="this.className='input_bt_Over'" onmouseout="this.className='input_bt'"/>
&nbsp;&nbsp;
<asp:Button ID="BtnSkip" runat="server" OnClick="BtnSkip_Click"  OnClientClick="StopAjax();" Text="跳过此步骤" CssClass="input_bt" onmouseover="this.className='input_bt_Over'" onmouseout="this.className='input_bt'" />
</p>
</div>
</form>
</body>
</html>
