-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathHFRichTextEditorPreset.java
67 lines (57 loc) · 3.05 KB
/
HFRichTextEditorPreset.java
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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
package com.healthfortis.map.shared.client.ui;
import java.util.HashMap;
import java.util.Map;
@SuppressWarnings("unchecked")
public class HFRichTextEditorPreset {
@SuppressWarnings("rawtypes")
public static Map PRESET_VERSION3_BASIC= new HashMap();
@SuppressWarnings("rawtypes")
public static Map PRESET_VERSION3_ADVANCED = new HashMap();
@SuppressWarnings("rawtypes")
public static Map PRESET_VERSION4_COMMON = new HashMap();
@SuppressWarnings("rawtypes")
public static Map PRESET_VERSION4_BASIC = new HashMap();
@SuppressWarnings("rawtypes")
public static Map PRESET_VERSION4_ADVANCED = new HashMap();
static {
PRESET_VERSION3_BASIC.put("theme", "simple");
PRESET_VERSION3_ADVANCED.put("theme", "advanced");
PRESET_VERSION3_ADVANCED.put("theme_advanced_resizing", true);
PRESET_VERSION3_ADVANCED.put("theme_advanced_resize_horizontal", true);
PRESET_VERSION3_ADVANCED.put("theme_advanced_resize_vertical", true);
PRESET_VERSION4_COMMON.put("theme", "modern");
PRESET_VERSION4_COMMON.put("plugins", "textcolor advlist autolink lists link image charmap preview anchor searchreplace visualblocks code insertdatetime table contextmenu paste tabfocus");
PRESET_VERSION4_COMMON.put("browser_spellcheck", true);
PRESET_VERSION4_COMMON.put("forced_root_block", false);
PRESET_VERSION4_COMMON.put("force_p_newlines", false);
PRESET_VERSION4_COMMON.put("force_br_newlines", true);
PRESET_VERSION4_COMMON.put("setup", "hfrichtexteditorSetupCallback");
PRESET_VERSION4_COMMON.put("init_instance_callback", "hfrichtexteditorInitCallback");
PRESET_VERSION4_BASIC.putAll(PRESET_VERSION4_COMMON);
PRESET_VERSION4_BASIC.put("toolbar", false);
PRESET_VERSION4_BASIC.put("menubar", false);
PRESET_VERSION4_BASIC.put("statusbar", false);
PRESET_VERSION4_ADVANCED.putAll(PRESET_VERSION4_COMMON);
PRESET_VERSION4_ADVANCED.put("menubar", "edit insert view format table tools");
PRESET_VERSION4_ADVANCED.put("toolbar", "undo redo | styleselect | bold italic | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | link image");
}
private HFRichTextEditorPreset() {}
@SuppressWarnings("rawtypes")
public static Map getBasicOptions() {
if (HFRichTextEditor.libraryVersion == HFRichTextEditor.TINYMCE_VERSION_3) {
return PRESET_VERSION3_BASIC;
} else if (HFRichTextEditor.libraryVersion == HFRichTextEditor.TINYMCE_VERSION_4) {
return PRESET_VERSION4_BASIC;
}
return new HashMap();
}
@SuppressWarnings("rawtypes")
public static Map getAdvancedOptions() {
if (HFRichTextEditor.libraryVersion == HFRichTextEditor.TINYMCE_VERSION_3) {
return PRESET_VERSION3_ADVANCED;
} else if (HFRichTextEditor.libraryVersion == HFRichTextEditor.TINYMCE_VERSION_4) {
return PRESET_VERSION4_ADVANCED;
}
return new HashMap();
}
}