You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@flink.apache.org by uc...@apache.org on 2014/11/11 11:56:41 UTC
incubator-flink git commit: [FLINK-983] Fix WebClient truncated
function names
Repository: incubator-flink
Updated Branches:
refs/heads/master c9cfe3ba9 -> 2f1176a78
[FLINK-983] Fix WebClient truncated function names
This closes #190.
Project: http://git-wip-us.apache.org/repos/asf/incubator-flink/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-flink/commit/2f1176a7
Tree: http://git-wip-us.apache.org/repos/asf/incubator-flink/tree/2f1176a7
Diff: http://git-wip-us.apache.org/repos/asf/incubator-flink/diff/2f1176a7
Branch: refs/heads/master
Commit: 2f1176a78e4198933fb1c2258f9df21dd38c41ef
Parents: c9cfe3b
Author: mingliang <qm...@gmail.com>
Authored: Sun Nov 9 15:50:26 2014 +0100
Committer: uce <uc...@apache.org>
Committed: Tue Nov 11 11:56:09 2014 +0100
----------------------------------------------------------------------
.../resources/web-docs/js/graphCreator.js | 20 +++++++++-----------
1 file changed, 9 insertions(+), 11 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-flink/blob/2f1176a7/flink-clients/resources/web-docs/js/graphCreator.js
----------------------------------------------------------------------
diff --git a/flink-clients/resources/web-docs/js/graphCreator.js b/flink-clients/resources/web-docs/js/graphCreator.js
index d46c856..bbd71b1 100644
--- a/flink-clients/resources/web-docs/js/graphCreator.js
+++ b/flink-clients/resources/web-docs/js/graphCreator.js
@@ -389,24 +389,22 @@ function tableRow(nameX, valueX) {
return htmlCode;
}
-//Shortens a string to be shorter than 30 letters.
-//If the string is an URL it shortens it in a way that "looks nice"
+//Split a string into multiple lines so that each line has less than 30 letters.
function shortenString(s) {
- var lastLength = s.length;
- do {
- lastLength = s.length;
- s = s.substring(s.indexOf("/")+1, s.length);
- } while (s.indexOf("/") != -1 && s.length > 30 && lastLength != s.length)
//make sure that name does not contain a < (because of html)
if (s.charAt(0) == "<") {
s = s.replace("<", "<");
s = s.replace(">", ">");
}
- if (s.length > 30) {
- s = "..." + s.substring(s.length-30, s.length);
+ sbr = ""
+ while (s.length > 30) {
+ sbr = sbr + s.substring(0, 30) + "<br>"
+ s = s.substring(30, s.length)
}
- return s;
+ sbr = sbr + s
+
+ return sbr;
}
//activates the zoom buttons
@@ -441,4 +439,4 @@ function activateZoomButtons() {
.attr("transform", "translate(" + v1 + ","+ v2 + ") scale(" + zoom.scale() + ")");
}
});
-}
\ No newline at end of file
+}