From 548f31a46a685860c73376261f39e502d680cedd Mon Sep 17 00:00:00 2001 From: Chia-liang Kao Date: Thu, 6 Jun 2013 12:59:56 +0800 Subject: [PATCH] new hook: aceSetAuthorStyle --- src/static/js/ace2_inner.js | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/src/static/js/ace2_inner.js b/src/static/js/ace2_inner.js index f53e5004d..f8b266b4e 100644 --- a/src/static/js/ace2_inner.js +++ b/src/static/js/ace2_inner.js @@ -213,8 +213,22 @@ function Ace2Inner(){ if (!dynamicCSS) { return; } - var authorSelector = getAuthorColorClassSelector(getAuthorClassName(author)); + + var authorStyleSet = hooks.callAll('aceSetAuthorStyle', { + dynamicCSS: dynamicCSS, + parentDynamicCSS: parentDynamicCSS, + info: info, + author: author, + authorSelector: authorSelector, + }); + + // Prevent default behaviour if any hook says so + if (_.any(authorStyleSet, function(it) { return it })) + { + return + } + if (!info) { dynamicCSS.removeSelectorStyle(authorSelector);