Code coverage report for code/mixins/node-title.coffee

Statements: 0% (0 / 12)      Branches: 0% (0 / 4)      Functions: 0% (0 / 5)      Lines: 0% (0 / 8)      Ignored: none     

All files » code/mixins/ » node-title.coffee
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20                                       
tr = require "../utils/translate"
module.exports =
  defaultTitle: ->
    tr "~NODE.UNTITLED"
 
  titlePlaceholder: ->
    @defaultTitle()
 
  displayTitleForInput: (proposedTitle) ->
    # For input fields, use 'placeholder' value @defaultTitle
    # to work, the 'value' attribute of the input should be blank
    if proposedTitle is @defaultTitle() then "" else proposedTitle
 
  maxTitleLength: ->
    35
 
  cleanupTitle: (newTitle) ->
    newTitle = newTitle.substr(0, @maxTitleLength())
    newTitle = if newTitle.length > 0 then newTitle else @defaultTitle()