//-------------------------------------------------------------------//
// 프로그램명 : 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(/