From f56125d94efba462869f09064dfa39aa780b8016 Mon Sep 17 00:00:00 2001 From: Matias Niemelä Date: Tue, 4 Jun 2013 19:05:50 -0400 Subject: chore(ngdocs): setup bower as the package manager for the docs pages --- .../angular-bootstrap/bootstrap-prettify.js | 290 +++++++++++++++++++++ docs/components/angular-bootstrap/bootstrap.js | 212 +++++++++++++++ 2 files changed, 502 insertions(+) create mode 100644 docs/components/angular-bootstrap/bootstrap-prettify.js create mode 100644 docs/components/angular-bootstrap/bootstrap.js (limited to 'docs/components/angular-bootstrap') diff --git a/docs/components/angular-bootstrap/bootstrap-prettify.js b/docs/components/angular-bootstrap/bootstrap-prettify.js new file mode 100644 index 00000000..cbe7b53f --- /dev/null +++ b/docs/components/angular-bootstrap/bootstrap-prettify.js @@ -0,0 +1,290 @@ +'use strict'; + +var directive = {}; +var service = { value: {} }; + +var DEPENDENCIES = { + 'angular.js': 'http://code.angularjs.org/' + angular.version.full + '/angular.min.js', + 'angular-resource.js': 'http://code.angularjs.org/' + angular.version.full + '/angular-resource.min.js', + 'angular-route.js': 'http://code.angularjs.org/' + angular.version.full + '/angular-route.min.js', + 'angular-sanitize.js': 'http://code.angularjs.org/' + angular.version.full + '/angular-sanitize.min.js', + 'angular-cookies.js': 'http://code.angularjs.org/' + angular.version.full + '/angular-cookies.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] += + '