summaryrefslogtreecommitdiff
path: root/src/static/js
diff options
context:
space:
mode:
Diffstat (limited to 'src/static/js')
-rw-r--r--src/static/js/linestylefilter.js16
1 files changed, 14 insertions, 2 deletions
diff --git a/src/static/js/linestylefilter.js b/src/static/js/linestylefilter.js
index f328bd56..1cbfac29 100644
--- a/src/static/js/linestylefilter.js
+++ b/src/static/js/linestylefilter.js
@@ -32,6 +32,8 @@ var Changeset = require('./Changeset');
var hooks = require('./pluginfw/hooks');
var linestylefilter = {};
var _ = require('./underscore');
+var AttributeManager = require('./AttributeManager');
+
linestylefilter.ATTRIB_CLASSES = {
'bold': 'tag:b',
@@ -40,6 +42,9 @@ linestylefilter.ATTRIB_CLASSES = {
'strikethrough': 'tag:s'
};
+var lineAttributeMarker = 'lineAttribMarker';
+exports.lineAttributeMarker = lineAttributeMarker;
+
linestylefilter.getAuthorClassName = function(author)
{
return "author-" + author.replace(/[^a-y0-9]/g, function(c)
@@ -68,14 +73,19 @@ linestylefilter.getLineStyleFilter = function(lineLength, aline, textAndClassFun
function attribsToClasses(attribs)
{
var classes = '';
+ var isLineAttribMarker = false;
+
Changeset.eachAttribNumber(attribs, function(n)
{
- var key = apool.getAttribKey(n);
+ var key = apool.getAttribKey(n);
if (key)
{
var value = apool.getAttribValue(n);
if (value)
{
+ if (!isLineAttribMarker && _.indexOf(AttributeManager.lineAttributes, key) >= 0){
+ isLineAttribMarker = true;
+ }
if (key == 'author')
{
classes += ' ' + linestylefilter.getAuthorClassName(value);
@@ -99,10 +109,12 @@ linestylefilter.getLineStyleFilter = function(lineLength, aline, textAndClassFun
key: key,
value: value
}, " ", " ", "");
- }
+ }
}
}
});
+
+ if(isLineAttribMarker) classes += ' ' + lineAttributeMarker;
return classes.substring(1);
}