Changeset 3610
- Timestamp:
- Jul 27, 2007, 2:53:11 PM (16 years ago)
- Location:
- trunk
- Files:
-
- 4 added
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/core/net/sf/basedb/core/ItemContext.java
r3484 r3610 165 165 private final Item itemType; 166 166 private final String subContext; 167 private int contextId; 167 168 private int itemId; 168 169 private Set<Integer> selected; … … 218 219 this.subContext = context.getSubContext(); 219 220 this.name = context.getName(); 221 this.contextId = context.getId(); 220 222 this.itemId = context.getItemId(); 221 223 this.rowsPerPage = context.getRowsPerPage(); … … 295 297 } 296 298 299 /** 300 Get the database ID of this context. Can be used to load contexts 301 @return The database ID of the context, or 0 if it hasn't been saved to 302 the database 303 @since 2.4 304 */ 305 public int getContextId() 306 { 307 return contextId; 308 } 309 297 310 /** 298 311 Get the ID of the current item in this context. -
trunk/www/WEB-INF/base.tld
r2949 r3610 438 438 </attribute> 439 439 </tag> 440 <tag> 441 <name>section</name> 442 <tagclass>net.sf.basedb.clients.web.taglib.HideableSection</tagclass> 443 <attribute> 444 <name>id</name> 445 <required>true</required> 446 <rtexprvalue>true</rtexprvalue> 447 </attribute> 448 <attribute> 449 <name>clazz</name> 450 <required>false</required> 451 <rtexprvalue>true</rtexprvalue> 452 </attribute> 453 <attribute> 454 <name>showclazz</name> 455 <required>false</required> 456 <rtexprvalue>true</rtexprvalue> 457 </attribute> 458 <attribute> 459 <name>hideclazz</name> 460 <required>false</required> 461 <rtexprvalue>true</rtexprvalue> 462 </attribute> 463 <attribute> 464 <name>style</name> 465 <required>false</required> 466 <rtexprvalue>true</rtexprvalue> 467 </attribute> 468 <attribute> 469 <name>contentstyle</name> 470 <required>false</required> 471 <rtexprvalue>true</rtexprvalue> 472 </attribute> 473 <attribute> 474 <name>title</name> 475 <required>true</required> 476 <rtexprvalue>true</rtexprvalue> 477 </attribute> 478 <attribute> 479 <name>visible</name> 480 <required>false</required> 481 <rtexprvalue>true</rtexprvalue> 482 </attribute> 483 <attribute> 484 <name>ontoggle</name> 485 <required>false</required> 486 <rtexprvalue>true</rtexprvalue> 487 </attribute> 488 <attribute> 489 <name>initial</name> 490 <required>false</required> 491 <rtexprvalue>true</rtexprvalue> 492 </attribute> 493 <attribute> 494 <name>context</name> 495 <required>false</required> 496 <rtexprvalue>true</rtexprvalue> 497 </attribute> 498 </tag> 440 499 441 500 </taglib> -
trunk/www/include/scripts/ajax.js
r3068 r3610 22 22 ------------------------------------------------------------------ 23 23 24 JavaScript functions for the Annotations25 /common/annotations/*24 JavaScript functions for sending Ajax request. Create a 25 request with Main.getAjaxRequest() or Ajax.getXmlHttpRequest(). 26 26 27 27 @author Nicklas … … 32 32 function AjaxClass() 33 33 { 34 /** 35 Create a new ajax request. 36 @return A request object or null if the browser doesn't support ajax 37 */ 34 38 this.getXmlHttpRequest = function() 35 39 { 36 var xmlHttp = null; 37 if (window.XMLHttpRequest) 38 { 39 // Non-IE browswers 40 xmlHttp = new XMLHttpRequest(); 41 } 42 else if (window.ActiveXObject) 43 { 44 // IE browsers 45 try 46 { 47 // IE #1 48 xmlHttp = new ActiveXObject("Msxml2.XMLHTTP"); 49 } 50 catch (e) 51 { 52 try 53 { 54 // IE #2 55 xmlHttp = new ActiveXObject("Microsoft.XMLHTTP"); 56 } 57 catch (e2) 58 {} 59 } 60 } 61 return xmlHttp; 40 return Main.getAjaxRequest(); 62 41 } 63 42 43 /** 44 Register callback functions for a successful of failed request. 45 When the request has been completed, the onSuccessHandler or 46 onFailHandler will be called with the request as a parameter: 47 onSuccessHandler(request); 48 */ 64 49 this.setReadyStateHandler = function(request, onSuccessHandler, onFailHandler) 65 50 { -
trunk/www/include/scripts/main.js
r3558 r3610 525 525 } 526 526 527 /** 528 Create a new ajax request. 529 @return A request object or null if the browser doesn't support ajax 530 */ 531 this.getAjaxRequest = function() 532 { 533 var xmlHttp = null; 534 if (window.XMLHttpRequest) 535 { 536 // Non-IE browswers 537 xmlHttp = new XMLHttpRequest(); 538 } 539 else if (window.ActiveXObject) 540 { 541 // IE browsers 542 try 543 { 544 // IE #1 545 xmlHttp = new ActiveXObject("Msxml2.XMLHTTP"); 546 } 547 catch (e) 548 { 549 try 550 { 551 // IE #2 552 xmlHttp = new ActiveXObject("Microsoft.XMLHTTP"); 553 } 554 catch (e2) 555 {} 556 } 557 } 558 return xmlHttp; 559 } 560 561 527 562 this.viewSource = function() 528 563 { … … 1555 1590 //alert("createHidden: name="+name+"; value="+value); 1556 1591 } 1592 1557 1593 } 1558 1594 … … 1569 1605 } 1570 1606 1571 1607 // Handle sections that can be shown/hidden and remembered by context settings 1608 var HideableSection = new HideableSectionClass(); 1609 function HideableSectionClass() 1610 { 1611 // Show/hide a section 1612 this.toggle = function(sectionId) 1613 { 1614 var main = document.getElementById(sectionId); 1615 var icon = document.getElementById(sectionId+'.icon'); 1616 var content = document.getElementById(sectionId+'.content'); 1617 var visible = true; 1618 var showClass = main.attributes['showclass']; 1619 var hideClass = main.attributes['hideclass']; 1620 1621 if (content.style.display == 'none') 1622 { 1623 Main.show(content.id); 1624 icon.src = getRoot() + '/images/hide_section.gif'; 1625 visible = true; 1626 if (showClass) Main.addClass(main, showClass.value); 1627 if (hideClass) Main.removeClass(main, hideClass.value); 1628 } 1629 else 1630 { 1631 Main.hide(content.id); 1632 icon.src = getRoot() + '/images/show_section.gif'; 1633 visible = false; 1634 if (showClass) Main.removeClass(main, showClass.value); 1635 if (hideClass) Main.addClass(main, hideClass.value); 1636 } 1637 return visible; 1638 } 1639 1640 /** 1641 Show/hide a section and send an Ajax request to the server with 1642 the new status. If the browser doesn't support Ajax, this method is 1643 identical to toggle() 1644 */ 1645 this.toggleAndSendWithAjax = function(sectionId, itemType, subcontext) 1646 { 1647 var visible = this.toggle(sectionId); 1648 var request = Main.getAjaxRequest(); 1649 if (request != null) 1650 { 1651 var url = getRoot()+'/common/store_show_hide_section.jsp?ID='+Main.getIdFromLocation(); 1652 url += '§ionId='+sectionId; 1653 url += '&itemType='+itemType; 1654 url += '&subcontext='+subcontext; 1655 url += '&visible='+(visible ? '1' : '0'); 1656 request.open("GET", url, true); 1657 request.send(null); 1658 } 1659 1660 } 1661 1662 1663 } -
trunk/www/include/styles/main.css
r3045 r3610 67 67 } 68 68 69 h3.docked {69 h3.docked, .docked h3 { 70 70 border-bottom: 0px; 71 71 } … … 80 80 } 81 81 82 h4.docked {82 h4.docked, .docked h4 { 83 83 border-bottom: 0px; 84 84 margin-bottom: 2px; -
trunk/www/lims/arraydesigns/view_design.jsp
r3608 r3610 245 245 /> 246 246 </tbl:toolbar> 247 247 248 <div class="boxedbottom"> 248 249 <div class="itemstatus">Permissions on this item: <i><%=PermissionUtil.getFullPermissionNames(design)%></i></div> … … 336 337 { 337 338 %> 338 <h4 class="docked">Array batches</h4> 339 <base:section 340 id="batches" 341 title="<%="Array batches (" + batches.size() +")"%>" 342 context="<%=cc%>"> 339 343 <tbl:table 340 344 id="batches" … … 368 372 </tbl:data> 369 373 </tbl:table> 374 </base:section> 370 375 <% 371 376 } … … 387 392 { 388 393 %> 389 <h4 class="docked">Plates</h4> 394 <base:section 395 id="plates" 396 title="<%="Plates (" + plates.size() +")"%>" 397 context="<%=cc%>"> 390 398 <tbl:table 391 399 id="plates" … … 434 442 </tbl:data> 435 443 </tbl:table> 444 </base:section> 436 445 <% 437 446 } … … 449 458 { 450 459 %> 451 <h4 class="docked">Shared to</h4> 460 <base:section 461 id="sharedTo" 462 title="Shared to" 463 context="<%=cc%>"> 452 464 <tbl:table 453 465 id="itemsSharedTo" … … 518 530 </tbl:data> 519 531 </tbl:table> 532 </base:section> 520 533 <% 521 534 }
Note: See TracChangeset
for help on using the changeset viewer.