From 33b97da914105927bc5800224b9bab0ad1d312c6 Mon Sep 17 00:00:00 2001 From: Alexander Sulfrian Date: Mon, 27 Jan 2014 11:12:27 +0000 Subject: Initial commit --- static/css/buttons.css | 32 ++++++++++++++++++++++++++++ static/css/headline_buttons.css | 23 ++++++++++++++++++++ static/img/etherpad_lite_headline_icons.png | Bin 0 -> 1062 bytes static/js/index.js | 7 ++++++ static/js/shared.js | 28 ++++++++++++++++++++++++ 5 files changed, 90 insertions(+) create mode 100644 static/css/buttons.css create mode 100644 static/css/headline_buttons.css create mode 100644 static/img/etherpad_lite_headline_icons.png create mode 100644 static/js/index.js create mode 100644 static/js/shared.js (limited to 'static') diff --git a/static/css/buttons.css b/static/css/buttons.css new file mode 100644 index 0000000..e073b0f --- /dev/null +++ b/static/css/buttons.css @@ -0,0 +1,32 @@ +.buttonicon-headline { + width: 16px; + height: 16px; + background-image: url('../../static/img/etherpad_lite_headline_icons.png'); + background-repeat: no-repeat; + display: inline-block; + vertical-align: middle; +} + +.buttonicon-headline-h1 { + background-position: 0px 1px; +} + +.buttonicon-headline-h2 { + background-position: 0px -15px; +} + +.buttonicon-headline-h3 { + background-position: 0px -31px; +} + +.buttonicon-headline-h4 { + background-position: 0px -47px; +} + +.buttonicon-headline-h5 { + background-position: 0px -63px; +} + +.buttonicon-headline-h6 { + background-position: 0px -79px; +} diff --git a/static/css/headline_buttons.css b/static/css/headline_buttons.css new file mode 100644 index 0000000..100b879 --- /dev/null +++ b/static/css/headline_buttons.css @@ -0,0 +1,23 @@ +h1 span, h2 span, h3 span, h4 span, h5 span, h6 span { + line-height: 1.5em; +} + +h1 { + font-size: 2em; +} + +h2 { + font-size: 1.5em; +} + +h3 { + font-size: 1.17em; +} + +h5 { + font-size: .83em; +} + +h6 { + font-size: .75em; +} diff --git a/static/img/etherpad_lite_headline_icons.png b/static/img/etherpad_lite_headline_icons.png new file mode 100644 index 0000000..b8f30b8 Binary files /dev/null and b/static/img/etherpad_lite_headline_icons.png differ diff --git a/static/js/index.js b/static/js/index.js new file mode 100644 index 0000000..ab18207 --- /dev/null +++ b/static/js/index.js @@ -0,0 +1,7 @@ +var cssFiles = ['ep_headline_buttons/static/css/headline_buttons.css']; + +function aceEditorCSS(){ + return cssFiles; +}; + +exports.aceEditorCSS = aceEditorCSS; diff --git a/static/js/shared.js b/static/js/shared.js new file mode 100644 index 0000000..df88e6b --- /dev/null +++ b/static/js/shared.js @@ -0,0 +1,28 @@ +var _ = require('ep_etherpad-lite/static/js/underscore'); + +var tags = ['h1', 'h2', 'h3', 'h4', 'h5', 'h6']; + +var collectContentPre = function(hook, context){ + var tname = context.tname; + var state = context.state; + var lineAttributes = state.lineAttributes + var tagIndex = _.indexOf(tags, tname); + + if (tagIndex >= 0) { + lineAttributes['heading'] = tags[tagIndex]; + } +}; + +var collectContentPost = function(hook, context){ + var tname = context.tname; + var state = context.state; + var lineAttributes = state.lineAttributes + var tagIndex = _.indexOf(tags, tname); + + if (tagIndex >= 0) { + delete lineAttributes['heading']; + } +}; + +exports.collectContentPre = collectContentPre; +exports.collectContentPost = collectContentPost; -- cgit v1.2.3-1-g7c22