Permalink
Browse files

Add color support

  • Loading branch information...
badosu committed Aug 8, 2013
1 parent 72d42f4 commit 66f7aefa784adba7d1e57cd810a4658ef0014705
View
@@ -0,0 +1,33 @@
+.irc-00 { color: white }
+.irc-01 { color: black }
+.irc-02 { color: navy }
+.irc-03 { color: green }
+.irc-04 { color: red }
+.irc-05 { color: brown }
+.irc-06 { color: purple }
+.irc-07 { color: olive }
+.irc-08 { color: #C8C800 }
+.irc-09 { color: #00C800 }
+.irc-10 { color: teal }
+.irc-11 { color: #00C3C3 }
+.irc-12 { color: blue }
+.irc-13 { color: #FF4D6C }
+.irc-14 { color: #555 }
+.irc-15 { color: #777 }
+
+.irc-bg00 { border: 1px dotted white }
+.irc-bg01 { border: 1px dotted black }
+.irc-bg02 { border: 1px dotted navy }
+.irc-bg03 { border: 1px dotted green }
+.irc-bg04 { border: 1px dotted red }
+.irc-bg05 { border: 1px dotted brown }
+.irc-bg06 { border: 1px dotted purple }
+.irc-bg07 { border: 1px dotted olive }
+.irc-bg08 { border: 1px dotted #C8C800 }
+.irc-bg09 { border: 1px dotted #00C800 }
+.irc-bg10 { border: 1px dotted teal }
+.irc-bg11 { border: 1px dotted #00C3C3 }
+.irc-bg12 { border: 1px dotted blue }
+.irc-bg13 { border: 1px dotted #FF4D6C }
+.irc-bg14 { border: 1px dotted #555 }
+.irc-bg15 { border: 1px dotted #777 }
View
@@ -3,6 +3,7 @@
//= require 'libs/backbone-min.js'
//= require 'libs/ICanHaz.min.js'
//= require 'libs/bootstrap.min.js'
+//= require 'libs/ircparser.min.js'
//= require 'utils.js'
//= require 'models.js'
//= require 'collections.js'
@@ -24,6 +25,7 @@ window.unity = {
$(function() {
// window.app = new ChatApplicationRouter;
irc.appView = new ChatApplicationView();
+ irc.parser = new IrcParser();
try {
window.unity.api = external.getUnityObject(1.0);

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.
@@ -26,6 +26,11 @@ var MessageView = Backbone.View.extend({
content: this.model.get('text'),
renderedTime: utils.formatDate(Date.now())
}, true);
+
+ if (!irc.me.get('stripColors')) {
+ html = irc.parser.parse(html);
+ }
+
html = this.model.parse(html);
}
@@ -72,6 +72,7 @@ var OverviewView = Backbone.View.extend({
selfSigned = $('#connect-selfSigned').is(':checked'),
password = $('#connect-password').val(),
encoding = $('#connect-encoding').val(),
+ stripColors = $('#connect-stripColors').is(':checked'),
keepAlive = false;
if (!server) {
@@ -100,6 +101,7 @@ var OverviewView = Backbone.View.extend({
realName: realName,
password: password,
encoding: encoding,
+ stripColors: stripColors,
keepAlive: keepAlive
};
View
@@ -63,7 +63,7 @@ module.exports = function IRCLink(connID, app) {
selfSigned: userConn.selfSigned,
encoding: userConn.encoding,
certExpired: false,
- stripColors: true
+ stripColors: userConn.stripColors
});
// add ourself as a connection
View
@@ -26,6 +26,7 @@ module.exports = function (schema) {
, disabled_timeout: { type: Date } // do not allow the user to re-enable this connection until this date
, disabled_reason: { type: String } // why is this connection disabled? (could be user-initiated)
, keep_alive: { type: Boolean } // keep this connection active even if the user is disconnected
+ , stripColors: { type: Boolean } // Do not highlight colors
, temporary: { type: Boolean } // this was created for a guest (no account)
});
@@ -54,4 +55,4 @@ module.exports = function (schema) {
schema.autoupdate();
return schema;
-};
+};
View
@@ -149,6 +149,7 @@ module.exports = function(socket, app) {
, disabled_timeout: Date.now()
, disabled_reason: ''
, keep_alive: keepAlive
+ , stripColors: data.stripColors
, temporary: temp
}, function (err, item) {
if (!err) {
View
@@ -6,6 +6,7 @@ html
!= css('bootstrap.min')
!= css('subway')
!= css('subway-mobile')
+ != css('irc-colors')
script
var ENV = '#{env}',
View
@@ -89,6 +89,9 @@ script(id="overview_connection", type="text/html")
option(value="CP1251") CP1251 (Cyrillic)
option(value="CP1256") CP1256 (Arabic)
option(value="CP1257") CP1257 (baltic)
+ .control-group
+ label(for="connect-stripColors") No Colors
+ input#connect-stripColors(type="checkbox")
.control-group
{{#loggedIn}}
label.checkbox(for="connect-keep-alive", style="width:100%") Keep connection alive after browser closed

0 comments on commit 66f7aef

Please sign in to comment.