Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Use latest xjst and ometajs to fix tests

- Small cleanup of `js+coffee.js` code
- Use updated `bem-bl`
- Canonize new reference test results
  • Loading branch information...
commit 3cf8e1c3d2e0bc448686fc8391964319602b0b6e 1 parent d7b2463
@arikon arikon authored
Showing with 3,513 additions and 9,232 deletions.
  1. +1 −3 lib/techs/js+coffee.js
  2. +2 −2 package.json
  3. +1 −1  test/data/make/project/bem-bl
  4. +451 −1,067 test/data/make/reference-result/pages/client/__profile/_client__profile.bemhtml.js
  5. +27 −0 test/data/make/reference-result/pages/client/__profile/_client__profile.en.js
  6. +27 −0 test/data/make/reference-result/pages/client/__profile/_client__profile.js
  7. +27 −0 test/data/make/reference-result/pages/client/__profile/_client__profile.ru.js
  8. +451 −1,067 test/data/make/reference-result/pages/client/__profile/client__profile.bemhtml.js
  9. +591 −1,773 test/data/make/reference-result/pages/client/_client.bemhtml.js
  10. +27 −0 test/data/make/reference-result/pages/client/_client.en.js
  11. +27 −0 test/data/make/reference-result/pages/client/_client.js
  12. +27 −0 test/data/make/reference-result/pages/client/_client.ru.js
  13. +591 −1,773 test/data/make/reference-result/pages/client/client.bemhtml.js
  14. +591 −1,773 test/data/make/reference-result/pages/example/_example.bemhtml.js
  15. +27 −0 test/data/make/reference-result/pages/example/_example.en.js
  16. +27 −0 test/data/make/reference-result/pages/example/_example.js
  17. +27 −0 test/data/make/reference-result/pages/example/_example.ru.js
  18. +591 −1,773 test/data/make/reference-result/pages/example/example.bemhtml.js
