/* ** ÇÁ·ÎÁ§Æ®¸í: ¾ËµðÅÍ (¾Ë¸¯ + wysiwyg ¿¡µðÅÍ) ** ** È­Àϸí: alditor.js ** ÀÛ¼ºÀÚ: Alex Suk Hyun Park a.k.a Alik (http://www.alik.info/ | alikong@gmail.com) ** ÀÛ¼ºÀÏ: 2006-08-19 ** ÃÖÁ¾ ¼öÁ¤ÀÏ: 2006-11-06 ** ** ** ¶óÀ̼¾½º Á¤º¸: ** ------------------------------------------------------------------------- ** ¼Ò½º ¼öÁ¤ ¹× ¹èÆ÷ ºÒ°¡ ** È­ÀÏÀÇ Á÷Á¢ ¸µÅ© (°³ÀÎ À¯Æ÷) ºÒ°¡ ** °³ÀÎÀûÀÎ ¿ëµµ·Î »ç¿ë°¡´ÉÇÏ¸ç »ó¾÷Àû »ç¿ë½Ã »ó±â¸í½ÃµÈ ÀÛ¼ºÀÚ¿¡°Ô ¿¬¶ô ¿ä¸Á. ** ¼Ò½º ¹èÆ÷, ¾÷µ¥ÀÌÆ® ¹× ±â´É Ãß°¡µîÀº ¸ðµÎ http://www.alik.info ¿¡¼­ È®ÀÎ ¿ä¸Á. ** °ÇÀÇ»çÇ× ¹× ¼öÁ¤»çÇ× ¶ÇÇÑ http://www.alik.info ·Î ¹®ÀÇ ¿ä¸Á ** ¼Ò½º¸¦ Á¦¿ÜÇÑ ¹öư ¾ÆÀÌÄÜµî ¸ðµç À̹ÌÁöÀÇ ÀúÀÛ±ÇÀº À̹ÌÁö Á¦ÀÛÀÚ¿¡°Ô ÀÖÀ½. ** ** ** ±â´É ¼³¸í: ** ------------------------------------------------------------------------- ** HTML ³»ºÎ¿¡ ÀÖ´Â Textarea ¸¦ À§ÁöÀ¨(WYSIWYG) ¿¡µðÅÍ·Î º¯È¯ÇÔ. ** ÇÑ ÆäÀÌÁö³» ´Ù¼öÀÇ Textarea ¸¦ ¼±º°Àû(Textarea ű×ÀÇ ¼Ó¼º¿¡ editable=0 Ãß°¡½Ã º¯È¯µÇÁö ¾ÊÀ½) ** ¶Ç´Â Àüü º¯È¯(±âº» ¼³Á¤) °¡´ÉÇÔ. ** ** ** »ç¿ë¹ý: ** ------------------------------------------------------------------------- ** ÀÚ¼¼ÇÑ ¼³¸í, ¼³Á¤¹æ¹ý ¹× »ç¿ë¹ýÀº http://www.alik.info/ ¹æ¹® ¿ä¸Á. */ /////////// »ç¿ëÀÚ ¼³Á¤ ½ÃÀÛ //////////// function alditorConfig () { /* this.alditorPath = ¾ËµðÅͰ¡ »ðÀÔµÈ À¥ÆäÀÌÁö¸¦ ±âÁØÀ¸·ÎÇÑ ¾ËµðÅÍ Æú´õ °æ·Î (³¡¿¡ / Çʼö) ·çÆ®·Î ºÎÅÍ Àý´ë°æ·Î¸¦ Ãßõ~ ( ./ °¡ ¾Æ´Ñ / Àº ·çÆ®¸¦ ±âÁØÀ¸·Î ÇÔ, ¾Æ·¡ »ùÇÃÀº ÇöÀç ·çÆ®¿¡ alditor ¿¡ ¾÷·ÎµåµÈ »óȲÀ¸·Î ¼³Á¤) this.buttonSet = »ç¿ëÇÒ ¹öư¼¼Æ®ÀÇ À̸§ (buttons Æú´õ ¾È¿¡ ¹öưÀ̹ÌÁöµéÀÌ ÀÖ´Â Æú´õÀÇ À̸§) */ this.alditorPath = "./alditor/"; this.buttonSet = "alik_nontoxic"; /* this.uploadLink = È­ÀÏÀ» ¾÷·Îµå ÇÒ¼ö ÀÖ´Â ¼­ºñ½ºÁ¦°ø ÆäÀÌÁöÀÇ ÁÖ¼Ò http://www.imageshack.us/ (¿Ü±¹¼­¹ö¶ó »ì¦ ´À¸².) http://img.npiza.com/ http://image.widesoccer.com/index.html (ºÎȰÇÔ) µîµî À¥¿¡¼­ °Ë»öÇϽñæ... (ȤÀº º»ÀÎÀÇ »çÀÌÆ®¿¡ ȸ¿øÁ¦ ¶Ç´Â ÀÚÀ¯ ¾÷·Îµå ÆäÀÌÁö¸¦ ¸¸µé¾î¼­ ¿¬°áÇÒ¼ö ÀÖÀ½ ^^ .... Â÷ÈÄ¿¡ Áö¿øÇսôÙ!) */ this.uploadLink = 'http://image.widesoccer.com/index.html'; /* this.spellcheckLink = ¸ÂÃã¹ý °Ë»ç ¼­ºñ½ºÁ¦°ø ÆäÀÌÁöÀÇ ÁÖ¼Ò (Á¾Á¾ º¯ÇÔ..¤Ì.¤Ì, º¯°æ½Ã http://urimal.cs.pusan.ac.kr/ ¿¡¼­ 'Çѱ¹¾î ¸ÂÃã¹ý/¹®¹ý°Ë»ç±â' ÁÖ¼Ò¸¦ ã±â ¹Ù¶÷) this.spellcheckAction = ¸ÂÃã¹ý °Ë»ç¸¦ À§ÇÑ Æû Àü¼Û½Ã¿¡ »ç¿ëµÉ action ÁÖ¼Ò (ÇöÀç À̸§¿¡¼­ ¾ÕÀÇ ¾ÆÀÌÇÇÁÖ¼Ò ¸¸ ¹Ù²ð °¡´É¼ºÀÌ ¸¹À½) */ this.spellcheckLink = 'http://164.125.36.47/urimal-spellcheck.html'; this.spellcheckAction = 'http://164.125.36.47/WebSpell_ISAPI.dll?Check'; /* this.runOnLoad = ÆäÀÌÁö ·Îµå½Ã ¿¡µðÅÍ·Î ½ÃÀÛÇÒ±î¿ä? true : false; Âü°í: false·Î ÁöÁ¤ÇÒ°æ¿ì ¿¡µðÅÍ È°¼ºÈ­ ¹öưÀº ¾Æ·¡ ¿¹Á¦¸¦ Âü°í ¿¹Á¦: ¿¡µðÅÍ ON this.setFocus = ÆäÀÌÁö ·Îµå½Ã Æ÷Ä¿½º¸¦ ¿¡µðÅÍ·Î À̵¿½Ãų±î¿ä? (¿¡µðÅͰ¡ ÇÑÆäÀÌÁö¿¡ ÇѰ³ ÀÌ»óÀÎ »óȲ¿¡¼­ true ¶ó¸é ù¹øÂ° ¿¡µðÅÍ·Î Æ÷Ä¿½º°¡ À̵¿µÊ.) true : false; this.useSafeFocus = À§ ¼³Á¤¿¡¼­ setFocus ¸¦ true ·Î ÇßÀ»½Ã, º» ¼³Á¤µµ true ·Î ÇÑ´Ù¸é ¿¡µðÅͰ¡ È­¸éÀÇ ÇÏ´Ü(ÄÚ¸àÆ® ÀÔ·ÂÀÇ °æ¿ì)¿¡ Àִ°æ¿ì´Â Æ÷Ä¿½º¸¦ ÁÖÁö ¾ÊÀ½À¸·Î¼­ ºÎÀûÀýÇÑ ½ºÅ©·ÑÀ» ¹æÁöÇÑ´Ù. true : false; */ this.runOnLoad = true; this.setFocus = false; //////////// °¡º±°Ô this.useSafeFocus = false; /* this.allowStretch = ¿¡µðÅÍ¿µ¿ªÀ» ³»¿ë¿¡ ¸Â°Ô ´Ã¾î³ª°Ô ÇÒ±î¿ä? (½ºÅ©·Ñ¹Ù°¡ ¾È»ý±â´Â´Ù´Â°ÅÁÒ ^^) µå·¹±×³ª À̰ųª µÑÁß¿¡ Çϳª¸¸ ¾²¸é ÁÁÀ»µí... true : false */ this.allowStretch = false; /* this.movableToolbar = Åø¹Ù¸¦ µå·¹±×ÇØ¼­ »ó/ÇÏ À§Ä¡¸¦ Á¶Á¤ÇÒ¼ö ÀÖ°Ô ÇÒ±î¿ä? true : false */ this.movableToolbar = false; ////////////// °¡º±°Ô /* this.allowDrag = ¸®»çÀÌÁî µå·¹±× Çã¿ë¿©ºÎ true : false this.dragMode = ¸®»çÀÌÁî µå·¹±× ¹æÇâÁ¦ÇÑ 1 = °¡·Î¸¸ ´Ã¾î³ª´Â ¸ðµå, 2 = ¼¼·Î¸¸ ´Ã¾î³ª´Â ¸ðµå, 3 = ¹æÇâ Á¦ÇÑ ¾ø´Â ÀÚÀ¯¸ðµå this.minWidth , this.minHeight = ¸®»çÀÌÁî °¡´ÉÇÑ ÃÖ¼Ò ³ÐÀÌ¿Í ³ôÀÌ ÁöÁ¤ (´ÜÀ§ = Çȼ¿) */ this.allowDrag = false; /////////////////// °¡º±°Ô this.dragMode = 2; this.minWidth = 200; this.minHeight = 200; /* this.useEnterBR = ¿£ÅÍ ÀԷ½à ÀÚµ¿À¸·Î ½¬ÇÁÆ®+¿£ÅÍ (
) Çü½ÄÀ¸·Î º¯È¯ÇØÁÙ±î¿ä? (¹®´Ü¹Ù²ÞÀ» ÁٹٲÞÀ¸·Î ¹Ù²ãÁÖ´Â ±â´É) true : false this.useAutoP = À§¿¡ ¼³Á¤ÇÑ useEnterBR ÀÌ true ¶ó¸é ¿£ÅÍ µÎ¹ø ÀԷ½à ÀÚµ¿À¸·Î º¸Åë¿£ÅÍ ÇѹøÀÔ·ÂÀ¸·Î º¯È¯ÇØÁÙ±î¿ä? (ÇѹøÀº ÁÙ¹Ù²Þ µÎ¹øÀº ¹®´Ü¹Ù²Þ) true : false */ this.useEnterBR = true; this.useAutoP = true; /* this.showPath = ¿¡µðÅÍ ÇÏ´ÜÀÇ Å±׼±Åñâ´É Çã¿ë¿©ºÎ true : false this.showPathSafeMode = showPath°¡ true À϶§ ³Ê¹« ´À¸°°¨ÀÌ ÀÖ´Ù¸é showPathSafeMode ¸¦ true·Î ÁöÁ¤ÇÏ¸é ¼Óµµ°¡ Á¶±Ý Áõ°¡ÇÑ´Ù (ű׸ñ·ÏÀÌ º»¹®¿¡ ³»¿ëÀԷ½ÿ¡¼­ ¹æÇüŰÀԷ½ðú Ŭ¸¯½Ã·Î ¾÷µ«µÇ°Ô º¯°æµÊ, true ±ÇÀå!) true : false */ this.showPath = true; this.showPathSafeMode = true; /* this.useExtraHTML = ¿¡µðÅÍ ¿ìÃø¿¡ ´Ù¾çÇÑ div »óÀÚ¸ðÀ½ÀÌ ³ª¿É´Ï´Ù. true : false this.useExtraHTMLwidth = À§¿¡ ¸í½ÃµÈ div »óÀÚ¸ðÀ½ÀÇ °¡·Î±æÀÌ (´ÜÀ§ = Çȼ¿) alditor.css ¿¡¼­ .extraDiv ÀÇwidth ¿Í µ¿ÀÏÇÏ°Ô ÁöÁ¤ÇØÁà¾ßÇÔ */ this.useExtraHTML = false; this.useExtraHTMLwidth = 120; /* this.useExpansion = Åø¹Ù¿¡ ¿©·¯°³ÀÇ ¹öưÁÙÀÌ Àִ°æ¿ì ¹öưÀ¸·Î È®ÀåÇÏ´Â Çü½ÄÀ¸·Î »ç¿ëÇÒ±î¿ä? true : false this.minimumRow = È®ÀåÇÏ´Â Çü½ÄÀ» »ç¿ëÇÏ½Å´Ù¸é ±âº»À¸·Î ¸îÁÙÀ» º¸¿©ÁÙ±î¿ä? true : false */ this.useExpansion = false; this.minimumRow = 1; /* this.noSelect = ±Û²Ã°ú ±ÛÀÚÅ©±â ¼³Á¤À» select °¡ ¾Æ´Ñ ·¹À̾î·Î Ç¥½ÃÇÒ±î¿ä? true : false this.freeFontSize = ±ÛÀÚÅ©±â ¼³Á¤À» select °¡ ¾Æ´Ñ ·¹À̾î·Î Ç¥½ÃÇÒ¶§ ±âº»¹æ½Ä(Ç¥ÁØ,¾ÈÁ¤ÀûÀÓ,8,10,12,14,18,24,36pt ·Î ¿É¼ÇÀÌ Á¦ÇÑÀûÀÓ) À» ¾µ±î¿ä? ¾Æ´Ô ¿øÇϴµ¥·Î (±ÛÀÚ ¼±ÅÃÈĸ¸ º¯°æ°¡´É, °ü¸®ÀÚ°¡ ¿øÇÏ´Â »çÀÌÁî Ãß°¡ °¡´É) ¹Ù²Ù´Â ¹æ½ÄÀ¸·Î ÇÒ±î¿ä? true : false */ this.noSelect = false; this.freeFontSize = false; /* this.targetBlank = ¿¡µðÅ;ȿ¡ »ðÀÔµÈ ¸ðµç ¸µÅ©µéÀÇ Å¸ÄÏÀ» »õâÀ¸·Î ÁöÁ¤ÇÒ±î¿ä? true : false */ this.targetBlank = true; /* this.imgKeepAddress = IE ÀÇ À̹ÌÁö »ðÀԽà »ó´ë°æ·Î°¡ ÀÚµ¿À¸·Î Àý´ë°æ·Î·Î ¹Ù²î´Â°É ¸·À»±î¿ä? (ÃÖÁ¾ Àü¼Û½Ã º¯È¯µÊ) true : false */ this.imgKeepAddress = true; /* this.useCopy = ±Û ³¯¸² ¹æÁö¿ë ³»¿ëº¹»ç ±â´ÉÀÇ »ç¿ë¿©ºÎ true : false this.useContentCheck = ±Û ³»¿ëÀÇ ±æÀÌ Ã¼Å© ±â´ÉÀÇ »ç¿ë¿©ºÎ true : false this.minimumContent = À§ üũ ±â´ÉÀÇ ±âÁØ ±ÛÀÚ¼ö (¸îÀÚ ÀÌ»ó ½á¾ß µî·ÏÀÌ µÇ´Â... ±× ±â´É) 1ºÎÅÍ ~ ¹«ÇÑ´ë (Á¤¼ö) this.saveRemoteIMG = º»¹®¿¡ »ðÀÔµÈ À̹ÌÁöµéÁß ¿ÜºÎ(´Ù¸¥°èÁ¤)¿¡ À§Ä¡ÇÑ À̹ÌÁöµéÀ» º»ÀÎÀÇ ¼­¹ö·Î ÀúÀåÇÒ±î¿ä? true : false */ this.useCopy = false; this.useContentCheck = false; this.minimumContent = 10; this.saveRemoteIMG = false; /* this.killError = ¿¡µðÅÍ »ðÀÔÀ¸·Î ÀÎÇØ »ý±â´Â °¢Á¾ ¿¡·¯¸Þ¼¼Áö Ãâ·ÂÀ» ¸·À»±î¿ä? (ºñÃßõ - ¸ðµç ¿¡·¯°¡ ¾Ê³ª¿È...¤Ñ.¤Ñ) true : false */ this.killError = false; /* this.noOnsubmit = ÆûÀü¼Û½Ã¿¡ ½ÇÇàµÇ´Â onsubmit Ç׸ñÀ» °Çµå¸®Áö ¾ÊÀ»±î¿ä? true ·Î ¼³Á¤½Ã ³»¿ëº¹»ç¸¦ ºñ·ÔÇÑ °¢Á¾±â´ÉµéÀÌ ÀÛµ¿ÇÏÁö ¾Ê°í ¹Ù·Î Àü¼ÛµÊ.(ÀÏÁ¾ÀÇ ½ÉÇøðµå, ƯÈ÷ form ¾È¿¡¼­ »ç¿ëÇÏ´Â textarea °¡ ¾Æ´Ò°æ¿ì true ·Î!) true : false */ this.noOnsubmit = false; /* Åø¹Ù¿¡ µé¾î°¡´Â ºó°ø°£ °¡·Î»çÀÌÁî ±âº»°ª ÁöÁ¤ (´ÜÀ§ = Çȼ¿) [firefox ¿¡¼± ½ÇÁ¦ Çȼ¿ÀÌ ¾Æ´Ñ »çÀÌÁî 5 ¸¶´Ù ºóÄ­À» Çϳª¾¿ »ðÀÔ] */ this.defaultSpaceWidth = 10; /* Åø¹Ù ¹öư Ç׸ñ 1. Á¤ÀÇÇÏ´Â ¼ø¼­´ë·Î ¿¡µðÅÍ¿¡ Ç¥½ÃµÊ. 2. ¹öư»çÀÌÀÇ ÀÓÀÇÀû °ø¹éÀº this.toolbarItems.push("space"); ¸¦ Ãß°¡ÇÔÀ¸·Î¼­ »ý¼º°¡´É 2-1. space ¸¸ ÀûÀ»°æ¿ì À§¿¡¼­ Á¤ÀÇÇÑ defaultSpaceWidth °ø¹éÀÇ »çÀÌÁî·Î ÀÌ¿ëµÇ¸ç, 2-2. °ø¹éº° »çÀÌÁ ÁöÁ¤ÇÏ°í ½ÍÀ»¶© space_40 ó·³ _ ¿Í ÇÔ²² Àû¾îÁÖ¸é ÇØ´ç °ø¹éÀÇ ³ÐÀ̸¦ ÁöÁ¤ÇÒ¼ö ÀÖÀ½ (´ÜÀ§ = Çȼ¿) 3. »õ·Î¿î ¹öưÁÙÀÇ °æ¿ì this.toolbarItems.push("row"); ¸¦ ÁÙ »çÀÌ¿¡ ³Ö¾îÁÖ¸é »ý¼ºµÊ. 4. ÇÊ¿ä¾ø´Â ¹öưÀº //this.toolbarItems.push("underline"); ó·³ //À» ÀÌ¿ëÇÏ¿© ÁÖ¼®Ã³¸® ±ÇÀå. 5. ¼³Á¤Ç׸ñµéÀÌ Àͼ÷ÇØÁö±æ ¹Ù¶ó´Â ¸¶À½¿¡ ÇöÀç µÎÁÙ·Î ¼³Á¤µÇ¾îÀÖÀ½. (ÇÑÁÙ·Î ÁÖ¿í~ Ç¥½ÃÇϱ⠱ÇÀå) */ this.toolbarItems = new Array(); this.toolbarItems.push("htmlsource"); //¼Ò½ºÃ¢°ú ¿¡µðÅÍâÀÇ Àüȯ ¹öư this.toolbarItems.push("image"); // À̹ÌÁö »ðÀÔ this.toolbarItems.push("space"); //±âº» °ø¹é this.toolbarItems.push("fontname"); // ±Û²Ã º¯°æ this.toolbarItems.push("fontsize"); // ±ÛÀÚÅ©±â º¯°æ this.toolbarItems.push("space"); //±âº» °ø¹é this.toolbarItems.push("bold"); // ±½°Ô this.toolbarItems.push("underline"); // ¹ØÁÙ this.toolbarItems.push("italic"); // ±â¿ïÀ̱â this.toolbarItems.push("strike"); // Ãë¼Ò¼± this.toolbarItems.push("space"); //±âº» °ø¹é this.toolbarItems.push("color"); // ±ÛÀÚ »ö»ó this.toolbarItems.push("bgcolor"); // ±ÛÀÚ ¹è°æ»ö this.toolbarItems.push("hilite"); // °­Á¶ (³ë¶û¹ÙÅÁ¿¡ °ËÁ¤±Û¾¾) this.toolbarItems.push("space"); //±âº» °ø¹é // this.toolbarItems.push("link"); // ¸µÅ©»ðÀÔ // this.toolbarItems.push("emoticon"); // À̸ðƼÄÜ »ðÀÔ // this.toolbarItems.push("specialchars"); // Ư¼ö¹®ÀÚ »ðÀÔ this.toolbarItems.push("space"); //±âº» °ø¹é // this.toolbarItems.push("row"); // »õ·Î¿î ¹öưÁÙ // this.toolbarItems.push("unlink"); // ¸µÅ©Ãë¼Ò this.toolbarItems.push("nohilite"); // °­Á¶ Ãë¼Ò ¹× °¢Á¾ ±ÛÀÚÈ¿°ú Á¦°Å // this.toolbarItems.push("sup"); // À­Ã·ÀÚ // this.toolbarItems.push("sub"); // ¾Æ·¡Ã·ÀÚ //this.toolbarItems.push("space_33"); //°ø¹é »çÀÌÁî 33 »ùÇà this.toolbarItems.push("orderedlist"); // ¹øÈ£¸Å±è this.toolbarItems.push("unorderedlist"); // Á¡¸Å±è // this.toolbarItems.push("indent"); // µé¿©¾²±â // this.toolbarItems.push("outdent"); // µé¿©¾²±â Ãë¼Ò this.toolbarItems.push("left"); // ¿ÞÂʸÂÃã this.toolbarItems.push("center"); // °¡¿îµ¥¸ÂÃã this.toolbarItems.push("right"); // ¿À¸¥ÂʸÂÃã this.toolbarItems.push("space"); //±âº» °ø¹é // this.toolbarItems.push("abs"); // position:absolute // this.toolbarItems.push("hr"); // ÁÙ »ðÀÔ this.toolbarItems.push("simpleDiv"); // ½ÉÇùڽº this.toolbarItems.push("table"); // Å×À̺í»ðÀÔ // this.toolbarItems.push("showhide"); // º¸À̱â/°¨Ãß±â // this.toolbarItems.push("spellcheck"); // ¸ÂÃã¹ý°Ë»ç // this.toolbarItems.push("preview"); // ¹Ì¸®º¸±â // ¹öư ³¡ /* À§¿¡¼­ ÁöÁ¤ÇÑ ÆùÆ®º¯°æ ¸Þ´º¿¡ ¿É¼ÇÀ¸·Î µé¾î°¥ ÆùÆ®¸ñ·Ï Çü½Ä = this.fontOptions.push("execcommand ·Î Àû¿ëµÇ´Â Á¤È®ÇÑ ÆùÆ®À̸§", "»ç¿ëÀÚ¿¡°Ô º¸¿©Áö´Â °ª - ÀÓÀÇÁöÁ¤ °¡´É"); */ this.fontOptions = new Array(); if (this.noSelect) // ±Û²Ã¼±ÅÃÀ» ·¹À̾î·Î ÇßÀ»°æ¿ì »ç¿ëµÉ Ç׸ñ { this.fontOptions.push("±¼¸²", "±¼¸²"); this.fontOptions.push("µ¸¿ò", "µ¸¿ò"); this.fontOptions.push("¹ÙÅÁ", "¹ÙÅÁ"); this.fontOptions.push("±Ã¼­", "±Ã¼­"); this.fontOptions.push("tahoma", "tahoma"); this.fontOptions.push("verdana", "verdana"); this.fontOptions.push("Courier", "Courier"); } else // ±Û²Ã¼±ÅÃÀ» select ·Î ÇßÀ»°æ¿ì »ç¿ëµÉ Ç׸ñ { this.fontOptions.push("", "±Û²Ã"); //ùÁÙ Á¦°Å ±ÝÁö! this.fontOptions.push("±¼¸²", "±¼¸²"); this.fontOptions.push("µ¸¿ò", "µ¸¿ò"); this.fontOptions.push("¹ÙÅÁ", "¹ÙÅÁ"); this.fontOptions.push("±Ã¼­", "±Ã¼­"); } /* À§¿¡¼­ ÁöÁ¤ÇÑ ±ÛÀÚÅ©±â ¸Þ´º¿¡ ¿É¼ÇÀ¸·Î µé¾î°¥ »çÀÌÁî¸ñ·Ï Çü½Ä = this.fontOptions.push("½ÇÁ¦·Î Àû¿ëµÇ´Â »çÀÌÁî°ª", "»ç¿ëÀÚ¿¡°Ô º¸¿©Áö´Â °ª - ÀÓÀÇÁöÁ¤ °¡´É"); */ this.fontSizeOptions = new Array(); if (this.noSelect && this.freeFontSize) // ±ÛÀÚÅ©±â¼±ÅÃÀ» ·¹À̾î·Î Çϸ鼭 Å©±âÀÚÀ¯ÀԷ½ÿ¡ »ç¿ëµÉ Ç׸ñ (pt µµ µÇ°í px µµ µÊ) { this.fontSizeOptions.push("7pt", "7pt"); this.fontSizeOptions.push("8pt", "8pt"); this.fontSizeOptions.push("9pt", "9pt"); this.fontSizeOptions.push("10pt", "10pt"); this.fontSizeOptions.push("11pt", "11pt"); this.fontSizeOptions.push("12pt", "12pt"); this.fontSizeOptions.push("14pt", "14pt"); this.fontSizeOptions.push("18pt", "18pt"); this.fontSizeOptions.push("24pt", "24pt"); this.fontSizeOptions.push("36pt", "36pt"); this.fontSizeOptions.push("40pt", "40pt"); } else // ±ÛÀÚÅ©±â¼±ÅÃÀ» select ·Î ÇßÀ»°æ¿ì »ç¿ëµÉ Ç׸ñ { this.fontSizeOptions.push("", "Å©±â"); //ùÁÙ Á¦°Å ±ÝÁö! this.fontSizeOptions.push("1", "1"); this.fontSizeOptions.push("2", "2"); this.fontSizeOptions.push("3", "3"); this.fontSizeOptions.push("4", "4"); this.fontSizeOptions.push("5", "5"); this.fontSizeOptions.push("6", "6"); this.fontSizeOptions.push("7", "7"); } if (this.useExtraHTML) { this.toolbarItems.push("extraHTML"); // Ãß°¡ Ç׸ñ HTML - ¾Æ·¡ ű׳»¿ë¸¸ ¼öÁ¤ÇϽñæ. »ç¿ë¿©ºÎ´Â À§ÀÇ ¼³Á¤¿¡¼­... this.extraHTML = new Array(); this.extraHTML.push("
", "
"); this.extraHTML.push("
", "
"); this.extraHTML.push("
", "
"); this.extraHTML.push("
", "
"); this.extraHTML.push("
", "
"); this.extraHTML.push("
", "
"); this.extraHTML.push("
", "
"); this.extraHTML.push("
", "
"); this.extraHTML.push("
", "
"); this.extraHTML.push("
", "
"); this.extraHTML.push("
", "
"); this.extraHTML.push("
", "
"); this.extraHTML.push("
", "
"); this.extraHTML.push("
", "
"); this.extraHTML.push("
", "
"); this.extraHTML.push("
", "
"); } return true; } /////////// ¼³Á¤ ³¡ //////////// ÀÌÇÏ ¼Õµ¨ ÇÊ¿ä ¾øÀ½ /////// //// Çʼö º¯¼öµé var is_IE = (window.showModelessDialog) ? true : false; var config = new alditorConfig(); var editorHeight = new Array(); var _1stRun = false; //// var styleCss=document.createElement('LINK'); styleCss.rel = 'stylesheet'; styleCss.href = config.alditorPath+'buttons/'+config.buttonSet+'/alditor.css'; var styleCssContent=document.createElement('LINK'); styleCssContent.rel = 'stylesheet'; styleCssContent.href = config.alditorPath+'alditorContent.css'; var jsContent=document.createElement('script'); jsContent.type = 'text/javascript'; jsContent.language = 'javascript'; jsContent.src = config.alditorPath+'alditorContent.js'; document.getElementsByTagName('HEAD')[0].appendChild(styleCss); document.getElementsByTagName('HEAD')[0].appendChild(styleCssContent); document.getElementsByTagName('HEAD')[0].appendChild(jsContent); if (config.runOnLoad) { addEvent(window,"load", alditorAll); } function alditorAll() { var txtareas = document.getElementsByTagName("TEXTAREA"); for ( i=0 ; i < txtareas.length ; i++ ) { if (txtareas[i].offsetHeight > 0 && txtareas[i].style.display.toLowerCase() != 'none' && txtareas[i].style.visibility.toLowerCase() != 'hidden' && !txtareas[i].readOnly && !txtareas[i].disabled) { var textarea = txtareas[i]; if (!textarea.id) { if (document.getElementById(textarea.name) && document.getElementById(textarea.name).nodeName != 'TEXTAREA') { textarea.id = 'text_' + textarea.name ; } else { textarea.id = textarea.name ; } } if ( txtareas.length == 1) { new alditor(textarea.id); } else { setTimeout("new alditor('" + textarea.id + "')", 10 * (i)); } } } } function killalditorAll() { var txtareas = document.getElementsByTagName("TEXTAREA"); for ( i=0 ; i < txtareas.length ; i++ ) { var txtarea = txtareas[i]; if (txtarea.previousSibling && txtarea.previousSibling.id == txtarea.id + '_alditor') { var _table = document.getElementById(txtarea.id + '_table'); txtarea.style.display = 'block'; txtarea.className = txtarea.rel; txtarea.style.cssText = txtarea.oldstyle; _table.parentNode.replaceChild(txtarea,_table); var extradiv = document.getElementById(txtarea.id + "_alditorextraDiv"); extradiv.parentNode.removeChild(extradiv); } } } function alditorById(textareaID) { _1stRun = false; var txtarea = document.getElementById(textareaID); if (!txtarea || txtarea.nodeName != 'TEXTAREA') { txtarea = document.getElementsByTagName('TEXTAREA')[textareaID]; if (document.getElementById(txtarea.name) && document.getElementById(txtarea.name).nodeName != 'TEXTAREA') { txtarea.id = 'text_' + txtarea.name ; } else { txtarea.id = txtarea.name ; } } else { if (!txtarea.id) { if (document.getElementById(txtarea.name) && document.getElementById(txtarea.name).nodeName != 'TEXTAREA') { txtarea.id = 'text_' + txtarea.name ; } else { txtarea.id = txtarea.name ; } } } if (!txtarea.previousSibling || (txtarea.previousSibling && txtarea.previousSibling.className !='alditorIframe')) { new alditor(txtarea); } return true; } function killalditor(txtID) { var txtarea = document.getElementById(txtID); if (!txtarea || txtarea.nodeName != "TEXTAREA") { txtarea = document.getElementsByTagName('TEXTAREA')[txtID]; } txtID = txtarea.id; if (txtarea.previousSibling && txtarea.previousSibling.id == txtarea.id + '_alditor') { txtarea.style.display = 'block'; txtarea.className = txtarea.rel; txtarea.style.cssText = txtarea.oldstyle; var _table = document.getElementById(txtID + "_table"); _table.parentNode.replaceChild(txtarea,_table); var extradiv = document.getElementById(txtarea.id + "_alditorextraDiv"); extradiv.parentNode.removeChild(extradiv); } } function getAlditor(textareaID) { var alditorObj = document.getElementById(textareaID + '_alditor'); if (!alditorObj) { alditorObj = document.getElementById('text_' + textareaID + '_alditor'); } if (alditorObj) { return alditorObj; } else { return false; } } // ¾ËµðÅÍ ½ÃÀÛ function alditor(textareaObj) { if (typeof textareaObj == 'string') { textareaObj = document.getElementById(textareaObj); } if (textareaObj.nodeName != "TEXTAREA" || navigator.userAgent.indexOf('Mac') != -1 || textareaObj.getAttribute("editable") == 0) { return true; } if ((textareaObj.offsetHeight > 0) && (!textareaObj.previousSibling || textareaObj.previousSibling.id != textareaObj.id + "_alditor")) { var self = this; var tempWidth = textareaObj.offsetWidth; var tempHeight = textareaObj.offsetHeight; this._initHeight = tempHeight; this._textarea = textareaObj; this._iframe = document.createElement("IFRAME"); this._textarea.rel = this._textarea.className; this._textarea.oldstyle = this._textarea.style.cssText; this._textarea.className = "alditorTextarea"; this._textarea.style.display = "none"; this._iframe.id = this._textarea.id + "_alditor"; this._iframe.frameBorder = 0; this._iframe.marginWidth = 0; this._iframe.marginHeight = 0; this._iframe.className = "alditorIframe"; editorHeight[ this._iframe.id ] = tempHeight; this._table = document.createElement("table"); this._table.setAttribute("border", "0"); this._table.setAttribute("cellPadding", "0"); this._table.setAttribute("cellSpacing", "0"); this._table.style.width = tempWidth + 'px'; this._table.className = "topTable"; this._table.id = this._textarea.id + "_table"; var topTablebody = document.createElement("tbody"); var current_row1 = document.createElement("tr"); current_row1.setAttribute("valign", "middle"); current_row1.setAttribute("align", "left"); this._toolbarTd = document.createElement("td"); this._toolbarTd.id = this._iframe.id + "toolbarTd"; this._toolbarTd.className = "toolbarTd"; this._toolbarTd.unselectable = 'on'; current_row1.appendChild(this._toolbarTd); this._toolbarDiv = document.createElement("div"); this._toolbarDiv.id = this._iframe.id + "_toolbarDiv"; this._toolbarDiv.className = "toolbarDiv"; this._toolbarDiv.style.backgroundImage = "url('"+config.alditorPath+"buttons/" + config.buttonSet + "/toolbar_bg.gif')"; if (config.movableToolbar) { this._toolbarDiv.onmousedown = function (event) {tb_moveStart(event, self._toolbarDiv, self._iframe);}; this._toolbarDiv.className = "toolbarDiv updown"; } this._toolbarTd.appendChild(this._toolbarDiv); var current_row2 = document.createElement("tr"); current_row2.setAttribute("valign", "top"); current_row2.setAttribute("align", "left"); this._alditorTd = document.createElement("td"); this._alditorTd.id = this._iframe.id + "alditorTd"; this._alditorTd.className = "alditorTd"; this._alditorTd.width = tempWidth; this._alditorTd.height = tempHeight; this._alditorTd.unselectable = 'on'; current_row2.appendChild(this._alditorTd); var current_row3 = document.createElement("tr"); current_row3.setAttribute("valign", "bottom"); current_row3.setAttribute("align", "left"); var bottomTd = document.createElement("td"); bottomTd.id = this._iframe.id + "bottomTd"; bottomTd.className = "bottomTd"; bottomTd.unselectable = 'on'; var bottomTable = document.createElement("table"); bottomTable.setAttribute("border", "0"); bottomTable.setAttribute("width", "100%"); bottomTable.setAttribute("cellPadding", "0"); bottomTable.setAttribute("cellSpacing", "2"); bottomTable.style.tableLayout = "fixed"; var bottomTablebody = document.createElement("tbody"); var current_row = document.createElement("tr"); current_row.setAttribute("align", "left"); current_row.setAttribute("valign", "bottom"); this._pathTd = document.createElement("td"); this._pathTd.id = this._iframe.id + "pathTd"; this._pathTd.className = "pathTd"; this._pathTd.innerHTML = (config.showPath)? "Tags:" : " "; this._pathTd.unselectable = 'on'; var current_cell2 = document.createElement("td"); if (config.allowDrag) { current_cell2.onmousedown = function (event) {resizeStart(event, self._table, self._iframe); return true;}; current_cell2.className = "resizeHandle"; } current_cell2.unselectable = "on"; current_row.appendChild(this._pathTd); current_row.appendChild(current_cell2); bottomTablebody.appendChild(current_row); bottomTable.appendChild(bottomTablebody); current_row3.appendChild(bottomTd); topTablebody.appendChild(current_row1); topTablebody.appendChild(current_row2); topTablebody.appendChild(current_row3); this._table.appendChild(topTablebody); this.alditorToolbar(); this._textarea.parentNode.insertBefore(this._table, this._textarea); this._alditorTd.appendChild(this._iframe); this._alditorTd.appendChild(this._textarea); if (config.allowDrag || config.showPath) { bottomTd.appendChild(bottomTable); } var tools = this._toolbarTd.getElementsByTagName('*'); for (ti=0;ti< tools.length; ti++) { tools[ti].unselectable = 'on'; } this._textarea.style.width = this._alditorTd.clientWidth + 'px'; this._textarea.style.height = this._alditorTd.clientHeight - 2 + 'px'; this.fillContents(this._textarea.value); if (config.toolbarItems.inArray('color') || config.toolbarItems.inArray('bgcolor')) { makeColorset(); } if (config.toolbarItems.inArray('table')) { makeTableset(); } if (config.toolbarItems.inArray('hilite')) { makeHiliteset(); } if (config.noSelect) { makeFontset(); } setTimeout(function () { self.setDesignMode(); },10); expanded = false; rowCnt = 0; } return true; } var expanded = false; var rowCnt = 0; alditor.prototype.alditorToolbar = function (startNo) { if (!startNo) { startNo = 0 } var self = this; var tempi = 0; this._buttonSet = document.createElement("DIV"); this._buttonSet.className = "buttonSet"; this._buttonSet.unselectable = "on"; if (expanded == true) { this._buttonSet.style.display = 'none'; } for (var i = startNo; i < config.toolbarItems.length; i++) { switch (config.toolbarItems[i].split("_")[0]) { case "htmlsource": this.createButton(config.alditorPath+"buttons/" + config.buttonSet + "/source.gif", "¼Ò½º º¸±â", "html"); break; case "image": this.createButton(config.alditorPath+"buttons/" + config.buttonSet + "/image.gif", "À̹ÌÁö/µ¿¿µ»ó/À½¾Ç/Ç÷¡½Ã »ðÀÔ", "image"); break; case "fontname": if (config.noSelect) { this.createButton(config.alditorPath+"buttons/" + config.buttonSet + "/font.gif", "±Û²Ã", "fontname"); } else { this.createSelect(config.fontOptions, "fontname"); } break; case "fontsize": if (config.noSelect) { this.createButton(config.alditorPath+"buttons/" + config.buttonSet + "/size.gif", "±ÛÀÚÅ©±â", "fontsize"); } else { this.createSelect(config.fontSizeOptions, "fontsize"); } break; case "bold": this.createButton(config.alditorPath+"buttons/" + config.buttonSet + "/bold.gif", "±½°Ô", "bold"); break; case "underline": this.createButton(config.alditorPath+"buttons/" + config.buttonSet + "/underline.gif", "¹ØÁÙ", "underline"); break; case "italic": this.createButton(config.alditorPath+"buttons/" + config.buttonSet + "/italic.gif", "±â¿ïÀ̱â", "italic"); break; case "strike": this.createButton(config.alditorPath+"buttons/" + config.buttonSet + "/strike.gif", "Ãë¼Ò¼±", "StrikeThrough"); break; case "color": this.createButton(config.alditorPath+"buttons/" + config.buttonSet + "/fontcolor.gif", "±ÛÀÚ »ö", "color"); break; case "bgcolor": this.createButton(config.alditorPath+"buttons/" + config.buttonSet + "/backcolor.gif", "±ÛÀÚ ¹è°æ»ö", "bgcolor"); break; case "sup": this.createButton(config.alditorPath+"buttons/" + config.buttonSet + "/super.gif", "À§Ã·ÀÚ", "Superscript"); break; case "sub": this.createButton(config.alditorPath+"buttons/" + config.buttonSet + "/sub.gif", "¾Æ·¡Ã·ÀÚ", "Subscript"); break; case "link": this.createButton(config.alditorPath+"buttons/" + config.buttonSet + "/link.gif", "¸µÅ© »ðÀÔ", "link"); break; case "unlink": this.createButton(config.alditorPath+"buttons/" + config.buttonSet + "/unlink.gif", "¸µÅ© Á¦°Å", "unlink"); break; case "emoticon": this.createButton(config.alditorPath+"buttons/" + config.buttonSet + "/emoticon.gif", "À̸ðƼÄÜ »ðÀÔ", "emoticon"); break; case "specialchars": this.createButton(config.alditorPath+"buttons/" + config.buttonSet + "/specialchars.gif", "Ư¼ö¹®ÀÚ »ðÀÔ", "specialchars"); break; case "hilite": this.createButton(config.alditorPath+"buttons/" + config.buttonSet + "/hilite.gif", "±ÛÀÚ °­Á¶", "hilite"); break; case "nohilite": this.createButton(config.alditorPath+"buttons/" + config.buttonSet + "/nohilite.gif", "°­Á¶ Ãë¼Ò ¹× °¢Á¾ ±ÛÀÚ¼Ó¼º Á¦°Å", "nohilite"); break; case "unorderedlist": this.createButton(config.alditorPath+"buttons/" + config.buttonSet + "/unordered.gif", "Á¡ ¸ñ·Ï", "insertunorderedlist"); break; case "orderedlist": this.createButton(config.alditorPath+"buttons/" + config.buttonSet + "/ordered.gif", "¼ýÀÚ ¸ñ·Ï", "insertorderedlist"); break; case "indent": this.createButton(config.alditorPath+"buttons/" + config.buttonSet + "/indent.gif", "µé¿©¾²±â", "indent"); break; case "outdent": this.createButton(config.alditorPath+"buttons/" + config.buttonSet + "/outdent.gif", "µé¿©¾²±â Ãë¼Ò", "outdent"); break; case "left": this.createButton(config.alditorPath+"buttons/" + config.buttonSet + "/left.gif", "¿ÞÂÊ Á¤·Ä", "justifyleft"); break; case "center": this.createButton(config.alditorPath+"buttons/" + config.buttonSet + "/center.gif", "Áß¾Ó Á¤·Ä", "justifycenter"); break; case "right": this.createButton(config.alditorPath+"buttons/" + config.buttonSet + "/right.gif", "¿À¸¥ÂÊ Á¤·Ä", "justifyright"); break; case "hr": this.createButton(config.alditorPath+"buttons/" + config.buttonSet + "/hr.gif", "°¡·Î¼± »ðÀÔ", "inserthorizontalrule"); break; case "simpleDiv": this.createButton(config.alditorPath+"buttons/" + config.buttonSet + "/simpleDiv.gif", "´Ü¼ø »óÀÚ", "simpleDiv"); break; case "table": this.createButton(config.alditorPath+"buttons/" + config.buttonSet + "/table.gif", "Å×ÀÌºí »ðÀÔ", "table"); break; case "showhide": this.createButton(config.alditorPath+"buttons/" + config.buttonSet + "/showhide.gif", "º¸À̱â/°¨Ãß±â", "showhide"); break; case "preview": this.createButton(config.alditorPath+"buttons/" + config.buttonSet + "/preview.gif", "¹Ì¸®º¸±â", "preview"); break; case "spellcheck": this.createButton(config.alditorPath+"buttons/" + config.buttonSet + "/spellcheck.gif", "ÇÑ±Û ¸ÂÃã¹ý/¹®¹ý °Ë»ç", "spellcheck"); break; case "space": var SpaceWidth = (config.toolbarItems[i].split("_")[1])?config.toolbarItems[i].split("_")[1]:config.defaultSpaceWidth; this.createSpace(SpaceWidth); break; case "abs": this.createButton(config.alditorPath+"buttons/" + config.buttonSet + "/abs.gif", "position:absolute", "abs"); break; case "extraHTML": this.extraDiv = document.createElement("DIV"); this.extraDiv.id = this._iframe.id + "extraDiv"; this.extraDiv.className = "extraDiv"; this.extraDiv.unselectable = "on"; for (xi=0; xi < config.extraHTML.length; xi +=2) { var divContent = document.createElement("DIV"); divContent.innerHTML = config.extraHTML[xi] + "..." + config.extraHTML[xi + 1]; divContent.onclick = function () { addExtraTag(self._iframe,this.innerHTML);} divContent.unselectable = "on"; divContent.firstChild.unselectable = "on"; this.extraDiv.appendChild(divContent); } document.body.appendChild(this.extraDiv); this.createButton(config.alditorPath+"buttons/" + config.buttonSet + "/extra.gif", "Ãß°¡ Ç׸ñ (¿­±â/´Ý±â)", "extraHTML"); break; } tempi = i; if (config.toolbarItems[i] == "row") { rowCnt++; if (config.useExpansion && expanded == false && rowCnt == config.minimumRow) { this.createButton(config.alditorPath+"buttons/" + config.buttonSet + "/expand.gif", "ÀÔ·Â µµ±¸ È®Àå", "expand"); expanded = true; } break; } } this._toolbarDiv.appendChild(this._buttonSet); if (tempi != config.toolbarItems.length-1) { this.addRow(i+1) } return true; } alditor.prototype.toolbarClick = function(action, buttonObj) { var self = this; var actionIframe = this._iframe; if (config.toolbarItems.inArray('color') || config.toolbarItems.inArray('bgcolor')) { hideColorPicker(); } if (config.toolbarItems.inArray('table')) { hideTableset(); } if (config.toolbarItems.inArray('hilite')) { hideHiliteSelector(); } if (config.noSelect) { hideFontset(); } actionIframe.contentWindow.focus(); switch (action) { case "html": switchMode(actionIframe); if (actionIframe.style.display != 'none' && config.allowStretch) { self.reHeight(actionIframe.contentWindow.document.body.scrollTop); } break; case "fontname": if (config.noSelect) { getFontName(actionIframe, buttonObj); } else { actionIframe.contentWindow.document.execCommand("fontname", false, buttonObj.value); buttonObj.selectedIndex=0; } break; case "fontsize": if (config.noSelect) { getFontSize(actionIframe, buttonObj); } else { actionIframe.contentWindow.document.execCommand("fontsize", false, buttonObj.value); buttonObj.selectedIndex=0; } break; case "color": getColor(actionIframe, buttonObj, "ForeColor"); break; case "bgcolor": if (is_IE) { getColor(actionIframe, buttonObj, "BackColor"); } else { getColor(actionIframe, buttonObj, "Hilitecolor"); } break; case "link": popWin(config.alditorPath + 'alditorLink.html?id='+this._iframe.id + '&rnd=' + new Date().getTime(), 650,500, actionIframe); break; case "image": popWin(config.alditorPath + 'alditorImage.html?id='+this._iframe.id + '&rnd=' + new Date().getTime() , 650,400, actionIframe, true); break; case "emoticon": popWin(config.alditorPath + 'alditorEmoticons.html?id='+this._iframe.id + '&rnd=' + new Date().getTime(), 540,460, actionIframe); break; case "specialchars": popWin(config.alditorPath + 'alditorSpecialchars.html?id='+this._iframe.id + '&rnd=' + new Date().getTime() ,350,400, actionIframe); break; case "hilite": getHilite(actionIframe, buttonObj); break; case "nohilite": actionIframe.contentWindow.document.execCommand("RemoveFormat",false,null); break; case "simpleDiv": addExtraTag(actionIframe, "
...
"); break; case "table": showTableset(actionIframe,buttonObj); break; case "showhide": addExtraTag(actionIframe, '
³»¿ë º¸±â
...¼û°ÜÁø ³»¿ë...
', "showhide"); break; case "preview": alditorPreview (actionIframe); break; case "spellcheck": spellcheck(actionIframe); break; case "extraHTML": this.extraDiv.style.top = getOffsetTop(this._table) + 'px'; if (is_IE) { this.extraDiv.style.height = this._table.offsetHeight + 'px'; } else { this.extraDiv.style.height = this._table.offsetHeight - 2 + 'px'; } var newLeft = getOffsetLeft(this._table) + this._table.offsetWidth; if ((newLeft + config.useExtraHTMLwidth) > document.body.clientWidth) { newLeft -= config.useExtraHTMLwidth; } this.extraDiv.style.left = newLeft + 'px'; if (this.extraDiv.style.display == "none" || !this.extraDiv.style.display){ this.extraDiv.style.display = "block"; } else { this.extraDiv.style.display = "none"; } break; case "expand": var buttonrows = this._toolbarDiv.childNodes; for (i=config.minimumRow; i< buttonrows.length; i++) { if ( buttonrows[i].style.display != 'none') { buttonrows[i].style.display = 'none'; } else { buttonrows[i].style.display = 'block'; } } break; case "abs": makeAbs(actionIframe); break; default: try { actionIframe.contentWindow.document.execCommand( action, false, null); } catch (e) {} } if (action != "html") { updatePath(actionIframe); } return true; } alditor.prototype.addRow = function (i) { this.alditorToolbar(i); return true; } alditor.prototype.createButton = function(imgSrc, title, action) { var self = this; var tempButton = document.createElement("IMG"); tempButton.title = title; tempButton.alt = action; tempButton.src = imgSrc; tempButton.align = 'absmiddle'; tempButton.border = 0; tempButton.onmouseover = function () { window.status = title; } ; tempButton.onmousedown = toolbarDown; tempButton.onmouseup = toolbarUp; tempButton.onmouseout = toolbarUp; tempButton.onclick = function () { self.toolbarClick(action, this); return true; } ; this._buttonSet.appendChild(tempButton); return true; } alditor.prototype.createSelect = function(optionList, action) { var self = this; var theSelect = document.createElement("select"); theSelect.onchange = function () { self.toolbarClick(action, this); return true; } ; for (var i = 0; i < optionList.length; i += 2) { var theOption = document.createElement("option"); var theText = document.createTextNode(optionList[i + 1]); theOption.value = optionList[i]; theOption.appendChild(theText); theSelect.appendChild(theOption); } this._buttonSet.appendChild(theSelect); return true; } alditor.prototype.createSpace = function(width) { var tempSpace = document.createElement("SPAN"); tempSpace.style.width = parseInt(width) + "px"; if (!is_IE) { for (iii=0;iii@import url(\""+config.alditorPath+"alditorInnerContent.css\");\ \ \ " + text + "\ \ \ "; this._iframe.contentWindow.document.open(); this._iframe.contentWindow.document.write(documentTemplate); this._iframe.contentWindow.document.close(); if (is_IE && config.allowStretch) { this.reHeight(this._iframe.contentWindow.document.body.scrollTop); } return true; } alditor.prototype.setDesignMode = function() { var self = this; self._iframe.contentWindow.document.designMode = 'On'; var _form = self._iframe.parentNode; while (_form.nodeName.toLowerCase() != "form") { _form = _form.parentNode; } if (!_form.rel || _form.rel == '') { if (config.noOnsubmit == false) { self.attachOnSubmit(_form); _form.rel = self._textarea.id; } } addEvent(self._iframe.contentWindow, "blur", function(){updateTextarea(self._iframe,true)}); addEvent(self._iframe.contentWindow.document, "keydown", function(event){interceptKey(event,self._iframe);}); addEvent(self._iframe.nextSibling, "keydown", function(event){allowTab(event, self._iframe.nextSibling);}); if (config.allowStretch) { addEvent(self._iframe.contentWindow.document, "keyup", function(){self.reHeight(self._iframe.contentWindow.document.body.scrollTop);}); } if (config.showPath) { if (config.showPathSafeMode == false) { addEvent(self._iframe.contentWindow.document, "keyup", function(){updatePath(self._iframe);}); } else { addEvent(self._iframe.contentWindow.document, "keyup", function(event){updatePathSafe(event, self._iframe);}); } addEvent(self._iframe.contentWindow.document, "click", function(){tempHide(self._iframe,true); updatePath(self._iframe);}); } else { addEvent(self._iframe.contentWindow.document, "click", function(){tempHide(self._iframe,true);}); } if (config.toolbarItems.inArray('abs')) { addEvent(self._iframe.contentWindow.document, "mousedown", function(event){moveAbs(event, self._iframe);}); } if (config.setFocus && !_1stRun) { if (config.useSafeFocus == false) { editorFocus(self._iframe, 0); } else { if ((getOffsetTop(self._table) + self._toolbarTd.offsetHeight + 20) < document.body.clientHeight + document.body.scrollTop) { editorFocus(self._iframe, 0); } } } if (!is_IE && config.allowStretch) { self.reHeight(self._iframe.contentWindow.document.body.scrollTop); } _1stRun = true; self.tryTextType(); return true; } var onsubmitHolder = new Array(); var oldOnsubmit = new Array(); alditor.prototype.attachOnSubmit = function(_form) { var self = this; if (!oldOnsubmit[self._textarea.id]) { oldOnsubmit[self._textarea.id] = _form.onsubmit; } if (onsubmitHolder[self._textarea.id]) { _form.onsubmit = onsubmitHolder[self._textarea.id]; } if (typeof _form.onsubmit != "function") { addEvent(_form, "submit", function(event){ if (self.contentCheck(_form)) { self.targetBlank(_form); self.contentCopy(); return true; } else { cancelDefault(event); return false; } }); } else { if (typeof g4_url == 'string' ) { addEvent(_form, "submit", function(event){ self.targetBlank(_form); if (passed == true) { if (self.contentCheck(_form)) { self.contentCopy(); return true; } else { cancelDefault(event); return false; } } passed = false; }); } else { if (!onsubmitHolder[self._textarea.id]) { _form.onsubmit = function(event) { if (self.contentCheck(_form)) { self.targetBlank(_form); if (oldOnsubmit[self._textarea.id]()) { self.contentCopy(); return true; } else { cancelDefault(event); return false; } } else { cancelDefault(event); return false; } } onsubmitHolder[self._textarea.id] = _form.onsubmit; } } } } alditor.prototype.contentCheck = function(_form) { var self = this; self.iframes = _form.getElementsByTagName("IFRAME"); if (self.iframes.length == 0) { self.iframes = new Array(); var ifs = document.getElementsByTagName("IFRAME"); for (var i=0; i< ifs.length ; i++) { if (ifs[i].className == "alditorIframe") { self.iframes.push(ifs[i]); } } } for ( i=0 ; i < self.iframes.length ; i++ ) { if (self.iframes[i].className == "alditorIframe") { if (self.iframes[i].style.display == 'none') { showIframe(self.iframes[i]); } if (config.useContentCheck) { if (is_IE) { var content = self.iframes[i].contentWindow.document.body.innerText; } else { var content = self.iframes[i].contentWindow.document.body.textContent; } var textLengh = content.length; if (!is_IE) { if (typeof g4_url == 'undefined' ) { textLengh -= 20; } } if (textLengh < config.minimumContent || textLengh == 0) { alert('³»¿ëÀÌ '+config.minimumContent+'ÀÚ ÀÌÇÏ À̰ųª ±×¸²¸¸ ÀÖ½À´Ï´Ù. È®ÀÎ ¹Ù¶ø´Ï´Ù.'); self.iframes[i].contentWindow.focus(); return false; } } } } return true; } alditor.prototype.targetBlank = function(_form) { var from_iframes = _form.getElementsByTagName("IFRAME"); if (from_iframes.length == 0) { from_iframes = new Array(); var ifs = document.getElementsByTagName("IFRAME"); for (var i=0; i< ifs.length ; i++) { if (ifs[i].className == "alditorIframe") { from_iframes.push(ifs[i]); } } } for ( i=0 ; i < from_iframes.length ; i++ ) { if (from_iframes[i].className == "alditorIframe") { if (from_iframes[i].style.display == 'none') { updateIframe(from_iframes[i]) } if (config.targetBlank) { var a = from_iframes[i].contentWindow.document.getElementsByTagName("A"); for (ii=0; ii 0) { contentHolder += iframes[i].nextSibling.value; } } } if (contentHolder.length > 0 && config.useCopy) { contentHolder = contentHolder.replace(/\[!--(.*)--\]/,''); copyContent(contentHolder); } this.tryTextType(); } alditor.prototype.tryTextType = function() { var self = this; self._textarea.focus = function() { if (self._iframe.style.display != 'hidden') { self._iframe.contentWindow.focus(); } } try { var _form = self._iframe.parentNode; while (_form.nodeName.toLowerCase() != "form") { _form = _form.parentNode; } } catch (e) {} try { //Á¦·Îº¸µå 4 _form.elements['use_html'].value = 2; _form.elements['use_html'].checked = true; _form.elements['use_html'].onclick = function () { return false;}; } catch(e){} try { //±×´©º¸µå 3 _form.elements['wr_html'].value = 1; _form.elements['wr_html'].checked = true; _form.elements['wr_html'].onclick = function () { return false;}; } catch(e){} try { //±×´©º¸µå 4 _form.elements['html'].value = 'html1'; _form.elements['html'].checked = true; _form.elements['html'].onclick = function () { return false;}; } catch(e){} try { // RGº¸µå var Htmlradio = _form.elements['rg_html_use']; for (i=0; i< Htmlradio.length; i++ ) { if (Htmlradio[i].value == 1) { Htmlradio[i].checked = true; } } } catch(e){} try { // ¹Ì´Ïº¸µå _form.elements['textmode'].checked = false; _form.elements['textmode'].onclick = function () { return false;}; _form.elements['auto_br'].checked = false; _form.elements['auto_br'].onclick = function () { return false;}; } catch(e){} } alditor.prototype.reHeight = function(newHeight) { var self = this; var strechBy = self._alditorTd.clientHeight + newHeight; if ((self._iframe.contentWindow.document.body.scrollWidth - self._iframe.contentWindow.document.body.clientWidth) > 0) { if (is_IE) { var extraH = 18; } else { var extraH = 21; } } else { var extraH = 0; } if (newHeight > 0) { self._alditorTd.style.height = strechBy + 3 + 'px'; self._iframe.style.height = self._alditorTd.clientHeight + 3 + 'px'; self._textarea.style.height = self._alditorTd.clientHeight + 1 + 'px'; } else { if (is_IE) { var tempH = self._iframe.contentWindow.document.body.scrollHeight; if (tempH > editorHeight[self._iframe.id]) { self._iframe.style.height = tempH + 3 + extraH + 'px'; self._textarea.style.height = tempH + 1 + extraH + 'px'; self._alditorTd.style.height = tempH + 3 + extraH + 'px'; } else if (self._alditorTd.clientHeight > editorHeight[self._iframe.id]) { self._iframe.style.height = editorHeight[self._iframe.id] - 1 + extraH + 'px'; self._textarea.style.height = editorHeight[self._iframe.id] -3 + extraH + 'px'; self._alditorTd.style.height = editorHeight[self._iframe.id] - 1 + extraH + 'px'; if (config.movableToolbar) { if (getOffsetTop(self._toolbarDiv) > getOffsetTop(self._table) + self._table.offsetHeight) { self._toolbarDiv.style.top = '0px'; self._toolbarDiv.newTop = 0; } } } } else { var tempH = self._iframe.contentWindow.document.body.offsetHeight; if (tempH > editorHeight[self._iframe.id]) { self._iframe.style.height = tempH + extraH + 'px'; self._textarea.style.height = tempH - 2 + extraH + 'px'; self._alditorTd.style.height = tempH + extraH + 'px'; } else if (self._alditorTd.clientHeight > editorHeight[self._iframe.id]) { self._iframe.style.height = editorHeight[self._iframe.id] + extraH + 'px'; self._textarea.style.height = editorHeight[self._iframe.id] - 2 + extraH+ 'px'; self._alditorTd.style.height = editorHeight[self._iframe.id] + extraH + 'px'; if (config.movableToolbar) { if (getOffsetTop(self._toolbarDiv) > getOffsetTop(self._table) + self._table.offsetHeight) { self._toolbarDiv.style.top = '0px'; self._toolbarDiv.newTop = 0; } } } } } return true; } function switchMode(_iframe) { if (!_iframe) { return false; } if (_iframe.style.display != 'none') { showTextarea(_iframe); } else { showIframe(_iframe); } } //¿¡µðÅÍ ¿µ¿ª Ç¥½Ã function showIframe (_iframe) { if (!_iframe || _iframe.style.display != 'none') { return false; } var buttonRows = document.getElementById(_iframe.id+'_toolbarDiv').childNodes; for (i=0; i< buttonRows.length;i++ ) { var buttons = buttonRows[i].childNodes; for (a=0; a< buttons.length;a++ ) { if (buttons[a].alt != "html") { buttons[a].style.visibility = "visible"; } } } updateIframe(_iframe); _iframe.style.display = ''; _iframe.nextSibling.style.display = 'none'; showPathTd(_iframe); editorFocus(_iframe, 0); } //Textarea Ç¥½Ã function showTextarea (_iframe) { if (!_iframe || _iframe.style.display == 'none') { return false; } var buttonRows = document.getElementById(_iframe.id+'_toolbarDiv').childNodes; for (i=0; i< buttonRows.length;i++ ) { var buttons = buttonRows[i].childNodes; for (a=0; a< buttons.length;a++ ) { if (buttons[a].alt != "html") { buttons[a].style.visibility = "hidden"; } } } updateTextarea(_iframe); _iframe.nextSibling.style.display = ''; _iframe.style.display = 'none'; hidePathTd(_iframe); textareaFocus(_iframe.nextSibling); } function updateTextareas(_form) { var iframes = _form.getElementsByTagName("IFRAME"); if (iframes.length == 0) { iframes = new Array(); var ifs = document.getElementsByTagName("IFRAME"); for (var i=0; i< ifs.length ; i++) { if (ifs[i].className == "alditorIframe") { iframes.push(ifs[i]); } } } for ( i=0 ; i < iframes.length ; i++ ) { if (iframes[i].className == "alditorIframe") { var editorValue = iframes[i].contentWindow.document.body.innerHTML; editorValue = beautifyTags(editorValue) editorValue = editorValue.replace(/(\n)/gi,''); iframes[i].nextSibling.value = editorValue; } } } function updateTextarea(_iframe,done) { var editorValue = _iframe.contentWindow.document.body.innerHTML; editorValue = beautifyTags(editorValue) if (done == true) { editorValue = editorValue.replace(/(\n)/gi,''); } _iframe.nextSibling.value = editorValue; } function updateIframe(_iframe) { var textareaValue = _iframe.nextSibling.value; _iframe.contentWindow.document.body.innerHTML = textareaValue.replace(/(\n)/gi,''); } function tempHide(_iframe) { hideExtra(_iframe,true); if (config.toolbarItems.inArray('table')) { hideTableset(); } if (config.noSelect) { hideFontset(); } if (config.toolbarItems.inArray('color') || config.toolbarItems.inArray('bgcolor')) { hideColorPicker(); } if (config.toolbarItems.inArray('hilite')) { hideHiliteSelector(); } pressed = 0; currentEditor = _iframe; } function hideExtra(_iframe, real) { if (config.useExtraHTML) { var extraDiv = document.getElementById(_iframe.id+"extraDiv"); if (!real) { extraDiv.style.visibility = "hidden"; } else { extraDiv.style.display = "none"; } } } function showExtra(_iframe) { if (config.useExtraHTML) { var extraDiv = document.getElementById(_iframe.id+"extraDiv"); var mainTable = _iframe.parentNode; while (mainTable.nodeName.toLowerCase() != "table") { mainTable = mainTable.parentNode; } var newLeft = getOffsetLeft(mainTable) + mainTable.offsetWidth; if ((newLeft + config.useExtraHTMLwidth) > document.body.clientWidth) { newLeft -= config.useExtraHTMLwidth; } extraDiv.style.top = getOffsetTop(mainTable) + 'px'; extraDiv.style.left = newLeft + 'px'; if (is_IE) { extraDiv.style.height = mainTable.offsetHeight + 'px'; } else { extraDiv.style.height = mainTable.offsetHeight - 2 + 'px'; } extraDiv.style.visibility = "visible"; } } function hidePathTd(_iframe) { if (config.showPath) { if (!is_IE) { removeEvent(_iframe.contentWindow.document, "click", function(){updatePath(_iframe); return true;}, false); removeEvent(_iframe.contentWindow.document, "keyup", function(){updatePath(_iframe); return true;}, false); } document.getElementById(_iframe.id + 'pathTd').style.visibility = 'hidden'; document.getElementById(_iframe.id + 'pathTd').innerHTML = (config.showPath)? "Tags:" : " "; } hideExtra(_iframe); } function showPathTd(_iframe) { if (config.showPath) { document.getElementById(_iframe.id + 'pathTd').style.visibility = 'visible'; if (!is_IE) { addEvent(_iframe.contentWindow.document, "click", function(){updatePath(_iframe); return true;}); addEvent(_iframe.contentWindow.document, "keyup", function(){updatePath(_iframe); return true;}); } } showExtra(_iframe); } // ÅØ½ºÆ® Á¤¸® °ü·Ã function beautifyTags(rawhtml) { rawhtml = rawhtml.replace(/(
)/gi,'
'); if (rawhtml.substring(rawhtml.length-6) == "
" && !is_IE) { rawhtml = rawhtml.substring(0,rawhtml.length-6); } rawhtml = rawhtml.replace(/(
)/gi,'
\n'); rawhtml = rawhtml.replace(/<[^> ]*/g, function(match){return match.toLowerCase();}); rawhtml = rawhtml.replace(/(]+[^\/])>/g, "$1 />"); rawhtml = rawhtml.replace (/(^\s*)|(\s*$)/g, ""); if (rawhtml == "

 

