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

@epages/beyond_canvas

Package Overview
Dependencies
Maintainers
4
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@epages/beyond_canvas - npm Package Compare versions

Comparing version 0.2.1-pre to 0.2.2-pre

src/initializers/functions.js

345

app/assets/javascripts/beyond_canvas/base.js

@@ -1,106 +0,255 @@

/*
* Warning: This file is auto-generated, do not modify. Instead, make your changes in 'app/javascript/beyond_canvas/' and run `yarn build`
/*!
*
* Warning: This file is auto-generated, do not modify. Instead, make your changes in 'app/javascript/beyond_canvas/' and run `yarn build`
*
* //= require jquery3
* //= require_self
*
*/
//= require jquery3
//= require_self
(function(e, a) { for(var i in a) e[i] = a[i]; }(window, /******/ (function(modules) { // webpackBootstrap
/******/ // The module cache
/******/ var installedModules = {};
/******/
/******/ // The require function
/******/ function __webpack_require__(moduleId) {
/******/
/******/ // Check if module is in cache
/******/ if(installedModules[moduleId]) {
/******/ return installedModules[moduleId].exports;
/******/ }
/******/ // Create a new module (and put it into the cache)
/******/ var module = installedModules[moduleId] = {
/******/ i: moduleId,
/******/ l: false,
/******/ exports: {}
/******/ };
/******/
/******/ // Execute the module function
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
/******/
/******/ // Flag the module as loaded
/******/ module.l = true;
/******/
/******/ // Return the exports of the module
/******/ return module.exports;
/******/ }
/******/
/******/
/******/ // expose the modules object (__webpack_modules__)
/******/ __webpack_require__.m = modules;
/******/
/******/ // expose the module cache
/******/ __webpack_require__.c = installedModules;
/******/
/******/ // define getter function for harmony exports
/******/ __webpack_require__.d = function(exports, name, getter) {
/******/ if(!__webpack_require__.o(exports, name)) {
/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter });
/******/ }
/******/ };
/******/
/******/ // define __esModule on exports
/******/ __webpack_require__.r = function(exports) {
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
/******/ }
/******/ Object.defineProperty(exports, '__esModule', { value: true });
/******/ };
/******/
/******/ // create a fake namespace object
/******/ // mode & 1: value is a module id, require it
/******/ // mode & 2: merge all properties of value into the ns
/******/ // mode & 4: return value when already ns object
/******/ // mode & 8|1: behave like require
/******/ __webpack_require__.t = function(value, mode) {
/******/ if(mode & 1) value = __webpack_require__(value);
/******/ if(mode & 8) return value;
/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
/******/ var ns = Object.create(null);
/******/ __webpack_require__.r(ns);
/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value });
/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
/******/ return ns;
/******/ };
/******/
/******/ // getDefaultExport function for compatibility with non-harmony modules
/******/ __webpack_require__.n = function(module) {
/******/ var getter = module && module.__esModule ?
/******/ function getDefault() { return module['default']; } :
/******/ function getModuleExports() { return module; };
/******/ __webpack_require__.d(getter, 'a', getter);
/******/ return getter;
/******/ };
/******/
/******/ // Object.prototype.hasOwnProperty.call
/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
/******/
/******/ // __webpack_public_path__
/******/ __webpack_require__.p = "";
/******/
/******/
/******/ // Load entry module and return exports
/******/ return __webpack_require__(__webpack_require__.s = 1);
/******/ })
/************************************************************************/
/******/ ([
/* 0 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
(function(factory) {
typeof define === "function" && define.amd ? define([ "jquery" ], factory) : factory();
})(function() {
"use strict";
var SPINNER_ANIMATION_TIMEOUT = 125;
(function($) {
var onDOMReady = function onDOMReady() {
var inputs = $("input, textarea, select").not(":input[type=button], :input[type=submit], :input[type=reset]");
inputs.each(function() {
var input = $(this);
input.bind("invalid", function(e) {
if ($(input).is(":hidden")) {
e.preventDefault();
}
$('button[class^="button"]').each(function() {
hideSpinner($(this));
});
enableActionElements();
});
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "showSpinner", function() { return showSpinner; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "hideSpinner", function() { return hideSpinner; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "disableActionElements", function() { return disableActionElements; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "enableActionElements", function() { return enableActionElements; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "closeAlert", function() { return closeAlert; });
var SPINNER_ANIMATION_TIMEOUT = 125;
function showSpinner(button) {
// Adjust the width of the button
button.width(button.width() + $('.spinner').outerWidth(true)); // Show the spinner
setTimeout(function () {
button.find('.spinner').css('display', 'flex');
}, SPINNER_ANIMATION_TIMEOUT);
}
function hideSpinner() {
$('button[class^="button"]').each(function (_, button) {
setTimeout(function () {
// Hide the spinner
$(button).find('.spinner').hide(); // Adjust the width of the button
$(button).width($(button).data('oldWidth'));
}, SPINNER_ANIMATION_TIMEOUT);
});
}
function disableActionElements() {
$('a, input[type="submit"], input[type="button"], input[type="reset"], button').each(function (_, button) {
$(button).addClass('actions--disabled');
});
}
function enableActionElements() {
$('a, input[type="submit"], input[type="button"], input[type="reset"], button').each(function (_, button) {
$(button).removeClass('actions--disabled');
});
}
function closeAlert() {
$('.flash').removeClass('flash--shown').delay(700).queue(function () {
$(this).remove();
});
}
/***/ }),
/* 1 */
/***/ (function(module, exports, __webpack_require__) {
__webpack_require__(3);
module.exports = __webpack_require__(0);
/***/ }),
/* 2 */
/***/ (function(module, exports) {
(function ($) {
var onDOMReady = function onDOMReady() {
$('input[type="file"]').each(function () {
var $input = $(this),
$label = $(".input__file__text." + $input.attr('id')),
labelVal = $label.html();
$input.on('change', function (e) {
var fileName = '';
if (this.files && this.files.length > 1) fileName = (this.getAttribute('data-multiple-caption') || '').replace('{count}', this.files.length);else if (e.target.value) fileName = e.target.value.split('\\').pop();
if (fileName) $label.html("<svg class=\"input__file__icon\" xmlns=\"http://www.w3.org/2000/svg\" width=\"24\" height=\"24\" viewBox=\"0 0 24 24\"><path d=\"M15 2v5h5v15h-16v-20h11zm1-2h-14v24h20v-18l-6-6z\"/></svg>" + fileName);else $label.html(labelVal);
}); // Firefox bug fix
$input.on('focus', function () {
$input.addClass('has-focus');
}).on('blur', function () {
$input.removeClass('has-focus');
});
$('button[class^="button"]').each(function() {
var button = $(this);
button.width(button.width());
button.data("oldWidth", button.width());
button.prepend('\n <div class="spinner">\n <div class="bounce1"></div>\n <div class="bounce2"></div>\n <div class="bounce3"></div>\n </div>');
button.closest("form").on("ajax:success", function() {
hideSpinner(button);
enableActionElements();
}).on("ajax:error", function() {
hideSpinner(button);
enableActionElements();
});
});
};
$(document).on('ready page:load turbolinks:load', onDOMReady);
})(jQuery);
/***/ }),
/* 3 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
// ESM COMPAT FLAG
__webpack_require__.r(__webpack_exports__);
// EXTERNAL MODULE: ./app/javascript/beyond_canvas/initializers/functions.js
var functions = __webpack_require__(0);
// CONCATENATED MODULE: ./app/javascript/beyond_canvas/initializers/buttons.js
(function ($) {
var onDOMReady = function onDOMReady() {
var inputs = $('input, textarea, select').not(':input[type=button], :input[type=submit], :input[type=reset]');
inputs.each(function () {
var input = $(this);
input.bind('invalid', function (e) {
if ($(input).is(':hidden')) {
e.preventDefault();
}
Object(functions["hideSpinner"])();
Object(functions["enableActionElements"])();
});
};
$(document).on("click", '[class^="button"]', function() {
disableActionElements();
showSpinner($(this));
});
$(document).on("ready page:load turbolinks:load", onDOMReady);
})(jQuery);
function showSpinner(button) {
button.width(button.width() + $(".spinner").outerWidth(true));
setTimeout(function() {
button.find(".spinner").css("display", "flex");
}, SPINNER_ANIMATION_TIMEOUT);
}
function hideSpinner(button) {
setTimeout(function() {
button.find(".spinner").hide();
button.width(button.data("oldWidth"));
}, SPINNER_ANIMATION_TIMEOUT);
}
function disableActionElements() {
$('a, input[type="submit"], input[type="button"], input[type="reset"], button').each(function() {
$(this).addClass("actions--disabled");
});
}
function enableActionElements() {
$('a, input[type="submit"], input[type="button"], input[type="reset"], button').each(function() {
$(this).removeClass("actions--disabled");
});
}
(function($) {
var onDOMReady = function onDOMReady() {
$(".flash").each(function() {
$(this).css("right", -$(this).width() + "px");
$('button[class^="button"]').each(function () {
var button = $(this); // Add width attribute and save old width
button.width(button.width());
button.data('oldWidth', button.width()); // Add the spinner
button.prepend("\n <div class=\"spinner\">\n <div class=\"bounce1\"></div>\n <div class=\"bounce2\"></div>\n <div class=\"bounce3\"></div>\n </div>"); // Bind ajax:success and ajax:error to the form the button belongs to
button.closest('form').on('ajax:success', function () {
Object(functions["hideSpinner"])();
Object(functions["enableActionElements"])();
}).on('ajax:error', function () {
Object(functions["hideSpinner"])();
Object(functions["enableActionElements"])();
});
setTimeout(function() {
$(".flash").addClass("flash--shown");
}, 100);
};
$(document).on("click", ".flash", function() {
closeAlert();
});
$(document).on("ready page:load turbolinks:load", onDOMReady);
})(jQuery);
function closeAlert() {
$(".flash").removeClass("flash--shown").delay(700).queue(function() {
$(this).remove();
};
$(document).on('click', '[class^="button"]', function () {
Object(functions["disableActionElements"])();
Object(functions["showSpinner"])($(this));
});
$(document).on('ready page:load turbolinks:load', onDOMReady);
})(jQuery);
// CONCATENATED MODULE: ./app/javascript/beyond_canvas/initializers/flash.js
(function ($) {
var onDOMReady = function onDOMReady() {
$('.flash').each(function () {
$(this).css('right', -$(this).width() + 'px');
});
}
(function($) {
var onDOMReady = function onDOMReady() {
$('input[type="file"]').each(function() {
var $input = $(this), $label = $(".input__file__text." + $input.attr("id")), labelVal = $label.html();
$input.on("change", function(e) {
var fileName = "";
if (this.files && this.files.length > 1) fileName = (this.getAttribute("data-multiple-caption") || "").replace("{count}", this.files.length); else if (e.target.value) fileName = e.target.value.split("\\").pop();
if (fileName) $label.html('<svg class="input__file__icon" xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path d="M15 2v5h5v15h-16v-20h11zm1-2h-14v24h20v-18l-6-6z"/></svg>' + fileName); else $label.html(labelVal);
});
$input.on("focus", function() {
$input.addClass("has-focus");
}).on("blur", function() {
$input.removeClass("has-focus");
});
});
};
$(document).on("ready page:load turbolinks:load", onDOMReady);
})(jQuery);
});
setTimeout(function () {
$('.flash').addClass('flash--shown');
}, 100);
};
$(document).on('click', '.flash', function () {
Object(functions["closeAlert"])();
});
$(document).on('ready page:load turbolinks:load', onDOMReady);
})(jQuery);
// EXTERNAL MODULE: ./app/javascript/beyond_canvas/initializers/inputs.js
var initializers_inputs = __webpack_require__(2);
// CONCATENATED MODULE: ./app/javascript/beyond_canvas/base.js
/***/ })
/******/ ])));

