🚀 DAY 5 OF LAUNCH WEEK: Introducing Socket Firewall Enterprise.Learn more →
Socket
Book a DemoInstallSign in
Socket

ceri-files-view

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ceri-files-view

A simple, themed files view

latest
Source
npmnpm
Version
0.2.0
Version published
Maintainers
1
Created
Source

ceri-files-view

A simple, themed files view

Demo

Install

npm install --save-dev ceri-files-view ceri-tooltip ceri-fab ceri-progress ceri-toaster ceri-icon

Usage

FilesView = require("ceri-files-view")
# load the theme (see below)
FilesView(require("ceri-files-view/materialize"))
filesView = document.create "ceri-files-view"
# add files to view:
# names need to be unique
filesView.files = [
  {
    name: "someFile1"
    size: 100000
    lastModified: 0
  }
]
# add actions
filesView.rename = (file) -> new Promise (resolve, reject) =>
  # somehow rename file server-side
  resolve() # on success
  reject() # on fail
filesView.upload = (file, setProgress) -> new Promise (resolve, reject) =>
  # file is html5 file object
  # https://developer.mozilla.org/de/docs/Web/API/File
  # upload to server
  setProgress(50) # to set progress bar to 50%
filesView.delete = (file) -> new Promise (resolve,reject) =>
  # somehow delete file server-side
filesView.download = (file) -> # somehow trigger file download

Themes

Materialize

  • setup ceri-materialize

  • setup webpack for ceri-icon. Include the following icons: [ma-file_upload,ma-delete_forever,ma-mode_edit]

  • load theme file

filesView = FilesView(require("ceri-files-view/materialize"))

For example see dev/materialize.

Development

Clone repository.

npm install
npm run dev

Browse to http://localhost:8080/.

Notable changes

0.2.0

  • use ceri-materialize@2

License

Copyright (c) 2017 Paul Pflugradt Licensed under the MIT license.

Keywords

files-view

FAQs

Package last updated on 07 Sep 2017

Did you know?

Socket

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.

Install

Related posts