Changeset 975


Ignore:
Timestamp:
12/09/10 14:52:09 (13 years ago)
Author:
oschonef
Message:
  • use WiQuery? plugin
  • clean up dependencies
Location:
VirtualCollectionRegistry/trunk/VirtualCollectionRegistry
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • VirtualCollectionRegistry/trunk/VirtualCollectionRegistry/pom.xml

    r963 r975  
    138138
    139139    <repository>
     140      <id>wiquery repository</id>
     141      <name>wiQuery repository</name>
     142      <url>http://wiquery.googlecode.com/svn/repo/</url>
     143      <layout>default</layout>
     144    </repository>
     145
     146    <repository>
    140147      <id>repository.clarin</id>
    141148      <name>CLARIN Repository</name>
     
    278285          <artifactId>jaxb-impl</artifactId>
    279286        </exclusion>
     287        <exclusion>
     288                <artifactId>jackson-mapper-asl</artifactId>
     289                <groupId>org.codehaus.jackson</groupId>
     290        </exclusion>
    280291      </exclusions>
    281292    </dependency>
     
    327338
    328339    <dependency>
     340      <groupId>org.odlabs.wiquery</groupId>
     341      <artifactId>wiquery</artifactId>
     342      <version>1.1.2</version>
     343    </dependency>
     344
     345    <dependency>
    329346      <groupId>net.java.dev.javacc</groupId>
    330347      <artifactId>javacc</artifactId>
     
    367384  <dependencyManagement>
    368385        <dependencies>
     386     <dependency>
     387       <groupId>commons-codec</groupId>
     388       <artifactId>commons-codec</artifactId>
     389       <version>1.4</version>
     390      </dependency>
     391
     392      <dependency>
     393        <groupId>org.codehaus.jettison</groupId>
     394        <artifactId>jettison</artifactId>
     395        <version>1.2</version>
     396      </dependency>
     397
     398      <dependency>
     399        <groupId>org.apache.wicket</groupId>
     400        <artifactId>wicket</artifactId>
     401        <version>${wicket.version}</version>
     402      </dependency>
     403
    369404      <dependency>
    370405        <groupId>org.slf4j</groupId>
    371406        <artifactId>slf4j-api</artifactId>
    372407        <version>${slf4j.version}</version>
     408      </dependency>
     409
     410      <dependency>
     411        <groupId>org.slf4j</groupId>
     412        <artifactId>slf4j-jdk14</artifactId>
     413        <version>${slf4j.version}</version>
     414      </dependency>
     415
     416      <dependency>
     417        <groupId>org.codehaus.jackson</groupId>
     418        <artifactId>jackson-core-asl</artifactId>
     419        <version>1.6.1</version>
     420      </dependency>
     421
     422      <dependency>
     423        <groupId>org.codehaus.jackson</groupId>
     424        <artifactId>jackson-mapper-asl</artifactId>
     425        <version>1.6.1</version>
    373426      </dependency>
    374427        </dependencies>
  • VirtualCollectionRegistry/trunk/VirtualCollectionRegistry/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/gui/border/AjaxToggleBorder.html

    r972 r975  
    66<head />
    77<body>
    8 <wicket:head>
    9 <script type="text/javascript" src="js/jquery.js"></script>
    10 <script type="text/javascript">
    11 var $j = jQuery.noConflict();
    12 $j(document).ready(function() {
    13         $j('div.toggleBorderHeader.hidden ~ div.toggleBorderContent').hide();
    14         $j('div.toggleBorderHeader').click(function() {
    15                 var $h = $j(this);
    16                 var $c = $j(this).next('div.toggleBorderContent');
    17                 if ($h.hasClass('shown')) {
    18                         $c.slideUp('slow', function() {
    19                     $h.removeClass('shown');
    20                     $h.addClass('hidden');
    21                         });
    22                 } else {
    23             $c.slideDown('slow', function() {
    24                 $h.removeClass('hidden');
    25                 $h.addClass('shown');
    26             });
    27                 }
    28                 return true;
    29         });
    30 });
    31 </script>
    32 </wicket:head>
    338<wicket:border>
    349  <div class="toggleBorder">
  • VirtualCollectionRegistry/trunk/VirtualCollectionRegistry/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/gui/border/AjaxToggleBorder.java

    r971 r975  
    55import org.apache.wicket.markup.html.basic.Label;
    66import org.apache.wicket.markup.html.border.Border;
    7 import org.apache.wicket.model.AbstractReadOnlyModel;
    87import org.apache.wicket.model.IModel;
     8import org.apache.wicket.model.Model;
     9import org.odlabs.wiquery.core.effects.EffectSpeed;
     10import org.odlabs.wiquery.core.effects.sliding.SlideToggle;
     11import org.odlabs.wiquery.core.events.Event;
     12import org.odlabs.wiquery.core.events.MouseEvent;
     13import org.odlabs.wiquery.core.events.WiQueryEventBehavior;
     14import org.odlabs.wiquery.core.javascript.JsScope;
     15import org.odlabs.wiquery.core.javascript.JsStatement;
    916
    1017@SuppressWarnings("serial")
    1118public class AjaxToggleBorder extends Border {
    12 
    13     public AjaxToggleBorder(String id, IModel<String> title, final boolean expanded) {
     19    private final static String COLLAPSED_CLASS = "collapsed";
     20   
     21    public AjaxToggleBorder(String id, IModel<String> title,
     22            final boolean expanded) {
    1423        super(id);
    1524        setRenderBodyOnly(true);
     
    1726        final WebMarkupContainer header = new WebMarkupContainer("header");
    1827        header.add(new Label("title", title));
    19         header.add(new AttributeAppender("class",
    20                 new AbstractReadOnlyModel<String>() {
    21                     @Override
    22                     public String getObject() {
    23                         return expanded ? "shown" : "hidden";
    24                     }
    25                 }, " "));
     28
     29        final WebMarkupContainer content = new WebMarkupContainer("content");
     30        content.setOutputMarkupId(true);
     31        content.add(getBodyContainer());
    2632        add(header);
    27         final WebMarkupContainer content = new WebMarkupContainer("content");
    28         content.add(getBodyContainer());
    2933        add(content);
     34
     35        header.add(new WiQueryEventBehavior(new Event(MouseEvent.CLICK) {
     36            @Override
     37            public JsScope callback() {
     38                final JsScope cb = JsScope.quickScope(new JsStatement()
     39                    .$(header).toggleClass(COLLAPSED_CLASS));
     40                final SlideToggle effect = new SlideToggle(EffectSpeed.SLOW);
     41                effect.setCallback(cb);
     42                return JsScope.quickScope(new JsStatement()
     43                    .$(content).chain(effect));
     44            }
     45        }));
     46        if (!expanded) {
     47            header.add(new AttributeAppender("class",
     48                    new Model<String>(COLLAPSED_CLASS), " "));
     49            content.add(new AttributeAppender("style",
     50                    new Model<String>("display:none"), ";"));
     51        }
    3052    }
    3153
Note: See TracChangeset for help on using the changeset viewer.