transparency
Advanced tools
Comparing version 0.4.0 to 0.4.1
@@ -5,7 +5,7 @@ (function() { | ||
require('./spec_helper'); | ||
require('../src/jquery.transparency'); | ||
require('../src/transparency'); | ||
} | ||
describe("Transparency", function() { | ||
it("should work with null values", function() { | ||
xit("should work with null values", function() { | ||
var data, doc, expected; | ||
@@ -97,3 +97,3 @@ doc = jQuery('<div>\ | ||
}); | ||
it("should match by element id, class, name and data-bind", function() { | ||
return it("should match by element id, class, name and data-bind", function() { | ||
var data, doc, expected, res; | ||
@@ -125,22 +125,4 @@ doc = jQuery('<div>\ | ||
}); | ||
return xit("should render html", function() { | ||
var data, doc, expected, res; | ||
doc = jQuery('<div>\ | ||
<div class="container">\ | ||
<div id="post"></div>\ | ||
</div>\ | ||
</div>'); | ||
data = { | ||
post: '<h1>This is the title</h1><p>This is the body</p>' | ||
}; | ||
expected = jQuery('<div>\ | ||
<div class="container">\ | ||
<div id="post"><h1>This is the title</h1><p>This is the body</p></div>\ | ||
</div>\ | ||
</div>'); | ||
res = doc.find('.container').render(data); | ||
return expect(doc.html()).htmlToBeEqual(expected.html()); | ||
}); | ||
}); | ||
}).call(this); |
@@ -5,3 +5,3 @@ (function() { | ||
require('./spec_helper'); | ||
require('../src/jquery.transparency'); | ||
require('../src/transparency'); | ||
} | ||
@@ -8,0 +8,0 @@ |
@@ -5,3 +5,3 @@ (function() { | ||
require('./spec_helper'); | ||
require('../src/jquery.transparency'); | ||
require('../src/transparency'); | ||
} | ||
@@ -8,0 +8,0 @@ |
@@ -5,3 +5,3 @@ (function() { | ||
require('./spec_helper'); | ||
require('../src/jquery.transparency'); | ||
window.Transparency = require('../src/transparency'); | ||
} | ||
@@ -36,2 +36,28 @@ | ||
}); | ||
it("should render safe html content with directives", function() { | ||
var directives, doc, expected, person; | ||
doc = jQuery('<div>\ | ||
<div class="person">\ | ||
<span class="name"></span><span class="email"></span>\ | ||
</div>\ | ||
</div>'); | ||
person = { | ||
firstname: '<b>Jasmine</b>', | ||
lastname: '<i>Taylor</i>', | ||
email: 'jasmine.tailor@example.com' | ||
}; | ||
directives = { | ||
name: function(element) { | ||
return window.Transparency.safeHtml("" + this.firstname + " " + this.lastname); | ||
} | ||
}; | ||
expected = jQuery('<div>\ | ||
<div class="person">\ | ||
<span class="name"><b>Jasmine</b> <i>Taylor</i></span>\ | ||
<span class="email">jasmine.tailor@example.com</span>\ | ||
</div>\ | ||
</div>'); | ||
doc.find('.person').render(person, directives); | ||
return expect(doc.html()).htmlToBeEqual(expected.html()); | ||
}); | ||
return it("should handle nested directives", function() { | ||
@@ -38,0 +64,0 @@ var directives, doc, expected, nameDecorator, person; |
@@ -6,3 +6,3 @@ (function() { | ||
require('./spec_helper'); | ||
require('../src/jquery.transparency'); | ||
require('../src/transparency'); | ||
} | ||
@@ -9,0 +9,0 @@ |
@@ -5,3 +5,3 @@ (function() { | ||
require('./spec_helper'); | ||
require('../src/jquery.transparency'); | ||
require('../src/transparency'); | ||
} | ||
@@ -8,0 +8,0 @@ |
require('jsdom'); | ||
jQuery = require('jquery'); | ||
require('./lib/jquery.transparency'); | ||
require('./lib/transparency'); |
{ | ||
"name" : "transparency", | ||
"version" : "0.4.0", | ||
"version" : "0.4.1", | ||
"description" : "Transparency is a minimal template engine for jQuery. It maps JSON objects to DOM elements with zero configuration.", | ||
@@ -5,0 +5,0 @@ "homepage" : "https://github.com/leonidas/transparency", |
@@ -11,3 +11,3 @@ Transparency is a minimal template engine for jQuery. It maps JSON objects to DOM elements with zero configuration. | ||
For more insight please see (FAQ)[https://github.com/leonidas/transparency/blob/master/FAQ.md] | ||
For more insight please see [FAQ](https://github.com/leonidas/transparency/blob/master/FAQ.md) | ||
@@ -20,3 +20,3 @@ ## Usage | ||
Get the [compiled and minified version](https://raw.github.com/leonidas/transparency/master/lib/jquery.transparency.min.js) | ||
Get the [compiled and minified version](https://raw.github.com/leonidas/transparency/master/lib/transparency.min.js) | ||
and include it to your application with jQuery | ||
@@ -26,3 +26,3 @@ | ||
<script src="js/jquery-1.7.1.min.js"></script> | ||
<script src="js/jquery.transparency.min.js"></script> | ||
<script src="js/transparency.min.js"></script> | ||
``` | ||
@@ -29,0 +29,0 @@ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
Uses eval
Supply chain riskPackage uses dynamic code execution (e.g., eval()), which is a dangerous practice. This can prevent the code from running in certain environments and increases the risk that the code may contain exploits or malicious behavior.
Found 1 instance in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
8824
866128
49
15
7