Browse Source

Bugfixes

master
Hedgehog 11 years ago
parent
commit
360b460ba2
  1. BIN
      img/tornado_avatar.png
  2. 2
      js/interface_localization.js
  3. 13
      js/twister_formatpost.js

BIN
img/tornado_avatar.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.3 KiB

2
js/interface_localization.js

@ -1079,7 +1079,7 @@ if(preferredLanguage == "ru"){ @@ -1079,7 +1079,7 @@ if(preferredLanguage == "ru"){
"Favorite": "Избранное",
"File APIs not supported in this browser.": "Ваш браузер не поддерживает File APIs.",
"Follow": "Подписаться",
"Followed by": "Подписчик у",
"Followed by": "Подписан",
"followed_by": "%{username} подписан",
"Followers": "Читателей",
"Following": "Читаемых",

13
js/twister_formatpost.js

@ -109,14 +109,16 @@ function postToElem( post, kind ) { @@ -109,14 +109,16 @@ function postToElem( post, kind ) {
if (postLink && localStorage['imagesPreview'] == 'enable' && (/(\.jpg)|(\.gif)|(\.png)|(\.jpeg)|(\.jpe)/i.test(postLink) || /https:\/\/img.bi/gi.test(postLink))){
previewContainer.show();
previewContainer.append(imagePreview(postLink, t));
previewContainer.append(imagePreview(postLink));
}else if(postLink && ytRegExp.test(postLink) && localStorage['youtubePreview'] === 'enable'){
var ytid = postLink.match(ytRegExp) ? RegExp.$1 : false;
previewContainer.show();
previewContainer.attr('data-youtube-id', ytid);
previewContainer.append(getYoutubePreview(postLink, ytid));
}else if(postLink && vimeoRegExp.test(postLink) && localStorage['vimeoPreview'] === 'enable'){
var vimid = postLink.match(vimeoRegExp) ? RegExp.$2 : false;
previewContainer.show();
previewContainer.attr('data-vimeo-id', vimid);
previewContainer.append(getVimeoPreview(postLink, vimid));
}
@ -342,6 +344,10 @@ function getYoutubePreview(link, ytid) { @@ -342,6 +344,10 @@ function getYoutubePreview(link, ytid) {
};
localStorage['ytData'] = JSON.stringify(ytDataStorage);
vidPreviewTmpl.find('img').attr('src', ytDataStorage[ytid].thumbnail);
vidPreviewTmpl.find('a').text(ytDataStorage[ytid].title).attr('href', link).attr('target', '_blank');
if (ytDataStorage[ytid].description) vidPreviewTmpl.find('p').html(ytDataStorage[ytid].description+'…');
$('[data-youtube-id='+ytid+']').append(vidPreviewTmpl);
}
});
}
@ -369,6 +375,11 @@ function getVimeoPreview (link, vimid) { @@ -369,6 +375,11 @@ function getVimeoPreview (link, vimid) {
time: Date.now()
};
localStorage['vimData'] = JSON.stringify(vimDataStorage);
vidPreviewTmpl.find('img').attr('src', vimDataStorage[vimid].thumbnail);
vidPreviewTmpl.find('a').text(vimDataStorage[vimid].title).attr('href', link).attr('target', '_blank');
if (vimDataStorage[vimid].description) vidPreviewTmpl.find('p').html(vimDataStorage[vimid].description+'…');
$('[data-vimeo-id='+vimid+']').append(vidPreviewTmpl);
}
});
}

Loading…
Cancel
Save