Merge remote-tracking branch 'origin/master'
This commit is contained in:
commit
c1f3ce8c5d
104
js/export.js
104
js/export.js
@ -4,11 +4,11 @@
|
||||
*
|
||||
*/
|
||||
|
||||
/**
|
||||
* Toggles the hiding and showing of each plugin's options
|
||||
* according to the currently selected plugin from the dropdown list
|
||||
*/
|
||||
$(document).ready(function() {
|
||||
/**
|
||||
* Toggles the hiding and showing of each plugin's options
|
||||
* according to the currently selected plugin from the dropdown list
|
||||
*/
|
||||
$(document).ready(function() {
|
||||
$("#plugins").change(function() {
|
||||
$(".format_specific_options").each(function() {
|
||||
$(this).hide();
|
||||
@ -22,24 +22,23 @@
|
||||
* Toggles the enabling and disabling of the SQL plugin's comment options that apply only when exporting structure
|
||||
*/
|
||||
$(document).ready(function() {
|
||||
$("input[type='radio'][name$='sql_structure_or_data']").change(function() {
|
||||
var show = $("input[type='radio'][name$='sql_structure_or_data']:checked").val();
|
||||
if(show == 'data') {
|
||||
$("input[type='radio'][name='sql_structure_or_data']").change(function() {
|
||||
var comments_are_present = $("#checkbox_sql_include_comments").prop("checked");
|
||||
var show = $("input[type='radio'][name='sql_structure_or_data']:checked").val();
|
||||
if (show == 'data') {
|
||||
// disable the SQL comment options
|
||||
$("#checkbox_sql_dates").parent().fadeTo('fast', 0.4);
|
||||
$("#checkbox_sql_dates").prop('disabled', true);
|
||||
$("#checkbox_sql_relation").parent().fadeTo('fast', 0.4);
|
||||
$("#checkbox_sql_relation").prop('disabled', true);
|
||||
$("#checkbox_sql_mime").parent().fadeTo('fast', 0.4);
|
||||
$("#checkbox_sql_mime").prop('disabled', true);
|
||||
if (comments_are_present) {
|
||||
$("#checkbox_sql_dates").prop('disabled', true).parent().fadeTo('fast', 0.4);
|
||||
}
|
||||
$("#checkbox_sql_relation").prop('disabled', true).parent().fadeTo('fast', 0.4);
|
||||
$("#checkbox_sql_mime").prop('disabled', true).parent().fadeTo('fast', 0.4);
|
||||
} else {
|
||||
// enable the SQL comment options
|
||||
$("#checkbox_sql_dates").parent().fadeTo('fast', 1);
|
||||
$("#checkbox_sql_dates").removeProp('disabled');
|
||||
$("#checkbox_sql_relation").parent().fadeTo('fast', 1);
|
||||
$("#checkbox_sql_relation").removeProp('disabled');
|
||||
$("#checkbox_sql_mime").parent().fadeTo('fast', 1);
|
||||
$("#checkbox_sql_mime").removeProp('disabled');
|
||||
if (comments_are_present) {
|
||||
$("#checkbox_sql_dates").removeProp('disabled').parent().fadeTo('fast', 1);
|
||||
}
|
||||
$("#checkbox_sql_relation").removeProp('disabled').parent().fadeTo('fast', 1);
|
||||
$("#checkbox_sql_mime").removeProp('disabled').parent().fadeTo('fast', 1);
|
||||
}
|
||||
});
|
||||
});
|
||||
@ -49,19 +48,18 @@ $(document).ready(function() {
|
||||
* Toggles the hiding and showing of plugin structure-specific and data-specific
|
||||
* options
|
||||
*/
|
||||
|
||||
function toggle_structure_data_opts(pluginName)
|
||||
{
|
||||
var radioFormName = pluginName + "_structure_or_data";
|
||||
var dataDiv = "#" + pluginName + "_data";
|
||||
var structureDiv = "#" + pluginName + "_structure";
|
||||
var show = $("input[type='radio'][name='" + radioFormName + "']:checked").val();
|
||||
if(show == 'data') {
|
||||
if (show == 'data') {
|
||||
$(dataDiv).slideDown('slow');
|
||||
$(structureDiv).slideUp('slow');
|
||||
} else {
|
||||
$(structureDiv).slideDown('slow');
|
||||
if(show == 'structure') {
|
||||
if (show == 'structure') {
|
||||
$(dataDiv).slideUp('slow');
|
||||
} else {
|
||||
$(dataDiv).slideDown('slow');
|
||||
@ -92,7 +90,7 @@ $(document).ready(function() {
|
||||
*/
|
||||
function toggle_save_to_file()
|
||||
{
|
||||
if($("#radio_dump_asfile:checked").length == 0) {
|
||||
if (!$("#radio_dump_asfile").prop("checked")) {
|
||||
$("#ul_save_asfile > li").fadeTo('fast', 0.4);
|
||||
$("#ul_save_asfile > li > input").prop('disabled', true);
|
||||
$("#ul_save_asfile > li> select").prop('disabled', true);
|
||||
@ -105,9 +103,7 @@ function toggle_save_to_file()
|
||||
|
||||
$(document).ready(function() {
|
||||
toggle_save_to_file();
|
||||
$("input[type='radio'][name='output_format']").change(function() {
|
||||
toggle_save_to_file();
|
||||
});
|
||||
$("input[type='radio'][name='output_format']").change(toggle_save_to_file);
|
||||
});
|
||||
|
||||
/**
|
||||
@ -116,20 +112,19 @@ $(document).ready(function() {
|
||||
function toggle_sql_include_comments()
|
||||
{
|
||||
$("#checkbox_sql_include_comments").change(function() {
|
||||
if($("#checkbox_sql_include_comments:checked").length == 0) {
|
||||
if (!$("#checkbox_sql_include_comments").prop("checked")) {
|
||||
$("#ul_include_comments > li").fadeTo('fast', 0.4);
|
||||
$("#ul_include_comments > li > input").prop('disabled', true);
|
||||
} else {
|
||||
} else {
|
||||
// If structure is not being exported, the comment options for structure should not be enabled
|
||||
if($("#radio_sql_structure_or_data_data:checked").length == 1) {
|
||||
$("#text_sql_header_comment").parent("li").fadeTo('fast', 1);
|
||||
$("#text_sql_header_comment").removeProp('disabled');
|
||||
if ($("#radio_sql_structure_or_data_data").prop("checked")) {
|
||||
$("#text_sql_header_comment").removeProp('disabled').parent("li").fadeTo('fast', 1);
|
||||
} else {
|
||||
$("#ul_include_comments > li").fadeTo('fast', 1);
|
||||
$("#ul_include_comments > li > input").removeProp('disabled');
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
@ -155,12 +150,10 @@ $(document).ready(function() {
|
||||
$("#plugins").change(function() {
|
||||
var active_plugin = $("#plugins option:selected").val();
|
||||
var force_file = $("#force_file_" + active_plugin).val();
|
||||
if(force_file == "true") {
|
||||
$("#radio_view_as_text").prop('disabled', true);
|
||||
$("#radio_view_as_text").parent().fadeTo('fast', 0.4);
|
||||
if (force_file == "true") {
|
||||
$("#radio_view_as_text").prop('disabled', true).parent().fadeTo('fast', 0.4);
|
||||
} else {
|
||||
$("#radio_view_as_text").removeProp('disabled');
|
||||
$("#radio_view_as_text").parent().fadeTo('fast', 1);
|
||||
$("#radio_view_as_text").removeProp('disabled').parent().fadeTo('fast', 1);
|
||||
}
|
||||
});
|
||||
});
|
||||
@ -170,7 +163,7 @@ $(document).ready(function() {
|
||||
*/
|
||||
function toggle_quick_or_custom()
|
||||
{
|
||||
if($("$(this):checked").val() == "custom") {
|
||||
if ($("#radio_custom_export").prop("checked")) {
|
||||
$("#databases_and_tables").show();
|
||||
$("#rows").show();
|
||||
$("#output").show();
|
||||
@ -188,43 +181,40 @@ function toggle_quick_or_custom()
|
||||
}
|
||||
|
||||
$(document).ready(function() {
|
||||
$("input[type='radio'][name='quick_or_custom']").change(function() {
|
||||
toggle_quick_or_custom();
|
||||
});
|
||||
$("input[type='radio'][name='quick_or_custom']").change(toggle_quick_or_custom);
|
||||
});
|
||||
|
||||
/**
|
||||
* Sets up the interface for Javascript-enabled browsers since the default is for
|
||||
* Javascript-disabled browsers
|
||||
*/
|
||||
$(document).ready(function() {
|
||||
if($("input[type='hidden'][name='export_method']").val() != "custom-no-form") {
|
||||
$(document).ready(function() {
|
||||
if ($("input[type='hidden'][name='export_method']").val() != "custom-no-form") {
|
||||
$("#quick_or_custom").show();
|
||||
}
|
||||
$("#scroll_to_options_msg").hide();
|
||||
$(".format_specific_options").hide();
|
||||
$(".format_specific_options").css({ "border": 0, "margin": 0, "padding": 0});
|
||||
$(".format_specific_options").hide().css({"border": 0, "margin": 0, "padding": 0});
|
||||
$(".format_specific_options h3").remove();
|
||||
toggle_quick_or_custom();
|
||||
toggle_structure_data_opts($("select[id='plugins']").val());
|
||||
toggle_structure_data_opts($("select#plugins").val());
|
||||
toggle_sql_include_comments();
|
||||
});
|
||||
|
||||
/**
|
||||
* Disables the "Dump some row(s)" sub-options when it is not selected
|
||||
*/
|
||||
$(document).ready(function() {
|
||||
$("input[type='radio'][name='allrows']").change(function() {
|
||||
if($("input[type='radio'][name='allrows']:checked").val() == "1") {
|
||||
$(document).ready(function() {
|
||||
$("input[type='radio'][name='allrows']").change(function() {
|
||||
if ($("input[type='radio'][name='allrows']").prop("checked")) {
|
||||
$("label[for='limit_to']").fadeTo('fast', 0.4);
|
||||
$("label[for='limit_from']").fadeTo('fast', 0.4);
|
||||
$("input[type='text'][name='limit_to']").prop('disabled', true);
|
||||
$("input[type='text'][name='limit_from']").prop('disabled', true);
|
||||
} else {
|
||||
$("label[for='limit_from']").fadeTo('fast', 0.4);
|
||||
$("input[type='text'][name='limit_to']").prop('disabled', true);
|
||||
$("input[type='text'][name='limit_from']").prop('disabled', true);
|
||||
} else {
|
||||
$("label[for='limit_to']").fadeTo('fast', 1);
|
||||
$("label[for='limit_from']").fadeTo('fast', 1);
|
||||
$("input[type='text'][name='limit_to']").removeProp('disabled');
|
||||
$("input[type='text'][name='limit_from']").removeProp('disabled');
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
@ -51,16 +51,19 @@ function makeRequest(url, parameters)
|
||||
*/
|
||||
function alertContents()
|
||||
{
|
||||
var layer = document.getElementById("layer_action");
|
||||
|
||||
if (http_request.readyState == 1) {
|
||||
document.getElementById("layer_action").style.left = (document.body.clientWidth + document.body.scrollLeft - 85) + 'px';
|
||||
document.getElementById("layer_action").style.top = (document.body.scrollTop + 10) + 'px';
|
||||
document.getElementById("layer_action").style.visibility = 'visible'; document.getElementById("layer_action").innerHTML = 'Loading...';
|
||||
layer.style.left = (document.body.clientWidth + document.body.scrollLeft - 85) + 'px';
|
||||
layer.style.top = (document.body.scrollTop + 10) + 'px';
|
||||
layer.style.visibility = 'visible';
|
||||
layer.innerHTML = 'Loading...';
|
||||
}
|
||||
if (http_request.readyState == 2) {
|
||||
document.getElementById("layer_action").innerHTML = 'Loaded';
|
||||
layer.innerHTML = 'Loaded';
|
||||
}
|
||||
if (http_request.readyState == 3) {
|
||||
document.getElementById("layer_action").innerHTML = 'Loading 99%';
|
||||
layer.innerHTML = 'Loading 99%';
|
||||
}
|
||||
if (http_request.readyState == 4) {
|
||||
if (http_request.status == 200) {
|
||||
@ -68,7 +71,7 @@ function alertContents()
|
||||
//alert(textdoc);
|
||||
xmldoc = http_request.responseXML;
|
||||
PrintXML();
|
||||
//document.getElementById("layer_action").style.visibility = 'hidden';
|
||||
//layer.style.visibility = 'hidden';
|
||||
} else {
|
||||
alert('There was a problem with the request.');
|
||||
}
|
||||
@ -77,10 +80,14 @@ function alertContents()
|
||||
|
||||
function layer_alert(text)
|
||||
{
|
||||
document.getElementById("layer_action").innerHTML = text;
|
||||
document.getElementById("layer_action").style.left = (document.body.clientWidth + document.body.scrollLeft - 20 - document.getElementById("layer_action").offsetWidth) + 'px';
|
||||
document.getElementById("layer_action").style.visibility = 'visible';
|
||||
setTimeout(function(){document.getElementById("layer_action").style.visibility = 'hidden';}, 2000);
|
||||
var layer = document.getElementById("layer_action");
|
||||
|
||||
layer.innerHTML = text;
|
||||
layer.style.left = (document.body.clientWidth + document.body.scrollLeft - 20 - layer.offsetWidth) + 'px';
|
||||
layer.style.visibility = 'visible';
|
||||
setTimeout(function () {
|
||||
layer.style.visibility = 'hidden';
|
||||
}, 2000);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -92,7 +99,7 @@ function PrintXML()
|
||||
//alert(xmldoc.getElementsByTagName('root').item(1));
|
||||
if (root == null) {
|
||||
// if error
|
||||
myWin=window.open('','Report','width=400, height=250, resizable=1, scrollbars=1, status=1');
|
||||
var myWin=window.open('','Report','width=400, height=250, resizable=1, scrollbars=1, status=1');
|
||||
var tmp = myWin.document;
|
||||
tmp.write(textdoc);
|
||||
tmp.close();
|
||||
@ -115,15 +122,15 @@ function PrintXML()
|
||||
if (root.getAttribute('act') == 'relation_new') {
|
||||
layer_alert(root.getAttribute('return'));
|
||||
if (root.getAttribute('b') == '1') {
|
||||
var i = contr.length;
|
||||
var i = contr.length;
|
||||
var t1 = root.getAttribute('DB1') + '.' + root.getAttribute('T1');
|
||||
var f1 = root.getAttribute('F1');
|
||||
var t2 = root.getAttribute('DB2') + '.' + root.getAttribute('T2');
|
||||
var f2 = root.getAttribute('F2');
|
||||
contr[i] = new Array();
|
||||
contr[i][''] = new Array();
|
||||
contr[i][''][t2] = new Array();
|
||||
contr[i][''][t2][f2] = new Array();
|
||||
contr[i] = [];
|
||||
contr[i][''] = [];
|
||||
contr[i][''][t2] = [];
|
||||
contr[i][''][t2][f2] = [];
|
||||
contr[i][''][t2][f2][0] = t1;
|
||||
contr[i][''][t2][f2][1] = f1;
|
||||
Re_load();
|
||||
|
||||
@ -1,10 +1,10 @@
|
||||
var chart_xaxis_idx = -1;
|
||||
var chart_series;
|
||||
var chart_series_index = -1;
|
||||
var chart_data;
|
||||
|
||||
$(document).ready(function() {
|
||||
var currentChart = null;
|
||||
var chart_data = jQuery.parseJSON($('#querychart').html());
|
||||
chart_series = 'columns';
|
||||
chart_xaxis_idx = $('select[name="chartXAxis"]').val();
|
||||
|
||||
@ -45,7 +45,6 @@ $(document).ready(function() {
|
||||
}
|
||||
};
|
||||
|
||||
$('#querychart').html('');
|
||||
|
||||
$('input[name="chartType"]').click(function() {
|
||||
currentSettings.chart.type = $(this).val();
|
||||
|
||||
@ -65,7 +65,7 @@ foreach ($GLOBALS['js_include'] as $js_script_file) {
|
||||
// <![CDATA[
|
||||
if (typeof(parent.document) != 'undefined' && typeof(parent.document) != 'unknown'
|
||||
&& typeof(parent.document.title) == 'string') {
|
||||
parent.document.title = '<?php echo (isset($title) ? PMA_sanitize(PMA_escapeJsString(htmlspecialchars($title))) : ''); ?>';
|
||||
parent.document.title = '<?php echo (isset($title) ? PMA_sanitize(PMA_escapeJsString($title), false, true) : ''); ?>';
|
||||
}
|
||||
<?php
|
||||
if (count($GLOBALS['js_script']) > 0) {
|
||||
|
||||
@ -819,10 +819,10 @@ if (! empty($_REQUEST['query'])) {
|
||||
echo '<div id="filter"></div>';
|
||||
echo '<div id="box">';
|
||||
echo '<span id="boxtitle"></span>';
|
||||
echo '<form method="post" action="db_qbe.php" >';
|
||||
echo '<form method="post" action="db_qbe.php">';
|
||||
echo '<textarea cols="80" name="sql_query" id="textSqlquery" rows="15"></textarea><div id="tblfooter">';
|
||||
echo ' <input type="submit" name="submit_sql" class="btn">';
|
||||
echo ' <input type="button" name="cancel" value="' . __('Cancel') . '" onclick="closebox()" class="btn">';
|
||||
echo ' <input type="submit" name="submit_sql" class="btn" />';
|
||||
echo ' <input type="button" name="cancel" value="' . __('Cancel') . '" onclick="closebox()" class="btn" />';
|
||||
echo PMA_generate_common_hidden_inputs($GLOBALS['db']);
|
||||
echo '</div></p>';
|
||||
echo '</form></div>';
|
||||
|
||||
@ -104,7 +104,7 @@ url_query = '<?php echo $url_query;?>';
|
||||
|
||||
foreach ($keys as $idx => $key) {
|
||||
if ($yaxis == -1 && (($idx == count($data[0]) - 1) || preg_match("/(date|time)/i", $key))) {
|
||||
echo '<option value="' . htmlspecialchars($idx) . '" selected>' . htmlspecialchars($key) . '</option>';
|
||||
echo '<option value="' . htmlspecialchars($idx) . '" selected="selected">' . htmlspecialchars($key) . '</option>';
|
||||
$yaxis=$idx;
|
||||
} else {
|
||||
echo '<option value="' . htmlspecialchars($idx) . '">' . htmlspecialchars($key) . '</option>';
|
||||
@ -137,25 +137,17 @@ url_query = '<?php echo $url_query;?>';
|
||||
<p style="clear:both;"> </p>
|
||||
<div id="resizer" style="width:600px; height:400px;">
|
||||
<div id="inner-resizer">
|
||||
<div id="querychart" style="display:none;">
|
||||
<?php
|
||||
$sanitized_data = array();
|
||||
foreach ($data as $data_row_number => $data_row) {
|
||||
$tmp_row = array();
|
||||
foreach ($data_row as $data_column => $data_value) {
|
||||
$tmp_row[htmlspecialchars($data_column)] = htmlspecialchars($data_value);
|
||||
}
|
||||
$sanitized_data[] = $tmp_row;
|
||||
}
|
||||
echo json_encode($sanitized_data);
|
||||
unset($sanitized_data);
|
||||
?>
|
||||
</div>
|
||||
<div id="querychart" style="display:none;"></div>
|
||||
</div>
|
||||
</div>
|
||||
</fieldset>
|
||||
</form>
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
//<![CDATA[
|
||||
chart_data = <?php echo strtr(json_encode($data), array('<' => '<', '>' => '>')); ?>;
|
||||
//]]>
|
||||
</script>
|
||||
<?php
|
||||
/**
|
||||
* Displays the footer
|
||||
|
||||
Loading…
Reference in New Issue
Block a user