       if isNaN(i = parseInt(s, 10)) then s else i
     byDefault = (a,b) -> +(a > b) || +(a == b) - 1
     byNumber = (a,b) -> a-b
-    byId = (a,b) -> a.id-b.id
     byType = (a,b) ->
       ta = typeof a
       tb = typeof b

            ### jshint ignore:start #### fixed in jshint 2.5.7
            $scope.categories = (c for ci, c of constants.category when ci not of Data)
            ### jshint ignore:end ###
            $scope.categories.sort(byId)
            $scope.categories.push(pseudoCategory[0]) unless 0 of Data
          return

        # Call all populate functions
        populate = ->
          Data = {}
          Data.slot = {id: []}
          Data.asset = {id: []} if Assets
          Depends = {}
          for s, i in Slots
            populateSlot(i)


        edit = (info) ->
          switch info.t
            when 'rec', 'add'
              if info.c == 'asset'
                # for now, just go to slot edit
