Created
November 18, 2014 20:53
-
-
Save bryanbraun/35b7962f29fab3f2240f to your computer and use it in GitHub Desktop.
A patch to CKEditor's image2 plugin, which makes the alt text field required.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
From f788a1a6c27be0fb421d2758492f9366b895ba20 Mon Sep 17 00:00:00 2001 | |
From: Bryan Braun <[email protected]> | |
Date: Tue, 18 Nov 2014 14:43:17 -0500 | |
Subject: [PATCH] Make the alt-text field required (and add a class for styling | |
it). | |
Signed-off-by: Bryan Braun <[email protected]> | |
--- | |
dialogs/image2.js | 4 +++- | |
1 file changed, 3 insertions(+), 1 deletion(-) | |
diff --git a/dialogs/image2.js b/dialogs/image2.js | |
index 319be69..0fb7021 100644 | |
--- a/dialogs/image2.js | |
+++ b/dialogs/image2.js | |
@@ -425,13 +425,15 @@ CKEDITOR.dialog.add( 'image2', function( editor ) { | |
{ | |
id: 'alt', | |
type: 'text', | |
+ className: 'ck-alt-required', | |
label: lang.alt, | |
setup: function( widget ) { | |
this.setValue( widget.data.alt ); | |
}, | |
commit: function( widget ) { | |
widget.setData( 'alt', this.getValue() ); | |
- } | |
+ }, | |
+ validate: CKEDITOR.dialog.validate.notEmpty( 'Alternative text is required.' ) | |
}, | |
{ | |
type: 'hbox', | |
-- | |
2.0.4 | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment