<%@ Page Language="c#" Inherits="Web.Wpdcc.pageLayoutTemplate" CodeBehind="pageLayoutTemplate.aspx.cs" %>

<!DOCTYPE html>
<!--[if lt IE 9]><html class="lte-ie8"><![endif]-->
<!--[if gt IE 8]><!-->
<html>
<!--<![endif]-->
<head>
    <title>pageLayoutTemplate</title>
    <!--#include file="/Css/head.htm"-->
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

    <script type="text/javascript" src="Js/jQuery.js"></script>

    <script type="text/javascript" src="Js/validate.js" charset="utf-8"></script>

    <%--加载编辑器--%>
    <link rel="stylesheet" href="Wpedt/WpdccEditor/themes/default/default.css" />
    <script type="text/javascript" src="Wpedt/WpdccEditor/kindeditor.js"></script>
    <script type="text/javascript" src="Wpedt/WpdccEditor/lang/zh_CN.js" charset="utf-8"></script>
    <script type="text/javascript">
         jQuery(function ($) {

                var type=<%=layoutTemplateType.ToString() %> ;
                if (type==2) {
                    $("#tpname").text('频道页模板');
                }
                if (type==1) {
                    $("#tpname").text('更多页模板');
                }
                if (type==0){
                    $("#tpname").text('新闻页模板');
                }
                if (type==3){
                    $("#tpname").text('库模板');
                }
         });
    </script>
    <style type="text/css">
        form {
            margin: 0;
        }

        textarea {
            display: block;
        }

        .edit-table {
            margin: 0px;
        }

        .ft {
            margin: 0px;
        }

        .ke-icon-sethomepage {
            background-image: url(./Wpedt/WpdccEditor/themes/default/nsyicon.png);
            background-position: 0px -24px;
            width: 24px;
            height: 24px;
        }

        .ke-icon-addfavorite {
            background-image: url(./Wpedt/WpdccEditor/themes/default/nsyicon.png);
            background-position: -24px -24px;
            width: 24px;
            height: 24px;
        }

        .ke-icon-nsysethomepage {
            background-image: url(./Wpedt/WpdccEditor/themes/default/nsyicon.png);
            background-position: 0px -24px;
            width: 24px;
            height: 24px;
        }

        .ke-icon-nsyaddtofavorite {
            background-image: url(./Wpedt/WpdccEditor/themes/default/nsyicon.png);
            background-position: -24px -24px;
            width: 24px;
            height: 24px;
        }

        .ke-icon-nsybanner {
            background-image: url(./Wpedt/WpdccEditor/themes/default/nsyicon.png);
            background-position: -48px -24px;
            width: 24px;
            height: 24px;
        }

        .ke-icon-nsymenu {
            background-image: url(./Wpedt/WpdccEditor/themes/default/nsyicon.png);
            background-position: -72px -24px;
            width: 24px;
            height: 24px;
        }

        .ke-icon-nsylibrary {
            background-image: url(./Wpedt/WpdccEditor/themes/default/nsyicon.png);
            background-position: -96px -24px;
            width: 24px;
            height: 24px;
        }

        .ke-icon-nsychannel {
            background-image: url(./Wpedt/WpdccEditor/themes/default/nsyicon.png);
            background-position: -96px -96px;
            width: 24px;
            height: 24px;
        }

        .ke-icon-nsymorenavigation {
            background-image: url(./Wpedt/WpdccEditor/themes/default/nsyicon.png);
            background-position: -24px -72px;
            width: 24px;
            height: 24px;
        }

        .ke-icon-nsymore {
            background-image: url(./Wpedt/WpdccEditor/themes/default/nsyicon.png);
            background-position: -72px -96px;
            width: 24px;
            height: 24px;
        }

        .ke-icon-nsybeautify {
            background-image: url(./Wpedt/WpdccEditor/themes/default/nsyicon.png);
            background-position: 0px -72px;
            width: 24px;
            height: 24px;
        }

        .ke-icon-nsynewsnavigation {
            background-image: url(./Wpedt/WpdccEditor/themes/default/nsyicon.png);
            background-position: -24px -72px;
            width: 24px;
            height: 24px;
        }

        .ke-icon-nsytitle {
            background-image: url(./Wpedt/WpdccEditor/themes/default/nsyicon.png);
            background-position: -48px -72px;
            width: 24px;
            height: 24px;
        }

        .ke-icon-nsysubtitle {
            background-image: url(./Wpedt/WpdccEditor/themes/default/nsyicon.png);
            background-position: -72px -72px;
            width: 24px;
            height: 24px;
        }

        .ke-icon-nsyupdownnews {
            background-image: url(./Wpedt/WpdccEditor/themes/default/nsyicon.png);
            background-position: -144px -72px;
            width: 24px;
            height: 24px;
        }

        .ke-icon-nsycontent {
            background-image: url(./Wpedt/WpdccEditor/themes/default/nsyicon.png);
            background-position: -96px -72px;
            width: 24px;
            height: 24px;
        }

        .ke-icon-nsycomment {
            background-image: url(./Wpedt/WpdccEditor/themes/default/nsyicon.png);
            background-position: -168px -72px;
            width: 24px;
            height: 24px;
        }

        .ke-icon-nsyabout {
            background-image: url(./Wpedt/WpdccEditor/themes/default/nsyicon.png);
            background-position: -120px -72px;
            width: 24px;
            height: 24px;
        }

        .ke-icon-nsyauthor {
            background-image: url(./Wpedt/WpdccEditor/themes/default/nsyicon.png);
            background-position: -192px -72px;
            width: 24px;
            height: 24px;
        }

        .ke-icon-nsysource {
            background-image: url(./Wpedt/WpdccEditor/themes/default/nsyicon.png);
            background-position: 0px -96px;
            width: 24px;
            height: 24px;
        }

        .ke-icon-nsypublishtime {
            background-image: url(./Wpedt/WpdccEditor/themes/default/nsyicon.png);
            background-position: -24px -96px;
            width: 24px;
            height: 24px;
        }

        .ke-icon-nsyvisits {
            background-image: url(./Wpedt/WpdccEditor/themes/default/nsyicon.png);
            background-position: 0px -120px;
            width: 24px;
            height: 24px;
        }

        .ke-icon-nsyauditor {
            background-image: url(./Wpedt/WpdccEditor/themes/default/nsyicon.png);
            background-position: -24px -120px;
            width: 24px;
            height: 24px;
        }

        .ke-icon-nsysetfont {
            background-image: url(./Wpedt/WpdccEditor/themes/default/nsyicon.png);
            background-position: -48px -120px;
            width: 24px;
            height: 24px;
        }

        .ke-icon-nsysetprint {
            background-image: url(./Wpedt/WpdccEditor/themes/default/nsyicon.png);
            background-position: -72px -120px;
            width: 24px;
            height: 24px;
        }

        .ke-icon-nsysetclose {
            background-image: url(./Wpedt/WpdccEditor/themes/default/nsyicon.png);
            background-position: -96px -120px;
            width: 24px;
            height: 24px;
        }

        .ke-icon-nsysetzoom {
            background-image: url(./Wpedt/WpdccEditor/themes/default/nsyicon.png);
            background-position: -120px -120px;
            width: 24px;
            height: 24px;
        }

        .ke-icon-zdycss {
            background-image: url(./Wpedt/WpdccEditor/themes/default/nsyicon.png);
            background-position: 0px 0px;
            width: 24px;
            height: 24px;
        }

        .ke-icon-zdyjs {
            background-image: url(./Wpedt/WpdccEditor/themes/default/nsyicon.png);
            background-position: -24px 0px;
            width: 24px;
            height: 24px;
        }
    </style>
