Skip to content
Snippets Groups Projects
Commit 56fd5521 authored by Jared Hancock's avatar Jared Hancock
Browse files

Merge remote branch 'upstream/develop' into develop-next

Conflicts:
	include/client/view.inc.php
	js/osticket.js
parents 184cf25f 49deb1bc
No related branches found
No related tags found
No related merge requests found
...@@ -30,11 +30,12 @@ ...@@ -30,11 +30,12 @@
.non-local-image { .non-local-image {
display: inline-block; display: inline-block;
border: 5px dashed #eee; border: 3px dashed #eee;
border-radius: 5px;
} }
.non-local-image:after { .non-local-image:after {
background: url(../assets/default/images/logo.png) center left no-repeat; background: url(../logo.php) center center no-repeat;
background-size: cover; background-size: cover;
content: ""; content: "";
z-index: -1; z-index: -1;
......
...@@ -292,7 +292,7 @@ class Format { ...@@ -292,7 +292,7 @@ class Format {
function($match) { function($match) {
// Drop embedded classes -- they don't refer to ours // Drop embedded classes -- they don't refer to ours
$match = preg_replace('/class="[^"]*"/', '', $match); $match = preg_replace('/class="[^"]*"/', '', $match);
return sprintf('<div %s class="non-local-image" data-%s %s></div>', return sprintf('<span %s class="non-local-image" data-%s %s></span>',
$match[1], $match[2], $match[3]); $match[1], $match[2], $match[3]);
}, },
$text); $text);
...@@ -371,7 +371,7 @@ class Format { ...@@ -371,7 +371,7 @@ class Format {
} }
// Images which are external are rewritten to <div // Images which are external are rewritten to <div
// data-src='url...'/> // data-src='url...'/>
elseif ($e == 'div' && $a && isset($a['data-src'])) elseif ($e == 'span' && $a && isset($a['data-src']))
$a['data-src'] = 'l.php?url='.urlencode($a['data-src']) $a['data-src'] = 'l.php?url='.urlencode($a['data-src'])
.'&amp;auth='.$token; .'&amp;auth='.$token;
// URLs for videos need to route too // URLs for videos need to route too
...@@ -390,7 +390,7 @@ class Format { ...@@ -390,7 +390,7 @@ class Format {
}, },
'schemes' => 'href: aim, feed, file, ftp, gopher, http, https, irc, mailto, news, nntp, sftp, ssh, telnet; *:file, http, https; src: cid, http, https, data', 'schemes' => 'href: aim, feed, file, ftp, gopher, http, https, irc, mailto, news, nntp, sftp, ssh, telnet; *:file, http, https; src: cid, http, https, data',
'elements' => '*+iframe', 'elements' => '*+iframe',
'spec' => 'div=data-src,width,height', 'spec' => 'span=data-src,width,height',
); );
return Format::html($text, $config); return Format::html($text, $config);
} }
......
...@@ -109,7 +109,12 @@ if($ticket->getThreadCount() && ($thread=$ticket->getClientThread())) { ...@@ -109,7 +109,12 @@ if($ticket->getThreadCount() && ($thread=$ticket->getClientThread())) {
$poster = ' '; $poster = ' ';
?> ?>
<table class="thread-entry <?php echo $threadType[$entry['thread_type']]; ?>" cellspacing="0" cellpadding="1" width="800" border="0"> <table class="thread-entry <?php echo $threadType[$entry['thread_type']]; ?>" cellspacing="0" cellpadding="1" width="800" border="0">
<tr><th><?php echo Format::db_datetime($entry['created']); ?> &nbsp;&nbsp;<span class="textra"></span><span><?php echo $poster; ?></span></th></tr> <tr><th><div>
<?php echo Format::db_datetime($entry['created']); ?>
&nbsp;&nbsp;<span class="textra"></span>
<span><?php echo $poster; ?></span>
</div>
</th></tr>
<tr><td class="thread-body"><div><?php echo $entry['body']->toHtml(); ?></div></td></tr> <tr><td class="thread-body"><div><?php echo $entry['body']->toHtml(); ?></div></td></tr>
<?php <?php
if($entry['attachments'] if($entry['attachments']
......
...@@ -124,39 +124,6 @@ $(document).ready(function(){ ...@@ -124,39 +124,6 @@ $(document).ready(function(){
}); });
return str; return str;
}; };
});
showImagesInline = function(urls, thread_id) {
var selector = (thread_id == undefined)
? '.thread-body img[data-cid]'
: '.thread-body#thread-id-'+thread_id+' img[data-cid]';
$(selector).each(function(i, el) {
var cid = $(el).data('cid').toLowerCase(),
info = urls[cid],
e = $(el);
if (info && !e.data('wrapped')) {
// Add a hover effect with the filename
var timeout, caption = $('<div class="image-hover">')
.css({'float':e.css('float')});
e.wrap(caption).parent()
.hover(
function() {
var self = this;
timeout = setTimeout(
function() { $(self).find('.caption').slideDown(250); },
500);
},
function() {
clearTimeout(timeout);
$(this).find('.caption').slideUp(250);
}
).append($('<div class="caption">')
.append('<span class="filename">'+info.filename+'</span>')
.append('<a href="'+info.download_url+'" class="action-button"><i class="icon-download-alt"></i> Download</a>')
);
e.data('wrapped', true);
}
});
var showNonLocalImage = function(div) { var showNonLocalImage = function(div) {
var $div = $(div), var $div = $(div),
...@@ -175,7 +142,7 @@ showImagesInline = function(urls, thread_id) { ...@@ -175,7 +142,7 @@ showImagesInline = function(urls, thread_id) {
// Optionally show external images // Optionally show external images
$('.thread-entry').each(function(i, te) { $('.thread-entry').each(function(i, te) {
var extra = $(te).find('.textra'), var extra = $(te).find('.textra'),
imgs = $(te).find('div.non-local-image[data-src]'); imgs = $(te).find('.non-local-image[data-src]');
if (!extra) return; if (!extra) return;
if (!imgs.length) return; if (!imgs.length) return;
extra.append($('<a>') extra.append($('<a>')
...@@ -213,4 +180,37 @@ showImagesInline = function(urls, thread_id) { ...@@ -213,4 +180,37 @@ showImagesInline = function(urls, thread_id) {
// TODO: Add a hover-button to show just one image // TODO: Add a hover-button to show just one image
}); });
}); });
});
showImagesInline = function(urls, thread_id) {
var selector = (thread_id == undefined)
? '.thread-body img[data-cid]'
: '.thread-body#thread-id-'+thread_id+' img[data-cid]';
$(selector).each(function(i, el) {
var cid = $(el).data('cid').toLowerCase(),
info = urls[cid],
e = $(el);
if (info && !e.data('wrapped')) {
// Add a hover effect with the filename
var timeout, caption = $('<div class="image-hover">')
.css({'float':e.css('float')});
e.wrap(caption).parent()
.hover(
function() {
var self = this;
timeout = setTimeout(
function() { $(self).find('.caption').slideDown(250); },
500);
},
function() {
clearTimeout(timeout);
$(this).find('.caption').slideUp(250);
}
).append($('<div class="caption">')
.append('<span class="filename">'+info.filename+'</span>')
.append('<a href="'+info.download_url+'" class="action-button"><i class="icon-download-alt"></i> Download</a>')
);
e.data('wrapped', true);
}
});
} }
...@@ -1561,15 +1561,20 @@ ul.progress li.no small {color:red;} ...@@ -1561,15 +1561,20 @@ ul.progress li.no small {color:red;}
#loading h1, #upgrading h4 { margin: 3px 0 0 0; padding: 0; color: #d80; } #loading h1, #upgrading h4 { margin: 3px 0 0 0; padding: 0; color: #d80; }
#loading, #upgrading { color: white; } #loading, #upgrading { color: white; }
.non-local-image {
display: inline-block;
border: 3px dashed #eee;
border-radius: 5px;
}
.non-local-image:after { .non-local-image:after {
background: url(../images/ost-logo.png) center center no-repeat; background: url(../../logo.php) center center no-repeat;
background-size: cover; background-size: cover;
content: ""; content: "";
z-index: -1; z-index: -1;
width: 100%; width: 100%;
height: 100%; height: 100%;
display: block;
opacity: 0.3; opacity: 0.3;
display: block;
} }
input[type=text]:disabled, input[type=checkbox]:disabled { input[type=text]:disabled, input[type=checkbox]:disabled {
......
...@@ -404,7 +404,7 @@ var ticket_onload = function($) { ...@@ -404,7 +404,7 @@ var ticket_onload = function($) {
// Optionally show external images // Optionally show external images
$('.thread-entry').each(function(i, te) { $('.thread-entry').each(function(i, te) {
var extra = $(te).find('.textra'), var extra = $(te).find('.textra'),
imgs = $(te).find('div.non-local-image[data-src]'); imgs = $(te).find('.non-local-image[data-src]');
if (!extra) return; if (!extra) return;
if (!imgs.length) return; if (!imgs.length) return;
extra.append($('<a>') extra.append($('<a>')
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment