basicplaceholder
Advanced tools
Comparing version 1.2.0 to 1.3.0
{ | ||
"name": "basicPlaceholder", | ||
"version": "1.2.0", | ||
"version": "1.3.0", | ||
"authors": [ | ||
"Tobias Reich <tobias.reich.ich@gmail.com>" | ||
"Tobias Reich <tobias@electerious.com>" | ||
], | ||
@@ -7,0 +7,0 @@ "description": "Easy-to-use persistent placeholders for input fields", |
@@ -1,1 +0,1 @@ | ||
"use strict";!function(e,t){"undefined"!=typeof module&&module.exports?module.exports=t():"function"==typeof define&&define.amd?define(t):window[e]=t()}("basicPlaceholder",function(){var e=null,t=null,r=function(){var r=void 0===arguments[0]?[]:arguments[0],a=void 0===arguments[1]?{}:arguments[1];e=a.errorText||"Invalid",t=a.warningText||"Invalid";for(var n=0;n<r.length;++n){var l=r[n];i(l),l.onclick=u,l.onkeyup=u}return!0},a=function(e){var t=e.getAttribute("data-basicPlaceholder-error");return null!==t&&"false"!==t?!0:!1},n=function(e){var t=e.getAttribute("data-basicPlaceholder-warning");return null!==t&&"false"!==t?!0:!1},l=function(e){var t=e.getAttribute("data-basicPlaceholder-persistent");return null!==t&&"false"!==t?!0:!1},u=function(){var e=this,t=a(e),r=n(e);t===!0&&o(e),r===!0&&o(e),e.value.length>0?i(e):o(e)},i=function(r){var u=null,i=r.getAttribute("data-basicPlaceholder-text"),o=r.parentElement,d=a(r),s=n(r),b=l(r),v=null;return 0===r.value.length&&b===!1&&d===!1&&s===!1?!1:"true"===r.getAttribute("data-basicPlaceholder")?!1:(u=d===!0?e:s===!0?t:r.getAttribute("placeholder")||null,null!==i&&i.length>0&&(u=i),null===u?!1:(v=c(u),o.insertAdjacentHTML("beforeend",v),r.setAttribute("data-basicPlaceholder",!0),!0))},o=function(e){var t=e.parentElement,r=t.querySelector(".basicPlaceholder__placeholder"),a=l(e);return a===!0?!1:null===r?!1:(r.parentNode.removeChild(r),e.removeAttribute("data-basicPlaceholder-error"),e.removeAttribute("data-basicPlaceholder-warning"),e.removeAttribute("data-basicPlaceholder"),!0)},c=function(){var e=void 0===arguments[0]?"":arguments[0];return'<div class="basicPlaceholder__placeholder">'+e+"</a>"};return{init:r}}); | ||
!function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var t;t="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,t.basicPlaceholder=e()}}(function(){return function e(t,r,n){function a(u,i){if(!r[u]){if(!t[u]){var o="function"==typeof require&&require;if(!i&&o)return o(u,!0);if(l)return l(u,!0);var d=new Error("Cannot find module '"+u+"'");throw d.code="MODULE_NOT_FOUND",d}var c=r[u]={exports:{}};t[u][0].call(c.exports,function(e){var r=t[u][1][e];return a(r?r:e)},c,c.exports,e,t,r,n)}return r[u].exports}for(var l="function"==typeof require&&require,u=0;u<n.length;u++)a(n[u]);return a}({1:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=null,a=null,l=(r.init=function(){var e=arguments.length<=0||void 0===arguments[0]?[]:arguments[0],t=arguments.length<=1||void 0===arguments[1]?{}:arguments[1];n=t.errorText||"Invalid",a=t.warningText||"Invalid";for(var r=0;r<e.length;++r){var l=e[r];d(l),l.oninput=o}return!0},function(e){var t=e.getAttribute("data-basicPlaceholder-error");return null!==t&&"false"!==t?!0:!1}),u=function(e){var t=e.getAttribute("data-basicPlaceholder-warning");return null!==t&&"false"!==t?!0:!1},i=function(e){var t=e.getAttribute("data-basicPlaceholder-persistent");return null!==t&&"false"!==t?!0:!1},o=function(){var e=this,t=l(e),r=u(e);t===!0&&c(e),r===!0&&c(e),e.value.length>0?d(e):c(e)},d=function(e){var t=null,r=e.getAttribute("data-basicPlaceholder-text"),o=e.parentElement,d=l(e),c=u(e),s=i(e),v=null;return 0===e.value.length&&s===!1&&d===!1&&c===!1?!1:"true"===e.getAttribute("data-basicPlaceholder")?!1:(t=d===!0?n:c===!0?a:e.getAttribute("placeholder")||null,null!==r&&r.length>0&&(t=r),null===t?!1:(v=f(t),o.insertAdjacentHTML("beforeend",v),e.setAttribute("data-basicPlaceholder",!0),!0))},c=function(e){var t=e.parentElement,r=t.querySelector(".basicPlaceholder__placeholder"),n=i(e);return n===!0?!1:null===r?!1:(r.parentElement.removeChild(r),e.removeAttribute("data-basicPlaceholder-error"),e.removeAttribute("data-basicPlaceholder-warning"),e.removeAttribute("data-basicPlaceholder"),!0)},f=function(){var e=arguments.length<=0||void 0===arguments[0]?"":arguments[0];return'<div class="basicPlaceholder__placeholder">'+e+"</a>"}},{}]},{},[1])(1)}); |
@@ -1,10 +0,12 @@ | ||
var name = require('./package.json').moduleName, | ||
fs = require('fs'), | ||
gulp = require('gulp'), | ||
plugins = require('gulp-load-plugins')() | ||
'use strict' | ||
var head = fs.readFileSync('./node_modules/@electerious/modulizer/head.js', { encoding: 'utf8' }), | ||
foot = fs.readFileSync('./node_modules/@electerious/modulizer/foot.js', { encoding: 'utf8' }) | ||
let name = require('./package.json').moduleName, | ||
gulp = require('gulp'), | ||
browserify = require('browserify'), | ||
babelify = require('babelify'), | ||
source = require('vinyl-source-stream'), | ||
buffer = require('vinyl-buffer'), | ||
plugins = require('gulp-load-plugins')() | ||
var catchError = function(err) { | ||
const catchError = function(err) { | ||
@@ -16,33 +18,46 @@ console.log(err.toString()) | ||
gulp.task('styles', function() { | ||
const scripts = function() { | ||
gulp.src('./src/styles/main.scss') | ||
.pipe(plugins.sass()) | ||
.pipe(plugins.concat(name + '.min.css', { newLine: "\n" })) | ||
.pipe(plugins.autoprefixer('last 2 version', '> 1%')) | ||
.pipe(plugins.minifyCss()) | ||
let bify = browserify({ | ||
entries : './src/scripts/main.js', | ||
standalone : name | ||
}) | ||
let transformer = babelify.configure({ | ||
presets: ['es2015'] | ||
}) | ||
bify.transform(transformer) | ||
.bundle() | ||
.on('error', catchError) | ||
.pipe(source(name + '.min.js')) | ||
.pipe(buffer()) | ||
.pipe(plugins.uglify()) | ||
.on('error', catchError) | ||
.pipe(gulp.dest('./dist')) | ||
}) | ||
} | ||
gulp.task('scripts', function() { | ||
const styles = function() { | ||
gulp.src('./src/scripts/*.js') | ||
.pipe(plugins.header(head, { name: name })) | ||
.pipe(plugins.footer(foot)) | ||
.pipe(plugins.babel()) | ||
.pipe(plugins.concat(name + '.min.js', { newLine: "\n" })) | ||
.pipe(plugins.uglify()) | ||
gulp.src('./src/styles/main.scss') | ||
.pipe(plugins.sass()) | ||
.on('error', catchError) | ||
.pipe(plugins.rename((path) => path.basename = name + '.min')) | ||
.pipe(plugins.autoprefixer('last 2 version', '> 1%')) | ||
.pipe(plugins.minifyCss()) | ||
.pipe(gulp.dest('./dist')) | ||
}) | ||
} | ||
gulp.task('default', ['styles', 'scripts']) | ||
const watch = function() { | ||
gulp.task('watch', ['styles', 'scripts'], function() { | ||
gulp.watch('./src/styles/**/*.scss', ['styles']) | ||
gulp.watch('./src/scripts/**/*.js', ['scripts']) | ||
gulp.watch('./src/styles/*.scss', ['styles']) | ||
gulp.watch('./src/scripts/*.js', ['scripts']) | ||
} | ||
}) | ||
gulp.task('scripts', scripts) | ||
gulp.task('styles', styles) | ||
gulp.task('default', ['scripts', 'styles']) | ||
gulp.task('watch', ['default'], watch) |
{ | ||
"name": "basicplaceholder", | ||
"moduleName": "basicPlaceholder", | ||
"version": "1.2.0", | ||
"version": "1.3.0", | ||
"authors": [ | ||
"Tobias Reich <tobias.reich.ich@gmail.com>" | ||
"Tobias Reich <tobias@electerious.com>" | ||
], | ||
@@ -31,15 +31,15 @@ "description": "Easy-to-use persistent placeholders for input fields", | ||
"devDependencies": { | ||
"@electerious/modulizer": "^1.0.1", | ||
"babel-preset-es2015": "^6.1.2", | ||
"babelify": "^7.2.0", | ||
"browserify": "^12.0.1", | ||
"gulp": "^3.9.0", | ||
"gulp-autoprefixer": "2.3.1", | ||
"gulp-babel": "^5.1.0", | ||
"gulp-concat": "^2.5.2", | ||
"gulp-footer": "^1.0.5", | ||
"gulp-header": "^1.2.2", | ||
"gulp-load-plugins": "^1.0.0-rc", | ||
"gulp-minify-css": "^1.1.6", | ||
"gulp-sass": "^2.0.1", | ||
"gulp-uglify": "^1.2.0", | ||
"gulp-util": "^3.0.5" | ||
"gulp-autoprefixer": "3.1.0", | ||
"gulp-load-plugins": "^1.1.0", | ||
"gulp-minify-css": "^1.2.1", | ||
"gulp-rename": "^1.2.2", | ||
"gulp-sass": "^2.1.0", | ||
"gulp-uglify": "^1.4.2", | ||
"vinyl-buffer": "^1.0.0", | ||
"vinyl-source-stream": "^1.1.0" | ||
} | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
Minified code
QualityThis package contains minified code. This may be harmless in some cases where minified code is included in packaged libraries, however packages on npm should not minify code.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
19811
156
1
2
1