diff --git a/lib/gollum/frontend/public/javascript/editor/langs/asciidoc.js b/lib/gollum/frontend/public/javascript/editor/langs/asciidoc.js old mode 100755 new mode 100644 index 3558be48..4b690198 --- a/lib/gollum/frontend/public/javascript/editor/langs/asciidoc.js +++ b/lib/gollum/frontend/public/javascript/editor/langs/asciidoc.js @@ -3,40 +3,40 @@ * */ -(function() { +(function($) { var ASCIIDoc = { - + 'function-bold' : { search: /(^[\n]+)([\n\s]*)/g, replace: "*$1*$2" }, - + 'function-italic' : { search: /(^[\n]+)([\n\s]*)/g, replace: "_$1_$2" }, - + 'function-code' : { search: /(^[\n]+)([\n\s]*)/g, replace: "+$1+$2" }, - - 'function-ul' : { + + 'function-ul' : { search: /(^[\n]+)([\n\s]*)/g, replace: "* $1$2" }, - + 'function-ol' : { search: /(.+)([\n]?)/g, replace: ". $1$2" }, - + 'function-blockquote' : { search: /(.+)([\n]?)/g, replace: "----\n$1$2\n----\n" }, - + 'function-link' : { exec: function( txt, selText, $field ) { var results = null; @@ -59,17 +59,17 @@ var ASCIIDoc = { OK: function( res ) { var h = ''; if ( res['text'] && res['href'] ) { - h = res['href'] + '[' + + h = res['href'] + '[' + res['text'] + ']'; } $.GollumEditor.replaceSelection( h ); } }); - - + + } }, - + 'function-image' : { exec: function( txt, selText, $field ) { var results = null; @@ -98,10 +98,10 @@ var ASCIIDoc = { }); } } - + }; -jQuery.GollumEditor.defineLanguage('asciidoc', ASCIIDoc); +$.GollumEditor.defineLanguage('asciidoc', ASCIIDoc); var ASCIIDocHelp = [ @@ -158,11 +158,10 @@ var ASCIIDocHelp = [ menuName: 'Images', data: '

Images in ASCIIDoc work much like hyperlinks, but image URLs are prefixed with image:. For example, to link to an image at images/icons/home.png, write image:images/icons/home.png. Alt text can be added by appending the text to the URI in [ (brackets).

' } - ] + ] } ]; -jQuery.GollumEditor.defineHelp('asciidoc', ASCIIDocHelp); - -})(); +$.GollumEditor.defineHelp('asciidoc', ASCIIDocHelp); +})(jQuery); diff --git a/lib/gollum/frontend/public/javascript/editor/langs/creole.js b/lib/gollum/frontend/public/javascript/editor/langs/creole.js index 86e2cf25..c0651d52 100644 --- a/lib/gollum/frontend/public/javascript/editor/langs/creole.js +++ b/lib/gollum/frontend/public/javascript/editor/langs/creole.js @@ -2,40 +2,40 @@ * Creole Language Definition * */ -(function() { +(function($) { var Creole = { - + 'function-bold' : { search: /([^\n]+)([\n]*)/gi, replace: "**$1**$2" }, - + 'function-italic' : { search: /([^\n]+)([\n]*)/gi, replace: "//$1//$2" }, - + 'function-code' : { search: /([^\n]+)([\n]*)/gi, replace: "{{{$1}}}$2" }, - + 'function-hr' : { - append: "\n\n----\n\n"; + append: "\n\n----\n\n" }, - - 'function-ul' : { + + 'function-ul' : { search: /(.+)([\n]?)/gi, replace: "* $1$2" }, - - /* This looks silly but is completely valid Markdown */ + + /* This looks silly but is completely valid Markdown */ 'function-ol' : { search: /(.+)([\n]?)/gi, replace: "# $1$2" }, - + 'function-link' : { exec: function( txt, selText, $field ) { var results = null; @@ -56,16 +56,16 @@ var Creole = { } ], OK: function( res ) { - var h = '[[' + res['href'] + '|' + + var h = '[[' + res['href'] + '|' + res['text'] + ']]'; $.GollumEditor.replaceSelection( h ); } }); - - + + } }, - + 'function-image' : { exec: function( txt, selText, $field ) { var results = null; @@ -84,8 +84,9 @@ var Creole = { } ], OK: function( res ) { + var h = ''; if ( res['url'] && res['alt'] ) { - var h = '{{' + res['url']; + h = '{{' + res['url']; if ( res['alt'] != '' ) { h += '|' + res['alt'] + '}}'; } @@ -95,9 +96,9 @@ var Creole = { }); } } - + }; -jQuery.GollumEditor.defineLanguage('creole', Creole); +$.GollumEditor.defineLanguage('creole', Creole); -})(); \ No newline at end of file +})(jQuery); diff --git a/lib/gollum/frontend/public/javascript/editor/langs/markdown.js b/lib/gollum/frontend/public/javascript/editor/langs/markdown.js old mode 100755 new mode 100644 index 7152502f..a3b54f4d --- a/lib/gollum/frontend/public/javascript/editor/langs/markdown.js +++ b/lib/gollum/frontend/public/javascript/editor/langs/markdown.js @@ -1,9 +1,9 @@ /** * Markdown Language Definition - * - * A language definition for string manipulation operations, in this case + * + * A language definition for string manipulation operations, in this case * for the Markdown, uh, markup language. Uses regexes for various functions - * by default. If regexes won't do and you need to do some serious + * by default. If regexes won't do and you need to do some serious * manipulation, you can declare a function in the object instead. * * Code example: @@ -14,63 +14,63 @@ * search: /somesearchregex/gi, * replace: 'replace text for RegExp.replace', * append: "just add this where the cursor is" - * } + * } * **/ -(function() { +(function($) { var MarkDown = { - + 'function-bold' : { search: /([^\n]+)([\n\s]*)/g, replace: "**$1**$2" }, - + 'function-italic' : { search: /([^\n]+)([\n\s]*)/g, replace: "_$1_$2" }, - + 'function-code' : { search: /(^[\n]+)([\n\s]*)/g, replace: "`$1`$2" }, - + 'function-hr' : { append: "\n***\n" }, - - 'function-ul' : { + + 'function-ul' : { search: /(.+)([\n]?)/g, replace: "* $1$2" }, - - /* This looks silly but is completely valid Markdown */ + + /* This looks silly but is completely valid Markdown */ 'function-ol' : { search: /(.+)([\n]?)/g, replace: "1. $1$2" }, - + 'function-blockquote' : { search: /(.+)([\n]?)/g, replace: "> $1$2" - }, - + }, + 'function-h1' : { search: /(.+)([\n]?)/g, replace: "# $1$2" }, - + 'function-h2' : { search: /(.+)([\n]?)/g, replace: "## $1$2" }, - + 'function-h3' : { search: /(.+)([\n]?)/g, replace: "### $1$2" }, - + 'function-link' : { exec: function( txt, selText, $field ) { var results = null; @@ -91,15 +91,15 @@ var MarkDown = { OK: function( res ) { var rep = ''; if ( res['text'] && res['href'] ) { - rep = '[' + res['text'] + '](' - + res['href'] + ')'; + rep = '[' + res['text'] + '](' + + res['href'] + ')'; } $.GollumEditor.replaceSelection( rep ); } - }); + }); } }, - + 'function-image' : { exec: function( txt, selText, $field ) { var results = null; @@ -128,7 +128,7 @@ var MarkDown = { }); } } - + }; var MarkDownHelp = [ @@ -162,7 +162,7 @@ var MarkDownHelp = [ } ] }, - + { menuName: 'Span Elements', content: [ @@ -170,24 +170,24 @@ var MarkDownHelp = [ menuName: 'Links', data: '

Markdown has two types of links: inline and reference. For both types of links, the text you want to display to the user is placed in square brackets. For example, if you want your link to display the text “GitHub”, you write [GitHub].

To create an inline link, create a set of parentheses immediately after the brackets and write your URL within the parentheses. (e.g., [GitHub](http://github.com/)). Relative paths are allowed in inline links.

To create a reference link, use two sets of square brackets. [my internal link][internal-ref] will link to the internal reference internal-ref.

' }, - + { menuName: 'Emphasis', data: '

Asterisks (*) and underscores (_) are treated as emphasis and are wrapped with an <em> tag, which usually displays as italics in most browsers. Double asterisks (**) or double underscores (__) are treated as bold using the <strong> tag. To create italic or bold text, simply wrap your words in single/double asterisks/underscores. For example, **My double emphasis text** becomes My double emphasis text, and *My single emphasis text* becomes My single emphasis text.

' }, - + { menuName: 'Code', data: '

To create inline spans of code, simply wrap the code in backticks (`). Markdown will turn `myFunction` into myFunction.

' }, - + { menuName: 'Images', data: '

Markdown image syntax looks a lot like the syntax for links; it is essentially the same syntax preceded by an exclamation point (!). For example, if you want to link to an image at http://github.com/unicorn.png with the alternate text My Unicorn, you would write ![My Unicorn](http://github.com/unicorn.png).

' } ] }, - + { menuName: 'Miscellaneous', content: [ @@ -195,7 +195,7 @@ var MarkDownHelp = [ menuName: 'Automatic Links', data: '

If you want to create a link that displays the actual URL, markdown allows you to quickly wrap the URL in < and > to do so. For example, the link http://github.com/ is easily produced by writing <http://github.com/>.

' }, - + { menuName: 'Escaping', data: '

If you want to use a special Markdown character in your document (such as displaying literal asterisks), you can escape the character with the backslash (\\). Markdown will ignore the character directly after a backslash.' @@ -205,7 +205,7 @@ var MarkDownHelp = [ ]; -jQuery.GollumEditor.defineLanguage('markdown', MarkDown); -jQuery.GollumEditor.defineHelp('markdown', MarkDownHelp); +$.GollumEditor.defineLanguage('markdown', MarkDown); +$.GollumEditor.defineHelp('markdown', MarkDownHelp); -})(); +})(jQuery); diff --git a/lib/gollum/frontend/public/javascript/editor/langs/org.js b/lib/gollum/frontend/public/javascript/editor/langs/org.js index 24d5aa21..7c67c896 100644 --- a/lib/gollum/frontend/public/javascript/editor/langs/org.js +++ b/lib/gollum/frontend/public/javascript/editor/langs/org.js @@ -1,36 +1,36 @@ /** * Org-mode Language Definition **/ -(function() { +(function($) { var OrgMode = { - + 'function-bold' : { search: /([^\n]+)([\n\s]*)/g, replace: "*$1*$2" }, - + 'function-italic' : { search: /([^\n]+)([\n\s]*)/g, replace: "/$1/$2" }, - + 'function-code' : { search: /(^[\n]+)([\n\s]*)/g, replace: "=$1=$2" }, - - 'function-ul' : { + + 'function-ul' : { search: /(.+)([\n]?)/g, replace: "* $1$2" }, - - /* This works, just like it works for Markdown */ + + /* This works, just like it works for Markdown */ 'function-ol' : { search: /(.+)([\n]?)/g, replace: "1. $1$2" }, - + 'function-blockquote' : { search: /(.+)([\n]?)/g, replace: "#+BEGIN_QUOTE\n$1$2\n#+END_QUOTE\n" @@ -40,17 +40,17 @@ var OrgMode = { search: /(.+)([\n]?)/g, replace: "* $1$2" }, - + 'function-h2' : { search: /(.+)([\n]?)/g, replace: "** $1$2" }, - + 'function-h3' : { search: /(.+)([\n]?)/g, replace: "*** $1$2" }, - + 'function-link' : { exec: function( txt, selText, $field ) { var results = null; @@ -71,18 +71,18 @@ var OrgMode = { OK: function( res ) { var rep = ''; if ( res['text'] && res['href'] ) { - rep = '[[' + res['href'] + '][' - + res['text'] + ']]'; + rep = '[[' + res['href'] + '][' + + res['text'] + ']]'; } else if ( res['href'] ) { rep = '[[' + res['href'] + ']]'; } $.GollumEditor.replaceSelection( rep ); } - }); + }); } }, - + 'function-image' : { exec: function( txt, selText, $field ) { var results = null; @@ -93,7 +93,7 @@ var OrgMode = { id: 'url', name: 'Image URL', type: 'text' - }, + } ], OK: function( res ) { var rep = ''; @@ -105,7 +105,7 @@ var OrgMode = { }); } } - + }; var OrgModeHelp = [ @@ -136,10 +136,10 @@ var OrgModeHelp = [ { menuName: 'Tables', data: '

Org-mode supports simple tables (tables with equal number of cells in each row). To create a simple table, just separate the contents of each cell with a | character. For example,

|one|two|three|
|four|five|six|


will appear as a table with two rows and three columns. Additionally,

|one|two|three|
|---+---+-----|
|four|five|six|


will also appear as a table, but the first row will be interpreted as a header row and the <th> tag will be used to render it.

' - }, + } ] }, - + { menuName: 'Span Elements', content: [ @@ -147,27 +147,27 @@ var OrgModeHelp = [ menuName: 'Links', data: '

To create links to external pages, you need to enclose the URI in double square brackets. (i.e., [[http://github.com/]] will automatically be parsed to http://github.com/)If you want to add text, to be displayed to the user, you write the URI and the text next to each other, both enclosed in square brackets and both of them together enclosed in another pair of square brackets. For example, if you want your link to display the text “GitHub”, you write [[http://github.com][GitHub]].

' }, - + { menuName: 'Emphasis', data: '

Forward slashes (/) are treated as emphasis and are wrapped with an <i> tag. Asterisks (*) are treated as bold using the <b> tag.

' }, - + { menuName: 'Code', data: '

To create inline spans of code, simply wrap the code in equal signs (=). Orgmode will turn =myFunction= into myFunction.

' }, - + { menuName: 'Images', data: "

Org-mode image syntax is exactly same as the syntax that you would use for a URI to link to itself. The image URI is enclosed in double square brackets. Alt text on images is not currently supported by Gollum's Org-mode parser.

" } ] - }, + } ]; -jQuery.GollumEditor.defineLanguage('org', OrgMode); -jQuery.GollumEditor.defineHelp('org', OrgModeHelp); +$.GollumEditor.defineLanguage('org', OrgMode); +$.GollumEditor.defineHelp('org', OrgModeHelp); -})(); +})(jQuery); diff --git a/lib/gollum/frontend/public/javascript/editor/langs/pod.js b/lib/gollum/frontend/public/javascript/editor/langs/pod.js old mode 100755 new mode 100644 index 5b12ae90..94ddc87f --- a/lib/gollum/frontend/public/javascript/editor/langs/pod.js +++ b/lib/gollum/frontend/public/javascript/editor/langs/pod.js @@ -1,40 +1,40 @@ /** * Pod Language Definition **/ -(function() { +(function($) { var Pod = { - + 'function-bold' : { search: /(^[\n]+)([\n\s]*)/g, replace: "B<$1>$2" }, - + 'function-italic' : { search: /(^[\n]+)([\n\s]*)/g, replace: "I<$1>$2" }, - + 'function-code' : { search: /(^[\n]+)([\n\s]*)/g, replace: "C<$1>$2" }, - + 'function-h1' : { search: /(.+)([\n]?)/gi, replace: "=head1 $1$2" }, - + 'function-h2' : { search: /(.+)([\n]?)/gi, replace: "=head2 $1$2" }, - + 'function-h3' : { search: /(.+)([\n]?)/gi, replace: "=head3 $1$2" }, - + 'function-link' : { exec: function( txt, selText, $field ) { var results = null; @@ -55,18 +55,18 @@ var Pod = { OK: function( res ) { var rep = ''; if ( res['text'] && res['href'] ) { - rep = 'L<' + res['text'] + '|' - + res['href'] + '>'; + rep = 'L<' + res['text'] + '|' + + res['href'] + '>'; } $.GollumEditor.replaceSelection( rep ); } - }); + }); } } - + }; -jQuery.GollumEditor.defineLanguage('pod', Pod); +$.GollumEditor.defineLanguage('pod', Pod); var PodHelp = [ @@ -106,6 +106,6 @@ var PodHelp = [ } ]; -jQuery.GollumEditor.defineHelp('pod', PodHelp); +$.GollumEditor.defineHelp('pod', PodHelp); -})(); +})(jQuery); diff --git a/lib/gollum/frontend/public/javascript/editor/langs/rdoc.js b/lib/gollum/frontend/public/javascript/editor/langs/rdoc.js old mode 100755 new mode 100644 index eca68f4d..f0df80b8 --- a/lib/gollum/frontend/public/javascript/editor/langs/rdoc.js +++ b/lib/gollum/frontend/public/javascript/editor/langs/rdoc.js @@ -1,9 +1,9 @@ /** * Markdown Language Definition - * - * A language definition for string manipulation operations, in this case + * + * A language definition for string manipulation operations, in this case * for the Markdown, uh, markup language. Uses regexes for various functions - * by default. If regexes won't do and you need to do some serious + * by default. If regexes won't do and you need to do some serious * manipulation, you can declare a function in the object instead. * * Code example: @@ -14,27 +14,27 @@ * search: /somesearchregex/gi, * replace: 'replace text for RegExp.replace', * append: "just add this where the cursor is" - * } + * } * **/ -(function() { +(function($) { var RDoc = { - + 'function-bold' : { search: /([^\n]+)([\n\s]*)/g, replace: "((*$1*))$2" - } + }, 'function-code' : { search: /([^\n]+)([\n\s]*)/g, replace: "(({$1}))$2" }, - - 'function-ul' : { + + 'function-ul' : { search: /(.+)([\n]?)/gi, replace: "* $1$2" }, - + 'function-ol' : { exec: function( txt, selText, $field ) { var count = 1; @@ -51,24 +51,24 @@ var RDoc = { $.GollumEditor.replaceSelection( repText ); } }, - + 'function-h1' : { search: /(.+)([\n]?)/gi, replace: "= $1$2" }, - + 'function-h2' : { search: /(.+)([\n]?)/gi, replace: "== $1$2" }, - + 'function-h3' : { search: /(.+)([\n]?)/gi, replace: "=== $1$2" } - + }; -jQuery.GollumEditor.defineLanguage('rdoc', RDoc); +$.GollumEditor.defineLanguage('rdoc', RDoc); -})(); +})(jQuery); diff --git a/lib/gollum/frontend/public/javascript/editor/langs/textile.js b/lib/gollum/frontend/public/javascript/editor/langs/textile.js old mode 100755 new mode 100644 index 9d848671..a9793d3d --- a/lib/gollum/frontend/public/javascript/editor/langs/textile.js +++ b/lib/gollum/frontend/public/javascript/editor/langs/textile.js @@ -1,44 +1,44 @@ /** * Textile Language Definition */ -(function() { +(function($) { var Textile = { - + 'function-bold' : { search: /(^[\n]+)([\n\s]*)/g, replace: "*$1*$2" }, - + 'function-italic' : { search: /(^[\n]+)([\n\s]*)/g, replace: "_$1_$2" }, - + 'function-hr' : { append: "\n***\n" }, - + 'function-code' : { search: /(^[\n]+)([\n\s]*)/g, replace: "
$1
$2" }, - - 'function-ul' : { + + 'function-ul' : { search: /(.+)([\n]?)/gi, replace: "* $1$2" }, - + 'function-ol' : { search: /(.+)([\n]?)/gi, replace: "# $1$2" }, - + 'function-blockquote' : { search: /(.+)([\n]?)/gi, replace: "bq. $1$2" }, - + 'function-link' : { exec: function( txt, selText, $field ) { var results = null; @@ -67,11 +67,11 @@ var Textile = { $.GollumEditor.replaceSelection( h ); } }); - - + + } }, - + 'function-image' : { exec: function( txt, selText, $field ) { var results = null; @@ -102,10 +102,10 @@ var Textile = { }); } } - + }; -jQuery.GollumEditor.defineLanguage('textile', Textile); +$.GollumEditor.defineLanguage('textile', Textile); var TextileHelp = [ @@ -170,6 +170,6 @@ var TextileHelp = [ } ]; -jQuery.GollumEditor.defineHelp('textile', TextileHelp); +$.GollumEditor.defineHelp('textile', TextileHelp); -})(); +})(jQuery);