Menu

[f1bb48]: / js / phpMyEdit.js  Maximize  Restore  History

Download this file

106 lines (95 with data), 3.0 kB

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
/*
* phpMyEdit - instant MySQL table editor and code generator
*
* phpMyEdit.js - runtime javascript part of phpMyEdit
* ___________________________________________________
*
* Copyright (c) 1999-2002 John McCreesh <jpmcc@users.sourceforge.net>
* Copyright (c) 2001-2002 Jim Kraai <jkraai@users.sourceforge.net>
* Versions 5.0 and higher developed by Ondrej Jombik <nepto@php.net>
* Versions 5.7.2 and higher developed by Yves De Billoëz
* Copyright (c) 2002-2006 Platon Group, http://platon.sk/
* All rights reserved.
*
* See README.md file for more information about this software.
* See COPYING file for license information.
*
* Download the latest version from
* https://sourceforge.net/projects/phpmariaedit/
*/
/* $Platon: phpMyEdit/js/phpMyEdit.js,v 5.7.6 2024-01-15 12:57:07 Yves $ */
function PME_js_trim(str)
{
while (str.substring(0, 1) == " "
|| str.substring(0, 1) == "\n"
|| str.substring(0, 1) == "\r")
{
str = str.substring(1, str.length);
}
while (str.substring(str.length - 1, str.length) == " "
|| str.substring(str.length - 1, str.length) == "\n"
|| str.substring(str.length - 1, str.length) == "\r")
{
str = str.substring(0, str.length - 1);
}
return str;
}
function PME_js_filter_handler(theForm, theEvent)
{
var pressed_key = null;
if (theEvent.which) {
pressed_key = theEvent.which;
} else {
pressed_key = theEvent.keyCode;
}
if (pressed_key == 13) { // enter pressed
theForm.submit();
return false;
}
return true;
}
function PME_js_form_control(theForm, e) {
//console.log(theForm); // DEBUG
//console.log(e); // DEBUG
}
function PME_js_show_tab(theTab) {
//console.log(theTab); // DEBUG
}
/* function called to confirm deletion of record
*/
function PME_js_confirm(msg, e) {
//console.log(e); // DEBUG
return confirm(msg);
}
/* function called to show alert dialog
*/
function PME_js_alert(msg, e) {
//console.log(e); // DEBUG
return alert(msg);
}
/* function called before phpMyEdit main starting call
*/
function PME_js_init(phpOpts) {
PME_js_setPageTitle(phpOpts.tb);
//console.log(phpOpts); // DEBUG
}
/* set page title
*/
function PME_js_setPageTitle(pageTitle, pageTitleLink) {
/* remove leading pme_ from possible pageTitle */
if (pageTitle.toLowerCase().indexOf("pme_") == 0) pageTitle = pageTitle.substring(4);
document.title = pageTitle.charAt(0).toUpperCase() + pageTitle.substring(1);
let el = document.getElementById('PME-pagetitle');
if (el != null) {
if (el.hasAttribute('data-caption')) {
el.setAttribute('data-caption', document.title);
} else {
if (typeof pageTitleLink === 'undefined') {
el.innerHTML = document.title;
} else {
el.innerHTML = "<a href='" + pageTitleLink + "'>" + document.title + "</a>";
}
}
}
}
/* eof */
Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.