[DE] Insert custom footnotes.
This commit is contained in:
parent
e1049695fc
commit
e93ec60426
|
@ -2014,10 +2014,10 @@ define([
|
||||||
handler: function(result, settings) {
|
handler: function(result, settings) {
|
||||||
if (settings) {
|
if (settings) {
|
||||||
if (result == 'insert') {
|
if (result == 'insert') {
|
||||||
me.api.asc_SetFootnoteProps(settings);
|
me.api.asc_SetFootnoteProps(settings.props);
|
||||||
me.api.asc_AddFootnote();
|
me.api.asc_AddFootnote(settings.custom);
|
||||||
} else if (result == 'apply') {
|
} else if (result == 'apply') {
|
||||||
me.api.asc_SetFootnoteProps(settings);
|
me.api.asc_SetFootnoteProps(settings.props);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Common.NotificationCenter.trigger('edit:complete', me.toolbar);
|
Common.NotificationCenter.trigger('edit:complete', me.toolbar);
|
||||||
|
|
|
@ -123,7 +123,7 @@ define([
|
||||||
'</div>',
|
'</div>',
|
||||||
'<div class="footer center">',
|
'<div class="footer center">',
|
||||||
'<button class="btn normal dlg-btn primary" result="insert" style="margin-right: 10px; width: 86px;">' + me.textInsert + '</button>',
|
'<button class="btn normal dlg-btn primary" result="insert" style="margin-right: 10px; width: 86px;">' + me.textInsert + '</button>',
|
||||||
'<button class="btn normal dlg-btn primary" result="apply" style="margin-right: 10px; width: 86px;">' + me.textApply + '</button>',
|
'<button id="note-settings-btn-apply" class="btn normal dlg-btn primary" result="apply" style="margin-right: 10px; width: 86px;">' + me.textApply + '</button>',
|
||||||
'<button class="btn normal dlg-btn" result="cancel" style="width: 86px;">' + me.textCancel + '</button>',
|
'<button class="btn normal dlg-btn" result="cancel" style="width: 86px;">' + me.textCancel + '</button>',
|
||||||
'</div>'
|
'</div>'
|
||||||
].join('')
|
].join('')
|
||||||
|
@ -149,11 +149,11 @@ define([
|
||||||
menuStyle: 'min-width: 150px;',
|
menuStyle: 'min-width: 150px;',
|
||||||
editable: false,
|
editable: false,
|
||||||
data: [
|
data: [
|
||||||
{ displayValue: this.textPageBottom, value: Asc.c_oAscFootnotePos.section_footnote_PosPageBottom },
|
{ displayValue: this.textPageBottom, value: Asc.c_oAscFootnotePos.PageBottom },
|
||||||
{ displayValue: this.textTextBottom, value: Asc.c_oAscFootnotePos.section_footnote_PosBeneathText }
|
{ displayValue: this.textTextBottom, value: Asc.c_oAscFootnotePos.BeneathText }
|
||||||
]
|
]
|
||||||
});
|
});
|
||||||
this.cmbFootnote.setValue(Asc.c_oAscFootnotePos.section_footnote_PosPageBottom);
|
this.cmbFootnote.setValue(Asc.c_oAscFootnotePos.PageBottom);
|
||||||
|
|
||||||
this.cmbFormat = new Common.UI.ComboBox({
|
this.cmbFormat = new Common.UI.ComboBox({
|
||||||
el: $('#note-settings-combo-format'),
|
el: $('#note-settings-combo-format'),
|
||||||
|
@ -161,11 +161,11 @@ define([
|
||||||
menuStyle: 'min-width: 150px;',
|
menuStyle: 'min-width: 150px;',
|
||||||
editable: false,
|
editable: false,
|
||||||
data: [
|
data: [
|
||||||
{ displayValue: '1, 2, 3,...', value: 1, maskExp: /[0-9]/, defValue: 1 },
|
{ displayValue: '1, 2, 3,...', value: c_oAscNumberingFormat.Decimal, maskExp: /[0-9]/, defValue: 1 },
|
||||||
{ displayValue: 'a, b, c,...', value: 5, maskExp: /[a-z]/, defValue: 'a' },
|
{ displayValue: 'a, b, c,...', value: c_oAscNumberingFormat.LowerLetter, maskExp: /[a-z]/, defValue: 'a' },
|
||||||
{ displayValue: 'A, B, C,...', value: 4, maskExp: /[A-Z]/, defValue: 'A' },
|
{ displayValue: 'A, B, C,...', value: c_oAscNumberingFormat.UpperLetter, maskExp: /[A-Z]/, defValue: 'A' },
|
||||||
{ displayValue: 'i, ii, iii,...', value: 7, maskExp: /[ivxlcdm]/, defValue: 'i' },
|
{ displayValue: 'i, ii, iii,...', value: c_oAscNumberingFormat.LowerRoman, maskExp: /[ivxlcdm]/, defValue: 'i' },
|
||||||
{ displayValue: 'I, II, III,...', value: 3, maskExp: /[IVXLCDM]/, defValue: 'I' }
|
{ displayValue: 'I, II, III,...', value: c_oAscNumberingFormat.UpperRoman, maskExp: /[IVXLCDM]/, defValue: 'I' }
|
||||||
]
|
]
|
||||||
});
|
});
|
||||||
this.cmbFormat.setValue(this.FormatType);
|
this.cmbFormat.setValue(this.FormatType);
|
||||||
|
@ -190,12 +190,12 @@ define([
|
||||||
menuStyle: 'min-width: 150px;',
|
menuStyle: 'min-width: 150px;',
|
||||||
editable: false,
|
editable: false,
|
||||||
data: [
|
data: [
|
||||||
{ displayValue: this.textContinue, value: Asc.c_oAscFootnoteRestart.section_footnote_RestartContinuous },
|
{ displayValue: this.textContinue, value: Asc.c_oAscFootnoteRestart.Continuous },
|
||||||
{ displayValue: this.textEachSection, value: Asc.c_oAscFootnoteRestart.section_footnote_RestartEachSect },
|
{ displayValue: this.textEachSection, value: Asc.c_oAscFootnoteRestart.EachSect },
|
||||||
{ displayValue: this.textEachPage, value: Asc.c_oAscFootnoteRestart.section_footnote_RestartEachPage }
|
{ displayValue: this.textEachPage, value: Asc.c_oAscFootnoteRestart.EachPage }
|
||||||
]
|
]
|
||||||
});
|
});
|
||||||
this.cmbNumbering.setValue(Asc.c_oAscFootnoteRestart.section_footnote_RestartContinuous);
|
this.cmbNumbering.setValue(Asc.c_oAscFootnoteRestart.Continuous);
|
||||||
|
|
||||||
this.txtCustom = new Common.UI.InputField({
|
this.txtCustom = new Common.UI.InputField({
|
||||||
el : $('#note-settings-txt-custom'),
|
el : $('#note-settings-txt-custom'),
|
||||||
|
@ -207,6 +207,7 @@ define([
|
||||||
}).on ('changing', function (input, value) {
|
}).on ('changing', function (input, value) {
|
||||||
me.cmbFormat.setDisabled(value.length>0);
|
me.cmbFormat.setDisabled(value.length>0);
|
||||||
me.spnStart.setDisabled(value.length>0);
|
me.spnStart.setDisabled(value.length>0);
|
||||||
|
me.btnApply.setDisabled(value.length>0);
|
||||||
});
|
});
|
||||||
|
|
||||||
this.cmbApply = new Common.UI.ComboBox({
|
this.cmbApply = new Common.UI.ComboBox({
|
||||||
|
@ -221,6 +222,10 @@ define([
|
||||||
});
|
});
|
||||||
this.cmbApply.setValue(Asc.section_footnote_RestartContinuous);
|
this.cmbApply.setValue(Asc.section_footnote_RestartContinuous);
|
||||||
|
|
||||||
|
this.btnApply = new Common.UI.Button({
|
||||||
|
el: $('#note-settings-btn-apply')
|
||||||
|
});
|
||||||
|
|
||||||
this.afterRender();
|
this.afterRender();
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -248,11 +253,6 @@ define([
|
||||||
this.cmbNumbering.setValue(val);
|
this.cmbNumbering.setValue(val);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
val = props.get_Custom();
|
|
||||||
this.txtCustom.setValue(val);
|
|
||||||
this.cmbFormat.setDisabled(!_.isEmpty(val));
|
|
||||||
this.spnStart.setDisabled(!_.isEmpty(val));
|
|
||||||
|
|
||||||
val = props.get_ApplyTo();
|
val = props.get_ApplyTo();
|
||||||
this.cmbApply.setValue(val);
|
this.cmbApply.setValue(val);
|
||||||
*/
|
*/
|
||||||
|
@ -269,17 +269,14 @@ define([
|
||||||
if (_.isEmpty(val)) {
|
if (_.isEmpty(val)) {
|
||||||
val = this.cmbFormat.getValue();
|
val = this.cmbFormat.getValue();
|
||||||
props.put_NumFormat(val);
|
props.put_NumFormat(val);
|
||||||
// if (val==1)
|
|
||||||
props.put_NumStart(this.spnStart.getNumberValue());
|
props.put_NumStart(this.spnStart.getNumberValue());
|
||||||
// else
|
|
||||||
// props.put_NumStart(this.txtStart.getValue());
|
|
||||||
} else {
|
} else {
|
||||||
// props.set_Custom(val);
|
// props.set_Custom(val);
|
||||||
}
|
}
|
||||||
|
|
||||||
// props.put_ApplyTo(this.cmbApply.getValue());
|
// props.put_ApplyTo(this.cmbApply.getValue());
|
||||||
|
|
||||||
return props;
|
return {props: props, custom: _.isEmpty(val) ? undefined : val};
|
||||||
},
|
},
|
||||||
|
|
||||||
onDlgBtnClick: function(event) {
|
onDlgBtnClick: function(event) {
|
||||||
|
@ -303,19 +300,19 @@ define([
|
||||||
|
|
||||||
var me = this;
|
var me = this;
|
||||||
switch (record.value) {
|
switch (record.value) {
|
||||||
case 3: // I, II, III, ...
|
case c_oAscNumberingFormat.UpperRoman: // I, II, III, ...
|
||||||
this.spnStart.options.toCustomFormat = this._10toRome;
|
this.spnStart.options.toCustomFormat = this._10toRome;
|
||||||
this.spnStart.options.fromCustomFormat = this._Rometo10;
|
this.spnStart.options.fromCustomFormat = this._Rometo10;
|
||||||
break;
|
break;
|
||||||
case 7: // i, ii, iii, ...
|
case c_oAscNumberingFormat.LowerRoman: // i, ii, iii, ...
|
||||||
this.spnStart.options.toCustomFormat = function(value) { return me._10toRome(value).toLocaleLowerCase(); };
|
this.spnStart.options.toCustomFormat = function(value) { return me._10toRome(value).toLocaleLowerCase(); };
|
||||||
this.spnStart.options.fromCustomFormat = function(value) { return me._Rometo10(value.toLocaleUpperCase()); };
|
this.spnStart.options.fromCustomFormat = function(value) { return me._Rometo10(value.toLocaleUpperCase()); };
|
||||||
break;
|
break;
|
||||||
case 4: // A, B, C, ...
|
case c_oAscNumberingFormat.UpperLetter: // A, B, C, ...
|
||||||
this.spnStart.options.toCustomFormat = this._10toS;
|
this.spnStart.options.toCustomFormat = this._10toS;
|
||||||
this.spnStart.options.fromCustomFormat = this._Sto10;
|
this.spnStart.options.fromCustomFormat = this._Sto10;
|
||||||
break;
|
break;
|
||||||
case 5: // a, b, c, ...
|
case c_oAscNumberingFormat.LowerLetter: // a, b, c, ...
|
||||||
this.spnStart.options.toCustomFormat = function(value) { return me._10toS(value).toLocaleLowerCase(); };
|
this.spnStart.options.toCustomFormat = function(value) { return me._10toS(value).toLocaleLowerCase(); };
|
||||||
this.spnStart.options.fromCustomFormat = function(value) { return me._Sto10(value.toLocaleUpperCase()); };
|
this.spnStart.options.fromCustomFormat = function(value) { return me._Sto10(value.toLocaleUpperCase()); };
|
||||||
break;
|
break;
|
||||||
|
|
Loading…
Reference in a new issue