Commit cb29d769 authored by Thomas Rehm's avatar Thomas Rehm

[FEATURE] Moved Text Checker Strict mode Options to TextChecker.js

parent 9d47cc30
......@@ -23,6 +23,10 @@ Ext.define('ARSnova.view.speaker.form.TextChecker', {
config: {
pressed: 'free',
scrollable: null,
ignoreCaseSensitive: false,
ignoreWhitespaces: false,
ignorePunctuation: false,
cls: 'newQuestionOptions centerFormTitle'
},
......@@ -30,6 +34,44 @@ Ext.define('ARSnova.view.speaker.form.TextChecker', {
var me = this;
this.callParent(arguments);
var strictOptions = Ext.create('Ext.form.FieldSet', {
title: Messages.TEXT_CHECKER_STRICT_OPTIONS,
hidden: true,
items: [{
xtype: 'segmentedbutton',
style: 'margin: auto',
allowMultiple: true,
//cls: 'yesnoOptions',
defaults: {
ui: 'action',
style: 'width: 33.3%'
},
items: [{
text: Messages.TEXT_CHECKER_IGNORE_CASE_SENSITIVE,
pressed: this.getIgnoreCaseSensitive(),
scope: this,
handler: function () {
this.setIgnoreCaseSensitive(!this.getIgnoreCaseSensitive());
}
},{
text: Messages.TEXT_CHECKER_IGNORE_WHITESPACE,
pressed: this.getIgnoreWhitespaces(),
scope: this,
handler: function () {
this.setIgnoreWhitespaces(!this.getIgnoreWhitespaces());
}
}, {
text: Messages.TEXT_CHECKER_IGNORE_PUNCTUATION,
pressed: this.getIgnorePunctuation(),
scope: this,
handler: function () {
this.setIgnorePunctuation(!this.getIgnorePunctuation());
}
}]
}]
});
this.textCheckerStricktOptionsFormPart = Ext.create('ARSnova.view.speaker.form.textCheckerStricktOptionsForm', {
id: 'textCheckerStricktOptionsFormPart',
hidden: true
......@@ -41,7 +83,7 @@ Ext.define('ARSnova.view.speaker.form.TextChecker', {
mainFormPanel.hide();
selectField.hide();
ratingField.hide();
me.textCheckerStricktOptionsFormPart.hide();
strictOptions.hide();
},
pressed: this.getPressed() === 'free'
});
......@@ -72,7 +114,7 @@ Ext.define('ARSnova.view.speaker.form.TextChecker', {
var easyButton = Ext.create('Ext.Button', {
text: Messages.TEXT_CHECKER_MODE_EASY,
handler: function () {
me.textCheckerStricktOptionsFormPart.hide();
strictOptions.hide();
},
pressed: true
});
......@@ -80,7 +122,7 @@ Ext.define('ARSnova.view.speaker.form.TextChecker', {
var strictButton = Ext.create('Ext.Button', {
text: Messages.TEXT_CHECKER_MODE_STRICT,
handler: function () {
me.textCheckerStricktOptionsFormPart.show();
strictOptions.show();
},
pressed: this.getPressed() === 'strict'
});
......@@ -142,16 +184,17 @@ Ext.define('ARSnova.view.speaker.form.TextChecker', {
freefixField,
mainFormPanel,
selectField,
this.textCheckerStricktOptionsFormPart,
strictOptions,
//this.textCheckerStricktOptionsFormPart,
ratingField
]);
},
getValues: function() {
var result = {};
result.ignoreCaseSensitive = this.textCheckerStricktOptionsFormPart.getIgnoreCaseSensitive();
result.ignoreWhitespaces = this.textCheckerStricktOptionsFormPart.getIgnoreWhitespaces();
result.ignorePunctuation = this.textCheckerStricktOptionsFormPart.getIgnorePunctuation();
result.ignoreCaseSensitive = this.getIgnoreCaseSensitive();
result.ignoreWhitespaces = this.getIgnoreWhitespaces();
result.ignorePunctuation = this.getIgnorePunctuation();
return result;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment