Skip to content

Commit 5a3f766

Browse files
committed
Merge pull request ArcBees#4 from ArcBees/jd_readme
add README.md
2 parents f4d3251 + c23ec3d commit 5a3f766

File tree

4 files changed

+89
-25
lines changed

4 files changed

+89
-25
lines changed

Diff for: README.md

+60-23
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,66 @@
1-
#ArcBees GQuery Plugins
2-
3-
##Plugins
4-
<table>
5-
<tr>
6-
<th>Plugin</th>
7-
<th>Demo</th>
8-
<th>Demo Source</th>
9-
<th>Javadocs</th>
10-
</tr>
11-
<tr>
12-
<td><a href="https://github.com/ArcBees/ArcBees-GQuery-Plugins/tree/master/tooltip">Tooltip Home</a></td>
13-
<td><a href="http://arcbees.github.com/ArcBees-GQuery-Plugins/">Demo & Docs</a></td>
14-
<td><a href="https://github.com/ArcBees/ArcBees-GQuery-Plugins/tree/master/tooltip-sample/src/main/java/com/arcbees/gquery/tooltip/client">Source</a></td>
15-
<td><a href="http://arcbees.github.com/ArcBees-GQuery-Plugins/javadoc/apidocs/">Javadocs</a></td>
16-
</tr>
17-
</table>
18-
19-
##Contributor
20-
21-
###Deploying
22-
* Deploying Javadocs and site to GitHub use `mvn clean package site`
1+
#GQuery Elastic Plugin
2+
3+
##Description of the plugin
4+
Elastic plugin takes the children of an element and rearranges them in a grid layout (like google+ or pinterest)
5+
6+
##Examples
7+
Check these 2 examples:
8+
9+
http://arcbees.github.io/gwtquery-elastic-plugin/ElasticWidgetSample/WidgetSample.html
10+
11+
http://arcbees.github.io/gwtquery-elastic-plugin/ElasticBasicSample/ElasticLayoutSample.html
12+
13+
##How it works ?
14+
To call the plugin:
15+
16+
```java
17+
import static com.arcbees.gquery.elastic.client.Elastic.Elastic;
18+
19+
ElasticOption option = new ElasticOption()
20+
.withColumWidth(400)
21+
.withMinimalNumberOfColumn(2);
22+
23+
$("#container").as(Elastic).elastic(option);
24+
```
25+
26+
or you can use an `ElasticHtmlPanel` and all direct children of the panel (html elements or widgets) will be rearranged in column.
27+
28+
29+
30+
##How to configure it
31+
32+
The different options are:
33+
* _minimumColumnWidth_: Specify the minimum width of the column. The plugin uses this value to maximise the
34+
number of column to display. (default: 250px)
35+
* _minimalNumberOfColumn_: Specify the minimum number of column. (default: 1)
36+
* _maximumNumberOfColumn_: Specify the maximum number of column. (default: infinity)
37+
* _maximumNumberOfColumn_: Specify the maximum number of column. (default: infinity)
38+
* _InnerColumnMargin_: Specify the space between each column (default: 10px)
39+
* _InnerRowMargin_: Specify the space between each row (default: 10px)
40+
*_autoResize_: Specify if we have to recalculate the layout after a window resizing. (default: true)
41+
42+
To specify this option, you can use an `ElasticOption` object and pass it to the plugin or uses the specific method directly on the ElasticHtmlPanel
43+
44+
On each child we can specify the following attributes:
45+
*_data-elastic-span_: specify the number of column to span for this child.
46+
*_data-elastic-column_: Force the child to be displayed in a specific column. "first" and "last" values are also accepted and the child will be displayed respectively in the first of in the last column no matter the number of column
47+
48+
## How to install
49+
50+
There is no official release yet, but you can already use a snapshot version
51+
###With maven :
52+
```xml
53+
<dependency>
54+
<groupId>com.arcbees.gquery</groupId>
55+
<artifactId>elastic</artifactId>
56+
<version>1.0-SNAPSHOT</version>
57+
</dependency>
58+
```
59+
2360

2461
##Thanks to
2562
[![Arcbees.com](http://arcbees-ads.appspot.com/ad.png)](http://arcbees.com)
2663

2764
[![IntelliJ](https://lh6.googleusercontent.com/--QIIJfKrjSk/UJJ6X-UohII/AAAAAAAAAVM/cOW7EjnH778/s800/banner_IDEA.png)](http://www.jetbrains.com/idea/index.html)
2865

29-
[![githalytics.com alpha](https://cruel-carlota.gopagoda.com/ae27e06a3a8ba8e031d37594ff186900 "githalytics.com")](http://githalytics.com/ArcBees/ArcBees-GQuery-Plugins)
66+
[![githalytics.com alpha](https://cruel-carlota.pagodabox.com/361ac462e4947df21a821a3fbbbc3367 "githalytics.com")](http://githalytics.com/ArcBees/gwtquery-elastic-plugin)

Diff for: elastic-sample/src/main/java/com/arcbees/gquery/elastic/htmlsample/client/ElasticSample.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ public void onModuleLoad() {
3232
@Override
3333
public void f() {
3434
ElasticOption option = new ElasticOption()
35-
.setMinimumColumWidth(400)
35+
.setMinimumColumWidth(275)
3636
.setMinimalNumberOfColumn(2);
3737

3838
$("#container").as(Elastic).elastic(option);

Diff for: elastic-sample/src/main/java/com/arcbees/gquery/elastic/htmlsample/public/ElasticLayoutSample.html

+15
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@
1717
<script language="javascript" src="ElasticBasicSample.nocache.js"></script>
1818
</head>
1919
<body>
20+
<p>
21+
Click on the button to run the plugin. Then resize the window to see how the plugin recomputes the layout.
22+
</p>
2023
<button id="go">Elastic</button>
2124
<div id="container">
2225
<div data-elastic-span="all"><h3>data-elastic-span="all"</h3>1. Lorem ipsum dolor sit amet, consectetur adipisicing
@@ -230,5 +233,17 @@
230233
laborum
231234
</div>
232235
</div>
236+
<script>
237+
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
238+
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
239+
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
240+
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
241+
242+
ga('create', 'UA-43120417-20', 'auto', {'allowLinker': true});
243+
ga('require', 'linker');
244+
ga('linker:autoLink', ['github.com'] );
245+
ga('send', 'pageview');
246+
247+
</script>
233248
</body>
234249
</html>

Diff for: elastic-sample/src/main/java/com/arcbees/gquery/elastic/widgetsample/public/WidgetSample.html

+13-1
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,20 @@
1313
<body>
1414
<header>
1515
This is an infinite scroll panel widget. Each time you reach the the bottom of the scroll, new divs are added in the
16-
panel and are automatically laid out by the ElasticHtmlPanel.
16+
panel and are automatically laid out by the ElasticHtmlPanel. Resize the window to see how the plugin recompute the layout.
1717
</header>
1818
<section id="main"></section>
19+
<script>
20+
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
21+
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
22+
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
23+
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
24+
25+
ga('create', 'UA-43120417-20', 'auto', {'allowLinker': true});
26+
ga('require', 'linker');
27+
ga('linker:autoLink', ['github.com'] );
28+
ga('send', 'pageview');
29+
30+
</script>
1931
</body>
2032
</html>

0 commit comments

Comments
 (0)