forked from prlambert/sproutcore-wysiwyg
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcore.js
76 lines (71 loc) · 2 KB
/
core.js
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
68
69
70
71
72
73
74
75
/*-------------------------------------------------------------------------------------------------
- Project: Sproutcore WYSIWYG -
- Copyright: ©2012 Matygo Educational Incorporated operating as Learndot -
- Author: Joe Gaudet ([email protected]) and contributors (see contributors.txt) -
- License: Licensed under MIT license (see license.js) -
-------------------------------------------------------------------------------------------------*/
/*globals SC */
SproutCoreWysiwyg = SC.Object.create(
/** @scope SproutcoreWysiwyg.prototype */
{
NAMESPACE: 'SproutcoreWysiwyg',
VERSION: '1.0.2',
styles: [ {
value: 'p',
title: 'Paragraph',
keyEquivalent: 'alt_ctrl_0',
height: 28,
action: 'formatBlock'
}, {
value: 'h1',
title: '<h1>Heading 1</h1>',
keyEquivalent: 'alt_ctrl_1',
height: 40,
action: 'formatBlock'
}, {
value: 'h2',
title: '<h2>Heading 2</h2>',
keyEquivalent: 'alt_ctrl_2',
height: 36,
action: 'formatBlock'
}, {
value: 'h3',
title: '<h3>Heading 3</h3>',
keyEquivalent: 'alt_ctrl_3',
height: 34,
action: 'formatBlock'
}, {
value: 'h4',
title: '<h4>Heading 4</h4>',
keyEquivalent: 'alt_ctrl_4',
height: 30,
action: 'formatBlock'
}, {
value: 'h5',
title: '<h5>Heading 5</h5>',
keyEquivalent: 'alt_ctrl_5',
height: 25,
action: 'formatBlock'
}, {
value: 'h6',
title: '<h6>Heading 6</h6>',
keyEquivalent: 'alt_ctrl_6',
height: 24,
action: 'formatBlock'
} ],
beautifyShortcut: function (shortcut) {
if (shortcut) {
if (SC.browser.isMac) {
shortcut = shortcut.replace('ctrl_', '⌘');
shortcut = shortcut.replace('shift_', '⇧');
shortcut = shortcut.replace('alt_', '⌥');
}
else {
shortcut = shortcut.replace('ctrl_', 'Ctrl+');
shortcut = shortcut.replace('shift_', 'Shift+');
shortcut = shortcut.replace('alt_', 'Alt+');
}
}
return shortcut;
},
});