Changeset 975
- Timestamp:
- 12/09/10 14:52:09 (13 years ago)
- Location:
- VirtualCollectionRegistry/trunk/VirtualCollectionRegistry
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
VirtualCollectionRegistry/trunk/VirtualCollectionRegistry/pom.xml
r963 r975 138 138 139 139 <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> 140 147 <id>repository.clarin</id> 141 148 <name>CLARIN Repository</name> … … 278 285 <artifactId>jaxb-impl</artifactId> 279 286 </exclusion> 287 <exclusion> 288 <artifactId>jackson-mapper-asl</artifactId> 289 <groupId>org.codehaus.jackson</groupId> 290 </exclusion> 280 291 </exclusions> 281 292 </dependency> … … 327 338 328 339 <dependency> 340 <groupId>org.odlabs.wiquery</groupId> 341 <artifactId>wiquery</artifactId> 342 <version>1.1.2</version> 343 </dependency> 344 345 <dependency> 329 346 <groupId>net.java.dev.javacc</groupId> 330 347 <artifactId>javacc</artifactId> … … 367 384 <dependencyManagement> 368 385 <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 369 404 <dependency> 370 405 <groupId>org.slf4j</groupId> 371 406 <artifactId>slf4j-api</artifactId> 372 407 <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> 373 426 </dependency> 374 427 </dependencies> -
VirtualCollectionRegistry/trunk/VirtualCollectionRegistry/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/gui/border/AjaxToggleBorder.html
r972 r975 6 6 <head /> 7 7 <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>33 8 <wicket:border> 34 9 <div class="toggleBorder"> -
VirtualCollectionRegistry/trunk/VirtualCollectionRegistry/src/main/java/eu/clarin/cmdi/virtualcollectionregistry/gui/border/AjaxToggleBorder.java
r971 r975 5 5 import org.apache.wicket.markup.html.basic.Label; 6 6 import org.apache.wicket.markup.html.border.Border; 7 import org.apache.wicket.model.AbstractReadOnlyModel;8 7 import org.apache.wicket.model.IModel; 8 import org.apache.wicket.model.Model; 9 import org.odlabs.wiquery.core.effects.EffectSpeed; 10 import org.odlabs.wiquery.core.effects.sliding.SlideToggle; 11 import org.odlabs.wiquery.core.events.Event; 12 import org.odlabs.wiquery.core.events.MouseEvent; 13 import org.odlabs.wiquery.core.events.WiQueryEventBehavior; 14 import org.odlabs.wiquery.core.javascript.JsScope; 15 import org.odlabs.wiquery.core.javascript.JsStatement; 9 16 10 17 @SuppressWarnings("serial") 11 18 public 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) { 14 23 super(id); 15 24 setRenderBodyOnly(true); … … 17 26 final WebMarkupContainer header = new WebMarkupContainer("header"); 18 27 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()); 26 32 add(header); 27 final WebMarkupContainer content = new WebMarkupContainer("content");28 content.add(getBodyContainer());29 33 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 } 30 52 } 31 53
Note: See TracChangeset
for help on using the changeset viewer.