Change truncate to JS

Might not work, leaving work right now.  Move JS to external JS file?