[DE] Set forms as active tab and show tooltip for docxf files.

This commit is contained in:
Julia Radzhabova 2021-10-28 16:41:06 +03:00
parent a2cb348723
commit a1fba17d6b
6 changed files with 73 additions and 7 deletions

View file

@ -67,6 +67,48 @@
}
}
&.colored {
.asc-synchronizetip {
background-color: @background-contrast-popover;
color: @text-contrast-background;
.close {
&:before, &:after {
background-color: @text-contrast-background;
}
}
}
.tip-arrow:after {
background-color: @background-contrast-popover;
}
.btn-div {
display: inline-block;
border: 1px solid @border-regular-control-ie;
border: 1px solid @border-regular-control;
border-radius: 2px;
padding: 3px 12px;
margin-top: 10px;
}
.show-link label {
border-bottom: @scaled-one-px-value-ie dotted @text-contrast-background-ie;
border-bottom: @scaled-one-px-value dotted @text-contrast-background;
color: @text-contrast-background-ie;
color: @text-contrast-background;
cursor: pointer;
&:hover:not(:disabled) {
color: @text-contrast-background;
border-bottom-color: dotted @text-contrast-background;
}
&:active {
color: @text-contrast-background;
border-bottom-color: dotted @text-contrast-background;
}
}
}
&.inc-index {
z-index: @zindex-navbar + 4;

View file

@ -360,7 +360,31 @@ define([
clr && (clr = Common.Utils.ThemeColor.getHexColor(clr.get_r(), clr.get_g(), clr.get_b()));
me.view.btnHighlight.currentColor = clr;
}
config.isEdit && config.canFeatureContentControl && config.isFormCreator && me.showCreateFormTip(); // show tip only when create form in docxf
});
},
showCreateFormTip: function() {
if (!Common.localStorage.getItem("de-hide-createform-tip")) {
var target = $('.toolbar').find('.ribtab [data-tab=forms]').parent();
var tip = new Common.UI.SynchronizeTip({
extCls: 'colored',
placement: 'bottom-right',
target: target,
text: this.view.textCreateForm,
showLink: true
});
tip.on({
'dontshowclick': function() {
Common.localStorage.setItem("de-hide-createform-tip", 1);
tip.close();
},
'closeclick': function() {
tip.close();
}
});
tip.show();
}
}
}, DE.Controllers.FormsTab || {}));

View file

@ -480,7 +480,8 @@ define([
}
var type = data.doc ? /^(?:(docxf))$/.exec(data.doc.fileType) : false;
this.appOptions.canFeatureForms = !!(type && typeof type[1] === 'string');
this.appOptions.isFormCreator = !!(type && typeof type[1] === 'string');
this.appOptions.canFeatureForms = this.appOptions.isFormCreator; // show forms only for docxf
type = data.doc ? /^(?:(oform))$/.exec(data.doc.fileType) : false;
if (type && typeof type[1] === 'string') {

View file

@ -3224,11 +3224,8 @@ define([
if ($panel) {
me.toolbar.addTab(tab, $panel, 4);
me.toolbar.setVisible('forms', true);
if (config.isEdit && config.canFeatureContentControl) {
Array.prototype.push.apply(me.toolbar.toolbarControls, forms.getView('FormsTab').getButtons());
} else if (!compactview) {
me.toolbar.setTab('forms');
}
config.isEdit && config.canFeatureContentControl && Array.prototype.push.apply(me.toolbar.toolbarControls, forms.getView('FormsTab').getButtons());
!compactview && (config.isFormCreator || config.isRestrictedEdit && config.canFillForms) && me.toolbar.setTab('forms');
}
}
}

View file

@ -431,7 +431,8 @@ define([
textRequired: 'Fill all required fields to send form.',
capBtnSaveForm: 'Save as a Form',
tipSaveForm: 'Save a file as a fillable OFORM document',
txtUntitled: 'Untitled'
txtUntitled: 'Untitled',
textCreateForm: 'Add fields and create a fillable OFORM document'
}
}()), DE.Views.FormsTab || {}));
});

View file

@ -1829,6 +1829,7 @@
"DE.Views.FormsTab.tipTextField": "Insert text field",
"DE.Views.FormsTab.tipViewForm": "View form",
"DE.Views.FormsTab.txtUntitled": "Untitled",
"DE.Views.FormsTab.textCreateForm": "Add fields and create a fillable OFORM document",
"DE.Views.HeaderFooterSettings.textBottomCenter": "Bottom center",
"DE.Views.HeaderFooterSettings.textBottomLeft": "Bottom left",
"DE.Views.HeaderFooterSettings.textBottomPage": "Bottom of Page",