Added JSDoc-Toolkit compatible documentation to js/db_structure.js

This commit is contained in:
ninadsp
2010-08-10 19:56:04 +05:30
parent 98d3916e91
commit eccad201bf

View File

@@ -1,16 +1,40 @@
/**
* jQuery code for 'Drop Database', 'Truncate Table', 'Drop Table' action on
* db_structure.php
* @fileoverview functions used on the database structure page
* @name Database Structure
*
* @requires jQuery
* @requires jQueryUI
* @required js/functions.js
*/
/**
* AJAX scripts for db_structure.php
*
* Actions ajaxified here:
* Drop Database
* Truncate Table
* Drop Table
*
*/
$(document).ready(function() {
//Truncate Table
/**
* Ajax Event handler for 'Truncate Table'
*
* @uses $.PMA_confirm()
* @uses PMA_ajaxShowMessage()
*/
$(".truncate_table_anchor").live('click', function(event) {
event.preventDefault();
//extract current table name and build the question string
/**
* @var curr_table_name String containing the name of the table to be truncated
*/
var curr_table_name = $(this).parents('tr').children('th').children('a').text();
/**
* @var question String containing the question to be asked for confirmation
*/
var question = 'TRUNCATE ' + curr_table_name;
$(this).PMA_confirm(question, $(this).attr('href'), function(url) {
@@ -26,17 +50,31 @@ $(document).ready(function() {
else {
PMA_ajaxShowMessage(PMA_messages['strErrorProcessingRequest'] + " : " + data.error);
}
})
})
}) // end $.get()
}) //end $.PMA_confirm()
}); //end of Truncate Table Ajax action
//Drop Table
/**
* Ajax Event handler for 'Drop Table'
*
* @uses $.PMA_confirm()
* @uses PMA_ajaxShowMessage()
*/
$(".drop_table_anchor").live('click', function(event) {
event.preventDefault();
//extract current table name and build the question string
/**
* @var curr_row Object containing reference to the current row
*/
var curr_row = $(this).parents('tr');
/**
* @var curr_table_name String containing the name of the table to be truncated
*/
var curr_table_name = $(curr_row).children('th').children('a').text();
/**
* @var question String containing the question to be asked for confirmation
*/
var question = 'DROP TABLE ' + curr_table_name;
$(this).PMA_confirm(question, $(this).attr('href'), function(url) {
@@ -52,17 +90,35 @@ $(document).ready(function() {
else {
PMA_ajaxShowMessage(PMA_messages['strErrorProcessingRequest'] + " : " + data.error);
}
});
});
}); // end $.get()
}); // end $.PMA_confirm()
}); //end of Drop Table Ajax action
//Drop Column
/**
* Attach Event Handler for 'Drop Column'
*
* @uses $.PMA_confirm()
* @uses PMA_ajaxShowMessage()
*/
$(".drop_column_anchor").live('click', function(event) {
event.preventDefault();
/**
* @var curr_table_name String containing the name of the current table
*/
var curr_table_name = window.parent.table;
/**
* @var curr_row Object reference to the currently selected row (i.e. field in the table)
*/
var curr_row = $(this).parents('tr');
/**
* @var curr_column_name String containing name of the field referred to by {@link curr_row}
*/
var curr_column_name = $(curr_row).children('th').children('label').text();
/**
* @var question String containing the question to be asked for confirmation
*/
var question = PMA_messages['strDoYouReally'] + ' :\n ALTER TABLE `' + curr_table_name + '` DROP `' + curr_column_name + '`';
$(this).PMA_confirm(question, $(this).attr('href'), function(url) {
@@ -77,16 +133,31 @@ $(document).ready(function() {
else {
PMA_ajaxShowMessage(PMA_messages['strErrorProcessingRequest'] + " : " + data.error);
}
})
}) // end $.get()
}); // end $.PMA_confirm()
}) ; //end of Drop Column Anchor action
})
//Add Primary Key
/**
* Ajax Event handler for 'Add Primary Key'
*
* @uses $.PMA_confirm()
* @uses PMA_ajaxShowMessage()
*/
$(".add_primary_key_anchor").live('click', function(event) {
event.preventDefault();
/**
* @var curr_table_name String containing the name of the current table
*/
var curr_table_name = window.parent.table;
/**
* @var curr_column_name String containing name of the field referred to by {@link curr_row}
*/
var curr_column_name = $(this).parents('tr').children('th').children('label').text();
/**
* @var question String containing the question to be asked for confirmation
*/
var question = PMA_messages['strDoYouReally'] + ' :\n ALTER TABLE `' + curr_table_name + '` ADD PRIMARY KEY(`' + curr_column_name + '`)';
$(this).PMA_confirm(question, $(this).attr('href'), function(url) {
@@ -101,16 +172,30 @@ $(document).ready(function() {
else {
PMA_ajaxShowMessage(PMA_messages['strErrorProcessingRequest'] + " : " + data.error);
}
})
})
}) // end $.get()
}) // end $.PMA_confirm()
})//end Add Primary Key
//Drop Event
/**
* Ajax Event handler for 'Drop Event'
*
* @uses $.PMA_confirm()
* @uses PMA_ajaxShowMessage()
*/
$('.drop_event_anchor').live('click', function(event) {
event.preventDefault();
/**
* @var curr_event_row Object reference to current event's row
*/
var curr_event_row = $(this).parents('tr');
/**
* @var curr_event_name String containing the name of {@link curr_event_row}
*/
var curr_event_name = $(curr_event_row).children('td:first').text();
/**
* @var question String containing the question to be asked for confirmation
*/
var question = 'DROP EVENT ' + curr_event_name;
$(this).PMA_confirm(question, $(this).attr('href') , function(url) {
@@ -125,16 +210,26 @@ $(document).ready(function() {
else {
PMA_ajaxShowMessage(PMA_messages['strErrorProcessingRequest'] + " : " + data.error);
}
})
})
})
//end Drop Event
}) // end $.get()
}) // end $.PMA_confirm()
}) //end Drop Event
//Drop Procedure
/**
* Ajax Event handler for 'Drop Procedure'
*
* @uses $.PMA_confirm()
* @uses PMA_ajaxShowMessage()
*/
$('.drop_procedure_anchor').live('click', function(event) {
event.preventDefault();
/**
* @var curr_proc_row Object containing reference to the current procedure's row
*/
var curr_proc_row = $(this).parents('tr');
/**
* @var question String containing the question to be asked for confirmation
*/
var question = $(curr_proc_row).children('.drop_procedure_sql').val();
$(this).PMA_confirm(question, $(this).attr('href'), function(url) {
@@ -149,16 +244,21 @@ $(document).ready(function() {
else {
PMA_ajaxShowMessage(PMA_messages['strErrorProcessingRequest'] + " : " + data.error);
}
})
})
})
//end Drop Procedure
}) // end $.get()
}) // end $.PMA_confirm()
}) //end Drop Procedure
//Drop Tracking
$('.drop_tracking_anchor').live('click', function(event) {
event.preventDefault();
/**
* @var curr_tracking_row Object containing reference to the current tracked table's row
*/
var curr_tracking_row = $(this).parents('tr');
/**
* @var question String containing the question to be asked for confirmation
*/
var question = PMA_messages['strDeleteTrackingData'];
$(this).PMA_confirm(question, $(this).attr('href'), function(url) {
@@ -173,16 +273,24 @@ $(document).ready(function() {
else {
PMA_ajaxShowMessage(PMA_messages['strErrorProcessingRequest'] + " : " + data.error);
}
})
})
})
//end Drop Tracking
}) // end $.get()
}) // end $.PMA_confirm()
}) //end Drop Tracking
//Drop Primary Key/Index
/**
* Ajax Event handler for 'Drop Primary Key/Index'
*
* @uses $.PMA_confirm()
* @uses PMA_ajaxShowMessage()
*/
$('.drop_primary_key_index_anchor').live('click', function(event) {
event.preventDefault();
/**
* @var curr_row Object containing reference to the current field's row
*/
var curr_row = $(this).parents('tr');
var question = $(curr_row).children('.drop_primary_key_index_msg').val();
$(this).PMA_confirm(question, $(this).attr('href'), function(url) {
@@ -197,22 +305,28 @@ $(document).ready(function() {
else {
PMA_ajaxShowMessage(PMA_messages['strErrorProcessingRequest'] + " : " + data.error);
}
})
})
})
//end Drop Primary Key/Index
}) // end $.get()
}) // end $.PMA_confirm()
}) //end Drop Primary Key/Index
//Calculate Real End for InnoDB
/**
* Ajax Event handler for calculatig the real end for a InnoDB table
*
* @uses $.PMA_confirm
*/
$('#real_end_input').live('click', function(event) {
event.preventDefault();
/**
* @var question String containing the question to be asked for confirmation
*/
var question = PMA_messages['strOperationTakesLongTime'];
$(this).PMA_confirm(question, '', function() {
return true;
})
return false;
})
//end Calculate Real End for InnoDB
}) //end Calculate Real End for InnoDB
}, 'top.frame_content');
}, 'top.frame_content'); // end $(document).ready()