Advertisement
Guest User

Untitled

a guest
Jul 6th, 2015
216
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.59 KB | None | 0 0
  1. (function() {
  2. var jQuery = window.$;
  3.  
  4. var OpenRegister = function(endpoint) {
  5. this.endpoint = endpoint;
  6. };
  7.  
  8. OpenRegister.prototype.buildURL = function(path) {
  9. return this.endpoint + path + ".json";
  10. };
  11.  
  12. OpenRegister.prototype.hash = function(id) {
  13. var path = this.buildURL("hash/" + id);
  14.  
  15. return jQuery.getJSON(path).done(function (data) {
  16. return data;
  17. });
  18. };
  19.  
  20. OpenRegister.prototype.all = function () {
  21. return jQuery.getJSON(this.buildURL("all")).done(function (data) {
  22. return data;
  23. });
  24. };
  25.  
  26. window.OpenRegister = OpenRegister;
  27. }).call(this);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement