diff --git a/common.blocks/i-bem/__collection/_type/i-bem__collection_type_dom.js b/common.blocks/i-bem/__collection/_type/i-bem__collection_type_dom.js index 51aa64f31..dd5db065f 100644 --- a/common.blocks/i-bem/__collection/_type/i-bem__collection_type_dom.js +++ b/common.blocks/i-bem/__collection/_type/i-bem__collection_type_dom.js @@ -27,4 +27,4 @@ provide(inherit(Collection, null, /** @lends BEMDOMCollection */{ } })); -}); \ No newline at end of file +}); diff --git a/common.blocks/i-bem/__dom/_collection/i-bem__dom_collection_yes.js b/common.blocks/i-bem/__dom/_collection/i-bem__dom_collection_yes.js index 1ee36f3d0..ffea3c5c2 100644 --- a/common.blocks/i-bem/__dom/_collection/i-bem__dom_collection_yes.js +++ b/common.blocks/i-bem/__dom/_collection/i-bem__dom_collection_yes.js @@ -1,22 +1,29 @@ /** - * Overrides BEM.DOM.findBlocks* methods - * that they return i-bem__collection_type_dom + * @module i-bem__dom + * @description Overrides BEM.DOM.findBlocks* methods that they return i-bem__collection_type_dom */ -modules.define('i-bem__dom', ['i-bem__collection_type_dom'], function(provide, Collection, DOM) { +modules.define('i-bem__dom', ['i-bem__collection_type_dom'], function(provide, Collection, BEMDOM) { -provide(DOM.decl('i-bem__dom', (function() { - var decl = {}, - wrapMethod = function() { - return Collection.create(this.__base.apply(this, arguments)); - }; +provide( + /** + * @class BEMDOM + * @augments BEMDOM + * @exports + */ + BEMDOM.decl('i-bem__dom', (function() { + var decl = {}, + wrapMethod = function() { + return Collection.create(this.__base.apply(this, arguments)); + }; - ['findBlocksInside', 'findBlocksOutside', 'findBlocksOn'] - .forEach(function(method) { - decl[method] = wrapMethod; - }); + ['findBlocksInside', 'findBlocksOutside', 'findBlocksOn'] + .forEach(function(method) { + decl[method] = wrapMethod; + }); - return decl; -}()))); + return decl; + }())) +); }); diff --git a/common.blocks/i-bem/__dom/_elem-instances/i-bem__dom_elem-instances_yes.js b/common.blocks/i-bem/__dom/_elem-instances/i-bem__dom_elem-instances_yes.js index 29f808064..b2b7d846d 100644 --- a/common.blocks/i-bem/__dom/_elem-instances/i-bem__dom_elem-instances_yes.js +++ b/common.blocks/i-bem/__dom/_elem-instances/i-bem__dom_elem-instances_yes.js @@ -1,5 +1,5 @@ /** - * @module i-bem__dom_elem-instances_yes + * @module i-bem__dom */ modules.define( diff --git a/common.blocks/i-bem/__dom/_init/i-bem__dom_init_auto.js b/common.blocks/i-bem/__dom/_init/i-bem__dom_init_auto.js index 5a35069ba..05241994c 100644 --- a/common.blocks/i-bem/__dom/_init/i-bem__dom_init_auto.js +++ b/common.blocks/i-bem/__dom/_init/i-bem__dom_init_auto.js @@ -1,6 +1,5 @@ /** - * @module i-bem__dom - * @description Auto initialization on DOM ready + * Auto initialization on DOM ready */ modules.require(['i-bem__dom', 'jquery'], function(DOM, $) { diff --git a/common.blocks/i-bem/_elem-instances/i-bem_elem-instances_yes.js b/common.blocks/i-bem/_elem-instances/i-bem_elem-instances_yes.js index c0fc971ad..ba079d794 100644 --- a/common.blocks/i-bem/_elem-instances/i-bem_elem-instances_yes.js +++ b/common.blocks/i-bem/_elem-instances/i-bem_elem-instances_yes.js @@ -1,5 +1,5 @@ /** - * @module i-bem_elem-instances_yes + * @module i-bem */ modules.define( diff --git a/common.blocks/idle/_start/idle_start_auto.js b/common.blocks/idle/_start/idle_start_auto.js index 770632629..ed265c772 100644 --- a/common.blocks/idle/_start/idle_start_auto.js +++ b/common.blocks/idle/_start/idle_start_auto.js @@ -1,6 +1,5 @@ /** - * @module idle_start_auto - * @description Automatically starts idle module + * Automatically starts idle module */ modules.require(['idle'], function(idle) { diff --git a/common.blocks/jquery/__config/jquery__config.js b/common.blocks/jquery/__config/jquery__config.js index 039b4a967..7e3bbd22a 100644 --- a/common.blocks/jquery/__config/jquery__config.js +++ b/common.blocks/jquery/__config/jquery__config.js @@ -1,11 +1,15 @@ /** * @module jquery__config + * @description Configuration for jQuery */ modules.define('jquery__config', function(provide) { -provide({ +provide(/** @exports */{ + /** + * URL for loading jQuery if it does not exist + */ url : '//yandex.st/jquery/2.0.3/jquery.min.js' }); -}); \ No newline at end of file +}); diff --git a/common.blocks/jquery/__event/_type/jquery__event_type_pointer.js b/common.blocks/jquery/__event/_type/jquery__event_type_pointer.js index 96a0b75f6..0782fc8b2 100644 --- a/common.blocks/jquery/__event/_type/jquery__event_type_pointer.js +++ b/common.blocks/jquery/__event/_type/jquery__event_type_pointer.js @@ -9,8 +9,6 @@ * @see http://www.benalman.com/news/2010/03/jquery-special-events/ * @see http://api.jquery.com/category/events/event-object/ * - * @modules pointerevents - * * @author Kir Belevich * @copyright Kir Belevich 2013 * @license MIT @@ -356,4 +354,4 @@ addSpecialEvent('release', function(specialEvent, pointerEventType) { provide($); -}); \ No newline at end of file +}); diff --git a/common.blocks/querystring/__uri/querystring__uri.vanilla.js b/common.blocks/querystring/__uri/querystring__uri.vanilla.js index 43f9dcd39..56e9a815f 100644 --- a/common.blocks/querystring/__uri/querystring__uri.vanilla.js +++ b/common.blocks/querystring/__uri/querystring__uri.vanilla.js @@ -1,5 +1,6 @@ /** * @module querystring__uri + * @description A set of helpers to work with URI */ modules.define('querystring__uri', function(provide) { @@ -10,7 +11,7 @@ var map = { '%D0' : '%D0%A0', '%C0' : '%D0%90', '%C1' : '%D0%91', '%C2' : '%D0%9 function convert(str) { // Symbol code in cp1251 (hex) : symbol code in utf8) return str.replace( - /%.{2}/g, + /%.{2}/g, function($0) { return map[$0]; }); @@ -31,14 +32,24 @@ function decode(fn, str) { return res; } -provide({ +provide(/** @exports */{ + /** + * Decodes URI string + * @param {String} str + * @returns {String} + */ decodeURI : function(str) { return decode(decodeURI, str); - }, + }, + /** + * Decodes URI component string + * @param {String} str + * @returns {String} + */ decodeURIComponent : function(str) { return decode(decodeURIComponent, str); } }); -}); \ No newline at end of file +}); diff --git a/common.blocks/tick/_start/tick_start_auto.vanilla.js b/common.blocks/tick/_start/tick_start_auto.vanilla.js index 0d628b97d..b54437294 100644 --- a/common.blocks/tick/_start/tick_start_auto.vanilla.js +++ b/common.blocks/tick/_start/tick_start_auto.vanilla.js @@ -1,6 +1,5 @@ /** - * @module idle_start_auto - * @description Automatically starts tick module + * Automatically starts tick module */ modules.require(['tick'], function(tick) { diff --git a/desktop.blocks/jquery/__config/jquery__config.js b/desktop.blocks/jquery/__config/jquery__config.js index d6fbc6ea2..01491526b 100644 --- a/desktop.blocks/jquery/__config/jquery__config.js +++ b/desktop.blocks/jquery/__config/jquery__config.js @@ -1,5 +1,6 @@ /** * @module jquery__config + * @description Configuration for jQuery */ modules.define( @@ -16,4 +17,4 @@ provide( }) : base); -}); \ No newline at end of file +}); diff --git a/desktop.blocks/jquery/__event/_type/jquery__event_type_pointerclick.js b/desktop.blocks/jquery/__event/_type/jquery__event_type_pointerclick.js index 11c04cc4b..68dc5208d 100644 --- a/desktop.blocks/jquery/__event/_type/jquery__event_type_pointerclick.js +++ b/desktop.blocks/jquery/__event/_type/jquery__event_type_pointerclick.js @@ -1,7 +1,5 @@ /** - * @modules jquery__event_type_pointerclick - * @version 1.0.2 - * @author Filatov Dmitry + * @module jquery */ modules.define('jquery', function(provide, $) { @@ -26,4 +24,4 @@ var event = $.event.special.pointerclick = { provide($); -}); \ No newline at end of file +}); diff --git a/desktop.blocks/jquery/__event/_type/jquery__event_type_winresize.js b/desktop.blocks/jquery/__event/_type/jquery__event_type_winresize.js index fa492d5da..42d397d01 100644 --- a/desktop.blocks/jquery/__event/_type/jquery__event_type_winresize.js +++ b/desktop.blocks/jquery/__event/_type/jquery__event_type_winresize.js @@ -1,5 +1,5 @@ /** - * @modules jquery__event_type_winresize + * @module jquery */ modules.define('jquery', ['ua'], function(provide, ua, $) { @@ -27,4 +27,4 @@ if(ua.ie) { // TODO: investigate for which version of IE we need this workaround provide($); -}); \ No newline at end of file +}); diff --git a/desktop.blocks/ua/ua.js b/desktop.blocks/ua/ua.js index 1cfeeccad..b8fbc90e4 100644 --- a/desktop.blocks/ua/ua.js +++ b/desktop.blocks/ua/ua.js @@ -1,6 +1,7 @@ /** * @module ua - * @description inspired by http://code.jquery.com/jquery-migrate-1.1.1.js + * @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 */ modules.define('ua', function(provide) { @@ -29,6 +30,10 @@ if(browser.chrome) { browser.safari = true; } +/** + * @exports + * @type Object + */ provide(browser); }); diff --git a/touch.blocks/jquery/__event/_type/jquery__event_type_pointerclick.js b/touch.blocks/jquery/__event/_type/jquery__event_type_pointerclick.js index ba978d6bb..8fef15ea4 100644 --- a/touch.blocks/jquery/__event/_type/jquery__event_type_pointerclick.js +++ b/touch.blocks/jquery/__event/_type/jquery__event_type_pointerclick.js @@ -1,20 +1,21 @@ /** * FastClick to jQuery module wrapper. * @see https://github.com/ftlabs/fastclick - * - * @modules fastclick */ modules.define('jquery', function(provide, $) { /** - * @preserve FastClick: polyfill to remove click delays on browsers with touch UIs. + * FastClick: polyfill to remove click delays on browsers with touch UIs. * * @version 0.6.11 - * @codingstandard ftlabs-jsv2 * @copyright The Financial Times Limited [All Rights Reserved] * @license MIT License (see LICENSE.txt) */ +/** + * @class FastClick + */ + /** * Instantiate fast-clicking listeners on the specificed layer. * diff --git a/touch.blocks/ua/__dom/ua__dom.js b/touch.blocks/ua/__dom/ua__dom.js index b47c18d74..95b00b87d 100644 --- a/touch.blocks/ua/__dom/ua__dom.js +++ b/touch.blocks/ua/__dom/ua__dom.js @@ -1,6 +1,15 @@ -modules.define('i-bem__dom', ['ua'], function(provide, ua, DOM) { +/** + * @module i-bem__dom + * @description Use ua module for provide user agent features by modifiers and update some on orient change + */ +modules.define('i-bem__dom', ['ua'], function(provide, ua, BEMDOM) { -DOM.decl('ua', { +/** + * @exports i-bem__dom:blocks.ua + * @class ua + * @bem + */ +BEMDOM.decl('ua', { onSetMod : { 'js' : { 'inited' : function() { @@ -36,6 +45,6 @@ DOM.decl('ua', { }, ua); -provide(DOM); +provide(BEMDOM); }); diff --git a/touch.blocks/ua/ua.js b/touch.blocks/ua/ua.js index 00afef0eb..4590000e1 100644 --- a/touch.blocks/ua/ua.js +++ b/touch.blocks/ua/ua.js @@ -1,3 +1,8 @@ +/** + * @module ua + * @description Detect some user agent features + */ + modules.define('ua', ['jquery'], function(provide, $) { var win = window, @@ -82,25 +87,119 @@ var lastOrient = win.innerWidth > win.innerHeight, } }); -provide({ +provide(/** @exports */{ + /** + * User agent + * @type String + */ ua : ua, + + /** + * iOS version + * @type String|undefined + */ ios : platform.ios, + + /** + * Is iPhone + * @type Boolean|undefined + */ iphone : device.iphone, + + /** + * Is iPad + * @type Boolean|undefined + */ ipad : device.ipad, + + /** + * Android version + * @type String|undefined + */ android : platform.android, + + /** + * Bada version + * @type String|undefined + */ bada : platform.bada, + + /** + * Windows Phone version + * @type String|undefined + */ wp : platform.wp, + + /** + * Undetected platform + * @type Boolean|undefined + */ other : platform.other, + + /** + * Opera version + * @type String|undefined + */ opera : browser.opera, + + /** + * Chrome version + * @type String|undefined + */ chrome : browser.chrome, + + /** + * Screen size, one of: large, normal, small + * @type String + */ screenSize : screen.width > 320? 'large' : screen.width < 320? 'small' : 'normal', + + /** + * Device pixel ratio + * @type Number + */ dpr : win.devicePixelRatio || 1, + + /** + * Connection type, one of: wifi, 3g, 2g + * @type String + */ connection : support.connection, + + /** + * Flash version + * @type String|undefined + */ flash : support.flash, + + /** + * Is video supported? + * @type Boolean + */ video : support.video, + + /** + * Is SVG supported? + * @type Boolean + */ svg : support.svg, + + /** + * Viewport width + * @type Number + */ width : win.innerWidth, + + /** + * Viewport height + * @type Number + */ height : win.innerHeight, + + /** + * Is landscape oriented? + * @type Boolean + */ landscape : lastOrient });