| -9,70 +9,111 |
|
| * 이 두 패치를 동시에 적용하면 다음과 같다. |
| : |
| {{{perl |
| {{{#!vim perl |
| # 다음의 함수를 통채로 바꿈 |
| sub PrintPageList { |
| my ($pagename); |
| my $count = 0; |
| my $titleIsPrinted = 0; |
| my @han = qw(가 나 다 라 마 바 사 아 자 차 카 타 파 하); |
| my @indexTitle = (0, "A".."Z"); |
| push (@indexTitle, @han, "기타"); |
| my @indexSearch=("A".."Z"); |
| push (@indexSearch, @han, "豈"); |
|
| print "<h2>", Ts('페이지 수: %s', ($#_ + 1)), "</h2>\n"; |
|
| my $count2 = 0; |
| print("\n|"); |
| while ( $count2 <= $#indexTitle ) { |
| if ($count2 == 27) { |
| print("<br>\n|"); |
| } |
| print("<a href=\"#H_$indexTitle[$count2]\"><b>"); |
| print(" $indexTitle[$count2] "); |
| print("</b></a>|"); |
| my ($pagename); |
| my $count = 0; |
| my $titleIsPrinted = 0; |
| my @han = qw(가 나 다 라 마 바 사 아 자 차 카 타 파 하); |
| my @indexTitle = (0, "A".."Z"); |
| push (@indexTitle, @han, "기타"); |
| my @indexSearch=("A".."Z"); |
| push (@indexSearch, @han, "豈"); |
|
| print "<a name='TOC'></a><h2>", Ts('%s pages found:', ($#_ + 1)), "</h2>\n"; |
|
| # 상단에 앵커를 가리키는 인덱스 나열 |
| my $count2 = 0; |
| print("\n|"); |
| while ( $count2 <= $#indexTitle ) { |
| if ($count2 == 27) { |
| print("<br>\n|"); |
| } |
| print("<a href=\"#H_$indexTitle[$count2]\"><b>"); |
| print(" $indexTitle[$count2] "); |
| print("</b></a>|"); |
| $count2++; |
| } |
| print "<br><br>"; |
| $count2 = 0; |
|
| foreach $pagename(@_) { |
| next if (&PageIsHidden($pagename)); |
| until ( |
| $pagename lt @indexSearch[$count] |
| && ($count == 0 || $pagename ge @indexSearch[$count-1]) |
| ) { |
| $count++; |
| $titleIsPrinted = 0; |
| last if $count > 40; |
| } |
| if (!$titleIsPrinted) { |
| # 페이지가 없는 색인의 앵커 처리 |
| while ( $count2 <= ($count - 1) ) { |
| print "\n<a name=\"H_$indexTitle[$count2]\">"; |
| print "</a>"; |
| $count2++; |
| } |
| print $q->h3("<a name=\"H_$indexTitle[$count]\" title=\"". T('Top') ."\" href=\"#TOC\">$indexTitle[$count]</A>"); |
| $count2 = $count + 1; |
| $titleIsPrinted=1; |
| } |
| print "<br><br>"; |
| $count2 = 0; |
|
| foreach $pagename(@_) { |
| until ( |
| $pagename lt @indexSearch[$count] |
| && ($count == 0 || $pagename gt @indexSearch[$count-1]) |
| ) { |
| $count++; |
| $titleIsPrinted = 0; |
| last if $count > 40; |
| } |
| if (!$titleIsPrinted) { |
| while ( $count2 <= ($count - 1) ) { |
| print "\n<a name=\"H_$indexTitle[$count2]\">"; |
| print "</a>"; |
| $count2++; |
| } |
| print "\n<a name=\"H_$indexTitle[$count]\">"; |
| print $q->h3($indexTitle[$count]); |
| print "</a>"; |
| $count2 = $count + 1; |
| $titleIsPrinted=1; |
| } |
|
| print ".... " if ($pagename =~ m|/|); |
| print &GetPageLink($pagename); |
|
| if (&UserIsAdmin()) { |
| print " | " . &ScriptLink("action=pagelock&set=1&id=" .$pagename, T('lock')); |
| print " | " . &ScriptLink("action=pagelock&set=0&id=" .$pagename, T('unlock')); |
| } |
| print $q->br; |
| print "\n"; |
| print ".... " if ($pagename =~ m|/|); |
| print &GetPageLink($pagename); |
|
| if (&UserIsAdmin()) { |
| if (-f &GetLockedPageFile($pagename)) { |
| print " " . T('(locked)'); |
| } |
| print " | " . &ScriptLink("action=pagelock&set=1&id=" . $pagename, T('lock')); |
| print " | " . &ScriptLink("action=pagelock&set=0&id=" . $pagename, T('unlock')); |
| if (defined($HiddenPage{$pagename})) { |
| print " | " . T('(hidden)'); |
| } |
| print " | " . &ScriptLink("action=pagehide&set=1&id=" . $pagename, T('hide')); |
| print " | " . &ScriptLink("action=pagehide&set=0&id=" . $pagename, T('unhide')); |
| } |
| print $q->br; |
| print "\n"; |
| } |
| } |
| }}} |
|
| === 추가 업데이트 내역 === |
| ext1.74g - <toc>매크로 출력과 일관성있게 하기 위하여, gotop.gif 아이콘을 없애고 각 색인항목 글자 자체를 클릭하면 목차로 이동하도록 고침. 위의 함수는 지금까지의 모든 수정이 반영된 형태이고, 이번 수정에서 바뀐 부분은 아래와 같다. |
| {{{#!vim diff |
| diff -u -r1.271 -r1.273 |
| --- wiki.pl 14 Feb 2005 03:55:06 -0000 1.271 |
| +++ wiki.pl 19 Feb 2005 06:28:42 -0000 1.273 |
| @@ -6488,7 +6488,7 @@ |
| my @indexSearch=("A".."Z"); |
| push (@indexSearch, @han, "豈"); |
|
| - print "<h2>", Ts('%s pages found:', ($#_ + 1)), "</h2>\n"; |
| + print "<a name='TOC'></a><h2>", Ts('%s pages found:', ($#_ + 1)), "</h2>\n"; |
|
| ############### |
| ### replaced by gypark |
| @@ -6548,10 +6548,7 @@ |
| $count2++; |
| } |
| # 앵커를 삽입 |
| - print "\n<a name=\"H_$indexTitle[$count]\"></a>"; |
| - print $q->h3($indexTitle[$count] |
| - . " <a href=\"#PAGE_TOP\"><img src=\"$IconDir/gotop.gif\" align=\"texttop\" alt=\"" . T('Top') |
| - . "\"></a>"); |
| + print $q->h3("<a name=\"H_$indexTitle[$count]\" title=\"". T('Top') ."\" href=\"#TOC\">$indexTitle[$count]</A>"); |
| $count2 = $count + 1; |
| ### gypark 의 색인 패치 |
| ############### |
| }}} |
|
| ext1.90b - "A", "B", ... ,"가", "나", ... ,"하"라는 이름의 페이지가 있을 경우 index 출력이 엉망이 되는 문제 수정 <mysign([[Raymundo]],2005-12-1 12:16 am)> |
|
| === 사용자 의견 === |
| <longcomments(100)> |
|
| ---- |
| [[위키위키분류]] |
|