mirror of
https://github.com/overleaf/overleaf.git
synced 2024-10-31 21:21:03 -04:00
14 lines
369 B
CoffeeScript
14 lines
369 B
CoffeeScript
define [
|
|
"base"
|
|
"ide/directives/SafePath"
|
|
], (App, SafePath) ->
|
|
|
|
MAX_PATH = 1024 # Maximum path length, in characters. This is fairly arbitrary.
|
|
|
|
App.directive "validFile", () ->
|
|
return {
|
|
require: 'ngModel'
|
|
link: (scope, element, attrs, ngModelCtrl) ->
|
|
ngModelCtrl.$validators.validFile = (filename) ->
|
|
return SafePath.isCleanFilename filename
|
|
}
|