Skip to content

Commit

Permalink
$compile use fix. Fixes #144. Also add trim possibility when leaving …
Browse files Browse the repository at this point in the history
…a buffer. See #83
  • Loading branch information
magne4000 committed May 4, 2016
1 parent 7426f75 commit e7a0db6
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 7 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
"jade": "~1.11.0",
"less": "^2.6.1",
"less-middleware": "^2.1.0",
"libquassel": "~1.1.4",
"libquassel": "~1.1.5",
"morgan": "^1.7.0",
"net-browserify-alt": "^0.6.1",
"serve-favicon": "~2.3.0"
Expand Down
9 changes: 8 additions & 1 deletion public/javascripts/angular-controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ angular.module('quassel')
if (oldValue !== null && (newValue === null || newValue.id !== oldValue.id)) {
if ($config.get('emptybufferonswitch', false)) {
loadingMoreBacklogs.delete(oldValue.id);
oldValue.clearMessages();
oldValue.trimMessages($config.get('emptybufferonswitchvalue', 0));
}
}
});
Expand Down Expand Up @@ -713,6 +713,13 @@ angular.module('quassel')
}
return $config.get('emptybufferonswitch', false);
};

$scope.gsemptybufferonswitchvalue = function(newValue) {
if (arguments.length > 0) {
$config.set('emptybufferonswitchvalue', newValue);
}
return $config.get('emptybufferonswitchvalue', 0);
};

$scope.configGeneral = function() {
modal = $uibModal.open({
Expand Down
16 changes: 12 additions & 4 deletions public/javascripts/angular-directive.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ angular.module('quassel')
break;
case MT.Nick:
if (message.sender === message.content) {
content = $compile("You are now known as " + nickplaceholder(message.content))(scope);
content = "You are now known as " + nickplaceholder(message.content);
} else {
content = nickplaceholder(message.sender) + " is now known as " + nickplaceholder(message.content);
}
Expand All @@ -82,10 +82,18 @@ angular.module('quassel')
content = nickplaceholder(message.sender) + " has joined";
break;
case MT.Part:
content = nickplaceholder(message.sender) + " has left (" + message.content + ")";
if (message.content) {
content = nickplaceholder(message.sender) + " has left (" + message.content + ")";
} else {
content = nickplaceholder(message.sender) + " has left";
}
break;
case MT.Quit:
content = nickplaceholder(message.sender) + " has quit (" + message.content + ")";
if (message.content) {
content = nickplaceholder(message.sender) + " has quit (" + message.content + ")";
} else {
content = nickplaceholder(message.sender) + " has quit";
}
break;
case MT.Kick:
var ind = message.content.indexOf(" ");
Expand All @@ -110,7 +118,7 @@ angular.module('quassel')
shouldCompile = false;
}
if (shouldCompile) {
return $compile(content + '<br>')(scope);
return $compile('<span>' + content + '</span><br>')(scope);
}
return content + '<br>';
}
Expand Down
7 changes: 6 additions & 1 deletion views/ng-templates/modalGeneralConfig.jade
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,17 @@ script(type="text/ng-template", id="modalGeneralConfig.html")
label
input(type="checkbox", ng-model="gsdebug", ng-model-options="{ getterSetter: true }")
| Display debug information in console ? (needs a refresh to take effect)
.form-group.checkbox
label
input(type="checkbox", ng-model="gsdisplayfullhostmask", ng-model-options="{ getterSetter: true }")
| Display full hostmask on join/part/quit ?
.form-group.checkbox
label
input(type="checkbox", ng-model="gsemptybufferonswitch", ng-model-options="{ getterSetter: true }")
| Empty buffer when switching to another buffer (check this if you have slowdowns after some time)
| Trim buffer when switching to another buffer (check this if you have slowdowns after some time)
small.form-group.col-md-offset-1(ng-show="gsemptybufferonswitch()") ↳ Leave only
input.input-xs(type="number", ng-model="gsemptybufferonswitchvalue", ng-model-options="{ getterSetter: true }", min="0", max="999", ng-readonly="!gsemptybufferonswitch()")
| messages.
h4 Highlight nicks
small if logged, needs a refresh to take effect
.btn-group
Expand Down

0 comments on commit e7a0db6

Please sign in to comment.