Author Topic: 【天问】cms made simple的tinymce编辑器的plugins and toolbar  (Read 4381 times)

laofuzi

  • Hero Member
  • *****
  • Posts: 5091
发达国家无犯罪证明Police Certificate/Criminal Record/海牙认证/使馆认证:www.newnewdoc.com 加拿大技术移民:www.newnewland.com  微信咨询:newnewlandvisa

laofuzi

  • Hero Member
  • *****
  • Posts: 5091
Re: 【天问】cms made simple的tinymce编辑器的plugins and toolbar
« Reply #1 on: April 14, 2021, 01:27:12 PM »
当modules安装出现如下error时,
Checksum error. This probably indicates a corrupt file, either when it was uploaded to the repository, or a
problem in transit down to your machine. (expected 2ab10c6de323f9249ce2ef21decbdebc and got7bff868353b61d305ae8519909f2f8

采用手动安装:http://dev.cmsmadesimple.org/project/files/12#package-7
比如tinymce,从这里下载zip文件,解压后文件夹命名为tinymce,然后ftp上传到根目录htdocs/modules/,然后在cms made simple的后台的module manager的页面,自动出来了tinymce,点击install即可完成安装。

在后台的module manager里删除tinymce点一下就删除了。如果在ftp里删除,要很久,要十几分钟才能删除。

note:expressentry网站,tinymce出现问题,系统选择tinymce后content不能出现编辑框,选择mcrotiny才可以出现。但是不能选择color和字体了。各种折腾和尝试后,最后选择了tinymce beta5版本(很旧的版本),只敢在advanced里面加入color和字体选择两个功能,其他功能不敢加了。加了又出现问题。


Problem solved.

I didn’t see the TAR.GZ file so just downloaded the ZIP and XML file, unpacked the ZIP and FTP’d both straight to modules/

Then in the admin section went to Extensions > Modules and saw Payment Made Simple in the list but it was “uninstalled”. Clicked install and it went through first time.

Thanks again Uniqu3


I advise to download the xml file and install it through extensions -> modules



If you install through XML, it works.

--
1.
Go to the xml file of SitemapMadeSimple:
http://s3.amazonaws.com/cmsms/downloads ... -1.2.6.xml

2.
Save the file on your computer (as SiteMapMadeSimple-1.2.6.xml)

3.
AT the bottom of your modules overview, choose to install a module using xml and select the saved xml-file

4.
After that you have to install or upgrade the module in the list.
NextDoorMedia - Online Marketing Partner
« Last Edit: August 13, 2021, 03:33:55 PM by laofuzi »
发达国家无犯罪证明Police Certificate/Criminal Record/海牙认证/使馆认证:www.newnewdoc.com 加拿大技术移民:www.newnewland.com  微信咨询:newnewlandvisa

laofuzi

  • Hero Member
  • *****
  • Posts: 5091
Re: 【天问】cms made simple的tinymce编辑器的plugins and toolbar
« Reply #2 on: April 14, 2021, 01:32:19 PM »
tinymce的编辑器功能添加:直接复制,该有的功能都有(比如大小,颜色,表格等,不用自己去第一帖的网站自己研究添加什么功能了)

在extension/inymce editor/advanced页面
Plugins:复制如下内容
autolink anchor code fullscreen image link media paste table visualblocks lists textcolor emoticons insertdatetime preview spellchecker save visualblocks textpattern toc searchreplace media hr codesample charmap autosave autolink anchor lists advlist print visualchars wordcount table lists

toolbar:
Toolbar - 1st line:复制如下内容:
undo redo | cut copy paste | formatselect | bold italic underline | alignleft aligncenter alignright alignjustify | bullist numlist | cmsms_linker link unlink responsivefilemanager image media template |outdent indent lineheight fullscreen code table tabledelete | tableprops tablerowprops tablecellprops | tableinsertrowbefore tableinsertrowafter tabledeleterow | tableinsertcolbefore tableinsertcolafter tabledeletecol hr codesample charmap restoredraft anchor visualchars wordcount lineheight newdocument removeformat selectall strikethrough underline pagebreak

Toolbar - 2nd line:复制如下内容


forecolor backcolor fontselect fontsizeselect emoticons subscript superscript insertdatetime preview spellchecker save visualblocks toc searchreplace print paste pastetext restoredraft  blockquote

新加入一个 outdent indent(首行缩进)

新加入一个lineheight:就是行间距。是下载了一个lineheight插件(http://tinymce.ax-z.cn/more-plugins/lineheight.php),然后ftp上传到"根目录modules\TinyMCE\lib\js\tinymce\plugins\lineheight"。然后在网站后台extension的tinymce的toolbar和meumbar中加入lineheight,只支持5以上的tinymce


新增一个restoredraft,和removeformat,只需要在toolbar加入即可,不需要再menubar添加。
增加一个引用符blockquote:就是空两个字,然后一条竖线,然后一行字。

总功能大全:https://lequ7.com/fu-wen-ben-cha-jian-TinyMCE-de-cai-dan-pei-zhi-he-gong-ju-lan-pei-zhi.html
« Last Edit: May 24, 2021, 04:22:45 PM by laofuzi »
发达国家无犯罪证明Police Certificate/Criminal Record/海牙认证/使馆认证:www.newnewdoc.com 加拿大技术移民:www.newnewland.com  微信咨询:newnewlandvisa

laofuzi

  • Hero Member
  • *****
  • Posts: 5091
 font_formats: '微软雅黑=Microsoft YaHei,Helvetica Neue,PingFang SC,sans-serif;苹果苹方=PingFang SC,Microsoft YaHei,sans-serif;宋体=simsun,serif;仿宋体=FangSong,serif;黑体=SimHei,sans-serif;Arial=arial,helvetica,sans-serif;Arial Black=arial black,avant garde;Book Antiqua=book antiqua,palatino;',

上面是网络复制的源代码:

在实际中的tinymce中加入新的字体,需要在\TinyMCE\lib\js\tinymce\themes\silver\theme.min.js中增加红色部分即可。只改这一个文件。需要说明的是,比如微软雅黑在编辑器端会显示乱码,可能要编码成utf-8编码才行,我没时间就用英文替代中文名称。

u=jT(r,"font_formats","YaHei=Microsoft YaHei,sans-serif;Song=simsun,serif;FangSong=FangSong,serif;HeiTi=SimHei,sans-serif;Andale Mono=andale mono,monospace;Arial=arial,helvetica,sans-serif;Arial Black=arial black,sans-serif;Book Antiqua=book antiqua,palatino,serif;Comic Sans MS=comic sans ms,sans-serif;Courier New=courier new,courier,monospace;Georgia=georgia,palatino,serif;Helvetica=helvetica,arial,sans-serif;Impact=impact,sans-serif;Symbol=symbol;Tahoma=tahoma,arial,helvetica,sans-serif;Terminal=terminal,monaco,monospace;Times New Roman=times new roman,times,serif;Trebuchet MS=trebuchet ms,geneva,sans-serif;Verdana=verdana,geneva,sans-serif;Webdings=webdings;Wingdings=wingdings,zapf dingbats"



« Last Edit: June 22, 2021, 12:32:52 PM by laofuzi »
发达国家无犯罪证明Police Certificate/Criminal Record/海牙认证/使馆认证:www.newnewdoc.com 加拿大技术移民:www.newnewland.com  微信咨询:newnewlandvisa

laofuzi

  • Hero Member
  • *****
  • Posts: 5091
终于找到这个tinymce.init文件(/modules/microtiny/templates/tinymce_config.js),在网站的ftp文件里用notepad检索,不要在tinymce的单独文件里检索,因为网站还要安装tinymce


// this is the actual tinymce initialization
tinymce.init({

    selector: '{if isset($mt_selector) && $mt_selector != ''}{$mt_selector}{else}textarea.MicroTiny{/if}',
    language: '{$languageid}',
    cmsms_tiny: cmsms_tiny = {
        schema: 'html5',
        base_url : '{root_url}/',
        resize : {mt_jsbool($mt_profile.allowresize)},
        statusbar : {mt_jsbool($mt_profile.showstatusbar)},
        menubar : {mt_jsbool($mt_profile.menubar)},
        filepicker_title : '{$MT->Lang('filepickertitle')|escape:javascript}',
        filepicker_url : '{$filepicker_url}&field=',
        filebrowser_title : '{$MT->Lang('title_cmsms_filebrowser')|escape:javascript}',
        linker_text : '{$MT->Lang('cmsms_linker')|escape:javascript}',
        linker_title : '{$MT->Lang('title_cmsms_linker')|escape:javascript}',
        linker_image : '{$MT->GetModuleURLPath()}/lib/images/cmsmslink.gif',
        linker_url : '{$linker_url}',
        linker_autocomplete_url : '{$getpages_url}',
   mailto_text : '{$MT->Lang('mailto_text')|escape:javascript}',
   mailto_title : '{$MT->Lang('mailto_image')|escape:javascript}',
   mailto_image : '{$MT->GetModuleURLPath()}/lib/images/mailto.gif',
        prompt_page : '{$MT->Lang('prompt_linker')|escape:javascript}',
        prompt_page_info : '{$MT->Lang('info_linker_autocomplete')|escape:javascript}',
        prompt_alias : '{$MT->Lang('prompt_selectedalias')|escape:javascript}',
        prompt_alias_info : '{$MT->Lang('tooltip_selectedalias')|escape:javascript}',
        prompt_text : '{$MT->Lang('prompt_texttodisplay')|escape:javascript}',
        prompt_class : '{$MT->Lang('prompt_class')|escape:javascript}',
        prompt_rel : '{$MT->Lang('prompt_rel')|escape:javascript}',
        prompt_target : '{$MT->Lang('prompt_target')|escape:javascript}',
        prompt_insertmailto : '{$MT->Lang('prompt_insertmailto')|escape:javascript}',
        prompt_email : '{$MT->Lang('prompt_email')|escape:javascript}',
        prompt_anchortext : '{$MT->Lang('prompt_anchortext')|escape:javascript}',
        prompt_linktext : '{$MT->Lang('prompt_linktext')|escape:javascript}',
        tab_general : '{$MT->Lang('tab_general_title')|escape:javascript}',
        tab_advanced : '{$MT->Lang('tab_advanced_title')|escape:javascript}',
        target_none : '{$MT->Lang('none')|escape:javascript}',
        target_new_window : '{$MT->Lang('newwindow')|escape:javascript}',
        loading_info : '{$MT->Lang('loading_info')|escape:javascript}'
    },
    document_base_url: cmsms_tiny.base_url,
    relative_urls: true,
    image_title: true,
    mysamplesetting: 'foobar',
    menubar: cmsms_tiny.menubar,
    statusbar: cmsms_tiny.statusbar,
    resize: cmsms_tiny.resize,
    removed_menuitems: 'newdocument',
    browser_spellcheck: true,
    // smarty logic stuff
{if isset($mt_cssname) && $mt_cssname != ''}
    content_css : '{cms_stylesheet name=$mt_cssname nolinks=1}',
{/if}
{if $isfrontend}
    toolbar: 'undo | bold italic underline | alignleft aligncenter alignright alignjustify indent outdent | bullist numlist | link mailto{if $mt_profile.allowimages} | image{/if}',
    plugins: ['tabfocus hr autolink paste link mailto anchor wordcount lists {if $mt_profile.allowimages} media image{/if} {if $mt_profile.allowtables}table{/if}'],
{else}
    image_advtab: true,
    toolbar: 'undo redo | cut copy paste | styleselect | bold italic underline | alignleft aligncenter alignright alignjustify indent outdent | bullist numlist | anchor link mailto unlink cmsms_linker{if $mt_profile.allowimages} | image {/if}',
    plugins: ['tabfocus hr paste autolink link lists mailto cmsms_linker charmap anchor searchreplace wordcount code fullscreen insertdatetime {if $mt_profile.allowtables}table{/if} {if $mt_profile.allowimages}media image cmsms_filepicker {/if}'],
{/if}
    // callback functions
    urlconverter_callback: function(url, elm, onsave, name) {
        var self = this;
        var settings = self.settings;

        if (!settings.convert_urls || ( elm && elm.nodeName == 'LINK' ) || url.indexOf('file:') === 0 || url.length === 0) {
            return url;
        }

        // fix entities in cms_selflink urls.
        if (url.indexOf('cms_selflink') != -1) {
            decodeURI(url);
            url = url.replace('%20', ' ');
            return url;
        }
        // Convert to relative
        if (settings.relative_urls) {
            return self.documentBaseURI.toRelative(url);
        }
        // Convert to absolute
        url = self.documentBaseURI.toAbsolute(url, settings.remove_script_host);

        return url;
    },
    setup: function(editor) {
        editor.addMenuItem('mailto',{
           text: cmsms_tiny.prompt_insertmailto,
           cmd:  'mailto',
           context: 'insert',
        })
        editor.on('change', function(e) {
            $(document).trigger('cmsms_formchange');
        });
    },
    paste_as_text: true,
});
« Last Edit: May 24, 2021, 04:30:14 PM by laofuzi »
发达国家无犯罪证明Police Certificate/Criminal Record/海牙认证/使馆认证:www.newnewdoc.com 加拿大技术移民:www.newnewland.com  微信咨询:newnewlandvisa

laofuzi

  • Hero Member
  • *****
  • Posts: 5091
插入首行缩进的功能:http://tinymce.ax-z.cn/more-plugins/indent2em.php

此页更新时间:2020-01-02 10:34

此页英文文档:无

    插件作者:莫若卿
    支持版本:5+
    支持语言:不限
    下载插件:indent2em.zip
    使用方法:将解压得到的文件夹,放到TinyMCE主目录下的plugins文件夹内。然后再网站后台在extension/inymce editor/advanced页面的Plugins和toolbar两处都加上code indent2em即可

作用:提供中文段落排版的首行缩进2个字符的功能,实际是加入css的text-indent:2em。

仅影响光标所在段落或选中段落。

tinymce.init({
    selector: '#tinydemo',
    plugins: "code indent2em",
    toolbar: "code indent2em",
});



插入百度地图

此页更新时间:2021-03-05 16:31
http://tinymce.ax-z.cn/more-plugins/bdmap.php
此页英文文档:无

    插件作者:莫若卿
    支持版本:5.0.4+
    支持语言:仅中文
    当前版本:1.2
    下载插件:bdmap.zip
    使用方法:将解压得到的文件夹,放到TinyMCE主目录下的plugins文件夹内。

    更新记录:

        1.2:百度地图API3.0的setSearchCompleteCallback返回值Ar变更为Br。
        1.1:百度地图API3.0的setSearchCompleteCallback返回值Qq变更为Ar。

作用:在内容区插入一个动态的百度地图。

    此插件是译者参考kindeditor同功能插件的写法,为TinyMCE编写的地图插件,在此感谢KE作者。

tinymce.init({
    selector: '#tinydemo',
    plugins: "code bdmap",
    toolbar: "code bdmap",
});


图片批量上传

http://tinymce.ax-z.cn/more-plugins/axupimgs.php
更多插件 \ ax多图片批量上传
+toolbar按钮+menu项

此页更新时间:2020-03-31 21:22

此页英文文档:无

    插件作者:莫若卿
    支持版本:5.0.4+
    支持语言:仅中文
    插件版本:1.6
    下载插件:axupimgs.zip
    使用方法:将解压得到的文件夹,放到TinyMCE主目录下的plugins文件夹内。

作用:这是一个tinymce多图片批量上传插件,支持拖拽文件添加,拖拽支持白名单,自动过滤非白名单文件类型,支持全选后直接无脑拽。

    注意:此插件依赖image插件,不能单独使用。



新增这些功能:https://github.com/Five-great/tinymce-plugins
bdmap axupimgs letterspacing layout attachment importword upfile



http://tinymce.ax-z.cn/more-plugins/more-index.php
« Last Edit: May 24, 2021, 07:28:23 PM by laofuzi »
发达国家无犯罪证明Police Certificate/Criminal Record/海牙认证/使馆认证:www.newnewdoc.com 加拿大技术移民:www.newnewland.com  微信咨询:newnewlandvisa

laofuzi

  • Hero Member
  • *****
  • Posts: 5091
编辑器的工具栏(后来查证,好像2.版本的tinymce直接就有下滑进度条,根本不用悬浮。哎,版本越高还退化了。)

当输入内容很多时,调整底下内容的格式需要指标翻到最上面来选择比如字体和颜色,工具栏不会跟着内容往下走。现在需要将工具栏往下输入内容时,一直悬浮在页面,方便随时调整格式。

网上找到这个链接 https://gitee.com/isszz/tinymce.toolbarsticky ,这里的攻略是对的。但是他的代码默认是不开启的。而要实现这个功能,必须把这个开启。cfyun_toolbar_sticky   不开启   插件开关怎么开启呢,就是r=t.getParam("cfyun_toolbar_sticky",!0把网页里他挂的代码里的!1改成!0,这样就开启了。



以下是tinymce的plugins的文件夹toolbarsticky/plugin.min.js的完整代码。可以用notepad打开一个别的插件一个的文件,然后粘贴进去就行。把这个文件夹放到tinymce的plugins里面,然后网站后台plugins里加入toolbarsticky就实现了这个功能。


/**
 * Copyright (c) Tiny Technologies, Inc. All rights reserved.
 * Licensed under the LGPL or a commercial license.
 * For LGPL see License.txt in the project root for license information.
 * For commercial licenses see https://www.tiny.cloud/
 *
 * Version: 5.3.1 (2020-05-27)
 */
!function(){"use strict";let t=tinymce.util.Tools.resolve("tinymce.PluginManager"),e=("undefined"!=typeof window?window:Function("return this;")(),{}),o={},i=!0,r=!1,n=null,s=0,l=null;class c{constructor(t){if(!(r=t.getParam("cfyun_toolbar_sticky",!0,"bool")))return;i=t.getParam("toolbar_sticky_type",!0,"bool"),n=t.getParam("toolbar_sticky_elem","","string"),l=t.getParam("toolbar_sticky_wrap","","string"),s=t.getParam("toolbar_sticky_elem_height",0,"number"),this.editor=t,o.wrap=window,o.editor=t.$(t.container),o.header=o.editor.find(".tox-editor-header"),o.container=o.editor.find(".tox-editor-container"),o.elemHeight=s,l&&"string"==typeof l&&"body"!=l&&(o.wrap=document.querySelector(l)||window);let e=this;return i?(t.on("focus",()=>{e.bind()}),t.on("blur",()=>{e.restore(),e.unBind()})):this.bind(),this}sticky(){return o.editor.hasClass("tox-fullscreen")?(this.restore(),!1):(this.position(),e.isSticky?(o.container.css("padding-top",o.header[0].clientHeight),o.editor.removeClass("tox-tinymce--toolbar-sticky-off").addClass("tox-tinymce--toolbar-sticky-on"),o.header.css({position:"fixed",width:e.width,left:e.left,top:o.elemHeight||0,borderTop:"1px solid #ccc"}),!1):void this.restore())}position(){let t=o.elemHeight;if(n){var i=document.querySelector(n);if(!i)return this.editor.notificationManager.open({text:"ToolbarSticky未获取到:预留位置DOM节点,请查看配置toolbar_sticky_elem。",type:"info"}),!1;t=i.offsetHeight,o.elemHeight=i.clientHeight}e.width=this.editor.container.clientWidth,e.left=o.editor.offset().left+1,e.isSticky=this.scrollTop()>=this.editor.$(o.container).offset().top-t}bind(){o.wrap.addEventListener("scroll",this.throttle(this.sticky.bind(this),60),!1),o.wrap.addEventListener("resize",this.throttle(this.sticky.bind(this),60),!1),this.sticky()}unBind(){o.wrap.removeEventListener("scroll",this.throttle(this.sticky.bind(this),60)),o.wrap.removeEventListener("resize",this.throttle(this.sticky.bind(this),60))}restore(){o.header.attr("style",""),o.container.css("padding-top",0),o.editor.removeClass("tox-tinymce--toolbar-sticky-on").addClass("tox-tinymce--toolbar-sticky-off")}destroy(){e=o={},this.unBind(),this.restore()}scrollTop(){return document.body.scrollTop||document.documentElement.scrollTop||window.pageYOffset}now(){return Date.now()||(new Date).getTime()}throttle(t,e){let o,i,r,n=this,s=null,l=0;const c=()=>{l=0,s=null,r=t.apply(o,i),s||(o=i=null)};return()=>{let a=n.now();l||(l=a);let d=e-(a-l);return o=this,i=arguments,d<=0||d>e?(s&&(clearTimeout(s),s=null),l=a,r=t.apply(o,i),s||(o=i=null)):s||(s=setTimeout(c,d)),r}}}t.add("toolbarsticky",function(t){t.on("init",function(e){new c(t)})})}();
« Last Edit: May 27, 2021, 12:19:09 PM by laofuzi »
发达国家无犯罪证明Police Certificate/Criminal Record/海牙认证/使馆认证:www.newnewdoc.com 加拿大技术移民:www.newnewland.com  微信咨询:newnewlandvisa

laofuzi

  • Hero Member
  • *****
  • Posts: 5091
Re: 【天问】cms made simple的tinymce编辑器的plugins and toolbar
« Reply #7 on: June 22, 2021, 10:16:29 AM »
加入数学公式;http://tinymce.ax-z.cn/more-plugins/kityformula-editor.php

此页更新时间:2021-06-08 09:47

此页英文文档:无

插件作者:HGC
支持版本:5+
支持语言:不限
下载插件:kityformula-editor.zip
使用方法:将解压得到的文件夹,放到TinyMCE主目录下的plugins文件夹内。
作用:插入编辑数学公式!

然后再系统后台plugins 和toolbar加入kityformula-editor
发达国家无犯罪证明Police Certificate/Criminal Record/海牙认证/使馆认证:www.newnewdoc.com 加拿大技术移民:www.newnewland.com  微信咨询:newnewlandvisa

laofuzi

  • Hero Member
  • *****
  • Posts: 5091
Re: 【天问】cms made simple的tinymce编辑器的plugins and toolbar
« Reply #8 on: October 25, 2021, 05:38:02 PM »
autoresize这个plugins很重要,跟indent插件一样放到指定位置,同时plugins引入aturesize插件。这样文章编辑框会自适应大小,不加入这个插件,编辑框就直接没有空白的地方,需要手动拖动右下角的框调整编辑框的大小。中文手册网站或者以前保存的跟目标文档里有。

http://tinymce.ax-z.cn/plugins/autoresize.php
« Last Edit: October 25, 2021, 06:03:32 PM by laofuzi »
发达国家无犯罪证明Police Certificate/Criminal Record/海牙认证/使馆认证:www.newnewdoc.com 加拿大技术移民:www.newnewland.com  微信咨询:newnewlandvisa