Cleaned up HTML snippets

This commit is contained in:
Holger Rapp 2009-07-29 19:29:28 +02:00
parent 8fb1412791
commit 22804a2cbb

View File

@ -1,43 +1,40 @@
###########################################################################
# TextMate Snippets #
###########################################################################
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
snippet doctype "DocType XHTML 1.0 Strict"
############
# Doctypes #
############
snippet doctype "DocType XHTML 1.0 Strict" b
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
endsnippet
snippet doctype "DocType XHTML 1.0 Transitional"
snippet doctype "DocType XHTML 1.0 Transitional" b
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
endsnippet
snippet doctype "DocType XHTML 1.1"
snippet doctype "DocType XHTML 1.1" b
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
endsnippet
snippet down "Down (down)"
&#x2193;
snippet doctype "HTML - 4.0 Transitional (doctype)" b
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
endsnippet
snippet movie "Embed QT movie (movie)"
<object width="$2" height="$3" classid="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B" codebase="http://www.apple.com/qtactivex/qtplugin.cab">
<param name="src" value="$1"${TM_XHTML}>
<param name="controller" value="$4"${TM_XHTML}>
<param name="autoplay" value="$5"${TM_XHTML}>
<embed src="${1:movie.mov}"
width="${2:320}" height="${3:240}"
controller="${4:true}" autoplay="${5:true}"
scale="tofit" cache="true"
pluginspage="http://www.apple.com/quicktime/download/"
${TM_XHTML}>
</object>
#############
# Shortcuts #
#############
snippet down "Down (down)"
&#x2193;
endsnippet
snippet enter "Enter (enter)"
@ -48,85 +45,6 @@ snippet escape "Escape (escape)"
&#x238B;
endsnippet
snippet fieldset "Fieldset"
<fieldset id="${1/[[:alpha:]]+|( )/(?1:_:\L$0)/g}" ${2:class="${3:}"}>
<legend></legend>
$0
</fieldset>
endsnippet
snippet doctype "HTML - 4.0 Transitional (doctype)"
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
endsnippet
snippet ! "IE Conditional Comment: Internet Explorer 5_0 only"
<!--[if IE 5.0]>${1:${TM_SELECTED_TEXT: IE Conditional Comment: Internet Explorer 5.0 only }}<![endif]-->$0
endsnippet
snippet ! "IE Conditional Comment: Internet Explorer 5_5 only"
<!--[if IE 5.5000]>${1:${TM_SELECTED_TEXT: IE Conditional Comment: Internet Explorer 5.5 only }}<![endif]-->$0
endsnippet
snippet ! "IE Conditional Comment: Internet Explorer 5_x"
<!--[if lt IE 6]>${1:${TM_SELECTED_TEXT: IE Conditional Comment: Internet Explorer 5.x }}<![endif]-->$0
endsnippet
snippet ! "IE Conditional Comment: Internet Explorer 6 and below"
<!--[if lte IE 6]>${1:${TM_SELECTED_TEXT: IE Conditional Comment: Internet Explorer 6 and below }}<![endif]-->$0
endsnippet
snippet ! "IE Conditional Comment: Internet Explorer 6 only"
<!--[if IE 6]>${1:${TM_SELECTED_TEXT: IE Conditional Comment: Internet Explorer 6 only }}<![endif]-->$0
endsnippet
snippet ! "IE Conditional Comment: Internet Explorer 7+"
<!--[if gte IE 7]>${1:${TM_SELECTED_TEXT: IE Conditional Comment: Internet Explorer 7 and above }}<![endif]-->$0
endsnippet
snippet ! "IE Conditional Comment: Internet Explorer"
<!--[if IE]>${1:${TM_SELECTED_TEXT: IE Conditional Comment: Internet Explorer }}<![endif]-->$0
endsnippet
snippet ! "IE Conditional Comment: NOT Internet Explorer"
<!--[if !IE]><!-->${1:${TM_SELECTED_TEXT: IE Conditional Comment: NOT Internet Explorer }}<!-- <![endif]-->$0
endsnippet
snippet input "Input with Label"
<label for="${2:${1/[[:alpha:]]+|( )/(?1:_:\L$0)/g}}">$1</label><input type="${3:text/submit/hidden/button}" name="${4:$2}" value="$5"${6: id="${7:$2}"}${TM_XHTML}>
endsnippet
snippet left "Left (left)"
&#x2190;
endsnippet
snippet option "Option (option)"
&#x2325;
endsnippet
snippet opt "Option"
<option${1: value="${2:option}"}>${3:$2}</option>
endsnippet
snippet return "Return (return)"
&#x21A9;
endsnippet
snippet right "Right (right)"
&#x2192;
endsnippet
snippet select "Select Box"
<select name="${1:some_name}" id="${2:$1}"${3:${4: multiple}${5: onchange="${6:}"}${7: size="${8:1}"}}>
<option${9: value="${10:option1}"}>${11:$10}</option>
<option${12: value="${13:option2}"}>${14:$13}</option>${15:}
$0
</select>
endsnippet
snippet shift "Shift (shift)"
&#x21E7;
endsnippet
@ -139,10 +57,83 @@ snippet up "Up (up)"
&#x2191;
endsnippet
snippet input "XHTML <input>"
<input type="${1:text/submit/hidden/button}" name="${2:some_name}" value="$3"${4: id="${5:$2}"}${TM_XHTML}>
snippet return "Return (return)"
&#x21A9;
endsnippet
snippet right "Right (right)"
&#x2192;
endsnippet
snippet left "Left (left)"
&#x2190;
endsnippet
snippet option "Option (option)"
&#x2325;
endsnippet
#######################
# Conditional inserts #
#######################
snippet ! "IE Conditional Comment: Internet Explorer 5_0 only"
<!--[if IE 5.0]>${1:IE Conditional Comment: Internet Explorer 5.0 only }<![endif]-->$0
endsnippet
snippet ! "IE Conditional Comment: Internet Explorer 5_5 only"
<!--[if IE 5.5000]>${1:IE Conditional Comment: Internet Explorer 5.5 only }<![endif]-->$0
endsnippet
snippet ! "IE Conditional Comment: Internet Explorer 5_x"
<!--[if lt IE 6]>${1:IE Conditional Comment: Internet Explorer 5.x }<![endif]-->$0
endsnippet
snippet ! "IE Conditional Comment: Internet Explorer 6 and below"
<!--[if lte IE 6]>${1:IE Conditional Comment: Internet Explorer 6 and below }<![endif]-->$0
endsnippet
snippet ! "IE Conditional Comment: Internet Explorer 6 only"
<!--[if IE 6]>${1:IE Conditional Comment: Internet Explorer 6 only }<![endif]-->$0
endsnippet
snippet ! "IE Conditional Comment: Internet Explorer 7+"
<!--[if gte IE 7]>${1:IE Conditional Comment: Internet Explorer 7 and above }<![endif]-->$0
endsnippet
snippet ! "IE Conditional Comment: Internet Explorer"
<!--[if IE]>${1: IE Conditional Comment: Internet Explorer }<![endif]-->$0
endsnippet
snippet ! "IE Conditional Comment: NOT Internet Explorer"
<!--[if !IE]><!-->${1: IE Conditional Comment: NOT Internet Explorer }<!-- <![endif]-->$0
endsnippet
#############
# HTML TAGS #
#############
snippet input "Input with Label"
<label for="${2:${1/[[:alpha:]]+|( )/(?1:_:\L$0)/g}}">$1</label><input type="${3:text/submit/hidden/button}" name="${4:$2}" value="$5"${6: id="${7:$2}"}`!p if vim.eval("&filetype").startswith("x"): res = '/'`>
endsnippet
snippet input "XHTML <input>"
<input type="${1:text/submit/hidden/button}" name="${2:some_name}" value="$3"${4: id="${5:$2}"}`!p if vim.eval("&filetype").startswith("x"): res = '/'`>
endsnippet
snippet opt "Option"
<option${1: value="${2:option}"}>${3:$2}</option>
endsnippet
snippet select "Select Box"
<select name="${1:some_name}" id="${2:$1}"${3:${4: multiple}${5: onchange="${6:}"}${7: size="${8:1}"}}>
<option${9: value="${10:option1}"}>${11:$10}</option>
<option${12: value="${13:option2}"}>${14:$13}</option>${15:}
$0
</select>
endsnippet
snippet textarea "XHTML <textarea>"
<textarea name="${1:Name}" rows="${2:8}" cols="${3:40}">$0</textarea>
endsnippet
@ -152,47 +143,59 @@ snippet mailto "XHTML <a mailto: >"
endsnippet
snippet base "XHTML <base>"
<base href="$1"${2: target="$3"}${TM_XHTML}>
<base href="$1"${2: target="$3"}`!p if vim.eval("&filetype").startswith("x"): res = '/'`>
endsnippet
snippet body "XHTML <body>"
<body id="${1:${TM_FILENAME/(.*)\..*/\L$1/}}"${2: onload="$3"}>
<body id="${1:`!p
if len(fn):
res = "Hallo"
else:
res = "Nothin"
`}"${2: onload="$3"}>
$0
</body>
endsnippet
snippet div "XHTML <div>"
<div${1: id="${2:name}"}>
${0:$TM_SELECTED_TEXT}
$0
</div>
endsnippet
snippet form "XHTML <form>"
<form action="${1:${TM_FILENAME/(.*?)\..*/$1_submit/}}" method="${2:get}" accept-charset="utf-8">
<form action="${1:`!p if len(fn):
res = fn.split('.')[-2]
else:
res = "unnamed"
res += '_submit'`}" method="${2:get}" accept-charset="utf-8">
$0
<p><input type="submit" value="Continue →"${TM_XHTML}></p>
<p><input type="submit" value="Continue →"`!p if vim.eval("&filetype").startswith("x"): res = '/'`></p>
</form>
endsnippet
snippet h1 "XHTML <h1>"
<h1 id="${1/[[:alpha:]]+|( )/(?1:_:\L$0)/g}">${1:$TM_SELECTED_TEXT}</h1>
<h1 id="${1/[\w\d]+|( )/(?1:_:\L$0\E)/g}">${1}</h1>
endsnippet
snippet head "XHTML <head>"
<head>
<meta http-equiv="Content-type" content="text/html; charset=utf-8"${TM_XHTML}>
<title>${1:${TM_FILENAME/((.+)\..*)?/(?2:$2:Page Title)/}}</title>
<meta http-equiv="Content-type" content="text/html; charset=utf-8"`!p if vim.eval("&filetype").startswith("x"): res = '/'`>
<title>${1:`!p if len(fn):
res = fn.split('.')[-2]
else:
res = "Page Title"`}</title>
$0
</head>
endsnippet
snippet link "XHTML <link>"
<link rel="${1:stylesheet}" href="${2:/css/master.css}" type="text/css" media="${3:screen}" title="${4:no title}" charset="${5:utf-8}"${TM_XHTML}>
<link rel="${1:stylesheet}" href="${2:/css/master.css}" type="text/css" media="${3:screen}" title="${4:no title}" charset="${5:utf-8}"`!p if vim.eval("&filetype").startswith("x"): res = '/'`>
endsnippet
snippet meta "XHTML <meta>"
<meta name="${1:name}" content="${2:content}"${TM_XHTML}>
<meta name="${1:name}" content="${2:content}"`!p if vim.eval("&filetype").startswith("x"): res = '/'`>
endsnippet
snippet scriptsrc "XHTML <script src...>"
@ -219,6 +222,31 @@ snippet table "XHTML <table>"
endsnippet
snippet title "XHTML <title>"
<title>${1:${TM_FILENAME/((.+)\..*)?/(?2:$2:Page Title)/}}</title>
<title>${1:`!p if len(fn):
res = fn.split('.')[-2]
else:
res = "Page Title"`}</title>
endsnippet
snippet fieldset "Fieldset"
<fieldset id="${1/[\w\d]+|( )/(?1:_:\L$0\E)/g}" ${2:class="${3:}"}>
<legend>$1</legend>
$0
</fieldset>
endsnippet
snippet movie "Embed QT movie (movie)" b
<object width="$2" height="$3" classid="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B" codebase="http://www.apple.com/qtactivex/qtplugin.cab">
<param name="src" value="$1"`!p if vim.eval("&filetype").startswith("x"): res = '/'`>
<param name="controller" value="$4"`!p if vim.eval("&filetype").startswith("x"): res = '/'`>
<param name="autoplay" value="$5"`!p if vim.eval("&filetype").startswith("x"): res = '/'`>
<embed src="${1:movie.mov}"
width="${2:320}" height="${3:240}"
controller="${4:true}" autoplay="${5:true}"
scale="tofit" cache="true"
pluginspage="http://www.apple.com/quicktime/download/"
`!p if vim.eval("&filetype").startswith("x"): res = '/'`>
</object>
endsnippet