Added standard diet filters

Added standard diet filters

Signed-off-by: WebFreak001 <b0a51d41aaf8d5df1e850f1ef2ec58fb1c30319f@web.de>

--- grammars/diet.cson
+++ grammars/diet.cson
@@ -128,6 +128,38 @@
       }
       {
         'include': 'source.sass'
+      }
+    ]
+  }
+  {
+    'begin': '^(\\s*):(css)(?=\\(|$)$'
+    'beginCaptures':
+      '2':
+        'name': 'constant.language.name.css.filter.diet'
+    'end': '^(?!(\\1\\s)|\\s*$)'
+    'name': 'source.css.filter.diet'
+    'patterns': [
+      {
+        'include': '#filter_args'
+      }
+      {
+        'include': 'source.css'
+      }
+    ]
+  }
+  {
+    'begin': '^(\\s*):(javascript)(?=\\(|$)$'
+    'beginCaptures':
+      '2':
+        'name': 'constant.language.name.javascript.filter.diet'
+    'end': '^(?!(\\1\\s)|\\s*$)'
+    'name': 'source.javascript.filter.diet'
+    'patterns': [
+      {
+        'include': '#filter_args'
+      }
+      {
+        'include': 'source.js'
       }
     ]
   }


Hint minifier

Hint minifier

--- src/array.coffee
+++ src/array.coffee
@@ -3,6 +3,9 @@
 typeChecks = require './typechecks'

 array = module.exports
+
+arrayProto  = Array.prototype
+objectProto = Object.prototype

 array.length = (xs) ->
   xs.length
@@ -85,20 +88,20 @@
     when ys is null then []
     else [ys]
   xs = array.slice 0, xs
-  Array.prototype.splice.apply xs, [index, howMany].concat(ys)
+  arrayProto.splice.apply xs, [index, howMany].concat(ys)
   xs

 array.toLocaleString = (xs) ->
   if typeChecks.isArray xs
-    Array.prototype.toLocaleString.call xs
+    arrayProto.toLocaleString.call xs
   else
-    Object.prototype.toLocaleString.call xs
+    objectProto.toLocaleString.call xs

 array.toString = (xs) ->
   if typeChecks.isArray xs
-    Array.prototype.toString.call xs
+    arrayProto.toString.call xs
   else
-    Object.prototype.toString.call xs
+    objectProto.toString.call xs

 array.unshift = curry (x, xs) ->
   array.concat xs, [x]


Fixes

Fixes

--- src/bdate.coffee
+++ src/bdate.coffee
@@ -41,6 +41,10 @@
       datetime = new Date(dmy.year, dmy.month - 1, dmy.day).getTime()
       return $filter('date') datetime, scope.bSettings.format

+    getFormattedDatRange = (dmy) ->
+      #datetime = new Date(dmy.year, dmy.month - 1, dmy.day).getTime()
+      #return $filter('date') datetime, scope.bSettings.format
+
     scope.$watch 'popup.result', (newVal, oldVal) ->
       return if newVal is oldVal
       return if not newVal
@@ -49,7 +53,7 @@
       if (not scope.bRange)
         scope.bModel = getFormattedDate(scope.popup.result)
       else
-        #scope.bModel = getFormattedDate(scope.popup.result)
+#        scope.bModel = getFormattedDatRange(scope.popup.result)
     , true

     processClick = (event) ->


找不到placeholder的处理

找不到placeholder的处理

--- src/charm.coffee
+++ src/charm.coffee
@@ -29,10 +29,10 @@

       @_addMethod funcName, method for funcName, method of methods

-
     #添加字符与数字形式的param
     _addPlainParam: (param, index)->
       placeholder = @segmentModel.placeholders[index]
+      return if not placeholder
       @params[index] = key: placeholder.key, value: String(param)

     #添加对象类型的参数


fix(data): log error type before actual error

--- src/lib/data.coffee
+++ src/lib/data.coffee
@@ -25,8 +25,8 @@
       if update
         db.save update.id, _.extend(update.value, form), (err, dbres) ->
           if err
+            console.log   'Database Error'
             console.log   err
-            console.log   'Database Error'
             res.send 500, 'Database Error'
           else
             console.log   'Submission Saved'
@@ -34,8 +34,8 @@
       else
         db.save form, (err, dbres) ->
           if err
+            console.log   'Database Error'
             console.log    err
-            console.log   'Database Error'
             res.send 500, 'Database Error'
           else
             console.log   'Submission Saved'
@@ -45,6 +45,7 @@
   db.view 'contractors/github', (err, docs) ->
     if err
       console.log 'Database Error'
+      console.log 'err'
       callback []
     else
       callback(_.pluck(docs, 'key'))