aboutsummaryrefslogtreecommitdiffstats
path: root/server/sonar-web/src/main/js/libs
diff options
context:
space:
mode:
authorStas Vilchik <vilchiks@gmail.com>2016-01-06 17:25:55 +0100
committerStas Vilchik <vilchiks@gmail.com>2016-01-06 17:25:55 +0100
commitbd60854219d700011b9661727a6ff004b3c21ef0 (patch)
tree58e09f43fe80f3c1207aaf7328d6b449d7d0dc7e /server/sonar-web/src/main/js/libs
parent0ee46b37498ef58ebd1069eafe930ebac06be8a5 (diff)
downloadsonarqube-bd60854219d700011b9661727a6ff004b3c21ef0.tar.gz
sonarqube-bd60854219d700011b9661727a6ff004b3c21ef0.zip
improve code quality
Diffstat (limited to 'server/sonar-web/src/main/js/libs')
-rw-r--r--server/sonar-web/src/main/js/libs/application.js56
1 files changed, 0 insertions, 56 deletions
diff --git a/server/sonar-web/src/main/js/libs/application.js b/server/sonar-web/src/main/js/libs/application.js
index 58905deff78..6abe69488e7 100644
--- a/server/sonar-web/src/main/js/libs/application.js
+++ b/server/sonar-web/src/main/js/libs/application.js
@@ -226,62 +226,6 @@ function closeModalWindow () {
/*
- * File Path
- */
-
-(function () {
- /**
- * Return a collapsed path without a file name
- * @example
- * // returns 'src/.../js/components/navigator/app/models/'
- * collapsedDirFromPath('src/main/js/components/navigator/app/models/state.js')
- * @param {string} path
- * @returns {string|null}
- */
- window.collapsedDirFromPath = function (path) {
- var limit = 30;
- if (typeof path === 'string') {
- var tokens = _.initial(path.split('/'));
- if (tokens.length > 2) {
- var head = _.first(tokens),
- tail = _.last(tokens),
- middle = _.initial(_.rest(tokens)),
- cut = false;
- while (middle.join().length > limit && middle.length > 0) {
- middle.shift();
- cut = true;
- }
- var body = [].concat(head, cut ? ['...'] : [], middle, tail);
- return body.join('/') + '/';
- } else {
- return tokens.join('/') + '/';
- }
- } else {
- return null;
- }
- };
-
- /**
- * Return a file name for a given file path
- * * @example
- * // returns 'state.js'
- * collapsedDirFromPath('src/main/js/components/navigator/app/models/state.js')
- * @param {string} path
- * @returns {string|null}
- */
- window.fileFromPath = function (path) {
- if (typeof path === 'string') {
- var tokens = path.split('/');
- return _.last(tokens);
- } else {
- return null;
- }
- };
-})();
-
-
-
-/*
* Users
*/