-
Notifications
You must be signed in to change notification settings - Fork 33
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
9 changed files
with
1,813 additions
and
3 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
1,332 changes: 1,332 additions & 0 deletions
1,332
...sil/gov/temas/jbot/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
...il/gov/temas/jbot/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
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
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,43 @@ | ||
@import '~tippy.js/dist/themes/light'; | ||
|
||
|
||
/* tip preview */ | ||
.tippreview { | ||
position: relative; | ||
|
||
display: flex; | ||
|
||
.tippreview-image { | ||
display: flex; | ||
|
||
min-width: 6rem; | ||
min-height: 6rem; | ||
|
||
align-items: center; | ||
justify-content: center; | ||
} | ||
.tippreview-image > img { | ||
max-width: 6rem; | ||
max-height: 6rem; | ||
} | ||
.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