| Current Path : /home/zqegovsj/www/us3web.haibo.com.cn/biguo/image/js/ |
| Current File : /home/zqegovsj/www/us3web.haibo.com.cn/biguo/image/js/checkTable.js |
function open4Table(str) {
// str = transHTML4Table(str);
var new_html = '<h6><a href="javascript:hidePop4Error(\'pop\')" title="close"> </a>Error</h6>'
+ '<div class="cent" style="padding: 0pt 20px 20px;">'
+ '<p class="red">Sorry, you input non-English characters (Marked in red below). Please modify them into English.</p> '
+ '<p ><div class="errorDiv" ></div></p></div>';
var new_body = '';
for (i = 0; i < str.length; i++) {
ch = str.charCodeAt(i);
errChar = str.charAt(i);
if (ch == 25 || (ch > 128 && !isOkSpecialChar(ch))) {
if (ch == 12288) {
new_body += '<font color="#CC0000"><b>&nbsp;</b></font>';
} else {
new_body += '<font color="#CC0000" size="+1"><b>' + errChar
+ '</b></font>';
}
} else {
new_body += errChar;
}
}
jQuery('#pop').html(new_html);
jQuery('#errorDiv').html(new_body);
showPopMenu('pop');
}
function transHTML4Table(str) {
var pattern = new RegExp("<(.|)+?>|( )", "gim");
str = str.replace(pattern, '');
return str;
}
function checkTable(checkType) {
var desc = document.getElementById('o11');
if (desc==null||checkDesc('o11')) {
if (document.getElementById(checkType)) {
var oEditor = FCKeditorAPI.GetInstance(checkType);
var tValue = oEditor.GetXHTML();
if (!checkSpecialChinese(tValue)) {
open4Table(tValue);
return false;
}
}
return jQuery.formValidator.PageIsValid('1');
} else {
return false;
}
}
function checkEcatalogTable(checkType) {
var desc = document.getElementById('o11');
if (desc==null||checkDesc('o11')) {
if (document.getElementById(checkType)) {
var oEditor = FCKeditorAPI.GetInstance(checkType);
var tValue = oEditor.GetXHTML();
if (!checkSpecialChinese(tValue)) {
open4Table(tValue);
return false;
}
}
return true;
} else {
return false;
}
}