Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

talk-message-forms

Package Overview
Dependencies
Maintainers
1
Versions
59
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

talk-message-forms - npm Package Compare versions

Comparing version 0.0.8 to 0.0.9

26

lib/default/image.js

@@ -68,20 +68,24 @@ (function() {

render: function() {
var height, imageHeight, imageWidth, maxWidth, reg, src, style, thumbnailUrl, width;
var boundary, imageHeight, imageWidth, previewHeight, previewWidth, reg, src, style, thumbnailUrl;
if (!this.props.attachment.data.thumbnailUrl.length) {
return;
}
thumbnailUrl = this.props.attachment.data.thumbnailUrl;
imageHeight = this.props.attachment.data.imageHeight;
imageWidth = this.props.attachment.data.imageWidth;
maxWidth = 240;
if (imageWidth > maxWidth) {
height = Math.round(imageHeight / (imageWidth / maxWidth));
width = maxWidth;
thumbnailUrl = this.props.attachment.data.thumbnailUrl;
boundary = 240;
reg = /(\/h\/\d+)|(\/w\/\d+)/g;
if (imageWidth > boundary) {
previewHeight = Math.round(imageHeight / (imageWidth / boundary));
previewWidth = boundary;
} else {
height = imageHeight;
width = imageWidth;
previewHeight = imageHeight;
previewWidth = imageWidth;
}
reg = /(h\/\d+)|(w\/\d+)/g;
if (previewHeight > boundary) {
previewWidth = Math.round(previewWidth / (previewHeight / boundary));
previewHeight = boundary;
}
if (reg.test(thumbnailUrl)) {
src = thumbnailUrl.replace('h/200', "h/" + height).replace('w/200', "w/" + width);
src = thumbnailUrl.replace(/(\/h\/\d+)/g, "/h/" + previewHeight).replace(/(\/w\/\d+)/g, "/w/" + previewWidth);
} else {

@@ -91,3 +95,3 @@ src = thumbnailUrl;

style = {
height: height
height: previewHeight
};

@@ -94,0 +98,0 @@ return div({

{
"name": "talk-message-forms",
"version": "0.0.8",
"version": "0.0.9",
"description": "The Message Structure and Layout of jianliao.com",

@@ -5,0 +5,0 @@ "main": "lib/index.js",

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc