Giter VIP home page Giter VIP logo

ands-registry-widget's Introduction

GitHub license Build Status

ANDS Registry Widget is a jQuery plugin that provides the ability to lookup, search and display records from the ANDS Registry API

Getting Started

Install using bower

bower install ands-registry-widget

Include jQuery dependency

<script src="node_modules/jquery/dist/jquery.min.js"></script>

Include the provided distribution file

<script src="dist/jquery.ands.registry-widget.min.js"></script>

Instantiate the plugin with

$("#registry_widget").registryWidget({
    // options
});

ANDS Registry Widget comes with out of the box support for Twitter Bootstrap styling and Mustache templating engine. Include them to get the same functionality as the available demo page

<link rel="stylesheet" href="bower_components/bootstrap/dist/css/bootstrap.min.css">
<link rel="stylesheet" href="bower_components/bootstrap/dist/css/bootstrap-theme.min.css">
<script src="bower_components/bootstrap/dist/js/bootstrap.min.js"></script>
<script src="bower_components/mustache.js/mustache.min.js"></script>

Configuration

Available parameters

  • apiKey : The API Key that this widget will use to access the ANDS Registry API
  • mode : lookup-activity|search-activity|display-activity Available modes are currently restricted to these
  • searchOptions: Search Options, for configuring how the Search functionality display and functions
    • autoSearch: true|false
    • autoLookup: true|false
    • returnType: purl|title|id
    • facets: institutions|funders|type|fundingScheme|status
    • facetSort: index|count : Determine the sorting order of the facets
    • openIn: bootstrap-modal : Enable custom search displayer. Default to nothing. (appear undearneath)
    • params: Search parameters, overwrite the default ones. For a list of available parameters. Have a look at the Activites API
      • funder: Default funder
      • limit : Number of rows return
      • pp : Per Page
      • q: General Search
      • subject
      • fundingScheme
      • identifier
      • ...
    • searchQueryOptions : Search query options for free text search. For more information, refer to the searchQueryOptions section

searchQueryOptions

Primarily in a list of specified fields to search for. By default it's set to

[
    { value: "q", display: "All" },
    { value: "title", display: "Title" },
    { value: "description", display: "Description" },
    { value: "researcher", display: "Researcher" },
    { value: "principalInvestigator", display: "Principal Investigator" },
    { value: "id", display: "Identifier" },
    { value: "subject", display: "Subject" }
]

Search Parameters can also be embed into the target via HTML data attribute. For example

<div id="display-activity" data-purl="http://purl.org/au-research/activitys/arc/DP140100435"></div>
$('#display-activity').registryWidget({
    api_key: "public",
    mode: "display-activity"
});

Development

Install the dependencies

npm install
bower install

Running tests

grunt karma

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.