diff --git a/scratch/css/editor.css b/scratch/css/editor.css
index 4b49b901..1dfeb239 100644
--- a/scratch/css/editor.css
+++ b/scratch/css/editor.css
@@ -6,7 +6,7 @@
#gollum-editor {
border: 1px solid #e4e4e4;
background: #f9f9f9;
- margin-bottom: 5em;
+ margin: 1em 0 5em;
overflow: hidden;
padding: 1em;
@@ -47,7 +47,7 @@
float: left;
height: 25px;
overflow: hidden;
- margin: 0 0.5em 0 0;
+ margin: 0.2em 0.5em 0 0;
/* text-indent: -5000px; */
text-shadow: 0 1px 0 #fff;
width: 25px;
@@ -77,6 +77,33 @@
width: 0.5em;
}
+#gollum-editor #gollum-editor-function-bar
+ #gollum-editor-format-selector select {
+ background-color: #f7f7f7;
+ border: 1px solid transparent;
+
+ float: right;
+ font-size: 1.1em;
+ font-weight: bold;
+ line-height: 1.6em;
+ padding: 0.5em 0.7em;
+ margin-bottom: 0;
+
+
+ border-radius: 0.5em;
+ -moz-border-radius: 0.5em;
+ -webkit-border-radius: 0.5em;
+
+ -moz-outline: none;
+}
+
+#gollum-editor #gollum-editor-function-bar
+ #gollum-editor-format-selector select:hover {
+ background-color: #fff;
+ border: 1px solid #ddd;
+ -moz-outline: none;
+}
+
/* @section form-fields */
diff --git a/scratch/edit.html b/scratch/edit.html
index 1fc56a9a..0bc8f0ed 100644
--- a/scratch/edit.html
+++ b/scratch/edit.html
@@ -41,12 +41,20 @@
Link
Image
+
+
+
+
diff --git a/scratch/js/gollum-editor/gollum.editor.js b/scratch/js/gollum-editor/gollum.editor.js
index 3cf77c3e..b2201342 100644
--- a/scratch/js/gollum-editor/gollum.editor.js
+++ b/scratch/js/gollum-editor/gollum.editor.js
@@ -60,7 +60,6 @@
// EditorHas.functionBar
}
// EditorHas.baseEditorMarkup
-
};
@@ -88,7 +87,8 @@
* @return void
*/
var debug = function(m) {
- if ( ActiveOptions.Debug && console
+ if ( ActiveOptions.Debug
+ && typeof console != 'undefined'
&& typeof console.log == 'function' ) {
console.log( m );
}
diff --git a/scratch/js/gollum-editor/langs/markdown.js b/scratch/js/gollum-editor/langs/markdown.js
index 1e113962..0f734997 100644
--- a/scratch/js/gollum-editor/langs/markdown.js
+++ b/scratch/js/gollum-editor/langs/markdown.js
@@ -39,12 +39,58 @@ var MarkDown = {
append: "\n***\n"
},
- 'function-ul' : {
+ 'function-ul' : {
search: /(.+)([\n]?)/gi,
replace: "* $1$2"
+ },
+
+ /* This looks silly but is completely valid Markdown */
+ 'function-ol' : {
+ search: /(.+)([\n]?)/gi,
+ replace: "1. $1$2"
+ },
+
+ 'function-blockquote' : {
+ search: /(.+)([\n]?)/gi,
+ replace: "> $1$2"
+ },
+
+ 'function-link' : {
+ exec: function( txt, selText, $field ) {
+ var results = null;
+ res = $.GollumEditor.Dialog({
+ title: '',
+ fields: [
+ {
+ id: 'text',
+ name: 'Link Text',
+ type: 'text',
+ help: 'The text to display to the user.'
+ },
+ {
+ id: 'href',
+ name: 'URL',
+ type: 'text',
+ help: 'The URL to link to.'
+ }
+ ]
+ });
+
+ if ( res['text'] && res['href'] ) {
+ return '[' + res['text'] + ']('
+ + res['href'] + ')';
+ }
+ else
+ return '';
+ }
+ },
+
+ 'function-image' : {
+ /* Stub */
}
-
+
};
+
// this is necessary for GollumEditor to pick this up
jQuery.GollumEditor.defineLanguage('markdown', MarkDown);
\ No newline at end of file