New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

gardr-plugin-host-wallpaper

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

gardr-plugin-host-wallpaper - npm Package Compare versions

Comparing version 0.0.1 to 0.0.2

7

index.js

@@ -9,3 +9,3 @@ var eventlistener = require('eventlistener');

if (item.rendered.wallpaperimage) {
createWallpaperByUrl(item.rendered.wallpaperimage, item.rendered.wallpapercolor);
createWallpaperByUrl(item.rendered.wallpaperimage, item.rendered.wallpapertiling, item.rendered.wallpapercolor);
if (item.rendered.wallpaperclick) {

@@ -20,4 +20,5 @@ listenToBodyClicks(item.rendered.wallpaperclick);

function createWallpaperByUrl (url, color) {
var css = 'url(' + url + ') 0% 0% repeat fixed ' + (color || '');
function createWallpaperByUrl (url, tiling, color) {
var repeat = (tiling === 'yes' || tiling === 'true') ? 'repeat' : 'no-repeat';
var css = 'url(' + url + ') 0% 0% ' + repeat + ' fixed ' + (color || '');
setBodyBackground(css);

@@ -24,0 +25,0 @@ }

@@ -18,5 +18,5 @@ var plugin = require('./index');

it('should put background image on body', function () {
it('should put a no tiling background image on body', function () {
var imageUrl = 'http://www.test.com/fooimage';
var expectedStyle = 'url(' + imageUrl + ') 0% 0% repeat fixed';
var expectedStyle = 'url(' + imageUrl + ') 0% 0% no-repeat fixed';
plugin(pluginApi, {});

@@ -35,2 +35,20 @@

it('should put a tiling background image on body', function () {
var imageUrl = 'http://www.test.com/fooimage';
var tiling = 'yes';
var expectedStyle = 'url(' + imageUrl + ') 0% 0% repeat fixed';
plugin(pluginApi, {});
var options = {
rendered : {
wallpaperimage : imageUrl,
wallpapertiling : tiling
}
};
pluginApi.trigger('item:afterrender', options);
expect(document.body.style.background).to.equal(expectedStyle);
});
it('should set background color on body', function() {

@@ -37,0 +55,0 @@ var color = 'rgb(255, 136, 51)';

{
"name": "gardr-plugin-host-wallpaper",
"version": "0.0.1",
"version": "0.0.2",
"description": "Gardr host plugin receiving a wallpaper url and puts it on the body as a background",

@@ -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