Files
adminer/editor/static/editing.js

66 lines
1.5 KiB
JavaScript
Raw Normal View History

2025-03-27 10:11:35 +01:00
'use strict'; // Editor specific functions
2018-01-13 23:42:48 +01:00
function messagesPrint() {
}
2014-09-14 13:40:12 -07:00
function selectFieldChange() {
}
let helpOpen;
2014-09-14 13:40:12 -07:00
function helpMouseover() {
}
function helpMouseout() {
2012-08-04 22:52:50 -07:00
}
2025-03-19 22:04:30 +01:00
function helpClose() {
}
/** Display typeahead
* @param string
* @this HTMLInputElement
*/
function whisper(url) {
const field = this;
field.orig = field.value;
field.previousSibling.value = field.value; // accept number, reject string
return ajax(url + encodeURIComponent(field.value), xmlhttp => {
if (xmlhttp.status && field.orig == field.value) { // ignore old responses
field.nextSibling.innerHTML = xmlhttp.responseText;
field.nextSibling.style.display = '';
const a = field.nextSibling.firstChild;
if (a && a.firstChild.data == field.value) {
field.previousSibling.value = decodeURIComponent(a.href.replace(/.*=/, ''));
2025-03-23 15:10:18 +01:00
a.classList.add('active');
}
}
});
}
/** Select typeahead value
* @param MouseEvent
* @return boolean false for success
* @this HTMLDivElement
*/
function whisperClick(event) {
const field = this.previousSibling;
2025-03-21 23:41:46 +01:00
const el = event.target;
2013-07-12 14:06:44 -07:00
if (isTag(el, 'a') && !(event.button || event.shiftKey || event.altKey || isCtrl(event))) {
2011-05-04 15:53:26 +02:00
field.value = el.firstChild.data;
field.previousSibling.value = decodeURIComponent(el.href.replace(/.*=/, ''));
field.nextSibling.style.display = 'none';
return false;
}
}
2018-01-13 08:58:01 +01:00
/** Add new attachment field
* @this HTMLInputElement
*/
function emailFileChange() {
const el = this.cloneNode(true);
this.onchange = () => { };
2018-01-13 08:58:01 +01:00
el.value = '';
this.parentNode.appendChild(el);
}