Example #1
0
        /// <summary>
        /// The on init.
        /// </summary>
        /// <param name="e">
        /// The e.
        /// </param>
        protected override void OnInit([NotNull] EventArgs e)
        {
            // since signatures are so small only allow YafBBCode in them...
            this._sig = new BBCodeEditor();
            this.EditorLine.Controls.Add(this._sig);

            this.signaturePreview = new SignaturePreview();
            this.PreviewLine.Controls.Add(this.signaturePreview);
       
            this.save.Click += this.Save_Click;
            this.preview.Click += this.Preview_Click;
            this.cancel.Click += this.Cancel_Click;

            // CODEGEN: This call is required by the ASP.NET Web Form Designer.
            InitializeComponent();
            base.OnInit(e);
        }
Example #2
0
        /// <summary>
        /// Raises the <see cref="E:System.Web.UI.Control.Init"/> event.
        /// </summary>
        /// <param name="e">An <see cref="T:System.EventArgs"/> object that contains the event data.</param>
        protected override void OnInit([NotNull] EventArgs e)
        {
            // get the forum editor based on the settings
            string editorId = this.Get<YafBoardSettings>().ForumEditor;

            if (this.Get<YafBoardSettings>().AllowUsersTextEditor)
            {
                // Text editor
                editorId = !string.IsNullOrEmpty(this.PageContext.TextEditor)
                    ? this.PageContext.TextEditor
                    : this.Get<YafBoardSettings>().ForumEditor;
            }

            // Check if Editor exists, if not fallback to default editorid=1
            this._forumEditor = this.Get<IModuleManager<ForumEditor>>().GetBy(editorId, false)
                                ?? this.Get<IModuleManager<ForumEditor>>().GetBy("1");

            // Override Editor when mobile device with default Yaf BBCode Editor
            if (this.PageContext.IsMobileDevice)
            {
                this._forumEditor = this.Get<IModuleManager<ForumEditor>>().GetBy("1");
            }

            this.EditorLine.Controls.Add(this._forumEditor);

            // setup jQuery and YAF JS...
            YafContext.Current.PageElements.RegisterJQuery();

            // Setup Syntax Highlight JS
            YafContext.Current.PageElements.RegisterJsResourceInclude(
                "syntaxhighlighter",
                "js/jquery.syntaxhighligher.js");
            YafContext.Current.PageElements.RegisterCssIncludeResource("css/jquery.syntaxhighligher.css");
            YafContext.Current.PageElements.RegisterJsBlockStartup(
                "syntaxhighlighterjs",
                JavaScriptBlocks.SyntaxHighlightLoadJs);

            base.OnInit(e);
        }
Example #3
0
        /// <summary>
        /// Raises the <see cref="E:System.Web.UI.Control.Init" /> event.
        /// </summary>
        /// <param name="e">An <see cref="T:System.EventArgs" /> object that contains the event data.</param>
        protected override void OnInit([NotNull] EventArgs e)
        {
            // Quick Reply Modification Begin
            this._quickReplyEditor = new BasicBBCodeEditor();
            this.QuickReplyLine.Controls.Add(this._quickReplyEditor);
            this.QuickReply.Click += this.QuickReply_Click;

            // CODEGEN: This call is required by the ASP.NET Web Form Designer.
            this.InitializeComponent();
            base.OnInit(e);
        }
