Skip to content

Commit

Permalink
Version 2.1.1
Browse files Browse the repository at this point in the history
GitOrigin-RevId: a9a39a76170ef11f317a5086356ebd4a25174a3a
  • Loading branch information
Interfaced authored and l1bbcsg committed Feb 4, 2020
1 parent de9462c commit 68567ea
Show file tree
Hide file tree
Showing 60 changed files with 3,970 additions and 5,532 deletions.
2 changes: 2 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
test/generated
fake.webpack.config.js
31 changes: 19 additions & 12 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,35 +1,42 @@
const copyright = [
'',
' * This file is part of the ZombieBox package.',
' *',
` * Copyright © 2012-${(new Date).getFullYear()}, Interfaced`,
' *',
' * For the full copyright and license information, please view the LICENSE',
' * file that was distributed with this source code.',
' '
];

module.exports = {
extends: 'interfaced',
plugins: ['header'],
overrides: [{
files: ['lib/**/*.js', 'test/components/**/*.js'],
extends: 'interfaced/esm',
rules: {
'no-else-return': 'off',
'padded-blocks': 'off',
'import/extensions': ['error', 'never', {jst: 'always'}],
'import/no-unresolved': ['error', {
ignore: [
'^generated/',
'^cutejs/',
],
}],
'import/extensions': ['error', 'never', {jst: 'always'}]
},
settings: {
'import/resolver': 'zombiebox',
}
}, {
files: ['lib/**/*.js'],
rules: {
'header/header': ['error', 'block', copyright]
}
}, {
files: ['test/karma.*.conf.js', 'index.js'],
extends: 'interfaced/node',
}, {
files: ['test/components/**/*.js'],
extends: 'interfaced/mocha-chai',
rules: {
'no-else-return': 'off',
'import/no-unused-modules': 'off',
},
globals: {
sinon: true,
mochaTestSteps: true,
sinon: true
}
}],
};
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
История изменений
-----------------------

## Версия 2.1.1

* Обновлены зависимости проекта;
* Поддержка ZombieBox 2.6.

## Версия 2.1.0

* Обновлены зависимости проекта;
Expand Down
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
The MIT License (MIT)

Copyright © 2019 Interfaced
Copyright © 2012-2020 Interfaced

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the “Software”), to deal
Expand Down
8 changes: 8 additions & 0 deletions lib/data/cyclical-list.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
/*
* This file is part of the ZombieBox package.
*
* Copyright © 2012-2020, Interfaced
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
import List from './list';


Expand Down
8 changes: 8 additions & 0 deletions lib/data/dynamic-list.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
/*
* This file is part of the ZombieBox package.
*
* Copyright © 2012-2020, Interfaced
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
import IList from './i-list';
import List from './list';

Expand Down
29 changes: 8 additions & 21 deletions lib/data/i-list.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
/*
* This file is part of the ZombieBox package.
*
* Copyright © 2012-2020, Interfaced
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
import IEventPublisher from 'zb/events/interfaces/i-event-publisher';


Expand Down Expand Up @@ -141,27 +149,6 @@ export default class IList {
}


/**
* @type {Array<ItemType>}
* @protected
*/
IList.prototype._items;


/**
* @type {number}
* @protected
*/
IList.prototype._currentIndex;


/**
* @type {boolean}
* @protected
*/
IList.prototype._autoSelect;


/**
* @const {string} Fired with args: item, index, prevItem, prevIndex
*/
Expand Down
49 changes: 26 additions & 23 deletions lib/data/list.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
/*
* This file is part of the ZombieBox package.
*
* Copyright © 2012-2020, Interfaced
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
import EventPublisher from 'zb/events/event-publisher';
import IList from './i-list';

Expand All @@ -13,6 +21,24 @@ export default class List extends EventPublisher {
constructor(items) {
super();

/**
* @type {Array<ItemType>}
* @protected
*/
this._items;

/**
* @type {number}
* @protected
*/
this._currentIndex;

/**
* @type {boolean}
* @protected
*/
this._autoSelect;

