Commit 7aaf81da authored by Romain Courteaud's avatar Romain Courteaud

erp5_core: gadget editor: use monospace font

parent 0a85ccba
...@@ -151,6 +151,7 @@ url_list = [ ...@@ -151,6 +151,7 @@ url_list = [
'gadget_translation_data.js', 'gadget_translation_data.js',
'gadget_editor.html', 'gadget_editor.html',
'gadget_editor.js', 'gadget_editor.js',
'gadget_editor.css',
'gadget_html_viewer.html', 'gadget_html_viewer.html',
'gadget_html_viewer.js', 'gadget_html_viewer.js',
'gadget_html_viewer.css', 'gadget_html_viewer.css',
......
div[data-gadget-url$="gadget_editor.html"] > textarea,
div[data-gadget-url$="gadget_editor.html"] > pre code {
font-family: "Courier New", Courier, monospace;
}
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="File" module="OFS.Image"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_Cacheable__manager_id</string> </key>
<value> <string>must_revalidate_http_cache</string> </value>
</item>
<item>
<key> <string>__name__</string> </key>
<value> <string>gadget_editor.css</string> </value>
</item>
<item>
<key> <string>content_type</string> </key>
<value> <string>text/css</string> </value>
</item>
<item>
<key> <string>precondition</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>gadget_editor.css</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
...@@ -6,6 +6,7 @@ ...@@ -6,6 +6,7 @@
<title>Text editor gadget</title> <title>Text editor gadget</title>
<link rel="http://www.renderjs.org/rel/interface" href="interface_editor.html"> <link rel="http://www.renderjs.org/rel/interface" href="interface_editor.html">
<link rel="http://www.renderjs.org/rel/interface" href="interface_erp5_form_content_provider.html"> <link rel="http://www.renderjs.org/rel/interface" href="interface_erp5_form_content_provider.html">
<link rel="stylesheet" href="gadget_editor.css">
<script src="rsvp.js"></script> <script src="rsvp.js"></script>
<script src="renderjs.js"></script> <script src="renderjs.js"></script>
<script src="gadget_global.js"></script> <script src="gadget_global.js"></script>
......
...@@ -205,13 +205,11 @@ ...@@ -205,13 +205,11 @@
.push(function (evt) { .push(function (evt) {
element.querySelector('img').src = evt.target.result; element.querySelector('img').src = evt.target.result;
}); });
} else if (editor_dict.hasOwnProperty(gadget.state.editor)) { } else {
code = document.createElement('code'); code = document.createElement('code');
code.textContent = gadget.state.value; code.textContent = gadget.state.value;
element.querySelector('pre').textContent = ''; element.querySelector('pre').textContent = '';
element.querySelector('pre').appendChild(code); element.querySelector('pre').appendChild(code);
} else {
element.querySelector('pre').textContent = gadget.state.value;
} }
return queue; return queue;
}) })
......
@monospace: "Courier New", Courier, monospace;
div[data-gadget-url$="gadget_editor.html"] {
& > textarea, & > pre code {
font-family: @monospace;
}
}
\ No newline at end of file
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="File" module="OFS.Image"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>__name__</string> </key>
<value> <string>gadget_editor.less</string> </value>
</item>
<item>
<key> <string>content_type</string> </key>
<value> <string>text/plain</string> </value>
</item>
<item>
<key> <string>precondition</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment