-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Issue #1: Clean up and basic functionality.
- Loading branch information
Showing
7 changed files
with
207 additions
and
529 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,49 +1,50 @@ | ||
# Expanding Formatter | ||
|
||
This module provides a formatter for existing text, long text and text with | ||
summary widget types. This module allows you to change how the content is being | ||
This module provides a formatter for existing text, long text and text with | ||
summary widget types. This module allows you to change how the content is being | ||
displayed (formatted) by providing new format types: | ||
|
||
- Trimmed (expandable) | ||
- Summary or Trimmed (expandable) | ||
|
||
![Expanding Formatter](https://github.com/backdrop-contrib/expanding_formatter/blob/1.x-1.x/images/expanding_formatter.gif "Expanding formatter demo") | ||
|
||
## Features | ||
|
||
- CSS3 Transition effects (with jQuery fallback if disabled): | ||
- CSS Transition effects: | ||
- None (just toggle visibility immediately) | ||
- Fade | ||
- Slide | ||
- Customizable/themable ellipsis | ||
- Customizable labels for trigger (collapsible, if you need to create a toggle) | ||
- Customizable classes on trigger | ||
- Customizable classes on trigger | ||
|
||
## How to use this module: | ||
|
||
Enable the module and go to your content type's display | ||
(e.g. `admin/structure/types/manage/page/display`). You will see fields | ||
(like `Body`) that allow you to adjust the `Format` – you can now choose | ||
"Trimmed (expandable)". Once you've selected this format, you will have | ||
Enable the module and go to your content type's display | ||
(e.g. `admin/structure/types/manage/page/display`). You will see fields | ||
(like `Body`) that allow you to adjust the `Format` – you can now choose | ||
"Trimmed (expandable)". Once you've selected this format, you will have | ||
additional configuration options. | ||
|
||
![Expanding Formatter Display Settings](https://github.com/backdrop-contrib/expanding_formatter/blob/1.x-1.x/images/expanding_formatter_display.png "Expanding formatter display settings") | ||
|
||
## Issues | ||
|
||
Bugs and Feature requests should be reported in the | ||
Bugs and Feature requests should be reported in the | ||
[Issue Queue](https://github.com/backdrop-contrib/expanding_formatter/issues) | ||
|
||
## Current Maintainers | ||
|
||
- [Laryn Kragt Bakker](https://github.com/laryn) - [CEDC.org](https://cedc.org) | ||
- [Laryn Kragt Bakker](https://github.com/laryn). | ||
|
||
## Credits | ||
|
||
- Ported to Backdrop CMS by [Laryn Kragt Bakker](https://github.com/laryn) - [CEDC.org](https://cedc.org). | ||
- Ported to Backdrop CMS by [Laryn Kragt Bakker](https://github.com/laryn). | ||
- Initial port to Backdrop sponsored by [CEDC.org](https://cedc.org). | ||
- Maintainer for the Drupal module: [Mark Carver](https://github.com/markcarver). | ||
|
||
## License | ||
|
||
This project is GPL v2 software. See the [LICENSE.txt](https://github.com/backdrop-contrib/expanding_formatter/blob/1.x-1.x/LICENSE.txt) | ||
file in this directory for complete text. | ||
This project is GPL v2 software. See the [LICENSE.txt](https://github.com/backdrop-contrib/expanding_formatter/blob/1.x-1.x/LICENSE.txt) | ||
file in this directory for complete text. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,110 @@ | ||
// Defaults | ||
.expanding-formatter { | ||
overflow: hidden; | ||
position: relative; | ||
|
||
&.expanded .expanding-formatter-ellipsis { | ||
display: none; | ||
} | ||
|
||
// Inline summary/expanded content. | ||
&[data-inline="1"] { | ||
p { | ||
margin: 0 0 1.2em; | ||
} | ||
|
||
p:nth-child(2) { | ||
margin-top: 1.2em; | ||
} | ||
|
||
p:first-child, | ||
p:last-child { | ||
display: inline; | ||
margin-bottom: 0; | ||
} | ||
|
||
.expanding-formatter-summary, | ||
.expanding-formatter-content { | ||
display: inline; | ||
} | ||
|
||
.expanding-formatter-trigger { | ||
display: inline-block; | ||
margin-bottom: 5px; | ||
} | ||
} | ||
|
||
// Margin for ellipsis. | ||
.expanding-formatter-ellipsis { | ||
margin-right: .25em; | ||
} | ||
|
||
// Collapsed | ||
&.collapsed { | ||
|
||
&.sliding .expanding-formatter-ellipsis, | ||
&[data-effect="slide"]:not(.sliding) .expanding-formatter-content { | ||
display: none; | ||
} | ||
|
||
.trigger { | ||
display: inline; | ||
} | ||
} | ||
|
||
// Slide effect | ||
&[data-effect="slide"] { | ||
@include transition(height 500ms ease); | ||
} | ||
|
||
// Fade effect | ||
&[data-effect="fade"] { | ||
.expanding-formatter-content { | ||
@include transition(opacity 500ms ease); | ||
@include opacity(0); | ||
overflow: hidden; | ||
} | ||
|
||
.expanding-formatter-trigger { | ||
@include transition(opacity 500ms ease); | ||
@include opacity(0); | ||
} | ||
|
||
&.fading .expanding-formatter-trigger { | ||
@include transition(none); | ||
} | ||
|
||
&.collapsed { | ||
.expanding-formatter-content { | ||
clip: rect(1px 1px 1px 1px); | ||
clip: rect(1px, 1px, 1px, 1px); | ||
height: 1px; | ||
overflow: hidden; | ||
position: absolute !important; | ||
width: 1px; | ||
} | ||
|
||
.expanding-formatter-trigger { | ||
@include opacity(1); | ||
} | ||
|
||
&.fading .expanding-formatter-content, | ||
&.fading .expanding-formatter-trigger { | ||
@include opacity(0); | ||
} | ||
} | ||
|
||
&.expanded { | ||
|
||
.expanding-formatter-content, | ||
.expanding-formatter-trigger { | ||
@include opacity(1); | ||
} | ||
|
||
&.fading .expanding-formatter-content, | ||
&.fading .expanding-formatter-trigger { | ||
@include opacity(0); | ||
} | ||
} | ||
} | ||
} |
Oops, something went wrong.