diff --git a/js/src/consts/files.js b/js/src/consts/files.js index d2606443bd..9ab3ef010a 100644 --- a/js/src/consts/files.js +++ b/js/src/consts/files.js @@ -17,7 +17,8 @@ const PhpToJsFileMapping = { 'indexes', 'key_handler', 'cross_framing_protection', - 'drag_drop_import' + 'drag_drop_import', + 'rte' ], server_privileges: ['server_privileges'], server_databases: ['server_databases'], @@ -100,7 +101,8 @@ const JsFileList = [ 'key_handler', 'cross_framing_protection', 'drag_drop_import', - 'normalization' + 'normalization', + 'rte' ]; export { diff --git a/js/src/navigation.js b/js/src/navigation.js index c09292075b..bfb990e5c9 100644 --- a/js/src/navigation.js +++ b/js/src/navigation.js @@ -1,10 +1,13 @@ /* vim: set expandtab sw=4 ts=4 sts=4: */ + +/* Module import */ import * as Navigation from './functions/navigation'; import { PMA_Messages as PMA_messages } from './variables/export_variables'; import CommonParams from './variables/common_params'; import { PMA_ajaxShowMessage, PMA_ajaxRemoveMessage, PMA_tooltip } from './utils/show_ajax_messages'; import { isStorageSupported } from './functions/config'; import { indexEditorDialog } from './functions/Indexes'; +import RTE from './classes/RTE'; /** * function used in or for navigation panel diff --git a/js/src/utils/show_ajax_messages.js b/js/src/utils/show_ajax_messages.js index b8be628bd9..5aa74b313b 100644 --- a/js/src/utils/show_ajax_messages.js +++ b/js/src/utils/show_ajax_messages.js @@ -220,11 +220,99 @@ function PMA_ajaxRemoveMessage ($thisMsgbox) { } } +/** + * Creates a message inside an object with a sliding effect + * + * @param msg A string containing the text to display + * @param $obj a jQuery object containing the reference + * to the element where to put the message + * This is optional, if no element is + * provided, one will be created below the + * navigation links at the top of the page + * + * @return bool True on success, false on failure + */ +function PMA_slidingMessage (msg, $obj) { + if (msg === undefined || msg.length === 0) { + // Don't show an empty message + return false; + } + if ($obj === undefined || !($obj instanceof jQuery) || $obj.length === 0) { + // If the second argument was not supplied, + // we might have to create a new DOM node. + if ($('#PMA_slidingMessage').length === 0) { + $('#page_content').prepend( + '' + ); + } + $obj = $('#PMA_slidingMessage'); + } + if ($obj.has('div').length > 0) { + // If there already is a message inside the + // target object, we must get rid of it + $obj + .find('div') + .first() + .fadeOut(function () { + $obj + .children() + .remove(); + $obj + .append('