init web ems all

This commit is contained in:
agtuser
2024-09-27 17:13:36 +08:00
parent 81c97acbe9
commit 5cc56f8078
4263 changed files with 798779 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,11 @@
/* 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
});
});
});