-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathREADME
51 lines (43 loc) · 1.69 KB
/
README
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
Copy all files to your CLOSURE_HOME/goog/editor/plugins directory.
Require the plugins:
goog.require('goog.editor.plugins.ImagePlugin');
goog.require('goog.editor.plugins.ImageDialogPlugin');
Then register the plugins:
myField.registerPlugin(new goog.editor.plugins.ImagePlugin());
myField.registerPlugin(new goog.editor.plugins.ImageDialogPlugin());
You can use the Image button from Google, or your own custom button. I use the Image button from Google.
var buttons = [
goog.editor.Command.BOLD,
goog.editor.Command.ITALIC,
goog.editor.Command.UNDERLINE,
goog.editor.Command.FONT_COLOR,
goog.editor.Command.BACKGROUND_COLOR,
goog.editor.Command.FONT_FACE,
goog.editor.Command.FONT_SIZE,
goog.editor.Command.LINK,
goog.editor.Command.UNDO,
goog.editor.Command.REDO,
goog.editor.Command.UNORDERED_LIST,
goog.editor.Command.ORDERED_LIST,
goog.editor.Command.JUSTIFY_LEFT,
goog.editor.Command.JUSTIFY_CENTER,
goog.editor.Command.JUSTIFY_RIGHT,
goog.editor.Command.SUBSCRIPT,
goog.editor.Command.SUPERSCRIPT,
goog.editor.Command.STRIKE_THROUGH,
goog.editor.Command.IMAGE,
goog.editor.Command.REMOVE_FORMAT
];
If you are using the built-in Image button from Google, then make this change in CLOSURE_HOME/goog/editor/command.js:
goog.editor.Command = {
.
.
.
.
IMAGE: 'ImageDialog'
}
If the bubble is not removed on making the field uneditable, call this (by listening to goog.editor.Field.EventType.DELAYEDCHANGE/CHANGE):
goog.editor.plugins.HelloWorld.removeAllBubbles();
to remove any instances.
TODO: Remove goog.ui.Bubble and use LinkBubble from closure-rev157.
Do not forget to calculate the dependencies.