whimsical-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ru...@apache.org
Subject [whimsy] branch master updated: hotlink agenda links in backchannel
Date Sat, 16 Jun 2018 22:48:50 GMT
This is an automated email from the ASF dual-hosted git repository.

rubys pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/whimsy.git


The following commit(s) were added to refs/heads/master by this push:
     new 73b4227  hotlink agenda links in backchannel
73b4227 is described below

commit 73b42275330b2cd8797275ee759f573f552832ff
Author: Sam Ruby <rubys@intertwingly.net>
AuthorDate: Sat Jun 16 18:48:25 2018 -0400

    hotlink agenda links in backchannel
---
 www/board/agenda/views/pages/backchannel.js.rb | 15 ++++++++++++++-
 1 file changed, 14 insertions(+), 1 deletion(-)

diff --git a/www/board/agenda/views/pages/backchannel.js.rb b/www/board/agenda/views/pages/backchannel.js.rb
index 08b2d2c..6e3b5f5 100644
--- a/www/board/agenda/views/pages/backchannel.js.rb
+++ b/www/board/agenda/views/pages/backchannel.js.rb
@@ -44,7 +44,9 @@ class Backchannel < Vue
               if message.link
                 _Link text: message.text, href: message.link
               else
-                _Text raw: message.text, filters: [hotlink, self.mention]
+                filters = [hotlink, self.mention]
+                filters << self.agenda_link if message.type == :agenda
+                _Text raw: message.text, filters: filters
               end
             end
             i += 1
@@ -61,6 +63,17 @@ class Backchannel < Vue
     end
   end
 
+  # link agenda pages
+  def agenda_link(text)
+    Agenda.index.each do |item|
+      text.gsub!(item.title) do |match|
+        "<a href='#{item.title.gsub(/[\W]/, '-')}'>#{item.title}</a>"
+      end
+    end
+
+    return text
+  end
+
   # on initial display, fetch backlog
   def mounted()
     Main.scrollTo = -1

-- 
To stop receiving notification emails like this one, please contact
rubys@apache.org.

Mime
View raw message