fixed undeclared javascript variables
This commit is contained in:
@@ -11,7 +11,7 @@ $Source$
|
|||||||
- check config file also on wakeup (bug #1376522)
|
- check config file also on wakeup (bug #1376522)
|
||||||
* libraries/Config.class.php, libraries/common.lib.php:
|
* libraries/Config.class.php, libraries/common.lib.php:
|
||||||
fixed handling of https and $cfg['ForceSSL'] (bug #1379491)
|
fixed handling of https and $cfg['ForceSSL'] (bug #1379491)
|
||||||
* left.php: fixed undeclared javascript variables
|
* left.php, js/function.js: fixed undeclared javascript variables
|
||||||
|
|
||||||
2005-12-14 Michal Čihař <michal@cihar.com>
|
2005-12-14 Michal Čihař <michal@cihar.com>
|
||||||
* libraries/config.default.php, Documentation.html: Transliterate invalid
|
* libraries/config.default.php, Documentation.html: Transliterate invalid
|
||||||
|
128
js/functions.js
128
js/functions.js
@@ -20,15 +20,15 @@ var only_once_elements = new Array();
|
|||||||
* f.e. only on first focus
|
* f.e. only on first focus
|
||||||
*/
|
*/
|
||||||
function selectContent( element, lock, only_once ) {
|
function selectContent( element, lock, only_once ) {
|
||||||
if ( only_once && only_once_elements[element.name] ) {
|
if ( only_once && only_once_elements[element.name] ) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
only_once_elements[element.name] = true;
|
only_once_elements[element.name] = true;
|
||||||
|
|
||||||
if ( lock ) {
|
if ( lock ) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
element.select();
|
element.select();
|
||||||
}
|
}
|
||||||
@@ -77,7 +77,7 @@ function confirmLink(theLink, theSqlQuery)
|
|||||||
|
|
||||||
var is_confirmed = confirm(confirmMsg + ' :\n' + theSqlQuery);
|
var is_confirmed = confirm(confirmMsg + ' :\n' + theSqlQuery);
|
||||||
if (is_confirmed) {
|
if (is_confirmed) {
|
||||||
if ( typeof(theLink.href) != 'undefined' ) {
|
if ( typeof(theLink.href) != 'undefined' ) {
|
||||||
theLink.href += '&is_js_confirmed=1';
|
theLink.href += '&is_js_confirmed=1';
|
||||||
} else if ( typeof(theLink.form) != 'undefined' ) {
|
} else if ( typeof(theLink.form) != 'undefined' ) {
|
||||||
theLink.form.action += '?is_js_confirmed=1';
|
theLink.form.action += '?is_js_confirmed=1';
|
||||||
@@ -292,7 +292,7 @@ function emptyCheckTheField(theForm, theFieldName)
|
|||||||
function emptyFormElements(theForm, theFieldName)
|
function emptyFormElements(theForm, theFieldName)
|
||||||
{
|
{
|
||||||
var theField = theForm.elements[theFieldName];
|
var theField = theForm.elements[theFieldName];
|
||||||
isEmpty = emptyCheckTheField(theForm, theFieldName);
|
var isEmpty = emptyCheckTheField(theForm, theFieldName);
|
||||||
|
|
||||||
if (isEmpty) {
|
if (isEmpty) {
|
||||||
theForm.reset();
|
theForm.reset();
|
||||||
@@ -470,30 +470,30 @@ var marked_row = new Array;
|
|||||||
*/
|
*/
|
||||||
function PMA_markRowsInit() {
|
function PMA_markRowsInit() {
|
||||||
// for every table row ...
|
// for every table row ...
|
||||||
var rows = document.getElementsByTagName('tr');
|
var rows = document.getElementsByTagName('tr');
|
||||||
for ( var i = 0; i < rows.length; i++ ) {
|
for ( var i = 0; i < rows.length; i++ ) {
|
||||||
// ... with the class 'odd' or 'even' ...
|
// ... with the class 'odd' or 'even' ...
|
||||||
if ( 'odd' != rows[i].className.substr(0,3) && 'even' != rows[i].className.substr(0,4) ) {
|
if ( 'odd' != rows[i].className.substr(0,3) && 'even' != rows[i].className.substr(0,4) ) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
// ... add event listeners ...
|
// ... add event listeners ...
|
||||||
// ... to highlight the row on mouseover ...
|
// ... to highlight the row on mouseover ...
|
||||||
if ( navigator.appName == 'Microsoft Internet Explorer' ) {
|
if ( navigator.appName == 'Microsoft Internet Explorer' ) {
|
||||||
// but only for IE, other browsers are handled by :hover in css
|
// but only for IE, other browsers are handled by :hover in css
|
||||||
rows[i].onmouseover = function() {
|
rows[i].onmouseover = function() {
|
||||||
this.className += ' hover';
|
this.className += ' hover';
|
||||||
}
|
}
|
||||||
rows[i].onmouseout = function() {
|
rows[i].onmouseout = function() {
|
||||||
this.className = this.className.replace( ' hover', '' );
|
this.className = this.className.replace( ' hover', '' );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// Do not set click events if not wanted
|
// Do not set click events if not wanted
|
||||||
if (rows[i].className.search(/noclick/) != -1) {
|
if (rows[i].className.search(/noclick/) != -1) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
// ... and to mark the row on click ...
|
// ... and to mark the row on click ...
|
||||||
rows[i].onmousedown = function() {
|
rows[i].onmousedown = function() {
|
||||||
var unique_id;
|
var unique_id;
|
||||||
var checkbox;
|
var checkbox;
|
||||||
|
|
||||||
checkbox = this.getElementsByTagName( 'input' )[0];
|
checkbox = this.getElementsByTagName( 'input' )[0];
|
||||||
@@ -502,8 +502,8 @@ function PMA_markRowsInit() {
|
|||||||
} else if ( this.id.length > 0 ) {
|
} else if ( this.id.length > 0 ) {
|
||||||
unique_id = this.id;
|
unique_id = this.id;
|
||||||
} else {
|
} else {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( typeof(marked_row[unique_id]) == 'undefined' || !marked_row[unique_id] ) {
|
if ( typeof(marked_row[unique_id]) == 'undefined' || !marked_row[unique_id] ) {
|
||||||
marked_row[unique_id] = true;
|
marked_row[unique_id] = true;
|
||||||
@@ -512,32 +512,32 @@ function PMA_markRowsInit() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if ( marked_row[unique_id] ) {
|
if ( marked_row[unique_id] ) {
|
||||||
this.className += ' marked';
|
this.className += ' marked';
|
||||||
} else {
|
} else {
|
||||||
this.className = this.className.replace(' marked', '');
|
this.className = this.className.replace(' marked', '');
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( checkbox && checkbox.disabled == false ) {
|
if ( checkbox && checkbox.disabled == false ) {
|
||||||
checkbox.checked = marked_row[unique_id];
|
checkbox.checked = marked_row[unique_id];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// ... and disable label ...
|
// ... and disable label ...
|
||||||
var labeltag = rows[i].getElementsByTagName('label')[0];
|
var labeltag = rows[i].getElementsByTagName('label')[0];
|
||||||
if ( labeltag ) {
|
if ( labeltag ) {
|
||||||
labeltag.onclick = function() {
|
labeltag.onclick = function() {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// .. and checkbox clicks
|
// .. and checkbox clicks
|
||||||
var checkbox = rows[i].getElementsByTagName('input')[0];
|
var checkbox = rows[i].getElementsByTagName('input')[0];
|
||||||
if ( checkbox ) {
|
if ( checkbox ) {
|
||||||
checkbox.onclick = function() {
|
checkbox.onclick = function() {
|
||||||
// opera does not recognize return false;
|
// opera does not recognize return false;
|
||||||
this.checked = ! this.checked;
|
this.checked = ! this.checked;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
window.onload=PMA_markRowsInit;
|
window.onload=PMA_markRowsInit;
|
||||||
|
|
||||||
@@ -548,11 +548,11 @@ window.onload=PMA_markRowsInit;
|
|||||||
* @param container DOM element
|
* @param container DOM element
|
||||||
*/
|
*/
|
||||||
function markAllRows( container_id ) {
|
function markAllRows( container_id ) {
|
||||||
var rows = document.getElementById(container_id).getElementsByTagName('tr');
|
var rows = document.getElementById(container_id).getElementsByTagName('tr');
|
||||||
var unique_id;
|
var unique_id;
|
||||||
var checkbox;
|
var checkbox;
|
||||||
|
|
||||||
for ( var i = 0; i < rows.length; i++ ) {
|
for ( var i = 0; i < rows.length; i++ ) {
|
||||||
|
|
||||||
checkbox = rows[i].getElementsByTagName( 'input' )[0];
|
checkbox = rows[i].getElementsByTagName( 'input' )[0];
|
||||||
|
|
||||||
@@ -565,10 +565,10 @@ function markAllRows( container_id ) {
|
|||||||
marked_row[unique_id] = true;
|
marked_row[unique_id] = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -578,11 +578,11 @@ function markAllRows( container_id ) {
|
|||||||
* @param container DOM element
|
* @param container DOM element
|
||||||
*/
|
*/
|
||||||
function unMarkAllRows( container_id ) {
|
function unMarkAllRows( container_id ) {
|
||||||
var rows = document.getElementById(container_id).getElementsByTagName('tr');
|
var rows = document.getElementById(container_id).getElementsByTagName('tr');
|
||||||
var unique_id;
|
var unique_id;
|
||||||
var checkbox;
|
var checkbox;
|
||||||
|
|
||||||
for ( var i = 0; i < rows.length; i++ ) {
|
for ( var i = 0; i < rows.length; i++ ) {
|
||||||
|
|
||||||
checkbox = rows[i].getElementsByTagName( 'input' )[0];
|
checkbox = rows[i].getElementsByTagName( 'input' )[0];
|
||||||
|
|
||||||
@@ -592,9 +592,9 @@ function unMarkAllRows( container_id ) {
|
|||||||
rows[i].className = rows[i].className.replace(' marked', '');
|
rows[i].className = rows[i].className.replace(' marked', '');
|
||||||
marked_row[unique_id] = false;
|
marked_row[unique_id] = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -865,15 +865,15 @@ function setVerticalPointer(theRow, theColNum, theAction, theDefaultColor1, theD
|
|||||||
* @return boolean always true
|
* @return boolean always true
|
||||||
*/
|
*/
|
||||||
function setCheckboxes( container_id, state ) {
|
function setCheckboxes( container_id, state ) {
|
||||||
var checkboxes = document.getElementById(container_id).getElementsByTagName('input');
|
var checkboxes = document.getElementById(container_id).getElementsByTagName('input');
|
||||||
|
|
||||||
for ( var i = 0; i < checkboxes.length; i++ ) {
|
for ( var i = 0; i < checkboxes.length; i++ ) {
|
||||||
if ( checkboxes[i].type == 'checkbox' ) {
|
if ( checkboxes[i].type == 'checkbox' ) {
|
||||||
checkboxes[i].checked = state;
|
checkboxes[i].checked = state;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
} // end of the 'setCheckboxes()' function
|
} // end of the 'setCheckboxes()' function
|
||||||
|
|
||||||
|
|
||||||
@@ -950,7 +950,7 @@ function insertValueQuery() {
|
|||||||
var myListBox = document.sqlform.dummy;
|
var myListBox = document.sqlform.dummy;
|
||||||
|
|
||||||
if(myListBox.options.length > 0) {
|
if(myListBox.options.length > 0) {
|
||||||
sql_box_locked = true;
|
sql_box_locked = true;
|
||||||
var chaineAj = "";
|
var chaineAj = "";
|
||||||
var NbSelect = 0;
|
var NbSelect = 0;
|
||||||
for(var i=0; i<myListBox.options.length; i++) {
|
for(var i=0; i<myListBox.options.length; i++) {
|
||||||
@@ -979,7 +979,7 @@ function insertValueQuery() {
|
|||||||
} else {
|
} else {
|
||||||
myQuery.value += chaineAj;
|
myQuery.value += chaineAj;
|
||||||
}
|
}
|
||||||
sql_box_locked = false;
|
sql_box_locked = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user