overleaf/services/web/public/coffee/ide/files/services/files.coffee

18 lines
368 B
CoffeeScript
Raw Normal View History

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