~fusonic/chive/1.1

« back to all changes in this revision

Viewing changes to protected/extensions/CodePress/codepress/languages/html.js

  • Committer: Matthias Burtscher
  • Date: 2010-02-12 09:12:35 UTC
  • Revision ID: matthias.burtscher@fusonic.net-20100212091235-jqxrb62klx872ajc
* Updated Yii to 1.1.0
* Removed CodePress and CodeMirror
* Updated jQuery and some plugins
* Cleaned some code ...

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/*
2
 
 * CodePress regular expressions for HTML syntax highlighting
3
 
 */
4
 
 
5
 
var Language = new Object();
6
 
 
7
 
// HTML
8
 
Language.syntax = [
9
 
        { input : /(&lt;[^!]*?&gt;)/g, output : '<b>$1</b>'     }, // all tags
10
 
        { input : /(&lt;a .*?&gt;|&lt;\/a&gt;)/g, output : '<a>$1</a>' }, // links
11
 
        { input : /(&lt;img .*?&gt;)/g, output : '<big>$1</big>' }, // images
12
 
        { input : /(&lt;\/?(button|textarea|form|input|select|option|label).*?&gt;)/g, output : '<u>$1</u>' }, // forms
13
 
        { input : /(&lt;style.*?&gt;)(.*?)(&lt;\/style&gt;)/g, output : '<em>$1</em><em>$2</em><em>$3</em>' }, // style tags
14
 
        { input : /(&lt;script.*?&gt;)(.*?)(&lt;\/script&gt;)/g, output : '<strong>$1</strong><tt>$2</tt><strong>$3</strong>' }, // script tags
15
 
        { input : /=(".*?")/g, output : '=<s>$1</s>' }, // atributes double quote
16
 
        { input : /=('.*?')/g, output : '=<s>$1</s>' }, // atributes single quote
17
 
        { input : /(&lt;!--.*?--&gt.)/g, output : '<ins>$1</ins>' }, // comments 
18
 
        { input : /\b(alert|window|document|break|continue|do|for|new|this|void|case|default|else|function|return|typeof|while|if|label|switch|var|with|catch|boolean|int|try|false|throws|null|true|goto)\b/g, output : '<i>$1</i>' } // script reserved words 
19
 
]
20
 
 
21
 
Language.snippets = [
22
 
        { input : 'aref', output : '<a href="$0"></a>' },
23
 
        { input : 'h1', output : '<h1>$0</h1>' },
24
 
        { input : 'h2', output : '<h2>$0</h2>' },
25
 
        { input : 'h3', output : '<h3>$0</h3>' },
26
 
        { input : 'h4', output : '<h4>$0</h4>' },
27
 
        { input : 'h5', output : '<h5>$0</h5>' },
28
 
        { input : 'h6', output : '<h6>$0</h6>' },
29
 
        { input : 'html', output : '<html>\n\t$0\n</html>' },
30
 
        { input : 'head', output : '<head>\n\t<meta http-equiv="content-type" content="text/html; charset=utf-8" />\n\t<title>$0</title>\n\t\n</head>' },
31
 
        { input : 'img', output : '<img src="$0" alt="" />' },
32
 
        { input : 'input', output : '<input name="$0" id="" type="" value="" />' },
33
 
        { input : 'label', output : '<label for="$0"></label>' },
34
 
        { input : 'legend', output : '<legend>\n\t$0\n</legend>' },
35
 
        { input : 'link', output : '<link rel="stylesheet" href="$0" type="text/css" media="screen" charset="utf-8" />' },              
36
 
        { input : 'base', output : '<base href="$0" />' }, 
37
 
        { input : 'body', output : '<body>\n\t$0\n</body>' }, 
38
 
        { input : 'css', output : '<link rel="stylesheet" href="$0" type="text/css" media="screen" charset="utf-8" />' },
39
 
        { input : 'div', output : '<div>\n\t$0\n</div>' },
40
 
        { input : 'divid', output : '<div id="$0">\n\t\n</div>' },
41
 
        { input : 'dl', output : '<dl>\n\t<dt>\n\t\t$0\n\t</dt>\n\t<dd></dd>\n</dl>' },
42
 
        { input : 'fieldset', output : '<fieldset>\n\t$0\n</fieldset>' },
43
 
        { input : 'form', output : '<form action="$0" method="" name="">\n\t\n</form>' },
44
 
        { input : 'meta', output : '<meta name="$0" content="" />' },
45
 
        { input : 'p', output : '<p>$0</p>' },
46
 
        { input : 'script', output : '<script type="text/javascript" language="javascript" charset="utf-8">\n\t$0\t\n</script>' },
47
 
        { input : 'scriptsrc', output : '<script src="$0" type="text/javascript" language="javascript" charset="utf-8"></script>' },
48
 
        { input : 'span', output : '<span>$0</span>' },
49
 
        { input : 'table', output : '<table border="$0" cellspacing="" cellpadding="">\n\t<tr><th></th></tr>\n\t<tr><td></td></tr>\n</table>' },
50
 
        { input : 'style', output : '<style type="text/css" media="screen">\n\t$0\n</style>' }
51
 
]
52
 
        
53
 
Language.complete = [
54
 
        { input : '\'',output : '\'$0\'' },
55
 
        { input : '"', output : '"$0"' },
56
 
        { input : '(', output : '\($0\)' },
57
 
        { input : '[', output : '\[$0\]' },
58
 
        { input : '{', output : '{\n\t$0\n}' }          
59
 
]
60
 
 
61
 
Language.shortcuts = []