Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/451.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 禁用/启用html元素显示的tinymce按钮的名称是什么?_Javascript_Tinymce_Wysiwyg - Fatal编程技术网

Javascript 禁用/启用html元素显示的tinymce按钮的名称是什么?

Javascript 禁用/启用html元素显示的tinymce按钮的名称是什么?,javascript,tinymce,wysiwyg,Javascript,Tinymce,Wysiwyg,我完全忘记了那个按钮的名称,它禁用了元素的名称,比如h3标题、段落等等,看看图片。 我正在寻找您为tinymce在init函数上输入的名称 我的完整tinymce_setup.js function CustomFileBrowser(field_name, url, type, win) { var cmsURL = '/admin/filebrowser/browse/?pop=2'; cmsURL = cmsURL + '&type=' + type;

我完全忘记了那个按钮的名称,它禁用了元素的名称,比如h3标题、段落等等,看看图片。

我正在寻找您为tinymce在init函数上输入的名称

我的完整tinymce_setup.js

function CustomFileBrowser(field_name, url, type, win) {

    var cmsURL = '/admin/filebrowser/browse/?pop=2';
    cmsURL = cmsURL + '&type=' + type;

    tinyMCE.activeEditor.windowManager.open({
        file: cmsURL,
        width: 980,  // Your dimensions may differ - toy around with them!
        height: 500,
        resizable: 'yes',
        scrollbars: 'yes',
        inline: 'no',  // This parameter only has an effect if you use the inlinepopups plugin!
        close_previous: 'no'
    }, {
        window: win,
        input: field_name,
        editor_id: tinyMCE.selectedInstance.editorId
    });
    return false;
}

tinyMCE.init({

    // Init
    mode: 'textareas',
    theme: 'advanced',
    skin: 'grappelli',

    // General
    //accessibility_warnings: false,
    browsers: 'gecko,msie,safari,opera',
    dialog_type: 'window',
    editor_deselector: 'mceNoEditor',
    keep_styles: false,
    language: 'en',
    object_resizing: false,
    media_strict: true,

    // Callbackss
    file_browser_callback: 'CustomFileBrowser',

    // Layout
    width: 758,
    height: 300,
    indentation: '10px',

    // Cleanup
    cleanup: true,
    cleanup_on_startup: true,
    element_format: 'xhtml',
    fix_list_elements: true,
    fix_table_elements: true,
    fix_nesting: true,
    forced_root_block : 'p',

    // URL
    relative_urls: false,
    remove_script_host: true,

    // Content CSS
    // content_css : "css/example.css",

    // Plugins
    plugins: 'advimage,advlink,fullscreen,paste,media,searchreplace,grappelli,grappelli_contextmenu,template',

    // Theme Advanced
    theme_advanced_toolbar_location: 'top',
    theme_advanced_toolbar_align: 'left',
    theme_advanced_statusbar_location: 'bottom',
    theme_advanced_buttons1: 'formatselect,styleselect,|,bold,italic,underline,|,bullist,numlist,blockquote,|,undo,redo,|,link,unlink,|,justifyleft,justifycenter,justifyright,justifyfull,|,grappelli_adv',
    theme_advanced_buttons2: 'search,|,pasteword,template,media,charmap,|,code,|,table,cleanup,|,image,|,fullscreen,|,ibrowser,',
    theme_advanced_buttons3: '',
    theme_advanced_path: false,
    theme_advanced_blockformats: 'p,h2,h3,h4,pre',
    theme_advanced_resizing: true,
    theme_advanced_resize_horizontal: false,
    theme_advanced_resizing_use_cookie: true,
    theme_advanced_styles: 'Image Left=img_left;Image Right=img_right;Image Block=img_block',

    // Style formats
    // see http://wiki.moxiecode.com/index.php/TinyMCE:Configuration/style_formats
    style_formats : [
        {title : 'Paragraph Small', block : 'p', classes: 'p_small'},
        {title : 'Paragraph ImageCaption', block : 'p', classes: 'p_caption'},
        {title : 'Clearfix', block : 'p', classes: 'clearfix'},
        {title : 'Code', block : 'p', classes: 'code'}
    ],

    // Templates
    template_templates : [
        {
            title : '2 Columns',
            src : '/path/to/your/template/',
            description : '2 Columns.'
        },
        {
            title : '4 Columns',
            src : '/path/to/your/template/',
            description : '4 Columns.'
        }
    ],

    // Adv
    advlink_styles: 'Internal Link=internal;External Link=external',
    advimage_update_dimensions_onchange: true,

    // Grappelli
    grappelli_adv_hidden: false,
    grappelli_show_documentstructure: 'on',

    extended_valid_elements : "iframe[src|width|height|name|align]", 

});

我不能完全确定你指的是哪个按钮,但我建议你看看tinymce演示页面,你可以在那里找到你的按钮:

经过一些尝试,我找到了一个适合我的解决方案

打开/关闭此功能的按钮位于Grappelli TinyMCE主题第二行的最右侧:

这个按钮的值(开/关)存储在一个cookie中(这很重要,因为我一直在努力弄清楚为什么删除这个按钮的更改不起作用)

完全删除此功能

我想我永远都不需要使用这个按钮的功能,所以我决定完全删除它。 在tinymce\u setup.js文件中,找到此行

grappelli_show_documentstructure: "on"
并将其更改为

grappelli_show_documentstructure: false
这将在初始加载时将按钮的状态设置为“关闭”。现在请记住,按钮的状态很可能已在cookie中设置为“打开”,因此,如果您尝试刷新页面,但页面仍在显示,这是由于cookie中的值被读取并用于显示此选项。关闭按钮(这将更改设置cookie中的值),或者清除浏览器的cookie。 在我确保cookies值设置为off后,如前所述,我不再使用此按钮,因此要将其从您的任务栏中删除,我们希望从窗口任务栏中删除grappelli_documentstructure按钮-查看以下行

theme_advanced_buttons2: 'search,|,pasteword,template,media,charmap,|,code,|,table,cleanup,grappelli_documentstructure'
只需删除grappelli\u documentstructure按钮即可

theme_advanced_buttons2: 'search,|,pasteword,template,media,charmap,|,code,|,table,cleanup'

如何禁用那些H3,段落,段落的显示,我知道我在某个时候禁用了,但我不记得怎么禁用。请发布完整的tinymce配置