Commit 9327a770 authored by Romain Courteaud's avatar Romain Courteaud

erp5_core: gadget editor: use monospace font

parent ff829633
......@@ -149,6 +149,7 @@ url_list = [
'gadget_translation_data.js',
'gadget_editor.html',
'gadget_editor.js',
'gadget_editor.css',
'gadget_html_viewer.html',
'gadget_html_viewer.js',
'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 @@
<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_erp5_form_content_provider.html">
<link rel="stylesheet" href="gadget_editor.css">
<script src="rsvp.js"></script>
<script src="renderjs.js"></script>
<script src="gadget_global.js"></script>
......
......@@ -80,6 +80,7 @@
gadget = this,
div = document.createElement('div'),
div_max = document.createElement('div'),
code,
queue = new RSVP.Queue();
if ((modification_dict.hasOwnProperty('editable')) ||
......@@ -200,7 +201,10 @@
element.querySelector('img').src = evt.target.result;
});
} else {
element.querySelector('pre').textContent = gadget.state.value;
code = document.createElement('code');
code.textContent = gadget.state.value;
element.querySelector('pre').textContent = '';
element.querySelector('pre').appendChild(code);
}
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