Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
62 changes: 31 additions & 31 deletions common.blocks/clearfix/clearfix.en.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,60 +8,60 @@ Example when used as a container:

```bemjson
[{
block: 'header',
attrs: { style: 'border: 2px solid blue;' },
content: 'Top element'
block : 'header',
attrs : { style : 'border : 2px solid blue;' },
content : 'Top element'
},
{
block: 'clearfix',
attrs: { style: 'border: 2px dotted yellow;' },
content: [
block : 'clearfix',
attrs : { style : 'border : 2px dotted yellow;' },
content : [
{
block: 'float',
attrs: { style: 'float: left; border: 1px solid green;' },
content: 'Floating item 1'
block : 'float',
attrs : { style : 'float : left; border : 1px solid green;' },
content : 'Floating item 1'
},
{
block: 'float',
attrs: { style: 'float: left; border: 1px solid green;' },
content: 'Floating item 2'
block : 'float',
attrs : { style : 'float : left; border : 1px solid green;' },
content : 'Floating item 2'
}]
},
{
block: 'footer',
attrs: { style: 'border: 2px solid red' },
content: 'Footer'
block : 'footer',
attrs : { style : 'border : 2px solid red' },
content : 'Footer'
}]
```

Mixed with a container block:

```bemjson
[{
block: 'header',
attrs: { style: 'border: 2px solid blue;' },
content: 'Top element'
block : 'header',
attrs : { style : 'border : 2px solid blue;' },
content : 'Top element'
},
{
block: 'some-container',
mix: [{ block: 'clearfix' }],
attrs: { style: 'border: 2px dotted yellow;' },
content: [
block : 'some-container',
mix : [{ block : 'clearfix' }],
attrs : { style : 'border : 2px dotted yellow;' },
content : [
{
block: 'float',
attrs: { style: 'float: left; border: 1px solid green;' },
content: 'Floating item 1'
block : 'float',
attrs : { style : 'float : left; border : 1px solid green;' },
content : 'Floating item 1'
},
{
block: 'float',
attrs: { style: 'float: left; border: 1px solid green;' },
content: 'Floating item 2'
block : 'float',
attrs : { style : 'float : left; border : 1px solid green;' },
content : 'Floating item 2'
}]
},
{
block: 'footer',
attrs: { style: 'border: 2px solid red' },
content: 'Footer'
block : 'footer',
attrs : { style : 'border : 2px solid red' },
content : 'Footer'
}]
```

Expand Down
62 changes: 31 additions & 31 deletions common.blocks/clearfix/clearfix.ru.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,60 +8,60 @@

```bemjson
[{
block: 'header',
attrs: { style: 'border: 2px solid blue;' },
content: 'Top element'
block : 'header',
attrs : { style : 'border : 2px solid blue;' },
content : 'Top element'
},
{
block: 'clearfix',
attrs: { style: 'border: 2px dotted yellow;' },
content: [
block : 'clearfix',
attrs : { style : 'border : 2px dotted yellow;' },
content : [
{
block: 'float',
attrs: { style: 'float: left; border: 1px solid green;' },
content: 'Floating item 1'
block : 'float',
attrs : { style : 'float : left; border : 1px solid green;' },
content : 'Floating item 1'
},
{
block: 'float',
attrs: { style: 'float: left; border: 1px solid green;' },
content: 'Floating item 2'
block : 'float',
attrs : { style : 'float : left; border : 1px solid green;' },
content : 'Floating item 2'
}]
},
{
block: 'footer',
attrs: { style: 'border: 2px solid red' },
content: 'Footer'
block : 'footer',
attrs : { style : 'border : 2px solid red' },
content : 'Footer'
}]
```

Примешивание к блоку-контейнеру:

```bemjson
[{
block: 'header',
attrs: { style: 'border: 2px solid blue;' },
content: 'Top element'
block : 'header',
attrs : { style : 'border : 2px solid blue;' },
content : 'Top element'
},
{
block: 'some-container',
mix: [{ block: 'clearfix' }],
attrs: { style: 'border: 2px dotted yellow;' },
content: [
block : 'some-container',
mix : [{ block : 'clearfix' }],
attrs : { style : 'border : 2px dotted yellow;' },
content : [
{
block: 'float',
attrs: { style: 'float: left; border: 1px solid green;' },
content: 'Floating item 1'
block : 'float',
attrs : { style : 'float : left; border : 1px solid green;' },
content : 'Floating item 1'
},
{
block: 'float',
attrs: { style: 'float: left; border: 1px solid green;' },
content: 'Floating item 2'
block : 'float',
attrs : { style : 'float : left; border : 1px solid green;' },
content : 'Floating item 2'
}]
},
{
block: 'footer',
attrs: { style: 'border: 2px solid red' },
content: 'Footer'
block : 'footer',
attrs : { style : 'border : 2px solid red' },
content : 'Footer'
}]
```

Expand Down
25 changes: 12 additions & 13 deletions common.blocks/jquery/__event/jquery__event.en.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,27 +19,26 @@ Each polyfill adds a set of **pointer events** for creating hardware agnostic lo
All the pointer events are jQuery user events. Subscribe to pointer events in the standard way:

