Javascript add document.noalyss_debug global variable

This commit is contained in:
sparkyx 2024-11-15 21:04:28 +01:00
parent 8804860044
commit 096db515f1
4 changed files with 30 additions and 6 deletions

View file

@ -384,7 +384,7 @@ var ManageTable = function (p_table_name)
$(obj.id).setStyle(here.mt_style);
remove_waiting_box();
$(obj.id).update(x['html']);
Effect.SlideDown(obj.id,{duration:0.3,scaleX:false,scaleY:true,scaleContent:false});
$(obj.id).show();
} catch (e) {
smoke.alert(content[48] + e.message);
}

22
html/js/noalyss_debug.js Normal file
View file

@ -0,0 +1,22 @@
/*
* This file is part of NOALYSS.
*
* NOALYSS is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* NOALYSS is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with NOALYSS; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
/**
* @file this file is for enable debug , just check variable document.debug_noalyss
*/
document.debug_noalyss=true;

View file

@ -126,11 +126,11 @@ function trim(s) {
function id$(ID) {
if (ID instanceof Object ) return ID;
if (document.getElementById(ID)) {
document.getElementById(ID);
return document.getElementById(ID);
} else if (document.all) {
return document.all[ID];
} else {
console.error(`id$ ${ID}`)
document.debug_noalyss&&console.error(`id$ ${ID}`)
return undefined;
}
}
@ -142,7 +142,7 @@ function id$(ID) {
* @returns {*}
*/
function g(ID) {
console.warn(`g(${ID} is deprecated, use id$`);
document.debug_noalyss&& console.warn(`g(${ID} is deprecated, use id$`);
return id$(ID);
}
function get_next_layer(){
@ -3186,7 +3186,7 @@ function confirm_box(p_obj, p_message, p_callback_true, p_waiting) {
* @returns void
*/
function alert_box(p_message) {
smoke.alert(p_message, undefined, {ok: 'ok', classname: "inner_box"});
smoke.alert(p_message, undefined, {ok: 'ok', classname: "inner_box",title:'ATTENTION'});
}