Title: [236890] trunk/Websites/bugs.webkit.org
Revision
236890
Author
jer.no...@apple.com
Date
2018-10-05 17:02:48 -0700 (Fri, 05 Oct 2018)

Log Message

Radar links should be clickable on bugs.webkit.org
https://bugs.webkit.org/show_bug.cgi?id=190293
<rdar://problem/45020184>

Reviewed by Lucas Forschler.

Add a new Extension which formats bug comments and makes radar:// links clickable.

* extensions/Radar/Config.pm: Added.
* extensions/Radar/Extension.pm: Added.
(bug_format_comment):
(_replace_radar):

Modified Paths

Added Paths

Diff

Modified: trunk/Websites/bugs.webkit.org/ChangeLog (236889 => 236890)


--- trunk/Websites/bugs.webkit.org/ChangeLog	2018-10-05 22:26:49 UTC (rev 236889)
+++ trunk/Websites/bugs.webkit.org/ChangeLog	2018-10-06 00:02:48 UTC (rev 236890)
@@ -1,3 +1,18 @@
+2018-10-05  Jer Noble  <jer.no...@apple.com>
+
+        Radar links should be clickable on bugs.webkit.org
+        https://bugs.webkit.org/show_bug.cgi?id=190293
+        <rdar://problem/45020184>
+
+        Reviewed by Lucas Forschler.
+
+        Add a new Extension which formats bug comments and makes radar:// links clickable.
+
+        * extensions/Radar/Config.pm: Added.
+        * extensions/Radar/Extension.pm: Added.
+        (bug_format_comment):
+        (_replace_radar):
+
 2018-08-23  Ross Kirsling  <ross.kirsl...@sony.com>
 
         EWS bubbles are being hidden due to lack of space.

Added: trunk/Websites/bugs.webkit.org/extensions/Radar/Config.pm (0 => 236890)


--- trunk/Websites/bugs.webkit.org/extensions/Radar/Config.pm	                        (rev 0)
+++ trunk/Websites/bugs.webkit.org/extensions/Radar/Config.pm	2018-10-06 00:02:48 UTC (rev 236890)
@@ -0,0 +1,32 @@
+# Copyright (C) 2018 Apple Inc. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1.  Redistributions of source code must retain the above copyright
+#     notice, this list of conditions and the following disclaimer.
+# 2.  Redistributions in binary form must reproduce the above copyright
+#     notice, this list of conditions and the following disclaimer in the
+#     documentation and/or other materials provided with the distribution.
+#
+# THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY
+# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+# DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY
+# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+# ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+package Bugzilla::Extension::Radar;
+
+use strict;
+use warnings;
+
+use constant NAME => "Radar";
+use constant REQUIRED_MODULES => [];
+use constant OPTIONAL_MODULES => [];
+
+__PACKAGE__->NAME;

Added: trunk/Websites/bugs.webkit.org/extensions/Radar/Extension.pm (0 => 236890)


--- trunk/Websites/bugs.webkit.org/extensions/Radar/Extension.pm	                        (rev 0)
+++ trunk/Websites/bugs.webkit.org/extensions/Radar/Extension.pm	2018-10-06 00:02:48 UTC (rev 236890)
@@ -0,0 +1,52 @@
+# Copyright (C) 2018 Apple Inc. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1.  Redistributions of source code must retain the above copyright
+#     notice, this list of conditions and the following disclaimer.
+# 2.  Redistributions in binary form must reproduce the above copyright
+#     notice, this list of conditions and the following disclaimer in the
+#     documentation and/or other materials provided with the distribution.
+#
+# THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY
+# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+# DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY
+# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+# ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+package Bugzilla::Extension::Radar;
+
+use strict;
+use warnings;
+
+use parent qw(Bugzilla::Extension);
+
+use Bugzilla::Constants;
+use Bugzilla::Group;
+use Bugzilla::User;
+
+our $VERSION = "1.0.0";
+
+sub bug_format_comment {
+    my ($self, $args) = @_;
+        my $regexes = $args->{'regexes'};
+
+    # See: <https://radar.apple.com/information/urls.html> for Radar URI documentation
+    push(@$regexes, { match => qr/\b(r[a]?dar:\/\/[[:word:]-.~&\/=%:,]*)([-.~&%=:,]?)\b/, replace => \&_replace_radar });
+}
+
+sub _replace_radar {
+    my $args = shift;
+    my $radarURI = $args->{matches}->[0];
+    my $optionalPunctuation = $args->{matches}->[1];
+    return qq{<a href=""
+};
+
+# This must be the last line of your extension.
+__PACKAGE__->NAME;
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to