From c19bbb60738a03e02091a7045d933d43cc11a5e8 Mon Sep 17 00:00:00 2001 From: Alexander Sulfrian Date: Tue, 16 Feb 2010 04:10:13 +0100 Subject: beautified code --- infrastructure/ace/www/ace2_inner.js | 29 ++++++++++++++++++++++++----- 1 file changed, 24 insertions(+), 5 deletions(-) (limited to 'infrastructure') diff --git a/infrastructure/ace/www/ace2_inner.js b/infrastructure/ace/www/ace2_inner.js index 645e406..8bd1096 100644 --- a/infrastructure/ace/www/ace2_inner.js +++ b/infrastructure/ace/www/ace2_inner.js @@ -2086,15 +2086,34 @@ function OUTER(gscope) { [[attributeName,'']]); } else { + var settings = [[attributeName, 'true']]; + if (attributeName == 'h1' || attributeName == 'h2' || attributeName == 'h3' || attributeName == 'h4' || attributeName == 'h5' || attributeName == 'h6') { - performDocumentApplyAttributesToRange(rep.selStart, rep.selEnd, - [['h1',''], ['h2',''], ['h3',''], - ['h4',''], ['h5',''], ['h6','']]); + + settings = [['h1',''], ['h2',''], ['h3',''], + ['h4',''], ['h5',''], ['h6','']]; + if (attributeName == 'h1') { + settings[0] = [attributeName, 'true']; + } + else if (attributeName == 'h2') { + settings[1] = [attributeName, 'true']; + } + else if (attributeName == 'h3') { + settings[2] = [attributeName, 'true']; + } + else if (attributeName == 'h4') { + settings[3] = [attributeName, 'true']; + } + else if (attributeName == 'h5') { + settings[4] = [attributeName, 'true']; + } + else if (attributeName == 'h6') { + settings[5] = [attributeName, 'true']; + } } - performDocumentApplyAttributesToRange(rep.selStart, rep.selEnd, - [[attributeName,'true']]); + performDocumentApplyAttributesToRange(rep.selStart, rep.selEnd, settings); } } -- cgit v1.2.3-1-g7c22