Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

gitignore stuff

  • Loading branch information...
commit 16f0a1f8f63d4c2c2223c24383b4f27ba126a675 1 parent a32211b
@elado elado authored
View
3  .gitignore
@@ -1,2 +1,3 @@
examples/rails3-example/log
-examples/rails3-example/tmp
+examples/rails3-example/tmp
+examples/rails3-example/vendor/plugins/ruby-hybrid-templates
View
2  README.md
@@ -4,7 +4,7 @@
Ajax based site developers sometimes struggle with content rendering and role division between server and client.
-## Common approaches, pros and cons:
+## Common Approaches, Pros & Cons:
A few approaches to output a rendered template evaluated with an object are:
View
2  examples/rails3-example/app/views/layouts/application.html.erb
@@ -3,7 +3,7 @@
<head>
<title>Rails3Example</title>
<script src="https://ajax.googleapis.com/ajax/libs/mootools/1.3.0/mootools-yui-compressed.js"></script>
- <script src="/javascripts/template.js"></script>
+ <script src="/javascripts/isotope.js"></script>
</head>
<body>
View
53 examples/rails3-example/public/javascripts/template.js
@@ -1,53 +0,0 @@
-// Simple JavaScript Templating
-// John Resig - http://ejohn.org/ - MIT Licensed
-
-(function(){
- var cache = {};
-
- this.Isotope = function tmpl(str, data, options){
- // Figure out if we're getting a template, or if we need to
- // load the template - and be sure to cache the result.
- var fn = cache[str] = cache[str] ||
-
- // Generate a reusable function that will serve as a template
- // generator (and which will be cached).
- new Function("obj",
- "var p=[],print=function(){p.push.apply(p,arguments);};" +
-
- // Introduce the data as local variables using with(){}
- "with(obj){p.push('" +
-
- // Convert the template into pure JavaScript
- str
- .replace(/[\r\t\n]/g, " ")
- .split("<%").join("\t")
- .replace(/((^|%>)[^\t]*)'/g, "$1\r")
- .replace(/\t=(.*?)%>/g, "',$1,'")
- .split("\t").join("');")
- .split("%>").join("p.push('")
- .split("\r").join("\\'")
- + "');}return p.join('');");
-
- // Provide some basic currying to the user
-
- if (data) {
- options=options || {};
-
- if (data instanceof Array) {
- var s=[];
- for (var i=0;i<data.length;i++) {
- var itemObject={};
- itemObject[options.localName || "item"]=data[i];
-
- s.push(fn(itemObject));
- }
- return s.join(options.delimeter || "");
- }
- else {
- return fn( data );
- }
- }
-
- return fn;
- };
-})();
View
1  examples/rails3-example/vendor/plugins/ruby-hybrid-templates
View
2  isotope.gemspec
@@ -20,7 +20,7 @@ Gem::Specification.new do |gem|
gem.rdoc_options = ['--main', 'README.rdoc', '--charset=UTF-8']
gem.extra_rdoc_files = ['README.rdoc', 'LICENSE', 'CHANGELOG.rdoc']
- gem.files = Dir['{lib,spec}/**/*', 'README*', 'LICENSE*'] & `git ls-files -z`.split("\0")
+ gem.files = Dir['{lib,test}/**/*', 'README*', 'LICENSE*'] & `git ls-files -z`.split("\0")
gem.add_development_dependency 'json'
gem.add_development_dependency 'johnson'
Please sign in to comment.
Something went wrong with that request. Please try again.