[SSE] Add autoformat settings

This commit is contained in:
Julia Radzhabova 2020-09-07 23:18:16 +03:00
parent aa0242e16d
commit 1060de655f
4 changed files with 38 additions and 1 deletions

View file

@ -79,3 +79,13 @@
</div> </div>
</div> </div>
</div> </div>
<div id="id-autocorrect-dialog-settings-sse-autoformat" class="settings-panel">
<div class="inner-content" style="width: 100%;">
<div class="padding-small">
<label class="header"><%= scope.textApplyAsWork %></label>
</div>
<div class="padding-large">
<div id="id-autocorrect-dialog-chk-new-rows"></div>
</div>
</div>
</div>

View file

@ -64,6 +64,8 @@ define([ 'text!common/main/lib/template/AutoCorrectDialog.template',
]; ];
if (this.appPrefix=='de-') if (this.appPrefix=='de-')
items.push({panelId: 'id-autocorrect-dialog-settings-de-autoformat', panelCaption: this.textAutoFormat}); items.push({panelId: 'id-autocorrect-dialog-settings-de-autoformat', panelCaption: this.textAutoFormat});
else if (this.appPrefix=='sse-')
items.push({panelId: 'id-autocorrect-dialog-settings-sse-autoformat', panelCaption: this.textAutoFormat});
_.extend(this.options, { _.extend(this.options, {
title: this.textTitle, title: this.textTitle,
@ -129,6 +131,16 @@ define([ 'text!common/main/lib/template/AutoCorrectDialog.template',
me.api.asc_SetAutoCorrectHyphensWithDash(value); me.api.asc_SetAutoCorrectHyphensWithDash(value);
} }
}; };
} else if (this.appPrefix=='sse-') {
var me = this;
this.options.handler = function(result, value) {
if ( result == 'ok' ) {
var value = me.chNewRows.getValue()==='checked';
Common.localStorage.setBool("sse-settings-autoformat-new-rows", value);
Common.Utils.InternalSettings.set("sse-settings-autoformat-new-rows", value);
me.api.asc_setIncludeNewRowColTable(value);
}
};
} }
Common.Views.AdvancedSettingsWindow.prototype.initialize.call(this, this.options); Common.Views.AdvancedSettingsWindow.prototype.initialize.call(this, this.options);
@ -325,6 +337,12 @@ define([ 'text!common/main/lib/template/AutoCorrectDialog.template',
labelText: this.textNumbered, labelText: this.textNumbered,
value: Common.Utils.InternalSettings.get(this.appPrefix + "settings-autoformat-numbered") value: Common.Utils.InternalSettings.get(this.appPrefix + "settings-autoformat-numbered")
}); });
} else if (this.appPrefix=='sse-') {
this.chNewRows = new Common.UI.CheckBox({
el: $('#id-autocorrect-dialog-chk-new-rows'),
labelText: this.textNewRowCol,
value: Common.Utils.InternalSettings.get(this.appPrefix + "settings-autoformat-new-rows")
});
} }
this.applyButtons = $window.find('.dlg-btn.can-apply'); this.applyButtons = $window.find('.dlg-btn.can-apply');
@ -777,7 +795,9 @@ define([ 'text!common/main/lib/template/AutoCorrectDialog.template',
textQuotes: '"Straight quotes" with "smart quotes"', textQuotes: '"Straight quotes" with "smart quotes"',
textHyphens: 'Hyphens (--) with dash (—)', textHyphens: 'Hyphens (--) with dash (—)',
textBulleted: 'Automatic bulleted lists', textBulleted: 'Automatic bulleted lists',
textNumbered: 'Automatic numbered lists' textNumbered: 'Automatic numbered lists',
textApplyAsWork: 'Apply as you work',
textNewRowCol: 'Include new rows and columns in table'
}, Common.Views.AutoCorrectDialog || {})) }, Common.Views.AutoCorrectDialog || {}))
}); });

View file

@ -2267,6 +2267,10 @@ define([
Common.Utils.InternalSettings.set("sse-settings-rec-functions-rem", value); Common.Utils.InternalSettings.set("sse-settings-rec-functions-rem", value);
arrRem = value ? JSON.parse(value) : []; arrRem = value ? JSON.parse(value) : [];
me.api.asc_refreshOnStartAutoCorrectMathFunctions(arrRem, arrAdd); me.api.asc_refreshOnStartAutoCorrectMathFunctions(arrRem, arrAdd);
value = Common.localStorage.getBool("sse-settings-autoformat-new-rows", true);
Common.Utils.InternalSettings.set("sse-settings-autoformat-new-rows", value);
me.api.asc_setIncludeNewRowColTable(value);
}, },
leavePageText: 'You have unsaved changes in this document. Click \'Stay on this Page\' then \'Save\' to save them. Click \'Leave this Page\' to discard all the unsaved changes.', leavePageText: 'You have unsaved changes in this document. Click \'Stay on this Page\' then \'Save\' to save them. Click \'Leave this Page\' to discard all the unsaved changes.',

View file

@ -76,6 +76,9 @@
"Common.Views.AutoCorrectDialog.textRecognizedDesc": "The following expressions are recognized math expressions. They will not be automatically italicized.", "Common.Views.AutoCorrectDialog.textRecognizedDesc": "The following expressions are recognized math expressions. They will not be automatically italicized.",
"Common.Views.AutoCorrectDialog.textWarnAddRec": "Recognized functions must contain only the letters A through Z, uppercase or lowercase.", "Common.Views.AutoCorrectDialog.textWarnAddRec": "Recognized functions must contain only the letters A through Z, uppercase or lowercase.",
"Common.Views.AutoCorrectDialog.textWarnResetRec": "Any expression you added will be removed and the removed ones will be restored. Do you want to continue?", "Common.Views.AutoCorrectDialog.textWarnResetRec": "Any expression you added will be removed and the removed ones will be restored. Do you want to continue?",
"Common.Views.AutoCorrectDialog.textAutoFormat": "AutoFormat As You Type",
"Common.Views.AutoCorrectDialog.textApplyAsWork": "Apply as you work",
"Common.Views.AutoCorrectDialog.textNewRowCol": "Include new rows and columns in table",
"Common.Views.Chat.textSend": "Send", "Common.Views.Chat.textSend": "Send",
"Common.Views.Comments.textAdd": "Add", "Common.Views.Comments.textAdd": "Add",
"Common.Views.Comments.textAddComment": "Add Comment", "Common.Views.Comments.textAddComment": "Add Comment",