Skip to content

Commit

Permalink
Merge b6a3378 into 7947ae6
Browse files Browse the repository at this point in the history
  • Loading branch information
qfox committed Mar 5, 2015
2 parents 7947ae6 + b6a3378 commit c34d227
Show file tree
Hide file tree
Showing 13 changed files with 35 additions and 51 deletions.
4 changes: 2 additions & 2 deletions .bem/techs/bemhtml.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ exports.techMixin = {

getBuildResultChunk : function(relPath, path, suffix) {
var content = this.readContent(path, suffix);
return (suffix !== 'bemhtml.xjst' ?
return (suffix !== 'bemhtml.xjst'?
content.then(function(source) { return compat.transpile(source); }) :
content)
.then(function(source) {
Expand Down Expand Up @@ -62,7 +62,7 @@ exports.techMixin = {
var tmpl = ['block(\'{{bemBlockName}}\')'];

vars.ElemName && tmpl.push('.elem(\'{{bemElemName}}\')');
vars.ModVal && tmpl.push('.' + (vars.ElemName ? 'elemMod' : 'mod') + '(\'{{bemModName}}\', \'{{bemModVal}}\')');
vars.ModVal && tmpl.push('.' + (vars.ElemName? 'elemMod' : 'mod') + '(\'{{bemModName}}\', \'{{bemModVal}}\')');

return Template.process(tmpl.join(''), vars);
},
Expand Down
29 changes: 5 additions & 24 deletions .jscs.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
{
"plugins": ["jscs-bem"],
"preset": "bem",

"excludeFiles": [
".bem/cache/**",
".enb/tmp/**",
Expand All @@ -14,29 +17,7 @@
"common.blocks/inherit/**",
"common.blocks/ecma/__array/ecma__array.spec.js",
"common.blocks/jquery/__event/_type/jquery__event_type_pointerclick.js",
"common.blocks/jquery/__event/_type/jquery__event_type_pointer.js",
"common.blocks/jquery/__event/_type/jquery__event_type_pointerpressrelease.js"
"*.docs/**/*.bemdecl.js"
],
"fileExtensions": [".js", ".bemtree", ".bemhtml"],
"requireSpaceAfterKeywords": ["do", "else"],
"disallowSpaceAfterKeywords": ["if", "for", "while", "switch"],
"disallowSpacesInFunctionExpression": {
"beforeOpeningRoundBrace": true
},
"disallowSpacesInsideArrayBrackets": true,
"requireSpacesInsideObjectBrackets": "all",
"requireSpaceAfterObjectKeys": true,
"disallowSpaceAfterPrefixUnaryOperators": ["++", "--", "+", "-", "~", "!"],
"disallowSpaceBeforePostfixUnaryOperators": ["++", "--"],
"disallowSpaceBeforeBinaryOperators": [","],
"requireSpaceBeforeBinaryOperators": ["+", "-", "/", "*", "=", "==", "===", "!=", "!==", ">", ">=", "<", "<=", "&&", "||"],
"requireSpaceAfterBinaryOperators": [",", "+", "-", "/", "*", "=", "==", "===", "!=", "!==", ">", ">=", "<", "<=", "&&", "||"],
"disallowKeywords": ["with"],
"disallowKeywordsOnNewLine": ["else"],
"requireLineFeedAtFileEnd": true,
"disallowMultipleLineBreaks": true,
"validateJSDoc": {
"checkParamNames": true,
"requireParamTypes": true
}
"fileExtensions": [".js", ".bemtree", ".bemhtml"]
}
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,5 @@ oninit(function() {
i18n.key = function(key) { return key; };
i18n.lang = function() { return; };

})(this, typeof BEM === 'undefined' ? {} : BEM);
})(this, typeof BEM === 'undefined'? {} : BEM);
});
12 changes: 6 additions & 6 deletions common.blocks/i-bem/__i18n/test/complex_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ suite('BEM.I18N Complex tests', function() {
return (lastNumber === 1 && lastNumbers !== 11)?
params.one : (
(lastNumber > 1 && lastNumber < 5) && (lastNumbers < 10 || lastNumbers > 20)?
params.some : params.many );
params.some : params.many);
}).call(this, params);
},
'plural_adv' : function(params) {
Expand Down Expand Up @@ -75,7 +75,7 @@ suite('BEM.I18N Complex tests', function() {
'one' : 'Найдена',
'some' : 'Найдено',
'many' : 'Найдено'
} ) + ' \n' +
}) + ' \n' +
params['count'] + '\n' +
this.keyset('i-tanker__dynamic').key('plural_adv', {
'count' : params['count'],
Expand All @@ -90,10 +90,10 @@ suite('BEM.I18N Complex tests', function() {
return this.keyset('i-tanker__dynamic').key('plural_adv', {
'count' : params['count'],
'none' : 'Ничего не найдено на страницах Помощи.',
'one' : '<p>' + this.keyset('i-locale').key('not-found-in-section', { } ) + '</p>' + 'Найдена',
'some' : '<p>' + this.keyset('i-locale').key('not-found-in-section', { } ) + '</p>' + 'Найдено',
'many' : '<p>' + this.keyset('i-locale').key('not-found-in-section', { } ) + '</p>' + 'Найдено'
} ) + ' \n' +
'one' : '<p>' + this.keyset('i-locale').key('not-found-in-section', {}) + '</p>' + 'Найдена',
'some' : '<p>' + this.keyset('i-locale').key('not-found-in-section', {}) + '</p>' + 'Найдено',
'many' : '<p>' + this.keyset('i-locale').key('not-found-in-section', {}) + '</p>' + 'Найдено'
}) + ' \n' +
params['count'] + '\n' +
this.keyset('i-tanker__dynamic').key('plural_adv', {
'count' : params['count'],
Expand Down
4 changes: 2 additions & 2 deletions common.blocks/i-bem/i-bem.bemtree
Original file line number Diff line number Diff line change
Expand Up @@ -118,8 +118,8 @@ match(this._mode === '')(
block = this._currBlock || this.block;

return apply('default', {
block : vBlock || (vElem ? block : undefined),
_currBlock : (vBlock || vElem) ? undefined : block,
block : vBlock || (vElem? block : undefined),
_currBlock : (vBlock || vElem)? undefined : block,
elem : vElem,
mods : vBlock? this.ctx.mods || (this.ctx.mods = {}) : this.mods,
elemMods : this.ctx.elemMods || {}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -532,7 +532,9 @@ var touchEvents = {
removePrimaryPointer : function(pointer) {
if(pointer.isPrimary) {
this.firstTouch = null;
//this.firstXY = null;
// TODO(@narqo): It seems that, flushing `firstXY` flag explicitly in `touchmove` handler is enough.
// Original code from polymer doing `this.firstXY = null` on every `removePrimaryPointer` call, but looks
// like it is harmful in some of our usecases.
this.resetClickCount();
}
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ block('example').content()({
elem : 'inner1',
content : {
elem : 'inner2',
content: {
elem: 'inner3'
content : {
elem : 'inner3'
}
}
}
Expand Down
14 changes: 7 additions & 7 deletions common.blocks/querystring/__uri/querystring__uri.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,31 +2,31 @@ modules.define('spec', ['querystring__uri'], function(provide, qs) {

describe('querystring__uri', function() {
describe('decodeURIComponent()', function() {

it('should be able to decode cp1251 encoded params', function() {
qs.decodeURIComponent('%F2%E0%E1%EB%EE').should.be.eql('табло');
});

it('should not fall on params encoded with unknown encoding', function() {
qs.decodeURIComponent('%COCO%C0C0').should.be.eql('%COCO%C0C0');
});

});

describe('decodeURI()', function() {

it('should be able to decode url with cp1251 encoded params', function() {
qs
.decodeURI('http://test.com/ololo/trololo.html?text=%F2%E0%E1%EB%EE')
.should.be.eql('http://test.com/ololo/trololo.html?text=табло');
});

it('should not fall on url with params encoded with unknown encoding', function() {
qs
.decodeURI('http://test.com/ololo/trololo.html?text=%COCO%C0C0')
.should.be.eql('http://test.com/ololo/trololo.html?text=%COCO%C0C0');
});

});
});

Expand Down
4 changes: 2 additions & 2 deletions common.blocks/querystring/__uri/querystring__uri.vanilla.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ function convert(str) {

function decode(fn, str) {
var decoded = '';

// Try/catch block for getting the encoding of the source string.
// Error is thrown if a non-UTF8 string is input.
// If the string was not decoded, it is returned without changes.
Expand All @@ -32,7 +32,7 @@ function decode(fn, str) {
decoded = str;
}
}

return decoded;
}

Expand Down
2 changes: 1 addition & 1 deletion common.blocks/querystring/querystring.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ describe('querystring', function() {
{ str : 'foo=1&bar=2', obj : { 'foo' : '1', 'bar' : '2' } },
{
str : 'my%20weird%20field=q1!2%22\'w%245%267%2Fz8)%3F',
obj : { 'my weird field' : "q1!2\"'w$5&7/z8)?" }
obj : { 'my weird field' : 'q1!2"\'w$5&7/z8)?' }
},
{ str : 'foo%3Dbaz=bar', obj : { 'foo=baz' : 'bar' } },
{ str : 'foo=bar&bar=baz', obj : { foo : 'bar', bar : 'baz' } },
Expand Down
2 changes: 1 addition & 1 deletion desktop.blocks/page/page.bemhtml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ block('page')(
elem('head')(
content()(function() {
return [
this.ctx['x-ua-compatible'] === false ?
this.ctx['x-ua-compatible'] === false?
false :
{
tag : 'meta',
Expand Down
2 changes: 1 addition & 1 deletion desktop.blocks/ua/ua.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/**
/**
* @module ua
* @description Detect some user agent features (works like jQuery.browser in jQuery 1.8)
* @see http://code.jquery.com/jquery-migrate-1.1.1.js
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@
"bem": "~0.9.0",
"mocha": "~1.9.0",
"jshint-groups": "0.6.0",
"jscs": "1.5.3",
"jscs": "^1.11.3",
"jscs-bem": "^0.1.2",
"git-hooks": "~0.0.6",
"bower-npm-install": "~0.5.4",
"bower": "1.3.12",
Expand Down

0 comments on commit c34d227

Please sign in to comment.