```js
modules.define(
'pointer-test',
['i-bem__dom', 'jquery'],
function(provide, BEMDOM, $) {
modules.define('pointer-test', ['i-bem-dom'], function(provide, bemDom) {

provide(BEMDOM.decl({ block : this.name }, /** @lends pointer-test.prototype */ {
provide(bemDom.declBlock(this.name, /** @lends pointer-test.prototype */ {
onSetMod : {
'js' : {
'inited' : function() {
this.bindTo('pointerpress', this.onPress); // subscribing to pointerpress on the block itself during initialization
js : {
inited : function() {
// subscribing to pointerpress on the block itself during initialization
this._domEvents().on('pointerpress', this._onPress);
}
}

},
onPress : function(e) {
_onPress : function(e) {
console.log(e.type);
this.bindTo('pointerrelease', this.onRelease); // subscribing to pointerrelease when calling the pointerpress handler
// subscribing to pointerrelease when calling the pointerpress handler
this._domEvents().on('pointerrelease', this._onRelease);
},
onRelease : function(e) {
_onRelease : function(e) {
console.log(e.type);
this.unbindFrom('pointerrelease', this.onRelease); // unsubscribing from pointerrelease when calling the pointerrelease handler
// unsubscribing from pointerrelease when calling the pointerrelease handler
this._domEvents().un('pointerrelease', this._onRelease);
}
}));
});
Expand Down
25 changes: 12 additions & 13 deletions common.blocks/jquery/__event/jquery__event.ru.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,27 +19,26 @@
Все pointer-события являются пользовательскими событиями jQuery. Подписка на pointer-события осуществляется стандартным образом:

```js
modules.define(
'pointer-test',
['i-bem__dom', 'jquery'],
function(provide, BEMDOM, $) {
modules.define('pointer-test', ['i-bem-dom'], function(provide, bemDom) {

provide(BEMDOM.decl({ block : this.name }, /** @lends pointer-test.prototype */ {
provide(bemDom.declBlock(this.name, /** @lends pointer-test.prototype */ {
onSetMod : {
'js' : {
'inited' : function() {
this.bindTo('pointerpress', this.onPress); // при инициализации подписываемся на pointerpress на самом блоке
js : {
inited : function() {
// при инициализации подписываемся на pointerpress на самом блоке
this._domEvents().on('pointerpress', this._onPress);
}
}

},
onPress : function(e) {
_onPress : function(e) {
console.log(e.type);
this.bindTo('pointerrelease', this.onRelease); // при вызове обработчика для pointerpress подписываемся на pointerrelease
// при вызове обработчика для pointerpress подписываемся на pointerrelease
this._domEvents().on('pointerrelease', this._onRelease);
},
onRelease : function(e) {
_onRelease : function(e) {
console.log(e.type);
this.unbindFrom('pointerrelease', this.onRelease); // при вызове обработчика для pointerrelease отписываемся от pointerrelease
// при вызове обработчика для pointerrelease отписываемся от pointerrelease
this._domEvents().un('pointerrelease', this._onRelease);
}
}));
});
Expand Down
49 changes: 49 additions & 0 deletions common.blocks/jquery/jquery.en.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
# jquery

This block is for downloading the [jQuery](https://jquery.com) library and its extensions and enabling them on a page.
Extensions are enabled via dependencies on the block elements.

## Usage

```js
modules.require(['jquery'], function($) {
console.log($);
});
```

## Overview

### Elements of the block

| Element | Usage | Description |
| --------| --------------------- | -------- |
| <a href="#elems-config">config</a> | `JS` | jQuery configuration. |
| <a href="#elems-event">event</a> | `JS` | Extensions for the jQuery event model. |

### Properties and methods of the block elements

| Element| Name | Return type | Description |
| -------| --- | ----------------------------- | -------- |
| <a href="#elems-config">config</a> | <a href="#fields-url">url</a> | `String` | String with the URL for connecting the jQuery library. |

### Events of the block elements

| Element | Name | Description |
| ------- | --- | -------- |
| <a href="#elems-event">event</a> | <a href="#events-pointerclick">pointerclick</a> | Eliminates the delay of the `click` event on touch devices. |
| | <a href="#events-pointerover">pointerover</a> | Generated when the pointer on the input device is over an element. |
| | <a href="#events-pointerenter">pointerenter</a> | Generated when the pointer enters an element's active area. |
| | <a href="#events-pointerdown">pointerdown</a> | Generated when the input device enters the active button state. |
| | <a href="#events-pointermove">pointermove</a> | Generated when the pointer's coordinates change. |
| | <a href="#events-pointerup">pointerup</a> | Generated when exiting the active button state. |
| | <a href="#events-pointerout">pointerout</a> | Generated when the pointer leaves the area over an element. |
| | <a href="#events-pointerleave">pointerleave</a> | Generated when the pointer leaves an element's active area. |
| | <a href="#events-pointerpress">pointerpress</a> | Generated on the `pointerdown` event. |
| | <a href="#events-pointerrelease">pointerrelease</a> | Generated on the `pointerup` and `pointercancel` events. |
| | <a href="#events-pointercancel">pointercancel</a> | Generated when more pointer events are not expected to occur, or after generating the `pointerdown` event. |

### Public block technologies

The block is implemented in:

* `js`
Loading