Update website

This commit is contained in:
Guilhem Lavaux 2024-11-19 08:02:04 +01:00
parent 4413528994
commit 1d90fbf296
6865 changed files with 1091082 additions and 0 deletions

View file

@ -0,0 +1,27 @@
/**
* Image upload transformations plugin js
*
* @package PhpMyAdmin
*/
AJAX.registerOnload('transformations/image_upload.js', function () {
// Change thumbnail when image file is selected
// through file upload dialog
$('input.image-upload').on('change', function () {
if (this.files && this.files[0]) {
var reader = new FileReader();
var $input = $(this);
reader.onload = function (e) {
$input.prevAll('img').attr('src', e.target.result);
};
reader.readAsDataURL(this.files[0]);
}
});
});
/**
* Unbind all event handlers before tearing down a page
*/
AJAX.registerTeardown('transformations/image_upload.js', function () {
$('input.image-upload').off('change');
});

View file

@ -0,0 +1,17 @@
/**
* JSON syntax highlighting transformation plugin
*/
AJAX.registerOnload('transformations/json.js', function () {
var $elm = $('#page_content').find('code.json');
$elm.each(function () {
var $json = $(this);
var $pre = $json.find('pre');
/* We only care about visible elements to avoid double processing */
if ($pre.is(':visible')) {
var $highlight = $('<div class="json-highlight cm-s-default"></div>');
$json.append($highlight);
CodeMirror.runMode($json.text(), 'application/json', $highlight[0]);
$pre.hide();
}
});
});

View file

@ -0,0 +1,16 @@
/**
* JSON syntax highlighting transformation plugin
*
* @package PhpMyAdmin
*/
AJAX.registerOnload('transformations/json_editor.js', function () {
$('textarea.transform_json_editor').each(function () {
CodeMirror.fromTextArea(this, {
lineNumbers: true,
matchBrackets: true,
indentUnit: 4,
mode: 'application/json',
lineWrapping: true
});
});
});

View file

@ -0,0 +1,10 @@
/**
* SQL syntax highlighting transformation plugin js
*
* @package PhpMyAdmin
*/
AJAX.registerOnload('transformations/sql_editor.js', function () {
$('textarea.transform_sql_editor').each(function () {
Functions.getSqlEditor($(this), {}, 'both');
});
});

View file

@ -0,0 +1,17 @@
/**
* XML syntax highlighting transformation plugin
*/
AJAX.registerOnload('transformations/xml.js', function () {
var $elm = $('#page_content').find('code.xml');
$elm.each(function () {
var $json = $(this);
var $pre = $json.find('pre');
/* We only care about visible elements to avoid double processing */
if ($pre.is(':visible')) {
var $highlight = $('<div class="xml-highlight cm-s-default"></div>');
$json.append($highlight);
CodeMirror.runMode($json.text(), 'application/xml', $highlight[0]);
$pre.hide();
}
});
});

View file

@ -0,0 +1,15 @@
/**
* XML editor plugin
*
* @package PhpMyAdmin
*/
AJAX.registerOnload('transformations/xml_editor.js', function () {
$('textarea.transform_xml_editor').each(function () {
CodeMirror.fromTextArea(this, {
lineNumbers: true,
indentUnit: 4,
mode: 'application/xml',
lineWrapping: true
});
});
});