overleaf/services/web/public/coffee/ide/files/services/files.coffee
2017-11-22 11:25:02 -05:00

17 lines
368 B
CoffeeScript

define [
"base"
], (App) ->
App.factory 'files', (ide) ->
Files =
getTeXFiles: () ->
texFiles = []
ide.fileTreeManager.forEachEntity (entity, folder, path) ->
if entity.type == 'doc' && entity?.name?.match?(/.*\.(tex|txt|md)/)
cloned = _.clone(entity)
cloned.path = path
texFiles.push cloned
return texFiles
return Files