Skip to content

Commit

Permalink
fixup code style errors
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexej Yaroshevich authored and qfox committed Jan 23, 2015
1 parent a70a8f1 commit 606bfbf
Show file tree
Hide file tree
Showing 14 changed files with 51 additions and 49 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 @@ -61,7 +61,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
1 change: 1 addition & 0 deletions common.blocks/i-bem-dom/i-bem-dom.js
Original file line number Diff line number Diff line change
Expand Up @@ -745,6 +745,7 @@ var Block = inherit(BEM.Block,/** @lends Block.prototype */{

/**
* Filters results of findElem helper execution in strict mode
* @private
* @param {jQuery} res DOM elements
* @returns {jQuery} DOM elements
*/
Expand Down
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);
});
1 change: 1 addition & 0 deletions common.blocks/i-bem/__i18n/i-bem__i18n.i18n/core.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ function _popStack() {

/**
* @constructor
* @protected
*/
function _i18n() {
this._lang = '';
Expand Down
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 @@ -114,8 +114,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
2 changes: 1 addition & 1 deletion common.blocks/i-bem/i-bem.vanilla.js
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,7 @@ var Block = inherit(events.Emitter, /** @lends Block.prototype */ {
/**
* Returns values of modifiers of the block/nested element
* @param {Object} [elem] Nested element
* @param {String} [...modNames] Modifier names
* @param {...String} [modNames] Modifier names
* @returns {Object} Hash of modifier values
*/
getMods : function(elem) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -532,7 +532,7 @@ var touchEvents = {
removePrimaryPointer : function(pointer) {
if(pointer.isPrimary) {
this.firstTouch = null;
//this.firstXY = null;
// this.firstXY = null;
this.resetClickCount();
}
},
Expand Down Expand Up @@ -602,21 +602,21 @@ var touchEvents = {
// return "true" for things to be much easier
return true;
},

findTouch : function(touches, pointerId) {
for(var i = 0, l = touches.length, t; i < l && (t = touches[i]); i++) {
if(t.identifier === pointerId) {
return true;
}
}
},

/**
* In some instances, a touchstart can happen without a touchend.
* This leaves the pointermap in a broken state.
* Therefore, on every touchstart, we remove the touches
* that did not fire a touchend event.
*
*
* To keep state globally consistent, we fire a pointercancel
* for this "abandoned" touch
*/
Expand All @@ -626,15 +626,15 @@ var touchEvents = {
// been processed yet.
if(pointermap.pointers() >= touches.length) {
var d = [];

pointermap.forEach(function(pointer, pointerId) {
// Never remove pointerId == 1, which is mouse.
// Touch identifiers are 2 smaller than their pointerId, which is the
// index in pointermap.
if(pointerId === MOUSE_POINTER_ID || this.findTouch(touches, pointerId - 2)) return;
d.push(pointer.outEvent);
}, this);

d.forEach(this.cancelOut, this);
}
},
Expand All @@ -658,20 +658,20 @@ var touchEvents = {
}, TOUCH_DEDUP_TIMEOUT);
}
},

touchstart : function(event) {
var touchEvent = event.originalEvent;

this.vacuumTouches(touchEvent);
this.setPrimaryTouch(touchEvent.changedTouches[0]);
this.dedupSynthMouse(touchEvent);

if(!this.scrolling) {
this.clickCount++;
this.processTouches(event, this.overDown);
}
},

touchmove : function(event) {
var touchEvent = event.originalEvent;
if(!this.scrolling) {
Expand All @@ -694,17 +694,17 @@ var touchEvents = {
}
}
},

touchend : function(event) {
var touchEvent = event.originalEvent;
this.dedupSynthMouse(touchEvent);
this.processTouches(event, this.upOut);
},

touchcancel : function(event) {
this.processTouches(event, this.cancelOut);
},

overDown : function(pEvent) {
var target = pEvent.target;
pointermap.set(pEvent.pointerId, {
Expand Down Expand Up @@ -781,62 +781,62 @@ var msEvents = {
'MSPointerOver',
'MSPointerCancel'
],

register : function(target) {
dispatcher.listen(target, this.events);
},

unregister : function(target) {
dispatcher.unlisten(target, this.events);
},

POINTER_TYPES : [
'',
'unavailable',
'touch',
'pen',
'mouse'
],

prepareEvent : function(event) {
var e = cloneEvent(event);
HAS_BITMAP_TYPE && (e.pointerType = this.POINTER_TYPES[event.pointerType]);
return e;
},

MSPointerDown : function(event) {
pointermap.set(event.pointerId, event);
var e = this.prepareEvent(event);
dispatcher.down(e);
},

MSPointerMove : function(event) {
var e = this.prepareEvent(event);
dispatcher.move(e);
},

MSPointerUp : function(event) {
var e = this.prepareEvent(event);
dispatcher.up(e);
this.cleanup(event.pointerId);
},

MSPointerOut : function(event) {
var e = this.prepareEvent(event);
dispatcher.leaveOut(e);
},

MSPointerOver : function(event) {
var e = this.prepareEvent(event);
dispatcher.enterOver(e);
},

MSPointerCancel : function(event) {
var e = this.prepareEvent(event);
dispatcher.cancel(e);
this.cleanup(event.pointerId);
},

cleanup : function(id) {
pointermap['delete'](id);
}
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

0 comments on commit 606bfbf

Please sign in to comment.