Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Cleanup, Changelog updates

  • Loading branch information...
commit 4f65134c404127e6dbdc899a07cc46eb6db689df 1 parent 205a638
@daffl daffl authored
View
3  changelog.md
@@ -1,5 +1,8 @@
__1.1.3__
+- fix: [`data` Mustache helper doesn't parse attribute properly](https://github.com/bitovi/canjs/issues/200)
+- fix: [Partial Mustache views assume the right parent tag for live-binding](https://github.com/bitovi/canjs/commit/492a22f7655d1ff15c37b95213252c87a264fe3e)
+- fix: [Mustache partials don't parse properly](https://github.com/bitovi/canjs/issues/199)
- fix: [can.Control will fail to find $.event.special in a $.noConflict(true) scenario](https://github.com/bitovi/canjs/issues/191)
- fix: [Nameless view renderers should return document fragment](https://github.com/bitovi/canjs/issues/195)
- add: [Add can.Observe.List.prototype.replace](https://github.com/bitovi/canjs/issues/194)
View
2  control/view/qunit.html
@@ -6,7 +6,7 @@
margin: 0px; padding: 0px;
}
</style>
- <script type='text/javascript' src='../../../steal/steal.js?can/control/view/test/qunit/view_test.js'></script>
+ <script type='text/javascript' src='../../../steal/steal.js?can/control/view/test/view_test.js'></script>
</head>
<body>
View
50 control/view/test/view_test.js
@@ -0,0 +1,50 @@
+steal('can/control/view','can/view/micro','funcunit/qunit') //load qunit
+ .then(function(){
+
+ module("can/control/view");
+
+ test("this.view", function(){
+
+ can.Control.extend("can.Control.View.Test",{
+ init: function() {
+ this.element.html(this.view('init'))
+ }
+ })
+ can.view.ext = ".micro";
+ can.$("#qunit-test-area").append("<div id='cont_view'/>");
+
+ new can.Control.View.Test( can.$('#cont_view') );
+
+ ok(/Hello World/i.test(can.$('#cont_view').text()),"view rendered")
+ });
+
+ test("test.suffix.doubling", function(){
+
+ can.Control.extend("can.Control.View.Test",{
+ init: function() {
+ this.element.html(this.view('init.micro'))
+ }
+ })
+
+ can.view.ext = ".ejs"; // Reset view extension to default
+ equal(".ejs", can.view.ext);
+
+ can.$("#qunit-test-area").append("<div id='suffix_test_cont_view'/>");
+
+ new can.Control.View.Test(can.$('#suffix_test_cont_view') );
+
+ ok(/Hello World/i.test(can.$('#suffix_test_cont_view').text()),"view rendered")
+ });
+
+ test("complex paths nested inside a controller directory", function(){
+ can.Control.extend("Myproject.Controllers.Foo.Bar");
+
+ //var path = jQuery.Controller._calculatePosition(Myproject.Controllers.Foo.Bar, "init.ejs", "init")
+ //equals(path, "//myproject/views/foo/bar/init.ejs", "view path is correct")
+
+ can.Control.extend("Myproject.Controllers.FooBar");
+ path = can.Control._calculatePosition(Myproject.Controllers.FooBar, "init.ejs", "init")
+ equals(path, "//myproject/views/foo_bar/init.ejs", "view path is correct")
+ })
+});
+
View
1  control/view/test/views/init.micro
@@ -0,0 +1 @@
+<h1>Hello World</h1>
View
87 test/setup.js
@@ -1,49 +1,52 @@
steal('can/util/mvc.js')
-.then('funcunit/qunit',
- 'can/util/fixture')
-.then(function() {
- var oldmodule = window.module;
+ .then('funcunit/qunit',
+ 'can/util/fixture',
+ 'can/view/jaml',
+ 'can/view/micro')
+ .then(function () {
+ var oldmodule = window.module;
- // Shim console, because IE 9 and under (and maybe something else?) doesn't have it,
- // and maybe some other browsers have under-defined versions.
- // This shim is shamelessly and ruthlessly stolen from
- // HTML5 Boilerplate: https://github.com/h5bp/html5-boilerplate/blob/master/js/plugins.js
- (function() {
- var method;
- var noop = function noop() {};
- var methods = [
- 'assert', 'clear', 'count', 'debug', 'dir', 'dirxml', 'error',
- 'exception', 'group', 'groupCollapsed', 'groupEnd', 'info', 'log',
- 'markTimeline', 'profile', 'profileEnd', 'table', 'time', 'timeEnd',
- 'timeStamp', 'trace', 'warn'
- ];
- var length = methods.length;
- var console = (window.console = window.console || {});
+ // Shim console, because IE 9 and under (and maybe something else?) doesn't have it,
+ // and maybe some other browsers have under-defined versions.
+ // This shim is shamelessly and ruthlessly stolen from
+ // HTML5 Boilerplate: https://github.com/h5bp/html5-boilerplate/blob/master/js/plugins.js
+ (function () {
+ var method;
+ var noop = function noop() {
+ };
+ var methods = [
+ 'assert', 'clear', 'count', 'debug', 'dir', 'dirxml', 'error',
+ 'exception', 'group', 'groupCollapsed', 'groupEnd', 'info', 'log',
+ 'markTimeline', 'profile', 'profileEnd', 'table', 'time', 'timeEnd',
+ 'timeStamp', 'trace', 'warn'
+ ];
+ var length = methods.length;
+ var console = (window.console = window.console || {});
- while (length--) {
- method = methods[length];
+ while (length--) {
+ method = methods[length];
- // Only stub undefined methods.
- if (!console[method]) {
- console[method] = noop;
- }
- }
- }());
-
- // Set the test timeout to five minutes
- QUnit.config.hidepassed = true;
- QUnit.config.testTimeout = 300000;
- if ( typeof console !== "undefined" && console.log ) {
- QUnit.log(function( details ) {
- if ( ! details.result ) {
- console.log( "FAILURE: ", details.result, details.message );
+ // Only stub undefined methods.
+ if (!console[method]) {
+ console[method] = noop;
+ }
}
- });
- }
+ }());
+
+ // Set the test timeout to five minutes
+ QUnit.config.hidepassed = true;
+ QUnit.config.testTimeout = 300000;
+ if (typeof console !== "undefined" && console.log) {
+ QUnit.log(function (details) {
+ if (!details.result) {
+ console.log("FAILURE: ", details.result, details.message);
+ }
+ });
+ }
- if(window.TESTINGLIBRARY !== undefined) {
- window.module = function(name, testEnvironment) {
- oldmodule(TESTINGLIBRARY + '/' + name, testEnvironment);
+ if (window.TESTINGLIBRARY !== undefined) {
+ window.module = function (name, testEnvironment) {
+ oldmodule(TESTINGLIBRARY + '/' + name, testEnvironment);
+ }
}
- }
-})
+ })
View
1  view/mustache/mustache.js
@@ -498,7 +498,6 @@ function( can ){
(can.trim(content)+' ').replace(/((([^\s]+?=)?('.*?'|".*?"))|.*?)\s/g, function(whole, part) {
args.push(part);
});
- console.log(args);
// Start the content render block.
result.push('can.Mustache.txt(' + CONTEXT_STACK + ',' + (mode ? '"'+mode+'"' : 'null') + ',');
Please sign in to comment.
Something went wrong with that request. Please try again.