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

ng-daia

v0.1.3

Published

AngularJS module to access DAIA services

Downloads

1

Readme

ng-daia

AngularJS module to access DAIA services

npm version Build Status Test Coverage GitHub Issues

ng-daia is an AngularJS module to facilitate access Document Availability Information API (DAIA) display DAIA responses.

Install

npm

npm install ng-daia --safe

bower

bower install ng-daia --safe

Usage

See https://gbv.github.io/ng-daia/ for documentation and usage examples!

Getting started

The demo illustrates display of availability information with directives and filters provided by module ng-daia}. Please have a look at the documentation of each directive/filter.

The following minimal example might help to include ng-daia into your website:

<html ng-app="myApp">
<head>
  <script src="angular.min.js"></script>
  <script src="ng-daia.min.js"></script>
  <script>angular.module('myApp', ['ngDAIA']);</script>
  <link href="ng-daia.css" rel="stylesheet" />
</head>
<body>
  <div daia-api="http://your-daia-base-url" daia-id="your-document-id">
  </div>
</body>
</html>

Customization

The default templates, included in ng-daia.js, can be styled with CSS, translated with angular-translate, and replaced with the template-url parameter:

The following CSS classes are used:

  • daia-response: the whole response
  • daia-result: the whole result
  • daia-document: each copy of the result
  • daia-label: style of descriptions
  • availability: overall style for display of availability
  • service-label: style for availability labels
  • availability-available: style for display of available services
  • availability-unavailable: style for display of unavailable services
  • availability-expected: style for display of unavailable services with expected availability
  • availability-limitation: style for limitations (in brackets after the corresponding availability status)
  • returning: overall style for message concerning 'expected' date and link for preordering
  • returning-expected: style for message concerning 'expected' date
  • access: style for display of possible access-link
  • simple-openaccess: style for simple availability "openaccess"
  • simple-loan: style for simple availability "loan"
  • simple-presentation: style for simple availability "presentation"

The default templates are fully prepared for internationalization (i18n) with angular-translate. To use the translations module, first include the following in your html:

<script src="../lib/angular-translate.min.js"></script>

There are several ways to manage translations with angular-translate. You might want to add them directly into your myApp module, or the translations can be put into their own json files and retrieved by your app, which will require an additional package:

<script src="../lib/angular-translate-loader-static-files.min.js"></script>

You then have to extend the app module to enable loading the translations (the filenames would in this case have the format "lang-en.json", etc.):

angular.module('myApp', ['ngDAIA', 'pascalprecht.translate']).config(['$translateProvider', function ($translateProvider) {
    $translateProvider.useStaticFilesLoader({
        prefix: '../src/translations/lang-',
        suffix: '.json'
    });
    $translateProvider.registerAvailableLanguageKeys(['en', 'de'], {
    'en_US':'en','en_UK':'en','de_DE':'de','de_AT':'de','de_CH':'de',
    })
    $translateProvider.fallbackLanguage('en');
    $translateProvider.determinePreferredLanguage();
}]);

As well as exporting the translation tables, this example shows the support for automatic language-detection. The default templates are using the following translation terms:

daia-response terms

  • unknown
  • available
  • unavailable
  • presentation
  • loan
  • interloan
  • none
  • expected
  • openaccess

labels and other text

  • INSTITUTION : reference label to holding institution
  • DOCUMENT : reference label for searched document
  • CATALOG_ENTRY : reference label for document link
  • DEPARTMENT : label for specific part of the institution
  • SIGNATURE : label for alternative id (like shelf mark for physical medium)
  • NO_RECORDS: message shown when no items can be displayed
  • AVAILABILITY : label used before unknown if no items can be displayed
  • EXPECTED_BACK : message
  • RESERVATION : displayed link text for reservation link
  • ACCESS : label displayed if a direct document link exists
  • STATUS : label text for daia-simple output

Demo

The demo (see demo directory of source code repository) contains a more detailed sample application that makes use of ng-daia as well as angular-translate. The demo should be run from a server (e.g. localhost).

Contributing

See CONTRIBUTING.md for development documentation. Contributions and feedback is appreciated!

Contributors

License

Code licensed under the AGPL. Documentation licensed under CC BY 3.0.

DAIA icons (included in daia.css) are based on PICOL icons, CC-BY Melih Bilgil.