1

TinyMCE のテーマを作成していますが、エディターでのボタンのレンダリング方法を変更する必要があります。

これを行うには、メインのtiny_mce.jsファイルのいくつかのコードを renderHTML メソッドで変更します。

    renderHTML : function() {
        var cp = this.classPrefix, s = this.settings, h, l;

        l = DOM.encode(s.label || '');
        h = '<a role="button" id="' + this.id + '" href="javascript:;" class="' + cp + ' ' + cp + 'Enabled ' + s['class'] + (l ? ' ' + cp + 'Labeled' : '') +'" onmousedown="return false;" onclick="return false;" aria-labelledby="' + this.id + '_voice" title="' + DOM.encode(s.title) + '">';
        if (s.image && !(this.editor  &&this.editor.forcedHighContrastMode) )
            h += '<img class="mceIcon" src="' + s.image + '" alt="' + DOM.encode(s.title) + '" />' + l;
        else
            h += '<span class="mceIcon ' + s['class'] + '"></span>' + (l ? '<span class="' + cp + 'Label">' + l + '</span>' : '');

        h += '<span class="mceVoiceLabel mceIconOnly" style="display: none;" id="' + this.id + '_voice">' + s.title + '</span>'; 
        h += '</a>';
        return h;
    },

しかし、私が作成している特定のテーマのためだけにこれを行う必要があります。メインの tiny_mce.js ソース ファイルに手を加えるのではなく、テーマのeditor_template.jsファイルの renderHTML メソッドの動作を変更する方法はありますか? 私はこれを行う方法を見つけることができませんでした。

4

0 に答える 0