Project

General

Profile

« Previous | Next » 

Revision 5790

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

View differences:

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