From 6f20ffdf64b907f7fc52766b6664af41f02cf149 Mon Sep 17 00:00:00 2001 From: Piyush Vijay Date: Thu, 9 Aug 2018 19:49:14 +0530 Subject: [PATCH] Resolving merge errors. Signed-Off-By: Piyush Vijay --- .eslintignore | 1 + db_search.php | 3 +-- js/src/ajax.js | 2 +- js/src/classes/Chart.js | 2 +- js/src/config.js | 8 +++---- js/src/export.js | 2 +- js/src/functions/Grid/Cell.js | 2 +- js/src/functions/Grid/GetFieldName.js | 2 +- js/src/functions/Server/SeverStatusSorter.js | 2 +- js/src/functions/chart.js | 2 +- js/src/server_databases.js | 6 +---- js/src/server_plugins.js | 2 +- js/src/server_status_monitor.js | 2 +- js/src/server_variables.js | 2 +- js/src/sql.js | 2 +- js/src/utils/JqueryExtended.js | 6 +++-- js/src/utils/makegrid.js | 2 +- js/src/utils/menu_resizer.js | 2 +- server_sql.php | 2 -- test/classes/ScriptsTest.php | 24 ++++++++++++-------- 20 files changed, 39 insertions(+), 37 deletions(-) diff --git a/.eslintignore b/.eslintignore index c383636a10..125f7df65e 100644 --- a/.eslintignore +++ b/.eslintignore @@ -3,3 +3,4 @@ tmp/ vendor/ js/dist/ js/lib/ +js/src/plugins/ diff --git a/db_search.php b/db_search.php index abc293a061..a4c9a963a5 100644 --- a/db_search.php +++ b/db_search.php @@ -22,8 +22,7 @@ $response = Response::getInstance(); $header = $response->getHeader(); $scripts = $header->getScripts(); $scripts->addFile('db_search'); -$scripts->addFile('sql.js'); -// $scripts->addFile('makegrid.js'); +$scripts->addFile('sql'); require 'libraries/db_common.inc.php'; diff --git a/js/src/ajax.js b/js/src/ajax.js index f4c9d1c9d0..337e3ab981 100644 --- a/js/src/ajax.js +++ b/js/src/ajax.js @@ -8,7 +8,7 @@ import { PMA_ajaxShowMessage, } from './utils/show_ajax_messages'; import { PMA_Messages as PMA_messages } from './variables/export_variables'; import CommonParams from './variables/common_params'; -import { jQuery as $ } from './utils/JqueryExtended'; +import { $ } from './utils/JqueryExtended'; import { PMA_getImage } from './functions/get_image'; import { PMA_ensureNaviSettings, PMA_reloadNavigation, diff --git a/js/src/classes/Chart.js b/js/src/classes/Chart.js index af9db92277..c13b8adb53 100644 --- a/js/src/classes/Chart.js +++ b/js/src/classes/Chart.js @@ -1,4 +1,4 @@ -import { $ } from '../utils/extend_jquery'; +import { $ } from '../utils/JqueryExtended'; import 'updated-jqplot'; import 'updated-jqplot/dist/plugins/jqplot.pieRenderer'; import 'updated-jqplot/dist/plugins/jqplot.highlighter'; diff --git a/js/src/config.js b/js/src/config.js index 08cf178969..1a247a428f 100644 --- a/js/src/config.js +++ b/js/src/config.js @@ -31,7 +31,7 @@ function onloadConfigPrefsTab () { // Form validation and field operations // -export function onload2 () { +function onloadConfigValidations () { Config.setupValidation(); } @@ -43,7 +43,7 @@ export function onload2 () { // Tabbed forms // -export function onload3 () { +function onloadConfigTabs () { Config.setupConfigTabs(); Config.adjustPrefsNotification(); @@ -91,7 +91,7 @@ function onloadConfigResetDefault () { // "Restore default" and "set value" buttons // -export function onload5 () { +function onloadConfigRestore () { Config.setupRestoreField(); } @@ -103,7 +103,7 @@ export function onload5 () { // User preferences import/export // -export function onload6 () { +function onloadPreferenceExport () { Config.offerPrefsAutoimport(); var $radios = $('#import_local_storage, #export_local_storage'); if (!$radios.length) { diff --git a/js/src/export.js b/js/src/export.js index e49b15e345..f14e24185b 100644 --- a/js/src/export.js +++ b/js/src/export.js @@ -251,7 +251,7 @@ function onloadExportOptions () { .parent() .fadeTo('fast', 0.4); - Export.setupTableStructureOrData(); + Export.setupTableStructureOrData(); } /** diff --git a/js/src/functions/Grid/Cell.js b/js/src/functions/Grid/Cell.js index d352a9591e..c8acc0d31f 100644 --- a/js/src/functions/Grid/Cell.js +++ b/js/src/functions/Grid/Cell.js @@ -13,4 +13,4 @@ export function PMA_getCellValue (td) { } else { return $td.text(); } -} \ No newline at end of file +} diff --git a/js/src/functions/Grid/GetFieldName.js b/js/src/functions/Grid/GetFieldName.js index ee7de276a5..3338728be0 100644 --- a/js/src/functions/Grid/GetFieldName.js +++ b/js/src/functions/Grid/GetFieldName.js @@ -38,4 +38,4 @@ export function getFieldName ($table_results, $this_field) { field_name = $.trim(field_name); return field_name; -} \ No newline at end of file +} diff --git a/js/src/functions/Server/SeverStatusSorter.js b/js/src/functions/Server/SeverStatusSorter.js index 020da354e4..9cf7695961 100644 --- a/js/src/functions/Server/SeverStatusSorter.js +++ b/js/src/functions/Server/SeverStatusSorter.js @@ -3,7 +3,7 @@ /** * Module import */ -import { $ } from '../../utils/extend_jquery'; +import { $ } from '../../utils/JqueryExtended'; import '../../plugins/jquery/jquery.tablesorter'; // TODO: tablesorter shouldn't sort already sorted columns /** diff --git a/js/src/functions/chart.js b/js/src/functions/chart.js index a1703ba503..20d6698d0c 100644 --- a/js/src/functions/chart.js +++ b/js/src/functions/chart.js @@ -2,7 +2,7 @@ * Creates a Profiling Chart. Used in sql.js * and in server_status_monitor.js */ -import { $ } from '../utils/extend_jquery'; +import { $ } from '../utils/JqueryExtended'; import JQPlotChartFactory from '../classes/Chart'; import { ChartType, ColumnType, DataTable } from '../classes/Chart'; diff --git a/js/src/server_databases.js b/js/src/server_databases.js index 451dc91175..154b83967b 100644 --- a/js/src/server_databases.js +++ b/js/src/server_databases.js @@ -16,11 +16,7 @@ import './variables/import_variables'; import { PMA_ajaxShowMessage } from './utils/show_ajax_messages'; import { escapeHtml } from './utils/Sanitise'; import { PMA_Messages as messages } from './variables/export_variables'; -<<<<<<< HEAD -import { jQuery as $ } from './utils/JqueryExtended'; -======= -import { $ } from './utils/extend_jquery'; ->>>>>>> Weekly progress. +import { $ } from './utils/JqueryExtended'; import { AJAX } from './ajax'; import CommonParams from './variables/common_params'; import { PMA_reloadNavigation } from './functions/navigation'; diff --git a/js/src/server_plugins.js b/js/src/server_plugins.js index 3633d1f637..01c50e4ea3 100644 --- a/js/src/server_plugins.js +++ b/js/src/server_plugins.js @@ -3,7 +3,7 @@ /** * Module import */ -import { $ } from './utils/extend_jquery'; +import { $ } from './utils/JqueryExtended'; import './plugins/jquery/jquery.tablesorter'; /** diff --git a/js/src/server_status_monitor.js b/js/src/server_status_monitor.js index 6d10b95d57..d47d4de8e3 100644 --- a/js/src/server_status_monitor.js +++ b/js/src/server_status_monitor.js @@ -1,6 +1,6 @@ /* vim: set expandtab sw=4 ts=4 sts=4: */ import { PMA_Messages as messages } from './variables/export_variables'; -import { $ } from './utils/extend_jquery'; +import { $ } from './utils/JqueryExtended'; import 'updated-jqplot'; import './plugins/jquery/jquery.sortableTable'; diff --git a/js/src/server_variables.js b/js/src/server_variables.js index ac60217991..f4ec19bf3d 100644 --- a/js/src/server_variables.js +++ b/js/src/server_variables.js @@ -3,7 +3,7 @@ /** * Module import */ -import { $ } from './utils/extend_jquery'; +import { $ } from './utils/JqueryExtended'; import { editVariable } from './functions/Server/ServerVariables'; /** diff --git a/js/src/sql.js b/js/src/sql.js index d5175882dc..4d1edefae3 100644 --- a/js/src/sql.js +++ b/js/src/sql.js @@ -1,5 +1,5 @@ /* vim: set expandtab sw=4 ts=4 sts=4: */ -import { $ } from './utils/extend_jquery'; +import { $ } from './utils/JqueryExtended'; import './plugins/jquery/jquery.uitablefilter'; import { PMA_Messages as PMA_messages } from './variables/export_variables'; import PMA_commonParams from './variables/common_params'; diff --git a/js/src/utils/JqueryExtended.js b/js/src/utils/JqueryExtended.js index 2e4ccfd477..cf3706db4c 100644 --- a/js/src/utils/JqueryExtended.js +++ b/js/src/utils/JqueryExtended.js @@ -15,7 +15,7 @@ import { PMA_Messages as PMA_messages } from '../variables/export_variables'; * Make sure that ajax requests will not be cached * by appending a random variable to their parameters */ -$.ajaxPrefilter(function (options, originalOptions, jqXHR) { +$.ajaxPrefilter(function (options, originalOptions) { var nocache = new Date().getTime() + '' + Math.floor(Math.random() * 1000000); if (typeof options.data === 'string') { options.data += '&_nocache=' + nocache + '&token=' + encodeURIComponent(PMA_commonParams.get('token')); @@ -250,4 +250,6 @@ export function extendingValidatorMessages () { window.jQ = $; -export const jQuery = $; +export { + $ +}; diff --git a/js/src/utils/makegrid.js b/js/src/utils/makegrid.js index 8d1ce2b1ff..393f5eeae3 100644 --- a/js/src/utils/makegrid.js +++ b/js/src/utils/makegrid.js @@ -3,7 +3,7 @@ /** * Module import */ -import { $ } from './extend_jquery'; +import { $ } from './JqueryExtended'; import { PMA_Messages as messages } from '../variables/export_variables'; import { PMA_ajaxShowMessage, PMA_tooltip } from './show_ajax_messages'; import { rearrangeStickyColumns } from '../functions/Grid/StickyColumns'; diff --git a/js/src/utils/menu_resizer.js b/js/src/utils/menu_resizer.js index cd7150c387..2435b75e46 100644 --- a/js/src/utils/menu_resizer.js +++ b/js/src/utils/menu_resizer.js @@ -4,7 +4,7 @@ * Module import */ import { PMA_getImage } from '../functions/get_image'; -import { PMA_messages as messages } from '../variables/export_variables'; +import { PMA_Messages as messages } from '../variables/export_variables'; /** * Handles the resizing of a menu according to the available screen width * diff --git a/server_sql.php b/server_sql.php index 05f9c6af88..42061068a2 100644 --- a/server_sql.php +++ b/server_sql.php @@ -24,8 +24,6 @@ PageSettings::showGroup('Sql'); $response = Response::getInstance(); $header = $response->getHeader(); $scripts = $header->getScripts(); -// $scripts->addFile('makegrid.js'); -// $scripts->addFile('vendor/jquery/jquery.uitablefilter.js'); $scripts->addFile('sql'); require_once 'libraries/server_common.inc.php'; diff --git a/test/classes/ScriptsTest.php b/test/classes/ScriptsTest.php index 572a784994..0fe8c1ec67 100644 --- a/test/classes/ScriptsTest.php +++ b/test/classes/ScriptsTest.php @@ -125,12 +125,16 @@ class ScriptsTest extends PmaTestCase public function testAddCodeNew() { - $this->object->addCode('alert(\'CodeAdded\');'); + $this->object->addCodeNew('alert(\'CodeAdded\');'); $this->assertEquals( - '', + '' + . '', $this->object->getDisplay() ); } @@ -146,11 +150,13 @@ class ScriptsTest extends PmaTestCase $this->object->addCode('alert(\'CodeAdded\');'); $this->assertEquals( - '', + '' + . '', $this->object->getDisplay() ); }