Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/tfs/3.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
在pagedown上隐藏按钮_Pagedown - Fatal编程技术网

在pagedown上隐藏按钮

在pagedown上隐藏按钮,pagedown,Pagedown,我现在正在我的网站上使用,到目前为止它非常棒,唯一的细节是 这不是一个面向编程的网站,所以我想删除“代码”按钮 有什么办法我能做到吗?我尝试使用CSS隐藏按钮,但html有内联样式“left:xxx”,我无法使用CSS更改 提前谢谢 如果打开Markdown.Editor.js,并滚动到大约第1360行(这取决于您使用的版本),您将看到一个包含以下内容的区域: group1 = makeGroup(1); buttons.bold = makeButton("wmd-bold-button",

我现在正在我的网站上使用,到目前为止它非常棒,唯一的细节是 这不是一个面向编程的网站,所以我想删除“代码”按钮

有什么办法我能做到吗?我尝试使用CSS隐藏按钮,但html有内联样式“left:xxx”,我无法使用CSS更改


提前谢谢

如果打开Markdown.Editor.js,并滚动到大约第1360行(这取决于您使用的版本),您将看到一个包含以下内容的区域:

group1 = makeGroup(1);
buttons.bold = makeButton("wmd-bold-button", "Bold - Ctrl+B", "icon-bold", bindCommand("doBold"), group1);
buttons.italic = makeButton("wmd-italic-button", "Italic - Ctrl+I", "icon-italic", bindCommand("doItalic"), group1);

group2 = makeGroup(2);
buttons.link = makeButton("wmd-link-button", "Link - Ctrl+L", "icon-link", bindCommand(function (chunk, postProcessing) {
  return this.doLinkOrImage(chunk, postProcessing, false);
}), group2);
buttons.quote = makeButton("wmd-quote-button", "Blockquote - Ctrl+Q", "icon-blockquote", bindCommand("doBlockquote"), group2);
buttons.code = makeButton("wmd-code-button", "Code Sample - Ctrl+K", "icon-code", bindCommand("doCode"), group2);
buttons.image = makeButton("wmd-image-button", "Image - Ctrl+G", "icon-picture", bindCommand(function (chunk, postProcessing) {
  return this.doLinkOrImage(chunk, postProcessing, true);
}), group2);
诸如此类。简单地引用你不想要的按钮

或者,您可以省去整个wmd按钮div,只使用编辑器和预览组件。

  • 在代码中搜索
    doClick(buttons.code)
    ,并将其注释掉

  • 如果查看makeButton函数:

    var makeButton = function (id, title, XShift, textOp) {
    var button = document.createElement("li");
    button.className = "wmd-button";
    button.style.left = xPosition + "px";
    xPosition += 25;
    var buttonImage = document.createElement("span");
    button.id = id + postfix;
    button.appendChild(buttonImage);
    button.title = title;
    button.XShift = XShift;
    if (textOp)
        button.textOp = textOp;
    setupButton(button, true); // <--- LOOK HERE
    buttonRow.appendChild(button);
    return button;
    
    buttons.code = makeButton2("wmd-code-button", getString("code"), "-80px", bindCommand("doCode"));