makes thumbnails show again

This commit is contained in:
Hannes Mannerheim 2014-11-27 23:29:58 +01:00
parent 80a79de484
commit 8a72b24ea2
2 changed files with 21 additions and 6 deletions

View File

@ -113,7 +113,7 @@ class QvitterAction extends ApiAction
if(preg_match("/^[a-zA-Z0-9]+$/", $nickname) == 1) {
$user = User::getKV('nickname', $nickname);
if(!isset($user->id)) {
error_log("QVITTER: Could not get user id for user with nickname: $nickname REQUEST_URI: ".$_SERVER['REQUEST_URI']);
//error_log("QVITTER: Could not get user id for user with nickname: $nickname REQUEST_URI: ".$_SERVER['REQUEST_URI']);
}
else {
print '<link title="Notice feed for '.$nickname.' (Activity Streams JSON)" type="application/stream+json" href="'.$instanceurl.'api/statuses/user_timeline/'.$user->id.'.as" rel="alternate">'."\n";
@ -154,6 +154,18 @@ class QvitterAction extends ApiAction
window.defaultAvatarStreamSize = <?php print json_encode(Avatar::defaultImage(AVATAR_STREAM_SIZE)) ?>;
window.textLimit = <?php print json_encode((int)common_config('site','textlimit')) ?>;
window.registrationsClosed = <?php print json_encode($registrationsclosed) ?>;
window.thisSiteThinksItIsHttpButIsActuallyHttps = <?php
if(isset($_SERVER['HTTPS'])
&& $_SERVER['HTTPS'] != 'off'
&& substr($instanceurl,0,7) == 'http://') {
print 'true';
}
else {
print 'false';
}
?>;
window.siteTitle = <?php print json_encode($sitetitle) ?>;
window.loggedIn = <?php

View File

@ -2470,8 +2470,11 @@ function uploadImage(e, thisUploadButton) {
var queetBox = $('img.to-upload').parent().siblings('.queet-box-syntax');
var caretPos = uploadButton.attr('data-caret-pos').split(',');
// remove http and https (not needed, just design choice)
data.shorturl = data.shorturl.replace('http://','').replace('https://','');
// if this site is like quitter.se, we have to do this, otherwise
// gnusocial will not recognize the link to the image as a local attachment
if(window.thisSiteThinksItIsHttpButIsActuallyHttps) {
data.shorturl = data.shorturl.replace('https://','http://');
}
$('img.to-upload').attr('data-shorturl', data.shorturl);
$('img.to-upload').addClass('uploaded');