ControlInput updating nick view properly
[KiwiIRC.git] / client / assets / dev / model_pluginmanager.js
1 _kiwi.model.PluginManager = Backbone.Model.extend({
2 initialize: function () {
3 this.$plugin_holder = $('<div id="kiwi_plugins" style="display:none;"></div>').appendTo('#kiwi');
4 this.loaded_plugins = {};
5 },
6
7 // Load an applet within this panel
8 load: function (url) {
9 if (this.loaded_plugins[url]) {
10 this.unload(url);
11 }
12
13 this.loaded_plugins[url] = $('<div></div>');
14 this.loaded_plugins[url].appendTo(this.$plugin_holder)
15 .load(url);
16 },
17
18
19 unload: function (url) {
20 if (!this.loaded_plugins[url]) {
21 return;
22 }
23
24 this.loaded_plugins[url].remove();
25 delete this.loaded_plugins[url];
26 }
27 });