diff --git a/public/resources/js/directives/live-example.js b/public/resources/js/directives/live-example.js index dc300f69a1..712933e019 100644 --- a/public/resources/js/directives/live-example.js +++ b/public/resources/js/directives/live-example.js @@ -32,9 +32,9 @@ angularIO.directive('liveExample', ['$location', function ($location) { function span(text) { return '' + text + ''; } - function embeddedTemplate(src, name) { + function embeddedTemplate(src) { return '
' + - '' + + '' + '
' + 'plunker'; } @@ -57,9 +57,9 @@ angularIO.directive('liveExample', ['$location', function ($location) { var isForJs = attrs.lang === 'js' || NgIoUtil.isDoc($location, 'js'); var exLang = isForDart ? 'dart' : isForJs ? 'js' : 'ts'; - if (attrs.hasOwnProperty('embedded') && !isForDart) { + if (embedded && !isForDart) { href = '/resources/live-examples/' + ex + '/' + exLang + '/' + plnkr + '.html' - template = embeddedTemplate(href, plnkr); + template = embeddedTemplate(href); } else { var href = isForDart ? 'http://angular-examples.github.io/' + ex diff --git a/tools/plunker-builder/builder.js b/tools/plunker-builder/builder.js index d8f910767d..fd878e77ce 100644 --- a/tools/plunker-builder/builder.js +++ b/tools/plunker-builder/builder.js @@ -83,7 +83,7 @@ class PlunkerBuilder { var config = this._initConfigAndCollectFileNames(configFileName); var postData = this._createPostData(config); this._addPlunkerFiles(config, postData); - var html = this._createPlunkerHtml(postData, altFileName); + var html = this._createPlunkerHtml(postData); if (this.options.writeNoLink) { fs.writeFileSync(outputFileName, html, 'utf-8'); } @@ -106,15 +106,9 @@ class PlunkerBuilder { } } - _createBasePlunkerHtml(embedded, altFileName) { - // We extract the filename without extension - var targetName = ''; - if (altFileName) { - targetName = altFileName.split('/').pop().slice(0, -5); - } - var target = embedded ? targetName : '_self'; + _createBasePlunkerHtml(embedded) { var html = '' - html += `
` + html += `` // html += '
' // html += '
' @@ -183,8 +177,8 @@ class PlunkerBuilder { return postData; } - _createPlunkerHtml(postData, altFileName) { - var baseHtml = this._createBasePlunkerHtml(this.options.embedded, altFileName); + _createPlunkerHtml(postData) { + var baseHtml = this._createBasePlunkerHtml(this.options.embedded); var doc = jsdom.jsdom(baseHtml); var form = doc.querySelector('form'); _.forEach(postData, (value, key) => {