@@ -0,1 +1,6 @@

### v0.15.2.pre
* bug-fixes
* Make `showSpinner` `hideSpinner` `disableActionElements` `enableActionElements` `closeAlert` functions public
### v0.15.1.pre

@@ -2,0 +7,0 @@

{
"name": "@epages/beyond_canvas",
"version": "0.2.1-pre",
"version": "0.2.2-pre",
"description": "Open-source framework that provides CSS and JS for apps designed and developed for the online shop software Beyond",

@@ -33,3 +33,3 @@ "keywords": [

"scripts": {
"build": "rollup --config rollup.config.js",
"build": "webpack",
"prepublishOnly": "rm -rf src && cp -R app/javascript/beyond_canvas src && cp -R app/assets/stylesheets/beyond_canvas src/scss",

@@ -43,7 +43,5 @@ "eslint": "eslint ./app/javascript/beyond_canvas"

"devDependencies": {
"@babel/core": "^7.6.2",
"@babel/preset-env": "^7.6.2",
"@rollup/plugin-babel": "^5.0.0",
"@rollup/plugin-commonjs": "^11.1.0",
"@rollup/plugin-node-resolve": "^7.1.3",
"@babel/core": "^7.10.2",
"@babel/preset-env": "^7.10.2",
"babel-loader": "^8.1.0",
"common-tags": "^1.8.0",

@@ -55,5 +53,5 @@ "eslint": "^7.1.0",

"eslint-plugin-standard": "^4.0.1",
"rollup": "^1.21.4",
"rollup-plugin-uglify": "^6.0.4"
"webpack": "^4.43.0",
"webpack-cli": "^3.3.11"
}
}

@@ -1,5 +0,3 @@

import 'jquery';
import './initializers/buttons';
import './initializers/flash';
import './initializers/inputs';

@@ -1,4 +0,4 @@

const SPINNER_ANIMATION_TIMEOUT = 125;
import { disableActionElements, enableActionElements, hideSpinner, showSpinner } from './functions';
(function($) {
(function ($) {
const onDOMReady = function () {

@@ -14,5 +14,3 @@ const inputs = $('input, textarea, select').not(':input[type=button], :input[type=submit], :input[type=reset]');

}
$('button[class^="button"]').each(function () {
hideSpinner($(this));
});
hideSpinner();
enableActionElements();

@@ -35,4 +33,3 @@ });

<div class="bounce3"></div>
</div>`
);
</div>`);

@@ -43,7 +40,7 @@ // Bind ajax:success and ajax:error to the form the button belongs to

.on('ajax:success', function () {
hideSpinner(button);
hideSpinner();
enableActionElements();
})
.on('ajax:error', function () {
hideSpinner(button);
hideSpinner();
enableActionElements();

@@ -59,33 +56,3 @@ });

$(document)
.on('ready page:load turbolinks:load', onDOMReady);
$(document).on('ready page:load turbolinks:load', onDOMReady);
})(jQuery);
function showSpinner(button) {
// Adjust the width of the button
button.width(button.width() + $('.spinner').outerWidth(true));
// Show the spinner
setTimeout(function() {
button.find('.spinner').css('display', 'flex');
}, SPINNER_ANIMATION_TIMEOUT);
}
function hideSpinner(button) {
setTimeout(function () {
// Hide the spinner
button.find('.spinner').hide();
// Adjust the width of the button
button.width(button.data('oldWidth'));
}, SPINNER_ANIMATION_TIMEOUT);
}
function disableActionElements() {
$('a, input[type="submit"], input[type="button"], input[type="reset"], button').each(function() {
$(this).addClass('actions--disabled');
});
}
function enableActionElements() {
$('a, input[type="submit"], input[type="button"], input[type="reset"], button').each(function() {
$(this).removeClass('actions--disabled');
});
}

@@ -1,2 +0,4 @@

(function($) {
import { closeAlert } from './functions';
(function ($) {
const onDOMReady = function () {

@@ -12,17 +14,7 @@ $('.flash').each(function () {

$(document).on('click', '.flash', function() {
$(document).on('click', '.flash', function () {
closeAlert();
});
$(document)
.on('ready page:load turbolinks:load', onDOMReady);
$(document).on('ready page:load turbolinks:load', onDOMReady);
})(jQuery);
function closeAlert() {
$('.flash')
.removeClass('flash--shown')
.delay(700)
.queue(function() {
$(this).remove();
});
}

@@ -1,2 +0,2 @@

(function($) {
(function ($) {
const onDOMReady = function () {

@@ -12,6 +12,3 @@ $('input[type="file"]').each(function () {

if (this.files && this.files.length > 1)
fileName = (this.getAttribute('data-multiple-caption') || '').replace(
'{count}',
this.files.length
);
fileName = (this.getAttribute('data-multiple-caption') || '').replace('{count}', this.files.length);
else if (e.target.value) fileName = e.target.value.split('\\').pop();

@@ -37,4 +34,3 @@

$(document)
.on('ready page:load turbolinks:load', onDOMReady);
$(document).on('ready page:load turbolinks:load', onDOMReady);
})(jQuery);
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