2010 05/30 21:41
Category : カレン・システム
docReplace = function(txt){
var doc = txt.replace(/\[op:(\d)\,(\w+)\,(\w+)\,([\w\,]+)\]/g, function(e0,e1,e2,e3,e4){
return '<select id="' + e2 + '" onchange=eDispSelChg(this,"' + e3 + '") style="display:' +
(e1 == '1' ? 'inline' : 'none') + '"><option value="">***' + e3 + '***<\/option>' +
e4.replace(/(\w+)/g, '<option value="$1">$1<\/option>') + '<\/select>';}
);
doc = doc.replace(/\[form:(\w+)\]/g, function(e0,e1){
return (e1 == "sep" ? '<\/td><td class="right_content">' :
e1 == "end" ? '<\/td><\/tr><\/tbody><\/table><\/form>' :
'<form id="' + e1 + '" action="#" class="disp_form" onsubmit="return false">' +
'<table class="disp_menu"><tbody><tr><td class="left_content">'
);}
);
doc = doc.replace(/\[append:(\d)\,(\w+)\]/g, function(e0,e1,e2){
return '<\/td><\/tr><\/tbody><\/table>' +
(e1 == '1' ? '<textarea id="' + e2 + '" cols="80" rows="26" onkeypress="eDispCounter()" ' +
'onmousedown="eDispCounter()"><\/textarea>' : '<div id="mDisp"><\/div>') +
'<table class="disp_info"><tbody><tr><td class="left_content">';}
);
return doc;
};
var doc = txt.replace(/\[op:(\d)\,(\w+)\,(\w+)\,([\w\,]+)\]/g, function(e0,e1,e2,e3,e4){
return '<select id="' + e2 + '" onchange=eDispSelChg(this,"' + e3 + '") style="display:' +
(e1 == '1' ? 'inline' : 'none') + '"><option value="">***' + e3 + '***<\/option>' +
e4.replace(/(\w+)/g, '<option value="$1">$1<\/option>') + '<\/select>';}
);
doc = doc.replace(/\[form:(\w+)\]/g, function(e0,e1){
return (e1 == "sep" ? '<\/td><td class="right_content">' :
e1 == "end" ? '<\/td><\/tr><\/tbody><\/table><\/form>' :
'<form id="' + e1 + '" action="#" class="disp_form" onsubmit="return false">' +
'<table class="disp_menu"><tbody><tr><td class="left_content">'
);}
);
doc = doc.replace(/\[append:(\d)\,(\w+)\]/g, function(e0,e1,e2){
return '<\/td><\/tr><\/tbody><\/table>' +
(e1 == '1' ? '<textarea id="' + e2 + '" cols="80" rows="26" onkeypress="eDispCounter()" ' +
'onmousedown="eDispCounter()"><\/textarea>' : '<div id="mDisp"><\/div>') +
'<table class="disp_info"><tbody><tr><td class="left_content">';}
);
return doc;
};