//-------------------------------------------------------------------//
// ÇÁ·Î±×·¥¸í : gmEditor v1.2
//-------------------------------------------------------------------//
// ÃÖÃÊ °³¹ß ¿Ï·áÀÏ : 2006-01-05
// °³¹ß»ç ¹× ÀúÀÛ±ÇÀÚ : PHP¸ó½ºÅÍ
// À¥»çÀÌÆ® : http://www.phpmonster.co.kr
// °³ ¹ß ÀÚ : ¹Ú¿äÇÑ (misnam@gmail.com)
//-------------------------------------------------------------------//
// Ä«ÇǶóÀÌÆ®
//-------------------------------------------------------------------//
// º» ÇÁ·Î±×·¥Àº ¹«·á ÇÁ·Î±×·¥À¸·Î ¹èÆ÷µË´Ï´Ù.
// gmEditor´Â GNU General Public License(GPL) ¸¦ µû¸¨´Ï´Ù.
// º¸´Ù ÀÚ¼¼ÇÑ ³»¿ëÀº LICENSE¸¦ ÂüÁ¶ÇϽʽÿä.
// Âü°í: http://korea.gnu.org/people/chsong/copyleft/gpl.ko.htmll
//-------------------------------------------------------------------//
// °³¹ßȯ°æ
//-------------------------------------------------------------------//
// Browser: ÀͽºÇ÷η¯, ÆÄÀÌ¾îÆø½º, ³×½ºÄÉÀÌÇÁ, ¿ÀÆä¶ó
// Server : PHP°¡ Áö¿øµÇ´Â ¸ðµç ¼¹ö
//-------------------------------------------------------------------//
var str,os;
var gmFrame = '';
var ostmp = navigator.appName.charAt(0);
// browser
os = (ostmp=='M') ? '' : 1;
// frame type
gmFrame = !os ? frames.gmEditor : document.getElementById("gmEditor").contentWindow;
// IE ? Nets
str = "\n";
// new document
function newDoc(){
gmFrame.document.open("text/html");
gmFrame.document.write(str);
gmFrame.document.write(" ");
gmFrame.document.close();
gmFrame.focus();
}
// layer Hide
function Layerhide(name){
document.getElementById(name).innerHTML = '';
}
// zoom
function zoom(id){
if(id) gmFrame.document.body.style.zoom = id + '%';
} // end func
function zoom_click(){
if(os == 1) return false;
var zoom_per = ['300','250','200','150','100','75','50','25'];
var body = '
';
body += ' |
';
body += '';
body += ' ';
body += ' ';
body += '';
body += ' ';
body += ' ' + editor_lang[78];
body += ' | ';
body += ' ';
body += ' ';
body += ' | ';
body += ' ';
body += ' | ';
for(var i=0; i';
body += ' ';
body += ' ' + zoom_per[i] + '%';
body += ' | ';
body += '';
body += ' | ';
} // end for
body += ' | ';
body += ' ';
body += ' | ';
body += '
';
body += '
';
document.getElementById('zoomin').innerHTML = body;
} // end func
// modal
function createHTML(val,key){
var width,height,filename;
switch(key){
case 1: // Table
width = 352; height = !os ? 490 : 457; filename = 'table.php';
break;
case 2: // charac
width = 304; height = !os ? 415 : 375; filename = 'characteristic.php';
break;
case 3: // icon
width = 232; height = !os ? 275 : 248; filename = 'emotions.php';
break;
case 4: // Fontname
width = 250; height = !os ? 335 : 302; filename = 'fontname.php';
break;
case 5: // color
width = 260; height = !os ? 305 : 278; filename = 'color.php';
break;
case 6: // Back Color
width = 260; height = !os ? 305 : 278; filename = 'color.php';
break;
case 7: // Font Size
width = 350; height = !os ? 280 : 249; filename = 'fontsize.php';
break;
case 8: // Link
width = 360; height = !os ? 200 : 173; filename = 'hyperLink.php';
break;
case 9: // Image Uploaded
width = 400; height = !os ? 460 : 434; filename = 'upfile.php';
break;
case 10: // Media Uploaded
width = 400; height = !os ? 460 : 434; filename = 'media.php';
break;
case 11: // Html Editor
width = 550; height = !os ? 520 : 485; filename = 'html_edit.php';
break;
case 12: // preview
width = 640; height = 580; filename = 'preview.php';
break;
}
if(!os){
if((key == 5) || (key == 6)){
val = (key == 6) ? 'backcolor' : 'forecolor';
}
arguments.charsets = document.getElementById('editor_stom').value;
arguments.arg = val;
arguments.url = _editor_url;
if((key == 11) || (key == 12)) arguments.html = window.SubmitHTML();
vrValue = window.showModalDialog(_editor_url+'/'+filename+'?lang='+arguments.charsets,arguments,"help=no;dialogWidth="+width+"px;dialogHeight:"+height+"px; center:yes; status:no; resizable:no;");
// return Value Key
if(vrValue){
if(vrValue.mode == 'makeTag'){
var tmp_vrValue = vrValue.val;
if(tmp_vrValue) window.HTMLPaste(tmp_vrValue);
}
else if(vrValue.mode == 'InsertData'){
gmFrame.document.body.innerHTML = vrValue.html;
}
else{
window.htmltrue(vrValue.mode,vrValue.val,false);
}
}
}
else{
document.getElementById('editor_stom').value = document.getElementById('editor_stom').value + '#' + val;
obj = window.open(_editor_url+'/'+filename,'_editor_tb','staus=no, width='+width+', height='+height+',scrollbars=no,toolbar=no,menubar=no');
}
}
// Contents
function Edit_Modify(_contentName,_contentValue){
return eval("document." + _contentName + "." + _contentValue + ".value");
}
// Submit's
function SubmitHTML(){
var tmp = !os ? gmFrame.document.body.innerHTML : gmFrame.document.documentElement.innerHTML;
var tmp_content = '';
tmp_content = tmp.replace(/<(\/?)p>/gi,"");
tmp_content = tmp_content.replace(/
/gi,"");
tmp_content = tmp_content.replace(/ /gi,"");
tmp_content = tmp_content.replace(/ /gi,"");
tmp_content = tmp_content.replace(/(.*?)<(\/?)head>/gi,"");
tmp_content = tmp_content.replace(/