Just a dump of handy live templates I use with IntelliJ. They should also work with WebStorm.
- Go to
settings
. - Search for
live templates
. - Under the javascript section you should be able to manage your templates.
.pt { | |
font-size: 12pt; | |
} | |
.px { | |
font-size: 16px; | |
} | |
.em { | |
font-size: 1em; |
javascript: document.location.search = (function(param, value, location){ | |
search = location.search; | |
if (search) { | |
pattern = new RegExp('([\?&]?)'+param+'=([^\?&#]*)'); | |
clue = search.match(pattern); | |
if (clue) { | |
search = search.replace(pattern, '$1'+param+'='+value); | |
} else { | |
search += '&'+param+'='+value; | |
} |
javascript: document.location.search = (function(param, value, location){ | |
search = location.search; | |
if (search) { | |
pattern = new RegExp('([\?&]?)'+param+'=([^\?&#]*)'); | |
clue = search.match(pattern); | |
if (clue) { | |
search = search.replace(pattern, '$1'+param+'='+value); | |
} else { | |
search += '&'+param+'='+value; | |
} |