Changeset 560


Ignore:
Timestamp:
06/30/10 23:29:04 (14 years ago)
Author:
gaba
Message:
 
Location:
MDService2/trunk/MDService2
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • MDService2/trunk/MDService2/WebContent/index.jsp

    r555 r560  
    1717<script src="scripts/jquery/js/jquery-ui-1.8.1.custom.min.js" type="text/javascript"></script>
    1818<script src="scripts/jquery/jquery-treeview/jquery.treeview.js" type="text/javascript"></script>
     19<script src="scripts/jquery/jquery-checkboxtree/jquery.checkboxtree.js" type="text/javascript"></script>
    1920<script src="scripts/mdservice_model.js" type="text/javascript"></script>
    2021<script src="scripts/mdservice2_ui.js" type="text/javascript"></script>
     
    6263        <s:form action="searchretrieve">
    6364                <s:textfield name="query" label="Query" size="50"/>     
     65                <!-- <s:label name="collections" value="Collections: 0 items selected."/> -->
    6466                <s:submit value="Submit" />
    6567        </s:form>
  • MDService2/trunk/MDService2/WebContent/scripts/jquery/jquery-treeview/jquery.treeview.css

    r466 r560  
    6767.filetree li.expandable span.folder { background: url(images/folder-closed.gif) 0 0 no-repeat; }
    6868.filetree span.file { background: url(images/file.gif) 0 0 no-repeat; }
     69
     70.treeview .showselection[some_selection="1"] {color: red}
     71.treeview .showselection[some_selection="0"] {color: white}
  • MDService2/trunk/MDService2/WebContent/scripts/jquery/jquery-treeview/jquery.treeview.js

    r466 r560  
    9393                },
    9494                treeview: function(settings) {
    95                        
     95               
    9696                        settings = $.extend({
    9797                                cookieId: "treeview"
     
    109109                        }
    110110               
     111                        //treeview children selection
     112                        //treeview parent selection
     113                        // todo - use class instead of css
     114                        $(this).find(".showselection").css("color","white");
     115                        $(".selection").click(function() {
     116                                var checked_status = this.checked;
     117                               
     118                                // select or deselect all children according to parent
     119                                $(this).next().next().find(".selection").attr("checked",checked_status);
     120                                /*
     121                                if (checked_status == "true"){
     122                                        $(this).next().next().find(".selection").attr("child","checked_child");
     123                                } else {
     124                                        $(this).next().next().find(".selection").attr("child","undefined");
     125                                }
     126                                console.log($(this).next().next().find(".selection").attr("child") );
     127                                                */
     128                               
     129                               
     130                                // deselect parents
     131                                if (checked_status===false){
     132                                        $(this).parent().parents("li").each(function(){
     133                                                $(this).children(".selection").attr("checked",false);
     134                                        });
     135                                }
     136                       
     137                               
     138                                // refresh sign of existent selection
     139                                // first reset childrens settings
     140                                $(this).next().next().find(".showselection").css("color","white");
     141                                $(this).next().next().find(".showselection").attr("some_selection","0");
     142                                // then refresh selections
     143                                $(this).parents("li").each(function(){
     144                                        var count_selected = $(this).find("ul li .selection:checked").size();
     145                                        if (count_selected > 0){
     146                                                $(this).children(".showselection").attr("some_selection","1");//css("color","red");
     147                                    } else {
     148                                                $(this).children(".showselection").attr("some_selection","0");//css("color","white");
     149                                }
     150                               
     151                                        //TODO move into .css
     152                                        if (count_selected > 0){
     153                                                $(this).children(".showselection").css("color","red");
     154                                    } else {
     155                                                $(this).children(".showselection").css("color","white");
     156                                        }
     157                                       
     158                                        $(this).children(".showselection").attr("count",count_selected);
     159                                                                //console.log(count_selected);
     160                                });
     161
     162                                // uncheck parents node + param settings
     163                                $(this).parent().parents("li").each(function(){
     164                                        $(this).find(".selection").attr("child","undefined");
     165                                        $(this).children(".selection").attr("checked",false);
     166                                });
     167                                // sett the parent_selection attr
     168                                $(this).parents("li").each(function(){
     169                                        $(this).find(".selection").each(function(){
     170                                                if (($(this).attr("checked")===true) &&
     171                                                        ($(this).parent().parent().parent().children(".selection").attr("checked")===false)
     172                                                        ){
     173                                                        $(this).attr("child","parent_selection");
     174                                                }
     175                                        });                                     
     176                                });
     177                        });             
     178       
     179                       
     180                       
    111181                        // factory for treecontroller
    112182                        function treeController(tree, control) {
  • MDService2/trunk/MDService2/WebContent/scripts/mdservice2_ui.js

    r555 r560  
    4949// POPULATE/LOAD VIEWS/BOXES;           
    5050                       
    51 // COLLECTIONS getCollections   
    52         //$('#collections').load(link('collections','xml'));
    53 
     51// COLLECTIONS getCollections           
    5452        $('#collections').load(link('collections','htmllist'), //profile.collections.base_uri,
    5553                        function() {
     
    6159                }
    6260        );
    63 
    64        
    65        
     61        /*
     62        $("#collections .selection").live("onchange", function() {
     63                var $base = $("#collections .treeview");
     64                var collection_count = $(".selection",$base).find("child:undefined").size();
     65                $('#searchretrieve_collections').val("Collections: " + collection_count + " items selected.");
     66        });
     67       
     68        */
    6669// COMPONENTS ComponentRegistry                 
    6770       
     
    218221        $(target_container).load(uri, handler );       
    219222}
    220 
     223// TODO multiple collections
    221224function submit_query (query) {
    222225        notifyUser("processing query");
    223        
    224         var q = new Query(actions.collections.current, query );
     226
     227        var $treeview = $(".treeview","#collections");
     228        var collection = $("li",$treeview).find("input:checked[child='parent_selection']").next().text();
     229        console.log("collection:" + collection);
     230       
     231        var q = new Query(collection, query); //actions.collections.current, query );
    225232        console.log("submit_query:" + q.query_uri());
    226233        queryset.addquery(q);
  • MDService2/trunk/MDService2/build.properties

    r466 r560  
    2626build.home=./build
    2727dist.home=./dist
    28 deploy.dir = C:/apps/ApacheTomcat/webapps
     28#deploy.dir = C:/apps/ApacheTomcat/webapps
     29deploy.dir = C:/apache-tomcat-6.0.26/webapps
    2930
    3031
  • MDService2/trunk/MDService2/src/xsl/collection2view.xsl

    r520 r560  
    3434<xsl:template name="continue-root" >
    3535        <div>
    36         <ul class="filetree treeview">
     36        <ul class="treeview">
    3737                <xsl:apply-templates select="*" >                                                       
    3838                </xsl:apply-templates>                 
     
    4444        <xsl:variable name="lv" select="count(ancestor::c)" />
    4545       
    46         <li><span class="folder"><xsl:value-of select="@n" />(<xsl:value-of select="@cnt" />)</span>           
     46        <li>
     47         <label class="showselection" count="0" some_selection="0" >o</label>
     48         <input type="checkbox" class="selection" child="undefined" />   
     49     <label class="folder"><xsl:value-of select="@n" /></label>
     50        <!--
     51        <span class="folder"><xsl:value-of select="@n" />(<xsl:value-of select="@cnt" />)
     52        </span>
     53         -->   
    4754       
    4855                <xsl:if test="c and ($lv&lt;$max_depth or $max_depth=0)">
Note: See TracChangeset for help on using the changeset viewer.