Comparing version 0.3.1 to 0.4.0
{ | ||
"name": "bemer", | ||
"description": "Template engine. BEMJSON to HTML processor.", | ||
"version": "0.3.1", | ||
"version": "0.4.0", | ||
"license": "MIT", | ||
@@ -6,0 +6,0 @@ "ignore": [ |
@@ -205,9 +205,4 @@ definer('Template', /** @exports Template */ function(Match, classify, Node, Selector, Helpers, object, string, is) { | ||
_getDefaultModes: function() { | ||
var hasBlock = this._patterns.some(function(pattern) { | ||
return new Selector(pattern).isBlock(); | ||
}, this); | ||
return { | ||
js: hasBlock, | ||
js: false, | ||
bem: true, | ||
@@ -214,0 +209,0 @@ mods: {}, |
{ | ||
"name": "bemer", | ||
"description": "Template engine. BEMJSON to HTML processor.", | ||
"version": "0.3.1", | ||
"version": "0.4.0", | ||
"repository": { | ||
@@ -6,0 +6,0 @@ "type": "git", |
@@ -59,3 +59,3 @@ # Bemer — БЭМ-шаблонизатор | ||
```html | ||
<div class="page i-bem" data-bem="{"page":{}}"></div> | ||
<div class="page"></div> | ||
``` | ||
@@ -78,3 +78,3 @@ | ||
```html | ||
<div class="item i-bem" data-bem="{"item":{}}"> | ||
<div class="item"> | ||
<div class="item__title">Фотоаппарат</div> | ||
@@ -311,3 +311,3 @@ <div class="item__price">14999</div> | ||
```html | ||
<span class="text i-bem" data-bem="{"text":{}}"></span> | ||
<span class="text"></span> | ||
``` | ||
@@ -331,3 +331,3 @@ | ||
```html | ||
<input class="input i-bem" type="text" data-bem="{"input":{}}"/> | ||
<input class="input" type="text"/> | ||
``` | ||
@@ -343,3 +343,3 @@ | ||
```html | ||
<input class="input i-bem" type="text" placeholder="login" data-bem="{"input":{}}"/> | ||
<input class="input" type="text" placeholder="login"/> | ||
``` | ||
@@ -351,3 +351,3 @@ | ||
По умолчанию: для блока `true`, для элемента `false` | ||
По умолчанию: `false` | ||
@@ -359,6 +359,6 @@ Поле `js` указывает на наличие клиентского JavaScript у блока или элемента. | ||
Блок без JS-реализации: | ||
Блок с JS-реализацией: | ||
```js | ||
bemer.match('menu', { js: false }); | ||
bemer.match('menu', { js: true }); | ||
bemer({ block: 'menu' }); | ||
@@ -368,3 +368,3 @@ ``` | ||
```html | ||
<div class="menu"></div> | ||
<div class="menu i-bem" data-bem="{"menu":{}}"></div> | ||
``` | ||
@@ -404,6 +404,6 @@ | ||
Тег `html` без JS-параметров и без БЭМ-классов: | ||
Тег `html` без БЭМ-классов: | ||
```js | ||
bemer.match('page', { tag: 'html', js: false, bem: false }); | ||
bemer.match('page', { tag: 'html', bem: false }); | ||
bemer({ block: 'page' }); | ||
@@ -432,3 +432,3 @@ ``` | ||
```html | ||
<div class="custom1 custom2 untypical i-bem" data-bem="{"untypical":{}}"></div> | ||
<div class="custom1 custom2 untypical"></div> | ||
``` | ||
@@ -452,3 +452,3 @@ | ||
```html | ||
<div class="header i-bem header_theme_red" data-bem="{"header":{}}"></div> | ||
<div class="header header_theme_red"></div> | ||
``` | ||
@@ -464,3 +464,3 @@ | ||
```html | ||
<div class="header i-bem header_theme_red header_adaptive" data-bem="{"header":{}}"></div> | ||
<div class="header header_theme_red header_adaptive"></div> | ||
``` | ||
@@ -516,3 +516,3 @@ | ||
```html | ||
<div class="header i-bem clearfix" data-bem="{"header":{}}"></div> | ||
<div class="header clearfix"></div> | ||
``` | ||
@@ -528,3 +528,3 @@ | ||
```html | ||
<div class="header i-bem menu" data-bem="{"header":{},"menu":{"length":10}}"></div> | ||
<div class="header i-bem menu" data-bem="{"menu":{"length":10}}"></div> | ||
``` | ||
@@ -540,3 +540,3 @@ | ||
```html | ||
<div class="header i-bem menu__wrap clearfix" data-bem="{"header":{}}"></div> | ||
<div class="header menu__wrap clearfix"></div> | ||
``` | ||
@@ -559,3 +559,3 @@ | ||
```html | ||
<div class="page i-bem" data-bem="{"page":{}}">Hello world!</div> | ||
<div class="page">Hello world!</div> | ||
``` | ||
@@ -574,5 +574,5 @@ | ||
```html | ||
<div class="page i-bem" data-bem="{"page":{}}"> | ||
<div class="header i-bem" data-bem="{"header":{}}"></div> | ||
<div class="footer i-bem" data-bem="{"footer":{}}"></div> | ||
<div class="page"> | ||
<div class="header"></div> | ||
<div class="footer"></div> | ||
</div> | ||
@@ -602,3 +602,3 @@ ``` | ||
```html | ||
<b class="bold i-bem" data-bem="{"bold":{}}"></b> | ||
<b class="bold"></b> | ||
``` | ||
@@ -622,3 +622,3 @@ | ||
```html | ||
<div class="header i-bem" data-bem="{"header":{}}">Hello world!</div> | ||
<div class="header">Hello world!</div> | ||
``` | ||
@@ -642,3 +642,3 @@ | ||
```html | ||
<b class="text i-bem" data-bem="{"text":{}}"></b> | ||
<b class="text"></b> | ||
``` | ||
@@ -663,3 +663,3 @@ | ||
```html | ||
<div class="input i-bem" type="number" name="age" data-bem="{"input":{}}"></div> | ||
<div class="input" type="number" name="age"></div> | ||
``` | ||
@@ -683,3 +683,3 @@ | ||
```html | ||
<span class="text i-bem" data-bem="{"text":{}}"></span> | ||
<span class="text"></span> | ||
``` | ||
@@ -709,3 +709,3 @@ | ||
```html | ||
<div class="sum i-bem" data-bem="{"sum":{}}">10</div> | ||
<div class="sum">10</div> | ||
``` | ||
@@ -722,3 +722,3 @@ | ||
bemer | ||
.match('input', { tag: 'input' }) | ||
.match('input', { js: true, tag: 'input' }) | ||
.match('input', { attrs: { type: 'text' }}) | ||
@@ -776,3 +776,3 @@ .match('input_inactive', { js: false }); | ||
```html | ||
<div class="text i-bem" data-bem="{"text":{}}">Hello world!</div> | ||
<div class="text">Hello world!</div> | ||
``` | ||
@@ -858,3 +858,3 @@ | ||
```html | ||
<div class="name i-bem" data-bem="{"name":{}}"></div> | ||
<div class="name"></div> | ||
``` | ||
@@ -937,3 +937,3 @@ | ||
```html | ||
<div class="header i-bem" data-bem="{"header":{}}">36</div> | ||
<div class="header">36</div> | ||
``` | ||
@@ -940,0 +940,0 @@ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
873324
87
5513