Not every panel needs .addMsg such as applets.
this.addMsg(' ', '== ' + _kiwi.global.i18n.translate('client_models_channel_part').fetch(member.displayNick(true), msg), 'action part');\r
}\r
}, this);\r
+ },\r
+\r
+\r
+ addMsg: function (nick, msg, type, opts) {\r
+ var message_obj, bs, d,\r
+ scrollback = (parseInt(_kiwi.global.settings.get('scrollback'), 10) || 250);\r
+\r
+ opts = opts || {};\r
+\r
+ // Time defaults to now\r
+ if (!opts || typeof opts.time === 'undefined') {\r
+ d = opts.date = new Date();\r
+ opts.time = d.getHours().toString().lpad(2, "0") + ":" + d.getMinutes().toString().lpad(2, "0") + ":" + d.getSeconds().toString().lpad(2, "0");\r
+ }\r
+\r
+ // CSS style defaults to empty string\r
+ if (!opts || typeof opts.style === 'undefined') {\r
+ opts.style = '';\r
+ }\r
+\r
+ // Run through the plugins\r
+ message_obj = {"msg": msg, "date": opts.date, "time": opts.time, "nick": nick, "chan": this.get("name"), "type": type, "style": opts.style};\r
+ //tmp = _kiwi.plugs.run('addmsg', message_obj);\r
+ if (!message_obj) {\r
+ return;\r
+ }\r
+\r
+ // The CSS class (action, topic, notice, etc)\r
+ if (typeof message_obj.type !== "string") {\r
+ message_obj.type = '';\r
+ }\r
+\r
+ // Make sure we don't have NaN or something\r
+ if (typeof message_obj.msg !== "string") {\r
+ message_obj.msg = '';\r
+ }\r
+\r
+ // Update the scrollback\r
+ bs = this.get("scrollback");\r
+ if (bs) {\r
+ bs.push(message_obj);\r
+\r
+ // Keep the scrolback limited\r
+ if (bs.length > scrollback) {\r
+ bs.splice(scrollback);\r
+ }\r
+ this.set({"scrollback": bs}, {silent: true});\r
+ }\r
+\r
+ this.trigger("msg", message_obj);\r
+ },\r
+\r
+\r
+ clearMessages: function () {\r
+ this.set({'scrollback': []}, {silent: true});\r
+ this.addMsg('', 'Window cleared');\r
+\r
+ this.view.render();\r
}\r
});\r
}, {"silent": true});\r
},\r
\r
- addMsg: function (nick, msg, type, opts) {\r
- var message_obj, bs, d,\r
- scrollback = (parseInt(_kiwi.global.settings.get('scrollback'), 10) || 250);\r
-\r
- opts = opts || {};\r
-\r
- // Time defaults to now\r
- if (!opts || typeof opts.time === 'undefined') {\r
- d = opts.date = new Date();\r
- opts.time = d.getHours().toString().lpad(2, "0") + ":" + d.getMinutes().toString().lpad(2, "0") + ":" + d.getSeconds().toString().lpad(2, "0");\r
- }\r
-\r
- // CSS style defaults to empty string\r
- if (!opts || typeof opts.style === 'undefined') {\r
- opts.style = '';\r
- }\r
-\r
- // Run through the plugins\r
- message_obj = {"msg": msg, "date": opts.date, "time": opts.time, "nick": nick, "chan": this.get("name"), "type": type, "style": opts.style};\r
- //tmp = _kiwi.plugs.run('addmsg', message_obj);\r
- if (!message_obj) {\r
- return;\r
- }\r
-\r
- // The CSS class (action, topic, notice, etc)\r
- if (typeof message_obj.type !== "string") {\r
- message_obj.type = '';\r
- }\r
-\r
- // Make sure we don't have NaN or something\r
- if (typeof message_obj.msg !== "string") {\r
- message_obj.msg = '';\r
- }\r
-\r
- // Update the scrollback\r
- bs = this.get("scrollback");\r
- if (bs) {\r
- bs.push(message_obj);\r
-\r
- // Keep the scrolback limited\r
- if (bs.length > scrollback) {\r
- bs.splice(scrollback);\r
- }\r
- this.set({"scrollback": bs}, {silent: true});\r
- }\r
-\r
- this.trigger("msg", message_obj);\r
- },\r
-\r
-\r
- clearMessages: function () {\r
- this.set({'scrollback': []}, {silent: true});\r
- this.addMsg('', 'Window cleared');\r
-\r
- this.view.render();\r
- },\r
-\r
closePanel: function () {\r
if (this.view) {\r
this.view.unbind();\r
-_kiwi.model.Server = _kiwi.model.Panel.extend({\r
+_kiwi.model.Server = _kiwi.model.Channel.extend({\r
// Used to determine if this is a server panel\r
server: true,\r
\r
[
'src/models/query.js',
'src/models/channel.js',
- 'src/models/server.js',
'src/models/applet.js'
],
[
+ 'src/models/server.js', // Depends on models/channel.js
'src/applets/settings.js',
'src/applets/chanlist.js',
'src/applets/scripteditor.js'