From e7c1850247b48e8446c144d835fe6a4a1a67d9c3 Mon Sep 17 00:00:00 2001 From: Byron Jones Date: Wed, 15 May 2013 23:34:22 +0800 Subject: Bug 821889: Make it so that Splinter shouts loudly when a patch introduces Windows line endings --- extensions/Splinter/Extension.pm | 1 + .../Splinter/template/en/default/pages/splinter.html.tmpl | 3 ++- extensions/Splinter/web/splinter.css | 2 +- extensions/Splinter/web/splinter.js | 10 +++++++--- 4 files changed, 11 insertions(+), 5 deletions(-) (limited to 'extensions/Splinter') diff --git a/extensions/Splinter/Extension.pm b/extensions/Splinter/Extension.pm index ecf61ea9a..eef9e89af 100644 --- a/extensions/Splinter/Extension.pm +++ b/extensions/Splinter/Extension.pm @@ -76,6 +76,7 @@ sub page_before_template { $vars->{'attach_id'} = $attachment->id; $vars->{'attach_data'} = $attachment->data; + $vars->{'attach_is_crlf'} = $attachment->{data} =~ /\012\015/ ? 1 : 0; } my $field_object = new Bugzilla::Field({ name => 'attachments.status' }); diff --git a/extensions/Splinter/template/en/default/pages/splinter.html.tmpl b/extensions/Splinter/template/en/default/pages/splinter.html.tmpl index fc4748548..fa6fd8316 100644 --- a/extensions/Splinter/template/en/default/pages/splinter.html.tmpl +++ b/extensions/Splinter/template/en/default/pages/splinter.html.tmpl @@ -99,6 +99,7 @@ attachment.isPatch = [% attachment.ispatch ? 1 : 0 %]; attachment.isObsolete = [% attachment.isobsolete ? 1 : 0 %]; attachment.isPrivate = [% attachment.isprivate ? 1 : 0 %]; + attachment.isCRLF = [% attach_is_crlf FILTER none %]; theBug.attachments.push(attachment); [% END %] @@ -129,7 +130,7 @@