Added function to support toggling of structure/data for all plugins
This commit is contained in:
52
js/export.js
52
js/export.js
@@ -20,15 +20,12 @@
|
||||
});
|
||||
|
||||
/**
|
||||
* Toggles the hiding and showing of the SQL plugin's structure-specific and data-specific
|
||||
* options (TODO: expand to include other plugins).
|
||||
* 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$='structure_or_data']").change(function() {
|
||||
var show = $("input[type='radio'][name$='structure_or_data']:checked").attr("value");
|
||||
$("input[type='radio'][name$='sql_structure_or_data']").change(function() {
|
||||
var show = $("input[type='radio'][name$='sql_structure_or_data']:checked").attr("value");
|
||||
if(show == 'data') {
|
||||
$('#data').slideDown('slow');
|
||||
$('#structure').slideUp('slow');
|
||||
// disable the SQL comment options
|
||||
$("#checkbox_sql_dates").parent().fadeTo('fast', 0.4);
|
||||
$("#checkbox_sql_dates").attr('disabled', 'disabled');
|
||||
@@ -44,14 +41,47 @@ $(document).ready(function() {
|
||||
$("#checkbox_sql_relation").removeAttr('disabled');
|
||||
$("#checkbox_sql_mime").parent().fadeTo('fast', 1);
|
||||
$("#checkbox_sql_mime").removeAttr('disabled');
|
||||
if(show == 'structure') {
|
||||
$('#structure').slideDown('slow');
|
||||
$('#data').slideUp('slow');
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
/**
|
||||
* Toggles the hiding and showing of plugin structure-specific and data-specific
|
||||
* options
|
||||
*/
|
||||
$(document).ready(function() {
|
||||
function toggleStructureAndDataOpts(pluginName) {
|
||||
var radioFormName = pluginName + "_structure_or_data";
|
||||
var dataDiv = "#" + pluginName + "_data";
|
||||
var structureDiv = "#" + pluginName + "_structure";
|
||||
var show = $("input[type='radio'][name='" + radioFormName + "']:checked").attr("value");
|
||||
if(show == 'data') {
|
||||
$(dataDiv).slideDown('slow');
|
||||
$(structureDiv).slideUp('slow');
|
||||
} else {
|
||||
$('#structure').slideDown('slow');
|
||||
$('#data').slideDown('slow');
|
||||
$(structureDiv).slideDown('slow');
|
||||
if(show == 'structure') {
|
||||
$(dataDiv).slideUp('slow');
|
||||
} else {
|
||||
$(dataDiv).slideDown('slow');
|
||||
}
|
||||
}
|
||||
}
|
||||
$("input[type='radio'][name='latex_structure_or_data']").change(function() {
|
||||
toggleStructureAndDataOpts("latex");
|
||||
});
|
||||
$("input[type='radio'][name='odt_structure_or_data']").change(function() {
|
||||
toggleStructureAndDataOpts("odt");
|
||||
});
|
||||
$("input[type='radio'][name='texytext_structure_or_data']").change(function() {
|
||||
toggleStructureAndDataOpts("texytext");
|
||||
});
|
||||
$("input[type='radio'][name='htmlword_structure_or_data']").change(function() {
|
||||
toggleStructureAndDataOpts("htmlword");
|
||||
});
|
||||
$("input[type='radio'][name='sql_structure_or_data']").change(function() {
|
||||
toggleStructureAndDataOpts("sql");
|
||||
});
|
||||
});
|
||||
|
||||
|
Reference in New Issue
Block a user