Parcourir la source

Add AMD module support

tags/0.5.2
Michael Jackson il y a 14 ans
Parent
révision
33920ad674
4 fichiers modifiés avec 14 ajouts et 12 suppressions
  1. +0
    -1
      Rakefile
  2. +14
    -2
      mustache.js
  3. +0
    -3
      wrappers/requirejs/mustache.js.post
  4. +0
    -6
      wrappers/requirejs/mustache.js.pre

+ 0
- 1
Rakefile Voir le fichier

@@ -65,5 +65,4 @@ templated_build "jQuery"
templated_build "MooTools" templated_build "MooTools"
templated_build "Dojo", :location => "dojox/string" templated_build "Dojo", :location => "dojox/string"
templated_build "YUI3", :location => "yui3/mustache" templated_build "YUI3", :location => "yui3/mustache"
templated_build "RequireJS"
templated_build "qooxdoo" templated_build "qooxdoo"

+ 14
- 2
mustache.js Voir le fichier

@@ -2,9 +2,19 @@
* mustache.js - Logic-less {{mustache}} templates with JavaScript * mustache.js - Logic-less {{mustache}} templates with JavaScript
* http://github.com/janl/mustache.js * http://github.com/janl/mustache.js
*/ */
var Mustache = (typeof module !== "undefined" && module.exports) || {};

var Mustache;


(function (exports) { (function (exports) {
if (typeof module !== "undefined") {
module.exports = exports; // CommonJS
} else if (typeof define === "function") {
define(exports); // AMD
} else {
Mustache = exports; // <script>
}
}(function () {
var exports = {};


exports.name = "mustache.js"; exports.name = "mustache.js";
exports.version = "0.5.1-dev"; exports.version = "0.5.1-dev";
@@ -598,4 +608,6 @@ var Mustache = (typeof module !== "undefined" && module.exports) || {};
return _renderer.render(template, view); return _renderer.render(template, view);
} }


})(Mustache);
return exports;

}()));

+ 0
- 3
wrappers/requirejs/mustache.js.post Voir le fichier

@@ -1,3 +0,0 @@

return Mustache;
});

+ 0
- 6
wrappers/requirejs/mustache.js.pre Voir le fichier

@@ -1,6 +0,0 @@
/*
Shameless port of a shameless port ^ 2
@defunkt => @janl => @aq => @voodootikigod => @timruffles
*/
define(function(){

Chargement…
Annuler
Enregistrer