From 502746649465ad8a528d14a3a11ba363db2ffbac Mon Sep 17 00:00:00 2001 From: pavel Date: Sat, 24 Jan 2015 15:30:24 +0000 Subject: [PATCH] some documentation --- .../static_client/js/_modules/block.common.js | 30 +++++++++-- .../static_client/js/_modules/page.about.js | 50 ++++++++++++++++--- 2 files changed, 69 insertions(+), 11 deletions(-) diff --git a/templates/client/static_client/js/_modules/block.common.js b/templates/client/static_client/js/_modules/block.common.js index 52253cec..5d44ba7c 100644 --- a/templates/client/static_client/js/_modules/block.common.js +++ b/templates/client/static_client/js/_modules/block.common.js @@ -5,13 +5,33 @@ if (EXPO.common){ }else { EXPO.common = (function () { -// variables + /** + * private (visible inside this module only) variables + */ + /** + * @type {Object} - module API interafce realization + */ var that = {}; + /** + * helper for this.children + * @param {HTMLElement} el + * @param selector + * @returns {*} + */ var matches = function(el, selector) { return (el.matches || el.matchesSelector || el.msMatchesSelector || el.mozMatchesSelector || el.webkitMatchesSelector || el.oMatchesSelector).call(el, selector); }; + /** + * @type {Object} default setting + */ that.opt = {}; //свойства по умолчанию + // Валидация форм, каждый объект содержит поля объектов формы и методы работы с формой + /** + * Form validation mechanism + * @param {*|jQuery|HTMLElement} obj - particualr form + * @constructor + */ var Validation = function(obj){ //поля над которыми проводится валидация this.fields = []; @@ -174,9 +194,11 @@ if (EXPO.common){ $("input[type='checkbox'], input[type='radio']").customRadioCheck(); // add to calendar button click event functional }); - -// methods - //инициализация общих свойств + + /** + * current module general initialization + * @param {Object} options - options recieved from web page view + */ that.init = function (options) { $.extend(this.opt, options); var self = this, diff --git a/templates/client/static_client/js/_modules/page.about.js b/templates/client/static_client/js/_modules/page.about.js index c4860318..ee7f0c2b 100644 --- a/templates/client/static_client/js/_modules/page.about.js +++ b/templates/client/static_client/js/_modules/page.about.js @@ -3,21 +3,51 @@ if (EXPO.about) { console.warn('WARNING: EXPO.eventsFeed is already defined!'); } else { EXPO.about = (function () { - // variables + /** + * private (visible inside this module only) variables + */ + /** + * @type {Object} - module API interafce realization + */ var that = {}; - //default module setting + /** + * @type {Object} default setting + */ that.opt = {}; - //dependence's + /** + * dependencies.Place where you can switch on dependencies for module + * @type {EXPO.common|*} - mostly used in project functions and data (block.common.js) + */ var com = EXPO.common; - //private + + /** + * tabs object constructor + * @param options - options (id's and classes to specifie HTML elements) + * @constructor + */ var Tabs = function (options) { this.opt = options; var self = this, opt = this.opt, tabClass = opt.tabClass, activeClass = opt.activeClass; + /** + * tabs navigation menu + * @type {*|jQuery|HTMLElement} + * @public + */ this.$tabsList = $('#'+opt.listId); + /** + * tabs body container + * @type {*|jQuery|HTMLElement} + * @public + */ this.$tabs = $('#'+opt.tabsId); + /** + * short peview for content of each tabs + * @type {*|jQuery|HTMLElement} + * @public + */ this.$tabsOpenings = $('#'+opt.tabsOpeningId); $('a',this.$tabsList).on('click', function () { @@ -31,9 +61,11 @@ if (EXPO.about) { }; Tabs.prototype = { - initTabs: function () { - - }, + /** + * make specified tab visible + * @param tabId - tab DOM id pararmeter + * @public + */ setActive: function (tabId) { var activeClass = this.opt.activeClass, tabClass = this.opt.tabClass, @@ -47,6 +79,10 @@ if (EXPO.about) { } }; + /** + * current module general initialization + * @param {Object} options - options recieved from web page view + */ that.init = function (options) { // settings extending $.extend(this.opt, options);