diff --git a/fluffy/static/js/paste-inline.js b/fluffy/static/js/paste-inline.js
index 3cc389b..73e55d0 100644
--- a/fluffy/static/js/paste-inline.js
+++ b/fluffy/static/js/paste-inline.js
@@ -91,7 +91,23 @@ function updateSelectedHash(selected) {
}
$(document).ready(function() {
- var numbers = $('.line-numbers > a');
+
+ $("#do_word_wrap").click(function () {
+ let text_to_wrap = $(".highlight").find('pre');
+ if (text_to_wrap.css('white-space')==="pre") {
+ text_to_wrap.css('white-space', 'break-spaces');
+ } else {
+ text_to_wrap.css('white-space', '');
+ }
+ });
+
+ var numbers = $('.highlight > pre > span');
+ numbers.each(function (i) {
+ var data = $("
| ").text($(this).text());
+ var line_num = $(" | ").text(i);
+ $(this).html("");
+ $(this).append(line_num, data);
+ });
var setState = -1;
$(document).mouseup(function() {
setState = -1;
@@ -121,12 +137,13 @@ $(document).ready(function() {
}
var selected = selectedLines();
- var line = parseInt(el.text());
+ var line = parseInt(el.get(0).id.replace("line-", ""));
var idx = selected.indexOf(line);
if (idx === -1 && setState === 1) {
updateLineClasses(line, true);
selected.push(line);
+ console.log("##"+ selected);
updateSelectedHash(selected);
} else if (idx !== -1 && setState === 0) {
selected.splice(idx, 1);
@@ -138,7 +155,7 @@ $(document).ready(function() {
numbers.on('mousedown', function(e) {
var selected = selectedLines();
- var line = parseInt($(this).text());
+ var line = parseInt(this.id.replace("line-", ""));
setState = selected.indexOf(line) === -1 ? 1 : 0;
return maybeChangeState($(this));
});
diff --git a/fluffy/static/scss/app.scss b/fluffy/static/scss/app.scss
index 4bd3153..30c05d7 100644
--- a/fluffy/static/scss/app.scss
+++ b/fluffy/static/scss/app.scss
@@ -99,3 +99,7 @@ a.report {
.footer a:hover {
color: #89C2C7;
}
+
+.page-paste #paste .text .highlight > pre > span::before {
+ content: attr(line-number);
+}
diff --git a/fluffy/templates/home.html b/fluffy/templates/home.html
index 83a072d..a8db29e 100644
--- a/fluffy/templates/home.html
+++ b/fluffy/templates/home.html
@@ -38,6 +38,11 @@
+
+
+
+
+