Skip to content

Commit

Permalink
indents text in section
Browse files Browse the repository at this point in the history
  • Loading branch information
SkyBirdSoar committed Aug 13, 2014
1 parent 9ce054a commit 3f85a00
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
9 changes: 5 additions & 4 deletions mathpw/acknowledgements.html
Original file line number Diff line number Diff line change
Expand Up @@ -19,20 +19,21 @@
<script type="application/javascript">
$(document).ready(function() {
var heading = function(text) {
return "<span style='font-size:3em;'>" + text + "</span>";
return "<span style='font-size:3em;'>" + text + "</span>" + "\n" + "<p style='margin: -5px 0 -5px 30px;'>";
};

var parse = function(text) {
text = text.split(/\n/);
text = text.split("\n");
text[0] = heading(text[0]);
for (var i = 1; i < text.length; i++) {
if (text[i] == "") {
if (text[i].length == 1) { // somehow empty strings here have a length of 1 but its not a newline character or space.
text[i] = "</p>\n";
text[i + 1] = heading(text[i + 1]);
}

text[i] = text[i].replace(/((?:(?:https?|ftp):\/\/)(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z\u00a1-\uffff0-9]-*)*[a-z\u00a1-\uffff0-9]+)(?:\.(?:[a-z\u00a1-\uffff0-9]-*)*[a-z\u00a1-\uffff0-9]+)*(?:\.(?:[a-z\u00a1-\uffff]{2,})))(?::\d{2,5})?(?:\/\S*)?)/ig, "<a href='$1'>$1</a>");
}
return text.join("<br>");
return text.join("<br>") + "\n</p>";
};

$.get('/mathpw/research/acknowledgements.txt', function(f) {
Expand Down
2 changes: 2 additions & 0 deletions mathpw/research/acknowledgements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ http://www.wolframalpha.com calculation
http://javascript.info/tutorial/number-math
http://google.com.sg *** AND GOOGLE CALCULATOR ***
https://gist.github.com/dperini/729294 url validation regex
http://www.javascriptkit.com/javatutors/determinevar2.shtml
https://developer.chrome.com/devtools/docs/console

Javascript utilities
http://jscompress.com compress scripts
Expand Down

0 comments on commit 3f85a00

Please sign in to comment.