Remove iScroll reference

Remove iScroll reference

--- src/coffee/flight.coffee
+++ src/coffee/flight.coffee
@@ -5,7 +5,6 @@
   targetPage: ''
   startPage: ''
   os: ''
-  iScroll: null
   moved: false
   theTarget: null

@@ -201,7 +200,6 @@
     targetPage.style.display = "-webkit-box"
     currentPage.style.display = "none"

-
   # Private: Hide DOM that has just been transitioned
   #
   # page    - The page element that has just been moved outside of view
@@ -213,19 +211,6 @@

     if @isAndroid() and @os.version < '4'
       @currentPage.style.webkitTransform = "none"
-
-  # Initiates iScroll when needed for android devices 2.3
-  #
-  # targetPage  - String or DOM element of the page that you want to use iScroll
-  #
-  # Returns nothing
-  initIscroll: (targetPage) =>
-    targetPage = @currentPage unless targetPage?
-    targetPage = document.querySelector targetPage if typeof targetPage is "string"
-    @iScroll = new iScroll targetPage.querySelector('.scrollview-inner'),
-      snap: false
-      onBeforeScrollMove: =>
-        @iScroll.refresh()

   # Private: Get a Hash of browser user agent information.
   #


Fix continueOnError.

Fix continueOnError.

--- src/coffee/import.coffee
+++ src/coffee/import.coffee
@@ -187,12 +187,15 @@
         else
           @publishProduct(result, rowIndex).then ->
             deferred.resolve "[row #{rowIndex}] Product updated."
-      .fail (err) ->
-        msg = "[row #{rowIndex}] Problem on updating product:\n#{_.prettify err}"
-        if @continueOnProblems
-          deferred.resolve "#{msg} - ignored!"
-        else
-          deferred.reject msg
+      .fail (err) =>
+        if err.statusCode is 400
+          msg = "[row #{rowIndex}] Problem on updating product:\n#{_.prettify err}"
+          if @continueOnProblems
+            deferred.resolve "#{msg} - ignored!"
+          else
+            deferred.reject msg
+        else
+          deferred.reject "[row #{rowIndex}] Error on updating product:\n#{_.prettify err}"
       .done()

     deferred.promise
@@ -205,7 +208,7 @@
       @client.products.create(product)
       .then (result) ->
         deferred.resolve "[row #{rowIndex}] New product created."
-      .fail (err) ->
+      .fail (err) =>
         if err.statusCode is 400
           msg = "[row #{rowIndex}] Problem on creating new product:\n#{_.prettify err}"
           if @continueOnProblems
@@ -235,7 +238,7 @@
       @client.products.byId(product.id).update(data)
       .then (result) ->
         deferred.resolve "[row #{rowIndex}] Product #{action}ed."
-      .fail (err) ->
+      .fail (err) =>
         if err.statusCode is 400
           if @continueOnProblems
             deferred.resolve "[row #{rowIndex}] Product is already #{action}ed."


Fix reduce call

Fix reduce call

--- src/coffee/import.coffee
+++ src/coffee/import.coffee
@@ -69,7 +69,9 @@
           chunks = _.batchList(products, 20)
           p = (p) => @processProducts(p)
           Promise.map(chunks, p, { concurrency: 20 })
-          .then((results) => results.reduce((agg, r) => agg.concat(r) []))
+          .then((results) => results.reduce((agg, r) ->
+            agg.concat(r)
+          []))

   processProducts: (products) ->
     console.warn "Mapping done. About to process existing product(s) ..."


Updated cohtml-parser (extractNode)

Updated cohtml-parser (extractNode)

--- src/cohtml-parser.coffee
+++ src/cohtml-parser.coffee
@@ -85,4 +85,59 @@

   extractTextNode: (parentNode)->

+  extractNode: (indentLevel, parentNode)->
+    tag = @takeAll @charset['tag']
+    return false unless tag
+
+    id = null
+    classList = []
+    while shorthand = @take [ '$', '.' ]
+      if shorthand is '$'
+        unless id = @takeAll @charset['id']
+          @throwError 'Expected ID after $ sign'
+      else
+        if className = @takeAll @charset['class']
+          classList.push className
+        else
+          @throwError 'Expected ClassName after $ sign'
+
+    @ignoreWhitespace()
+
+    attributeMap = {}
+    while attribute = @takeAll @charset['attribute']
+      @ignoreWhitespace()
+
+      if @take @charset['equal']
+
+        @ignoreWhitespace()
+        if @take @charset['dquote']
+          value = @takeAllUntil @charset['dquote']
+          attributeMap[attribute] = value
+          @take @charset['dquote']
+          if value.length is 0
+            @throwError 'Value of an attribute can not be empty'
+        else
+          @throwError 'Expected Double Quote after = sign'
+
+      else
+        attributeMap[attribute] = null
+
+    @ignoreWhitespace()
+
+    innerText = null
+    if @take @charset['pipe']
+      innerText = @takeAllUntil @charset['newline']
+      @ignoreWhitespace()
+    else
+      if @take @charset['backtick']
+        innerText = @takeAllUntil @charset['backtick']
+        @ignoreWhitespace()
+
+    node = new CohtmlNode parentNode, tag, id, classList, attributeMap, innerText
+
+    @take @charset['newline']
+
+    childrenList = @extractScope (indentLevel + 1), node
+
+
 @CohtmlParser = CohtmlParser