Changeset 3283

Show
Ignore:
Timestamp:
05/16/07 17:24:40 (20 months ago)
Author:
inureyes
Message:

#407

  • Move to trunk / 1.5 tree.
  • 언제나 느끼지만 너무 비효율적인 스크립트 자체를 좀 뜯어야 할 것 같다.
Files:
4 modified

Legend:

Unmodified
Added
Removed
  • branches/1.5/lib/view/view.php

    r3124 r3283  
    3636    ob_start(); 
    3737?> 
     38 
    3839    <!-- 
    3940        <?php echo TEXTCUBE_NAME." ".TEXTCUBE_VERSION.CRLF;?> 
     
    4344    --> 
    4445    <script type="text/javascript"> 
    45         //<![CDATA[ 
    46             var servicePath = "<?php echo $service['path'];?>"; 
    47             var blogURL = "<?php echo $blogURL;?>"; 
    48         //]]> 
     46    //<![CDATA[ 
     47        var servicePath = "<?php echo $service['path'];?>"; 
     48        var blogURL = "<?php echo $blogURL;?>"; 
     49        var prevURL = "<?php echo isset($paging['prev']) ? escapeJSInCData("{$paging['url']}{$paging['prefix']}{$paging['prev']}{$paging['postfix']}") : '';?>"; 
     50        var nextURL = "<?php echo isset($paging['next']) ? escapeJSInCData("{$paging['url']}{$paging['prefix']}{$paging['next']}{$paging['postfix']}") : '';?>"; 
     51        var commentKey = "<?php echo md5(filemtime(ROOT . '/config.php'));?>"; 
     52        var doesHaveOwnership = <?php echo doesHaveOwnership() ? 'true' : 'false'; ?>; 
     53        var messages = { 
     54            "trackbackUrlCopied": "<?php echo _text('엮인글 주소가 복사되었습니다.');?>", 
     55            "operationFailed": "<?php echo _text('실패했습니다.');?>", 
     56            "confirmTrackbackDelete": "<?php echo _text('선택된 글걸기를 삭제합니다. 계속 하시겠습니까?');?>", 
     57            "confirmEntryDelete": "<?php echo _text('이 글 및 이미지 파일을 완전히 삭제합니다. 계속 하시겠습니까?');?>" 
     58        } 
     59    //]]> 
    4960    </script> 
    5061    <script type="text/javascript" src="<?php echo $service['path'];?>/script/EAF2.js"></script> 
     
    5768<?php 
    5869    } 
    59 ?> 
    60     <script type="text/javascript"> 
    61         //<![CDATA[ 
    62             function processShortcut(event) { 
    63                 if (isIE) 
    64                 { 
    65                     event = window.event; 
    66                     event.target = event.srcElement; 
    67                 } 
    68  
    69                 if (event.altKey || event.ctrlKey) 
    70                     return; 
    71                 switch (event.target.nodeName) { 
    72                     case "INPUT": 
    73                     case "SELECT": 
    74                     case "TEXTAREA": 
    75                         return; 
    76                 } 
    77                 switch (event.keyCode) { 
    78                     case 81: //Q 
    79                         window.location = "<?php echo $blogURL;?>/owner"; 
    80                         break; 
    81                     case 82: //R 
    82                         window.location = "<?php echo $blogURL;?>/owner/reader"; 
    83                         break; 
    84                     case 84: //T 
    85                         window.location = "<?php echo $blogURL;?>/owner/reader/?forceRefresh"; 
    86                         break; 
    87 <?php 
    88     if (isset($paging['prev'])) { 
    89 ?> 
    90                     case 65: //A 
    91                         window.location = "<?php echo escapeJSInCData("{$paging['url']}{$paging['prefix']}{$paging['prev']}{$paging['postfix']}");?>"; 
    92                         break; 
    93 <?php 
    94     } 
    95     if (isset($paging['next'])) { 
    96 ?> 
    97                     case 83: //S 
    98                         window.location = "<?php echo escapeJSInCData("{$paging['url']}{$paging['prefix']}{$paging['next']}{$paging['postfix']}");?>"; 
    99                         break; 
    100 <?php 
    101     } 
    102 ?> 
    103                     case 90: //Z 
    104                         window.location = "#recentEntries"; 
    105                         break; 
    106                     case 88: //X 
    107                         window.location = "#recentComments"; 
    108                         break; 
    109                     case 67: //C 
    110                         window.location = "#recentTrackback"; 
    111                         break; 
    112                 } 
    113             } 
    114             document.onkeydown = processShortcut; 
    115  
    116             function addComment(caller, entryId) { 
    117                 var oForm = findFormObject(caller); 
    118                 if (!oForm) 
    119                     return false; 
    120                 var request = new HTTPRequest("POST", oForm.action); 
    121                 request.onSuccess = function () { 
    122                     document.getElementById("entry" + entryId + "Comment").innerHTML = this.getText("/response/commentBlock"); 
    123                     if(getObject("recentComments") != null) 
    124                         document.getElementById("recentComments").innerHTML = this.getText("/response/recentCommentBlock"); 
    125                     if(getObject("commentCount" + entryId) != null) 
    126                         document.getElementById("commentCount" + entryId).innerHTML = this.getText("/response/commentView"); 
    127                     if(getObject("commentCountOnRecentEntries" + entryId) != null) 
    128                         document.getElementById("commentCountOnRecentEntries" + entryId).innerHTML = "(" + this.getText("/response/commentCount") + ")"; 
    129                 } 
    130                 request.onError = function() { 
    131                     alert(this.getText("/response/description")); 
    132                 } 
    133  
    134                 var queryString = "key=<?php echo md5(filemtime(ROOT . '/config.php'));?>"; 
    135  
    136                 tempComment = 'comment_' + entryId; 
    137                 tempHomepage = 'homepage_' + entryId; 
    138                 tempName = 'name_' + entryId; 
    139                 tempPassword = 'password_' + entryId; 
    140                 tempSecret = 'secret_' + entryId; 
    141  
    142                 for (i=0; i<oForm.elements.length; i++) { 
    143                     if (queryString != "") 
    144                         linker = "&"; 
    145                     else 
    146                         linker = ""; 
    147  
    148                     // disabled 상태이면 패스. 
    149                     if (oForm.elements[i].disabled == true) 
    150                         continue; 
    151  
    152                     if (oForm.elements[i].tagName.toLowerCase() == "input") { 
    153                         switch (oForm.elements[i].type) { 
    154                             case "checkbox": 
    155                             case "radio": 
    156                                 if (oForm.elements[i].checked == true) { 
    157                                     if (oForm.elements[i].name == tempSecret) 
    158                                         queryString += linker + oForm.elements[i].name + '=' + encodeURIComponent(oForm.elements[i].value); 
    159                                     else if (oForm.elements[i].id == tempSecret) 
    160                                         queryString += linker + oForm.elements[i].id + '=' + encodeURIComponent(oForm.elements[i].value); 
    161                                     else if (oForm.elements[i].name != '') 
    162                                         queryString += linker + oForm.elements[i].name + '_' + entryId + '=' + encodeURIComponent(oForm.elements[i].value); 
    163                                     else if (oForm.elements[i].id != '') 
    164                                         queryString += linker + oForm.elements[i].id + "=" + encodeURIComponent(oForm.elements[i].value); 
    165                                 } 
    166                                 break; 
    167                             case "text": 
    168                             case "password": 
    169                             case "hidden": 
    170                             case "button": 
    171                             case "submit": 
    172                                 if (oForm.elements[i].name == tempName) 
    173                                     queryString += linker + oForm.elements[i].name + '=' + encodeURIComponent(oForm.elements[i].value); 
    174                                 else if (oForm.elements[i].id == tempName) 
    175                                     queryString += linker + oForm.elements[i].id + '=' + encodeURIComponent(oForm.elements[i].value); 
    176                                 else if (oForm.elements[i].name == tempPassword) 
    177                                     queryString += linker + oForm.elements[i].name + '=' + encodeURIComponent(oForm.elements[i].value); 
    178                                 else if (oForm.elements[i].id == tempPassword) 
    179                                     queryString += linker + oForm.elements[i].id + '=' + encodeURIComponent(oForm.elements[i].value); 
    180                                 else if (oForm.elements[i].name == tempHomepage) 
    181                                     queryString += linker + oForm.elements[i].name + '=' + encodeURIComponent(oForm.elements[i].value); 
    182                                 else if (oForm.elements[i].id == tempHomepage) 
    183                                     queryString += linker + oForm.elements[i].id + '=' + encodeURIComponent(oForm.elements[i].value); 
    184                                 else if (oForm.elements[i].name != '') 
    185                                     queryString += linker + oForm.elements[i].name + '_' + entryId + "=" + encodeURIComponent(oForm.elements[i].value); 
    186                                 else if (oForm.elements[i].id != '') 
    187                                     queryString += linker + oForm.elements[i].id + "=" + encodeURIComponent(oForm.elements[i].value); 
    188                                 break; 
    189                             //case "file": 
    190                             //  break; 
    191                         } 
    192                     } else if (oForm.elements[i].tagName.toLowerCase() == "select") { 
    193                         num = oForm.elements[i].selectedIndex; 
    194                         if (oForm.elements[i].name != '') 
    195                             queryString += linker + oForm.elements[i].name + '_' + entryId + "=" + encodeURIComponent(oForm.elements[i].options[num].value); 
    196                         else if (oForm.elements[i].id != '') 
    197                             queryString += linker + oForm.elements[i].id + "=" + encodeURIComponent(oForm.elements[i].options[num].value); 
    198                     } else if (oForm.elements[i].tagName.toLowerCase() == "textarea") { 
    199                         if (oForm.elements[i].name == tempComment) 
    200                             queryString += linker + oForm.elements[i].name + '=' + encodeURIComponent(oForm.elements[i].value); 
    201                         else if (oForm.elements[i].name != '') 
    202                             queryString += linker + oForm.elements[i].name + '_' + entryId + "=" + encodeURIComponent(oForm.elements[i].value); 
    203                         else if (oForm.elements[i].id != '') 
    204                             queryString += linker + oForm.elements[i].id + "=" + encodeURIComponent(oForm.elements[i].value); 
    205                     } 
    206                 } 
    207                 request.send(queryString); 
    208             } 
    209  
    210             var openWindow=''; 
    211  
    212             function alignCenter(win,width,height) { 
    213                 try{ // sometimes fail. 
    214                     win.moveTo(screen.width/2-width/2,screen.height/2-height/2); 
    215                 } catch (e) {} 
    216             } 
    217  
    218             function deleteComment(id) { 
    219                 width = 450; 
    220                 height = 400; 
    221                 if(openWindow != '') openWindow.close(); 
    222                 openWindow = window.open("<?php echo $blogURL;?>/comment/delete/" + id, "tatter", "width="+width+",height="+height+",location=0,menubar=0,resizable=0,scrollbars=0,status=0,toolbar=0"); 
    223                 openWindow.focus(); 
    224                 alignCenter(openWindow,width,height); 
    225             } 
    226  
    227             function commentComment(parent) { 
    228                 width = 450; 
    229                 height = 380; 
    230                 if(openWindow != '') openWindow.close(); 
    231                 openWindow = window.open("<?php echo $blogURL;?>/comment/comment/" + parent, "tatter", "width="+width+",height="+height+",location=0,menubar=0,resizable=0,scrollbars=0,status=0,toolbar=0"); 
    232                 openWindow.focus(); 
    233                 alignCenter(openWindow,width,height); 
    234             } 
    235  
    236             function editEntry(parent,child) { 
    237                 width =  1020; 
    238                 height = 550; 
    239                 if(openWindow != '') openWindow.close(); 
    240                 openWindow = window.open("<?php echo $blogURL;?>/owner/entry/edit/" + parent + "?popupEditor&returnURL=" + child,"tatter", "width="+width+",height="+height+",location=0,menubar=0,resizable=1,scrollbars=1,status=0,toolbar=0"); 
    241                 openWindow.focus(); 
    242                 alignCenter(openWindow,width,height); 
    243             } 
    244  
    245             function guestbookComment(parent) { 
    246                 width = 450; 
    247                 height = 360; 
    248                 if(openWindow != '') openWindow.close(); 
    249                 openWindow = window.open("<?php echo $blogURL;?>/comment/comment/" + parent, "tatter", "width="+width+",height="+height+",location=0,menubar=0,resizable=0,scrollbars=0,status=0,toolbar=0"); 
    250                 openWindow.focus(); 
    251                 alignCenter(openWindow,width,height); 
    252             } 
    253  
    254             function sendTrackback(id) { 
    255                 width = 700; 
    256                 height = 500; 
    257                 if(openWindow != '') openWindow.close(); 
    258                 openWindow = window.open("<?php echo $blogURL;?>/trackback/send/" + id, "tatter", "width=580,height=400,location=0,menubar=0,resizable=1,scrollbars=1,status=0,toolbar=0"); 
    259                 openWindow.focus(); 
    260                 alignCenter(openWindow,width,height); 
    261             } 
    262  
    263             function copyUrl(url){ 
    264                 if(isIE) { 
    265                     window.clipboardData.setData('Text',url); 
    266                     window.alert("<?php echo _text('엮인글 주소가 복사되었습니다.');?>"); 
    267                 } 
    268             } 
    269  
    270  
    271             function deleteTrackback(id,entryId) { 
    272 <?php 
    273     if (doesHaveOwnership()) { 
    274 ?> 
    275                 if (!confirm("<?php echo _text('선택된 글걸기를 삭제합니다. 계속 하시겠습니까?');?>")) 
    276                     return; 
    277  
    278                 var request = new HTTPRequest("GET", "<?php echo $blogURL;?>/trackback/delete/" + id); 
    279                 request.onSuccess = function() { 
    280                     document.getElementById('entry' + entryId + 'Trackback').innerHTML = this.getText("/response/trackbackList"); 
    281                     document.getElementById('entry' + entryId + 'Trackback').style.display = "block"; 
    282                     try { 
    283                         obj = document.getElementById('trackbackCount' + entryId); 
    284                         if (obj != null) obj.innerHTML = this.getText("/response/trackbackCount"); 
    285                     } catch(e) { } 
    286                     try { 
    287                         obj = document.getElementById("recentTrackbacks"); 
    288                         if(obj != null) obj.innerHTML = this.getText("/response/recentTrackbacks"); 
    289                     } catch(e) { } 
    290                 } 
    291                 request.onError = function() { 
    292                     alert('<?php echo _text('실패했습니다.');?>'); 
    293                 } 
    294                 request.send(); 
    295 <?php 
    296     } else { 
    297 ?> 
    298                 alert('<?php echo _text('실패했습니다.');?>'); 
    299 <?php 
    300     } 
    301 ?> 
    302             } 
    303 <?php 
    304     if (doesHaveOwnership()) { 
    305 ?> 
    306             function changeVisibility(id, visibility) { 
    307                 var request = new HTTPRequest("GET", "<?php echo $blogURL;?>/owner/entry/visibility/" + id + "?visibility=" + visibility); 
    308                 request.onSuccess = function() { 
    309                     window.location.reload(); 
    310                 } 
    311                 request.send(); 
    312             } 
    313  
    314             function deleteEntry(id) { 
    315                 if (!confirm("<?php echo _text('이 글 및 이미지 파일을 완전히 삭제합니다. 계속 하시겠습니까?');?>")) 
    316                     return; 
    317                 var request = new HTTPRequest("GET", "<?php echo $blogURL;?>/owner/entry/delete/" + id); 
    318                 request.onSuccess = function() { 
    319                     window.location.href = "<?php echo $blogURL;?>"; 
    320                 } 
    321                 request.send(); 
    322     } 
    323 <?php 
    324     } 
    325 ?> 
    326             function reloadEntry(id) { 
    327                 var password = document.getElementById("entry" + id + "password"); 
    328                 if (!password) { 
    329                     passwords = document.getElementsByName("entry" + id + "password"); 
    330                     if (passwords != null && passwords.Count > 0) 
    331                         password = passwords; 
    332                 } 
    333                 if (!password) 
    334                     return; 
    335                 document.cookie = "GUEST_PASSWORD=" + escape(password.value) + ";path=<?php echo $service['path'];?>"; 
    336  
    337                 window.location.href = window.location.href; 
    338             } 
    339         //]]> 
    340     </script> 
    341 <?php 
     70 
    34271    $view = ob_get_contents(); 
    34372    ob_end_clean(); 
  • branches/1.5/script/common2.js

    r3124 r3283  
    927927    return true; 
    928928} 
     929 
     930function processShortcut(event) { 
     931    event = STD.event(event); 
     932    if(event.altKey || event.ctrlKey) 
     933        return; 
     934    switch(event.target.nodeName) { 
     935        case "INPUT": 
     936        case "SELECT": 
     937        case "TEXTAREA": 
     938            return; 
     939    } 
     940    switch(event.keyCode) { 
     941        case 81: //Q 
     942            window.location = blogURL + "/owner"; 
     943            break; 
     944        case 82: //R 
     945            window.location = blogURL + "/owner/reader"; 
     946            break; 
     947        case 84: //T 
     948            window.location = blogURL + "/owner/reader/?forceRefresh"; 
     949            break; 
     950        case 65: //A 
     951            if(prevURL) 
     952                window.location = prevURL; 
     953            break; 
     954        case 83: //S 
     955            if(nextURL) 
     956                window.location = nextURL; 
     957            break; 
     958        case 90: //Z 
     959            window.location = "#recentEntries"; 
     960            break; 
     961        case 88: //X 
     962            window.location = "#recentComments"; 
     963            break; 
     964        case 67: //C 
     965            window.location = "#recentTrackback"; 
     966            break; 
     967    } 
     968} 
     969 
     970document.onkeydown = processShortcut; 
     971 
     972function addComment(caller, entryId) { 
     973    var oForm = findFormObject(caller); 
     974    if (!oForm) 
     975        return false; 
     976    var request = new HTTPRequest("POST", oForm.action); 
     977    request.onSuccess = function () { 
     978        document.getElementById("entry" + entryId + "Comment").innerHTML = this.getText("/response/commentBlock"); 
     979        if(getObject("recentComments") != null) 
     980            document.getElementById("recentComments").innerHTML = this.getText("/response/recentCommentBlock"); 
     981        if(getObject("commentCount" + entryId) != null) 
     982            document.getElementById("commentCount" + entryId).innerHTML = this.getText("/response/commentView"); 
     983        if(getObject("commentCountOnRecentEntries" + entryId) != null) 
     984            document.getElementById("commentCountOnRecentEntries" + entryId).innerHTML = "(" + this.getText("/response/commentCount") + ")"; 
     985    } 
     986    request.onError = function() { 
     987        alert(this.getText("/response/description")); 
     988    } 
     989 
     990    var queryString = "key=" + commentKey; 
     991 
     992    tempComment = 'comment_' + entryId; 
     993    tempHomepage = 'homepage_' + entryId; 
     994    tempName = 'name_' + entryId; 
     995    tempPassword = 'password_' + entryId; 
     996    tempSecret = 'secret_' + entryId; 
     997 
     998    for (i=0; i<oForm.elements.length; i++) { 
     999        if (queryString != "") 
     1000            linker = "&"; 
     1001        else 
     1002            linker = ""; 
     1003 
     1004        // disabled 상태이면 패스. 
     1005        if (oForm.elements[i].disabled == true) 
     1006            continue; 
     1007 
     1008        if (oForm.elements[i].tagName.toLowerCase() == "input") { 
     1009            switch (oForm.elements[i].type) { 
     1010                case "checkbox": 
     1011                case "radio": 
     1012                    if (oForm.elements[i].checked == true) { 
     1013                        if (oForm.elements[i].name == tempSecret) 
     1014                            queryString += linker + oForm.elements[i].name + '=' + encodeURIComponent(oForm.elements[i].value); 
     1015                        else if (oForm.elements[i].id == tempSecret) 
     1016                            queryString += linker + oForm.elements[i].id + '=' + encodeURIComponent(oForm.elements[i].value); 
     1017                        else if (oForm.elements[i].name != '') 
     1018                            queryString += linker + oForm.elements[i].name + '_' + entryId + '=' + encodeURIComponent(oForm.elements[i].value); 
     1019                        else if (oForm.elements[i].id != '') 
     1020                            queryString += linker + oForm.elements[i].id + "=" + encodeURIComponent(oForm.elements[i].value); 
     1021                    } 
     1022                    break; 
     1023                case "text": 
     1024                case "password": 
     1025                case "hidden": 
     1026                case "button": 
     1027                case "submit": 
     1028                    if (oForm.elements[i].name == tempName) 
     1029                        queryString += linker + oForm.elements[i].name + '=' + encodeURIComponent(oForm.elements[i].value); 
     1030                    else if (oForm.elements[i].id == tempName) 
     1031                        queryString += linker + oForm.elements[i].id + '=' + encodeURIComponent(oForm.elements[i].value); 
     1032                    else if (oForm.elements[i].name == tempPassword) 
     1033                        queryString += linker + oForm.elements[i].name + '=' + encodeURIComponent(oForm.elements[i].value); 
     1034                    else if (oForm.elements[i].id == tempPassword) 
     1035                        queryString += linker + oForm.elements[i].id + '=' + encodeURIComponent(oForm.elements[i].value); 
     1036                    else if (oForm.elements[i].name == tempHomepage) 
     1037                        queryString += linker + oForm.elements[i].name + '=' + encodeURIComponent(oForm.elements[i].value); 
     1038                    else if (oForm.elements[i].id == tempHomepage) 
     1039                        queryString += linker + oForm.elements[i].id + '=' + encodeURIComponent(oForm.elements[i].value); 
     1040                    else if (oForm.elements[i].name != '') 
     1041                        queryString += linker + oForm.elements[i].name + '_' + entryId + "=" + encodeURIComponent(oForm.elements[i].value); 
     1042                    else if (oForm.elements[i].id != '') 
     1043                        queryString += linker + oForm.elements[i].id + "=" + encodeURIComponent(oForm.elements[i].value); 
     1044                    break; 
     1045                //case "file": 
     1046                //  break; 
     1047            } 
     1048        } else if (oForm.elements[i].tagName.toLowerCase() == "select") { 
     1049            num = oForm.elements[i].selectedIndex; 
     1050            if (oForm.elements[i].name != '') 
     1051                queryString += linker + oForm.elements[i].name + '_' + entryId + "=" + encodeURIComponent(oForm.elements[i].options[num].value); 
     1052            else if (oForm.elements[i].id != '') 
     1053                queryString += linker + oForm.elements[i].id + "=" + encodeURIComponent(oForm.elements[i].options[num].value); 
     1054        } else if (oForm.elements[i].tagName.toLowerCase() == "textarea") { 
     1055            if (oForm.elements[i].name == tempComment) 
     1056                queryString += linker + oForm.elements[i].name + '=' + encodeURIComponent(oForm.elements[i].value); 
     1057            else if (oForm.elements[i].name != '') 
     1058                queryString += linker + oForm.elements[i].name + '_' + entryId + "=" + encodeURIComponent(oForm.elements[i].value); 
     1059            else if (oForm.elements[i].id != '') 
     1060                queryString += linker + oForm.elements[i].id + "=" + encodeURIComponent(oForm.elements[i].value); 
     1061        } 
     1062    } 
     1063    request.send(queryString); 
     1064} 
     1065 
     1066var openWindow=''; 
     1067 
     1068function alignCenter(win,width,height) { 
     1069    try{ // sometimes fail. 
     1070        win.moveTo(screen.width/2-width/2,screen.height/2-height/2); 
     1071    } catch (e) {} 
     1072} 
     1073 
     1074function deleteComment(id) { 
     1075    width = 450; 
     1076    height = 400; 
     1077    if(openWindow != '') openWindow.close(); 
     1078    openWindow = window.open(blogURL + "/comment/delete/" + id, "tatter", "width="+width+",height="+height+",location=0,menubar=0,resizable=0,scrollbars=0,status=0,toolbar=0"); 
     1079    openWindow.focus(); 
     1080    alignCenter(openWindow,width,height); 
     1081} 
     1082 
     1083function commentComment(parent) { 
     1084    width = 450; 
     1085    height = 380; 
     1086    if(openWindow != '') openWindow.close(); 
     1087    openWindow = window.open(blogURL + "/comment/comment/" + parent, "tatter", "width="+width+",height="+height+",location=0,menubar=0,resizable=0,scrollbars=0,status=0,toolbar=0"); 
     1088    openWindow.focus(); 
     1089    alignCenter(openWindow,width,height); 
     1090} 
     1091 
     1092function editEntry(parent,child) { 
     1093    width =  1020; 
     1094    height = 550; 
     1095    if(openWindow != '') openWindow.close(); 
     1096    openWindow = window.open(blogURL + "/owner/entry/edit/" + parent + "?popupEditor&returnURL=" + child,"tatter", "width="+width+",height="+height+",location=0,menubar=0,resizable=1,scrollbars=1,status=0,toolbar=0"); 
     1097    openWindow.focus(); 
     1098    alignCenter(openWindow,width,height); 
     1099} 
     1100 
     1101function guestbookComment(parent) { 
     1102    width = 450; 
     1103    height = 360; 
     1104    if(openWindow != '') openWindow.close(); 
     1105    openWindow = window.open(blogURL + "/comment/comment/" + parent, "tatter", "width="+width+",height="+height+",location=0,menubar=0,resizable=0,scrollbars=0,status=0,toolbar=0"); 
     1106    openWindow.focus(); 
     1107    alignCenter(openWindow,width,height); 
     1108} 
     1109 
     1110function sendTrackback(id) { 
     1111    width = 700; 
     1112    height = 500; 
     1113    if(openWindow != '') openWindow.close(); 
     1114    openWindow = window.open(blogURL + "/trackback/send/" + id, "tatter", "width=580,height=400,location=0,menubar=0,resizable=1,scrollbars=1,status=0,toolbar=0"); 
     1115    openWindow.focus(); 
     1116    alignCenter(openWindow,width,height); 
     1117} 
     1118 
     1119function copyUrl(url){ 
     1120    if(STD.isIE) { 
     1121        window.clipboardData.setData("Text", url); 
     1122        window.alert(messages.trackbackUrlCopied); 
     1123    } 
     1124} 
     1125 
     1126function deleteTrackback(id, entryId) { 
     1127    if (!doesHaveOwnership) { 
     1128        alert(messages.operationFailed); 
     1129        return; 
     1130    } 
     1131    if (!confirm(messages.confirmTrackbackDelete)) 
     1132        return; 
     1133 
     1134    var request = new HTTPRequest("GET", blogURL + "/trackback/delete/" + id); 
     1135    request.onSuccess = function() { 
     1136        document.getElementById('entry' + entryId + 'Trackback').innerHTML = this.getText("/response/trackbackList"); 
     1137        document.getElementById('entry' + entryId + 'Trackback').style.display = "block"; 
     1138        try { 
     1139            obj = document.getElementById('trackbackCount' + entryId); 
     1140            if (obj != null) obj.innerHTML = this.getText("/response/trackbackCount"); 
     1141        } catch(e) { } 
     1142        try { 
     1143            obj = document.getElementById("recentTrackbacks"); 
     1144            if(obj != null) obj.innerHTML = this.getText("/response/recentTrackbacks"); 
     1145        } catch(e) { } 
     1146    } 
     1147    request.onError = function() { 
     1148        alert(messages.operationFailed); 
     1149    } 
     1150    request.send(); 
     1151} 
     1152 
     1153function changeVisibility(id, visibility) { 
     1154    if (!doesHaveOwnership) 
     1155        return; 
     1156    var request = new HTTPRequest("GET", blogURL + "/owner/entry/visibility/" + id + "?visibility=" + visibility); 
     1157    request.onSuccess = function() { 
     1158        window.location.reload(); 
     1159    } 
     1160    request.send(); 
     1161} 
     1162 
     1163function deleteEntry(id) { 
     1164    if (!doesHaveOwnership) 
     1165        return; 
     1166    if (!confirm(messages.confirmEntryDelete)) 
     1167        return; 
     1168    var request = new HTTPRequest("GET", blogURL + "/owner/entry/delete/" + id); 
     1169    request.onSuccess = function() { 
     1170        window.location.href = blogURL; 
     1171    } 
     1172    request.send(); 
     1173} 
     1174 
     1175function reloadEntry(id) { 
     1176    var password = document.getElementById("entry" + id + "password"); 
     1177    if (!password) { 
     1178        passwords = document.getElementsByName("entry" + id + "password"); 
     1179        if (passwords != null && passwords.Count > 0) 
     1180            password = passwords; 
     1181    } 
     1182    if (!password) 
     1183        return; 
     1184    document.cookie = "GUEST_PASSWORD=" + escape(password.value) + ";path=" + servicePath; 
     1185 
     1186    window.location.href = window.location.href; 
     1187} 
  • trunk/lib/view/view.php

    r3219 r3283  
    3636    ob_start(); 
    3737?> 
     38 
    3839    <!-- 
    3940        <?php echo TEXTCUBE_NAME." ".TEXTCUBE_VERSION.CRLF;?> 
     
    4344    --> 
    4445    <script type="text/javascript"> 
    45         //<![CDATA[ 
    46             var servicePath = "<?php echo $service['path'];?>"; 
    47             var blogURL = "<?php echo $blogURL;?>"; 
    48         //]]> 
     46    //<![CDATA[ 
     47        var servicePath = "<?php echo $service['path'];?>"; 
     48        var blogURL = "<?php echo $blogURL;?>"; 
     49        var prevURL = "<?php echo isset($paging['prev']) ? escapeJSInCData("{$paging['url']}{$paging['prefix']}{$paging['prev']}{$paging['postfix']}") : '';?>"; 
     50        var nextURL = "<?php echo isset($paging['next']) ? escapeJSInCData("{$paging['url']}{$paging['prefix']}{$paging['next']}{$paging['postfix']}") : '';?>"; 
     51        var commentKey = "<?php echo md5(filemtime(ROOT . '/config.php'));?>"; 
     52        var doesHaveOwnership = <?php echo doesHaveOwnership() ? 'true' : 'false'; ?>; 
     53        var messages = { 
     54            "trackbackUrlCopied": "<?php echo _text('엮인글 주소가 복사되었습니다.');?>", 
     55            "operationFailed": "<?php echo _text('실패했습니다.');?>", 
     56            "confirmTrackbackDelete": "<?php echo _text('선택된 글걸기를 삭제합니다. 계속 하시겠습니까?');?>", 
     57            "confirmEntryDelete": "<?php echo _text('이 글 및 이미지 파일을 완전히 삭제합니다. 계속 하시겠습니까?');?>" 
     58        } 
     59    //]]> 
    4960    </script> 
    5061    <script type="text/javascript" src="<?php echo $service['path'];?>/script/EAF2.js"></script> 
     
    5768<?php 
    5869    } 
    59 ?>