Changeset 560
- Timestamp:
- 06/30/10 23:29:04 (14 years ago)
- Location:
- MDService2/trunk/MDService2
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
MDService2/trunk/MDService2/WebContent/index.jsp
r555 r560 17 17 <script src="scripts/jquery/js/jquery-ui-1.8.1.custom.min.js" type="text/javascript"></script> 18 18 <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> 19 20 <script src="scripts/mdservice_model.js" type="text/javascript"></script> 20 21 <script src="scripts/mdservice2_ui.js" type="text/javascript"></script> … … 62 63 <s:form action="searchretrieve"> 63 64 <s:textfield name="query" label="Query" size="50"/> 65 <!-- <s:label name="collections" value="Collections: 0 items selected."/> --> 64 66 <s:submit value="Submit" /> 65 67 </s:form> -
MDService2/trunk/MDService2/WebContent/scripts/jquery/jquery-treeview/jquery.treeview.css
r466 r560 67 67 .filetree li.expandable span.folder { background: url(images/folder-closed.gif) 0 0 no-repeat; } 68 68 .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 93 93 }, 94 94 treeview: function(settings) { 95 95 96 96 settings = $.extend({ 97 97 cookieId: "treeview" … … 109 109 } 110 110 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 111 181 // factory for treecontroller 112 182 function treeController(tree, control) { -
MDService2/trunk/MDService2/WebContent/scripts/mdservice2_ui.js
r555 r560 49 49 // POPULATE/LOAD VIEWS/BOXES; 50 50 51 // COLLECTIONS getCollections 52 //$('#collections').load(link('collections','xml')); 53 51 // COLLECTIONS getCollections 54 52 $('#collections').load(link('collections','htmllist'), //profile.collections.base_uri, 55 53 function() { … … 61 59 } 62 60 ); 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 */ 66 69 // COMPONENTS ComponentRegistry 67 70 … … 218 221 $(target_container).load(uri, handler ); 219 222 } 220 223 // TODO multiple collections 221 224 function submit_query (query) { 222 225 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 ); 225 232 console.log("submit_query:" + q.query_uri()); 226 233 queryset.addquery(q); -
MDService2/trunk/MDService2/build.properties
r466 r560 26 26 build.home=./build 27 27 dist.home=./dist 28 deploy.dir = C:/apps/ApacheTomcat/webapps 28 #deploy.dir = C:/apps/ApacheTomcat/webapps 29 deploy.dir = C:/apache-tomcat-6.0.26/webapps 29 30 30 31 -
MDService2/trunk/MDService2/src/xsl/collection2view.xsl
r520 r560 34 34 <xsl:template name="continue-root" > 35 35 <div> 36 <ul class=" filetreetreeview">36 <ul class="treeview"> 37 37 <xsl:apply-templates select="*" > 38 38 </xsl:apply-templates> … … 44 44 <xsl:variable name="lv" select="count(ancestor::c)" /> 45 45 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 --> 47 54 48 55 <xsl:if test="c and ($lv<$max_depth or $max_depth=0)">
Note: See TracChangeset
for help on using the changeset viewer.