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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
|
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<template id="wysiwyg_iframe_editor_assets" name="Editor assets for wysiwyg iframe content" groups="base.group_user">
<t t-call-assets="web.assets_common"/>
<t t-call-assets="web.assets_frontend" t-js="false"/>
<t t-call-assets="web_editor.assets_wysiwyg"/>
</template>
<template id="compiled_assets_wysiwyg" name="Wysiwyg Editor" groups="base.group_user,base.group_portal">
<t t-call-assets="web_editor.assets_wysiwyg"/>
</template>
<template id="web_editor.assets_wysiwyg" name="Wysiwyg Editor Assets">
<!-- lib -->
<t t-call-assets="web_editor.assets_summernote"/>
<link rel="stylesheet" type="text/css" href="/web_editor/static/lib/cropperjs/cropper.css"/>
<script type="text/javascript" src="/web_editor/static/lib/cropperjs/cropper.js"/>
<script type="text/javascript" src="/web_editor/static/lib/jquery-cropper/jquery-cropper.js"/>
<script type="text/javascript" src="/web_editor/static/lib/jQuery.transfo.js"/>
<script type="text/javascript" src="/web/static/lib/nearest/jquery.nearest.js"/>
<script type="text/javascript" src="/web_editor/static/lib/webgl-image-filter/webgl-image-filter.js"/>
<!-- odoo utils -->
<t t-call="web._assets_helpers">
<link rel="stylesheet" type="text/scss" href="/web_editor/static/src/scss/bootstrap_overridden.scss"/>
</t>
<!-- integration -->
<link rel="stylesheet" type="text/scss" href="/web_editor/static/src/scss/wysiwyg.scss"/>
<link rel="stylesheet" type="text/scss" href="/web_editor/static/src/scss/wysiwyg_iframe.scss"/>
<link rel="stylesheet" type="text/scss" href="/web_editor/static/src/scss/wysiwyg_snippets.scss"/>
<script type="text/javascript" src="/web_editor/static/src/js/wysiwyg/fonts.js"/>
<script type="text/javascript" src="/web_editor/static/src/js/base.js"/>
<script type="text/javascript" src="/web_editor/static/src/js/editor/editor.js"/>
<script type="text/javascript" src="/web_editor/static/src/js/editor/rte.js"/>
<script type="text/javascript" src="/web_editor/static/src/js/editor/rte.summernote.js"/>
<script type="text/javascript" src="/web_editor/static/src/js/editor/image_processing.js"/>
<script type="text/javascript" src="/web_editor/static/src/js/editor/custom_colors.js"/>
<!-- widgets & plugins -->
<script type="text/javascript" src="/web_editor/static/src/js/wysiwyg/widgets/media.js"/>
<script type="text/javascript" src="/web_editor/static/src/js/wysiwyg/widgets/dialog.js"/>
<script type="text/javascript" src="/web_editor/static/src/js/wysiwyg/widgets/alt_dialog.js"/>
<script type="text/javascript" src="/web_editor/static/src/js/wysiwyg/widgets/color_palette.js"/>
<script type="text/javascript" src="/web_editor/static/src/js/wysiwyg/widgets/image_crop_widget.js"/>
<script type="text/javascript" src="/web_editor/static/src/js/wysiwyg/widgets/link_dialog.js"/>
<script type="text/javascript" src="/web_editor/static/src/js/wysiwyg/widgets/media_dialog.js"/>
<script type="text/javascript" src="/web_editor/static/src/js/wysiwyg/widgets/widgets.js"/>
<script type="text/javascript" src="/web_editor/static/src/js/editor/snippets.editor.js"/>
<script type="text/javascript" src="/web_editor/static/src/js/editor/snippets.options.js"/>
<!-- Launcher -->
<script type="text/javascript" src="/web_editor/static/lib/jabberwock/jabberwock.js"/>
<link rel="stylesheet" type="text/css" href="/web_editor/static/lib/jabberwock/jabberwock.css"/>
<script type="text/javascript" src="/web_editor/static/src/js/wysiwyg/wysiwyg_translate_attributes.js"/>
<script type="text/javascript" src="/web_editor/static/src/js/wysiwyg/wysiwyg.js"/>
<script type="text/javascript" src="/web_editor/static/src/js/wysiwyg/wysiwyg_snippets.js"/>
<script type="text/javascript" src="/web_editor/static/src/js/wysiwyg/wysiwyg_iframe.js"/>
</template>
<template id="assets_summernote" name="Summernote">
<script type="text/javascript" src="/web_editor/static/lib/summernote/src/js/enable_summernote.js"/>
<script type="text/javascript">
(function () {
"use strict";
odoo.define('jquery', function () {return $;});
var uniqId = 0;
odoo.__define__ = window.define;
window.define = function (id) {
if (!odoo.__enable_summernote__) return;
var args = Array.prototype.slice.call(arguments);
var factorie = args.pop();
var id = args[0];
if (id instanceof Array) {
var name = "summernote_factorie_" + (++uniqId);
odoo[name] = factorie;
var head = '';
var fn = 'var fn = odoo.'+name+';\ndelete odoo.'+name+';\n';
fn += 'return fn(';
for (var k=0; k<id.length; k++) {
head += 'var a'+(++uniqId)+' = require("'+id[k]+'");\n';
fn += 'a'+uniqId+', ';
}
fn += 'null);';
odoo.define(odoo.website_next_define, new Function('require', head + fn));
} else {
odoo.define(id, factorie);
}
};
})();
</script>
<t t-set="summer_js_files" t-value="['core/async', 'core/func', 'core/agent', 'core/list',
'core/dom', 'core/key', 'core/range', 'editing/Bullet', 'editing/History', 'editing/Style',
'editing/Table', 'editing/Typing', 'module/Editor', 'module/Button', 'module/Clipboard',
'module/Codeview', 'module/DragAndDrop', 'module/Fullscreen', 'module/Handle',
'module/HelpDialog', 'module/ImageDialog', 'module/LinkDialog', 'module/Popover',
'module/Statusbar', 'module/Toolbar', 'Renderer', 'EventHandler', 'defaults', 'summernote']" />
<t t-foreach="summer_js_files" t-as="file">
<script>odoo.website_next_define = 'summernote/<t t-esc="file" />';</script>
<script type="text/javascript" t-attf-src="/web_editor/static/lib/summernote/src/js/{{ file }}.js"></script>
</t>
<script type="text/javascript" src="/web_editor/static/src/js/editor/summernote.js" />
<script type="text/javascript">
window.define = odoo.__define__;
delete odoo.__define__;
delete odoo.website_next_define;
delete odoo.__enable_summernote__;
</script>
<link rel="stylesheet" type="text/css" href="/web_editor/static/lib/summernote/src/css/summernote.css"/>
</template>
<template id="_assets_primary_variables" inherit_id="web._assets_primary_variables">
<xpath expr="//link[last()]" position="after">
<link rel="stylesheet" type="text/scss" href="/web_editor/static/src/scss/web_editor.variables.scss"/>
</xpath>
</template>
<template id="_assets_13_0_color_system_support_primary_variables" inherit_id="web_editor._assets_primary_variables" active="False">
<xpath expr="//link[last()]" position="after">
<link rel="stylesheet" type="text/scss" href="/web_editor/static/src/scss/13_0_color_system_support_primary_variables.scss"/>
</xpath>
</template>
<template id="_assets_secondary_variables" inherit_id="web._assets_secondary_variables">
<xpath expr="//link" position="before">
<link rel="stylesheet" type="text/scss" href="/web_editor/static/src/scss/secondary_variables.scss"/>
</xpath>
</template>
<template id="assets_common" inherit_id="web.assets_common" name="Web Editor Common Assets (used in backend interface and website)">
<xpath expr="script[last()]" position="after">
<script type="text/javascript" src="/web_editor/static/lib/vkbeautify/vkbeautify.0.99.00.beta.js"/>
<script type="text/javascript" src="/web_editor/static/src/js/common/ace.js"/>
<script type="text/javascript" src="/web_editor/static/src/js/common/utils.js"/>
<script type="text/javascript" src="/web_editor/static/src/js/wysiwyg/root.js"/>
</xpath>
</template>
<template id="_assets_backend_helpers" inherit_id="web._assets_backend_helpers">
<xpath expr="//link" position="before">
<link rel="stylesheet" type="text/scss" href="/web_editor/static/src/scss/bootstrap_overridden_backend.scss"/>
<link rel="stylesheet" type="text/scss" href="/web_editor/static/src/scss/bootstrap_overridden.scss"/>
</xpath>
</template>
<template id="assets_backend" inherit_id="web.assets_backend" name="Web Editor Backend Assets (used in backend interface)">
<xpath expr="link[last()]" position="after">
<link rel="stylesheet" type="text/scss" href="/web_editor/static/src/scss/web_editor.common.scss"/> <!-- not in common because compiled differently with context -->
<link rel="stylesheet" type="text/scss" href="/web_editor/static/src/scss/web_editor.backend.scss"/>
</xpath>
<xpath expr="script[last()]" position="after">
<script type="text/javascript" src="/web_editor/static/src/js/frontend/loader.js" />
<script type="text/javascript" src="/web_editor/static/src/js/backend/field_html.js" />
<script type="text/javascript" src="/web_editor/static/src/js/backend/convert_inline.js" />
</xpath>
</template>
<template id="_assets_frontend_helpers" inherit_id="web._assets_frontend_helpers">
<xpath expr="//link" position="before">
<link rel="stylesheet" type="text/scss" href="/web_editor/static/src/scss/bootstrap_overridden.scss"/>
</xpath>
</template>
<template id="_assets_frontend_minimal_js" inherit_id="web._assets_frontend_minimal_js">
<xpath expr="//script[last()]" position="after">
<script type="text/javascript" src="/web_editor/static/src/js/frontend/loader_loading.js"/>
</xpath>
</template>
<template id="assets_frontend" inherit_id="web.assets_frontend" name="Web Editor Frontend Assets (used in public odoo)" priority="15">
<xpath expr="//link[last()]" position="after">
<link rel="stylesheet" type="text/scss" href="/web_editor/static/src/scss/web_editor.common.scss"/> <!-- not in common because compiled differently with context -->
<link rel="stylesheet" type ="text/scss" href="/web_editor/static/src/scss/web_editor.frontend.scss"/>
</xpath>
<xpath expr="//script[last()]" position="after">
<script type="text/javascript" src="/web_editor/static/src/js/frontend/loader.js"/>
</xpath>
</template>
<template id="qunit_suite" inherit_id="web.qunit_suite_tests">
<xpath expr="//script[last()]" position="after">
<script type="text/javascript">
odoo.define('web_editor.wysiwyg.root.test', function (require) {
'use strict';
var WysiwygRoot = require('web_editor.wysiwyg.root');
if (WysiwygRoot) {
WysiwygRoot.include({
assetLibs: null // We need to add the asset because tests performed overwrites (Dialog, Unbreakable...)
});
}
});
</script>
<t t-call="web_editor.assets_wysiwyg"/>
<script type="text/javascript" src="/web_editor/static/tests/test_utils.js"/>
<script type="text/javascript" src="/web_editor/static/tests/field_html_tests.js"/>
</xpath>
</template>
<template id="assets_edit_html_field" name="Wysiwyg Editor Assets for html field (style-inline)" groups="base.group_user,base.group_portal">
<t t-call-assets="web.assets_common" t-js="false"/>
<t t-call-assets="web_editor.assets_wysiwyg" t-js="false"/>
</template>
<!--
The web_editor.colorpicker template regroups section of colorpicker menu for website customization
(text foreground/background but also snippet background color option).
As it is presentend below, the colorpicker tag regroups a set of .o_colorpicker_section with name,
icon-class and icon-content as data. These will be used to build the colorpicker dropdowns.
Redefinition can edit section content, add sections or even remove them. If no section is found when
building a colorpicker dropdown, the template content will be used without changes as the colorpicker
dropdown content.
Sections should contain a set of button with a data-color attribute. When selecting such a button to
edit style, the "bg-x" class or the "text-x" will be automatically added.
If a color is no longer used you need to add the d-none class to it and not remove it from this file !!
Else you will no longer be able to use them.
-->
<template id="web_editor.colorpicker" name="Color-Picker" groups="base.group_user">
<colorpicker>
<div class="o_colorpicker_section" data-name="theme">
<button t-foreach="5" t-as="i" t-attf-data-color="o-color-#{i + 1}"></button>
</div>
<div class="o_colorpicker_section" data-name="common">
<button data-color="black"></button>
<button data-color="900"></button>
<button data-color="800"></button>
<button data-color="700" class="d-none"></button>
<button data-color="600"></button>
<button data-color="500" class="d-none"></button>
<button data-color="400"></button>
<button data-color="300" class="d-none"></button>
<button data-color="200"></button>
<button data-color="100"></button>
<button data-color="white"></button>
</div>
<div class="o_colorpicker_section" data-name="transparent_grayscale">
<button data-color="black-15"></button>
<button data-color="black-25"></button>
<button data-color="black-50"></button>
<button data-color="black-75"></button>
<button data-color="white-25"></button>
<button data-color="white-50"></button>
<button data-color="white-75"></button>
<button data-color="white-85"></button>
</div>
</colorpicker>
</template>
</odoo>
|