Created
August 6, 2014 12:49
-
-
Save cetver/02c90c9b8bac856b92ed to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var template = | |
'<div class="row">' + | |
'<div class="col-xs-2 col-sm-1 align-right">' + | |
'<span class="{ icon_class }"></span>' + | |
'</div>' + | |
'<div class="col-xs-7 col-sm-9">' + | |
'<p>{message}</p>' + | |
'<time datetime=""><{when_created}</time>' + | |
'</div>' + | |
'<div class="col-xs-3 col-sm-2 align-right-fxd">' + | |
'<img src="{image_url}" alt="">' + | |
'</div>' | |
; | |
var vars = template.match(/\{(.*?)\}/g).map(function(val){ | |
return $.trim(val.replace(/[\{|\}]/g,'')); | |
}); | |
console.log(vars); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment