|
@@ -23,3 +23,114 @@
|
23
|
23
|
<sup class="pod-item-nb-sup-block"> ${len(plItemList)}</sup>
|
24
|
24
|
% endif
|
25
|
25
|
</%def>
|
|
26
|
+
|
|
27
|
+<%def name='RichTextEditorToolbar(psRichTextEditorNodeId, psMenuOptions="styles|boldanditalic|lists|justifiers|links|images|undoredo|fullscreen")'>
|
|
28
|
+ <div class="btn-toolbar" data-role="${psRichTextEditorNodeId}-toolbar" data-target="${psRichTextEditorNodeId}">
|
|
29
|
+ % if psMenuOptions.find('styles')>=0:
|
|
30
|
+ <div class="btn-group">
|
|
31
|
+ <a class="btn" data-edit="formatBlock p" title="Normal paragraph">§</h1></a></li>
|
|
32
|
+ <a class="btn" data-edit="formatBlock pre" title="Fixed width (code)">C</h1></a>
|
|
33
|
+ <a class="btn" data-edit="formatBlock h1" title="Title - level 1">h1</a>
|
|
34
|
+ <a class="btn" data-edit="formatBlock h2" title="Title - level 2">h2</a>
|
|
35
|
+ <a class="btn" data-edit="formatBlock h3" title="Title - level 3">h3</a>
|
|
36
|
+ <a class="btn" data-edit="formatBlock h4" title="Title - level 4">h4</a>
|
|
37
|
+ <a class="btn" data-edit="formatBlock h5" title="Title - level 5">h5</a>
|
|
38
|
+ <a class="btn" data-edit="formatBlock h6" title="Title - level 6">h6</a>
|
|
39
|
+ </div>
|
|
40
|
+ % endif
|
|
41
|
+ % if psMenuOptions.find('boldanditalic')>=0:
|
|
42
|
+ <div class="btn-group">
|
|
43
|
+ <a class="btn" data-edit="bold" title="Bold (Ctrl/Cmd+B)"><i class="fa fa-bold"></i></a>
|
|
44
|
+ <a class="btn" data-edit="italic" title="Italic (Ctrl/Cmd+I)"><i class="fa fa-italic"></i></a>
|
|
45
|
+ <a class="btn" data-edit="strikethrough" title="Strikethrough"><i class="fa fa-strikethrough"></i></a>
|
|
46
|
+ <a class="btn" data-edit="underline" title="Underline (Ctrl/Cmd+U)"><i class="fa fa-underline"></i></a>
|
|
47
|
+ </div>
|
|
48
|
+ % endif
|
|
49
|
+ % if psMenuOptions.find('lists')>=0:
|
|
50
|
+ <div class="btn-group">
|
|
51
|
+ <a class="btn" data-edit="insertunorderedlist" title="Bullet list"><i class="fa fa-list-ul"></i></a>
|
|
52
|
+ <a class="btn" data-edit="insertorderedlist" title="Number list"><i class="fa fa-list-ol"></i></a>
|
|
53
|
+ <a class="btn" data-edit="outdent" title="Reduce indent (Shift+Tab)"><i class="fa fa-outdent"></i></a>
|
|
54
|
+ <a class="btn" data-edit="indent" title="Indent (Tab)"><i class="fa fa-indent"></i></a>
|
|
55
|
+ </div>
|
|
56
|
+ % endif
|
|
57
|
+ % if psMenuOptions.find('justifiers')>=0:
|
|
58
|
+ <div class="btn-group">
|
|
59
|
+ <a class="btn" data-edit="justifyleft" title="Align Left (Ctrl/Cmd+L)"><i class="fa fa-align-left"></i></a>
|
|
60
|
+ <a class="btn" data-edit="justifycenter" title="Center (Ctrl/Cmd+E)"><i class="fa fa-align-center"></i></a>
|
|
61
|
+ <a class="btn" data-edit="justifyright" title="Align Right (Ctrl/Cmd+R)"><i class="fa fa-align-right"></i></a>
|
|
62
|
+ <a class="btn" data-edit="justifyfull" title="Justify (Ctrl/Cmd+J)"><i class="fa fa-align-justify"></i></a>
|
|
63
|
+ </div>
|
|
64
|
+ % endif
|
|
65
|
+ % if psMenuOptions.find('links')>=0:
|
|
66
|
+ <div class="btn-group">
|
|
67
|
+ <a class="btn dropdown-toggle" data-toggle="dropdown" title="Hyperlink"><i class="fa fa-link"></i></a>
|
|
68
|
+ <div class="dropdown-menu input-append">
|
|
69
|
+ <input class="span2" placeholder="URL" type="text" data-edit="createLink"/>
|
|
70
|
+ <button class="btn" type="button">Add</button>
|
|
71
|
+ </div>
|
|
72
|
+ <a class="btn" data-edit="unlink" title="Remove Hyperlink"><i class="fa fa-cut"></i></a>
|
|
73
|
+ </div>
|
|
74
|
+ % endif
|
|
75
|
+ % if psMenuOptions.find('images')>=0:
|
|
76
|
+ <div class="btn-group">
|
|
77
|
+ <a class="btn" title="Insert picture (or just drag & drop)" id="pictureBtn"><i class="fa fa-picture-o"></i></a>
|
|
78
|
+ <input type="file" data-role="magic-overlay" data-target="#pictureBtn" data-edit="insertImage" />
|
|
79
|
+ </div>
|
|
80
|
+ % endif
|
|
81
|
+ % if psMenuOptions.find('undoredo')>=0:
|
|
82
|
+ <div class="btn-group">
|
|
83
|
+ <a class="btn" data-edit="undo" title="Undo (Ctrl/Cmd+Z)"><i class="fa fa-undo"></i></a>
|
|
84
|
+ <a class="btn" data-edit="redo" title="Redo (Ctrl/Cmd+Y)"><i class="fa fa-repeat"></i></a>
|
|
85
|
+ </div>
|
|
86
|
+ % endif
|
|
87
|
+ % if psMenuOptions.find('fullscreen')>=0:
|
|
88
|
+ <div class="btn-group">
|
|
89
|
+ <a class="btn btn-primary pod-toggle-full-screen-button"
|
|
90
|
+ title="Toggle fullscreen"
|
|
91
|
+ onclick="toggleFullScreen('#${psRichTextEditorNodeId}-widget', '#${psRichTextEditorNodeId}-widget-inner')"
|
|
92
|
+ >
|
|
93
|
+ ## TODO - D.A. - 2013-11-13 - Use jQuery instead of static JS call
|
|
94
|
+ ## >The previous button "onclick" should be replaced by a jquery dynamic link finding parent node with the right id
|
|
95
|
+ <i class="fa fa-expand"></i>
|
|
96
|
+ </a>
|
|
97
|
+ </div>
|
|
98
|
+ % endif
|
|
99
|
+ <input type="text" data-edit="inserttext" id="voiceBtn" x-webkit-speech="">
|
|
100
|
+ </div>
|
|
101
|
+</%def>
|
|
102
|
+
|
|
103
|
+<%def name='RichTextEditor(psRichTextEditorNodeId, psRichTextEditorContent="", psMenuOptions="styles|boldanditalic|lists|justifiers|links|images|undoredo|fullscreen")'>
|
|
104
|
+ <div id="${psRichTextEditorNodeId}-widget" class="rich-text-editor-widget">
|
|
105
|
+ <div id="${psRichTextEditorNodeId}-widget-inner" class="rich-text-editor-widget-inner">
|
|
106
|
+ <div id="${psRichTextEditorNodeId}-alert-container"></div>
|
|
107
|
+ ${RichTextEditorToolbar(psRichTextEditorNodeId, psMenuOptions)}
|
|
108
|
+ <div id="${psRichTextEditorNodeId}" class="pod-rich-text-zone pod-input-like-shadow">
|
|
109
|
+ ${psRichTextEditorContent|n}
|
|
110
|
+ </div>
|
|
111
|
+ </div>
|
|
112
|
+
|
|
113
|
+ <script>
|
|
114
|
+ ##########################
|
|
115
|
+ ##
|
|
116
|
+ ## Initializes the rich text editor widget with toolbar
|
|
117
|
+ ##
|
|
118
|
+ $(document).ready(function() {
|
|
119
|
+ initToolbarBootstrapBindings('#${psRichTextEditorNodeId}');
|
|
120
|
+ $('#${psRichTextEditorNodeId}').wysiwyg({
|
|
121
|
+## FIXME - 2013-11-13 - D.A.
|
|
122
|
+## The selector is now based on the id of the toolbar div
|
|
123
|
+## according to the following bug report:
|
|
124
|
+## https://github.com/mindmup/bootstrap-wysiwyg/issues/52
|
|
125
|
+## // toolbarSelector: '#${psRichTextEditorNodeId} [data-role=editor-toolbar]',
|
|
126
|
+ toolbarSelector: '[data-role=${psRichTextEditorNodeId}-toolbar]',
|
|
127
|
+ fileUploadError: showErrorAlert
|
|
128
|
+ });
|
|
129
|
+ window.prettyPrint && prettyPrint();
|
|
130
|
+ });
|
|
131
|
+ </script>
|
|
132
|
+
|
|
133
|
+ </div>
|
|
134
|
+
|
|
135
|
+</%def>
|
|
136
|
+
|