aboutsummaryrefslogtreecommitdiffstats
path: root/infrastructure
diff options
context:
space:
mode:
authorAlexander Sulfrian <alexander@sulfrian.net>2010-02-16 04:10:13 +0100
committerAlexander Sulfrian <alexander@sulfrian.net>2010-02-16 04:10:13 +0100
commitc19bbb60738a03e02091a7045d933d43cc11a5e8 (patch)
tree2dd1e0c4ceb19f608f01bfed2b008e6980c76d8f /infrastructure
parentd1f8713c9dc21685e09d974d8c330c1bd716b1ed (diff)
downloadetherpad-c19bbb60738a03e02091a7045d933d43cc11a5e8.tar.gz
etherpad-c19bbb60738a03e02091a7045d933d43cc11a5e8.tar.xz
etherpad-c19bbb60738a03e02091a7045d933d43cc11a5e8.zip
beautified code
Diffstat (limited to 'infrastructure')
-rw-r--r--infrastructure/ace/www/ace2_inner.js29
1 files changed, 24 insertions, 5 deletions
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);
}
}