diff --git a/docs-web/src/main/webapp/src/app/docs/filter/Filesize.js b/docs-web/src/main/webapp/src/app/docs/filter/Filesize.js new file mode 100644 index 00000000..e3dfda68 --- /dev/null +++ b/docs-web/src/main/webapp/src/app/docs/filter/Filesize.js @@ -0,0 +1,18 @@ +'use strict'; + +/** + * Format file sizes. + */ +angular.module('docs').filter('filesize', function() { + return function(text) { + if (!text) { + return ''; + } + + var size = parseInt(text); + if (size > 1000000) { // 1MB + return Math.round(size / 1000000) + 'MB'; + } + return Math.round(size / 1000) + 'kB'; + } +}); \ No newline at end of file diff --git a/docs-web/src/main/webapp/src/app/docs/filter/Newline.js b/docs-web/src/main/webapp/src/app/docs/filter/Newline.js index c7cce4b7..e56e6bac 100644 --- a/docs-web/src/main/webapp/src/app/docs/filter/Newline.js +++ b/docs-web/src/main/webapp/src/app/docs/filter/Newline.js @@ -1,7 +1,7 @@ 'use strict'; /** - * Filter converting new lines in
+ * Filter converting new lines in
. */ angular.module('docs').filter('newline', function() { return function(text) { @@ -10,4 +10,4 @@ angular.module('docs').filter('newline', function() { } return text.replace(/\n/g, '
'); } -}) \ No newline at end of file +}); \ No newline at end of file diff --git a/docs-web/src/main/webapp/src/app/docs/filter/Shorten.js b/docs-web/src/main/webapp/src/app/docs/filter/Shorten.js index d2b055e1..d479cce1 100644 --- a/docs-web/src/main/webapp/src/app/docs/filter/Shorten.js +++ b/docs-web/src/main/webapp/src/app/docs/filter/Shorten.js @@ -10,4 +10,4 @@ angular.module('docs').filter('shorten', function() { } return text.substring(0, 1).toUpperCase(); } -}) \ No newline at end of file +}); \ No newline at end of file diff --git a/docs-web/src/main/webapp/src/app/share/filter/Filesize.js b/docs-web/src/main/webapp/src/app/share/filter/Filesize.js new file mode 100644 index 00000000..b6765b45 --- /dev/null +++ b/docs-web/src/main/webapp/src/app/share/filter/Filesize.js @@ -0,0 +1,18 @@ +'use strict'; + +/** + * Format file sizes. + */ +angular.module('share').filter('filesize', function() { + return function(text) { + if (!text) { + return ''; + } + + var size = parseInt(text); + if (size > 1000000) { // 1MB + return Math.round(size / 1000000) + 'MB'; + } + return Math.round(size / 1000) + 'kB'; + } +}); \ No newline at end of file diff --git a/docs-web/src/main/webapp/src/app/share/filter/Newline.js b/docs-web/src/main/webapp/src/app/share/filter/Newline.js index 571fa4d5..5e5c44f8 100644 --- a/docs-web/src/main/webapp/src/app/share/filter/Newline.js +++ b/docs-web/src/main/webapp/src/app/share/filter/Newline.js @@ -1,7 +1,7 @@ 'use strict'; /** - * Filter converting new lines in
+ * Filter converting new lines in
. */ angular.module('share').filter('newline', function() { return function(text) { @@ -10,4 +10,4 @@ angular.module('share').filter('newline', function() { } return text.replace(/\n/g, '
'); } -}) \ No newline at end of file +}); \ No newline at end of file diff --git a/docs-web/src/main/webapp/src/index.html b/docs-web/src/main/webapp/src/index.html index c71cf81d..59f8b030 100644 --- a/docs-web/src/main/webapp/src/index.html +++ b/docs-web/src/main/webapp/src/index.html @@ -63,6 +63,7 @@ + diff --git a/docs-web/src/main/webapp/src/partial/docs/document.default.html b/docs-web/src/main/webapp/src/partial/docs/document.default.html index d4842b17..0d814030 100644 --- a/docs-web/src/main/webapp/src/partial/docs/document.default.html +++ b/docs-web/src/main/webapp/src/partial/docs/document.default.html @@ -8,7 +8,7 @@
- +
diff --git a/docs-web/src/main/webapp/src/partial/docs/document.view.content.html b/docs-web/src/main/webapp/src/partial/docs/document.view.content.html index 5042d3ce..4d5d7a9d 100644 --- a/docs-web/src/main/webapp/src/partial/docs/document.view.content.html +++ b/docs-web/src/main/webapp/src/partial/docs/document.view.content.html @@ -6,7 +6,7 @@
- +
diff --git a/docs-web/src/main/webapp/src/partial/share/share.html b/docs-web/src/main/webapp/src/partial/share/share.html index 25833a68..d03fe326 100644 --- a/docs-web/src/main/webapp/src/partial/share/share.html +++ b/docs-web/src/main/webapp/src/partial/share/share.html @@ -18,7 +18,9 @@ diff --git a/docs-web/src/main/webapp/src/share.html b/docs-web/src/main/webapp/src/share.html index 6e401014..a8e8ea7d 100644 --- a/docs-web/src/main/webapp/src/share.html +++ b/docs-web/src/main/webapp/src/share.html @@ -37,6 +37,7 @@ +