View
4 lib/techs/js+coffee.js
@@ -1,6 +1,4 @@
-var COFFEE = require('coffee-script'),
- PATH = require('../path'),
- Q = require('q');
+var COFFEE = require('coffee-script');
exports.baseTechPath = require.resolve('./js.js');
View
4 package.json
@@ -36,8 +36,8 @@
"mime": "~1.2.5",
"underscore": "~1.3.1",
"inherit": "~1.0.0",
- "xjst": "0.2.21",
- "ometajs": "~2.1.10",
+ "xjst": "~0.3.10",
+ "ometajs": "~3.1.15",
"borschik": "~0.0.13",
"apw": "~0.3.6",
"winston": ">= 0.5.0",
2  test/data/make/project/bem-bl
@@ -1 +1 @@
-Subproject commit 88d3a0e3be8d2c5858bb24a88628a8862475ca13
+Subproject commit 3060063e7bbdfa54b416c76c6aada943f7ae8e8c
View
1,518 test/data/make/reference-result/pages/client/__profile/_client__profile.bemhtml.js
@@ -1,62 +1,273 @@
var BEMHTML = (function(exports) {
- var __r8, __r10, __r12, __r14, __r16, __r18, __r20, __r22, __r24, __r26, __r33, __r34;
exports.apply = apply;
function apply() {
- return $55.call(this);
+ var __this = this;
+ var __t = this._mode;
+ if (__t === "attrs") {
+ if (this.block === "b-page") {
+ var __t = this.elem;
+ if (__t === "favicon") {
+ return {
+ rel: "shortcut icon",
+ href: this.ctx.url
+ };
+ return;
+ } else if (__t === "js") {
+ if (!this.ctx.url === false) {
+ return {
+ src: this.ctx.url
+ };
+ return;
+ } else {
+ return $99.call(this);
+ }
+ } else if (__t === "css") {
+ if (!this.ctx.url === false) {
+ return {
+ rel: "stylesheet",
+ href: this.ctx.url
+ };
+ return;
+ } else {
+ return $99.call(this);
+ }
+ } else if (__t === "meta") {
+ return this.ctx.attrs;
+ return;
+ } else {
+ return $99.call(this);
+ }
+ } else {
+ return $99.call(this);
+ }
+ } else if (__t === "tag") {
+ var __t = this.block;
+ if (__t === "b-page") {
+ var __t = this.elem;
+ if (__t === "favicon") {
+ return "link";
+ return;
+ } else if (__t === "js") {
+ return "script";
+ return;
+ } else if (__t === "css") {
+ if (!this.ctx.url === false) {
+ return "link";
+ return;
+ } else {
+ return "style";
+ return;
+ }
+ } else if (__t === "meta") {
+ return "meta";
+ return;
+ } else if (__t === "body") {
+ return "body";
+ return;
+ } else if (__t === "head") {
+ return "head";
+ return;
+ } else {
+ return $99.call(this);
+ }
+ } else if (__t === "i-ua") {
+ if (!!this.elem === false) {
+ return "script";
+ return;
+ } else {
+ return $99.call(this);
+ }
+ } else {
+ return $99.call(this);
+ }
+ } else if (__t === "bem") {
+ var __t = this.block;
+ if (__t === "b-page") {
+ var __t = this.elem;
+ if (__t === "favicon" || __t === "js" || __t === "css" || __t === "meta" || __t === "head") {
+ return false;
+ return;
+ } else {
+ return $99.call(this);
+ }
+ } else if (__t === "i-ua") {
+ if (!!this.elem === false) {
+ return false;
+ return;
+ } else {
+ return $99.call(this);
+ }
+ } else {
+ return $99.call(this);
+ }
+ } else if (__t === "default") {
+ var __t = this.block;
+ if (__t === "b-page") {
+ if (this.elem === "css") {
+ if (!this.ctx.hasOwnProperty("ie") === false) {
+ if (!!this.ctx._ieCommented === false) {
+ return $74.call(this);
+ } else {
+ return $79.call(this);
+ }
+ } else {
+ return $79.call(this);
+ }
+ } else {
+ return $79.call(this);
+ }
+ } else if (__t === "i-jquery") {
+ if (this.elem === "core") {
+ var __r36, __r37, __r38;
+ return "", __r36 = this._mode, this._mode = "", __r37 = this.ctx, this.ctx = {
+ block: "b-page",
+ elem: "js",
+ url: "//yandex.st/jquery/1.7.2/jquery.min.js"
+ }, __r38 = apply.call(__this), this._mode = __r36, this.ctx = __r37, "", __r38;
+ return;
+ } else {
+ return $99.call(this);
+ }
+ } else {
+ return $99.call(this);
+ }
+ } else if (__t === "content") {
+ if (this.block === "i-ua") {
+ if (!!this.elem === false) {
+ return [ ";(function(d,e,c,r){", "e=d.documentElement;", 'c="className";', 'r="replace";', 'e[c]=e[c][r]("i-ua_js_no","i-ua_js_yes");', 'if(d.compatMode!="CSS1Compat")', 'e[c]=e[c][r]("i-ua_css_standart","i-ua_css_quirks")', "})(document);" ].join("");
+ return;
+ } else {
+ return $99.call(this);
+ }
+ } else {
+ return $99.call(this);
+ }
+ } else {
+ return $99.call(this);
+ }
}
- function $2() {
- return "link";
+ function $74() {
+ var _$rie = this.ctx.ie;
+ if (_$rie === true) {
+ {
+ "";
+ var __r41 = this._mode;
+ this._mode = "";
+ var __r42 = this.ctx;
+ this.ctx = [ 6, 7, 8, 9 ].map(function(v) {
+ return {
+ elem: "css",
+ url: this.ctx.url + ".ie" + v + ".css",
+ ie: "IE " + v
+ };
+ }, this);
+ this.apply();
+ this._mode = __r41;
+ this.ctx = __r42;
+ "";
+ }
+ } else {
+ var _$rhideRule = !_$rie ? [ "gt IE 9", "<!-->", "<!--" ] : _$rie == "!IE" ? [ _$rie, "<!-->", "<!--" ] : [ _$rie, "", "" ];
+ {
+ "";
+ var __r43 = this._mode;
+ this._mode = "";
+ var __r44 = this.ctx, __r45 = __r44._ieCommented;
+ __r44._ieCommented = true;
+ var __r46 = this.ctx;
+ this.ctx = [ "<!--[if " + _$rhideRule[0] + "]>", _$rhideRule[1], this.ctx, _$rhideRule[2], "<![endif]-->" ];
+ this.apply();
+ this._mode = __r43;
+ __r44._ieCommented = __r45;
+ this.ctx = __r46;
+ "";
+ }
+ }
return;
}
- function $3() {
- return false;
- return;
+ function $79() {
+ if (!!this.elem === false) {
+ return $81.call(this);
+ } else {
+ return $99.call(this);
+ }
}
- function $4() {
- this["_buf"].push("<!DOCTYPE html>");
- "";
- var __r36 = this["_mode"];
- this["_mode"] = "";
- var __r37 = this["ctx"];
- this["ctx"] = {
- tag: "html",
- cls: "i-ua_js_no i-ua_css_standard",
- content: [ {
- elem: "head",
+ function $81() {
+ this._buf.push("<!DOCTYPE html>");
+ {
+ "";
+ var __r39 = this._mode;
+ this._mode = "";
+ var __r40 = this.ctx;
+ this.ctx = {
+ tag: "html",
+ cls: "i-ua_js_no i-ua_css_standard",
content: [ {
- tag: "meta",
- attrs: {
- charset: "utf-8"
- }
- }, {
- tag: "meta",
- attrs: {
- "http-equiv": "X-UA-Compatible",
- content: "IE=EmulateIE7, IE=edge"
- }
+ elem: "head",
+ content: [ {
+ tag: "meta",
+ attrs: {
+ charset: "utf-8"
+ }
+ }, {
+ tag: "meta",
+ attrs: {
+ "http-equiv": "X-UA-Compatible",
+ content: "IE=EmulateIE7, IE=edge"
+ }
+ }, {
+ tag: "title",
+ content: this.ctx.title
+ }, this.ctx.favicon ? {
+ elem: "favicon",
+ url: this.ctx.favicon
+ } : "", this.ctx.meta, {
+ block: "i-ua"
+ }, this.ctx.head ]
}, {
- tag: "title",
- content: this["ctx"]["title"]
- }, this["ctx"]["favicon"] ? {
- elem: "favicon",
- url: this["ctx"]["favicon"]
- } : "", this["ctx"]["meta"], {
- block: "i-ua"
- }, this["ctx"]["head"] ]
- }, {
- elem: "body",
- mix: [ this["ctx"] ],
- content: [ this["ctx"]["content"] ]
- } ]
- };
- this.apply();
- this["_mode"] = __r36;
- this["ctx"] = __r37;
- "";
+ elem: "body",
+ mix: [ this.ctx ],
+ content: [ this.ctx.content ]
+ } ]
+ };
+ this.apply();
+ this._mode = __r39;
+ this.ctx = __r40;
+ "";
+ }
return;
}
- function $5() {
- var BEM_ = {}, toString = Object["prototype"]["toString"], SHORT_TAGS = {
+ function $99() {
+ if (!!this._start === false) {
+ return $101.call(this);
+ } else {
+ var __t = this._mode;
+ if (__t === "content") {
+ return this.ctx.content;
+ return;
+ } else if (__t === "mix" || __t === "bem" || __t === "jsAttr" || __t === "js" || __t === "cls" || __t === "attrs" || __t === "tag") {
+ return undefined;
+ return;
+ } else if (__t === "default") {
+ return $120.call(this);
+ } else {
+ if (!this._.isSimple(this.ctx) === false) {
+ if (!!this._mode === false) {
+ this._listLength--;
+ var _$3ctx = this.ctx;
+ (_$3ctx && _$3ctx !== true || _$3ctx === 0) && this._buf.push(_$3ctx);
+ return;
+ } else {
+ return $127.call(this);
+ }
+ } else {
+ return $127.call(this);
+ }
+ }
+ }
+ }
+ function $101() {
+ var _$dBEM_ = {}, _$dtoString = Object.prototype.toString, _$dSHORT_TAGS = {
area: 1,
base: 1,
br: 1,
@@ -75,19 +286,19 @@ var BEMHTML = (function(exports) {
};
(function(BEM, undefined) {
var MOD_DELIM = "_", ELEM_DELIM = "__", NAME_PATTERN = "[a-zA-Z0-9-]+";
- var buildModPostfix = function(modName, modVal, buffer) {
+ function buildModPostfix(modName, modVal, buffer) {
buffer.push(MOD_DELIM, modName, MOD_DELIM, modVal);
- };
- var buildBlockClass = function(name, modName, modVal, buffer) {
+ }
+ function buildBlockClass(name, modName, modVal, buffer) {
buffer.push(name);
modVal && buildModPostfix(modName, modVal, buffer);
- };
- var buildElemClass = function(block, name, modName, modVal, buffer) {
+ }
+ function buildElemClass(block, name, modName, modVal, buffer) {
buildBlockClass(block, undefined, undefined, buffer);
buffer.push(ELEM_DELIM, name);
modVal && buildModPostfix(modName, modVal, buffer);
- };
- BEM["INTERNAL"] = {
+ }
+ BEM.INTERNAL = {
NAME_PATTERN: NAME_PATTERN,
MOD_DELIM: MOD_DELIM,
ELEM_DELIM: ELEM_DELIM,
@@ -120,13 +331,11 @@ var BEMHTML = (function(exports) {
}
}
}
- undefined;
if (!(elem || modName || buffer)) {
return block;
} else {
undefined;
}
- undefined;
var res = buffer || [];
elem ? buildElemClass(block, elem, modName, modVal, res) : buildBlockClass(block, modName, modVal, res);
return buffer ? res : res.join("");
@@ -136,7 +345,7 @@ var BEMHTML = (function(exports) {
if (mods) {
var modName;
for (modName in mods) {
- if (mods.hasOwnProperty(modName) && mods[modName] && mods[modName]["length"]) {
+ if (mods.hasOwnProperty(modName) && mods[modName] && mods[modName].toString().length) {
var modVal = mods[modName];
res.push(" ");
elem ? buildElemClass(block, elem, modName, modVal, res) : buildBlockClass(block, modName, modVal, res);
@@ -147,7 +356,6 @@ var BEMHTML = (function(exports) {
} else {
undefined;
}
- undefined;
return buffer ? res : res.join("");
},
buildClasses: function(block, elem, mods, buffer) {
@@ -157,8 +365,8 @@ var BEMHTML = (function(exports) {
return buffer ? res : res.join("");
}
};
- })(BEM_);
- var buildEscape = function() {
+ })(_$dBEM_);
+ var _$dbuildEscape = function() {
var ts = {
'"': "&quot;",
"&": "&amp;",
@@ -173,21 +381,21 @@ var BEMHTML = (function(exports) {
return ("" + s).replace(r, f);
};
};
- }(), ctx = {
+ }(), _$dctx = {
ctx: this,
_start: true,
apply: apply,
_buf: [],
_: {
isArray: function(obj) {
- return toString.call(obj) === "[object Array]";
+ return _$dtoString.call(obj) === "[object Array]";
},
isSimple: function(obj) {
var t = typeof obj;
return t === "string" || t === "number" || t === "boolean";
},
isShortTag: function(t) {
- return SHORT_TAGS.hasOwnProperty(t);
+ return _$dSHORT_TAGS.hasOwnProperty(t);
},
extend: function(o1, o2) {
if (!o1 || !o2) {
@@ -195,16 +403,13 @@ var BEMHTML = (function(exports) {
} else {
undefined;
}
- undefined;
var res = {}, n;
for (n in o1) {
o1.hasOwnProperty(n) && (res[n] = o1[n]);
}
- undefined;
for (n in o2) {
o2.hasOwnProperty(n) && (res[n] = o2[n]);
}
- undefined;
return res;
},
identify: function() {
@@ -217,7 +422,6 @@ var BEMHTML = (function(exports) {
} else {
undefined;
}
- undefined;
if (onlyGet || obj[expando]) {
return obj[expando];
} else {
@@ -225,61 +429,90 @@ var BEMHTML = (function(exports) {
}
};
}(),
- xmlEscape: buildEscape("[&<>]"),
- attrEscape: buildEscape('["&<>]')
+ xmlEscape: _$dbuildEscape("[&<>]"),
+ attrEscape: _$dbuildEscape('["&<>]')
},
- BEM: BEM_,
+ BEM: _$dBEM_,
isFirst: function() {
- return this["position"] === 1;
+ return this.position === 1;
},
isLast: function() {
- return this["position"] === this["_listLength"];
+ return this.position === this._listLength;
},
generateId: function() {
- return this["_"].identify(this["ctx"]);
+ return this._.identify(this.ctx);
}
};
- ctx.apply();
- return ctx["_buf"].join("");
+ _$dctx.apply();
+ return _$dctx._buf.join("");
return;
}
- function $6() {
- var _this = this, BEM_ = _this["BEM"], v = this["ctx"], buf = this["_buf"], tag;
- tag = ("", __r8 = this["_mode"], this["_mode"] = "tag", __r9 = $55.call(this), this["_mode"] = __r8, "", __r9);
- typeof tag != "undefined" || (tag = v["tag"]);
- typeof tag != "undefined" || (tag = "div");
- if (tag) {
- var jsParams, js;
- if (this["block"] && v["js"] !== false) {
- js = ("", __r12 = this["_mode"], this["_mode"] = "js", __r13 = $55.call(this), this["_mode"] = __r12, "", __r13);
- js = js ? this["_"].extend(v["js"], js === true ? {} : js) : v["js"] === true ? {} : v["js"];
- js && ((jsParams = {})[BEM_["INTERNAL"].buildClass(this["block"], v["elem"])] = js);
+ function $120() {
+ var __this = this;
+ var __r19, __r7, __r11, __r12, __r13, __r14, __r15, __r16, __r17, __r18, __r8, __r20, __r21, __r22, __r25, __r26, __r27, __r28, __r29, __r30;
+ var _$4_this = this, _$4BEM_ = _$4_this.BEM, _$4v = this.ctx, _$4buf = this._buf, _$4tag;
+ _$4tag = ("", __r7 = this._mode, this._mode = "tag", __r8 = apply.call(__this), this._mode = __r7, "", __r8);
+ typeof _$4tag != "undefined" || (_$4tag = _$4v.tag);
+ typeof _$4tag != "undefined" || (_$4tag = "div");
+ if (_$4tag) {
+ var _$4jsParams, _$4js;
+ if (this.block && _$4v.js !== false) {
+ _$4js = ("", __r11 = this._mode, this._mode = "js", __r12 = apply.call(__this), this._mode = __r11, "", __r12);
+ _$4js = _$4js ? this._.extend(_$4v.js, _$4js === true ? {} : _$4js) : _$4v.js === true ? {} : _$4v.js;
+ _$4js && ((_$4jsParams = {})[_$4BEM_.INTERNAL.buildClass(this.block, _$4v.elem)] = _$4js);
} else {
undefined;
}
- undefined;
- buf.push("<", tag);
- var isBEM = ("", __r14 = this["_mode"], this["_mode"] = "bem", __r15 = $55.call(this), this["_mode"] = __r14, "", __r15);
- typeof isBEM != "undefined" || (isBEM = typeof v["bem"] != "undefined" ? v["bem"] : v["block"] || v["elem"]);
- var cls = ("", __r16 = this["_mode"], this["_mode"] = "cls", __r17 = $55.call(this), this["_mode"] = __r16, "", __r17);
- cls || (cls = v["cls"]);
- var addJSInitClass = v["block"] && jsParams;
- if (isBEM || cls) {
- buf.push(' class="');
- if (isBEM) {
- BEM_["INTERNAL"].buildClasses(this["block"], v["elem"], v["elemMods"] || v["mods"], buf);
- var mix = ("", __r18 = this["_mode"], this["_mode"] = "mix", __r19 = $55.call(this), this["_mode"] = __r18, "", __r19);
- v["mix"] && (mix = mix ? mix.concat(v["mix"]) : v["mix"]);
- if (mix) {
- var i = 0, l = mix["length"], mixItem, hasItem, block;
- while (i < l) {
- mixItem = mix[i++];
- hasItem = mixItem["block"] || mixItem["elem"], block = mixItem["block"] || _this["block"];
- hasItem && buf.push(" ");
- BEM_["INTERNAL"][hasItem ? "buildClasses" : "buildModsClasses"](block, mixItem["elem"] || (mixItem["block"] ? undefined : _this["elem"]), mixItem["elemMods"] || mixItem["mods"], buf);
- if (mixItem["js"]) {
- (jsParams || (jsParams = {}))[BEM_["INTERNAL"].buildClass(block, mixItem["elem"])] = mixItem["js"] === true ? {} : mixItem["js"];
- addJSInitClass || (addJSInitClass = block && !mixItem["elem"]);
+ _$4buf.push("<", _$4tag);
+ var _$4isBEM = ("", __r13 = this._mode, this._mode = "bem", __r14 = apply.call(__this), this._mode = __r13, "", __r14);
+ typeof _$4isBEM != "undefined" || (_$4isBEM = typeof _$4v.bem != "undefined" ? _$4v.bem : _$4v.block || _$4v.elem);
+ var _$4cls = ("", __r15 = this._mode, this._mode = "cls", __r16 = apply.call(__this), this._mode = __r15, "", __r16);
+ _$4cls || (_$4cls = _$4v.cls);
+ var _$4addJSInitClass = _$4v.block && _$4jsParams;
+ if (_$4isBEM || _$4cls) {
+ _$4buf.push(' class="');
+ if (_$4isBEM) {
+ _$4BEM_.INTERNAL.buildClasses(this.block, _$4v.elem, _$4v.elemMods || _$4v.mods, _$4buf);
+ var _$4mix = ("", __r17 = this._mode, this._mode = "mix", __r18 = apply.call(__this), this._mode = __r17, "", __r18);
+ _$4v.mix && (_$4mix = _$4mix ? _$4mix.concat(_$4v.mix) : _$4v.mix);
+ if (_$4mix) {
+ var _$4visited = {};
+ function _$4visitedKey(block, elem) {
+ return (block || "") + "__" + (elem || "");
+ }
+ _$4visited[_$4visitedKey(this.block, this.elem)] = true;
+ if (!this._.isArray(_$4mix)) {
+ _$4mix = [ _$4mix ];
+ } else {
+ undefined;
+ }
+ for (var _$4i = 0; _$4i < _$4mix.length; _$4i++) {
+ var _$4mixItem = _$4mix[_$4i], _$4hasItem = _$4mixItem.block || _$4mixItem.elem, _$4block = _$4mixItem.block || _$4mixItem._block || _$4_this.block, _$4elem = _$4mixItem.elem || _$4mixItem._elem || _$4_this.elem;
+ _$4hasItem && _$4buf.push(" ");
+ _$4BEM_.INTERNAL[_$4hasItem ? "buildClasses" : "buildModsClasses"](_$4block, _$4mixItem.elem || _$4mixItem._elem || (_$4mixItem.block ? undefined : _$4_this.elem), _$4mixItem.elemMods || _$4mixItem.mods, _$4buf);
+ if (_$4mixItem.js) {
+ (_$4jsParams || (_$4jsParams = {}))[_$4BEM_.INTERNAL.buildClass(_$4block, _$4mixItem.elem)] = _$4mixItem.js === true ? {} : _$4mixItem.js;
+ _$4addJSInitClass || (_$4addJSInitClass = _$4block && !_$4mixItem.elem);
+ } else {
+ undefined;
+ }
+ if (_$4hasItem && !_$4visited[_$4visitedKey(_$4block, _$4elem)]) {
+ _$4visited[_$4visitedKey(_$4block, _$4elem)] = true;
+ var _$4nestedMix = ("", __r19 = this.block, this.block = _$4block, __r20 = this.elem, this.elem = _$4elem, __r21 = this._mode, this._mode = "mix", __r22 = apply.call(__this), this.block = __r19, this.elem = __r20, this._mode = __r21, "", __r22);
+ if (_$4nestedMix) {
+ for (var _$4j = 0; _$4j < _$4nestedMix.length; _$4j++) {
+ var _$4nestedItem = _$4nestedMix[_$4j];
+ if (!_$4nestedItem.block && !_$4nestedItem.elem || !_$4visited[_$4visitedKey(_$4nestedItem.block, _$4nestedItem.elem)]) {
+ _$4nestedItem._block = _$4block;
+ _$4nestedItem._elem = _$4elem;
+ _$4mix.splice(_$4i + 1, 0, _$4nestedItem);
+ } else {
+ undefined;
+ }
+ }
+ } else {
+ undefined;
+ }
} else {
undefined;
}
@@ -290,27 +523,29 @@ var BEMHTML = (function(exports) {
} else {
undefined;
}
- undefined;
- cls && buf.push(isBEM ? " " : "", cls);
- addJSInitClass && buf.push(" i-bem");
- buf.push('"');
+ _$4cls && _$4buf.push(_$4isBEM ? " " : "", _$4cls);
+ _$4addJSInitClass && _$4buf.push(" i-bem");
+ _$4buf.push('"');
} else {
undefined;
}
- undefined;
- if (jsParams) {
- var jsAttr = ("", __r22 = this["_mode"], this["_mode"] = "jsAttr", __r23 = $55.call(this), this["_mode"] = __r22, "", __r23);
- buf.push(" ", jsAttr || "onclick", '="return ', this["_"].attrEscape(JSON.stringify(jsParams)), '"');
+ if (_$4jsParams) {
+ var _$4jsAttr = ("", __r25 = this._mode, this._mode = "jsAttr", __r26 = apply.call(__this), this._mode = __r25, "", __r26);
+ _$4buf.push(" ", _$4jsAttr || "onclick", '="return ', this._.attrEscape(JSON.stringify(_$4jsParams)), '"');
} else {
undefined;
}
- undefined;
- var attrs = ("", __r24 = this["_mode"], this["_mode"] = "attrs", __r25 = $55.call(this), this["_mode"] = __r24, "", __r25);
- attrs = this["_"].extend(attrs, v["attrs"]);
- if (attrs) {
- var name;
- for (name in attrs) {
- buf.push(" ", name, '="', this["_"].attrEscape(attrs[name]), '"');
+ var _$4attrs = ("", __r27 = this._mode, this._mode = "attrs", __r28 = apply.call(__this), this._mode = __r27, "", __r28);
+ _$4attrs = this._.extend(_$4attrs, _$4v.attrs);
+ if (_$4attrs) {
+ var _$4name;
+ for (_$4name in _$4attrs) {
+ if (_$4attrs[_$4name] === undefined) {
+ continue;
+ } else {
+ undefined;
+ }
+ _$4buf.push(" ", _$4name, '="', this._.attrEscape(_$4attrs[_$4name]), '"');
}
} else {
undefined;
@@ -318,988 +553,137 @@ var BEMHTML = (function(exports) {
} else {
undefined;
}
- if (this["_"].isShortTag(tag)) {
- buf.push("/>");
+ if (this._.isShortTag(_$4tag)) {
+ _$4buf.push("/>");
} else {
- tag && buf.push(">");
- var content = ("", __r26 = this["_mode"], this["_mode"] = "content", __r27 = $55.call(this), this["_mode"] = __r26, "", __r27);
- if (content || content === 0) {
- var isBEM = this["block"] || this["elem"];
+ _$4tag && _$4buf.push(">");
+ var _$4content = ("", __r29 = this._mode, this._mode = "content", __r30 = apply.call(__this), this._mode = __r29, "", __r30);
+ if (_$4content || _$4content === 0) {
+ var _$4isBEM = this.block || this.elem;
{
"";
- var __r28 = this["_notNewList"];
- this["_notNewList"] = false;
- var __r29 = this["position"];
- this["position"] = isBEM ? 1 : this["position"];
- var __r30 = this["_listLength"];
- this["_listLength"] = isBEM ? 1 : this["_listLength"];
- var __r31 = this["ctx"];
- this["ctx"] = content;
- var __r32 = this["_mode"];
- this["_mode"] = "";
- $55.call(this);
- this["_notNewList"] = __r28;
- this["position"] = __r29;
- this["_listLength"] = __r30;
- this["ctx"] = __r31;
- this["_mode"] = __r32;
+ var __r31 = this._notNewList;
+ this._notNewList = false;
+ var __r32 = this.position;
+ this.position = _$4isBEM ? 1 : this.position;
+ var __r33 = this._listLength;
+ this._listLength = _$4isBEM ? 1 : this._listLength;
+ var __r34 = this.ctx;
+ this.ctx = _$4content;
+ var __r35 = this._mode;
+ this._mode = "";
+ apply.call(__this);
+ this._notNewList = __r31;
+ this.position = __r32;
+ this._listLength = __r33;
+ this.ctx = __r34;
+ this._mode = __r35;
"";
}
undefined;
- undefined;
- undefined;
} else {
undefined;
}
- undefined;
- tag && buf.push("</", tag, ">");
- }
- return;
- }
- function $7() {
- if (!!this["_start"] === false) {
- return $5.call(this);
- } else {
- return $6.call(this);
- }
- }
- function $8() {
- if (!!this["elem"] === false) {
- return $4.call(this);
- } else {
- if (!!this["_start"] === false) {
- return $5.call(this);
- } else {
- return $6.call(this);
- }
+ _$4tag && _$4buf.push("</", _$4tag, ">");
}
- }
- function $9() {
- return this["ctx"]["content"];
return;
}
- function $10() {
- if (!!this["_start"] === false) {
- return $5.call(this);
- } else {
- return $9.call(this);
- }
- }
- function $11() {
- return undefined;
- return;
- }
- function $12() {
- if (!!this["_start"] === false) {
- return $5.call(this);
- } else {
- return $11.call(this);
- }
- }
- function $22() {
- var __this = this;
- if (!!this["_mode"] === false) {
- if (!this["_"].isSimple(this["ctx"]) === false) {
- this["_listLength"]--;
- var ctx = this["ctx"];
- (ctx && ctx !== true || ctx === 0) && this["_buf"].push(ctx);
+ function $127() {
+ if (!!this._mode === false) {
+ if (!!this.ctx === false) {
+ this._listLength--;
return;
} else {
- if (!!this["ctx"] === false) {
- this["_listLength"]--;
- return;
- } else {
- if (!this["_"].isArray(this["ctx"]) === false) {
- var v = this["ctx"], l = v["length"], i = 0, prevPos = this["position"], prevNotNewList = this["_notNewList"];
- if (prevNotNewList) {
- this["_listLength"] += l - 1;
- } else {
- this["position"] = 0;
- this["_listLength"] = l;
- }
- this["_notNewList"] = true;
- while (i < l) {
- {
- "";
- var __r7 = this["ctx"];
- this["ctx"] = v[i++];
- apply.call(__this);
- this["ctx"] = __r7;
- "";
- }
- undefined;
- }
- undefined;
- prevNotNewList || (this["position"] = prevPos);
- return;
- } else {
- if (!true === false) {
- var vBlock = this["ctx"]["block"], vElem = this["ctx"]["elem"], block = this["_currBlock"] || this["block"];
- this["ctx"] || (this["ctx"] = {});
- "";
- var __r0 = this["_mode"];
- this["_mode"] = "default";
- var __r1 = this["block"];
- this["block"] = vBlock || (vElem ? block : undefined);
- var __r2 = this["_currBlock"];
- this["_currBlock"] = vBlock || vElem ? undefined : block;
- var __r3 = this["elem"];
- this["elem"] = this["ctx"]["elem"];
- var __r4 = this["mods"];
- this["mods"] = (vBlock ? this["ctx"]["mods"] : this["mods"]) || {};
- var __r5 = this["elemMods"];
- this["elemMods"] = this["ctx"]["elemMods"] || {};
- this["block"] || this["elem"] ? this["position"] = (this["position"] || 0) + 1 : this["_listLength"]--;
- $55.call(this);
- undefined;
- undefined;
- this["_mode"] = __r0;
- this["block"] = __r1;
- this["_currBlock"] = __r2;
- this["elem"] = __r3;
- this["mods"] = __r4;
- this["elemMods"] = __r5;
- "";
- undefined;
- return;
- } else {
- return $e.call(this);
- }
- }
- }
+ return $133.call(this);
}
} else {
- return $e.call(this, []);
+ return $133.call(this);
}
}
- function $23() {
- if (!!this["_start"] === false) {
- return $5.call(this);
- } else {
- return $22.call(this);
- }
- }
- function $27() {
- return "script";
- return;
- }
- function $32() {
- if (!this["ctx"].hasOwnProperty("ie") === false) {
- if (!!this["ctx"]["_ieCommented"] === false) {
- var ie = this["ctx"]["ie"];
- if (ie === true) {
- "";
- var __r38 = this["_mode"];
- this["_mode"] = "";
- var __r39 = this["ctx"];
- this["ctx"] = [ 6, 7, 8, 9 ].map(function(v) {
- return {
- elem: "css",
- url: this["ctx"]["url"] + ".ie" + v + ".css",
- ie: "IE " + v
- };
- }, this);
- this.apply();
- this["_mode"] = __r38;
- this["ctx"] = __r39;
- "";
+ function $133() {
+ var __this = this;
+ if (!this._.isArray(this.ctx) === false) {
+ if (!!this._mode === false) {
+ var _$1v = this.ctx, _$1l = _$1v.length, _$1i = 0, _$1prevPos = this.position, _$1prevNotNewList = this._notNewList;
+ if (_$1prevNotNewList) {
+ this._listLength += _$1l - 1;
} else {
- var hideRule = !ie ? [ "gt IE 9", "<!-->", "<!--" ] : ie == "!IE" ? [ ie, "<!-->", "<!--" ] : [ ie, "", "" ];
- {
- "";
- var __r40 = this["_mode"];
- this["_mode"] = "";
- var __r41 = this["ctx"], __r42 = __r41["_ieCommented"];
- __r41["_ieCommented"] = true;
- var __r43 = this["ctx"];
- this["ctx"] = [ "<!--[if " + hideRule[0] + "]>", hideRule[1], this["ctx"], hideRule[2], "<![endif]-->" ];
- this.apply();
- this["_mode"] = __r40;
- __r41["_ieCommented"] = __r42;
- this["ctx"] = __r43;
- "";
- }
+ this.position = 0;
+ this._listLength = _$1l;
}
- return;
- } else {
- if (!!this["elem"] === false) {
- this["_buf"].push("<!DOCTYPE html>");
+ this._notNewList = true;
+ while (_$1i < _$1l) {
"";
- var __r36 = this["_mode"];
- this["_mode"] = "";
- var __r37 = this["ctx"];
- this["ctx"] = {
- tag: "html",
- cls: "i-ua_js_no i-ua_css_standard",
- content: [ {
- elem: "head",
- content: [ {
- tag: "meta",
- attrs: {
- charset: "utf-8"
- }
- }, {
- tag: "meta",
- attrs: {
- "http-equiv": "X-UA-Compatible",
- content: "IE=EmulateIE7, IE=edge"
- }
- }, {
- tag: "title",
- content: this["ctx"]["title"]
- }, this["ctx"]["favicon"] ? {
- elem: "favicon",
- url: this["ctx"]["favicon"]
- } : "", this["ctx"]["meta"], {
- block: "i-ua"
- }, this["ctx"]["head"] ]
- }, {
- elem: "body",
- mix: [ this["ctx"] ],
- content: [ this["ctx"]["content"] ]
- } ]
- };
- this.apply();
- this["_mode"] = __r36;
- this["ctx"] = __r37;
+ var __r6 = this.ctx;
+ this.ctx = _$1v[_$1i++];
+ apply.call(__this);
+ this.ctx = __r6;
"";
- return;
- } else {
- if (!!this["_start"] === false) {
- return $5.call(this);
- } else {
- return $6.call(this);
- }
}
- }
- } else {
- if (!!this["elem"] === false) {
- this["_buf"].push("<!DOCTYPE html>");
- "";
- var __r36 = this["_mode"];
- this["_mode"] = "";
- var __r37 = this["ctx"];
- this["ctx"] = {
- tag: "html",
- cls: "i-ua_js_no i-ua_css_standard",
- content: [ {
- elem: "head",
- content: [ {
- tag: "meta",
- attrs: {
- charset: "utf-8"
- }
- }, {
- tag: "meta",
- attrs: {
- "http-equiv": "X-UA-Compatible",
- content: "IE=EmulateIE7, IE=edge"
- }
- }, {
- tag: "title",
- content: this["ctx"]["title"]
- }, this["ctx"]["favicon"] ? {
- elem: "favicon",
- url: this["ctx"]["favicon"]
- } : "", this["ctx"]["meta"], {
- block: "i-ua"
- }, this["ctx"]["head"] ]
- }, {
- elem: "body",
- mix: [ this["ctx"] ],
- content: [ this["ctx"]["content"] ]
- } ]
- };
- this.apply();
- this["_mode"] = __r36;
- this["ctx"] = __r37;
- "";
+ undefined;
+ _$1prevNotNewList || (this.position = _$1prevPos);
return;
} else {
- if (!!this["_start"] === false) {
- return $5.call(this);
- } else {
- return $6.call(this);
- }
+ return $139.call(this);
}
- }
- }
- function $46() {
- var __this = this;
- if (!!this["_start"] === false) {
- return $5.call(this);
} else {
- var __t = this["_mode"];
- if (__t === "attrs") {
- return undefined;
- return;
- } else if (__t === "tag") {
- return undefined;
- return;
- } else if (__t === "bem") {
- return undefined;
- return;
- } else if (__t === "default") {
- return $6.call(this);
- } else if (__t === "content") {
- return this["ctx"]["content"];
- return;
- } else if (__t === "mix") {
- return undefined;
- return;
- } else if (__t === "jsAttr") {
- return undefined;
- return;
- } else if (__t === "js") {
- return undefined;
- return;
- } else if (__t === "cls") {
- return undefined;
- return;
- } else {
- if (!!this["_mode"] === false) {
- if (!this["_"].isSimple(this["ctx"]) === false) {
- this["_listLength"]--;
- var ctx = this["ctx"];
- (ctx && ctx !== true || ctx === 0) && this["_buf"].push(ctx);
- return;
- } else {
- if (!!this["ctx"] === false) {
- this["_listLength"]--;
- return;
- } else {
- if (!this["_"].isArray(this["ctx"]) === false) {
- var v = this["ctx"], l = v["length"], i = 0, prevPos = this["position"], prevNotNewList = this["_notNewList"];
- if (prevNotNewList) {
- this["_listLength"] += l - 1;
- } else {
- this["position"] = 0;
- this["_listLength"] = l;
- }
- this["_notNewList"] = true;
- while (i < l) {
- {
- "";
- var __r7 = this["ctx"];
- this["ctx"] = v[i++];
- apply.call(__this);
- this["ctx"] = __r7;
- "";
- }
- undefined;
- }
- undefined;
- prevNotNewList || (this["position"] = prevPos);
- return;
- } else {
- if (!true === false) {
- var vBlock = this["ctx"]["block"], vElem = this["ctx"]["elem"], block = this["_currBlock"] || this["block"];
- this["ctx"] || (this["ctx"] = {});
- "";
- var __r0 = this["_mode"];
- this["_mode"] = "default";
- var __r1 = this["block"];
- this["block"] = vBlock || (vElem ? block : undefined);
- var __r2 = this["_currBlock"];
- this["_currBlock"] = vBlock || vElem ? undefined : block;
- var __r3 = this["elem"];
- this["elem"] = this["ctx"]["elem"];
- var __r4 = this["mods"];
- this["mods"] = (vBlock ? this["ctx"]["mods"] : this["mods"]) || {};
- var __r5 = this["elemMods"];
- this["elemMods"] = this["ctx"]["elemMods"] || {};
- this["block"] || this["elem"] ? this["position"] = (this["position"] || 0) + 1 : this["_listLength"]--;
- $55.call(this);
- undefined;
- undefined;
- this["_mode"] = __r0;
- this["block"] = __r1;
- this["_currBlock"] = __r2;
- this["elem"] = __r3;
- this["mods"] = __r4;
- this["elemMods"] = __r5;
- "";
- undefined;
- return;
- } else {
- return $e.call(this, []);
- }
- }
- }
- }
- } else {
- return $e.call(this, []);
- }
- }
+ return $139.call(this);
}
}
- function $47() {
- var __this = this;
- if (!!this["elem"] === false) {
- var __t = this["_mode"];
- if (__t === "attrs") {
- if (!!this["_start"] === false) {
- return $5.call(this);
- } else {
- return undefined;
- return;
- }
- } else if (__t === "tag") {
- if (!!this["_start"] === false) {
- return $5.call(this);
- } else {
- return undefined;
- return;
- }
- } else if (__t === "bem") {
- if (!!this["_start"] === false) {
- return $5.call(this);
- } else {
- return undefined;
- return;
- }
- } else if (__t === "default") {
- this["_buf"].push("<!DOCTYPE html>");
- "";
- var __r36 = this["_mode"];
- this["_mode"] = "";
- var __r37 = this["ctx"];
- this["ctx"] = {
- tag: "html",
- cls: "i-ua_js_no i-ua_css_standard",
- content: [ {
- elem: "head",
- content: [ {
- tag: "meta",
- attrs: {
- charset: "utf-8"
- }
- }, {
- tag: "meta",
- attrs: {
- "http-equiv": "X-UA-Compatible",
- content: "IE=EmulateIE7, IE=edge"
- }
- }, {
- tag: "title",
- content: this["ctx"]["title"]
- }, this["ctx"]["favicon"] ? {
- elem: "favicon",
- url: this["ctx"]["favicon"]
- } : "", this["ctx"]["meta"], {
- block: "i-ua"
- }, this["ctx"]["head"] ]
- }, {
- elem: "body",
- mix: [ this["ctx"] ],
- content: [ this["ctx"]["content"] ]
- } ]
- };
- this.apply();
- this["_mode"] = __r36;
- this["ctx"] = __r37;
- "";
- return;
- } else if (__t === "content") {
- if (!!this["_start"] === false) {
- return $5.call(this);
- } else {
- return this["ctx"]["content"];
- return;
- }
- } else if (__t === "mix") {
- if (!!this["_start"] === false) {
- return $5.call(this);
- } else {
- return undefined;
- return;
- }
- } else if (__t === "jsAttr") {
- if (!!this["_start"] === false) {
- return $5.call(this);
- } else {
- return undefined;
- return;
- }
- } else if (__t === "js") {
- if (!!this["_start"] === false) {
- return $5.call(this);
- } else {
- return undefined;
- return;
- }
- } else if (__t === "cls") {
- if (!!this["_start"] === false) {
- return $5.call(this);
- } else {
- return undefined;
- return;
- }
+ function $139() {
+ if (!true === false) {
+ if (!!this._mode === false) {
+ return $142.call(this);
} else {
- if (!!this["_start"] === false) {
- return $5.call(this);
- } else {
- if (!!this["_mode"] === false) {
- if (!this["_"].isSimple(this["ctx"]) === false) {
- this["_listLength"]--;
- var ctx = this["ctx"];
- (ctx && ctx !== true || ctx === 0) && this["_buf"].push(ctx);
- return;
- } else {
- if (!!this["ctx"] === false) {
- this["_listLength"]--;
- return;
- } else {
- if (!this["_"].isArray(this["ctx"]) === false) {
- var v = this["ctx"], l = v["length"], i = 0, prevPos = this["position"], prevNotNewList = this["_notNewList"];
- if (prevNotNewList) {
- this["_listLength"] += l - 1;
- } else {
- this["position"] = 0;
- this["_listLength"] = l;
- }
- this["_notNewList"] = true;
- while (i < l) {
- {
- "";
- var __r7 = this["ctx"];
- this["ctx"] = v[i++];
- apply.call(__this);
- this["ctx"] = __r7;
- "";
- }
- undefined;
- }
- undefined;
- prevNotNewList || (this["position"] = prevPos);
- return;
- } else {
- if (!true === false) {
- var vBlock = this["ctx"]["block"], vElem = this["ctx"]["elem"], block = this["_currBlock"] || this["block"];
- this["ctx"] || (this["ctx"] = {});
- "";
- var __r0 = this["_mode"];
- this["_mode"] = "default";
- var __r1 = this["block"];
- this["block"] = vBlock || (vElem ? block : undefined);
- var __r2 = this["_currBlock"];
- this["_currBlock"] = vBlock || vElem ? undefined : block;
- var __r3 = this["elem"];
- this["elem"] = this["ctx"]["elem"];
- var __r4 = this["mods"];
- this["mods"] = (vBlock ? this["ctx"]["mods"] : this["mods"]) || {};
- var __r5 = this["elemMods"];
- this["elemMods"] = this["ctx"]["elemMods"] || {};
- this["block"] || this["elem"] ? this["position"] = (this["position"] || 0) + 1 : this["_listLength"]--;
- $55.call(this);
- undefined;
- undefined;
- this["_mode"] = __r0;
- this["block"] = __r1;
- this["_currBlock"] = __r2;
- this["elem"] = __r3;
- this["mods"] = __r4;
- this["elemMods"] = __r5;
- "";
- undefined;
- return;
- } else {
- return $e.call(this, []);
- }
- }
- }
- }
- } else {
- return $e.call(this, []);
- }
- }
- }
- } else {
- if (!!this["_start"] === false) {
- return $5.call(this);
- } else {
- var __t = this["_mode"];
- if (__t === "attrs") {
- return undefined;
- return;
- } else if (__t === "tag") {
- return undefined;
- return;
- } else if (__t === "bem") {
- return undefined;
- return;
- } else if (__t === "default") {
- return $6.call(this);
- } else if (__t === "content") {
- return this["ctx"]["content"];
- return;
- } else if (__t === "mix") {
- return undefined;
- return;
- } else if (__t === "jsAttr") {
- return undefined;
- return;
- } else if (__t === "js") {
- return undefined;
- return;
- } else if (__t === "cls") {
- return undefined;
- return;
- } else {
- if (!!this["_mode"] === false) {
- if (!this["_"].isSimple(this["ctx"]) === false) {
- this["_listLength"]--;
- var ctx = this["ctx"];
- (ctx && ctx !== true || ctx === 0) && this["_buf"].push(ctx);
- return;
- } else {
- if (!!this["ctx"] === false) {
- this["_listLength"]--;
- return;
- } else {
- if (!this["_"].isArray(this["ctx"]) === false) {
- var v = this["ctx"], l = v["length"], i = 0, prevPos = this["position"], prevNotNewList = this["_notNewList"];
- if (prevNotNewList) {
- this["_listLength"] += l - 1;
- } else {
- this["position"] = 0;
- this["_listLength"] = l;
- }
- this["_notNewList"] = true;
- while (i < l) {
- {
- "";
- var __r7 = this["ctx"];
- this["ctx"] = v[i++];
- apply.call(__this);
- this["ctx"] = __r7;
- "";
- }
- undefined;
- }
- undefined;
- prevNotNewList || (this["position"] = prevPos);
- return;
- } else {
- if (!true === false) {
- var vBlock = this["ctx"]["block"], vElem = this["ctx"]["elem"], block = this["_currBlock"] || this["block"];
- this["ctx"] || (this["ctx"] = {});
- "";
- var __r0 = this["_mode"];
- this["_mode"] = "default";
- var __r1 = this["block"];
- this["block"] = vBlock || (vElem ? block : undefined);
- var __r2 = this["_currBlock"];
- this["_currBlock"] = vBlock || vElem ? undefined : block;
- var __r3 = this["elem"];
- this["elem"] = this["ctx"]["elem"];
- var __r4 = this["mods"];
- this["mods"] = (vBlock ? this["ctx"]["mods"] : this["mods"]) || {};
- var __r5 = this["elemMods"];
- this["elemMods"] = this["ctx"]["elemMods"] || {};
- this["block"] || this["elem"] ? this["position"] = (this["position"] || 0) + 1 : this["_listLength"]--;
- $55.call(this);
- undefined;
- undefined;
- this["_mode"] = __r0;
- this["block"] = __r1;
- this["_currBlock"] = __r2;
- this["elem"] = __r3;
- this["mods"] = __r4;
- this["elemMods"] = __r5;
- "";
- undefined;
- return;
- } else {
- return $e.call(this, []);
- }
- }
- }
- }
- } else {
- return $e.call(this, []);
- }
- }
+ return $e.call(this);
}
- }
- }
- function $50() {
- var __t = this["_mode"];
- if (__t === "attrs") {
- return $12.call(this);
- } else if (__t === "tag") {
- return $12.call(this);
- } else if (__t === "bem") {
- return $12.call(this);
- } else if (__t === "default") {
- return "", __r33 = this["_mode"], this["_mode"] = "", __r34 = this["ctx"], this["ctx"] = {
- block: "b-page",
- elem: "js",
- url: "//yandex.st/jquery/1.7.2/jquery.min.js"
- }, __r35 = $50.call(this), this["_mode"] = __r33, this["ctx"] = __r34, "", __r35;
- return;
- } else if (__t === "content") {
- return $10.call(this);
- } else if (__t === "mix") {
- return $12.call(this);
- } else if (__t === "jsAttr") {
- return $12.call(this);
- } else if (__t === "js") {
- return $12.call(this);
- } else if (__t === "cls") {
- return $12.call(this);
} else {
- return $23.call(this);
+ return $e.call(this);
}
}
- function $55() {
- var __t = this["block"];
- if (__t === "b-page") {
- var __t = this["elem"];
- if (__t === "favicon") {
- var __t = this["_mode"];
- if (__t === "attrs") {
- return {
- rel: "shortcut icon",
- href: this["ctx"]["url"]
- };
- return;
- } else if (__t === "tag") {
- return $2.call(this);
- } else if (__t === "bem") {
- return $3.call(this);
- } else if (__t === "default") {
- return $8.call(this);
- } else if (__t === "content") {
- return $10.call(this);
- } else if (__t === "mix") {
- return $12.call(this);
- } else if (__t === "jsAttr") {
- return $12.call(this);
- } else if (__t === "js") {
- return $12.call(this);
- } else if (__t === "cls") {
- return $12.call(this);
- } else {
- return $23.call(this);
- }
- } else if (__t === "js") {
- var __t = this["_mode"];
- if (__t === "attrs") {
- if (!this["ctx"]["url"] === false) {
- return {
- src: this["ctx"]["url"]
- };
- return;
- } else {
- return $12.call(this);
- }
- } else if (__t === "tag") {
- return $27.call(this);
- } else if (__t === "bem") {
- return $3.call(this);
- } else if (__t === "default") {
- return $8.call(this);
- } else if (__t === "content") {
- return $10.call(this);
- } else if (__t === "mix") {
- return $12.call(this);
- } else if (__t === "jsAttr") {
- return $12.call(this);
- } else if (__t === "js") {
- return $12.call(this);
- } else if (__t === "cls") {
- return $12.call(this);
- } else {
- return $23.call(this);
- }
- } else if (__t === "css") {
- if (!this["ctx"]["url"] === false) {
- var __t = this["_mode"];
- if (__t === "attrs") {
- return {
- rel: "stylesheet",
- href: this["ctx"]["url"]
- };
- return;
- } else if (__t === "tag") {
- return $2.call(this);
- } else if (__t === "bem") {
- return $3.call(this);
- } else if (__t === "default") {
- return $32.call(this);
- } else if (__t === "content") {
- return $10.call(this);
- } else if (__t === "mix") {
- return $12.call(this);
- } else if (__t === "jsAttr") {
- return $12.call(this);
- } else if (__t === "js") {
- return $12.call(this);
- } else if (__t === "cls") {
- return $12.call(this);
- } else {
- return $23.call(this);
- }
- } else {
- var __t = this["_mode"];
- if (__t === "attrs") {
- return $12.call(this);
- } else if (__t === "tag") {
- return "style";
- return;
- } else if (__t === "bem") {
- return $3.call(this);
- } else if (__t === "default") {
- return $32.call(this);
- } else if (__t === "content") {
- return $10.call(this);
- } else if (__t === "mix") {
- return $12.call(this);
- } else if (__t === "jsAttr") {
- return $12.call(this);
- } else if (__t === "js") {
- return $12.call(this);
- } else if (__t === "cls") {
- return $12.call(this);
- } else {
- return $23.call(this);
- }
- }
- } else if (__t === "meta") {
- var __t = this["_mode"];
- if (__t === "attrs") {
- return this["ctx"]["attrs"];
- return;
- } else if (__t === "tag") {
- return "meta";
- return;
- } else if (__t === "bem") {
- return $3.call(this);
- } else if (__t === "default") {
- return $8.call(this);
- } else if (__t === "content") {
- return $10.call(this);
- } else if (__t === "mix") {
- return $12.call(this);
- } else if (__t === "jsAttr") {
- return $12.call(this);
- } else if (__t === "js") {
- return $12.call(this);
- } else if (__t === "cls") {
- return $12.call(this);
- } else {
- return $23.call(this);
- }
- } else if (__t === "body") {
- var __t = this["_mode"];
- if (__t === "attrs") {
- return $12.call(this);
- } else if (__t === "tag") {
- return "body";
- return;
- } else if (__t === "bem") {
- return $12.call(this);
- } else if (__t === "default") {
- return $8.call(this);
- } else if (__t === "content") {
- return $10.call(this);
- } else if (__t === "mix") {
- return $12.call(this);
- } else if (__t === "jsAttr") {
- return $12.call(this);
- } else if (__t === "js") {
- return $12.call(this);
- } else if (__t === "cls") {
- return $12.call(this);
- } else {
- return $23.call(this);
- }
- } else if (__t === "head") {
- var __t = this["_mode"];
- if (__t === "attrs") {
- return $12.call(this);
- } else if (__t === "tag") {
- return "head";
- return;
- } else if (__t === "bem") {
- return $3.call(this);
- } else if (__t === "default") {
- return $8.call(this);
- } else if (__t === "content") {
- return $10.call(this);
- } else if (__t === "mix") {
- return $12.call(this);
- } else if (__t === "jsAttr") {
- return $12.call(this);
- } else if (__t === "js") {
- return $12.call(this);
- } else if (__t === "cls") {
- return $12.call(this);
- } else {
- return $23.call(this);
- }
- } else if (__t === "core") {
- return $47.call(this);
- } else {
- return $47.call(this);
- }
- } else if (__t === "i-jquery") {
- var __t = this["elem"];
- if (__t === "favicon") {
- return $46.call(this);
- } else if (__t === "js") {
- return $46.call(this);
- } else if (__t === "css") {
- return $46.call(this);
- } else if (__t === "meta") {
- return $46.call(this);
- } else if (__t === "body") {
- return $46.call(this);
- } else if (__t === "head") {
- return $46.call(this);
- } else if (__t === "core") {
- return $50.call(this);
- } else {
- return $46.call(this);
- }
- } else if (__t === "i-ua") {
- if (!!this["elem"] === false) {
- var __t = this["_mode"];
- if (__t === "attrs") {
- return $12.call(this);
- } else if (__t === "tag") {
- return $27.call(this);
- } else if (__t === "bem") {
- return $3.call(this);
- } else if (__t === "default") {
- return $7.call(this);
- } else if (__t === "content") {
- return [ ";(function(d,e,c,r){", "e=d.documentElement;", 'c="className";', 'r="replace";', 'e[c]=e[c][r]("i-ua_js_no","i-ua_js_yes");', 'if(d.compatMode!="CSS1Compat")', 'e[c]=e[c][r]("i-ua_css_standart","i-ua_css_quirks")', "})(document);" ].join("");
- return;
- } else if (__t === "mix") {
- return $12.call(this);
- } else if (__t === "jsAttr") {
- return $12.call(this);
- } else if (__t === "js") {
- return $12.call(this);
- } else if (__t === "cls") {
- return $12.call(this);
- } else {
- return $23.call(this);
- }
- } else {
- return $46.call(this);
+ function $142() {
+ var __this = this;
+ var _$0vBlock = this.ctx.block, _$0vElem = this.ctx.elem, _$0block = this._currBlock || this.block;
+ this.ctx || (this.ctx = {});
+ {
+ "";
+ var __r0 = this._mode;
+ this._mode = "default";
+ var __r1 = this.block;
+ this.block = _$0vBlock || (_$0vElem ? _$0block : undefined);
+ var __r2 = this._currBlock;
+ this._currBlock = _$0vBlock || _$0vElem ? undefined : _$0block;
+ var __r3 = this.elem;
+ this.elem = this.ctx.elem;
+ var __r4 = this.mods;
+ this.mods = (_$0vBlock ? this.ctx.mods : this.mods) || {};
+ var __r5 = this.elemMods;
+ this.elemMods = this.ctx.elemMods || {};
+ {
+ this.block || this.elem ? this.position = (this.position || 0) + 1 : this._listLength--;
+ apply.call(__this);
+ undefined;
}
- } else {
- return $46.call(this);
+ this._mode = __r0;
+ this.block = __r1;
+ this._currBlock = __r2;
+ this.elem = __r3;
+ this.mods = __r4;
+ this.elemMods = __r5;
+ "";
}
+ return;
}
function $e() {
throw new Error;
return;
}
return exports;
-})(typeof exports === "undefined" ? {} : exports);
-BEMHTML = (function(xjst) { return function() { return xjst.apply.call([this]); }; }(BEMHTML));
+})(typeof exports === "undefined" ? {} : exports);;
+BEMHTML = (function(xjst) {
+ return function() {
+ return xjst.apply.call(
+[this]
+ ); };
+}(BEMHTML));
typeof exports === "undefined" || (exports.BEMHTML = BEMHTML);
View
27 test/data/make/reference-result/pages/client/__profile/_client__profile.en.js
@@ -849,6 +849,21 @@ this.BEM = $.inherit($.observable, /** @lends BEM.prototype */ {
},
/**
+ * Shortcut for getMod/setMod
+ * @param {Object} [elem] Nested element
+ * @param {String} modName Modifier name
+ * @param {String} [modVal] Modifier value
+ * @returns {BEM}
+ */
+ mod : function(elem, modName, modVal) {
+
+ return typeof modVal !== 'undefined' || (typeof modName !== 'undefined' && typeof elem === 'string')?
+ this.setMod(elem, modName, modVal) :
+ this.getMod(elem, modName, modVal);
+
+ },
+
+ /**
* Executes handlers for setting modifiers
* @private
* @param {String} elemName Element name
@@ -2572,6 +2587,18 @@ var DOM = BEM.DOM = BEM.decl('i-bem__dom',/** @lends BEM.DOM.prototype */{
},
/**
+ * Changes a fragment of the DOM tree including the context and initializes blocks.
+ * @param {jQuery} ctx Root DOM node
+ * @param {jQuery|String} content Content to be added
+ */
+ replace : function(ctx, content) {
+
+ this.destruct(true, ctx);
+ this.init($(content).replaceAll(ctx));
+
+ },
+
+ /**
* Adds a fragment of the DOM tree at the end of the context and initializes blocks
* @param {jQuery} ctx Root DOM node
* @param {jQuery|String} content Content to be added
View
27 test/data/make/reference-result/pages/client/__profile/_client__profile.js
@@ -849,6 +849,21 @@ this.BEM = $.inherit($.observable, /** @lends BEM.prototype */ {
},
/**
+ * Shortcut for getMod/setMod
+ * @param {Object} [elem] Nested element
+ * @param {String} modName Modifier name
+ * @param {String} [modVal] Modifier value
+ * @returns {BEM}
+ */
+ mod : function(elem, modName, modVal) {
+
+ return typeof modVal !== 'undefined' || (typeof modName !== 'undefined' && typeof elem === 'string')?
+ this.setMod(elem, modName, modVal) :
+ this.getMod(elem, modName, modVal);
+
+ },
+
+ /**
* Executes handlers for setting modifiers
* @private
* @param {String} elemName Element name
@@ -2572,6 +2587,18 @@ var DOM = BEM.DOM = BEM.decl('i-bem__dom',/** @lends BEM.DOM.prototype */{
},
/**
+ * Changes a fragment of the DOM tree including the context and initializes blocks.
+ * @param {jQuery} ctx Root DOM node
+ * @param {jQuery|String} content Content to be added
+ */
+ replace : function(ctx, content) {
+
+ this.destruct(true, ctx);
+ this.init($(content).replaceAll(ctx));
+
+ },
+
+ /**
* Adds a fragment of the DOM tree at the end of the context and initializes blocks
* @param {jQuery} ctx Root DOM node
* @param {jQuery|String} content Content to be added
View
27 test/data/make/reference-result/pages/client/__profile/_client__profile.ru.js
@@ -849,6 +849,21 @@ this.BEM = $.inherit($.observable, /** @lends BEM.prototype */ {
},
/**
+ * Shortcut for getMod/setMod
+ * @param {Object} [elem] Nested element
+ * @param {String} modName Modifier name
+ * @param {String} [modVal] Modifier value
+ * @returns {BEM}
+ */
+ mod : function(elem, modName, modVal) {
+
+ return typeof modVal !== 'undefined' || (typeof modName !== 'undefined' && typeof elem === 'string')?
+ this.setMod(elem, modName, modVal) :
+ this.getMod(elem, modName, modVal);
+
+ },
+
+ /**
* Executes handlers for setting modifiers
* @private
* @param {String} elemName Element name
@@ -2572,6 +2587,18 @@ var DOM = BEM.DOM = BEM.decl('i-bem__dom',/** @lends BEM.DOM.prototype */{
},
/**
+ * Changes a fragment of the DOM tree including the context and initializes blocks.
+ * @param {jQuery} ctx Root DOM node
+ * @param {jQuery|String} content Content to be added
+ */
+ replace : function(ctx, content) {
+
+ this.destruct(true, ctx);
+ this.init($(content).replaceAll(ctx));
+
+ },
+
+ /**
* Adds a fragment of the DOM tree at the end of the context and initializes blocks
* @param {jQuery} ctx Root DOM node
* @param {jQuery|String} content Content to be added
View
1,518 test/data/make/reference-result/pages/client/__profile/client__profile.bemhtml.js
@@ -1,62 +1,273 @@
var BEMHTML = (function(exports) {
- var __r8, __r10, __r12, __r14, __r16, __r18, __r20, __r22, __r24, __r26, __r33, __r34;
exports.apply = apply;
function apply() {
- return $55.call(this);
+ var __this = this;
+ var __t = this._mode;
+ if (__t === "attrs") {
+ if (this.block === "b-page") {
+ var __t = this.elem;
+ if (__t === "favicon") {
+ return {
+ rel: "shortcut icon",
+ href: this.ctx.url
+ };
+ return;
+ } else if (__t === "js") {
+ if (!this.ctx.url === false) {
+ return {
+ src: this.ctx.url
+ };
+ return;
+ } else {
+ return $99.call(this);
+ }
+ } else if (__t === "css") {
+ if (!this.ctx.url === false) {
+ return {
+ rel: "stylesheet",
+ href: this.ctx.url
+ };
+ return;
+ } else {
+ return $99.call(this);
+ }
+ } else if (__t === "meta") {
+ return this.ctx.attrs;
+ return;
+ } else {
+ return $99.call(this);
+ }
+ } else {
+ return $99.call(this);
+ }
+ } else if (__t === "tag") {
+ var __t = this.block;
+ if (__t === "b-page") {
+ var __t = this.elem;
+ if (__t === "favicon") {
+ return "link";
+ return;
+ } else if (__t === "js") {
+ return "script";
+ return;
+ } else if (__t === "css") {
+ if (!this.ctx.url === false) {
+ return "link";
+ return;
+ } else {
+ return "style";
+ return;
+ }
+ } else if (__t === "meta") {
+ return "meta";
+ return;
+ } else if (__t === "body") {
+ return "body";
+ return;
+ } else if (__t === "head") {
+ return "head";
+ return;
+ } else {
+ return $99.call(this);
+ }
+ } else if (__t === "i-ua") {
+ if (!!this.elem === false) {
+ return "script";
+ return;
+ } else {
+ return $99.call(this);
+ }
+ } else {
+ return $99.call(this);
+ }
+ } else if (__t === "bem") {
+ var __t = this.block;
+ if (__t === "b-page") {
+ var __t = this.elem;
+ if (__t === "favicon" || __t === "js" || __t === "css" || __t === "meta" || __t === "head") {
+ return false;
+ return;
+ } else {
+ return $99.call(this);
+ }
+ } else if (__t === "i-ua") {
+ if (!!this.elem === false) {
+ return false;
+ return;
+ } else {
+ return $99.call(this);
+ }
+ } else {
+ return $99.call(this);
+ }
+ } else if (__t === "default") {
+ var __t = this.block;
+ if (__t === "b-page") {
+ if (this.elem === "css") {
+ if (!this.ctx.hasOwnProperty("ie") === false) {
+ if (!!this.ctx._ieCommented === false) {
+ return $74.call(this);
+ } else {
+ return $79.call(this);
+ }
+ } else {
+ return $79.call(this);
+ }
+ } else {
+ return $79.call(this);
+ }
+ } else if (__t === "i-jquery") {
+ if (this.elem === "core") {
+ var __r36, __r37, __r38;
+ return "", __r36 = this._mode, this._mode = "", __r37 = this.ctx, this.ctx = {
+ block: "b-page",
+ elem: "js",
+ url: "//yandex.st/jquery/1.7.2/jquery.min.js"
+ }, __r38 = apply.call(__this), this._mode = __r36, this.ctx = __r37, "", __r38;
+ return;
+ } else {
+ return $99.call(this);
+ }
+ } else {
+ return $99.call(this);
+ }
+ } else if (__t === "content") {
+ if (this.block === "i-ua") {
+ if (!!this.elem === false) {
+ return [ ";(function(d,e,c,r){", "e=d.documentElement;", 'c="className";', 'r="replace";', 'e[c]=e[c][r]("i-ua_js_no","i-ua_js_yes");', 'if(d.compatMode!="CSS1Compat")', 'e[c]=e[c][r]("i-ua_css_standart","i-ua_css_quirks")', "})(document);" ].join("");
+ return;
+ } else {
+ return $99.call(this);
+ }
+ } else {
+ return $99.call(this);
+ }
+ } else {
+ return $99.call(this);
+ }
}
- function $2() {
- return "link";
+ function $74() {
+ var _$rie = this.ctx.ie;
+ if (_$rie === true) {
+ {
+ "";
+ var __r41 = this._mode;
+ this._mode = "";
+ var __r42 = this.ctx;
+ this.ctx = [ 6, 7, 8, 9 ].map(function(v) {
+ return {
+ elem: "css",
+ url: this.ctx.url + ".ie" + v + ".css",
+ ie: "IE " + v
+ };
+ }, this);
+ this.apply();
+ this._mode = __r41;
+ this.ctx = __r42;
+ "";
+ }
+ } else {
+ var _$rhideRule = !_$rie ? [ "gt IE 9", "<!-->", "<!--" ] : _$rie == "!IE" ? [ _$rie, "<!-->", "<!--" ] : [ _$rie, "", "" ];
+ {
+ "";
+ var __r43 = this._mode;
+ this._mode = "";
+ var __r44 = this.ctx, __r45 = __r44._ieCommented;
+ __r44._ieCommented = true;
+ var __r46 = this.ctx;
+ this.ctx = [ "<!--[if " + _$rhideRule[0] + "]>", _$rhideRule[1], this.ctx, _$rhideRule[2], "<![endif]-->" ];
+ this.apply();
+ this._mode = __r43;
+ __r44._ieCommented = __r45;
+ this.ctx = __r46;
+ "";
+ }
+ }
return;
}
- function $3() {
- return false;
- return;
+ function $79() {
+ if (!!this.elem === false) {
+ return $81.call(this);
+ } else {
+ return $99.call(this);
+ }
}
- function $4() {
- this["_buf"].push("<!DOCTYPE html>");
- "";
- var __r36 = this["_mode"];
- this["_mode"] = "";
- var __r37 = this["ctx"];
- this["ctx"] = {
- tag: "html",
- cls: "i-ua_js_no i-ua_css_standard",
- content: [ {
- elem: "head",
+ function $81() {
+ this._buf.push("<!DOCTYPE html>");
+ {
+ "";
+ var __r39 = this._mode;
+ this._mode = "";
+ var __r40 = this.ctx;
+ this.ctx = {
+ tag: "html",
+ cls: "i-ua_js_no i-ua_css_standard",
content: [ {
- tag: "meta",
- attrs: {
- charset: "utf-8"
- }
- }, {
- tag: "meta",
- attrs: {
- "http-equiv": "X-UA-Compatible",
- content: "IE=EmulateIE7, IE=edge"
- }
+ elem: "head",
+ content: [ {
+ tag: "meta",
+ attrs: {
+ charset: "utf-8"
+ }
+ }, {
+ tag: "meta",
+ attrs: {
+ "http-equiv": "X-UA-Compatible",
+ content: "IE=EmulateIE7, IE=edge"
+ }
+ }, {
+ tag: "title",
+ content: this.ctx.title
+ }, this.ctx.favicon ? {
+ elem: "favicon",
+ url: this.ctx.favicon
+ } : "", this.ctx.meta, {
+ block: "i-ua"
+ }, this.ctx.head ]
}, {
- tag: "title",
- content: this["ctx"]["title"]
- }, this["ctx"]["favicon"] ? {
- elem: "favicon",
- url: this["ctx"]["favicon"]
- } : "", this["ctx"]["meta"], {
- block: "i-ua"
- }, this["ctx"]["head"] ]
- }, {
- elem: "body",
- mix: [ this["ctx"] ],
- content: [ this["ctx"]["content"] ]
- } ]
- };
- this.apply();
- this["_mode"] = __r36;
- this["ctx"] = __r37;
- "";
+ elem: "body",
+ mix: [ this.ctx ],
+ content: [ this.ctx.content ]
+ } ]
+ };
+ this.apply();
+ this._mode = __r39;
+ this.ctx = __r40;
+ "";
+ }
return;
}
- function $5() {
- var BEM_ = {}, toString = Object["prototype"]["toString"], SHORT_TAGS = {
+ function $99() {
+ if (!!this._start === false) {
+ return $101.call(this);
+ } else {
+ var __t = this._mode;
+ if (__t === "content") {
+ return this.ctx.content;
+ return;
+ } else if (__t === "mix" || __t === "bem" || __t === "jsAttr" || __t === "js" || __t === "cls" || __t === "attrs" || __t === "tag") {
+ return undefined;
+ return;