") { rawhtml = ''; } rawhtml = rawhtml.replace(/)/g, ")/g, ")/g, ")/g, "'); evt.cancelBubble = true; evt.returnValue = false; range.select(); } catch (e) { } } } else if (keyCode == 13 && pressed == 13){ if (evt.shiftKey == false) { if (config.useAutoP) { try { var tempBRi, prevBR; range.pasteHTML('
'); var tempBR = parent.getElementsByTagName('BR'); for (var i=0; i 

" || selected.toLowerCase() == "

" || selected.toLowerCase() == "

" || selected.toLowerCase() == "
" || selected.toLowerCase() == "
") { selected = ''; } if (selected.length > 0) { if (mode == "showhide") { html = html.replace('...¼û°ÜÁø ³»¿ë...',selected); } else { html = html.replace('...',selected); } } else { if (mode == "showhide") { alert("¼û°ÜÁú ³»¿ë ºÎºÐÀ» ¼±ÅÃÇϼ¼¿ä."); return false; } } html = html.replace('unselectable="on"', ''); html = html.substring(0,html.indexOf(' ')) + ' id="' + rand + '"' + html.substring(html.indexOf(' ')); if (mode == "showhide") { html = html.replace('[[_sh_]]', 'id='+ rand + 'sh'); } if (is_IE) { var range = _iframe.contentWindow.document.selection.createRange(); range.pasteHTML(html); if (selected.length < 1) { range.moveToElementText(_iframe.contentWindow.document.getElementById(rand)); range.select(); } else { range.collapse(false); } } else { html += "
"; _iframe.contentWindow.document.execCommand("InsertHTML", false, html); } } function getSelectedHTML(win){ var rng=null,html=""; if (win.contentWindow.document.selection && win.contentWindow.document.selection.createRange){ rng=win.contentWindow.document.selection.createRange(); html=rng.htmlText||""; }else if (win.contentWindow.getSelection){ rng=win.contentWindow.getSelection(); if (rng.rangeCount > 0 && win.contentWindow.XMLSerializer){ rng=rng.getRangeAt(0); html=new XMLSerializer().serializeToString(rng.cloneContents()); } } return html; } function alditorPreview (_iframe) { var param = getCenterWinStr(800, 600); var previewWin = window.open(null, "previewWin",param+",menubar=no,scrollbars=no,statusbar=yes, resizable=yes"); var content = "\ \ \ ¹Ì ¸® º¸ ±â \ \ \ \ \ \
\ " + _iframe.contentWindow.document.body.innerHTML + "\
\ \ "; previewWin.document.open(); previewWin.document.write(content); previewWin.document.close(); } function spellcheck(_iframe) { if (is_IE) { var contentText = _iframe.contentWindow.document.body.innerText; } else { var contentText = _iframe.contentWindow.document.body.textContent; } var param = getCenterWinStr(450, 550); var spellcheckWin = window.open(config.spellcheckLink, "spellcheckWin",param+",menubar=no,scrollbars=yes, statusbar=no, resizable=yes"); var formObj = document.createElement('form'); formObj.setAttribute('name','form'); formObj.setAttribute('action',config.spellcheckAction); formObj.setAttribute('method','post'); formObj.setAttribute('target','spellcheckWin'); var spellText = document.createElement('input'); spellText.setAttribute('type', 'hidden'); spellText.setAttribute('name', 'text1'); spellText.setAttribute('value', contentText); formObj.appendChild(spellText); document.body.appendChild(formObj); formObj.submit(); spellcheckWin.focus(); spellcheckWin.opener = null; } //abs ±â´É var zindexCnt = 0; function makeAbs(_iframe) { var elm = getParentElement(_iframe); currentEditor = _iframe; var selected = getSelectedHTML(_iframe); selected = selected.replace (/(^\s*)|(\s*$)/g, ""); if (selected) { zindexCnt ++; selected = "" + selected + ""; if (is_IE) { currentEditor.contentWindow.document.execCommand("delete", false, null); var sel = currentEditor.contentWindow.document.selection; var range = sel.createRange(); range.pasteHTML(selected); } else { currentEditor.contentWindow.document.execCommand("InsertHTML", false, selected); } } else { if (elm && elm.tagName.toLowerCase() != 'body') { if (elm.style.position != 'absolute') { zindexCnt ++; elm.style.position = 'absolute'; elm.style.zIndex = zindexCnt; } else { elm.style.position = ''; elm.style.zIndex = ''; elm.style.marginLeft = ''; elm.style.marginTop = ''; elm.style.top = ''; elm.style.left = ''; } } } } var absOnMove = false; var init_marginL = 0; var init_marginT = 0; var marginL = 0 var marginT = 0 var absObj; function moveAbs(evt, _iframe) { var e = evt || window.event; var elm = getParentElement(_iframe); var t = e.target ? e.target : e.srcElement; var CurElem = t ? (t.id || t.tagName || t.nodeName || t) : ''; if (is_IE) { var sel = _iframe.contentWindow.document.selection; var selType = sel.type; } if (is_IE) { if (elm && elm.style.position == 'absolute' && CurElem == elm.tagName && selType == "Control") { cancelDefault(e); absObj = elm; absOnMove = true; init_marginL = e.pageX ? e.pageX : e.clientX; init_marginT = e.pageY ? e.pageY : e.clientY; marginL = (parseInt(elm.style.marginLeft) || 0); marginT = (parseInt(elm.style.marginTop) || 0); addEvent(elm, "dragstart", nodrag); addEvent(_iframe.contentWindow.document, "mousemove", moveAbsING); addEvent(_iframe.contentWindow.document, "mouseup", moveAbsEnd); } } else { if (elm && elm.style.position == 'absolute' && CurElem == elm.tagName) { cancelDefault(e); absObj = elm; absOnMove = true; init_marginL = e.pageX ? e.pageX : e.clientX; init_marginT = e.pageY ? e.pageY : e.clientY; marginL = (parseInt(elm.style.marginLeft) || 0); marginT = (parseInt(elm.style.marginTop) || 0); addEvent(_iframe.contentWindow.document, "mousemove", moveAbsING); addEvent(_iframe.contentWindow.document, "mouseup", moveAbsEnd); } } } function nodrag() { return false; } function moveAbsING(evt) { if (!absOnMove) return; var e = evt || window.event; cancelDefault(e); if (!is_IE) { absObj.style.top = null; absObj.style.left = null; } var end_marginL = e.pageX ? e.pageX : e.clientX; var end_marginT = e.pageY ? e.pageY : e.clientY; var diff_marginL = end_marginL - init_marginL; var diff_marginT = end_marginT - init_marginT; if (end_marginL <= currentEditor.contentWindow.document.body.offsetWidth && end_marginL > 0) { absObj.style.marginLeft = marginL + diff_marginL + 'px'; } if (end_marginT <= currentEditor.contentWindow.document.body.offsetHeight && end_marginT > 0) { absObj.style.marginTop = marginT + diff_marginT + 'px'; } } function moveAbsEnd(evt) { absOnMove = false; if (is_IE) { removeEvent(absObj, "dragstart", nodrag, false); } else { absObj.style.top = null; absObj.style.left = null; } removeEvent(currentEditor.contentWindow.document, "mousemove", moveAbsING, false); removeEvent(currentEditor.contentWindow.document, "mouseup", moveAbsEnd, false); } // Åø¹Ù µå·¹±× var on_move = false; var init_y = 0; var new_y = 0; var movableObj; var parentEditor; function tb_moveStart(evt, _toolbarDiv, _iframe) { var e = evt || window.event; cancelDefault(e); init_y = e.pageY ? e.pageY : e.clientY; movableObj = _toolbarDiv; parentEditor = _iframe; on_move = true; addEvent(document, "mousemove", tb_moveING); addEvent(document, "mouseup", tb_moveEnd); } function tb_moveING(evt) { if (!on_move) return; var e = evt || window.event; cancelDefault(e); if (parentEditor.style.display != 'none') { parentEditor.style.visibility = 'hidden'; } var current_y = (movableObj.newTop)? movableObj.newTop : 0; var end_y = e.pageY ? e.pageY : e.clientY; new_y = current_y + (end_y - init_y); if (new_y < 0) { new_y = 0; } movableObj.style.top = new_y + 'px'; } function tb_moveEnd(evt) { on_move = false; if (parentEditor.style.visibility == 'hidden') { parentEditor.style.visibility = 'visible'; } movableObj.newTop = new_y; removeEvent(document, "mousemove", tb_moveING, false); removeEvent(document, "mouseup", tb_moveEnd, false); } //¸®»çÀÌÁî µå·¹±× var on_resize = false; var start_x = 0, start_y = 0, objWidth = 0, objHeight = 0, newWidth = 0, newHeight = 0; var outerTable, resizableObj, wasShown; function resizeStart(evt, _table, _iframe) { var e = evt || window.event; cancelDefault(e); start_x = e.pageX ? e.pageX : e.clientX; start_y = e.pageY ? e.pageY : e.clientY; outerTable = _table; outerTable.className = "topTableDrag"; resizableObj = _iframe.parentNode; if (resizableObj.childNodes[0].style.display != "none") { wasShown = "editor"; newWidth = resizableObj.childNodes[0].offsetWidth; } else { wasShown = "textarea"; newWidth = resizableObj.childNodes[1].offsetWidth; } newHeight = resizableObj.offsetHeight ; resizableObj.childNodes[0].style.display = "none"; resizableObj.childNodes[1].style.display = "none"; hidePathTd(_iframe); objWidth = newWidth; objHeight = newHeight; on_resize = true; addEvent(document, "mousemove", resizING); addEvent(document, "mouseup", resizeEnd); }; function resizING(evt) { if (!on_resize) return; var e = evt || window.event; cancelDefault(e); var end_x = e.pageX ? e.pageX : e.clientX; var end_y = e.pageY ? e.pageY : e.clientY; var diff_x = end_x - start_x; var diff_y = end_y - start_y; newWidth = objWidth + diff_x; newHeight = objHeight + diff_y; (newWidth < config.minWidth)? newWidth = config.minWidth : newWidth; (newHeight < config.minHeight)? newHeight = config.minHeight : newHeight; if (config.dragMode == 1 || config.dragMode > 2) { outerTable.style.width = newWidth + 'px'; } if (config.dragMode > 1) { resizableObj.style.height = newHeight + 'px'; } }; function resizeEnd(evt) { var e = evt || window.event; cancelDefault(e); resizableObj.childNodes[0].style.width = resizableObj.clientWidth + 'px'; resizableObj.childNodes[0].style.height = resizableObj.clientHeight + 'px'; resizableObj.childNodes[1].style.width = resizableObj.clientWidth +'px'; resizableObj.childNodes[1].style.height = resizableObj.clientHeight - 2 + 'px'; outerTable.className = "topTable"; if (wasShown == "editor") { resizableObj.childNodes[0].style.display = ""; editorFocus(resizableObj.childNodes[0], 0); showPathTd(resizableObj.childNodes[0]); } else { resizableObj.childNodes[1].style.display = ""; textareaFocus(resizableObj.childNodes[1]); } editorHeight[resizableObj.childNodes[0].id] = newHeight; on_resize = false; removeEvent(document, "mousemove", resizING, false); removeEvent(document, "mouseup", resizeEnd, false); }; // ű×Ç¥½Ã°ü·Ã function updatePathSafe(evt, _iframe) { evt = evt || window.event; var keyCode = evt.keyCode || evt.charCode; switch (evt.keyCode) { case 37: updatePath(_iframe); break; case 38: updatePath(_iframe); break; case 39: updatePath(_iframe); break; case 40: updatePath(_iframe); break; case 8: updatePath(_iframe); break; } return true; } var removeButton = 1; var selectedNode; function updatePath(_iframe) { var bodyContent = _iframe.contentWindow.document.body; if (bodyContent.firstChild && bodyContent.firstChild.nodeName.toLowerCase() == "p" && bodyContent.childNodes.length < 2) { if (bodyContent.firstChild.innerHTML == " " || bodyContent.firstChild.innerHTML == "") { bodyContent.removeChild(bodyContent.firstChild); } } var ancestors = null; var pathTdArea = document.getElementById(_iframe.id + 'pathTd'); var ancestors = getAllAncestors(_iframe); if (config.showPath) { pathTdArea.innerHTML = "Tags:"; for ( var i = ancestors.length; --i >= 0; ) { var el = ancestors[i]; if ( !el || el.tagName.toLowerCase() == "br") // || el.tagName.toLowerCase() == "body" { continue; } var a = document.createElement("a"); a.href = "javascript:void(0)"; a.node = el; a.onclick = function() { selectNodeContents(_iframe,this.node); return false; } var txt = el.tagName.toLowerCase(); if (txt != "body") { a.title = el.style.cssText; } if ( el.id ) { // txt += "#" + el.id; } if ( el.className ) { // txt += "." + el.className; } a.appendChild(document.createTextNode(txt)); pathTdArea.appendChild(a); if ( i !== 0 ) //&& el.tagName.toLowerCase() != "body" { pathTdArea.appendChild(document.createTextNode(String.fromCharCode(0xbb))); } } if(is_IE) { var sel = _iframe.contentWindow.document.selection.createRange().text; } else { var sel = _iframe.contentWindow.getSelection(); } if ((removeButton > 1) && sel != '') { var a = document.createElement("a"); a.href = "javascript:void(0)"; a.onclick = function() { removeTag(_iframe); return false; }; a.unselectable = 'on'; a.title = "¼±ÅõÈ(°¨½Î°í ÀÖ´Â) ű׸¦ ¹«È¿È­ ÇÕ´Ï´Ù (³»¿ë »èÁ¦ ¾Æ´Ô!)"; a.appendChild(document.createTextNode("x")); pathTdArea.appendChild(a); removeButton --; } } return false; } function getAllAncestors(_iframe) { var p = getParentElement(_iframe); var a = []; while ( p && (p.nodeType == 1) && ( p.tagName.toLowerCase() != 'body' ) ) { a.push(p); p = p.parentNode; } a.push(_iframe.contentWindow.document.body); return a; } function getParentElement(_iframe) { if(is_IE) { var sel = _iframe.contentWindow.document.selection; var range = sel.createRange(); } else { var sel = _iframe.contentWindow.getSelection(); var range = sel.getRangeAt(0); } if (is_IE) { try { switch ( sel.type ) { case "Text": var parent = range.parentElement(); while ( true ) { var TestRange = range.duplicate(); TestRange.moveToElementText(parent); if ( TestRange.inRange(range) ) { break; } if ( ( parent.nodeType != 1 ) || ( parent.tagName.toLowerCase() == 'body' ) ) { break; } parent = parent.parentElement; } return parent; case "None": return range.parentElement(); case "Control": return range.item(0); default: return _iframe.contentWindow.document.body; } } catch(e) {} } else { try { var p = range.commonAncestorContainer; if ( !range.collapsed && range.startContainer == range.endContainer && range.startOffset - range.endOffset <= 1 && range.startContainer.hasChildNodes() ) { p = range.startContainer.childNodes[range.startOffset]; } while ( p.nodeType == 3 ) { p = p.parentNode; } return p; } catch (ex) { return null; } } } function selectNodeContents (_iframe, node) { if (!node) { return; } _iframe.contentWindow.focus(); _iframe.contentWindow.document.body.style.visibility = "hidden"; _iframe.contentWindow.document.body.style.visibility = "visible"; if ( is_IE ) { var range; if (node.tagName && node.tagName.toLowerCase().match(/table|img|input|select|textarea/) ) { range = _iframe.contentWindow.document.body.createControlRange(); range.add(node); } else { range = _iframe.contentWindow.document.body.createTextRange(); range.moveToElementText(node); } range.select(); } else { var range; var sel = _iframe.contentWindow.getSelection(); range = sel.getRangeAt(0); if (node.tagName && node.tagName.toLowerCase().match(/table|img|input|textarea|select/) ) { range.selectNode(node); } else { range.selectNodeContents(node); } sel.removeAllRanges(); sel.addRange(range); } selectedNode = node; if (node.parentNode.tagName.toLowerCase() != "html") { removeButton = 3; } else { removeButton = 1; } updatePath(_iframe); } function removeTag(_iframe) { if (selectedNode && selectedNode.parentNode != null) { try { var len = selectedNode.childNodes.length; for (i=0; i < len ; i++) { selectedNode.parentNode.insertBefore( selectedNode.firstChild, selectedNode); } selectedNode.parentNode.removeChild(selectedNode); selectedNode = null; removeButton = 1; }catch (e) {} } editorFocus(_iframe, 1); // ¾Æ·¡ ÁÖ¼®°ú ±³Â÷ (ÅÂ±× Á¦°ÅÈÄ ¼±ÅÃÃë¼Ò? | ÇöÀç: Ãë¼Ò) //updatePath(_iframe); } // ÆùÆ® ·¹À̾î function getFontName(_iframe, buttonObj) { currentEditor = _iframe; var fontSelector = document.getElementById("fontSelector"); fontSelector.style.left = getOffsetLeft(buttonObj) + 'px'; fontSelector.style.top = getOffsetTop(buttonObj) + buttonObj.offsetHeight + 'px'; fontSelector.style.display=""; } function setFont(fontname) { currentEditor.contentWindow.document.execCommand("fontname",false,fontname); hideFontset(); currentEditor.contentWindow.focus(); } function hideFontset() { document.getElementById("fontSelector").style.display="none"; hideFontSizeset(); } function makeFontset() { if(document.getElementById("fontSelector") == null){ var fontDiv = document.createElement("div"); fontDiv.id = "fontSelector"; fontDiv.unselectable = "on"; fontDiv.style.width = "185px"; fontDiv.style.display = "none"; fontDiv.style.zIndex = 5; fontDiv.style.position = "absolute"; fontDiv.style.border = "#9B9B9B 1px solid"; var tablestr = ''; var optionList = config.fontOptions; for (var i = 0; i < optionList.length; i += 2) { tablestr += ''; } tablestr += '
ÃʱâÈ­
'+optionList[i + 1]+' (°¡,A,a,1)
'; fontDiv.innerHTML = tablestr; document.body.appendChild(fontDiv); makeFontSizeset(); } } // ÆùƮũ±â ·¹À̾î function getFontSize(_iframe, buttonObj) { currentEditor = _iframe; var fontSizeSelector = document.getElementById("fontSizeSelector"); fontSizeSelector.style.left = getOffsetLeft(buttonObj) + 'px'; fontSizeSelector.style.top = getOffsetTop(buttonObj) + buttonObj.offsetHeight + 'px'; fontSizeSelector.style.display=""; } function setFontSize(fontsize) { if (config.freeFontSize) { setFontSizeFree(fontsize); } else { currentEditor.contentWindow.document.execCommand("fontsize",false,fontsize); } hideFontSizeset(); currentEditor.contentWindow.focus(); } function setFontSizeFree(fontsize){ if (is_IE){ var sel = currentEditor.contentWindow.document.selection } else { var sel = currentEditor.contentWindow.getSelection(); } var type = sel.type; if("Control" == type){ return; } var html = getSelectedHTML(currentEditor); if (document.getElementById('hiddenFontDiv') == null) { var tempdiv = document.createElement("div"); tempdiv.id = "hiddenFontDiv"; tempdiv.style.display = "none"; document.body.appendChild(tempdiv); } else { var tempdiv = document.getElementById('hiddenFontDiv'); } tempdiv.innerHTML = html; var eles = tempdiv.getElementsByTagName('*'); var lng = eles.length; for (i=0; i < lng ; i++) { if (eles[i].nodeName == "FONT") { eles[i].size = null; eles[i].style.fontSize = fontsize; } if (eles[i].nodeName != "BR" && eles[i].nodeName != "HR" && eles[i].nodeName != "UL" && eles[i].nodeName != "OL") { eles[i].style.fontSize = fontsize; } } var texts = tempdiv.childNodes; var lng1 = texts.length; for (i=0; i < lng1 ; i++ ) { if (texts[i].nodeType == 3) { var newspan = document.createElement('span'); newspan.style.fontSize = fontsize; newspan.innerHTML = texts[i].nodeValue; texts[i].parentNode.replaceChild(newspan, texts[i]); } } var newhtml = " "+document.getElementById('hiddenFontDiv').innerHTML; if (newhtml != '') { if (is_IE) { currentEditor.contentWindow.document.execCommand("delete", false, null); var range = sel.createRange(); range.pasteHTML(newhtml); } else { currentEditor.contentWindow.document.execCommand("InsertHTML", false, newhtml); } } if (html == '' || newhtml == ''){ alert('\nº»¹®¿¡¼­ ±ÛÀÚÀÇ Å©±â¸¦ º¯°æÇÒ ¿µ¿ªÀ» ¼±ÅÃÇØ ÁÖ¼¼¿ä.\t\n\n(¸¶¿ì½º µå·¡±× ¶Ç´Â shift + ¹æÇâŰ)'); } } function hideFontSizeset() { document.getElementById("fontSizeSelector").style.display="none"; } function makeFontSizeset() { if(document.getElementById("fontSizeSelector") == null){ var fontSizeDiv = document.createElement("div"); fontSizeDiv.id = "fontSizeSelector"; fontSizeDiv.unselectable = "on"; fontSizeDiv.style.width = "100px"; fontSizeDiv.style.display = "none"; fontSizeDiv.style.zIndex = 5; fontSizeDiv.style.position = "absolute"; fontSizeDiv.style.border = "#9B9B9B 1px solid"; var optionList = config.fontSizeOptions; if (config.freeFontSize) { var starti = 0; } else { var starti = 2; } var tablestr = ''; var tdcont = 0; for (var i = starti; i < optionList.length; i += 2) { tablestr += ''; if (i == (optionList.length - 2)) { tablestr += ''; } tdcont ++; if (tdcont == 2) { tablestr += ''; tdcont = 0; } } tablestr += '
ÃʱâÈ­
'+optionList[i + 1]+'
'; fontSizeDiv.innerHTML = tablestr; document.body.appendChild(fontSizeDiv); } } // Ä÷¯ÇÈÄ¿ var command, currentEditor; function getColor(_iframe, buttonObj, cmd) { currentEditor = _iframe; command = cmd; var colorSelector = document.getElementById("colorSelector"); colorSelector.style.left = getOffsetLeft(buttonObj) + 'px'; colorSelector.style.top = getOffsetTop(buttonObj) + buttonObj.offsetHeight + 'px'; colorSelector.style.display=""; } function hideColorPicker() { document.getElementById("colorSelector").style.display="none"; } function previewColor(color) { document.getElementById("color_view").bgColor = color; document.getElementById("color_value").style.color = "#"+color; document.getElementById("color_value").value = color; } function chooseColor(color) { currentEditor.contentWindow.document.execCommand(command,false,color); hideColorPicker(); editorFocus(currentEditor,2); } function makeColorset() { if(document.getElementById("colorSelector") == null){ var colorDiv = document.createElement("div"); colorDiv.id = "colorSelector"; colorDiv.unselectable = "on"; colorDiv.style.padding = "5px"; colorDiv.style.display = "none"; colorDiv.style.zIndex = 5; colorDiv.style.position = "absolute"; colorDiv.style.backgroundColor = "#FFFFFF"; colorDiv.style.border = "#9b9b9b 1px solid"; colorDiv.align="center"; colorDiv.innerHTML = '
'; document.body.appendChild(colorDiv); } } //ÇÏÀ̶óÀÌÆ® ÇÈÄ¿ function getHilite(_iframe, buttonObj) { currentEditor = _iframe; var hiliteSelector = document.getElementById("hiliteSelector"); hiliteSelector.style.left = getOffsetLeft(buttonObj) + 'px'; hiliteSelector.style.top = getOffsetTop(buttonObj) + buttonObj.offsetHeight + 'px'; hiliteSelector.style.display=""; } function hideHiliteSelector() { document.getElementById("hiliteSelector").style.display="none"; } function chooseHilite(color1, color2, act) { if (act == true) { currentEditor.contentWindow.document.execCommand("RemoveFormat",false,null); hideHiliteSelector(); editorFocus(currentEditor,2); return; } else { if (color1) { currentEditor.contentWindow.document.execCommand("ForeColor", false, color1); } if (is_IE) { currentEditor.contentWindow.document.execCommand("BackColor", false, color2); } else { currentEditor.contentWindow.document.execCommand("Hilitecolor", false, color2); } hideHiliteSelector(); editorFocus(currentEditor,1); } } function makeHiliteset() { if(document.getElementById("hiliteSelector") == null){ var hiliteDiv = document.createElement("div"); hiliteDiv.id = "hiliteSelector"; hiliteDiv.unselectable = "on"; hiliteDiv.style.padding = "5px"; hiliteDiv.style.display = "none"; hiliteDiv.style.zIndex = 5; hiliteDiv.style.width = "154px"; hiliteDiv.style.position = "absolute"; hiliteDiv.style.backgroundColor = "#FFFFFF"; hiliteDiv.style.border = "#9b9b9b 1px solid"; hiliteDiv.align="center"; hiliteDiv.innerHTML = '
°¡³ª´Ù¶ó¸¶¹Ù °¡³ª´Ù¶ó¸¶¹Ù
°¡³ª´Ù¶ó¸¶¹Ù °¡³ª´Ù¶ó¸¶¹Ù
°¡³ª´Ù¶ó¸¶¹Ù °¡³ª´Ù¶ó¸¶¹Ù
°¡³ª´Ù¶ó¸¶¹Ù °¡³ª´Ù¶ó¸¶¹Ù
°¡³ª´Ù¶ó¸¶¹Ù °¡³ª´Ù¶ó¸¶¹Ù
°­Á¶ È¿°ú Á¦°Å
'; document.body.appendChild(hiliteDiv); } } // Å×ÀÌºí ¸ÞÀÌÄ¿ function showTableset(_iframe, buttonObj) { currentEditor = _iframe; var tableCreator = document.getElementById("tableCreatorDiv"); tableCreator.style.left = getOffsetLeft(buttonObj) + 'px'; tableCreator.style.top = getOffsetTop(buttonObj) + buttonObj.offsetHeight + 'px'; tableCreator.style.display=""; } function hideTableset() { document.getElementById('tableCreatorDiv').style.display = 'none'; } function makeTableset() { var rows = 5; var cols = 7; if(document.getElementById("tableCreatorDiv") == null){ var tablesetDiv = document.createElement("div"); tablesetDiv.style.border = "#CCCCCC 1px solid"; tablesetDiv.style.width = "145px"; tablesetDiv.style.display = "none"; tablesetDiv.style.position = "absolute"; tablesetDiv.style.zIndex = 5; tablesetDiv.style.backgroundColor = "#FFFFFF"; tablesetDiv.id = "tableCreatorDiv"; tablesetDiv.unselectable = "on"; var tablesetTable = document.createElement("table"); tablesetTable.width = "100%"; tablesetTable.cellSpacing = 2; tablesetTable.cellPadding = 0; tablesetTable.border = 0; tablesetTable.style.tableLayout = "fixed"; tablesetTable.style.cursor = "pointer"; tablesetTable.id = "tableCreator"; var tbody = document.createElement("tbody"); for (i=0; i < rows ; i++ ) { var row = document.createElement("TR"); row.height = 12; for (ii=0; ii< cols ; ii++) { var col = document.createElement("TD"); col.style.border = "#CCCCCC 1px solid"; col.style.fontSize = "12px"; col.unselectable = "on"; col.onclick = new Function('createTable(' + (i + 1) + ',' + (ii + 1) + ')'); col.onmouseover = new Function('createTableHover(' + (i + 1) + ',' + (ii + 1) + ')'); col.innerHTML = " "; row.appendChild(col); } tbody.appendChild(row); } tablesetTable.appendChild(tbody); tablesetDiv.appendChild(tablesetTable); document.body.appendChild(tablesetDiv); } } function createTableHover(row, col) { var table = document.getElementById('tableCreator'); var tableRow = table.firstChild.childNodes; for (var i = 0; i < tableRow.length; i++) { for (var j = 0; j '; document.getElementById(flashcopier).innerHTML = divinfo; alert('Ŭ¸³º¸µå¿¡ ÀúÀåµÇ¾ú½À´Ï´Ù.'); } } }; function encodeforFlash(str) { var SAFECHARS = "0123456789" + "ABCDEFGHIJKLMNOPQRSTUVWXYZ" + "abcdefghijklmnopqrstuvwxyz" + "-_.!~*'()"; var HEX = "0123456789ABCDEF"; var plaintext = str; var encoded = ""; for (var i = 0; i < plaintext.length; i++ ) { var ch = plaintext.charAt(i); if (ch == " ") { encoded += "+"; } else if (SAFECHARS.indexOf(ch) != -1) { encoded += ch; } else { var charCode = ch.charCodeAt(0); if (charCode > 255) { encoded += ch; //ÇѱÛÀº Åë°ú } else { encoded += "%"; encoded += HEX.charAt((charCode >> 4) & 0xF); encoded += HEX.charAt(charCode & 0xF); } } } // for return encoded; }; //¿¡·¯ ¹«½Ã °ü·Ã function killerror(){ return true; } if (config.killError) { window.onerror = killerror; } ////ajax °ü·Ã.. function getHTTPObject() { var xmlhttp; /*@cc_on @if (@_jscript_version >= 5) try { xmlhttp = new ActiveXObject("Msxml2.XMLHTTP"); } catch (e) { try { xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); } catch (E) { xmlhttp = false; } } @else xmlhttp = false; @end @*/ if (!xmlhttp && typeof XMLHttpRequest != 'undefined') { try { xmlhttp = new XMLHttpRequest(); } catch (e) { xmlhttp = false; } } return xmlhttp; } var http = getHTTPObject();