From ff4fc6f708b31c4fdaa6a0a0d1f5c87b179a7e44 Mon Sep 17 00:00:00 2001 From: Eston Bond Date: Wed, 3 Nov 2010 16:52:14 -0700 Subject: [PATCH] Well well. We have a functional editor. Now some CSS. --- scratch/css/editor.css | 7 ++++++- scratch/edit.html | 4 ++++ scratch/js/gollum-editor/gollum.editor.js | 3 ++- scratch/js/gollum-editor/langs/markdown.js | 15 +++++++++++++++ 4 files changed, 27 insertions(+), 2 deletions(-) diff --git a/scratch/css/editor.css b/scratch/css/editor.css index b5f0d329..18cb262e 100644 --- a/scratch/css/editor.css +++ b/scratch/css/editor.css @@ -156,4 +156,9 @@ filter:progid:DXImageTransform.Microsoft.gradient(GradientType=0, startColorstr='#599bdc', endColorstr='#3072b3'); background: -webkit-gradient(linear, left top, left bottom, from(#599bdc), to(#3072b3)); background: -moz-linear-gradient(top, #599bdc, #3072b3); -} \ No newline at end of file +} + + + +/* @control dialog */ + diff --git a/scratch/edit.html b/scratch/edit.html index 870e1307..68f8c45d 100644 --- a/scratch/edit.html +++ b/scratch/edit.html @@ -39,6 +39,10 @@ Horizontal Rule   + h1 + h2 + h3 +   Link Image diff --git a/scratch/js/gollum-editor/gollum.editor.js b/scratch/js/gollum-editor/gollum.editor.js index 407616c1..557894a3 100644 --- a/scratch/js/gollum-editor/gollum.editor.js +++ b/scratch/js/gollum-editor/gollum.editor.js @@ -474,7 +474,8 @@ createMarkup: function( title, body ) { Dialog.markupCreated = true; return '
' + - '

' + title + '

' + + '

' + + title +'

' + '
' + body + '
' + '
' + 'OK' + diff --git a/scratch/js/gollum-editor/langs/markdown.js b/scratch/js/gollum-editor/langs/markdown.js index a56f4e54..6649867f 100644 --- a/scratch/js/gollum-editor/langs/markdown.js +++ b/scratch/js/gollum-editor/langs/markdown.js @@ -56,6 +56,21 @@ var MarkDown = { replace: "> $1$2" }, + 'function-h1' : { + search: /(.+)([\n]?)/gi, + replace: "# $1$2" + }, + + 'function-h2' : { + search: /(.+)([\n]?)/gi, + replace: "## $1$2" + }, + + 'function-h3' : { + search: /(.+)([\n]?)/gi, + replace: "### $1$2" + }, + 'function-link' : { exec: function( txt, selText, $field ) { var results = null;