Skip to content

Commit be938eb

Browse files
authored
Merge branch 'master' into sticky
2 parents 84b95f8 + 731e464 commit be938eb

6 files changed

Lines changed: 67 additions & 35 deletions

File tree

.ruby-version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2.5.0
1+
2.5.1

.travis.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ env:
77
- NOKOGIRI_USE_SYSTEM_LIBRARIES=true
88
before_install:
99
- gem update --system
10+
- gem install bundler
1011
script:
1112
- ./build
1213
before_deploy:

Gemfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
ruby '2.5.0'
1+
ruby '2.5.1'
22

33
source 'https://rubygems.org'
44

Gemfile.lock

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@ GIT
88
GEM
99
remote: https://rubygems.org/
1010
specs:
11-
activesupport (5.1.5)
11+
activesupport (5.1.6)
1212
concurrent-ruby (~> 1.0, >= 1.0.2)
13-
i18n (~> 0.7)
13+
i18n (>= 0.7, < 2)
1414
minitest (~> 5.1)
1515
tzinfo (~> 1.1)
1616
addressable (2.5.2)
@@ -97,7 +97,7 @@ DEPENDENCIES
9797
uswds-jekyll!
9898

9999
RUBY VERSION
100-
ruby 2.5.0p0
100+
ruby 2.5.1p57
101101

102102
BUNDLED WITH
103103
1.16.1

_pages/getting-started.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ tree-nodes:
5656
- text: "No"
5757
link: contract
5858

59-
- title: ""
59+
- title: Contract Complete
6060
id: contract-complete
6161
content: |
6262
Since the project has been completed, you should have received final delivery. What's key now is how that delivery was made: did you receive all of the source code, including any testing resources, build artifacts, documentation, etc? Or did you only receive a final built product?
@@ -69,7 +69,7 @@ tree-nodes:
6969
7070
<a href='/how-to-open-source.html' class='usa-button'>How to Open Source</a>
7171
72-
- title: Two Options
72+
- title: Contract In-progress
7373
id: contract
7474
content: |
7575
You should **review your contract** to see how delivery of the final product is expected. What we'd like to see is that delivery will be of all source code, development operations and testing code and artifacts, build code and artifacts, etc. If the contractor is only expected to deliver a working product then you might not get access to the code at all.
@@ -80,7 +80,7 @@ tree-nodes:
8080
8181
There are a lot of possibilities within those options, however. We encourage you to read our [frequently asked questions](/frequently-asked-questions.html) and then reach out to us by email at [{{site.email}}](mailto:{{site.email}}) to continue the conversation.
8282
83-
- title: ""
83+
- title: Gov Only
8484
id: gov-only
8585
content: |
8686
Awesome! We're really happy to hear about all the great things that the DoD is doing on a regular basis. You may not be aware, but most code produced by a U.S. federal employee within the scope of their employment does not have copyright protections in the U.S. and certain foreign jurisdictions. In the U.S., creative works (like code) without copyright protections are sometimes referred to as "public domain." Not all countries recognize the concept of public domain, and many countries actually recognize copyright protections for code written by U.S. federal employees.
@@ -93,7 +93,7 @@ tree-nodes:
9393
9494
<a href='/how-to-open-source.html' class='usa-button'>How to Open Source</a>
9595
96-
- title: ""
96+
- title: Gov and Contractor
9797
id: mixed-code
9898
content: |
9999
Great! We understand that partnering with the private sector is how most project development happens in the DoD. You may still be able to open source the resulting code for the project depending on the U.S. federal government's data rights in the contract! The key is to **identify any pieces of the code that are proprietary to the contractor or otherwise restricted from public disclosure**. If there are such pieces then you may need to segment those so that you don't violate the license terms in the contract. That said, if you have Unlimited Rights in segregable portions of the code, you should be able to follow the Code.mil guideline for open sourcing that code!
@@ -106,7 +106,7 @@ tree-nodes:
106106
107107
<a href='/how-to-open-source.html' class='usa-button'>How to Open Source</a>
108108
109-
- title: ""
109+
- title: Not yet
110110
id: info-only
111111
content: |
112112
That's great! We're glad you are interested in open source. You may want to start by reading our [Why Open Source](/why-open-source.html) page and some of the [Frequently Asked Questions](/frequently-asked-questions.html). You can also explore information on the OMB policy itself over on the [Code.gov](https://code.gov) website.

assets/js/main.js

Lines changed: 56 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -82,46 +82,77 @@
8282
}
8383

