diff --git a/.travis.yml b/.travis.yml index b61ea4704..c6f17fd85 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,7 +1,7 @@ language: node_js node_js: - - "0.10" - - "0.12" - - "node" +- 4 +- 6 +- 8 script: npm test sudo: false diff --git a/appveyor.yml b/appveyor.yml index 4ee5c89ec..70665c251 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -1,7 +1,8 @@ # Test against this version of Node.js environment: matrix: - - nodejs_version: "0.12" + - nodejs_version: "4" + - nodejs_version: "6" # Install scripts. (runs after repo cloning) install: diff --git a/examples/simple/components/tabs.js b/examples/simple/components/tabs.js index 88bc8d01a..d02c92f3b 100644 --- a/examples/simple/components/tabs.js +++ b/examples/simple/components/tabs.js @@ -1,4 +1,4 @@ -import can from 'can/'; +import CanComponent from 'can-component'; import tabsStache from './tabs.stache!'; /** * @module {function} components/tabs/ @@ -7,7 +7,7 @@ import tabsStache from './tabs.stache!'; * @signature `` * Creates a tabs component. */ -export default can.Component.extend({ +export default CanComponent.extend({ tag: "tabs", template: tabsStache, scope: { ... } diff --git a/lib/configured/configured_test.js b/lib/configured/configured_test.js index 3b7fc1c70..a7e18390a 100644 --- a/lib/configured/configured_test.js +++ b/lib/configured/configured_test.js @@ -104,7 +104,7 @@ describe("lib/configured", function(){ done(e) } else { configured.getProject({ - source: "git://github.com/bitovi/canjs#minor", + source: "git://github.com/canjs/canjs#master", path: path.join(__dirname,"test","tmp","canjs"), npmInstall: ["stealjs/steal#master"] }).then(function(){ @@ -122,7 +122,7 @@ describe("lib/configured", function(){ it(".geneateProject is able to read the documentjs.json without versions and build a site", function(done){ - this.timeout(10000); + this.timeout(30000); rmdir(path.join(__dirname,"test","api"), function(e){ if(e) { done(e); @@ -141,7 +141,7 @@ describe("lib/configured", function(){ }); it(".geneateProject is able to take a docObject instead of reading one", function(done){ - this.timeout(10000); + this.timeout(30000); rmdir(path.join(__dirname,"test","tmp","example_project"), function(e){ if(e) { done(e); @@ -176,15 +176,17 @@ describe("lib/configured", function(){ open("test/tmp/multiple_versions/1.0.0/api/index.html",function(browser, close){ var select = browser.window.document.getElementsByTagName("select")[0], $ = browser.window.$; - $(select).val("3.0.0").trigger("change"); - waitFor(browser, function(window){ - return window.location.href == "http://localhost:8081/test/tmp/multiple_versions/3.0.0/api/index.html" - }, function(){ - assert.ok(true,"updated page"); - close(); - next(); - }, close); + $(select).val("3.0.0"); + select.dispatchEvent(new browser.window.Event('change')); + + waitFor(browser, function(window){ + return window.location.href == "http://localhost:8081/test/tmp/multiple_versions/3.0.0/api/index.html" + }, function(){ + assert.ok(true,"updated page"); + close(); + next(); + }, close); },done); }; @@ -193,15 +195,17 @@ describe("lib/configured", function(){ open("test/tmp/multiple_versions/api/index.html",function(browser, close){ var select = browser.window.document.getElementsByTagName("select")[0], $ = browser.window.$; - $(select).val("3.0.0").trigger("change"); - waitFor(browser, function(window){ - return window.location.href == "http://localhost:8081/test/tmp/multiple_versions/3.0.0/api/index.html" - }, function(){ - assert.ok(true,"updated page"); - close(); - next(); - }, close); + $(select).val("3.0.0"); + select.dispatchEvent(new browser.window.Event('change')); + + waitFor(browser, function(window){ + return window.location.href == "http://localhost:8081/test/tmp/multiple_versions/3.0.0/api/index.html" + }, function(){ + assert.ok(true,"updated page"); + close(); + next(); + }, close); },done); }; @@ -210,15 +214,17 @@ describe("lib/configured", function(){ open("test/tmp/multiple_versions/3.0.0/api/index.html",function(browser, close){ var select = browser.window.document.getElementsByTagName("select")[0], $ = browser.window.$; - $(select).val("2.0.0").trigger("change"); - waitFor(browser, function(window){ - return window.location.href == "http://localhost:8081/test/tmp/multiple_versions/api/index.html" - }, function(){ - assert.ok(true,"updated page"); - close(); - next(); - }, close); + $(select).val("2.0.0"); + select.dispatchEvent(new browser.window.Event('change')); + + waitFor(browser, function(window){ + return window.location.href == "http://localhost:8081/test/tmp/multiple_versions/api/index.html" + }, function(){ + assert.ok(true,"updated page"); + close(); + next(); + }, close); },done); }; @@ -258,7 +264,7 @@ describe("lib/configured", function(){ it(".generateProject is able to build something without a documentjs.json", function(done){ - this.timeout(10000); + this.timeout(30000); rmdir(path.join(__dirname,"test","docs"), function(e){ if(e) { done(e); diff --git a/lib/generate/test/generate_test.js b/lib/generate/test/generate_test.js index 2b4259a30..1fc65b11b 100644 --- a/lib/generate/test/generate_test.js +++ b/lib/generate/test/generate_test.js @@ -39,7 +39,7 @@ var open = function(url, callback, done){ describe("documentjs/lib/generate/generate",function(){ it("works",function(done){ - this.timeout(30000); + this.timeout(10000); rmdir(__dirname+"/out",function(error){ generate({ @@ -62,6 +62,7 @@ describe("documentjs/lib/generate/generate",function(){ }); it("@outline works", function(done){ + this.timeout(30000); generate({ glob: __dirname+"/example/*.js", dest: __dirname+"/out", diff --git a/lib/generators/html/html_test.js b/lib/generators/html/html_test.js index aaffecf75..56bad8b0b 100644 --- a/lib/generators/html/html_test.js +++ b/lib/generators/html/html_test.js @@ -33,7 +33,7 @@ describe("documentjs/lib/generators/html",function(){ }, options)); }); html.generate(docMap,options).then(function(){ - if(!fs.existsSync(path.join(__dirname,"test","tmp","static","can","can.js"))) { + if(!fs.existsSync(path.join(__dirname,"test","tmp","static","can-control","can-control.js"))) { done(new Error("canjs does not exist")); } else if(fs.existsSync(path.join(__dirname,"test","tmp","static","bundles","static.js"))) { done(new Error("static build exists")); diff --git a/lib/tags/alias.js b/lib/tags/alias.js index 6f7e98438..233e30be3 100644 --- a/lib/tags/alias.js +++ b/lib/tags/alias.js @@ -21,7 +21,7 @@ var _default = require("./_default"), * /** * * @alias WidgetFactory * *| - * can.Class.extend("jQuery.Controller", + * CanClass.extend("jQuery.Controller", * ... * @codeend */ diff --git a/lib/tags/deprecated.js b/lib/tags/deprecated.js index fc327d167..ecd4dba2f 100644 --- a/lib/tags/deprecated.js +++ b/lib/tags/deprecated.js @@ -33,7 +33,7 @@ var tnd = require('./helpers/typeNameDescription') * /** * * @function * * @deprecated {1.0} This method has been replaced - * * by [can.Model.parseModel]. + * * by [CanModel.parseModel]. * * * * @param {String} name * *| diff --git a/lib/tags/helpers/typer_test.js b/lib/tags/helpers/typer_test.js index d344c05a4..088353150 100644 --- a/lib/tags/helpers/typer_test.js +++ b/lib/tags/helpers/typer_test.js @@ -5,9 +5,9 @@ var typer = require("./typer"), describe("documentjs/tags/helpers/typer", function(){ it("name",function(){ - assert.deepEqual( typer.type("can.Control"), { + assert.deepEqual( typer.type("CanControl"), { types: [{ - type: "can.Control" + type: "CanControl" }] }); }); @@ -43,11 +43,11 @@ describe("documentjs/tags/helpers/typer", function(){ }); it("union",function(){ - assert.deepEqual( typer.type("(can.Control|can.Model)"), { + assert.deepEqual( typer.type("(CanControl|CanModel)"), { types: [{ - type: "can.Control" + type: "CanControl" },{ - type: "can.Model" + type: "CanModel" }] }); }); @@ -67,16 +67,16 @@ describe("documentjs/tags/helpers/typer", function(){ }); it("nullable",function(){ - assert.deepEqual( typer.type("?can.Control"), { + assert.deepEqual( typer.type("?CanControl"), { types: [{ - type: "can.Control" + type: "CanControl" }], nullable: true }); - assert.deepEqual( typer.type("?can.Control"), { + assert.deepEqual( typer.type("?CanControl"), { types: [{ - type: "can.Control" + type: "CanControl" }], nullable: true }); @@ -85,9 +85,9 @@ describe("documentjs/tags/helpers/typer", function(){ it("nonnullable",function(){ - assert.deepEqual( typer.type("!can.Control"), { + assert.deepEqual( typer.type("!CanControl"), { types: [{ - type: "can.Control" + type: "CanControl" }], nonnull: true }); @@ -123,18 +123,18 @@ describe("documentjs/tags/helpers/typer", function(){ }); it("variable params",function(){ - assert.deepEqual( typer.type("...can.Control"), { + assert.deepEqual( typer.type("...CanControl"), { types: [{ - type: "can.Control" + type: "CanControl" }], variable: true }); }) it("variable params",function(){ - assert.deepEqual( typer.type("...can.Control"), { + assert.deepEqual( typer.type("...CanControl"), { types: [{ - type: "can.Control" + type: "CanControl" }], variable: true }); @@ -143,14 +143,14 @@ describe("documentjs/tags/helpers/typer", function(){ it("variable params",function(){ - assert.deepEqual( typer.type("function(...can.Observe){}"), { + assert.deepEqual( typer.type("function(...CanObserve){}"), { types: [{ type: "function", constructs: undefined, context: undefined, returns: {types: [{type: "undefined"}]}, params: [ - {types: [{type: "can.Observe"}], variable: true} + {types: [{type: "CanObserve"}], variable: true} ] }], }); @@ -159,9 +159,9 @@ describe("documentjs/tags/helpers/typer", function(){ // NON-STANDARD types ... it("optional",function(){ - assert.deepEqual( typer.type("can.Control="), { + assert.deepEqual( typer.type("CanControl="), { types: [{ - type: "can.Control" + type: "CanControl" }], optional: true }); @@ -178,17 +178,17 @@ describe("documentjs/tags/helpers/typer", function(){ }); it("parenthesis-less union", function(){ - assert.deepEqual( typer.type("can.Control|can.Model"), { + assert.deepEqual( typer.type("CanControl|CanModel"), { types: [{ - type: "can.Control" + type: "CanControl" },{ - type: "can.Model" + type: "CanModel" }] }); }) it("parenthesis-less union with function", function(){ - assert.deepEqual( typer.type("function|can.Model"), { + assert.deepEqual( typer.type("function|CanModel"), { types: [{ type: "function", type: "function", @@ -197,7 +197,7 @@ describe("documentjs/tags/helpers/typer", function(){ returns: {types: [{type: "undefined"}]}, params: [] },{ - type: "can.Model" + type: "CanModel" }] }); }); diff --git a/lib/tags/plugin.js b/lib/tags/plugin.js index 572c777f7..e8309be30 100644 --- a/lib/tags/plugin.js +++ b/lib/tags/plugin.js @@ -12,8 +12,8 @@ * * @codestart * /** - * * @@page can.Construct.super - * * @@parent can.Construct.plugins + * * @@page CanConstruct.super + * * @@parent CanConstruct.plugins * * @@plugin can/construct/super * * @@test can/construct/super/qunit.html * *| diff --git a/lib/tags/property_test.js b/lib/tags/property_test.js index 4d51b0896..7bcc50801 100644 --- a/lib/tags/property_test.js +++ b/lib/tags/property_test.js @@ -27,8 +27,8 @@ describe("documentjs/lib/tags/property",function(){ var obj = {}; var docMap = {Foo: {name: "Foo", type: "constructor"}} - property.add.call(obj,"@property {can.Map|Object|function} bar a description",null,docMap.Foo, docMap ); - option.add.call(obj,"@option {can.Map} can.Map description"); + property.add.call(obj,"@property {CanMap|Object|function} bar a description",null,docMap.Foo, docMap ); + option.add.call(obj,"@option {CanMap} CanMap description"); option.add.call(obj,"@option {Object} Object description"); option.add.call(obj,"@option {function(String)} Function description"); @@ -37,7 +37,7 @@ describe("documentjs/lib/tags/property",function(){ name: "Foo.bar", type: "property", types: [ - {type: "can.Map", description: "can.Map description"}, + {type: "CanMap", description: "CanMap description"}, {type: "Object", description: "Object description", options: []}, { constructs: undefined, diff --git a/lib/tags/signature.js b/lib/tags/signature.js index 20b8cf068..49d27df41 100644 --- a/lib/tags/signature.js +++ b/lib/tags/signature.js @@ -10,9 +10,9 @@ * @codestart javascript * /** * * Capitalizes a string. - * * @@signature `can.capitalize(s)` Example: + * * @@signature `CanCapitalize(s)` Example: * * - * * can.capitalize("foo") //-> "Bar" + * * CanCapitalize("foo") //-> "Bar" * * * * @@param {String} s the string to be lowercased. * * @@return {String} a string with the first character capitalized, diff --git a/package.json b/package.json index e51195f9d..348beb8d5 100644 --- a/package.json +++ b/package.json @@ -15,7 +15,6 @@ }, "scripts": { "test": "mocha test.js --reporter spec", - "postinstall": "install-engine-dependencies", "publish": "git push origin && git push origin --tags", "release:prerelease": "npm version prerelease && npm publish", "release:patch": "npm version patch && npm publish", @@ -23,18 +22,21 @@ "release:major": "npm version major && npm publish" }, "devDependencies": { + "connect": "^2.14.4", "mocha": ">= 1.18.0", "qunit-mocha-ui": "*", "rimraf": "2.1", - "connect": "^2.14.4" + "zombie": "^4.2.1" }, "dependencies": { "async": "~0.2.7", - "can": "2.3.8", + "can-control": "^3.0.10", + "can-map": "^3.0.7", + "can-stache": "^3.0.24", + "can-util": "^3.6.1", "chokidar": "^1.0.0-rc5", "cross-spawn-async": "^2.1.9", "documentjs-github-download": "^0.3.0", - "engine-dependencies": "^0.2.0", "esprima": "~2.5.0", "fs-extra": "^0.24.0", "glob": "~6.0.3", @@ -45,43 +47,13 @@ "md5": "^2.0.0", "minimatch": "~1.0.0", "q": "~1.0.1", - "steal": "0.13.X", - "steal-tools": "0.13.X", + "steal": "0.16.X", + "steal-stache": "^3.0.7", + "steal-tools": "0.16.X", "yargs": "^1.3.1" }, - "engineDependencies": { - "node": { - "0.10.x": { - "devDependencies": { - "zombie": "^3.1.1" - } - }, - "0.12.x": { - "devDependencies": { - "zombie": "^3.1.1" - } - }, - "^4.0.0": { - "devDependencies": { - "zombie": "^4.2.1" - } - }, - "^5.0.0": { - "devDependencies": { - "zombie": "^4.2.1" - } - } - }, - "iojs": { - "^3.0.0": { - "devDependencies": { - "zombie": "^4.1.0" - } - } - } - }, "system": { - "npmDependencies": [] + "npmAlgorithm": "flat" }, "homepage": "http://documentjs.com", "repository": { diff --git a/site/default/static/build.js b/site/default/static/build.js index 0a4323902..d1c247e2f 100644 --- a/site/default/static/build.js +++ b/site/default/static/build.js @@ -1,4 +1,6 @@ - +var assign = require("can-util/js/assign/assign"); +var fs = require('fs'); +var map = require('./map'); var stealTools = require("steal-tools"), fsx = require('../../../../lib/fs_extras'), Q = require('q'), @@ -19,26 +21,60 @@ module.exports = function(options, folders){ if(options.devBuild) { var promise = Q.all([ fsx.copy(path.join(folders.build), path.join(folders.dist) ), - fsx.copy(path.join("node_modules","steal"), path.join(folders.dist,"steal") ), - fsx.copy(path.join("node_modules","can"), path.join(folders.dist,"can") ), - fsx.copy(path.join("node_modules","jquery"), path.join(folders.dist,"jquery") ) + fsx.copy(path.join("node_modules"), path.join(folders.dist) ), ]); // copy everything and steal.js return promise; } else { + // manually configure Can/Steal packages for Steal build + var paths = { + 'jquery': path.relative(__dirname, require.resolve('jquery')) + }; + + // generate the remaining paths + var mapCopy = {}; + for (var packageName in map) { + if (map.hasOwnProperty(packageName)) { + // map[packageName] can either be just a string (e.g. jquery) or + // an object, so we want the path for the module, not an object + var resolvePath = (typeof map[packageName] === 'object') ? map[packageName][packageName] : map[packageName]; + if (!resolvePath) {// Fall back to Node’s resolution for npm 3+ + resolvePath = require.resolve(packageName); + } + + // Get the path relative to the build folder + var moduleRelativePath = path.relative(__dirname, resolvePath); + + // Update the paths object with the AMD configuration + paths[packageName + '/*'] = path.dirname(moduleRelativePath) + '/*.js'; + paths[packageName] = moduleRelativePath; + + // Make a copy of the object without the key + // that was used to locate the module + if (map[packageName][packageName]) { + mapCopy[packageName] = assign({}, map[packageName]); + delete mapCopy[packageName][packageName]; + } else { + mapCopy[packageName] = map[packageName]; + } + } + } + + // conditional map + // write it out for the client to consume + var mapJSON = JSON.stringify(mapCopy); + fs.writeFileSync(path.join(__dirname, 'map.json'), mapJSON); - var jQueryRelative = path.relative( __dirname, require.resolve("jquery") ); - var canJSRelative = path.dirname( path.relative( __dirname, require.resolve("can") ) )+"/*.js"; - // makes sure can is not added to the global so we can build nicely. global.GLOBALCAN = false; return stealTools.build({ main: "static", - config: __dirname+"/config.js", + config: __dirname + "/config.js", bundlesPath: __dirname+"/bundles", - paths: { - "jquery": jQueryRelative, - "can/*": canJSRelative + paths: paths, + map: mapCopy, + ext: { + 'stache': 'steal-stache' } },{ minify: options.minifyBuild === false ? false : true, @@ -65,7 +101,4 @@ module.exports = function(options, folders){ }); } - - - }; diff --git a/site/default/static/config.js b/site/default/static/config.js index f41da0e2d..d5b5184dd 100644 --- a/site/default/static/config.js +++ b/site/default/static/config.js @@ -1,34 +1,29 @@ (function () { + var map = require('./map.json'); var isClient = typeof window !== "undefined"; - + var configData = { - map: { - "jquery/jquery": "jquery", - "can/util/util": "can/util/jquery/jquery", - "benchmark/benchmark": "benchmark", - "mustache": "can/view/mustache/system" + map: map, + ext: { + 'stache': 'steal-stache' }, meta: { jquery: { exports: "jQuery" }, prettify: {format: "global"} - }, - ext: { - ejs: "can/view/ejs/system", - mustache: "can/view/mustache/system", - stache: "can/view/stache/system" } }; - + if(isClient) { // when not a client, these values are set by build.js. configData.paths = { "jquery": "jquery/dist/jquery.js", - "can/*": "can/*.js" + "can/*": "can/*.js" }; } - + + System.config(configData); })(); diff --git a/site/default/static/content_list.js b/site/default/static/content_list.js index 9e152e10a..682c0e231 100644 --- a/site/default/static/content_list.js +++ b/site/default/static/content_list.js @@ -1,85 +1,86 @@ -steal("can/control","jquery","can/observe",function(Control, $){ +var CanControl = require("can-control"); +var $ = require("jquery"); +require("can-map"); - var contentList = function(sections, tag){ - var element = $("<"+tag+">"); - $.each(sections, function(i, section){ - $li = $("
  • "); - $a = $("").attr("href","#"+section.id).text(section.text); - element.append( $li.append($a) ); - - if(section.sections && section.sections.length) { - $li.append( contentList(section.sections, tag) ); - } +var contentList = function(sections, tag){ + var element = $("<"+tag+">"); + $.each(sections, function(i, section){ + $li = $("
  • "); + $a = $("").attr("href","#"+section.id).text(section.text); + element.append( $li.append($a) ); + + if(section.sections && section.sections.length) { + $li.append( contentList(section.sections, tag) ); + } + }); + return element; +}; + +module.exports = CanControl.extend({ + init: function() { + var sections = []; + this.$element = $(this.element); + + this.collectSignatures().each(function(ix) { + var h2 = $('h2', this); + this.id = 'sig_' + h2.text().replace(/\s/g,"").replace(/[^\w]/g,"_"); + //this.id = encodeURIComponent(h2.text()); + sections.push({id: this.id, text: h2.text()}); }); - return element; - }; - return can.Control.extend({ - init: function() { - var sections = []; - - this.collectSignatures().each(function(ix) { - var h2 = $('h2', this); - this.id = 'sig_' + h2.text().replace(/\s/g,"").replace(/[^\w]/g,"_"); - //this.id = encodeURIComponent(h2.text()); - sections.push({id: this.id, text: h2.text()}); - }); - - var headingStack = [], - last = function(){ - return headingStack[ headingStack.length -1 ] - }; - - var ch = this.collectHeadings().each(function(ix) { - var el = $(this); - this.id = 'section_' + el.text().replace(/\s/g,"").replace(/[^\w]/g,"_"); - var num = +this.nodeName.substr(1); - var section = { - id: this.id, - text: el.text(), - num: num, - sections: [] - }; - - while(last() && (last().num >= num) ) { - headingStack.pop(); - } - - if(!headingStack.length) { - sections.push(section); - headingStack.push(section); - } else { - last().sections.push(section); - headingStack.push(section); - } - }); - - this.element.html( contentList(sections, - ( ( window.docObject.outline && window.docObject.outline.tag ) || "ul" ).toLowerCase() ) ); - - if(window.location.hash.length) { - var id = window.location.hash.replace('#', ''), - anchor = document.getElementById(id); + var headingStack = [], + last = function(){ + return headingStack[ headingStack.length -1 ] + }; + + var ch = this.collectHeadings().each(function(ix) { + var el = $(this); + this.id = 'section_' + el.text().replace(/\s/g,"").replace(/[^\w]/g,"_"); + var num = +this.nodeName.substr(1); + var section = { + id: this.id, + text: el.text(), + num: num, + sections: [] + }; + + while(last() && (last().num >= num) ) { + headingStack.pop(); + } - if(anchor) { - anchor.scrollIntoView(true); - } + if(!headingStack.length) { + sections.push(section); + headingStack.push(section); + } else { + last().sections.push(section); + headingStack.push(section); } - }, - collectSignatures: function() { - var cloned = $('.content .signature').clone(); - // remove release numbers - cloned.find(".release").remove(); - return cloned; - }, - collectHeadings: function() { - var depth = ( window.docObject.outline && window.docObject.outline.depth ) || 1; - var headings = []; - for(var i = 0; i < depth; i++) { - headings.push("h"+(i+2)); + }); + + this.$element.html( contentList(sections, + ( ( window.docObject.outline && window.docObject.outline.tag ) || "ul" ).toLowerCase() ) ); + + if(window.location.hash.length) { + var id = window.location.hash.replace('#', ''), + anchor = document.getElementById(id); + + if(anchor) { + anchor.scrollIntoView(true); } - return $('.content .comment').find(headings.join(",")); } - }); - -}); \ No newline at end of file + }, + collectSignatures: function() { + var cloned = $('.content .signature').clone(); + // remove release numbers + cloned.find(".release").remove(); + return cloned; + }, + collectHeadings: function() { + var depth = ( window.docObject.outline && window.docObject.outline.depth ) || 1; + var headings = []; + for(var i = 0; i < depth; i++) { + headings.push("h"+(i+2)); + } + return $('.content .comment').find(headings.join(",")); + } +}); diff --git a/site/default/static/demo_frame.js b/site/default/static/demo_frame.js index 2274b1978..9bdb2fde2 100644 --- a/site/default/static/demo_frame.js +++ b/site/default/static/demo_frame.js @@ -1,13 +1,15 @@ -steal("can/control","./demo_frame.mustache!","jquery","can/observe","./prettify.js",function(Control,demoFrameMustache,$){ - - +var CanControl = require("can-control"); +var demoFrameTemplate = require("./demo_frame.stache!"); +var $ = require("jquery"); +require("can-map"); +require("./prettify"); -return can.Control.extend({ +module.exports = CanControl.extend({ init: function() { - var docConfig = window.docConfig || {}; + this.element = $(this.element); // Render out the demo container. - this.element.html(demoFrameMustache( {demoSrc: (docConfig.demoSrcRoot || ".." )+'/' + this.element.data('demoSrc')})); + this.element.html(demoFrameTemplate( {demoSrc: (docConfig.demoSrcRoot || ".." )+'/' + this.element.data('demoSrc')})); // Start with the demo tab showing. this.showTab('demo'); @@ -85,5 +87,3 @@ return can.Control.extend({ return prettyPrintOne(unescaped.replace(/ - $('.iframe_wrapper', this.element).each(function() { - var wrapper = $(this), - iframe = $('