contentcontrol: expose checkbox unocommmand
added checkbox in mobile,classic and notebookbar Signed-off-by: Rash419 <rashesh.padia@collabora.com> Change-Id: I0bed99094c2c4bacd50529dbd00891d39cb40c13
This commit is contained in:
parent
c9b9a6589e
commit
d6f055d36d
5 changed files with 22 additions and 5 deletions
|
@ -169,7 +169,9 @@ L.Control.Menubar = L.Control.extend({
|
||||||
{uno: '.uno:InsertIndexesEntry'},
|
{uno: '.uno:InsertIndexesEntry'},
|
||||||
{uno: '.uno:InsertAuthoritiesEntry'},
|
{uno: '.uno:InsertAuthoritiesEntry'},
|
||||||
{uno: '.uno:InsertMultiIndex'}]},
|
{uno: '.uno:InsertMultiIndex'}]},
|
||||||
{uno: '.uno:InsertContentControl'},
|
{name: _UNO('.uno:ContentControlsMenu', 'text'), type: 'menu', menu: [
|
||||||
|
{uno: '.uno:InsertContentControl'},
|
||||||
|
{uno: '.uno:InsertCheckboxContentControl'}]},
|
||||||
]},
|
]},
|
||||||
{name: _UNO('.uno:FormatMenu', 'text'), id: 'format', type: 'menu', menu: [
|
{name: _UNO('.uno:FormatMenu', 'text'), id: 'format', type: 'menu', menu: [
|
||||||
{name: _UNO('.uno:FormatTextMenu', 'text'), type: 'menu', menu: [
|
{name: _UNO('.uno:FormatTextMenu', 'text'), type: 'menu', menu: [
|
||||||
|
@ -1066,7 +1068,9 @@ L.Control.Menubar = L.Control.extend({
|
||||||
{uno: '.uno:InsertWJ'},
|
{uno: '.uno:InsertWJ'},
|
||||||
{uno: '.uno:InsertLRM'},
|
{uno: '.uno:InsertLRM'},
|
||||||
{uno: '.uno:InsertRLM'}]},
|
{uno: '.uno:InsertRLM'}]},
|
||||||
{name: _UNO('.uno:InsertContentControl', 'text'), uno: '.uno:InsertContentControl'},
|
{name: _UNO('.uno:ContentControlsMenu', 'text'), type: 'menu', menu: [
|
||||||
|
{uno: '.uno:InsertContentControl'},
|
||||||
|
{uno: '.uno:InsertCheckboxContentControl'}]},
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
spreadsheet : {
|
spreadsheet : {
|
||||||
|
|
|
@ -954,6 +954,16 @@ L.Control.NotebookbarWriter = L.Control.Notebookbar.extend({
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
'type': 'toolbox',
|
||||||
|
'children': [
|
||||||
|
{
|
||||||
|
'type': 'toolitem',
|
||||||
|
'text': _UNO('.uno:InsertCheckboxContentControl', 'text'),
|
||||||
|
'command': '.uno:InsertCheckboxContentControl'
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
],
|
],
|
||||||
'vertical': 'true'
|
'vertical': 'true'
|
||||||
}
|
}
|
||||||
|
|
|
@ -1704,7 +1704,6 @@ L.CanvasTileLayer = L.Layer.extend({
|
||||||
app.sectionContainer.setClearColor('#' + this.coreDocBGColor);
|
app.sectionContainer.setClearColor('#' + this.coreDocBGColor);
|
||||||
}
|
}
|
||||||
} else if (textMsg.startsWith('contentcontrol:')) {
|
} else if (textMsg.startsWith('contentcontrol:')) {
|
||||||
//this._onContentControlMsg(textMsg);
|
|
||||||
textMsg = textMsg.substring('contentcontrol:'.length + 1);
|
textMsg = textMsg.substring('contentcontrol:'.length + 1);
|
||||||
if (!app.sectionContainer.doesSectionExist(L.CSections.ContentControl.name)) {
|
if (!app.sectionContainer.doesSectionExist(L.CSections.ContentControl.name)) {
|
||||||
app.sectionContainer.addSection(new app.definitions.ContentControlSection());
|
app.sectionContainer.addSection(new app.definitions.ContentControlSection());
|
||||||
|
|
|
@ -23,10 +23,12 @@ class ContentControlSection {
|
||||||
|
|
||||||
public onInitialize() {
|
public onInitialize() {
|
||||||
this.sectionProperties.rectangles = [];
|
this.sectionProperties.rectangles = [];
|
||||||
|
this.sectionProperties.strokeStyle = '#000000';
|
||||||
}
|
}
|
||||||
|
|
||||||
constructor() {
|
constructor() {
|
||||||
this.sectionProperties.rectangles = null;
|
this.sectionProperties.rectangles = null;
|
||||||
|
this.sectionProperties.strokeStyle = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
drawContentControl(json: any) {
|
drawContentControl(json: any) {
|
||||||
|
@ -39,7 +41,7 @@ class ContentControlSection {
|
||||||
this.sectionProperties.rectangles.push([parseInt(matches[i]), parseInt(matches[i + 1]), parseInt(matches[i + 2]), parseInt(matches[i + 3])]);
|
this.sectionProperties.rectangles.push([parseInt(matches[i]), parseInt(matches[i + 1]), parseInt(matches[i + 2]), parseInt(matches[i + 3])]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else if (json.action == 'hide') {
|
} else if (json.action === 'hide') {
|
||||||
this.sectionProperties.rectangles = [];
|
this.sectionProperties.rectangles = [];
|
||||||
}
|
}
|
||||||
app.sectionContainer.requestReDraw();
|
app.sectionContainer.requestReDraw();
|
||||||
|
@ -93,7 +95,7 @@ class ContentControlSection {
|
||||||
xMax = Math.round(xMax * ratio);
|
xMax = Math.round(xMax * ratio);
|
||||||
yMax = Math.round(yMax * ratio);
|
yMax = Math.round(yMax * ratio);
|
||||||
|
|
||||||
this.context.strokeStyle = '#000000';
|
this.context.strokeStyle = this.sectionProperties.strokeStyle;
|
||||||
this.context.strokeRect(xMin - this.position[0], yMin - this.position[1], xMax - xMin, yMax - yMin);
|
this.context.strokeRect(xMin - this.position[0], yMin - this.position[1], xMax - xMin, yMax - yMin);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -492,7 +492,9 @@ var unoCommandsArray = {
|
||||||
'ZTestDialog':{spreadsheet:{menu:_('~Z-test...'),},},
|
'ZTestDialog':{spreadsheet:{menu:_('~Z-test...'),},},
|
||||||
'ZoomMinus':{global:{menu:_('Zoom Out'),},},
|
'ZoomMinus':{global:{menu:_('Zoom Out'),},},
|
||||||
'ZoomPlus':{global:{menu:_('Zoom In'),},},
|
'ZoomPlus':{global:{menu:_('Zoom In'),},},
|
||||||
|
'ContentControlsMenu':{text:{menu:_('Content Controls'),},},
|
||||||
'InsertContentControl':{text:{menu:_('~Insert Rich Text'),},},
|
'InsertContentControl':{text:{menu:_('~Insert Rich Text'),},},
|
||||||
|
'InsertCheckboxContentControl':{text:{menu:_('~Insert Checkbox'),},},
|
||||||
};
|
};
|
||||||
|
|
||||||
window._UNO = function(string, component, isContext) {
|
window._UNO = function(string, component, isContext) {
|
||||||
|
|
Loading…
Reference in a new issue