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

@movable/behavioral-app

Package Overview
Dependencies
Maintainers
8
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@movable/behavioral-app - npm Package Compare versions

Comparing version 1.0.7 to 1.1.0

34

files/app/js/index.js

@@ -60,2 +60,3 @@ import CD from "cropduster";

this.options.item = item;
// Be sure to update extraData as necessary, if adding logic to modify the items returned by watson
this.options.extraData = extraData;

@@ -70,8 +71,5 @@

render() {
// Additional business logic, like sorting or filtering, can be added as a new Promise
this.verifyOptions()
.then(() => this.getItemsByType())
.then(payload => this.makeCall(payload))
.then(raw => {
parseData(raw) {
return new Promise((resolve, reject) => {
try {
let { data, status, contentType, response } = raw; // eslint-disable-line

@@ -87,9 +85,24 @@

const $doc = $(data);
// Rendering code goes here
const imageUrl = $doc.find('').eq(0).attr('data-src');
// Cropping code goes here
const tagContent = {
mi_item_title: $doc.find('').text().trim(),
mi_item_price: $doc.find('').text().trim()
mi_item_price: $doc.find('').text().trim(),
imageUrl: $doc.find('').eq(0).attr('data-src')
};
resolve(tagContent);
} catch (error) {
reject(error);
}
});
}
render() {
// Additional business logic, like sorting or filtering, can be added as a new Promise
this.verifyOptions()
.then(() => this.getItemsByType())
.then(payload => this.makeCall(payload))
.then(raw => this.parseData(raw))
.then(tagContent => {
CD.setExtraData(this.options.extraData);

@@ -99,6 +112,7 @@ CD.setClickthrough(this.options.item.u);

$('.itemImage img').attr('src', imageUrl);
$('.itemImage img').attr('src', tagContent.imageUrl);
this.autoresizeTags();
this.waitForImageAssets();
window.APP_SUCCESSFULLY_RENDERED = true;

@@ -105,0 +119,0 @@ })

{
"name": "@movable/behavioral-app",
"version": "1.0.7",
"version": "1.1.0",
"description": "Movable CLI blueprint for initializing a new behavioral application.",

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

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