Merge remote-tracking branch 'origin/master'

This commit is contained in:
Pootle server
2011-05-05 10:40:18 +02:00
10 changed files with 168 additions and 72 deletions

View File

@@ -1118,25 +1118,32 @@ function changeMIMEType(db, table, reference, mime_type)
* Jquery Coding for inline editing SQL_QUERY
*/
$(document).ready(function(){
var oldText,db,table,token,sql_query;
oldText=$(".inner_sql").html();
$("#inline_edit").live('click',function(){
db=$("input[name='db']").val();
table=$("input[name='table']").val();
token=$("input[name='token']").val();
sql_query=$("input[name='sql_query']").val();
$(".inner_sql").replaceWith("<textarea name=\"sql_query_edit\" id=\"sql_query_edit\">"+ sql_query +"</textarea><input type=\"button\" id=\"btnSave\" value=\"" + PMA_messages['strGo'] + "\"><input type=\"button\" id=\"btnDiscard\" value=\"" + PMA_messages['strCancel'] + "\">");
$(".inline_edit").click( function(){
var db = $(this).prev().find("input[name='db']").val();
var table = $(this).prev().find("input[name='table']").val();
var token = $(this).prev().find("input[name='token']").val();
var sql_query = $(this).prev().find("input[name='sql_query']").val();
var $inner_sql = $(this).parent().prev().find('.inner_sql');
var old_text = $inner_sql.html();
var new_content = "<textarea name=\"sql_query_edit\" id=\"sql_query_edit\">" + sql_query + "</textarea>\n";
new_content += "<input type=\"button\" class=\"btnSave\" value=\"" + PMA_messages['strGo'] + "\">\n";
new_content += "<input type=\"button\" class=\"btnDiscard\" value=\"" + PMA_messages['strCancel'] + "\">\n";
$inner_sql.replaceWith(new_content);
$(".btnSave").each(function(){
$(this).click(function(){
sql_query = $(this).prev().val();
window.location.replace("import.php?db=" + db +"&table=" + table + "&sql_query=" + sql_query + "&show_query=1&token=" + token);
});
});
$(".btnDiscard").each(function(){
$(this).click(function(){
$(this).closest(".sql").html("<span class=\"syntax\"><span class=\"inner_sql\">" + old_text + "</span></span>");
});
});
return false;
});
$("#btnSave").live("click",function(){
window.location.replace("import.php?db=" + db +"&table=" + table + "&sql_query=" + $("#sql_query_edit").val()+"&show_query=1&token=" + token + "");
});
$("#btnDiscard").live("click",function(){
$(".sql").html("<span class=\"syntax\"><span class=\"inner_sql\">" + oldText + "</span></span>");
});
$('.sqlbutton').click(function(evt){
insertQuery(evt.target.id);
return false;

View File

@@ -69,21 +69,9 @@ abstract class PMA_pChart_chart extends PMA_chart
// as in CSS (top, right, bottom, left)
$this->setAreaMargins(array(20, 20, 40, 60));
// when graph area gradient is used, this is the color of the graph
// area border
$this->settings['graphAreaColor'] = '#D5D9DD';
// the background color of the graph area
$this->settings['graphAreaGradientColor'] = '#A3CBA7';
// the color of the grid lines in the graph area
$this->settings['gridColor'] = '#E6E6E6';
// the color of the scale and the labels
$this->settings['scaleColor'] = '#D5D9DD';
$this->settings['titleBgColor'] = '#000000';
// Get color settings from theme
$this->settings = array_merge($this->settings,$GLOBALS['cfg']['chartColor']);
}
protected function init()
@@ -149,8 +137,11 @@ abstract class PMA_pChart_chart extends PMA_chart
$this->getBgColor(RED),
$this->getBgColor(GREEN),
$this->getBgColor(BLUE),
50,TARGET_BACKGROUND);
$this->chart->addBorder(2);
// With a gradientIntensity of 0 the background does't draw, oddly
($this->settings['gradientIntensity']==0)?1:$this->settings['gradientIntensity'],TARGET_BACKGROUND);
if(is_string($this->settings['border']))
$this->chart->addBorder(1,$this->getBorderColor(RED),$this->getBorderColor(GREEN),$this->getBorderColor(BLUE));
}
/**
@@ -170,11 +161,10 @@ abstract class PMA_pChart_chart extends PMA_chart
$this->getTitleColor(GREEN),
$this->getTitleColor(BLUE),
ALIGN_CENTER,
True,
false,
$this->getTitleBgColor(RED),
$this->getTitleBgColor(GREEN),
$this->getTitleBgColor(BLUE),
30
$this->getTitleBgColor(BLUE)
);
}
@@ -211,12 +201,21 @@ abstract class PMA_pChart_chart extends PMA_chart
$this->getScaleColor(BLUE),
TRUE,0,2,TRUE
);
$this->chart->drawGraphAreaGradient(
$this->getGraphAreaGradientColor(RED),
$this->getGraphAreaGradientColor(GREEN),
$this->getGraphAreaGradientColor(BLUE),
50
);
if($this->settings['gradientIntensity']>0)
$this->chart->drawGraphAreaGradient(
$this->getGraphAreaGradientColor(RED),
$this->getGraphAreaGradientColor(GREEN),
$this->getGraphAreaGradientColor(BLUE),
$this->settings['gradientIntensity']
);
else
$this->chart->drawGraphArea(
$this->getGraphAreaGradientColor(RED),
$this->getGraphAreaGradientColor(GREEN),
$this->getGraphAreaGradientColor(BLUE)
);
$this->chart->drawGrid(
4,
TRUE,
@@ -393,6 +392,11 @@ abstract class PMA_pChart_chart extends PMA_chart
{
return $this->hexStrToDecComp($this->settings['titleBgColor'], $component);
}
protected function getBorderColor($component)
{
return $this->hexStrToDecComp($this->settings['border'], $component);
}
}
?>

View File

@@ -57,12 +57,20 @@ class PMA_pChart_multi_radar extends PMA_pChart_multi
$this->getGraphAreaColor(BLUE),
FALSE
);
$this->chart->drawGraphAreaGradient(
$this->getGraphAreaGradientColor(RED),
$this->getGraphAreaGradientColor(GREEN),
$this->getGraphAreaGradientColor(BLUE),
50
);
if($this->settings['gradientIntensity']>0)
$this->chart->drawGraphAreaGradient(
$this->getGraphAreaGradientColor(RED),
$this->getGraphAreaGradientColor(GREEN),
$this->getGraphAreaGradientColor(BLUE),
$this->settings['gradientIntensity']
);
else
$this->chart->drawGraphArea(
$this->getGraphAreaGradientColor(RED),
$this->getGraphAreaGradientColor(GREEN),
$this->getGraphAreaGradientColor(BLUE)
);
}
/**

View File

@@ -47,12 +47,21 @@ class PMA_pChart_Pie extends PMA_pChart_multi
$this->getGraphAreaColor(BLUE),
FALSE
);
$this->chart->drawGraphAreaGradient(
$this->getGraphAreaGradientColor(RED),
$this->getGraphAreaGradientColor(GREEN),
$this->getGraphAreaGradientColor(BLUE),
50
);
if($this->settings['gradientIntensity']>0)
$this->chart->drawGraphAreaGradient(
$this->getGraphAreaGradientColor(RED),
$this->getGraphAreaGradientColor(GREEN),
$this->getGraphAreaGradientColor(BLUE),
$this->settings['gradientIntensity']
);
else
$this->chart->drawGraphArea(
$this->getGraphAreaGradientColor(RED),
$this->getGraphAreaGradientColor(GREEN),
$this->getGraphAreaGradientColor(BLUE)
);
}
/**

View File

@@ -48,12 +48,21 @@ class PMA_pChart_single_radar extends PMA_pChart_single
$this->getGraphAreaColor(BLUE),
FALSE
);
$this->chart->drawGraphAreaGradient(
$this->getGraphAreaGradientColor(RED),
$this->getGraphAreaGradientColor(GREEN),
$this->getGraphAreaGradientColor(BLUE),
50
);
if($this->settings['gradientIntensity']>0)
$this->chart->drawGraphAreaGradient(
$this->getGraphAreaGradientColor(RED),
$this->getGraphAreaGradientColor(GREEN),
$this->getGraphAreaGradientColor(BLUE),
$this->settings['gradientIntensity']
);
else
$this->chart->drawGraphArea(
$this->getGraphAreaGradientColor(RED),
$this->getGraphAreaGradientColor(GREEN),
$this->getGraphAreaGradientColor(BLUE)
);
}
/**

View File

@@ -1261,9 +1261,9 @@ function PMA_showMessage($message, $sql_query = null, $type = 'notice', $is_view
// document.write conflicts with jQuery, hence used $().append()
echo "<script type=\"text/javascript\">\n" .
"//<![CDATA[\n" .
"$('.tools form').after('[<a href=\"#\" title=\"" .
"$('.tools form').last().after('[<a href=\"#\" title=\"" .
PMA_escapeJsString(__('Inline edit of this query')) .
"\" id=\"inline_edit\">" .
"\" class=\"inline_edit\">" .
PMA_escapeJsString(__('Inline')) .
"</a>]');\n" .
"//]]>\n" .

View File

@@ -339,6 +339,11 @@ function PMA_langList()
/* We can always speak English */
$result = array('en' => PMA_langDetails('en'));
/* Check for existing directory */
if (!is_dir($GLOBALS['lang_path'])) {
return $result;
}
/* Open the directory */
$handle = @opendir($GLOBALS['lang_path']);
/* This can happen if the kit is English-only */

View File

@@ -13,20 +13,21 @@ THRESHOLD=50
#
# Generated output file
#
TMPOUTPUTFILE=libraries/language_stats.inc.php.tmp
OUTPUTFILE=libraries/language_stats.inc.php
if [ ! -z "$1" ] ; then
THRESHOLD=$1
fi
echo '<?php' > $OUTPUTFILE
echo '/* Automatically generated file, do not edit! */' >> $OUTPUTFILE
echo '/* Generated by scripts/remove-incomplete-mo */' >> $OUTPUTFILE
echo '' >> $OUTPUTFILE
echo '$GLOBALS["language_stats"] = array (' >> $OUTPUTFILE
echo '<?php' > $TMPOUTPUTFILE
echo '/* Automatically generated file, do not edit! */' >> $TMPOUTPUTFILE
echo '/* Generated by scripts/remove-incomplete-mo */' >> $TMPOUTPUTFILE
echo '' >> $TMPOUTPUTFILE
echo '$GLOBALS["language_stats"] = array (' >> $TMPOUTPUTFILE
check() {
OUTPUTFILE=$2
TMPOUTPUTFILE=$2
lang=`echo $1 | sed 's@po/\(.*\)\.po@\1@'`
STATS=`LC_ALL=C msgfmt --statistics -o /dev/null $1 2>&1`
if echo $STATS | grep -q ' translated ' ; then
@@ -45,7 +46,7 @@ check() {
UNTRANSLATED=0
fi
PERCENT=`expr 100 \* $TRANSLATED / \( $TRANSLATED + $FUZZY + $UNTRANSLATED \) || true`
echo " '$lang' => $PERCENT," >> $OUTPUTFILE
echo " '$lang' => $PERCENT," >> $TMPOUTPUTFILE
if [ $PERCENT -lt $THRESHOLD ] ; then
echo "Removing $lang, only $PERCENT%"
@@ -54,8 +55,10 @@ check() {
}
for x in po/*.po ; do
check $x $OUTPUTFILE
check $x $TMPOUTPUTFILE
done
echo ');' >> $OUTPUTFILE
echo '?>' >> $OUTPUTFILE
echo ');' >> $TMPOUTPUTFILE
echo '?>' >> $TMPOUTPUTFILE
mv $TMPOUTPUTFILE $OUTPUTFILE

View File

@@ -110,4 +110,29 @@ $GLOBALS['cfg']['SQP']['fmtColor'] = array(
'quote_single' => '',
'quote_backtick' => ''
);
/**
* Chart colors
*/
$GLOBALS['cfg']['chartColor'] = array(
'gradientIntensity' => 0,
// The style of the chart title.
'titleColor' => '#000000',
'titleBgColor' => $GLOBALS['cfg']['ThBackground'],
// Chart border (0 for no border)
'border' => '#CCCCCC',
// Chart background color.
'bgColor' => $GLOBALS['cfg']['BgTwo'],
// when graph area gradient is used, this is the color of the graph
// area border
'graphAreaColor' => '#D5D9DD',
// the background color of the inner graph area
'graphAreaGradientColor' => $GLOBALS['cfg']['BgOne'],
// the color of the grid lines in the graph area
'gridColor' => '#E6E6E6',
// the color of the scale and the labels
'scaleColor' => '#D5D9DD',
);
?>

View File

@@ -112,4 +112,30 @@ $GLOBALS['cfg']['SQP']['fmtColor'] = array(
'quote_single' => '',
'quote_backtick' => ''
);
/**
* Chart colors
*/
$GLOBALS['cfg']['chartColor'] = array(
'gradientIntensity' => 50,
// The style of the chart title.
'titleColor' => '#000000',
'titleBgColor' => '#E5E5E5',
// Chart border (0 for no border)
'border' => '#CCCCCC',
// Chart background color.
'bgColor' => '#FBFBFB',
// when graph area gradient is used, this is the color of the graph
// area border
'graphAreaColor' => '#D5D9DD',
// the background color of the graph area
'graphAreaGradientColor' => $GLOBALS['cfg']['BgTwo'],
// the color of the grid lines in the graph area
'gridColor' => '#E6E6E6',
// the color of the scale and the labels
'scaleColor' => '#D5D9DD',
);
?>