Show
Ignore:
Timestamp:
04/02/08 06:38:21 (20 months ago)
Author:
fumiakiy
Message:

Merged the latest checkins to release-32 branch to the current dev branch. svn merge -r1669:1708 http://code.sixapart.com/svn/movabletype/branches/release-32 .

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • branches/release-33/default_templates/search_results.mtml

    r1641 r1709  
    1 <MTSetVar name="body_class" value="mt-search-results"> 
    2 <MTSetVar name="system_template" value="1"> 
    31<MTSetVar name="search_results_template" value="1"> 
    4 <MTSetVarBlock name="page_title"><__trans phrase="Search Results"></MTSetVarBlock> 
    5 <MTSetVarBlock name="title"><$MTBlogName encode_html="1"$>: <$MTGetVar name="page_title"$></MTSetVarBlock> 
    6 <MTIfStraightSearch> 
    7     <MTSetVar name="search_type" value="search"> 
    8 <MTElse> 
    9     <MTSetVar name="search_type" value="tag"> 
    10 </MTIfStraightSearch> 
     2<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
     3    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
     4<html xmlns="http://www.w3.org/1999/xhtml" id="sixapart-standard"> 
     5<head> 
     6    <title><$MTBlogName encode_html="1"$>: <__trans phrase="Search Results"></title> 
     7    <$mt:include module="<__trans phrase="HTML Head">"$> 
     8    <MTIgnore>Below Javascript adds ajax search capability</MTIgnore> 
     9    <script type="text/javascript"> 
     10    <!-- 
     11    <MTIfMoreResults> 
     12    function getXmlHttp() { 
     13        if ( !window.XMLHttpRequest ) { 
     14            window.XMLHttpRequest = function() { 
     15                var types = [ 
     16                    "Microsoft.XMLHTTP", 
     17                    "MSXML2.XMLHTTP.5.0", 
     18                    "MSXML2.XMLHTTP.4.0", 
     19                    "MSXML2.XMLHTTP.3.0", 
     20                    "MSXML2.XMLHTTP" 
     21                ]; 
    1122 
    12 <MTSetVarTemplate id="search_results" name="search_results"> 
    13 <div id="search-results"><span id="current-page" class="hidden"><MTCurrentPage></span> 
     23                for ( var i = 0; i < types.length; i++ ) { 
     24                    try { 
     25                        return new ActiveXObject( types[ i ] ); 
     26                    } catch( e ) {} 
     27                } 
     28 
     29                return undefined; 
     30            }; 
     31        } 
     32        if ( window.XMLHttpRequest ) 
     33            return new XMLHttpRequest(); 
     34    } 
     35 
     36    function getResults(page) { 
     37        page = parseInt(page); 
     38        if (timer) window.clearTimeout(timer); 
     39        var xh = getXmlHttp(); 
     40        if (!xh) return false; 
     41        var res = results[page]; 
     42        if (!res) return; 
     43        var url = res['next_url']; 
     44        if (!url) return; 
     45 
     46        xh.open('GET', url + '&format=js', true); 
     47        xh.onreadystatechange = function() { 
     48            if ( xh.readyState == 4 ) { 
     49                if ( xh.status && ( xh.status != 200 ) ) { 
     50                    // error - ignore 
     51                } else { 
     52                    try { 
     53                        var page_results = eval("(" + xh.responseText + ")"); 
     54                        if ( page_results['error'] == null ) 
     55                            results[page + 1] = page_results['result']; 
     56                    } catch (e) { 
     57                    } 
     58                } 
     59            } 
     60        }; 
     61        xh.send(null); 
     62    } 
     63 
     64    function swapContent(direction) { 
     65        if ( direction == undefined ) direction = 1; 
     66        var page_span = document.getElementById('current-page'); 
     67        if (!page_span) return true; 
     68        var next_page = direction + parseInt(page_span.innerHTML); 
     69        var res = results[next_page]; 
     70        if (!res) return true; 
     71        var content = res['content']; 
     72        if (!content) return true; 
     73        var div = document.getElementById('search-results'); 
     74        if (!div) return true; 
     75        div.innerHTML = content; 
     76        timer = window.setTimeout("getResults(" + next_page + ")", 1*1000); 
     77        window.scroll(0, 0); 
     78        return false; 
     79    } 
     80    <MTElse><MTIfPreviousResults> 
     81    function swapContent(direction) { 
     82        return true; 
     83    }</MTIfPreviousResults> 
     84    </MTIfMoreResults> 
     85    //--> 
     86    </script> 
     87</head> 
     88<body class="mt-search-results <$MTVar name="page_layout"$>"> 
     89    <div id="container"> 
     90        <div id="container-inner"> 
     91 
     92 
     93            <$mt:include module="<__trans phrase="Banner Header">"$> 
     94 
     95 
     96            <div id="content"> 
     97                <div id="content-inner"> 
     98 
     99 
     100                    <div id="alpha"> 
     101                        <div id="alpha-inner"> 
     102 
     103 
     104<mt:ignore><!-- Display search results --></mt:ignore> 
    14105<MTSearchResults> 
    15106    <MTBlogResultHeader> 
    16 <h1 id="page-title" class="search-results-header"> 
     107                            <div id="search-results"> 
     108                                <span id="current-page" class="hidden"><MTCurrentPage></span> 
     109                                <h1 id="page-title" class="search-results-header"> 
    17110        <MTIfStraightSearch> 
    18     <__trans phrase="Results matching &ldquo;[_1]&rdquo; from [_2]" params="<$MTSearchString$>%%<$MTBlogName encode_html="1"$>"> 
     111                                    <__trans phrase="Results matching &ldquo;[_1]&rdquo; from [_2]" params="<$MTSearchString$>%%<$MTBlogName encode_html="1"$>"> 
    19112        </MTIfStraightSearch> 
    20113        <MTIfTagSearch> 
    21     <__trans phrase="Results tagged &ldquo;[_1]&rdquo; from [_2]" params="<$MTSearchString$>%%<$MTBlogName encode_html="1"$>"> 
     114                                    <__trans phrase="Results tagged &ldquo;[_1]&rdquo; from [_2]" params="<$MTSearchString$>%%<$MTBlogName encode_html="1"$>"> 
    22115        </MTIfTagSearch> 
    23 </h1> 
    24 <div class="search-results-container autopagerize_page_element"> 
     116                                </h1> 
     117                                <div class="search-results-container autopagerize_page_element"> 
    25118    </MTBlogResultHeader> 
    26     <$MTInclude module="<__trans phrase="Entry Summary">" hide_counts="1"$> 
     119                                    <$MTInclude module="<__trans phrase="Entry Summary">" hide_counts="1"$> 
    27120    <MTBlogResultFooter> 
    28 </div><div class="autopagerize_insert_before"></div> 
     121                                </div><div class="autopagerize_insert_before"></div> 
     122 
     123    <MTIgnore><!-- Used with the ajax search capability of the new search class --></MTIgnore> 
     124                                <div class="content-nav"> 
     125                                    <MTIfPreviousResults><a href="<MTPreviousLink>" rel="prev" onclick="return swapContent(-1);">&lt; <__trans phrase="Previous"></a>&nbsp;&nbsp;</MTIfPreviousResults><MTPagerBlock><MTIfCurrentPage><MTVar name="__value__"><MTElse><a href="<MTPagerLink>"><MTVar name="__value__"></a></MTIfCurrentPage><mt:unless name="__last__">&nbsp;</mt:unless></MTPagerBlock><MTIfMoreResults>&nbsp;&nbsp;<a href="<MTNextLink>" rel="next" onclick="return swapContent();"><__trans phrase="Next"> &gt;</a></MTIfMoreResults> 
     126                                </div> 
     127                            </div> 
    29128    </MTBlogResultFooter> 
    30129</MTSearchResults> 
    31 <MTIgnore>Used with the ajax search capability of the new search class</MTIgnore> 
    32     <div class="content-nav"> 
    33 <MTIfPreviousResults><a href="<MTPreviousLink>" rel="prev" onclick="return swapContent(-1);">&lt; <__trans phrase="Previous"></a>&nbsp;&nbsp;</MTIfPreviousResults><MTPagerBlock><MTIfCurrentPage><mt:var name="__value__"><MTElse><a href="<MTPagerLink>"><mt:var name="__value__"></a></MTIfCurrentPage><mt:unless name="__last__">&nbsp;</mt:unless></MTPagerBlock><MTIfMoreResults>&nbsp;&nbsp;<a href="<MTNextLink>" rel="next" onclick="return swapContent();"><__trans phrase="Next"> &gt;</a></MTIfMoreResults> 
    34     </div> 
    35 </div> 
    36 </MTSetVarTemplate> 
    37130 
    38 <MTIgnore>Used with the ajax search capability of the new search class</MTIgnore> 
    39 <MTSetVarBlock name="html_head" append="1"> 
    40 <script type="text/javascript"> 
    41 <!-- 
    42 <MTIfMoreResults> 
    43 function getXmlHttp() { 
    44     if ( !window.XMLHttpRequest ) { 
    45         window.XMLHttpRequest = function() { 
    46             var types = [ 
    47                 "Microsoft.XMLHTTP", 
    48                 "MSXML2.XMLHTTP.5.0", 
    49                 "MSXML2.XMLHTTP.4.0", 
    50                 "MSXML2.XMLHTTP.3.0", 
    51                 "MSXML2.XMLHTTP" 
    52             ]; 
    53131 
    54             for ( var i = 0; i < types.length; i++ ) { 
    55                 try { 
    56                     return new ActiveXObject( types[ i ] ); 
    57                 } catch( e ) {} 
    58             } 
    59  
    60             return undefined; 
    61         }; 
    62     } 
    63     if ( window.XMLHttpRequest ) 
    64         return new XMLHttpRequest(); 
    65 } 
    66  
    67 function getResults(page) { 
    68     page = parseInt(page); 
    69     if (timer) window.clearTimeout(timer); 
    70     var xh = getXmlHttp(); 
    71     if (!xh) return false; 
    72     var res = results[page]; 
    73     if (!res) return; 
    74     var url = res['next_url']; 
    75     if (!url) return; 
    76  
    77     xh.open('GET', url + '&format=js', true); 
    78     xh.onreadystatechange = function() { 
    79         if ( xh.readyState == 4 ) { 
    80             if ( xh.status && ( xh.status != 200 ) ) { 
    81                 // error - ignore 
    82             } else { 
    83                 try { 
    84                     var page_results = eval("(" + xh.responseText + ")"); 
    85                     if ( page_results['error'] == null ) 
    86                         results[page + 1] = page_results['result']; 
    87                 } catch (e) { 
    88                 } 
    89             } 
    90         } 
    91     }; 
    92     xh.send(null); 
    93 } 
    94  
    95 function swapContent(direction) { 
    96     if ( direction == undefined ) direction = 1; 
    97     var page_span = document.getElementById('current-page'); 
    98     if (!page_span) return true; 
    99     var next_page = direction + parseInt(page_span.innerHTML); 
    100     var res = results[next_page]; 
    101     if (!res) return true; 
    102     var content = res['content']; 
    103     if (!content) return true; 
    104     var div = document.getElementById('search-results'); 
    105     if (!div) return true; 
    106     div.innerHTML = content; 
    107     timer = window.setTimeout("getResults(" + next_page + ")", 1*1000); 
    108     window.scroll(0, 0); 
    109     return false; 
    110 } 
    111 <MTElse><MTIfPreviousResults> 
    112 function swapContent(direction) { 
    113         return true; 
    114 }</MTIfPreviousResults> 
    115 </MTIfMoreResults> 
    116 //--> 
    117 </script> 
    118 </MTSetVarBlock> 
    119  
    120 <$MTInclude module="<__trans phrase="Header">"$> 
    121  
    122 <$MTVar name="search_results"$> 
    123  
     132<mt:ignore><!-- Display no results message --></mt:ignore> 
    124133<MTNoSearchResults> 
    125 <h1 id="page-title" class="search-results-header"> 
     134                            <h1 id="page-title" class="search-results-header"> 
    126135    <MTIfStraightSearch> 
    127     <__trans phrase="Results matching &ldquo;[_1]&rdquo;" params="<$MTSearchString$>"> 
     136                                <__trans phrase="Results matching &ldquo;[_1]&rdquo;" params="<$MTSearchString$>"> 
    128137    </MTIfStraightSearch> 
    129138    <MTIfTagSearch> 
    130     <__trans phrase="Results tagged &ldquo;[_1]&rdquo;" params="<$MTSearchString$>"> 
     139                                <__trans phrase="Results tagged &ldquo;[_1]&rdquo;" params="<$MTSearchString$>"> 
    131140    </MTIfTagSearch> 
    132 </h1> 
    133 <p><__trans phrase="No results found for &ldquo;[_1]&rdquo;." params="<$MTSearchString$>"></p> 
     141                            </h1> 
     142                            <p><__trans phrase="No results found for &ldquo;[_1]&rdquo;." params="<$MTSearchString$>"></p> 
    134143</MTNoSearchResults> 
    135144 
     145 
     146<mt:ignore><!-- Display instructions for searching if search script was accessed without a query --></mt:ignore> 
    136147<MTNoSearch> 
    137 <h1 id="page-title" class="search-results-header"><__trans phrase="Instructions"></h1> 
    138 <p><__trans phrase="By default, this search engine looks for all words in any order. To search for an exact phrase, enclose the phrase in quotes:"></p> 
    139 <blockquote> 
    140     <p><code>"<__trans phrase="movable type">"</code></p> 
    141 </blockquote> 
    142 <p><__trans phrase="The search engine also supports AND, OR, and NOT keywords to specify boolean expressions:"></p> 
    143 <blockquote> 
    144     <p><code><__trans phrase="personal OR publishing"></code></p> 
    145     <p><code><__trans phrase="publishing NOT personal"></code></p> 
    146 </blockquote> 
     148                            <h1 id="page-title" class="search-results-header"><__trans phrase="Instructions"></h1> 
     149                            <p><__trans phrase="By default, this search engine looks for all words in any order. To search for an exact phrase, enclose the phrase in quotes:"></p> 
     150                            <blockquote> 
     151                                <p><code>"<__trans phrase="movable type">"</code></p> 
     152                            </blockquote> 
     153                            <p><__trans phrase="The search engine also supports AND, OR, and NOT keywords to specify boolean expressions:"></p> 
     154                            <blockquote> 
     155                                <p><code><__trans phrase="personal OR publishing"></code></p> 
     156                                <p><code><__trans phrase="publishing NOT personal"></code></p> 
     157                            </blockquote> 
    147158</MTNoSearch> 
    148159 
    149 <MTIgnore>Used with the ajax search capability of the new search class</MTIgnore> 
     160<MTIgnore><!-- Used with the ajax search capability of the new search class --></MTIgnore> 
    150161<MTIfMoreResults> 
    151162<script type="text/javascript"> 
     
    162173</script> 
    163174</MTIfMoreResults> 
    164 <$MTInclude module="<__trans phrase="Footer">"$> 
     175 
     176 
     177                        </div> 
     178                    </div> 
     179 
     180                    <$MTInclude module="<__trans phrase="Sidebar">"$> 
     181 
     182 
     183                </div> 
     184            </div> 
     185 
     186 
     187            <$mt:include module="<__trans phrase="Banner Footer">"$> 
     188 
     189 
     190        </div> 
     191    </div> 
     192</body> 
     193</html>