Skip to content

Instantly share code, notes, and snippets.

@codewithpassion
Created April 20, 2015 05:48
Show Gist options
  • Save codewithpassion/a55497daf217c9ed82e1 to your computer and use it in GitHub Desktop.
Save codewithpassion/a55497daf217c9ed82e1 to your computer and use it in GitHub Desktop.
PluginFinderConfig.js with namespace
(function() {
'use strict';
window.Cockpit.SystemPlugins = window.Cockpit.SystemPlugins || { PluginFinder: {} }
window.Cockpit.SystemPlugins.PluginFinder.PluginFinderConfig = function PluginFinderConfig() {
var self = this;
self.get = function (pluginName, callback) {
$.get('/system-plugin/plugin-finder/config/' + pluginName, function (config) {
if (callback !== undefined)
callback(config);
});
};
self.set = function (pluginName, config) {
$.post('/system-plugin/plugin-finder/config/' + pluginName, config);
};
};
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment