
Security News
vlt Launches "reproduce": A New Tool Challenging the Limits of Package Provenance
vlt's new "reproduce" tool verifies npm packages against their source code, outperforming traditional provenance adoption in the JavaScript ecosystem.
spartan-multi-image-picker
Advanced tools
A Jquery multi image picker with preview (with madness)
This plugin enable you to upload multiple files on a html form without giving your dummy user a pain in the ass to hold their Ctrl
keyboard for non ajax upload file.
Download this package or install via bower
bower install spartan-multi-image-picker
Include JQuery first, and this plugin after that like so.
<script type="text/javascript" src="https://code.jquery.com/jquery-3.3.1.min.js"></script>
<script type="text/javascript" src="dist/js/spartan-multi-image-picker-min.js"></script>
Create an element where do you want to activate this input file.
<div class="row">
<div id="coba"></div>
</div>
Activate this plugin.
$("#coba1").spartanMultiImagePicker({
fieldName: 'fileUpload[]'
});
The fieldName
is your field name that will appended as input type file to you html.
This is what you can custom when you call this plugin.
Property | Type | Example |
---|---|---|
fieldName | String | fileUpload[] or fileUpload for single image |
maxCount | Number | 1 , 2 remove for unlimited count |
rowHeight | String | 200px |
groupClassName | String | col-md-4 col-sm-4 col-xs-6 |
allowedExt | String | `png |
placeholderImage | Object with image and width properties | { image: 'placeholder.png', width: '100%'} |
maxFileSize | Number (in kb) | 40000 |
Callback | Description |
---|---|
onAddRow | Called on a new field appear |
onRenderedPreview | Called on image rendered as a preview |
onRemoveRow | Called on user click the remove button for each field |
onExtensionErr | Called on extension didn't match as allowedExtension |
onSizeErr | Called on image size is more than maxFileSize prop |
$("#coba").spartanMultiImagePicker({
fieldName: 'fileUpload[]',
maxCount: 5,
rowHeight: '200px',
groupClassName: 'col-md-4 col-sm-4 col-xs-6',
allowedExt: 'png|jpg',
placeholderImage: {
image: 'placeholder.png',
width: '100%'
},
onAddRow: function(){
console.log('add new row');
},
onRenderedPreview : function(){
console.log('preview rendered');
},
onRemoveRow : function(){
console.log('remove row');
},
onExtensionErr : function(){
console.log('extension error');
alert('Please only input png or jpg type file');
},
onSizeErr : function(){
console.log('file size too big');
alert('File size too big');
}
});
FAQs
A Jquery multi image picker with preview (and madness)
The npm package spartan-multi-image-picker receives a total of 7 weekly downloads. As such, spartan-multi-image-picker popularity was classified as not popular.
We found that spartan-multi-image-picker demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
vlt's new "reproduce" tool verifies npm packages against their source code, outperforming traditional provenance adoption in the JavaScript ecosystem.
Research
Security News
Socket researchers uncovered a malicious PyPI package exploiting Deezer’s API to enable coordinated music piracy through API abuse and C2 server control.
Research
The Socket Research Team discovered a malicious npm package, '@ton-wallet/create', stealing cryptocurrency wallet keys from developers and users in the TON ecosystem.