Changeset 595

Show
Ignore:
Timestamp:
03/04/09 11:17:30 (18 months ago)
Author:
jparker
Message:
  • 맞춤법 체크 플러그인 환경설정 보완.
Location:
plugins/trunk/JP_UrimalSpellCheck
Files:
1 removed
2 modified

Legend:

Unmodified
Added
Removed
  • plugins/trunk/JP_UrimalSpellCheck/index.php

    r538 r595  
    11<?php 
    22function getPostSpellCheck($target) { 
    3     global $blogURL, $pluginURL; 
    4     $script[] = '<script type="text/javascript">var blogURL_USC="'.$blogURL.'";</script>'; 
    5     $script[] = '<script type="text/javascript" src="'.$pluginURL.'/lib/spellcheck.js"></script>'; 
    6     $script[] = '<script language="javascript" type="text/javascript">'; 
    7     $script[] = '//<![CDATA['; 
    8     $script[] = 'String.prototype.trim = function () {return this.replace(/\s\s+/, " ").replace("\'", "").replace(/^\s*/g, "").replace(/\s*$/g, "");}'; 
    9     $script[] = 'function spellcheck_owner(caller) {'; 
    10     $script[] = '   if(editor.editMode == "WYSIWYG") {'; 
    11     $script[] = '       var contentDoc = editor.contentDocument.body;'; 
    12     $script[] = '       var text = (document.all) ? contentDoc.innerText : contentDoc.textContent;'; 
    13     $script[] = '   } else {'; 
    14     $script[] = '       var text = document.getElementById("editWindow").value;'; 
    15     $script[] = '   }'; 
    16     $script[] = '   var content = text.trim();'; 
    17     $script[] = '   getSpellcheck("", "", content, 0);'; 
    18     $script[] = '}//]]></script>'; 
    19     $script[] = '<div id="SpellView" style="position:absolute;display:none;z-index:200;width:600px;height:400px;overflow-y:scroll;"></div>'; 
    20     $script[] = '<img src="'.$pluginURL.'/lib/spellcheck_icon.gif" width="74" height="20" border="0"  onclick="spellcheck_owner(this);return false;" style="cursor:pointer;">'; 
    21  
    22     return implode("\r\n", $script).$target; 
     3    global $blogURL, $pluginURL, $configVal; 
     4    requireComponent('Textcube.Function.misc'); 
     5    $data = misc::fetchConfigVal($configVal); 
     6    $data['editor'] = isset($data['editor']) ? $data['editor'] : 1; 
     7    if ($data['editor'] > 0) { 
     8        $script[] = '<script type="text/javascript">var blogURL_USC="'.$blogURL.'";</script>'; 
     9        $script[] = '<script type="text/javascript" src="'.$pluginURL.'/lib/spellcheck.js"></script>'; 
     10        $script[] = '<script language="javascript" type="text/javascript">'; 
     11        $script[] = '//<![CDATA['; 
     12        $script[] = 'String.prototype.trim = function () {return this.replace(/\s\s+/, " ").replace("\'", "").replace(/^\s*/g, "").replace(/\s*$/g, "");}'; 
     13        $script[] = 'function spellcheck_owner(caller) {'; 
     14        $script[] = '   if(editor.editMode == "WYSIWYG") {'; 
     15        $script[] = '       var contentDoc = editor.contentDocument.body;'; 
     16        $script[] = '       var text = (document.all) ? contentDoc.innerText : contentDoc.textContent;'; 
     17        $script[] = '   } else {'; 
     18        $script[] = '       var text = document.getElementById("editWindow").value;'; 
     19        $script[] = '   }'; 
     20        $script[] = '   var content = text.trim();'; 
     21        $script[] = '   getSpellcheck("", "", content, 0);'; 
     22        $script[] = '}//]]></script>'; 
     23        $script[] = '<div id="SpellView" style="position:absolute;display:none;z-index:200;width:600px;height:400px;overflow-y:scroll;"></div>'; 
     24        $script[] = '<img src="'.$pluginURL.'/lib/spellcheck_icon.gif" width="74" height="20" border="0"  onclick="spellcheck_owner(this);return false;" style="cursor:pointer;">'; 
     25        $target = implode("\r\n", $script).$target; 
     26    } 
     27    return $target; 
    2328} 
    2429 
    2530function getCommentSpellCheck($target) { 
    26     global $pluginURL; 
    27     $target .= '<img src="'.$pluginURL.'/lib/spellcheck_icon.gif" width="74" height="20" border="0" align="absbottom" onclick="getSpellcheck(this, \'[##_article_rep_id_##]\', \'\', 1);return false;" style="cursor:pointer;">&nbsp;(<a href="http://urimal.cs.pusan.ac.kr/urimal_new" onclick="window.open(this.href); return false;">우리말 배움터</a>)'; 
     31    global $pluginURL, $configVal; 
     32    $data = misc::fetchConfigVal($configVal); 
     33    $data['comment'] = isset($data['comment']) ? $data['comment'] : 1; 
     34    if ($data['comment'] > 0) { 
     35        $target .= '<img src="'.$pluginURL.'/lib/spellcheck_icon.gif" width="74" height="20" border="0" align="absbottom" onclick="getSpellcheck(this, \'[##_article_rep_id_##]\', \'\', 1);return false;" style="cursor:pointer;">&nbsp;(<a href="http://urimal.cs.pusan.ac.kr/urimal_new" onclick="window.open(this.href); return false;">우리말 배움터</a>)'; 
     36    } 
    2837    return $target; 
    2938} 
    3039 
    3140function getSpellCheckScript($target) { 
    32     global $blogURL, $pluginURL; 
    33     ob_start(); 
    34 ?> 
    35 <script type="text/javascript">var blogURL_USC="<?php echo $blogURL;?>";</script> 
    36 <script type="text/javascript" src="<?php echo $pluginURL;?>/lib/spellcheck.js"></script> 
    37 <?php 
    38     $target .= ob_get_contents(); 
    39     ob_end_clean(); 
     41    global $blogURL, $pluginURL, $entries, $suri, $configVal; 
     42    $data = misc::fetchConfigVal($configVal); 
     43    $data['comment'] = isset($data['comment']) ? $data['comment'] : 1; 
     44    if ($data['comment'] > 0) { 
     45        $script = ''; 
     46        if (count($entries) > 0 || $suri['directive']=="/guestbook") { 
     47            $script .= '<script type="text/javascript">var blogURL_USC="' . $blogURL . '";</script>'.CRLF; 
     48            $script .= '<script type="text/javascript" src="' . $pluginURL . '/lib/spellcheck.js"></script>'.CRLF; 
     49        } 
     50        $target .= $script; 
     51    } 
    4052    return $target; 
    4153} 
     
    4961 
    5062    if(is_null($data)){ 
    51         $data['actionURL']  = "http://164.125.36.47/WebSpell_ISAPI.dll?Check"; 
     63        $data['actionURL']  = "http://speller.cs.pusan.ac.kr/WebSpell_ISAPI.dll?Check"; 
    5264    } 
    5365 
  • plugins/trunk/JP_UrimalSpellCheck/index.xml

    r538 r595  
    22<plugin version="1.0"> 
    33  <title>JP 우리말 맞춤법/문법 검사기</title> 
    4   <version>1.6.0225</version> 
     4  <version>1.9.0304</version> 
    55  <description>태터 블로그에서 신규/수정할 글과 댓글 및 방명록 작성시 본문에 쓰여진 글(한글/영문/한자)을 우리말(한국어) 맞춤법과 문법을 체크할 수 있는 검사기 플러그인입니다.[참조:우리말배움터(http://urimal.cs.pusan.ac.kr)]</description> 
    66  <license>GPL</license> 
     
    1818    <tag name="SKIN_head_end" handler="getSpellCheckScript" /> 
    1919    <config dataValHandler="getSpellCheckDataSet" > 
    20         <window width="500" height="287" /> 
    21             <fieldset legend="맞춤법/문법 관련 URL" > 
    22                 <field title="검사 URL :" name="actionURL" type="text" size ="50" value="http://164.125.36.47/WebSpell_ISAPI.dll?Check" > 
    23                     <caption><![CDATA[<b>tip:</b> 접속이 원할하지 못 할때는 위 URL의 IP번호를 확인해 보시기 바랍니다.<br>(체크할 IP번호는 164.125.36.46~164.125.36.48 사이 입니다.)]]></caption> 
     20        <window width="500" height="310" /> 
     21            <fieldset legend="맞춤법/문법 관련 설정" > 
     22                <field title="검사 URL :" name="actionURL" type="text" size="50" value="http://speller.cs.pusan.ac.kr/WebSpell_ISAPI.dll?Check" > 
     23                    <caption><![CDATA[<b>tip:</b> 접속이 원할하지 못 할때는 <a href="http://urimal.cs.pusan.ac.kr/system/speller" target="_blank"><font color="blue">Form URL</font></a> 경로를 확인해 보세요.]]></caption> 
     24                </field> 
     25                <field title="사용 범위 :" name="scope" type="checkbox"> 
     26                    <op name="editor" value="1" checked="checked"><![CDATA[<b>에디터&nbsp;</b>]]></op> 
     27                    <op name="comment" value="1" checked="checked"><![CDATA[<b>댓글</b>]]></op> 
    2428                </field> 
    2529            </fieldset>