Show
Ignore:
Timestamp:
04/02/08 03:04:46 (20 months ago)
Author:
bsmith
Message:

bugzid:69535 - less modularized template set committed. produces same html as modularized template set

Files:
1 modified

Legend:

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

    r1698 r1707  
    11<MTSetVar name="search_results_template" value="1"> 
    2 <MTSetVarBlock name="page_title"><__trans phrase="Search Results"></MTSetVarBlock> 
    3 <MTSetVarBlock name="title"><$MTBlogName encode_html="1"$>: <$MTVar name="page_title"$></MTSetVarBlock> 
     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                ]; 
    422 
    5 <MTIgnore>Below Javascript adds ajax search capability</MTIgnore> 
    6 <MTSetVarBlock name="html_head" append="1"> 
    7 <script type="text/javascript"> 
    8 <!-- 
    9 <MTIfMoreResults> 
    10 function getXmlHttp() { 
    11     if ( !window.XMLHttpRequest ) { 
    12         window.XMLHttpRequest = function() { 
    13             var types = [ 
    14                 "Microsoft.XMLHTTP", 
    15                 "MSXML2.XMLHTTP.5.0", 
    16                 "MSXML2.XMLHTTP.4.0", 
    17                 "MSXML2.XMLHTTP.3.0", 
    18                 "MSXML2.XMLHTTP" 
    19             ]; 
     23                for ( var i = 0; i < types.length; i++ ) { 
     24                    try { 
     25                        return new ActiveXObject( types[ i ] ); 
     26                    } catch( e ) {} 
     27                } 
    2028 
    21             for ( var i = 0; i < types.length; i++ ) { 
    22                 try { 
    23                     return new ActiveXObject( types[ i ] ); 
    24                 } catch( e ) {} 
    25             } 
     29                return undefined; 
     30            }; 
     31        } 
     32        if ( window.XMLHttpRequest ) 
     33            return new XMLHttpRequest(); 
     34    } 
    2635 
    27             return undefined; 
    28         }; 
    29     } 
    30     if ( window.XMLHttpRequest ) 
    31         return new XMLHttpRequest(); 
    32 } 
     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; 
    3345 
    34 function getResults(page) { 
    35     page = parseInt(page); 
    36     if (timer) window.clearTimeout(timer); 
    37     var xh = getXmlHttp(); 
    38     if (!xh) return false; 
    39     var res = results[page]; 
    40     if (!res) return; 
    41     var url = res['next_url']; 
    42     if (!url) return; 
    43  
    44     xh.open('GET', url + '&format=js', true); 
    45     xh.onreadystatechange = function() { 
    46         if ( xh.readyState == 4 ) { 
    47             if ( xh.status && ( xh.status != 200 ) ) { 
    48                 // error - ignore 
    49             } else { 
    50                 try { 
    51                     var page_results = eval("(" + xh.responseText + ")"); 
    52                     if ( page_results['error'] == null ) 
    53                         results[page + 1] = page_results['result']; 
    54                 } catch (e) { 
     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                    } 
    5558                } 
    5659            } 
    57         } 
    58     }; 
    59     xh.send(null); 
    60 } 
     60        }; 
     61        xh.send(null); 
     62    } 
    6163 
    62 function swapContent(direction) { 
    63     if ( direction == undefined ) direction = 1; 
    64     var page_span = document.getElementById('current-page'); 
    65     if (!page_span) return true; 
    66     var next_page = direction + parseInt(page_span.innerHTML); 
    67     var res = results[next_page]; 
    68     if (!res) return true; 
    69     var content = res['content']; 
    70     if (!content) return true; 
    71     var div = document.getElementById('search-results'); 
    72     if (!div) return true; 
    73     div.innerHTML = content; 
    74     timer = window.setTimeout("getResults(" + next_page + ")", 1*1000); 
    75     window.scroll(0, 0); 
    76     return false; 
    77 } 
    78 <MTElse><MTIfPreviousResults> 
    79 function swapContent(direction) { 
    80         return true; 
    81 }</MTIfPreviousResults> 
    82 </MTIfMoreResults> 
    83 //--> 
    84 </script> 
    85 </MTSetVarBlock> 
     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"> 
    8691 
    87 <$MTInclude module="<__trans phrase="Header">" body_class="mt-search-results"$> 
    8892 
     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> 
    89105<MTSearchResults> 
    90106    <MTBlogResultHeader> 
    91 <div id="search-results"> 
    92     <span id="current-page" class="hidden"><MTCurrentPage></span> 
    93     <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"> 
    94110        <MTIfStraightSearch> 
    95         <__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"$>"> 
    96112        </MTIfStraightSearch> 
    97113        <MTIfTagSearch> 
    98         <__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"$>"> 
    99115        </MTIfTagSearch> 
    100     </h1> 
    101     <div class="search-results-container autopagerize_page_element"> 
     116                                </h1> 
     117                                <div class="search-results-container autopagerize_page_element"> 
    102118    </MTBlogResultHeader> 
    103     <$MTInclude module="<__trans phrase="Entry Summary">" hide_counts="1"$> 
     119                                    <$MTInclude module="<__trans phrase="Entry Summary">" hide_counts="1"$> 
    104120    <MTBlogResultFooter> 
    105     </div><div class="autopagerize_insert_before"></div> 
    106         <MTIgnore>Used with the ajax search capability of the new search class</MTIgnore> 
    107     <div class="content-nav"> 
    108         <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> 
    109     </div> 
    110 </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> 
    111128    </MTBlogResultFooter> 
    112129</MTSearchResults> 
    113130 
     131 
     132<mt:ignore><!-- Display no results message --></mt:ignore> 
    114133<MTNoSearchResults> 
    115 <h1 id="page-title" class="search-results-header"> 
     134                            <h1 id="page-title" class="search-results-header"> 
    116135    <MTIfStraightSearch> 
    117     <__trans phrase="Results matching &ldquo;[_1]&rdquo;" params="<$MTSearchString$>"> 
     136                                <__trans phrase="Results matching &ldquo;[_1]&rdquo;" params="<$MTSearchString$>"> 
    118137    </MTIfStraightSearch> 
    119138    <MTIfTagSearch> 
    120     <__trans phrase="Results tagged &ldquo;[_1]&rdquo;" params="<$MTSearchString$>"> 
     139                                <__trans phrase="Results tagged &ldquo;[_1]&rdquo;" params="<$MTSearchString$>"> 
    121140    </MTIfTagSearch> 
    122 </h1> 
    123 <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> 
    124143</MTNoSearchResults> 
    125144 
     145 
     146<mt:ignore><!-- Display instructions for searching if search script was accessed without a query --></mt:ignore> 
    126147<MTNoSearch> 
    127 <h1 id="page-title" class="search-results-header"><__trans phrase="Instructions"></h1> 
    128 <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> 
    129 <blockquote> 
    130     <p><code>"<__trans phrase="movable type">"</code></p> 
    131 </blockquote> 
    132 <p><__trans phrase="The search engine also supports AND, OR, and NOT keywords to specify boolean expressions:"></p> 
    133 <blockquote> 
    134     <p><code><__trans phrase="personal OR publishing"></code></p> 
    135     <p><code><__trans phrase="publishing NOT personal"></code></p> 
    136 </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> 
    137158</MTNoSearch> 
    138159 
    139 <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> 
    140161<MTIfMoreResults> 
    141162<script type="text/javascript"> 
     
    152173</script> 
    153174</MTIfMoreResults> 
    154 <$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>