insertimagefromcustomgallery.cs

来自「Freetextbox是优秀的在线编辑器」· CS 代码 · 共 29 行

CS
29
字号
namespace CommunityServer.FreeTextBoxWrapper
{
    using CommunityServer.Components;
    using FreeTextBoxControls;
    using System;
    using System.IO;
    using System.Web;

    public class InsertImageFromCustomGallery : ToolbarButton
    {
        public InsertImageFromCustomGallery(string imageGalleryPath) : base("Insert Image From Gallery", "insertimagefromgallery")
        {
            base.CommandIdentifier = "insertimagefromcustomgallery";
            base.ScriptBlock = "this.ftb.imageGalleryPath=\"" + imageGalleryPath.Replace("//", "/") + "\";";
            if (!CSContext.Current.User.IsAnonymous)
            {
                string text1 = imageGalleryPath + "/" + CSContext.Current.User.Username;
                if (Directory.Exists(HttpContext.Current.Server.MapPath(text1.Replace("//", "/"))))
                {
                    base.ScriptBlock = "this.ftb.imageGalleryPath=\"" + text1.Replace("//", "/") + "\";";
                }
            }
            base.ScriptBlock = base.ScriptBlock + "var url=this.ftb.imageGalleryUrl.replace(/\\{0\\}/g,this.ftb.imageGalleryPath) + \"&ftb=\" + this.ftb.id; var gallery=window.open(url,'gallery','width=700,height=600,toolbars=0,resizable=1');gallery.focus();";
        }

    }
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?