</head>
<body>
    <div class="main-content-inner">
        <!-- #section:basics/content.breadcrumbs -->
        <div class="breadcrumbs" id="breadcrumbs">
            <script type="text/javascript">
                try { ace.settings.check('breadcrumbs', 'fixed') } catch (e) { }
            </script>
            <ul class="breadcrumb">
                <li><i class="ace-icon fa  fa-desktop"></i> <a href="wpdcc/welcome.aspx">主页</a></li>
                <li class="active" id="tpname"></li>   
                <li>模板制作</li>
                             
            </ul>
            <!-- /.breadcrumb -->
            <!-- /section:basics/content.searchbox -->
        </div>
        <!-- /section:basics/content.breadcrumbs -->
        <div class="page-content">
            <div class="row">
                <div class="col-xs-12">
                    <!-- PAGE CONTENT BEGINS -->
                    <div class="edit-func-box func-box">
                    <%-- <div class="hd">
            模板制作<div class="user-service">
                <a class="help" href="#" title="制作提示：一般先用photoShop和dreamWeaver等制作好html模板粘贴至此处，模板包含的文件须存放在'Images/pageItem'目录下的新建目录内，并根据该存放目录修正模版的相关路径。">
                    制作提示</a></div>
        </div>--%>
         <form id="Form1" method="post" runat="server">
            <div class="bd" style="height: 558px; *height: 558px; overflow: auto;">
                <table class="edit-table">
                    <tr>
                        <td>
                            <textarea name="content" style="width: 100%; height: 540px; *height: 540px; visibility: hidden;"></textarea>
                        </td>
                    </tr>
                </table>
            </div>
            <div class="ft">
                <div class="txt-l" style="float: left;">
                    <asp:Button ID="btnSave" runat="server" class="btn btn-sm btn-primary" Text="保存" OnClientClick="return checkall();" OnClick="Btn_Click"></asp:Button>&emsp;
                    <asp:Button ID="btnSaveBack" runat="server" class="btn btn-sm btn-primary" Text="保存并返回" OnClientClick="return checkall();" OnClick="Btn_Click"></asp:Button>&emsp;
                    <asp:Button ID="btnBack" runat="server" class="btn btn-sm btn-primary" Text="返回" OnClick="Btn_Click"></asp:Button>&emsp;
                    模板名称：<asp:TextBox ID="name" runat="server" class="input-md" notNull="true" msgName="模板名称" MaxLength="50"></asp:TextBox>
                &emsp;&nbsp;
                <asp:DropDownList ID="isArtDesign" runat="server" Visible="False">
                    <asp:ListItem Value="0">否</asp:ListItem>
                    <asp:ListItem Value="1" Selected="True">是</asp:ListItem>
                </asp:DropDownList>
                </div>
                <asp:Panel runat="server" ID="pnlBgpic">
                &emsp;模板背景图：
                <div id="bgpic1" style="display: inline; width: 70px; height: 15px" runat="server">
                </div>
                <div style="display: inline;"><a id="upbgimg" href="javascript:void(0);">上传模板背景图片</a></div>
                <input id="HiddenPkId" runat="server" type="hidden" />&nbsp;&nbsp;<a href="javascript:findreplace();" >查找替换</a>&nbsp;&nbsp;<a href="#" onclick="copycode()">模板图片路径修正</a>
                </asp:Panel>
                <asp:TextBox ID="itemWidth" runat="server" Width="117px" Visible="False"></asp:TextBox>
                <asp:HiddenField ID="bgpic" runat="server" />
                <input id="content1" type="hidden" name="content1" runat="server" />
            </div>
        </form>
                <!-- PAGE CONTENT ENDS -->
            </div>
        </div>
    </div>
    <!-- /.page-content -->
