受欢迎的博客标签

Integrating TinyMCE 5.x Mobile in ASP.NET Core(iaspnetcore.com)

Published

sample tinymce

tinymce.init({
    selector: '#articletextarea',
    plugins: [
        'advlist autolink lists link image charmap preview hr anchor pagebreak',
        'searchreplace wordcount visualblocks visualchars code',
        'insertdatetime media nonbreaking table contextmenu directionality',
        'emoticons template paste textcolor colorpicker textpattern imagetools codesample'
    ],
    toolbar: 'codesample | bold italic sizeselect fontselect fontsizeselect | hr alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | link image | insertfile undo redo | forecolor backcolor emoticons | code',
    fontsize_formats: "8pt 10pt 12pt 14pt 18pt 24pt 36pt",
    height: "350",
    menubar: false
});

https://www.tiny.cloud/docs/mobile/

TinyMCE mobile is available in TinyMCE versions 4.7+ and 5.TinyMCE 5.1 provides an improved mobile editor, replacing the existing mobile editor with a touch friendly version on the silver theme.

step 1:Get TinyMCE

Use the snippets below to see TinyMCE in action then get a free API key to test our premium features:

<!DOCTYPE html>
<html>
<head>
  <script src="https://cdn.tiny.cloud/1/no-api-key/tinymce/5/tinymce.min.js" referrerpolicy="origin"></script>
  <script>tinymce.init({selector:'textarea'});</script>
</head>
<body>
  <textarea>Next, use our Get Started docs to setup Tiny!</textarea>
</body>
</html>

more detail:https://www.tiny.cloud/get-tiny/

or

Download tinymce 5.x

Self-hosted releases of TinyMCE are available for download for both development and production packages.

Download everything you need for production usage (including a jQuery integration plugin) for free. TinyMCE is open source and licensed under LGPL 2.1.

tinymce_5.1.6.zip:   https://download.tiny.cloud/tinymce/community/tinymce_5.1.6.zip    

more detail:https://www.tiny.cloud/get-tiny/self-hosted/

other:

How do I convert my URLs to  absolute with domain in tinymce?

Domain absolute URLs

 

tinymce.init({
  selector: 'textarea',  // change this value according to your HTML
  relative_urls : false,
  remove_script_host : false,
  document_base_url : "http://www.iaspnetcore.com/"
});

This will convert all relative URLs to absolute URLs. The URLs will be absolute based on the [document_base_url] with domain.

Example: path2/file.htm » http://www.iaspnetcore.com/path2/file.htm

 

Domain absolute URLs upgrade to:

@using Microsoft.AspNetCore.Http
@using Microsoft.Net.Http.Headers
@inject IHttpContextAccessor _httpContextAccessor
@{
    var allowJbimages = false;
    var random = CommonHelper.GenerateRandomInteger();

    var scheme = _httpContextAccessor.HttpContext.Request.Scheme;
    var host = _httpContextAccessor.HttpContext.Request.Headers[HeaderNames.Host];
    var domainUrl = scheme + "://" + host;
}

tinymce.init({
  selector: 'textarea',  // change this value according to your HTML
  relative_urls : false,
  remove_script_host : false,
  document_base_url: "@domainUrl",
});

 

src\Presentation\Nop.Web\Themes\RootTheme\Views\Shared\EditorTemplates\RichEditor.cshtml

default_link_target 

default_link_target: '_blank'

https://www.tiny.cloud/docs/plugins/link/

tinymce.init({
  selector: 'textarea',  // change this value according to your HTML
  plugins: 'link',
  menubar: 'insert',
  toolbar: 'link',
  default_link_target: '_blank'
});

How do I convert my URLs to relative, absolute, or absolute with domain  in tinymce?