Sha256: a9c0d6b3f6d04d3d88530690831da68f1323409e893e1294d9d450401f284b18

Contents?: true

Size: 1.29 KB

Versions: 26

Compression:

Stored size: 1.29 KB

Contents

# PluginFactoryScaffolding : PARTIAL
########################################################################################################################

# FILTER: fromNow
####################################################################################
App.filter('fromNow', ()-> (date) ->
  return 'never' if !date
  moment(date).fromNow()
)

# FILTER: titleize
####################################################################################
App.filter('titleize', -> (str) ->
  return str if typeof str != 'string'
  smallWords = /^(a|an|and|as|at|but|by|en|for|if|in|of|on|or|the|to|vs?\.?|via)$/i
  str.replace /([^\W_]+[^\s-]*) */g, (match, p1, index, title)->
    return match.toLowerCase() if (index > 0 && index + p1.length != title.length && p1.search(smallWords) > -1) && (title.charAt(index - 2) != ":") && (title.charAt(index - 1).search(/[^\s-]/) < 0)
    return match if (p1.substr(1).search(/[A-Z]|\../) > -1)
    match.charAt(0).toUpperCase() + match.substr(1)
)

# FILTER: humanize
####################################################################################
App.filter('humanize', -> (str) ->
  return str if typeof str != 'string'
  str.replace('_', ' ')
)

# END PARTIAL ##########################################################################################################

Version data entries

26 entries across 26 versions & 1 rubygems

Version Path
fanforce-plugin-factory-2.0.0.rc29 lib/fanforce/plugin_factory/scaffolding/assets/js/lib/filters.coffee
fanforce-plugin-factory-2.0.0.rc28 lib/fanforce/plugin_factory/scaffolding/assets/js/lib/filters.coffee
fanforce-plugin-factory-2.0.0.rc27 lib/fanforce/plugin_factory/scaffolding/assets/js/lib/filters.coffee
fanforce-plugin-factory-2.0.0.rc26 lib/fanforce/plugin_factory/scaffolding/assets/js/lib/filters.coffee
fanforce-plugin-factory-2.0.0.rc25 lib/fanforce/plugin_factory/scaffolding/assets/js/lib/filters.coffee
fanforce-plugin-factory-2.0.0.rc24 lib/fanforce/plugin_factory/scaffolding/assets/js/lib/filters.coffee
fanforce-plugin-factory-2.0.0.rc23 lib/fanforce/plugin_factory/scaffolding/assets/js/lib/filters.coffee
fanforce-plugin-factory-2.0.0.rc22 lib/fanforce/plugin_factory/scaffolding/assets/js/lib/filters.coffee
fanforce-plugin-factory-2.0.0.rc21 lib/fanforce/plugin_factory/scaffolding/assets/js/lib/filters.coffee
fanforce-plugin-factory-2.0.0.rc19 lib/fanforce/plugin_factory/scaffolding/assets/js/lib/filters.coffee
fanforce-plugin-factory-2.0.0.rc18 lib/fanforce/plugin_factory/scaffolding/assets/js/lib/filters.coffee
fanforce-plugin-factory-2.0.0.rc17 lib/fanforce/plugin_factory/scaffolding/assets/js/lib/filters.coffee
fanforce-plugin-factory-2.0.0.rc16 lib/fanforce/plugin_factory/scaffolding/assets/js/lib/filters.coffee
fanforce-plugin-factory-2.0.0.rc15 lib/fanforce/plugin_factory/scaffolding/assets/js/lib/filters.coffee
fanforce-plugin-factory-2.0.0.rc13 lib/fanforce/plugin_factory/scaffolding/assets/js/lib/filters.coffee
fanforce-plugin-factory-2.0.0.rc12 lib/fanforce/plugin_factory/scaffolding/assets/js/lib/filters.coffee
fanforce-plugin-factory-2.0.0.rc11 lib/fanforce/plugin_factory/scaffolding/assets/js/lib/filters.coffee
fanforce-plugin-factory-2.0.0.rc10 lib/fanforce/plugin_factory/scaffolding/assets/js/lib/filters.coffee
fanforce-plugin-factory-2.0.0.rc9 lib/fanforce/plugin_factory/scaffolding/assets/js/lib/filters.coffee
fanforce-plugin-factory-2.0.0.rc8 lib/fanforce/plugin_factory/scaffolding/assets/js/lib/filters.coffee