mirror of
https://github.com/ONLYOFFICE/web-apps.git
synced 2026-07-25 15:33:23 +08:00
Merge pull request #2510 from ONLYOFFICE/feature/sse-hf-image
[SSE] Bug 62317: insert picture to header/footer
This commit is contained in:
@ -2433,82 +2433,102 @@ define([
|
||||
|
||||
onConfirmAction: function(id, apiCallback, data) {
|
||||
var me = this;
|
||||
if (id == Asc.c_oAscConfirm.ConfirmReplaceRange || id == Asc.c_oAscConfirm.ConfirmReplaceFormulaInTable) {
|
||||
Common.UI.warning({
|
||||
title: this.notcriticalErrorTitle,
|
||||
msg: id == Asc.c_oAscConfirm.ConfirmReplaceRange ? this.confirmMoveCellRange : this.confirmReplaceFormulaInTable,
|
||||
buttons: ['yes', 'no'],
|
||||
primary: 'yes',
|
||||
callback: _.bind(function(btn) {
|
||||
if (apiCallback) {
|
||||
apiCallback(btn === 'yes');
|
||||
}
|
||||
if (btn == 'yes') {
|
||||
switch (id) {
|
||||
case Asc.c_oAscConfirm.ConfirmReplaceRange:
|
||||
case Asc.c_oAscConfirm.ConfirmReplaceFormulaInTable:
|
||||
Common.UI.warning({
|
||||
title: this.notcriticalErrorTitle,
|
||||
msg: id == Asc.c_oAscConfirm.ConfirmReplaceRange ? this.confirmMoveCellRange : this.confirmReplaceFormulaInTable,
|
||||
buttons: ['yes', 'no'],
|
||||
primary: 'yes',
|
||||
callback: _.bind(function(btn) {
|
||||
if (apiCallback) {
|
||||
apiCallback(btn === 'yes');
|
||||
}
|
||||
if (btn == 'yes') {
|
||||
me.onEditComplete(me.application.getController('DocumentHolder').getView('DocumentHolder'));
|
||||
}
|
||||
}, this)
|
||||
});
|
||||
break;
|
||||
case Asc.c_oAscConfirm.ConfirmPutMergeRange:
|
||||
Common.UI.warning({
|
||||
closable: false,
|
||||
title: this.notcriticalErrorTitle,
|
||||
msg: this.confirmPutMergeRange,
|
||||
buttons: ['ok'],
|
||||
primary: 'ok',
|
||||
callback: _.bind(function(btn) {
|
||||
if (apiCallback) {
|
||||
apiCallback();
|
||||
}
|
||||
me.onEditComplete(me.application.getController('DocumentHolder').getView('DocumentHolder'));
|
||||
}, this)
|
||||
});
|
||||
break;
|
||||
case Asc.c_oAscConfirm.ConfirmChangeProtectRange:
|
||||
var win = new Common.Views.OpenDialog({
|
||||
title: this.txtUnlockRange,
|
||||
closable: true,
|
||||
type: Common.Utils.importTextType.DRM,
|
||||
warning: true,
|
||||
warningMsg: this.txtUnlockRangeWarning,
|
||||
txtOpenFile: this.txtUnlockRangeDescription,
|
||||
validatePwd: false,
|
||||
handler: function (result, value) {
|
||||
if (me.api && apiCallback) {
|
||||
if (result == 'ok') {
|
||||
me.api.asc_checkProtectedRangesPassword(value.drmOptions.asc_getPassword(), data, function(res) {
|
||||
apiCallback(res, false);
|
||||
});
|
||||
} else
|
||||
apiCallback(false, true);
|
||||
}
|
||||
me.onEditComplete(me.application.getController('DocumentHolder').getView('DocumentHolder'));
|
||||
}
|
||||
}, this)
|
||||
});
|
||||
} else if (id == Asc.c_oAscConfirm.ConfirmPutMergeRange) {
|
||||
Common.UI.warning({
|
||||
closable: false,
|
||||
title: this.notcriticalErrorTitle,
|
||||
msg: this.confirmPutMergeRange,
|
||||
buttons: ['ok'],
|
||||
primary: 'ok',
|
||||
callback: _.bind(function(btn) {
|
||||
if (apiCallback) {
|
||||
apiCallback();
|
||||
}
|
||||
me.onEditComplete(me.application.getController('DocumentHolder').getView('DocumentHolder'));
|
||||
}, this)
|
||||
});
|
||||
} else if (id == Asc.c_oAscConfirm.ConfirmChangeProtectRange) {
|
||||
var win = new Common.Views.OpenDialog({
|
||||
title: this.txtUnlockRange,
|
||||
closable: true,
|
||||
type: Common.Utils.importTextType.DRM,
|
||||
warning: true,
|
||||
warningMsg: this.txtUnlockRangeWarning,
|
||||
txtOpenFile: this.txtUnlockRangeDescription,
|
||||
validatePwd: false,
|
||||
handler: function (result, value) {
|
||||
if (me.api && apiCallback) {
|
||||
if (result == 'ok') {
|
||||
me.api.asc_checkProtectedRangesPassword(value.drmOptions.asc_getPassword(), data, function(res) {
|
||||
apiCallback(res, false);
|
||||
});
|
||||
} else
|
||||
apiCallback(false, true);
|
||||
}
|
||||
me.onEditComplete(me.application.getController('DocumentHolder').getView('DocumentHolder'));
|
||||
}
|
||||
});
|
||||
win.show();
|
||||
} else if (id == Asc.c_oAscConfirm.ConfirmAddCellWatches) {
|
||||
Common.UI.warning({
|
||||
title: this.notcriticalErrorTitle,
|
||||
msg: (data>Asc.c_nAscMaxAddCellWatchesCount) ? Common.Utils.String.format(this.confirmAddCellWatchesMax, Asc.c_nAscMaxAddCellWatchesCount) : Common.Utils.String.format(this.confirmAddCellWatches, data),
|
||||
buttons: ['yes', 'no'],
|
||||
primary: 'yes',
|
||||
callback: _.bind(function(btn) {
|
||||
if (apiCallback) {
|
||||
apiCallback(btn === 'yes');
|
||||
}
|
||||
}, this)
|
||||
});
|
||||
} else if (id == Asc.c_oAscConfirm.ConfirmMaxChangesSize) {
|
||||
Common.UI.warning({
|
||||
title: this.notcriticalErrorTitle,
|
||||
msg: this.confirmMaxChangesSize,
|
||||
buttons: [{value: 'ok', caption: this.textUndo, primary: true}, {value: 'cancel', caption: this.textContinue}],
|
||||
maxwidth: 600,
|
||||
callback: _.bind(function(btn) {
|
||||
if (apiCallback) {
|
||||
apiCallback(btn === 'ok');
|
||||
}
|
||||
me.onEditComplete(me.application.getController('DocumentHolder').getView('DocumentHolder'));
|
||||
}, this)
|
||||
});
|
||||
});
|
||||
win.show();
|
||||
break;
|
||||
case Asc.c_oAscConfirm.ConfirmAddCellWatches:
|
||||
Common.UI.warning({
|
||||
title: this.notcriticalErrorTitle,
|
||||
msg: (data>Asc.c_nAscMaxAddCellWatchesCount) ? Common.Utils.String.format(this.confirmAddCellWatchesMax, Asc.c_nAscMaxAddCellWatchesCount) : Common.Utils.String.format(this.confirmAddCellWatches, data),
|
||||
buttons: ['yes', 'no'],
|
||||
primary: 'yes',
|
||||
callback: _.bind(function(btn) {
|
||||
if (apiCallback) {
|
||||
apiCallback(btn === 'yes');
|
||||
}
|
||||
}, this)
|
||||
});
|
||||
break;
|
||||
case Asc.c_oAscConfirm.ConfirmMaxChangesSize:
|
||||
Common.UI.warning({
|
||||
title: this.notcriticalErrorTitle,
|
||||
msg: this.confirmMaxChangesSize,
|
||||
buttons: [{value: 'ok', caption: this.textUndo, primary: true}, {value: 'cancel', caption: this.textContinue}],
|
||||
maxwidth: 600,
|
||||
callback: _.bind(function(btn) {
|
||||
if (apiCallback) {
|
||||
apiCallback(btn === 'ok');
|
||||
}
|
||||
me.onEditComplete(me.application.getController('DocumentHolder').getView('DocumentHolder'));
|
||||
}, this)
|
||||
});
|
||||
break;
|
||||
case Asc.c_oAscConfirm.ConfirmReplaceHeaderFooterPicture:
|
||||
Common.UI.warning({
|
||||
title: this.notcriticalErrorTitle,
|
||||
msg: this.confirmReplaceHFPicture,
|
||||
buttons: [{value: 'ok', caption: this.textReplace, primary: true}, {value: 'cancel', caption: this.textKeep}],
|
||||
maxwidth: 600,
|
||||
callback: _.bind(function(btn) {
|
||||
if (apiCallback) {
|
||||
apiCallback(btn === 'ok');
|
||||
}
|
||||
}, this)
|
||||
});
|
||||
break;
|
||||
}
|
||||
},
|
||||
|
||||
@ -3856,7 +3876,10 @@ define([
|
||||
txtNone: 'None',
|
||||
warnLicenseAnonymous: 'Access denied for anonymous users. This document will be opened for viewing only.',
|
||||
txtSlicer: 'Slicer',
|
||||
txtInfo: 'Info'
|
||||
txtInfo: 'Info',
|
||||
confirmReplaceHFPicture: 'Only one picture can be inserted in each section of the header.<br>Press \"Replace\" to replace existing picture.<br>Press \"Keep\" to keep existing picture.',
|
||||
textReplace: 'Replace',
|
||||
textKeep: 'Keep'
|
||||
}
|
||||
})(), SSE.Controllers.Main || {}))
|
||||
});
|
||||
|
||||
@ -292,7 +292,8 @@ define([
|
||||
{caption: this.textDate, value: Asc.c_oAscHeaderFooterField.date},
|
||||
{caption: this.textTime, value: Asc.c_oAscHeaderFooterField.time},
|
||||
{caption: this.textFileName, value: Asc.c_oAscHeaderFooterField.fileName},
|
||||
{caption: this.textSheet, value: Asc.c_oAscHeaderFooterField.sheetName}
|
||||
{caption: this.textSheet, value: Asc.c_oAscHeaderFooterField.sheetName},
|
||||
{caption: this.textImage, value: Asc.c_oAscHeaderFooterField.picture}
|
||||
];
|
||||
|
||||
this.btnInsertH = new Common.UI.Button({
|
||||
@ -1029,7 +1030,8 @@ define([
|
||||
textOdd: 'Odd page',
|
||||
textEven: 'Even page',
|
||||
textAll: 'All pages',
|
||||
textMaxError: 'The text string you entered is too long. Reduce the number of characters used.'
|
||||
textMaxError: 'The text string you entered is too long. Reduce the number of characters used.',
|
||||
textImage: 'Picture'
|
||||
|
||||
}, SSE.Views.HeaderFooterDialog || {}))
|
||||
});
|
||||
@ -1372,6 +1372,9 @@
|
||||
"SSE.Controllers.Main.txtNone": "None",
|
||||
"SSE.Controllers.Main.txtSlicer": "Slicer",
|
||||
"SSE.Controllers.Main.txtInfo": "Info",
|
||||
"SSE.Controllers.Main.confirmReplaceHFPicture": "Only one picture can be inserted in each section of the header.<br>Press \"Replace\" to replace existing picture.<br>Press \"Keep\" to keep existing picture.",
|
||||
"SSE.Controllers.Main.textReplace": "Replace",
|
||||
"SSE.Controllers.Main.textKeep": "Keep",
|
||||
"SSE.Controllers.PivotTable.strSheet": "Sheet",
|
||||
"SSE.Controllers.Print.strAllSheets": "All Sheets",
|
||||
"SSE.Controllers.Print.textFirstCol": "First column",
|
||||
@ -2878,6 +2881,7 @@
|
||||
"SSE.Views.HeaderFooterDialog.textUnderline": "Underline",
|
||||
"SSE.Views.HeaderFooterDialog.tipFontName": "Font",
|
||||
"SSE.Views.HeaderFooterDialog.tipFontSize": "Font size",
|
||||
"SSE.Views.HeaderFooterDialog.textImage": "Picture",
|
||||
"SSE.Views.HyperlinkSettingsDialog.strDisplay": "Display",
|
||||
"SSE.Views.HyperlinkSettingsDialog.strLinkTo": "Link to",
|
||||
"SSE.Views.HyperlinkSettingsDialog.strRange": "Range",
|
||||
|
||||
Reference in New Issue
Block a user