now it looks fantastic. Nothing under!
This commit is contained in:
1 parent
a72347d1e3
commit
59813e906e
15 files changed
+130
-16
No files matched your search
@@ -7,7 +7,30 @@ directive = () ->
|
||||
restrict: 'E',
|
||||
scope:
|
||||
value: "="
|
||||
controller:["$scope", ($scope) ->
|
||||
docId: "="
|
||||
key: "="
|
||||
expended: "="
|
||||
controller:["$scope", "$routeParams", ($scope, $routeParams) ->
|
||||
$scope.isSmallString = (str)->
|
||||
if not _.isString(str)
|
||||
return false
|
||||
rgx = str.match(/\n/g) or []
|
||||
return str.length < 1000 and rgx.length < 20
|
||||
|
||||
$scope.isSmallObject = (obj) ->
|
||||
return $scope.isSmallString(JSON.stringify(obj, null, 4))
|
||||
|
||||
$scope.getSmallPrefix = (str) ->
|
||||
if _.isString(str)
|
||||
return str.substr(0, 500) + "..."
|
||||
return ""
|
||||
$scope.url = ()->
|
||||
rp = $routeParams
|
||||
s = $scope
|
||||
return "#/#{rp.server}/#{rp.database}/#{rp.collection}/_id/#{s.docId}/field/#{s.key}"
|
||||
|
||||
$scope.valueLength = if _.isObject($scope.value) then _.keys($scope.value).length else $scope.value.length
|
||||
|
||||
$scope.isString = _.isString($scope.value)
|
||||
$scope.isNumber = _.isNumber($scope.value)
|
||||
$scope.isObject = _.isObject($scope.value)
|
||||
|
||||
Reference in new issue
Block a user