8484
var nodes = find('.tree-node', tree);
85-
nodes[0].classList.add('active');
85+
var hashHistory = [];
8686

87+
// Pull tree history from hash
88+
function updateHashHistory() {
89+
hashHistory = window.location.hash.replace('#','').split('!');
90+
if (hashHistory.length == 1) {
91+
hashHistory = ["tree-node-start"];
92+
}
93+
}
94+
95+
// Update tree to reflect hash state
96+
function renderTree() {
97+
updateHashHistory();
98+
var treeNodes = nodes.filter(function(n) {
99+
return n.classList && n.classList.contains('tree-node');
100+
});
101+
for (var i = 0; i < treeNodes.length; i++) {
102+
var node = treeNodes[i];
103+
if (hashHistory.includes(node.getAttribute('id'))) {
104+
node.classList.add('active');
105+
} else {
106+
node.classList.remove('active');
107+
}
108+
var childNodes = Array.prototype.concat.apply([], node.childNodes);
109+
var childNode = childNodes.filter(function(n) {
110+
return n.classList && n.classList.contains('tree-node-options');
111+
})[0];
112+
if (!childNode) {
113+
continue;
114+
}
115+
if (hashHistory[hashHistory.length - 1] == node.getAttribute('id')) {
116+
childNode.classList.remove('hidden');
117+
} else {
118+
childNode.classList.add('hidden');
119+
}
120+
}
121+
if (hashHistory.length > 1) {
122+
var node = document.getElementById(hashHistory[hashHistory.length - 1]);
123+
node.scrollIntoView({
124+
behavior: "smooth"
125+
});
126+
}
127+
}
128+
129+
// Render tree as it is now
130+
renderTree();
131+
132+
// Re-render tree each time the hash changes
133+
window.addEventListener("hashchange", function() {
134+
renderTree();
135+
});
136+
137+
// Update hash each time the tree is clicked
87138
tree.addEventListener('click', function treeNodeButtonClick(e) {
88139
if (!e.target.classList.contains('tree-link')) {
89140
return;
90141
}
91-
92142
e.preventDefault();
93-
94143
var node = nodes.filter(function(n) {
95144
return n.getAttribute('id') === e.target.getAttribute('href').substr(1);
96145
})[0];
97146
if (node) {
98-
node.classList.add('active');
99-
node.scrollIntoView({
100-
behavior: "smooth"
101-
});
102-
var answer = document.createElement('p');
103-
answer.classList.add('tree-node-answer');
104-
answer.innerText = e.target.innerText;
105-
e.target.parentNode.parentNode.appendChild(answer);
106-
e.target.parentNode.classList.add('hidden');
147+
hashHistory.push(node.getAttribute('id'));
148+
window.location.hash = hashHistory.join("!");
107149
}
108150
});
109151

152+
// support reset
110153
tree.querySelector('a.tree-reset').addEventListener('click', function treeNodeButtonClick(e) {
111154
e.preventDefault();
112-
nodes.forEach(function(n, i) {
113-
if (i === 0) {
114-
return;
115-
}
116-
n.classList.remove('active');
117-
});
118-
find('.tree-node-options', tree).forEach(function(n) {
119-
n.classList.remove('hidden');
120-
});
121-
find('.tree-node-answer', tree).forEach(function(n) {
122-
n.parentNode.removeChild(n);
123-
});
155+
window.location.hash = "";
124156
});
125157
})();
126-
127158
})();

0 commit comments

Comments
 (0)