Commit fd0b4abf authored by Mikolaï Krol's avatar Mikolaï Krol Committed by Mikolaï Krol

erp5_jexcel_editor: moved toolbar definition to util gadget

erp5_jexcel_editor: formula bar, not working like expected yet

erp5_jexcel_editor: updated jexcel source
parent eb45d105
div.jexcel_formula img{
display: inline-block;
width: 12px;
height: 12px;
margin-left: 4px;
margin-right: 4px;
}
input.jexcel_formula {
margin-left: 2px;
width: 97%;
position:sticky;
top:0px;
z-index:21;
display: inline-block;
}
\ 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>complements.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></string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?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>fx.png</string> </value>
</item>
<item>
<key> <string>content_type</string> </key>
<value> <string>image/png</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>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Jexcel</title>
<script src="rsvp.js"></script>
<script src="renderjs.js"></script>
<script src="gadget.utils.toolbar.js"></script>
</head>
<body>
</body>
</html>
<?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.utils.toolbar.html</string> </value>
</item>
<item>
<key> <string>content_type</string> </key>
<value> <string>text/html</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>
/*jslint nomen: true, indent: 2 */
/*global window, rJS, RSVP, jexcel*/
(function (window, rJS, jexcel) {
"use strict";
var font_style = {
type: 'select',
k: 'font-family',
v: ['Arial', 'Comic Sans MS', 'Verdana', 'Calibri', 'Tahoma', 'Helvetica', 'DejaVu Sans', 'Times New Roman', 'Georgia', 'Antiqua']
};
var font_size = {
type: 'select',
k: 'font-size',
v: ['9px', '10px', '11px', '12px', '13px', '14px', '15px', '16px', '17px', '18px', '19px', '20px', '22px', '24px', '26px', '28px', '30px']
};
var text_align_left = {
type: 'i',
content: 'format_align_left',
k: 'text-align',
v: 'left'
};
var text_align_center = {
type: 'i',
content: 'format_align_center',
k: 'text-align',
v: 'center'
};
var text_align_right = {
type: 'i',
content: 'format_align_right',
k: 'text-align',
v: 'right'
};
var text_align_justify = {
type: 'i',
content: 'format_align_justify',
k: 'text-align',
v: 'justify'
};
var vertical_align_top = {
type: 'i',
content: 'vertical_align_top',
k: 'vertical-align',
v: 'top'
};
var vertical_align_middle = {
type: 'i',
content: 'vertical_align_center',
k: 'vertical-align',
v: 'middle'
};
var vertical_align_bottom = {
type: 'i',
content: 'vertical_align_bottom',
k: 'vertical-align',
v: 'bottom'
};
var style_bold = {
type: 'i',
content: 'format_bold',
k: 'font-weight',
v: 'bold'
};
var style_underlined = {
type: 'i',
content: 'format_underlined',
k: 'text-decoration',
v: 'underline'
};
var style_italic = {
type: 'i',
content: 'format_italic',
k: 'font-style',
v: 'italic'
};
var text_color = {
type: 'color',
content: 'format_color_text',
k: 'color'
};
var background_color = {
type: 'color',
content: 'format_color_fill',
k: 'background-color'
};
rJS(window)
.declareMethod("getToolbarList", function (dict) {
var list = [];
if (dict.hasOwnProperty("text_font") && dict.text_font) {
list.push(font_style, font_size, style_bold, style_italic, style_underlined);
}
if (dict.hasOwnProperty("text_position") && dict.text_position) {
list.push(text_align_left, text_align_center, text_align_right, text_align_justify, vertical_align_top, vertical_align_middle, vertical_align_bottom);
}
if (dict.hasOwnProperty("color_picker") && dict.color_picker) {
list.push(text_color, background_color);
}
return list;
});
}(window, rJS, jexcel));
<?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.utils.toolbar.js</string> </value>
</item>
<item>
<key> <string>content_type</string> </key>
<value> <string>application/javascript</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>
......@@ -13,6 +13,7 @@
<script src="jsuites/jsuites.js"></script>
<link rel="stylesheet" href="jexcel/jexcel.css" type="text/css" />
<link rel="stylesheet" href="jsuites/jsuites.css" type="text/css" />
<link rel="stylesheet" href="complements.css" type="text/css" />
<link rel="stylesheet" href="icons.css" type="text/css" />
......@@ -20,6 +21,10 @@
</head>
<body>
<div data-gadget-url="gadget.utils.toolbar.html"
data-gadget-scope="toolbar_gadget"
data-gadget-sandbox="public">
</div>
<div class="spreadsheet"></div>
</body>
</html>
......@@ -21,7 +21,7 @@
.jexcel_container.fullscreen .jexcel_content {
overflow:auto;
width:100%;
height:100%;
height:96.5%;
background-color:#ffffff;
}
......@@ -609,7 +609,7 @@
background-color:#f3f3f3;
border:1px solid #ccc;
padding:4px;
margin:0px 2px 4px 1px;
margin:0px 2px 1px 1px;
position:sticky;
top:0px;
z-index:21;
......
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