JavaScript HTML Other
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
docs Update install readme May 1, 2018
jsdoc Update theme and jsdoc conf. Jan 22, 2016
scripts Update update_binary Jun 27, 2017
src
tests
.gitignore Add .gitignore. Jan 22, 2016
Gruntfile.js
LICENSE.txt Added license. Jan 3, 2014
README.md Move repo from easystreet3 to signalpoint and tylerfrankenstein.com Jan 6, 2017
bower.json Created non-minified version for the main option based on bower stand… Jun 22, 2017
default.index.html Update index.html Jan 19, 2016
dev.html Move app examples into dev.html. Remove app folder. Jan 21, 2016
index.html Fix code comment. Jan 22, 2016
jdrupal.js
jdrupal.min.js Update binaries. Mar 23, 2018
makefile Move binaries into root folder. Jan 19, 2016
package.json Move repo from easystreet3 to signalpoint and tylerfrankenstein.com Jan 6, 2017
tests.html Update tests.html. Jan 20, 2016

README.md

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.