-
Notifications
You must be signed in to change notification settings - Fork 31
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
1,800 additions
and
1 deletion.
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
1,332 changes: 1,332 additions & 0 deletions
1,332
...er/plone/overrides/Products.TinyMCE.skins.tinymce.plugins.plonebrowser.js.plonebrowser.js
Large diffs are not rendered by default.
Oops, something went wrong.
356 changes: 356 additions & 0 deletions
356
...r/plone/overrides/Products.TinyMCE.skins.tinymce.plugins.plonebrowser.plonebrowser.htm.pt
Large diffs are not rendered by default.
Oops, something went wrong.
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 |
---|---|---|
@@ -1 +1,2 @@ | ||
@import 'scss/sprite'; | ||
@import 'scss/tippreview'; |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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,61 @@ | ||
import tippy from 'tippy.js'; | ||
|
||
|
||
export default class TipPreview { | ||
constructor() { | ||
this.$template = $('<div>'); | ||
this.$template.html( | ||
`<div class="tippreview"> | ||
<div class="tippreview-image"> | ||
<img src="" alt="" /> | ||
</div> | ||
<div class="tippreview-title"> | ||
Page title | ||
</div> | ||
</div>` | ||
); | ||
|
||
// don't show preview on edit tab | ||
if ($('#contentview-edit.selected').length > 0) { | ||
return; | ||
} | ||
|
||
// Change this option when style the tooltip | ||
this.dontHide = false; | ||
|
||
this.createTooltip(); | ||
} | ||
createTooltip() { | ||
tippy('[data-tippreview-enabled="true"]', { | ||
animation: 'shift-toward', | ||
arrow: true, | ||
theme: 'light', | ||
html: this.$template[0], | ||
onShow: this.onShow.bind(this), | ||
// prevent tooltip from displaying over button | ||
popperOptions: { | ||
modifiers: { | ||
preventOverflow: { | ||
enabled: false | ||
}, | ||
hide: { | ||
enabled: false | ||
} | ||
} | ||
} | ||
}); | ||
} | ||
onShow(tip) { | ||
if (this.dontHide) { | ||
tip.hide = function() {}; | ||
} | ||
|
||
let $a = $(tip.reference); | ||
|
||
let $image = $('.tippreview-image > img', this.$template); | ||
$image.attr('src', $a.attr('data-tippreview-image')); | ||
|
||
let $title = $('.tippreview-title', this.$template); | ||
$title.html($a.attr('data-tippreview-title')); | ||
} | ||
} |
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,39 @@ | ||
@import '~tippy.js/dist/themes/light'; | ||
|
||
|
||
/* tip preview */ | ||
.tippreview { | ||
position: relative; | ||
|
||
display: flex; | ||
|
||
.tippreview-image { | ||
width: 6rem; | ||
height: 6rem; | ||
} | ||
.tippreview-image > img { | ||
width: 6rem; | ||
height: 6rem; | ||
object-fit: cover; | ||
} | ||
.tippreview-title { | ||
font-weight: bold; | ||
|
||
width: 12rem; | ||
margin: 1rem; | ||
|
||
text-align: left; | ||
} | ||
&::after { | ||
font-size: 1.2rem; | ||
font-weight: bold; | ||
|
||
position: absolute; | ||
top: 0; | ||
right: 0; | ||
|
||
display: block; | ||
|
||
content: '🡵'; | ||
} | ||
} |
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