js -> jsx

This commit is contained in:
RainLoop Team 2016-06-07 00:57:52 +03:00
parent 3bcf23f8fa
commit 08ccf55577
43 changed files with 2342 additions and 2347 deletions

View file

@ -1,6 +1,6 @@
import ko from 'ko';
import Utils from 'Common/Utils';
import {isUnd} from 'Common/Utils';
import {AbstractComponent} from 'Component/Abstract';
class AbstracCheckbox extends AbstractComponent
@ -13,30 +13,30 @@ class AbstracCheckbox extends AbstractComponent
super();
this.value = params.value;
if (Utils.isUnd(this.value) || !this.value.subscribe)
if (isUnd(this.value) || !this.value.subscribe)
{
this.value = ko.observable(Utils.isUnd(this.value) ? false : !!this.value);
this.value = ko.observable(isUnd(this.value) ? false : !!this.value);
}
this.enable = params.enable;
if (Utils.isUnd(this.enable) || !this.enable.subscribe)
if (isUnd(this.enable) || !this.enable.subscribe)
{
this.enable = ko.observable(Utils.isUnd(this.enable) ? true : !!this.enable);
this.enable = ko.observable(isUnd(this.enable) ? true : !!this.enable);
}
this.disable = params.disable;
if (Utils.isUnd(this.disable) || !this.disable.subscribe)
if (isUnd(this.disable) || !this.disable.subscribe)
{
this.disable = ko.observable(Utils.isUnd(this.disable) ? false : !!this.disable);
this.disable = ko.observable(isUnd(this.disable) ? false : !!this.disable);
}
this.label = params.label || '';
this.inline = Utils.isUnd(params.inline) ? false : params.inline;
this.inline = isUnd(params.inline) ? false : params.inline;
this.readOnly = Utils.isUnd(params.readOnly) ? false : !!params.readOnly;
this.inverted = Utils.isUnd(params.inverted) ? false : !!params.inverted;
this.readOnly = isUnd(params.readOnly) ? false : !!params.readOnly;
this.inverted = isUnd(params.inverted) ? false : !!params.inverted;
this.labeled = !Utils.isUnd(params.label);
this.labeled = !isUnd(params.label);
this.labelAnimated = !!params.labelAnimated;
}

View file

@ -1,7 +1,7 @@
import {_} from 'common';
import ko from 'ko';
import Utils from 'Common/Utils';
import {isUnd} from 'Common/Utils';
import {AbstractComponent} from 'Component/Abstract';
class AbstracRadio extends AbstractComponent
@ -16,13 +16,13 @@ class AbstracRadio extends AbstractComponent
this.values = ko.observableArray([]);
this.value = params.value;
if (Utils.isUnd(this.value) || !this.value.subscribe)
if (isUnd(this.value) || !this.value.subscribe)
{
this.value = ko.observable('');
}
this.inline = Utils.isUnd(params.inline) ? false : params.inline;
this.readOnly = Utils.isUnd(params.readOnly) ? false : !!params.readOnly;
this.inline = isUnd(params.inline) ? false : params.inline;
this.readOnly = isUnd(params.readOnly) ? false : !!params.readOnly;
if (params.values)
{

View file

@ -1,7 +1,7 @@
import {$} from 'common';
import {isUnd} from 'Common/Utils';
import ko from 'ko';
import Utils from 'Common/Utils';
class AbstractComponent
{
@ -40,7 +40,7 @@ const componentExportHelper = (ClassObject, templateID = '') => {
require('Common/Translator').i18nToNodes(params.element);
if (!Utils.isUnd(params.inline) && ko.unwrap(params.inline))
if (!isUnd(params.inline) && ko.unwrap(params.inline))
{
params.element.css('display', 'inline-block');
}

View file

@ -1,6 +1,6 @@
import ko from 'ko';
import Utils from 'Common/Utils';
import {isUnd, trim, pInt} from 'Common/Utils';
import {SaveSettingsStep} from 'Common/Enums';
import {AbstractComponent} from 'Component/Abstract';
@ -17,13 +17,13 @@ class AbstractInput extends AbstractComponent
this.size = params.size || 0;
this.label = params.label || '';
this.preLabel = params.preLabel || '';
this.enable = Utils.isUnd(params.enable) ? true : params.enable;
this.enable = isUnd(params.enable) ? true : params.enable;
this.trigger = params.trigger && params.trigger.subscribe ? params.trigger : null;
this.placeholder = params.placeholder || '';
this.labeled = !Utils.isUnd(params.label);
this.preLabeled = !Utils.isUnd(params.preLabel);
this.triggered = !Utils.isUnd(params.trigger) && !!this.trigger;
this.labeled = !isUnd(params.label);
this.preLabeled = !isUnd(params.preLabel);
this.triggered = !isUnd(params.trigger) && !!this.trigger;
this.classForTrigger = ko.observable('');
@ -32,14 +32,14 @@ class AbstractInput extends AbstractComponent
var
size = ko.unwrap(this.size),
suffixValue = this.trigger ?
' ' + Utils.trim('settings-saved-trigger-input ' + this.classForTrigger()) : ''
' ' + trim('settings-saved-trigger-input ' + this.classForTrigger()) : ''
;
return (size > 0 ? 'span' + size : '') + suffixValue;
}, this);
if (!Utils.isUnd(params.width) && params.element)
if (!isUnd(params.width) && params.element)
{
params.element.find('input,select,textarea').css('width', params.width);
}
@ -57,7 +57,7 @@ class AbstractInput extends AbstractComponent
}
setTriggerState(value) {
switch (Utils.pInt(value))
switch (pInt(value))
{
case SaveSettingsStep.TrueResult:
this.classForTrigger('success');

View file

@ -1,5 +1,5 @@
import Utils from 'Common/Utils';
import {pInt} from 'Common/Utils';
import {SaveSettingsStep} from 'Common/Enums';
import {AbstractComponent, componentExportHelper} from 'Component/Abstract';
@ -41,7 +41,7 @@ class SaveTriggerComponent extends AbstractComponent
setState(value) {
switch (Utils.pInt(value))
switch (pInt(value))
{
case SaveSettingsStep.TrueResult:
this.element

View file

@ -1,6 +1,6 @@
import Utils from 'Common/Utils';
import Translator from 'Common/Translator';
import {defautOptionsAfterRender} from 'Common/Utils';
import {componentExportHelper} from 'Component/Abstract';
import {AbstractInput} from 'Component/AbstractInput';
@ -24,7 +24,7 @@ class SelectComponent extends AbstractInput
this.optionsCaption = Translator.i18n(this.optionsCaption);
}
this.defautOptionsAfterRender = Utils.defautOptionsAfterRender;
this.defautOptionsAfterRender = defautOptionsAfterRender;
}
}

View file

@ -1,5 +1,5 @@
import Utils from 'Common/Utils';
import {isUnd} from 'Common/Utils';
import {componentExportHelper} from 'Component/Abstract';
import {AbstractInput} from 'Component/AbstractInput';
@ -13,7 +13,7 @@ class TextAreaComponent extends AbstractInput
super(params);
this.rows = params.rows || 5;
this.spellcheck = Utils.isUnd(params.spellcheck) ? false : !!params.spellcheck;
this.spellcheck = isUnd(params.spellcheck) ? false : !!params.spellcheck;
}
}