ponymail-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From humbed...@apache.org
Subject [1/2] incubator-ponymail git commit: rename vars, make their function more obvious
Date Fri, 02 Sep 2016 11:32:46 GMT
Repository: incubator-ponymail
Updated Branches:
  refs/heads/coffee-and-cake a9040b3cb -> 1f553aa7e


rename vars, make their function more obvious


Project: http://git-wip-us.apache.org/repos/asf/incubator-ponymail/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ponymail/commit/510bfac3
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ponymail/tree/510bfac3
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ponymail/diff/510bfac3

Branch: refs/heads/coffee-and-cake
Commit: 510bfac39ab9a0910a8c17517ac486aa17fc51af
Parents: a9040b3
Author: Daniel Gruno <humbedooh@apache.org>
Authored: Fri Sep 2 13:31:40 2016 +0200
Committer: Daniel Gruno <humbedooh@apache.org>
Committed: Fri Sep 2 13:31:40 2016 +0200

----------------------------------------------------------------------
 site/js/coffee/dom_utils.coffee | 32 ++++++++++++++++----------------
 1 file changed, 16 insertions(+), 16 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ponymail/blob/510bfac3/site/js/coffee/dom_utils.coffee
----------------------------------------------------------------------
diff --git a/site/js/coffee/dom_utils.coffee b/site/js/coffee/dom_utils.coffee
index ac4db5c..178e8b0 100644
--- a/site/js/coffee/dom_utils.coffee
+++ b/site/js/coffee/dom_utils.coffee
@@ -30,41 +30,41 @@
 class HTML
     constructor: (type, params, children) ->
         ### create the raw element ###
-        r = document.createElement(type)
+        @element = document.createElement(type)
         
         ### If params have been passed, set them ###
         if isHash(params)
-            for k, v of params
+            for key, val of params
                 ### Standard string value? ###
-                if typeof v is "string"
-                    r.setAttribute(k, v)
-                else if isArray(v)
+                if typeof val is "string"
+                    @element.setAttribute(key, val)
+                else if isArray(val)
                     ### Are we passing a list of data to set? concatenate then ###
-                    r.setAttribute(k, v.join(" "))
-                else if isHash(v)
+                    @element.setAttribute(key, val.join(" "))
+                else if isHash(val)
                     ### Are we trying to set multiple sub elements, like a style? ###
-                    for x,y of v
-                        r[k][x] = y
+                    for subkey,subval of val
+                        @element[key][subkey] = subval
         
         ### If any children have been passed, add them to the element  ###
         if children
             ### If string, convert to textNode using txt() ###
             if typeof children is "string"
-                app(r, txt(children))
+                @element.inject(txt(children))
             else
                 ### If children is an array of elems, iterate and add ###
                 if isArray children
-                    for k in children
+                    for child in children
                         ### String? Convert via txt() then ###
-                        if typeof k is "string"
-                            app(r, txt(k))
+                        if typeof child is "string"
+                            @element.inject(txt(child))
                         else
                             ### Plain element, add normally ###
-                            app(r, k)
+                            @element.inject(k)
                 else
                     ### Just a single element, add it ###
-                    app(r, children)
-        return r
+                    @element.inject(children)
+        return @element
 
 ###*
 # App: Shortcut for document.appendChild with modifications


Mime
View raw message