overleaf/services/web/public/coffee/ide/directives/validFile.coffee

13 lines
287 B
CoffeeScript
Raw Normal View History

2018-02-05 11:56:52 -05:00
define [
"base"
"ide/directives/SafePath"
], (App, SafePath) ->
2018-02-05 11:56:52 -05:00
App.directive "validFile", () ->
return {
require: 'ngModel'
link: (scope, element, attrs, ngModelCtrl) ->
ngModelCtrl.$validators.validFile = (filename) ->
return SafePath.isCleanFilename filename
2018-02-05 11:56:52 -05:00
}