/** * @license AngularJS v1.0.0 * (c) 2010-2012 Google, Inc. http://angularjs.org * License: MIT */ (function(window, angular, undefined) { 'use strict'; var directive = {}; var service = { value: {} }; var DEPENDENCIES = { 'angular.js': 'http://code.angularjs.org/angular-' + angular.version.full + '.min.js', 'angular-resource.js': 'http://code.angularjs.org/angular-resource-' + angular.version.full + '.min.js', 'angular-sanitize.js': 'http://code.angularjs.org/angular-sanitize-' + angular.version.full + '.min.js', 'angular-cookies.js': 'http://code.angularjs.org/angular-cookies-' + angular.version.full + '.min.js' }; function escape(text) { return text. replace(/\&/g, '&'). replace(/\/g, '>'). replace(/"/g, '"'); } /** * http://stackoverflow.com/questions/451486/pre-tag-loses-line-breaks-when-setting-innerhtml-in-ie * http://stackoverflow.com/questions/195363/inserting-a-newline-into-a-pre-tag-ie-javascript */ function setHtmlIe8SafeWay(element, html) { var newElement = angular.element('
' + html + ''); element.html(''); element.append(newElement.contents()); return element; } directive.jsFiddle = function(getEmbeddedTemplate, escape, script) { return { terminal: true, link: function(scope, element, attr) { var name = '', stylesheet = '\n', fields = { html: '', css: '', js: '' }; angular.forEach(attr.jsFiddle.split(' '), function(file, index) { var fileType = file.split('.')[1]; if (fileType == 'html') { if (index == 0) { fields[fileType] += '