<%@ Page Language="C#" AutoEventWireup="true"  CodeBehind="htmlcode.aspx.cs" Inherits="PPFOR.Admin.CustomView.htmlcode" %>
<!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>HTML代码调用与预览</title>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <link href="../Css/global.css" rel="stylesheet" type="text/css" /> 
    <script src="../../CustomAction/JS/checkCustomFormItemValue.js" type="text/javascript"></script>    
    <script type="text/javascript" language="javascript">  
    function displayReview(v)
    {
        var obj=document.getElementById("showReview");
        objCode=document.getElementById("showScriptCode");
        if(v=="none")
        {
            obj.style.display="none";
            objCode.style.display="";
        }
        else
        {
            obj.style.display="";
            objCode.style.display="none";
        }
    }
    function closeMe()
    {
        parent.popup_close();
    }
    function copyMe(id)
    {
        var obj=document.getElementById(id);
        if(obj!=null)
        {            
            if(window.clipboardData && window.clipboardData.setData('Text',obj.value)==true)
            {
                alert("代码已成功复制！");
            }
            else
            {
                alert("代码复制失败，请手动复制！");                              
            }
            obj.select();  
        }
        return false;
    }
    function modelCheck()
    {
        if(checkCustomFormItemAllValues()==true)
        {
            alert("预览结果：数据已在客户端验证通过！");
        }
        else
        {
            alert("预览结果：数据在客户端验证未通过，请检查输入！");
        }
    }
 </script>
</head>
<body onload="displayReview('<%=PPFOR_displayReviewOption %>');">
<form id="form1" runat="server">
    <table width="99%" border="0" cellpadding="0" cellspacing="0" class="fortable" style="margin:6px;">
    <thead>
    <tr> 
        <td colspan="3" align="center"><asp:Label ID="PPFOR_formName" runat="server" Font-Bold="true" Font-Size="Large"></asp:Label></td>
    </tr>
    </thead>
    <tr>
        <td style="width:33%" align="left"><a onclick="displayReview('none');" style="cursor:pointer;">HTML代码调用</a></td>
        <td style="width:33%" align="left"><a onclick="displayReview('');" style="cursor:pointer;">预览</a></td>
        <td style="width:33%" align="left"><a onclick="copyMe('<%=PPFOR_showScriptCode.ClientID %>');" style="cursor:pointer; display:<%=PPFOR_displayCopyOption %>;">复制代码</a>&nbsp;</td>
    </tr>
    <tr id="showScriptCode" style="display:none;">
        <td colspan="3" align="center">
        <asp:TextBox ID="PPFOR_showScriptCode" Wrap="false" TextMode="MultiLine" Width="98%" Height="400px" runat="server" ReadOnly="true">
        </asp:TextBox>
        </td>
    </tr>
    <tr id="showReview" style="display:none;">
        <td colspan="3" align="center">
        <asp:Label ID="PPFOR_showReview" runat="server" CssClass="reviewtable"></asp:Label>
        </td>
    </tr>
    </table>
    <div style="margin:6px; display:none;">
    <button value="关闭" id="close_me" onclick="closeMe();" class="inputbutton" onmouseover="this.className='inputbutton_hover'" onmouseout="this.className='inputbutton'"></button>&nbsp;
    <button id="cancel" value="复制代码" onclick="copyMe('<%=PPFOR_showScriptCode.ClientID %>');return false;" style="display:<%=PPFOR_displayCopyOption %>;" class="inputbutton" onmouseover="this.className='inputbutton_hover'" onmouseout="this.className='inputbutton'"></button>  
        <script type="text/javascript"> 
            parent.popup_clearButtons();
            parent.popup_addButton(document.getElementById('close_me'));
            parent.popup_addButton(document.getElementById('cancel'));
        </script>
    </div>
</form>
</body>
</html>