Fix invalid syntax, leaky vars and trailing whitespace in lang JS

This commit is contained in:
Joshua Peek
2011-09-26 17:35:39 -05:00
parent fced891975
commit 7829e17c27
7 changed files with 146 additions and 146 deletions
+4 -5
View File
@@ -3,7 +3,7 @@
*
*/
(function() {
(function($) {
var ASCIIDoc = {
@@ -101,7 +101,7 @@ var ASCIIDoc = {
};
jQuery.GollumEditor.defineLanguage('asciidoc', ASCIIDoc);
$.GollumEditor.defineLanguage('asciidoc', ASCIIDoc);
var ASCIIDocHelp = [
@@ -162,7 +162,6 @@ var ASCIIDocHelp = [
}
];
jQuery.GollumEditor.defineHelp('asciidoc', ASCIIDocHelp);
})();
$.GollumEditor.defineHelp('asciidoc', ASCIIDocHelp);
})(jQuery);
@@ -2,7 +2,7 @@
* Creole Language Definition
*
*/
(function() {
(function($) {
var Creole = {
@@ -22,7 +22,7 @@ var Creole = {
},
'function-hr' : {
append: "\n\n----\n\n";
append: "\n\n----\n\n"
},
'function-ul' : {
@@ -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'] + '}}';
}
@@ -98,6 +99,6 @@ var Creole = {
};
jQuery.GollumEditor.defineLanguage('creole', Creole);
$.GollumEditor.defineLanguage('creole', Creole);
})();
})(jQuery);
+6 -6
View File
@@ -17,7 +17,7 @@
* }
*
**/
(function() {
(function($) {
var MarkDown = {
@@ -91,8 +91,8 @@ 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 );
}
@@ -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);
@@ -1,7 +1,7 @@
/**
* Org-mode Language Definition
**/
(function() {
(function($) {
var OrgMode = {
@@ -71,8 +71,8 @@ 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'] + ']]';
@@ -93,7 +93,7 @@ var OrgMode = {
id: 'url',
name: 'Image URL',
type: 'text'
},
}
],
OK: function( res ) {
var rep = '';
@@ -136,7 +136,7 @@ var OrgModeHelp = [
{
menuName: 'Tables',
data: '<p>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 <code>|</code> character. For example, <br><br><code>|one|two|three|<br>|four|five|six|</code><br><br> will appear as a table with two rows and three columns. Additionally, <br><br><code>|one|two|three|<br>|---+---+-----|<br>|four|five|six|</code><br><br> will also appear as a table, but the first row will be interpreted as a header row and the <code>&lt;th&gt;</code> tag will be used to render it. </p>'
},
}
]
},
@@ -163,11 +163,11 @@ var OrgModeHelp = [
data: "<p>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.</p>"
}
]
},
}
];
jQuery.GollumEditor.defineLanguage('org', OrgMode);
jQuery.GollumEditor.defineHelp('org', OrgModeHelp);
$.GollumEditor.defineLanguage('org', OrgMode);
$.GollumEditor.defineHelp('org', OrgModeHelp);
})();
})(jQuery);
+6 -6
View File
@@ -1,7 +1,7 @@
/**
* Pod Language Definition
**/
(function() {
(function($) {
var Pod = {
@@ -55,8 +55,8 @@ 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 );
}
@@ -66,7 +66,7 @@ var Pod = {
};
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);
+4 -4
View File
@@ -17,14 +17,14 @@
* }
*
**/
(function() {
(function($) {
var RDoc = {
'function-bold' : {
search: /([^\n]+)([\n\s]*)/g,
replace: "((*$1*))$2"
}
},
'function-code' : {
search: /([^\n]+)([\n\s]*)/g,
replace: "(({$1}))$2"
@@ -69,6 +69,6 @@ var RDoc = {
};
jQuery.GollumEditor.defineLanguage('rdoc', RDoc);
$.GollumEditor.defineLanguage('rdoc', RDoc);
})();
})(jQuery);
+4 -4
View File
@@ -1,7 +1,7 @@
/**
* Textile Language Definition
*/
(function() {
(function($) {
var Textile = {
@@ -105,7 +105,7 @@ 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);