document.write('
Data hosted with ♥ by Pastebin.com - Download Raw - See Original
  1. sourceData = @sourceData
  2.  
  3. UI.registerHelper \'dataValue\', (variable)->
  4.     item = sourceData.findOne(name:variable)
  5.     if item
  6.         this.value = item.value
  7.         this._id = item._id
  8.         this.variable = variable
  9.         this
  10.     else
  11.         null
  12.  
  13. Template.yesNo.helpers
  14.     getColor: (variable)->
  15.         item = sourceData.findOne(name:variable)
  16.         if item
  17.             if item.value then \'green\' else \'red\'
  18.         else
  19.             \'black\'
  20.  
  21. Template.yesNo.events
  22.     \'click circle\': (e,t)->
  23.         Meteor.call \'Control\', $(e.target).attr(\'variable\')#$(t.find(\'div\')).attr(\'name\')
  24.        
  25.  
  26. Template.swBasicPerecentage.helpers
  27.     getWidth: (value) ->
  28.         w = this.width
  29.         w*value/100
  30.     getColor: (value) ->
  31.         if value >= 50
  32.             \'red\'
  33.         else
  34.             \'green\'
  35.     xPosText: ->
  36.         this.width/2
  37.  
  38. Template.swVelocimeter.helpers
  39.     x2 : (value)->
  40.         alfa = value*2*Math.PI/100.0
  41.         25+25.0*Math.cos(alfa)
  42.     y2 : (value)->
  43.         alfa = value*2*Math.PI/100.0
  44.         25+25.0*Math.sin(alfa)
');