Example #4
0
        /// <summary>
        /// Raises the <see cref="E:System.Web.UI.Control.Init"/> event.
        /// </summary>
        /// <param name="e">An <see cref="T:System.EventArgs"/> object that contains the event data.</param>
        protected override void OnInit([NotNull] EventArgs e)
        {
            // get the forum editor based on the settings
            string editorId = this.Get<YafBoardSettings>().ForumEditor;

            if (this.Get<YafBoardSettings>().AllowUsersTextEditor)
            {
                // Text editor
                editorId = !string.IsNullOrEmpty(this.PageContext.TextEditor)
                    ? this.PageContext.TextEditor
                    : this.Get<YafBoardSettings>().ForumEditor;
            }

            // Check if Editor exists, if not fallback to default editorid=1
            this._forumEditor = this.Get<IModuleManager<ForumEditor>>().GetBy(editorId, false)
                                ?? this.Get<IModuleManager<ForumEditor>>().GetBy("1");

            // Override Editor when mobile device with default Yaf BBCode Editor
            if (this.PageContext.IsMobileDevice)
            {
                this._forumEditor = this.Get<IModuleManager<ForumEditor>>().GetBy("1");
            }

            this.EditorLine.Controls.Add(this._forumEditor);

            // setup jQuery and YAF JS...
            YafContext.Current.PageElements.RegisterJQuery();

            // Setup Syntax Highlight JS
            YafContext.Current.PageElements.RegisterJsResourceInclude(
                "syntaxhighlighter",
                "js/jquery.syntaxhighligher.js");
            YafContext.Current.PageElements.RegisterCssIncludeResource("css/jquery.syntaxhighligher.css");
            YafContext.Current.PageElements.RegisterJsBlockStartup(
                "syntaxhighlighterjs",
                JavaScriptBlocks.SyntaxHighlightLoadJs);

            // Setup SpellChecker JS
            YafContext.Current.PageElements.RegisterJsResourceInclude(
                "jqueryspellchecker",
                "js/jquery.spellchecker.min.js");
            YafContext.Current.PageElements.RegisterCssIncludeResource("css/jquery.spellchecker.css");

            var editorClientId = this._forumEditor.ClientID;

            editorClientId = editorClientId.Replace(
                editorClientId.Substring(editorClientId.LastIndexOf("_", StringComparison.Ordinal)),
                "_YafTextEditor");

            var editorSpellBtnId = "{0}_spell".FormatWith(editorClientId);

            /*if (this._forumEditor.ModuleId.Equals("5") ||
                                this._forumEditor.ModuleId.Equals("0"))
                        {
                                var spellCheckBtn = new Button
                                        {
                                                CssClass = "pbutton", 
                                                ID = "SpellCheckBtn", 
                                                Text = this.GetText("COMMON", "SPELL")
                                        };

                                this.EditorLine.Controls.Add(spellCheckBtn);

                                editorSpellBtnId = spellCheckBtn.ClientID;
                        }*/
            YafContext.Current.PageElements.RegisterJsBlockStartup(
                "spellcheckerjs",
                JavaScriptBlocks.SpellCheckerLoadJs(
                    editorClientId,
                    editorSpellBtnId,
                    this.PageContext.CultureUser.IsSet()
                        ? this.PageContext.CultureUser.Substring(0, 2)
                        : this.Get<YafBoardSettings>().Culture,
                    this.GetText("SPELL_CORRECT")));

            base.OnInit(e);
        }
Example #5
0
        /// <summary>
        /// Handles the Initialization event of the Page control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="EventArgs"/> instance containing the event data.</param>
        protected void Page_Init([NotNull] object sender, [NotNull] EventArgs e)
        {
            // create editor based on administrator's settings
            // get the forum editor based on the settings
            string editorId = this.Get<YafBoardSettings>().ForumEditor;
            if (this.Get<YafBoardSettings>().AllowUsersTextEditor)
            {
                // Text editor
                editorId = !string.IsNullOrEmpty(this.PageContext.TextEditor)
                               ? this.PageContext.TextEditor
                               : this.Get<YafBoardSettings>().ForumEditor;
            }

            // Check if Editor exists, if not fallback to default editorid=1
            this._editor = this.Get<IModuleManager<ForumEditor>>().GetBy(editorId, false)
                           ?? this.Get<IModuleManager<ForumEditor>>().GetBy("1");

            // Override Editor when mobile device with default Yaf BBCode Editor
            if (PageContext.IsMobileDevice)
            {
                this._editor = this.Get<IModuleManager<ForumEditor>>().GetBy("1");
            }

            // add editor to the page
            this.EditorLine.Controls.Add(this._editor);
        }
Example #6
0
        /// <summary>
        /// Handles the Init event of the Page control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="EventArgs"/> instance containing the event data.</param>
        protected void Page_Init([NotNull] object sender, [NotNull] EventArgs e)
        {
            // get the forum editor based on the settings
            this.reportEditor = ForumEditorHelper.GetCurrentForumEditor();

            // add editor to the page
            this.EditorLine.Controls.Add(this.reportEditor);
        }
Example #7
0
        /// <summary>
        /// Handles the Initialization event of the Page control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="EventArgs"/> instance containing the event data.</param>
        protected void Page_Init([NotNull] object sender, [NotNull] EventArgs e)
        {
            // create editor based on administrator's settings
            // get the forum editor based on the settings
            this._editor = ForumEditorHelper.GetCurrentForumEditor();

            this.EditorLine.Controls.Add(this._editor);

            this._editor.UserCanUpload = true;

            // add editor to the page
            this.EditorLine.Controls.Add(this._editor);
        }