</div>
</div>
    <script type="text/javascript" lang="javascript">
        var cont = document.getElementById("content1").value;
        var editor;
        switch ("<%=layoutTemplateType%>") {
                case '0': //新闻页  
                    KindEditor.ready(function (K) {
                        editor = K.create('textarea[name="content"]', {
                            designMode: true,
                            fullscreenMode: false,
                            filterMode: false,//是否开启过滤HTML代码
                            wellFormatMode: true,
                            shadowMode: true,
                            loadStyleMode: true,
                            basePath: K.basePath,
                            themesPath: K.basePath + 'themes/',
                            langPath: K.basePath + 'lang/',
                            pluginsPath: K.basePath + 'plugins/',
                            themeType: 'default',
                            langType: 'zh_CN',
                            urlType: '',
                            newlineTag: 'p',
                            resizeType: 2,
                            syncType: 'form',
                            pasteType: 2,
                            dialogAlignType: 'page',
                            useContextmenu: true,//是否启用右键菜单
                            fullscreenShortcut: false,
                            bodyClass: 'ke-content',
                            indentChar: '\t',
                            cssPath: ['./Wpedt/WpdccEditor/plugins/code/prettify.css', './Css/public.css'],
                            cssData: '',
                            width: '100%',
                            minWidth: 650,
                            minHeight: 100,
                            minChangeSize: 5,
                            items: [
                                'source', '|', 'undo', 'redo', '|', 'preview', 'print', 'cut', 'copy', 'paste',
                                'plainpaste', 'wordpaste', '|', 'justifyleft', 'justifycenter', 'justifyright',
                                'justifyfull', 'insertorderedlist', 'insertunorderedlist', 'indent', 'outdent', 'subscript',
                                'superscript', 'selectall', '|', 'fullscreen', '/',
                                'formatblock', 'fontname', 'fontsize', '|', 'forecolor', 'hilitecolor', 'bold',
                                'italic', 'underline', 'strikethrough', 'lineheight', '|', 'image', 'multiimage', 'flash',
                                'media', 'insertfile', 'table', 'hr',
                                'anchor', 'link', 'unlink', '|', 'baidumap',
                                '/', 'zdycss', 'zdyjs', '|', 'nsysethomepage', 'nsyaddtofavorite', 'nsybanner', 'nsymenu', 'nsylibrary', '|', 'nsybeautify', 'nsynewsnavigation', 'nsytitle', 'nsysubtitle', 'nsyupdownnews', 'nsycontent', 'nsycomment', 'nsyabout', 'nsyauthor', 'nsysource', 'nsypublishtime', '|', 'nsyvisits', 'nsyauditor', 'nsysetfont', 'nsysetprint', 'nsysetclose', 'nsysetzoom'
                            ],
                            noDisableItems: ['source', 'fullscreen'],
                            layout: '<div class="container"><div class="toolbar"></div><div class="edit"></div><div class="statusbar"></div></div>',

                            uploadJson: './Wpedt/WpdccEditor/aspnet/upload_json.ashx',
                            fileManagerJson: './Wpedt/WpdccEditor/aspnet/file_manager_json.ashx',
                            allowFileManager: true,
                            afterCreate: function () {
                                var self = this;
                                K.ctrl(document, 13, function () {
                                    self.sync();
                                    K('form[name=example]')[0].submit();
                                });
                                K.ctrl(self.edit.doc, 13, function () {
                                    self.sync();
                                    K('form[name=example]')[0].submit();
                                });
                            }
                        });
                        editor.insertHtml(cont);
                    });
                    break;

                case '1'://更多页
                    KindEditor.ready(function (K) {
                        editor = K.create('textarea[name="content"]', {
                            designMode: true,
                            fullscreenMode: false,
                            filterMode: false,//是否开启过滤HTML代码
                            wellFormatMode: true,
                            shadowMode: true,
                            loadStyleMode: true,
                            basePath: K.basePath,
                            themesPath: K.basePath + 'themes/',
                            langPath: K.basePath + 'lang/',
                            pluginsPath: K.basePath + 'plugins/',
                            themeType: 'default',
                            langType: 'zh_CN',
                            urlType: '',
                            newlineTag: 'p',
                            resizeType: 2,
                            syncType: 'form',
                            pasteType: 2,
                            dialogAlignType: 'page',
                            useContextmenu: true,//是否启用右键菜单
                            fullscreenShortcut: false,
                            bodyClass: 'ke-content',
                            indentChar: '\t',
                            cssPath: ['./Wpedt/WpdccEditor/plugins/code/prettify.css', './Css/public.css'],
                            cssData: '',
                            width: '100%',
                            minWidth: 650,
                            minHeight: 100,
                            minChangeSize: 5,
                            items: [
                                'source', '|', 'undo', 'redo', '|', 'preview', 'print', 'cut', 'copy', 'paste',
                                'plainpaste', 'wordpaste', '|', 'justifyleft', 'justifycenter', 'justifyright',
                                'justifyfull', 'insertorderedlist', 'insertunorderedlist', 'indent', 'outdent', 'subscript',
                                'superscript', 'selectall', '|', 'fullscreen', '/',
                                'formatblock', 'fontname', 'fontsize', '|', 'forecolor', 'hilitecolor', 'bold',
                                'italic', 'underline', 'strikethrough', 'lineheight', '|', 'image', 'multiimage', 'flash',
                                'media', 'insertfile', 'table', 'hr',
                                'anchor', 'link', 'unlink', '|', 'baidumap',
                                '/', 'zdycss', 'zdyjs', '|', 'nsysethomepage', 'nsyaddtofavorite', 'nsybanner', 'nsymenu', 'nsylibrary', '|', 'nsybeautify', 'nsymorenavigation', 'nsymore'
                            ],
                            noDisableItems: ['source', 'fullscreen'],

                            layout: '<div class="container"><div class="toolbar"></div><div class="edit"></div><div class="statusbar"></div></div>',

                            uploadJson: './Wpedt/WpdccEditor/aspnet/upload_json.ashx',
                            fileManagerJson: './Wpedt/WpdccEditor/aspnet/file_manager_json.ashx',
                            allowFileManager: true,
                            afterCreate: function () {
                                var self = this;
                                K.ctrl(document, 13, function () {
                                    self.sync();
                                    K('form[name=example]')[0].submit();
                                });
                                K.ctrl(self.edit.doc, 13, function () {
                                    self.sync();
                                    K('form[name=example]')[0].submit();
                                });
                            }
                        });
                        editor.insertHtml(cont);
                    });
                    break;
                case '2': //频道模板
                    KindEditor.ready(function (K) {
                        editor = K.create('textarea[name="content"]', {
                            designMode: true,
                            fullscreenMode: false,
                            filterMode: false,//是否开启过滤HTML代码
                            wellFormatMode: true,
                            shadowMode: true,
                            loadStyleMode: true,
                            basePath: K.basePath,
                            themesPath: K.basePath + 'themes/',
                            langPath: K.basePath + 'lang/',
                            pluginsPath: K.basePath + 'plugins/',
                            themeType: 'default',
                            langType: 'zh_CN',
                            urlType: '',
                            newlineTag: 'p',
                            resizeType: 2,
                            syncType: 'form',
                            pasteType: 2,
                            dialogAlignType: 'page',
                            useContextmenu: true,//是否启用右键菜单
                            fullscreenShortcut: false,
                            bodyClass: 'ke-content',
                            indentChar: '\t',
                            cssPath: ['./Wpedt/WpdccEditor/plugins/code/prettify.css', './Css/public.css'],
                            cssData: '',
                            width: '100%',
                            minWidth: 650,
                            minHeight: 100,
                            minChangeSize: 5,
                            items: [
                                'source', '|', 'undo', 'redo', '|', 'preview', 'print', 'cut', 'copy', 'paste',
                                'plainpaste', 'wordpaste', '|', 'justifyleft', 'justifycenter', 'justifyright',
                                'justifyfull', 'insertorderedlist', 'insertunorderedlist', 'indent', 'outdent', 'subscript',
                                'superscript', 'selectall', '|', 'fullscreen', '/',
                                'formatblock', 'fontname', 'fontsize', '|', 'forecolor', 'hilitecolor', 'bold',
                                'italic', 'underline', 'strikethrough', 'lineheight', '|', 'image', 'multiimage', 'flash',
                                'media', 'insertfile', 'table', 'hr',
                                'anchor', 'link', 'unlink', '|', 'baidumap',
                                '/', 'zdycss', 'zdyjs', '|', 'nsysethomepage', 'nsyaddtofavorite', 'nsybanner', 'nsymenu', 'nsylibrary', '|', 'nsychannel'
                            ],
                            noDisableItems: ['source', 'fullscreen'],

                            layout: '<div class="container"><div class="toolbar"></div><div class="edit"></div><div class="statusbar"></div></div>',

                            uploadJson: './Wpedt/WpdccEditor/aspnet/upload_json.ashx',
                            fileManagerJson: './Wpedt/WpdccEditor/aspnet/file_manager_json.ashx',
                            allowFileManager: true,
                            afterCreate: function () {
                                var self = this;
                                K.ctrl(document, 13, function () {
                                    self.sync();
                                    K('form[name=example]')[0].submit();
                                });
                                K.ctrl(self.edit.doc, 13, function () {
                                    self.sync();
                                    K('form[name=example]')[0].submit();
                                });
                            }
                        });

                        editor.insertHtml(cont);
                    });
                    break;
                case '3':  //库模版
                    // 自定义插件 #1 sethomepage
                    KindEditor.lang({
                        sethomepage: '设为首页'
                    });
                    KindEditor.plugin('sethomepage', function (K) {
                        var self = this, name = 'sethomepage';
                        self.clickToolbar(name, function () {
                            self.insertHtml('<a href="#" onclick="this.style.behavior=\'url(#default#homepage)\';this.setHomePage(location.href);" >设为首页</a>');
                        });
                    });

                    // 自定义插件 #2 addfavorite
                    KindEditor.lang({
                        addfavorite: '加入收藏'
                    });
                    KindEditor.plugin('addfavorite', function (K) {
                        var self = this, name = 'addfavorite';
                        self.clickToolbar(name, function () {
                            self.insertHtml('<a href="#" onclick="window.external.AddFavorite(location.href,document.title);" >加入收藏</a>');
                        });
                    });
                    KindEditor.ready(function (K) {
                        editor = K.create('textarea[name="content"]', {
                            designMode: true,
                            fullscreenMode: false,
                            filterMode: false,//是否开启过滤HTML代码
                            wellFormatMode: true,
                            shadowMode: true,
                            loadStyleMode: true,
                            basePath: K.basePath,
                            themesPath: K.basePath + 'themes/',
                            langPath: K.basePath + 'lang/',
                            pluginsPath: K.basePath + 'plugins/',
                            themeType: 'default',
                            langType: 'zh_CN',
                            urlType: '',
                            newlineTag: 'p',
                            resizeType: 2,
                            syncType: 'form',
                            pasteType: 2,
                            dialogAlignType: 'page',
                            useContextmenu: true,//是否启用右键菜单
                            fullscreenShortcut: false,
                            bodyClass: 'ke-content',
                            indentChar: '\t',
                            cssPath: './Wpedt/WpdccEditor/plugins/code/prettify.css',
                            cssData: '',
                            width: '100%',
                            minWidth: 650,
                            minHeight: 100,
                            minChangeSize: 5,
                            items: [
                                'source', '|', 'undo', 'redo', '|', 'preview', 'print', 'cut', 'copy', 'paste',
                                'plainpaste', 'wordpaste', '|', 'justifyleft', 'justifycenter', 'justifyright',
                                'justifyfull', 'insertorderedlist', 'insertunorderedlist', 'indent', 'outdent', 'subscript',
                                'superscript', 'clearhtml', "|", 'selectall', '/',
                                'formatblock', 'fontname', 'fontsize', '|', 'forecolor', 'hilitecolor', 'bold',
                                'italic', 'underline', 'strikethrough', 'lineheight', '|', 'image', 'multiimage', 'flash',
                                'media', 'insertfile', 'table', 'hr',
                                'anchor', 'link', 'unlink', '|', 'fullscreen', '/',
                                'sethomepage', 'addfavorite'
                            ],
                            noDisableItems: ['source', 'fullscreen'],

                            layout: '<div class="container"><div class="toolbar"></div><div class="edit"></div><div class="statusbar"></div></div>',

                            uploadJson: './Wpedt/WpdccEditor/aspnet/upload_json.ashx',
                            fileManagerJson: './Wpedt/WpdccEditor/aspnet/file_manager_json.ashx',
                            allowFileManager: true,
                            afterCreate: function () {
                                var self = this;
                                K.ctrl(document, 13, function () {
                                    self.sync();
                                    K('form[name=example]')[0].submit();
                                });
                                K.ctrl(self.edit.doc, 13, function () {
                                    self.sync();
                                    K('form[name=example]')[0].submit();
                                });
                            }
                        });

                        editor.insertHtml(cont);
                    });
                    break
                default:

                    break;
            }


    </script>

    <script type="text/javascript" lang="javascript">
        //自定义上传图片控件加载，支持自定义上传图片功能需先引用三个文件，[themes/default/default.css] [kindeditor.js] [lang/zh_CN.js]
        KindEditor.ready(function (K) {
            var editor = K.editor({
                uploadJson: './Wpedt/WpdccEditor/aspnet/upload_json.ashx',
                fileManagerJson: './Wpedt/WpdccEditor/aspnet/file_manager_json.ashx',
                allowFileManager: true
            });
            K('#upbgimg').click(function () {
                editor.loadPlugin('zdyupbgimg', function () {
                    editor.plugin.zdyupbgimgDialog({
                        zdyupbgimgUrl: K('#bgpic').val(),
                        clickFn: function (url) {
                            K('#bgpic').val(url);
                            editor.hideDialog();
                            change();//加载预览图片
                        }
                    });
                });
            });

        });

    </script>

    <script type="text/javascript" lang="javascript">

        //点击保存
        function checkall() {
            if (checkAllValidate()) {
                var etxtisempty = editor.isEmpty();
                if (etxtisempty) {
                    alert("模板内容不能为空！");
                    return false;
                } else {
                    document.getElementById("content1").value = editor.html();
                    return true;
                }
            } else {
                return false;
            }
        }

        //加载预览图片
        function change() {
            if (document.Form1.bgpic.value != "") {
                var arr = document.Form1.bgpic.value;
                document.getElementById("bgpic1").innerHTML = "<img src=" + arr + " height='18' width='70' />";
            }
        }
        //清除模板背景图片
        function clearzdy(clearname) {
            switch (clearname) {
                case "zdyupbgimg":
                    document.getElementById("bgpic1").innerHTML = "";
                    document.getElementById("bgpic").value = "";
                    break;
            }
        }

        // 查找替换
        function findreplace() {
            editor.focus();
            showModalDialog('./Wpedt/WpdccEditor/plugins/zdyfindreplace/findreplace.htm', window, "dialogWidth:320px;dialogHeight:165px;help:no;scroll:no;status:no");
            editor.focus();
        }

        // 模板图片路径修正
        function copycode() {

            editor.focus();
            window.open("./Wpedt/WpdccEditor/plugins/zdyfindreplace/copycode.htm");
            //editor.focus();
        }
    </script>
</body>
</html>
