Skip to content
This repository was archived by the owner on Feb 26, 2024. It is now read-only.

Commit

Permalink
fix: restore copyright notice and remove unused deps for examples
Browse files Browse the repository at this point in the history
Closes #188
  • Loading branch information
Narretz authored and petebacondarwin committed Feb 11, 2016
1 parent fef352d commit 227bcd8
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 4 deletions.
5 changes: 1 addition & 4 deletions src/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,7 @@ <h3>Server Communication</h3>
<div class="span8 app-source" app-source="project.html project.js list.html detail.html" resource="resource" route="route" firebase="firebase" annotate="project.annotation" module="project"></div>
<div class="span4">
<span hint></span>
<span class="pull-right" plnkr="project.html bootstrap.css list.html detail.html project.js project-list.js" resource="resource" route="route" firebase="firebase" module="project"></span>
<span class="pull-right" plnkr="project.html list.html detail.html project.js project-list.js" resource="resource" route="route" firebase="firebase" module="project"></span>
<div class="tabs-spacer"></div>
<!--[if lt IE 10]>
<div class="alert alert-error">
Expand Down Expand Up @@ -927,9 +927,6 @@ <h2>JavaScript Projects</h2>
}
});
</script>
<style type="text/css" id="bootstrap.css">
// Uncomment this in Plunker or JSFiddle: @import '//netdna.bootstrapcdn.com/twitter-bootstrap/2.0.4/css/bootstrap-combined.min.css';
</style>
<script type="text/ng-template" id="tabs.html">
<tabs>
<pane title="Localization">
Expand Down
20 changes: 20 additions & 0 deletions src/js/homepage.js
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,12 @@ angular.module('homepage', ['ngAnimate', 'ui.bootstrap', 'download-data'])
}])

.factory('templateBuilder', function(script) {
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-->';

return {
createLocalDependencies: function(files) {
var head = [];
Expand Down Expand Up @@ -150,6 +156,18 @@ angular.module('homepage', ['ngAnimate', 'ui.bootstrap', 'download-data'])
'__BODY__' +
' </body>\n' +
'</html>';
},
getCopyright: function(filename) {
switch (filename.substr(filename.lastIndexOf('.'))) {
case '.html':
return COPYRIGHT_HTML;
case '.js':
case '.css':
return COPYRIGHT_JS_CSS;
case '.md':
return COPYRIGHT;
}
return '';
}
};
})
Expand Down Expand Up @@ -316,6 +334,8 @@ angular.module('homepage', ['ngAnimate', 'ui.bootstrap', 'download-data'])
content = fetchCode(filename);
}

content += templateBuilder.getCopyright(filename);

plnkrFiles.push({
name: index === 0 ? 'index.html' : filename, // plnkr expects an index.html
content: content
Expand Down

0 comments on commit 227bcd8

Please sign in to comment.