Skip to content

Commit

Permalink
variables failed to be replaced in src and href attributes. updated r…
Browse files Browse the repository at this point in the history
…egex to include %7(B|D) values (thanks htrex)
  • Loading branch information
Eric Hynds committed May 21, 2010
1 parent da46d23 commit 7748527
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions index.htm
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<style type="text/css">form input { display:block; width:250px; margin-bottom:5px }</style>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.js" type="text/javascript"></script>
<script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1/jquery-ui.js" type="text/javascript"></script>
<script src="src/jquery.notify.min.js" type="text/javascript"></script>
<script src="src/jquery.notify.js" type="text/javascript"></script>

<script type="text/javascript">
function create( template, vars, opts ){
Expand Down Expand Up @@ -37,7 +37,7 @@
});

$("#warning").click(function(){
create("withIcon", { title:'Warning!', text:'OMG the quick brown fox jumped over the lazy dog. You\'ve been warned. <a href="#" class="ui-notify-close">Close me.</a>', icon:'<img src="alert.png" alt="warning">' },{
create("withIcon", { title:'Warning!', text:'OMG the quick brown fox jumped over the lazy dog. You\'ve been warned. <a href="#" class="ui-notify-close">Close me.</a>', icon:'alert.png' },{
expires:false
});
});
Expand Down Expand Up @@ -102,7 +102,7 @@ <h1>#{title}</h1>

<div id="withIcon">
<a class="ui-notify-close ui-notify-cross" href="#">x</a>
<div style="float:left;margin:0 10px 0 0">#{icon}</div>
<div style="float:left;margin:0 10px 0 0"><img src="#{icon}" alt="warning" /></div>
<h1>#{title}</h1>
<p>#{text}</p>
</div>
Expand Down
2 changes: 1 addition & 1 deletion src/jquery.notify.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ $.extend($.ui.notify.instance.prototype, {
var self = this,

// build html template
html = template.replace(/#\{(.*?)\}/g, function($1, $2){
html = template.replace(/#(?:\{|%7B)(.*?)(?:\}|%7D)/g, function($1, $2){
return ($2 in params) ? params[$2] : '';
}),

Expand Down

0 comments on commit 7748527

Please sign in to comment.