Skip to content
This repository was archived by the owner on Jun 27, 2022. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ More specifically...
* Click on the title node, so that Workflowy focuses on it (rather than e.g. its parents)
* Click the button on the toolbar to trigger your prototype download
* Save the zip and extract it, and your prototype is ready to go
* You can apply custom styling by modifying the included "custom.css"
* You can apply custom styling by renaming "custom.template.css" to "custom.css" and modifying as required.

## Demo

Expand Down Expand Up @@ -63,7 +63,7 @@ You will then be able to launch a single run of the tests from the command line
npm test
```
### Manual testing and debugging
Chrome extensions can be loaded in Google Chrome from the source code without having to be packaged:
Chrome extensions can be loaded in Google Chrome from the source code without having to be packaged:
* Go to chrome://extensions/
* Enable Developer Mode
* Click the 'Load unpacked extension...' button
Expand Down
4 changes: 2 additions & 2 deletions src/converter.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
async.series([
function (callback) {
addExistingFile(zip, chrome.extension.getURL('resources/stylesheets/style.css'), 'stylesheets/style.css', callback);
addExistingFile(zip, chrome.extension.getURL('resources/stylesheets/empty.css'), 'stylesheets/custom.css', callback);
addExistingFile(zip, chrome.extension.getURL('resources/stylesheets/empty.css'), 'stylesheets/custom.template.css', callback);
}
].concat(imageFileNames.map(function(imageFileName) {
return function (callback) {
Expand All @@ -42,4 +42,4 @@
callback(null, true);
});
}
}
}
4 changes: 2 additions & 2 deletions test/htmlGenerator.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ describe('outline', function() {
selected: false
}
]];
var expectedHtml = '<!doctype html><html><head><title>Footer - tag</title><link rel="stylesheet" href="../../stylesheets/style.css"></link><script>window.onload = function() {var body = document.body;var list = [].slice.call(document.querySelectorAll("a"));function getParameterByName(name) {name = name.replace(/[[]/, "\\[").replace(/[]]/, "\\]");var regex = new RegExp("[\\?&]" + name + "=([^&#]*)"),results = regex.exec(location.search);return results === null ? "" : decodeURIComponent(results[1].replace(/+/g, " "));}function addNotes() {body.classList.add("notes");list.forEach(function(link) { link.setAttribute("href", link.getAttribute("href") + "?showNotes=1"); });}function removeNotes() {body.classList.remove("notes");list.forEach(function(link) { link.setAttribute("href", link.getAttribute("href").replace("?showNotes=1", "")); });}if (location.href.indexOf("?showNotes=1") > -1) {addNotes();}document.onkeypress = function(e) {var spaceKeyCode = 32;if (e.keyCode == spaceKeyCode && e.shiftKey) {if (body.classList.contains("notes")) {removeNotes();} else {addNotes();}}return false;};}</script></head><body><h1>Site Title</h1><div class="mainNav"><a href="../../home.html" class="selected">Home</a><a href="../../section.html">Section</a></div><div class="localNav"><a href="../top.html" class="selected">Top</a><a href="../footertag.html">Footer - tag</a></div><div class="placeholder content-block-level-2"><h2>Something - or other</h2><span class="note"></span></div><div class="placeholder content-block-level-2"><h2>TV � Quarterly Reach / Share / Av Time</h2><span class="note"></span></div></body></html>';
var expectedHtml = '<!doctype html><html><head><title>Footer - tag</title><link rel="stylesheet" href="../../stylesheets/style.css"></link><link rel="stylesheet" href="../../stylesheets/custom.css"></link><script>window.onload = function() {var body = document.body;var list = [].slice.call(document.querySelectorAll("a"));function getParameterByName(name) {name = name.replace(/[[]/, "\\[").replace(/[]]/, "\\]");var regex = new RegExp("[\\?&]" + name + "=([^&#]*)"),results = regex.exec(location.search);return results === null ? "" : decodeURIComponent(results[1].replace(/+/g, " "));}function addNotes() {body.classList.add("notes");list.forEach(function(link) { link.setAttribute("href", link.getAttribute("href") + "?showNotes=1"); });}function removeNotes() {body.classList.remove("notes");list.forEach(function(link) { link.setAttribute("href", link.getAttribute("href").replace("?showNotes=1", "")); });}if (location.href.indexOf("?showNotes=1") > -1) {addNotes();}document.onkeypress = function(e) {var spaceKeyCode = 32;if (e.keyCode == spaceKeyCode && e.shiftKey) {if (body.classList.contains("notes")) {removeNotes();} else {addNotes();}}return false;};}</script></head><body><h1>Site Title</h1><div class="mainNav"><a href="../../home.html" class="selected">Home</a><a href="../../section.html">Section</a></div><div class="localNav"><a href="../top.html" class="selected">Top</a><a href="../footertag.html">Footer - tag</a></div><div class="placeholder content-block-level-2"><h2>Something - or other</h2><span class="note"></span></div><div class="placeholder content-block-level-2"><h2>TV � Quarterly Reach / Share / Av Time</h2><span class="note"></span></div></body></html>';

describe('generate', function() {
it('returns the correct HTML', function() {
Expand All @@ -50,4 +50,4 @@ describe('outline', function() {
expect(result).toEqual(expectedHtml);
});
});
});
});