Skip to content

Commit 383d7ae

Browse files
author
Oliver Pulges
committed
Merge pull request #73 from tremby/wysihtml5
--- This is tiff/wysihtml5#461 which I wrote last year some time, rebased on to your fork. This patch allows the classes set on toolbar buttons to be set in the wysihtml5 configuration, as `classNameCommandDisabled`, `classNameCommandsDisabled`, `classNameCommandActive`, `classNameActionActive`. I already have disabled and active classes provided by Twitter Bootstrap and dont want to trawl through the source files and apply all relevant styles to wysihtml5-specific classes too -- this is a very nice short cut.
2 parents 5525a1b + b25f36f commit 383d7ae

File tree

5 files changed

+30
-4
lines changed

5 files changed

+30
-4
lines changed

dist/wysihtml5x-toolbar.js

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13478,6 +13478,19 @@ wysihtml5.views.View = Base.extend(
1347813478
this._observe();
1347913479
if (showOnInit) { this.show(); }
1348013480

13481+
if (editor.config.classNameCommandDisabled != null) {
13482+
CLASS_NAME_COMMAND_DISABLED = editor.config.classNameCommandDisabled;
13483+
}
13484+
if (editor.config.classNameCommandsDisabled != null) {
13485+
CLASS_NAME_COMMANDS_DISABLED = editor.config.classNameCommandsDisabled;
13486+
}
13487+
if (editor.config.classNameCommandActive != null) {
13488+
CLASS_NAME_COMMAND_ACTIVE = editor.config.classNameCommandActive;
13489+
}
13490+
if (editor.config.classNameActionActive != null) {
13491+
CLASS_NAME_ACTION_ACTIVE = editor.config.classNameActionActive;
13492+
}
13493+
1348113494
var speechInputLinks = this.container.querySelectorAll("[data-wysihtml5-command=insertSpeech]"),
1348213495
length = speechInputLinks.length,
1348313496
i = 0;

dist/wysihtml5x-toolbar.min.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/wysihtml5x-toolbar.min.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/wysihtml5x.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/toolbar/toolbar.js

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,19 @@
3434
this._observe();
3535
if (showOnInit) { this.show(); }
3636

37+
if (editor.config.classNameCommandDisabled != null) {
38+
CLASS_NAME_COMMAND_DISABLED = editor.config.classNameCommandDisabled;
39+
}
40+
if (editor.config.classNameCommandsDisabled != null) {
41+
CLASS_NAME_COMMANDS_DISABLED = editor.config.classNameCommandsDisabled;
42+
}
43+
if (editor.config.classNameCommandActive != null) {
44+
CLASS_NAME_COMMAND_ACTIVE = editor.config.classNameCommandActive;
45+
}
46+
if (editor.config.classNameActionActive != null) {
47+
CLASS_NAME_ACTION_ACTIVE = editor.config.classNameActionActive;
48+
}
49+
3750
var speechInputLinks = this.container.querySelectorAll("[data-wysihtml5-command=insertSpeech]"),
3851
length = speechInputLinks.length,
3952
i = 0;

0 commit comments

Comments
 (0)