-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added support to Drupal 8 and maintain version for Drupal 7
- Loading branch information
1 parent
2f609ea
commit fd392fc
Showing
6 changed files
with
155 additions
and
49 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,13 +4,13 @@ | |
"backbone.drupal.js", | ||
"backbone.drupal.services.js" | ||
], | ||
"version": "0.1.0-beta", | ||
"version": "0.2.0-alpha", | ||
"homepage": "http://enzolutions.com/projects/backbone_drupal/", | ||
"author": { | ||
"name": "enzo - Eduardo Garcia", | ||
"email": "[email protected]" | ||
}, | ||
"description": "Backbone.drupal extension provides Drupal compatible using Services module", | ||
"description": "Backbone.drupal extension provides connection to Drupal 7/8", | ||
"keywords": [ | ||
"backbone", | ||
"marionette", | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
<!DOCTYPE html> | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="utf-8"> | ||
<title>Backbone Drupal Library</title> | ||
</head> | ||
<body> | ||
<script src="./jquery.js"></script> | ||
<script src="./underscore.js"></script> | ||
<script src="./backbone.js"></script> | ||
<script src="../backbone.drupal.js"></script> | ||
<script src="../backbone.drupal.services.js"></script> | ||
<script> | ||
$(function() { | ||
// Set API Information | ||
Backbone.Drupal.restEndpoint = { | ||
root: 'http://onthisday/api', | ||
dataType: '.json' | ||
}; | ||
// Define auth object, set crossDomain if is necessary | ||
var Auth = new Backbone.Drupal.Auth({crossDomain: true, drupal8: false}); | ||
// Request executed in sync mode | ||
// If status is token further ajax will use the proper token | ||
var status = Auth.login('admin', 'admin'); | ||
|
||
console.log(status); | ||
|
||
/* | ||
Check user retrieve | ||
*/ | ||
|
||
var User = new Backbone.Drupal.Models.User({uid: 1}); | ||
User.fetch({ | ||
success: function (user) { | ||
// Check information retrived, could be used directly in a template | ||
console.log(user.attributes.mail); | ||
} | ||
}); | ||
/* | ||
Check users retrive | ||
*/ | ||
var Users = new Backbone.Drupal.Collections.UserIndex(); | ||
Users.fetch({ | ||
success: function (users) { | ||
// Check information retrived, could be used directly in a template | ||
console.log(users.models[0].attributes.uri); | ||
} | ||
}); | ||
}); | ||
|
||
</script> | ||
|
||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters