From 287d0536213783c778a69fc9a28ba8b819384156 Mon Sep 17 00:00:00 2001 From: WubTheCaptain Date: Sat, 19 Sep 2015 16:40:48 +0000 Subject: Wrap long lines to 80 characters in length String concatenation is used because line terminating characters are not allowed in the ECMAScript spec. Certain style guides such as Airbnb also endorse using string concatenation. --- js/pomf.js | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) (limited to 'js') diff --git a/js/pomf.js b/js/pomf.js index c1d89de..7375797 100644 --- a/js/pomf.js +++ b/js/pomf.js @@ -84,7 +84,8 @@ $(function() { if (files.size > MAX_SIZE) { uploadFiles.addClass('error'); - $('.file-name', totalRow).html('onii-chan y-your upload is t-too big…'); + $('.file-name', totalRow).html('onii-chan y-your upload is t-too ' + + 'big…'); return; } @@ -94,7 +95,8 @@ $(function() { var hits = {}; files.forEach(function(file) { ++hits[file.name] || (hits[file.name] = 0); - var row = $($('li[data-filename="' + escape(file.name) + '"]')[hits[file.name] || 0]); + var row = $($('li[data-filename="' + escape(file.name) + '"]') + + [hits[file.name] || 0]); fn.call(row, row, file, files); }); }; @@ -119,7 +121,8 @@ $(function() { var res = JSON.parse(res); if (!res.success) { uploadFiles.addClass('error'); - $('.file-name', totalRow).text('Something went wrong; try again later.'); + $('.file-name', totalRow).text('Something went wrong; try again ' + + 'later.'); break; } eachRow(res.files, function(row, file, files) { @@ -136,8 +139,10 @@ $(function() { break; case 413: uploadFiles.addClass('error completed'); - // Terrible work-around, but necessary since otherwise the '…' entity is left decoded - totalName.html($('
').html('onii-chan, y-your upload is t-too big…').text()); + // Terrible work-around, but necessary since otherwise the '…' + // entity is left decoded. + totalName.html($('
').html('onii-chan, y-your upload is t-too ' + + 'big…').text()); break; default: uploadFiles.addClass('error completed'); -- cgit v1.2.3