Skip to content
Browse files

Change mustache js template engine by Twitter Hogan

  • Loading branch information...
1 parent f33db7a commit 21386f05b074bee27c4ee231f04e30942555b86a @heldr heldr committed
Showing with 7 additions and 7 deletions.
  1. +1 −1 index.html
  2. +6 −6 scripts/hub.me.js
View
2 index.html
@@ -37,7 +37,7 @@
</footer>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
- <script src="http://ajax.cdnjs.com/ajax/libs/mustache.js/0.4.2/mustache.min.js"></script>
+ <script src="http://twitter.github.com/hogan.js/builds/2.0.0/hogan-2.0.0.min.js"></script>
<script src="scripts/css3-mediaqueries.js"></script>
<script src="scripts/hub.me.js"></script>
View
12 scripts/hub.me.js
@@ -8,7 +8,7 @@
// the semi-colon before function invocation is a safety net against concatenated
// scripts and/or other plugins which may not be closed properly.
-;(function ( $, window, document, undefined ) {
+;(function ( $, Hogan, window, document, undefined ) {
// undefined is used here as the undefined global variable in ECMAScript 3 is
// mutable (ie. it can be changed by someone else). undefined isn't really being
@@ -94,9 +94,9 @@
Plugin.prototype.createCategory = function(catName) {
- var tmpl = $('#category-item').html(),
+ var tmpl = Hogan.compile( $('#category-item').html() ),
params = {category_name:catName},
- cat = Mustache.to_html(tmpl, params);
+ cat = tmpl.render(params);
this.element.append(cat);
@@ -106,8 +106,8 @@
// test if homepage begins with http or https
repo.homepage = ( repo.homepage && !( /^(http|https):\/\//.test( repo.homepage ) ) ) ? "http://" + repo.homepage : repo.homepage;
- var tmpl = $('#repository-item').html(),
- repository = Mustache.to_html(tmpl, repo);
+ var tmpl = Hogan.compile( $('#repository-item').html() ),
+ repository = tmpl.render(repo);
this.element.append(repository);
@@ -138,4 +138,4 @@
});
}
-})(jQuery, window, document);
+})(jQuery, Hogan, window, document);

0 comments on commit 21386f0

Please sign in to comment.
Something went wrong with that request. Please try again.