Skip to content

Commit 8f85e34

Browse files
authored
Merge pull request #174 from karma4u101/develop
FoBo v2.1.0 release
2 parents 915ed8f + b8b8355 commit 8f85e34

File tree

1,548 files changed

+130479
-40
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,548 files changed

+130479
-40
lines changed

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
language: scala
22
scala:
3-
- "2.12.1"
3+
- "2.12.7"
44
jdk:
55
- oraclejdk8
66

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
# FoBo TwBs Bootstrap4 API Module
2+
3+
This FoBo API module provides FoBo/Lift API components for the TwBs Bootstrap4 Toolkit Module,
4+
but can also be used as-is, see below for setup information.
5+
6+
## Integration into your project
7+
8+
### Dependency settings
9+
10+
Example setup:
11+
12+
```scala
13+
"net.liftmodules" %% "fobo-twbs-bootstrap4-api_3.3 % "2.1"
14+
```
15+
```xml
16+
<dependency>
17+
<groupId>net.liftmodules</groupId>
18+
<artifactId>fobo-twbs-bootstrap4-api_3.3_2.12.6</artifactId>
19+
<version>2.1</version>
20+
</dependency>
21+
```
22+
The example will include the FoBo Bootstrap4 API module v2.1 built for Lift 3.3.x.
23+
If you are using maven observe that the artifact id also needs the Scala version.
24+
25+
### Lift FoBo boot hooks (when used in the FoBo module)
26+
```scala
27+
import net.liftmodules.fobo
28+
:
29+
fobo.API.init = fobo.API.Bootstrap4
30+
```
31+
32+
### Lift FoBo boot hooks (when used as stand alone module)
33+
```scala
34+
import net.liftmodules.{fobobsapi => fobo}
35+
:
36+
fobo.API.init = fobo.API.Bootstrap4
37+
```
38+
### Contributions
39+
40+
Improvements, contributions and suggestions are welcome! Please see the [Contribution Document](https://github.com/karma4u101/FoBo/blob/master/CONTRIBUTING.md).
41+
You can also leave a issue report or drop a question/suggestion on [Lift's mailing list](http://groups.google.com/group/liftweb/)
42+

Bootstrap/Bootstrap4/TwBs-Bootstrap4-API/src/main/scala/net/liftmodules/fobobs4/lib/BootstrapSH.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,10 @@ import net.liftweb.http.js.JsCmd
1414
* ==Bootstrap Script Helper Bootstrap v4.x==
1515
* Bootstrap script helper is a helper class that implements some commonly
1616
* used bootstrap component init/usage script functions.
17-
* This convenience script functions is used in the [[net.liftmodules.FoBoBs.snippet.FoBo.Bs4Comp]]
17+
* This convenience script functions is used in the [[net.liftmodules.fobobs4.snippet.FoBo.Bs4Comp]]
1818
* snippet but can also be used as a convenience helper in your own customized snippets.
1919
*
20-
* @example If you find that the [[net.liftmodules.FoBoBs.snippet.FoBo.Bs4Comp]] snippet dose not fit you exact needs
20+
* @example If you find that the [[net.liftmodules.fobobs4.snippet.FoBo.Bs4Comp]] snippet dose not fit you exact needs
2121
* your can still use the BootstrapSH class to customize your own project snippets.
2222
* {{{
2323
* import net.liftmodules.FoBoBs.lib.{BootstrapSH=>sch}

Bootstrap/Bootstrap4/TwBs-Bootstrap4-API/src/main/scala/net/liftmodules/fobobs4/snippet/FoBo/Bs4Comp.scala

Lines changed: 52 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
package net.liftmodules.fobobs4.snippet.FoBo
22

3-
import scala.xml.{NodeSeq, Text}
3+
import scala.xml.{NodeSeq}
44
import net.liftweb.util._
55
import net.liftweb.common._
66
import net.liftweb.http._
7-
import net.liftweb._
87
import Helpers._
98
import net.liftweb.http.js._
109
import net.liftweb.http.js.JsCmds._
1110
import net.liftmodules.fobobs4.lib.{BootstrapSH => sch}
11+
import net.liftweb.sitemap.{Loc, SiteMap}
1212

1313
/**
1414
* ==Bs4Component's Snippet Bootstrap v4.x==
@@ -25,6 +25,7 @@ class Bs4Comp extends StatefulSnippet with Loggable {
2525
private lazy val sch = new sch()
2626

2727
def dispatch = {
28+
case "breadCrumb" => breadCrumb
2829
case "popover" => popover
2930
case "popoverAppendJs" => popoverAppendJs
3031
case "popoverPreventDefault" => popoverPreventDefault
@@ -35,6 +36,54 @@ class Bs4Comp extends StatefulSnippet with Loggable {
3536
case "activateDropdownAppendJs" => activateDropdownAppendJs
3637
}
3738

39+
/**
40+
* This function creates a bootstrap breadCrumb component using Loc information from Lift.
41+
*
42+
* '''Snippet Params:'''
43+
*
44+
* - '''Param''' ''prefix'' - A optional param to prefix the breadcrumb list with if it's value can
45+
* be found as a Loc.name.
46+
*
47+
* '''Example'''
48+
* {{{ <script data-lift="FoBo.Bs4Comp.breadCrumb?prefix=Home"></script> }}}
49+
*
50+
* @since v2.0.1
51+
*/
52+
def breadCrumb: CssSel = {
53+
val locName = S.attr("prefix") openOr ""
54+
val aPrefix: Box[Loc[_]] = SiteMap.findLoc(locName)
55+
var breadcrumbs: List[Loc[_]] =
56+
for {
57+
currentLoc <- S.location.toList
58+
loc <- currentLoc.breadCrumbs
59+
} yield loc
60+
61+
breadcrumbs = aPrefix match {
62+
case Full(prefix) => prefix :: breadcrumbs
63+
case _ => breadcrumbs
64+
}
65+
66+
" *" #> <nav aria-label="breadcrumb" role="navigation">
67+
<ol class="breadcrumb">
68+
{breadcrumbs.map { loc =>
69+
val linkText = loc.linkText.openOr(NodeSeq.Empty)
70+
val link = loc.createDefaultLink.getOrElse(NodeSeq.Empty)
71+
72+
if (loc == S.location.openOr(NodeSeq.Empty))
73+
<li class="breadcrumb-item active" aria-current="page">
74+
{linkText}
75+
</li>
76+
else
77+
<li class="breadcrumb-item">
78+
<a href={link}>
79+
{linkText}
80+
</a>
81+
</li>
82+
}}
83+
</ol>
84+
</nav>
85+
}
86+
3887
/**
3988
* This function sets a popover action on a element by inlining a script snippet on the page.
4089
*
@@ -112,7 +161,7 @@ class Bs4Comp extends StatefulSnippet with Loggable {
112161
* // ]]>
113162
* </script>
114163
* }}}
115-
* @see [[net.liftmodules.FoBoBs.lib.BootstrapSH.tooltipScript]]
164+
* @see [[net.liftmodules.fobobs4.lib.BootstrapSH.tooltipScript]]
116165
* @since v2.0
117166
*/
118167
def tooltip: CssSel = {
Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
# FoBo TwBs Bootstrap4 Resource Module
2+
3+
This resource module provides Bootstrap 4.x resource components to the FoBo TwBs Bootstrap3 Toolkit Module,
4+
but can also be used as-is (see below for setup information).
5+
6+
## Components and available versions
7+
8+
- Bootstrap [v4.0.0, v4.1.3] - [Bootstrap 4.1](https://getbootstrap.com/docs/4.1)
9+
10+
## Integration into your project
11+
12+
### Dependency settings
13+
14+
Example setup:
15+
16+
**SBT:**
17+
```scala
18+
"net.liftmodules" %% "fobo-twitter-bootstrap-res_3.3 % "2.1"
19+
```
20+
**Maven:**
21+
```xml
22+
<dependency>
23+
<groupId>net.liftmodules</groupId>
24+
<artifactId>fobo-twitter-bootstrap-res_3.3_2.12.6</artifactId>
25+
<version>2.1</version>
26+
</dependency>
27+
```
28+
The example will include a module built for lift 3.3.x.
29+
If you are using maven observe that the artifact id also needs the Scala version.
30+
31+
### Lift FoBo boot hooks (when used in the FoBo module)
32+
```scala
33+
import net.liftmodules.fobo
34+
:
35+
fobo.Resource.init = fobo.Resource.BootstrapXXX
36+
```
37+
### Lift FoBo boot hooks (when used as stand alone module)
38+
```scala
39+
import net.liftmodules.{fobobsres => fobo}
40+
:
41+
fobo.Resource.init = fobo.Resource.BootstrapXXX
42+
```
43+
### Lift FoBo Template hooks
44+
```html
45+
<link href='/classpath/fobo/bootstrap.css' rel="stylesheet" type='text/css'>
46+
:
47+
<link href='[path/to/you/app/specific/css/file/in/the/webapp/dir]' rel="stylesheet" type='text/css'>
48+
:
49+
:
50+
<script src="/classpath/fobo/bootstrap.js" type="text/javascript"></script>
51+
```
52+
Here the resources starting with /classpath/fobo/ is the ones provided by the FoBo module.
53+
The FoBo js and css files will, without any name change, be served debug-able in development and minimized otherwise.
54+
55+
### More information
56+
57+
For more information on how to use Twitter Bootstrap in the FoBo module see the [FoBo - Lift Front-End Toolkit Module](https://github.com/karma4u101/FoBo).
58+
For more information on how to use Twitter Bootstrap see [Twitter Bootstrap](http://twitter.github.com/bootstrap/)
59+
60+
## Contributions
61+
62+
Improvements, contributions and suggestions are welcome! Please see the [Contribution Document](https://github.com/karma4u101/FoBo/blob/master/CONTRIBUTING.md). You can also leave a issue report or drop a question/suggestion on [Lift's mailing list](http://groups.google.com/group/liftweb/)
63+

0 commit comments

Comments
 (0)