mirror of
https://github.com/ONLYOFFICE/web-apps.git
synced 2026-07-24 07:31:55 +08:00
refactored and added translates
This commit is contained in:
committed by
Nikita Khromov
parent
65554ddf4d
commit
dcf7863ced
@ -394,7 +394,6 @@ define([
|
||||
title : errors.join('\n'),
|
||||
placement : 'cursor'
|
||||
});
|
||||
errorBadge.tooltip('show');
|
||||
|
||||
if (modalParents.length > 0) {
|
||||
errorBadge.data('bs.tooltip').tip().css('z-index', parseInt(modalParents.css('z-index')) + 10);
|
||||
|
||||
@ -138,7 +138,6 @@ define([], function () { 'use strict';
|
||||
if (state == 'ok') {
|
||||
if (this.inputLabel.checkValidate() !== true) {
|
||||
this.inputLabel.cmpEl.find('input').focus();
|
||||
this.inputLabel.showError(this.inputLabel.checkValidate())
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
@ -40,16 +40,12 @@
|
||||
define([
|
||||
'core',
|
||||
'pdfeditor/main/app/view/RedactTab',
|
||||
'pdfeditor/main/app/collection/ShapeGroups',
|
||||
'pdfeditor/main/app/collection/EquationGroups'
|
||||
], function () {
|
||||
'use strict';
|
||||
|
||||
PDFE.Controllers.RedactTab = Backbone.Controller.extend(_.extend({
|
||||
models : [],
|
||||
collections : [
|
||||
'ShapeGroups',
|
||||
'EquationGroups'
|
||||
],
|
||||
views : [
|
||||
'RedactTab'
|
||||
@ -124,7 +120,7 @@ define([
|
||||
},
|
||||
|
||||
onRedactPages: function() {
|
||||
const self = this;
|
||||
const me = this;
|
||||
const countPages = this.api.getCountPages();
|
||||
|
||||
(new Common.Views.TextInputDialog({
|
||||
@ -132,7 +128,6 @@ define([
|
||||
label: this.textEnterPageRange,
|
||||
value: `1-${countPages}`,
|
||||
description: this.textEnterRangeDescription,
|
||||
inputFixedConfig: {fixedWidth: 40},
|
||||
inputConfig: {
|
||||
maxLength: 20,
|
||||
allowBlank: false,
|
||||
@ -142,7 +137,7 @@ define([
|
||||
|
||||
if (singlePage.test(value)) {
|
||||
const page = parseInt(value, 10);
|
||||
if (page < 1 || page > countPages) return `Page must be between 1 and ${countPages}`;
|
||||
if (page < 1 || page > countPages) return Common.Utils.String.format(me.txtInvalidRange, countPages);
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -151,13 +146,13 @@ define([
|
||||
const start = parseInt(match[1], 10);
|
||||
const end = parseInt(match[2], 10);
|
||||
if (start < 1 || end < 1 || start > countPages || end > countPages) {
|
||||
return `Pages must be between 1 and ${countPages}`;
|
||||
return Common.Utils.String.format(me.txtInvalidRange, countPages);
|
||||
}
|
||||
if (start > end) return 'Start page must be less than or equal to end page';
|
||||
if (start > end) return me.txtReversedRange;
|
||||
return true;
|
||||
}
|
||||
|
||||
return 'Invalid format. Use single number or range with dash, e.g., 2 or 2-6';
|
||||
return me.txtInvalidFormat;
|
||||
}
|
||||
},
|
||||
handler: function(result, value) {
|
||||
@ -173,38 +168,42 @@ define([
|
||||
pages.push(parseInt(value, 10));
|
||||
}
|
||||
|
||||
self.api.RedactPages(pages);
|
||||
me.api.RedactPages(pages);
|
||||
}
|
||||
}
|
||||
})).show();
|
||||
},
|
||||
|
||||
onActiveTab: function(tab) {
|
||||
Common.UI.TooltipManager.showTip('mark-for-redaction');
|
||||
const isMarked = this.api.HasRedact();
|
||||
if (isMarked) {
|
||||
Common.UI.warning({
|
||||
width: 500,
|
||||
msg: this.textUnappliedRedactions,
|
||||
buttons: ['apply', 'doNotApply', 'cancel'],
|
||||
primary: 'apply',
|
||||
callback: _.bind(function(btn) {
|
||||
if (btn == 'apply') {
|
||||
this.api.ApplyRedact();
|
||||
this.api.SetRedactTool(false);
|
||||
this.view.btnMarkForRedact.toggle(false);
|
||||
} else if (btn == 'doNotApply') {
|
||||
this.api.RemoveAllRedact();
|
||||
this.api.SetRedactTool(false);
|
||||
this.view.btnMarkForRedact.toggle(false);
|
||||
} else if (btn == 'cancel') {
|
||||
// Common.NotificationCenter.trigger('tab:set-active', 'red');
|
||||
this.toolbar.toolbar.setTab('red')
|
||||
}}, this)
|
||||
});
|
||||
if (tab == 'red') {
|
||||
Common.UI.TooltipManager.showTip('mark-for-redaction');
|
||||
} else {
|
||||
this.view.btnMarkForRedact.toggle(false);
|
||||
this.api.SetRedactTool(false);
|
||||
// Common.UI.TooltipManager.closeTip('mark-for-redaction');
|
||||
// Common.UI.TooltipManager.closeTip('apply-redaction');
|
||||
const isMarked = this.api.HasRedact();
|
||||
if (isMarked) {
|
||||
Common.UI.warning({
|
||||
width: 500,
|
||||
msg: this.textUnappliedRedactions,
|
||||
buttons: ['apply', 'doNotApply', 'cancel'],
|
||||
primary: 'apply',
|
||||
callback: _.bind(function(btn) {
|
||||
if (btn == 'apply') {
|
||||
this.api.ApplyRedact();
|
||||
this.api.SetRedactTool(false);
|
||||
this.view.btnMarkForRedact.toggle(false);
|
||||
} else if (btn == 'doNotApply') {
|
||||
this.api.RemoveAllRedact();
|
||||
this.api.SetRedactTool(false);
|
||||
this.view.btnMarkForRedact.toggle(false);
|
||||
} else if (btn == 'cancel') {
|
||||
this.toolbar.toolbar.setTab('red')
|
||||
}}, this)
|
||||
});
|
||||
} else {
|
||||
this.view.btnMarkForRedact.toggle(false);
|
||||
this.api.SetRedactTool(false);
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
@ -1474,6 +1474,17 @@ define([
|
||||
me.toolbar.setVisible('ins', true);
|
||||
}
|
||||
|
||||
tab = {caption: me.toolbar.textTabRedact, action: 'red', extcls: config.isEdit ? 'canedit' : '', layoutname: 'toolbar-redact', dataHintTitle: 'X'};
|
||||
var redacttab = me.getApplication().getController('RedactTab');
|
||||
redacttab.setApi(me.api).setConfig({toolbar: me, mode: config});
|
||||
redacttab.onAppReady(config);
|
||||
$panel = redacttab.createToolbarPanel()
|
||||
if ($panel) {
|
||||
me.toolbar.addTab(tab, $panel, 2);
|
||||
me.toolbar.setVisible('red', true);
|
||||
redacttab.onDocumentReady();
|
||||
};
|
||||
|
||||
if (config.canFeatureForms) {
|
||||
tab = {caption: me.textTabForms, action: 'forms', layoutname: 'toolbar-forms', dataHintTitle: 'M'};
|
||||
var forms = me.getApplication().getController('FormsTab');
|
||||
@ -1518,7 +1529,7 @@ define([
|
||||
instab.onDocumentReady();
|
||||
}, 50);
|
||||
|
||||
var tab = {caption: 'Redact', action: 'red', extcls: this.mode.isEdit ? 'canedit' : '', layoutname: 'toolbar-redact', dataHintTitle: 'X'};
|
||||
var tab = {caption: toolbar.textTabRedact, action: 'red', extcls: this.mode.isEdit ? 'canedit' : '', layoutname: 'toolbar-redact', dataHintTitle: 'X'};
|
||||
var redacttab = this.getApplication().getController('RedactTab');
|
||||
redacttab.setApi(this.api).setConfig({toolbar: this, mode: this.mode});
|
||||
toolbar.addTab(tab, redacttab.createToolbarPanel(), 2);
|
||||
|
||||
@ -40,7 +40,6 @@ define([
|
||||
'common/main/lib/util/utils',
|
||||
'common/main/lib/component/BaseView',
|
||||
'common/main/lib/component/Layout',
|
||||
'common/main/lib/component/DimensionPicker'
|
||||
], function () {
|
||||
'use strict';
|
||||
|
||||
@ -48,12 +47,12 @@ define([
|
||||
var template =
|
||||
'<section class="panel" data-tab="red" role="tabpanel">' +
|
||||
'<div class="group">' +
|
||||
'<span class="btn-slot text x-huge slot-inspage" id="slot-btn-markredact"></span>' +
|
||||
'<span class="btn-slot text x-huge" id="slot-btn-markredact"></span>' +
|
||||
'<span class="btn-slot text x-huge" id="slot-btn-redactpages"></span>' +
|
||||
'</div>' +
|
||||
'<div class="separator long separator-theme"></div>' +
|
||||
'<div class="separator long"></div>' +
|
||||
'<div class="group">' +
|
||||
'<span class="btn-slot text x-huge slot-inspage" id="slot-btn-apply-redactions"></span>' +
|
||||
'<span class="btn-slot text x-huge" id="slot-btn-apply-redactions"></span>' +
|
||||
'</div>' +
|
||||
'</section>';
|
||||
|
||||
@ -102,7 +101,6 @@ define([
|
||||
dataHint: '1',
|
||||
dataHintDirection: 'bottom',
|
||||
dataHintOffset: 'small',
|
||||
action: 'interface-theme'
|
||||
});
|
||||
me.lockedControls.push(this.btnRedactPages);
|
||||
|
||||
@ -147,8 +145,8 @@ define([
|
||||
me.btnRedactPages.setMenu(
|
||||
new Common.UI.Menu({
|
||||
items: [
|
||||
{caption: 'Mark current page', value: 'current'},
|
||||
{caption: 'Select range', value: 'range'},
|
||||
{caption: me.txtMarkCurrentPage, value: 'current'},
|
||||
{caption: me.txtSelectRange, value: 'range'},
|
||||
]
|
||||
}).on('item:click', function (menu, item, e) {
|
||||
if (item.value === 'current') {
|
||||
|
||||
@ -876,6 +876,9 @@
|
||||
"PDFE.Controllers.RedactTab.tipApplyRedaction": "Apply and save all redactions. Unsaved redactions can still be undone.",
|
||||
"PDFE.Controllers.RedactTab.tipApplyRedactionHeader": "Apply redactions",
|
||||
"PDFE.Controllers.RedactTab.tipMarkForRedactionHeader": "Mark for redactions",
|
||||
"PDFE.Controllers.RedactTab.txtInvalidRange": "Pages must be between 1 and {0}",
|
||||
"PDFE.Controllers.RedactTab.txtReversedRange": "Start page must be less than or equal to end page",
|
||||
"PDFE.Controllers.RedactTab.txtInvalidFormat": "Invalid format. Use single number or range with dash, e.g., 2 or 2-6",
|
||||
"PDFE.Controllers.LeftMenu.leavePageText": "All unsaved changes in this document will be lost.<br> Click \"Cancel\" then \"Save\" to save them. Click \"OK\" to discard all the unsaved changes.",
|
||||
"PDFE.Controllers.LeftMenu.newDocumentTitle": "Unnamed document",
|
||||
"PDFE.Controllers.LeftMenu.notcriticalErrorTitle": "Warning",
|
||||
@ -1706,6 +1709,8 @@
|
||||
"PDFE.Views.RedactTab.capMarkRedact": "Mark for Redaction",
|
||||
"PDFE.Views.RedactTab.capRedactPages": "Redact Pages",
|
||||
"PDFE.Views.RedactTab.capApplyRedactions": "Apply Redactions",
|
||||
"PDFE.Views.RedactTab.txtMarkCurrentPage": "Mark current page",
|
||||
"PDFE.Views.RedactTab.txtSelectRange": "Select range",
|
||||
"PDFE.Views.LeftMenu.ariaLeftMenu": "Left menu",
|
||||
"PDFE.Views.LeftMenu.tipAbout": "About",
|
||||
"PDFE.Views.LeftMenu.tipChat": "Chat",
|
||||
@ -2175,6 +2180,7 @@
|
||||
"PDFE.Views.Toolbar.textTabFile": "File",
|
||||
"PDFE.Views.Toolbar.textTabHome": "Home",
|
||||
"PDFE.Views.Toolbar.textTabInsert": "Insert",
|
||||
"PDFE.Views.Toolbar.textTabRedact": "Redact",
|
||||
"PDFE.Views.Toolbar.textTabView": "View",
|
||||
"PDFE.Views.Toolbar.textUnderline": "Underline",
|
||||
"PDFE.Views.Toolbar.tipAddComment": "Add comment",
|
||||
|
||||
Reference in New Issue
Block a user