从 Derobins 的 WMD 编辑器中删除工具栏按钮

发布于 2024-10-29 05:04:27 字数 89 浏览 7 评论 0原文

我正在尝试 Derobins WMD 编辑器,但想知道在哪里可以删除标题处的一些按钮,因为我的 PHP 应用程序中不需要它们。

图片、锚链接等按钮。

I am trying-out Derobins WMD Editor but would like to know where I can remove some of the buttons at the header since I don't need them in my PHP app.

Buttons like image, anchor link etc.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

甜心小果奶 2024-11-05 05:04:27

在 wmd.js 文件中,有一个名为 ma​​keSpritedButtonRow 的函数,用于创建菜单上的每个按钮。它位于文件第 913 行附近。

创建每个按钮的代码组合在一起,要禁用按钮,您需要注释掉要删除的按钮的代码块。

示例

下面是函数顶部的摘录。

var makeSpritedButtonRow = function(){

    var buttonBar = document.getElementById("wmd-button-bar");

    var normalYShift = "0px";
    var disabledYShift = "-20px";
    var highlightYShift = "-40px";

    var buttonRow = document.createElement("ul");
    buttonRow.id = "wmd-button-row";
    buttonRow = buttonBar.appendChild(buttonRow);


    var boldButton = document.createElement("li");
    boldButton.className = "wmd-button";
    boldButton.id = "wmd-bold-button";
    boldButton.title = "Strong <strong> Ctrl+B";
    boldButton.XShift = "0px";
    boldButton.textOp = command.doBold;
    setupButton(boldButton, true);
    buttonRow.appendChild(boldButton);

要在应用程序中禁用粗体按钮,请注释掉粗体按钮的代码块,使其类似于下面的代码。

var makeSpritedButtonRow = function(){

    var buttonBar = document.getElementById("wmd-button-bar");

    var normalYShift = "0px";
    var disabledYShift = "-20px";
    var highlightYShift = "-40px";

    var buttonRow = document.createElement("ul");
    buttonRow.id = "wmd-button-row";
    buttonRow = buttonBar.appendChild(buttonRow);

    // var boldButton = document.createElement("li");
    // boldButton.className = "wmd-button";
    // boldButton.id = "wmd-bold-button";
    // boldButton.title = "Strong <strong> Ctrl+B";
    // boldButton.XShift = "0px";
    // boldButton.textOp = command.doBold;
    // setupButton(boldButton, true);
    // buttonRow.appendChild(boldButton);

这将删除该按钮。

In the wmd.js file, there is a function called makeSpritedButtonRow which is used to create each of the buttons on the menu. This is located around line 913 of the file.

The code to create each button is grouped together and to disable a button you need to comment out the code block for the button you want to remove.

Example

Below is an extract from the top of the function.

var makeSpritedButtonRow = function(){

    var buttonBar = document.getElementById("wmd-button-bar");

    var normalYShift = "0px";
    var disabledYShift = "-20px";
    var highlightYShift = "-40px";

    var buttonRow = document.createElement("ul");
    buttonRow.id = "wmd-button-row";
    buttonRow = buttonBar.appendChild(buttonRow);


    var boldButton = document.createElement("li");
    boldButton.className = "wmd-button";
    boldButton.id = "wmd-bold-button";
    boldButton.title = "Strong <strong> Ctrl+B";
    boldButton.XShift = "0px";
    boldButton.textOp = command.doBold;
    setupButton(boldButton, true);
    buttonRow.appendChild(boldButton);

To disable the bold button in your application, comment out the code block for the boldButton so it looks like the code below.

var makeSpritedButtonRow = function(){

    var buttonBar = document.getElementById("wmd-button-bar");

    var normalYShift = "0px";
    var disabledYShift = "-20px";
    var highlightYShift = "-40px";

    var buttonRow = document.createElement("ul");
    buttonRow.id = "wmd-button-row";
    buttonRow = buttonBar.appendChild(buttonRow);

    // var boldButton = document.createElement("li");
    // boldButton.className = "wmd-button";
    // boldButton.id = "wmd-bold-button";
    // boldButton.title = "Strong <strong> Ctrl+B";
    // boldButton.XShift = "0px";
    // boldButton.textOp = command.doBold;
    // setupButton(boldButton, true);
    // buttonRow.appendChild(boldButton);

This will remove the button.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文