Files
OctoPrint/src/octoprint/static/js/app/client/languages.js
T
Gina Häußge c5f0ccdb94 Migrated client to module factory pattern
This should _hopefully_ also make it compatible to AMD implementations,
but I have to admit that I haven't tried that yet...
2015-09-28 17:07:37 +02:00

23 lines
637 B
JavaScript

(function (global, factory) {
if (typeof define === "function" && define.amd) {
define(["OctoPrint"], factory);
} else {
factory(window.OctoPrint);
}
})(window || this, function(OctoPrint) {
var url = "api/languages";
OctoPrint.languages = {
list: function(opts) {
return OctoPrint.get(url, opts);
},
upload: function(file) {
return OctoPrint.upload(url, file);
},
delete: function(locale, pack, opts) {
var packUrl = url + "/" + locale + "/" + pack;
return OctoPrint.delete(packUrl, opts);
}
};
});