Changeset 1898

Show
Ignore:
Timestamp:
04/14/08 23:41:00 (19 months ago)
Author:
bsmith
Message:

bugzid:74897 - Template listing Quickfilters now js-based

Location:
branches/release-35
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • branches/release-35/mt-static/css/structure.css

    r1852 r1898  
    11791179#quickfilters .current-filter { 
    11801180    background: url('../images/current-filter.gif') no-repeat 3px center; 
     1181    font-weight: bold; 
    11811182} 
    11821183 
  • branches/release-35/tmpl/cms/list_template.tmpl

    r1877 r1898  
    44        id="quickfilters" 
    55        label="<__trans phrase="Quickfilters">"> 
    6         <$mtapp:ListFilters$> 
     6        <ul> 
     7            <li id="all-tab"><a href="#all" onclick="showTable('all-listing');">Show All</a></li> 
     8            <li id="index-tab"><a href="#index" onclick="showTable('index-listing');">Index Templates</a></li> 
     9            <li id="system-tab"><a href="#system"  onclick="showTable('system-listing');">System Templates</a></li> 
     10            <li id="archive-tab"><a href="#archive" onclick="showTable('archive-listing');">Archive Templates</a></li> 
     11            <li id="module-tab"><a href="#module"  onclick="showTable('module-listing');">Template Modules</a></li> 
     12        </ul> 
    713    </mtapp:widget> 
    814    <mtapp:widget 
     
    2127<script type="text/javascript"> 
    2228/* <![CDATA[ */ 
     29var tableList = ["index", "archive", "module", "system"]; 
    2330var tableSelect = []; 
     31function showTable(name) { 
     32    for (var i=0, len=tableList.length; i<len; i++) { 
     33        var el = tableList[i] + "-listing" 
     34        var elTab = tableList[i] + "-tab" 
     35        if (name == "all-listing") { 
     36            DOM.removeClassName ( el, "hidden"); 
     37            DOM.removeClassName ( elTab, "current-filter"); 
     38            DOM.addClassName( "all-tab", "current-filter" ); 
     39        } 
     40        else if (name == el) { 
     41            DOM.removeClassName ( el, "hidden"); 
     42            DOM.addClassName( elTab, "current-filter" ); 
     43            DOM.removeClassName( "all-tab", "current-filter" ); 
     44        } 
     45        else { 
     46            DOM.addClassName( el, "hidden" ); 
     47            DOM.removeClassName( elTab, "current-filter" ); 
     48            DOM.removeClassName( "all-tab", "current-filter" ); 
     49        } 
     50    } 
     51} 
    2452function init() { 
    2553<mt:loop name="template_type_loop"> 
     
    2755    tableSelect[tableSelect.length-1].rowSelect = true; 
    2856</mt:loop> 
     57    var name = (window.location.hash && window.location.hash.match( /^#/ ) ) ? window.location.hash.substr(1) : "all"; 
     58    showTable(name + "-listing"); 
    2959} 
    3060TC.attachLoadEvent(init);