From f954332dd4c5e0a06a2769012c0f21469957afbb Mon Sep 17 00:00:00 2001 From: Tony Partner Date: Mon, 30 Nov 2009 12:15:47 +0000 Subject: [PATCH] Fix issue 03896: Evaluation of migrating to jQuery progressbar Dev Apply jQuery UI to progress bar element Dev Call jQuery progressbar() function in makegraph() git-svn-id: file:///Users/Shitiz/Downloads/lssvn/source/limesurvey@8017 b72ed6b6-b9f8-46b5-92b4-906544132732 --- index.php | 32 +++++++++++++++++++++++++------- 1 file changed, 25 insertions(+), 7 deletions(-) diff --git a/index.php b/index.php index 957bf1613c2..9625c0dbd9e 100644 --- a/index.php +++ b/index.php @@ -856,18 +856,36 @@ function loadanswers() function makegraph($currentstep, $total) { global $thissurvey; - global $publicurl, $clang; + global $publicurl, $clang, $js_header_includes, $css_header_includes; + + $js_header_includes[] = '/scripts/jquery/jquery-ui.js'; + $css_header_includes[]= '/scripts/jquery/css/start/jquery-ui.css'; + $css_header_includes[]= '/scripts/jquery/css/start/lime-progress.css'; $shchart = "$publicurl/templates/".validate_templatedir($thissurvey['templatedir'])."/chart.jpg"; $size = intval(($currentstep-1)/$total*100); - $graph = '
+ + if ($size < 0.5) // Min value for progress bar - it looks dumb if 0 + { + $size = 0.5; + } + + $graph = ' + +
'.sprintf($clang->gT('You have completed %s%% of this survey'),$size).' - -
0%
-
'.sprintf($clang->gT('You have completed %s%% of this survey'),$size).'
-
100%
-
'; +
0%
+
+
100%
+
'; + return $graph; }