Prechádzať zdrojové kódy

Some changes in documentation

@soyjavi 14 rokov pred
rodič
commit
4efcaedfb8

+ 14 - 10
src/Lungo.Core.js

@@ -140,11 +140,14 @@ LUNGO.Core = (function(lng, $$, undefined) {
     };
 
     /**
-     * Returns information of execute environment
+     * Returns a ordered list of objects by a property
      *
-     * @method environment
+     * @method orderByProperty
      *
-     * @return {object} Environment information
+     * @param {list} List of objects
+     * @param {string} Name of property
+     * @param {string} Type of order: asc (ascendent) or desc (descendent)
+     * @return {list} Ordered list
      */
     var orderByProperty = function(data, property, order) {
         var order_operator = (order === 'desc') ? -1 : 1;
@@ -163,7 +166,8 @@ LUNGO.Core = (function(lng, $$, undefined) {
      *
      * @method parseUrl
      *
-     * @return {string} Href
+     * @param {string} Url
+     * @return {string} Url parsed
      */
     var parseUrl = function(href) {
         var href_hashtag = href.lastIndexOf(HASHTAG_CHARACTER);
@@ -176,16 +180,16 @@ LUNGO.Core = (function(lng, $$, undefined) {
     };
 
     /**
-     * Find a Object in a list by a property value
+     * Returns a Object in a list by a property value
      *
      * @method objectInListByProperty
      *
-     * @param {list}
-     * @param {string}
-     * @param {} obj
+     * @param {list} List of objects
+     * @param {string} Name of property
+     * @param {var} Value for comparision
      * @return {object} Instance of object founded (if exists)
      */
-     var objectInListByProperty = function(list, property, value) {
+     var findByProperty = function(list, property, value) {
         var search = null;
 
         for (var i = 0, len = list.length; i < len; i++) {
@@ -212,7 +216,7 @@ LUNGO.Core = (function(lng, $$, undefined) {
         environment: environment,
         orderByProperty: orderByProperty,
         parseUrl: parseUrl,
-        objectInListByProperty: objectInListByProperty
+        findByProperty: findByProperty
     };
 
 })(LUNGO, Quo);

+ 3 - 3
src/Lungo.Service.js

@@ -70,18 +70,18 @@ LUNGO.Service = (function(lng, $$, undefined) {
      * @param  {Function} [OPTIONAL] Callback function after the request
      * @param  {string} Mime-Type: json, xml, html, or text [OPTIONAL]
      */
-    var cache = function(url, data, date_pattern, success, dataType) {
+    var cache = function(url, data, date_pattern, callback, dataType) {
         var url_key = url + $$.serializeParameters(data);
 
         if (_urlCached(url_key, date_pattern)) {
             var value = lng.Data.Storage.persistent(url_key);
             if (value) {
-                return success.call(success, value);
+                return callback.call(callback, value);
             }
         } else {
             return $$.get(url, data, function(result) {
                 _saveServiceInCache(url_key, result);
-                success.call(success, result);
+                callback.call(callback, result);
             }, dataType);
         }
     };

+ 18 - 0
src/data/Lungo.Data.Storage.js

@@ -15,10 +15,28 @@ LUNGO.Data.Storage = (function(lng, undefined) {
         SESSION: 'sessionStorage'
     };
 
+    /**
+     * Wrapper for SessionStorage
+     *
+     * @method persistent
+     *
+     * @param {string} Key
+     * @param {object} Value
+     * @return {string} If no value assigned returns the value of established key
+     */
 	var persistent = function(key, value) {
         return _handler(STORAGE.PERSISTENT, key, value);
 	};
 
+    /**
+     * Wrapper for SessionStorage
+     *
+     * @method session
+     *
+     * @param {string} Key
+     * @param {object} Value
+     * @return {string} If no value assigned returns the value of established key
+     */
 	var session = function(key, value) {
         return _handler(STORAGE.SESSION, key, value);
 	};

+ 4 - 4
src/view/Lungo.View.Aside.js

@@ -15,12 +15,12 @@ LUNGO.View.Aside = (function(lng, undefined) {
     var ATTRIBUTE = lng.Constants.ATTRIBUTE;
 
     /**
-     * ?
+     * Display an aside element for a particular <section>
      *
      * @method show
      *
-     * @param  {string} Element query selector
-     * @param  {string} Value for counter
+     * @param  {string} Section id
+     * @param  {string} Aside id
      */
     var show = function(section_id, aside_id) {
         var aside = lng.dom(ELEMENT.ASIDE + aside_id);
@@ -32,7 +32,7 @@ LUNGO.View.Aside = (function(lng, undefined) {
     };
 
     /**
-     * ?
+     * Hide an aside element for a particular section
      *
      * @method hide
      *

+ 4 - 3
src/view/Lungo.View.Scroll.js

@@ -74,11 +74,12 @@ LUNGO.View.Scroll = (function(lng, undefined) {
     };
 
     /**
-     * Removes iScroll instance.
+     * Refresh iScroll instance.
      *
      * @method refresh
      *
-     * @param {Object} Id of the <section>
+     * @param {string} Id of the container scroll.
+     * @param {object} [OPTIONAL] Properties
      */
     var refresh = function(id, properties) {
         _render(id, properties);
@@ -89,7 +90,7 @@ LUNGO.View.Scroll = (function(lng, undefined) {
      *
      * @method remove
      *
-     * @param {string} Id of the <section>
+     * @param {string} Id of the container scroll.
      */
     var remove = function(id) {
         if (lng.Data.Cache.exists(CACHE_KEY) && lng.Data.Cache.get(CACHE_KEY, id)) {

+ 16 - 0
src/view/Lungo.View.Template.List.js

@@ -31,6 +31,14 @@ LUNGO.View.Template.List = (function(lng, undefined) {
         }
 	};
 
+    /**
+     * Append a list based DataBind with a configuration object for an element <article>
+     * if the config has a 'norecords' property it will display the norecords markup rather than nothing.
+     *
+     * @method append
+     *
+     * @param {object} Id of the container showing the result of databinding
+     */
     var append = function(config) {
         var markup = lng.View.Template.markup(config.template, config.data);
         var container = _getContainer(config.el);
@@ -39,6 +47,14 @@ LUNGO.View.Template.List = (function(lng, undefined) {
         _scroll(config.el, ATTRIBUTE.LAST);
     };
 
+    /**
+     * Prepend a list based DataBind with a configuration object for an element <article>
+     * if the config has a 'norecords' property it will display the norecords markup rather than nothing.
+     *
+     * @method prepend
+     *
+     * @param {object} Id of the container showing the result of databinding
+     */
     var prepend = function(config) {
         var markup = lng.View.Template.markup(config.template, config.data);
         var container = _getContainer(config.el);

+ 2 - 2
src/view/Lungo.View.Template.js

@@ -53,9 +53,9 @@ LUNGO.View.Template = (function(lng, undefined) {
     /**
      * Performs databinding process for a data set and a given template
      *
-     * @method binding
+     * @method render
      *
-     * @param {String} Id of the container showing the result of databinding
+     * @param {String} Element selector for showing the result of databinding
      * @param {String} Databinding Template Id
      * @param {Object} Data for binding
      * @param {Function} Callback when the process is complete