npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

fh-wfm-file-angular

v0.1.2

Published

Angular 1 implementation for a WFM module providing file support

Downloads

10

Readme

FeedHenry RainCatcher file Build Status

This module is an Angular JS implementation of Workorders for the Raincatcher project.

Client-side usage (via broswerify)

Cordova Requirements

This module requires following cordova plugins to be available:

  <plugin name="cordova-plugin-file" spec="~4.2.0" />
  <plugin name="cordova-plugin-file-transfer" spec="~1.5.1" />
  <plugin name="cordova-plugin-camera" spec="~2.3.0" />

Setup

This module is packaged in a CommonJS format, exporting the name of the Angular namespace. The module can be included in an angular.js as follows:

var config = {
  uploadEnabled: false,
  listColumnViewId: "column2",
  mainColumnViewId: "content@app",
  detailStateMount: "app.file.detail"
}

angular.module('app', [
, require('fh-wfm-file-angular')(config)
...
])

Configuration Options

The following configuration options are available for this module:

userMode (Required)

Specifies if module should filter images using current user id.

uploadEnabled (Required)

Specifies if file upload button should be visible.

detailStateMount (Required)

Allows to control angular URL for cases when we need to have both list and details (large screens) we need to use nested view (app.file.detail)

mainColumnViewId (Required)

This is the identifier for the Angular view where the main Fileviews will be rendered.

listColumnViewId (Optional)

This is the identifier for the Angular view where the list of Files will be rendered into. This is useful for organising where the lists will be rendered on-screen. If not specified, the lists will be rendered into the mainColumnViewId.

Integration

Angular Services (Depreciated)

Please move to use mediator subscribers. See section bellow.

This module provides a injectable file service : fileClient

Example of read usage :

resolve: {
      files: function(fileClient, profileData) {
        return fileClient.list(profileData.id);
      }
    }

Example of upload usage :

camera.capture()
      .then(function(dataUrl) {
        return fileClient.uploadDataUrl(profileData.id, dataUrl)
      });

For a more complete example around files operations, please check the demo mobile app.

File Directives

| name | wfm-img | |--------- |------------------------------------- | | purpose | retrieves image file from the cloud | | args | uid of the file | | example | <img wfm-img uid="ctrl.file.uid" style="width:450px"> |

| name | file-detail | |--------- |------------------------------------- | | purpose | presents file details, takes options to select which details it will show. | | args | file: file object, display-options: array of file attributes e.g. self.displayOptions = {id: true, name: true, uid: true, owner: true, preview: true}; | | example | <file-detail file="ctrl.file" display-options="ctrl.displayOptions"></file-detail> |

| name | file-list | |--------- |------------------------------------- | | purpose | presents list of the files | | example | <file-list></file-list> |

Topics

As part of rendering Files, this module publishes and subscribes to several topics. These topics can be implemented in your application or you can use the fh-wfm-file module that already has implementations for these topics.

Published Topics

Each of the following topics subscribes to the error and done topics. If the parameter includes a topicUid, the error topic should have the topicUid appended to the done or error topic.

| Topic | Parameters | | ---- | ----------- | | wfm:files:list | NONE | | wfm:files:create | { fileToCreate: fileToCreate, topicUid: topicUid} | | wfm:users:list | NONE | | wfm:users:read | {id: userId, topicUid: userId} |