Add Fancybox to the core
This commit is contained in:
parent
349fa08ece
commit
b4b9a6a34a
14 changed files with 6681 additions and 32 deletions
|
@ -3021,6 +3021,7 @@ class Item
|
|||
if (!$is_preview) {
|
||||
$item['body'] = preg_replace("#\s*\[attachment .*?].*?\[/attachment]\s*#ism", "\n", $item['body']);
|
||||
$item['body'] = Post\Media::removeFromEndOfBody($item['body'] ?? '');
|
||||
$item['body'] = Post\Media::replaceImage($item['body']);
|
||||
}
|
||||
|
||||
$body = $item['body'];
|
||||
|
@ -3038,6 +3039,7 @@ class Item
|
|||
if (!empty($shared['post'])) {
|
||||
$shared_item = $shared['post'];
|
||||
$shared_item['body'] = Post\Media::removeFromEndOfBody($shared_item['body']);
|
||||
$shared_item['body'] = Post\Media::replaceImage($shared_item['body']);
|
||||
$quote_uri_id = $shared['post']['uri-id'];
|
||||
$shared_links[] = strtolower($shared['post']['uri']);
|
||||
$item['body'] = BBCode::removeSharedData($item['body']);
|
||||
|
@ -3141,12 +3143,14 @@ class Item
|
|||
}
|
||||
|
||||
if (!empty($shared_attachments)) {
|
||||
$s = self::AddGallery($s, $shared_attachments, $item['uri-id']);
|
||||
$s = self::addVisualAttachments($shared_attachments, $shared_item, $s, true);
|
||||
$s = self::addLinkAttachment($shared_uri_id ?: $item['uri-id'], $shared_attachments, $body, $s, true, $quote_shared_links);
|
||||
$s = self::addNonVisualAttachments($shared_attachments, $item, $s, true);
|
||||
$body = BBCode::removeSharedData($body);
|
||||
}
|
||||
|
||||
$s = self::AddGallery($s, $attachments, $item['uri-id']);
|
||||
$s = self::addVisualAttachments($attachments, $item, $s, false);
|
||||
$s = self::addLinkAttachment($item['uri-id'], $attachments, $body, $s, false, $shared_links);
|
||||
$s = self::addNonVisualAttachments($attachments, $item, $s, false);
|
||||
|
@ -3196,6 +3200,24 @@ class Item
|
|||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Modify links to pictures to links for the "Fancybox" gallery
|
||||
*
|
||||
* @param string $s
|
||||
* @param array $attachments
|
||||
* @param integer $uri_id
|
||||
* @return string
|
||||
*/
|
||||
private static function AddGallery(string $s, array $attachments, int $uri_id): string
|
||||
{
|
||||
foreach ($attachments['visual'] as $attachment) {
|
||||
if (empty($attachment['preview']) || ($attachment['type'] != Post\Media::IMAGE)) {
|
||||
continue;
|
||||
}
|
||||
$s = str_replace('<a href="' . $attachment['url'] . '"', '<a data-fancybox="' . $uri_id . '" href="' . $attachment['url'] . '"', $s);
|
||||
}
|
||||
return $s;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if the body contains a link
|
||||
|
@ -3259,12 +3281,18 @@ class Item
|
|||
|
||||
foreach ($attachments['visual'] as $attachment) {
|
||||
if (!empty($attachment['preview'])) {
|
||||
if (Network::isLocalLink($attachment['preview'])) {
|
||||
continue;
|
||||
}
|
||||
$proxy = Post\Media::getPreviewUrlForId($attachment['id'], Proxy::SIZE_LARGE);
|
||||
$search = ['[img=' . $attachment['preview'] . ']', ']' . $attachment['preview'] . '[/img]'];
|
||||
$replace = ['[img=' . $proxy . ']', ']' . $proxy . '[/img]'];
|
||||
|
||||
$body = str_replace($search, $replace, $body);
|
||||
} elseif ($attachment['filetype'] == 'image') {
|
||||
if (Network::isLocalLink($attachment['url'])) {
|
||||
continue;
|
||||
}
|
||||
$proxy = Post\Media::getUrlForId($attachment['id']);
|
||||
$search = ['[img=' . $attachment['url'] . ']', ']' . $attachment['url'] . '[/img]'];
|
||||
$replace = ['[img=' . $proxy . ']', ']' . $proxy . '[/img]'];
|
||||
|
@ -3344,7 +3372,7 @@ class Item
|
|||
if (self::containsLink($item['body'], $src_url)) {
|
||||
continue;
|
||||
}
|
||||
$images[] = ['src' => $src_url, 'preview' => $preview_url, 'attachment' => $attachment];
|
||||
$images[] = ['src' => $src_url, 'preview' => $preview_url, 'attachment' => $attachment, 'uri_id' => $item['uri-id']];
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -478,6 +478,33 @@ class Media
|
|||
return preg_match('#/photos/.*/image/#ism', $page) && preg_match('#/photo/.*-[01]\.#ism', $preview);
|
||||
}
|
||||
|
||||
/**
|
||||
* Replace the image link in Friendica image posts with a link to the image
|
||||
*
|
||||
* @param string $body
|
||||
* @return string
|
||||
*/
|
||||
public static function replaceImage(string $body): string
|
||||
{
|
||||
if (preg_match_all("#\[url=([^\]]+?)\]\s*\[img=([^\[\]]*)\]([^\[\]]*)\[\/img\]\s*\[/url\]#ism", $body, $pictures, PREG_SET_ORDER)) {
|
||||
foreach ($pictures as $picture) {
|
||||
if (self::isLinkToImagePage($picture[1], $picture[2])) {
|
||||
$body = str_replace($picture[0], '[url=' . str_replace('-1.', '-0.', $picture[2]) . '][img=' . $picture[2] . ']' . $picture[3] . '[/img][/url]', $body);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (preg_match_all("#\[url=([^\]]+?)\]\s*\[img\]([^\[]+?)\[/img\]\s*\[/url\]#ism", $body, $pictures, PREG_SET_ORDER)) {
|
||||
foreach ($pictures as $picture) {
|
||||
if (self::isLinkToImagePage($picture[1], $picture[2])) {
|
||||
$body = str_replace($picture[0], '[url=' . str_replace('-1.', '-0.', $picture[2]) . '][img]' . $picture[2] . '[/img][/url]', $body);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return $body;
|
||||
}
|
||||
|
||||
/**
|
||||
* Add media links and remove them from the body
|
||||
*
|
||||
|
|
62
view/js/fancybox/README.md
Normal file
62
view/js/fancybox/README.md
Normal file
|
@ -0,0 +1,62 @@
|
|||
# fancyBox 3.5.7
|
||||
|
||||
jQuery lightbox script for displaying images, videos and more.
|
||||
Touch enabled, responsive and fully customizable.
|
||||
|
||||
See the [project page](http://fancyapps.com/fancybox/3/) for documentation and a demonstration.
|
||||
|
||||
Follow [@thefancyapps](//twitter.com/thefancyapps) for updates.
|
||||
|
||||
|
||||
## Quick start
|
||||
|
||||
1\. Add latest jQuery and fancyBox files
|
||||
|
||||
```html
|
||||
<script src="https://code.jquery.com/jquery-3.3.1.min.js"></script>
|
||||
|
||||
<link href="/path/to/jquery.fancybox.min.css" rel="stylesheet">
|
||||
<script src="/path/to/jquery.fancybox.min.js"></script>
|
||||
```
|
||||
|
||||
|
||||
2\. Create links
|
||||
|
||||
```html
|
||||
<a data-fancybox="gallery" href="big_1.jpg">
|
||||
<img src="small_1.jpg">
|
||||
</a>
|
||||
|
||||
<a data-fancybox="gallery" href="big_2.jpg">
|
||||
<img src="small_2.jpg">
|
||||
</a>
|
||||
```
|
||||
|
||||
|
||||
3\. Enjoy!
|
||||
|
||||
|
||||
## License
|
||||
|
||||
fancyBox is licensed under the [GPLv3](http://choosealicense.com/licenses/gpl-3.0) license for all open source applications.
|
||||
A commercial license is required for all commercial applications (including sites, themes and apps you plan to sell).
|
||||
|
||||
[Read more about fancyBox license](http://fancyapps.com/fancybox/3/#license).
|
||||
|
||||
## Bugs and feature requests
|
||||
|
||||
If you find a bug, please report it [here on Github](https://github.com/fancyapps/fancybox/issues).
|
||||
|
||||
Guidelines for bug reports:
|
||||
|
||||
1. Use the GitHub issue search — check if the issue has already been reported.
|
||||
2. Check if the issue has been fixed — try to reproduce it using the latest master or development branch in the repository.
|
||||
3. Isolate the problem — create a reduced test case and a live example. You can use CodePen to fork any demo found on documentation to use it as a template.
|
||||
|
||||
A good bug report shouldn't leave others needing to chase you up for more information.
|
||||
Please try to be as detailed as possible in your report.
|
||||
|
||||
|
||||
Feature requests are welcome. Please look for existing ones and use GitHub's "reactions" feature to vote.
|
||||
|
||||
Please do not use the issue tracker for personal support requests - use Stack Overflow ([fancybox-3](http://stackoverflow.com/questions/tagged/fancybox-3) tag) instead.
|
13
view/js/fancybox/fancybox.config.js
Normal file
13
view/js/fancybox/fancybox.config.js
Normal file
|
@ -0,0 +1,13 @@
|
|||
$(document).ready(function() {
|
||||
$.fancybox.defaults.loop = "true";
|
||||
// this disables the colorbox hook found in frio/js/modal.js:34
|
||||
$("body").off("click", ".wall-item-body a img");
|
||||
|
||||
// Adds ALT/TITLE text to fancybox
|
||||
$('a[data-fancybox').fancybox({
|
||||
afterLoad : function(instance, current) {
|
||||
current.$image.attr('alt', current.opts.$orig.find('img').attr('alt') );
|
||||
current.$image.attr('title', current.opts.$orig.find('img').attr('title') );
|
||||
}
|
||||
});
|
||||
});
|
895
view/js/fancybox/jquery.fancybox.css
vendored
Normal file
895
view/js/fancybox/jquery.fancybox.css
vendored
Normal file
|
@ -0,0 +1,895 @@
|
|||
body.compensate-for-scrollbar {
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.fancybox-active {
|
||||
height: auto;
|
||||
}
|
||||
|
||||
.fancybox-is-hidden {
|
||||
left: -9999px;
|
||||
margin: 0;
|
||||
position: absolute !important;
|
||||
top: -9999px;
|
||||
visibility: hidden;
|
||||
}
|
||||
|
||||
.fancybox-container {
|
||||
-webkit-backface-visibility: hidden;
|
||||
height: 100%;
|
||||
left: 0;
|
||||
outline: none;
|
||||
position: fixed;
|
||||
-webkit-tap-highlight-color: transparent;
|
||||
top: 0;
|
||||
-ms-touch-action: manipulation;
|
||||
touch-action: manipulation;
|
||||
transform: translateZ(0);
|
||||
width: 100%;
|
||||
z-index: 99992;
|
||||
}
|
||||
|
||||
.fancybox-container * {
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.fancybox-outer,
|
||||
.fancybox-inner,
|
||||
.fancybox-bg,
|
||||
.fancybox-stage {
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
position: absolute;
|
||||
right: 0;
|
||||
top: 0;
|
||||
}
|
||||
|
||||
.fancybox-outer {
|
||||
-webkit-overflow-scrolling: touch;
|
||||
overflow-y: auto;
|
||||
}
|
||||
|
||||
.fancybox-bg {
|
||||
background: rgb(30, 30, 30);
|
||||
opacity: 0;
|
||||
transition-duration: inherit;
|
||||
transition-property: opacity;
|
||||
transition-timing-function: cubic-bezier(.47, 0, .74, .71);
|
||||
}
|
||||
|
||||
.fancybox-is-open .fancybox-bg {
|
||||
opacity: .9;
|
||||
transition-timing-function: cubic-bezier(.22, .61, .36, 1);
|
||||
}
|
||||
|
||||
.fancybox-infobar,
|
||||
.fancybox-toolbar,
|
||||
.fancybox-caption,
|
||||
.fancybox-navigation .fancybox-button {
|
||||
direction: ltr;
|
||||
opacity: 0;
|
||||
position: absolute;
|
||||
transition: opacity .25s ease, visibility 0s ease .25s;
|
||||
visibility: hidden;
|
||||
z-index: 99997;
|
||||
}
|
||||
|
||||
.fancybox-show-infobar .fancybox-infobar,
|
||||
.fancybox-show-toolbar .fancybox-toolbar,
|
||||
.fancybox-show-caption .fancybox-caption,
|
||||
.fancybox-show-nav .fancybox-navigation .fancybox-button {
|
||||
opacity: 1;
|
||||
transition: opacity .25s ease 0s, visibility 0s ease 0s;
|
||||
visibility: visible;
|
||||
}
|
||||
|
||||
.fancybox-infobar {
|
||||
color: #ccc;
|
||||
font-size: 13px;
|
||||
-webkit-font-smoothing: subpixel-antialiased;
|
||||
height: 44px;
|
||||
left: 0;
|
||||
line-height: 44px;
|
||||
min-width: 44px;
|
||||
mix-blend-mode: difference;
|
||||
padding: 0 10px;
|
||||
pointer-events: none;
|
||||
top: 0;
|
||||
-webkit-touch-callout: none;
|
||||
-webkit-user-select: none;
|
||||
-moz-user-select: none;
|
||||
-ms-user-select: none;
|
||||
user-select: none;
|
||||
}
|
||||
|
||||
.fancybox-toolbar {
|
||||
right: 0;
|
||||
top: 0;
|
||||
}
|
||||
|
||||
.fancybox-stage {
|
||||
direction: ltr;
|
||||
overflow: visible;
|
||||
transform: translateZ(0);
|
||||
z-index: 99994;
|
||||
}
|
||||
|
||||
.fancybox-is-open .fancybox-stage {
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.fancybox-slide {
|
||||
-webkit-backface-visibility: hidden;
|
||||
/* Using without prefix would break IE11 */
|
||||
display: none;
|
||||
height: 100%;
|
||||
left: 0;
|
||||
outline: none;
|
||||
overflow: auto;
|
||||
-webkit-overflow-scrolling: touch;
|
||||
padding: 44px;
|
||||
position: absolute;
|
||||
text-align: center;
|
||||
top: 0;
|
||||
transition-property: transform, opacity;
|
||||
white-space: normal;
|
||||
width: 100%;
|
||||
z-index: 99994;
|
||||
}
|
||||
|
||||
.fancybox-slide::before {
|
||||
content: '';
|
||||
display: inline-block;
|
||||
font-size: 0;
|
||||
height: 100%;
|
||||
vertical-align: middle;
|
||||
width: 0;
|
||||
}
|
||||
|
||||
.fancybox-is-sliding .fancybox-slide,
|
||||
.fancybox-slide--previous,
|
||||
.fancybox-slide--current,
|
||||
.fancybox-slide--next {
|
||||
display: block;
|
||||
}
|
||||
|
||||
.fancybox-slide--image {
|
||||
overflow: hidden;
|
||||
padding: 44px 0;
|
||||
}
|
||||
|
||||
.fancybox-slide--image::before {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.fancybox-slide--html {
|
||||
padding: 6px;
|
||||
}
|
||||
|
||||
.fancybox-content {
|
||||
background: #fff;
|
||||
display: inline-block;
|
||||
margin: 0;
|
||||
max-width: 100%;
|
||||
overflow: auto;
|
||||
-webkit-overflow-scrolling: touch;
|
||||
padding: 44px;
|
||||
position: relative;
|
||||
text-align: left;
|
||||
vertical-align: middle;
|
||||
}
|
||||
|
||||
.fancybox-slide--image .fancybox-content {
|
||||
animation-timing-function: cubic-bezier(.5, 0, .14, 1);
|
||||
-webkit-backface-visibility: hidden;
|
||||
background: transparent;
|
||||
background-repeat: no-repeat;
|
||||
background-size: 100% 100%;
|
||||
left: 0;
|
||||
max-width: none;
|
||||
overflow: visible;
|
||||
padding: 0;
|
||||
position: absolute;
|
||||
top: 0;
|
||||
-ms-transform-origin: top left;
|
||||
transform-origin: top left;
|
||||
transition-property: transform, opacity;
|
||||
-webkit-user-select: none;
|
||||
-moz-user-select: none;
|
||||
-ms-user-select: none;
|
||||
user-select: none;
|
||||
z-index: 99995;
|
||||
}
|
||||
|
||||
.fancybox-can-zoomOut .fancybox-content {
|
||||
cursor: zoom-out;
|
||||
}
|
||||
|
||||
.fancybox-can-zoomIn .fancybox-content {
|
||||
cursor: zoom-in;
|
||||
}
|
||||
|
||||
.fancybox-can-swipe .fancybox-content,
|
||||
.fancybox-can-pan .fancybox-content {
|
||||
cursor: -webkit-grab;
|
||||
cursor: grab;
|
||||
}
|
||||
|
||||
.fancybox-is-grabbing .fancybox-content {
|
||||
cursor: -webkit-grabbing;
|
||||
cursor: grabbing;
|
||||
}
|
||||
|
||||
.fancybox-container [data-selectable='true'] {
|
||||
cursor: text;
|
||||
}
|
||||
|
||||
.fancybox-image,
|
||||
.fancybox-spaceball {
|
||||
background: transparent;
|
||||
border: 0;
|
||||
height: 100%;
|
||||
left: 0;
|
||||
margin: 0;
|
||||
max-height: none;
|
||||
max-width: none;
|
||||
padding: 0;
|
||||
position: absolute;
|
||||
top: 0;
|
||||
-webkit-user-select: none;
|
||||
-moz-user-select: none;
|
||||
-ms-user-select: none;
|
||||
user-select: none;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.fancybox-spaceball {
|
||||
z-index: 1;
|
||||
}
|
||||
|
||||
.fancybox-slide--video .fancybox-content,
|
||||
.fancybox-slide--map .fancybox-content,
|
||||
.fancybox-slide--pdf .fancybox-content,
|
||||
.fancybox-slide--iframe .fancybox-content {
|
||||
height: 100%;
|
||||
overflow: visible;
|
||||
padding: 0;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.fancybox-slide--video .fancybox-content {
|
||||
background: #000;
|
||||
}
|
||||
|
||||
.fancybox-slide--map .fancybox-content {
|
||||
background: #e5e3df;
|
||||
}
|
||||
|
||||
.fancybox-slide--iframe .fancybox-content {
|
||||
background: #fff;
|
||||
}
|
||||
|
||||
.fancybox-video,
|
||||
.fancybox-iframe {
|
||||
background: transparent;
|
||||
border: 0;
|
||||
display: block;
|
||||
height: 100%;
|
||||
margin: 0;
|
||||
overflow: hidden;
|
||||
padding: 0;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
/* Fix iOS */
|
||||
.fancybox-iframe {
|
||||
left: 0;
|
||||
position: absolute;
|
||||
top: 0;
|
||||
}
|
||||
|
||||
.fancybox-error {
|
||||
background: #fff;
|
||||
cursor: default;
|
||||
max-width: 400px;
|
||||
padding: 40px;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.fancybox-error p {
|
||||
color: #444;
|
||||
font-size: 16px;
|
||||
line-height: 20px;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
/* Buttons */
|
||||
|
||||
.fancybox-button {
|
||||
background: rgba(30, 30, 30, .6);
|
||||
border: 0;
|
||||
border-radius: 0;
|
||||
box-shadow: none;
|
||||
cursor: pointer;
|
||||
display: inline-block;
|
||||
height: 44px;
|
||||
margin: 0;
|
||||
padding: 10px;
|
||||
position: relative;
|
||||
transition: color .2s;
|
||||
vertical-align: top;
|
||||
visibility: inherit;
|
||||
width: 44px;
|
||||
}
|
||||
|
||||
.fancybox-button,
|
||||
.fancybox-button:visited,
|
||||
.fancybox-button:link {
|
||||
color: #ccc;
|
||||
}
|
||||
|
||||
.fancybox-button:hover {
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.fancybox-button:focus {
|
||||
outline: none;
|
||||
}
|
||||
|
||||
.fancybox-button.fancybox-focus {
|
||||
outline: 1px dotted;
|
||||
}
|
||||
|
||||
.fancybox-button[disabled],
|
||||
.fancybox-button[disabled]:hover {
|
||||
color: #888;
|
||||
cursor: default;
|
||||
outline: none;
|
||||
}
|
||||
|
||||
/* Fix IE11 */
|
||||
.fancybox-button div {
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.fancybox-button svg {
|
||||
display: block;
|
||||
height: 100%;
|
||||
overflow: visible;
|
||||
position: relative;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.fancybox-button svg path {
|
||||
fill: currentColor;
|
||||
stroke-width: 0;
|
||||
}
|
||||
|
||||
.fancybox-button--play svg:nth-child(2),
|
||||
.fancybox-button--fsenter svg:nth-child(2) {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.fancybox-button--pause svg:nth-child(1),
|
||||
.fancybox-button--fsexit svg:nth-child(1) {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.fancybox-progress {
|
||||
background: #ff5268;
|
||||
height: 2px;
|
||||
left: 0;
|
||||
position: absolute;
|
||||
right: 0;
|
||||
top: 0;
|
||||
-ms-transform: scaleX(0);
|
||||
transform: scaleX(0);
|
||||
-ms-transform-origin: 0;
|
||||
transform-origin: 0;
|
||||
transition-property: transform;
|
||||
transition-timing-function: linear;
|
||||
z-index: 99998;
|
||||
}
|
||||
|
||||
/* Close button on the top right corner of html content */
|
||||
|
||||
.fancybox-close-small {
|
||||
background: transparent;
|
||||
border: 0;
|
||||
border-radius: 0;
|
||||
color: #ccc;
|
||||
cursor: pointer;
|
||||
opacity: .8;
|
||||
padding: 8px;
|
||||
position: absolute;
|
||||
right: -12px;
|
||||
top: -44px;
|
||||
z-index: 401;
|
||||
}
|
||||
|
||||
.fancybox-close-small:hover {
|
||||
color: #fff;
|
||||
opacity: 1;
|
||||
}
|
||||
|
||||
.fancybox-slide--html .fancybox-close-small {
|
||||
color: currentColor;
|
||||
padding: 10px;
|
||||
right: 0;
|
||||
top: 0;
|
||||
}
|
||||
|
||||
.fancybox-slide--image.fancybox-is-scaling .fancybox-content {
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.fancybox-is-scaling .fancybox-close-small,
|
||||
.fancybox-is-zoomable.fancybox-can-pan .fancybox-close-small {
|
||||
display: none;
|
||||
}
|
||||
|
||||
/* Navigation arrows */
|
||||
|
||||
.fancybox-navigation .fancybox-button {
|
||||
background-clip: content-box;
|
||||
height: 100px;
|
||||
opacity: 0;
|
||||
position: absolute;
|
||||
top: calc(50% - 50px);
|
||||
width: 70px;
|
||||
}
|
||||
|
||||
.fancybox-navigation .fancybox-button div {
|
||||
padding: 7px;
|
||||
}
|
||||
|
||||
.fancybox-navigation .fancybox-button--arrow_left {
|
||||
left: 0;
|
||||
left: env(safe-area-inset-left);
|
||||
padding: 31px 26px 31px 6px;
|
||||
}
|
||||
|
||||
.fancybox-navigation .fancybox-button--arrow_right {
|
||||
padding: 31px 6px 31px 26px;
|
||||
right: 0;
|
||||
right: env(safe-area-inset-right);
|
||||
}
|
||||
|
||||
/* Caption */
|
||||
|
||||
.fancybox-caption {
|
||||
background: linear-gradient(to top,
|
||||
rgba(0, 0, 0, .85) 0%,
|
||||
rgba(0, 0, 0, .3) 50%,
|
||||
rgba(0, 0, 0, .15) 65%,
|
||||
rgba(0, 0, 0, .075) 75.5%,
|
||||
rgba(0, 0, 0, .037) 82.85%,
|
||||
rgba(0, 0, 0, .019) 88%,
|
||||
rgba(0, 0, 0, 0) 100%);
|
||||
bottom: 0;
|
||||
color: #eee;
|
||||
font-size: 14px;
|
||||
font-weight: 400;
|
||||
left: 0;
|
||||
line-height: 1.5;
|
||||
padding: 75px 44px 25px 44px;
|
||||
pointer-events: none;
|
||||
right: 0;
|
||||
text-align: center;
|
||||
z-index: 99996;
|
||||
}
|
||||
|
||||
@supports (padding: max(0px)) {
|
||||
.fancybox-caption {
|
||||
padding: 75px max(44px, env(safe-area-inset-right)) max(25px, env(safe-area-inset-bottom)) max(44px, env(safe-area-inset-left));
|
||||
}
|
||||
}
|
||||
|
||||
.fancybox-caption--separate {
|
||||
margin-top: -50px;
|
||||
}
|
||||
|
||||
.fancybox-caption__body {
|
||||
max-height: 50vh;
|
||||
overflow: auto;
|
||||
pointer-events: all;
|
||||
}
|
||||
|
||||
.fancybox-caption a,
|
||||
.fancybox-caption a:link,
|
||||
.fancybox-caption a:visited {
|
||||
color: #ccc;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
.fancybox-caption a:hover {
|
||||
color: #fff;
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
/* Loading indicator */
|
||||
|
||||
.fancybox-loading {
|
||||
animation: fancybox-rotate 1s linear infinite;
|
||||
background: transparent;
|
||||
border: 4px solid #888;
|
||||
border-bottom-color: #fff;
|
||||
border-radius: 50%;
|
||||
height: 50px;
|
||||
left: 50%;
|
||||
margin: -25px 0 0 -25px;
|
||||
opacity: .7;
|
||||
padding: 0;
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
width: 50px;
|
||||
z-index: 99999;
|
||||
}
|
||||
|
||||
@keyframes fancybox-rotate {
|
||||
100% {
|
||||
transform: rotate(360deg);
|
||||
}
|
||||
}
|
||||
|
||||
/* Transition effects */
|
||||
|
||||
.fancybox-animated {
|
||||
transition-timing-function: cubic-bezier(0, 0, .25, 1);
|
||||
}
|
||||
|
||||
/* transitionEffect: slide */
|
||||
|
||||
.fancybox-fx-slide.fancybox-slide--previous {
|
||||
opacity: 0;
|
||||
transform: translate3d(-100%, 0, 0);
|
||||
}
|
||||
|
||||
.fancybox-fx-slide.fancybox-slide--next {
|
||||
opacity: 0;
|
||||
transform: translate3d(100%, 0, 0);
|
||||
}
|
||||
|
||||
.fancybox-fx-slide.fancybox-slide--current {
|
||||
opacity: 1;
|
||||
transform: translate3d(0, 0, 0);
|
||||
}
|
||||
|
||||
/* transitionEffect: fade */
|
||||
|
||||
.fancybox-fx-fade.fancybox-slide--previous,
|
||||
.fancybox-fx-fade.fancybox-slide--next {
|
||||
opacity: 0;
|
||||
transition-timing-function: cubic-bezier(.19, 1, .22, 1);
|
||||
}
|
||||
|
||||
.fancybox-fx-fade.fancybox-slide--current {
|
||||
opacity: 1;
|
||||
}
|
||||
|
||||
/* transitionEffect: zoom-in-out */
|
||||
|
||||
.fancybox-fx-zoom-in-out.fancybox-slide--previous {
|
||||
opacity: 0;
|
||||
transform: scale3d(1.5, 1.5, 1.5);
|
||||
}
|
||||
|
||||
.fancybox-fx-zoom-in-out.fancybox-slide--next {
|
||||
opacity: 0;
|
||||
transform: scale3d(.5, .5, .5);
|
||||
}
|
||||
|
||||
.fancybox-fx-zoom-in-out.fancybox-slide--current {
|
||||
opacity: 1;
|
||||
transform: scale3d(1, 1, 1);
|
||||
}
|
||||
|
||||
/* transitionEffect: rotate */
|
||||
|
||||
.fancybox-fx-rotate.fancybox-slide--previous {
|
||||
opacity: 0;
|
||||
-ms-transform: rotate(-360deg);
|
||||
transform: rotate(-360deg);
|
||||
}
|
||||
|
||||
.fancybox-fx-rotate.fancybox-slide--next {
|
||||
opacity: 0;
|
||||
-ms-transform: rotate(360deg);
|
||||
transform: rotate(360deg);
|
||||
}
|
||||
|
||||
.fancybox-fx-rotate.fancybox-slide--current {
|
||||
opacity: 1;
|
||||
-ms-transform: rotate(0deg);
|
||||
transform: rotate(0deg);
|
||||
}
|
||||
|
||||
/* transitionEffect: circular */
|
||||
|
||||
.fancybox-fx-circular.fancybox-slide--previous {
|
||||
opacity: 0;
|
||||
transform: scale3d(0, 0, 0) translate3d(-100%, 0, 0);
|
||||
}
|
||||
|
||||
.fancybox-fx-circular.fancybox-slide--next {
|
||||
opacity: 0;
|
||||
transform: scale3d(0, 0, 0) translate3d(100%, 0, 0);
|
||||
}
|
||||
|
||||
.fancybox-fx-circular.fancybox-slide--current {
|
||||
opacity: 1;
|
||||
transform: scale3d(1, 1, 1) translate3d(0, 0, 0);
|
||||
}
|
||||
|
||||
/* transitionEffect: tube */
|
||||
|
||||
.fancybox-fx-tube.fancybox-slide--previous {
|
||||
transform: translate3d(-100%, 0, 0) scale(.1) skew(-10deg);
|
||||
}
|
||||
|
||||
.fancybox-fx-tube.fancybox-slide--next {
|
||||
transform: translate3d(100%, 0, 0) scale(.1) skew(10deg);
|
||||
}
|
||||
|
||||
.fancybox-fx-tube.fancybox-slide--current {
|
||||
transform: translate3d(0, 0, 0) scale(1);
|
||||
}
|
||||
|
||||
/* Styling for Small-Screen Devices */
|
||||
@media all and (max-height: 576px) {
|
||||
.fancybox-slide {
|
||||
padding-left: 6px;
|
||||
padding-right: 6px;
|
||||
}
|
||||
|
||||
.fancybox-slide--image {
|
||||
padding: 6px 0;
|
||||
}
|
||||
|
||||
.fancybox-close-small {
|
||||
right: -6px;
|
||||
}
|
||||
|
||||
.fancybox-slide--image .fancybox-close-small {
|
||||
background: #4e4e4e;
|
||||
color: #f2f4f6;
|
||||
height: 36px;
|
||||
opacity: 1;
|
||||
padding: 6px;
|
||||
right: 0;
|
||||
top: 0;
|
||||
width: 36px;
|
||||
}
|
||||
|
||||
.fancybox-caption {
|
||||
padding-left: 12px;
|
||||
padding-right: 12px;
|
||||
}
|
||||
|
||||
@supports (padding: max(0px)) {
|
||||
.fancybox-caption {
|
||||
padding-left: max(12px, env(safe-area-inset-left));
|
||||
padding-right: max(12px, env(safe-area-inset-right));
|
||||
}
|
||||
}
|
||||
}
|
||||
/* Share */
|
||||
|
||||
.fancybox-share {
|
||||
background: #f4f4f4;
|
||||
border-radius: 3px;
|
||||
max-width: 90%;
|
||||
padding: 30px;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.fancybox-share h1 {
|
||||
color: #222;
|
||||
font-size: 35px;
|
||||
font-weight: 700;
|
||||
margin: 0 0 20px 0;
|
||||
}
|
||||
|
||||
.fancybox-share p {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.fancybox-share__button {
|
||||
border: 0;
|
||||
border-radius: 3px;
|
||||
display: inline-block;
|
||||
font-size: 14px;
|
||||
font-weight: 700;
|
||||
line-height: 40px;
|
||||
margin: 0 5px 10px 5px;
|
||||
min-width: 130px;
|
||||
padding: 0 15px;
|
||||
text-decoration: none;
|
||||
transition: all .2s;
|
||||
-webkit-user-select: none;
|
||||
-moz-user-select: none;
|
||||
-ms-user-select: none;
|
||||
user-select: none;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.fancybox-share__button:visited,
|
||||
.fancybox-share__button:link {
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.fancybox-share__button:hover {
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
.fancybox-share__button--fb {
|
||||
background: #3b5998;
|
||||
}
|
||||
|
||||
.fancybox-share__button--fb:hover {
|
||||
background: #344e86;
|
||||
}
|
||||
|
||||
.fancybox-share__button--pt {
|
||||
background: #bd081d;
|
||||
}
|
||||
|
||||
.fancybox-share__button--pt:hover {
|
||||
background: #aa0719;
|
||||
}
|
||||
|
||||
.fancybox-share__button--tw {
|
||||
background: #1da1f2;
|
||||
}
|
||||
|
||||
.fancybox-share__button--tw:hover {
|
||||
background: #0d95e8;
|
||||
}
|
||||
|
||||
.fancybox-share__button svg {
|
||||
height: 25px;
|
||||
margin-right: 7px;
|
||||
position: relative;
|
||||
top: -1px;
|
||||
vertical-align: middle;
|
||||
width: 25px;
|
||||
}
|
||||
|
||||
.fancybox-share__button svg path {
|
||||
fill: #fff;
|
||||
}
|
||||
|
||||
.fancybox-share__input {
|
||||
background: transparent;
|
||||
border: 0;
|
||||
border-bottom: 1px solid #d7d7d7;
|
||||
border-radius: 0;
|
||||
color: #5d5b5b;
|
||||
font-size: 14px;
|
||||
margin: 10px 0 0 0;
|
||||
outline: none;
|
||||
padding: 10px 15px;
|
||||
width: 100%;
|
||||
}
|
||||
/* Thumbs */
|
||||
|
||||
.fancybox-thumbs {
|
||||
background: #ddd;
|
||||
bottom: 0;
|
||||
display: none;
|
||||
margin: 0;
|
||||
-webkit-overflow-scrolling: touch;
|
||||
-ms-overflow-style: -ms-autohiding-scrollbar;
|
||||
padding: 2px 2px 4px 2px;
|
||||
position: absolute;
|
||||
right: 0;
|
||||
-webkit-tap-highlight-color: rgba(0, 0, 0, 0);
|
||||
top: 0;
|
||||
width: 212px;
|
||||
z-index: 99995;
|
||||
}
|
||||
|
||||
.fancybox-thumbs-x {
|
||||
overflow-x: auto;
|
||||
overflow-y: hidden;
|
||||
}
|
||||
|
||||
.fancybox-show-thumbs .fancybox-thumbs {
|
||||
display: block;
|
||||
}
|
||||
|
||||
.fancybox-show-thumbs .fancybox-inner {
|
||||
right: 212px;
|
||||
}
|
||||
|
||||
.fancybox-thumbs__list {
|
||||
font-size: 0;
|
||||
height: 100%;
|
||||
list-style: none;
|
||||
margin: 0;
|
||||
overflow-x: hidden;
|
||||
overflow-y: auto;
|
||||
padding: 0;
|
||||
position: absolute;
|
||||
position: relative;
|
||||
white-space: nowrap;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.fancybox-thumbs-x .fancybox-thumbs__list {
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.fancybox-thumbs-y .fancybox-thumbs__list::-webkit-scrollbar {
|
||||
width: 7px;
|
||||
}
|
||||
|
||||
.fancybox-thumbs-y .fancybox-thumbs__list::-webkit-scrollbar-track {
|
||||
background: #fff;
|
||||
border-radius: 10px;
|
||||
box-shadow: inset 0 0 6px rgba(0, 0, 0, .3);
|
||||
}
|
||||
|
||||
.fancybox-thumbs-y .fancybox-thumbs__list::-webkit-scrollbar-thumb {
|
||||
background: #2a2a2a;
|
||||
border-radius: 10px;
|
||||
}
|
||||
|
||||
.fancybox-thumbs__list a {
|
||||
-webkit-backface-visibility: hidden;
|
||||
backface-visibility: hidden;
|
||||
background-color: rgba(0, 0, 0, .1);
|
||||
background-position: center center;
|
||||
background-repeat: no-repeat;
|
||||
background-size: cover;
|
||||
cursor: pointer;
|
||||
float: left;
|
||||
height: 75px;
|
||||
margin: 2px;
|
||||
max-height: calc(100% - 8px);
|
||||
max-width: calc(50% - 4px);
|
||||
outline: none;
|
||||
overflow: hidden;
|
||||
padding: 0;
|
||||
position: relative;
|
||||
-webkit-tap-highlight-color: transparent;
|
||||
width: 100px;
|
||||
}
|
||||
|
||||
.fancybox-thumbs__list a::before {
|
||||
border: 6px solid #ff5268;
|
||||
bottom: 0;
|
||||
content: '';
|
||||
left: 0;
|
||||
opacity: 0;
|
||||
position: absolute;
|
||||
right: 0;
|
||||
top: 0;
|
||||
transition: all .2s cubic-bezier(.25, .46, .45, .94);
|
||||
z-index: 99991;
|
||||
}
|
||||
|
||||
.fancybox-thumbs__list a:focus::before {
|
||||
opacity: .5;
|
||||
}
|
||||
|
||||
.fancybox-thumbs__list a.fancybox-thumbs-active::before {
|
||||
opacity: 1;
|
||||
}
|
||||
|
||||
/* Styling for Small-Screen Devices */
|
||||
@media all and (max-width: 576px) {
|
||||
.fancybox-thumbs {
|
||||
width: 110px;
|
||||
}
|
||||
|
||||
.fancybox-show-thumbs .fancybox-inner {
|
||||
right: 110px;
|
||||
}
|
||||
|
||||
.fancybox-thumbs__list a {
|
||||
max-width: calc(100% - 10px);
|
||||
}
|
||||
}
|
5632
view/js/fancybox/jquery.fancybox.js
vendored
Normal file
5632
view/js/fancybox/jquery.fancybox.js
vendored
Normal file
File diff suppressed because it is too large
Load diff
1
view/js/fancybox/jquery.fancybox.min.css
vendored
Normal file
1
view/js/fancybox/jquery.fancybox.min.css
vendored
Normal file
File diff suppressed because one or more lines are too long
13
view/js/fancybox/jquery.fancybox.min.js
vendored
Normal file
13
view/js/fancybox/jquery.fancybox.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
|
@ -1,5 +1,5 @@
|
|||
{{if $image.preview}}
|
||||
<a href="{{$image.attachment.url}}"><img src="{{$image.preview}}" alt="{{$image.attachment.description}}" title="{{$image.attachment.description}}"></a>
|
||||
<a data-fancybox="{{$image.uri_id}}" href="{{$image.attachment.url}}"><img src="{{$image.preview}}" alt="{{$image.attachment.description}}" title="{{$image.attachment.description}}"></a>
|
||||
{{else}}
|
||||
<img src="{{$image.src}}" alt="{{$image.attachment.description}}" title="{{$image.attachment.description}}">
|
||||
{{/if}}
|
||||
|
|
|
@ -7,6 +7,7 @@
|
|||
<link rel="stylesheet" href="view/asset/jgrowl/jquery.jgrowl.min.css?v={{$smarty.const.FRIENDICA_VERSION}}" type="text/css" media="screen" />
|
||||
<link rel="stylesheet" href="view/asset/jquery-datetimepicker/build/jquery.datetimepicker.min.css?v={{$smarty.const.FRIENDICA_VERSION}}" type="text/css" media="screen" />
|
||||
<link rel="stylesheet" href="view/asset/perfect-scrollbar/dist/css/perfect-scrollbar.min.css?v={{$smarty.const.FRIENDICA_VERSION}}" type="text/css" media="screen" />
|
||||
<link rel="stylesheet" href="view/js/fancybox/jquery.fancybox.min.css?v=2023.06-dev" type="text/css" media="screen" />
|
||||
|
||||
{{foreach $stylesheets as $stylesheetUrl => $media}}
|
||||
<link rel="stylesheet" href="{{$stylesheetUrl}}" type="text/css" media="{{$media}}" />
|
||||
|
@ -44,6 +45,8 @@
|
|||
<script type="text/javascript" src="view/asset/imagesloaded/imagesloaded.pkgd.min.js?v={{$smarty.const.FRIENDICA_VERSION}}"></script>
|
||||
<script type="text/javascript" src="view/asset/base64/base64.min.js?v={{$smarty.const.FRIENDICA_VERSION}}"></script>
|
||||
<script type="text/javascript" src="view/asset/dompurify/dist/purify.min.js?v={{$smarty.const.FRIENDICA_VERSION}}"></script>
|
||||
<script type="text/javascript" src="view/js/fancybox/jquery.fancybox.min.js?v=2023.06-dev"></script>
|
||||
<script type="text/javascript" src="view/js/fancybox/fancybox.config.js?v=2023.06-dev"></script>
|
||||
<script type="text/javascript">
|
||||
const updateInterval = {{$update_interval}};
|
||||
const localUser = {{if $local_user}}{{$local_user}}{{else}}false{{/if}};
|
||||
|
|
|
@ -29,33 +29,6 @@ $(document).ready(function () {
|
|||
}
|
||||
});
|
||||
|
||||
// Add Colorbox for viewing Network page images.
|
||||
//var cBoxClasses = new Array();
|
||||
$("body").on("click", ".wall-item-body a img", function () {
|
||||
var aElem = $(this).parent();
|
||||
var imgHref = aElem.attr("href");
|
||||
|
||||
// We need to make sure we only put a Colorbox on links to Friendica images.
|
||||
// We'll try to do this by looking for links of the form
|
||||
// .../photo/ab803d8eg08daf85023adfec08 (with nothing more following), in hopes
|
||||
// that will be unique enough.
|
||||
if (imgHref.match(/\/photo\/[a-fA-F0-9]+(-[0-9]\.[\w]+?)?$/)) {
|
||||
// Add a unique class to all the images of a certain post, to allow scrolling through
|
||||
var cBoxClass = $(this).closest(".wall-item-body").attr("id") + "-lightbox";
|
||||
$(this).addClass(cBoxClass);
|
||||
|
||||
// if( $.inArray(cBoxClass, cBoxClasses) < 0 ) {
|
||||
// cBoxClasses.push(cBoxClass);
|
||||
// }
|
||||
|
||||
aElem.colorbox({
|
||||
maxHeight: "90%",
|
||||
photo: true, // Colorbox doesn't recognize a URL that don't end in .jpg, etc. as a photo.
|
||||
rel: cBoxClass, //$(this).attr("class").match(/wall-item-body-[\d]+-lightbox/)[0].
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
// Navbar login.
|
||||
$("body").on("click", "#nav-login", function (e) {
|
||||
e.preventDefault();
|
||||
|
|
|
@ -49,6 +49,8 @@
|
|||
type="text/css" media="screen" />
|
||||
<link rel="stylesheet" href="view/theme/frio/font/open_sans/open-sans.css?v={{$smarty.const.FRIENDICA_VERSION}}"
|
||||
type="text/css" media="screen" />
|
||||
<link rel="stylesheet" href="view/js/fancybox/jquery.fancybox.min.css?v=2023.06-dev"
|
||||
type="text/css" media="screen" />
|
||||
|
||||
{{* own css files *}}
|
||||
<link rel="stylesheet" href="view/theme/frio/css/hovercard.css?v={{$smarty.const.FRIENDICA_VERSION}}" type="text/css"
|
||||
|
@ -144,6 +146,8 @@
|
|||
<script type="text/javascript" src="vendor/enyo/dropzone/dist/min/dropzone.min.js?v={{$smarty.const.FRIENDICA_VERSION}}"></script>
|
||||
<script type="text/javascript" src="view/js/dropzone-factory.js?v={{$smarty.const.FRIENDICA_VERSION}}"></script>
|
||||
<script type="text/javascript"> const dzFactory = new DzFactory({{$max_imagesize}});</script>
|
||||
<script type="text/javascript" src="view/js/fancybox/jquery.fancybox.min.js?v=2023.06-dev"></script>
|
||||
<script type="text/javascript" src="view/js/fancybox/fancybox.config.js?v=2023.06-dev"></script>
|
||||
|
||||
{{* Include the strings which are needed for some js functions (e.g. translation)
|
||||
They are loaded into the html <head> so that js functions can use them *}}
|
||||
|
|
|
@ -51,7 +51,7 @@ body, section, blockquote, blockquote.shared_content, #profile-jot-form,
|
|||
}
|
||||
|
||||
#profile-jot-acl-wrapper, #event-notice, #event-wrapper,
|
||||
#cboxLoadedContent, .contact-photo-menu, #contact-edit-status-wrapper {
|
||||
.contact-photo-menu, #contact-edit-status-wrapper {
|
||||
background-color: #252C33 !important;
|
||||
}
|
||||
|
||||
|
|
|
@ -227,8 +227,6 @@ aside.show {
|
|||
#profile-jot-acl-wrapper, #profile-jot-acl-wrapper * { box-sizing: border-box; }
|
||||
#acl-wrapper { width: 100%; float: none; }
|
||||
/* flexbox for ACL window */
|
||||
#cboxLoadedContent,
|
||||
#cboxLoadedContent > div,
|
||||
#acl-wrapper {
|
||||
display: -ms-Flexbox !important;
|
||||
-ms-box-orient: vertical;
|
||||
|
|
Loading…
Reference in a new issue