this._items = [];
this._currentIndex = NaN;
this._autoSelect = true;
Expand Down Expand Up @@ -299,7 +325,6 @@ export default class List extends EventPublisher {

if (!isNaN(currentIndex)) {
if (currentIndex === index) {

this._currentIndex = NaN;
changedIndex = NaN;

Expand All @@ -310,7 +335,6 @@ export default class List extends EventPublisher {
}

fireSelectAt = true;

} else if (currentIndex > index) {
changedIndex = currentIndex - 1;
}
Expand All @@ -335,27 +359,6 @@ export default class List extends EventPublisher {
}


/**
* @type {Array<ItemType>}
* @protected
*/
List.prototype._items;


/**
* @type {number}
* @protected
*/
List.prototype._currentIndex;


/**
* @type {boolean}
* @protected
*/
List.prototype._autoSelect;


/**
* Fired with: item {!ItemType}, index {number}, prevItem {!ItemType}, prevIndex {number}
* @const {string}
Expand Down
10 changes: 10 additions & 0 deletions lib/image-preload.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
/*
* This file is part of the ZombieBox package.
*
* Copyright © 2012-2020, Interfaced
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/


/**
* @param {Array<string>} urlList
* @param {number=} timeout
Expand Down
9 changes: 9 additions & 0 deletions lib/limit.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
/*
* This file is part of the ZombieBox package.
*
* Copyright © 2012-2020, Interfaced
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/

/**
* @param {function()|function(...*)} targetFunction
* @param {number} waitTime
Expand Down
12 changes: 10 additions & 2 deletions lib/popups/abstract-base/abstract-base.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
/*
* This file is part of the ZombieBox package.
*
* Copyright © 2012-2020, Interfaced
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
import AbstractCutePopup from 'cutejs/layers/abstract-popup';
import InputKeys from 'zb/device/input/keys';
import InputKey from 'zb/device/input/key';


/**
Expand All @@ -26,7 +34,7 @@ export default class AbstractBase extends AbstractCutePopup {
* @override
*/
_processKey(zbKey, e) {
if (zbKey === InputKeys.BACK) {
if (zbKey === InputKey.BACK) {
this.close(Status.CANCELLED);
return true;
}
Expand Down
8 changes: 8 additions & 0 deletions lib/widgets/arrow-list/arrow-list.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
/*
* This file is part of the ZombieBox package.
*
* Copyright © 2012-2020, Interfaced
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
import * as template from 'generated/cutejs/ui/widgets/arrow-list/arrow-list.jst';
import {updateClassName} from 'zb/html';
import BaseList from '../base-list/base-list';
Expand Down
15 changes: 11 additions & 4 deletions lib/widgets/base-list/abstract-base-list-buffer.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
/*
* This file is part of the ZombieBox package.
*
* Copyright © 2012-2020, Interfaced
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
import IList from '../../data/i-list';
import {
getPrevIndex,
Expand Down Expand Up @@ -261,9 +269,8 @@ export default class AbstractBaseListBuffer {
getGlobalStart() {
if (this.hasSource() && this.getSourceSize()) {
return 0;
} else {
return NaN;
}
return NaN;
}

/**
Expand Down Expand Up @@ -438,9 +445,9 @@ export default class AbstractBaseListBuffer {

if (this._isBlocked && this.isLoading()) {
return true;
} else {
this._isBlocked = false;
}
this._isBlocked = false;


let isSelected = false;

Expand Down
11 changes: 9 additions & 2 deletions lib/widgets/base-list/base-list-data-list.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
/*
* This file is part of the ZombieBox package.
*
* Copyright © 2012-2020, Interfaced
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
import CyclicalList from '../../data/cyclical-list';
import DynamicList from '../../data/dynamic-list';
import AbstractBaseListBuffer from './abstract-base-list-buffer';
Expand Down Expand Up @@ -90,9 +98,8 @@ export default class BaseListDataList extends AbstractBaseListBuffer {
getSourceStart() {
if (this.hasSource() && this.getSourceSize()) {
return this._source.getBufferStart();
} else {
return NaN;
}
return NaN;
}

/**
Expand Down
8 changes: 8 additions & 0 deletions lib/widgets/base-list/base-list-item.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
/*
* This file is part of the ZombieBox package.
*
* Copyright © 2012-2020, Interfaced
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
import {text, div} from 'zb/html';
import IBaseListItem, {Input as IBaseListItemInput} from './i-base-list-item';

Expand Down
10 changes: 10 additions & 0 deletions lib/widgets/base-list/base-list-utils.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
/*
* This file is part of the ZombieBox package.
*
* Copyright © 2012-2020, Interfaced
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/


/*
* Утилита для работы с координатами.
* Ограничения нужны для того, чтобы можно было вычислять конец по размеру и размер по концу.
Expand Down
Loading

0 comments on commit 68567ea

Please sign in to comment.