Example #8
0
        /// <summary>
        /// Raises the <see cref="E:System.Web.UI.Control.Init"/> event.
        /// </summary>
        /// <param name="e">An <see cref="T:System.EventArgs"/> object that contains the event data.</param>
        protected override void OnInit([NotNull] EventArgs e)
        {
            if (this.PageContext.ForumUploadAccess)
            {
                this.PageContext.PageElements.RegisterJsScriptsInclude(
                    "FileUploadScriptJs",
#if DEBUG
                    "jquery.fileupload.comb.js");
#else
                    "jquery.fileupload.comb.min.js");
#endif

#if DEBUG
                this.PageContext.PageElements.RegisterCssIncludeContent("jquery.fileupload.comb.css");
#else
                this.PageContext.PageElements.RegisterCssIncludeContent("jquery.fileupload.comb.min.css");
#endif
            }

            this._forumEditor = ForumEditorHelper.GetCurrentForumEditor();

            this.EditorLine.Controls.Add(this._forumEditor);

            base.OnInit(e);
        }
Example #9
0
        /// <summary>
        /// The on init.
        /// </summary>
        /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param>
        protected override void OnInit([NotNull] EventArgs e)
        {
            // get the forum editor based on the settings
            // string editorId = this.Get<YafBoardSettings>().ForumEditor;

           //  if (this.Get<YafBoardSettings>().AllowUsersTextEditor)
           // {
                // Text editor
             //   editorId = !string.IsNullOrEmpty(this.PageContext.TextEditor)
             //                  ? this.PageContext.TextEditor
             //                  : this.Get<YafBoardSettings>().ForumEditor;
          //  }

            // Check if Editor exists, if not fallback to default editorid=1
            /* this._quickReplyEditor = this.Get<IModuleManager<ForumEditor>>().GetBy(editorId, false)
                                     ?? this.Get<IModuleManager<ForumEditor>>().GetBy("1");*/
            this._quickReplyEditor = new TextEditor();

            // Override Editor when mobile device with default Yaf BBCode Editor
            if (this.PageContext.IsMobileDevice)
            {
                this._quickReplyEditor = this.Get<IModuleManager<ForumEditor>>().GetBy("1");
            }

            // Quick Reply Modification Begin
            // this._quickReplyEditor = new BasicBBCodeEditor();
            this.QuickReplyLine.Controls.Add(this._quickReplyEditor);
            this.QuickReply.Click += this.QuickReply_Click;
            this.Pager.PageChange += this.Pager_PageChange;

            // CODEGEN: This call is required by the ASP.NET Web Form Designer.
            this.InitializeComponent();
            base.OnInit(e);
        }
Example #10
0
        /// <summary>
        /// Raises the <see cref="E:System.Web.UI.Control.Init"/> event.
        /// </summary>
        /// <param name="e">An <see cref="T:System.EventArgs"/> object that contains the event data.</param>
        protected override void OnInit([NotNull] EventArgs e)
        {
            if (this.PageContext.ForumUploadAccess)
            {
                this.PageContext.PageElements.RegisterJsScriptsInclude(
                    "FileUploadScriptJs",
#if DEBUG
                    "jquery.fileupload.comb.js");
#else
                    "jquery.fileupload.comb.min.js");
#endif

#if DEBUG
                this.PageContext.PageElements.RegisterCssIncludeContent("jquery.fileupload.comb.css");
#else
                this.PageContext.PageElements.RegisterCssIncludeContent("jquery.fileupload.comb.min.css");
#endif
            }

            // get the forum editor based on the settings
            var editorId = this.Get<YafBoardSettings>().ForumEditor;

            if (this.Get<YafBoardSettings>().AllowUsersTextEditor)
            {
                // Text editor
                editorId = this.PageContext.TextEditor.IsSet()
                    ? this.PageContext.TextEditor
                    : this.Get<YafBoardSettings>().ForumEditor;
            }

            // Check if Editor exists, if not fallback to default editorid=1
            this._forumEditor = this.Get<IModuleManager<ForumEditor>>().GetBy(editorId, false)
                                ?? this.Get<IModuleManager<ForumEditor>>().GetBy("1");

            // Override Editor when mobile device with default Yaf BBCode Editor
            if (this.PageContext.IsMobileDevice)
            {
                this._forumEditor = this.Get<IModuleManager<ForumEditor>>().GetBy("1");
            }

            this.EditorLine.Controls.Add(this._forumEditor);
            
            base.OnInit(e);
        }