Revision 5790
Added by ben leinfelder almost 14 years ago
lib/style/skins/semtools/resultset.xsl | ||
---|---|---|
124 | 124 |
<!-- citation --> |
125 | 125 |
<xsl:call-template name="citation"/> |
126 | 126 |
|
127 |
<!-- edit cart, TODO: reflect status of cart contents -->
|
|
127 |
<!-- edit cart --> |
|
128 | 128 |
<xsl:if test="$showAdd = 'true'"> |
129 |
<a href="javascript:donothing()">
|
|
129 |
<input type="button" class="addCartButton">
|
|
130 | 130 |
<xsl:attribute name="id"> |
131 | 131 |
<xsl:text>add_</xsl:text><xsl:value-of select="replace(./docid, '\.', '_')"/> |
132 | 132 |
</xsl:attribute> |
... | ... | |
144 | 144 |
); |
145 | 145 |
loadCart(); |
146 | 146 |
</xsl:attribute> |
147 |
Add to cart |
|
148 |
</a> |
|
147 |
<xsl:attribute name="value"> |
|
148 |
Add to cart |
|
149 |
</xsl:attribute> |
|
150 |
</input> |
|
149 | 151 |
</xsl:if> |
150 | 152 |
<xsl:if test="$showRemove = 'true'"> |
151 |
<a href="javascript:donothing()">
|
|
153 |
<input type="button" class="removeCartButton">
|
|
152 | 154 |
<xsl:attribute name="id"> |
153 | 155 |
<xsl:text>remove_</xsl:text><xsl:value-of select="replace(./docid, '\.', '_')"/> |
154 | 156 |
</xsl:attribute> |
... | ... | |
166 | 168 |
); |
167 | 169 |
loadCart(); |
168 | 170 |
</xsl:attribute> |
169 |
Remove from cart |
|
170 |
</a> |
|
171 |
<xsl:attribute name="value"> |
|
172 |
Remove from cart |
|
173 |
</xsl:attribute> |
|
174 |
</input> |
|
171 | 175 |
</xsl:if> |
172 | 176 |
</div> |
173 | 177 |
|
lib/style/skins/semtools/index.jsp | ||
---|---|---|
387 | 387 |
}); |
388 | 388 |
return true; |
389 | 389 |
} |
390 |
function addAllToCart() { |
|
391 |
// press all the add cart buttons? |
|
392 |
// TODO: add them in a single request (the service handles multiple docids) |
|
393 |
$(".addCartButton").click(); |
|
394 |
} |
|
390 | 395 |
function clearForm() { |
391 | 396 |
// clear the form values |
392 | 397 |
$('#searchForm').get(0).reset(); |
... | ... | |
445 | 450 |
// refresh the search results now that they are less restrictive |
446 | 451 |
doSearch($("#searchForm").get(0)); |
447 | 452 |
}); |
453 |
|
|
454 |
// clear the form of what we just saved to the criteria list |
|
455 |
clearForm(); |
|
448 | 456 |
} |
457 |
function clearCriteria() { |
|
458 |
|
|
459 |
// remove all children of the criteria |
|
460 |
$("#searchCriteria").children().remove(); |
|
461 |
|
|
462 |
// clear the form of any selections |
|
463 |
clearForm(); |
|
464 |
|
|
465 |
// refresh the search results now that they are less restrictive |
|
466 |
doSearch($("#searchForm").get(0)); |
|
467 |
} |
|
449 | 468 |
/** |
450 | 469 |
* Perform this when the page first loads |
451 | 470 |
*/ |
... | ... | |
491 | 510 |
<input name="query" type="hidden" /> |
492 | 511 |
<input name="qformat" value="semtools" type="hidden" /> |
493 | 512 |
<input name="includeHeader" value="false" type="hidden" /> |
494 |
<input name="showAdd" value="true" type="hidden" />
|
|
513 |
<input name="showAdd" value="<%=AuthUtil.isUserLoggedIn(request)%>" type="hidden" />
|
|
495 | 514 |
<input name="showRemove" value="false" type="hidden" /> |
496 | 515 |
<input name="action" value="semquery" type="hidden" /> |
497 | 516 |
|
... | ... | |
574 | 593 |
<th> |
575 | 594 |
<p> |
576 | 595 |
Search criteria |
577 |
<input type="button" value="Save current selection as criterion" onclick="addCurrent()"/> |
|
596 |
<input type="button" value="Add selected criteria" onclick="addCurrent()"/> |
|
597 |
<input type="button" value="Remove all" onclick="clearCriteria()"/> |
|
578 | 598 |
</p> |
579 | 599 |
</th> |
580 | 600 |
</tr> |
... | ... | |
643 | 663 |
<p> |
644 | 664 |
Cart |
645 | 665 |
<% |
646 |
boolean loggedIn = AuthUtil.isUserLoggedIn(request); |
|
647 |
if (loggedIn) { |
|
666 |
if (AuthUtil.isUserLoggedIn(request)) { |
|
648 | 667 |
%> |
649 | 668 |
<!-- <input type="button" value="Refresh" onclick="loadCart()"/> --> |
650 | 669 |
<input type="button" value="Remove all" onclick="clearCart(); loadCart()"/> |
... | ... | |
677 | 696 |
<tr> |
678 | 697 |
<th> |
679 | 698 |
Search Results |
680 |
<input type="reset" value="Clear" onclick="clearForm()"/> |
|
699 |
<% |
|
700 |
if (AuthUtil.isUserLoggedIn(request)) { |
|
701 |
%> |
|
702 |
<input type="button" value="Add all to cart" onclick="addAllToCart()"/> |
|
703 |
<% |
|
704 |
} |
|
705 |
%> |
|
681 | 706 |
</th> |
682 | 707 |
</tr> |
683 | 708 |
<tr> |
Also available in: Unified diff
ui enhancements:
-Remove all button for the cart
-Add all button for the search results
-use buttons for the add/remove cart actions
-Remove all button for the search criteria
-Add button for the search criteria now clears the tree selection after it saves the selected concepts