The branch, master has been updated via 1ec0b69e6bf3378188a051b45fb2c0e7ea93b990 (commit) from 6205d419b68d57105d985a4a5335498337f6ccf4 (commit)
- Log ----------------------------------------------------------------- commit 1ec0b69e6bf3378188a051b45fb2c0e7ea93b990 Author: Michal Čihař mcihar@suse.cz Date: Fri Aug 5 14:49:23 2011 +0200
Coding style, function definitions
-----------------------------------------------------------------------
Summary of changes: js/common.js | 33 ++++-- js/config.js | 48 ++++++--- js/db_search.js | 6 +- js/db_structure.js | 3 +- js/export.js | 24 +++-- js/functions.js | 108 +++++++++++++------- js/import.js | 14 ++- js/keyhandler.js | 3 +- js/navigation.js | 18 ++- js/replication.js | 19 ++-- js/server_privileges.js | 3 +- js/server_variables.js | 55 +++++----- js/sql.js | 21 +++-- js/tbl_change.js | 34 ++++--- js/tbl_chart.js | 98 +++++++++--------- js/tbl_gis_visualization.js | 9 +- js/tbl_relation.js | 5 +- js/tbl_structure.js | 11 +- js/update-location.js | 9 +- libraries/advisor.lib.php | 3 +- libraries/auth/cookie.auth.lib.php | 3 +- libraries/auth/signon.auth.lib.php | 3 +- libraries/build_html_for_db.lib.php | 6 +- libraries/charset_conversion.lib.php | 3 +- libraries/common.lib.php | 57 +++++++---- libraries/core.lib.php | 15 ++- libraries/database_interface.lib.php | 15 ++- libraries/dbi/mysql.dbi.lib.php | 11 ++- libraries/dbi/mysqli.dbi.lib.php | 8 +- libraries/display_export.lib.php | 6 +- libraries/display_import_ajax.lib.php | 26 +++-- libraries/display_select_lang.lib.php | 6 +- libraries/display_tbl.lib.php | 64 ++++++++---- libraries/header.inc.php | 3 +- libraries/iconv_wrapper.lib.php | 3 +- libraries/import.lib.php | 24 +++-- libraries/import/upload/apc.php | 3 +- libraries/import/upload/noplugin.php | 3 +- libraries/import/upload/uploadprogress.php | 3 +- libraries/js_escape.lib.php | 3 +- libraries/kanji-encoding.lib.php | 15 ++- libraries/logging.lib.php | 3 +- libraries/mime.lib.php | 3 +- libraries/mysql_charsets.lib.php | 12 ++- libraries/opendocument.lib.php | 3 +- libraries/relation.lib.php | 3 +- libraries/replication.inc.php | 21 +++-- libraries/replication_gui.lib.php | 15 ++- libraries/select_lang.lib.php | 6 +- libraries/server_synchronize.lib.php | 9 +- libraries/sql_query_form.lib.php | 3 +- libraries/sysinfo.lib.php | 41 ++++---- libraries/tbl_properties.inc.php | 3 +- libraries/transformations/TEMPLATE | 6 +- .../application_octetstream__download.inc.php | 6 +- .../application_octetstream__hex.inc.php | 6 +- libraries/transformations/global.inc.php | 9 +- .../transformations/image_jpeg__inline.inc.php | 6 +- libraries/transformations/image_jpeg__link.inc.php | 6 +- .../transformations/image_png__inline.inc.php | 6 +- .../transformations/text_plain__dateformat.inc.php | 6 +- .../transformations/text_plain__external.inc.php | 9 +- .../transformations/text_plain__formatted.inc.php | 6 +- .../transformations/text_plain__imagelink.inc.php | 6 +- libraries/transformations/text_plain__link.inc.php | 6 +- .../transformations/text_plain__longToIpv4.inc.php | 3 +- libraries/transformations/text_plain__sql.inc.php | 6 +- .../transformations/text_plain__substr.inc.php | 6 +- navigation.php | 3 +- pmd/scripts/history.js | 60 +++++++---- pmd/scripts/move.js | 6 +- pmd_save_pos.php | 3 +- scripts/openid.php | 3 +- scripts/signon-script.php | 3 +- server_privileges.php | 3 +- server_status.php | 18 ++- server_variables.php | 13 ++- setup/lib/form_processing.lib.php | 3 +- setup/scripts.js | 5 +- themes.php | 3 +- 80 files changed, 710 insertions(+), 432 deletions(-)
diff --git a/js/common.js b/js/common.js index 97fa7d9..9b5dcf6 100644 --- a/js/common.js +++ b/js/common.js @@ -19,7 +19,8 @@ var query_to_load = ''; * * @param string db name */ -function setDb(new_db) { +function setDb(new_db) +{ //alert('setDb(' + new_db + ')'); if (new_db != db) { // db has changed @@ -51,7 +52,8 @@ function setDb(new_db) { * * @param string table name */ -function setTable(new_table) { +function setTable(new_table) +{ //alert('setTable(' + new_table + ')'); if (new_table != table) { // table has changed @@ -86,7 +88,8 @@ function setTable(new_table) { * @uses encodeURIComponent() * @param string url name of page to be loaded */ -function refreshMain(url) { +function refreshMain(url) +{ if (! url) { if (db) { url = opendb_url; @@ -117,7 +120,8 @@ function refreshMain(url) { * @uses encodeURIComponent() * @param boolean force force reloading */ -function refreshNavigation(force) { +function refreshNavigation(force) +{ // The goTo() function won't refresh in case the target // url is the same as the url given as parameter, but sometimes // we want to refresh anyway. @@ -174,7 +178,8 @@ function markDbTable(db, table) /** * sets current selected server, table and db (called from libraries/footer.inc.php) */ -function setAll( new_lang, new_collation_connection, new_server, new_db, new_table, new_token ) { +function setAll( new_lang, new_collation_connection, new_server, new_db, new_table, new_token ) +{ //alert('setAll( ' + new_lang + ', ' + new_collation_connection + ', ' + new_server + ', ' + new_db + ', ' + new_table + ', ' + new_token + ' )'); if (new_server != server || new_lang != lang || new_collation_connection != collation_connection) { @@ -257,7 +262,8 @@ function focus_querywindow(sql_query) * inserts query string into query window textarea * called from script tag in querywindow */ -function insertQuery() { +function insertQuery() +{ if (query_to_load != '' && querywindow.document && querywindow.document.getElementById && querywindow.document.getElementById('sqlquery')) { querywindow.document.getElementById('sqlquery').value = query_to_load; query_to_load = ''; @@ -266,7 +272,8 @@ function insertQuery() { return false; }
-function open_querywindow( url ) { +function open_querywindow( url ) +{ if ( ! url ) { url = 'querywindow.php?' + common_query + '&db=' + encodeURIComponent(db) + '&table=' + encodeURIComponent(table); } @@ -293,7 +300,8 @@ function open_querywindow( url ) { return true; }
-function refreshQuerywindow( url ) { +function refreshQuerywindow( url ) +{
if ( ! querywindow.closed && querywindow.location ) { if ( ! querywindow.document.sqlform.LockFromUpdate @@ -310,7 +318,8 @@ function refreshQuerywindow( url ) { * @param string targeturl new url to load * @param string target frame where to load the new url */ -function goTo(targeturl, target) { +function goTo(targeturl, target) +{ //alert(targeturl); if ( target == 'main' ) { target = window.frame_content; @@ -339,7 +348,8 @@ function goTo(targeturl, target) { }
// opens selected db in main frame -function openDb(new_db) { +function openDb(new_db) +{ //alert('opendb(' + new_db + ')'); setDb(new_db); setTable(''); @@ -347,7 +357,8 @@ function openDb(new_db) { return true; }
-function updateTableTitle( table_link_id, new_title ) { +function updateTableTitle( table_link_id, new_title ) +{ //alert('updateTableTitle'); if ( window.parent.frame_navigation.document && window.parent.frame_navigation.document.getElementById(table_link_id) ) { var left = window.parent.frame_navigation.document; diff --git a/js/config.js b/js/config.js index 94b2650..53702e3 100644 --- a/js/config.js +++ b/js/config.js @@ -14,7 +14,8 @@ var PMA_messages = {}; * * @param {Element} field */ -function getFieldType(field) { +function getFieldType(field) +{ field = $(field); var tagName = field.prop('tagName'); if (tagName == 'INPUT') { @@ -40,7 +41,8 @@ function getFieldType(field) { * @param {String} field_type see {@link #getFieldType} * @param {String|Boolean} [value] */ -function setFieldValue(field, field_type, value) { +function setFieldValue(field, field_type, value) +{ field = $(field); switch (field_type) { case 'text': @@ -78,7 +80,8 @@ function setFieldValue(field, field_type, value) { * @param {String} field_type returned by {@link #getFieldType} * @type Boolean|String|String[] */ -function getFieldValue(field, field_type) { +function getFieldValue(field, field_type) +{ field = $(field); switch (field_type) { case 'text': @@ -101,7 +104,8 @@ function getFieldValue(field, field_type) { /** * Returns values for all fields in fieldsets */ -function getAllValues() { +function getAllValues() +{ var elements = $('fieldset input, fieldset select, fieldset textarea'); var values = {}; var type, value; @@ -126,7 +130,8 @@ function getAllValues() { * @param {String} type * @return boolean */ -function checkFieldDefault(field, type) { +function checkFieldDefault(field, type) +{ field = $(field); var field_id = field.attr('id'); if (typeof defaultValues[field_id] == 'undefined') { @@ -157,7 +162,8 @@ function checkFieldDefault(field, type) { * Returns element's id prefix * @param {Element} element */ -function getIdPrefix(element) { +function getIdPrefix(element) +{ return $(element).attr('id').replace(/[^-]+$/, ''); }
@@ -254,7 +260,8 @@ var validators = { * @param {boolean} onKeyUp whether fire on key up * @param {Array} params validation function parameters */ -function validateField(id, type, onKeyUp, params) { +function validateField(id, type, onKeyUp, params) +{ if (typeof validators[type] == 'undefined') { return; } @@ -272,7 +279,8 @@ function validateField(id, type, onKeyUp, params) { * @type Array * @return array of [function, paramseters to be passed to function] */ -function getFieldValidators(field_id, onKeyUpOnly) { +function getFieldValidators(field_id, onKeyUpOnly) +{ // look for field bound validator var name = field_id.match(/[^-]+$/)[0]; if (typeof validators._field[name] != 'undefined') { @@ -302,7 +310,8 @@ function getFieldValidators(field_id, onKeyUpOnly) { * * @param {Object} error_list list of errors in the form {field id: error array} */ -function displayErrors(error_list) { +function displayErrors(error_list) +{ for (var field_id in error_list) { var errors = error_list[field_id]; var field = $('#'+field_id); @@ -354,7 +363,8 @@ function displayErrors(error_list) { * @param {boolean} isKeyUp * @param {Object} errors */ -function validate_fieldset(fieldset, isKeyUp, errors) { +function validate_fieldset(fieldset, isKeyUp, errors) +{ fieldset = $(fieldset); if (fieldset.length && typeof validators._fieldset[fieldset.attr('id')] != 'undefined') { var fieldset_errors = validators._fieldset[fieldset.attr('id')].apply(fieldset[0], [isKeyUp]); @@ -377,7 +387,8 @@ function validate_fieldset(fieldset, isKeyUp, errors) { * @param {boolean} isKeyUp * @param {Object} errors */ -function validate_field(field, isKeyUp, errors) { +function validate_field(field, isKeyUp, errors) +{ field = $(field); var field_id = field.attr('id'); errors[field_id] = []; @@ -403,7 +414,8 @@ function validate_field(field, isKeyUp, errors) { * @param {Element} field * @param {boolean} isKeyUp */ -function validate_field_and_fieldset(field, isKeyUp) { +function validate_field_and_fieldset(field, isKeyUp) +{ field = $(field); var errors = {}; validate_field(field, isKeyUp, errors); @@ -416,7 +428,8 @@ function validate_field_and_fieldset(field, isKeyUp) { * * @param {Element} field */ -function markField(field) { +function markField(field) +{ field = $(field); var type = getFieldType(field); var isDefault = checkFieldDefault(field, type); @@ -433,7 +446,8 @@ function markField(field) { * @param {Element} field * @param {boolean} display */ -function setRestoreDefaultBtn(field, display) { +function setRestoreDefaultBtn(field, display) +{ var el = $(field).closest('td').find('.restore-default img'); el[display ? 'show' : 'hide'](); } @@ -495,7 +509,8 @@ $(function() { * * @param {String} tab_id */ -function setTab(tab_id) { +function setTab(tab_id) +{ $('.tabs a').removeClass('active').filter('[href=' + tab_id + ']').addClass('active'); $('.tabs_contents fieldset').hide().filter(tab_id).show(); location.hash = 'tab_' + tab_id.substr(1); @@ -562,7 +577,8 @@ $(function() { * * @param {String} field_id */ -function restoreField(field_id) { +function restoreField(field_id) +{ var field = $('#'+field_id); if (field.length == 0 || defaultValues[field_id] == undefined) { return; diff --git a/js/db_search.js b/js/db_search.js index 72b3046..3e2eeb4 100644 --- a/js/db_search.js +++ b/js/db_search.js @@ -15,7 +15,8 @@ */
/** Loads the database search results */ -function loadResult(result_path , table_name , link , ajaxEnable){ +function loadResult(result_path , table_name , link , ajaxEnable) +{ $(document).ready(function() { if(ajaxEnable) { @@ -43,7 +44,8 @@ function loadResult(result_path , table_name , link , ajaxEnable){ }
/** Delete the selected search results */ -function deleteResult(result_path , msg , ajaxEnable){ +function deleteResult(result_path , msg , ajaxEnable) +{ $(document).ready(function() { /** Hides the results shown by the browse criteria */ $("#table-info").hide(); diff --git a/js/db_structure.js b/js/db_structure.js index 559819e..c3b280a 100644 --- a/js/db_structure.js +++ b/js/db_structure.js @@ -24,7 +24,8 @@ * * @param jQuery object $this_anchor */ -function PMA_adjustTotals($this_anchor) { +function PMA_adjustTotals($this_anchor) +{ var $parent_tr = $this_anchor.closest('tr'); var $rows_td = $parent_tr.find('.tbl_rows'); var $size_td = $parent_tr.find('.tbl_size'); diff --git a/js/export.js b/js/export.js index 3fd3c00..a356d45 100644 --- a/js/export.js +++ b/js/export.js @@ -3,7 +3,7 @@ * Functions used in the export tab * */ - + /** * Toggles the hiding and showing of each plugin's options * according to the currently selected plugin from the dropdown list @@ -19,7 +19,7 @@ });
/** - * Toggles the enabling and disabling of the SQL plugin's comment options that apply only when exporting structure + * 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() { @@ -50,7 +50,8 @@ $(document).ready(function() { * options */
-function toggle_structure_data_opts(pluginName) { +function toggle_structure_data_opts(pluginName) +{ var radioFormName = pluginName + "_structure_or_data"; var dataDiv = "#" + pluginName + "_data"; var structureDiv = "#" + pluginName + "_structure"; @@ -89,7 +90,8 @@ $(document).ready(function() { /** * Toggles the disabling of the "save to file" options */ -function toggle_save_to_file() { +function toggle_save_to_file() +{ if($("#radio_dump_asfile:checked").length == 0) { $("#ul_save_asfile > li").fadeTo('fast', 0.4); $("#ul_save_asfile > li > input").attr('disabled', 'disabled'); @@ -111,7 +113,8 @@ $(document).ready(function() { /** * For SQL plugin, toggles the disabling of the "display comments" options */ -function toggle_sql_include_comments() { +function toggle_sql_include_comments() +{ $("#checkbox_sql_include_comments").change(function() { if($("#checkbox_sql_include_comments:checked").length == 0) { $("#ul_include_comments > li").fadeTo('fast', 0.4); @@ -130,8 +133,8 @@ function toggle_sql_include_comments() { }
/** - * For SQL plugin, if "CREATE TABLE options" is checked/unchecked, check/uncheck each of its sub-options - */ + * For SQL plugin, if "CREATE TABLE options" is checked/unchecked, check/uncheck each of its sub-options + */ $(document).ready(function() { $("#checkbox_sql_create_table_statements").change(function() { if($("#checkbox_sql_create_table_statements:checked").length == 0) { @@ -144,7 +147,7 @@ $(document).ready(function() { }); });
-/** +/** * Disables the view output as text option if the output must be saved as a file */ $(document).ready(function() { @@ -164,7 +167,8 @@ $(document).ready(function() { /** * Toggles display of options when quick and custom export are selected */ -function toggle_quick_or_custom() { +function toggle_quick_or_custom() +{ if($("$(this):checked").attr("value") == "custom") { $("#databases_and_tables").show(); $("#rows").show(); @@ -222,4 +226,4 @@ $(document).ready(function() { $("input[type='text'][name='limit_from']").removeAttr('disabled'); } }); -}); \ No newline at end of file +}); diff --git a/js/functions.js b/js/functions.js index 0cca1d1..bb976ce 100644 --- a/js/functions.js +++ b/js/functions.js @@ -35,7 +35,8 @@ var chart_activeTimeouts = new Object(); * * @param object the form */ -function PMA_prepareForAjaxRequest($form) { +function PMA_prepareForAjaxRequest($form) +{ if (! $form.find('input:hidden').is('#ajax_request_hidden')) { $form.append('<input type="hidden" id="ajax_request_hidden" name="ajax_request" value="true" />'); } @@ -48,7 +49,8 @@ function PMA_prepareForAjaxRequest($form) { * * @return boolean always true */ -function suggestPassword(passwd_form) { +function suggestPassword(passwd_form) +{ // restrict the password to just letters and numbers to avoid problems: // "editors and viewers regard the password as multiple words and // things like double click no longer work" @@ -68,7 +70,8 @@ function suggestPassword(passwd_form) { /** * Version string to integer conversion. */ -function parseVersionString (str) { +function parseVersionString (str) +{ if (typeof(str) != 'string') { return false; } var add = 0; // Parse possible alpha/beta/rc/ @@ -98,7 +101,8 @@ function parseVersionString (str) { /** * Indicates current available version on main page. */ -function PMA_current_version() { +function PMA_current_version() +{ var current = parseVersionString(pmaversion); var latest = parseVersionString(PMA_latest_version); var version_information_message = PMA_messages['strLatestAvailable'] + ' ' + PMA_latest_version; @@ -124,7 +128,8 @@ function PMA_current_version() { * */
-function displayPasswordGenerateButton() { +function displayPasswordGenerateButton() +{ $('#tr_element_before_generate_password').parent().append('<tr><td>' + PMA_messages['strGeneratePassword'] + '</td><td><input type="button" id="button_generate_password" value="' + PMA_messages['strGenerate'] + '" onclick="suggestPassword(this.form)" /><input type="text" name="generated_pw" id="generated_pw" /></td></tr>'); $('#div_element_before_generate_password').parent().append('<div class="item"><label for="button_generate_password">' + PMA_messages['strGeneratePassword'] + ':</label><span class="options"><input type="button" id="button_generate_password" value="' + PMA_messages['strGenerate'] + '" onclick="suggestPassword(this.form)" /></span><input type="text" name="generated_pw" id="generated_pw" /></div>'); } @@ -134,7 +139,8 @@ function displayPasswordGenerateButton() { * * @param object $this_element a jQuery object pointing to the element */ -function PMA_addDatepicker($this_element, options) { +function PMA_addDatepicker($this_element, options) +{ var showTimeOption = false; if ($this_element.is('.datetimefield')) { showTimeOption = true; @@ -176,7 +182,8 @@ function PMA_addDatepicker($this_element, options) { * @param boolean only_once if true this is only done once * f.e. only on first focus */ -function selectContent( element, lock, only_once ) { +function selectContent( element, lock, only_once ) +{ if ( only_once && only_once_elements[element.name] ) { return; } @@ -720,7 +727,8 @@ var marked_row = new Array; * * @param container DOM element */ -function markAllRows( container_id ) { +function markAllRows( container_id ) +{
$("#"+container_id).find("input:checkbox:enabled").attr('checked', 'checked') .parents("tr").addClass("marked"); @@ -733,7 +741,8 @@ function markAllRows( container_id ) { * * @param container DOM element */ -function unMarkAllRows( container_id ) { +function unMarkAllRows( container_id ) +{
$("#"+container_id).find("input:checkbox:enabled").removeAttr('checked') .parents("tr").removeClass("marked"); @@ -747,7 +756,8 @@ function unMarkAllRows( container_id ) { * @param boolean state new value for checkbox (true or false) * @return boolean always true */ -function setCheckboxes( container_id, state ) { +function setCheckboxes( container_id, state ) +{
if(state) { $("#"+container_id).find("input:checkbox").attr('checked', 'checked'); @@ -777,7 +787,8 @@ function setSelectOptions(the_form, the_select, do_check) /** * Sets current value for query box. */ -function setQuery(query) { +function setQuery(query) +{ if (codemirror_editor) { codemirror_editor.setValue(query); } else { @@ -790,7 +801,8 @@ function setQuery(query) { * Create quick sql statements. * */ -function insertQuery(queryType) { +function insertQuery(queryType) +{ if (queryType == "clear") { setQuery(''); return; @@ -839,7 +851,8 @@ function insertQuery(queryType) { * Inserts multiple fields. * */ -function insertValueQuery() { +function insertValueQuery() +{ var myQuery = document.sqlform.sql_query; var myListBox = document.sqlform.dummy;
@@ -884,14 +897,16 @@ function insertValueQuery() { /** * listbox redirection */ -function goToUrl(selObj, goToLocation) { +function goToUrl(selObj, goToLocation) +{ eval("document.location.href = '" + goToLocation + "pos=" + selObj.options[selObj.selectedIndex].value + "'"); }
/** * getElement */ -function getElement(e,f){ +function getElement(e,f) +{ if(document.layers){ f=(f)?f:self; if(f.document.layers[e]) { @@ -910,7 +925,8 @@ function getElement(e,f){ /** * Refresh the WYSIWYG scratchboard after changes have been made */ -function refreshDragOption(e) { +function refreshDragOption(e) +{ var elm = $('#' + e); if (elm.css('visibility') == 'visible') { refreshLayout(); @@ -921,7 +937,8 @@ function refreshDragOption(e) { /** * Refresh/resize the WYSIWYG scratchboard */ -function refreshLayout() { +function refreshLayout() +{ var elm = $('#pdflayout') var orientation = $('#orientation_opt').val(); if($('#paper_opt').length==1){ @@ -943,7 +960,8 @@ function refreshLayout() { /** * Show/hide the WYSIWYG scratchboard */ -function ToggleDragDrop(e) { +function ToggleDragDrop(e) +{ var elm = $('#' + e); if (elm.css('visibility') == 'hidden') { PDFinit(); /* Defined in pdf_pages.php */ @@ -961,7 +979,8 @@ function ToggleDragDrop(e) { * PDF scratchboard: When a position is entered manually, update * the fields inside the scratchboard. */ -function dragPlace(no, axis, value) { +function dragPlace(no, axis, value) +{ var elm = $('#table_' + no); if (axis == 'x') { elm.css('left', value + 'px'); @@ -973,7 +992,8 @@ function dragPlace(no, axis, value) { /** * Returns paper sizes for a given format */ -function pdfPaperSize(format, axis) { +function pdfPaperSize(format, axis) +{ switch (format.toUpperCase()) { case '4A0': if (axis == 'x') return 4767.87; else return 6740.79; @@ -1301,7 +1321,8 @@ $(document).ready(function(){ * optional, defaults to 5000 * @return jQuery object jQuery Element that holds the message div */ -function PMA_ajaxShowMessage(message, timeout) { +function PMA_ajaxShowMessage(message, timeout) +{
//Handle the case when a empty data.message is passed. We don't want the empty message if (message == '') { @@ -1351,7 +1372,8 @@ function PMA_ajaxShowMessage(message, timeout) { /** * Removes the message shown for an Ajax operation when it's completed */ -function PMA_ajaxRemoveMessage($this_msgbox) { +function PMA_ajaxRemoveMessage($this_msgbox) +{ if ($this_msgbox != undefined && $this_msgbox instanceof jQuery) { $this_msgbox .stop(true, true) @@ -1362,7 +1384,8 @@ function PMA_ajaxRemoveMessage($this_msgbox) { /** * Hides/shows the "Open in ENUM/SET editor" message, depending on the data type of the column currently selected */ -function PMA_showNoticeForEnum(selectElement) { +function PMA_showNoticeForEnum(selectElement) +{ var enum_notice_id = selectElement.attr("id").split("_")[1]; enum_notice_id += "_" + (parseInt(selectElement.attr("id").split("_")[2]) + 1); var selectedType = selectElement.attr("value"); @@ -1376,7 +1399,8 @@ function PMA_showNoticeForEnum(selectElement) { /** * Generates a dialog box to pop up the create_table form */ -function PMA_createTableDialog( div, url , target) { +function PMA_createTableDialog( div, url , target) +{ /** * @var button_options Object that stores the options passed to jQueryUI * dialog @@ -1439,7 +1463,8 @@ function PMA_createTableDialog( div, url , target) { * * @return object The created highcharts instance */ -function PMA_createChart(passedSettings) { +function PMA_createChart(passedSettings) +{ var container = passedSettings.chart.renderTo;
var settings = { @@ -1574,7 +1599,8 @@ function PMA_createChart(passedSettings) { /* * Creates a Profiling Chart. Used in sql.php and server_status.js */ -function PMA_createProfilingChart(data, options) { +function PMA_createProfilingChart(data, options) +{ return PMA_createChart($.extend(true, { chart: { renderTo: 'profilingchart', @@ -1608,7 +1634,8 @@ function PMA_createProfilingChart(data, options) { }
// Formats a profiling duration nicely. Used in PMA_createProfilingChart() and server_status.js -function PMA_prettyProfilingNum(num, acc) { +function PMA_prettyProfilingNum(num, acc) +{ if (!acc) { acc = 2; } @@ -2203,7 +2230,8 @@ $(document).ready(function() { }); });
-function PMA_verifyTypeOfAllColumns() { +function PMA_verifyTypeOfAllColumns() +{ $("select[class='column_type']").each(function() { PMA_showNoticeForEnum($(this)); }); @@ -2212,7 +2240,8 @@ function PMA_verifyTypeOfAllColumns() { /** * Closes the ENUM/SET editor and removes the data in it */ -function disable_popup() { +function disable_popup() +{ $("#popup_background").fadeOut("fast"); $("#enum_editor").fadeOut("fast"); // clear the data from the text boxes @@ -2308,7 +2337,8 @@ $(document).ready(function() { displayMoreTableOpts(); });
-function displayMoreTableOpts() { +function displayMoreTableOpts() +{ // Remove the actions from the table cells (they are available by default for JavaScript-disabled browsers) // if the table is not a view or information_schema (otherwise there is only one action to hide and there's no point) if($("input[type='hidden'][name='table_type']").val() == "table") { @@ -2425,7 +2455,8 @@ function checkIndexName(form_id) * ommit this parameter the function searches * the footnotes in the whole body **/ -function PMA_convertFootnotesToTooltips($div) { +function PMA_convertFootnotesToTooltips($div) +{ // Hide the footnotes from the footer (which are displayed for // JavaScript-disabled browsers) since the tooltip is sufficient
@@ -2571,14 +2602,16 @@ $(function() { /** * Get the row number from the classlist (for example, row_1) */ -function PMA_getRowNumber(classlist) { +function PMA_getRowNumber(classlist) +{ return parseInt(classlist.split(/\s+row_/)[1]); }
/** * Changes status of slider */ -function PMA_set_status_label(id) { +function PMA_set_status_label(id) +{ if ($('#' + id).css('display') == 'none') { $('#anchor_status_' + id).text('+ '); } else { @@ -2589,7 +2622,8 @@ function PMA_set_status_label(id) { /** * Initializes slider effect. */ -function PMA_init_slider() { +function PMA_init_slider() +{ $('.pma_auto_slider').each(function(idx, e) { if ($(e).hasClass('slider_init_done')) return; $(e).addClass('slider_init_done'); @@ -2870,7 +2904,8 @@ $(document).ready(function() { * * @return bool True on success, false on failure */ -function PMA_slidingMessage(msg, $obj) { +function PMA_slidingMessage(msg, $obj) +{ if (msg == undefined || msg.length == 0) { // Don't show an empty message return false; @@ -3041,7 +3076,8 @@ $(document).ready(function() { * Create default PMA tooltip for the element specified. The default appearance * can be overriden by specifying optional "options" parameter (see qTip options). */ -function PMA_createqTip($elements, content, options) { +function PMA_createqTip($elements, content, options) +{ var o = { content: content, style: { diff --git a/js/import.js b/js/import.js index 8445716..68a3793 100644 --- a/js/import.js +++ b/js/import.js @@ -9,10 +9,11 @@ * Toggles the hiding and showing of each plugin's options * according to the currently selected plugin from the dropdown list */ -function changePluginOpts() { - $(".format_specific_options").each(function() { +function changePluginOpts() +{ + $(".format_specific_options").each(function() { $(this).hide(); - }); + }); var selected_plugin_name = $("#plugins option:selected").attr("value"); $("#" + selected_plugin_name + "_options").fadeIn('slow'); if(selected_plugin_name == "csv") { @@ -26,7 +27,8 @@ function changePluginOpts() { * Toggles the hiding and showing of each plugin's options and sets the selected value * in the plugin dropdown list according to the format of the selected file */ -function matchFile(fname) { +function matchFile(fname) +{ var fname_array = fname.toLowerCase().split("."); var len = fname_array.length; if(len != 0) { @@ -43,7 +45,7 @@ function matchFile(fname) { } } $(document).ready(function() { - // Initially display the options for the selected plugin + // Initially display the options for the selected plugin changePluginOpts();
// Whenever the selected plugin changes, change the options displayed @@ -79,4 +81,4 @@ $(document).ready(function() { $("#scroll_to_options_msg").hide(); $(".format_specific_options").css({ "border": 0, "margin": 0, "padding": 0 }); $(".format_specific_options h3").remove(); -}); \ No newline at end of file +}); diff --git a/js/keyhandler.js b/js/keyhandler.js index f92c7fb..63a13fa 100644 --- a/js/keyhandler.js +++ b/js/keyhandler.js @@ -3,7 +3,8 @@ * * @param object event data */ -function onKeyDownArrowsHandler(e) { +function onKeyDownArrowsHandler(e) +{ e = e||window.event; var o = (e.srcElement||e.target); if (!o) return; diff --git a/js/navigation.js b/js/navigation.js index 5ce805c..c70d428 100644 --- a/js/navigation.js +++ b/js/navigation.js @@ -17,7 +17,8 @@ var pma_saveframesize_timeout = null; * @param string id id of the element in the DOM * @param boolean only_open do not close/hide element */ -function toggle(id, only_open) { +function toggle(id, only_open) +{ var el = document.getElementById('subel' + id); if (! el) { return false; @@ -104,7 +105,8 @@ function PMA_setFrameSize() * @param string name name of the value to retrieve * @return string value value for the given name from cookie */ -function PMA_getCookie(name) { +function PMA_getCookie(name) +{ var start = document.cookie.indexOf(name + "="); var len = start + name.length + 1; if ((!start) && (name != document.cookie.substring(0, name.length))) { @@ -130,7 +132,8 @@ function PMA_getCookie(name) { * @param string domain * @param boolean secure */ -function PMA_setCookie(name, value, expires, path, domain, secure) { +function PMA_setCookie(name, value, expires, path, domain, secure) +{ document.cookie = name + "=" + escape(value) + ( (expires) ? ";expires=" + expires.toGMTString() : "") + ( (path) ? ";path=" + path : "") + @@ -144,7 +147,8 @@ function PMA_setCookie(name, value, expires, path, domain, secure) { * @param string value requested value * */ -function fast_filter(value){ +function fast_filter(value) +{ lowercase_value = value.toLowerCase(); $("#subel0 a[class!='tableicon']").each(function(idx,elem){ $elem = $(elem); @@ -160,7 +164,8 @@ function fast_filter(value){ /** * Clears fast filter. */ -function clear_fast_filter() { +function clear_fast_filter() +{ var elm = $('#NavFilter input'); elm.val(''); fast_filter(''); @@ -170,7 +175,8 @@ function clear_fast_filter() { /** * Reloads the recent tables list. */ -function PMA_reloadRecentTable() { +function PMA_reloadRecentTable() +{ $.get('navigation.php', { 'token': window.parent.token, 'server': window.parent.server, diff --git a/js/replication.js b/js/replication.js index 1a7c785..04cf86e 100644 --- a/js/replication.js +++ b/js/replication.js @@ -1,13 +1,14 @@ /* vim: set expandtab sw=4 ts=4 sts=4: */ /** - * for server_replication.php + * for server_replication.php * */
var random_server_id = Math.floor(Math.random() * 10000000); var conf_prefix = "server-id=" + random_server_id + "<br />log-bin=mysql-bin<br />log-error=mysql-bin.err<br />";
-function update_config() { +function update_config() +{ var conf_ignore = "binlog_ignore_db="; var conf_do = "binlog_do_db="; var database_list = $('#db_select option:selected:first').val(); @@ -30,24 +31,24 @@ $(document).ready(function() { $('#db_select').change(update_config);
$('#master_status_href').click(function() { - $('#replication_master_section').toggle(); + $('#replication_master_section').toggle(); }); $('#master_slaves_href').click(function() { - $('#replication_slaves_section').toggle(); + $('#replication_slaves_section').toggle(); }); $('#slave_status_href').click(function() { - $('#replication_slave_section').toggle(); + $('#replication_slave_section').toggle(); }); $('#slave_control_href').click(function() { - $('#slave_control_gui').toggle(); + $('#slave_control_gui').toggle(); }); $('#slave_errormanagement_href').click(function() { - $('#slave_errormanagement_gui').toggle(); + $('#slave_errormanagement_gui').toggle(); }); $('#slave_synchronization_href').click(function() { - $('#slave_synchronization_gui').toggle(); + $('#slave_synchronization_gui').toggle(); }); $('#db_reset_href').click(function() { - $('#db_select option:selected').attr('selected', false); + $('#db_select option:selected').attr('selected', false); }); }); diff --git a/js/server_privileges.js b/js/server_privileges.js index 35c34aa..c695dab 100644 --- a/js/server_privileges.js +++ b/js/server_privileges.js @@ -81,7 +81,8 @@ function checkAddUser(the_form) * @param new_user_initial the first alphabet of the user's name * @param new_user_initial_string html to replace the initial for pagination */ -function appendNewUser(new_user_string, new_user_initial, new_user_initial_string) { +function appendNewUser(new_user_string, new_user_initial, new_user_initial_string) +{ //Append the newly retrived user to the table now
//Calculate the index for the new row diff --git a/js/server_variables.js b/js/server_variables.js index 8776440..1aded3b 100644 --- a/js/server_variables.js +++ b/js/server_variables.js @@ -1,13 +1,14 @@ -function editVariable(link) { +function editVariable(link) +{ var varName = $(link).parent().parent().find('th:first').first().text().replace(/ /g,'_'); var mySaveLink = $(saveLink); var myCancelLink = $(cancelLink); var $cell = $(link).parent(); - + $cell.addClass('edit'); // remove edit link $cell.find('a.editLink').remove(); - + mySaveLink.click(function() { $.get('server_variables.php?' + url_query, { ajax_request: true, type: 'setval', varName: varName, varValue: $cell.find('input').attr('value') }, @@ -23,14 +24,14 @@ function editVariable(link) { ); return false; }); - + myCancelLink.click(function() { $cell.html($cell.find('span.oldContent').html()); $cell.removeClass('edit'); return false; }); - - + + $.get('server_variables.php?' + url_query, { ajax_request: true, type: 'getval', varName: varName }, function(data) { @@ -42,17 +43,17 @@ function editVariable(link) { $cell.find('table td:first').append(myCancelLink); } ); - + return false; }
-$(function() { +$(function() { var textFilter=null; var odd_row=false; var testString = 'abcdefghijklmnopqrstuvwxyz0123456789,ABCEFGHIJKLMOPQRSTUVWXYZ'; var $tmpDiv; var charWidth; - + // Global vars editLink = '<a href="#" class="editLink" onclick="return editVariable(this);"><img class="icon ic_b_edit" src="themes/dot.gif" alt=""> '+PMA_messages['strEdit']+'</a>'; saveLink = '<a href="#" class="saveLink"><img class="icon ic_b_save" src="themes/dot.gif" alt=""> '+PMA_messages['strSave']+'</a> '; @@ -62,7 +63,7 @@ $(function() { $.ajaxSetup({ cache:false }); - + /* Variable editing */ if(isSuperuser) { $('table.data tbody tr td:nth-child(2)').hover( @@ -76,36 +77,36 @@ $(function() { } ); } - + /*** This code snippet takes care that the table stays readable. It cuts off long strings the table overlaps the window size ***/ $('table.data').after($tmpDiv=$('<span>'+testString+'</span>')); charWidth = $tmpDiv.width() / testString.length; $tmpDiv.remove(); - + $(window).resize(limitTableWidth); limitTableWidth(); - + function limitTableWidth() { var fulltext; var charDiff; var maxTableWidth; var $tmpTable; - + $('table.data').after($tmpTable=$('<table id="testTable" style="width:100%;"><tr><td>'+testString+'</td></tr></table>')); - maxTableWidth = $('#testTable').width(); + maxTableWidth = $('#testTable').width(); $tmpTable.remove(); charDiff = ($('table.data').width()-maxTableWidth) / charWidth; - + if($('body').innerWidth() < $('table.data').width()+10 || $('body').innerWidth() > $('table.data').width()+20) { var maxChars=0; - + $('table.data tbody tr td:nth-child(2)').each(function() { maxChars=Math.max($(this).text().length,maxChars); }); - + // Do not resize smaller if there's only 50 chars displayed already if(charDiff > 0 && maxChars < 50) return; - + $('table.data tbody tr td:nth-child(2)').each(function() { if((charDiff>0 && $(this).text().length > maxChars-charDiff) || (charDiff<0 && $(this).find('abbr.cutoff').length>0)) { if($(this).find('abbr.cutoff').length > 0) @@ -115,7 +116,7 @@ $(function() { // Do not cut off elements with html in it and hope they are not too long if(fulltext.length != $(this).html().length) return 0; } - + if(fulltext.length < maxChars-charDiff) $(this).html(fulltext); else $(this).html('<abbr class="cutoff" title="'+fulltext+'">'+fulltext.substr(0,maxChars-charDiff-3)+'...</abbr>'); @@ -123,31 +124,31 @@ $(function() { }); } } - + // Filter options are invisible for disabled js users $('fieldset#tableFilter').css('display',''); - + $('#filterText').keyup(function(e) { if($(this).val().length==0) textFilter=null; else textFilter = new RegExp("(^| )"+$(this).val().replace(/_/g,' '),'i'); filterVariables(); }); - + function filterVariables() { odd_row=false; var mark_next=false; var firstCell; - + $('table.filteredData tbody tr').each(function() { firstCell = $(this).children(':first'); - + if(mark_next || textFilter==null || textFilter.exec(firstCell.text())) { // If current row is 'marked', also display next row if($(this).hasClass('marked') && !mark_next) mark_next=true; else mark_next=false;
- odd_row = !odd_row; + odd_row = !odd_row; $(this).css('display',''); if(odd_row) { $(this).addClass('odd'); @@ -161,4 +162,4 @@ $(function() { } }); } -}); \ No newline at end of file +}); diff --git a/js/sql.js b/js/sql.js index e762bb5..2b77af1 100644 --- a/js/sql.js +++ b/js/sql.js @@ -15,11 +15,13 @@ var $data_a; * @param string str * @return string the URL-decoded string */ -function PMA_urldecode(str) { +function PMA_urldecode(str) +{ return decodeURIComponent(str.replace(/+/g, '%20')); }
-function PMA_urlencode(str) { +function PMA_urlencode(str) +{ return encodeURIComponent(str.replace(/%20/g, '+')); }
@@ -29,7 +31,8 @@ function PMA_urlencode(str) { * * @param $this_field jQuery object that points to the current field's tr */ -function getFieldName($this_field) { +function getFieldName($this_field) +{
var this_field_index = $this_field.index(); // ltr or rtl direction does not impact how the DOM was generated @@ -52,7 +55,8 @@ function getFieldName($this_field) { * new inline edit anchor to each table row. * */ -function appendInlineAnchor() { +function appendInlineAnchor() +{ // TODO: remove two lines below if vertical display mode has been completely removed var disp_mode = $("#top_direction_dropdown").val();
@@ -1090,7 +1094,8 @@ $(document).ready(function() { * (when called in the situation where no posting was done, the data * parameter is empty) */ -function PMA_unInlineEditRow($del_hide, $chg_submit, $this_td, $input_siblings, data) { +function PMA_unInlineEditRow($del_hide, $chg_submit, $this_td, $input_siblings, data) +{
// deleting the hide button. remove <br><br><a> tags $del_hide.find('a, br').remove(); @@ -1183,7 +1188,8 @@ function PMA_unInlineEditRow($del_hide, $chg_submit, $this_td, $input_siblings, * Starting from some th, change the class of all td under it. * If isAddClass is specified, it will be used to determine whether to add or remove the class. */ -function PMA_changeClassForColumn($this_th, newclass, isAddClass) { +function PMA_changeClassForColumn($this_th, newclass, isAddClass) +{ // index 0 is the th containing the big T var th_index = $this_th.index(); var has_big_t = !$this_th.closest('tr').children(':first').hasClass('column_heading'); @@ -1232,7 +1238,8 @@ $(document).ready(function() { /* * Profiling Chart */ -function makeProfilingChart() { +function makeProfilingChart() +{ if ($('#profilingchart').length == 0) { return; } diff --git a/js/tbl_change.js b/js/tbl_change.js index 5e6ce84..17677b9 100644 --- a/js/tbl_change.js +++ b/js/tbl_change.js @@ -64,7 +64,8 @@ function nullify(theType, urlField, md5Field, multi_edit) * Start of validation part */ //function checks the number of days in febuary -function daysInFebruary (year){ +function daysInFebruary (year) +{ return (((year % 4 == 0) && ( (!(year % 100 == 0)) || (year % 400 == 0))) ? 29 : 28 ); } //function to convert single digit to double digit @@ -143,7 +144,8 @@ function isTime(val) return true; }
-function verificationsAfterFieldChange(urlField, multi_edit, theType){ +function verificationsAfterFieldChange(urlField, multi_edit, theType) +{ var evt = window.event || arguments.callee.caller.arguments[0]; var target = evt.target || evt.srcElement;
@@ -226,23 +228,23 @@ $(document).ready(function() {
/** * Handles all current checkboxes for Null; this only takes care of the - * checkboxes on currently displayed rows as the rows generated by - * "Continue insertion" are handled in the "Continue insertion" code - * + * checkboxes on currently displayed rows as the rows generated by + * "Continue insertion" are handled in the "Continue insertion" code + * */ $('.checkbox_null').bind('click', function(e) { nullify( // use hidden fields populated by tbl_change.php $(this).siblings('.nullify_code').val(), - $(this).closest('tr').find('input:hidden').first().val(), + $(this).closest('tr').find('input:hidden').first().val(), $(this).siblings('.hashed_field').val(), $(this).siblings('.multi_edit').val() ); });
/** - * Submission of data to be inserted or updated - * + * Submission of data to be inserted or updated + * * @uses PMA_ajaxShowMessage() * * This section has been deactivated. Here are the problems that I've @@ -257,9 +259,9 @@ $(document).ready(function() { * 2. This code can be called if we are editing or inserting. If editing, * the "and then" action can be "go back to this page" or "edit next * row", in which cases it makes sense to use AJAX. But the "go back - * to previous page" and "insert another new row" actions, using AJAX + * to previous page" and "insert another new row" actions, using AJAX * has no obvious advantage. If inserting, the "go back to previous" - * action needs a page refresh anyway. + * action needs a page refresh anyway. */ $("#insertFormDEACTIVATED").live('submit', function(event) {
@@ -388,8 +390,8 @@ $(document).ready(function() { .bind('change', function(e) { var $changed_element = $(this); verificationsAfterFieldChange( - $changed_element.data('hashed_field'), - $changed_element.data('new_row_index'), + $changed_element.data('hashed_field'), + $changed_element.data('new_row_index'), $changed_element.closest('tr').find('span.column_type').html() ); }); @@ -401,15 +403,15 @@ $(document).ready(function() { // to the original row, not the cloned one, so unbind() .unbind('click') // Keep these values to be used when the element - // will be clicked + // will be clicked .data('hashed_field', hashed_field) .data('new_row_index', new_row_index) .bind('click', function(e) { var $changed_element = $(this); nullify( $changed_element.siblings('.nullify_code').val(), - $this_element.closest('tr').find('input:hidden').first().val(), - $changed_element.data('hashed_field'), + $this_element.closest('tr').find('input:hidden').first().val(), + $changed_element.data('hashed_field'), '[multi_edit][' + $changed_element.data('new_row_index') + ']' ); }); @@ -461,7 +463,7 @@ $(document).ready(function() { // IMO it's not really important to handle the tabindex for // function and Null var tabindex = 0; - $('.textfield') + $('.textfield') .each(function() { tabindex++; $(this).attr('tabindex', tabindex); diff --git a/js/tbl_chart.js b/js/tbl_chart.js index 16a83b0..bec9a5c 100644 --- a/js/tbl_chart.js +++ b/js/tbl_chart.js @@ -7,25 +7,25 @@ $(document).ready(function() { var chart_data = jQuery.parseJSON($('#querychart').html()); chart_series = 'columns'; chart_xaxis_idx = $('select[name="chartXAxis"]').attr('value'); - + $('#resizer').resizable({ minHeight:240, minWidth:300, - // On resize, set the chart size to that of the + // On resize, set the chart size to that of the // resizer minus padding. If your chart has a lot of data or other - // content, the redrawing might be slow. In that case, we recommend + // content, the redrawing might be slow. In that case, we recommend // that you use the 'stop' event instead of 'resize'. resize: function() { currentChart.setSize( - this.offsetWidth - 20, + this.offsetWidth - 20, this.offsetHeight - 20, false ); } - }); - + }); + var currentSettings = { - chart: { + chart: { type: 'line', width: $('#resizer').width() - 20, height: $('#resizer').height() - 20 @@ -36,28 +36,28 @@ $(document).ready(function() { yAxis: { title: { text: $('input[name="yaxis_label"]').attr('value') } }, - title: { - text: $('input[name="chartTitle"]').attr('value'), - margin:20 + title: { + text: $('input[name="chartTitle"]').attr('value'), + margin:20 }, plotOptions: { series: {} } } - + $('#querychart').html(''); - + $('input[name="chartType"]').click(function() { currentSettings.chart.type = $(this).attr('value'); - + drawChart(); - + if($(this).attr('value') == 'bar' || $(this).attr('value') == 'column') $('span.barStacked').show(); else $('span.barStacked').hide(); }); - + $('input[name="barStacked"]').click(function() { if(this.checked) $.extend(true,currentSettings,{ plotOptions: { series: { stacking:'normal' } } }); @@ -65,13 +65,13 @@ $(document).ready(function() { $.extend(true,currentSettings,{ plotOptions: { series: { stacking:null } } }); drawChart(); }); - + $('input[name="chartTitle"]').keyup(function() { var title = $(this).attr('value'); if(title.length == 0) title = ' '; currentChart.setTitle({ text: title }); }); - + $('select[name="chartXAxis"]').change(function() { chart_xaxis_idx = this.value; drawChart(); @@ -81,7 +81,7 @@ $(document).ready(function() { chart_series_index = this.selectedIndex; drawChart(); }); - + /* Sucks, we cannot just set axis labels, we have to redraw the chart completely */ $('input[name="xaxis_label"]').keyup(function() { currentSettings.xAxis.title.text = $(this).attr('value'); @@ -91,56 +91,58 @@ $(document).ready(function() { currentSettings.yAxis.title.text = $(this).attr('value'); drawChart(true); }); - + function drawChart(noAnimation) { currentSettings.chart.width = $('#resizer').width() - 20; currentSettings.chart.height = $('#resizer').height() - 20; - + if(currentChart != null) currentChart.destroy(); - + if(noAnimation) currentSettings.plotOptions.series.animation = false; currentChart = PMA_queryChart(chart_data,currentSettings); if(noAnimation) currentSettings.plotOptions.series.animation = true; } - + drawChart(); $('#querychart').show(); });
-function in_array(element,array) { +function in_array(element,array) +{ for(var i=0; i < array.length; i++) if(array[i] == element) return true; return false; }
-function PMA_queryChart(data,passedSettings) { +function PMA_queryChart(data,passedSettings) +{ if($('#querychart').length == 0) return; - + var columnNames = Array(); - + var series = new Array(); var xaxis = { type: 'linear' }; var yaxis = new Object(); - + $.each(data[0],function(index,element) { columnNames.push(index); - }); - + }); + switch(passedSettings.chart.type) { case 'column': case 'spline': case 'line': case 'bar': xaxis.categories = new Array(); - + if(chart_series == 'columns') { var j = 0; - for(var i=0; i<columnNames.length; i++) + for(var i=0; i<columnNames.length; i++) if(i != chart_xaxis_idx) { series[j] = new Object(); series[j].data = new Array(); series[j].name = columnNames[i]; - + $.each(data,function(key,value) { series[j].data.push(parseFloat(value[columnNames[i]])); if( j== 0 && chart_xaxis_idx != -1 && ! xaxis.categories[value[columnNames[chart_xaxis_idx]]]) @@ -156,7 +158,7 @@ function PMA_queryChart(data,passedSettings) { var contains = false; for(var i=0; i < series.length; i++) if(series[i].name == element[chart_series]) contains = true; - + if(!contains) { seriesIndex[element[chart_series]] = j; series[j] = new Object(); @@ -165,24 +167,24 @@ function PMA_queryChart(data,passedSettings) { j++; } }); - + var type; // Get series points from query data $.each(data,function(key,value) { type = value[chart_series]; series[seriesIndex[type]].data.push(parseFloat(value[columnNames[0]])); - + if( !in_array(value[columnNames[chart_xaxis_idx]],xaxis.categories)) xaxis.categories.push(value[columnNames[chart_xaxis_idx]]); }); } - - - + + + if(columnNames.length == 2) yaxis.title = { text: columnNames[0] }; break; - + case 'pie': series[0] = new Object(); series[0].data = new Array(); @@ -194,17 +196,17 @@ function PMA_queryChart(data,passedSettings) { }); break; } - + // Prevent the user from seeing the JSON code $('div#profilingchart').html('').show();
var settings = { - chart: { + chart: { renderTo: 'querychart' }, - title: { - text: '', - margin: 0 + title: { + text: '', + margin: 0 }, series: series, xAxis: xaxis, @@ -224,17 +226,17 @@ function PMA_queryChart(data,passedSettings) { }, tooltip: { formatter: function() { - if(this.point.name) return '<b>'+this.series.name+'</b><br/>'+this.point.name+'<br/>'+this.y; - return '<b>'+this.series.name+'</b><br/>'+this.y; + if(this.point.name) return '<b>'+this.series.name+'</b><br/>'+this.point.name+'<br/>'+this.y; + return '<b>'+this.series.name+'</b><br/>'+this.y; } } };
if(passedSettings.chart.type == 'pie') settings.tooltip.formatter = function() { return '<b>'+columnNames[0]+'</b><br/>'+this.y; } - + // Overwrite/Merge default settings with passedsettings $.extend(true,settings,passedSettings); - + return PMA_createChart(settings); } diff --git a/js/tbl_gis_visualization.js b/js/tbl_gis_visualization.js index 81a86c4..978cd69 100644 --- a/js/tbl_gis_visualization.js +++ b/js/tbl_gis_visualization.js @@ -15,7 +15,8 @@ var svg; /** * Zooms and pans the visualization. */ -function zoomAndPan() { +function zoomAndPan() +{ var g = svg.getElementById('groupPanel');
g.setAttribute('transform', 'translate(' + x + ', ' + y + ') scale(' + scale + ')'); @@ -173,7 +174,7 @@ $(document).ready(function() { y = height / 2 - (height / 2 - y) * 1.5; zoomAndPan(); }); - + $('#zoom_world').live('click', function(e) { e.preventDefault(); scale = 1; @@ -181,7 +182,7 @@ $(document).ready(function() { y = 0; zoomAndPan(); }); - + $('#zoom_out').live('click', function(e) { e.preventDefault(); //zoom out @@ -239,7 +240,7 @@ $(document).ready(function() { }).appendTo("body").fadeIn(200); } }); - + /** * Detect the mouseout event and hide tooltips. */ diff --git a/js/tbl_relation.js b/js/tbl_relation.js index 5cdb0d7..74cb409 100644 --- a/js/tbl_relation.js +++ b/js/tbl_relation.js @@ -1,9 +1,10 @@ /* vim: set expandtab sw=4 ts=4 sts=4: */ /** - * for tbl_relation.php + * for tbl_relation.php * */ -function show_hide_clauses(thisDropdown) { +function show_hide_clauses(thisDropdown) +{ // here, one span contains the label and the clause dropdown // and we have one span for ON DELETE and one for ON UPDATE // diff --git a/js/tbl_structure.js b/js/tbl_structure.js index 897cad8..63fa60f 100644 --- a/js/tbl_structure.js +++ b/js/tbl_structure.js @@ -341,7 +341,7 @@ $(document).ready(function() { **/ $("#addColumns.ajax input[value=Go]").live('click', function(event){ event.preventDefault(); - + /*Remove the hidden dialogs if there are*/ if ($('#add_columns').length != 0) { $('#add_columns').remove(); @@ -349,7 +349,7 @@ $(document).ready(function() { var $div = $('<div id="add_columns"></div>');
var $form = $("#addColumns"); - + /** * @var button_options Object that stores the options passed to jQueryUI * dialog @@ -389,7 +389,7 @@ $(document).ready(function() { //Remove the top menu container from the dialog .find("#topmenucontainer").hide() ; // end dialog options - + $div = $("#add_columns"); /*changed the z-index of the enum editor to allow the edit*/ $("#enum_editor").css("z-index", "1100"); @@ -399,7 +399,7 @@ $(document).ready(function() { }) // end $.get() });
- +
}) // end $(document).ready()
@@ -411,7 +411,8 @@ $(document).ready(function() { * @param string $url Variable which parses the data for the * post action */ -function changeColumns(action,url) { +function changeColumns(action,url) +{ /*Remove the hidden dialogs if there are*/ if ($('#change_column_dialog').length != 0) { $('#change_column_dialog').remove(); diff --git a/js/update-location.js b/js/update-location.js index d271cc8..3b9c51d 100644 --- a/js/update-location.js +++ b/js/update-location.js @@ -10,13 +10,14 @@ var hash_init_done = 0;
/** * Sets hash part in URL, either calls itself in parent frame or does the - * work itself. The hash is not set directly if we did not yet process old + * work itself. The hash is not set directly if we did not yet process old * one. */ -function setURLHash(hash) { +function setURLHash(hash) +{ if (jQuery.browser.webkit) { - /* - * Setting hash leads to reload in webkit: + /* + * Setting hash leads to reload in webkit: * http://www.quirksmode.org/bugreports/archives/2005/05/Safari_13_visual_anoma... */ return; diff --git a/libraries/advisor.lib.php b/libraries/advisor.lib.php index 660f90d..1f00a13 100644 --- a/libraries/advisor.lib.php +++ b/libraries/advisor.lib.php @@ -169,7 +169,8 @@ class Advisor { } }
-function PMA_bytime($num, $precision) { +function PMA_bytime($num, $precision) +{ $per = ''; if ($num >= 1) { # per second $per = "per second"; diff --git a/libraries/auth/cookie.auth.lib.php b/libraries/auth/cookie.auth.lib.php index 9360b9a..4615c55 100644 --- a/libraries/auth/cookie.auth.lib.php +++ b/libraries/auth/cookie.auth.lib.php @@ -81,7 +81,8 @@ if (function_exists('mcrypt_encrypt')) { * * @access public */ -function PMA_get_blowfish_secret() { +function PMA_get_blowfish_secret() +{ if (empty($GLOBALS['cfg']['blowfish_secret'])) { if (empty($_SESSION['auto_blowfish_secret'])) { // this returns 23 characters diff --git a/libraries/auth/signon.auth.lib.php b/libraries/auth/signon.auth.lib.php index 0a079b2..976845c 100644 --- a/libraries/auth/signon.auth.lib.php +++ b/libraries/auth/signon.auth.lib.php @@ -18,7 +18,8 @@ * * @access public */ -function PMA_auth() { +function PMA_auth() +{ unset($_SESSION['LAST_SIGNON_URL']); if (empty($GLOBALS['cfg']['Server']['SignonURL'])) { PMA_fatalError('You must set SignonURL!'); diff --git a/libraries/build_html_for_db.lib.php b/libraries/build_html_for_db.lib.php index 6f4357c..8d64549 100644 --- a/libraries/build_html_for_db.lib.php +++ b/libraries/build_html_for_db.lib.php @@ -13,7 +13,8 @@ if (! defined('PHPMYADMIN')) { * * @return array */ -function PMA_getColumnOrder() { +function PMA_getColumnOrder() +{
$column_order['DEFAULT_COLLATION_NAME'] = array( 'disp_name' => __('Collation'), @@ -70,7 +71,8 @@ function PMA_getColumnOrder() { * * @return array $column_order, $out */ -function PMA_buildHtmlForDb($current, $is_superuser, $checkall, $url_query, $column_order, $replication_types, $replication_info) { +function PMA_buildHtmlForDb($current, $is_superuser, $checkall, $url_query, $column_order, $replication_types, $replication_info) +{
$out = ''; if ($is_superuser || $GLOBALS['cfg']['AllowUserDropDatabase']) { diff --git a/libraries/charset_conversion.lib.php b/libraries/charset_conversion.lib.php index b3ae693..8d19ad4 100644 --- a/libraries/charset_conversion.lib.php +++ b/libraries/charset_conversion.lib.php @@ -67,7 +67,8 @@ if ($PMA_recoding_engine == PMA_CHARSET_ICONV_AIX) { * @access public * */ -function PMA_convert_string($src_charset, $dest_charset, $what) { +function PMA_convert_string($src_charset, $dest_charset, $what) +{ if ($src_charset == $dest_charset) { return $what; } diff --git a/libraries/common.lib.php b/libraries/common.lib.php index 13983de..cc89c85 100644 --- a/libraries/common.lib.php +++ b/libraries/common.lib.php @@ -410,7 +410,8 @@ function PMA_showMySQLDocu($chapter, $link, $big_icon = false, $anchor = '', $ju * * @access public */ -function PMA_showDocu($anchor) { +function PMA_showDocu($anchor) +{ if ($GLOBALS['cfg']['ReplaceHelpImg']) { return '<a href="Documentation.html#' . $anchor . '" target="documentation"><img class="icon ic_b_help_s" src="themes/dot.gif" alt="' . __('Documentation') . '" title="' . __('Documentation') . '" /></a>'; } else { @@ -426,7 +427,8 @@ function PMA_showDocu($anchor) { * * @access public */ -function PMA_showPHPDocu($target) { +function PMA_showPHPDocu($target) +{ $url = PMA_getPHPDocLink($target);
if ($GLOBALS['cfg']['ReplaceHelpImg']) { @@ -2142,7 +2144,8 @@ function PMA_pageselector($rows, $pageNow = 1, $nbTotalPage = 1, * * @access public */ -function PMA_listNavigator($count, $pos, $_url_params, $script, $frame, $max_count) { +function PMA_listNavigator($count, $pos, $_url_params, $script, $frame, $max_count) +{
if ($max_count < $count) { echo 'frame_navigation' == $frame ? '<div id="navidbpageselector">' . "\n" : ''; @@ -2279,7 +2282,8 @@ function PMA_externalBug($functionality, $component, $minimum_version, $bugref) * @param boolean $checked is it initially checked? * @param boolean $onclick should it submit the form on click? */ -function PMA_display_html_checkbox($html_field_name, $label, $checked, $onclick) { +function PMA_display_html_checkbox($html_field_name, $label, $checked, $onclick) +{
echo '<input type="checkbox" name="' . $html_field_name . '" id="' . $html_field_name . '"' . ($checked ? ' checked="checked"' : '') . ($onclick ? ' onclick="this.form.submit();"' : '') . ' /><label for="' . $html_field_name . '">' . $label . '</label>'; } @@ -2294,7 +2298,8 @@ function PMA_display_html_checkbox($html_field_name, $label, $checked, $onclick) * @param boolean $escape_label whether to use htmlspecialchars() on label * @param string $class enclose each choice with a div of this class */ -function PMA_display_html_radio($html_field_name, $choices, $checked_choice = '', $line_break = true, $escape_label = true, $class='') { +function PMA_display_html_radio($html_field_name, $choices, $checked_choice = '', $line_break = true, $escape_label = true, $class='') +{ foreach ($choices as $choice_value => $choice_label) { if (! empty($class)) { echo '<div class="' . $class . '">'; @@ -2452,7 +2457,8 @@ function PMA_toggleButton($action, $select_name, $options, $callback) /** * Clears cache content which needs to be refreshed on user change. */ -function PMA_clearUserCache() { +function PMA_clearUserCache() +{ PMA_cacheUnset('is_superuser', true); }
@@ -2529,7 +2535,8 @@ function PMA_cacheUnset($var, $server = 0) * @param integer $length * @return string the printable value */ -function PMA_printable_bit_value($value, $length) { +function PMA_printable_bit_value($value, $length) +{ $printable = ''; for ($i = 0, $len_ceiled = ceil($length / 8); $i < $len_ceiled; $i++) { $printable .= sprintf('%08d', decbin(ord(substr($value, $i, 1)))); @@ -2544,7 +2551,8 @@ function PMA_printable_bit_value($value, $length) { * @param string $value * @return boolean */ -function PMA_contains_nonprintable_ascii($value) { +function PMA_contains_nonprintable_ascii($value) +{ return preg_match('@[^[:print:]]@', $value); }
@@ -2555,7 +2563,8 @@ function PMA_contains_nonprintable_ascii($value) { * @param string $bit_default_value * @return string the converted value */ -function PMA_convert_bit_default_value($bit_default_value) { +function PMA_convert_bit_default_value($bit_default_value) +{ return strtr($bit_default_value, array("b" => "", "' ) $value) { s, $callback) k = true, $escape_label = true, $class='') ($onclick ? ' onclick="this.form.submit();"' : '') . ' /><label for="' . $html_field_name . '">' . $label . '</label>'; messages['strGenerate'] + '" onclick="suggestPassword(this.form)" /></span><input type="text" name="generated_pw" id="generated_pw" /></div>'); �)e;+ 7�� �)e;+ ?7�� �O�f;+ �)e;+ @�f;+ �D�f;+ �I�f;+ �$+e;+ xTFf;+ �-�� P,�� �)e;+ �! �! 7�� p7�� �&f;+ `.�� "�)e;+ �)e;+ 7�� �)e;+ ?7�� 07�� (7�� �Je;+ �p� p7�� �)e;+ �$+e;+ `.�� 0-�� �)e;+ G H I J K M N O P 7�� p7�� H��e;+ 0�� "�)e;+ �)e;+ 7�� 0O�f;+ �)e;+ `Ff;+ � �e;+ @�f;+ �D�f;+ �I�f;+ �$+e;+ H��e;+ 0�� @.�� �)e;+ 8��e;+ 0�� p.�� �)e;+ (��e;+ 0�� �.�� �)e;+ ��e;+ 0�� �.�� �)e;+ �N�f;+ �)e;+ �I�f;+ P)�� �X�e;+ �)e;+ �D�f;+ p/�� yX�e;+ �)e;+ @�f;+ �/�� ZX�e;+ �)e;+ ��e;+ `Ff;+ � �e;+ @�f;+ �dFf;+ �D�f;+ �I�f;+ �$+e;+ �M�e;+ 1�� �/�� �)e;+ # % ' ) * - . 0 3 5 6 7 8 : <