Skip to content

Commit

Permalink
Open license in a modal window instead of linking to GitHub
Browse files Browse the repository at this point in the history
LICENSE.md is already bundled with the distribution. So, the license text
is grabbed from the root of the dist/ folder. Because the LICENSE.md is not
in the content root during development, the connect server configuration in
Gruntfile.js had to be modified to handle the /LICENSE.md route.

Closes #123
  • Loading branch information
neelabhg committed Nov 12, 2015
1 parent e0d742e commit 4c36788
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 4 deletions.
3 changes: 2 additions & 1 deletion Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,8 @@ module.exports = function (grunt) {
return [
serveStatic('.tmp'),
connect().use('/bower_components', serveStatic('./bower_components')),
serveStatic(config.app)
serveStatic(config.app),
connect().use('/LICENSE.md', serveStatic('./LICENSE.md')),
];
},
livereload: false
Expand Down
31 changes: 29 additions & 2 deletions app/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,11 @@ <h3 style="display: inline" data-bind="with: currentSection"><span data-bind="te
<div class="footer">
<div class="container">
<p class="text-muted">
<img width="12px" src="images/imark_bold.gif" alt="University of Illinois icon"><small>&nbsp;Copyright &copy; 2015 The Board of Trustees at the University of Illinois. <a target="_blank" href="https://github.com/cs-education/sysbuild/blob/master/LICENSE.md">Attribution and legal information</a></small>
<img width="12px" src="images/imark_bold.gif" alt="University of Illinois icon">
<small>
<span>&nbsp;Copyright &copy; 2015 The Board of Trustees at the University of Illinois.</span>
<a href="#" data-toggle="modal" data-target="#project-license-window">Attribution and legal information</a>
</small>
</p>
</div>
</div>
Expand Down Expand Up @@ -311,7 +315,13 @@ <h3 id="video-search-title">Search Video</h3>
</div>
</div>
<div class="container col-sm-6 pull-right">
<p class="text-muted pull-right"><img width="12px" src="images/imark_bold.gif" alt="University of Illinois icon"><small>&nbsp;Copyright &copy; 2015 The Board of Trustees at the University of Illinois. <a target="_blank" href="https://github.com/cs-education/sysbuild/blob/master/LICENSE.md">Attribution and legal information</a></small></p>
<p class="text-muted pull-right">
<img width="12px" src="images/imark_bold.gif" alt="University of Illinois icon">
<small>
<span>&nbsp;Copyright &copy; 2015 The Board of Trustees at the University of Illinois.</span>
<a href="#" data-toggle="modal" data-target="#project-license-window">Attribution and legal information</a>
</small>
</p>
</div>
</div>
</div>
Expand All @@ -334,6 +344,23 @@ <h4 class="modal-title" id="gcc-error-label" data-bind="html: errorWarningLabel"
</div>
</div>
</div>

<!-- Project License Modal -->
<div class="modal fade" id="project-license-window" tabindex="-1" role="dialog" aria-labelledby="project-license-window-title" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button>
<h4 class="modal-title" id="project-license-window-title">Attribution and legal information</h4>
<span>(<a target="_blank" href="https://github.com/cs-education/sysbuild/blob/master/LICENSE.md">See latest project license on GitHub</a>)</span>
</div>
<div class="modal-body" data-bind="html: projectLicense"></div>
<div class="modal-footer">
<button type="button" class="btn btn-primary" data-dismiss="modal">Close</button>
</div>
</div>
</div>
</div>
</div><!--/.show-if-supported -->

<!-- ==================== Javascript ==================== -->
Expand Down
7 changes: 6 additions & 1 deletion app/scripts/sys-view-model.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* global ko, $, SysRuntime */
/* global ko, $, marked, SysRuntime */

window.SysViewModel = (function () {
'use strict';
Expand Down Expand Up @@ -206,6 +206,11 @@ window.SysViewModel = (function () {
});

self.playGroundNavPagerVisible = ko.observable();

self.projectLicense = ko.observable();
$.get('LICENSE.md', function (data) {
self.projectLicense(marked(data));
});
}

SysViewModel.prototype.setSysPlayGroundState = function (state) {
Expand Down

0 comments on commit 4c36788

Please sign in to comment.