Initial commit

This commit is contained in:
2022-11-21 09:47:28 +01:00
commit 76cec83d26
11652 changed files with 1980467 additions and 0 deletions

View File

@ -0,0 +1,28 @@
/* vim: set expandtab sw=4 ts=4 sts=4: */
/**
* 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(event) {
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,18 @@
/* vim: set expandtab sw=4 ts=4 sts=4: */
/**
* 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,17 @@
/* vim: set expandtab sw=4 ts=4 sts=4: */
/**
* 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,12 @@
/* vim: set expandtab sw=4 ts=4 sts=4: */
/**
* SQL syntax highlighting transformation plugin js
*
* @package PhpMyAdmin
*/
AJAX.registerOnload('transformations/sql_editor.js', function() {
$('textarea.transform_sql_editor').each(function () {
PMA_getSQLEditor($(this), {}, 'both');
});
});

View File

@ -0,0 +1,18 @@
/* vim: set expandtab sw=4 ts=4 sts=4: */
/**
* 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,16 @@
/* vim: set expandtab sw=4 ts=4 sts=4: */
/**
* 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
});
});
});