@{
    /**/
    var ImgPath = PageData["ImgPath"];
    var ContentID = PageData["ContentID"];
    var Contents = PageData["Contents"];
    var IsSelect = PageData["IsSelect"];
    var IsDouble = PageData["IsDouble"];
}
<script>
    //判定是否已存在加载的js或css引用
    function isInclude(name) {
        var js = /js$/i.test(name);
        var es = document.getElementsByTagName(js ? 'script' : 'link');
        for (var i = 0; i < es.length; i++)
            if (es[i][js ? 'src' : 'href'].indexOf(name) != -1) return true;
        return false;
    }
    if (!isInclude('ueditor.config.js')) {
        document.write("<script src=\"@Url.Content("~/App_Scripts/Editor/UEditor/ueditor.config.js")\"><\/script>");
    }
    if (!isInclude('ueditor.all.js')) {
        document.write("<script src=\"@Url.Content("~/App_Scripts/Editor/UEditor/ueditor.all.js")\"><\/script>");
    }
    if (!isInclude('addCustomizeButton.js')) {
        document.write("<script src=\"@Url.Content("~/App_Scripts/Editor/UEditor/addCustomizeButton.js")\"><\/script>");
    }
    function GetDescript(toObjId, length) {
        var content = ue_edit_@(ContentID).getContentTxt();
        $("#" + toObjId).val(content.substring(0, length));
    }
    function GetIncludeImgs(toObjId) {
        var content = ue_edit_F_Info.getContent();
        var s = content.match(/src="[^"]+"/g)
        $(".Include-Imgs").html("");
        for (var i = 0; i < s.length; i++) {
            var img_url = s[i].replace("src=\"", "").replace("\"", "");
            $(".Include-Imgs").append("<a href=\"javascript:void(0);\"><img src=\"" + img_url + "\">" + (i + 1) + "<div id=\"show_edit_" + i + "\"></div></a>");
            ImageAttributes_Edit(img_url, i);
        }

        $(".Include-Imgs img").click(function () {
            var imgs_type = $('input[name="imgs_type"]:checked').val();
            if (imgs_type == 0) {
                $("#F_Logo").val($(this).attr("src"));
                $("#F_Logo_Show").attr("src", $(this).attr("src"));
                ImageAttributes_F_Logo();
            } else {
                numberF_Imgs = numberF_Imgs + 1;
                Add_Imags_F_Imgs(numberF_Imgs, $(this).attr("src"));
                $("#ImagsF_Imgs_Count").html(numberF_Imgs);

            }
        });
    }

    //显示图片信息
    function ImageAttributes_Edit(url, i) {

        var img = new Image();
        img.src = url;
        img.onload = function () {
            var size = "";
            if (img.fileSize != null && img.fileSize != null) {
                size = img.fileSize + " KB";
            }
            $("#show_edit_" + i).html('<span style=\'color:#f00\'>' + img.width + '</span>×<span style=\'color:#f00\'>' + img.height + "</span>" + size); // + img.fileSize + " KB"
        };
    }

</script>

@if (IsSelect)
{
    <div class="box" style="padding-bottom:8px;">
        <input id="IsFirstImage" name="IsFirstImage" type="checkbox" value="true" @(string.IsNullOrEmpty(ImgPath) ? "checked='checked'" : "")>
        <label for="IsFirstImage">
            提取第一个图片为缩略图
        </label>
        <a href="javascript:;" class="easyui-linkbutton" onclick="GetIncludeImgs('F_Images');" data-options="iconCls:'icon-large-picture',size:'large',iconAlign:'top'">
            提取(缩略图)
        </a>
        <label><input name="imgs_type" type="radio" value="0" checked />单图</label>
        @if (IsDouble != null && IsDouble)
        {
            <label><input name="imgs_type" type="radio" value="1" />多图</label>
        }
        <div class="Include-Imgs">
        </div>
    </div>
}
<!-- 加载编辑器的容器 -->
<script id="@(ContentID)" name="@(ContentID)" type="text/plain" style="width:95%;height:420px;">
    @Html.Raw(Contents)
</script>
<script>
    var ue_edit_@(ContentID) = UE.getEditor('@(ContentID)');
</script>