Skip to content

Commit

Permalink
Add way to use custom items of clips (#148)
Browse files Browse the repository at this point in the history
  • Loading branch information
bscheshirwork authored and vova07 committed Nov 15, 2018
1 parent f3f0673 commit e4105b3
Show file tree
Hide file tree
Showing 5 changed files with 62 additions and 6 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@

All notable changes to `yii2-imperavi-widget` will be documented in this file.

## 2.0.7

### Changes
- Fix the issue #130 add a custom clips throw settings (bscheshirwork)

## 2.0.6

### Changes
Expand Down
18 changes: 18 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,12 @@ echo \vova07\imperavi\Widget::widget([
'clips',
'fullscreen',
],
'clips' => [
['Lorem ipsum...', 'Lorem...'],
['red', '<span class="label-red">red</span>'],
['green', '<span class="label-green">green</span>'],
['blue', '<span class="label-blue">blue</span>'],
],
],
]);
```
Expand All @@ -65,6 +71,12 @@ echo $form->field($model, 'content')->widget(Widget::className(), [
'clips',
'fullscreen',
],
'clips' => [
['Lorem ipsum...', 'Lorem...'],
['red', '<span class="label-red">red</span>'],
['green', '<span class="label-green">green</span>'],
['blue', '<span class="label-blue">blue</span>'],
],
],
]);
```
Expand All @@ -81,6 +93,12 @@ echo \vova07\imperavi\Widget::widget([
'clips',
'fullscreen',
],
'clips' => [
['Lorem ipsum...', 'Lorem...'],
['red', '<span class="label-red">red</span>'],
['green', '<span class="label-green">green</span>'],
['blue', '<span class="label-blue">blue</span>'],
],
],
]);
```
Expand Down
18 changes: 18 additions & 0 deletions README_RU.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,12 @@ echo \vova07\imperavi\Widget::widget([
'clips',
'fullscreen',
],
'clips' => [
['Lorem ipsum...', 'Lorem...'],
['red', '<span class="label-red">red</span>'],
['green', '<span class="label-green">green</span>'],
['blue', '<span class="label-blue">blue</span>'],
],
],
]);
```
Expand All @@ -66,6 +72,12 @@ echo $form->field($model, 'content')->widget(Widget::className(), [
'clips',
'fullscreen',
],
'clips' => [
['Lorem ipsum...', 'Lorem...'],
['red', '<span class="label-red">red</span>'],
['green', '<span class="label-green">green</span>'],
['blue', '<span class="label-blue">blue</span>'],
],
],
]);
```
Expand All @@ -82,6 +94,12 @@ echo \vova07\imperavi\Widget::widget([
'clips',
'fullscreen',
],
'clips' => [
['Lorem ipsum...', 'Lorem...'],
['red', '<span class="label-red">red</span>'],
['green', '<span class="label-green">green</span>'],
['blue', '<span class="label-blue">blue</span>'],
],
],
]);
```
Expand Down
25 changes: 20 additions & 5 deletions src/assets/plugins/clips/clips.css
Original file line number Diff line number Diff line change
@@ -1,6 +1,21 @@
.label-red,
.label-green,
.label-blue {
color: #fff;
padding: 0 7px;
-webkit-border-radius: 4px;
-moz-border-radius: 4px;
border-radius: 4px;
}

.label-red {
color: #fff;
background: #c92020;
padding: 0 7px;
border-radius: 4px;
}
background: #c92020;
}

.label-blue {
background: #2020c9;
}

.label-green {
background: #20c920;
}
2 changes: 1 addition & 1 deletion src/assets/plugins/clips/clips.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
return {
init: function()
{
var items = [
var items = this.opts.clips || [
['Lorem ipsum...', 'Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.'],
['Red label', '<span class="label-red">Label</span>']
];
Expand Down

0 comments on commit e4105b3

Please sign in to comment.