Giter Site home page Giter Site logo

ryandekker / jdrupal Goto Github PK

View Code? Open in Web Editor NEW

This project forked from signalpoint/jdrupal

0.0 1.0 1.0 1.01 MB

A JavaScript Library and API for Drupal Applications

Home Page: http://jdrupal.tylerfrankenstein.com/

License: GNU General Public License v2.0

JavaScript 89.85% HTML 9.33% Makefile 0.66% Shell 0.15%

jdrupal's Introduction

What is jDrupal?

A simple Vanilla JavaScript Library and API.

What is jDrupal used for?

Drupal 8 Application Development.

What kind of apps?

A variety of application architectures, including...

  • Mobile Applications (Android, iOS, etc)
  • Web Applications
  • Headless Drupal / Decoupled Drupal
  • PhoneGap (Cordova)

jDrupal...

  • solves many common development needs for Drupal based applications.
  • provides a familiar Drupal coding experience and syntax for developers.
  • runs alongside any frontend client side framework, or with no framework at all.
  • utilizes JavaScript prototypes and promises.

Since jDrupal has no dependencies and is written in pure JavaScript, it can be used in a wide variety of architectures and frameworks. Just include it in the <head> of your app's index.html file:

<html>
  <head>
    <!-- ... -->
    <script src="jdrupal.min.js"></script>
    <!-- ... -->
  </head>
  <body><!-- ... --></body>
</html>

Quick Examples

// Connect to Drupal and say hello to the current user.
jDrupal.connect().then(function() {
  var user = jDrupal.currentUser();
  var msg = user.isAuthenticated() ?
    'Hello ' + user.getAccountName() : 'Hello World';
  alert(msg);
});
// Load a node and display the title.
jDrupal.nodeLoad(123).then(function(node) {
  alert(node.getTitle());
});
// Login and show the user their id.
jDrupal.userLogin('bob', 'secret').then(function() {
  alert(jDrupal.currentUser().id());
});
// Get results from a view and print the node ids to the console.
jDrupal.viewsLoad('my-view-url').then(function(view) {
  var results = view.getResults();
  for (var i = 0; i < results.length; i ++) {
    var node = new jDrupal.Node(results[i]);
    console.log('node id: ' + node.id());
  }
});

Getting Started

jDrupal is best friends with DrupalGap, the open source application development kit for Drupal websites.

jdrupal's People

Contributors

signalpoint avatar ryandekker avatar marthinal avatar lukedekker avatar rob-mcgrail avatar

Watchers

 avatar

Forkers

lukedekker

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.