Podświetlanie składni w edytorze XML dzięki editArea. Closes #17. Niestety dla tekstó...
[redakcja.git] / project / static / js / reg_syntax / ruby.js
diff --git a/project/static/js/reg_syntax/ruby.js b/project/static/js/reg_syntax/ruby.js
new file mode 100755 (executable)
index 0000000..c6ee2f4
--- /dev/null
@@ -0,0 +1,67 @@
+/**\r
+ * Ruby syntax v 1.0 \r
+ * \r
+ * v1.0 by Patrice De Saint Steban (2007/01/03)\r
+ *   \r
+**/\r
+editAreaLoader.load_syntax["ruby"] = {\r
+       'COMMENT_SINGLE' : {1 : '#'}\r
+       ,'COMMENT_MULTI' : {}\r
+       ,'QUOTEMARKS' : {1: "'", 2: '"'}\r
+       ,'KEYWORD_CASE_SENSITIVE' : true\r
+       ,'KEYWORDS' : {\r
+               'reserved' : [\r
+                       'alias', 'and', 'BEGIN', 'begin', 'break', 'case', 'class', 'def', 'defined', 'do', 'else',\r
+                       'elsif', 'END', 'end', 'ensure', 'false', 'for', 'if', \r
+                       'in', 'module', 'next', 'not', 'or', 'redo', 'rescue', 'retry',\r
+                       'return', 'self', 'super', 'then', 'true', 'undef', 'unless', 'until', 'when', 'while', 'yield'\r
+               ]\r
+       }\r
+       ,'OPERATORS' :[\r
+               '+', '-', '/', '*', '=', '<', '>', '%', '!', '&', ';', '?', '`', ':', ','\r
+       ]\r
+       ,'DELIMITERS' :[\r
+               '(', ')', '[', ']', '{', '}'\r
+       ]
+       ,'REGEXPS' : {
+               'constants' : {\r
+                       'search' : '()([A-Z]\\w*)()'\r
+                       ,'class' : 'constants'\r
+                       ,'modifiers' : 'g'\r
+                       ,'execute' : 'before' \r
+               }
+               ,'variables' : {\r
+                       'search' : '()([\$\@\%]+\\w+)()'\r
+                       ,'class' : 'variables'\r
+                       ,'modifiers' : 'g'\r
+                       ,'execute' : 'before' \r
+               }
+               ,'numbers' : {\r
+                       'search' : '()(-?[0-9]+)()'\r
+                       ,'class' : 'numbers'\r
+                       ,'modifiers' : 'g'\r
+                       ,'execute' : 'before' \r
+               }
+               ,'symbols' : {\r
+                       'search' : '()(:\\w+)()'\r
+                       ,'class' : 'symbols'\r
+                       ,'modifiers' : 'g'\r
+                       ,'execute' : 'before'\r
+               }
+       }\r
+       ,'STYLES' : {\r
+               'COMMENTS': 'color: #AAAAAA;'\r
+               ,'QUOTESMARKS': 'color: #660066;'\r
+               ,'KEYWORDS' : {\r
+                       'reserved' : 'font-weight: bold; color: #0000FF;'\r
+                       }\r
+               ,'OPERATORS' : 'color: #993300;'\r
+               ,'DELIMITERS' : 'color: #993300;'\r
+               ,'REGEXPS' : {
+                       'variables' : 'color: #E0BD54;'
+                       ,'numbers' : 'color: green;'
+                       ,'constants' : 'color: #00AA00;'
+                       ,'symbols' : 'color: #879EFA;'
+               }       \r
+       }\r
+};\r