MyBB.de Forum

Normale Version: Neue Schriftfarben hinzufügen
Du siehst gerade eine vereinfachte Darstellung unserer Inhalte. Normale Ansicht mit richtiger Formatierung.
Hallo,

wie kann man denn neue Schriftfarben in MyBB 1.2.3 ändern / hinzufügen ?
Zwar wird in der Editor.js ein Array mit den Farben angelegt, allerdings kann ich nirgendwo ein Farbdefinition aller zum Beispiel: #861c1c finden...

Dann hab ich zu den Schriftfarben in der Editor.js Datei gefunden:

Code:
// An array of colours to be shown.
        this.colors = new Array();
        this.colors["white"] = this.options.lang.color_white;
        this.colors["black"] = this.options.lang.color_black;
        this.colors["red"] = this.options.lang.color_red;
        this.colors["yellow"] = this.options.lang.color_yellow;
        this.colors["pink"] = this.options.lang.color_pink;
        this.colors["green"] = this.options.lang.color_green;
        this.colors["orange"] = this.options.lang.color_orange;
        this.colors["purple"] = this.options.lang.color_purple;
        this.colors["blue"] = this.options.lang.color_blue;
        this.colors["beige"] = this.options.lang.color_beige;
        this.colors["brown"] = this.options.lang.color_brown;
        this.colors["teal"] = this.options.lang.color_teal;
        this.colors["navy"] = this.options.lang.color_navy;
        this.colors["maroon"] = this.options.lang.color_maroon;
        this.colors["limegreen"] = this.options.lang.color_limegreen;

Das erzeugt ja nur ein Array mit diesen Einträgen.

Code:
// Create the colour drop down.
        colorSelect = document.createElement("select");
        colorSelect.style.margin = "2px";
        colorSelect.id = "color";
        colorSelect.options[colorSelect.options.length] = new Option(this.options.lang.color, "-");
        
        for(color in this.colors)
        {
            colorSelect.options[colorSelect.options.length] = new Option(this.colors[color], color);
            colorSelect.options[colorSelect.options.length-1].style.backgroundColor = color;
            colorSelect.options[colorSelect.options.length-1].style.color = color;
        }
        Event.observe(colorSelect, "change", this.changeColor.bindAsEventListener(this));
        textFormatting.appendChild(colorSelect);

und dann gibt es in der Editor.js noch so etwas, dass scheint ein Listener zu sein, der die Auswahl der Farbe mitbekommt und dann diese Methode textFormatting.appendChild(colorSelect); aufruft...

Mfg,

Dyers Eve
Suche nach:
Code:
this.colors["limegreen"] = this.options.lang.color_limegreen;
Darunter einfügen:
Code:
this.colors["#xxxxxx"] = 'NAME_DER_FARBE';
Okay, ich hab das so gemacht, und die Farbeklappt auch wunderbar,
jetzt gibts nur ein optisches Problemwenn man die Farbe anwählt steht der Farben namen nicht drinnen (bei den anderen erscheint ja der Farbennamen wenn man mit der MAus drüber fährt)
Alsoes ist nicht schlimm, aber wenn es trotzdem ne lösunggebenwürde, wäre ich dankbar, dann wäre das Forum wieder perfekt
Eigentlich wird der Name aber im Code angegeben.