//-------------------------------------------------------------------//
// ÇÁ·Î±×·¥¸í : 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,gmFrame,array;
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 = '';
}
// HTML edit
function editor_html(){
obj = window.open(_editor_url+'/html_edit.html','_editor_Html','width=650,height=495,scrollbars=no');
}
// Preview
function editor_view(){
obj = window.open(_editor_url+'/preview.html','_editor_view','width=650,height=550,scrollbars=yes');
}
// File uploaded
function file_upload(id,name){
if(id > 0){
document.getElementById('editor_stom').value = document.getElementById('editor_stom').value + '#' + _m_uploaded;
}
else{
document.getElementById('editor_stom').value = document.getElementById('editor_stom').value + '#' + _i_uploaded;
}
return window.open(_editor_url+'/'+name+'.html','_editor_tb','staus=no, width=400, height=435,scrollbars=no,toolbar=no,menubar=no');
} // end func
// 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 = 457; filename = 'table.html';
break;
case 2: // charac
width = 304; height = 375; filename = 'characteristic.html';
break;
case 3: // icon
width = 232; height = 248; filename = 'emotions.html';
break;
case 4: // Fontname
width = 250; height = 302; filename = 'fontname.html';
break;
case 5: // color
width = 260; height = 278; filename = 'color.html';
break;
case 6: // BG Color
width = 260; height = 278; filename = 'color.html';
break;
case 7: // Font Size
width = 350; height = 249; filename = 'fontsize.html';
break;
case 8: // Link
width = 360; height = 173; filename = 'hyperLink.html';
break;
}
if(!os){
if((key == 5) || (key == 6)){
val = (key == 6) ? 'backcolor' : 'forecolor';
}
}
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(/