From 22870f193cf954bb7f74cc99be7a2bb6a44825d4 Mon Sep 17 00:00:00 2001 From: m7r Date: Tue, 26 Aug 2014 08:32:09 +0200 Subject: [PATCH] fix(): remove jsfiddle from edit example options #101 --- src/templates/js/docs.js | 57 +++------------------------------------- 1 file changed, 3 insertions(+), 54 deletions(-) diff --git a/src/templates/js/docs.js b/src/templates/js/docs.js index 30eed3d..81a933a 100644 --- a/src/templates/js/docs.js +++ b/src/templates/js/docs.js @@ -79,17 +79,10 @@ docsApp.directive.code = function() { docsApp.directive.sourceEdit = function(getEmbeddedTemplate) { return NG_DOCS.editExample ? { - template: '
' + - '' + - ' Edit ' + - '' + - '' + - '
', + template: '' + + ' Edit in Plunkr', scope: true, - controller: function($scope, $attrs, openJsFiddle, openPlunkr) { + controller: function($scope, $attrs, openPlunkr) { var sources = { module: $attrs.sourceEdit, deps: read($attrs.sourceEditDeps), @@ -99,10 +92,6 @@ docsApp.directive.sourceEdit = function(getEmbeddedTemplate) { unit: read($attrs.sourceEditUnit), scenario: read($attrs.sourceEditScenario) }; - $scope.fiddle = function(e) { - e.stopPropagation(); - openJsFiddle(sources); - }; $scope.plunkr = function(e) { e.stopPropagation(); openPlunkr(sources); @@ -204,46 +193,6 @@ docsApp.serviceFactory.openPlunkr = function(templateMerge, formPostData, loaded }; }; -docsApp.serviceFactory.openJsFiddle = function(templateMerge, formPostData, loadedUrls) { - - var HTML = '
\n{{html:2}}
', - SCRIPT_CACHE = '\n\n\n'; - - return function(content) { - var prop = { - module: content.module, - html: '', - css: '', - script: '' - }; - - angular.forEach(content.html, function(file, index) { - if (index) { - prop.html += templateMerge(SCRIPT_CACHE, file); - } else { - prop.html += file.content; - } - }); - - angular.forEach(content.js, function(file, index) { - prop.script += file.content; - }); - - angular.forEach(content.css, function(file, index) { - prop.css += file.content; - }); - - formPostData("http://jsfiddle.net/api/post/library/pure/dependencies/more/", { - title: 'AngularJS Example', - html: templateMerge(HTML, prop), - js: prop.script, - css: prop.css, - resources: loadedUrls.base.join(','), - wrap: 'b' - }); - }; -}; - docsApp.serviceFactory.sections = function serviceFactory() { var sections = {