Skip to content
Permalink
Browse files

docs(examples): add copyright and license info to each plunker file

Closes #13729
  • Loading branch information
petebacondarwin committed Jan 10, 2016
1 parent dd14e0c commit 8ccc0547a8838454300e2dc75bab7fafdf22d21f
Showing with 21 additions and 2 deletions.
  1. +21 −2 docs/app/src/examples.js
@@ -24,7 +24,26 @@ angular.module('examples', [])


.factory('openPlunkr', ['formPostData', '$http', '$q', function(formPostData, $http, $q) {
return function(exampleFolder, clickEvent) {

var COPYRIGHT = 'Copyright ' + (new Date()).getFullYear() + ' Google Inc. All Rights Reserved.\n'
+ 'Use of this source code is governed by an MIT-style license that\n'
+ 'can be found in the LICENSE file at http://angular.io/license';
var COPYRIGHT_JS_CSS = '\n\n/*\n' + COPYRIGHT + '\n*/';
var COPYRIGHT_HTML = '\n\n<!-- \n' + COPYRIGHT + '\n-->';
function getCopyright(filename) {
switch (filename.substr(filename.lastIndexOf('.'))) {
case '.html':
return COPYRIGHT_HTML;
case '.js':
case '.css':
return COPYRIGHT_JS_CSS;
case '.md':
return COPYRIGHT;
}
return '';
}

return function(exampleFolder, clickEvent) {

var exampleName = 'AngularJS Example';
var newWindow = clickEvent.ctrlKey || clickEvent.metaKey;
@@ -67,7 +86,7 @@ angular.module('examples', [])
var postData = {};

angular.forEach(files, function(file) {
postData['files[' + file.name + ']'] = file.content;
postData['files[' + file.name + ']'] = file.content + getCopyright(file.name);
});

postData['tags[0]'] = "angularjs";

0 comments on commit 8ccc054

Please sign in to comment.
You can’t perform that action at this time.